Template ltlast/ & ltlenv/ classes in internal/ & Add ELTL parser.

This commit is contained in:
Damien Lefortier 2008-03-25 16:52:06 +01:00 committed by Damien Lefortier
parent 21c98c0a01
commit 543190f2bc
74 changed files with 4299 additions and 468 deletions

View file

@ -1,4 +1,4 @@
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// Copyright (C) 2008 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
@ -27,8 +27,8 @@
#ifndef SPOT_LTLAST_BINOP_HH
# define SPOT_LTLAST_BINOP_HH
#include <map>
#include "refformula.hh"
# include "formula.hh"
# include "internal/binop.hh"
namespace spot
{
@ -37,53 +37,7 @@ namespace spot
/// \brief Binary operator.
/// \ingroup ltl_ast
class binop : public ref_formula
{
public:
/// Different kinds of binary opertaors
///
/// And and Or are not here. Because they
/// are often nested we represent them as multops.
enum type { Xor, Implies, Equiv, U, R };
/// Build an unary operator with operation \a op and
/// children \a first and \a second.
static binop* instance(type op, formula* first, formula* second);
virtual void accept(visitor& v);
virtual void accept(const_visitor& v) const;
/// Get the first operand.
const formula* first() const;
/// Get the first operand.
formula* first();
/// Get the second operand.
const formula* second() const;
/// Get the second operand.
formula* second();
/// Get the type of this operator.
type op() const;
/// Get the type of this operator, as a string.
const char* op_name() const;
/// Number of instantiated binary operators. For debugging.
static unsigned instance_count();
protected:
typedef std::pair<formula*, formula*> pairf;
typedef std::pair<type, pairf> pair;
typedef std::map<pair, formula*> map;
static map instances;
binop(type op, formula* first, formula* second);
virtual ~binop();
private:
type op_;
formula* first_;
formula* second_;
};
typedef spot::internal::binop<ltl_t> binop;
}
}