public class BlockStatement extends Statement
Constructor and Description |
---|
BlockStatement() |
BlockStatement(java.util.List<Statement> statements,
VariableScope scope)
Creates a BlockStatement with a scope and children statements.
|
BlockStatement(Statement[] statements,
VariableScope scope)
Creates a BlockStatement with a scope and children statements.
|
Modifier and Type | Method and Description |
---|---|
void |
addStatement(Statement statement) |
void |
addStatements(java.util.List<Statement> listOfStatements) |
java.util.List<Statement> |
getStatements() |
java.lang.String |
getText() |
VariableScope |
getVariableScope() |
boolean |
isEmpty() |
void |
setVariableScope(VariableScope scope) |
java.lang.String |
toString() |
void |
visit(GroovyCodeVisitor visitor) |
getStatementLabel, setStatementLabel
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getNodeMetaData, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition
public BlockStatement()
public BlockStatement(java.util.List<Statement> statements, VariableScope scope)
statements
- the statements. Do not pass null. If you do, no exception will occur,
but a NullPointerException will eventually occur later. Also, a reference
to the list is kept, so modifying the List later does effect this class.scope
- the scopepublic BlockStatement(Statement[] statements, VariableScope scope)
statements
- the statements, which cannot be null or an exception occurs. No reference
to the array is held, so modifying the array later has no effect on this
class.scope
- the scopepublic void visit(GroovyCodeVisitor visitor)
public java.util.List<Statement> getStatements()
public void addStatement(Statement statement)
public void addStatements(java.util.List<Statement> listOfStatements)
public java.lang.String toString()
toString
in class java.lang.Object
public void setVariableScope(VariableScope scope)
public VariableScope getVariableScope()