aboutsummaryrefslogtreecommitdiffstats
path: root/AST.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-01 22:22:45 +0800
committerChristian <c@ethdev.com>2014-12-02 00:33:21 +0800
commit9e91596c8d5683e79314fcd53a18e0e3df7b3390 (patch)
tree403740e7f56b4f6fc9d7b49b1c7383f5cdb99a5f /AST.h
parent3fc2708d657525162567b663a07cf8cb5b1c59aa (diff)
downloaddexon-solidity-9e91596c8d5683e79314fcd53a18e0e3df7b3390.tar.gz
dexon-solidity-9e91596c8d5683e79314fcd53a18e0e3df7b3390.tar.zst
dexon-solidity-9e91596c8d5683e79314fcd53a18e0e3df7b3390.zip
Save the scope for every declaration.
Diffstat (limited to 'AST.h')
-rw-r--r--AST.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/AST.h b/AST.h
index 81a12ad1..68b5c8b8 100644
--- a/AST.h
+++ b/AST.h
@@ -88,11 +88,16 @@ public:
Declaration(Location const& _location, ASTPointer<ASTString> const& _name):
ASTNode(_location), m_name(_name) {}
- /// Returns the declared name.
+ /// @returns the declared name.
ASTString const& getName() const { return *m_name; }
+ /// @returns the scope this declaration resides in. Can be nullptr if it is the global scope.
+ /// Available only after name and type resolution step.
+ Declaration* getScope() const { return m_scope; }
+ void setScope(Declaration* const& _scope) { m_scope = _scope; }
private:
ASTPointer<ASTString> m_name;
+ Declaration* m_scope;
};
/**