ANTLR Support Libraries 2.7.1+
LLkParser.hpp
Go to the documentation of this file.
1 #ifndef INC_LLkParser_hpp__
2 #define INC_LLkParser_hpp__
3 
4 /* ANTLR Translator Generator
5  * Project led by Terence Parr at http://www.jGuru.com
6  * Software rights: http://www.antlr.org/license.html
7  *
8  * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/LLkParser.hpp#2 $
9  */
10 
11 #include <antlr/config.hpp>
12 #include <antlr/Parser.hpp>
13 
14 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
15 namespace antlr {
16 #endif
17 
24 class ANTLR_API LLkParser : public Parser {
25 public:
26  LLkParser(const ParserSharedInputState& lexer, int k_);
27 
28  LLkParser(TokenBuffer& tokenBuf, int k_);
29 
30  LLkParser(TokenStream& lexer, int k_);
31 
39  virtual inline void consume()
40  {
41  inputState->getInput().consume();
42  }
43 
44  virtual inline int LA(unsigned int i)
45  {
46  return inputState->getInput().LA(i);
47  }
48 
49  virtual inline RefToken LT(unsigned int i)
50  {
51  return inputState->getInput().LT(i);
52  }
53 protected:
55  int k;
56 private:
57  void trace(const char* ee, const char* rname);
58 public:
59  virtual void traceIn(const char* rname);
60  virtual void traceOut(const char* rname);
61 };
62 
63 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
64 }
65 #endif
66 
67 #endif //INC_LLkParser_hpp__
virtual RefToken LT(unsigned int i)
Return the i-th token of lookahead.
Definition: LLkParser.hpp:49
Definition: ANTLRException.hpp:15
Definition: LLkParser.hpp:24
virtual int LA(unsigned int i)
Definition: LLkParser.hpp:44
#define ANTLR_API
Definition: config.hpp:22
int k
the lookahead this LL(k) parser is using.
Definition: LLkParser.hpp:55
Definition: TokenBuffer.hpp:36
Definition: TokenStream.hpp:22
virtual void consume()
Definition: LLkParser.hpp:39
Definition: Parser.hpp:64