com.ibm.wala.cast.ir.translator
Class AstTranslator

java.lang.Object
  extended by com.ibm.wala.cast.tree.visit.CAstVisitor
      extended by com.ibm.wala.cast.ir.translator.AstTranslator
All Implemented Interfaces:
ArrayOpHandler, TranslatorToIR
Direct Known Subclasses:
JavaCAst2IRTranslator, JSAstTranslator

public abstract class AstTranslator
extends CAstVisitor
implements ArrayOpHandler, TranslatorToIR

Common code to translate CAst to IR. Must be specialized by each language to handle semantics appropriately.


Nested Class Summary
protected static class AstTranslator.AstCFG
          data structure for the final CFG for a method, based on the information in an AstTranslator.IncipientCFG
static class AstTranslator.AstLexicalInformation
          lexical access information for some entity scope.
 class AstTranslator.DefaultContext
           
protected  class AstTranslator.FinalCAstSymbol
           
 class AstTranslator.IncipientCFG
          holds the control-flow graph as it is being constructed.
static class AstTranslator.InternalCAstSymbol
           
protected static class AstTranslator.PreBasicBlock
          basic block implementation used in the CFGs constructed during the IR-generating AST traversal
static interface AstTranslator.Scope
          a scope in the symbol table built during AST traversal
static class AstTranslator.ScopeType
           
protected static interface AstTranslator.Symbol
          interface for name information stored in a symbol table.
protected  class AstTranslator.UnwindState
           
static interface AstTranslator.WalkContext
           
 
Nested classes/interfaces inherited from class com.ibm.wala.cast.tree.visit.CAstVisitor
CAstVisitor.Context
 
Field Summary
static boolean DEBUG_ALL
           
static boolean DEBUG_CFG
           
static boolean DEBUG_LEXICAL
           
static boolean DEBUG_NAMES
           
static boolean DEBUG_TOP
           
protected  SSAInstructionFactory insts
           
protected  IClassLoader loader
           
protected  java.util.Map namedEntityResolver
          for handling languages that let you include other source files named statically (e.g., ABAP)
 
Constructor Summary
protected AstTranslator(IClassLoader loader)
           
protected AstTranslator(IClassLoader loader, java.util.Map namedEntityResolver)
           
 
Method Summary
protected  void assignValue(CAstNode n, AstTranslator.WalkContext context, AstTranslator.Symbol ls, java.lang.String nm, int rval)
          assign rval to nm as appropriate, depending on the scope of ls
 void closeFunctionEntity(CAstEntity n, AstTranslator.WalkContext parentContext, AstTranslator.WalkContext functionContext)
           
protected abstract  java.lang.String composeEntityName(AstTranslator.WalkContext parent, CAstEntity f)
          create the language-appropriate name for f
protected abstract  void declareFunction(CAstEntity N, AstTranslator.WalkContext context)
          declare a new function, represented by N
protected abstract  TypeReference defaultCatchType()
          for a block that catches all exceptions, what is the root exception type that it can catch? E.g., for Java, java.lang.Throwable
protected abstract  void defineField(CAstEntity topEntity, AstTranslator.WalkContext context, CAstEntity fieldEntity)
          define a new field fieldEntity within topEntity
protected abstract  void defineFunction(CAstEntity N, AstTranslator.WalkContext definingContext, AbstractCFG cfg, SymbolTable symtab, boolean hasCatchBlock, TypeReference[][] caughtTypes, boolean hasMonitorOp, AstTranslator.AstLexicalInformation lexicalInfo, AstMethod.DebuggingInformation debugInfo)
          fully define a function.
protected abstract  boolean defineType(CAstEntity type, AstTranslator.WalkContext wc)
          define a new (presumably nested) type.
abstract  void doArrayRead(AstTranslator.WalkContext context, int result, int arrayValue, CAstNode arrayRef, int[] dimValues)
          generate IR for a CAst array read, updating context.cfg()
abstract  void doArrayWrite(AstTranslator.WalkContext context, int arrayValue, CAstNode arrayRef, int[] dimValues, int rval)
          generate IR for a CAst array write, updating context.cfg()
protected abstract  void doCall(AstTranslator.WalkContext context, CAstNode call, int result, int exception, CAstNode name, int receiver, int[] arguments)
          generate IR for a CAst method call expression, updating context.cfg()
protected abstract  void doFieldRead(AstTranslator.WalkContext context, int result, int receiver, CAstNode elt, CAstNode parent)
          generate IR for a CAst field read, updating context.cfg()
protected abstract  void doFieldWrite(AstTranslator.WalkContext context, int receiver, CAstNode elt, CAstNode parent, int rval)
          generate IR for a CAst field write, updating context.cfg()
protected  int doGlobalRead(CAstNode node, AstTranslator.WalkContext context, java.lang.String name)
          generate instructions for a read of a global
protected  void doGlobalWrite(AstTranslator.WalkContext context, java.lang.String name, int rval)
          generate instructions for a write of a global
protected  void doIsFieldDefined(AstTranslator.WalkContext context, int result, int ref, CAstNode field)
          generate instructions to check if ref has field, storing answer in result
