public abstract class ProgramTransformer extends JavaNonTerminalProgramElement implements StatementContainer, Statement, Expression, TypeReference
Modifier and Type | Field and Description |
---|---|
private ProgramElement |
body
the encapsulated program element
|
private Name |
name
the name of the meta construct
|
Constructor and Description |
---|
ProgramTransformer(Name name,
ProgramElement body)
creates a ProgramTransformer
|
ProgramTransformer(java.lang.String name,
ProgramElement body)
creates a ProgramTransformer
|
Modifier and Type | Method and Description |
---|---|
ProgramElement |
body()
returns the body of the meta construct
|
ProgramElement |
getChildAt(int index)
Returns the child at the specified index in this node's "virtual"
child array.
|
int |
getChildCount()
Returns the number of children of this node.
|
int |
getDimensions() |
Expression |
getExpressionAt(int index) |
int |
getExpressionCount()
Get the number of expressions in this container.
|
KeYJavaType |
getKeYJavaType() |
KeYJavaType |
getKeYJavaType(Services javaServ,
ExecutionContext ec)
returns the
KeYJavaType of an expression |
KeYJavaType |
getKeYJavaType(TermServices javaServ) |
SourceElement |
getLastElement()
Finds the source element that occurs last in the source.
|
java.lang.String |
getName()
Return the name of the model element.
|
PackageReference |
getPackageReference()
Get the package reference.
|
ProgramElementName |
getProgramElementName()
Get identifier.
|
ReferencePrefix |
getReferencePrefix() |
Statement |
getStatementAt(int index) |
int |
getStatementCount()
Get the number of statements in this container.
|
TypeReference |
getTypeReferenceAt(int index) |
int |
getTypeReferenceCount()
Get the number of type references in this container.
|
Name |
name()
returns the name of the meta construct
|
ImmutableList<SchemaVariable> |
neededInstantiations(SVInstantiations svInst)
get a list of schema variables that are needed by this entity when
working given a SV instantiation set.
|
ImmutableList<SchemaVariable> |
needs()
get a list of schema variables that are needed by this entity when
working given a SV instantiation set.
|
void |
prettyPrint(PrettyPrinter p)
Pretty printing the source element.
|
ReferencePrefix |
setReferencePrefix(ReferencePrefix r) |
java.lang.String |
toString()
to String
|
abstract ProgramElement[] |
transform(ProgramElement pe,
Services services,
SVInstantiations svInst)
performs the program transformation needed for symbolic
program transformation
|
void |
visit(Visitor v)
calls the corresponding method of a visitor in order to
perform some action/transformation on this element
|
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
private Name name
private ProgramElement body
public ProgramTransformer(Name name, ProgramElement body)
name
- the Name of the meta constructbody
- the ProgramElement contained by the meta constructpublic ProgramTransformer(java.lang.String name, ProgramElement body)
name
- the String with the name of the meta constructbody
- the ProgramElement contained by the meta constructpublic abstract ProgramElement[] transform(ProgramElement pe, Services services, SVInstantiations svInst)
pe
- the ProgramElement on which the execution is performedservices
- the Services with all necessary information
about the java programssvInst
- the instantiations of the schemavariablespublic Name name()
public ProgramElement body()
public SourceElement getLastElement()
getLastElement
in interface SourceElement
getLastElement
in class JavaSourceElement
JavaSourceElement.toSource()
,
JavaSourceElement.getEndPosition()
public int getStatementCount()
getStatementCount
in interface StatementContainer
public Statement getStatementAt(int index)
getStatementAt
in interface StatementContainer
public int getChildCount()
getChildCount
in interface NonTerminalProgramElement
public ProgramElement getChildAt(int index)
getChildAt
in interface NonTerminalProgramElement
index
- an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException
- if index is out
of boundspublic ReferencePrefix getReferencePrefix()
getReferencePrefix
in interface ReferencePrefix
getReferencePrefix
in interface TypeReference
public ReferencePrefix setReferencePrefix(ReferencePrefix r)
public int getDimensions()
getDimensions
in interface TypeReference
public int getTypeReferenceCount()
TypeReferenceContainer
getTypeReferenceCount
in interface TypeReferenceContainer
public TypeReference getTypeReferenceAt(int index)
getTypeReferenceAt
in interface TypeReferenceContainer
public PackageReference getPackageReference()
PackageReferenceContainer
getPackageReference
in interface PackageReferenceContainer
public int getExpressionCount()
ExpressionContainer
getExpressionCount
in interface ExpressionContainer
public Expression getExpressionAt(int index)
getExpressionAt
in interface ExpressionContainer
public ProgramElementName getProgramElementName()
NamedProgramElement
getProgramElementName
in interface NamedProgramElement
getProgramElementName
in interface TypeReference
public java.lang.String getName()
NamedModelElement
getName
in interface NamedModelElement
getName
in interface TypeReference
public void visit(Visitor v)
visit
in interface SourceElement
v
- the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElement
prettyPrint
in interface SourceElement
prettyPrint
in class JavaProgramElement
p
- a pretty printer.java.io.IOException
- occasionally thrown.public java.lang.String toString()
toString
in class JavaSourceElement
public KeYJavaType getKeYJavaType()
getKeYJavaType
in interface TypeReference
public KeYJavaType getKeYJavaType(TermServices javaServ)
public KeYJavaType getKeYJavaType(Services javaServ, ExecutionContext ec)
Expression
KeYJavaType
of an expressiongetKeYJavaType
in interface Expression
public ImmutableList<SchemaVariable> needs()
svInst
- the instantiations of SV so far.public ImmutableList<SchemaVariable> neededInstantiations(SVInstantiations svInst)
svInst
- the instatiations of SV so far.