diff options
author | Christian <c@ethdev.com> | 2014-12-03 14:46:55 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-12-03 17:44:46 +0800 |
commit | 328387d6d0a14143f1634df11036a91fad85cec9 (patch) | |
tree | 0c790402332a3fdc4fc8beddd57929db148b8c36 /AST.h | |
parent | 9dadeea37710fe23a7512035b69356f3405ee6f1 (diff) | |
download | dexon-solidity-328387d6d0a14143f1634df11036a91fad85cec9.tar.gz dexon-solidity-328387d6d0a14143f1634df11036a91fad85cec9.tar.zst dexon-solidity-328387d6d0a14143f1634df11036a91fad85cec9.zip |
Import directive.
Diffstat (limited to 'AST.h')
-rw-r--r-- | AST.h | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -80,6 +80,40 @@ private: }; /** + * Source unit containing import directives and contract definitions. + */ +class SourceUnit: public ASTNode +{ +public: + SourceUnit(Location const& _location, std::vector<ASTPointer<ASTNode>> const& _nodes): + ASTNode(_location), m_nodes(_nodes) {} + + virtual void accept(ASTVisitor& _visitor) override; + + std::vector<ASTPointer<ASTNode>> getNodes() const { return m_nodes; } + +private: + std::vector<ASTPointer<ASTNode>> m_nodes; +}; + +/** + * Import directive for referencing other files / source objects. + */ +class ImportDirective: public ASTNode +{ +public: + ImportDirective(Location const& _location, ASTPointer<ASTString> const& _url): + ASTNode(_location), m_url(_url) {} + + virtual void accept(ASTVisitor& _visitor) override; + + ASTString const& getURL() const { return *m_url; } + +private: + ASTPointer<ASTString> m_url; +}; + +/** * Abstract AST class for a declaration (contract, function, struct, variable). */ class Declaration: public ASTNode |