diff options
author | JINMEI Tatuya <jinmei@isc.org> | 2012-11-29 18:59:54 +0100 |
---|---|---|
committer | JINMEI Tatuya <jinmei@isc.org> | 2012-11-29 19:02:37 +0100 |
commit | b991213a389213fe42ef0c87bde56e462c025229 (patch) | |
tree | 88aa2293e5530502762d0dd926f66dd5cefb4460 /src/lib/dns/master_lexer.h | |
parent | [2506] rename: MasterLexer::Token to MasterToken. (diff) | |
download | kea-b991213a389213fe42ef0c87bde56e462c025229.tar.xz kea-b991213a389213fe42ef0c87bde56e462c025229.zip |
[2506] added another version of getNextToken, basic part
Diffstat (limited to 'src/lib/dns/master_lexer.h')
-rw-r--r-- | src/lib/dns/master_lexer.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/dns/master_lexer.h b/src/lib/dns/master_lexer.h index 13205be14f..bee6b4690e 100644 --- a/src/lib/dns/master_lexer.h +++ b/src/lib/dns/master_lexer.h @@ -306,6 +306,15 @@ public: {} }; + class LexerError : public Exception { + public: + LexerError(const char* file, size_t line, MasterToken error_token) : + Exception(file, line, error_token.getErrorText().c_str()), + token_(error_token) + {} + const MasterToken token_; + }; + /// \brief Options for getNextToken. /// /// A compound option, indicating multiple options are set, can be @@ -442,6 +451,9 @@ public: /// or the token fail. const MasterToken& getNextToken(Options options = NONE); + const MasterToken& getNextToken(MasterToken::Type expect, + bool eol_ok = false); + /// \brief Return the last token back to the lexer. /// /// The method undoes the lasts call to getNextToken(). If you call the |