Annotation of parser3/src/main/pa_wcontext.C, revision 1.1
1.1 ! paf 1: /*
! 2: $Id: pa_value.C,v 1.3 2001/02/23 22:22:08 paf Exp $
! 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?
! 27: THROW(0,0, // don't need to construct twice
! 28: fvalue->name(),
! 29: "value already assigned, use constructor to reassign it");
! 30: else
! 31: fvalue=avalue;
! 32: }
! 33:
E-mail: