--- parser3/src/main/compile.y 2015/04/02 22:17:22 1.268 +++ parser3/src/main/compile.y 2015/09/27 20:12:42 1.271 @@ -8,7 +8,7 @@ */ -volatile const char * IDENT_COMPILE_Y = "$Id: compile.y,v 1.268 2015/04/02 22:17:22 moko Exp $"; +volatile const char * IDENT_COMPILE_Y = "$Id: compile.y,v 1.271 2015/09/27 20:12:42 moko Exp $"; /** @todo parser4: @@ -22,12 +22,12 @@ volatile const char * IDENT_COMPILE_Y = */ #define YYSTYPE ArrayOperation* -#define YYPARSE_PARAM pc -#define YYLEX_PARAM pc #define YYDEBUG 1 -#define YYERROR_VERBOSE 1 -#define yyerror(msg) real_yyerror((Parse_control *)pc, msg) +#define YYERROR_VERBOSE 1 +#define yyerror(pc, msg) real_yyerror(pc, msg) #define YYPRINT(file, type, value) yyprint(file, type, value) +#define YYMALLOC pa_malloc +#define YYFREE pa_free // includes @@ -59,7 +59,7 @@ static const VString vempty; // local convinient inplace typecast & var #undef PC -#define PC (*(Parse_control *)pc) +#define PC (*pc) #undef POOL #define POOL (*PC.pool) #ifndef DOXYGEN @@ -72,7 +72,9 @@ static const VString vempty; %} -%pure_parser +%pure-parser +%lex-param {Parse_control* pc} +%parse-param {Parse_control* pc} %token EON %token STRING @@ -1071,8 +1073,8 @@ default: case '"': case '\'': if( - pc.ls == LS_EXPRESSION_STRING_QUOTED && c=='"' || - pc.ls == LS_EXPRESSION_STRING_APOSTROFED && c=='\'') { + (pc.ls == LS_EXPRESSION_STRING_QUOTED && c=='"') || + (pc.ls == LS_EXPRESSION_STRING_APOSTROFED && c=='\'') ) { pop_LS(pc); //"abc". | 'abc'. RC; } @@ -1145,11 +1147,12 @@ default: case LS_METHOD_ROUND: switch(c) { case ')': - if(--lexical_brackets_nestage==0) + if(--lexical_brackets_nestage==0) { if(pc.ls==LS_METHOD_ROUND) // method round param ended pc.ls=LS_METHOD_AFTER; // look for method end else // pc.ls==LS_VAR_ROUND // variable constructor ended pop_LS(pc); // return to normal life + } RC; case '#': // comment start skipping if(end!=begin) {