diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-28 21:13:41 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-06-07 21:42:22 +0800 |
commit | 502304f30b1dfa45a936d500c173858baf5735df (patch) | |
tree | 1a948469c7abd95b2ff4b9cb4142ff526a8f8bc0 /libsolidity/interface/AssemblyStack.cpp | |
parent | 937c2083207f28e0b084959492f72ef01119c202 (diff) | |
download | dexon-solidity-502304f30b1dfa45a936d500c173858baf5735df.tar.gz dexon-solidity-502304f30b1dfa45a936d500c173858baf5735df.tar.zst dexon-solidity-502304f30b1dfa45a936d500c173858baf5735df.zip |
Add analyze(block) to AssemblyStack
Diffstat (limited to 'libsolidity/interface/AssemblyStack.cpp')
-rw-r--r-- | libsolidity/interface/AssemblyStack.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libsolidity/interface/AssemblyStack.cpp b/libsolidity/interface/AssemblyStack.cpp index dc9d7db2..a571a008 100644 --- a/libsolidity/interface/AssemblyStack.cpp +++ b/libsolidity/interface/AssemblyStack.cpp @@ -57,6 +57,20 @@ bool AssemblyStack::parseAndAnalyze(std::string const& _sourceName, std::string return m_analysisSuccessful; } +bool AssemblyStack::analyze(assembly::Block const& _block, Scanner const* _scanner) +{ + m_errors.clear(); + m_analysisSuccessful = false; + if (_scanner) + m_scanner = make_shared<Scanner>(*_scanner); + m_parserResult = make_shared<assembly::Block>(_block); + + m_analysisInfo = make_shared<assembly::AsmAnalysisInfo>(); + assembly::AsmAnalyzer analyzer(*m_analysisInfo, m_errorReporter); + m_analysisSuccessful = analyzer.analyze(*m_parserResult); + return m_analysisSuccessful; +} + eth::LinkerObject AssemblyStack::assemble(Machine _machine) { solAssert(m_analysisSuccessful, ""); |