From 3434650848e500d605447388ef7e069ee1515b72 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 3 Feb 2009 12:21:54 -0400 Subject: Removed the binary caching code, and the XML, QIF and Gnucash parsers. --- src/op.cc | 76 --------------------------------------------------------------- 1 file changed, 76 deletions(-) (limited to 'src/op.cc') diff --git a/src/op.cc b/src/op.cc index 237426f7..e34be005 100644 --- a/src/op.cc +++ b/src/op.cc @@ -31,7 +31,6 @@ #include "op.h" #include "scope.h" -#include "binary.h" namespace ledger { @@ -501,81 +500,6 @@ void expr_t::op_t::dump(std::ostream& out, const int depth) const } } -void expr_t::op_t::read(const char *& data) -{ - kind = binary::read_long(data); - - if (kind > TERMINALS) { - set_left(new expr_t::op_t()); - left()->read(data); - - if (kind > UNARY_OPERATORS && binary::read_bool(data)) { - set_right(new expr_t::op_t()); - right()->read(data); - } - } - - switch (kind) { - case VALUE: { - value_t temp; - temp.read(data); - set_value(temp); - break; - } - case IDENT: { - string temp; - binary::read_string(data, temp); - set_ident(temp); - break; - } - case INDEX: { - long temp; - binary::read_long(data, temp); - set_index(temp); - break; - } - - default: - assert(false); - break; - } -} - -void expr_t::op_t::write(std::ostream& out) const -{ - binary::write_long(out, kind); - - if (kind > TERMINALS) { - left()->write(out); - - if (kind > UNARY_OPERATORS) { - if (has_right()) { - binary::write_bool(out, true); - right()->write(out); - } else { - binary::write_bool(out, false); - } - } - } else { - switch (kind) { - case VALUE: - as_value().write(out); - break; - case IDENT: - binary::write_string(out, as_ident()); - break; - case INDEX: - binary::write_long(out, as_index()); - break; - - case FUNCTION: - default: - assert(false); - break; - } - } -} - string op_context(const expr_t::ptr_op_t op, const expr_t::ptr_op_t goal) { ostream_pos_type start_pos, end_pos; -- cgit v1.2.3