X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/25b222faf6299aad314c11713561c7cbfc43a420..f499b06243dfe7d6387c9413411601cd5c20dd2c:/src/muscle_tab.c diff --git a/src/muscle_tab.c b/src/muscle_tab.c index eeda6112..53f83e46 100644 --- a/src/muscle_tab.c +++ b/src/muscle_tab.c @@ -1,5 +1,5 @@ /* Macro table manager for Bison, - Copyright 1984, 1989, 2000 Free Software Foundation, Inc. + Copyright 2001 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -18,9 +18,6 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include - -#include "xalloc.h" #include "system.h" #include "hash.h" #include "files.h" @@ -32,19 +29,20 @@ struct hash_table muscle_table; static unsigned long mhash1 (const void *item) { - return_STRING_HASH_1 (((muscle_entry_t *) item)->key); + return_STRING_HASH_1 (((const muscle_entry_t *) item)->key); } static unsigned long mhash2 (const void *item) { - return_STRING_HASH_2 (((muscle_entry_t *) item)->key); + return_STRING_HASH_2 (((const muscle_entry_t *) item)->key); } static int mcmp (const void *x, const void *y) { - return strcmp (((muscle_entry_t*) x)->key, ((muscle_entry_t *) y)->key); + return strcmp (((const muscle_entry_t*) x)->key, + ((const muscle_entry_t *) y)->key); } void @@ -56,49 +54,46 @@ muscle_init (void) muscle_insert ("version", VERSION); muscle_insert ("filename", infile); - /* Skeleton use. */ - muscle_insert ("skeleton", skeleton); - /* Types. */ muscle_insert ("stype", "int"); muscle_insert ("ltype", "yyltype"); /* Tokens. */ - muscle_insert ("tokendef", ""); + muscle_insert ("tokendef", NULL); /* Tables. */ - muscle_insert ("rhs", "0"); - muscle_insert ("pact", "0"); - muscle_insert ("prhs", "0"); - muscle_insert ("stos", "0"); - muscle_insert ("check", "0"); - muscle_insert ("pgoto", "0"); - muscle_insert ("table", "0"); - muscle_insert ("tname", "0"); - muscle_insert ("defact", "0"); - muscle_insert ("toknum", "0"); - muscle_insert ("defgoto", "0"); - muscle_insert ("translate", "0"); + muscle_insert ("rhs", NULL); + muscle_insert ("pact", NULL); + muscle_insert ("prhs", NULL); + muscle_insert ("stos", NULL); + muscle_insert ("check", NULL); + muscle_insert ("pgoto", NULL); + muscle_insert ("table", NULL); + muscle_insert ("tname", NULL); + muscle_insert ("defact", NULL); + muscle_insert ("toknum", NULL); + muscle_insert ("defgoto", NULL); + muscle_insert ("translate", NULL); /* Various macros. */ - muscle_insert ("flag", "0"); - muscle_insert ("last", "0"); - muscle_insert ("pure", "0"); - muscle_insert ("nsym", "0"); - muscle_insert ("debug", "0"); - muscle_insert ("final", "0"); - muscle_insert ("maxtok", "0"); - muscle_insert ("ntbase", "0"); - muscle_insert ("verbose", "0"); - muscle_insert ("prefix", "yy"); + muscle_insert ("flag", NULL); + muscle_insert ("last", NULL); + muscle_insert ("pure", NULL); + muscle_insert ("nsym", NULL); + muscle_insert ("debug", NULL); + muscle_insert ("final", NULL); + muscle_insert ("maxtok", NULL); + muscle_insert ("ntbase", NULL); + muscle_insert ("error-verbose", NULL); + muscle_insert ("prefix", NULL); /* Default #line formatting. */ muscle_insert ("linef", "#line %d %s\n"); /* No parser macros. */ - muscle_insert ("nnts", "0"); - muscle_insert ("nrules", "0"); - muscle_insert ("nstates", "0"); - muscle_insert ("ntokens", "0"); + muscle_insert ("nnts", NULL); + muscle_insert ("nrules", NULL); + muscle_insert ("nstates", NULL); + muscle_insert ("ntokens", NULL); /* Stack parameters. */ muscle_insert ("maxdepth", "10000"); @@ -108,7 +103,7 @@ muscle_init (void) muscle_insert ("name", "Parser"); } -void +void muscle_insert (const char *key, const char *value) { muscle_entry_t *pair = XMALLOC (muscle_entry_t, 1);