mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 12:53:03 +00:00
* src/system.h: Include `xalloc.h'.
Remove it from the C files. * src/files.c (output_files): Free the obstacks. * src/lex.c (init_lex): Rename as... (lex_init): this. (lex_free): New. * src/main.c (main): Use it.
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
||||
2001-09-25 Akim Demaille <akim@epita.fr>
|
||||
|
||||
* src/system.h: Include `xalloc.h'.
|
||||
Remove it from the C files.
|
||||
* src/files.c (output_files): Free the obstacks.
|
||||
* src/lex.c (init_lex): Rename as...
|
||||
(lex_init): this.
|
||||
(lex_free): New.
|
||||
* src/main.c (main): Use it.
|
||||
|
||||
2001-09-24 Marc Autret <autret_m@epita.fr>
|
||||
|
||||
* src/vcg.c (open_edge, close_edge, open_node, close_node): Change
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
The entry point is generate_states. */
|
||||
|
||||
#include "system.h"
|
||||
#include "xalloc.h"
|
||||
#include "gram.h"
|
||||
#include "state.h"
|
||||
#include "complain.h"
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
02111-1307, USA. */
|
||||
|
||||
#include "system.h"
|
||||
#include "xalloc.h"
|
||||
#include "gram.h"
|
||||
#include "closure.h"
|
||||
#include "derives.h"
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "system.h"
|
||||
#include "getargs.h"
|
||||
#include "xalloc.h"
|
||||
#include "files.h"
|
||||
#include "gram.h"
|
||||
#include "state.h"
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include "xalloc.h"
|
||||
#include "types.h"
|
||||
#include "gram.h"
|
||||
#include "derives.h"
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "system.h"
|
||||
#include "getargs.h"
|
||||
#include "files.h"
|
||||
#include "xalloc.h"
|
||||
#include "gram.h"
|
||||
#include "complain.h"
|
||||
|
||||
@@ -467,14 +466,17 @@ output_files (void)
|
||||
obstack_save (&table_obstack, spec_outfile);
|
||||
else
|
||||
obstack_save (&table_obstack, stringappend (base_name, src_extension));
|
||||
obstack_free (&table_obstack, NULL);
|
||||
|
||||
/* Output the header file if wanted. */
|
||||
if (defines_flag)
|
||||
defines_obstack_save (spec_defines_file);
|
||||
obstack_free (&defines_obstack, NULL);
|
||||
|
||||
/* If we output only the table, dump the actions in ACTFILE. */
|
||||
if (no_parser_flag)
|
||||
obstack_save (&action_obstack, stringappend (short_base_name, ".act"));
|
||||
obstack_free (&action_obstack, NULL);
|
||||
|
||||
/* If we produced a semantic parser ATTRS_OBSTACK must be dumped
|
||||
into its own file, ATTTRSFILE. */
|
||||
@@ -483,10 +485,12 @@ output_files (void)
|
||||
char *temp_name;
|
||||
|
||||
obstack_save (&attrs_obstack, attrsfile);
|
||||
obstack_free (&attrs_obstack, NULL);
|
||||
temp_name = stringappend (short_base_name, EXT_GUARD_C);
|
||||
#ifndef MSDOS
|
||||
temp_name = stringappend (temp_name, src_extension);
|
||||
#endif /* MSDOS */
|
||||
obstack_save (&guard_obstack, temp_name);
|
||||
obstack_free (&guard_obstack, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "system.h"
|
||||
#include "types.h"
|
||||
#include "LR0.h"
|
||||
#include "xalloc.h"
|
||||
#include "gram.h"
|
||||
#include "complain.h"
|
||||
#include "lalr.h"
|
||||
|
||||
10
src/lex.c
10
src/lex.c
@@ -24,7 +24,6 @@
|
||||
#include "getopt.h" /* for optarg */
|
||||
#include "symtab.h"
|
||||
#include "lex.h"
|
||||
#include "xalloc.h"
|
||||
#include "complain.h"
|
||||
#include "gram.h"
|
||||
#include "quote.h"
|
||||
@@ -43,13 +42,20 @@ static bucket *unlexed_symval = NULL;
|
||||
|
||||
|
||||
void
|
||||
init_lex (void)
|
||||
lex_init (void)
|
||||
{
|
||||
obstack_init (&token_obstack);
|
||||
unlexed = tok_undef;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
lex_free (void)
|
||||
{
|
||||
obstack_free (&token_obstack, NULL);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
skip_white_space (void)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,8 @@ extern const char *token_buffer;
|
||||
extern bucket *symval;
|
||||
extern int numval;
|
||||
|
||||
void init_lex PARAMS ((void));
|
||||
void lex_init PARAMS ((void));
|
||||
void lex_free PARAMS ((void));
|
||||
int skip_white_space PARAMS ((void));
|
||||
void unlex PARAMS ((int));
|
||||
void read_type_name PARAMS ((FILE *fin));
|
||||
|
||||
@@ -102,6 +102,8 @@ main (int argc, char *argv[])
|
||||
/* Free the symbol table data structure. */
|
||||
free_symtab ();
|
||||
|
||||
lex_free ();
|
||||
|
||||
/* Close the input files. */
|
||||
close_files ();
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "system.h"
|
||||
#include "types.h"
|
||||
#include "gram.h"
|
||||
#include "xalloc.h"
|
||||
#include "nullable.h"
|
||||
|
||||
char *nullable = NULL;
|
||||
|
||||
@@ -94,7 +94,6 @@
|
||||
#include "obstack.h"
|
||||
#include "quotearg.h"
|
||||
#include "getargs.h"
|
||||
#include "xalloc.h"
|
||||
#include "files.h"
|
||||
#include "gram.h"
|
||||
#include "LR0.h"
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
|
||||
#include "system.h"
|
||||
#include "xalloc.h"
|
||||
#include "files.h"
|
||||
#include "gram.h"
|
||||
#include "LR0.h"
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "system.h"
|
||||
#include "xalloc.h"
|
||||
#include "files.h"
|
||||
#include "gram.h"
|
||||
#include "LR0.h"
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "quote.h"
|
||||
#include "getargs.h"
|
||||
#include "files.h"
|
||||
#include "xalloc.h"
|
||||
#include "symtab.h"
|
||||
#include "lex.h"
|
||||
#include "gram.h"
|
||||
@@ -1912,7 +1911,7 @@ reader (void)
|
||||
|
||||
grammar = NULL;
|
||||
|
||||
init_lex ();
|
||||
lex_init ();
|
||||
lineno = 1;
|
||||
|
||||
/* Initialize the symbol table. */
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "getargs.h"
|
||||
#include "files.h"
|
||||
#include "gram.h"
|
||||
#include "xalloc.h"
|
||||
#include "complain.h"
|
||||
#include "reduce.h"
|
||||
#include "reader.h"
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
|
||||
#include "system.h"
|
||||
#include "xalloc.h"
|
||||
#include "symtab.h"
|
||||
#include "gram.h"
|
||||
|
||||
|
||||
10
src/system.h
10
src/system.h
@@ -73,7 +73,7 @@ extern int errno;
|
||||
# define PARAMS(p) ()
|
||||
#endif
|
||||
|
||||
|
||||
# include "xalloc.h"
|
||||
|
||||
/*---------------------.
|
||||
| Missing prototypes. |
|
||||
@@ -159,9 +159,9 @@ typedef int bool;
|
||||
| Obstacks. |
|
||||
`-----------*/
|
||||
|
||||
#define obstack_chunk_alloc xmalloc
|
||||
#define obstack_chunk_free free
|
||||
#include "obstack.h"
|
||||
# define obstack_chunk_alloc xmalloc
|
||||
# define obstack_chunk_free free
|
||||
# include "obstack.h"
|
||||
|
||||
#define obstack_sgrow(Obs, Str) \
|
||||
obstack_grow (Obs, Str, strlen (Str))
|
||||
@@ -271,8 +271,6 @@ do { \
|
||||
# if WITH_DMALLOC
|
||||
# define DMALLOC_FUNC_CHECK
|
||||
# include <dmalloc.h>
|
||||
|
||||
# endif /* WITH_DMALLOC */
|
||||
|
||||
|
||||
#endif /* BISON_SYSTEM_H */
|
||||
|
||||
Reference in New Issue
Block a user