--- parser3/src/include/Attic/pa_value.h 2001/02/24 13:18:19 1.26 +++ parser3/src/include/Attic/pa_value.h 2001/02/25 17:58:28 1.35 @@ -1,5 +1,5 @@ /* - $Id: pa_value.h,v 1.26 2001/02/24 13:18:19 paf Exp $ + $Id: pa_value.h,v 1.35 2001/02/25 17:58:28 paf Exp $ */ /* @@ -14,11 +14,14 @@ #include "pa_array.h" //#include "pa_voperator.h" +#define NAME_NAME "NAME" + class Value; class VClass; //class VOperator; class Junction; class WContext; +class VAliased; class Method : public Pooled { public: @@ -54,14 +57,14 @@ public: Junction(Pool& apool, Value& aself, - Method *amethod, + VClass *avclass, Method *amethod, Value *aroot, Value *arcontext, WContext *awcontext, const Array *acode) : Pooled(apool), self(aself), - method(amethod), + vclass(avclass), method(amethod), root(aroot), rcontext(arcontext), wcontext(awcontext), @@ -69,7 +72,7 @@ public: } Value& self; - Method *method; + VClass *vclass; Method *method; Value *root; Value *rcontext; WContext *wcontext; @@ -81,7 +84,7 @@ public: // Value // all: for error reporting after fail(), etc virtual const char *type() const =0; - const String *name() const { return fname; } + /*const*/ String& name() const { return *fname; } // string: value // unknown: "" @@ -96,38 +99,35 @@ public: // Value // hash: (key)=value // object_class: (field)=STATIC.value;(STATIC)=hash;(method)=method_ref with self=object_class - // object_instance: (field)=value;(STATIC)=hash;(method)=method_ref + // object_instance: (field)=value;(CLASS)=vclass;(method)=method_ref // operator_class: (field)=value - static values only - // wcontext: transparent - // frame: my or self_transparent // codeframe: wcontext_transparent - virtual Value *get_element(const String& name) { failed("is '%s', can not get element from it"); return 0; } + // methodframe: my or self_transparent + virtual Value *get_element(const String& name) { failed("type is '%s', can not get element from it"); return 0; } // hash: (key)=value // object_class, operator_class: (field)=value - static values only // object_instance: (field)=value - // wcontext: transparent - // frame: my or self_transparent // codeframe: wcontext_transparent - virtual void put_element(const String& name, Value *value) { failed("is '%s', can not put element to it"); } + // methodframe: my or self_transparent + virtual void put_element(const String& name, Value *value) { failed("type is '%s', can not put element to it"); } // object_class, object_instance: object_class - // frame: transparent - // wcontext: transparent - // codeframe: wcontext_transparent + // wcontext: none yet | transparent virtual VClass *get_class() { return 0; } - // object_class: true when this class is this or derived from 'ancestor' - // frame: transparent + // valiased: this // wcontext: transparent - // codeframe: wcontext_transparent - virtual bool is_or_derived_from(VClass& ancestor) { failed("thoghts of ancestors of '%s'"); return false; } + // methodframe: self_transparent + virtual Value *get_aliased() { return 0; } public: // usage - Value(Pool& apool) : Pooled(apool), fname(0) {} + Value(Pool& apool) : Pooled(apool), fname(new(apool) String(apool)) { + fname->APPEND_CONST("unnamed"); + } - void set_name(const String& aname) { fname=&aname; } + void set_name(String& aname) { fname=&aname; } String& as_string() { String *result=get_string(); @@ -138,7 +138,7 @@ public: // usage private: - const String *fname; + String *fname; private: