summaryrefslogtreecommitdiff
path: root/src/op.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/op.h')
-rw-r--r--src/op.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/op.h b/src/op.h
index 192c1f5e..03fcf816 100644
--- a/src/op.h
+++ b/src/op.h
@@ -69,6 +69,7 @@ private:
public:
enum kind_t {
// Constants
+ PLUG,
VALUE,
IDENT,
@@ -260,12 +261,8 @@ private:
checked_delete(this);
}
- friend inline void intrusive_ptr_add_ref(const op_t * op) {
- op->acquire();
- }
- friend inline void intrusive_ptr_release(const op_t * op) {
- op->release();
- }
+ friend void intrusive_ptr_add_ref(const op_t * op);
+ friend void intrusive_ptr_release(const op_t * op);
ptr_op_t copy(ptr_op_t _left = NULL, ptr_op_t _right = NULL) const {
ptr_op_t node(new_node(kind, _left, _right));
@@ -278,10 +275,14 @@ public:
static ptr_op_t new_node(kind_t _kind, ptr_op_t _left = NULL,
ptr_op_t _right = NULL);
- ptr_op_t compile(scope_t& scope, const int depth = 0);
+ ptr_op_t compile(scope_t& scope, const int depth = 0,
+ scope_t * param_scope = NULL);
value_t calc(scope_t& scope, ptr_op_t * locus = NULL,
const int depth = 0);
+ value_t call(const value_t& args, scope_t& scope,
+ ptr_op_t * locus = NULL, const int depth = 0);
+
struct context_t
{
ptr_op_t expr_op;
@@ -309,6 +310,11 @@ public:
static ptr_op_t wrap_functor(expr_t::func_t fobj);
static ptr_op_t wrap_scope(shared_ptr<scope_t> sobj);
+private:
+ value_t calc_call(scope_t& scope, ptr_op_t * locus, const int depth);
+ value_t calc_cons(scope_t& scope, ptr_op_t * locus, const int depth);
+ value_t calc_seq(scope_t& scope, ptr_op_t * locus, const int depth);
+
#if defined(HAVE_BOOST_SERIALIZATION)
private:
/** Serialization. */
@@ -359,13 +365,6 @@ expr_t::op_t::wrap_functor(expr_t::func_t fobj) {
return temp;
}
-inline expr_t::ptr_op_t
-expr_t::op_t::wrap_scope(shared_ptr<scope_t> sobj) {
- ptr_op_t temp(new op_t(op_t::SCOPE));
- temp->set_scope(sobj);
- return temp;
-}
-
#define MAKE_FUNCTOR(x) expr_t::op_t::wrap_functor(bind(&x, this, _1))
#define WRAP_FUNCTOR(x) expr_t::op_t::wrap_functor(x)