jparse.stmt
Class StatementAST

java.lang.Object
  extended byantlr.BaseAST
      extended byantlr.CommonAST
          extended byantlr.CommonASTWithHiddenTokens
              extended byjparse.JavaAST
                  extended byjparse.stmt.StatementAST
All Implemented Interfaces:
antlr.collections.AST, HasExceptions, Serializable
Direct Known Subclasses:
BreakAST, CaseGroupAST, CatchAST, ClassAST, CompoundAST, ContinueAST, DeclarationAST, DoWhileAST, EmptyAST, ExpressionAST, ForAST, IfElseAST, LabelAST, ReturnAST, SwitchAST, SynchronizedAST, ThrowAST, TryAST, WhileAST

public abstract class StatementAST
extends JavaAST
implements HasExceptions

An AST node that represents a statement

Author:
Jerry James
See Also:
Serialized Form

Field Summary
protected  StatementAST[] control
          The points to which control might flow from this statement
protected  Type[] exceptions
          The checked exceptions this statement might throw
protected  StatementAST next
          The next statement in a sequential list of statements
static StatementAST nonlocal
          A special member of the StatementAST class which is used to indicate that control passes out of the current method due to a throw or return.
 
Fields inherited from class jparse.JavaAST
context, currSymTable, noTypes, symTable, topLevel, typeAST
 
Fields inherited from class antlr.CommonASTWithHiddenTokens
hiddenAfter, hiddenBefore
 
Fields inherited from class antlr.CommonAST
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
protected StatementAST()
          Create a new statement AST
protected StatementAST(antlr.Token token)
          Create a new statement AST
 
Method Summary
protected abstract  StatementAST[] computeControl()
          Compute the list of points to which control might flow after this statement
protected abstract  Type[] computeExceptions()
          Compute the checked exception types that might be thrown by this statement
 Type[] getExceptionTypes()
          Get the checked exception types that might be thrown by this statement
abstract  VarList getVarList()
          Get the list of variables read, written, and declared by this statement
 StatementAST[] nextControlPoints()
          Get the list of points to which control might pass after executing this statement.
 void parseComplete()
          Compute any derived attributes that must be evaluated after the initial parse.
 
Methods inherited from class jparse.JavaAST
print, printHiddenAfter, printHiddenBefore
 
Methods inherited from class antlr.CommonASTWithHiddenTokens
getHiddenAfter, getHiddenBefore, initialize
 
Methods inherited from class antlr.CommonAST
getText, getType, initialize, initialize, setText, setType
 
Methods inherited from class antlr.BaseAST
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getColumn, getFirstChild, getLine, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toString, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nonlocal

public static final StatementAST nonlocal
A special member of the StatementAST class which is used to indicate that control passes out of the current method due to a throw or return.


exceptions

protected Type[] exceptions
The checked exceptions this statement might throw


next

protected StatementAST next
The next statement in a sequential list of statements


control

protected StatementAST[] control
The points to which control might flow from this statement

Constructor Detail

StatementAST

protected StatementAST()
Create a new statement AST


StatementAST

protected StatementAST(antlr.Token token)
Create a new statement AST

Parameters:
token - the token represented by this AST node
Method Detail

parseComplete

public void parseComplete()
Description copied from class: JavaAST
Compute any derived attributes that must be evaluated after the initial parse. The default action is to just tell your children that the parse is complete.

Overrides:
parseComplete in class JavaAST

getExceptionTypes

public final Type[] getExceptionTypes()
Get the checked exception types that might be thrown by this statement

Specified by:
getExceptionTypes in interface HasExceptions
Returns:
an array of types representing the exceptions that this statement might throw

computeExceptions

protected abstract Type[] computeExceptions()
Compute the checked exception types that might be thrown by this statement

Returns:
an array of types representing the exceptions that this statement might throw

nextControlPoints

public StatementAST[] nextControlPoints()
Get the list of points to which control might pass after executing this statement. This may include StatementAST.nonlocal if the statement returns or throws something.

Returns:
a list of statements to which control might pass from this one

computeControl

protected abstract StatementAST[] computeControl()
Compute the list of points to which control might flow after this statement

Returns:
a list of statements to which control might pass from this one

getVarList

public abstract VarList getVarList()
Get the list of variables read, written, and declared by this statement

Returns:
the list of variables read, written, and declared by this statement