namespace Synopsis::PTree
class Visitor
Visitor-inheritance Scopes/Synopsis/PTree/DotFileGenerator.html Scopes/Synopsis/PTree/Display.html Scopes/Synopsis/SymbolLookup/Walker.html Scopes/Synopsis/TypeAnalysis/ConstEvaluator.html Scopes/Synopsis/PTree/RTTIDisplay.html Scopes/Synopsis/PTree/Writer.html Scopes/Synopsis/PTree/TypeVisitor.html Scopes/Synopsis/TypeAnalysis/TypeEvaluator.html Scopes/Synopsis/SymbolLookup/Undefined.html

The Visitor class is used to dynamically resolve type information about a given Node. The default implementation does nothing, so you only need to implement the methods you actually need. Any types for which no corresponding 'visit' methods exist will be caught by the 'visit' of the closest parent.

Public Member functions Summary:
virtual destructor ~Visitor()
references
source code
virtual void visit(Node*)
references
source code
virtual void visit(Atom*)
references
source code
virtual void visit(List*)
references
source code
virtual void visit(Literal*)
references
source code
virtual void visit(CommentedAtom*)
references
source code
virtual void visit(DupAtom*)
references
source code
virtual void visit(Identifier*)
references
source code
virtual void visit(Keyword*)
references
source code
virtual void visit(Kwd::Auto*)
source code
virtual void visit(Kwd::Break*)
source code
virtual void visit(Kwd::Bool*)
source code
virtual void visit(Kwd::Case*)
source code
virtual void visit(Kwd::Catch*)
source code
virtual void visit(Kwd::Char*)
source code
virtual void visit(Kwd::Class*)
source code
virtual void visit(Kwd::Continue*)
source code
virtual void visit(Kwd::Const*)
source code
virtual void visit(Kwd::Default*)
source code
virtual void visit(Kwd::Delete*)
source code
virtual void visit(Kwd::Double*)
source code
virtual void visit(Kwd::Do*)
source code
virtual void visit(Kwd::Else*)
source code
virtual void visit(Kwd::Extern*)
source code
virtual void visit(Kwd::Float*)
source code
virtual void visit(Kwd::For*)
source code
virtual void visit(Kwd::Friend*)
source code
virtual void visit(Kwd::Goto*)
source code
virtual void visit(Kwd::Inline*)
source code
virtual void visit(Kwd::If*)
source code
virtual void visit(Kwd::Int*)
source code
virtual void visit(Kwd::Long*)
source code
virtual void visit(Kwd::Mutable*)
source code
virtual void visit(Kwd::Namespace*)
source code
virtual void visit(Kwd::New*)
source code
virtual void visit(Kwd::Operator*)
source code
virtual void visit(Kwd::Private*)
source code
virtual void visit(Kwd::Protected*)
source code
virtual void visit(Kwd::Public*)
source code
virtual void visit(Kwd::Register*)
source code
virtual void visit(Kwd::Return*)
source code
virtual void visit(Kwd::Short*)
source code
virtual void visit(Kwd::Signed*)
source code
virtual void visit(Kwd::Static*)
source code
virtual void visit(Kwd::Struct*)
source code
virtual void visit(Kwd::Switch*)
source code
virtual void visit(Kwd::Template*)
source code
virtual void visit(Kwd::This*)
source code
virtual void visit(Kwd::Throw*)
source code
virtual void visit(Kwd::Try*)
source code
virtual void visit(Kwd::Typedef*)
source code
virtual void visit(Kwd::Typename*)
source code
virtual void visit(Kwd::Union*)
source code
virtual void visit(Kwd::Unsigned*)
source code
virtual void visit(Kwd::Using*)
source code
virtual void visit(Kwd::Virtual*)
source code
virtual void visit(Kwd::Void*)
source code
virtual void visit(Kwd::Volatile*)
source code
virtual void visit(Kwd::WChar*)
source code
virtual void visit(Kwd::While*)
source code
virtual void visit(Brace*)
references
source code

