mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 08:43:03 +00:00
* src/output.c (output): Remove the initialization of the macro
obstack. It was done too late here. * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was completely wrong. (reader): Initialize the macro obstack here, since we need it to grow '%define' directives. * src/reader.h: Declare the macro obstack as extern.
This commit is contained in:
12
ChangeLog
12
ChangeLog
@@ -1,3 +1,15 @@
|
|||||||
|
2001-08-27 Robert Anisko <robert.anisko@epita.fr>
|
||||||
|
|
||||||
|
* src/output.c (output): Remove the initialization of the macro
|
||||||
|
obstack. It was done too late here.
|
||||||
|
|
||||||
|
* src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
|
||||||
|
completely wrong.
|
||||||
|
(reader): Initialize the macro obstack here, since we need it to grow
|
||||||
|
'%define' directives.
|
||||||
|
|
||||||
|
* src/reader.h: Declare the macro obstack as extern.
|
||||||
|
|
||||||
2001-08-27 Robert Anisko <robert.anisko@epita.fr>
|
2001-08-27 Robert Anisko <robert.anisko@epita.fr>
|
||||||
|
|
||||||
* src/output.c (output_parser): Fix. Store single '%' characters in
|
* src/output.c (output_parser): Fix. Store single '%' characters in
|
||||||
|
|||||||
@@ -1103,7 +1103,6 @@ prepare (void)
|
|||||||
void
|
void
|
||||||
output (void)
|
output (void)
|
||||||
{
|
{
|
||||||
obstack_init (¯o_obstack);
|
|
||||||
obstack_init (&output_obstack);
|
obstack_init (&output_obstack);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|||||||
12
src/reader.c
12
src/reader.c
@@ -907,9 +907,6 @@ parse_macro_decl (void)
|
|||||||
int ch = ungetc (skip_white_space (), finput);
|
int ch = ungetc (skip_white_space (), finput);
|
||||||
char* macro_key;
|
char* macro_key;
|
||||||
char* macro_value;
|
char* macro_value;
|
||||||
struct obstack macro_obstack;
|
|
||||||
|
|
||||||
obstack_init (¯o_obstack);
|
|
||||||
|
|
||||||
/* Read key. */
|
/* Read key. */
|
||||||
if (!isalpha (ch) && ch != '_')
|
if (!isalpha (ch) && ch != '_')
|
||||||
@@ -919,6 +916,7 @@ parse_macro_decl (void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
copy_identifier (finput, ¯o_obstack);
|
copy_identifier (finput, ¯o_obstack);
|
||||||
|
obstack_1grow (¯o_obstack, 0);
|
||||||
macro_key = obstack_finish (¯o_obstack);
|
macro_key = obstack_finish (¯o_obstack);
|
||||||
|
|
||||||
/* Read value. */
|
/* Read value. */
|
||||||
@@ -935,11 +933,10 @@ parse_macro_decl (void)
|
|||||||
else
|
else
|
||||||
fatal (_("Premature EOF after %s"), "\"");
|
fatal (_("Premature EOF after %s"), "\"");
|
||||||
}
|
}
|
||||||
copy_string (finput, ¯o_obstack, '"');
|
copy_string2 (finput, ¯o_obstack, '"', 0);
|
||||||
|
obstack_1grow (¯o_obstack, 0);
|
||||||
macro_value = obstack_finish (¯o_obstack);
|
macro_value = obstack_finish (¯o_obstack);
|
||||||
|
|
||||||
obstack_free (¯o_obstack, 0);
|
|
||||||
|
|
||||||
/* Store the (key, value) pair in the environment. */
|
/* Store the (key, value) pair in the environment. */
|
||||||
macro_insert (macro_key, macro_value);
|
macro_insert (macro_key, macro_value);
|
||||||
}
|
}
|
||||||
@@ -1991,6 +1988,9 @@ reader (void)
|
|||||||
init_lex ();
|
init_lex ();
|
||||||
lineno = 1;
|
lineno = 1;
|
||||||
|
|
||||||
|
/* Initialize the macro obstack. */
|
||||||
|
obstack_init (¯o_obstack);
|
||||||
|
|
||||||
/* Initialize the symbol table. */
|
/* Initialize the symbol table. */
|
||||||
tabinit ();
|
tabinit ();
|
||||||
|
|
||||||
|
|||||||
@@ -36,4 +36,6 @@ extern int lineno;
|
|||||||
extern char **tags;
|
extern char **tags;
|
||||||
extern short *user_toknums;
|
extern short *user_toknums;
|
||||||
|
|
||||||
|
extern struct obstack macro_obstack;
|
||||||
|
|
||||||
#endif /* !READER_H_ */
|
#endif /* !READER_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user