logo

mixin

compiler::Visitor

sys::Obj
  compiler::Visitor

Vistor is used to walk the abstract syntax tree and visit key nodes. The walk for each node type entails:

  1. enter
  2. children
  3. exit
  4. visit

Slots

enterBlock

virtual Void enterBlock(Block block)

Callback when entering a block.

Source

enterFieldDef

virtual Void enterFieldDef(FieldDef def)

Callback when entering a field definition.

Source

enterFinally

virtual Void enterFinally(TryStmt stmt)

Callback when entering a finally block

Source

enterMethodDef

virtual Void enterMethodDef(MethodDef def)

Callback when entering a method.

Source

enterStmt

virtual Void enterStmt(Stmt stmt)

Callback when entering a stmt.

Source

enterTypeDef

virtual Void enterTypeDef(TypeDef def)

Callback when entering a type definition.

Source

exitBlock

virtual Void exitBlock(Block block)

Callback when exiting a block.

Source

exitFieldDef

virtual Void exitFieldDef(FieldDef def)

Callback when exiting a field definition.

Source

exitFinally

virtual Void exitFinally(TryStmt stmt)

Callback when exiting a finally block

Source

exitMethodDef

virtual Void exitMethodDef(MethodDef def)

Callback when exiting a method.

Source

exitStmt

virtual Void exitStmt(Stmt stmt)

Callback when exiting a stmt.

Source

exitTypeDef

virtual Void exitTypeDef(TypeDef def)

Callback when exiting a type definition.

Source

visitBlock

virtual Void visitBlock(Block block)

Callback when visiting a block.

Source

visitExpr

virtual Expr visitExpr(Expr expr)

Call to visit an expression. Return expr or a new expression if doing a replacement for the expression in the abstract syntax tree.

Source

visitFieldDef

virtual Void visitFieldDef(FieldDef def)

Callback when visiting a field definition.

Source

visitMethodDef

virtual Void visitMethodDef(MethodDef def)

Callback when visiting a method.

Source

visitStmt

virtual Void visitStmt(Stmt stmt)

Callback when visiting a stmt.

Source

visitTypeDef

virtual Void visitTypeDef(TypeDef def)

Callback when visiting a type definition.

Source

walk

Void walk(TypeDef[] typeDefs, VisitDepth depth)

Peform a walk of the abstract syntax tree down to the specified depth.

Source