antlr

Class LLkParser

public class LLkParser extends Parser

An LL(k) parser.

See Also: Token TokenBuffer

Field Summary
intk
Constructor Summary
LLkParser(int k_)
LLkParser(ParserSharedInputState state, int k_)
LLkParser(TokenBuffer tokenBuf, int k_)
LLkParser(TokenStream lexer, int k_)
Method Summary
voidconsume()
Consume another token from the input stream.
intLA(int i)
TokenLT(int i)
voidtraceIn(String rname)
voidtraceOut(String rname)

Field Detail

k

int k

Constructor Detail

LLkParser

public LLkParser(int k_)

LLkParser

public LLkParser(ParserSharedInputState state, int k_)

LLkParser

public LLkParser(TokenBuffer tokenBuf, int k_)

LLkParser

public LLkParser(TokenStream lexer, int k_)

Method Detail

consume

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

LA

public int LA(int i)

LT

public Token LT(int i)

traceIn

public void traceIn(String rname)

traceOut

public void traceOut(String rname)