Commit Graph

1468 Commits

Author SHA1 Message Date
Akim Demaille
ae7453f2ba Prototype support of %lex-param and %parse-param.
* src/parse-gram.y: Add the definition of the %lex-param and
%parse-param tokens, plus their rules.
Drop the `_' version of %glr-parser.
Add the "," token.
* src/scan-gram.l (INITIAL): Scan them.
* src/muscle_tab.c: Comment changes.
(muscle_insert, muscle_find): Rename `pair' as `probe'.
* src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
(muscle_entry_s): The `value' member is no longer const.
Adjust all dependencies.
* src/muscle_tab.c (muscle_init): Adjust: use
MUSCLE_INSERT_STRING.
Initialize the obstack earlier.
* src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
(muscle_pair_list_grow): New.
* data/c.m4 (b4_c_function_call, b4_c_args): New.
* data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
* tests/calc.at: Use %locations, not --locations.
(AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
2002-10-19 14:38:06 +00:00
Akim Demaille
0e57572183 * src/getargs.c (usage): Take status as argument and exit
accordingly.
Report the traditional `Try ... --help' message when status != 0.
(usage, version): Don't take a FILE * as arg, it is pointless.
(getargs): When there is an incorrect number of arguments, make it
an error, and report it GNUlically thanks to `usage ()'.
2002-10-19 14:36:40 +00:00
Paul Eggert
3a781eb26b * data/glr.c (yyreportParseError): Don't assume that sprintf
yields the length of the printed string, as this is not true
on SunOS 4.1.4.  Reported by Peter Klein.
2002-10-19 01:33:39 +00:00
Paul Eggert
3eb4916379 (yyreportParseError): Don't assume that sprintf
yields the length of the printed string, as this is not true
on SunOS 4.1.4.  Reported by Peter Klein.
2002-10-19 01:33:20 +00:00
Paul Eggert
724ce7f524 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
* tests/conflicts.at (%nonassoc and eof): Likewise.
Fixes SunOS 4.1.4 test failure reported by Peter Klein.
2002-10-19 01:10:26 +00:00
Paul Eggert
ac5dd84c25 (%nonassoc and eof): #undef memcmp and realloc. 2002-10-19 01:09:36 +00:00
Paul Eggert
d968424300 (_AT_DATA_CALC_Y): #undef memcmp and realloc. 2002-10-19 01:09:13 +00:00
Akim Demaille
473d0a7567 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
* src/getargs.c (trace_types, trace_args): Adjust.
* src/reader.c (grammar_current_rule_prec_set)
(grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
Standardize error messages.
And s/@prec/%prec/!
(reader): Use trace_flag to enable scanner/parser debugging,
instead of an adhoc scheme.
* src/scan-gram.l: Remove trailing debugging code.
2002-10-17 17:47:33 +00:00
Paul Eggert
93e2236a6d * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as MUSCLE_TAB_H. 2002-10-17 06:31:51 +00:00
Paul Eggert
f7737e2e16 (MUSCLE_TAB_H_): Was misspelled as MUSCLE_TAB_H_. 2002-10-17 06:27:41 +00:00
Paul Eggert
e76d2469e5 * NEWS: Officially drop support for building Bison with K&R C,
since it didn't work anyway and it's not worth worrying about.
* Makefile.maint (wget_files): Remove ansi2knr.c.
(ansi2knr.c-url_prefix): Remove.
* lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
* lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
* src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2002-10-17 01:29:58 +00:00
Paul Eggert
24c7b92b25 (AUTOMAKE_OPTIONS): Remove. 2002-10-17 01:29:01 +00:00
Paul Eggert
dddb8b6121 Remove ansi2knr, ansi2knr.*. 2002-10-17 01:26:33 +00:00
Paul Eggert
71d1d25c7a Officially drop support for building Bison with K&R C,
since it didn't work anyway and it's not worth worrying about.
2002-10-17 01:24:46 +00:00
Paul Eggert
da2292e5c7 (wget_files): Remove ansi2knr.c.
(ansi2knr.c-url_prefix): Remove.
2002-10-17 00:14:32 +00:00
Akim Demaille
b37e55423b Bump to 1.75a. 2002-10-16 06:32:07 +00:00
Paul Eggert
5bd1c41900 Stop using the "enum_" trick for K&R-style function definitions;
it confused me, and I was the author!  Instead, assume that people
who want to use K&R C compilers (when using these modules in GCC,
perhaps?) will run ansi2knr.
2002-10-16 06:29:12 +00:00
Paul Eggert
829f74d293 (enum_lbitset_find_mode): Remove. All uses of "enum_" changed to "enum ".
(debug_lbitset, lbitset_and, lbitset_and_cmp, lbitset_andn,
lbitset_andn_cmp, lbitset_bytes, lbitset_copy, lbitset_copy_cmp,
lbitset_disjoint_p, lbitset_elt_alloc, lbitset_elt_calloc,
lbitset_elt_find, lbitset_elt_free, lbitset_elt_link,
lbitset_elt_unlink, lbitset_elt_zero_p, lbitset_empty_p,
lbitset_equal_p, lbitset_free, lbitset_init, lbitset_list,
lbitset_list_reverse, lbitset_not, lbitset_ones, lbitset_op3_cmp,
lbitset_or, lbitset_or_cmp, lbitset_prune, lbitset_release_memory,
lbitset_reset, lbitset_set, lbitset_size, lbitset_subset_p,
lbitset_test, lbitset_weed, lbitset_xor, lbitset_xor_cmp,
lbitset_zero): Use function prototypes; this removes the need for
declaring static functions simply to provide their prototypes.
2002-10-16 06:27:59 +00:00
Paul Eggert
75f10004fe (enum_ebitset_find_mode): Remove. All uses of "enum_" changed to "enum ".
(ebitset_and, ebitset_and_cmp, ebitset_andn, ebitset_andn_cmp,
ebitset_bytes, ebitset_copy, ebitset_copy_, ebitset_copy_cmp,
ebitset_disjoint_p, ebitset_elt_add, ebitset_elt_alloc,
ebitset_elt_calloc, ebitset_elt_find, ebitset_elt_free,
ebitset_elt_last, ebitset_elt_remove, ebitset_elt_zero_p,
ebitset_elts_grow, ebitset_empty_p, ebitset_equal_p, ebitset_free,
ebitset_init, ebitset_list, ebitset_list_reverse, ebitset_not,
ebitset_ones, ebitset_op3_cmp, ebitset_or, ebitset_or_cmp,
ebitset_release_memory, ebitset_reset, ebitset_set, ebitset_size,
ebitset_subset_p, ebitset_test, ebitset_weed, ebitset_xor,
ebitset_xor_cmp, ebitset_zero): Use function prototypes; this removes
the need for declaring static functions simply to provide their
prototypes.
2002-10-16 06:26:31 +00:00
Paul Eggert
24f4e18b77 (bitsetv_alloc): enum_bitset_type -> enum bitset_type 2002-10-16 06:24:26 +00:00
Paul Eggert
a182371d69 (bitsetv_alloc, bitsetv_create, bitsetv_free, bitsetv_zero,
bitsetv_ones, bitsetv_transitive_closure, bitsetv_dump,
debug_bitsetv): Use function prototypes; this removes the need for
declaring static functions simply to provide their prototypes.
2002-10-16 06:23:21 +00:00
Paul Eggert
bba392ec8a (bitset_stats_init): enum_bitset_type -> enum bitset_type. 2002-10-16 06:22:04 +00:00
Paul Eggert
d65ec44e3b (bitset_log_histogram_print, bitset_percent_histogram_print,
bitset_stats_and, bitset_stats_and_cmp, bitset_stats_and_or,
bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
bitset_stats_zero): Use function prototypes; this removes the need for
declaring static functions simply to provide their prototypes.
2002-10-16 06:20:44 +00:00
Paul Eggert
04af9e5267 (bitset_set, bitset_reset, bitset_test): Use function prototypes; this
removes the need for declaring static functions simply to provide
their prototypes.
2002-10-16 06:19:22 +00:00
Paul Eggert
447e90bcef (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_, bitset_andn_or_,
bitset_andn_or_cmp_, bitset_bytes, bitset_copy_, bitset_count_,
bitset_create, bitset_dump, bitset_first, bitset_free, bitset_init,
bitset_last, bitset_next, bitset_obstack_alloc, bitset_obstack_free,
bitset_only_set_p, bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_,
bitset_prev, bitset_print, bitset_release_memory, bitset_toggle_,
bitset_type_choose, bitset_type_get, bitset_type_name_get,
debug_bitset): Use function prototypes; this removes the need for
declaring static functions simply to provide their prototypes.
2002-10-16 06:18:00 +00:00
Paul Eggert
59fc3dcdf4 (enum_bitset_ops, enum_bitset_type): Remove.
All uses of "enum_" changed to "enum ".
2002-10-16 06:16:29 +00:00
Paul Eggert
a911db9cba (abitset_and, abitset_and_cmp, abitset_and_or,
abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
abitset_copy1, abitset_disjoint_p, abitset_empty_p,
abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
abitset_not, abitset_ones, abitset_or, abitset_or_and,
abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
Use function prototypes; this removes the need for declaring
static functions simply to provide their prototypes.
2002-10-16 06:15:02 +00:00
Akim Demaille
1a9bf9b959 . 2002-10-14 18:15:05 +00:00
Akim Demaille
ae26e1f02a Version 1.75. 2002-10-14 16:29:41 +00:00
Akim Demaille
d43baf71a7 * tests/Makefile.am (maintainer-check-posix): New. 2002-10-14 15:09:15 +00:00
Akim Demaille
7ebc83e34d * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
member.
2002-10-14 13:00:48 +00:00
Akim Demaille
b0a7a533c9 Regen. 2002-10-14 12:49:24 +00:00
Akim Demaille
d90c934c05 Update. 2002-10-14 12:32:48 +00:00
Akim Demaille
05846dae07 * src/tables.c (table_ninf_remap): base -> tab.
Reported by Matt Rosing.
2002-10-14 11:38:21 +00:00
Paul Eggert
447fbb178d * tests/action.at, tests/calc.at, tests/conflicts.at,
tests/cxx-type.at, tests/headers.at, tests/input.at,
tests/regression.at, tests/synclines.at, tests/torture.at:
Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
so that the tests still work even if POSIXLY_CORRECT is set.
* doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
2002-10-14 08:44:02 +00:00
Paul Eggert
b56471a689 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
so that the commands still work even if POSIXLY_CORRECT is set.
2002-10-14 08:43:36 +00:00
Paul Eggert
1318e37d58 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
for portability to K&R hosts.  Fix typo: signed char is guaranteed
only to 127, not to 128.
* data/glr.c (yysigned_char): New type.
* data/yacc.c (yysigned_char): Likewise.
* tests/regression.at (Web2c Actions): signed char -> yysigned_char.
2002-10-14 08:07:01 +00:00
Paul Eggert
22a00a0cd2 (b4_int_type): Use yysigned_char instead of signed char,
for portability to K&R hosts.  Fix typo: signed char is guaranteed
only to 127, not to 128.
2002-10-14 08:06:33 +00:00
Paul Eggert
768eb43fe8 (yysigned_char): New type. 2002-10-14 08:06:06 +00:00
Paul Eggert
7c78fa1885 (Web2c Actions): signed char -> yysigned_char. 2002-10-14 08:05:20 +00:00
Paul Eggert
5038f418c1 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
true due to limited range of data type" warning from GCC.
2002-10-14 06:55:10 +00:00
Paul Eggert
e5cfd9d8af (yyparse): Rewrite to avoid "comparison is always true due to limited
range of data type" warning from GCC in synclines.at test.
2002-10-14 06:54:41 +00:00
Paul Eggert
cc0f0794b8 * data/c.m4 (b4_token_defines): Protect against double-inclusion
by wrapping enum yytokentype's definition inside #ifndef
YYTOKENTYPE.  This undoes a bug I introduced on 2002-10-12.
2002-10-13 20:36:45 +00:00
Paul Eggert
6b8c325436 (b4_token_defines): Protect against double-inclusion
by wrapping enum yytokentype's definition inside #ifndef
YYTOKENTYPE.  This undoes a bug I introduced on 2002-10-12.
2002-10-13 20:35:06 +00:00
Akim Demaille
6fed0802ee * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
Un yy- yyrhs to avoid the name clash with the global YYRHS.
2002-10-13 19:40:30 +00:00
Akim Demaille
32f0598d06 * Makefile.maint: Update from Autoconf 2.54.
* m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
2002-10-13 19:39:29 +00:00
Akim Demaille
7ea9a33f3b * src/print.c (print_state): Separate the list of solved conflicts
from the other items.
* tests/conflicts.at (Resolved SR Conflicts): Adjust.
2002-10-13 19:35:59 +00:00
Akim Demaille
ea99527d23 Let nondeterministic skeletons be usable with deterministic
tables.
With the patch, GAWK compiled by GCC without -O2 passes its test
suite using a GLR parser driven by LALR tables.  It fails with -O2
because `struct stat' gives two different answers on my machine:
88 (definition of an auto var) and later 96 (memset on this var).
Hence the stack is badly corrumpted.  The headers inclusion is to
blame: if I move the awk.h inclusion before GLR's system header
inclusion, the two struct stat have the same size.
* src/tables.c (pack_table): Always create conflict_table.
(token_actions): Always create conflict_list.
* data/glr.c (YYFLAG): Remove, unused.
2002-10-13 18:50:40 +00:00
Akim Demaille
f377f69fec * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
(O0FLAGS): New.
(VALGRIND, GXX): New.
* tests/atlocal.in (CFLAGS): Use O0FLAGS.
* tests/bison.in: Run $PREBISON a pre-command.
* tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
(maintainer-check-g++): New.
* Makefile.am (maintainer-check): New.
2002-10-13 18:49:44 +00:00
Akim Demaille
2a1fe6ed6f * data/glr.c: Formatting changes.
Tweak some trace messages to match yacc.c's.
2002-10-13 14:25:55 +00:00