7 # define AST_VISITOR_HH
19 template <
template <
typename>
class Const>
30 virtual void operator()(
typename Const<Ast>::type& e);
31 virtual void operator()(
typename Const<ArrayExp>::type&) = 0;
32 virtual void operator()(
typename Const<ArrayTy>::type&) = 0;
33 virtual void operator()(
typename Const<AssignExp>::type&) = 0;
34 virtual void operator()(
typename Const<BreakExp>::type&) = 0;
35 virtual void operator()(
typename Const<CallExp>::type&) = 0;
36 virtual void operator()(
typename Const<CastExp>::type&) = 0;
37 virtual void operator()(
typename Const<CastVar>::type&) = 0;
38 virtual void operator()(
typename Const<ClassTy>::type&) = 0;
39 virtual void operator()(
typename Const<DecsList>::type&) = 0;
40 virtual void operator()(
typename Const<Field>::type&) = 0;
41 virtual void operator()(
typename Const<FieldInit>::type&) = 0;
42 virtual void operator()(
typename Const<FieldVar>::type&) = 0;
43 virtual void operator()(
typename Const<ForExp>::type&) = 0;
44 virtual void operator()(
typename Const<FunctionDec>::type&) = 0;
45 virtual void operator()(
typename Const<IfExp>::type&) = 0;
46 virtual void operator()(
typename Const<IntExp>::type&) = 0;
47 virtual void operator()(
typename Const<LetExp>::type&) = 0;
48 virtual void operator()(
typename Const<MethodCallExp>::type&) = 0;
49 virtual void operator()(
typename Const<MethodDec>::type&) = 0;
50 virtual void operator()(
typename Const<NameTy>::type&) = 0;
51 virtual void operator()(
typename Const<NilExp>::type&) = 0;
52 virtual void operator()(
typename Const<ObjectExp>::type&) = 0;
53 virtual void operator()(
typename Const<OpExp>::type&) = 0;
54 virtual void operator()(
typename Const<RecordExp>::type&) = 0;
55 virtual void operator()(
typename Const<RecordTy>::type&) = 0;
56 virtual void operator()(
typename Const<SeqExp>::type&) = 0;
57 virtual void operator()(
typename Const<SimpleVar>::type&) = 0;
58 virtual void operator()(
typename Const<StringExp>::type&) = 0;
59 virtual void operator()(
typename Const<SubscriptVar>::type&) = 0;
60 virtual void operator()(
typename Const<TypeDec>::type&) = 0;
61 virtual void operator()(
typename Const<VarDec>::type&) = 0;
62 virtual void operator()(
typename Const<WhileExp>::type&) = 0;
64 virtual void operator()(
typename Const<FunctionDecs>::type&) = 0;
65 virtual void operator()(
typename Const<MethodDecs>::type&) = 0;
66 virtual void operator()(
typename Const<TypeDecs>::type&) = 0;
67 virtual void operator()(
typename Const<VarDecs>::type&) = 0;
103 template <
typename E>
107 # define VISITOR_VISIT_NODE_(Z, N, Array) \
108 virtual void operator()(ast::BOOST_PP_ARRAY_ELEM(N, Array)& e);
110 # define VISITOR_VISIT_NODES(Nodes) \
111 BOOST_PP_REPEAT(BOOST_PP_ARRAY_SIZE(Nodes), \
112 VISITOR_VISIT_NODE_, \
118 typedef GenVisitor<misc::id_traits>
Visitor;
124 #endif // !AST_VISITOR_HH