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, setParentNodepublic static Block emptyBlock()
public static Block of(java.lang.Object block)
public Block ofAST(GoloASTNode n)
ofAST in class GoloElementpublic void merge(Block other)
public ReferenceTable getReferenceTable()
public java.util.Optional<ReferenceTable> getLocalReferenceTable()
getLocalReferenceTable in class GoloElementpublic 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.Objectpublic boolean isEmpty()
public void relink(ReferenceTable table)
Scopepublic void relinkTopLevel(ReferenceTable table)
ScopeGo up in the hierarchy of parent scope, and set the root to the given table.
relinkTopLevel in interface Scopepublic void accept(GoloIrVisitor visitor)
accept in class GoloElementpublic void walk(GoloIrVisitor visitor)
walk in class GoloElementprotected void replaceElement(GoloElement original, GoloElement newElement)
replaceElement in class GoloElement