diff options
author | John Wiegley <johnw@newartisans.com> | 2008-07-27 20:37:21 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-07-27 20:37:21 -0400 |
commit | e14d7b6e543850bae6c46f01a80b11c41ea383cf (patch) | |
tree | 7e6d191cadc7aff167fae2c8cadf3edce6a513d3 /valexpr.h | |
parent | 0c76ac5b8f962525d20228f7fa3a7ec3d3d40ea7 (diff) | |
download | fork-ledger-e14d7b6e543850bae6c46f01a80b11c41ea383cf.tar.gz fork-ledger-e14d7b6e543850bae6c46f01a80b11c41ea383cf.tar.bz2 fork-ledger-e14d7b6e543850bae6c46f01a80b11c41ea383cf.zip |
Cleaned up the value expression code a bit before undertaking the real work of
getting everything back up to what it was (plus the new code written for 3.0).
Diffstat (limited to 'valexpr.h')
-rw-r--r-- | valexpr.h | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -449,6 +449,7 @@ public: O_DEF, O_REF, O_ARG, + O_LOOKUP, LAST }; @@ -902,6 +903,37 @@ public: return temp; } +#if 0 + void compile(scope_t& scope) { + if (ptr.get()) + ptr = ptr->compile(scope); + } + + value_t calc(scope_t& scope) const { + if (ptr.get()) + return ptr->calc(scope); + return NULL_VALUE; + } + + static value_t eval(const string& _expr, scope_t& scope) { + return xpath_t(_expr).calc(scope); + } + + path_iterator_t find_all(scope_t& scope) { + return path_iterator_t(*this, scope); + } + + void print(std::ostream& out, scope_t& scope) const { + op_t::print_context_t context(scope); + print(out, context); + } + + void dump(std::ostream& out) const { + if (ptr) + ptr->dump(out, 0); + } +#endif + friend bool print_value_expr(std::ostream& out, const expr::ptr_op_t node, const expr::ptr_op_t node_to_find, |