|
|
| version 1.26, 2001/02/24 13:18:19 | version 1.30, 2001/02/25 09:42:03 |
|---|---|
| Line 14 | Line 14 |
| #include "pa_array.h" | #include "pa_array.h" |
| //#include "pa_voperator.h" | //#include "pa_voperator.h" |
| #define NAME_NAME "NAME" | |
| #define PARENTS_NAME "PARENTS" | |
| #define STATIC_NAME "STATIC" | |
| #define STATICS_NAME "STATICS" | |
| class Value; | class Value; |
| class VClass; | class VClass; |
| //class VOperator; | //class VOperator; |
| Line 81 public: // Value | Line 86 public: // Value |
| // all: for error reporting after fail(), etc | // all: for error reporting after fail(), etc |
| virtual const char *type() const =0; | virtual const char *type() const =0; |
| const String *name() const { return fname; } | /*const*/ String *name() const { return fname; } |
| // string: value | // string: value |
| // unknown: "" | // unknown: "" |
| Line 96 public: // Value | Line 101 public: // Value |
| // hash: (key)=value | // hash: (key)=value |
| // object_class: (field)=STATIC.value;(STATIC)=hash;(method)=method_ref with self=object_class | // 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 | // operator_class: (field)=value - static values only |
| // wcontext: transparent | |
| // frame: my or self_transparent | |
| // codeframe: wcontext_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 | // hash: (key)=value |
| // object_class, operator_class: (field)=value - static values only | // object_class, operator_class: (field)=value - static values only |
| // object_instance: (field)=value | // object_instance: (field)=value |
| // wcontext: transparent | |
| // frame: my or self_transparent | |
| // codeframe: wcontext_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 | // object_class, object_instance: object_class |
| // frame: transparent | |
| // wcontext: transparent | |
| // codeframe: wcontext_transparent | // codeframe: wcontext_transparent |
| // methodframe: transparent | |
| virtual VClass *get_class() { return 0; } | virtual VClass *get_class() { return 0; } |
| // object_class: true when this class is this or derived from 'ancestor' | |
| // frame: transparent | |
| // wcontext: transparent | |
| // codeframe: wcontext_transparent | |
| virtual bool is_or_derived_from(VClass& ancestor) { failed("thoghts of ancestors of '%s'"); return false; } | |
| public: // usage | 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& as_string() { |
| String *result=get_string(); | String *result=get_string(); |
| Line 138 public: // usage | Line 136 public: // usage |
| private: | private: |
| const String *fname; | String *fname; |
| private: | private: |