mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 18:53:04 +00:00
* src/main.c (main): Standardize.
* src/output.c (output_table_data, output_parser): Likewise. * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2001-08-31 Pascal Bart <pascal.bart@epita.fr>
|
||||||
|
|
||||||
|
* src/main.c (main): Standardize.
|
||||||
|
* src/output.c (output_table_data, output_parser): Likewise.
|
||||||
|
* src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
|
||||||
|
|
||||||
2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
|
2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
|
||||||
|
|
||||||
* src/reader.c (read_additionnal_code): Rename %%user_code to
|
* src/reader.c (read_additionnal_code): Rename %%user_code to
|
||||||
|
|||||||
@@ -160,8 +160,8 @@ static const short yyrline[] =
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if YYDEBUG || YYERROR_VERBOSE
|
#if YYDEBUG || YYERROR_VERBOSE
|
||||||
/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
|
/* YYTNME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
|
||||||
static const char* const yytname[] =
|
static const char *const yytname[] =
|
||||||
{
|
{
|
||||||
%%tname
|
%%tname
|
||||||
};
|
};
|
||||||
@@ -617,12 +617,12 @@ yybackup:
|
|||||||
%%yychar = YYLEX;
|
%%yychar = YYLEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert token to internal form (in yychar1) for indexing tables with */
|
/* Convert token to internal form (in yychar1) for indexing tables with. */
|
||||||
|
|
||||||
if (%%yychar <= 0) /* This means end of input. */
|
if (%%yychar <= 0) /* This means end of input. */
|
||||||
{
|
{
|
||||||
yychar1 = 0;
|
yychar1 = 0;
|
||||||
%%yychar = YYEOF; /* Don't call YYLEX any more */
|
%%yychar = YYEOF; /* Don't call YYLEX any more. */
|
||||||
|
|
||||||
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
||||||
}
|
}
|
||||||
@@ -845,16 +845,16 @@ yyerrlab:
|
|||||||
goto yyerrlab1;
|
goto yyerrlab1;
|
||||||
|
|
||||||
|
|
||||||
/*--------------------------------------------------.
|
/*----------------------------------------------------.
|
||||||
| yyerrlab1 -- error raised explicitly by an action |
|
| yyerrlab1 -- error raised explicitly by an action. |
|
||||||
`--------------------------------------------------*/
|
`----------------------------------------------------*/
|
||||||
yyerrlab1:
|
yyerrlab1:
|
||||||
if (yyerrstatus == 3)
|
if (yyerrstatus == 3)
|
||||||
{
|
{
|
||||||
/* If just tried and failed to reuse lookahead token after an
|
/* If just tried and failed to reuse lookahead token after an
|
||||||
error, discard it. */
|
error, discard it. */
|
||||||
|
|
||||||
/* return failure if at end of input */
|
/* Return failure if at end of input. */
|
||||||
if (%%yychar == YYEOF)
|
if (%%yychar == YYEOF)
|
||||||
YYABORT;
|
YYABORT;
|
||||||
YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
|
YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
|
||||||
@@ -865,7 +865,7 @@ yyerrlab1:
|
|||||||
/* Else will try to reuse lookahead token after shifting the error
|
/* Else will try to reuse lookahead token after shifting the error
|
||||||
token. */
|
token. */
|
||||||
|
|
||||||
yyerrstatus = 3; /* Each real token shifted decrements this */
|
yyerrstatus = 3; /* Each real token shifted decrements this. */
|
||||||
|
|
||||||
goto yyerrhandle;
|
goto yyerrhandle;
|
||||||
|
|
||||||
@@ -888,7 +888,7 @@ yyerrdefault:
|
|||||||
|
|
||||||
/*---------------------------------------------------------------.
|
/*---------------------------------------------------------------.
|
||||||
| yyerrpop -- pop the current state because it cannot handle the |
|
| yyerrpop -- pop the current state because it cannot handle the |
|
||||||
| error token |
|
| error token. |
|
||||||
`---------------------------------------------------------------*/
|
`---------------------------------------------------------------*/
|
||||||
yyerrpop:
|
yyerrpop:
|
||||||
if (yyssp == yyss)
|
if (yyssp == yyss)
|
||||||
|
|||||||
@@ -29,21 +29,21 @@
|
|||||||
struct hash_table macro_table;
|
struct hash_table macro_table;
|
||||||
|
|
||||||
static unsigned long
|
static unsigned long
|
||||||
mhash1 (const void* item)
|
mhash1 (const void *item)
|
||||||
{
|
{
|
||||||
return_STRING_HASH_1 (((macro_entry_t*) item)->key);
|
return_STRING_HASH_1 (((macro_entry_t *) item)->key);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned long
|
static unsigned long
|
||||||
mhash2 (const void* item)
|
mhash2 (const void *item)
|
||||||
{
|
{
|
||||||
return_STRING_HASH_2 (((macro_entry_t*) item)->key);
|
return_STRING_HASH_2 (((macro_entry_t *) item)->key);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mcmp (const void* x, const void* y)
|
mcmp (const void *x, const void *y)
|
||||||
{
|
{
|
||||||
return strcmp (((macro_entry_t*) x)->key, ((macro_entry_t*) y)->key);
|
return strcmp (((macro_entry_t*) x)->key, ((macro_entry_t *) y)->key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -113,7 +113,7 @@ macro_init (void)
|
|||||||
void
|
void
|
||||||
macro_insert (const char *key, const char *value)
|
macro_insert (const char *key, const char *value)
|
||||||
{
|
{
|
||||||
macro_entry_t* pair = XMALLOC (macro_entry_t, 1);
|
macro_entry_t *pair = XMALLOC (macro_entry_t, 1);
|
||||||
pair->key = key;
|
pair->key = key;
|
||||||
pair->value = value;
|
pair->value = value;
|
||||||
hash_insert (¯o_table, pair);
|
hash_insert (¯o_table, pair);
|
||||||
@@ -123,6 +123,6 @@ const char*
|
|||||||
macro_find (const char *key)
|
macro_find (const char *key)
|
||||||
{
|
{
|
||||||
macro_entry_t pair = { key, 0 };
|
macro_entry_t pair = { key, 0 };
|
||||||
macro_entry_t* result = hash_find_item (¯o_table, &pair);
|
macro_entry_t *result = hash_find_item (¯o_table, &pair);
|
||||||
return result ? result->value : 0;
|
return result ? result->value : 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,12 +25,12 @@
|
|||||||
|
|
||||||
typedef struct macro_entry_s
|
typedef struct macro_entry_s
|
||||||
{
|
{
|
||||||
const char* key;
|
const char *key;
|
||||||
const char* value;
|
const char *value;
|
||||||
} macro_entry_t;
|
} macro_entry_t;
|
||||||
|
|
||||||
void macro_init PARAMS ((void));
|
void macro_init PARAMS ((void));
|
||||||
void macro_insert PARAMS ((const char *key, const char *value));
|
void macro_insert PARAMS ((const char *key, const char *value));
|
||||||
const char* macro_find PARAMS ((const char *key));
|
const char *macro_find PARAMS ((const char *key));
|
||||||
|
|
||||||
#endif /* not MACROTAB_H_ */
|
#endif /* not MACROTAB_H_ */
|
||||||
|
|||||||
@@ -129,8 +129,8 @@ struct obstack output_obstack;
|
|||||||
/* FIXME. */
|
/* FIXME. */
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
output_table_data (struct obstack* oout,
|
output_table_data (struct obstack *oout,
|
||||||
short* table_data,
|
short *table_data,
|
||||||
short first,
|
short first,
|
||||||
short begin,
|
short begin,
|
||||||
short end)
|
short end)
|
||||||
@@ -984,8 +984,8 @@ output_parser (void)
|
|||||||
else if ((c = getc (fskel)) == '%')
|
else if ((c = getc (fskel)) == '%')
|
||||||
{
|
{
|
||||||
/* Read the macro. */
|
/* Read the macro. */
|
||||||
const char* macro_key = 0;
|
const char *macro_key = 0;
|
||||||
const char* macro_value = 0;
|
const char *macro_value = 0;
|
||||||
while (isalnum (c = getc (fskel)) || c == '_')
|
while (isalnum (c = getc (fskel)) || c == '_')
|
||||||
obstack_1grow (¯o_obstack, c);
|
obstack_1grow (¯o_obstack, c);
|
||||||
obstack_1grow (¯o_obstack, 0);
|
obstack_1grow (¯o_obstack, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user