Package com.ibm.wala.cast.tree.visit
Class CAstVisitor<C extends CAstVisitor.Context>
- java.lang.Object
-
- com.ibm.wala.cast.tree.visit.CAstVisitor<C>
-
- Direct Known Subclasses:
AstTranslator,CAstPattern.Matcher,DelegatingCAstVisitor,ExposedNamesCollector
public abstract class CAstVisitor<C extends CAstVisitor.Context> extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCAstVisitor.ContextThis interface represents a visitor-specific context.
-
Field Summary
Fields Modifier and Type Field Description protected CAstSourcePositionMap.PositioncurrentPositionstatic booleanDEBUG
-
Constructor Summary
Constructors Modifier Constructor Description protectedCAstVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleandoVisit(CAstNode n, C context, CAstVisitor<C> visitor)Node processing hook; sub-classes are expected to override if they introduce new node types.protected booleandoVisitArrayRefNode(CAstNode n, CAstNode v, CAstNode a, boolean assign, boolean preOp, C context, CAstVisitor<C> visitor)Process the given array reference node.protected booleandoVisitAssignNodes(CAstNode n, C context, CAstNode v, CAstNode a, CAstVisitor<C> 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 booleandoVisitEntity(CAstEntity n, C context, CAstVisitor<C> visitor)Entity processing hook; sub-classes are expected to override if they introduce new entity types.protected booleanenterEntity(CAstEntity n, C context, CAstVisitor<C> visitor)Enter the entity visitor.protected booleanenterNode(CAstNode n, C c, CAstVisitor<C> visitor)Enter the node visitor.CAstSourcePositionMap.PositiongetCurrentPosition()protected CAstEntitygetParent(CAstEntity entity)Get the parent entity for a given entity.protected voidleaveArrayLength(CAstNode n, C c, CAstVisitor<C> visitor)Leave an ArrayLength node.protected voidleaveArrayLiteral(CAstNode n, C c, CAstVisitor<C> visitor)Leave a ArrayLiteral node.protected voidleaveArrayLiteralInitElement(CAstNode n, int i, C c, CAstVisitor<C> visitor)Visit an ArrayLiteral node after processing the {i}th element initializer.protected voidleaveArrayLiteralObject(CAstNode n, C c, CAstVisitor<C> visitor)Visit an ArrayLiteral node after processing the array object.protected voidleaveArrayRef(CAstNode n, C c, CAstVisitor<C> visitor)Leave an ArrayRef node.protected voidleaveArrayRefAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)Visit an ArrayRef Assignment node after visiting the LHS.protected voidleaveArrayRefAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)Visit an ArrayRef Op/Assignment node after visiting the LHS.protected voidleaveAssert(CAstNode n, C c, CAstVisitor<C> visitor)Visit an InstanceOf node.voidleaveAssign(CAstNode n, C c, CAstVisitor<C> visitor)Leave an Assign node.protected voidleaveBinaryExpr(CAstNode n, C c, CAstVisitor<C> visitor)Leave a BinaryExpr node.protected voidleaveBlockExpr(CAstNode n, C c, CAstVisitor<C> visitor)Leave a BlockExpr node.protected voidleaveBlockExprAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)Visit a BlockExpr Assignment node after visiting the LHS.protected voidleaveBlockExprAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)Visit a BlockExpr Op/Assignment node after visiting the LHS.protected voidleaveBlockStmt(CAstNode n, C c, CAstVisitor<C> visitor)Leave a BlockStmt node.protected voidleaveCall(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Call node.protected voidleaveCast(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Cast node.protected voidleaveCatch(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Catch node.protected voidleaveConstant(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Constant node.protected voidleaveDeclStmt(CAstNode n, C c, CAstVisitor<C> visitor)Leave a DeclStmt node.protected voidleaveEachElementGet(CAstNode n, C c, CAstVisitor<C> visitor)Leave an FOR_EACH_ELEMENT_GET node.protected voidleaveEachElementHasNext(CAstNode n, C c, CAstVisitor<C> visitor)protected voidleaveEcho(CAstNode n, C c, CAstVisitor<C> visitor)Leave an ECHO node.protected voidleaveEmpty(CAstNode n, C c, CAstVisitor<C> visitor)Leave an Empty node.voidleaveEntity(CAstEntity n, C context, CAstVisitor<C> visitor)Leave any entity.protected voidleaveFieldEntity(CAstEntity n, C context, CAstVisitor<C> visitor)Leave a Field entity.protected voidleaveFileEntity(CAstEntity n, C context, C fileContext, CAstVisitor<C> visitor)Leave a File entity.protected voidleaveForIn(CAstNode n, C c, CAstVisitor<C> visitor)Leave a For..In node.protected voidleaveFunctionEntity(CAstEntity n, C context, C codeContext, CAstVisitor<C> visitor)Leave a Function entity.protected voidleaveFunctionExpr(CAstNode n, C c, CAstVisitor<C> visitor)Leave a FunctionExpr node.protected voidleaveFunctionStmt(CAstNode n, C c, CAstVisitor<C> visitor)Leave a FunctionStmt node.protected voidleaveGetCaughtException(CAstNode n, C c, CAstVisitor<C> visitor)Leave a GetCaughtException node.protected voidleaveGlobalEntity(CAstEntity n, C context, CAstVisitor<C> visitor)Leave a Field entity.protected voidleaveGoto(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Goto node.protected voidleaveIfExpr(CAstNode n, C c, CAstVisitor<C> visitor)Leave an IfExpr node.protected voidleaveIfExprCondition(CAstNode n, C c, CAstVisitor<C> visitor)Visit an IfExpr node after processing the condition.protected voidleaveIfExprTrueClause(CAstNode n, C c, CAstVisitor<C> visitor)Visit an IfExpr node after processing the true clause.protected voidleaveIfgoto(CAstNode n, C c, CAstVisitor<C> visitor)Leave an Ifgoto node.protected voidleaveIfStmt(CAstNode n, C c, CAstVisitor<C> visitor)Leave an IfStmt node.protected voidleaveIfStmtCondition(CAstNode n, C c, CAstVisitor<C> visitor)Visit an IfStmt node after processing the condition.protected voidleaveIfStmtTrueClause(CAstNode n, C c, CAstVisitor<C> visitor)Visit an IfStmt node after processing the true clause.protected voidleaveInclude(CAstNode n, C c, CAstVisitor<C> visitor)Leave an INCLUDE node.protected voidleaveInstanceOf(CAstNode n, C c, CAstVisitor<C> visitor)Leave an InstanceOf node.protected voidleaveIsDefinedExpr(CAstNode n, C c, CAstVisitor<C> visitor)Leave an IS_DEFINED_EXPR node.protected voidleaveLabelStmt(CAstNode n, C c, CAstVisitor<C> visitor)Leave a LabelStmt node.protected voidleaveLocalScope(CAstNode n, C c, CAstVisitor<C> visitor)Leave a LocalScope node.protected voidleaveLoop(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Loop node.protected voidleaveLoopHeader(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Loop node after processing the loop header.protected voidleaveMacroEntity(CAstEntity n, C context, C codeContext, CAstVisitor<C> visitor)Leave a Macro entity.protected voidleaveMacroVar(CAstNode n, C c, CAstVisitor<C> visitor)Leave an MACRO_VAR node.protected voidleaveNew(CAstNode n, C c, CAstVisitor<C> visitor)Leave a New node.voidleaveNode(CAstNode n, C c, CAstVisitor<C> visitor)Leave any node.protected voidleaveObjectLiteral(CAstNode n, C c, CAstVisitor<C> visitor)Leave an ObjectLiteral node.protected voidleaveObjectLiteralFieldInit(CAstNode n, int i, C c, CAstVisitor<C> visitor)Visit an ObjectLiteral node after processing the {i}th field initializer.protected voidleaveObjectRef(CAstNode n, C c, CAstVisitor<C> visitor)Leave an ObjectRef node.protected voidleaveObjectRefAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)Visit an ObjectRef Assignment node after visiting the LHS.protected voidleaveObjectRefAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)Visit an ObjectRef Op/Assignment node after visiting the LHS.protected voidleavePrimitive(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Primitive node.protected voidleaveReturn(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Return node.protected voidleaveScriptEntity(CAstEntity n, C context, C codeContext, CAstVisitor<C> visitor)Leave a Script entity.protected voidleaveSpecialParentScope(CAstNode n, C context, CAstVisitor<C> visitor)protected voidleaveSuper(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Super node.protected voidleaveSwitch(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Switch node.protected voidleaveSwitchValue(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Switch node after processing the switch value.protected voidleaveThis(CAstNode n, C c, CAstVisitor<C> visitor)Leave a This node.protected voidleaveThrow(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Throw node.protected voidleaveTry(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Try node.protected voidleaveTryBlock(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Try node after processing the try block.protected voidleaveTypeEntity(CAstEntity n, C context, C typeContext, CAstVisitor<C> visitor)Leave a Type entity.protected voidleaveTypeLiteralExpr(CAstNode n, C c, CAstVisitor<C> visitor)Leave an TYPE_LITERAL_EXPR node.protected voidleaveUnaryExpr(CAstNode n, C c, CAstVisitor<C> visitor)Leave a UnaryExpr node.protected voidleaveUnwind(CAstNode n, C c, CAstVisitor<C> visitor)Leave an Unwind node.protected voidleaveVar(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Var node.protected voidleaveVarAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)Visit a Var Assignment node after visiting the LHS.protected voidleaveVarAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)Visit a Var Op/Assignment node after visiting the LHS.protected voidleaveVoid(CAstNode n, C c, CAstVisitor<C> visitor)Leave a Void node.protected CmakeCodeContext(C context, CAstEntity n)Construct a context for a Code entity.protected CmakeFileContext(C context, CAstEntity n)Construct a context for a File entity.protected CmakeLocalContext(C context, CAstNode n)Construct a context for a LocalScope node.protected CmakeSpecialParentContext(C context, CAstNode n)protected CmakeTypeContext(C context, CAstEntity n)Construct a context for a Type entity.protected CmakeUnwindContext(C context, CAstNode n, CAstVisitor<C> visitor)Construct a context for an Unwind node.protected voidpostProcessEntity(CAstEntity n, C context, CAstVisitor<C> visitor)Post-process an entity after visiting it.protected voidpostProcessNode(CAstNode n, C c, CAstVisitor<C> visitor)Post-process a node after visiting it.protected voidsetParent(CAstEntity entity, CAstEntity parent)Set the parent entity for a given entity.voidvisit(CAstNode n, C context, CAstVisitor<C> visitor)Recursively visit a given node.voidvisitAllChildren(CAstNode n, C context, CAstVisitor<C> visitor)Visit all children of a node.protected booleanvisitArrayLength(CAstNode n, C c, CAstVisitor<C> visitor)Visit an ArrayLength node.protected booleanvisitArrayLiteral(CAstNode n, C c, CAstVisitor<C> visitor)Visit an ArrayLiteral node.protected booleanvisitArrayRef(CAstNode n, C c, CAstVisitor<C> visitor)Visit an ArrayRef node.protected booleanvisitArrayRefAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)Visit an ArrayRef Assignment node after visiting the RHS.protected booleanvisitArrayRefAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)Visit an ArrayRef Op/Assignment node after visiting the RHS.protected booleanvisitAssert(CAstNode n, C c, CAstVisitor<C> visitor)booleanvisitAssign(CAstNode n, C c, CAstVisitor<C> visitor)Visit an Assign node.protected booleanvisitAssignNodes(CAstNode n, C context, CAstNode v, CAstNode a, CAstVisitor<C> visitor)protected booleanvisitBinaryExpr(CAstNode n, C c, CAstVisitor<C> visitor)Visit a BinaryExpr node.protected booleanvisitBlockExpr(CAstNode n, C c, CAstVisitor<C> visitor)Visit a BlockExpr node.protected booleanvisitBlockExprAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)Visit a BlockExpr Assignment node after visiting the RHS.protected booleanvisitBlockExprAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)Visit a BlockExpr Op/Assignment node after visiting the RHS.protected booleanvisitBlockStmt(CAstNode n, C c, CAstVisitor<C> visitor)Visit a BlockStmt node.protected booleanvisitCall(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Call node.protected booleanvisitCast(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Cast node.protected booleanvisitCatch(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Catch node.voidvisitChildren(CAstNode n, int start, C context, CAstVisitor<C> visitor)Visit children of a node starting at a given index.protected booleanvisitConstant(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Constant node.protected booleanvisitDeclStmt(CAstNode n, C c, CAstVisitor<C> visitor)Visit a DeclStmt node.protected booleanvisitEachElementGet(CAstNode n, C c, CAstVisitor<C> visitor)Visit an InstanceOf node.protected booleanvisitEachElementHasNext(CAstNode n, C c, CAstVisitor<C> visitor)Leave an InstanceOf node.protected booleanvisitEcho(CAstNode n, C c, CAstVisitor<C> visitor)protected booleanvisitEmpty(CAstNode n, C c, CAstVisitor<C> visitor)Visit an Empty node.voidvisitEntities(CAstEntity n, C context, CAstVisitor<C> visitor)Recursively visit an entity.booleanvisitEntity(CAstEntity n, C context, CAstVisitor<C> visitor)Visit any entity.protected booleanvisitFieldEntity(CAstEntity n, C context, CAstVisitor<C> visitor)Visit a Field entity.protected booleanvisitFileEntity(CAstEntity n, C context, C fileC, CAstVisitor<C> visitor)Visit a File entity.protected booleanvisitForIn(CAstNode n, C c, CAstVisitor<C> visitor)Visit a For..In node.protected booleanvisitFunctionEntity(CAstEntity n, C context, C codeContext, CAstVisitor<C> visitor)Visit a Function entity.protected booleanvisitFunctionExpr(CAstNode n, C c, CAstVisitor<C> visitor)Visit a FunctionExpr node.protected booleanvisitFunctionStmt(CAstNode n, C c, CAstVisitor<C> visitor)Visit a FunctionStmt node.protected booleanvisitGetCaughtException(CAstNode n, C c, CAstVisitor<C> visitor)Visit a GetCaughtException node.protected booleanvisitGlobalEntity(CAstEntity n, C context, CAstVisitor<C> visitor)Visit a Field entity.protected booleanvisitGoto(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Goto node.protected booleanvisitIfExpr(CAstNode n, C c, CAstVisitor<C> visitor)Visit an IfExpr node.protected booleanvisitIfgoto(CAstNode n, C c, CAstVisitor<C> visitor)Visit an Ifgoto node.protected booleanvisitIfStmt(CAstNode n, C c, CAstVisitor<C> visitor)Visit an IfStmt node.protected booleanvisitInclude(CAstNode n, C c, CAstVisitor<C> visitor)protected booleanvisitInstanceOf(CAstNode n, C c, CAstVisitor<C> visitor)Visit an InstanceOf node.protected booleanvisitIsDefinedExpr(CAstNode n, C c, CAstVisitor<C> visitor)protected booleanvisitLabelStmt(CAstNode n, C c, CAstVisitor<C> visitor)Visit a LabelStmt node.protected booleanvisitLocalScope(CAstNode n, C c, CAstVisitor<C> visitor)Visit a LocalScope node.protected booleanvisitLoop(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Loop node.protected booleanvisitMacroEntity(CAstEntity n, C context, C codeContext, CAstVisitor<C> visitor)Visit a Macro entity.protected booleanvisitMacroVar(CAstNode n, C c, CAstVisitor<C> visitor)protected booleanvisitNew(CAstNode n, C c, CAstVisitor<C> visitor)Visit a New node.booleanvisitNode(CAstNode n, C c, CAstVisitor<C> visitor)Visit any node.protected booleanvisitObjectLiteral(CAstNode n, C c, CAstVisitor<C> visitor)Visit an ObjectLiteral node.protected booleanvisitObjectRef(CAstNode n, C c, CAstVisitor<C> visitor)Visit an ObjectRef node.protected booleanvisitObjectRefAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)Visit an ObjectRef Assignment node after visiting the RHS.protected booleanvisitObjectRefAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)Visit an ObjectRef Op/Assignment node after visiting the RHS.protected booleanvisitPrimitive(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Primitive node.protected booleanvisitReturn(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Return node.voidvisitScopedEntities(CAstEntity n, Iterator i, C context, CAstVisitor<C> visitor)voidvisitScopedEntities(CAstEntity n, Map allScopedEntities, C context, CAstVisitor<C> visitor)Visit scoped entities of an entity using a given iterator.protected booleanvisitScriptEntity(CAstEntity n, C context, C codeContext, CAstVisitor<C> visitor)Visit a Script entity.protected booleanvisitSpecialParentScope(CAstNode n, C context, CAstVisitor<C> visitor)protected booleanvisitSuper(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Super node.protected booleanvisitSwitch(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Switch node.protected booleanvisitThis(CAstNode n, C c, CAstVisitor<C> visitor)Visit a This node.protected booleanvisitThrow(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Throw node.protected booleanvisitTry(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Try node.protected booleanvisitTypeEntity(CAstEntity n, C context, C typeContext, CAstVisitor<C> visitor)Visit a Type entity.protected booleanvisitTypeLiteralExpr(CAstNode n, C c, CAstVisitor<C> visitor)Visit an TYPE_LITERAL_EXPR node.protected booleanvisitUnaryExpr(CAstNode n, C c, CAstVisitor<C> visitor)Visit a UnaryExpr node.protected booleanvisitUnwind(CAstNode n, C c, CAstVisitor<C> visitor)Visit an Unwind node.protected booleanvisitVar(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Var node.protected booleanvisitVarAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)Visit a Var Assignment node after visiting the RHS.protected booleanvisitVarAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)Visit a Var Op/Assignment node after visiting the RHS.protected booleanvisitVoid(CAstNode n, C c, CAstVisitor<C> visitor)Visit a Void node.
-
-
-
Field Detail
-
DEBUG
public static boolean DEBUG
-
currentPosition
protected CAstSourcePositionMap.Position currentPosition
-
-
Method Detail
-
getCurrentPosition
public CAstSourcePositionMap.Position getCurrentPosition()
-
makeFileContext
protected C makeFileContext(C context, CAstEntity n)
Construct a context for a File entity.- Parameters:
context- a visitor-specific context in which this file was visitedn- the file entity
-
makeTypeContext
protected C makeTypeContext(C context, CAstEntity n)
Construct a context for a Type entity.- Parameters:
context- a visitor-specific context in which this type was visitedn- the type entity
-
makeCodeContext
protected C makeCodeContext(C context, CAstEntity n)
Construct a context for a Code entity.- Parameters:
context- a visitor-specific context in which the code was visitedn- the code entity
-
makeLocalContext
protected C makeLocalContext(C context, CAstNode n)
Construct a context for a LocalScope node.- Parameters:
context- a visitor-specific context in which the local scope was visitedn- the local scope node
-
makeUnwindContext
protected C makeUnwindContext(C context, CAstNode n, CAstVisitor<C> visitor)
Construct a context for an Unwind node.- Parameters:
context- a visitor-specific context in which the unwind was visitedn- 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 entityparent- the parent entity
-
doVisitEntity
protected boolean doVisitEntity(CAstEntity n, C context, CAstVisitor<C> 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, Map allScopedEntities, C context, CAstVisitor<C> 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 processi- the iterator over some scoped entities of ncontext- a visitor-specific context
-
visitScopedEntities
public final void visitScopedEntities(CAstEntity n, Iterator i, C context, CAstVisitor<C> visitor)
-
visitEntities
public final void visitEntities(CAstEntity n, C context, CAstVisitor<C> visitor)
Recursively visit an entity.- Parameters:
n- the entity to processcontext- a visitor-specific context
-
enterEntity
protected boolean enterEntity(CAstEntity n, C context, CAstVisitor<C> visitor)
Enter the entity visitor.- Parameters:
n- the entity to processcontext- a visitor-specific context- Returns:
- true if no further processing is needed
-
postProcessEntity
protected void postProcessEntity(CAstEntity n, C context, CAstVisitor<C> visitor)
Post-process an entity after visiting it.- Parameters:
n- the entity to processcontext- a visitor-specific context
-
visitEntity
public boolean visitEntity(CAstEntity n, C context, CAstVisitor<C> visitor)
Visit any entity. Override only this to change behavior for all entities.- Parameters:
n- the entity to processcontext- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveEntity
public void leaveEntity(CAstEntity n, C context, CAstVisitor<C> visitor)
Leave any entity. Override only this to change behavior for all entities.- Parameters:
n- the entity to processcontext- a visitor-specific context
-
visitFileEntity
protected boolean visitFileEntity(CAstEntity n, C context, C fileC, CAstVisitor<C> visitor)
Visit a File entity.- Parameters:
n- the entity to processcontext- a visitor-specific contextfileC- a visitor-specific context for this file- Returns:
- true if no further processing is needed
-
leaveFileEntity
protected void leaveFileEntity(CAstEntity n, C context, C fileContext, CAstVisitor<C> visitor)
Leave a File entity.- Parameters:
n- the entity to processcontext- a visitor-specific contextfileContext- a visitor-specific context for this file
-
visitFieldEntity
protected boolean visitFieldEntity(CAstEntity n, C context, CAstVisitor<C> visitor)
Visit a Field entity.- Parameters:
n- the entity to processcontext- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveFieldEntity
protected void leaveFieldEntity(CAstEntity n, C context, CAstVisitor<C> visitor)
Leave a Field entity.- Parameters:
n- the entity to processcontext- a visitor-specific context
-
visitGlobalEntity
protected boolean visitGlobalEntity(CAstEntity n, C context, CAstVisitor<C> visitor)
Visit a Field entity.- Parameters:
n- the entity to processcontext- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveGlobalEntity
protected void leaveGlobalEntity(CAstEntity n, C context, CAstVisitor<C> visitor)
Leave a Field entity.- Parameters:
n- the entity to processcontext- a visitor-specific context
-
visitTypeEntity
protected boolean visitTypeEntity(CAstEntity n, C context, C typeContext, CAstVisitor<C> visitor)
Visit a Type entity.- Parameters:
n- the entity to processcontext- a visitor-specific contexttypeContext- a visitor-specific context for this type- Returns:
- true if no further processing is needed
-
leaveTypeEntity
protected void leaveTypeEntity(CAstEntity n, C context, C typeContext, CAstVisitor<C> visitor)
Leave a Type entity.- Parameters:
n- the entity to processcontext- a visitor-specific contexttypeContext- a visitor-specific context for this type
-
visitFunctionEntity
protected boolean visitFunctionEntity(CAstEntity n, C context, C codeContext, CAstVisitor<C> visitor)
Visit a Function entity.- Parameters:
n- the entity to processcontext- a visitor-specific contextcodeContext- a visitor-specific context for this function- Returns:
- true if no further processing is needed
-
leaveFunctionEntity
protected void leaveFunctionEntity(CAstEntity n, C context, C codeContext, CAstVisitor<C> visitor)
Leave a Function entity.- Parameters:
n- the entity to processcontext- a visitor-specific contextcodeContext- a visitor-specific context for this function
-
visitMacroEntity
protected boolean visitMacroEntity(CAstEntity n, C context, C codeContext, CAstVisitor<C> visitor)
Visit a Macro entity.- Parameters:
n- the entity to processcontext- a visitor-specific contextcodeContext- a visitor-specific context for this macro- Returns:
- true if no further processing is needed
-
leaveMacroEntity
protected void leaveMacroEntity(CAstEntity n, C context, C codeContext, CAstVisitor<C> visitor)
Leave a Macro entity.- Parameters:
n- the entity to processcontext- a visitor-specific contextcodeContext- a visitor-specific context for this macro
-
visitScriptEntity
protected boolean visitScriptEntity(CAstEntity n, C context, C codeContext, CAstVisitor<C> visitor)
Visit a Script entity.- Parameters:
n- the entity to processcontext- a visitor-specific contextcodeContext- a visitor-specific context for this script- Returns:
- true if no further processing is needed
-
leaveScriptEntity
protected void leaveScriptEntity(CAstEntity n, C context, C codeContext, CAstVisitor<C> visitor)
Leave a Script entity.- Parameters:
n- the entity to processcontext- a visitor-specific contextcodeContext- a visitor-specific context for this script
-
doVisit
protected boolean doVisit(CAstNode n, C context, CAstVisitor<C> 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, C context, CAstNode v, CAstNode a, CAstVisitor<C> 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, C context, CAstVisitor<C> visitor)
Visit children of a node starting at a given index.- Parameters:
n- the parent node of the nodes to processstart- the starting index of the nodes to processcontext- a visitor-specific context
-
visitAllChildren
public final void visitAllChildren(CAstNode n, C context, CAstVisitor<C> visitor)
Visit all children of a node.- Parameters:
n- the parent node of the nodes to processcontext- a visitor-specific context
-
visit
public final void visit(CAstNode n, C context, CAstVisitor<C> visitor)
Recursively visit a given node. TODO: do assertions about structure belong here?- Parameters:
n- the node to processcontext- a visitor-specific context
-
leaveSpecialParentScope
protected void leaveSpecialParentScope(CAstNode n, C context, CAstVisitor<C> visitor)
-
visitSpecialParentScope
protected boolean visitSpecialParentScope(CAstNode n, C context, CAstVisitor<C> visitor)
-
doVisitArrayRefNode
protected boolean doVisitArrayRefNode(CAstNode n, CAstNode v, CAstNode a, boolean assign, boolean preOp, C context, CAstVisitor<C> visitor)
Process the given array reference node. Factored out so that derived languages can reuse this code for specially-marked types of array references (as in X10, for which different instruction types get generated, but whose structure is essentially the same as an ordinary array reference).
-
visitAssignNodes
protected boolean visitAssignNodes(CAstNode n, C context, CAstNode v, CAstNode a, CAstVisitor<C> visitor)
-
enterNode
protected boolean enterNode(CAstNode n, C c, CAstVisitor<C> visitor)
Enter the node visitor.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
postProcessNode
protected void postProcessNode(CAstNode n, C c, CAstVisitor<C> visitor)
Post-process a node after visiting it.- Parameters:
n- the node to processc- a visitor-specific context
-
visitNode
public boolean visitNode(CAstNode n, C c, CAstVisitor<C> visitor)
Visit any node. Override only this to change behavior for all nodes.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveNode
public void leaveNode(CAstNode n, C c, CAstVisitor<C> visitor)
Leave any node. Override only this to change behavior for all nodes.- Parameters:
n- the node to processc- a visitor-specific context
-
visitFunctionExpr
protected boolean visitFunctionExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a FunctionExpr node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveFunctionExpr
protected void leaveFunctionExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a FunctionExpr node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitFunctionStmt
protected boolean visitFunctionStmt(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a FunctionStmt node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveFunctionStmt
protected void leaveFunctionStmt(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a FunctionStmt node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitLocalScope
protected boolean visitLocalScope(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a LocalScope node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveLocalScope
protected void leaveLocalScope(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a LocalScope node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitBlockExpr
protected boolean visitBlockExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a BlockExpr node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveBlockExpr
protected void leaveBlockExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a BlockExpr node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitBlockStmt
protected boolean visitBlockStmt(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a BlockStmt node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveBlockStmt
protected void leaveBlockStmt(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a BlockStmt node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitLoop
protected boolean visitLoop(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Loop node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
visitForIn
protected boolean visitForIn(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a For..In node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveLoopHeader
protected void leaveLoopHeader(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Loop node after processing the loop header.- Parameters:
n- the node to processc- a visitor-specific context
-
leaveLoop
protected void leaveLoop(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Loop node.- Parameters:
n- the node to processc- a visitor-specific context
-
leaveForIn
protected void leaveForIn(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a For..In node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitGetCaughtException
protected boolean visitGetCaughtException(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a GetCaughtException node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveGetCaughtException
protected void leaveGetCaughtException(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a GetCaughtException node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitThis
protected boolean visitThis(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a This node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveThis
protected void leaveThis(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a This node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitSuper
protected boolean visitSuper(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Super node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveSuper
protected void leaveSuper(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Super node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitCall
protected boolean visitCall(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Call node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveCall
protected void leaveCall(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Call node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitVar
protected boolean visitVar(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Var node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveVar
protected void leaveVar(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Var node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitConstant
protected boolean visitConstant(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Constant node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveConstant
protected void leaveConstant(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Constant node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitBinaryExpr
protected boolean visitBinaryExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a BinaryExpr node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveBinaryExpr
protected void leaveBinaryExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a BinaryExpr node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitUnaryExpr
protected boolean visitUnaryExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a UnaryExpr node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveUnaryExpr
protected void leaveUnaryExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a UnaryExpr node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitArrayLength
protected boolean visitArrayLength(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an ArrayLength node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveArrayLength
protected void leaveArrayLength(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an ArrayLength node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitArrayRef
protected boolean visitArrayRef(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an ArrayRef node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveArrayRef
protected void leaveArrayRef(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an ArrayRef node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitDeclStmt
protected boolean visitDeclStmt(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a DeclStmt node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveDeclStmt
protected void leaveDeclStmt(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a DeclStmt node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitReturn
protected boolean visitReturn(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Return node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveReturn
protected void leaveReturn(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Return node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitIfgoto
protected boolean visitIfgoto(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an Ifgoto node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveIfgoto
protected void leaveIfgoto(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an Ifgoto node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitGoto
protected boolean visitGoto(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Goto node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveGoto
protected void leaveGoto(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Goto node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitLabelStmt
protected boolean visitLabelStmt(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a LabelStmt node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveLabelStmt
protected void leaveLabelStmt(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a LabelStmt node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitIfStmt
protected boolean visitIfStmt(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an IfStmt node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveIfStmtCondition
protected void leaveIfStmtCondition(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an IfStmt node after processing the condition.- Parameters:
n- the node to processc- a visitor-specific context
-
leaveIfStmtTrueClause
protected void leaveIfStmtTrueClause(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an IfStmt node after processing the true clause.- Parameters:
n- the node to processc- a visitor-specific context
-
leaveIfStmt
protected void leaveIfStmt(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an IfStmt node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitIfExpr
protected boolean visitIfExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an IfExpr node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveIfExprCondition
protected void leaveIfExprCondition(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an IfExpr node after processing the condition.- Parameters:
n- the node to processc- a visitor-specific context
-
leaveIfExprTrueClause
protected void leaveIfExprTrueClause(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an IfExpr node after processing the true clause.- Parameters:
n- the node to processc- a visitor-specific context
-
leaveIfExpr
protected void leaveIfExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an IfExpr node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitNew
protected boolean visitNew(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a New node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveNew
protected void leaveNew(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a New node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitObjectLiteral
protected boolean visitObjectLiteral(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an ObjectLiteral node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveObjectLiteralFieldInit
protected void leaveObjectLiteralFieldInit(CAstNode n, int i, C c, CAstVisitor<C> visitor)
Visit an ObjectLiteral node after processing the {i}th field initializer.- Parameters:
n- the node to processi- the field position that was initializedc- a visitor-specific context
-
leaveObjectLiteral
protected void leaveObjectLiteral(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an ObjectLiteral node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitArrayLiteral
protected boolean visitArrayLiteral(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an ArrayLiteral node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveArrayLiteralObject
protected void leaveArrayLiteralObject(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an ArrayLiteral node after processing the array object.- Parameters:
n- the node to processc- a visitor-specific context
-
leaveArrayLiteralInitElement
protected void leaveArrayLiteralInitElement(CAstNode n, int i, C c, CAstVisitor<C> visitor)
Visit an ArrayLiteral node after processing the {i}th element initializer.- Parameters:
n- the node to processi- the index that was initializedc- a visitor-specific context
-
leaveArrayLiteral
protected void leaveArrayLiteral(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a ArrayLiteral node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitObjectRef
protected boolean visitObjectRef(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an ObjectRef node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveObjectRef
protected void leaveObjectRef(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an ObjectRef node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitAssign
public boolean visitAssign(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an Assign node. Override only this to change behavior for all assignment nodes.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveAssign
public void leaveAssign(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an Assign node. Override only this to change behavior for all assignment nodes.- Parameters:
n- the node to processc- a visitor-specific context
-
visitArrayRefAssign
protected boolean visitArrayRefAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)
Visit an ArrayRef Assignment node after visiting the RHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveArrayRefAssign
protected void leaveArrayRefAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)
Visit an ArrayRef Assignment node after visiting the LHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processc- a visitor-specific context
-
visitArrayRefAssignOp
protected boolean visitArrayRefAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)
Visit an ArrayRef Op/Assignment node after visiting the RHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processpre- whether the value before the operation should be usedc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveArrayRefAssignOp
protected void leaveArrayRefAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)
Visit an ArrayRef Op/Assignment node after visiting the LHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processpre- whether the value before the operation should be usedc- a visitor-specific context
-
visitObjectRefAssign
protected boolean visitObjectRefAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)
Visit an ObjectRef Assignment node after visiting the RHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveObjectRefAssign
protected void leaveObjectRefAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)
Visit an ObjectRef Assignment node after visiting the LHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processc- a visitor-specific context
-
visitObjectRefAssignOp
protected boolean visitObjectRefAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)
Visit an ObjectRef Op/Assignment node after visiting the RHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processpre- whether the value before the operation should be usedc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveObjectRefAssignOp
protected void leaveObjectRefAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)
Visit an ObjectRef Op/Assignment node after visiting the LHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processpre- whether the value before the operation should be usedc- a visitor-specific context
-
visitBlockExprAssign
protected boolean visitBlockExprAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)
Visit a BlockExpr Assignment node after visiting the RHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveBlockExprAssign
protected void leaveBlockExprAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)
Visit a BlockExpr Assignment node after visiting the LHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processc- a visitor-specific context
-
visitBlockExprAssignOp
protected boolean visitBlockExprAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)
Visit a BlockExpr Op/Assignment node after visiting the RHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processpre- whether the value before the operation should be usedc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveBlockExprAssignOp
protected void leaveBlockExprAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)
Visit a BlockExpr Op/Assignment node after visiting the LHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processpre- whether the value before the operation should be usedc- a visitor-specific context
-
visitVarAssign
protected boolean visitVarAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)
Visit a Var Assignment node after visiting the RHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveVarAssign
protected void leaveVarAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor<C> visitor)
Visit a Var Assignment node after visiting the LHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processc- a visitor-specific context
-
visitVarAssignOp
protected boolean visitVarAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)
Visit a Var Op/Assignment node after visiting the RHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processpre- whether the value before the operation should be usedc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveVarAssignOp
protected void leaveVarAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor<C> visitor)
Visit a Var Op/Assignment node after visiting the LHS.- Parameters:
n- the LHS node to processv- the RHS node to processa- the assignment node to processpre- whether the value before the operation should be usedc- a visitor-specific context
-
visitSwitch
protected boolean visitSwitch(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Switch node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveSwitchValue
protected void leaveSwitchValue(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Switch node after processing the switch value.- Parameters:
n- the node to processc- a visitor-specific context
-
leaveSwitch
protected void leaveSwitch(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Switch node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitThrow
protected boolean visitThrow(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Throw node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveThrow
protected void leaveThrow(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Throw node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitCatch
protected boolean visitCatch(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Catch node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveCatch
protected void leaveCatch(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Catch node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitUnwind
protected boolean visitUnwind(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an Unwind node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveUnwind
protected void leaveUnwind(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an Unwind node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitTry
protected boolean visitTry(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Try node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveTryBlock
protected void leaveTryBlock(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Try node after processing the try block.- Parameters:
n- the node to processc- a visitor-specific context
-
leaveTry
protected void leaveTry(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Try node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitEmpty
protected boolean visitEmpty(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an Empty node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveEmpty
protected void leaveEmpty(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an Empty node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitPrimitive
protected boolean visitPrimitive(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Primitive node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leavePrimitive
protected void leavePrimitive(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Primitive node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitVoid
protected boolean visitVoid(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Void node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveVoid
protected void leaveVoid(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Void node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitCast
protected boolean visitCast(CAstNode n, C c, CAstVisitor<C> visitor)
Visit a Cast node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveCast
protected void leaveCast(CAstNode n, C c, CAstVisitor<C> visitor)
Leave a Cast node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitInstanceOf
protected boolean visitInstanceOf(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an InstanceOf node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveInstanceOf
protected void leaveInstanceOf(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an InstanceOf node.- Parameters:
n- the node to processc- a visitor-specific context
-
leaveAssert
protected void leaveAssert(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an InstanceOf node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitAssert
protected boolean visitAssert(CAstNode n, C c, CAstVisitor<C> visitor)
-
visitEachElementHasNext
protected boolean visitEachElementHasNext(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an InstanceOf node.- Parameters:
n- the node to processc- a visitor-specific context
-
leaveEachElementHasNext
protected void leaveEachElementHasNext(CAstNode n, C c, CAstVisitor<C> visitor)
-
visitEachElementGet
protected boolean visitEachElementGet(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an InstanceOf node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveEachElementGet
protected void leaveEachElementGet(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an FOR_EACH_ELEMENT_GET node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitTypeLiteralExpr
protected boolean visitTypeLiteralExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Visit an TYPE_LITERAL_EXPR node.- Parameters:
n- the node to processc- a visitor-specific context- Returns:
- true if no further processing is needed
-
leaveTypeLiteralExpr
protected void leaveTypeLiteralExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an TYPE_LITERAL_EXPR node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitIsDefinedExpr
protected boolean visitIsDefinedExpr(CAstNode n, C c, CAstVisitor<C> visitor)
-
leaveIsDefinedExpr
protected void leaveIsDefinedExpr(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an IS_DEFINED_EXPR node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitEcho
protected boolean visitEcho(CAstNode n, C c, CAstVisitor<C> visitor)
-
leaveEcho
protected void leaveEcho(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an ECHO node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitInclude
protected boolean visitInclude(CAstNode n, C c, CAstVisitor<C> visitor)
-
leaveInclude
protected void leaveInclude(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an INCLUDE node.- Parameters:
n- the node to processc- a visitor-specific context
-
visitMacroVar
protected boolean visitMacroVar(CAstNode n, C c, CAstVisitor<C> visitor)
-
leaveMacroVar
protected void leaveMacroVar(CAstNode n, C c, CAstVisitor<C> visitor)
Leave an MACRO_VAR node.- Parameters:
n- the node to processc- a visitor-specific context
-
-