Class ExposedNamesCollector
java.lang.Object
com.ibm.wala.cast.tree.visit.CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext>
com.ibm.wala.cast.ir.translator.ExposedNamesCollector
public class ExposedNamesCollector
extends CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext>
discovers which names declared by an
entity
are exposed, i.e., accessed by
nested functions.-
Nested Class Summary
Nested classes/interfaces inherited from class com.ibm.wala.cast.tree.visit.CAstVisitor
CAstVisitor.Context
-
Field Summary
Fields inherited from class com.ibm.wala.cast.tree.visit.CAstVisitor
currentPosition, DEBUG
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
doVisit
(CAstNode n, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext context, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Node processing hook; sub-classes are expected to override if they introduce new node types.protected boolean
doVisitAssignNodes
(CAstNode n, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext context, CAstNode v, CAstNode a, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Node processing hook; sub-classes are expected to override if they introduce new node types that appear on the left hand side of assignment operations.protected void
leaveClassStmt
(CAstNode n, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext c, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Leave a FunctionStmt node.protected void
leaveDeclStmt
(CAstNode n, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext c, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Leave a DeclStmt node.protected void
leaveFunctionStmt
(CAstNode n, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext c, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Leave a FunctionStmt node.protected void
leaveVar
(CAstNode n, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext c, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Leave a Var node.protected void
leaveVarAssign
(CAstNode n, CAstNode v, CAstNode a, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext c, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Visit a Var Assignment node after visiting the LHS.protected void
leaveVarAssignOp
(CAstNode n, CAstNode v, CAstNode a, boolean pre, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext c, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Visit a Var Op/Assignment node after visiting the LHS.protected com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext
makeCodeContext
(com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext context, CAstEntity n) Construct a context for a Code entity.void
run
(CAstEntity N) run the collector on an entityMethods inherited from class com.ibm.wala.cast.tree.visit.CAstVisitor
doVisitArrayRefNode, doVisitEntity, enterEntity, enterNode, getCodeContext, getCurrentPosition, getParent, leaveArrayLength, leaveArrayLiteral, leaveArrayLiteralAssign, leaveArrayLiteralInitElement, leaveArrayLiteralObject, leaveArrayRef, leaveArrayRefAssign, leaveArrayRefAssignOp, leaveAssert, leaveAssign, leaveBinaryExpr, leaveBlockExpr, leaveBlockExprAssign, leaveBlockExprAssignOp, leaveBlockStmt, leaveCall, leaveCast, leaveCatch, leaveConstant, leaveEachElementGet, leaveEachElementHasNext, leaveEcho, leaveEmpty, leaveEntity, leaveFieldEntity, leaveFileEntity, leaveForIn, leaveFunctionEntity, leaveFunctionExpr, leaveGetCaughtException, leaveGlobalEntity, leaveGoto, leaveIfExpr, leaveIfExprCondition, leaveIfExprTrueClause, leaveIfgoto, leaveIfStmt, leaveIfStmtCondition, leaveIfStmtTrueClause, leaveInclude, leaveInstanceOf, leaveIsDefinedExpr, leaveLabelStmt, leaveLocalScope, leaveLoop, leaveLoopHeader, leaveMacroEntity, leaveMacroVar, leaveNew, leaveNode, leaveObjectLiteral, leaveObjectLiteralAssign, leaveObjectLiteralFieldInit, leaveObjectRef, leaveObjectRefAssign, leaveObjectRefAssignOp, leavePrimitive, leaveReturn, leaveScriptEntity, leaveSpecialParentScope, leaveSuper, leaveSwitch, leaveSwitchValue, leaveThis, leaveThrow, leaveTry, leaveTryBlock, leaveTypeEntity, leaveTypeLiteralExpr, leaveUnaryExpr, leaveUnwind, leaveVoid, leaveYield, makeFileContext, makeLocalContext, makeSpecialParentContext, makeTypeContext, makeUnwindContext, postProcessEntity, postProcessNode, setParent, visit, visitAllChildren, visitArrayLength, visitArrayLiteral, visitArrayLiteralAssign, visitArrayRef, visitArrayRefAssign, visitArrayRefAssignOp, visitAssert, visitAssign, visitAssignNodes, visitBinaryExpr, visitBlockExpr, visitBlockExprAssign, visitBlockExprAssignOp, visitBlockStmt, visitCall, visitCast, visitCatch, visitChildren, visitClassStmt, visitConstant, visitDeclStmt, visitEachElementGet, visitEachElementHasNext, visitEcho, visitEmpty, visitEntities, visitEntity, visitFieldEntity, visitFileEntity, visitForIn, visitFunctionEntity, visitFunctionExpr, visitFunctionStmt, visitGetCaughtException, visitGlobalEntity, visitGoto, visitIfExpr, visitIfgoto, visitIfStmt, visitInclude, visitInstanceOf, visitIsDefinedExpr, visitLabelStmt, visitLocalScope, visitLoop, visitMacroEntity, visitMacroVar, visitNew, visitNode, visitObjectLiteral, visitObjectLiteralAssign, visitObjectRef, visitObjectRefAssign, visitObjectRefAssignOp, visitPrimitive, visitReturn, visitScopedEntities, visitScopedEntities, visitScriptEntity, visitSpecialParentScope, visitSuper, visitSwitch, visitThis, visitThrow, visitTry, visitTypeEntity, visitTypeLiteralExpr, visitUnaryExpr, visitUnwind, visitVar, visitVarAssign, visitVarAssignOp, visitVoid, visitYield
-
Constructor Details
-
ExposedNamesCollector
public ExposedNamesCollector()
-
-
Method Details
-
getEntity2ExposedNames
-
getEntity2WrittenNames
-
run
-
makeCodeContext
protected com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext makeCodeContext(com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext context, CAstEntity n) Description copied from class:CAstVisitor
Construct a context for a Code entity.- Overrides:
makeCodeContext
in classCAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext>
- Parameters:
context
- a visitor-specific context in which the code was visitedn
- the code entity
-
leaveDeclStmt
protected void leaveDeclStmt(CAstNode n, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext c, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Description copied from class:CAstVisitor
Leave a DeclStmt node.- Overrides:
leaveDeclStmt
in classCAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext>
- Parameters:
n
- the node to processc
- a visitor-specific context
-
leaveFunctionStmt
protected void leaveFunctionStmt(CAstNode n, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext c, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Description copied from class:CAstVisitor
Leave a FunctionStmt node.- Overrides:
leaveFunctionStmt
in classCAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext>
- Parameters:
n
- the node to processc
- a visitor-specific context
-
leaveClassStmt
protected void leaveClassStmt(CAstNode n, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext c, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Description copied from class:CAstVisitor
Leave a FunctionStmt node.- Overrides:
leaveClassStmt
in classCAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext>
- Parameters:
n
- the node to processc
- a visitor-specific context
-
leaveVar
protected void leaveVar(CAstNode n, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext c, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Description copied from class:CAstVisitor
Leave a Var node.- Overrides:
leaveVar
in classCAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext>
- Parameters:
n
- the node to processc
- a visitor-specific context
-
leaveVarAssignOp
protected void leaveVarAssignOp(CAstNode n, CAstNode v, CAstNode a, boolean pre, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext c, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Description copied from class:CAstVisitor
Visit a Var Op/Assignment node after visiting the LHS.- Overrides:
leaveVarAssignOp
in classCAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext>
- Parameters:
n
- the LHS node to processv
- the RHS node to processa
- the assignment node to processpre
- whether the value before the operation should be usedc
- a visitor-specific context
-
leaveVarAssign
protected void leaveVarAssign(CAstNode n, CAstNode v, CAstNode a, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext c, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Description copied from class:CAstVisitor
Visit a Var Assignment node after visiting the LHS.- Overrides:
leaveVarAssign
in classCAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext>
- Parameters:
n
- the LHS node to processv
- the RHS node to processa
- the assignment node to processc
- a visitor-specific context
-
doVisit
protected boolean doVisit(CAstNode n, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext context, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Description copied from class:CAstVisitor
Node processing hook; sub-classes are expected to override if they introduce new node types.(Should invoke super.doVisit() for unprocessed nodes.)
- Overrides:
doVisit
in classCAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext>
- Returns:
- true if node was handled
-
doVisitAssignNodes
protected boolean doVisitAssignNodes(CAstNode n, com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext context, CAstNode v, CAstNode a, CAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext> visitor) Description copied from class:CAstVisitor
Node processing hook; sub-classes are expected to override if they introduce new node types that appear on the left hand side of assignment operations.(Should invoke super.doVisit() for unprocessed nodes.)
- Overrides:
doVisitAssignNodes
in classCAstVisitor<com.ibm.wala.cast.ir.translator.ExposedNamesCollector.EntityContext>
- Returns:
- true if node was handled
-