protected  int doLexicallyScopedRead(CAstNode node, AstTranslator.WalkContext context, java.lang.String name)
          Note that the caller is responsible for ensuring that name is defined in a lexical scope.
protected  void doLexicallyScopedWrite(AstTranslator.WalkContext context, java.lang.String name, int rval)
          Note that the caller is responsible for ensuring that name is defined in a lexical scope.
protected  int doLocalRead(AstTranslator.WalkContext context, java.lang.String name)
          get the value number for a name defined locally (i.e., within the current method) by looking up the name in context.currentScope().
protected  void doLocalWrite(AstTranslator.WalkContext context, java.lang.String nm, int rval)
          add an AssignInstruction to context.cfg() that copies rval to the value number of local nm.
protected abstract  void doMaterializeFunction(CAstNode node, AstTranslator.WalkContext context, int result, int exception, CAstEntity fn)
          generate IR for a CAst function expression, updating context.cfg()
protected abstract  void doNewObject(AstTranslator.WalkContext context, CAstNode newNode, int result, java.lang.Object type, int[] arguments)
          generate IR for a CAst new expression, updating context.cfg()
protected abstract  void doPrimitive(int resultVal, AstTranslator.WalkContext context, CAstNode primitiveCall)
          generate IR for call modeling creation of primitive value, updating context.cfg()
protected  void doPrologue(AstTranslator.WalkContext context)
          generate prologue code for each function body
protected abstract  void doThrow(AstTranslator.WalkContext context, int exception)
          generate IR for a CAst throw expression, updating context.cfg()
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  AstTranslator.Scope getGlobalScope()
           
 CAstEntity getIncludedEntity(CAstNode n)
           
protected  CAstType getTypeForNode(AstTranslator.WalkContext context, CAstNode node)
           
 int getValue(CAstNode n)
           
protected  void handleUnspecifiedLiteralKey(AstTranslator.WalkContext context, CAstNode objectLiteralNode, int unspecifiedLiteralIndex, CAstVisitor visitor)
          some languages let you omit initialization of certain fields when writing an object literal (e.g., PHP).
protected  boolean hasImplicitGlobals()
          If this returns true, new global declarations get created for any attempt to access a non-existent variable (believe it or not, JavaScript actually does this!)
