mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 06:13:02 +00:00
* src/reader.c: Include muscle_tab.h.
(parse_union_decl): Update. (parse_macro_decl): Rename parse_muscle_decl. Update to use renamed functions and variable. (read_declarations, copy_action, read_additionnal_code, : Updated with correct variables and functions names. (packsymbols, reader): Likewise. * src/reader.h (muscle_obstack): Extern declaration update. * src/output.c: Include muscle_tab.h In all functions using macro_insert, change by using muscle_insert (). (macro_obstack): Rename muscle_obstack. Echo modifications in the whole file. (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT. (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING. (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX. * src/muscle_tab.h: Update double inclusion macros. (macro_entry_s): Rename muscle_entry_s. Update prototypes. * src/muscle_tab.c: Include muscle_tab.h. Rename macro_tabble to muscle_table. (mhash1, mhash2, mcmp): Use muscle_entry. (macro_init): Rename muscle_init. Update. (macro_insert): Rename muscle_insert. Update. (macro_find): Rename muscle_find. Update. * src/main.c: Include muscle_tab.h. (main): Call muscle_init (). * src/Makefile.am (bison_SOURCES): Echo modifications.
This commit is contained in:
38
src/reader.c
38
src/reader.c
@@ -34,7 +34,7 @@
|
||||
#include "output.h"
|
||||
#include "reader.h"
|
||||
#include "conflicts.h"
|
||||
#include "macrotab.h"
|
||||
#include "muscle_tab.h"
|
||||
|
||||
/* Number of slots allocated (but not necessarily used yet) in `rline' */
|
||||
static int rline_allocated;
|
||||
@@ -750,7 +750,7 @@ parse_union_decl (void)
|
||||
if (!no_lines_flag)
|
||||
obstack_fgrow2 (&attrs_obstack, "\n#line %d %s\n",
|
||||
lineno, quotearg_style (c_quoting_style,
|
||||
macro_find("filename")));
|
||||
muscle_find("filename")));
|
||||
else
|
||||
obstack_1grow (&attrs_obstack, '\n');
|
||||
|
||||
@@ -903,11 +903,11 @@ parse_thong_decl (void)
|
||||
/* FIXME. */
|
||||
|
||||
static void
|
||||
parse_macro_decl (void)
|
||||
parse_muscle_decl (void)
|
||||
{
|
||||
int ch = ungetc (skip_white_space (), finput);
|
||||
char* macro_key;
|
||||
char* macro_value;
|
||||
char* muscle_key;
|
||||
char* muscle_value;
|
||||
|
||||
/* Read key. */
|
||||
if (!isalpha (ch) && ch != '_')
|
||||
@@ -916,9 +916,9 @@ parse_macro_decl (void)
|
||||
skip_to_char ('%');
|
||||
return;
|
||||
}
|
||||
copy_identifier (finput, ¯o_obstack);
|
||||
obstack_1grow (¯o_obstack, 0);
|
||||
macro_key = obstack_finish (¯o_obstack);
|
||||
copy_identifier (finput, &muscle_obstack);
|
||||
obstack_1grow (&muscle_obstack, 0);
|
||||
muscle_key = obstack_finish (&muscle_obstack);
|
||||
|
||||
/* Read value. */
|
||||
ch = skip_white_space ();
|
||||
@@ -934,12 +934,12 @@ parse_macro_decl (void)
|
||||
else
|
||||
fatal (_("Premature EOF after %s"), "\"");
|
||||
}
|
||||
copy_string2 (finput, ¯o_obstack, '"', 0);
|
||||
obstack_1grow (¯o_obstack, 0);
|
||||
macro_value = obstack_finish (¯o_obstack);
|
||||
copy_string2 (finput, &muscle_obstack, '"', 0);
|
||||
obstack_1grow (&muscle_obstack, 0);
|
||||
muscle_value = obstack_finish (&muscle_obstack);
|
||||
|
||||
/* Store the (key, value) pair in the environment. */
|
||||
macro_insert (macro_key, macro_value);
|
||||
muscle_insert (muscle_key, muscle_value);
|
||||
}
|
||||
|
||||
|
||||
@@ -1061,7 +1061,7 @@ read_declarations (void)
|
||||
break;
|
||||
|
||||
case tok_define:
|
||||
parse_macro_decl ();
|
||||
parse_muscle_decl ();
|
||||
break;
|
||||
|
||||
case tok_skel:
|
||||
@@ -1113,7 +1113,7 @@ copy_action (symbol_list *rule, int stack_offset)
|
||||
{
|
||||
sprintf (buf, "#line %d %s\n",
|
||||
lineno, quotearg_style (c_quoting_style,
|
||||
macro_find ("filename")));
|
||||
muscle_find ("filename")));
|
||||
obstack_grow (&action_obstack, buf, strlen (buf));
|
||||
}
|
||||
obstack_1grow (&action_obstack, '{');
|
||||
@@ -1202,7 +1202,7 @@ copy_guard (symbol_list *rule, int stack_offset)
|
||||
if (!no_lines_flag)
|
||||
obstack_fgrow2 (&guard_obstack, "#line %d %s\n",
|
||||
lineno, quotearg_style (c_quoting_style,
|
||||
macro_find ("filename")));
|
||||
muscle_find ("filename")));
|
||||
obstack_1grow (&guard_obstack, '{');
|
||||
|
||||
count = 0;
|
||||
@@ -1683,7 +1683,7 @@ read_additionnal_code (void)
|
||||
obstack_1grow (&el_obstack, c);
|
||||
|
||||
obstack_1grow (&el_obstack, 0);
|
||||
macro_insert ("epilogue", obstack_finish (&el_obstack));
|
||||
muscle_insert ("epilogue", obstack_finish (&el_obstack));
|
||||
}
|
||||
|
||||
|
||||
@@ -1853,7 +1853,7 @@ packsymbols (void)
|
||||
|
||||
output_token_defines (&output_obstack);
|
||||
obstack_1grow (&output_obstack, 0);
|
||||
macro_insert ("tokendef", obstack_finish (&output_obstack));
|
||||
muscle_insert ("tokendef", obstack_finish (&output_obstack));
|
||||
|
||||
#if 0
|
||||
if (!no_parser_flag)
|
||||
@@ -2005,8 +2005,8 @@ reader (void)
|
||||
init_lex ();
|
||||
lineno = 1;
|
||||
|
||||
/* Initialize the macro obstack. */
|
||||
obstack_init (¯o_obstack);
|
||||
/* Initialize the muscle obstack. */
|
||||
obstack_init (&muscle_obstack);
|
||||
|
||||
/* Initialize the symbol table. */
|
||||
tabinit ();
|
||||
|
||||
Reference in New Issue
Block a user