polyglot.ext.jl.ast
Class Term_c

java.lang.Object
  extended by polyglot.ext.jl.ast.Node_c
      extended by polyglot.ext.jl.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

public abstract class Term_c
extends Node_c
implements Term

A Term represents any Java expression or statement on which dataflow can be performed.


Field Summary
protected  SubtypeSet exceptions
           
protected  boolean reachable
           
 
Fields inherited from class polyglot.ext.jl.ast.Node_c
del, ext, position
 
Constructor Summary
Term_c(Position pos)
           
 
Method Summary
abstract  java.util.List acceptCFG(CFGBuilder v, java.util.List succs)
          Visit this term in evaluation order.
abstract  Term entry()
          Return the first (sub)term performed when evaluating this term.
 Node exceptionCheck(ExceptionChecker ec)
          Check that exceptions are properly propagated throughout the AST.
 SubtypeSet exceptions()
          List of Types with all exceptions possibly thrown by this term.
 Term exceptions(SubtypeSet exceptions)
           
static Term listEntry(java.util.List l, Term alt)
          Utility function to get the first entry of a list, or else alt.
 boolean reachable()
          Return true if this term is eachable.
 Term reachable(boolean reachability)
          Set the reachability of this term.
 
Methods inherited from class polyglot.ext.jl.ast.Node_c
addDecls, addMembers, addMembersEnter, addMembersOverride, buildTypes, buildTypesEnter, buildTypesOverride, childExpectedType, copy, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, enterScope, enterScope, exceptionCheckEnter, exceptionCheckOverride, ext, ext, ext, ext, init, node, position, position, 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, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList
 
Methods inherited from interface polyglot.ast.JL
init, node
 
Methods inherited from interface polyglot.ast.NodeOps
addDecls, addMembers, addMembersEnter, buildTypes, buildTypesEnter, disambiguate, disambiguateEnter, enterScope, enterScope, exceptionCheckEnter, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, visitChildren
 
Methods inherited from interface polyglot.util.Copy
copy
 

Field Detail

reachable

protected boolean reachable

exceptions

protected SubtypeSet exceptions
Constructor Detail

Term_c

public Term_c(Position pos)
Method Detail

entry

public abstract Term entry()
Return the first (sub)term performed when evaluating this term.

Specified by:
entry in interface Term

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

listEntry

public static Term listEntry(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