mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 23:33:03 +00:00
* 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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user