antlr::LLkParser Class Reference

#include <LLkParser.hpp>

Inheritance diagram for antlr::LLkParser:
[legend]
Collaboration diagram for antlr::LLkParser:
[legend]

List of all members.

Public Member Functions

 LLkParser (const ParserSharedInputState &lexer, int k_)
 LLkParser (TokenBuffer &tokenBuf, int k_)
 LLkParser (TokenStream &lexer, int k_)
virtual void consume ()
virtual int LA (unsigned int i)
virtual RefToken LT (unsigned int i)
 Return the i-th token of lookahead.
virtual void traceIn (const char *rname)
virtual void traceOut (const char *rname)

Protected Attributes

int k
 the lookahead this LL(k) parser is using.

Private Member Functions

void trace (const char *ee, const char *rname)

Detailed Description

An LL(k) parser.

See also:
antlr.Token
antlr.TokenBuffer
antlr.LL1Parser

Constructor & Destructor Documentation

antlr::LLkParser::LLkParser ( const ParserSharedInputState state,
int  k_ 
)

An LL(k) parser.

See also:
antlr.Token
antlr.TokenBuffer
antlr.LL1Parser
antlr::LLkParser::LLkParser ( TokenBuffer tokenBuf,
int  k_ 
)
antlr::LLkParser::LLkParser ( TokenStream lexer,
int  k_ 
)

Member Function Documentation

virtual void antlr::LLkParser::consume (  )  [inline, virtual]

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.

Implements antlr::Parser.

virtual int antlr::LLkParser::LA ( unsigned int  i  )  [inline, virtual]

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).

Implements antlr::Parser.

virtual RefToken antlr::LLkParser::LT ( unsigned int  i  )  [inline, virtual]

Return the i-th token of lookahead.

Implements antlr::Parser.

void antlr::LLkParser::trace ( const char *  ee,
const char *  rname 
) [private]
void antlr::LLkParser::traceIn ( const char *  rname  )  [virtual]

Reimplemented from antlr::Parser.

void antlr::LLkParser::traceOut ( const char *  rname  )  [virtual]

Reimplemented from antlr::Parser.


Member Data Documentation

int antlr::LLkParser::k [protected]

the lookahead this LL(k) parser is using.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines

Generated on 16 Nov 2015 for ANTLR Support Libraries 2.7.1+ by  doxygen 1.6.1