--- parser3/src/include/Attic/pa_vclass.h 2001/02/22 09:14:25 1.4 +++ parser3/src/include/Attic/pa_vclass.h 2001/02/24 08:28:35 1.9 @@ -1,20 +1,13 @@ /* - $Id: pa_vclass.h,v 1.4 2001/02/22 09:14:25 paf Exp $ -*/ - -/* - data core + $Id: pa_vclass.h,v 1.9 2001/02/24 08:28:35 paf Exp $ */ #ifndef PA_VCLASS_H #define PA_VCLASS_H #include "pa_value.h" -///#include "pa_vhash.h" -class VHash { -public: - VHash(Pool& apool, Hash& hash) {} -}; +#include "pa_vhash.h" +#include "pa_vjunction.h" class VClass : public Value { public: // Value @@ -26,27 +19,24 @@ public: // Value Value *get_element(const String& name) { // $STATIC=STATIC hash if(name==STATIC_NAME) - return 0;//TODO:new(pool()) VHash(pool(), STATIC); + return &STATIC; - // $field=STATIC.field - Value *result=static_cast(STATIC.get(name)); - if(!result) { - // $method=VMethod_ref - if(Method *method=get_method(name)) - result=0;///new(pool()) VMethod_ref(this, method); + // $method=junction(this+method) + if(Method *method=static_cast(methods.get(name))) { + Junction& j=*NEW Junction(pool(), + method, + this,0,0,0); + + return NEW VJunction(j); } - return result; + // $field=STATIC.field + return STATIC.get_element(name); } // object_class, operator_class: (field)=value - static values only void put_element(const String& name, Value *value) { - STATIC.put(name, value); - } - - // object_instance, object_class: method - Method *get_method(const String& name) const { - return static_cast(methods.get(name)); + STATIC.put_element(name, value); } // object_class, object_instance: object_class @@ -90,7 +80,7 @@ public: // creation private: String *fname; - Hash STATIC; + VHash STATIC; Hash methods; Array parents; Hash parents_hash; };