mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 17:53:02 +00:00
* src/reader.c (copy_definition, parse_union_decl): Update and use
`linef' muscle. (copy_action): Likewise. Use obstack_1grow (). * src/muscle_tab.c (muscle_init): Add muscle `linef'.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2001-09-21 Marc Autret <autret_m@epita.fr>
|
||||||
|
|
||||||
|
* src/reader.c (copy_definition, parse_union_decl): Update and use
|
||||||
|
`linef' muscle.
|
||||||
|
(copy_action): Likewise.
|
||||||
|
Use obstack_1grow ().
|
||||||
|
* src/muscle_tab.c (muscle_init): Add muscle `linef'.
|
||||||
|
|
||||||
2001-09-21 Marc Autret <autret_m@epita.fr>
|
2001-09-21 Marc Autret <autret_m@epita.fr>
|
||||||
|
|
||||||
* src/options.c (option_table): Adjust.
|
* src/options.c (option_table): Adjust.
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ muscle_init (void)
|
|||||||
muscle_insert ("ntbase", "0");
|
muscle_insert ("ntbase", "0");
|
||||||
muscle_insert ("verbose", "0");
|
muscle_insert ("verbose", "0");
|
||||||
muscle_insert ("prefix", "yy");
|
muscle_insert ("prefix", "yy");
|
||||||
|
/* Default #line formatting. */
|
||||||
|
muscle_insert ("linef", "#line %d %s\n");
|
||||||
|
|
||||||
/* No parser macros. */
|
/* No parser macros. */
|
||||||
muscle_insert ("nnts", "0");
|
muscle_insert ("nnts", "0");
|
||||||
|
|||||||
30
src/reader.c
30
src/reader.c
@@ -429,8 +429,11 @@ copy_definition (void)
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (!no_lines_flag)
|
if (!no_lines_flag)
|
||||||
obstack_fgrow2 (&attrs_obstack, "#line %d %s\n",
|
{
|
||||||
lineno, quotearg_style (c_quoting_style, infile));
|
obstack_fgrow2 (&attrs_obstack, muscle_find ("linef"),
|
||||||
|
lineno, quotearg_style (c_quoting_style,
|
||||||
|
muscle_find("filename")));
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
after_percent = 0;
|
after_percent = 0;
|
||||||
@@ -748,13 +751,16 @@ parse_union_decl (void)
|
|||||||
|
|
||||||
typed = 1;
|
typed = 1;
|
||||||
|
|
||||||
|
|
||||||
if (!no_lines_flag)
|
if (!no_lines_flag)
|
||||||
obstack_fgrow2 (&attrs_obstack, "\n#line %d %s\n",
|
{
|
||||||
lineno, quotearg_style (c_quoting_style,
|
obstack_fgrow2 (&attrs_obstack, muscle_find ("linef"),
|
||||||
muscle_find("filename")));
|
lineno, quotearg_style (c_quoting_style,
|
||||||
|
muscle_find("filename")));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
obstack_1grow (&attrs_obstack, '\n');
|
obstack_1grow (&attrs_obstack, '\n');
|
||||||
|
|
||||||
obstack_sgrow (&attrs_obstack, "typedef union");
|
obstack_sgrow (&attrs_obstack, "typedef union");
|
||||||
if (defines_flag)
|
if (defines_flag)
|
||||||
obstack_sgrow (&defines_obstack, "typedef union");
|
obstack_sgrow (&defines_obstack, "typedef union");
|
||||||
@@ -1107,15 +1113,13 @@ copy_action (symbol_list *rule, int stack_offset)
|
|||||||
if (semantic_parser)
|
if (semantic_parser)
|
||||||
stack_offset = 0;
|
stack_offset = 0;
|
||||||
|
|
||||||
sprintf (buf, "\ncase %d:\n", nrules);
|
obstack_fgrow1 (&action_obstack, "\ncase %d:\n", nrules);
|
||||||
obstack_grow (&action_obstack, buf, strlen (buf));
|
|
||||||
|
|
||||||
if (!no_lines_flag)
|
if (!no_lines_flag)
|
||||||
{
|
{
|
||||||
sprintf (buf, "#line %d %s\n",
|
obstack_fgrow2 (&action_obstack, muscle_find ("linef"),
|
||||||
lineno, quotearg_style (c_quoting_style,
|
lineno, quotearg_style (c_quoting_style,
|
||||||
muscle_find ("filename")));
|
muscle_find ("filename")));
|
||||||
obstack_grow (&action_obstack, buf, strlen (buf));
|
|
||||||
}
|
}
|
||||||
obstack_1grow (&action_obstack, '{');
|
obstack_1grow (&action_obstack, '{');
|
||||||
|
|
||||||
@@ -1201,7 +1205,7 @@ copy_guard (symbol_list *rule, int stack_offset)
|
|||||||
|
|
||||||
obstack_fgrow1 (&guard_obstack, "\ncase %d:\n", nrules);
|
obstack_fgrow1 (&guard_obstack, "\ncase %d:\n", nrules);
|
||||||
if (!no_lines_flag)
|
if (!no_lines_flag)
|
||||||
obstack_fgrow2 (&guard_obstack, "#line %d %s\n",
|
obstack_fgrow2 (&guard_obstack, muscle_find ("linef"),
|
||||||
lineno, quotearg_style (c_quoting_style,
|
lineno, quotearg_style (c_quoting_style,
|
||||||
muscle_find ("filename")));
|
muscle_find ("filename")));
|
||||||
obstack_1grow (&guard_obstack, '{');
|
obstack_1grow (&guard_obstack, '{');
|
||||||
|
|||||||
Reference in New Issue
Block a user