mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 15:53:03 +00:00
examples: ship and install variant.yy
This file was meant to be shown as an example. Install it. * README, data/README: Put Emacs metadata in the final section. * examples/README: New. * examples/variant.yy: Use %empty. * examples/local.mk: Install both these files.
This commit is contained in:
@@ -88,13 +88,13 @@ result:
|
||||
;
|
||||
|
||||
list:
|
||||
/* nothing */ { /* Generates an empty string list */ }
|
||||
| list item { std::swap ($$, $1); $$.push_back ($2); }
|
||||
%empty { /* Generates an empty string list */ }
|
||||
| list item { std::swap ($$, $1); $$.push_back ($2); }
|
||||
;
|
||||
|
||||
item:
|
||||
TEXT { std::swap ($$, $1); }
|
||||
| NUMBER { $$ = string_cast ($1); }
|
||||
TEXT { std::swap ($$, $1); }
|
||||
| NUMBER { $$ = string_cast ($1); }
|
||||
;
|
||||
%%
|
||||
|
||||
|
||||
Reference in New Issue
Block a user