Commit Graph

1668 Commits

Author SHA1 Message Date
Paul Eggert
e95aed631d (main): Use return to exit, undoing yesterday's change.
The last OS that we could find where this wouldn't work is
SunOS 3.5, and that's too old to worry about now.
2002-10-23 07:00:19 +00:00
Paul Eggert
ffa4c58acb (struct yyltype): Define members even when not
doing locations.  This is more consistent with yacc.c, and it
works around the following bug reports:
http://mail.gnu.org/pipermail/bug-bison/2002-October/001748.html
http://mail.gnu.org/pipermail/bug-bison/2002-October/001764.html
http://mail.gnu.org/pipermail/bug-bison/2002-October/001769.html
2002-10-23 06:30:49 +00:00
Paul Eggert
c827f760f6 Minor spelling and typographical fixes. Use @acronym consistently.
Standardize on "Yacc" instead of "YACC", "Algol" instead of "ALGOL".
Give a bit more history about BNF.
2002-10-23 05:26:32 +00:00
Paul Eggert
6db10d14be Be consistent about 'bool'.
* src/complain.c (warning_issued): Renamed from warn_message_count; now bool.
(complaint_issued): Renamed from complain_message_count; likewise.

* src/main.c (main): Use exit to exit with failure.

* src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
rather than 1 and 0.
* src/main.c (main): Likewise.
* src/getargs.c (getargs): Likewise.
* src/reader.c (reader): Likewise.

* src/getarg.c (getargs): Remove duplicate code for
"Try `bison --help'".

* src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
What was that "2" for?

* src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
* src/getargs.c (usage): Likewise.