protected  boolean hasSpecialUndeclaredVariables()
          If this returns true, then attempts to lookup non-existent names return `null' rather than tripping an assertion.
protected  boolean hasValue(CAstNode n)
           
 void initFunctionEntity(CAstEntity n, AstTranslator.WalkContext parentContext, AstTranslator.WalkContext functionContext)
           
protected  boolean isExceptionLabel(java.lang.Object label)
           
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 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 leaveEcho(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an ECHO node.
protected  void leaveEmpty(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an Empty node.
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 leaveGlobalEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor visitor)
          Leave a Field entity.
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 leaveInclude(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Leave an INCLUDE 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.
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 c, CAstEntity n)
          Construct a context for a Code entity.
protected  CAstVisitor.Context makeFileContext(CAstVisitor.Context c, CAstEntity n)
          Construct a context for a File entity.
protected  FieldReference makeGlobalRef(java.lang.String globalName)
          creates a reference to a global named globalName.
protected  CAstVisitor.Context makeLocalContext(CAstVisitor.Context context, CAstNode n)
          Construct a context for a LocalScope node.
protected abstract  TypeReference makeType(CAstType type)
           
protected  CAstVisitor.Context makeTypeContext(CAstVisitor.Context c, CAstEntity n)
          Construct a context for a Type entity.
protected  AstTranslator.Scope makeTypeScope(CAstEntity type, AstTranslator.Scope parent)
           
protected  CAstVisitor.Context makeUnwindContext(CAstVisitor.Context context, CAstNode n, CAstVisitor visitor)
          Construct a context for an Unwind node.
protected  void postProcessNode(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Post-process a node after visiting it.
protected  int processAssignOp(CAstNode n, CAstNode v, CAstNode a, int temp, boolean post, CAstVisitor.Context c)
           
protected  int processFunctionExpr(CAstNode n, CAstVisitor.Context c)
           
protected  void processIf(CAstNode n, boolean isExpr, CAstVisitor.Context c, CAstVisitor visitor)
           
protected  void processObjectRefAssignOp(CAstNode n, CAstNode v, CAstNode a, CAstVisitor.Context c)
           
 void setArrayOpHandler(ArrayOpHandler arrayOpHandler)
           
 int setValue(CAstNode n, int v)
           
protected  boolean topLevelFunctionsInGlobalScope()
           
 void translate(CAstEntity N, ModuleEntry module)
          translate module, represented by CAstEntity N
protected  IBinaryOpInstruction.IOperator translateBinaryOpcode(CAstNode op)
           
protected  IConditionalBranchInstruction.IOperator translateConditionOpcode(CAstNode op)
           
protected  IUnaryOpInstruction.IOperator translateUnaryOpcode(CAstNode op)
           
protected abstract  boolean treatGlobalsAsLexicallyScoped()
          can lexical reads / writes access globals?
protected abstract  boolean useDefaultInitValues()
          does the language care about using type-appropriate default values? For Java, the answer is yes (ints should get a default value of 0, null for pointers, etc.).
protected abstract  boolean useLocalValuesForLexicalVars()
          given accesses in a method to variables defined in an enclosing lexical scope, is it legal to read the variable into a local l once at the beginning of the method, operate on l through the method body (rather than performing separate lexical read / write operations), and write back the value in l (if necessary) at the end of the method?
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 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 visitCatch(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a Catch node.
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 visitEcho(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
           
protected  boolean visitEmpty(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit an Empty node.
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 visitGlobalEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor visitor)
          Visit a Field entity.
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 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 visitMacroEntity(CAstEntity n, CAstVisitor.Context context, CAstVisitor.Context codeContext, CAstVisitor visitor)
          Visit a Macro entity.
protected  boolean visitNew(CAstNode n, CAstVisitor.Context c, CAstVisitor visitor)
          Visit a New 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.
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.
protected  void walkEntities(CAstEntity N, CAstVisitor.Context c)
           
 
Methods inherited from class com.ibm.wala.cast.tree.visit.CAstVisitor
doVisit, doVisitArrayRefNode, doVisitAssignNodes, doVisitEntity, getParent, leaveCast, leaveEntity, leaveInstanceOf, leaveMacroEntity, leaveMacroVar, leaveNode, postProcessEntity, setParent, visit, visitAllChildren, visitAssignNodes, visitCast, visitChildren, visitEntities, visitEntity, visitInclude, visitInstanceOf, visitMacroVar, visitNode, visitScopedEntities, visitScopedEntities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loader

protected final IClassLoader loader

namedEntityResolver

protected final java.util.Map namedEntityResolver
for handling languages that let you include other source files named statically (e.g., ABAP)


insts

protected final SSAInstructionFactory insts

DEBUG_ALL

public static final boolean DEBUG_ALL
See Also:
Constant Field Values

DEBUG_TOP

public static final boolean DEBUG_TOP
See Also:
Constant Field Values

DEBUG_CFG

public static final boolean DEBUG_CFG
See Also:
Constant Field Values

DEBUG_NAMES

public static final boolean DEBUG_NAMES
See Also:
Constant Field Values

DEBUG_LEXICAL

public static final boolean DEBUG_LEXICAL
See Also:
Constant Field Values
Constructor Detail

AstTranslator

protected AstTranslator(IClassLoader loader,
                        java.util.Map namedEntityResolver)

AstTranslator

protected AstTranslator(IClassLoader loader)
Method Detail

useDefaultInitValues

protected abstract boolean useDefaultInitValues()
does the language care about using type-appropriate default values? For Java, the answer is yes (ints should get a default value of 0, null for pointers, etc.). For JavaScript, the answer is no, as any variable can hold the value 'undefined'.


treatGlobalsAsLexicallyScoped

protected abstract boolean treatGlobalsAsLexicallyScoped()
can lexical reads / writes access globals?


useLocalValuesForLexicalVars

protected abstract boolean useLocalValuesForLexicalVars()
given accesses in a method to variables defined in an enclosing lexical scope, is it legal to read the variable into a local l once at the beginning of the method, operate on l through the method body (rather than performing separate lexical read / write operations), and write back the value in l (if necessary) at the end of the method?


topLevelFunctionsInGlobalScope

protected boolean topLevelFunctionsInGlobalScope()

defaultCatchType

protected abstract TypeReference defaultCatchType()
for a block that catches all exceptions, what is the root exception type that it can catch? E.g., for Java, java.lang.Throwable


makeType

protected abstract TypeReference makeType(CAstType type)

defineType

protected abstract boolean defineType(CAstEntity type,
                                      AstTranslator.WalkContext wc)
define a new (presumably nested) type. return true if type was successfully defined, false otherwise


declareFunction

protected abstract void declareFunction(CAstEntity N,
                                        AstTranslator.WalkContext context)
declare a new function, represented by N


defineFunction

protected abstract void defineFunction(CAstEntity N,
                                       AstTranslator.WalkContext definingContext,
                                       AbstractCFG cfg,
                                       SymbolTable symtab,
                                       boolean hasCatchBlock,
                                       TypeReference[][] caughtTypes,
                                       boolean hasMonitorOp,
                                       AstTranslator.AstLexicalInformation lexicalInfo,
                                       AstMethod.DebuggingInformation debugInfo)
fully define a function. invoked after all the code of the function has been processed


defineField

protected abstract void defineField(CAstEntity topEntity,
                                    AstTranslator.WalkContext context,
                                    CAstEntity fieldEntity)
define a new field fieldEntity within topEntity


composeEntityName

protected abstract java.lang.String composeEntityName(AstTranslator.WalkContext parent,
                                                      CAstEntity f)
create the language-appropriate name for f


doThrow

protected abstract void doThrow(AstTranslator.WalkContext context,
                                int exception)
generate IR for a CAst throw expression, updating context.cfg()


doArrayRead

public abstract void doArrayRead(AstTranslator.WalkContext context,
                                 int result,
                                 int arrayValue,
                                 CAstNode arrayRef,
                                 int[] dimValues)
generate IR for a CAst array read, updating context.cfg()

Specified by:
doArrayRead in interface ArrayOpHandler

doArrayWrite

public abstract void doArrayWrite(AstTranslator.WalkContext context,
                                  int arrayValue,
                                  CAstNode arrayRef,
                                  int[] dimValues,
                                  int rval)
generate IR for a CAst array write, updating context.cfg()

Specified by:
doArrayWrite in interface ArrayOpHandler

doFieldRead

protected abstract void doFieldRead(AstTranslator.WalkContext context,
                                    int result,
                                    int receiver,
                                    CAstNode elt,
                                    CAstNode parent)
generate IR for a CAst field read, updating context.cfg()


doFieldWrite

protected abstract void doFieldWrite(AstTranslator.WalkContext context,
                                     int receiver,
                                     CAstNode elt,
                                     CAstNode parent,
                                     int rval)
generate IR for a CAst field write, updating context.cfg()


doMaterializeFunction

protected abstract void doMaterializeFunction(CAstNode node,
                                              AstTranslator.WalkContext context,
                                              int result,
                                              int exception,
                                              CAstEntity fn)
generate IR for a CAst function expression, updating context.cfg()


doNewObject

protected abstract void doNewObject(AstTranslator.WalkContext context,
                                    CAstNode newNode,
                                    int result,
                                    java.lang.Object type,
                                    int[] arguments)
generate IR for a CAst new expression, updating context.cfg()


doCall

protected abstract void doCall(AstTranslator.WalkContext context,
                               CAstNode call,
                               int result,
                               int exception,
                               CAstNode name,
                               int receiver,
                               int[] arguments)
generate IR for a CAst method call expression, updating context.cfg()


isExceptionLabel

protected boolean isExceptionLabel(java.lang.Object label)

hasImplicitGlobals

protected boolean hasImplicitGlobals()
If this returns true, new global declarations get created for any attempt to access a non-existent variable (believe it or not, JavaScript actually does this!)


hasSpecialUndeclaredVariables

protected boolean hasSpecialUndeclaredVariables()
If this returns true, then attempts to lookup non-existent names return `null' rather than tripping an assertion. This can be used when special handling is needed for built-in names. (PHP does this)


