LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
#include <non-object-visitor.hh>
Public Types | |
typedef GenVisitor< Const > | super_type |
Super class type. |
Public Member Functions | |
virtual void | operator() (typename Const< Ast >::type &e) |
The entry point: visit e. | |
virtual void | operator() (typename Const< ArrayExp >::type &)=0 |
virtual void | operator() (typename Const< ArrayTy >::type &)=0 |
virtual void | operator() (typename Const< AssignExp >::type &)=0 |
virtual void | operator() (typename Const< BreakExp >::type &)=0 |
virtual void | operator() (typename Const< CallExp >::type &)=0 |
virtual void | operator() (typename Const< CastExp >::type &)=0 |
virtual void | operator() (typename Const< CastVar >::type &)=0 |
virtual void | operator() (typename Const< DecsList >::type &)=0 |
virtual void | operator() (typename Const< Field >::type &)=0 |
virtual void | operator() (typename Const< FieldInit >::type &)=0 |
virtual void | operator() (typename Const< FieldVar >::type &)=0 |
virtual void | operator() (typename Const< ForExp >::type &)=0 |
virtual void | operator() (typename Const< FunctionDec >::type &)=0 |
virtual void | operator() (typename Const< IfExp >::type &)=0 |
virtual void | operator() (typename Const< IntExp >::type &)=0 |
virtual void | operator() (typename Const< LetExp >::type &)=0 |
virtual void | operator() (typename Const< NameTy >::type &)=0 |
virtual void | operator() (typename Const< NilExp >::type &)=0 |
virtual void | operator() (typename Const< OpExp >::type &)=0 |
virtual void | operator() (typename Const< RecordExp >::type &)=0 |
virtual void | operator() (typename Const< RecordTy >::type &)=0 |
virtual void | operator() (typename Const< SeqExp >::type &)=0 |
virtual void | operator() (typename Const< SimpleVar >::type &)=0 |
virtual void | operator() (typename Const< StringExp >::type &)=0 |
virtual void | operator() (typename Const< SubscriptVar >::type &)=0 |
virtual void | operator() (typename Const< TypeDec >::type &)=0 |
virtual void | operator() (typename Const< VarDec >::type &)=0 |
virtual void | operator() (typename Const< WhileExp >::type &)=0 |
template<class E > | |
void | operator() (E *e) |
Helper to visit nodes manipulated via a pointer. | |
Ctor & dtor. | |
GenNonObjectVisitor () | |
Construct a non-object visitor. | |
virtual | ~GenNonObjectVisitor () |
Destroy a non-object visitor. | |
Object-related visits. | |
The methods should not be used, since this visitor is for the non-object flavor of the language. | |
virtual void | operator() (typename Const< ClassTy >::type &e) override |
virtual void | operator() (typename Const< MethodDecs >::type &e) override |
virtual void | operator() (typename Const< MethodDec >::type &e) override |
virtual void | operator() (typename Const< MethodCallExp >::type &e) override |
virtual void | operator() (typename Const< ObjectExp >::type &e) override |
Protected Member Functions | |
template<typename E > | |
void | accept (E *e) |
GenNonObjectVisitor<CONSTNESS-SELECTOR> provides aborting visit methods for object-related nodes. This class is meant to factor the code visiting object-related nodes in visitors bound to process AST without objects.
ast::GenNonObjectVisitor inherits virtually from ast::GenVisitor to allow diamond inheritance, notably for a ``compatibility'' purpose with ast::GenDefaultVisitor.
For instance, type::TypeChecker, a visitor that checks the types of an AST without objects, inherits from ast::DefaultVisitor to factor default (``empty'') traversal implementations, and from ast::NonObjectVisitor to get an aborting behavior for object-related nodes.
/ast::Visitor/ ^ (virtual) | (virtual) ,--------------+--------------. | | | | /ast::DefaultVisitor/ /ast::NonObjectVisitor/ ^ ^ | | `--------------+--------------' | | type::TypeChecker
typedef GenVisitor<Const> ast::GenNonObjectVisitor< Const >::super_type |
Super class type.
ast::GenNonObjectVisitor< Const >::GenNonObjectVisitor | ( | ) |
Construct a non-object visitor.
|
virtual |
Destroy a non-object visitor.
|
protectedinherited |
A convenient shortcut for recurring code like this:
However, the drawback of this approach is that it doesn't take care of the constness, and any const violation will be reported within the body of this method, not at its corresponding call site.
We cannot use the misc/select_const.hh approach here, since the compiler cannot resolve a function overloaded or specialized on an associated type of a template. E.g., writing accept like this:
won't work directly. Of course, one can help the compiler, providing it with E
but this is painful.
|
virtualinherited |
The entry point: visit e.
Reimplemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
pure virtualinherited |
Implemented in ast::GenDefaultVisitor< Const >.
|
overridevirtual |
Implements ast::GenVisitor< Const >.
References unreached.
|
inherited |
Helper to visit nodes manipulated via a pointer.
|
overridevirtual |
Implements ast::GenVisitor< Const >.
References unreached.
|
overridevirtual |
Implements ast::GenVisitor< Const >.
References unreached.
|
overridevirtual |
Implements ast::GenVisitor< Const >.
References unreached.
|
overridevirtual |
Implements ast::GenVisitor< Const >.
References unreached.