Removed a couple of shift/reduce warnings in grammar.
This commit is contained in:
parent
939f9eaac8
commit
e596a0113f
|
@ -79,7 +79,7 @@ int yyerror(const char*);
|
||||||
%left '+' '-'
|
%left '+' '-'
|
||||||
%left '*' '/' '%'
|
%left '*' '/' '%'
|
||||||
%left OP_SIGN '!' '~' OP_DEREF /* OP_INC OP_DEC OP_ADDR */
|
%left OP_SIGN '!' '~' OP_DEREF /* OP_INC OP_DEC OP_ADDR */
|
||||||
%left '.' '[' OP_DRF
|
%left '.' '[' OP_DRF OP_SCOPE
|
||||||
%nonassoc ':'
|
%nonassoc ':'
|
||||||
|
|
||||||
%type <expression> expr lvalue
|
%type <expression> expr lvalue
|
||||||
|
@ -164,8 +164,8 @@ identifier:
|
||||||
tIDENTIFIER { $$ = $1; }
|
tIDENTIFIER { $$ = $1; }
|
||||||
| tPATH '!' tIDENTIFIER { $$ = lexeme_alloc_size(strlen($1) + 1 + strlen($3) + 1);
|
| tPATH '!' tIDENTIFIER { $$ = lexeme_alloc_size(strlen($1) + 1 + strlen($3) + 1);
|
||||||
sprintf($$, "%s!%s", $1, $3); }
|
sprintf($$, "%s!%s", $1, $3); }
|
||||||
| identifier ':' ':' tIDENTIFIER { $$ = lexeme_alloc_size(strlen($1) + 2 + strlen($4) + 1);
|
| identifier OP_SCOPE tIDENTIFIER { $$ = lexeme_alloc_size(strlen($1) + 2 + strlen($3) + 1);
|
||||||
sprintf($$, "%s::%s", $1, $4); }
|
sprintf($$, "%s::%s", $1, $3); }
|
||||||
;
|
;
|
||||||
|
|
||||||
list_arg:
|
list_arg:
|
||||||
|
@ -374,7 +374,8 @@ lvalue_addr:
|
||||||
lvalue { $$ = expr_eval($1); }
|
lvalue { $$ = expr_eval($1); }
|
||||||
;
|
;
|
||||||
|
|
||||||
lvalue: tNUM { $$ = expr_alloc_sconstant($1); }
|
lvalue:
|
||||||
|
tNUM { $$ = expr_alloc_sconstant($1); }
|
||||||
| tINTVAR { $$ = expr_alloc_internal_var($1); }
|
| tINTVAR { $$ = expr_alloc_internal_var($1); }
|
||||||
| identifier { $$ = expr_alloc_symbol($1); }
|
| identifier { $$ = expr_alloc_symbol($1); }
|
||||||
| lvalue OP_DRF tIDENTIFIER { $$ = expr_alloc_pstruct($1, $3); }
|
| lvalue OP_DRF tIDENTIFIER { $$ = expr_alloc_pstruct($1, $3); }
|
||||||
|
|
|
@ -112,6 +112,7 @@ STRING \"[^\n"]+\"
|
||||||
"<<" { return OP_SHL; }
|
"<<" { return OP_SHL; }
|
||||||
">>" { return OP_SHR; }
|
">>" { return OP_SHR; }
|
||||||
"->" { return OP_DRF; }
|
"->" { return OP_DRF; }
|
||||||
|
"::" { return OP_SCOPE; }
|
||||||
[-+<=>|&^()*/%:!~,\.] { return *yytext; }
|
[-+<=>|&^()*/%:!~,\.] { return *yytext; }
|
||||||
"[" { return *yytext; }
|
"[" { return *yytext; }
|
||||||
"]" { return *yytext; }
|
"]" { return *yytext; }
|
||||||
|
|
Loading…
Reference in New Issue