jparse.expr
Class IdentifierAST

java.lang.Object
  extended byantlr.BaseAST
      extended byantlr.CommonAST
          extended byantlr.CommonASTWithHiddenTokens
              extended byjparse.JavaAST
                  extended byjparse.expr.ExpressionAST
                      extended byjparse.expr.IdentifierAST
All Implemented Interfaces:
antlr.collections.AST, HasExceptions, JavaTokenTypes, Serializable
Direct Known Subclasses:
ThisLiteralAST, TypeAST, VarAST

public class IdentifierAST
extends ExpressionAST
implements JavaTokenTypes

An AST node that represents an identifier

Author:
Jerry James
See Also:
Serialized Form

Field Summary
private  boolean isMethod
          true if this is a method name
private  String name
          The full name of this identifier
 
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
 
Fields inherited from interface jparse.JavaTokenTypes
ARRAY_DECLARATOR, ARRAY_INIT, ASSIGN, BAND, BAND_ASSIGN, BNOT, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, CASE_GROUP, CHAR_LITERAL, COLON, COMMA, CONCAT_ASSIGN, CONCATENATION, CONST, CONSTRUCTOR_CALL, CTOR_DEF, DEC, DIV, DIV_ASSIGN, DOT, ELIST, EMPTY_STAT, EOF, EQUAL, ESC, EXPONENT, EXPRESSION_STAT, EXTENDS_CLAUSE, FILE, FLOAT_SUFFIX, FOR_CONDITION, FOR_INIT, FOR_ITERATOR, GE, GOTO, GT, HEX_DIGIT, IDENT, IMPLEMENTS_CLAUSE, INC, INDEX_OP, INSTANCE_INIT, LABELED_STAT, LAND, LBRACK, LCURLY, LE, LITERAL_abstract, LITERAL_boolean, LITERAL_break, LITERAL_byte, LITERAL_case, LITERAL_catch, LITERAL_char, LITERAL_class, LITERAL_continue, LITERAL_default, LITERAL_do, LITERAL_double, LITERAL_else, LITERAL_extends, LITERAL_false, LITERAL_final, LITERAL_finally, LITERAL_float, LITERAL_for, LITERAL_if, LITERAL_implements, LITERAL_import, LITERAL_instanceof, LITERAL_int, LITERAL_interface, LITERAL_long, LITERAL_native, LITERAL_new, LITERAL_null, LITERAL_package, LITERAL_private, LITERAL_protected, LITERAL_public, LITERAL_return, LITERAL_short, LITERAL_static, LITERAL_strictfp, LITERAL_super, LITERAL_switch, LITERAL_synchronized, LITERAL_this, LITERAL_throw, LITERAL_throws, LITERAL_transient, LITERAL_true, LITERAL_try, LITERAL_void, LITERAL_volatile, LITERAL_while, LNOT, LOR, LPAREN, LT, METHOD_CALL, METHOD_DEF, MINUS, MINUS_ASSIGN, ML_COMMENT, MOD, MOD_ASSIGN, MODIFIERS, NOT_EQUAL, NULL_TREE_LOOKAHEAD, NUM_FLOAT, NUM_INT, OBJBLOCK, PARAMETER_DEF, PARAMETERS, PAREN_EXPR, PLUS, PLUS_ASSIGN, POST_DEC, POST_INC, QUESTION, RBRACK, RCURLY, RPAREN, SEMI, SL, SL_ASSIGN, SL_COMMENT, SLIST, SR, SR_ASSIGN, STAR, STAR_ASSIGN, STRING_LITERAL, TYPE, TYPE_STAT, TYPECAST, UNARY_MINUS, UNARY_PLUS, VARIABLE_DEF, VARIABLE_DEFS, VOCAB, WS
 
Constructor Summary
IdentifierAST()
          Create a new identifier AST
IdentifierAST(antlr.Token token)
          Create a new identifier AST
 
Method Summary
 int compareTo(IdentifierAST ident)
          Compares this identifier with another for order.
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
 String getName()
          Extract the full name of this identifier, even if is is a dotted name
 VarList getVarList()
          Get the list of variables read and written by this expression
 void setMethod()
          Identify this as a method name
 void setName(String theName)
          Set the name of this identifier
 String toString()
           
 
Methods inherited from class jparse.expr.ExpressionAST
getExceptionTypes, getValue, retrieveType
 
Methods inherited from class jparse.JavaAST
parseComplete, 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, 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

name

private String name
The full name of this identifier


isMethod

private boolean isMethod
true if this is a method name

Constructor Detail

IdentifierAST

public IdentifierAST()
Create a new identifier AST


IdentifierAST

public IdentifierAST(antlr.Token token)
Create a new identifier AST

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

setName

public final void setName(String theName)
Set the name of this identifier

Parameters:
theName - the name of this identifier

getName

public final String getName()
Extract the full name of this identifier, even if is is a dotted name

Returns:
the concatenated string representing the full name of the identifier

setMethod

public final void setMethod()
Identify this as a method name


compareTo

public int compareTo(IdentifierAST ident)
Compares this identifier with another for order.

Parameters:
ident - the IdentifierAST to compare with this one
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified IdentifierAST

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

toString

public String toString()
Specified by:
toString in interface antlr.collections.AST