diff options
Diffstat (limited to 'src/scope.h')
-rw-r--r-- | src/scope.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/scope.h b/src/scope.h index 8b4a9380..31b10f6b 100644 --- a/src/scope.h +++ b/src/scope.h @@ -109,6 +109,8 @@ public: TRACE_DTOR(scope_t); } + virtual string description() = 0; + virtual void define(const symbol_t::kind_t, const string&, expr_t::ptr_op_t) {} virtual expr_t::ptr_op_t lookup(const symbol_t::kind_t kind, @@ -191,6 +193,10 @@ public: TRACE_DTOR(bind_scope_t); } + virtual string description() { + return grandchild.description(); + } + virtual void define(const symbol_t::kind_t kind, const string& name, expr_t::ptr_op_t def) { parent->define(kind, name, def); @@ -262,6 +268,16 @@ public: TRACE_DTOR(symbol_scope_t); } + virtual string description() { + if (parent) + return parent->description(); +#if !defined(NO_ASSERTS) + else + assert(false); +#endif + return empty_string; + } + virtual void define(const symbol_t::kind_t kind, const string& name, expr_t::ptr_op_t def); @@ -299,6 +315,10 @@ public: TRACE_DTOR(context_scope_t); } + virtual string description() { + return parent->description(); + } + virtual value_t::type_t type_context() const { return value_type_context; } @@ -351,6 +371,10 @@ public: TRACE_DTOR(call_scope_t); } + virtual string description() { + return context_scope_t::description(); + } + void set_args(const value_t& _args) { args = _args; } @@ -617,6 +641,10 @@ public: value_scope_t(scope_t& _parent, const value_t& _value) : child_scope_t(_parent), value(_value) {} + virtual string description() { + return parent->description(); + } + virtual expr_t::ptr_op_t lookup(const symbol_t::kind_t kind, const string& name) { |