--- parser3/src/main/compile_tools.h 2001/02/22 09:14:46 1.8 +++ parser3/src/main/compile_tools.h 2001/02/23 12:37:58 1.12 @@ -1,5 +1,5 @@ /* - $Id: compile_tools.h,v 1.8 2001/02/22 09:14:46 paf Exp $ + $Id: compile_tools.h,v 1.12 2001/02/23 12:37:58 paf Exp $ */ #ifndef COMPILE_TOOLS @@ -9,7 +9,8 @@ #include "pa_types.h" #include "pa_pool.h" #include "pa_array.h" -#include "pa_value.h" +#include "pa_string.h" +#include "pa_vstring.h" enum lexical_state { LS_USER, @@ -60,10 +61,6 @@ inline void OP(Array/**/ *result, en *result+=op.cast; } -/* Argument String // append String to ops*/ -inline void AS(Array/**/ *result, String *string) { - *result+=string; -} /* Argument Array // append Array to ops */ inline void AA(Array/**/ *result, Array/**/ *array) { *result+=array; @@ -73,20 +70,25 @@ inline void AE(Array/**/ *result, ch *result+=eval_expression; } +// aPpend 'code_array' to 'result' inline void P(Array/**/ *result, Array *code_array) { result->append_array(*code_array); } +// aPpend part of 'code_array', starting from offset, to 'result' +inline void P(Array/**/ *result, Array *code_array, int offset) { + result->append_array(*code_array, offset); +} +// aPpend 'vstring' to 'result' +void PVS(Array/**/ *result, VString *vstring); /* Literal // returns array with // first: OP_STRING instruction // second op: string itself */ -Array *L(String *string); +Array *L(VString *vstring); /* Literal Array to(2) String // return string value from literal array OP+string array */ String *LA2S(Array *literal_string_array, int offset=0); -/* Literal Array String2VString fix // return literal array with string changed to VString */ -Array *LAS2LAVS(Array *literal_array); void push_LS(struct parse_control *pc, lexical_state new_state); void pop_LS(struct parse_control *pc);