--- parser3/src/include/Attic/pa_wcontext.h 2001/02/24 11:20:32 1.14 +++ parser3/src/include/Attic/pa_wcontext.h 2001/03/06 15:02:47 1.21 @@ -1,5 +1,5 @@ /* - $Id: pa_wcontext.h,v 1.14 2001/02/24 11:20:32 paf Exp $ + $Id: pa_wcontext.h,v 1.21 2001/03/06 15:02:47 paf Exp $ */ #ifndef PA_WCONTEXT_H @@ -13,9 +13,14 @@ class WContext : public Value { public: // Value // all: for error reporting after fail(), etc - const char *type() const { return "WContext"; } + const char *type() const { return "wcontext"; } // WContext: accumulated string - String *get_string() { return string; }; + String *get_string() { return &string; }; + + // WContext: none yet | transparent + VClass *get_class() { return fvalue?fvalue->get_class():0; } + // wcontext: transparent + VAliased *get_aliased() { return fvalue?fvalue->get_aliased():0; } public: // WContext @@ -28,25 +33,29 @@ public: // WContext public: // usage - WContext(Pool& apool, Value *avalue) : Value(apool), + WContext(Pool& apool, Value *avalue, bool aconstructing) : Value(apool), fvalue(avalue), - string(new(apool) String(apool)) { + fconstructing(aconstructing), + string(*new(apool) String(apool)) { } + bool constructing() { return fconstructing; } + // retrives the resulting value - Value *value() const { + Value *object() const { return fvalue; } // retrives the resulting value // that can be VString if value==0 or the Value object - Value *value_or_string() const { + Value *result() const { return fvalue?fvalue:NEW VString(string); } protected: Value *fvalue; private: - String *string; + bool fconstructing; + String& string; }; #endif