* tests/calc.at: Exercise prologue splitting.

* data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
`b4_post_prologue' instead of `b4_prologue'.
* src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
muscles.
(output): Free pre_prologue_obstack and post_prologue_obstack.
* src/files.h, src/files.c (attrs_obstack): Remove.
(pre_prologue_obstack, post_prologue_obstack): New.
* src/reader.c (copy_definition): Add a parameter to specify the
obstack to fill, instead of using attrs_obstack unconditionally.
(read_declarations): Pass pre_prologue_obstack to copy_definition if
`%union' has not yet been seen, pass post_prologue_obstack otherwise.
This commit is contained in:
Robert Anisko
2002-04-24 16:22:57 +00:00
parent b98ec53ee4
commit 0dd1580afc
8 changed files with 66 additions and 19 deletions

View File

@@ -61,14 +61,23 @@ static int yygetc (void);
static void yyungetc (int c);
extern void perror (const char *s);
/* Exercise pre-prologue dependency to %union. */
typedef int value_t;
%}
/* Also exercise %union. */
%union
{
int ival; /* A comment to exercise an old bug. */
value_t ival; /* A comment to exercise an old bug. */
};
/* Exercise post-prologue dependency to %union. */
%{
static void id (YYSTYPE *lval);
%}
/* Bison Declarations */
%token CALC_EOF 0 "end of file"
%token <ival> NUM "number"
@@ -236,6 +245,11 @@ power (int base, int exponent)
return res;
}
void
id (YYSTYPE* lval)
{
}
int
main (int argc, const char **argv)
{