diff options
author | Gav Wood <i@gavwood.com> | 2014-05-27 01:41:46 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2014-05-27 01:41:46 +0800 |
commit | 51e6c251641eef12ba93b725974faa35b514d636 (patch) | |
tree | 9113f63687347c7d5a61c5bb2db61ffe4d800da4 /Compiler.cpp | |
parent | 8e3e592ec6a3b39835e540766774025e3f34c590 (diff) | |
download | dexon-solidity-51e6c251641eef12ba93b725974faa35b514d636.tar dexon-solidity-51e6c251641eef12ba93b725974faa35b514d636.tar.gz dexon-solidity-51e6c251641eef12ba93b725974faa35b514d636.tar.bz2 dexon-solidity-51e6c251641eef12ba93b725974faa35b514d636.tar.lz dexon-solidity-51e6c251641eef12ba93b725974faa35b514d636.tar.xz dexon-solidity-51e6c251641eef12ba93b725974faa35b514d636.tar.zst dexon-solidity-51e6c251641eef12ba93b725974faa35b514d636.zip |
New Assembler.
Diffstat (limited to 'Compiler.cpp')
-rw-r--r-- | Compiler.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/Compiler.cpp b/Compiler.cpp index afe84eb4..777bb72d 100644 --- a/Compiler.cpp +++ b/Compiler.cpp @@ -27,12 +27,12 @@ using namespace std; using namespace eth; -bytes eth::compileLLL(string const& _s, vector<string>* _errors) +bytes eth::compileLLL(string const& _src, vector<string>* _errors) { try { CompilerState cs; - bytes ret = CodeFragment::compile(_s, cs).code(); + bytes ret = CodeFragment::compile(_src, cs).code(); for (auto i: cs.treesToKill) killBigints(i); return ret; @@ -50,6 +50,29 @@ bytes eth::compileLLL(string const& _s, vector<string>* _errors) return bytes(); } +std::string eth::compileLLLToAsm(std::string const& _src, std::vector<std::string>* _errors) +{ + try + { + CompilerState cs; + string ret = CodeFragment::compile(_src, cs).assembly(); + for (auto i: cs.treesToKill) + killBigints(i); + return ret; + } + catch (Exception const& _e) + { + if (_errors) + _errors->push_back(_e.description()); + } + catch (std::exception) + { + if (_errors) + _errors->push_back("Parse error."); + } + return string(); +} + string eth::parseLLL(string const& _src) { sp::utree o; |