jparse
Class JavaAST

java.lang.Object
  extended byantlr.BaseAST
      extended byantlr.CommonAST
          extended byantlr.CommonASTWithHiddenTokens
              extended byjparse.JavaAST
All Implemented Interfaces:
antlr.collections.AST, Serializable
Direct Known Subclasses:
ConstrAST, ExpressionAST, FileAST, MethAST, ModifierAST, ParameterAST, StatementAST, TypeAST

public class JavaAST
extends antlr.CommonASTWithHiddenTokens

An AST node that is a superclass for all Java AST types.

Author:
Jerry James
See Also:
Serialized Form

Field Summary
protected static CompileContext context
          The current compilation context
protected static SymbolTable currSymTable
          The current symbol table under construction
protected static Type[] noTypes
          An empty array of types, for use in parameter and exception lists when there are none; avoids creating new arrays when it is unnecessary without resorting to lots of null checks
 SymbolTable symTable
          The symbols in the context of this AST node
 FileAST topLevel
          The top-level node for this file
 TypeAST typeAST
          The type (class or interface) containing this AST node
 
Fields inherited from class antlr.CommonASTWithHiddenTokens
hiddenAfter, hiddenBefore
 
Fields inherited from class antlr.CommonAST
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
JavaAST()
          Create a new Java AST
JavaAST(SymbolTable table)
          Create a new Java AST with an existing symbol table
JavaAST(antlr.Token token)
          Create a new Java AST from a token
JavaAST(antlr.Token token, SymbolTable table)
          Create a new Java AST from a token, with an existing symbol table
 
Method Summary
 void parseComplete()
          Compute any derived attributes that must be evaluated after the initial parse.
 void print(PrintWriter output)
          Print a representation of this AST node, and its following hidden tokens
 void printHiddenAfter(PrintWriter output)
          Print any hidden tokens after this AST node
 void printHiddenBefore(PrintWriter output)
          Print any hidden tokens before this AST node
 
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

noTypes

protected static final Type[] noTypes
An empty array of types, for use in parameter and exception lists when there are none; avoids creating new arrays when it is unnecessary without resorting to lots of null checks


currSymTable

protected static SymbolTable currSymTable
The current symbol table under construction


context

protected static CompileContext context
The current compilation context


symTable

public final SymbolTable symTable
The symbols in the context of this AST node


topLevel

public final FileAST topLevel
The top-level node for this file


typeAST

public final TypeAST typeAST
The type (class or interface) containing this AST node

Constructor Detail

JavaAST

public JavaAST()
Create a new Java AST


JavaAST

public JavaAST(SymbolTable table)
Create a new Java AST with an existing symbol table

Parameters:
table - the symbol table to use

JavaAST

public JavaAST(antlr.Token token)
Create a new Java AST from a token

Parameters:
token - the token represented by this AST node

JavaAST

public JavaAST(antlr.Token token,
               SymbolTable table)
Create a new Java AST from a token, with an existing symbol table

Parameters:
token - the token represented by this AST node
table - the symbol table to use
Method Detail

print

public final void print(PrintWriter output)
Print a representation of this AST node, and its following hidden tokens

Parameters:
output - the output stream on which to print

printHiddenAfter

public final void printHiddenAfter(PrintWriter output)
Print any hidden tokens after this AST node

Parameters:
output - the output stream on which to print

printHiddenBefore

public final void printHiddenBefore(PrintWriter output)
Print any hidden tokens before this AST node

Parameters:
output - the output stream on which to print

parseComplete

public void parseComplete()
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.