public abstract class TypeReferenceImp extends JavaNonTerminalProgramElement implements TypeReference
Types by name.
A TypeReference can refer to an outer or inner type and hence can also
be a MemberReference, but does not have to.
A TypeReference can also occur as part of a reference path and
as a prefix for types, too. As a possible suffix for types, it can
have other TypeReferences as a prefix, playing the role of a
TypeReferenceContainer.| Modifier and Type | Field and Description |
|---|---|
protected int |
dimensions
Dimensions.
|
protected ProgramElementName |
name
Name.
|
protected ReferencePrefix |
prefix
Prefix.
|
| Constructor and Description |
|---|
TypeReferenceImp(ExtList children,
int dim)
Constructor for the transformation of RECODER ASTs to KeY.
|
TypeReferenceImp(ProgramElementName name) |
TypeReferenceImp(ProgramElementName name,
int dimension,
ReferencePrefix prefix) |
| Modifier and Type | Method and Description |
|---|---|
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()
Get dimensions.
|
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.
|
abstract KeYJavaType |
getKeYJavaType() |
String |
getName()
Get name.
|
PackageReference |
getPackageReference()
Get the package reference.
|
ProgramElementName |
getProgramElementName()
Get identifier.
|
ReferencePrefix |
getReferencePrefix()
Get reference prefix.
|
TypeReference |
getTypeReferenceAt(int index) |
int |
getTypeReferenceCount()
Get the number of type references in this container.
|
MatchConditions |
match(SourceData source,
MatchConditions matchCond)
matches the source "text" (@link SourceData#getSource()) against the pattern represented
by this object.
|
void |
prettyPrint(PrettyPrinter p)
Pretty printing the source element.
|
void |
visit(Visitor v)
calls the corresponding method of a visitor in order to
perform some action/transformation on this element
|
compatibleBlockSize, equals, equalsModRenaming, getArrayPos, hashCode, matchChildrengetComments, prettyPrintMain, reuseSignaturegetEndPosition, getLastElement, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCommentsprotected ReferencePrefix prefix
protected int dimensions
protected ProgramElementName name
public TypeReferenceImp(ExtList children, int dim)
children - the children of this AST element as KeY classes.
May contain:
a ReferencePrefix (as prefix of the type reference)
a ProgramElementName (as name for the type reference)
Commentsdim - the dimension of this typepublic TypeReferenceImp(ProgramElementName name)
public TypeReferenceImp(ProgramElementName name, int dimension, ReferencePrefix prefix)
public SourceElement getFirstElement()
JavaSourceElementgetFirstElement in interface SourceElementgetFirstElement in class JavaSourceElementJavaSourceElement.toSource(),
JavaSourceElement.getStartPosition()public SourceElement getFirstElementIncludingBlocks()
SourceElementgetFirstElementIncludingBlocks in interface SourceElementgetFirstElementIncludingBlocks in class JavaSourceElementSourceElement.getStartPosition()public int getChildCount()
getChildCount in interface NonTerminalProgramElementpublic ProgramElement getChildAt(int index)
getChildAt in interface NonTerminalProgramElementindex - an index into this node's "virtual" child arrayArrayIndexOutOfBoundsException - if index is out
of boundspublic int getTypeReferenceCount()
getTypeReferenceCount in interface TypeReferenceContainerpublic TypeReference getTypeReferenceAt(int index)
getTypeReferenceAt in interface TypeReferenceContainerpublic int getExpressionCount()
getExpressionCount in interface ExpressionContainerpublic Expression getExpressionAt(int index)
getExpressionAt in interface ExpressionContainerpublic ReferencePrefix getReferencePrefix()
getReferencePrefix in interface ReferencePrefixgetReferencePrefix in interface TypeReferencepublic PackageReference getPackageReference()
getPackageReference in interface PackageReferenceContainerpublic int getDimensions()
getDimensions in interface TypeReferencepublic final String getName()
getName in interface NamedModelElementgetName in interface TypeReferencepublic abstract KeYJavaType getKeYJavaType()
getKeYJavaType in interface TypeReferencepublic ProgramElementName getProgramElementName()
getProgramElementName in interface NamedProgramElementgetProgramElementName in interface TypeReferencepublic void visit(Visitor v)
visit in interface SourceElementv - the Visitorpublic void prettyPrint(PrettyPrinter p) throws IOException
JavaSourceElementprettyPrint in interface SourceElementprettyPrint in class JavaProgramElementp - a pretty printer.IOException - occasionally thrown.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 ProgramElementmatch in class JavaNonTerminalProgramElementsource - the SourceData with the program element to matchmatchCond - the MatchConditions found up to this point