public final class Block extends ExpressionStatement implements Scope
Modifier and Type | Method and Description |
---|---|
void |
accept(GoloIrVisitor visitor) |
Block |
add(java.lang.Object statement) |
void |
addStatement(GoloStatement statement) |
static Block |
emptyBlock() |
java.util.Optional<ReferenceTable> |
getLocalReferenceTable() |
ReferenceTable |
getReferenceTable() |
java.util.List<GoloStatement> |
getStatements() |
boolean |
hasOnlyReturn() |
boolean |
hasReturn() |
void |
internReferenceTable() |
boolean |
isEmpty() |
void |
merge(Block other) |
static Block |
of(java.lang.Object block) |
Block |
ofAST(GoloASTNode n) |
void |
prependStatement(GoloStatement statement) |
Block |
ref(java.lang.Object referenceTable) |
void |
relink(ReferenceTable table)
Make the given table a parent of this scope.
|
void |
relinkTopLevel(ReferenceTable table)
Make the given table the top-level parent of this scope.
|
protected void |
replaceElement(GoloElement original,
GoloElement newElement) |
void |
setReferenceTable(ReferenceTable referenceTable) |
int |
size() |
java.lang.String |
toString() |
void |
walk(GoloIrVisitor visitor) |
cantConvert, cantReplace, cantReplace, doesNotContain, getASTNode, getDocumentation, getParentNode, getPositionInSourceCode, hasASTNode, makeParentOf, replaceInParentBy, setASTNode, setParentNode
public static Block emptyBlock()
public static Block of(java.lang.Object block)
public Block ofAST(GoloASTNode n)
ofAST
in class GoloElement
public void merge(Block other)
public ReferenceTable getReferenceTable()
public java.util.Optional<ReferenceTable> getLocalReferenceTable()
getLocalReferenceTable
in class GoloElement
public Block ref(java.lang.Object referenceTable)
public void setReferenceTable(ReferenceTable referenceTable)
public void internReferenceTable()
public java.util.List<GoloStatement> getStatements()
public Block add(java.lang.Object statement)
public void addStatement(GoloStatement statement)
public void prependStatement(GoloStatement statement)
public boolean hasReturn()
public int size()
public boolean hasOnlyReturn()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isEmpty()
public void relink(ReferenceTable table)
Scope
public void relinkTopLevel(ReferenceTable table)
Scope
Go up in the hierarchy of parent scope, and set the root to the given table.
relinkTopLevel
in interface Scope
public void accept(GoloIrVisitor visitor)
accept
in class GoloElement
public void walk(GoloIrVisitor visitor)
walk
in class GoloElement
protected void replaceElement(GoloElement original, GoloElement newElement)
replaceElement
in class GoloElement