public abstract class AbstractBlock_c extends Stmt_c implements Block
Block
represents a Java block statement -- an immutable
sequence of statements.Term.Instance
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Stmt> |
statements |
exceptions, reachable
Constructor and Description |
---|
AbstractBlock_c(Position pos,
java.util.List<Stmt> statements)
Deprecated.
|
AbstractBlock_c(Position pos,
java.util.List<Stmt> statements,
Ext ext) |
Modifier and Type | Method and Description |
---|---|
<T> java.util.List<T> |
acceptCFG(CFGBuilder<?> v,
java.util.List<T> succs)
Visit this term in evaluation order, calling v.edge() for each successor
in succs, if data flows on that edge.
|
Block |
append(Stmt stmt)
Append a statement to the block, returning a new block.
|
Context |
enterScope(Context c)
Push a new scope upon entering this node, and add any declarations to the
context that should be in scope when visiting children of this node.
|
Term |
firstChild()
Return the first direct subterm performed when evaluating this term.
|
Block |
prepend(Stmt stmt)
Prepend a statement to the block, returning a new block.
|
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given
CodeWriter . |
protected <N extends AbstractBlock_c> |
reconstruct(N n,
java.util.List<Stmt> statements)
Reconstruct the block.
|
java.util.List<Stmt> |
statements()
Get the statements in the block.
|
Block |
statements(java.util.List<Stmt> statements)
Set the statements in the block.
|
protected <N extends AbstractBlock_c> |
statements(N n,
java.util.List<Stmt> statements) |
java.lang.String |
toString() |
Node |
visitChildren(NodeVisitor v)
Visit the children of the node.
|
exceptionCheck, exceptions, exceptions, exceptions, extRewrite, listChild, reachable, reachable, reachable
addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, copy, copyIfNeeded, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, dump, enterChildScope, error, error, error, exceptionCheckEnter, ext, ext, ext, ext, extRewriteEnter, isDisambiguated, isTypeChecked, lang, position, position, position, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visit, visitChild, visitEdge, visitList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
exceptions, exceptions, reachable, reachable
del, del, dump, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitEdge
addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChild, visitList
protected java.util.List<Stmt> statements
@Deprecated public AbstractBlock_c(Position pos, java.util.List<Stmt> statements)
public java.util.List<Stmt> statements()
Block
statements
in interface Block
Stmt
.public Block statements(java.util.List<Stmt> statements)
Block
statements
in interface Block
statements
- A list of Stmt
.protected <N extends AbstractBlock_c> N statements(N n, java.util.List<Stmt> statements)
public Block append(Stmt stmt)
Block
public Block prepend(Stmt stmt)
Block
protected <N extends AbstractBlock_c> N reconstruct(N n, java.util.List<Stmt> statements)
public Node visitChildren(NodeVisitor v)
NodeOps
visitChildren
in interface NodeOps
visitChildren
in class Node_c
v
- The visitor that will traverse/rewrite the AST.this
.public Context enterScope(Context c)
Node_c
enterScope
in interface NodeOps
enterScope
in class Node_c
c
- the current Context
Context
to be used for visiting this node.public void prettyPrint(CodeWriter w, PrettyPrinter tr)
Node_c
CodeWriter
.prettyPrint
in interface NodeOps
prettyPrint
in class Node_c
w
- The code writer to which to write.tr
- The pretty printer. This is not a visitor.public Term firstChild()
TermOps
firstChild
in interface TermOps
firstChild
in class Term_c
public <T> java.util.List<T> acceptCFG(CFGBuilder<?> v, java.util.List<T> succs)
TermOps