public class StatementBlock extends JavaStatement implements StatementContainer, TypeDeclarationContainer, VariableScope, TypeScope, ProgramPrefix
JavaProgramElement.NameAbstractionTableDisabled| Modifier and Type | Field and Description |
|---|---|
private ImmutableArray<? extends Statement> |
body
Body.
|
private MethodFrame |
innerMostMethodFrame |
private int |
prefixLength |
| Constructor and Description |
|---|
StatementBlock() |
StatementBlock(ExtList children)
Statement block.
|
StatementBlock(ImmutableArray<? extends Statement> as) |
StatementBlock(Statement... body) |
StatementBlock(Statement as) |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableArray<ProgramPrefix> |
computePrefixElements(ImmutableArray<? extends Statement> b,
ProgramPrefix current)
computes the prefix elements for the given array of statment block
|
boolean |
equalsModRenaming(SourceElement se,
NameAbstractionTable nat)
commented in interface SourceElement.
|
ImmutableArray<? extends 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.
|
PosInProgram |
getFirstActiveChildPos()
returns the position of the first active child
|
SourceElement |
getFirstElement()
Finds the source element that occurs first in the source.
|
SourceElement |
getFirstElementIncludingBlocks()
Finds the source element that occurs first in the source.
|
MethodFrame |
getInnerMostMethodFrame()
returns the inner most
MethodFrame |
ProgramPrefix |
getLastPrefixElement()
return the last prefix element
|
ProgramPrefix |
getNextPrefixElement()
return the next prefix element
if no next prefix element is available an IndexOutOfBoundsException is thrown
|
ImmutableArray<ProgramPrefix> |
getPrefixElements()
returns an array with all prefix elements starting at
this element
|
int |
getPrefixLength()
returns the length of the prefix
|
Statement |
getStatementAt(int index) |
int |
getStatementCount()
Get the number of statements in this container.
|
TypeDeclaration |
getTypeDeclarationAt(int index) |
int |
getTypeDeclarationCount()
Get the number of type declarations in this container.
|
boolean |
hasNextPrefixElement()
return true if there is a next prefix element
|
boolean |
isEmpty() |
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, getArrayPos, match, matchChildrengetComments, hashCode, prettyPrintMain, reuseSignaturegetEndPosition, getLastElement, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetComments, matchgetEndPosition, getLastElement, getPositionInfo, getRelativePosition, getStartPositionprivate final ImmutableArray<? extends Statement> body
private final int prefixLength
private final MethodFrame innerMostMethodFrame
public StatementBlock()
public StatementBlock(ExtList children)
children - an ExtList that contains the childrenpublic StatementBlock(ImmutableArray<? extends Statement> as)
public StatementBlock(Statement as)
public StatementBlock(Statement... body)
public boolean equalsModRenaming(SourceElement se, NameAbstractionTable nat)
JavaNonTerminalProgramElementequalsModRenaming in interface SourceElementequalsModRenaming in class JavaNonTerminalProgramElementpublic static ImmutableArray<ProgramPrefix> computePrefixElements(ImmutableArray<? extends Statement> b, ProgramPrefix current)
public ImmutableArray<? extends Statement> getBody()
public final boolean isEmpty()
public int getChildCount()
getChildCount in interface NonTerminalProgramElementpublic ProgramElement getChildAt(int index)
getChildAt in interface NonTerminalProgramElementindex - an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException - if index is out
of boundspublic int getStatementCount()
getStatementCount in interface StatementContainerpublic Statement getStatementAt(int index)
getStatementAt in interface StatementContainerpublic int getTypeDeclarationCount()
getTypeDeclarationCount in interface TypeDeclarationContainerpublic TypeDeclaration getTypeDeclarationAt(int index)
getTypeDeclarationAt in interface TypeDeclarationContainerpublic void visit(Visitor v)
visit in interface SourceElementv - the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElementprettyPrint in interface SourceElementprettyPrint in class JavaProgramElementp - a pretty printer.java.io.IOException - occasionally thrown.public SourceElement getFirstElement()
JavaSourceElementgetFirstElement in interface SourceElementgetFirstElement in class JavaSourceElementJavaSourceElement.toSource(),
JavaSourceElement.getStartPosition()public SourceElement getFirstElementIncludingBlocks()
SourceElementgetFirstElementIncludingBlocks in interface SourceElementgetFirstElementIncludingBlocks in class JavaSourceElementSourceElement.getStartPosition()public boolean hasNextPrefixElement()
ProgramPrefixhasNextPrefixElement in interface ProgramPrefixpublic ProgramPrefix getNextPrefixElement()
ProgramPrefixgetNextPrefixElement in interface ProgramPrefixpublic ProgramPrefix getLastPrefixElement()
ProgramPrefixgetLastPrefixElement in interface ProgramPrefixpublic int getPrefixLength()
ProgramPrefixgetPrefixLength in interface ProgramPrefixpublic MethodFrame getInnerMostMethodFrame()
ProgramPrefixMethodFramegetInnerMostMethodFrame in interface ProgramPrefixpublic ImmutableArray<ProgramPrefix> getPrefixElements()
ProgramPrefixgetPrefixElements in interface ProgramPrefixpublic PosInProgram getFirstActiveChildPos()
ProgramPrefixgetFirstActiveChildPos in interface ProgramPrefix