Annotation of parser3/src/main/pa_wcontext.C, revision 1.2
1.1 paf 1: /*
1.2 ! paf 2: $Id: pa_wcontext.C,v 1.1 2001/02/24 11:20:33 paf Exp $
1.1 paf 3: */
4:
5: #include "pa_wcontext.h"
6: #include "pa_exception.h"
7:
8: // appends a string to result
9: void WContext::write(String *astring) {
10: if(!astring)
11: return;
12:
13: *string+=*astring;
14: }
15:
16: // if value is VString writes string,
17: // else writes Value; raises an error if already
18: void WContext::write(Value *avalue) {
19: if(!avalue)
20: return;
21:
22: String *string=avalue->get_string();
23: if(string)
24: write(string);
25: else
26: if(fvalue) // already have value?
1.2 ! paf 27: THROW(0,0, // must not construct twice
1.1 paf 28: fvalue->name(),
29: "value already assigned, use constructor to reassign it");
30: else
31: fvalue=avalue;
32: }
33:
E-mail: