antlr
Class TreeParser

java.lang.Object
  |
  +--antlr.TreeParser

public class TreeParser
extends Object

Untamed:


Field Summary
protected  AST _retTree
          Where did this rule leave off parsing; avoids a return parameter
protected  ASTFactory astFactory
          AST support code; parser and treeparser delegate to this object
static ASTNULLType ASTNULL
          Enabled: The AST Null object; the parsing cursor is set to this when it is found to be null.
protected  TreeParserSharedInputState inputState
          Nesting level of registered handlers
protected  AST returnAST
          AST return value for a rule is squirreled away here
protected  String[] tokenNames
          Table of token type to token names
protected  int traceDepth
          Used to keep track of indentdepth for traceIn/Out
 
Constructor Summary
TreeParser()
          Enabled:
 
Method Summary
 AST getAST()
          Enabled: Get the AST return value squirreled away in the parser
 ASTFactory getASTFactory()
          Enabled:
 String getTokenName(int num)
          Enabled:
 String[] getTokenNames()
          Enabled:
 void match(AST t, BitSet b)
          Enabled: Make sure current lookahead symbol matches the given set Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.
protected  void match(AST t, int ttype)
           
protected  void matchNot(AST t, int ttype)
           
static void panic()
          Enabled:
 void reportError(RecognitionException ex)
          Enabled: Parser error-reporting function can be overridden in subclass
 void reportError(String s)
          Enabled: Parser error-reporting function can be overridden in subclass
 void reportWarning(String s)
          Enabled: Parser warning-reporting function can be overridden in subclass
 void setASTFactory(ASTFactory f)
          Enabled: Specify an object with support code (shared by Parser and TreeParser.
 void setASTNodeClass(String nodeType)
          Enabled: Specify the type of node to create during tree building
 void setASTNodeType(String nodeType)
          Enabled: Specify the type of node to create during tree building
 void traceIn(String rname, AST t)
          Enabled:
 void traceIndent()
          Enabled:
 void traceOut(String rname, AST t)
          Enabled:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASTNULL

public static ASTNULLType ASTNULL
Enabled: The AST Null object; the parsing cursor is set to this when it is found to be null. This way, we can test the token type of a node without having to have tests for null everywhere.


_retTree

protected AST _retTree
Where did this rule leave off parsing; avoids a return parameter


inputState

protected TreeParserSharedInputState inputState
Nesting level of registered handlers


tokenNames

protected String[] tokenNames
Table of token type to token names


returnAST

protected AST returnAST
AST return value for a rule is squirreled away here


astFactory

protected ASTFactory astFactory
AST support code; parser and treeparser delegate to this object


traceDepth

protected int traceDepth
Used to keep track of indentdepth for traceIn/Out

Constructor Detail

TreeParser

public TreeParser()
Enabled:

Method Detail

getAST

public AST getAST()
Enabled: Get the AST return value squirreled away in the parser


getASTFactory

public ASTFactory getASTFactory()
Enabled:


getTokenName

public String getTokenName(int num)
Enabled:


getTokenNames

public String[] getTokenNames()
Enabled:


match

protected void match(AST t,
                     int ttype)
              throws MismatchedTokenException
MismatchedTokenException

match

public void match(AST t,
                  BitSet b)
           throws MismatchedTokenException
Enabled: Make sure current lookahead symbol matches the given set Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.

MismatchedTokenException

matchNot

protected void matchNot(AST t,
                        int ttype)
                 throws MismatchedTokenException
MismatchedTokenException

panic

public static void panic()
Enabled:


reportError

public void reportError(RecognitionException ex)
Enabled: Parser error-reporting function can be overridden in subclass


reportError

public void reportError(String s)
Enabled: Parser error-reporting function can be overridden in subclass


reportWarning

public void reportWarning(String s)
Enabled: Parser warning-reporting function can be overridden in subclass


setASTFactory

public void setASTFactory(ASTFactory f)
Enabled: Specify an object with support code (shared by Parser and TreeParser. Normally, the programmer does not play with this, using setASTNodeType instead.


setASTNodeType

public void setASTNodeType(String nodeType)
Enabled: Specify the type of node to create during tree building


setASTNodeClass

public void setASTNodeClass(String nodeType)
Enabled: Specify the type of node to create during tree building


traceIndent

public void traceIndent()
Enabled:


traceIn

public void traceIn(String rname,
                    AST t)
Enabled:


traceOut

public void traceOut(String rname,
                     AST t)
Enabled:



comments?