%%
input:
line
-| input line { }
+| input line {}
;
line:
'\n'
-| exp '\n' { }
+| exp '\n' {}
;
exp:
$$ = $l;
}
| exp[x] '+' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>l + $r; }
-| exp[l] '-' exp[r] { $$ = $l - $r; }
-| exp[l] '*' exp[r] { $$ = $l * $r; }
+| exp[l] '-' exp[r] { $$ = $l - $r; }
+| exp[l] '*' exp[r] { $$ = $l * $r; }
| exp[l] '/' exp[r] { $$ = $l / $r; }
| '-' exp %prec NEG { $$ = -$2; }
-| exp[l] '^' exp[r] { $$ = power ($l, $r); }
-| '(' exp[e] ')' { $$ = $e; }
+| exp[l] '^' exp[r] { $$ = power ($l, $r); }
+| '(' exp[e] ')' { $$ = $e; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '!' { $$ = 0; YYERROR; }
| '-' error { $$ = 0; YYERROR; }
%%
input:
line
-| input line { }
+| input line {}
;
line:
'\n'
-| exp '\n' { }
+| exp '\n' {}
;
exp:
| exp[x] '*' { $<ival>$ = $x; } [l] exp[r] { $$ = $l * $r; }
| exp[l] '/' exp[r] { $$ = $l / $r; }
| '-' exp %prec NEG { $$ = -$2; }
-| exp[l] '^' exp[r] { $$ = power ($l, $r12); }
+| exp[l] '^' exp[r] { $$ = power ($l, $r12); }
| '(' exp ')' { $$ = $expo; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '!' { $$ = 0; YYERROR; }
test.y:51.7: possibly meant: $x, hiding $exp at $1
test.y:51.41: possibly meant: $r, hiding $exp at $4
test.y:52.51-52: error: $l of 'exp' has no declared type
-test.y:55.46-49: error: invalid reference: '$r12'
-test.y:55.3-53: symbol not found in production: r12
+test.y:55.40-43: error: invalid reference: '$r12'
+test.y:55.3-47: symbol not found in production: r12
test.y:56.29-33: error: invalid reference: '$expo'
test.y:56.3-46: symbol not found in production: expo
]])
AT_DATA_GRAMMAR([test.y],
[[
%%
-start: foo[ /* aaa */ *&-.+\000\001\002\377 ] bar
+start: foo[ % /* aaa */ *&-.+\000\001\002\377 ] bar
{ s = $foo; }
]])
AT_CHECK([[$PERL -pi -e 's/\\(\d{3})/chr(oct($1))/ge' test.y || exit 77]])
AT_BISON_CHECK([-o test.c test.y], 1, [],
-[[test.y:11.23: error: invalid character in bracketed name: '*'
-test.y:11.24: error: invalid character in bracketed name: '&'
-test.y:11.25: error: invalid character in bracketed name: '-'
-test.y:11.27: error: invalid character in bracketed name: '+'
-test.y:11.28: error: invalid character in bracketed name: '\0'
-test.y:11.28: error: invalid character in bracketed name: '\001'
-test.y:11.28: error: invalid character in bracketed name: '\002'
-test.y:11.28: error: invalid character in bracketed name: '\377'
+[[test.y:11.13: error: invalid character in bracketed name: '%'
+test.y:11.25-27: error: invalid characters in bracketed name: '*&-'
+test.y:11.29-30: error: invalid characters in bracketed name: '+\0\001\002\377'
]])
AT_CLEANUP