--- parser3/src/main/compile.y 2001/02/21 17:36:58 1.12 +++ parser3/src/main/compile.y 2001/02/22 08:16:31 1.14 @@ -27,7 +27,7 @@ int yylex(YYSTYPE *lvalp, void *pc); %pure_parser -%token END_OF_NAME +%token EON %token STRING %token BOGUS @@ -87,10 +87,10 @@ action: get | put | with | call; get: '$' any_name { $$=$2; /* stack: resulting value */ - OP($$, OP_WRITE); /* value=pop; write(value) */ + OP($$, OP_WRITE_VALUE); /* value=pop; write(value) */ }; -any_name: name_without_curly_rdive END_OF_NAME | name_in_curly_rdive; +any_name: name_without_curly_rdive EON | name_in_curly_rdive; name_in_curly_rdive: '{' name_without_curly_rdive '}' { $$=$2 }; name_without_curly_rdive: name_rdive { @@ -164,7 +164,7 @@ constructor_two_params_value: STRING ';' /* call */ -call: '^' name_expr_dive store_params END_OF_NAME { /* ^field.$method{vasya} */ +call: '^' name_expr_dive store_params EON { /* ^field.$method{vasya} */ /* TODO: подсмотреть в $3, и если там в первом элементе первая буква ":" то выкинуть её и делать не OP_WITH_READ, а WITH_ROOT @@ -235,7 +235,7 @@ name_expr_with_subvar_value: STRING subv $$=N(pool); OP($$, OP_CREATE_EWPOOL); P($$, $1); - OP($$, OP_WRITE); + OP($$, OP_WRITE_STRING); P($$, $2); OP($$, OP_REDUCE_EWPOOL); }; @@ -250,7 +250,7 @@ subvar_ref_name_rdive: STRING { subvar_get_writes: subvar__get_write | subvar_get_writes subvar__get_write { $$=$1; P($$, $2) }; subvar__get_write: '$' subvar_ref_name_rdive { $$=$2; - OP($$, OP_GET_ELEMENT__WRITE); + OP($$, OP_GET_ELEMENT__WRITE_VALUE); }; @@ -261,7 +261,7 @@ with: '$' name_without_curly_rdive '{' c OP($$, OP_CREATE_RWPOOL); P($$, $4); OP($$, OP_REDUCE_RWPOOL); - OP($$, OP_WRITE); + OP($$, OP_WRITE_VALUE); }; /* codes_in_brackets */ @@ -281,7 +281,7 @@ codes__excluding_sole_str_literal: ; write_str_literal: STRING { $$=$1; - OP($$, OP_WRITE); + OP($$, OP_WRITE_STRING); }; /* */ @@ -430,10 +430,10 @@ int yylex(YYSTYPE *lvalp, void *pc) { c==')' || c=='}') { pop_LS(PC); PC->source--; PC->col--; - result=END_OF_NAME; + result=EON; goto break2; } - if(begin==end && c=='{') { /* ${name}, no need of END_OF_NAME, switching LS */ + if(begin==end && c=='{') { /* ${name}, no need of EON, switching LS */ PC->ls=LS_VAR_NAME_CURLY; result=c; goto break2; @@ -590,7 +590,7 @@ int yylex(YYSTYPE *lvalp, void *pc) { } pop_LS(PC); PC->source--; PC->col--; - result=END_OF_NAME; + result=EON; goto break2; } if(c==0) {