polyglot.ast
Interface Term

All Superinterfaces:
java.lang.Cloneable, Copy, JL, Node, NodeOps
All Known Subinterfaces:
AmbAssign, AmbExpr, AmbTypeNode, ArrayAccess, ArrayAccessAssign, ArrayInit, ArrayTypeNode, Assert, Assign, Binary, Block, BooleanLit, Branch, Call, CanonicalTypeNode, Case, Cast, Catch, CharLit, ClassBody, ClassDecl, ClassLit, ClassMember, CodeBlock, CodeDecl, CodeNode, CompoundStmt, Conditional, ConstructorCall, ConstructorDecl, Do, Empty, Eval, Expr, Field, FieldAssign, FieldDecl, FloatLit, For, ForInit, Formal, ForUpdate, If, Initializer, Instanceof, IntLit, Labeled, Lit, Local, LocalAssign, LocalClassDecl, LocalDecl, Loop, MethodDecl, NamedVariable, New, NewArray, NullLit, NumLit, ProcedureCall, ProcedureDecl, Return, Special, Stmt, StringLit, Switch, SwitchBlock, SwitchElement, Synchronized, Throw, Try, TypeNode, Unary, VarDecl, Variable, While
All Known Implementing Classes:
AbstractBlock_c, AmbAssign_c, AmbExpr_c, AmbTypeNode_c, ArrayAccess_c, ArrayAccessAssign_c, ArrayInit_c, ArrayTypeNode_c, Assert_c, Assign_c, Binary_c, Block_c, BooleanLit_c, Branch_c, Call_c, CanonicalTypeNode_c, Case_c, Cast_c, Catch_c, CharLit_c, ClassBody_c, ClassDecl_c, ClassLit_c, Conditional_c, ConstructorCall_c, ConstructorDecl_c, Do_c, Empty_c, Eval_c, Expr_c, Field_c, FieldAssign_c, FieldDecl_c, FloatLit_c, For_c, Formal_c, If_c, Initializer_c, Instanceof_c, IntLit_c, Labeled_c, Lit_c, Local_c, LocalAssign_c, LocalClassDecl_c, LocalDecl_c, Loop_c, MethodDecl_c, New_c, NewArray_c, NullLit_c, NumLit_c, Return_c, Special_c, Stmt_c, StringLit_c, Switch_c, SwitchBlock_c, Synchronized_c, Term_c, Throw_c, Try_c, TypeNode_c, Unary_c, While_c

public interface Term
extends Node

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


Field Summary
static int ENTRY
          Indicates to dataflow methods that we are looking at the entry of a term.
static int EXIT
          Indicates to dataflow methods that we are looking at the exit of a term.
 
Method Summary
 java.util.List acceptCFG(CFGBuilder v, java.util.List succs)
          Visit this node, calling calling v.edge() for each successor in succs, if data flows on that edge.
 SubtypeSet exceptions()
          List of Types with all exceptions possibly thrown by this term.
 Term exceptions(SubtypeSet exceptions)
           
 Term firstChild()
          Return the first direct subterm performed when evaluating this term.
 boolean reachable()
          Returns true if the term is reachable.
 Term reachable(boolean reachability)
          Set the reachability of this term.
 
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, exceptionCheck, exceptionCheckEnter, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChildren
 
Methods inherited from interface polyglot.util.Copy
copy
 

Field Detail

ENTRY

static final int ENTRY
Indicates to dataflow methods that we are looking at the entry of a term.

See Also:
Constant Field Values

EXIT

static final int EXIT
Indicates to dataflow methods that we are looking at the exit of a term.

See Also:
Constant Field Values
Method Detail

firstChild

Term firstChild()
Return the first direct subterm performed when evaluating this term. If this term has no subterms, this should return null. This method is similar to the deprecated entry(), but it should *not* recursively drill down to the innermost subterm. The direct child visited first in this term's dataflow should be returned.


acceptCFG

java.util.List acceptCFG(CFGBuilder v,
                         java.util.List succs)
Visit this node, calling calling v.edge() for each successor in succs, if data flows on that edge.


reachable

boolean reachable()
Returns true if the term is reachable. This attribute is not guaranteed correct until after the reachability pass.

See Also:
ReachChecker

reachable

Term reachable(boolean reachability)
Set the reachability of this term.


exceptions

SubtypeSet exceptions()
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.


exceptions

Term exceptions(SubtypeSet exceptions)