public class ProgVarReplaceVisitor extends CreatingASTVisitor
CreatingASTVisitor.DefaultAction
Modifier and Type | Field and Description |
---|---|
protected boolean |
replaceallbynew |
protected Map<ProgramVariable,ProgramVariable> |
replaceMap
stores the program variables to be replaced as keys and the new
program variables as values
|
private ProgramElement |
result |
CHANGED, preservesPositionInfo, stack
services
Constructor and Description |
---|
ProgVarReplaceVisitor(ProgramElement st,
Map<ProgramVariable,ProgramVariable> map,
boolean replaceall,
Services services)
creates a visitor that replaces the program variables in the given
statement
|
ProgVarReplaceVisitor(ProgramElement st,
Map<ProgramVariable,ProgramVariable> map,
Services services)
creates a visitor that replaces the program variables in the given
statement by new ones with the same name
|
addChild, addChildren, addToTopOfStack, changed, doDefaultAction, getPosition, performActionOnAllFields, performActionOnArrayInitializer, performActionOnArrayLengthReference, performActionOnArrayReference, performActionOnAssert, performActionOnBinaryAnd, performActionOnBinaryAndAssignment, performActionOnBinaryNot, performActionOnBinaryOr, performActionOnBinaryOrAssignment, performActionOnBinaryXOr, performActionOnBinaryXOrAssignment, performActionOnBreak, performActionOnCase, performActionOnCatch, performActionOnClassInitializer, performActionOnConditional, performActionOnContinue, performActionOnCopyAssignment, performActionOnDefault, performActionOnDivide, performActionOnDivideAssignment, performActionOnDLEmbeddedExpression, performActionOnDo, performActionOnElse, performActionOnEmptyStatement, performActionOnEnhancedFor, performActionOnEquals, performActionOnExecutionContext, performActionOnFieldReference, performActionOnFinally, performActionOnFor, performActionOnForUpdates, performActionOnGreaterOrEquals, performActionOnGreaterThan, performActionOnGuard, performActionOnIf, performActionOnInstanceof, performActionOnIntersect, performActionOnLabeledStatement, performActionOnLessOrEquals, performActionOnLessThan, performActionOnLocalVariableDeclaration, performActionOnLogicalAnd, performActionOnLogicalNot, performActionOnLogicalOr, performActionOnLoopInit, performActionOnMetaClassReference, performActionOnMethodBodyStatement, performActionOnMethodFrame, performActionOnMethodReference, performActionOnMinus, performActionOnMinusAssignment, performActionOnModulo, performActionOnModuloAssignment, performActionOnNegative, performActionOnNew, performActionOnNewArray, performActionOnNotEquals, performActionOnPackageReference, performActionOnPackageSpecification, performActionOnParameterDeclaration, performActionOnParenthesizedExpression, performActionOnPassiveExpression, performActionOnPlus, performActionOnPlusAssignment, performActionOnPositive, performActionOnPostDecrement, performActionOnPostIncrement, performActionOnPreDecrement, performActionOnPreIncrement, performActionOnReturn, performActionOnSchematicFieldReference, performActionOnSeqConcat, performActionOnSeqLength, performActionOnSeqReverse, performActionOnSeqSingleton, performActionOnSeqSub, performActionOnSetMinus, performActionOnSetUnion, performActionOnShiftLeft, performActionOnShiftLeftAssignment, performActionOnShiftRight, performActionOnShiftRightAssignment, performActionOnSingleton, performActionOnStatementBlock, performActionOnSuperConstructorReference, performActionOnSuperReference, performActionOnSwitch, performActionOnSynchronizedBlock, performActionOnThen, performActionOnThisConstructorReference, performActionOnThisReference, performActionOnThrow, performActionOnTimes, performActionOnTimesAssignment, performActionOnTry, performActionOnTypeCast, performActionOnTypeReference, performActionOnUnsignedShiftRight, performActionOnUnsignedShiftRightAssignment, performActionOnVariableSpecification, performActionOnWhile, preservesPositionInfo, toString
performActionOnAbstractProgramElement, performActionOnAllObjects, performActionOnArrayDeclaration, performActionOnBlockContract, performActionOnBooleanLiteral, performActionOnCatchAllStatement, performActionOnCharLiteral, performActionOnClassDeclaration, performActionOnComment, performActionOnCompilationUnit, performActionOnConstructorDeclaration, performActionOnContextStatementBlock, performActionOnDoubleLiteral, performActionOnEmptyMapLiteral, performActionOnEmptySeqLiteral, performActionOnEmptySetLiteral, performActionOnExactInstanceof, performActionOnExtends, performActionOnFieldDeclaration, performActionOnFieldSpecification, performActionOnFloatLiteral, performActionOnImplements, performActionOnImplicitFieldSpecification, performActionOnImport, performActionOnInterfaceDeclaration, performActionOnIntLiteral, performActionOnIProgramVariable, performActionOnLongLiteral, performActionOnLoopInvariant, performActionOnMethod, performActionOnMethodDeclaration, performActionOnModifier, performActionOnNullLiteral, performActionOnProgramElementName, performActionOnProgramMetaConstruct, performActionOnProgramMethod, performActionOnSchemaVariable, performActionOnSeqGet, performActionOnSeqIndexOf, performActionOnStringLiteral, performActionOnSuperArrayDeclaration, performActionOnThrows, performActionOnTransactionStatement, performActionOnVariableDeclaration, performActionOnVariableReference
depth, root
private ProgramElement result
protected boolean replaceallbynew
protected Map<ProgramVariable,ProgramVariable> replaceMap
public ProgVarReplaceVisitor(ProgramElement st, Map<ProgramVariable,ProgramVariable> map, Services services)
st
- the statement where the prog vars are replacedmap
- the HashMap with the replacementspublic ProgVarReplaceVisitor(ProgramElement st, Map<ProgramVariable,ProgramVariable> map, boolean replaceall, Services services)
st
- the statement where the prog vars are replacedmap
- the HashMap with the replacementsreplaceall
- decides if all variables are to be replacedpublic static LocationVariable copy(ProgramVariable pv)
public static LocationVariable copy(ProgramVariable pv, String postFix)
protected void walk(ProgramElement node)
JavaASTWalker
walk
in class CreatingASTVisitor
node
- the JavaProgramElement the walker is atprotected void doAction(ProgramElement node)
doAction
in class JavaASTVisitor
public void start()
start
in class JavaASTWalker
public ProgramElement result()
public void performActionOnProgramVariable(ProgramVariable pv)
performActionOnProgramVariable
in interface Visitor
performActionOnProgramVariable
in class JavaASTVisitor
private ImmutableList<Term> replaceVariablesInTerms(ImmutableList<Term> terms)
private ImmutableList<InfFlowSpec> replaceVariablesInTermListTriples(ImmutableList<InfFlowSpec> terms)
public void performActionOnLocationVariable(LocationVariable x)
performActionOnLocationVariable
in interface Visitor
performActionOnLocationVariable
in class JavaASTVisitor
public void performActionOnProgramConstant(ProgramConstant x)
performActionOnProgramConstant
in interface Visitor
performActionOnProgramConstant
in class JavaASTVisitor
public void performActionOnBlockContract(StatementBlock oldBlock, StatementBlock newBlock)
performActionOnBlockContract
in class CreatingASTVisitor
private BlockContract createNewBlockContract(BlockContract oldContract, StatementBlock newBlock, boolean blockChanged)
private BlockContract.Variables replaceBlockContractVariables(BlockContract.Variables variables)
private ProgramVariable replaceVariable(ProgramVariable variable)
private Map<Label,ProgramVariable> replaceFlags(Map<Label,ProgramVariable> flags)
private Map<LocationVariable,LocationVariable> replaceRemembranceHeaps(Map<LocationVariable,LocationVariable> remembranceHeaps)
private Map<LocationVariable,LocationVariable> replaceRemembranceLocalVariables(Map<LocationVariable,LocationVariable> remembranceLocalVariables)
public void performActionOnLoopInvariant(LoopStatement oldLoop, LoopStatement newLoop)
performActionOnLoopInvariant
in class CreatingASTVisitor