FileDocCategorySizeDatePackage
LLkParser.javaAPI DocGlassfish v2 API2254Wed Aug 30 15:34:08 BST 2006persistence.antlr

LLkParser

public class LLkParser extends Parser
An LL(k) parser.
see
persistence.antlr.Token
see
persistence.antlr.TokenBuffer

Fields Summary
int
k
Constructors Summary
public LLkParser(int k_)

        k = k_;
    
public LLkParser(ParserSharedInputState state, int k_)

        super(state);
		k = k_;
    
public LLkParser(TokenBuffer tokenBuf, int k_)

        k = k_;
        setTokenBuffer(tokenBuf);
    
public LLkParser(TokenStream lexer, int k_)

        k = k_;
        TokenBuffer tokenBuf = new TokenBuffer(lexer);
        setTokenBuffer(tokenBuf);
    
Methods Summary
public intLA(int i)

        return inputState.input.LA(i);
    
public persistence.antlr.TokenLT(int i)

        return inputState.input.LT(i);
    
public voidconsume()
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.

        inputState.input.consume();
    
private voidtrace(java.lang.String ee, java.lang.String rname)

        traceIndent();
        System.out.print(ee + rname + ((inputState.guessing > 0)?"; [guessing]":"; "));
        for (int i = 1; i <= k; i++) {
            if (i != 1) {
                System.out.print(", ");
            }
            if ( LT(i)!=null ) {
                System.out.print("LA(" + i + ")==" + LT(i).getText());
            }
            else {
                System.out.print("LA(" + i + ")==null");
            }
        }
        System.out.println("");
    
public voidtraceIn(java.lang.String rname)

        traceDepth += 1;
        trace("> ", rname);
    
public voidtraceOut(java.lang.String rname)

        trace("< ", rname);
        traceDepth -= 1;