diff options
author | Gav Wood <i@gavwood.com> | 2014-05-26 18:12:22 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2014-05-26 18:12:22 +0800 |
commit | e2d327308d9024cbbb80ea21c056f38591319234 (patch) | |
tree | 38d3d042843557dabc74e347f50775bf4a793ce0 /Parser.cpp | |
parent | 48f6bad8a3f0290f0439545c799d725a2d5b2d54 (diff) | |
download | dexon-solidity-e2d327308d9024cbbb80ea21c056f38591319234.tar dexon-solidity-e2d327308d9024cbbb80ea21c056f38591319234.tar.gz dexon-solidity-e2d327308d9024cbbb80ea21c056f38591319234.tar.bz2 dexon-solidity-e2d327308d9024cbbb80ea21c056f38591319234.tar.lz dexon-solidity-e2d327308d9024cbbb80ea21c056f38591319234.tar.xz dexon-solidity-e2d327308d9024cbbb80ea21c056f38591319234.tar.zst dexon-solidity-e2d327308d9024cbbb80ea21c056f38591319234.zip |
Assembler.
Debug trace stuff.
Diffstat (limited to 'Parser.cpp')
-rw-r--r-- | Parser.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -42,6 +42,31 @@ void eth::killBigints(sp::utree const& _this) } } +void eth::debugOutAST(ostream& _out, sp::utree const& _this) +{ + switch (_this.which()) + { + case sp::utree_type::list_type: + switch (_this.tag()) + { + case 0: _out << "( "; for (auto const& i: _this) { debugOutAST(_out, i); _out << " "; } _out << ")"; break; + case 1: _out << "@ "; debugOutAST(_out, _this.front()); break; + case 2: _out << "@@ "; debugOutAST(_out, _this.front()); break; + case 3: _out << "[ "; debugOutAST(_out, _this.front()); _out << " ] "; debugOutAST(_out, _this.back()); break; + case 4: _out << "[[ "; debugOutAST(_out, _this.front()); _out << " ]] "; debugOutAST(_out, _this.back()); break; + case 5: _out << "{ "; for (auto const& i: _this) { debugOutAST(_out, i); _out << " "; } _out << "}"; break; + default:; + } + + break; + case sp::utree_type::int_type: _out << _this.get<int>(); break; + case sp::utree_type::string_type: _out << "\"" << _this.get<sp::basic_string<boost::iterator_range<char const*>, sp::utree_type::string_type>>() << "\""; break; + case sp::utree_type::symbol_type: _out << _this.get<sp::basic_string<boost::iterator_range<char const*>, sp::utree_type::symbol_type>>(); break; + case sp::utree_type::any_type: _out << *_this.get<bigint*>(); break; + default: _out << "nil"; + } +} + void eth::parseTreeLLL(string const& _s, sp::utree& o_out) { using qi::ascii::space; |