[ { [ <statement>* ] } ]

virtual void visit(Block*)
references
source code

[ { [ <statement>* ] } ]

virtual void visit(ClassBody*)
references
source code
virtual void visit(Typedef*)
references
source code
virtual void visit(TemplateDecl*)
references
source code

[ template < [types] > [decl] ]

virtual void visit(TemplateInstantiation*)
references
source code
virtual void visit(ExternTemplate*)
references
source code
virtual void visit(MetaclassDecl*)
references
source code
virtual void visit(LinkageSpec*)
references
source code

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

virtual void visit(NamespaceSpec*)
references
source code

[ namespace <identifier> [{ body }] ]

virtual void visit(UsingDirective*)
references
source code

[ using namespace Foo ; ]

virtual void visit(Declaration*)
references
source code

One of:

virtual void visit(NamespaceAlias*)
references
source code

[ namespace Foo = Bar ; ]

virtual void visit(FunctionDefinition*)
references
source code

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

virtual void visit(ParameterDeclaration*)
references
source code

One of:

virtual void visit(UsingDeclaration*)
references
source code

[ using Foo :: x ; ]

virtual void visit(Declarator*)
references
source code

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

virtual void visit(Name*)
references
source code
virtual void visit(FstyleCastExpr*)
references
source code

[ [type] ( [expr] ) ]

virtual void visit(ClassSpec*)
references
source code
virtual void visit(EnumSpec*)
references
source code

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

virtual void visit(TypeParameter*)
references
source code

One of:

virtual void visit(AccessSpec*)
references
source code
virtual void visit(AccessDecl*)
references
source code
virtual void visit(UserAccessSpec*)
references
source code
virtual void visit(IfStatement*)
references
source code

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

virtual void visit(SwitchStatement*)
references
source code

[ switch ( expr ) statement ]

virtual void visit(WhileStatement*)
references
source code

[ while ( expr ) statement ]

virtual void visit(DoStatement*)
references
source code

