diff options
author | Christian <c@ethdev.com> | 2015-01-16 03:04:06 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-01-20 06:35:04 +0800 |
commit | 914fcedd0e2217300ee28f13bc4c006860f81a12 (patch) | |
tree | a0536dbf1e36ac7ce96ca68febda501915f9c973 /NameAndTypeResolver.h | |
parent | 4631e54e08184df7b6788f37b0ad2f808d1d73cc (diff) | |
download | dexon-solidity-914fcedd0e2217300ee28f13bc4c006860f81a12.tar.gz dexon-solidity-914fcedd0e2217300ee28f13bc4c006860f81a12.tar.zst dexon-solidity-914fcedd0e2217300ee28f13bc4c006860f81a12.zip |
Import inherited members into the contract's scope.
Diffstat (limited to 'NameAndTypeResolver.h')
-rw-r--r-- | NameAndTypeResolver.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/NameAndTypeResolver.h b/NameAndTypeResolver.h index 1032a87c..4fb67da3 100644 --- a/NameAndTypeResolver.h +++ b/NameAndTypeResolver.h @@ -23,6 +23,7 @@ #pragma once #include <map> +#include <list> #include <boost/noncopyable.hpp> #include <libsolidity/DeclarationContainer.h> @@ -64,6 +65,17 @@ public: private: void reset(); + /// Imports all members declared directly in the given contract (i.e. does not import inherited + /// members) into the current scope if they are not present already. + void importInheritedScope(ContractDefinition const& _base); + + /// Computes "C3-Linearization" of base contracts and stores it inside the contract. + void linearizeBaseContracts(ContractDefinition& _contract) const; + /// Computes the C3-merge of the given list of lists of bases. + /// @returns the linearized vector or an empty vector if linearization is not possible. + template <class _T> + static std::vector<_T const*> cThreeMerge(std::list<std::list<_T const*>>& _toMerge); + /// Maps nodes declaring a scope to scopes, i.e. ContractDefinition and FunctionDeclaration, /// where nullptr denotes the global scope. Note that structs are not scope since they do /// not contain code. |