--- parser3/src/main/compile_tools.h 2001/02/21 06:59:43 1.4 +++ parser3/src/main/compile_tools.h 2001/02/21 15:00:02 1.7 @@ -1,5 +1,5 @@ /* - $Id: compile_tools.h,v 1.4 2001/02/21 06:59:43 paf Exp $ + $Id: compile_tools.h,v 1.7 2001/02/21 15:00:02 paf Exp $ */ #ifndef COMPILE_TOOLS @@ -7,9 +7,15 @@ #include "code.h" #include "pa_types.h" +#include "pa_pool.h" +#include "pa_array.h" enum lexical_state { LS_USER, + LS_DEF_NAME, + LS_DEF_PARAMS, + LS_DEF_LOCALS, + LS_DEF_COMMENT, LS_VAR_NAME_SIMPLE, LS_VAR_NAME_CURLY, LS_VAR_ROUND, @@ -22,7 +28,7 @@ enum lexical_state { struct parse_control { /* input */ Pool *pool; - Exception *exception; + Array *methods; #ifndef NO_CSTRING_ORIGIN char *source; char *file; @@ -38,13 +44,13 @@ struct parse_control { enum lexical_state stack[MAX_LEXICAL_STATES]; int brackets_nestages[MAX_LEXICAL_STATES]; - /* output: Array * */ - Array *result; + /* output: filled input 'methods' and 'error' if any */ + char error[MAX_STRING]; }; /* New array // return empty array */ -inline Array/**/ *N(Pool *pool) { - return new(*pool) Array/**/(*pool); +inline Array/**/ *N(Pool& pool) { + return new(pool) Array/**/(pool); } /* Assembler instruction // append ordinary instruction to ops */ @@ -77,10 +83,10 @@ inline void P(Array/**/ *result, Arr */ Array *L(String *string); /* Literal Array to(2) String // return string value from literal array OP+string array */ -const String *LA2S(Array *literal_string_array); +String *LA2S(Array *literal_string_array, int offset=0); -void push_LS(struct parse_control *pc); +void push_LS(struct parse_control *pc, lexical_state new_state); void pop_LS(struct parse_control *pc); #endif