jparse
Class TypeAST

java.lang.Object
  extended byantlr.BaseAST
      extended byantlr.CommonAST
          extended byantlr.CommonASTWithHiddenTokens
              extended byjparse.JavaAST
                  extended byjparse.TypeAST
All Implemented Interfaces:
antlr.collections.AST, JavaTokenTypes, Serializable

public final class TypeAST
extends JavaAST
implements JavaTokenTypes

An AST node that represents a type.

Author:
Jerry James
See Also:
Serialized Form

Field Summary
private  int anon
          The count of anonymous inner classes
(package private)  ConstrAST[] constructors
          The constructors for this type
(package private) static TypeAST currType
          The type currently being parsed
(package private)  TypeAST[] inner
          The inner classes of this class
(package private)  String[] interfaces
          The interfaces implemented by this class or the superinterfaces of this interface
(package private)  ModifierAST modifiers
          The modifiers for this type
(package private)  String name
          The fully qualified name of this type
(package private)  TypeAST outer
          The outer class for this type
(package private)  String superclass
          The superclass of this class
(package private)  SourceType type
          The type object corresponding to this AST
 
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
  TypeAST()
          Create a new Type AST
protected TypeAST(String name)
          Create a new Type AST
protected TypeAST(antlr.Token token)
          Create a new Type AST
 
Method Summary
(package private)  void addAnonymous(String pkg, TypeAST type)
          Add an anonymous inner class to the list
protected  void addConstructor(ConstrAST cons)
          Add a constructor to the list for this type
(package private)  void addInner(TypeAST type)
          Add an inner class to the list
 JavaAST[] getMembers()
          Get the members of this type
 String getSuperclass()
          Get the name of the superclass of this class
 void parseComplete()
          Compute any derived attributes that must be evaluated after the initial parse.
 Type retrieveType()
          Retrieve the type represented by this AST node
protected  void setInfo(String pkg, String typeName, TypeAST out, ModifierAST mods)
          Set the name and outer class for this type
 String toString()
           
 
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, 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

currType

static TypeAST currType
The type currently being parsed


type

SourceType type
The type object corresponding to this AST


name

String name
The fully qualified name of this type


outer

TypeAST outer
The outer class for this type


inner

TypeAST[] inner
The inner classes of this class


modifiers

ModifierAST modifiers
The modifiers for this type


superclass

String superclass
The superclass of this class


interfaces

String[] interfaces
The interfaces implemented by this class or the superinterfaces of this interface


constructors

ConstrAST[] constructors
The constructors for this type


anon

private int anon
The count of anonymous inner classes

Constructor Detail

TypeAST

public TypeAST()
Create a new Type AST


TypeAST

protected TypeAST(String name)
Create a new Type AST

Parameters:
name - the name of the superclass

TypeAST

protected TypeAST(antlr.Token token)
Create a new Type AST

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

setInfo

protected void setInfo(String pkg,
                       String typeName,
                       TypeAST out,
                       ModifierAST mods)
Set the name and outer class for this type

Parameters:
pkg - the name of the package for this type
typeName - the name of this type
out - the outer class or interface for this type
mods - the modifiers for this class

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

addConstructor

protected void addConstructor(ConstrAST cons)
Add a constructor to the list for this type

Parameters:
cons - the constructor to add to the list

addAnonymous

void addAnonymous(String pkg,
                  TypeAST type)
Add an anonymous inner class to the list

Parameters:
pkg - the name of the package for this type
type - the anonymous inner class to add

addInner

void addInner(TypeAST type)
Add an inner class to the list

Parameters:
type - the inner class to add

getSuperclass

public String getSuperclass()
Get the name of the superclass of this class

Returns:
the name of the superclass of this class

getMembers

public JavaAST[] getMembers()
Get the members of this type

Returns:
an array containing the members (static and instance variables, methods, and initializers) of this type

retrieveType

public Type retrieveType()
Retrieve the type represented by this AST node

Returns:
the type of this AST node

toString

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