summaryrefslogtreecommitdiff
path: root/src/op.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/op.cc')
-rw-r--r--src/op.cc76
1 files changed, 0 insertions, 76 deletions
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<kind_t>(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<kind_t>(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;