Synopsis - Synopsis::PTree::Visitor

namespace Synopsis::PTree
class Visitor
File: ../Synopsis/PTree/Visitor.hh

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

[ { [ <statement>* ] } ]

virtual void visit(Block*)

[ { [ <statement>* ] } ]

virtual void visit(ClassBody*)
virtual void visit(Typedef*)
virtual void visit(TemplateDecl*)

[ template < [types] > [decl] ]

virtual void visit(TemplateInstantiation*)
virtual void visit(ExternTemplate*)
virtual void visit(MetaclassDecl*)
virtual void visit(LinkageSpec*)

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

virtual void visit(NamespaceSpec*)

[ namespace <identifier> [{ body }] ]

virtual void visit(UsingDirective*)

[ using namespace Foo ; ]

virtual void visit(Declaration*)

One of:

virtual void visit(NamespaceAlias*)

[ namespace Foo = Bar ; ]

virtual void visit(FunctionDefinition*)

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

virtual void visit(ParameterDeclaration*)

One of:

virtual void visit(UsingDeclaration*)

[ using Foo :: x ; ]

virtual void visit(Declarator*)

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

virtual void visit(Name*)
virtual void visit(FstyleCastExpr*)

[ [type] ( [expr] ) ]

virtual void visit(ClassSpec*)
virtual void visit(EnumSpec*)

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

virtual void visit(TypeParameter*)

One of:

virtual void visit(AccessSpec*)
virtual void visit(AccessDecl*)
virtual void visit(UserAccessSpec*)
virtual void visit(IfStatement*)

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

virtual void visit(SwitchStatement*)

[ switch ( expr ) statement ]

virtual void visit(WhileStatement*)

[ while ( expr ) statement ]

virtual void visit(DoStatement*)

[ do [{ ...

virtual void visit(ForStatement*)

[ for ( stmt expr ; expr ) statement ]

virtual void visit(TryStatement*)

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

virtual void visit(BreakStatement*)

[ break ; ]

virtual void visit(ContinueStatement*)
virtual void visit(ReturnStatement*)
virtual void visit(GotoStatement*)
virtual void visit(CaseStatement*)

[ case expr : [expr] ]

virtual void visit(DefaultStatement*)

[ default : [expr] ]

virtual void visit(LabelStatement*)
virtual void visit(ExprStatement*)
virtual void visit(Expression*)

[ expr (, expr)* ]

virtual void visit(AssignExpr*)

[left = right]

virtual void visit(CondExpr*)
virtual void visit(InfixExpr*)

[left op right]

virtual void visit(PmExpr*)
virtual void visit(CastExpr*)

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

virtual void visit(UnaryExpr*)

[op expr]

virtual void visit(ThrowExpr*)

[ throw [expr] ]

virtual void visit(SizeofExpr*)

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

virtual void visit(OffsetofExpr*)
virtual void visit(TypeidExpr*)
virtual void visit(TypeofExpr*)
virtual void visit(NewExpr*)
virtual void visit(DeleteExpr*)

[ delete [expr] ]

virtual void visit(ArrayExpr*)

<postfix> [ <expr> ]

virtual void visit(FuncallExpr*)

[ postfix ( args ) ]

virtual void visit(PostfixExpr*)

[ expr ++ ]

virtual void visit(DotMemberExpr*)

[ postfix .

virtual void visit(ArrowMemberExpr*)

[ postfix -> name ]

virtual void visit(ParenExpr*)

[ ( expr ) ]

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

[ { [ <statement>* ] } ]

virtual void visit(Block*)

[ { [ <statement>* ] } ]

virtual void visit(TemplateDecl*)

[ template < [types] > [decl] ]

virtual void visit(LinkageSpec*)

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

virtual void visit(NamespaceSpec*)

[ namespace <identifier> [{ body }] ]

virtual void visit(UsingDirective*)

[ using namespace Foo ; ]

virtual void visit(Declaration*)

One of:

- Variables: [ [modifiers] name [declarators] ; ]
- Function: prototype: [ [modifiers] name [declarators] ; ]
- Typedef: ?
- Class definition: [ [modifiers] [class foo ...] [declarators]? ; ]

virtual void visit(NamespaceAlias*)

[ namespace Foo = Bar ; ]

virtual void visit(FunctionDefinition*)

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

virtual void visit(ParameterDeclaration*)

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*)

[ using Foo :: x ; ]

virtual void visit(Declarator*)

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

virtual void visit(FstyleCastExpr*)

[ [type] ( [expr] ) ]

virtual void visit(EnumSpec*)

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

virtual void visit(TypeParameter*)

One of:

- [typename]
- [typename identifier]
- [typename identifier = type-id]

virtual void visit(IfStatement*)

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

virtual void visit(SwitchStatement*)

[ switch ( expr ) statement ]

virtual void visit(WhileStatement*)

[ while ( expr ) statement ]

virtual void visit(DoStatement*)

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

virtual void visit(ForStatement*)

[ for ( stmt expr ; expr ) statement ]

virtual void visit(TryStatement*)

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

virtual void visit(BreakStatement*)

[ break ; ]

virtual void visit(CaseStatement*)

[ case expr : [expr] ]

virtual void visit(DefaultStatement*)

[ default : [expr] ]

virtual void visit(Expression*)

[ expr (, expr)* ]

virtual void visit(AssignExpr*)

[left = right]

virtual void visit(InfixExpr*)

[left op right]

virtual void visit(CastExpr*)

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

virtual void visit(UnaryExpr*)

[op expr]

virtual void visit(ThrowExpr*)

[ throw [expr] ]

virtual void visit(SizeofExpr*)

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

virtual void visit(DeleteExpr*)

[ delete [expr] ]

virtual void visit(ArrayExpr*)

<postfix> [ <expr> ]

virtual void visit(FuncallExpr*)

[ postfix ( args ) ]

virtual void visit(PostfixExpr*)

[ expr ++ ]

virtual void visit(DotMemberExpr*)

[ postfix . name ]

virtual void visit(ArrowMemberExpr*)

[ postfix -> name ]

virtual void visit(ParenExpr*)

[ ( expr ) ]

Generated on Thu Apr 16 16:27:56 2009 by
synopsis (version devel)