8#include "antlr/LLkParser.hpp"
11#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
15ANTLR_USING_NAMESPACE(std)
37: Parser(new TokenBuffer(lexer)), k(k_)
41void LLkParser::trace(
const char* ee,
const char* rname)
45 cout << ee << rname << ((inputState->
guessing>0)?
"; [guessing]":
"; ");
47 for (
int i = 1; i <=
k; i++)
52 cout <<
"LA(" << i <<
")==";
57 temp =
LT(i)->getText().c_str();
59 catch( ANTLRException& ae )
62 temp += ae.toString();
71void LLkParser::traceIn(
const char* rname)
77void LLkParser::traceOut(
const char* rname)
83#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
LLkParser(const ParserSharedInputState &lexer, int k_)
An LL(k) parser.
int k
the lookahead this LL(k) parser is using.
virtual RefToken LT(unsigned int i)
Return the i-th token of lookahead.
A generic ANTLR parser (LL(k) for k>=1) containing a bunch of utility routines useful at any lookahea...
virtual void traceIndent()
Set or change the input token buffer.
A Stream of Token objects fed to the parser from a TokenStream that can be rewound via mark()/rewind(...