handleUnspecifiedLiteralKey

protected void handleUnspecifiedLiteralKey(AstTranslator.WalkContext context,
                                           CAstNode objectLiteralNode,
                                           int unspecifiedLiteralIndex,
                                           CAstVisitor visitor)
some languages let you omit initialization of certain fields when writing an object literal (e.g., PHP). This method should be overridden to handle such cases.


doPrologue

protected void doPrologue(AstTranslator.WalkContext context)
generate prologue code for each function body


doPrimitive

protected abstract void doPrimitive(int resultVal,
                                    AstTranslator.WalkContext context,
                                    CAstNode primitiveCall)
generate IR for call modeling creation of primitive value, updating context.cfg()


doLocalRead

protected int doLocalRead(AstTranslator.WalkContext context,
                          java.lang.String name)
get the value number for a name defined locally (i.e., within the current method) by looking up the name in context.currentScope(). Note that the caller is responsible for ensuring that name is defined in the local scope.


doLocalWrite

protected void doLocalWrite(AstTranslator.WalkContext context,
                            java.lang.String nm,
                            int rval)
add an AssignInstruction to context.cfg() that copies rval to the value number of local nm. Note that the caller is responsible for ensuring that nm is defined in the local scope.


doLexicallyScopedRead

protected int doLexicallyScopedRead(CAstNode node,
                                    AstTranslator.WalkContext context,
                                    java.lang.String name)
Note that the caller is responsible for ensuring that name is defined in a lexical scope.

Parameters:
node - the AST node representing the read
context -
name -
Returns:

doLexicallyScopedWrite

protected void doLexicallyScopedWrite(AstTranslator.WalkContext context,
                                      java.lang.String name,
                                      int rval)
Note that the caller is responsible for ensuring that name is defined in a lexical scope.


doGlobalRead

protected int doGlobalRead(CAstNode node,
                           AstTranslator.WalkContext context,
                           java.lang.String name)
generate instructions for a read of a global


doGlobalWrite

protected void doGlobalWrite(AstTranslator.WalkContext context,
                             java.lang.String name,
                             int rval)
generate instructions for a write of a global


doIsFieldDefined

protected void doIsFieldDefined(AstTranslator.WalkContext context,
                                int result,
                                int ref,
                                CAstNode field)
generate instructions to check if ref has field, storing answer in result


makeGlobalRef

protected FieldReference makeGlobalRef(java.lang.String globalName)
creates a reference to a global named globalName. the declaring type and type of the global are both the root type.


setArrayOpHandler

public void setArrayOpHandler(ArrayOpHandler arrayOpHandler)

makeTypeScope

protected AstTranslator.Scope makeTypeScope(CAstEntity type,
                                            AstTranslator.Scope parent)

