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
|
CHANGED, stack
services
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
|
Modifier and Type | Method and Description |
---|---|
static LocationVariable |
copy(ProgramVariable pv) |
static LocationVariable |
copy(ProgramVariable pv,
java.lang.String postFix) |
protected void |
doAction(ProgramElement node)
the action that is performed just before leaving the node the last time
|
void |
performActionOnBlockContract(StatementBlock oldBlock,
StatementBlock newBlock)
Adds block contract for new statement block to block contract
of old block statement.
|
void |
performActionOnLocationVariable(LocationVariable x) |
void |
performActionOnLoopContract(LoopStatement oldLoop,
LoopStatement newLoop)
Adds loop contract for new loop statement to loop contract
of old loop statement.
|
void |
performActionOnLoopContract(StatementBlock oldBlock,
StatementBlock newBlock)
Adds block contract for new statement block to block contract
of old block statement.
|
void |
performActionOnLoopInvariant(LoopStatement oldLoop,
LoopStatement newLoop) |
void |
performActionOnMergeContract(MergeContract oldContract) |
protected void |
performActionOnMergeContract(MergePointStatement oldMps,
MergePointStatement newMps) |
void |
performActionOnProgramConstant(ProgramConstant x) |
void |
performActionOnProgramVariable(ProgramVariable pv) |
ProgramElement |
result() |
void |
start()
starts the walker
|
protected void |
walk(ProgramElement node)
walks through the AST.
|
addChild, addChildren, addToTopOfStack, changed, doDefaultAction, getPosition, performActionOnAllFields, performActionOnArrayInitializer, performActionOnArrayLengthReference, performActionOnArrayReference, performActionOnAssert, performActionOnBinaryAnd, performActionOnBinaryAndAssignment, performActionOnBinaryNot, performActionOnBinaryOr, performActionOnBinaryOrAssignment, performActionOnBinaryXOr, performActionOnBinaryXOrAssignment, performActionOnBreak, performActionOnCase, performActionOnCatch, performActionOnCcatch, performActionOnClassInitializer, performActionOnConditional, performActionOnContinue, performActionOnCopyAssignment, performActionOnDefault, performActionOnDivide, performActionOnDivideAssignment, performActionOnDLEmbeddedExpression, performActionOnDo, performActionOnElse, performActionOnEmptyStatement, performActionOnEnhancedFor, performActionOnEquals, performActionOnExec, 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, toString
performActionOnAbstractProgramElement, performActionOnAllObjects, performActionOnArrayDeclaration, performActionOnBlockContract, performActionOnBooleanLiteral, performActionOnCatchAllStatement, performActionOnCcatchBreakLabelParameterDeclaration, performActionOnCcatchBreakParameterDeclaration, performActionOnCcatchBreakWildcardParameterDeclaration, performActionOnCcatchContinueParameterDeclaration, performActionOnCcatchContinueWildcardParameterDeclaration, performActionOnCcatchReturnParameterDeclaration, performActionOnCcatchReturnValParameterDeclaration, performActionOnCCcatchContinueLabelParameterDeclaration, 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, performActionOnVariableReference
depth, root
protected boolean replaceallbynew
protected java.util.Map<ProgramVariable,ProgramVariable> replaceMap
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)
JavaASTWalker
walk
in class CreatingASTVisitor
node
- the JavaProgramElement the walker is atprotected void doAction(ProgramElement node)
doAction
in class JavaASTVisitor
node
- the node described abovepublic void start()
start
in class JavaASTWalker
public ProgramElement result()
public void performActionOnProgramVariable(ProgramVariable pv)
performActionOnProgramVariable
in interface Visitor
performActionOnProgramVariable
in class JavaASTVisitor
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)
Visitor
performActionOnBlockContract
in interface Visitor
performActionOnBlockContract
in class JavaASTVisitor
oldBlock
- the old blocknewBlock
- the new blockpublic void performActionOnLoopContract(StatementBlock oldBlock, StatementBlock newBlock)
Visitor
performActionOnLoopContract
in interface Visitor
performActionOnLoopContract
in class JavaASTVisitor
oldBlock
- the old blocknewBlock
- the new blockpublic void performActionOnLoopContract(LoopStatement oldLoop, LoopStatement newLoop)
Visitor
performActionOnLoopContract
in interface Visitor
performActionOnLoopContract
in class JavaASTVisitor
oldLoop
- the old loop statementnewLoop
- the new loop statementpublic void performActionOnMergeContract(MergeContract oldContract)
performActionOnMergeContract
in interface Visitor
performActionOnMergeContract
in class JavaASTVisitor
protected void performActionOnMergeContract(MergePointStatement oldMps, MergePointStatement newMps)
performActionOnMergeContract
in class CreatingASTVisitor
public void performActionOnLoopInvariant(LoopStatement oldLoop, LoopStatement newLoop)
performActionOnLoopInvariant
in class CreatingASTVisitor
Copyright © 2003-2019 The KeY-Project.