public class Catch_c extends Stmt_c implements Catch
Catch represents one half of a try-catch
statement. Specifically, the second half.Term.Instance| Modifier and Type | Field and Description |
|---|---|
protected Block |
body |
protected Formal |
formal |
exceptions, reachable| Constructor and Description |
|---|
Catch_c(Position pos,
Formal formal,
Block body) |
Catch_c(Position pos,
Formal formal,
Block body,
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 |
body()
The body of the catch block.
|
Catch |
body(Block body)
Set the body of the catch block.
|
protected <N extends Catch_c> |
body(N n,
Block body) |
Type |
catchType()
The type of the catch's formal.
|
Node |
copy(NodeFactory nf)
Produce a copy of this node using the given NodeFactory.
|
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.
|
Formal |
formal()
The catch block's formal parameter.
|
Catch |
formal(Formal formal)
Set the catch block's formal parameter.
|
protected <N extends Catch_c> |
formal(N n,
Formal formal) |
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given
CodeWriter. |
protected <N extends Catch_c> |
reconstruct(N n,
Formal formal,
Block body)
Reconstruct the catch block.
|
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, reachableaddDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, 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, typeCheckEnter, typeCheckOverride, visit, visitChild, visitEdge, visitListclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexceptions, exceptions, reachable, reachabledel, del, dump, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitEdgeaddDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheckEnter, typeCheckOverride, visitChild, visitListpublic Type catchType()
Catchpublic Formal formal()
Catchpublic Catch formal(Formal formal)
Catchpublic Catch body(Block body)
Catchprotected <N extends Catch_c> N reconstruct(N n, Formal formal, Block body)
public Node visitChildren(NodeVisitor v)
NodeOpsvisitChildren in interface NodeOpsvisitChildren in class Node_cv - The visitor that will traverse/rewrite the AST.this.public Context enterScope(Context c)
Node_centerScope in interface NodeOpsenterScope in class Node_cc - the current ContextContext to be used for visiting this node.public Node typeCheck(TypeChecker tc) throws SemanticException
NodeOpsleave() 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 NodeOpstypeCheck in class Node_ctc - The type checking visitor.SemanticExceptionpublic void prettyPrint(CodeWriter w, PrettyPrinter tr)
Node_cCodeWriter.prettyPrint in interface NodeOpsprettyPrint in class Node_cw - The code writer to which to write.tr - The pretty printer. This is not a visitor.public Term firstChild()
TermOpsfirstChild in interface TermOpsfirstChild in class Term_cpublic <T> java.util.List<T> acceptCFG(CFGBuilder<?> v, java.util.List<T> succs)
TermOps