Annotation of parser3/src/main/pa_wcontext.C, revision 1.6

1.1       paf         1: /*
1.6     ! paf         2:   $Id: pa_wcontext.C,v 1.5 2001/03/08 13:13:41 paf Exp $
1.1       paf         3: */
                      4: 
                      5: #include "pa_wcontext.h"
                      6: #include "pa_exception.h"
                      7: 
1.4       paf         8: // appends a fstring to result
1.5       paf         9: void WContext::write(String& astring) {
                     10:        fstring+=astring;
1.1       paf        11: }
                     12: 
1.4       paf        13: // if value is VString writes fstring,
1.1       paf        14: // else writes Value; raises an error if already
1.5       paf        15: void WContext::write(Value& avalue) {
                     16:        String *fstring=avalue.get_string();
1.4       paf        17:        if(fstring)
1.5       paf        18:                write(*fstring);
1.1       paf        19:        else
                     20:                if(fvalue) // already have value?
1.2       paf        21:                        THROW(0,0,  // must not construct twice
1.6     ! paf        22:                        &avalue.name(),
        !            23:                        "(%s) illegal assignment attempt to '%s' (%s), use constructor instead",
        !            24:                                avalue.type(), fvalue->name().cstr(), fvalue->type());
1.1       paf        25:                else
1.5       paf        26:                        fvalue=&avalue;
1.1       paf        27: }
                     28: 

E-mail: