public class Labeled_c extends Stmt_c implements Labeled
Term.Instance
Modifier and Type | Field and Description |
---|---|
protected Id |
label |
protected Stmt |
statement |
exceptions, reachable
Constructor and Description |
---|
Labeled_c(Position pos,
Id label,
Stmt statement) |
Labeled_c(Position pos,
Id label,
Stmt statement,
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.
|
Node |
copy(NodeFactory nf)
Produce a copy of this node using the given NodeFactory.
|
Context |
enterChildScope(Node child,
Context c)
Push a new scope for visiting the child node
child . |
Term |
firstChild()
Return the first direct subterm performed when evaluating this term.
|
java.lang.String |
label()
The label.
|
Labeled |
label(java.lang.String label)
Set the label.
|
Id |
labelNode()
The label.
|
Labeled |
labelNode(Id label)
Set the label.
|
protected <N extends Labeled_c> |
labelNode(N n,
Id label) |
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given
CodeWriter . |
protected <N extends Labeled_c> |
reconstruct(N n,
Id label,
Stmt statement)
Reconstruct the statement.
|
Stmt |
statement()
The statement to label.
|
protected <N extends Labeled_c> |
statement(N n,
Stmt statement) |
Labeled |
statement(Stmt statement)
Set the statement to label.
|
java.lang.String |
toString() |
Node |
typeCheck(TypeChecker tc)
Type check the AST.
|
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, copyIfNeeded, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, dump, enterScope, error, error, error, exceptionCheckEnter, ext, ext, ext, ext, extRewriteEnter, isDisambiguated, isTypeChecked, lang, position, position, position, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, translate, 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, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheckEnter, typeCheckOverride, visitChild, visitList
public Labeled labelNode(Id label)
Labeled
public java.lang.String label()
Labeled
public Labeled label(java.lang.String label)
Labeled
public Stmt statement()
Labeled
public Labeled statement(Stmt statement)
Labeled
protected <N extends Labeled_c> N reconstruct(N n, Id label, Stmt statement)
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 enterChildScope(Node child, Context c)
NodeOps
child
.
The default behavior is to delegate the call to the child node, and let
it add appropriate declarations that should be in scope. However,
this method gives parent nodes have the ability to modify this behavior.enterChildScope
in interface NodeOps
enterChildScope
in class Node_c
child
- the child node about to be entered.c
- the current Context
Context
to be used for visiting node
child
public Node typeCheck(TypeChecker tc) throws SemanticException
NodeOps
leave()
method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this
or a new copy of the node which will be
installed as a child of the node's parent.typeCheck
in interface NodeOps
typeCheck
in class Node_c
tc
- The type checking visitor.SemanticException
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