diff options
author | François Bobot <francois@bobot.eu> | 2012-06-22 15:11:21 +0000 |
---|---|---|
committer | François Bobot <francois@bobot.eu> | 2012-06-22 15:11:21 +0000 |
commit | eda7d4df5481030d4e9cb6ef4a33d52afc8f7e0a (patch) | |
tree | 20d6a6335c5fd43fdf2a76dd7550d0519992d5e0 /src/parser/antlr_input.h | |
parent | 1cbf657d955776860580b662aefd53705b603680 (diff) |
parser: add some acces function and recover the original nextToken from antlr3
in order to be able to use the stack of streams.
Diffstat (limited to 'src/parser/antlr_input.h')
-rw-r--r-- | src/parser/antlr_input.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parser/antlr_input.h b/src/parser/antlr_input.h index 10a4b907d..2d468a7d6 100644 --- a/src/parser/antlr_input.h +++ b/src/parser/antlr_input.h @@ -130,8 +130,12 @@ class AntlrInput : public Input { static void lexerError(pANTLR3_BASE_RECOGNIZER recognizer); /** Returns the next available lexer token from the current input stream. */ + /* - auxillary function */ static pANTLR3_COMMON_TOKEN nextTokenStr (pANTLR3_TOKEN_SOURCE toksource); + /* - main function */ + static pANTLR3_COMMON_TOKEN + nextToken (pANTLR3_TOKEN_SOURCE toksource); /* Since we own d_tokenStream and it needs to be freed, we need to prevent * copy construction and assignment. @@ -182,6 +186,9 @@ public: /** Retrieve the remaining text in this input. */ std::string getUnparsedText(); + /** Get the ANTLR3 lexer for this input. */ + pANTLR3_LEXER getAntlr3Lexer(){ return d_lexer; }; + protected: /** Create an input. This input takes ownership of the given input stream, * and will delete it at destruction time. |