hasValue

protected boolean hasValue(CAstNode n)

setValue

public final int setValue(CAstNode n,
                          int v)

getValue

public final int getValue(CAstNode n)

translateUnaryOpcode

protected IUnaryOpInstruction.IOperator translateUnaryOpcode(CAstNode op)

translateBinaryOpcode

protected IBinaryOpInstruction.IOperator translateBinaryOpcode(CAstNode op)

translateConditionOpcode

protected IConditionalBranchInstruction.IOperator translateConditionOpcode(CAstNode op)

getTypeForNode

protected final CAstType getTypeForNode(AstTranslator.WalkContext context,
                                        CAstNode node)

makeFileContext

protected CAstVisitor.Context makeFileContext(CAstVisitor.Context c,
                                              CAstEntity n)
Description copied from class: CAstVisitor
Construct a context for a File entity.

Overrides:
makeFileContext in class CAstVisitor
Parameters:
c - a visitor-specific context in which this file was visited
n - the file entity

makeTypeContext

protected CAstVisitor.Context makeTypeContext(CAstVisitor.Context c,
                                              CAstEntity n)
Description copied from class: CAstVisitor
Construct a context for a Type entity.

Overrides:
makeTypeContext in class CAstVisitor
Parameters:
c - a visitor-specific context in which this type was visited
n - the type entity

makeCodeContext

protected CAstVisitor.Context makeCodeContext(CAstVisitor.Context c,
                                              CAstEntity n)
Description copied from class: CAstVisitor
Construct a context for a Code entity.

Overrides:
makeCodeContext in class CAstVisitor
Parameters:
c - a visitor-specific context in which the code was visited
n - the code entity

enterEntity

protected boolean enterEntity(CAstEntity n,
                              CAstVisitor.Context context,
                              CAstVisitor visitor)
Description copied from class: CAstVisitor
Enter the entity visitor.

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

visitFileEntity

