Annotation of parser3/src/types/pa_wcontext.C, revision 1.22

1.6       paf         1: /**    @file
                      2:        Parser: write context class.
                      3: 
1.14      paf         4:        Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com)
1.15      paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.20      paf         6: */
1.6       paf         7: 
1.22    ! paf         8: static const char* IDENT_WCONTEXT_C="$Date: 2002/08/01 11:41:25 $";
1.1       paf         9: 
                     10: #include "pa_wcontext.h"
                     11: #include "pa_exception.h"
1.3       paf        12: #include "pa_request.h"
1.1       paf        13: 
                     14: // appends a fstring to result
1.18      paf        15: void WContext::write(Value& avalue, const String* origin) {
                     16:        if(fvalue) { // already have value?
                     17:                // must not construct twice
                     18:                if(origin)
1.17      paf        19:                        throw Exception("parser.runtime",
1.18      paf        20:                                origin,
1.19      paf        21:                                "contains illegal assignment attempt of %s to %s %s, use constructor",
1.18      paf        22:                                avalue.type(), 
                     23:                                        fvalue->get_class()->name_cstr(), fvalue->type());
                     24:                else            
1.17      paf        25:                        throw Exception("parser.runtime",
1.18      paf        26:                                fvalue->get_class()?&fvalue->get_class()->name():0,
1.19      paf        27:                                "%s may not be overwritten with %s %s, use constructor",
1.18      paf        28:                                fvalue->type(), 
                     29:                                        avalue.get_class()->name_cstr(), avalue.type());
1.5       paf        30:        } else 
1.4       paf        31:                fvalue=&avalue;
1.18      paf        32: }

E-mail: