diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-25 06:03:15 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-27 03:44:34 +0800 |
commit | 3459052ae83ac08082855d41e21c297ac5f852b5 (patch) | |
tree | 887973b9f7a34e7c7b30dd9f942d81ca8542e422 /libsolidity | |
parent | 2fefe3b5497172a16094014b66e148b707bc7492 (diff) | |
download | dexon-solidity-3459052ae83ac08082855d41e21c297ac5f852b5.tar.gz dexon-solidity-3459052ae83ac08082855d41e21c297ac5f852b5.tar.zst dexon-solidity-3459052ae83ac08082855d41e21c297ac5f852b5.zip |
Add scanner helpers to ParserBase
Diffstat (limited to 'libsolidity')
-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 |