* src/getargs.c (getargs): When there are too few operands, report
the last one.  When there are too many, report the first extra
one.  This is how diffutils does it.
2002-10-23 03:59:56 +00:00
Akim Demaille
8b76775adb * data/README: New. 2002-10-22 11:32:38 +00:00
Akim Demaille
f0e48240c9 Update. 2002-10-22 11:19:45 +00:00
Akim Demaille
78bcec17c8 Regen. 2002-10-22 07:47:55 +00:00
Paul Eggert
ec88357a8c (fatal, fatal_at): Add __attribute__((__noreturn__)).
(warning_issued): Renamed from warn_message_count.  Now bool.
(complaint_issued): Renamed from complain_message_count.  Now bool.
2002-10-22 05:12:08 +00:00
Paul Eggert
5ca3209b44 (main): Use exit to exit with failure.
Use EXIT_FAILURE and EXIT_SUCCESS rather than 1 and 0.
2002-10-22 05:07:12 +00:00
Paul Eggert
0df27e8b2d (getargs): Use EXIT_FAILURE and EXIT_SUCCESS rather than 1 and 0.
Remove duplicate code for "Try `bison --help'".
(usage):  Add __attribute__((__noreturn__)).
2002-10-22 05:06:21 +00:00
Paul Eggert
901ec1537a (xfopen, xfclose): Use EXIT_FAILURE rathern than 2.
What was that "2" for?
2002-10-22 05:01:46 +00:00
Paul Eggert
0ae6073a18 (warning_issued): Renamed from warn_message_count,
so that we needn't worry about integer overflow (!).
Now of type bool.  All uses changed.
(complaint_issued): Renamed from complain_message_count; likewise.
(fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS rather than 1 and 0.
2002-10-22 04:53:49 +00:00
Paul Eggert
8307162d58 Use C99-style bool instead of our own style. 2002-10-22 04:46:28 +00:00
Paul Eggert
738c69de37 Use C99-style bool instead of our own style.
(comment change only)
2002-10-22 04:45:51 +00:00
Paul Eggert
b4afb6bbe5 Use C99-style bool instead of our own style.
(reader): Use EXIT_FAILURE and EXIT_SUCCESS rather than 1 and 0.
2002-10-22 04:43:50 +00:00
Paul Eggert
637c4b283c se C99-style bool instead of our own style. 2002-10-22 04:41:25 +00:00
Paul Eggert
78b8881659 (bool, false, true): Use a definition consistent with ../lib/hash.c. 2002-10-22 04:40:09 +00:00
Paul Eggert
a3714bcedf (hash_compare_symbol_t): (a ? FALSE : TRUE) -> (! a) 2002-10-22 04:39:44 +00:00
Paul Eggert
5dd5fd4a56 (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a) 2002-10-22 04:39:05 +00:00
Paul Eggert
fece5986bf (EXTRA_DIST): Add stdbool.m4. 2002-10-22 04:38:11 +00:00
Paul Eggert
8d60a570d5 (AC_HEADER_STDBOOL): Add. 2002-10-22 04:37:50 +00:00
Paul Eggert
a7e92301ef New file, from coreutils 4.5.3. 2002-10-22 04:36:31 +00:00
Paul Eggert
a4b6efd473 (getargs): When there are too few operands, report the last one. When
there are too many, report the first extra one.  This is how diffutils
does it.
2002-10-21 18:15:13 +00:00
Paul Eggert
92a060fd6a Remove K&R vestiges.
* configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
* src/complain.c (VA_START): Remove.  Assume prototypes.
(vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
(private_strerror, warn_at, warn, complain_at, complain, fatal_at,
fatal): Assume prototypes.
* src/complain.h: Assume prototypes.
* src/system.h (PARAMS): Remove.
Include <limits.h> unconditionally, since it's guaranteeed even
for a freestanding C89 compiler.
(SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
* src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
2002-10-21 05:31:34 +00:00
Paul Eggert
d33cb3ae09 Remove all uses of PARAMS, since we now assume C89 or better. 2002-10-21 05:30:50 +00:00
Paul Eggert
b8452344de (getargs, cli_present, cli_get_value): Prototype. 2002-10-21 05:29:50 +00:00
Paul Eggert
930393cf02 (PARAMS): Remove.
Include <limits.h> unconditionally, since it's guaranteeed even
for a freestanding C89 compiler.
(SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
2002-10-21 05:29:07 +00:00
Paul Eggert
49f801e6fe Assume prototypes. 2002-10-21 05:28:34 +00:00
Paul Eggert
2118414023 (VA_START): Remove. Assume prototypes.
(vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
(private_strerror, warn_at, warn, complain_at, complain, fatal_at,
fatal): Assume prototypes.
2002-10-21 05:28:16 +00:00
Paul Eggert
87004b05f7 (AC_C_CONST, AM_C_PROTOTYPES): Remove. 2002-10-21 05:27:45 +00:00
Akim Demaille
e7cb57c0b8 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
* data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
(yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
(yyresolveStates, yyresolveAction, yyresolveStack)
(yyprocessOneStack): Use them.
(yy_reduce_print): New.
* tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
2002-10-20 16:09:47 +00:00
Akim Demaille
0245f82d31 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
arguments and output `void'.
(b4_c_function): Rename as...
(b4_c_function_def): this.
(b4_c_function_decl, b4_c_ansi_function_def)
(b4_c_ansi_function_decl): New.
Change the interpretation of the arguments: before `int, foo', now
`int foo, foo'.
* data/yacc.c (yyparse): Prototype and define thanks to these.
Adjust b4_c_function_def uses.
* data/glr.c (yyparse): Likewise, but ANSI only.
2002-10-20 12:51:10 +00:00
Akim Demaille
39912f5263 * src/output.c (prepare): Move the definition of `tokens_number',
`nterms_number', `undef_token_number', `user_token_number_max'
to...
(prepare_tokens): Here.
(prepare_tokens): Rename as...
(prepare_symbols): this.
(prepare): Move the definition of `rules_number' to...
(prepare_rules): here.
(prepare): Move the definition of `last', `final_state_number',
`states_number' to...
(prepare_states): here.
* data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
2002-10-20 11:20:15 +00:00
Akim Demaille
20c1e2ad98 * src/tables.h, src/tables.c, src/output.c: Comment changes. 2002-10-20 11:18:14 +00:00
Akim Demaille
21964f4394 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
* data/c.m4: here.
2002-10-20 11:17:20 +00:00
Akim Demaille
66d30cd4eb * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
* src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
`pair'.
(muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
`name' to...
* data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
(b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
These.
2002-10-20 11:16:01 +00:00
Paul Eggert
95f2c9fe7d Do not create a temporary file, as that involves security and
cleanup headaches.  Instead, use a pair of pipes.
Derived from a suggestion by Florian Krohm.

Also, some other minor changes to avoid GCC warnings.
2002-10-20 06:37:08 +00:00
Paul Eggert
975553805c Do not create a temporary file, as that involves security and
cleanup headaches.  Instead, use a pair of pipes.  Derived from
a suggestion by Florian Krohm.
2002-10-20 06:35:41 +00:00
Paul Eggert
2cdb2a7b05 (readpipe): Remove decl.
(scan_skel): New function, to be used in place of m4_invoke.
Read from stream rather than file.
2002-10-20 06:32:04 +00:00
Paul Eggert
573312acb6 Include "subpipe.h".
(m4_invoke): Remove decl.
(scan_skel): New decl.
(output_skeleton): Use pipe rather than temporary file for m4 input.
Check that m4sugar.m4 is readable, to avoid deadlock.
Check for pipe I/O error.
2002-10-20 06:31:23 +00:00
Paul Eggert
f7aed66054 Add lib/subpipe.c. 2002-10-20 06:30:43 +00:00
Paul Eggert
82f9f11f39 (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4. 2002-10-20 06:30:15 +00:00
Paul Eggert
6d55632cb7 (libbison_a_SOURCES): Remove readpipe.c.
Add subpipe.h, subpipe.c.
2002-10-20 06:29:41 +00:00
Paul Eggert
2593afab81 (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
(BISON_PREREQ_SUBPIPE): Add.
2002-10-20 06:29:09 +00:00
Paul Eggert
5b2d69cc5b Initial version. 2002-10-20 06:28:23 +00:00
Paul Eggert
bb33f19a4b (prepare): Use xstrdup to convert char const * to char *, to avoid GCC
warning.
2002-10-20 06:01:07 +00:00
Paul Eggert
d9d363b172 (muscle_pair_list_grow): Rename local to avoid confusion with
similarly-named more-global.
2002-10-20 05:47:09 +00:00
Paul Eggert
9e2c5ef112 (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
float, as this generates a warning on Solaris 8 + GCC 3.2 with
--enable-gcc-warnings.  Instead, divide into 1.0 rather than 1;
this generates a more-accurate value anyway.
(timervar_accumulate): Rename local variables to avoid confusion
with similarly-named global 'start_time'.
2002-10-20 05:34:55 +00:00
Paul Eggert
55b929cab2 Spell -*- Autoconf -*-' properly; the leading -' was missing. 2002-10-20 05:23:11 +00:00
Akim Demaille
c19988b766 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
Use them to have `calc.y' ready for %pure-parser.
* data/yacc.c (YYLEX): Pass a yylex return type to
b4_c_function_call.
2002-10-19 14:39:07 +00:00