public final class ProgramSV extends AbstractSV implements ProgramConstruct, UpdateableOperator
| Modifier and Type | Field and Description |
|---|---|
private static ProgramList |
EMPTY_LIST_INSTANTIATION |
private boolean |
isListSV |
| Constructor and Description |
|---|
ProgramSV(Name name,
ProgramSVSort s,
boolean isListSV)
creates a new SchemaVariable used as a placeholder for program constructs
|
| Modifier and Type | Method and Description |
|---|---|
private MatchConditions |
addProgramInstantiation(ProgramElement pe,
MatchConditions matchCond,
Services services)
adds a found mapping from schema variable
var to program
element pe and returns the updated match conditions or null
if mapping is not possible because of violating some variable condition |
private MatchConditions |
addProgramInstantiation(ProgramList list,
MatchConditions matchCond,
Services services)
adds a found mapping from schema variable
var to the list of
program elements list and returns the updated match
conditions or null if mapping is not possible because of violating some
variable condition |
private boolean |
check(ProgramElement match,
ExecutionContext ec,
Services services)
returns true, if the given SchemaVariable can stand for the
ProgramElement
|
ImmutableList<LocationVariable> |
collectParameters() |
boolean |
equalsModRenaming(SourceElement se,
NameAbstractionTable nat)
this method tests on object identity
|
StatementBlock |
getBody() |
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.
|
Comment[] |
getComments()
Get comments.
|
KeYJavaType |
getContainerType()
Returns the container type of this symbol; for non-static observer
symbols, this corresponds to the sort of its second argument.
|
int |
getDimensions() |
Position |
getEndPosition()
Returns the end position of the primary token of this element.
|
Expression |
getExpressionAt(int index) |
int |
getExpressionCount()
Get the number of expressions in this container.
|
SourceElement |
getFirstElement()
Finds the source element that occurs first in the source.
|
SourceElement |
getFirstElementIncludingBlocks()
Finds the source element that occurs first in the source.
|
java.lang.String |
getFullName() |
int |
getHeapCount(Services services)
Check the heap count of the declaration, e.g. the base heap and extra heap.
|
ImmutableArray<LoopInitializer> |
getInits() |
KeYJavaType |
getKeYJavaType() |
KeYJavaType |
getKeYJavaType(Services javaServ) |
KeYJavaType |
getKeYJavaType(Services javaServ,
ExecutionContext ec)
returns the
KeYJavaType of an expression |
SourceElement |
getLastElement()
Finds the source element that occurs last in the source.
|
IProgramMethod |
getMethodContext()
returns the program method which is currently active
|
MethodDeclaration |
getMethodDeclaration() |
ImmutableArray<Modifier> |
getModifiers()
Get the modifiers.
|
java.lang.String |
getName()
Return the name of the model element.
|
int |
getNumParams()
Gives the number of parameters of the observer symbol.
|
PackageReference |
getPackageReference()
Get the package reference.
|
ParameterDeclaration |
getParameterDeclarationAt(int index) |
int |
getParameterDeclarationCount() |
ImmutableArray<ParameterDeclaration> |
getParameters() |
KeYJavaType |
getParameterType(int i)
returns the KeYJavaType of the i-th parameter declaration.
|
KeYJavaType |
getParamType(int i)
Gives the type of the i-th parameter of this observer symbol.
|
ImmutableArray<KeYJavaType> |
getParamTypes()
Returns the parameter types of this observer symbol.
|
PositionInfo |
getPositionInfo()
complete position information
|
ProgramElementName |
getProgramElementName()
Get identifier.
|
ReferencePrefix |
getReferencePrefix() |
Position |
getRelativePosition()
Returns the relative position (number of blank heading lines and
columns) of the primary token of this element.
|
KeYJavaType |
getReturnType() |
ReferencePrefix |
getRuntimeInstance()
returns the runtime instance object
|
Position |
getStartPosition()
Returns the start position of the primary token of this element.
|
int |
getStateCount()
Check the state count of the declaration (no_state = 0, two_state = 2, 1 otherwise).
|
Statement |
getStatementAt(int i) |
int |
getStatementCount()
Get the number of statements in this container.
|
Throws |
getThrown() |
KeYJavaType |
getType()
Returns the result type of this symbol.
|
TypeReference |
getTypeReference()
returns the type reference to the next enclosing class
|
TypeReference |
getTypeReferenceAt(int index) |
int |
getTypeReferenceCount()
Get the number of type references in this container.
|
java.lang.String |
getUniqueName() |
ImmutableArray<Expression> |
getUpdates() |
VariableSpecification |
getVariableSpecification(int index)
Returns the variablespecification of the i-th parameterdeclaration
|
boolean |
isAbstract() |
boolean |
isConstructor()
Test whether the declaration is a constructor.
|
boolean |
isFinal() |
boolean |
isImplicit() |
boolean |
isListSV() |
boolean |
isModel()
Test whether the declaration is model.
|
boolean |
isNative() |
boolean |
isPrivate()
Test whether the declaration is private.
|
boolean |
isProtected()
Test whether the declaration is protected.
|
boolean |
isPublic()
Test whether the declaration is public.
|
boolean |
isStatic()
Tells whether the observer symbol is static.
|
boolean |
isStrictFp()
Test whether the declaration is strictfp.
|
boolean |
isSynchronized() |
boolean |
isVoid() |
MatchConditions |
match(SourceData source,
MatchConditions matchCond)
matches the source "text" (@link SourceData#getSource()) against the pattern represented
by this object.
|
private MatchConditions |
matchListSV(SourceData source,
MatchConditions matchCond) |
void |
prettyPrint(PrettyPrinter w)
Pretty print.
|
java.lang.String |
proofToString()
Creates a parseable string representation of the declaration of the
schema variable.
|
int |
size() |
java.lang.String |
toString() |
void |
visit(Visitor v)
calls the corresponding method of a visitor in order to
perform some action/transformation on this element
|
isStrict, toStringadditionalValidTopLevel, additionalValidTopLevel2, argSort, argSorts, sort, sortarity, bindVarsAt, isRigid, name, validTopLevel, whereToBindclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitargSort, argSorts, sortarity, bindVarsAt, isRigid, sort, validTopLevelprivate static final ProgramList EMPTY_LIST_INSTANTIATION
private final boolean isListSV
ProgramSV(Name name, ProgramSVSort s, boolean isListSV)
name - the Name of the SchemaVariable allowed to match a list of
program constructspublic boolean isListSV()
public boolean equalsModRenaming(SourceElement se, NameAbstractionTable nat)
equalsModRenaming in interface SourceElementpublic Comment[] getComments()
ProgramElementgetComments in interface LabelgetComments in interface ProgramElementpublic SourceElement getFirstElement()
SourceElementgetFirstElement in interface LabelgetFirstElement in interface SourceElementSourceElement.getStartPosition()public SourceElement getFirstElementIncludingBlocks()
SourceElementgetFirstElementIncludingBlocks in interface SourceElementSourceElement.getStartPosition()public SourceElement getLastElement()
SourceElementgetLastElement in interface LabelgetLastElement in interface SourceElementSourceElement.getEndPosition()public Position getStartPosition()
SourceElementgetFirstElement().getStartPosition in interface LabelgetStartPosition in interface SourceElementpublic Position getEndPosition()
SourceElementgetLastElement().getEndPosition in interface LabelgetEndPosition in interface SourceElementpublic Position getRelativePosition()
SourceElementgetFirstElement().getRelativePosition in interface LabelgetRelativePosition in interface SourceElementpublic PositionInfo getPositionInfo()
SourceElementgetPositionInfo in interface SourceElementpublic ReferencePrefix getReferencePrefix()
getReferencePrefix in interface ReferencePrefixgetReferencePrefix in interface TypeReferencepublic int getDimensions()
getDimensions in interface TypeReferencepublic int getTypeReferenceCount()
TypeReferenceContainergetTypeReferenceCount in interface TypeReferenceContainerpublic TypeReference getTypeReferenceAt(int index)
getTypeReferenceAt in interface TypeReferenceContainerpublic PackageReference getPackageReference()
PackageReferenceContainergetPackageReference in interface PackageReferenceContainerpublic int getExpressionCount()
ExpressionContainergetExpressionCount in interface ExpressionContainerpublic Expression getExpressionAt(int index)
getExpressionAt in interface ExpressionContainergetExpressionAt in interface IForUpdatespublic int getChildCount()
NonTerminalProgramElementgetChildCount in interface NonTerminalProgramElementpublic ProgramElement getChildAt(int index)
NonTerminalProgramElementgetChildAt in interface NonTerminalProgramElementindex - an index into this node's "virtual" child arraypublic int getStatementCount()
StatementContainergetStatementCount in interface StatementContainerpublic int size()
size in interface IForUpdatessize in interface ILoopInitpublic ImmutableArray<Expression> getUpdates()
getUpdates in interface IForUpdatespublic ImmutableArray<LoopInitializer> getInits()
public Statement getStatementAt(int i)
getStatementAt in interface StatementContainerpublic ProgramElementName getProgramElementName()
NamedProgramElementgetProgramElementName in interface NamedProgramElementgetProgramElementName in interface TypeReferencegetProgramElementName in interface IProgramMethodpublic java.lang.String getName()
NamedModelElementgetName in interface NamedModelElementgetName in interface TypeReferencegetName in interface IProgramMethodpublic void visit(Visitor v)
SourceElementvisit in interface Labelvisit in interface SourceElementv - the Visitorpublic void prettyPrint(PrettyPrinter w) throws java.io.IOException
SourceElementprettyPrint in interface LabelprettyPrint in interface SourceElementw - a pretty printer.java.io.IOException - occasionally thrown.public KeYJavaType getKeYJavaType()
getKeYJavaType in interface TypeReferencegetKeYJavaType in interface IProgramVariablepublic KeYJavaType getKeYJavaType(Services javaServ)
getKeYJavaType in interface IProgramVariablepublic KeYJavaType getKeYJavaType(Services javaServ, ExecutionContext ec)
ExpressionKeYJavaType of an expressiongetKeYJavaType in interface ExpressiongetKeYJavaType in interface IProgramVariableprivate MatchConditions addProgramInstantiation(ProgramElement pe, MatchConditions matchCond, Services services)
var to program
element pe and returns the updated match conditions or null
if mapping is not possible because of violating some variable conditionpe - the ProgramElement var is mapped tomatchCond - the MatchConditions to be updatedservices - the Services provide access to the Java modelvar
to pe or null if some variable condition would be
hurt by the mappingprivate MatchConditions addProgramInstantiation(ProgramList list, MatchConditions matchCond, Services services)
var to the list of
program elements list and returns the updated match
conditions or null if mapping is not possible because of violating some
variable conditionlist - the ProgramList var is mapped tomatchCond - the MatchConditions to be updatedservices - the Services provide access to the Java modelvar
to list or null if some variable condition would be
hurt by the mappingprivate MatchConditions matchListSV(SourceData source, MatchConditions matchCond)
private boolean check(ProgramElement match, ExecutionContext ec, Services services)
match - the ProgramElement to be matchedservices - the Services object encapsulating information about the java
datastructures like (static)types etc.public MatchConditions match(SourceData source, MatchConditions matchCond)
ProgramElementMatchConditions with
the found instantiations of the schemavariables. If the match
failed, null is returned instead.match in interface ProgramElementsource - the SourceData with the program element to matchmatchCond - the MatchConditions found up to this pointpublic java.lang.String toString()
toString in class AbstractOperatorpublic java.lang.String proofToString()
SchemaVariableproofToString in interface SchemaVariablepublic MethodDeclaration getMethodDeclaration()
getMethodDeclaration in interface IProgramMethodpublic KeYJavaType getParameterType(int i)
IProgramMethodgetParameterType in interface IProgramMethodi - the int specifying the parameter positionpublic StatementBlock getBody()
getBody in interface IProgramMethodpublic boolean isConstructor()
IProgramMethodisConstructor in interface IProgramMethodpublic boolean isModel()
IProgramMethodisModel in interface IProgramMethodpublic int getStateCount()
IObserverFunctiongetStateCount in interface IObserverFunctionpublic int getHeapCount(Services services)
IObserverFunctiongetHeapCount in interface IObserverFunctionpublic boolean isVoid()
isVoid in interface IProgramMethodpublic KeYJavaType getReturnType()
getReturnType in interface IProgramMethodpublic java.lang.String getUniqueName()
getUniqueName in interface IProgramMethodpublic java.lang.String getFullName()
getFullName in interface IProgramMethodpublic boolean isAbstract()
isAbstract in interface IProgramMethodpublic boolean isImplicit()
isImplicit in interface IProgramMethodpublic boolean isNative()
isNative in interface IProgramMethodpublic boolean isFinal()
isFinal in interface IProgramMethodpublic boolean isSynchronized()
isSynchronized in interface IProgramMethodpublic Throws getThrown()
getThrown in interface IProgramMethodpublic ParameterDeclaration getParameterDeclarationAt(int index)
getParameterDeclarationAt in interface IProgramMethodpublic VariableSpecification getVariableSpecification(int index)
IProgramMethodgetVariableSpecification in interface IProgramMethodpublic int getParameterDeclarationCount()
getParameterDeclarationCount in interface IProgramMethodpublic ImmutableArray<ParameterDeclaration> getParameters()
getParameters in interface IProgramMethodpublic ImmutableList<LocationVariable> collectParameters()
collectParameters in interface IProgramMethodLocationVariables passed as parameters to
this IProgramMethod.public boolean isPrivate()
MemberDeclarationisPrivate in interface MemberDeclarationpublic boolean isProtected()
MemberDeclarationisProtected in interface MemberDeclarationpublic boolean isPublic()
MemberDeclarationisPublic in interface MemberDeclarationpublic boolean isStatic()
IObserverFunctionisStatic in interface MemberDeclarationisStatic in interface IObserverFunctionpublic boolean isStrictFp()
MemberDeclarationisStrictFp in interface MemberDeclarationpublic ImmutableArray<Modifier> getModifiers()
DeclarationgetModifiers in interface Declarationpublic ImmutableArray<KeYJavaType> getParamTypes()
IObserverFunctiongetParamTypes in interface IObserverFunctiongetParamTypes in interface IProgramMethodpublic KeYJavaType getType()
IObserverFunctiongetType in interface IObserverFunctionpublic KeYJavaType getContainerType()
IObserverFunctiongetContainerType in interface IObserverFunctionpublic int getNumParams()
IObserverFunctiongetNumParams in interface IObserverFunctionpublic KeYJavaType getParamType(int i)
IObserverFunctiongetParamType in interface IObserverFunctionpublic TypeReference getTypeReference()
IExecutionContextgetTypeReference in interface IExecutionContextpublic IProgramMethod getMethodContext()
IExecutionContextgetMethodContext in interface IExecutionContextpublic ReferencePrefix getRuntimeInstance()
IExecutionContextgetRuntimeInstance in interface IExecutionContext