public class ProgVarReplaceVisitor extends CreatingASTVisitor
CreatingASTVisitor.DefaultAction| Modifier and Type | Field and Description | 
|---|---|
protected boolean | 
replaceallbynew  | 
protected java.util.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, stackservices| Constructor and Description | 
|---|
ProgVarReplaceVisitor(ProgramElement st,
                     java.util.Map<ProgramVariable,ProgramVariable> map,
                     boolean replaceall,
                     Services services)
creates a visitor that replaces the program variables in the given
 statement 
 | 
ProgVarReplaceVisitor(ProgramElement st,
                     java.util.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, performActionOnLoopScopeBlock, performActionOnMergePointStatement, 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, toStringperformActionOnAbstractProgramElement, 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, performActionOnLoopContract, performActionOnLoopInvariant, performActionOnMethod, performActionOnMethodDeclaration, performActionOnModifier, performActionOnNullLiteral, performActionOnProgramElementName, performActionOnProgramMetaConstruct, performActionOnProgramMethod, performActionOnSchemaVariable, performActionOnSeqGet, performActionOnSeqIndexOf, performActionOnStringLiteral, performActionOnSuperArrayDeclaration, performActionOnThrows, performActionOnTransactionStatement, performActionOnVariableDeclaration, performActionOnVariableReferencedepth, rootprotected boolean replaceallbynew
protected java.util.Map<ProgramVariable,ProgramVariable> replaceMap
private ProgramElement result
public ProgVarReplaceVisitor(ProgramElement st, java.util.Map<ProgramVariable,ProgramVariable> map, Services services)
st - the statement where the prog vars are replacedmap - the HashMap with the replacementsservices - the services instancepublic ProgVarReplaceVisitor(ProgramElement st, java.util.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 replacedservices - the services instancepublic static LocationVariable copy(ProgramVariable pv)
public static LocationVariable copy(ProgramVariable pv, java.lang.String postFix)
protected void walk(ProgramElement node)
JavaASTWalkerwalk in class CreatingASTVisitornode - the JavaProgramElement the walker is atprotected void doAction(ProgramElement node)
doAction in class JavaASTVisitornode - the node described abovepublic void start()
start in class JavaASTWalkerpublic ProgramElement result()
public void performActionOnProgramVariable(ProgramVariable pv)
performActionOnProgramVariable in interface VisitorperformActionOnProgramVariable in class JavaASTVisitorprivate ImmutableList<Term> replaceVariablesInTerms(ImmutableList<Term> terms)
private ImmutableList<InfFlowSpec> replaceVariablesInTermListTriples(ImmutableList<InfFlowSpec> terms)
public void performActionOnLocationVariable(LocationVariable x)
performActionOnLocationVariable in interface VisitorperformActionOnLocationVariable in class JavaASTVisitorpublic void performActionOnProgramConstant(ProgramConstant x)
performActionOnProgramConstant in interface VisitorperformActionOnProgramConstant in class JavaASTVisitorpublic void performActionOnBlockContract(StatementBlock oldBlock, StatementBlock newBlock)
VisitorperformActionOnBlockContract in interface VisitorperformActionOnBlockContract in class JavaASTVisitoroldBlock - the old blocknewBlock - the new blockpublic void performActionOnLoopContract(StatementBlock oldBlock, StatementBlock newBlock)
VisitorperformActionOnLoopContract in interface VisitorperformActionOnLoopContract in class JavaASTVisitoroldBlock - the old blocknewBlock - the new blockpublic void performActionOnLoopContract(LoopStatement oldLoop, LoopStatement newLoop)
VisitorperformActionOnLoopContract in interface VisitorperformActionOnLoopContract in class JavaASTVisitoroldLoop - the old loop statementnewLoop - the new loop statementpublic void performActionOnMergeContract(MergeContract oldContract)
performActionOnMergeContract in interface VisitorperformActionOnMergeContract in class JavaASTVisitorprotected void performActionOnMergeContract(MergePointStatement oldMps, MergePointStatement newMps)
performActionOnMergeContract in class CreatingASTVisitorprivate MergeContract createNewMergeContract(MergeContract oldContract, MergePointStatement newMps, boolean changed)
private BlockContract createNewBlockContract(BlockContract oldContract, StatementBlock newBlock, boolean blockChanged)
private LoopContract createNewLoopContract(LoopContract oldContract, JavaStatement newStatement, boolean blockChanged)
private AuxiliaryContract.Variables replaceBlockContractVariables(AuxiliaryContract.Variables variables)
private ProgramVariable replaceVariable(ProgramVariable variable)
private java.util.Map<Label,ProgramVariable> replaceFlags(java.util.Map<Label,ProgramVariable> flags)
private java.util.Map<LocationVariable,LocationVariable> replaceRemembranceHeaps(java.util.Map<LocationVariable,LocationVariable> remembranceHeaps)
private java.util.Map<LocationVariable,LocationVariable> replaceRemembranceLocalVariables(java.util.Map<LocationVariable,LocationVariable> remembranceLocalVariables)
public void performActionOnLoopInvariant(LoopStatement oldLoop, LoopStatement newLoop)
performActionOnLoopInvariant in class CreatingASTVisitor