public class EnhancedForElimination extends ProgramTransformer
Constructor and Description |
---|
EnhancedForElimination(ExecutionContext execContext,
EnhancedFor forStatement)
Creates a new enhaced for-loop elimination.
|
EnhancedForElimination(ProgramSV execContextSV,
EnhancedFor forStatement)
Creates a new enhaced for-loop elimination.
|
Modifier and Type | Method and Description |
---|---|
StatementBlock |
getHead() |
ProgramVariable |
getIndexVariable() |
ProgramVariable |
getIteratorVariable() |
LoopStatement |
getLoop() |
ProgramVariable |
getValuesVariable() |
ProgramElement[] |
transform(ProgramElement pe,
Services services,
SVInstantiations svInst)
An enhanced for loop is executed by transforming it into a "normal" for loop.
|
body, getChildAt, getChildCount, getDimensions, getExpressionAt, getExpressionCount, getKeYJavaType, getKeYJavaType, getKeYJavaType, getLastElement, getName, getPackageReference, getProgramElementName, getReferencePrefix, getStatementAt, getStatementCount, getTypeReferenceAt, getTypeReferenceCount, name, neededInstantiations, needs, prettyPrint, setReferencePrefix, toString, visit
compatibleBlockSize, computeHashCode, equals, equalsModRenaming, getArrayPos, match, matchChildren
getComments, hashCode, prettyPrintMain, reuseSignature
getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComments, match
public EnhancedForElimination(ProgramSV execContextSV, EnhancedFor forStatement)
execContextSV
- the execution context.forStatement
- the enhanced for loop to eliminate.public EnhancedForElimination(ExecutionContext execContext, EnhancedFor forStatement)
execContext
- the execution context.forStatement
- the enhanced for loop to eliminate.public ProgramElement[] transform(ProgramElement pe, Services services, SVInstantiations svInst)
Loops over arrays are treated by a taclet without use of this class.
Loops over Iterable-objects are treated by this meta-construct.
The rules which use this meta construct must ensure that exp is of type Iterable.
transform
in class ProgramTransformer
pe
- the ProgramElement on which the execution is performedservices
- the Services with all necessary information
about the java programssvInst
- the instantiations of the schemavariables#makeIterableForLoop(LocalVariableDeclaration, Expression, Statement)
,
ProgramTransformer.transform(de.uka.ilkd.key.java.ProgramElement, Services,
SVInstantiations)
public ProgramVariable getIndexVariable()
\index
.public ProgramVariable getValuesVariable()
\values
.public ProgramVariable getIteratorVariable()
public StatementBlock getHead()
getLoop()
public LoopStatement getLoop()
getHead()
Copyright © 2003-2019 The KeY-Project.