public class ReplaceWhileLoop extends CreatingASTVisitor
CreatingASTVisitor.DefaultAction
Modifier and Type | Field and Description |
---|---|
private int |
currentMethodFrame |
private int |
firstLoopPos |
private boolean |
firstWhileFound |
protected SVInstantiations |
instantiations
if run in check mode there are normally schemavaribles, so we need the
instantiations of them
|
private int |
lastMethodFrameBeforeLoop |
private boolean |
replaced |
protected ProgramElement |
result
the result of the transformation
|
private KeYJavaType |
returnType |
private LoopStatement |
theLoop |
private StatementBlock |
toInsert |
CHANGED, stack
services
Constructor and Description |
---|
ReplaceWhileLoop(ProgramElement root,
StatementBlock toInsert,
Services services)
creates the WhileLoopTransformation for the transformation mode
|
ReplaceWhileLoop(ProgramElement root,
SVInstantiations inst,
StatementBlock toInsert,
Services services)
creates the WhileLoopTransformation for the check mode
|
Modifier and Type | Method and Description |
---|---|
Statement |
getTheLoop() |
void |
performActionOnEnhancedFor(EnhancedFor x) |
void |
performActionOnMethodFrame(MethodFrame x) |
void |
performActionOnWhile(While x) |
ProgramElement |
result() |
KeYJavaType |
returnType() |
void |
start()
starts the walker
|
java.lang.String |
toString() |
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, performActionOnClassInitializer, performActionOnConditional, performActionOnContinue, performActionOnCopyAssignment, performActionOnDefault, performActionOnDivide, performActionOnDivideAssignment, performActionOnDLEmbeddedExpression, performActionOnDo, performActionOnElse, performActionOnEmptyStatement, performActionOnEquals, performActionOnExecutionContext, performActionOnFieldReference, performActionOnFinally, performActionOnFor, performActionOnForUpdates, performActionOnGreaterOrEquals, performActionOnGreaterThan, performActionOnGuard, performActionOnIf, performActionOnInstanceof, performActionOnIntersect, performActionOnLabeledStatement, performActionOnLessOrEquals, performActionOnLessThan, performActionOnLocalVariableDeclaration, performActionOnLogicalAnd, performActionOnLogicalNot, performActionOnLogicalOr, performActionOnLoopInit, performActionOnLoopInvariant, performActionOnLoopScopeBlock, performActionOnMergeContract, performActionOnMergePointStatement, performActionOnMetaClassReference, performActionOnMethodBodyStatement, 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, preservesPositionInfo
doAction, performActionOnAbstractProgramElement, performActionOnAllObjects, performActionOnArrayDeclaration, performActionOnBlockContract, performActionOnBlockContract, performActionOnBooleanLiteral, performActionOnCatchAllStatement, performActionOnCharLiteral, performActionOnClassDeclaration, performActionOnComment, performActionOnCompilationUnit, performActionOnConstructorDeclaration, performActionOnContextStatementBlock, performActionOnDoubleLiteral, performActionOnEmptyMapLiteral, performActionOnEmptySeqLiteral, performActionOnEmptySetLiteral, performActionOnExactInstanceof, performActionOnExtends, performActionOnFieldDeclaration, performActionOnFieldSpecification, performActionOnFloatLiteral, performActionOnImplements, performActionOnImplicitFieldSpecification, performActionOnImport, performActionOnInterfaceDeclaration, performActionOnIntLiteral, performActionOnIProgramVariable, performActionOnLocationVariable, performActionOnLongLiteral, performActionOnLoopContract, performActionOnLoopContract, performActionOnLoopContract, performActionOnLoopInvariant, performActionOnMergeContract, performActionOnMethod, performActionOnMethodDeclaration, performActionOnModifier, performActionOnNullLiteral, performActionOnProgramConstant, performActionOnProgramElementName, performActionOnProgramMetaConstruct, performActionOnProgramMethod, performActionOnProgramVariable, performActionOnSchemaVariable, performActionOnSeqGet, performActionOnSeqIndexOf, performActionOnStringLiteral, performActionOnSuperArrayDeclaration, performActionOnThrows, performActionOnTransactionStatement, performActionOnVariableDeclaration, performActionOnVariableReference
depth, root
private boolean firstWhileFound
private boolean replaced
private StatementBlock toInsert
private LoopStatement theLoop
private int lastMethodFrameBeforeLoop
private KeYJavaType returnType
private int currentMethodFrame
private int firstLoopPos
protected SVInstantiations instantiations
protected ProgramElement result
public ReplaceWhileLoop(ProgramElement root, StatementBlock toInsert, Services services)
root
- the ProgramElement where to beginpublic ReplaceWhileLoop(ProgramElement root, SVInstantiations inst, StatementBlock toInsert, Services services)
root
- the ProgramElement where to begininst
- the SVInstantiations if availableprotected void walk(ProgramElement node)
JavaASTWalker
walk
in class CreatingASTVisitor
node
- the JavaProgramElement the walker is atpublic void start()
JavaASTWalker
start
in class JavaASTWalker
public ProgramElement result()
public KeYJavaType returnType()
public Statement getTheLoop()
public java.lang.String toString()
toString
in class CreatingASTVisitor
public void performActionOnMethodFrame(MethodFrame x)
performActionOnMethodFrame
in interface Visitor
performActionOnMethodFrame
in class CreatingASTVisitor
public void performActionOnWhile(While x)
performActionOnWhile
in interface Visitor
performActionOnWhile
in class CreatingASTVisitor
public void performActionOnEnhancedFor(EnhancedFor x)
performActionOnEnhancedFor
in interface Visitor
performActionOnEnhancedFor
in class CreatingASTVisitor