* src/ltlast/atomic_prop.hh, src/ltlast/binop.hh,

src/ltlast/constant.hh, src/ltlast/formula.hh,
src/ltlast/multop.hh, src/ltlast/unop.hh, src/ltlast/visitor.hh,
src/ltlenv/defaultenv.hh, src/ltlenv/environment.hh,
src/ltlparse/public.hh, src/ltlvisit/clone.hh,
src/ltlvisit/dotty.hh, src/ltlvisit/dump.hh,
src/ltlvisit/equals.hh, src/ltlvisit/lunabbrev.hh,
src/ltlvisit/nenoform.hh, src/ltlvisit/tunabbrev.hh: Add
Doxygen comments.
* src/visitor.hh: Do not use const_sel.  This clarify
the code and helps Doxygen.
This commit is contained in:
Alexandre Duret-Lutz 2003-04-18 15:02:55 +00:00
parent 4b8b02e811
commit d35817ccd9
19 changed files with 239 additions and 51 deletions

View file

@ -2,29 +2,44 @@
# define SPOT_LTLAST_VISITOR_HH
#include "predecl.hh"
#include "misc/const_sel.hh"
namespace spot {
namespace ltl {
template <bool WantConst>
struct generic_visitor
/// \brief Formula visitor that can modify the formula.
///
/// Writing visitors is the prefered way
/// to traverse a formula, since it doesn't
/// involve any cast.
///
/// If you do not need to modify the visited formula, inherit from
/// spot::ltl:const_visitor instead.
struct visitor
{
virtual void visit(typename const_sel<atomic_prop, WantConst>::t* node)
= 0;
virtual void visit(typename const_sel<constant, WantConst>::t* node)
= 0;
virtual void visit(typename const_sel<binop, WantConst>::t* node) = 0;
virtual void visit(typename const_sel<unop, WantConst>::t* node) = 0;
virtual void visit(typename const_sel<multop, WantConst>::t* node) = 0;
virtual void visit(atomic_prop* node) = 0;
virtual void visit(constant* node) = 0;
virtual void visit(binop* node) = 0;
virtual void visit(unop* node) = 0;
virtual void visit(multop* node) = 0;
};
/// \brief Formula visitor that cannot modify the formula.
///
/// Writing visitors is the prefered way
/// to traverse a formula, since it doesn't
/// involve any cast.
///
/// If you want to modify the visited formula, inherit from
/// spot::ltl:visitor instead.
struct const_visitor
{
virtual void visit(const atomic_prop* node) = 0;
virtual void visit(const constant* node) = 0;
virtual void visit(const binop* node) = 0;
virtual void visit(const unop* node) = 0;
virtual void visit(const multop* node) = 0;
};
struct visitor : public generic_visitor<false> {};
struct const_visitor : public generic_visitor<true> {};
}
}