public class LoopScopeBlock extends JavaStatement implements StatementContainer, ExpressionContainer
ProgramElement.TreeStructureSourceElement.Position| Modifier and Type | Field and Description |
|---|---|
protected Statement |
body |
protected Expression |
indexPV |
private static long |
serialVersionUID |
parentcommentsfactorySTRUCTURAL_EQUALITY, STRUCTURAL_HASH_CODE| Modifier | Constructor and Description |
|---|---|
|
LoopScopeBlock()
This constructor should only be used in the SchemaJavaParser!
|
|
LoopScopeBlock(Expression resultVar,
StatementBlock body) |
protected |
LoopScopeBlock(LoopScopeBlock proto) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(SourceVisitor v) |
LoopScopeBlock |
deepClone()
Deep clone.
|
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.
|
int |
getChildPositionCode(ProgramElement child) |
Expression |
getExpressionAt(int index)
Return the expression at the specified index in this node's "virtual"
expression array.
|
int |
getExpressionCount()
Get the number of expressions in this container.
|
SourceElement |
getFirstElement()
Finds the source element that occurs first in the source.
|
Expression |
getIndexPV() |
SourceElement |
getLastElement()
Finds the source element that occurs last in the source.
|
Statement |
getStatementAt(int index)
Return the statement at the specified index in this node's "virtual"
statement array.
|
int |
getStatementCount()
Get the number of statements in this container.
|
void |
makeParentRoleValid()
Ensures that each child has "this" as syntactical parent.
|
boolean |
replaceChild(ProgramElement p,
ProgramElement q)
Replace a single child in the current node.
|
void |
setBody(Statement body)
Set body.
|
void |
setIndexPV(Expression indexPV) |
getASTParent, getStatementContainer, setStatementContainergetIndexOfChild, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAllgetComments, setComments, validategetEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSourceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIndexOfChild, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAllgetASTParent, getComments, setCommentsgetEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSourcevalidateprivate static final long serialVersionUID
protected Expression indexPV
protected Statement body
public LoopScopeBlock()
setBody(Statement) and
setIndexPV(Expression) afterward.public LoopScopeBlock(Expression resultVar, StatementBlock body)
resultVar - body - protected LoopScopeBlock(LoopScopeBlock proto)
public void setIndexPV(Expression indexPV)
public Expression getIndexPV()
public void setBody(Statement body)
body - the Statementpublic Statement getBody()
public SourceElement getFirstElement()
getFirstElement in interface SourceElementgetFirstElement in class JavaSourceElementpublic SourceElement getLastElement()
getLastElement in interface SourceElementgetLastElement in class JavaSourceElementpublic 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 getChildPositionCode(ProgramElement child)
getChildPositionCode in interface NonTerminalProgramElementpublic int getStatementCount()
getStatementCount in interface StatementContainerpublic Statement getStatementAt(int index)
getStatementAt in interface StatementContainerindex - an index for a statement.java.lang.ArrayIndexOutOfBoundsException - if index is out of bounds.public int getExpressionCount()
getExpressionCount in interface ExpressionContainerpublic Expression getExpressionAt(int index)
getExpressionAt in interface ExpressionContainerindex - an index for a expression.java.lang.ArrayIndexOutOfBoundsException - if index is out of bounds.public boolean replaceChild(ProgramElement p, ProgramElement q)
replaceChild in interface NonTerminalProgramElementp - the old child.q - the new child.java.lang.ClassCastException - if the new child cannot take over the role of the old one.public void makeParentRoleValid()
makeParentRoleValid in interface NonTerminalProgramElementmakeParentRoleValid in class JavaNonTerminalProgramElementpublic void accept(SourceVisitor v)
accept in interface SourceElementpublic LoopScopeBlock deepClone()
deepClone in interface SourceElementdeepClone in interface Statement