public class Ccatch extends BranchImp implements ParameterContainer, VariableScope
Modifier and Type | Field and Description |
---|---|
protected StatementBlock |
body
Body.
|
protected java.util.Optional<ParameterDeclaration> |
parameter
Parameter.
|
Constructor and Description |
---|
Ccatch()
Ccatch.
|
Ccatch(CcatchNonstandardParameterDeclaration e,
StatementBlock body)
Ccatch.
|
Ccatch(ExtList children)
Constructor for the transformation of COMPOST ASTs to KeY.
|
Ccatch(ParameterDeclaration e,
StatementBlock body)
Ccatch.
|
Modifier and Type | Method and Description |
---|---|
Statement |
getBody()
Get body.
|
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.
|
CcatchNonstandardParameterDeclaration |
getNonStdParameterDeclaration()
Get non-standard parameter declaration.
|
CcatchNonstandardParameterDeclaration |
getNonStdParameterDeclarationAt(int index)
Return the non-standard parameter declaration at the specified index in
this node's "virtual" parameter declaration array.
|
ParameterDeclaration |
getParameterDeclaration()
Get parameter declaration.
|
ParameterDeclaration |
getParameterDeclarationAt(int index)
Return the parameter declaration at the specified index in this node's
"virtual" parameter declaration array.
|
int |
getParameterDeclarationCount()
Get the number of parameters in this container.
|
Statement |
getStatementAt(int index) |
int |
getStatementCount()
Get the number of statements in this container.
|
boolean |
hasNonStdParameterDeclaration() |
boolean |
hasParameterDeclaration() |
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 final java.util.Optional<ParameterDeclaration> parameter
protected final StatementBlock body
public Ccatch()
public Ccatch(ParameterDeclaration e, StatementBlock body)
e
- a parameter declaration.body
- a statement.public Ccatch(CcatchNonstandardParameterDeclaration e, StatementBlock body)
e
- a parameter declaration.body
- a statement.public Ccatch(ExtList children)
children
- the children of this AST element as KeY classes. May contain:
Comments, a ParameterDeclaration (declaring the catched
exceptions) a StatementBlock (as the action to do when
catching)public SourceElement getLastElement()
JavaSourceElement
getLastElement
in interface SourceElement
getLastElement
in class JavaSourceElement
JavaSourceElement.toSource()
,
JavaSourceElement.getEndPosition()
public boolean hasParameterDeclaration()
public boolean hasNonStdParameterDeclaration()
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 getStatementCount()
getStatementCount
in interface StatementContainer
public Statement getStatementAt(int index)
getStatementAt
in interface StatementContainer
public int getParameterDeclarationCount()
getParameterDeclarationCount
in interface ParameterContainer
public ParameterDeclaration getParameterDeclarationAt(int index)
getParameterDeclarationAt
in interface ParameterContainer
index
- an index for a parameter declaration.java.lang.ArrayIndexOutOfBoundsException
- if index is out of bounds.public CcatchNonstandardParameterDeclaration getNonStdParameterDeclarationAt(int index)
index
- an index for a parameter declaration.java.lang.ArrayIndexOutOfBoundsException
- if index is out of bounds.public Statement getBody()
public ParameterDeclaration getParameterDeclaration()
public CcatchNonstandardParameterDeclaration getNonStdParameterDeclaration()
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.Copyright © 2003-2019 The KeY-Project.