* data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:

Allow multiple %union directives, whose contents concatenate.
* src/parse-gram.y (grammar_declaration): Likewise.
Use muscle_code_grow, so that we don't need stype_line any more.
All uses changed.
This commit is contained in:
Paul Eggert
2006-01-03 20:25:54 +00:00
parent ff5150d9a4
commit 1221b78adb
6 changed files with 45 additions and 21 deletions

View File

@@ -247,9 +247,19 @@ grammar_declaration:
}
| "%union {...}"
{
char const *body = $1;
if (typed)
{
/* Concatenate the union bodies, turning the first one's
trailing '}' into '\n', and omitting the second one's '{'. */
char *code = muscle_find ("stype");
code[strlen (code) - 1] = '\n';
body++;
}
typed = true;
MUSCLE_INSERT_INT ("stype_line", @1.start.line);
muscle_insert ("stype", $1);
muscle_code_grow ("stype", body, @1);
}
| "%destructor {...}" symbols.1
{