antlr
Class LLkParser

java.lang.Object
  |
  +--antlr.Parser
        |
        +--antlr.LLkParser
Direct Known Subclasses:
ANTLRParser, ANTLRTokdefParser, LLkDebuggingParser, Preprocessor

public class LLkParser
extends Parser

Untamed: An LL(k) parser.

See Also:
antlr.Token, antlr.TokenBuffer, antlr.LL1Parser

Field Summary
(package private)  int k
           
 
Fields inherited from class antlr.Parser
astFactory, inputState, returnAST, tokenNames, traceDepth
 
Constructor Summary
LLkParser(int k_)
          Enabled:
LLkParser(ParserSharedInputState state, int k_)
          Enabled:
LLkParser(TokenBuffer tokenBuf, int k_)
          Enabled:
LLkParser(TokenStream lexer, int k_)
          Enabled:
 
Method Summary
 void consume()
          Enabled: Consume another token from the input stream.
 int LA(int i)
          Enabled:
 Token LT(int i)
          Enabled:
private  void trace(String ee, String rname)
           
 void traceIn(String rname)
          Enabled:
 void traceOut(String rname)
          Enabled:
 
Methods inherited from class antlr.Parser
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, isDebugMode, mark, match, match, matchNot, panic, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, reportError, reportError, reportWarning, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

k

int k
Constructor Detail

LLkParser

public LLkParser(int k_)
Enabled:


LLkParser

public LLkParser(ParserSharedInputState state,
                 int k_)
Enabled:


LLkParser

public LLkParser(TokenBuffer tokenBuf,
                 int k_)
Enabled:


LLkParser

public LLkParser(TokenStream lexer,
                 int k_)
Enabled:

Method Detail

consume

public void consume()
Enabled: Consume another token from the input stream. Can only write sequentially! If you need 3 tokens ahead, you must consume() 3 times.

Note that it is possible to overwrite tokens that have not been matched. For example, calling consume() 3 times when k=2, means that the first token consumed will be overwritten with the 3rd.

Specified by:
consume in class Parser

LA

public int LA(int i)
       throws TokenStreamException
Enabled:

Specified by:
LA in class Parser
TokenStreamException

LT

public Token LT(int i)
         throws TokenStreamException
Enabled:

Specified by:
LT in class Parser
TokenStreamException

trace

private void trace(String ee,
                   String rname)
            throws TokenStreamException
TokenStreamException

traceIn

public void traceIn(String rname)
             throws TokenStreamException
Enabled:

Overrides:
traceIn in class Parser
TokenStreamException

traceOut

public void traceOut(String rname)
              throws TokenStreamException
Enabled:

Overrides:
traceOut in class Parser
TokenStreamException


comments?