aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerStack.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-04 01:52:28 +0800
committerChristian <c@ethdev.com>2014-12-04 01:52:28 +0800
commitd2cf34548322598ae067434a61a171bd190fc2c9 (patch)
tree9f89db707b8435f4774aea1115249e076fb37b74 /CompilerStack.cpp
parent254df50feab6bb4c9f013257591b73919e4013a5 (diff)
downloaddexon-solidity-d2cf34548322598ae067434a61a171bd190fc2c9.tar.gz
dexon-solidity-d2cf34548322598ae067434a61a171bd190fc2c9.tar.zst
dexon-solidity-d2cf34548322598ae067434a61a171bd190fc2c9.zip
Improved external interface for multi-source and multi-contract compilation.
Diffstat (limited to 'CompilerStack.cpp')
-rw-r--r--CompilerStack.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/CompilerStack.cpp b/CompilerStack.cpp
index 49ac3b64..198ded09 100644
--- a/CompilerStack.cpp
+++ b/CompilerStack.cpp
@@ -81,10 +81,20 @@ void CompilerStack::parse(string const& _sourceCode)
parse();
}
-void CompilerStack::compile(bool _optimize)
+vector<string> CompilerStack::getContractNames()
{
if (!m_parseSuccessful)
BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Parsing was not successful."));
+ vector<string> contractNames;
+ for (auto const& contract: m_contracts)
+ contractNames.push_back(contract.first);
+ return contractNames;
+}
+
+void CompilerStack::compile(bool _optimize)
+{
+ if (!m_parseSuccessful)
+ parse();
for (Source const* source: m_sourceOrder)
for (ASTPointer<ASTNode> const& node: source->ast->getNodes())
if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))