LLkParser Class Reference
An LL(k) parser. More...
#include <LLkParser.hpp>
Inheritance diagram for LLkParser:

Public Member Functions | |
LLkParser (const ParserSharedInputState &lexer, int k_) | |
An LL(k) parser. | |
LLkParser (TokenBuffer &tokenBuf, int k_) | |
LLkParser (TokenStream &lexer, int k_) | |
virtual void | consume () |
Consume another token from the input stream. | |
virtual int | LA (int i) |
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). | |
virtual RefToken | LT (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
Definition at line 24 of file LLkParser.hpp.
Constructor & Destructor Documentation
|
An LL(k) parser.
Definition at line 26 of file LLkParser.cpp. Referenced by LLkParser(). |
|
Definition at line 31 of file LLkParser.cpp. References LLkParser(). |
|
Definition at line 36 of file LLkParser.cpp. References LLkParser(). |
Member Function Documentation
|
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 Parser. Definition at line 39 of file LLkParser.hpp. |
|
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 Parser. Definition at line 44 of file LLkParser.hpp. |
|
Return the i-th token of lookahead.
Implements Parser. Definition at line 49 of file LLkParser.hpp. References RefToken. Referenced by trace(). |
|
Definition at line 41 of file LLkParser.cpp. References endl(), k, LT(), trace(), and Parser::traceIndent(). Referenced by trace(), traceIn(), and traceOut(). |
|
Reimplemented from Parser. Definition at line 71 of file LLkParser.cpp. References trace(), and traceIn(). Referenced by traceIn(). |
|
Reimplemented from Parser. Definition at line 77 of file LLkParser.cpp. References trace(), and traceOut(). Referenced by traceOut(). |
Member Data Documentation
|
the lookahead this LL(k) parser is using.
Definition at line 55 of file LLkParser.hpp. Referenced by trace(). |
The documentation for this class was generated from the following files:
- lib/antlr/antlr/LLkParser.hpp
- lib/antlr/src/LLkParser.cpp