Commit Graph

822 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
f7737e2e16 (MUSCLE_TAB_H_): Was misspelled as MUSCLE_TAB_H_. 2002-10-17 06:27:41 +00:00
Paul Eggert
24c7b92b25 (AUTOMAKE_OPTIONS): Remove. 2002-10-17 01:29:01 +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
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
Paul Eggert
3b7d4eb2cd Regenerate. 2002-10-13 09:09:49 +00:00
Paul Eggert
efcb44dd47 (rule_length): New static var.
Use it to keep track of the rule length in the scanner, since
we can't expect the parser to be in lock-step sync with the scanner.
(handle_action_dollar, handle_action_at): Use this var.
2002-10-13 08:38:39 +00:00
Paul Eggert
3f4c0f8017 (grammar_current_rule_check):
Don't worry about the default action if $$ is untyped.
Prevents bogus warnings reported by Jim Gifford in
<http://mail.gnu.org/pipermail/bug-bison/2002-October/001673.html>.
2002-10-13 03:52:53 +00:00
Akim Demaille
eb71459201 * tests/regression.at Characters Escapes): New.
* src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept ' in strings and
characters.
Reported by Jan Nieuwenhuizen.
2002-10-11 11:23:19 +00:00
Paul Eggert
242a6e484e (reader): SHRT_MAX -> SYMBOL_NUMBER_MAX. 2002-10-05 05:47:51 +00:00
Paul Eggert
01eb033cf5 (SYMBOL_NUMBER_MAX): New macro. 2002-10-05 05:47:14 +00:00
Paul Eggert
1c303b00fe (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX. 2002-10-05 05:46:42 +00:00
Paul Eggert
f704e33362 (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN. 2002-10-05 05:46:08 +00:00
Paul Eggert
9abb46d527 (AM_CFLAGS): Renamed from CFLAGS.
(AM_YFLAGS): Renamed from YFLAGS.
2002-10-05 04:54:54 +00:00
Akim Demaille
a75649b395 Remove. 2002-09-27 14:50:35 +00:00
Akim Demaille
b906441c95 Playing with autoscan.
* src/reader.c (get_merge_function): Use xstrdup, not strdup.
* src/files.c (skeleton_find): Remove, unused.
* m4/memcmp.m4: New, from the Coreutils 4.5.1.
* m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
2002-09-13 16:12:21 +00:00
Akim Demaille
3d38c03a86 * src/parse-gram.y: Associate a human readable string to each
token type.
* tests/regression.at (Invalid inputs): Adjust.
2002-09-10 13:52:33 +00:00
Akim Demaille
427c0dda0c * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
* src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
translate maintainer only messages.
2002-09-04 10:18:15 +00:00
Akim Demaille
3f8237696f Typo. 2002-09-04 10:07:33 +00:00
Akim Demaille
9503bbd27d Regen. 2002-09-04 09:58:12 +00:00
Paul Eggert
04b6e11ebb Regenerate. 2002-08-12 15:25:59 +00:00
Paul Eggert
63400d5d02 (table_grow, pack_vector): Wrap strings in _() if
they need translation.
2002-08-12 14:55:23 +00:00
Paul Eggert
04c5cba268 (alloca): Use same pattern as ../lib/error.c.
Do not include <ctype.h>; no longer needed.
Do not include <malloc.h>; no longer needed (and generates
warnings on OpenBSD 3.0).
2002-08-12 14:54:27 +00:00
Paul Eggert
d7163c0a58 (symbol_get): Don't cast LHS of an assignment;
this is a GCC extension and is not portable to other compilers.
2002-08-12 14:53:26 +00:00
Paul Eggert
db2cc12fd0 Wrap strings in _() if they need translation.
Use strings rather than escapes when possible,
to minimize the number of warnings from xgettext.

(handle_action_dollar, handle_action_at): Don't use isdigit,
as it mishandles negative chars and it may not work as expected
outside the C locale.
2002-08-12 14:52:47 +00:00
Paul Eggert
7e78575709 (relation_transpose): Wrap strings in _() if they need translation. 2002-08-12 14:50:38 +00:00
Paul Eggert
f9a85a156a Fix spelling in comment. 2002-08-12 14:49:45 +00:00