--- parser3/src/main/compile_tools.C 2001/02/22 09:14:46 1.6 +++ parser3/src/main/compile_tools.C 2001/02/22 13:58:43 1.9 @@ -1,5 +1,5 @@ /* - $Id: compile_tools.C,v 1.6 2001/02/22 09:14:46 paf Exp $ + $Id: compile_tools.C,v 1.9 2001/02/22 13:58:43 paf Exp $ */ #include "compile_tools.h" @@ -8,32 +8,22 @@ #include "pa_exception.h" #include "pa_vstring.h" -Array *L(String *string) { +Array *L(VString *vstring) { // empty ops array - Array *result=N(string->pool()); + Array *result=N(vstring->pool()); // append OP_STRING Operation op; op.code=OP_STRING; *result+=op.cast; - // append 'string' - *result+=string; + // append 'vstring' + *result+=vstring; return result; } String *LA2S(Array *literal_string_array, int offset) { - return static_cast(literal_string_array->get(offset+1)); -} -Array *LAS2LAVS(Array *literal_array) { - Operation op; op.code=OP_VSTRING; - literal_array->put(0, op.cast); - - Value *value=new(literal_array->pool()) - VString(static_cast(literal_array->get(1))); - literal_array->put(1, value); - - return literal_array; + return static_cast(literal_string_array->get(offset+1))->get_string(); } @@ -41,13 +31,11 @@ void push_LS(struct parse_control *pc, l if(pc->spstack[pc->sp++]=pc->ls; pc->ls=new_state; } else - (static_cast(pc->pool))->exception().raise(0, 0, 0, - "push_LS: stack overflow"); + pc->pool->THROW(0, 0, 0, "push_LS: stack overflow"); } void pop_LS(struct parse_control *pc) { if(--pc->sp>=0) pc->ls=pc->stack[pc->sp]; else - (static_cast(pc->pool))->exception().raise(0, 0, 0, - "push_LS: stack underflow"); + pc->pool->THROW(0, 0, 0, "push_LS: stack underflow"); }