public abstract class TypeReferenceImp extends JavaNonTerminalProgramElement implements TypeReference
Type
s 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() |
java.lang.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, computeHashCode, equals, equalsModRenaming, getArrayPos, matchChildren
getComments, hashCode, prettyPrintMain, reuseSignature
getEndPosition, getLastElement, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComments
protected 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()
JavaSourceElement
getFirstElement
in interface SourceElement
getFirstElement
in class JavaSourceElement
JavaSourceElement.toSource()
,
JavaSourceElement.getStartPosition()
public SourceElement getFirstElementIncludingBlocks()
SourceElement
getFirstElementIncludingBlocks
in interface SourceElement
getFirstElementIncludingBlocks
in class JavaSourceElement
SourceElement.getStartPosition()
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 int getTypeReferenceCount()
getTypeReferenceCount
in interface TypeReferenceContainer
public TypeReference getTypeReferenceAt(int index)
getTypeReferenceAt
in interface TypeReferenceContainer
public int getExpressionCount()
getExpressionCount
in interface ExpressionContainer
public Expression getExpressionAt(int index)
getExpressionAt
in interface ExpressionContainer
public ReferencePrefix getReferencePrefix()
getReferencePrefix
in interface ReferencePrefix
getReferencePrefix
in interface TypeReference
public PackageReference getPackageReference()
getPackageReference
in interface PackageReferenceContainer
public int getDimensions()
getDimensions
in interface TypeReference
public final java.lang.String getName()
getName
in interface NamedModelElement
getName
in interface TypeReference
public abstract KeYJavaType getKeYJavaType()
getKeYJavaType
in interface TypeReference
public ProgramElementName getProgramElementName()
getProgramElementName
in interface NamedProgramElement
getProgramElementName
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 MatchConditions match(SourceData source, MatchConditions matchCond)
ProgramElement
MatchConditions
with
the found instantiations of the schemavariables. If the match
failed, null is returned instead.match
in interface ProgramElement
match
in class JavaNonTerminalProgramElement
source
- the SourceData with the program element to matchmatchCond
- the MatchConditions found up to this point