aboutsummaryrefslogtreecommitdiffstats
path: root/AST.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-03 14:46:55 +0800
committerChristian <c@ethdev.com>2014-12-03 17:44:46 +0800
commit328387d6d0a14143f1634df11036a91fad85cec9 (patch)
tree0c790402332a3fdc4fc8beddd57929db148b8c36 /AST.h
parent9dadeea37710fe23a7512035b69356f3405ee6f1 (diff)
downloaddexon-solidity-328387d6d0a14143f1634df11036a91fad85cec9.tar.gz
dexon-solidity-328387d6d0a14143f1634df11036a91fad85cec9.tar.zst
dexon-solidity-328387d6d0a14143f1634df11036a91fad85cec9.zip
Import directive.
Diffstat (limited to 'AST.h')
-rw-r--r--AST.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/AST.h b/AST.h
index 87bc3cd4..2b532d76 100644
--- a/AST.h
+++ b/AST.h
@@ -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