public class New extends TypeOperator implements ConstructorReference, ExpressionStatement, ReferencePrefix, ReferenceSuffix, TypeDeclarationContainer
Modifier and Type | Field and Description |
---|---|
protected ReferencePrefix |
accessPath |
protected ClassDeclaration |
anonymousClass |
typeReference
Constructor and Description |
---|
New(Expression[] arguments,
TypeReference type,
ReferencePrefix rp)
Constructor for the transformation of COMPOST ASTs to KeY.
|
New(ExtList children,
ReferencePrefix rp)
Constructor for the transformation of COMPOST ASTs to KeY.
|
New(ExtList children,
ReferencePrefix rp,
PositionInfo pi)
Constructor for the transformation of COMPOST ASTs to KeY.
|
Modifier and Type | Method and Description |
---|---|
int |
getArity()
getArity() == getASTchildren().size()
|
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.
|
ClassDeclaration |
getClassDeclaration() |
SourceElement |
getFirstElement()
Finds the source element that occurs first in the source.
|
SourceElement |
getFirstElementIncludingBlocks()
Finds the source element that occurs first in the source.
|
SourceElement |
getLastElement()
Finds the source element that occurs last in the source.
|
int |
getNotation() |
int |
getPrecedence()
0 is the "highest" precedence (obtained by parantheses),
13 the "lowest".
|
ReferencePrefix |
getReferencePrefix()
Get reference prefix.
|
TypeDeclaration |
getTypeDeclarationAt(int index) |
int |
getTypeDeclarationCount()
Get the number of type declarations in this container.
|
void |
prettyPrint(PrettyPrinter p)
Pretty printing the source element.
|
ReferencePrefix |
setReferencePrefix(ReferencePrefix r) |
void |
visit(Visitor v)
calls the corresponding method of a visitor in order to
perform some action/transformation on this element
|
getKeYJavaType, getKeYJavaType, getTypeReference, getTypeReferenceAt, getTypeReferenceCount
getArguments, getExpressionAt, getExpressionCount, isLeftAssociative, isToBeParenthesized, precedes, reuseSignature
compatibleBlockSize, computeHashCode, equals, equalsModRenaming, getArrayPos, match, matchChildren
getComments, hashCode, prettyPrintMain
getEndPosition, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getArguments
getExpressionAt, getExpressionCount
getComments, match
equalsModRenaming, getEndPosition, getPositionInfo, getRelativePosition, getStartPosition
getKeYJavaType
protected final ClassDeclaration anonymousClass
protected final ReferencePrefix accessPath
public New(ExtList children, ReferencePrefix rp)
children
- the children of this AST element as KeY classes.
a ClassDeclaration (in case of an anonymous class decl)
a TypeReference (the referred type)
2 of Expression (the first Expression as left hand
side, the second as right hand side),
Comments;
does NOT contain: a ReferencePrefix for the constructor
as it might be mixed up with the TypeReferencerp
- a ReferencePrefix as access path for the constructorpublic New(ExtList children, ReferencePrefix rp, PositionInfo pi)
children
- the children of this AST element as KeY classes.
a ClassDeclaration (in case of an anonymous class decl)
a TypeReference (the referred type)
2 of Expression (the first Expression as left hand
side, the second as right hand side),
Comments;
does NOT contain: a ReferencePrefix for the constructor
as it might be mixed up with the TypeReferencerp
- a ReferencePrefix as access path for the constructorpublic New(Expression[] arguments, TypeReference type, ReferencePrefix rp)
type
- a TypeReference (the referred type)rp
- a ReferencePrefix as access path for the constructorpublic SourceElement getFirstElement()
JavaSourceElement
getFirstElement
in interface SourceElement
getFirstElement
in class Operator
JavaSourceElement.toSource()
,
JavaSourceElement.getStartPosition()
public SourceElement getFirstElementIncludingBlocks()
SourceElement
getFirstElementIncludingBlocks
in interface SourceElement
getFirstElementIncludingBlocks
in class Operator
SourceElement.getStartPosition()
public SourceElement getLastElement()
JavaSourceElement
getLastElement
in interface SourceElement
getLastElement
in class Operator
JavaSourceElement.toSource()
,
JavaSourceElement.getEndPosition()
public int getArity()
Operator
public int getPrecedence()
Operator
getPrecedence
in class Operator
public int getNotation()
getNotation
in class Operator
public ClassDeclaration getClassDeclaration()
public int getTypeDeclarationCount()
TypeDeclarationContainer
getTypeDeclarationCount
in interface TypeDeclarationContainer
public TypeDeclaration getTypeDeclarationAt(int index)
getTypeDeclarationAt
in interface TypeDeclarationContainer
public int getChildCount()
Operator
getChildCount
in interface NonTerminalProgramElement
getChildCount
in class Operator
public ProgramElement getChildAt(int index)
Operator
getChildAt
in interface NonTerminalProgramElement
getChildAt
in class Operator
index
- an index into this node's "virtual" child arraypublic ReferencePrefix getReferencePrefix()
getReferencePrefix
in interface ReferencePrefix
public void visit(Visitor v)
SourceElement
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 ReferencePrefix setReferencePrefix(ReferencePrefix r)