antlr
Class Parser

java.lang.Object
  |
  +--antlr.Parser
Direct Known Subclasses:
LLkParser

public abstract class Parser
extends Object

Untamed:


Field Summary
protected  ASTFactory astFactory
          AST support code; parser and treeparser delegate to this object
private  boolean ignoreInvalidDebugCalls
           
protected  ParserSharedInputState inputState
           
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
Parser()
          Enabled:
Parser(ParserSharedInputState state)
          Enabled:
 
Method Summary
 void addMessageListener(MessageListener l)
          Enabled:
 void addParserListener(ParserListener l)
          Enabled:
 void addParserMatchListener(ParserMatchListener l)
          Enabled:
 void addParserTokenListener(ParserTokenListener l)
          Enabled:
 void addSemanticPredicateListener(SemanticPredicateListener l)
          Enabled:
 void addSyntacticPredicateListener(SyntacticPredicateListener l)
          Enabled:
 void addTraceListener(TraceListener l)
          Enabled:
abstract  void consume()
          Enabled: Get another token object from the token stream
 void consumeUntil(BitSet set)
          Enabled: Consume tokens until one matches the given token set
 void consumeUntil(int tokenType)
          Enabled: Consume tokens until one matches the given token
protected  void defaultDebuggingSetup(TokenStream lexer, TokenBuffer tokBuf)
           
 AST getAST()
          Enabled: Get the AST return value squirreled away in the parser
 ASTFactory getASTFactory()
          Enabled:
 String getFilename()
          Enabled:
 ParserSharedInputState getInputState()
          Enabled:
 String getTokenName(int num)
          Enabled:
 String[] getTokenNames()
          Enabled:
 boolean isDebugMode()
          Enabled:
abstract  int LA(int i)
          Enabled: Return the token type of the ith token of lookahead where i=1 is the current token being examined by the parser (i.e., it has not been matched yet).
abstract  Token LT(int i)
          Enabled: Return the ith token of lookahead
 int mark()
          Enabled:
 void match(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.
 void match(int t)
          Enabled: Make sure current lookahead symbol matches token type t.
 void matchNot(int t)
          Enabled:
static void panic()
          Enabled:
 void removeMessageListener(MessageListener l)
          Enabled:
 void removeParserListener(ParserListener l)
          Enabled:
 void removeParserMatchListener(ParserMatchListener l)
          Enabled:
 void removeParserTokenListener(ParserTokenListener l)
          Enabled:
 void removeSemanticPredicateListener(SemanticPredicateListener l)
          Enabled:
 void removeSyntacticPredicateListener(SyntacticPredicateListener l)
          Enabled:
 void removeTraceListener(TraceListener l)
          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 rewind(int pos)
          Enabled:
 void setASTFactory(ASTFactory f)
          Enabled: Specify an object with support code (shared by Parser and TreeParser.
 void setASTNodeClass(String cl)
          Enabled:
 void setASTNodeType(String nodeType)
          Enabled: Specify the type of node to create during tree building; use setASTNodeClass now to be consistent with Token Object Type accessor.
 void setDebugMode(boolean debugMode)
          Enabled:
 void setFilename(String f)
          Enabled:
 void setIgnoreInvalidDebugCalls(boolean value)
          Enabled:
 void setInputState(ParserSharedInputState state)
          Enabled:
 void setTokenBuffer(TokenBuffer t)
          Enabled: Set or change the input token buffer
 void traceIn(String rname)
          Enabled:
 void traceIndent()
          Enabled:
 void traceOut(String rname)
          Enabled:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputState

protected ParserSharedInputState inputState

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


ignoreInvalidDebugCalls

private boolean ignoreInvalidDebugCalls

traceDepth

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

Constructor Detail

Parser

public Parser()
Enabled:


Parser

public Parser(ParserSharedInputState state)
Enabled:

Method Detail

addMessageListener

public void addMessageListener(MessageListener l)
Enabled:


addParserListener

public void addParserListener(ParserListener l)
Enabled:


addParserMatchListener

public void addParserMatchListener(ParserMatchListener l)
Enabled:


addParserTokenListener

public void addParserTokenListener(ParserTokenListener l)
Enabled:


addSemanticPredicateListener

public void addSemanticPredicateListener(SemanticPredicateListener l)
Enabled:


addSyntacticPredicateListener

public void addSyntacticPredicateListener(SyntacticPredicateListener l)
Enabled:


addTraceListener

public void addTraceListener(TraceListener l)
Enabled:


consume

public abstract void consume()
                      throws TokenStreamException
Enabled: Get another token object from the token stream

TokenStreamException

consumeUntil

public void consumeUntil(int tokenType)
                  throws TokenStreamException
Enabled: Consume tokens until one matches the given token

TokenStreamException

consumeUntil

public void consumeUntil(BitSet set)
                  throws TokenStreamException
Enabled: Consume tokens until one matches the given token set

TokenStreamException

defaultDebuggingSetup

protected void defaultDebuggingSetup(TokenStream lexer,
                                     TokenBuffer tokBuf)

getAST

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


getASTFactory

public ASTFactory getASTFactory()
Enabled:


getFilename

public String getFilename()
Enabled:


getInputState

public ParserSharedInputState getInputState()
Enabled:


setInputState

public void setInputState(ParserSharedInputState state)
Enabled:


getTokenName

public String getTokenName(int num)
Enabled:


getTokenNames

public String[] getTokenNames()
Enabled:


isDebugMode

public boolean isDebugMode()
Enabled:


LA

public abstract int LA(int i)
                throws TokenStreamException
Enabled: Return the token type of the ith token of lookahead where i=1 is the current token being examined by the parser (i.e., it has not been matched yet).

TokenStreamException

LT

public abstract Token LT(int i)
                  throws TokenStreamException
Enabled: Return the ith token of lookahead

TokenStreamException

mark

public int mark()
Enabled:


match

public void match(int t)
           throws MismatchedTokenException,
                  TokenStreamException
Enabled: Make sure current lookahead symbol matches token type t. Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.

MismatchedTokenException
TokenStreamException

match

public void match(BitSet b)
           throws MismatchedTokenException,
                  TokenStreamException
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
TokenStreamException

matchNot

public void matchNot(int t)
              throws MismatchedTokenException,
                     TokenStreamException
Enabled:

MismatchedTokenException
TokenStreamException

panic

public static void panic()
Enabled:


removeMessageListener

public void removeMessageListener(MessageListener l)
Enabled:


removeParserListener

public void removeParserListener(ParserListener l)
Enabled:


removeParserMatchListener

public void removeParserMatchListener(ParserMatchListener l)
Enabled:


removeParserTokenListener

public void removeParserTokenListener(ParserTokenListener l)
Enabled:


removeSemanticPredicateListener

public void removeSemanticPredicateListener(SemanticPredicateListener l)
Enabled:


removeSyntacticPredicateListener

public void removeSyntacticPredicateListener(SyntacticPredicateListener l)
Enabled:


removeTraceListener

public void removeTraceListener(TraceListener l)
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


rewind

public void rewind(int pos)
Enabled:


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.


setASTNodeClass

public void setASTNodeClass(String cl)
Enabled:


setASTNodeType

public void setASTNodeType(String nodeType)
Enabled: Specify the type of node to create during tree building; use setASTNodeClass now to be consistent with Token Object Type accessor.


setDebugMode

public void setDebugMode(boolean debugMode)
Enabled:


setFilename

public void setFilename(String f)
Enabled:


setIgnoreInvalidDebugCalls

public void setIgnoreInvalidDebugCalls(boolean value)
Enabled:


setTokenBuffer

public void setTokenBuffer(TokenBuffer t)
Enabled: Set or change the input token buffer


traceIndent

public void traceIndent()
Enabled:


traceIn

public void traceIn(String rname)
             throws TokenStreamException
Enabled:

TokenStreamException

traceOut

public void traceOut(String rname)
              throws TokenStreamException
Enabled:

TokenStreamException


comments?