diff options
author | Christian <c@ethdev.com> | 2014-12-04 00:45:12 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-12-04 01:51:59 +0800 |
commit | 254df50feab6bb4c9f013257591b73919e4013a5 (patch) | |
tree | f8258a07f87046e1695373bc6024af87f51f51be /NameAndTypeResolver.cpp | |
parent | 328387d6d0a14143f1634df11036a91fad85cec9 (diff) | |
download | dexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.tar dexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.tar.gz dexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.tar.bz2 dexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.tar.lz dexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.tar.xz dexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.tar.zst dexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.zip |
Multi-source and multi-contract compiler.
Diffstat (limited to 'NameAndTypeResolver.cpp')
-rw-r--r-- | NameAndTypeResolver.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/NameAndTypeResolver.cpp b/NameAndTypeResolver.cpp index d473348b..08deb66a 100644 --- a/NameAndTypeResolver.cpp +++ b/NameAndTypeResolver.cpp @@ -38,9 +38,13 @@ NameAndTypeResolver::NameAndTypeResolver(std::vector<Declaration*> const& _globa m_scopes[nullptr].registerDeclaration(*declaration); } +void NameAndTypeResolver::registerDeclarations(SourceUnit& _sourceUnit) +{ + DeclarationRegistrationHelper registrar(m_scopes, _sourceUnit); +} + void NameAndTypeResolver::resolveNamesAndTypes(ContractDefinition& _contract) { - DeclarationRegistrationHelper registrar(m_scopes, _contract); m_currentScope = &m_scopes[&_contract]; for (ASTPointer<StructDefinition> const& structDef: _contract.getDefinedStructs()) ReferencesResolver resolver(*structDef, *this, nullptr); @@ -65,6 +69,12 @@ void NameAndTypeResolver::resolveNamesAndTypes(ContractDefinition& _contract) m_currentScope = &m_scopes[nullptr]; } +void NameAndTypeResolver::updateDeclaration(Declaration& _declaration) +{ + m_scopes[nullptr].registerDeclaration(_declaration, true); + _declaration.setScope(nullptr); +} + Declaration* NameAndTypeResolver::resolveName(ASTString const& _name, Declaration const* _scope) const { auto iterator = m_scopes.find(_scope); |