--- parser3/src/include/Attic/pa_value.h 2001/02/25 14:47:12 1.32 +++ parser3/src/include/Attic/pa_value.h 2001/03/07 13:54:46 1.41 @@ -1,5 +1,5 @@ /* - $Id: pa_value.h,v 1.32 2001/02/25 14:47:12 paf Exp $ + $Id: pa_value.h,v 1.41 2001/03/07 13:54:46 paf Exp $ */ /* @@ -21,6 +21,7 @@ class VClass; //class VOperator; class Junction; class WContext; +class VAliased; class Method : public Pooled { public: @@ -56,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), @@ -71,7 +72,7 @@ public: } Value& self; - Method *method; + VClass *vclass; Method *method; Value *root; Value *rcontext; WContext *wcontext; @@ -85,13 +86,29 @@ public: // Value virtual const char *type() const =0; /*const*/ String& name() const { return *fname; } + // unknown: false + // others: true + virtual bool get_defined() { return true; } + // string: value // unknown: "" + // double: value // others: 0 virtual String *get_string() { return 0; } // string: value - virtual void put_string(String *astring) { failed("storing string to '%s'"); } + // double: value + // bool: value + virtual double get_double() { failed("getting numerical value of '%s'"); return 0; } + + // unknown: false + // bool: value + // double: 0 or !0 + // string: empty or not + // hash: size!=0 + // TODO table: count!=0 + // others: true + virtual bool get_bool() { return true; } // junction: auto_calc,root,self,rcontext,wcontext, code virtual Junction *get_junction() { return 0; } @@ -102,7 +119,7 @@ public: // Value // operator_class: (field)=value - static values only // codeframe: wcontext_transparent // methodframe: my or self_transparent - virtual Value *get_element(const String& name) { failed("type is '%s', can not get element from it"); return 0; } + virtual Value *get_element(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 @@ -115,6 +132,11 @@ public: // Value // wcontext: none yet | transparent virtual VClass *get_class() { return 0; } + // valiased: this + // wcontext: transparent + // methodframe: self_transparent + virtual VAliased *get_aliased() { return 0; } + public: // usage Value(Pool& apool) : Pooled(apool), fname(new(apool) String(apool)) { @@ -139,16 +161,4 @@ private: void failed(char *action); }; -/* -descendants: - text:+ value:String - hash:+ keys&values:Hash - table:+ columns_order:Array, columns:Hash, rows:Array - object_class:+ STATIC:Hash, methods:Hash - object_instance:+ object_class, fields:Hash - method_ref:+ self:Value/object_class, method:String - method_self_n_params_n_locals:+ self:Value/object_class[1st try], params_locals&values:Hash[2nd try] - junction:+ self:Value, code:String -*/ - #endif