public class ParenthesizedExpression extends Operator implements ExpressionStatement, ReferencePrefix
Constructor and Description |
---|
ParenthesizedExpression(Expression child) |
ParenthesizedExpression(ExtList children)
Constructor for the transformation of COMPOST ASTs to KeY.
|
Modifier and Type | Method and Description |
---|---|
int |
getArity()
Get arity.
|
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.
|
SourceElement |
getFirstElement()
Finds the source element that occurs first in the source.
|
KeYJavaType |
getKeYJavaType(Services javaServ,
ExecutionContext ec)
returns the
KeYJavaType of an expression |
SourceElement |
getLastElement()
Finds the source element that occurs last in the source.
|
int |
getNotation()
Get notation.
|
int |
getPrecedence()
Get precedence.
|
ReferencePrefix |
getReferencePrefix()
We do not have a prefix, so fake it!
|
void |
prettyPrint(PrettyPrinter w)
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
|
getArguments, getExpressionAt, getExpressionCount, getFirstElementIncludingBlocks, 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
getComments, match
equalsModRenaming, getEndPosition, getFirstElementIncludingBlocks, getPositionInfo, getRelativePosition, getStartPosition
public ParenthesizedExpression(ExtList children)
children
- the children of this AST element as KeY classes.
In this case the order of the children is IMPORTANT.
May contain:
several of Expression (should be one, the first is taken
as parenthesized expression),
Commentspublic ParenthesizedExpression(Expression child)
public int getChildCount()
getChildCount
in interface NonTerminalProgramElement
getChildCount
in class Operator
public ProgramElement getChildAt(int index)
getChildAt
in interface NonTerminalProgramElement
getChildAt
in class Operator
index
- an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException
- if index is out
of boundspublic int getArity()
public int getPrecedence()
getPrecedence
in class Operator
public int getNotation()
getNotation
in class Operator
public SourceElement getFirstElement()
JavaSourceElement
getFirstElement
in interface SourceElement
getFirstElement
in class Operator
JavaSourceElement.toSource()
,
JavaSourceElement.getStartPosition()
public SourceElement getLastElement()
JavaSourceElement
getLastElement
in interface SourceElement
getLastElement
in class Operator
JavaSourceElement.toSource()
,
JavaSourceElement.getEndPosition()
public void visit(Visitor v)
visit
in interface SourceElement
v
- the Visitorpublic void prettyPrint(PrettyPrinter w) throws java.io.IOException
JavaSourceElement
prettyPrint
in interface SourceElement
prettyPrint
in class JavaProgramElement
w
- a pretty printer.java.io.IOException
- occasionally thrown.public ReferencePrefix getReferencePrefix()
getReferencePrefix
in interface ReferencePrefix
public ReferencePrefix setReferencePrefix(ReferencePrefix r)
public KeYJavaType getKeYJavaType(Services javaServ, ExecutionContext ec)
Expression
KeYJavaType
of an expressiongetKeYJavaType
in interface Expression
getKeYJavaType
in class Operator