mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-10-18 13:43:27 +00:00
glr2.cc: example: simplify
* examples/c++/glr/c++-types.yy: Formatting changes. Remove unused support for '@'. * examples/c/glr/c++-types.y: Ditto.
This commit is contained in:
1 parent
bb97a2a37b
commit
89296e3962
2 files changed
+1
-4
No files matched your search
@@ -71,12 +71,10 @@ prog : %empty
|
||||
stmt : expr ';' %merge <stmtMerge> { $$ = $1; }
|
||||
| decl %merge <stmtMerge>
|
||||
| error ';' { $$ = Nterm ("<error>"); }
|
||||
| '@' { $$ = $1; YYACCEPT; }
|
||||
;
|
||||
|
||||
expr : ID
|
||||
| TYPENAME '(' expr ')'
|
||||
{ $$ = Nterm ("<cast>", $3, $1); }
|
||||
| TYPENAME '(' expr ')' { $$ = Nterm ("<cast>", $3, $1); }
|
||||
| expr '+' expr { $$ = Nterm ("+", $1, $3); }
|
||||
| expr '=' expr { $$ = Nterm ("=", $1, $3); }
|
||||
;
|
||||
|
||||
@@ -84,7 +84,6 @@ prog : %empty
|
||||
stmt : expr ';' %merge <stmtMerge> { $$ = $1; }
|
||||
| decl %merge <stmtMerge>
|
||||
| error ';' { $$ = new_nterm ("<error>", NULL, NULL, NULL); }
|
||||
| '@' { $$ = $1; YYACCEPT; }
|
||||
;
|
||||
|
||||
expr : ID
|
||||
|
||||
Reference in new issue
Block a user