--- parser3/src/include/Attic/pa_wcontext.h 2001/02/25 14:47:12 1.18 +++ parser3/src/include/Attic/pa_wcontext.h 2001/03/08 17:59:28 1.23.4.1 @@ -1,5 +1,5 @@ /* - $Id: pa_wcontext.h,v 1.18 2001/02/25 14:47:12 paf Exp $ + $Id: pa_wcontext.h,v 1.23.4.1 2001/03/08 17:59:28 paf Exp $ */ #ifndef PA_WCONTEXT_H @@ -13,47 +13,45 @@ class WContext : public Value { public: // Value // all: for error reporting after fail(), etc - const char *type() const { return "WContext"; } - // WContext: accumulated string - String *get_string() { return &string; }; + const char *type() const { return "wcontext"; } + // WContext: accumulated fstring + String *get_string() { return &fstring; }; // 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 - // appends a string to result - virtual void write(String *astring); + // appends a fstring to result + virtual void write(String& astring); - // if value is VString writes string, + // if value is VString writes fstring, // else writes Value; raises an error if already - virtual void write(Value *avalue); + virtual void write(Value& avalue); public: // usage WContext(Pool& apool, Value *avalue, bool aconstructing) : Value(apool), fvalue(avalue), fconstructing(aconstructing), - string(*new(apool) String(apool)) { + fstring(*new(apool) String(apool)) { } bool constructing() { return fconstructing; } // retrives the resulting value - Value *object() const { - return fvalue; - } - // retrives the resulting value // that can be VString if value==0 or the Value object Value *result() const { - return fvalue?fvalue:NEW VString(string); + return fvalue?fvalue:NEW VString(fstring); } protected: Value *fvalue; private: bool fconstructing; - String& string; + String& fstring; }; #endif