Synopsis - Synopsis/PTree/Visitor.hh Details

# Synopsis/PTree/Visitor.hh

source code

## Includes from this file:

- include Synopsis/PTree/NodesFwd.hh

## Declarations in this file:

### Classes in Synopsis::PTree

Visitor

The Visitor class is used to dynamically resolve type information about a given Node.

### Member functions in Synopsis::PTree::Visitor

visit(AccessDecl*)
visit(AccessSpec*)
visit(ArrayExpr*)

<postfix> [ <expr> ]

visit(ArrowMemberExpr*)

[ postfix -> name ]

visit(AssignExpr*)

[left = right]

visit(Atom*)
visit(Block*)

[ { [ <statement>* ] } ]

visit(Brace*)

[ { [ <statement>* ] } ]

visit(BreakStatement*)

[ break ; ]

visit(CaseStatement*)

[ case expr : [expr] ]

visit(CastExpr*)

( type-expr ) expr ..type-expr is type encoded

visit(ClassBody*)
visit(ClassSpec*)
visit(CommentedAtom*)
visit(CondExpr*)
visit(ContinueStatement*)
visit(Declaration*)

One of:

visit(Declarator*)

[ [ declarator { = <expr> } ] , ...

visit(DefaultStatement*)

[ default : [expr] ]

visit(DeleteExpr*)

[ delete [expr] ]

visit(DoStatement*)

[ do [{ ...

visit(DotMemberExpr*)

[ postfix .

visit(DupAtom*)
visit(EnumSpec*)

[ enum [name] [{ [name [= value] ]* }] ]

visit(ExprStatement*)
visit(Expression*)

[ expr (, expr)* ]

visit(ExternTemplate*)
visit(ForStatement*)

[ for ( stmt expr ; expr ) statement ]

visit(FstyleCastExpr*)

[ [type] ( [expr] ) ]

visit(FuncallExpr*)

[ postfix ( args ) ]

visit(FunctionDefinition*)

Function definition: [ [modifiers] name declarator [ { ...

visit(GotoStatement*)
visit(Identifier*)
visit(IfStatement*)

[ if ( expr ) statement (else statement)? ]

visit(InfixExpr*)

[left op right]

visit(Keyword*)
visit(Kwd::Auto*)
visit(Kwd::Bool*)
visit(Kwd::Break*)
visit(Kwd::Case*)
visit(Kwd::Catch*)
visit(Kwd::Char*)
visit(Kwd::Class*)
visit(Kwd::Const*)
visit(Kwd::Continue*)
visit(Kwd::Default*)
visit(Kwd::Delete*)
visit(Kwd::Do*)
visit(Kwd::Double*)
visit(Kwd::Else*)
visit(Kwd::Extern*)
visit(Kwd::Float*)
visit(Kwd::For*)
visit(Kwd::Friend*)
visit(Kwd::Goto*)
visit(Kwd::If*)
visit(Kwd::Inline*)
visit(Kwd::Int*)
visit(Kwd::Long*)
visit(Kwd::Mutable*)
visit(Kwd::Namespace*)
visit(Kwd::New*)
visit(Kwd::Operator*)
visit(Kwd::Private*)
visit(Kwd::Protected*)
visit(Kwd::Public*)
visit(Kwd::Register*)
visit(Kwd::Return*)
visit(Kwd::Short*)
visit(Kwd::Signed*)
visit(Kwd::Static*)
visit(Kwd::Struct*)
visit(Kwd::Switch*)
visit(Kwd::Template*)
visit(Kwd::This*)
visit(Kwd::Throw*)
visit(Kwd::Try*)
visit(Kwd::Typedef*)
visit(Kwd::Typename*)
visit(Kwd::Union*)
visit(Kwd::Unsigned*)
visit(Kwd::Using*)
visit(Kwd::Virtual*)
visit(Kwd::Void*)
visit(Kwd::Volatile*)
visit(Kwd::WChar*)
visit(Kwd::While*)
visit(LabelStatement*)
visit(LinkageSpec*)

[ extern ["C++"] [{ body }] ]

visit(List*)
visit(Literal*)
visit(MetaclassDecl*)
visit(Name*)
visit(NamespaceAlias*)

[ namespace Foo = Bar ; ]

visit(NamespaceSpec*)

[ namespace <identifier> [{ body }] ]

visit(NewExpr*)
visit(Node*)
visit(OffsetofExpr*)
visit(ParameterDeclaration*)

One of:

visit(ParenExpr*)

[ ( expr ) ]

visit(PmExpr*)
visit(PostfixExpr*)

[ expr ++ ]

visit(ReturnStatement*)
visit(SizeofExpr*)

[ sizeof ( [type [???] ] ) ]

visit(SwitchStatement*)

[ switch ( expr ) statement ]

visit(TemplateDecl*)

[ template < [types] > [decl] ]

visit(TemplateInstantiation*)
visit(ThrowExpr*)

[ throw [expr] ]

visit(TryStatement*)

[ try [{}] [catch ( arg ) [{}] ]* ]

visit(TypeParameter*)

One of:

visit(Typedef*)
visit(TypeidExpr*)
visit(TypeofExpr*)
visit(UnaryExpr*)

[op expr]

visit(UserAccessSpec*)
visit(UsingDeclaration*)

[ using Foo :: x ; ]

visit(UsingDirective*)

[ using namespace Foo ; ]

visit(WhileStatement*)

[ while ( expr ) statement ]

~Visitor()