diff options
-rw-r--r-- | libsolidity/parsing/ParserBase.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libsolidity/parsing/ParserBase.h b/libsolidity/parsing/ParserBase.h index 768b3bbf..18b39a5e 100644 --- a/libsolidity/parsing/ParserBase.h +++ b/libsolidity/parsing/ParserBase.h @@ -24,6 +24,7 @@ #include <memory> #include <libsolidity/interface/Exceptions.h> +#include <libsolidity/parsing/Scanner.h> #include <libsolidity/parsing/Token.h> namespace dev @@ -46,11 +47,14 @@ protected: /// End position of the current token int endPosition() const; - ///@{ ///@name Helper functions /// If current token value is not _value, throw exception otherwise advance token. void expectToken(Token::Value _value); + Token::Value currentToken() const { return m_scanner->currentToken(); } + Token::Value peekNextToken() const { return m_scanner->peekNextToken(); } + std::string currentLiteral() const { return m_scanner->currentLiteral(); } + Token::Value advance() { return m_scanner->next(); } ///@} /// Creates a @ref ParserError and annotates it with the current position and the |