public class LoopScopeBlock extends JavaStatement implements StatementContainer, ExpressionContainer
ProgramElement.TreeStructure
SourceElement.Position
Modifier and Type | Field and Description |
---|---|
protected Statement |
body |
protected Expression |
indexPV |
private static long |
serialVersionUID |
parent
comments
factory
STRUCTURAL_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, setStatementContainer
getIndexOfChild, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll
getComments, setComments, validate
getEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIndexOfChild, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll
getASTParent, getComments, setComments
getEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
validate
private 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 SourceElement
getFirstElement
in class JavaSourceElement
public SourceElement getLastElement()
getLastElement
in interface SourceElement
getLastElement
in class JavaSourceElement
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 getChildPositionCode(ProgramElement child)
getChildPositionCode
in interface NonTerminalProgramElement
public int getStatementCount()
getStatementCount
in interface StatementContainer
public Statement getStatementAt(int index)
getStatementAt
in interface StatementContainer
index
- an index for a statement.java.lang.ArrayIndexOutOfBoundsException
- if index is out of bounds.public int getExpressionCount()
getExpressionCount
in interface ExpressionContainer
public Expression getExpressionAt(int index)
getExpressionAt
in interface ExpressionContainer
index
- an index for a expression.java.lang.ArrayIndexOutOfBoundsException
- if index is out of bounds.public boolean replaceChild(ProgramElement p, ProgramElement q)
replaceChild
in interface NonTerminalProgramElement
p
- 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 NonTerminalProgramElement
makeParentRoleValid
in class JavaNonTerminalProgramElement
public void accept(SourceVisitor v)
accept
in interface SourceElement
public LoopScopeBlock deepClone()
deepClone
in interface SourceElement
deepClone
in interface Statement