mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Add analyze(block) to AssemblyStack
This commit is contained in:
		
							parent
							
								
									937c208320
								
							
						
					
					
						commit
						502304f30b
					
				| @ -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, ""); | ||||
|  | ||||
| @ -60,6 +60,10 @@ public: | ||||
| 	/// Multiple calls overwrite the previous state.
 | ||||
| 	bool parseAndAnalyze(std::string const& _sourceName, std::string const& _source); | ||||
| 
 | ||||
| 	/// Runs analysis step on the supplied block, returns false if input cannot be assembled.
 | ||||
| 	/// Multiple calls overwrite the previous state.
 | ||||
| 	bool analyze(assembly::Block const& _block, Scanner const* _scanner = nullptr); | ||||
| 
 | ||||
| 	/// Run the assembly step (should only be called after parseAndAnalyze).
 | ||||
| 	eth::LinkerObject assemble(Machine _machine); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user