com.ibm.wala.cast.tree.visit
Class CAstVisitor

java.lang.Object
  extended by com.ibm.wala.cast.tree.visit.CAstVisitor
Direct Known Subclasses:
AstTranslator, DelegatingCAstVisitor

public abstract class CAstVisitor
extends java.lang.Object


Nested Class Summary
static interface CAstVisitor.Context
          This interface represents a visitor-specific context.
 
Constructor Summary
CAstVisitor()
           
 
Method Summary
protected  boolean doVisit(CAstNode n, CAstVisitor.Context context, CAstVisitor visitor)
          Node processing hook; sub-classes are expected to override if they introduce new node types.
protected  boolean doVisitAssignNodes(CAstNode n, CAstVisitor.Context context, CAstNode v, CAstNode a, CAstVisitor visitor)
          Node processing hook; sub-classes are expected to override if they introduce new node types that appear on the left hand side of assignment operations.
protected  boolean doVisitEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor visitor)
          Entity processing hook; sub-classes are expected to override if they introduce new entity types.
protected  boolean enterEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor visitor)
          Enter the entity visitor.
protected  boolean enterNode(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Enter the node visitor.
protected  CAstEntity getParent(CAstEntity entity)
          Get the parent entity for a given entity.
protected  void leaveArrayLength(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an ArrayLength node.
protected  void leaveArrayLiteral(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a ArrayLiteral node.
protected  void leaveArrayLiteralInitElement(CAstNode n, int i, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ArrayLiteral node after processing the {i}th element initializer.
protected  void leaveArrayLiteralObject(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ArrayLiteral node after processing the array object.
protected  void leaveArrayRef(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an ArrayRef node.
protected  void leaveArrayRefAssign(CAstNode n, CAstNode v, CAstNode a, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ArrayRef Assignment node after visiting the LHS.
protected  void leaveArrayRefAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ArrayRef Op/Assignment node after visiting the LHS.
protected  void leaveAssert(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an InstanceOf node.
 void leaveAssign(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an Assign node.
protected  void leaveBinaryExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a BinaryExpr node.
protected  void leaveBlockExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a BlockExpr node.
protected  void leaveBlockExprAssign(CAstNode n, CAstNode v, CAstNode a, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a BlockExpr Assignment node after visiting the LHS.
protected  void leaveBlockExprAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a BlockExpr Op/Assignment node after visiting the LHS.
protected  void leaveBlockStmt(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a BlockStmt node.
protected  void leaveCall(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Call node.
protected  void leaveCast(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Cast node.
protected  void leaveCatch(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Catch node.
protected  void leaveConstant(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Constant node.
protected  void leaveDeclStmt(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a DeclStmt node.
protected  void leaveEachElementGet(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an FOR_EACH_ELEMENT_GET node.
protected  void leaveEachElementHasNext(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an InstanceOf node.
protected  void leaveEmpty(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an Empty node.
 void leaveEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor visitor)
          Leave any entity.
protected  void leaveFieldEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor visitor)
          Leave a Field entity.
protected  void leaveFileEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor.Context fileContext, CAstVisitor visitor)
          Leave a File entity.
protected  void leaveFunctionEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor.Context codeContext, CAstVisitor visitor)
          Leave a Function entity.
protected  void leaveFunctionExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a FunctionExpr node.
protected  void leaveFunctionStmt(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a FunctionStmt node.
protected  void leaveGetCaughtException(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a GetCaughtException node.
protected  void leaveGoto(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Goto node.
protected  void leaveIfExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an IfExpr node.
protected  void leaveIfExprCondition(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an IfExpr node after processing the condition.
protected  void leaveIfExprTrueClause(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an IfExpr node after processing the true clause.
protected  void leaveIfgoto(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an Ifgoto node.
protected  void leaveIfStmt(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an IfStmt node.
protected  void leaveIfStmtCondition(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an IfStmt node after processing the condition.
protected  void leaveIfStmtTrueClause(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an IfStmt node after processing the true clause.
protected  void leaveInstanceOf(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an InstanceOf node.
protected  void leaveIsDefinedExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an IS_DEFINED_EXPR node.
protected  void leaveLabelStmt(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a LabelStmt node.
protected  void leaveLocalScope(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a LocalScope node.
protected  void leaveLoop(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Loop node.
protected  void leaveLoopHeader(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Loop node after processing the loop header.
protected  void leaveNew(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a New node.
 void leaveNode(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave any node.
protected  void leaveObjectLiteral(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an ObjectLiteral node.
protected  void leaveObjectLiteralFieldInit(CAstNode n, int i, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ObjectLiteral node after processing the {i}th field initializer.
protected  void leaveObjectRef(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an ObjectRef node.
protected  void leaveObjectRefAssign(CAstNode n, CAstNode v, CAstNode a, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ObjectRef Assignment node after visiting the LHS.
protected  void leaveObjectRefAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ObjectRef Op/Assignment node after visiting the LHS.
protected  void leavePrimitive(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Primitive node.
protected  void leaveReturn(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Return node.
protected  void leaveScriptEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor.Context codeContext, CAstVisitor visitor)
          Leave a Script entity.
protected  void leaveSuper(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Super node.
protected  void leaveSwitch(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Switch node.
protected  void leaveSwitchValue(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Switch node after processing the switch value.
protected  void leaveThis(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a This node.
protected  void leaveThrow(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Throw node.
protected  void leaveTry(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Try node.
protected  void leaveTryBlock(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Try node after processing the try block.
protected  void leaveTypeEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor.Context typeContext, CAstVisitor visitor)
          Leave a Type entity.
protected  void leaveTypeLiteralExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an TYPE_LITERAL_EXPR node.
protected  void leaveUnaryExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a UnaryExpr node.
protected  void leaveUnwind(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an Unwind node.
protected  void leaveVar(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Var node.
protected  void leaveVarAssign(CAstNode n, CAstNode v, CAstNode a, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Var Assignment node after visiting the LHS.
protected  void leaveVarAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Var Op/Assignment node after visiting the LHS.
protected  void leaveVoid(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave a Void node.
protected  CAstVisitor.Context makeCodeContext(CAstVisitor.Context context, CAstEntity n)
          Construct a context for a Code entity.
protected  CAstVisitor.Context makeFileContext(CAstVisitor.Context context, CAstEntity n)
          Construct a context for a File entity.
protected  CAstVisitor.Context makeLocalContext(CAstVisitor.Context context, CAstNode n)
          Construct a context for a LocalScope node.
protected  CAstVisitor.Context makeTypeContext(CAstVisitor.Context context, CAstEntity n)
          Construct a context for a Type entity.
protected  CAstVisitor.Context makeUnwindContext(CAstVisitor.Context context, CAstNode n, CAstVisitor visitor)
          Construct a context for an Unwind node.
protected  void postProcessEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor visitor)
          Post-process an entity after visiting it.
protected  void postProcessNode(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Post-process a node after visiting it.
protected  void setParent(CAstEntity entity, CAstEntity parent)
          Set the parent entity for a given entity.
 void visit(CAstNode n, CAstVisitor.Context context, CAstVisitor visitor)
          Recursively visit a given node.
 void visitAllChildren(CAstNode n, CAstVisitor.Context context, CAstVisitor visitor)
          Visit all children of a node.
protected  boolean visitArrayLength(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ArrayLength node.
protected  boolean visitArrayLiteral(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ArrayLiteral node.
protected  boolean visitArrayRef(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ArrayRef node.
protected  boolean visitArrayRefAssign(CAstNode n, CAstNode v, CAstNode a, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ArrayRef Assignment node after visiting the RHS.
protected  boolean visitArrayRefAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ArrayRef Op/Assignment node after visiting the RHS.
protected  boolean visitAssert(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an InstanceOf node.
 boolean visitAssign(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an Assign node.
protected  boolean visitAssignNodes(CAstNode n, CAstVisitor.Context context, CAstNode v, CAstNode a, CAstVisitor visitor)
           
protected  boolean visitBinaryExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a BinaryExpr node.
protected  boolean visitBlockExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a BlockExpr node.
protected  boolean visitBlockExprAssign(CAstNode n, CAstNode v, CAstNode a, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a BlockExpr Assignment node after visiting the RHS.
protected  boolean visitBlockExprAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a BlockExpr Op/Assignment node after visiting the RHS.
protected  boolean visitBlockStmt(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a BlockStmt node.
protected  boolean visitCall(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Call node.
protected  boolean visitCast(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Cast node.
protected  boolean visitCatch(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Catch node.
 void visitChildren(CAstNode n, int start, CAstVisitor.Context context, CAstVisitor visitor)
          Visit children of a node starting at a given index.
protected  boolean visitConstant(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Constant node.
protected  boolean visitDeclStmt(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a DeclStmt node.
protected  boolean visitEachElementGet(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an InstanceOf node.
protected  boolean visitEachElementHasNext(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an InstanceOf node.
protected  boolean visitEmpty(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an Empty node.
 void visitEntities(CAstEntity n, CAstVisitor.Context context, CAstVisitor visitor)
          Recursively visit an entity.
 boolean visitEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor visitor)
          Visit any entity.
protected  boolean visitFieldEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor visitor)
          Visit a Field entity.
protected  boolean visitFileEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor.Context fileContext, CAstVisitor visitor)
          Visit a File entity.
protected  boolean visitFunctionEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor.Context codeContext, CAstVisitor visitor)
          Visit a Function entity.
protected  boolean visitFunctionExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a FunctionExpr node.
protected  boolean visitFunctionStmt(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a FunctionStmt node.
protected  boolean visitGetCaughtException(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a GetCaughtException node.
protected  boolean visitGoto(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Goto node.
protected  boolean visitIfExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an IfExpr node.
protected  boolean visitIfgoto(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an Ifgoto node.
protected  boolean visitIfStmt(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an IfStmt node.
protected  boolean visitInstanceOf(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an InstanceOf node.
protected  boolean visitIsDefinedExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
           
protected  boolean visitLabelStmt(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a LabelStmt node.
protected  boolean visitLocalScope(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a LocalScope node.
protected  boolean visitLoop(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Loop node.
protected  boolean visitNew(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a New node.
 boolean visitNode(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit any node.
protected  boolean visitObjectLiteral(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ObjectLiteral node.
protected  boolean visitObjectRef(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ObjectRef node.
protected  boolean visitObjectRefAssign(CAstNode n, CAstNode v, CAstNode a, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ObjectRef Assignment node after visiting the RHS.
protected  boolean visitObjectRefAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an ObjectRef Op/Assignment node after visiting the RHS.
protected  boolean visitPrimitive(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Primitive node.
protected  boolean visitReturn(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Return node.
 void visitScopedEntities(CAstEntity n, java.util.Iterator i, CAstVisitor.Context context, CAstVisitor visitor)
           
 void visitScopedEntities(CAstEntity n, java.util.Map allScopedEntities, CAstVisitor.Context context, CAstVisitor visitor)
          Visit scoped entities of an entity using a given iterator.
protected  boolean visitScriptEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor.Context codeContext, CAstVisitor visitor)
          Visit a Script entity.
protected  boolean visitSuper(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Super node.
protected  boolean visitSwitch(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Switch node.
protected  boolean visitThis(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a This node.
protected  boolean visitThrow(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Throw node.
protected  boolean visitTry(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Try node.
protected  boolean visitTypeEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor.Context typeContext, CAstVisitor visitor)
          Visit a Type entity.
protected  boolean visitTypeLiteralExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an TYPE_LITERAL_EXPR node.
protected  boolean visitUnaryExpr(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a UnaryExpr node.
protected  boolean visitUnwind(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an Unwind node.
protected  boolean visitVar(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Var node.
protected  boolean visitVarAssign(CAstNode n, CAstNode v, CAstNode a, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Var Assignment node after visiting the RHS.
protected  boolean visitVarAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Var Op/Assignment node after visiting the RHS.
protected  boolean visitVoid(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Void node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CAstVisitor

public CAstVisitor()
Method Detail

makeFileContext

protected CAstVisitor.Context makeFileContext(CAstVisitor.Context context,
                                              CAstEntity n)
Construct a context for a File entity.

Parameters:
context - a visitor-specific context in which this file was visited
n - the file entity

makeTypeContext

protected CAstVisitor.Context makeTypeContext(CAstVisitor.Context context,
                                              CAstEntity n)
Construct a context for a Type entity.

Parameters:
context - a visitor-specific context in which this type was visited
n - the type entity

makeCodeContext

protected CAstVisitor.Context makeCodeContext(CAstVisitor.Context context,
                                              CAstEntity n)
Construct a context for a Code entity.

Parameters:
context - a visitor-specific context in which the code was visited
n - the code entity

makeLocalContext

protected CAstVisitor.Context makeLocalContext(CAstVisitor.Context context,
                                               CAstNode n)
Construct a context for a LocalScope node.

Parameters:
context - a visitor-specific context in which the local scope was visited
n - the local scope node

makeUnwindContext

protected CAstVisitor.Context makeUnwindContext(CAstVisitor.Context context,
                                                CAstNode n,
                                                CAstVisitor visitor)
Construct a context for an Unwind node.

Parameters:
context - a visitor-specific context in which the unwind was visited
n - the unwind node

getParent

protected CAstEntity getParent(CAstEntity entity)
Get the parent entity for a given entity.

Parameters:
entity - the child entity
Returns:
the parent entity for the given entity

setParent

protected void setParent(CAstEntity entity,
                         CAstEntity parent)
Set the parent entity for a given entity.

Parameters:
entity - the child entity
parent - the parent entity

doVisitEntity

protected boolean doVisitEntity(CAstEntity n,
                                CAstVisitor.Context context,
                                CAstVisitor visitor)
Entity processing hook; sub-classes are expected to override if they introduce new entity types. Should invoke super.doVisitEntity() for unprocessed entities.

Returns:
true if entity was handled

visitScopedEntities

public final void visitScopedEntities(CAstEntity n,
                                      java.util.Map allScopedEntities,
                                      CAstVisitor.Context context,
                                      CAstVisitor visitor)
Visit scoped entities of an entity using a given iterator. Prerequisite (unchecked): i iterates over entities scoped in n.

Parameters:
n - the parent entity of the entities to process
i - the iterator over some scoped entities of n
context - a visitor-specific context

visitScopedEntities

public final void visitScopedEntities(CAstEntity n,
                                      java.util.Iterator i,
                                      CAstVisitor.Context context,
                                      CAstVisitor visitor)

visitEntities

public final void visitEntities(CAstEntity n,
                                CAstVisitor.Context context,
                                CAstVisitor visitor)
Recursively visit an entity.

Parameters:
n - the entity to process
context - a visitor-specific context

enterEntity

protected boolean enterEntity(CAstEntity n,
                              CAstVisitor.Context context,
                              CAstVisitor visitor)
Enter the entity visitor.

Parameters:
n - the entity to process
context - a visitor-specific context
Returns:
true if no further processing is needed

postProcessEntity

protected void postProcessEntity(CAstEntity n,
                                 CAstVisitor.Context context,
                                 CAstVisitor visitor)
Post-process an entity after visiting it.

Parameters:
n - the entity to process
context - a visitor-specific context

visitEntity

public boolean visitEntity(CAstEntity n,
                           CAstVisitor.Context context,
                           CAstVisitor visitor)
Visit any entity. Override only this to change behavior for all entities.

Parameters:
n - the entity to process
context - a visitor-specific context
Returns:
true if no further processing is needed

leaveEntity

public void leaveEntity(CAstEntity n,
                        CAstVisitor.Context context,
                        CAstVisitor visitor)
Leave any entity. Override only this to change behavior for all entities.

Parameters:
n - the entity to process
context - a visitor-specific context

visitFileEntity

protected boolean visitFileEntity(CAstEntity n,
                                  CAstVisitor.Context context,
                                  CAstVisitor.Context fileContext,
                                  CAstVisitor visitor)
Visit a File entity.

Parameters:
n - the entity to process
context - a visitor-specific context
fileContext - a visitor-specific context for this file
Returns:
true if no further processing is needed

leaveFileEntity

protected void leaveFileEntity(CAstEntity n,
                               CAstVisitor.Context context,
                               CAstVisitor.Context fileContext,
                               CAstVisitor visitor)
Leave a File entity.

Parameters:
n - the entity to process
context - a visitor-specific context
fileContext - a visitor-specific context for this file

visitFieldEntity

protected boolean visitFieldEntity(CAstEntity n,
                                   CAstVisitor.Context context,
                                   CAstVisitor visitor)
Visit a Field entity.

Parameters:
n - the entity to process
context - a visitor-specific context
Returns:
true if no further processing is needed

leaveFieldEntity

protected void leaveFieldEntity(CAstEntity n,
                                CAstVisitor.Context context,
                                CAstVisitor visitor)
Leave a Field entity.

Parameters:
n - the entity to process
context - a visitor-specific context

visitTypeEntity

protected boolean visitTypeEntity(CAstEntity n,
                                  CAstVisitor.Context context,
                                  CAstVisitor.Context typeContext,
                                  CAstVisitor visitor)
Visit a Type entity.

Parameters:
n - the entity to process
context - a visitor-specific context
typeContext - a visitor-specific context for this type
Returns:
true if no further processing is needed

leaveTypeEntity

protected void leaveTypeEntity(CAstEntity n,
                               CAstVisitor.Context context,
                               CAstVisitor.Context typeContext,
                               CAstVisitor visitor)
Leave a Type entity.

Parameters:
n - the entity to process
context - a visitor-specific context
typeContext - a visitor-specific context for this type

visitFunctionEntity

protected boolean visitFunctionEntity(CAstEntity n,
                                      CAstVisitor.Context context,
                                      CAstVisitor.Context codeContext,
                                      CAstVisitor visitor)
Visit a Function entity.

Parameters:
n - the entity to process
context - a visitor-specific context
codeContext - a visitor-specific context for this function
Returns:
true if no further processing is needed

leaveFunctionEntity

protected void leaveFunctionEntity(CAstEntity n,
                                   CAstVisitor.Context context,
                                   CAstVisitor.Context codeContext,
                                   CAstVisitor visitor)
Leave a Function entity.

Parameters:
n - the entity to process
context - a visitor-specific context
codeContext - a visitor-specific context for this function

visitScriptEntity

protected boolean visitScriptEntity(CAstEntity n,
                                    CAstVisitor.Context context,
                                    CAstVisitor.Context codeContext,
                                    CAstVisitor visitor)
Visit a Script entity.

Parameters:
n - the entity to process
context - a visitor-specific context
codeContext - a visitor-specific context for this script
Returns:
true if no further processing is needed

leaveScriptEntity

protected void leaveScriptEntity(CAstEntity n,
                                 CAstVisitor.Context context,
                                 CAstVisitor.Context codeContext,
                                 CAstVisitor visitor)
Leave a Script entity.

Parameters:
n - the entity to process
context - a visitor-specific context
codeContext - a visitor-specific context for this script

doVisit

protected boolean doVisit(CAstNode n,
                          CAstVisitor.Context context,
                          CAstVisitor visitor)
Node processing hook; sub-classes are expected to override if they introduce new node types. (Should invoke super.doVisit() for unprocessed nodes.)

Returns:
true if node was handled

doVisitAssignNodes

protected boolean doVisitAssignNodes(CAstNode n,
                                     CAstVisitor.Context context,
                                     CAstNode v,
                                     CAstNode a,
                                     CAstVisitor visitor)
Node processing hook; sub-classes are expected to override if they introduce new node types that appear on the left hand side of assignment operations. (Should invoke super.doVisit() for unprocessed nodes.)

Returns:
true if node was handled

visitChildren

public final void visitChildren(CAstNode n,
                                int start,
                                CAstVisitor.Context context,
                                CAstVisitor visitor)
Visit children of a node starting at a given index.

Parameters:
n - the parent node of the nodes to process
start - the starting index of the nodes to process
context - a visitor-specific context

visitAllChildren

public final void visitAllChildren(CAstNode n,
                                   CAstVisitor.Context context,
                                   CAstVisitor visitor)
Visit all children of a node.

Parameters:
n - the parent node of the nodes to process
context - a visitor-specific context

visit

public final void visit(CAstNode n,
                        CAstVisitor.Context context,
                        CAstVisitor visitor)
Recursively visit a given node. TODO: do assertions about structure belong here?

Parameters:
n - the node to process
context - a visitor-specific context

visitAssignNodes

protected boolean visitAssignNodes(CAstNode n,
                                   CAstVisitor.Context context,
                                   CAstNode v,
                                   CAstNode a,
                                   CAstVisitor visitor)

enterNode

protected boolean enterNode(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Enter the node visitor.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

postProcessNode

protected void postProcessNode(CAstNode n,
                               CAstVisitor.Context c,
                               CAstVisitor visitor)
Post-process a node after visiting it.

Parameters:
n - the node to process
c - a visitor-specific context

visitNode

public boolean visitNode(CAstNode n,
                         CAstVisitor.Context c,
                         CAstVisitor visitor)
Visit any node. Override only this to change behavior for all nodes.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveNode

public void leaveNode(CAstNode n,
                      CAstVisitor.Context c,
                      CAstVisitor visitor)
Leave any node. Override only this to change behavior for all nodes.

Parameters:
n - the node to process
c - a visitor-specific context

visitFunctionExpr

protected boolean visitFunctionExpr(CAstNode n,
                                    CAstVisitor.Context c,
                                    CAstVisitor visitor)
Visit a FunctionExpr node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveFunctionExpr

protected void leaveFunctionExpr(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Leave a FunctionExpr node.

Parameters:
n - the node to process
c - a visitor-specific context

visitFunctionStmt

protected boolean visitFunctionStmt(CAstNode n,
                                    CAstVisitor.Context c,
                                    CAstVisitor visitor)
Visit a FunctionStmt node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveFunctionStmt

protected void leaveFunctionStmt(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Leave a FunctionStmt node.

Parameters:
n - the node to process
c - a visitor-specific context

visitLocalScope

protected boolean visitLocalScope(CAstNode n,
                                  CAstVisitor.Context c,
                                  CAstVisitor visitor)
Visit a LocalScope node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveLocalScope

protected void leaveLocalScope(CAstNode n,
                               CAstVisitor.Context c,
                               CAstVisitor visitor)
Leave a LocalScope node.

Parameters:
n - the node to process
c - a visitor-specific context

visitBlockExpr

protected boolean visitBlockExpr(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Visit a BlockExpr node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveBlockExpr

protected void leaveBlockExpr(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Leave a BlockExpr node.

Parameters:
n - the node to process
c - a visitor-specific context

visitBlockStmt

protected boolean visitBlockStmt(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Visit a BlockStmt node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveBlockStmt

protected void leaveBlockStmt(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Leave a BlockStmt node.

Parameters:
n - the node to process
c - a visitor-specific context

visitLoop

protected boolean visitLoop(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Visit a Loop node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveLoopHeader

protected void leaveLoopHeader(CAstNode n,
                               CAstVisitor.Context c,
                               CAstVisitor visitor)
Visit a Loop node after processing the loop header.

Parameters:
n - the node to process
c - a visitor-specific context

leaveLoop

protected void leaveLoop(CAstNode n,
                         CAstVisitor.Context c,
                         CAstVisitor visitor)
Leave a Loop node.

Parameters:
n - the node to process
c - a visitor-specific context

visitGetCaughtException

protected boolean visitGetCaughtException(CAstNode n,
                                          CAstVisitor.Context c,
                                          CAstVisitor visitor)
Visit a GetCaughtException node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveGetCaughtException

protected void leaveGetCaughtException(CAstNode n,
                                       CAstVisitor.Context c,
                                       CAstVisitor visitor)
Leave a GetCaughtException node.

Parameters:
n - the node to process
c - a visitor-specific context

visitThis

protected boolean visitThis(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Visit a This node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveThis

protected void leaveThis(CAstNode n,
                         CAstVisitor.Context c,
                         CAstVisitor visitor)
Leave a This node.

Parameters:
n - the node to process
c - a visitor-specific context

visitSuper

protected boolean visitSuper(CAstNode n,
                             CAstVisitor.Context c,
                             CAstVisitor visitor)
Visit a Super node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveSuper

protected void leaveSuper(CAstNode n,
                          CAstVisitor.Context c,
                          CAstVisitor visitor)
Leave a Super node.

Parameters:
n - the node to process
c - a visitor-specific context

visitCall

protected boolean visitCall(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Visit a Call node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveCall

protected void leaveCall(CAstNode n,
                         CAstVisitor.Context c,
                         CAstVisitor visitor)
Leave a Call node.

Parameters:
n - the node to process
c - a visitor-specific context

visitVar

protected boolean visitVar(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Visit a Var node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveVar

protected void leaveVar(CAstNode n,
                        CAstVisitor.Context c,
                        CAstVisitor visitor)
Leave a Var node.

Parameters:
n - the node to process
c - a visitor-specific context

visitConstant

protected boolean visitConstant(CAstNode n,
                                CAstVisitor.Context c,
                                CAstVisitor visitor)
Visit a Constant node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveConstant

protected void leaveConstant(CAstNode n,
                             CAstVisitor.Context c,
                             CAstVisitor visitor)
Leave a Constant node.

Parameters:
n - the node to process
c - a visitor-specific context

visitBinaryExpr

protected boolean visitBinaryExpr(CAstNode n,
                                  CAstVisitor.Context c,
                                  CAstVisitor visitor)
Visit a BinaryExpr node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveBinaryExpr

protected void leaveBinaryExpr(CAstNode n,
                               CAstVisitor.Context c,
                               CAstVisitor visitor)
Leave a BinaryExpr node.

Parameters:
n - the node to process
c - a visitor-specific context

visitUnaryExpr

protected boolean visitUnaryExpr(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Visit a UnaryExpr node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveUnaryExpr

protected void leaveUnaryExpr(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Leave a UnaryExpr node.

Parameters:
n - the node to process
c - a visitor-specific context

visitArrayLength

protected boolean visitArrayLength(CAstNode n,
                                   CAstVisitor.Context c,
                                   CAstVisitor visitor)
Visit an ArrayLength node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveArrayLength

protected void leaveArrayLength(CAstNode n,
                                CAstVisitor.Context c,
                                CAstVisitor visitor)
Leave an ArrayLength node.

Parameters:
n - the node to process
c - a visitor-specific context

visitArrayRef

protected boolean visitArrayRef(CAstNode n,
                                CAstVisitor.Context c,
                                CAstVisitor visitor)
Visit an ArrayRef node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveArrayRef

protected void leaveArrayRef(CAstNode n,
                             CAstVisitor.Context c,
                             CAstVisitor visitor)
Leave an ArrayRef node.

Parameters:
n - the node to process
c - a visitor-specific context

visitDeclStmt

protected boolean visitDeclStmt(CAstNode n,
                                CAstVisitor.Context c,
                                CAstVisitor visitor)
Visit a DeclStmt node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveDeclStmt

protected void leaveDeclStmt(CAstNode n,
                             CAstVisitor.Context c,
                             CAstVisitor visitor)
Leave a DeclStmt node.

Parameters:
n - the node to process
c - a visitor-specific context

visitReturn

protected boolean visitReturn(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Visit a Return node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveReturn

protected void leaveReturn(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Leave a Return node.

Parameters:
n - the node to process
c - a visitor-specific context

visitIfgoto

protected boolean visitIfgoto(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Visit an Ifgoto node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveIfgoto

protected void leaveIfgoto(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Leave an Ifgoto node.

Parameters:
n - the node to process
c - a visitor-specific context

visitGoto

protected boolean visitGoto(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Visit a Goto node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveGoto

protected void leaveGoto(CAstNode n,
                         CAstVisitor.Context c,
                         CAstVisitor visitor)
Leave a Goto node.

Parameters:
n - the node to process
c - a visitor-specific context

visitLabelStmt

protected boolean visitLabelStmt(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Visit a LabelStmt node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveLabelStmt

protected void leaveLabelStmt(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Leave a LabelStmt node.

Parameters:
n - the node to process
c - a visitor-specific context

visitIfStmt

protected boolean visitIfStmt(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Visit an IfStmt node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveIfStmtCondition

protected void leaveIfStmtCondition(CAstNode n,
                                    CAstVisitor.Context c,
                                    CAstVisitor visitor)
Visit an IfStmt node after processing the condition.

Parameters:
n - the node to process
c - a visitor-specific context

leaveIfStmtTrueClause

protected void leaveIfStmtTrueClause(CAstNode n,
                                     CAstVisitor.Context c,
                                     CAstVisitor visitor)
Visit an IfStmt node after processing the true clause.

Parameters:
n - the node to process
c - a visitor-specific context

leaveIfStmt

protected void leaveIfStmt(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Leave an IfStmt node.

Parameters:
n - the node to process
c - a visitor-specific context

visitIfExpr

protected boolean visitIfExpr(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Visit an IfExpr node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveIfExprCondition

protected void leaveIfExprCondition(CAstNode n,
                                    CAstVisitor.Context c,
                                    CAstVisitor visitor)
Visit an IfExpr node after processing the condition.

Parameters:
n - the node to process
c - a visitor-specific context

leaveIfExprTrueClause

protected void leaveIfExprTrueClause(CAstNode n,
                                     CAstVisitor.Context c,
                                     CAstVisitor visitor)
Visit an IfExpr node after processing the true clause.

Parameters:
n - the node to process
c - a visitor-specific context

leaveIfExpr

protected void leaveIfExpr(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Leave an IfExpr node.

Parameters:
n - the node to process
c - a visitor-specific context

visitNew

protected boolean visitNew(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Visit a New node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveNew

protected void leaveNew(CAstNode n,
                        CAstVisitor.Context c,
                        CAstVisitor visitor)
Leave a New node.

Parameters:
n - the node to process
c - a visitor-specific context

visitObjectLiteral

protected boolean visitObjectLiteral(CAstNode n,
                                     CAstVisitor.Context c,
                                     CAstVisitor visitor)
Visit an ObjectLiteral node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveObjectLiteralFieldInit

protected void leaveObjectLiteralFieldInit(CAstNode n,
                                           int i,
                                           CAstVisitor.Context c,
                                           CAstVisitor visitor)
Visit an ObjectLiteral node after processing the {i}th field initializer.

Parameters:
n - the node to process
i - the field position that was initialized
c - a visitor-specific context

leaveObjectLiteral

protected void leaveObjectLiteral(CAstNode n,
                                  CAstVisitor.Context c,
                                  CAstVisitor visitor)
Leave an ObjectLiteral node.

Parameters:
n - the node to process
c - a visitor-specific context

visitArrayLiteral

protected boolean visitArrayLiteral(CAstNode n,
                                    CAstVisitor.Context c,
                                    CAstVisitor visitor)
Visit an ArrayLiteral node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveArrayLiteralObject

protected void leaveArrayLiteralObject(CAstNode n,
                                       CAstVisitor.Context c,
                                       CAstVisitor visitor)
Visit an ArrayLiteral node after processing the array object.

Parameters:
n - the node to process
c - a visitor-specific context

leaveArrayLiteralInitElement

protected void leaveArrayLiteralInitElement(CAstNode n,
                                            int i,
                                            CAstVisitor.Context c,
                                            CAstVisitor visitor)
Visit an ArrayLiteral node after processing the {i}th element initializer.

Parameters:
n - the node to process
i - the index that was initialized
c - a visitor-specific context

leaveArrayLiteral

protected void leaveArrayLiteral(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Leave a ArrayLiteral node.

Parameters:
n - the node to process
c - a visitor-specific context

visitObjectRef

protected boolean visitObjectRef(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Visit an ObjectRef node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveObjectRef

protected void leaveObjectRef(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Leave an ObjectRef node.

Parameters:
n - the node to process
c - a visitor-specific context

visitAssign

public boolean visitAssign(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Visit an Assign node. Override only this to change behavior for all assignment nodes.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveAssign

public void leaveAssign(CAstNode n,
                        CAstVisitor.Context c,
                        CAstVisitor visitor)
Leave an Assign node. Override only this to change behavior for all assignment nodes.

Parameters:
n - the node to process
c - a visitor-specific context

visitArrayRefAssign

protected boolean visitArrayRefAssign(CAstNode n,
                                      CAstNode v,
                                      CAstNode a,
                                      CAstVisitor.Context c,
                                      CAstVisitor visitor)
Visit an ArrayRef Assignment node after visiting the RHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveArrayRefAssign

protected void leaveArrayRefAssign(CAstNode n,
                                   CAstNode v,
                                   CAstNode a,
                                   CAstVisitor.Context c,
                                   CAstVisitor visitor)
Visit an ArrayRef Assignment node after visiting the LHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
c - a visitor-specific context

visitArrayRefAssignOp

protected boolean visitArrayRefAssignOp(CAstNode n,
                                        CAstNode v,
                                        CAstNode a,
                                        boolean pre,
                                        CAstVisitor.Context c,
                                        CAstVisitor visitor)
Visit an ArrayRef Op/Assignment node after visiting the RHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
pre - whether the value before the operation should be used
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveArrayRefAssignOp

protected void leaveArrayRefAssignOp(CAstNode n,
                                     CAstNode v,
                                     CAstNode a,
                                     boolean pre,
                                     CAstVisitor.Context c,
                                     CAstVisitor visitor)
Visit an ArrayRef Op/Assignment node after visiting the LHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
pre - whether the value before the operation should be used
c - a visitor-specific context

visitObjectRefAssign

protected boolean visitObjectRefAssign(CAstNode n,
                                       CAstNode v,
                                       CAstNode a,
                                       CAstVisitor.Context c,
                                       CAstVisitor visitor)
Visit an ObjectRef Assignment node after visiting the RHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveObjectRefAssign

protected void leaveObjectRefAssign(CAstNode n,
                                    CAstNode v,
                                    CAstNode a,
                                    CAstVisitor.Context c,
                                    CAstVisitor visitor)
Visit an ObjectRef Assignment node after visiting the LHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
c - a visitor-specific context

visitObjectRefAssignOp

protected boolean visitObjectRefAssignOp(CAstNode n,
                                         CAstNode v,
                                         CAstNode a,
                                         boolean pre,
                                         CAstVisitor.Context c,
                                         CAstVisitor visitor)
Visit an ObjectRef Op/Assignment node after visiting the RHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
pre - whether the value before the operation should be used
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveObjectRefAssignOp

protected void leaveObjectRefAssignOp(CAstNode n,
                                      CAstNode v,
                                      CAstNode a,
                                      boolean pre,
                                      CAstVisitor.Context c,
                                      CAstVisitor visitor)
Visit an ObjectRef Op/Assignment node after visiting the LHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
pre - whether the value before the operation should be used
c - a visitor-specific context

visitBlockExprAssign

protected boolean visitBlockExprAssign(CAstNode n,
                                       CAstNode v,
                                       CAstNode a,
                                       CAstVisitor.Context c,
                                       CAstVisitor visitor)
Visit a BlockExpr Assignment node after visiting the RHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveBlockExprAssign

protected void leaveBlockExprAssign(CAstNode n,
                                    CAstNode v,
                                    CAstNode a,
                                    CAstVisitor.Context c,
                                    CAstVisitor visitor)
Visit a BlockExpr Assignment node after visiting the LHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
c - a visitor-specific context

visitBlockExprAssignOp

protected boolean visitBlockExprAssignOp(CAstNode n,
                                         CAstNode v,
                                         CAstNode a,
                                         boolean pre,
                                         CAstVisitor.Context c,
                                         CAstVisitor visitor)
Visit a BlockExpr Op/Assignment node after visiting the RHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
pre - whether the value before the operation should be used
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveBlockExprAssignOp

protected void leaveBlockExprAssignOp(CAstNode n,
                                      CAstNode v,
                                      CAstNode a,
                                      boolean pre,
                                      CAstVisitor.Context c,
                                      CAstVisitor visitor)
Visit a BlockExpr Op/Assignment node after visiting the LHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
pre - whether the value before the operation should be used
c - a visitor-specific context

visitVarAssign

protected boolean visitVarAssign(CAstNode n,
                                 CAstNode v,
                                 CAstNode a,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Visit a Var Assignment node after visiting the RHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveVarAssign

protected void leaveVarAssign(CAstNode n,
                              CAstNode v,
                              CAstNode a,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Visit a Var Assignment node after visiting the LHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
c - a visitor-specific context

visitVarAssignOp

protected boolean visitVarAssignOp(CAstNode n,
                                   CAstNode v,
                                   CAstNode a,
                                   boolean pre,
                                   CAstVisitor.Context c,
                                   CAstVisitor visitor)
Visit a Var Op/Assignment node after visiting the RHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
pre - whether the value before the operation should be used
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveVarAssignOp

protected void leaveVarAssignOp(CAstNode n,
                                CAstNode v,
                                CAstNode a,
                                boolean pre,
                                CAstVisitor.Context c,
                                CAstVisitor visitor)
Visit a Var Op/Assignment node after visiting the LHS.

Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
pre - whether the value before the operation should be used
c - a visitor-specific context

visitSwitch

protected boolean visitSwitch(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Visit a Switch node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveSwitchValue

protected void leaveSwitchValue(CAstNode n,
                                CAstVisitor.Context c,
                                CAstVisitor visitor)
Visit a Switch node after processing the switch value.

Parameters:
n - the node to process
c - a visitor-specific context

leaveSwitch

protected void leaveSwitch(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Leave a Switch node.

Parameters:
n - the node to process
c - a visitor-specific context

visitThrow

protected boolean visitThrow(CAstNode n,
                             CAstVisitor.Context c,
                             CAstVisitor visitor)
Visit a Throw node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveThrow

protected void leaveThrow(CAstNode n,
                          CAstVisitor.Context c,
                          CAstVisitor visitor)
Leave a Throw node.

Parameters:
n - the node to process
c - a visitor-specific context

visitCatch

protected boolean visitCatch(CAstNode n,
                             CAstVisitor.Context c,
                             CAstVisitor visitor)
Visit a Catch node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveCatch

protected void leaveCatch(CAstNode n,
                          CAstVisitor.Context c,
                          CAstVisitor visitor)
Leave a Catch node.

Parameters:
n - the node to process
c - a visitor-specific context

visitUnwind

protected boolean visitUnwind(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Visit an Unwind node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveUnwind

protected void leaveUnwind(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Leave an Unwind node.

Parameters:
n - the node to process
c - a visitor-specific context

visitTry

protected boolean visitTry(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Visit a Try node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveTryBlock

protected void leaveTryBlock(CAstNode n,
                             CAstVisitor.Context c,
                             CAstVisitor visitor)
Visit a Try node after processing the try block.

Parameters:
n - the node to process
c - a visitor-specific context

leaveTry

protected void leaveTry(CAstNode n,
                        CAstVisitor.Context c,
                        CAstVisitor visitor)
Leave a Try node.

Parameters:
n - the node to process
c - a visitor-specific context

visitEmpty

protected boolean visitEmpty(CAstNode n,
                             CAstVisitor.Context c,
                             CAstVisitor visitor)
Visit an Empty node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveEmpty

protected void leaveEmpty(CAstNode n,
                          CAstVisitor.Context c,
                          CAstVisitor visitor)
Leave an Empty node.

Parameters:
n - the node to process
c - a visitor-specific context

visitPrimitive

protected boolean visitPrimitive(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Visit a Primitive node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leavePrimitive

protected void leavePrimitive(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Leave a Primitive node.

Parameters:
n - the node to process
c - a visitor-specific context

visitVoid

protected boolean visitVoid(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Visit a Void node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveVoid

protected void leaveVoid(CAstNode n,
                         CAstVisitor.Context c,
                         CAstVisitor visitor)
Leave a Void node.

Parameters:
n - the node to process
c - a visitor-specific context

visitCast

protected boolean visitCast(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Visit a Cast node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveCast

protected void leaveCast(CAstNode n,
                         CAstVisitor.Context c,
                         CAstVisitor visitor)
Leave a Cast node.

Parameters:
n - the node to process
c - a visitor-specific context

visitInstanceOf

protected boolean visitInstanceOf(CAstNode n,
                                  CAstVisitor.Context c,
                                  CAstVisitor visitor)
Visit an InstanceOf node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveInstanceOf

protected void leaveInstanceOf(CAstNode n,
                               CAstVisitor.Context c,
                               CAstVisitor visitor)
Leave an InstanceOf node.

Parameters:
n - the node to process
c - a visitor-specific context

visitAssert

protected boolean visitAssert(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Visit an InstanceOf node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveAssert

protected void leaveAssert(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Leave an InstanceOf node.

Parameters:
n - the node to process
c - a visitor-specific context

visitEachElementHasNext

protected boolean visitEachElementHasNext(CAstNode n,
                                          CAstVisitor.Context c,
                                          CAstVisitor visitor)
Visit an InstanceOf node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveEachElementHasNext

protected void leaveEachElementHasNext(CAstNode n,
                                       CAstVisitor.Context c,
                                       CAstVisitor visitor)
Leave an InstanceOf node.

Parameters:
n - the node to process
c - a visitor-specific context

visitEachElementGet

protected boolean visitEachElementGet(CAstNode n,
                                      CAstVisitor.Context c,
                                      CAstVisitor visitor)
Visit an InstanceOf node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveEachElementGet

protected void leaveEachElementGet(CAstNode n,
                                   CAstVisitor.Context c,
                                   CAstVisitor visitor)
Leave an FOR_EACH_ELEMENT_GET node.

Parameters:
n - the node to process
c - a visitor-specific context

visitTypeLiteralExpr

protected boolean visitTypeLiteralExpr(CAstNode n,
                                       CAstVisitor.Context c,
                                       CAstVisitor visitor)
Visit an TYPE_LITERAL_EXPR node.

Parameters:
n - the node to process
c - a visitor-specific context
Returns:
true if no further processing is needed

leaveTypeLiteralExpr

protected void leaveTypeLiteralExpr(CAstNode n,
                                    CAstVisitor.Context c,
                                    CAstVisitor visitor)
Leave an TYPE_LITERAL_EXPR node.

Parameters:
n - the node to process
c - a visitor-specific context

visitIsDefinedExpr

protected boolean visitIsDefinedExpr(CAstNode n,
                                     CAstVisitor.Context c,
                                     CAstVisitor visitor)

leaveIsDefinedExpr

protected void leaveIsDefinedExpr(CAstNode n,
                                  CAstVisitor.Context c,
                                  CAstVisitor visitor)
Leave an IS_DEFINED_EXPR node.

Parameters:
n - the node to process
c - a visitor-specific context