aboutsummaryrefslogtreecommitdiffstats
path: root/AST.h
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-01-30 00:28:14 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-01-30 01:21:51 +0800
commit04190798eba7a2996b28aee6d74b1c636f575a02 (patch)
tree2a5fb37440bed96c96ecfcfda494fd1b436b3118 /AST.h
parentdcd47be6ca8b408b384dca9737625873ad279464 (diff)
downloaddexon-solidity-04190798eba7a2996b28aee6d74b1c636f575a02.tar.gz
dexon-solidity-04190798eba7a2996b28aee6d74b1c636f575a02.tar.zst
dexon-solidity-04190798eba7a2996b28aee6d74b1c636f575a02.zip
Minor fixes plus a rebase merge fix
Diffstat (limited to 'AST.h')
-rwxr-xr-xAST.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/AST.h b/AST.h
index 9ea6c144..6c207290 100755
--- a/AST.h
+++ b/AST.h
@@ -157,6 +157,37 @@ private:
};
/**
+ * Abstract class that is added to each AST node that can store local variables.
+ */
+class VariableScope
+{
+public:
+ void addLocalVariable(VariableDeclaration const& _localVariable) { m_localVariables.push_back(&_localVariable); }
+ std::vector<VariableDeclaration const*> const& getLocalVariables() const { return m_localVariables; }
+
+private:
+ std::vector<VariableDeclaration const*> m_localVariables;
+};
+
+/**
+ * Abstract class that is added to each AST node that can receive documentation.
+ */
+class Documented
+{
+public:
+ explicit Documented(ASTPointer<ASTString> const& _documentation): m_documentation(_documentation) {}
+
+ /// @return A shared pointer of an ASTString.
+ /// Can contain a nullptr in which case indicates absence of documentation
+ ASTPointer<ASTString> const& getDocumentation() const { return m_documentation; }
+
+protected:
+ ASTPointer<ASTString> m_documentation;
+};
+
+/// @}
+
+/**
* Definition of a contract. This is the only AST nodes where child nodes are not visited in
* document order. It first visits all struct declarations, then all variable declarations and
* finally all function declarations.