Let --trace have arguments.

* src/getargs.h (enum trace_e): New.
* src/getargs.c (trace_args, trace_types, trace_argmatch): New.
(long_options, short_options): --trace/-T takes an optional
argument.
Change all the uses of trace_flag to reflect the new flags.
* tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
Strengthen `stage' portability.
* m4/stage.m4 (BISON_PREREQ_STAGE): New.
* configure.in: Use it.
Don't check for malloc.h and sys/times.h.
* src/system.h: Include them when appropriate.
* src/main.c (stage): Compile only when mallinfo, struct mallinfo,
times and struct tms are available.
This commit is contained in:
Akim Demaille
2002-07-31 19:49:52 +00:00
parent 2ed0e35f86
commit 273a74fa89
20 changed files with 338 additions and 55 deletions

View File

@@ -183,10 +183,10 @@ static unsigned int *conflict_list = NULL;
static int conflict_list_cnt;
static int conflict_list_free;
/* TABLE_SIZE is the allocated size of both TABLE and CHECK.
We start with the original hard-coded value: SHRT_MAX
(yes, not USHRT_MAX). */
static size_t table_size = SHRT_MAX;
/* TABLE_SIZE is the allocated size of both TABLE and CHECK. We start
with more or less the original hard-coded value (which was
SHRT_MAX). */
static size_t table_size = 32768;
static base_t *table = NULL;
static base_t *check = NULL;
/* The value used in TABLE to denote explicit parse errors
@@ -216,7 +216,7 @@ table_grow (size_t desired)
while (table_size <= desired)
table_size *= 2;
if (trace_flag)
if (trace_flag & trace_resource)
fprintf (stderr, "growing table and check from: %d to %d\n",
old_size, table_size);
@@ -1381,7 +1381,7 @@ output_skeleton (void)
m4_invoke (tempfile);
/* If `debugging', keep this file alive. */
if (!trace_flag)
if (!(trace_flag & trace_tools))
unlink (tempfile);
free (tempfile);