diff options
author | chriseth <c@ethdev.com> | 2016-08-20 01:57:21 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-09-01 06:02:51 +0800 |
commit | 3c412ed2f63a58b27eeb00fe584b9378311b099f (patch) | |
tree | cba706f91c05658a8b1f8794ad21745ea5619e39 /libsolidity/ast/AST.h | |
parent | 52d9f897126394dcc7388277d4fbd3ef7b4df38a (diff) | |
download | dexon-solidity-3c412ed2f63a58b27eeb00fe584b9378311b099f.tar.gz dexon-solidity-3c412ed2f63a58b27eeb00fe584b9378311b099f.tar.zst dexon-solidity-3c412ed2f63a58b27eeb00fe584b9378311b099f.zip |
Version pragma.
Diffstat (limited to 'libsolidity/ast/AST.h')
-rw-r--r-- | libsolidity/ast/AST.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index bf275869..761d85fe 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -176,6 +176,34 @@ private: }; /** + * Pragma directive, only version requirements in the form `pragma solidity "^0.4.0";` are + * supported for now. + */ +class PragmaDirective: public ASTNode +{ +public: + PragmaDirective( + SourceLocation const& _location, + std::vector<Token::Value> const& _tokens, + std::vector<ASTString> const& _literals + ): ASTNode(_location), m_tokens(_tokens), m_literals(_literals) + {} + + virtual void accept(ASTVisitor& _visitor) override; + virtual void accept(ASTConstVisitor& _visitor) const override; + + std::vector<Token::Value> const& tokens() const { return m_tokens; } + std::vector<ASTString> const& literals() const { return m_literals; } + +private: + + /// Sequence of tokens following the "pragma" keyword. + std::vector<Token::Value> m_tokens; + /// Sequence of literals following the "pragma" keyword. + std::vector<ASTString> m_literals; +}; + +/** * Import directive for referencing other files / source objects. * Example: import "abc.sol" // imports all symbols of "abc.sol" into current scope * Source objects are identified by a string which can be a file name but does not have to be. |