jparse.expr
Class NumLiteralAST

java.lang.Object
  extended byantlr.BaseAST
      extended byantlr.CommonAST
          extended byantlr.CommonASTWithHiddenTokens
              extended byjparse.JavaAST
                  extended byjparse.expr.ExpressionAST
                      extended byjparse.expr.NumLiteralAST
All Implemented Interfaces:
antlr.collections.AST, HasExceptions, Serializable

public final class NumLiteralAST
extends ExpressionAST

An AST node that represents a literal number

Author:
Jerry James
See Also:
Serialized Form

Field Summary
 
Fields inherited from class jparse.expr.ExpressionAST
exceptions, nonconstant, type, value
 
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
NumLiteralAST(antlr.Token token)
          Create a new literal number AST
 
Method Summary
protected  Type[] computeExceptions()
          Compute the checked exception types that might be thrown by this expression
protected  Type computeType()
          Compute the type of this expression
protected  Object computeValue()
          Compute the constant value of this expression, if any
 VarList getVarList()
          Get the list of variables read and written by this expression
 void parseComplete()
          Compute any derived attributes that must be evaluated after the initial parse.
 
Methods inherited from class jparse.expr.ExpressionAST
getExceptionTypes, getValue, retrieveType
 
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
 

Constructor Detail

NumLiteralAST

public NumLiteralAST(antlr.Token token)
Create a new literal number 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

computeType

protected Type computeType()
Description copied from class: ExpressionAST
Compute the type of this expression

Specified by:
computeType in class ExpressionAST
Returns:
the type of this expression

computeExceptions

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

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

computeValue

protected Object computeValue()
Description copied from class: ExpressionAST
Compute the constant value of this expression, if any

Specified by:
computeValue in class ExpressionAST
Returns:
the constant value (if any) of this expression, as a wrapped primitive type or an object type

getVarList

public VarList getVarList()
Description copied from class: ExpressionAST
Get the list of variables read and written by this expression

Specified by:
getVarList in class ExpressionAST
Returns:
the list of variables read and written by this expression