[ do [{ ...

virtual void visit(ForStatement*)
references
source code

[ for ( stmt expr ; expr ) statement ]

virtual void visit(TryStatement*)
references
source code

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

virtual void visit(BreakStatement*)
references
source code

[ break ; ]

virtual void visit(ContinueStatement*)
references
source code
virtual void visit(ReturnStatement*)
references
source code
virtual void visit(GotoStatement*)
references
source code
virtual void visit(CaseStatement*)
references
source code

[ case expr : [expr] ]

virtual void visit(DefaultStatement*)
references
source code

[ default : [expr] ]

virtual void visit(LabelStatement*)
references
source code
virtual void visit(ExprStatement*)
references
source code
virtual void visit(Expression*)
references
source code

[ expr (, expr)* ]

virtual void visit(AssignExpr*)
references
source code

[left = right]

virtual void visit(CondExpr*)
references
source code
virtual void visit(InfixExpr*)
references
source code

[left op right]

virtual void visit(PmExpr*)
references
source code
virtual void visit(CastExpr*)
references
source code

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

virtual void visit(UnaryExpr*)
references
source code

[op expr]

virtual void visit(ThrowExpr*)
references
source code

[ throw [expr] ]

virtual void visit(SizeofExpr*)
references
source code

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

virtual void visit(OffsetofExpr*)
references
source code
virtual void visit(TypeidExpr*)
references
source code
virtual void visit(TypeofExpr*)
references
source code
virtual void visit(NewExpr*)
references
source code
virtual void visit(DeleteExpr*)
references
source code

[ delete [expr] ]

virtual void visit(ArrayExpr*)
references
source code

<postfix> [ <expr> ]

virtual void visit(FuncallExpr*)
references
source code

[ postfix ( args ) ]

virtual void visit(PostfixExpr*)
references
source code

[ expr ++ ]

virtual void visit(DotMemberExpr*)
references
source code

[ postfix .

virtual void visit(ArrowMemberExpr*)
references
source code

[ postfix -> name ]

virtual void visit(ParenExpr*)
references
source code

[ ( expr ) ]

Public Member functions Details:
virtual void visit(Brace*)
references
source code

[ { [ <statement>* ] } ]

virtual void visit(Block*)
references
source code

[ { [ <statement>* ] } ]

virtual void visit(TemplateDecl*)
references
source code

[ template < [types] > [decl] ]

virtual void visit(LinkageSpec*)
references
source code

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

virtual void visit(NamespaceSpec*)
references
source code

[ namespace <identifier> [{ body }] ]

virtual void visit(UsingDirective*)
references
source code

[ using namespace Foo ; ]

virtual void visit(Declaration*)
references
source code

One of:

  • Variables: [ [modifiers] name [declarators] ; ]
  • Function: prototype: [ [modifiers] name [declarators] ; ]
  • Typedef: ?
  • Class definition: [ [modifiers] [class foo ...] [declarators]? ; ]
virtual void visit(NamespaceAlias*)
references
source code

[ namespace Foo = Bar ; ]

virtual void visit(FunctionDefinition*)
references
source code

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

virtual void visit(ParameterDeclaration*)
references
source code

One of:

  • [ decl-specifier-seq ]
  • [ decl-specifier-seq declarator ]
  • [ decl-specifier-seq declarator = assignment-expression ]
  • [ decl-specifier-seq abstract-declarator ]
  • [ decl-specifier-seq abstract-declarator = assignment-expression ]
  • [ decl-specifier-seq = assignment-expression ]
virtual void visit(UsingDeclaration*)
references
source code

[ using Foo :: x ; ]

virtual void visit(Declarator*)
references
source code

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

virtual void visit(FstyleCastExpr*)
references
source code

[ [type] ( [expr] ) ]

virtual void visit(EnumSpec*)
references
source code

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

virtual void visit(TypeParameter*)
references
source code

One of:

  • [typename]
  • [typename identifier]
  • [typename identifier = type-id]
virtual void visit(IfStatement*)
references
source code

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

virtual void visit(SwitchStatement*)
references
source code

[ switch ( expr ) statement ]

virtual void visit(WhileStatement*)
references
source code

[ while ( expr ) statement ]

virtual void visit(DoStatement*)
references
source code

[ do [{ ... }] while ( [...] ) ; ]

virtual void visit(ForStatement*)
references
source code

[ for ( stmt expr ; expr ) statement ]

virtual void visit(TryStatement*)
references
source code

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

virtual void visit(BreakStatement*)
references
source code

[ break ; ]

virtual void visit(CaseStatement*)
references
source code

[ case expr : [expr] ]

virtual void visit(DefaultStatement*)
references
source code

[ default : [expr] ]

virtual void visit(Expression*)
references
source code

[ expr (, expr)* ]

virtual void visit(AssignExpr*)
references
source code

[left = right]

virtual void visit(InfixExpr*)
references
source code

[left op right]

virtual void visit(CastExpr*)
references
source code

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

virtual void visit(UnaryExpr*)
references
source code

[op expr]

virtual void visit(ThrowExpr*)
references
source code

[ throw [expr] ]

virtual void visit(SizeofExpr*)
references
source code

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

virtual void visit(DeleteExpr*)
references
source code

[ delete [expr] ]

virtual void visit(ArrayExpr*)
references
source code

<postfix> [ <expr> ]

virtual void visit(FuncallExpr*)
references
source code

[ postfix ( args ) ]

virtual void visit(PostfixExpr*)
references
source code

[ expr ++ ]

virtual void visit(DotMemberExpr*)
references
source code

[ postfix . name ]

virtual void visit(ArrowMemberExpr*)
references
source code

[ postfix -> name ]

virtual void visit(ParenExpr*)
references
source code

[ ( expr ) ]