diff options
author | chriseth <c@ethdev.com> | 2017-01-17 17:31:09 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2017-01-17 17:45:45 +0800 |
commit | 99eaadd2cd4ece9c3ceba16fa5559c45c2e66b08 (patch) | |
tree | b02e8efce3ff7e63b8a285bca0c93e24fdc548ff /libsolidity/ast/AST.h | |
parent | 6ecb4aa36f8c30ca91f650d17f1214c2f2bc4319 (diff) | |
download | dexon-solidity-99eaadd2cd4ece9c3ceba16fa5559c45c2e66b08.tar dexon-solidity-99eaadd2cd4ece9c3ceba16fa5559c45c2e66b08.tar.gz dexon-solidity-99eaadd2cd4ece9c3ceba16fa5559c45c2e66b08.tar.bz2 dexon-solidity-99eaadd2cd4ece9c3ceba16fa5559c45c2e66b08.tar.lz dexon-solidity-99eaadd2cd4ece9c3ceba16fa5559c45c2e66b08.tar.xz dexon-solidity-99eaadd2cd4ece9c3ceba16fa5559c45c2e66b08.tar.zst dexon-solidity-99eaadd2cd4ece9c3ceba16fa5559c45c2e66b08.zip |
Deterministic AST node identifiers.
Diffstat (limited to 'libsolidity/ast/AST.h')
-rw-r--r-- | libsolidity/ast/AST.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index 2d092408..e9df2e7d 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -57,6 +57,9 @@ public: explicit ASTNode(SourceLocation const& _location); virtual ~ASTNode(); + /// @returns an identifier of this AST node that is unique for a single compilation run. + size_t id() const { return m_id; } + virtual void accept(ASTVisitor& _visitor) = 0; virtual void accept(ASTConstVisitor& _visitor) const = 0; template <class T> @@ -94,6 +97,7 @@ public: ///@} protected: + size_t m_id = 0; /// Annotation - is specialised in derived classes, is created upon request (because of polymorphism). mutable ASTAnnotation* m_annotation = nullptr; |