Annotation of parser3/src/types/pa_wcontext.C, revision 1.24
1.6 paf 1: /** @file
2: Parser: write context class.
3:
1.24 ! paf 4: Copyright (c) 2001, 2003 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.24 ! paf 8: static const char* IDENT_WCONTEXT_C="$Date: 2002/09/10 12:02:24 $";
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.23 paf 32: }
33:
34:
35: void WContext::detach_junctions() {
36: Array_iter i(junctions);
37: while(i.has_next())
38: static_cast<Junction *>(i.next())->reattach(fparent);
39: // someday free junctions
40: }
E-mail: