Annotation of parser3/src/types/pa_wcontext.C, revision 1.24.2.1
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.2.1! paf 8: static const char* IDENT_WCONTEXT_C="$Date: 2003/01/21 15:51:22 $";
1.1 paf 9:
10: #include "pa_wcontext.h"
11: #include "pa_exception.h"
12:
13: // appends a fstring to result
1.24.2.1! paf 14: void WContext::write(ValuePtr avalue, ConstStringPtr asource) {
1.18 paf 15: if(fvalue) { // already have value?
16: // must not construct twice
1.24.2.1! paf 17: if(asource)
1.17 paf 18: throw Exception("parser.runtime",
1.24.2.1! paf 19: asource,
1.19 paf 20: "contains illegal assignment attempt of %s to %s %s, use constructor",
1.24.2.1! paf 21: avalue->type(),
1.18 paf 22: fvalue->get_class()->name_cstr(), fvalue->type());
23: else
1.17 paf 24: throw Exception("parser.runtime",
1.24.2.1! paf 25: fvalue->get_class()?fvalue->get_class()->name():Exception::undefined_source,
1.19 paf 26: "%s may not be overwritten with %s %s, use constructor",
1.18 paf 27: fvalue->type(),
1.24.2.1! paf 28: avalue->get_class()->name_cstr(), avalue->type());
1.5 paf 29: } else
1.24.2.1! paf 30: fvalue=avalue;
1.23 paf 31: }
32:
33:
34: void WContext::detach_junctions() {
1.24.2.1! paf 35: Array_iterator<JunctionPtr> i(junctions);
1.23 paf 36: while(i.has_next())
1.24.2.1! paf 37: i.next()->reattach(fparent);
1.23 paf 38: // someday free junctions
1.24.2.1! paf 39: // the day has come?
1.23 paf 40: }
E-mail: