public class Else extends BranchImp
Constructor and Description |
---|
Else(ExtList children)
Constructor for the transformation of COMPOST ASTs to KeY.
|
Else(Statement body)
Constructor for the transformation of COMPOST ASTs to KeY.
|
Modifier and Type | Method and Description |
---|---|
Statement |
getBody()
The body may be empty (null), to define a fall-through.
|
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 |
getLastElement()
Finds the source element that occurs last in the source.
|
Statement |
getStatementAt(int index) |
int |
getStatementCount()
Get the number of statements in this container.
|
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, match, matchChildren
getComments, hashCode, prettyPrintMain, reuseSignature
getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComments, match
equalsModRenaming, getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getPositionInfo, getRelativePosition, getStartPosition
protected Statement body
public Else(ExtList children)
children
- the children of this AST element as KeY classes.
May contain: a Body (as body of Else), Commentspublic Else(Statement body)
body
- Statement that is the body of the else partpublic SourceElement getLastElement()
JavaSourceElement
getLastElement
in interface SourceElement
getLastElement
in class JavaSourceElement
JavaSourceElement.toSource()
,
JavaSourceElement.getEndPosition()
public int getChildCount()
public ProgramElement getChildAt(int index)
index
- an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException
- if index is out
of boundspublic int getStatementCount()
public Statement getStatementAt(int index)
public Statement getBody()
EmptyStatement
would create a single ";".public void visit(Visitor v)
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.