polyglot.ast
Class Term_c
java.lang.Object
polyglot.ast.Node_c
polyglot.ast.Term_c
- All Implemented Interfaces:
- java.lang.Cloneable, JL, Node, NodeOps, Term, Copy
- Direct Known Subclasses:
- ClassBody_c, ClassDecl_c, ConstructorDecl_c, Expr_c, FieldDecl_c, Formal_c, Initializer_c, MethodDecl_c, Stmt_c, TypeNode_c
public abstract class Term_c
- extends Node_c
- implements Term
A Term
represents any Java expression or statement on which
dataflow can be performed.
Methods inherited from class polyglot.ast.Node_c |
addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, copy, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, enterChildScope, enterScope, error, error, exceptionCheckEnter, ext, ext, ext, ext, init, isDisambiguated, isTypeChecked, node, position, position, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, toString, translate, typeCheck, typeCheckEnter, typeCheckOverride, visit, visitChild, visitChildren, visitEdge, visitList |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface polyglot.ast.Node |
childExpectedType, del, del, dump, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitChild, visitEdge, visitList |
Methods inherited from interface polyglot.ast.JL |
init, node |
Methods inherited from interface polyglot.ast.NodeOps |
addDecls, buildTypes, buildTypesEnter, checkConstants, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, exceptionCheckEnter, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChildren |
Methods inherited from interface polyglot.util.Copy |
copy |
reachable
protected boolean reachable
exceptions
protected SubtypeSet exceptions
Term_c
public Term_c(Position pos)
acceptCFG
public abstract java.util.List acceptCFG(CFGBuilder v,
java.util.List succs)
- Visit this term in evaluation order.
- Specified by:
acceptCFG
in interface Term
reachable
public boolean reachable()
- Return true if this term is eachable. This attribute is not
guaranteed correct until after the reachability pass
- Specified by:
reachable
in interface Term
- See Also:
ReachChecker
reachable
public Term reachable(boolean reachability)
- Set the reachability of this term.
- Specified by:
reachable
in interface Term
listChild
public static Term listChild(java.util.List l,
Term alt)
- Utility function to get the first entry of a list, or else alt.
exceptions
public SubtypeSet exceptions()
- Description copied from interface:
Term
- List of Types with all exceptions possibly thrown by this term.
The list is not necessarily correct until after exception-checking.
polyglot.ast.NodeOps.throwTypes()
is similar, but exceptions
are not propagated to the containing node.
- Specified by:
exceptions
in interface Term
exceptions
public Term exceptions(SubtypeSet exceptions)
- Specified by:
exceptions
in interface Term
exceptionCheck
public Node exceptionCheck(ExceptionChecker ec)
throws SemanticException
- Description copied from interface:
NodeOps
- Check that exceptions are properly propagated throughout the AST.
This method is called by the
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.
- Specified by:
exceptionCheck
in interface NodeOps
- Overrides:
exceptionCheck
in class Node_c
- Parameters:
ec
- The visitor.
- Throws:
SemanticException