protected boolean visitFileEntity(CAstEntity n,
                                  CAstVisitor.Context context,
                                  CAstVisitor.Context fileContext,
                                  CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a File entity.

Overrides:
visitFileEntity in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a File entity.

Overrides:
leaveFileEntity in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit a Field entity.

Overrides:
visitFieldEntity in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Field entity.

Overrides:
leaveFieldEntity in class CAstVisitor
Parameters:
n - the entity to process
context - a visitor-specific context

visitGlobalEntity

protected boolean visitGlobalEntity(CAstEntity n,
                                    CAstVisitor.Context context,
                                    CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Field entity.

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

leaveGlobalEntity

protected void leaveGlobalEntity(CAstEntity n,
                                 CAstVisitor.Context context,
                                 CAstVisitor visitor)
Description copied from class: CAstVisitor
Leave a Field entity.

Overrides:
leaveGlobalEntity in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit a Type entity.

Overrides:
visitTypeEntity in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Type entity.

Overrides:
leaveTypeEntity in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit a Function entity.

Overrides:
visitFunctionEntity in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Function entity.

Overrides:
leaveFunctionEntity in class CAstVisitor
Parameters:
n - the entity to process
context - a visitor-specific context
codeContext - a visitor-specific context for this function

visitMacroEntity

protected boolean visitMacroEntity(CAstEntity n,
                                   CAstVisitor.Context context,
                                   CAstVisitor.Context codeContext,
                                   CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Macro entity.

Overrides:
visitMacroEntity in class CAstVisitor
Parameters:
n - the entity to process
context - a visitor-specific context
codeContext - a visitor-specific context for this macro
Returns:
true if no further processing is needed

visitScriptEntity

protected boolean visitScriptEntity(CAstEntity n,
                                    CAstVisitor.Context context,
                                    CAstVisitor.Context codeContext,
                                    CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Script entity.

Overrides:
visitScriptEntity in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Script entity.

Overrides:
leaveScriptEntity in class CAstVisitor
Parameters:
n - the entity to process
context - a visitor-specific context
codeContext - a visitor-specific context for this script

initFunctionEntity

public void initFunctionEntity(CAstEntity n,
                               AstTranslator.WalkContext parentContext,
                               AstTranslator.WalkContext functionContext)

closeFunctionEntity

public void closeFunctionEntity(CAstEntity n,
                                AstTranslator.WalkContext parentContext,
                                AstTranslator.WalkContext functionContext)

makeLocalContext

protected CAstVisitor.Context makeLocalContext(CAstVisitor.Context context,
                                               CAstNode n)
Description copied from class: CAstVisitor
Construct a context for a LocalScope node.

Overrides:
makeLocalContext in class CAstVisitor
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)
Description copied from class: CAstVisitor
Construct a context for an Unwind node.

Overrides:
makeUnwindContext in class CAstVisitor
Parameters:
context - a visitor-specific context in which the unwind was visited
n - the unwind node

enterNode

protected boolean enterNode(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Description copied from class: CAstVisitor
Enter the node visitor.

Overrides:
enterNode in class CAstVisitor
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)
Description copied from class: CAstVisitor
Post-process a node after visiting it.

Overrides:
postProcessNode in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

processFunctionExpr

protected int processFunctionExpr(CAstNode n,
                                  CAstVisitor.Context c)

visitFunctionExpr

protected boolean visitFunctionExpr(CAstNode n,
                                    CAstVisitor.Context c,
                                    CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a FunctionExpr node.

Overrides:
visitFunctionExpr in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a FunctionExpr node.

Overrides:
leaveFunctionExpr in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitFunctionStmt

protected boolean visitFunctionStmt(CAstNode n,
                                    CAstVisitor.Context c,
                                    CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a FunctionStmt node.

Overrides:
visitFunctionStmt in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a FunctionStmt node.

Overrides:
leaveFunctionStmt in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitLocalScope

protected boolean visitLocalScope(CAstNode n,
                                  CAstVisitor.Context c,
                                  CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a LocalScope node.

Overrides:
visitLocalScope in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a LocalScope node.

Overrides:
leaveLocalScope in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitBlockExpr

protected boolean visitBlockExpr(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a BlockExpr node.

Overrides:
visitBlockExpr in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a BlockExpr node.

Overrides:
leaveBlockExpr in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitBlockStmt

protected boolean visitBlockStmt(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a BlockStmt node.

Overrides:
visitBlockStmt in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a BlockStmt node.

Overrides:
leaveBlockStmt in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitLoop

protected boolean visitLoop(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Loop node.

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

leaveLoopHeader

protected final void leaveLoopHeader(CAstNode n,
                                     CAstVisitor.Context c,
                                     CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Loop node after processing the loop header.

Overrides:
leaveLoopHeader in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

leaveLoop

protected final void leaveLoop(CAstNode n,
                               CAstVisitor.Context c,
                               CAstVisitor visitor)
Description copied from class: CAstVisitor
Leave a Loop node.

Overrides:
leaveLoop in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitGetCaughtException

protected boolean visitGetCaughtException(CAstNode n,
                                          CAstVisitor.Context c,
                                          CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a GetCaughtException node.

Overrides:
visitGetCaughtException in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a GetCaughtException node.

Overrides:
leaveGetCaughtException in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitThis

protected boolean visitThis(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a This node.

Overrides:
visitThis in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a This node.

Overrides:
leaveThis in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitSuper

protected boolean visitSuper(CAstNode n,
                             CAstVisitor.Context c,
                             CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Super node.

Overrides:
visitSuper in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Super node.

Overrides:
leaveSuper in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitCall

protected boolean visitCall(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Call node.

Overrides:
visitCall in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Call node.

Overrides:
leaveCall in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitVar

protected boolean visitVar(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Var node.

Overrides:
visitVar in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Var node.

Overrides:
leaveVar in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitConstant

protected boolean visitConstant(CAstNode n,
                                CAstVisitor.Context c,
                                CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Constant node.

Overrides:
visitConstant in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Constant node.

Overrides:
leaveConstant in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitBinaryExpr

protected boolean visitBinaryExpr(CAstNode n,
                                  CAstVisitor.Context c,
                                  CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a BinaryExpr node.

Overrides:
visitBinaryExpr in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a BinaryExpr node.

Overrides:
leaveBinaryExpr in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitUnaryExpr

protected boolean visitUnaryExpr(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a UnaryExpr node.

Overrides:
visitUnaryExpr in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a UnaryExpr node.

Overrides:
leaveUnaryExpr in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitArrayLength

protected boolean visitArrayLength(CAstNode n,
                                   CAstVisitor.Context c,
                                   CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an ArrayLength node.

Overrides:
visitArrayLength in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave an ArrayLength node.

Overrides:
leaveArrayLength in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitArrayRef

protected boolean visitArrayRef(CAstNode n,
                                CAstVisitor.Context c,
                                CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an ArrayRef node.

Overrides:
visitArrayRef in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave an ArrayRef node.

Overrides:
leaveArrayRef in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitDeclStmt

protected boolean visitDeclStmt(CAstNode n,
                                CAstVisitor.Context c,
                                CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a DeclStmt node.

Overrides:
visitDeclStmt in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a DeclStmt node.

Overrides:
leaveDeclStmt in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitReturn

protected boolean visitReturn(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Return node.

Overrides:
visitReturn in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Return node.

Overrides:
leaveReturn in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitIfgoto

protected boolean visitIfgoto(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an Ifgoto node.

Overrides:
visitIfgoto in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave an Ifgoto node.

Overrides:
leaveIfgoto in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitGoto

protected boolean visitGoto(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Goto node.

Overrides:
visitGoto in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Goto node.

Overrides:
leaveGoto in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitLabelStmt

protected boolean visitLabelStmt(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a LabelStmt node.

Overrides:
visitLabelStmt in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a LabelStmt node.

Overrides:
leaveLabelStmt in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

processIf

protected void processIf(CAstNode n,
                         boolean isExpr,
                         CAstVisitor.Context c,
                         CAstVisitor visitor)

leaveIfStmtCondition

protected final void leaveIfStmtCondition(CAstNode n,
                                          CAstVisitor.Context c,
                                          CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an IfStmt node after processing the condition.

Overrides:
leaveIfStmtCondition in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

leaveIfStmtTrueClause

protected final void leaveIfStmtTrueClause(CAstNode n,
                                           CAstVisitor.Context c,
                                           CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an IfStmt node after processing the true clause.

Overrides:
leaveIfStmtTrueClause in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

leaveIfStmt

protected final void leaveIfStmt(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Description copied from class: CAstVisitor
Leave an IfStmt node.

Overrides:
leaveIfStmt in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

leaveIfExprCondition

protected final void leaveIfExprCondition(CAstNode n,
                                          CAstVisitor.Context c,
                                          CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an IfExpr node after processing the condition.

Overrides:
leaveIfExprCondition in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

leaveIfExprTrueClause

protected final void leaveIfExprTrueClause(CAstNode n,
                                           CAstVisitor.Context c,
                                           CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an IfExpr node after processing the true clause.

Overrides:
leaveIfExprTrueClause in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

leaveIfExpr

protected final void leaveIfExpr(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Description copied from class: CAstVisitor
Leave an IfExpr node.

Overrides:
leaveIfExpr in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitIfStmt

protected boolean visitIfStmt(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an IfStmt node.

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

visitIfExpr

protected boolean visitIfExpr(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an IfExpr node.

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

visitNew

protected boolean visitNew(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a New node.

Overrides:
visitNew in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a New node.

Overrides:
leaveNew in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitObjectLiteral

protected boolean visitObjectLiteral(CAstNode n,
                                     CAstVisitor.Context c,
                                     CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an ObjectLiteral node.

Overrides:
visitObjectLiteral in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit an ObjectLiteral node after processing the {i}th field initializer.

Overrides:
leaveObjectLiteralFieldInit in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave an ObjectLiteral node.

Overrides:
leaveObjectLiteral in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitArrayLiteral

protected boolean visitArrayLiteral(CAstNode n,
                                    CAstVisitor.Context c,
                                    CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an ArrayLiteral node.

Overrides:
visitArrayLiteral in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit an ArrayLiteral node after processing the array object.

Overrides:
leaveArrayLiteralObject in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

leaveArrayLiteralInitElement

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

Overrides:
leaveArrayLiteralInitElement in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a ArrayLiteral node.

Overrides:
leaveArrayLiteral in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitObjectRef

protected boolean visitObjectRef(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an ObjectRef node.

Overrides:
visitObjectRef in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave an ObjectRef node.

Overrides:
leaveObjectRef in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitAssign

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

Overrides:
visitAssign in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave an Assign node. Override only this to change behavior for all assignment nodes.

Overrides:
leaveAssign in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

processAssignOp

protected int processAssignOp(CAstNode n,
                              CAstNode v,
                              CAstNode a,
                              int temp,
                              boolean post,
                              CAstVisitor.Context c)

visitArrayRefAssign

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

Overrides:
visitArrayRefAssign in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit an ArrayRef Assignment node after visiting the LHS.

Overrides:
leaveArrayRefAssign in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit an ArrayRef Op/Assignment node after visiting the RHS.

Overrides:
visitArrayRefAssignOp in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit an ArrayRef Op/Assignment node after visiting the LHS.

Overrides:
leaveArrayRefAssignOp in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit an ObjectRef Assignment node after visiting the RHS.

Overrides:
visitObjectRefAssign in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit an ObjectRef Assignment node after visiting the LHS.

Overrides:
leaveObjectRefAssign in class CAstVisitor
Parameters:
n - the LHS node to process
v - the RHS node to process
a - the assignment node to process
c - a visitor-specific context

processObjectRefAssignOp

protected void processObjectRefAssignOp(CAstNode n,
                                        CAstNode v,
                                        CAstNode a,
                                        CAstVisitor.Context c)

visitObjectRefAssignOp

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

Overrides:
visitObjectRefAssignOp in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit an ObjectRef Op/Assignment node after visiting the LHS.

Overrides:
leaveObjectRefAssignOp in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit a BlockExpr Assignment node after visiting the RHS.

Overrides:
visitBlockExprAssign in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit a BlockExpr Assignment node after visiting the LHS.

Overrides:
leaveBlockExprAssign in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit a BlockExpr Op/Assignment node after visiting the RHS.

Overrides:
visitBlockExprAssignOp in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit a BlockExpr Op/Assignment node after visiting the LHS.

Overrides:
leaveBlockExprAssignOp in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit a Var Assignment node after visiting the RHS.

Overrides:
visitVarAssign in class CAstVisitor
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

assignValue

protected void assignValue(CAstNode n,
                           AstTranslator.WalkContext context,
                           AstTranslator.Symbol ls,
                           java.lang.String nm,
                           int rval)
assign rval to nm as appropriate, depending on the scope of ls


leaveVarAssign

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

Overrides:
leaveVarAssign in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit a Var Op/Assignment node after visiting the RHS.

Overrides:
visitVarAssignOp in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit a Var Op/Assignment node after visiting the LHS.

Overrides:
leaveVarAssignOp in class CAstVisitor
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)
Description copied from class: CAstVisitor
Visit a Switch node.

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

leaveSwitchValue

protected final void leaveSwitchValue(CAstNode n,
                                      CAstVisitor.Context c,
                                      CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Switch node after processing the switch value.

Overrides:
leaveSwitchValue in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

leaveSwitch

protected final void leaveSwitch(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Description copied from class: CAstVisitor
Leave a Switch node.

Overrides:
leaveSwitch in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitThrow

protected boolean visitThrow(CAstNode n,
                             CAstVisitor.Context c,
                             CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Throw node.

Overrides:
visitThrow in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Throw node.

Overrides:
leaveThrow in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitCatch

protected boolean visitCatch(CAstNode n,
                             CAstVisitor.Context c,
                             CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Catch node.

Overrides:
visitCatch in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Catch node.

Overrides:
leaveCatch in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitUnwind

protected boolean visitUnwind(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an Unwind node.

Overrides:
visitUnwind in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave an Unwind node.

Overrides:
leaveUnwind in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitTry

protected boolean visitTry(CAstNode n,
                           CAstVisitor.Context c,
                           CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Try node.

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

leaveTryBlock

protected final void leaveTryBlock(CAstNode n,
                                   CAstVisitor.Context c,
                                   CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Try node after processing the try block.

Overrides:
leaveTryBlock in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

leaveTry

protected final void leaveTry(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Description copied from class: CAstVisitor
Leave a Try node.

Overrides:
leaveTry in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitEmpty

protected boolean visitEmpty(CAstNode n,
                             CAstVisitor.Context c,
                             CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an Empty node.

Overrides:
visitEmpty in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave an Empty node.

Overrides:
leaveEmpty in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitPrimitive

protected boolean visitPrimitive(CAstNode n,
                                 CAstVisitor.Context c,
                                 CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Primitive node.

Overrides:
visitPrimitive in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Primitive node.

Overrides:
leavePrimitive in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitVoid

protected boolean visitVoid(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit a Void node.

Overrides:
visitVoid in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave a Void node.

Overrides:
leaveVoid in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitAssert

protected boolean visitAssert(CAstNode n,
                              CAstVisitor.Context c,
                              CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an InstanceOf node.

Overrides:
visitAssert in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave an InstanceOf node.

Overrides:
leaveAssert in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitEachElementGet

protected boolean visitEachElementGet(CAstNode n,
                                      CAstVisitor.Context c,
                                      CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an InstanceOf node.

Overrides:
visitEachElementGet in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave an FOR_EACH_ELEMENT_GET node.

Overrides:
leaveEachElementGet in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitEachElementHasNext

protected boolean visitEachElementHasNext(CAstNode n,
                                          CAstVisitor.Context c,
                                          CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an InstanceOf node.

Overrides:
visitEachElementHasNext in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave an InstanceOf node.

Overrides:
leaveEachElementHasNext in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitTypeLiteralExpr

protected boolean visitTypeLiteralExpr(CAstNode n,
                                       CAstVisitor.Context c,
                                       CAstVisitor visitor)
Description copied from class: CAstVisitor
Visit an TYPE_LITERAL_EXPR node.

Overrides:
visitTypeLiteralExpr in class CAstVisitor
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)
Description copied from class: CAstVisitor
Leave an TYPE_LITERAL_EXPR node.

Overrides:
leaveTypeLiteralExpr in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitIsDefinedExpr

protected boolean visitIsDefinedExpr(CAstNode n,
                                     CAstVisitor.Context c,
                                     CAstVisitor visitor)
Overrides:
visitIsDefinedExpr in class CAstVisitor

leaveIsDefinedExpr

protected void leaveIsDefinedExpr(CAstNode n,
                                  CAstVisitor.Context c,
                                  CAstVisitor visitor)
Description copied from class: CAstVisitor
Leave an IS_DEFINED_EXPR node.

Overrides:
leaveIsDefinedExpr in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

visitEcho

protected boolean visitEcho(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Overrides:
visitEcho in class CAstVisitor

leaveEcho

protected void leaveEcho(CAstNode n,
                         CAstVisitor.Context c,
                         CAstVisitor visitor)
Description copied from class: CAstVisitor
Leave an ECHO node.

Overrides:
leaveEcho in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

getIncludedEntity

public CAstEntity getIncludedEntity(CAstNode n)

leaveInclude

protected void leaveInclude(CAstNode n,
                            CAstVisitor.Context c,
                            CAstVisitor visitor)
Description copied from class: CAstVisitor
Leave an INCLUDE node.

Overrides:
leaveInclude in class CAstVisitor
Parameters:
n - the node to process
c - a visitor-specific context

walkEntities

protected final void walkEntities(CAstEntity N,
                                  CAstVisitor.Context c)

translate

public void translate(CAstEntity N,
                      ModuleEntry module)
translate module, represented by CAstEntity N

Specified by:
translate in interface TranslatorToIR

getGlobalScope

protected AstTranslator.Scope getGlobalScope()