jparse.stmt
Class CatchAST

java.lang.Object
  extended byantlr.BaseAST
      extended byantlr.CommonAST
          extended byantlr.CommonASTWithHiddenTokens
              extended byjparse.JavaAST
                  extended byjparse.stmt.StatementAST
                      extended byjparse.stmt.CatchAST
All Implemented Interfaces:
antlr.collections.AST, HasExceptions, Serializable

public final class CatchAST
extends StatementAST

An AST node that represents a catch clause

Author:
Jerry James
See Also:
Serialized Form

Field Summary
private  CompoundAST body
          The catch body
private  VarAST param
          The catch parameter
 
Fields inherited from class jparse.stmt.StatementAST
control, exceptions, next, nonlocal
 
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
CatchAST(antlr.Token token)
          Create a new catch clause AST
 
Method Summary
protected  StatementAST[] computeControl()
          Compute the list of points to which control might flow after this statement
protected  Type[] computeExceptions()
          Compute the checked exception types that might be thrown by this statement
 CompoundAST getBody()
          Get the body of the catch clause
 VarAST getParameter()
          Get the parameter to the catch clause
 VarList getVarList()
          Get the list of variables read, written, and declared by this statement
 void parseComplete()
          Compute any derived attributes that must be evaluated after the initial parse.
(package private)  Type[] removeCaughtException(Type[] list)
          Remove the exception caught by this catch clause from a list of exceptions.
 
Methods inherited from class jparse.stmt.StatementAST
getExceptionTypes, nextControlPoints
 
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

param

private VarAST param
The catch parameter


body

private CompoundAST body
The catch body

Constructor Detail

CatchAST

public CatchAST(antlr.Token token)
Create a new catch clause 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 StatementAST

computeExceptions

protected Type[] computeExceptions()
Description copied from class: StatementAST
Compute the checked exception types that might be thrown by this statement

Specified by:
computeExceptions in class StatementAST
Returns:
an array of types representing the exceptions that this statement might throw

removeCaughtException

Type[] removeCaughtException(Type[] list)
Remove the exception caught by this catch clause from a list of exceptions. This will actually remove all subclasses of the exception caught by this catch clause

Parameters:
list - the list of exceptions to modify
Returns:
list, modified to remove any exceptions caught by this catch clause

computeControl

protected StatementAST[] computeControl()
Description copied from class: StatementAST
Compute the list of points to which control might flow after this statement

Specified by:
computeControl in class StatementAST
Returns:
a list of statements to which control might pass from this one

getVarList

public VarList getVarList()
Description copied from class: StatementAST
Get the list of variables read, written, and declared by this statement

Specified by:
getVarList in class StatementAST
Returns:
the list of variables read, written, and declared by this statement

getParameter

public VarAST getParameter()
Get the parameter to the catch clause

Returns:
the parameter

getBody

public CompoundAST getBody()
Get the body of the catch clause

Returns:
the body