diff options
author | Christian <c@ethdev.com> | 2014-12-01 22:22:45 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-12-02 00:33:21 +0800 |
commit | 9e91596c8d5683e79314fcd53a18e0e3df7b3390 (patch) | |
tree | 403740e7f56b4f6fc9d7b49b1c7383f5cdb99a5f /AST.h | |
parent | 3fc2708d657525162567b663a07cf8cb5b1c59aa (diff) | |
download | dexon-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.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; }; /** |