]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
(Type Clashes): Adjust to diagnostic changes.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-11-03 Akim Demaille <akim@epita.fr>
2
3 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
4 New.
5 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
6 (b4_parse_param): Remove.
7 Use b4_identification.
8 Propagate b4_pure_args where needed to pass them to yyerror.
9 * data/glr.m4 (b4_parse_param): Remove.
10 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11 (b4_lpure_formals): New.
12 Use b4_identification.
13 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14 b4_user_formals and b4_user_args.
15 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
16 (yyreportAmbiguity): When using a pure parser, also need
17 the location, and the parse-params.
18 Adjust callers.
19 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
20 When using a pure parser, also need the parse-params.
21 Adjust callers.
22 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
23 (%pure-parser + %parse-param) LALR and GLR parsers.
24 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
25 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
26 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
27 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
28 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
29 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
30 * doc/bison.texinfo: Untabify the whole file.
31 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
32 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
33 (Error Reporting): Adjust to these new directives.
34 Document %error-verbose, deprecate YYERROR_VERBOSE.
35
362002-11-03 Akim Demaille <akim@epita.fr>
37
38 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
39 AT_CHECK_CALC_GLR invocations to use % directives, instead of
40 command line options.
41 * tests/cxx-type.at: Formatting changes.
42
432002-11-03 Paul Eggert <eggert@twinsun.com>
44
45 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
46 to count columns correctly, and to check for invalid inputs.
47
48 Use mbsnwidth to count columns correctly. Account for tabs, too.
49 Include mbswidth.h.
50 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
51 (extend_location): New function.
52 (YY_LINES): Remove.
53
54 Handle CRLF in C code rather than in Lex code.
55 (YY_INPUT): New macro.
56 (no_cr_read): New function.
57
58 Scan UCNs, even though we don't fully handle them yet.
59 (convert_ucn_to_byte): New function.
60
61 Handle backslash-newline correctly in C code.
62 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
63 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
64 all uses changed.
65 (tag, splice): New EREs. Do not allow NUL or newline in tags.
66 Use {splice} wherever C allows backslash-newline.
67 YY_STEP after space, newline, vertical-tab.
68 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
69
70 (letter, id): Don't assume ASCII; e.g., spell out a-z.
71
72 ({int}, handle_action_dollar, handle_action_at): Check for integer
73 overflow.
74
75 (YY_STEP): Omit trailing semicolon, so that it's more like C.
76
77 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
78 as well as \000. Check for UCHAR_MAX, not 255.
79 Allow \x with an arbitrary positive number of digits, as in C.
80 Check for overflow here.
81 Allow \? and UCNs, for compatibility with C.
82
83 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
84 with quote slot used by complain_at.
85
86 * tests/input.at: Add tests for backslash-newline, m4 quotes
87 in symbols, long literals, and funny escapes in strings.
88
89 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
90 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
91 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
92 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
93 * m4/mbswidth.m4: New file, from GNU coreutils.
94
95 * doc/bison.texinfo (Grammar Outline): Document // comments.
96 (Symbols): Document that trigraphs have no special meaning in Bison,
97 nor is backslash-newline allowed.
98 (Actions): Document that trigraphs have no special meaning.
99
100 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
101 no longer used.
102
1032002-11-02 Paul Eggert <eggert@twinsun.com>
104
105 * src/reader.c: Don't include quote.h; not needed.
106 (get_merge_function): Reword warning to be consistent with
107 type clash diagnostic in grammar_current_rule_check.
108
109 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
110 bug in trigraph handling.
111
112 * src/output.c (prepare_symbols): When printing token names,
113 escape "[" as "@<:@" and likewise for "]".
114
115 * src/system.h (errno): Remove declaration, as we are now
116 assuming C89 or better, and C89 guarantees errno.
117
1182002-10-30 Paul Eggert <eggert@twinsun.com>
119
120 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
121 Check for close failures.
122 * src/files.h (xfclose): Return void, not int, since it always
123 returned zero.
124 * src/files.c (xfclose): Likewise. Report I/O error if ferror
125 indicates one.
126 * src/output.c (output_skeleton): Use xfclose rather than fclose
127 and ferror. xfclose now checks ferror.
128
129 * data/glr.c (YYLEFTMOST_STATE): Remove.
130 (yyreportTree): Use a stack-based leftmost state. This avoids
131 our continuing battles with bogus warnings about initializers.
132
1332002-10-30 Akim Demaille <akim@epita.fr>
134
135 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
136 #if.
137
1382002-10-24 Paul Eggert <eggert@twinsun.com>
139
140 Version 1.75a.
141
142 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
143 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
144 we use malloc. Don't assume 'A' through 'Z' are contiguous.
145 Don't assume strdup exists; POSIX says its an XSI extension.
146 Check for buffer overflow on input.
147
1482002-10-24 Akim Demaille <akim@epita.fr>
149
150 * src/output.c (output_skeleton): Don't disable M4sugar comments
151 too soon: it results in comments being expanded.
152 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
153 first output.
154
1552002-10-24 Akim Demaille <akim@epita.fr>
156
157 * data/yacc.c (m4_int_type): New.
158 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
159 char' as only yacc.c wants K&R portability.
160 * data/glr.c (yysigned_char): Remove.
161 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
162 Reported by Quoc Peyrot.
163
1642002-10-23 Paul Eggert <eggert@twinsun.com>
165
166 * src/main.c (main): With --trace=time, report times even if a
167 non-fatal error occurs. Formerly, the times were reported in some
168 such cases but not in others.
169 * src/reader.c (reader): Just return if a complaint has been issued,
170 instead of exiting, so that 'main' can report times.
171
1722002-10-22 Akim Demaille <akim@epita.fr>
173
174 * src/system.h: Include sys/types.
175 Reported by Bert Deknuydt.
176
1772002-10-23 Paul Eggert <eggert@twinsun.com>
178
179 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
180 Suggested by Art Haas.
181
1822002-10-22 Paul Eggert <eggert@twinsun.com>
183
184 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
185 decl; not needed any more.
186 * src/main.c (main): Use return to exit, undoing yesterday's change.
187 The last OS that we could find where this wouldn't work is
188 SunOS 3.5, and that's too old to worry about now.
189
190 * data/glr.c (struct yyltype): Define members even when not
191 doing locations. This is more consistent with yacc.c, and it
192 works around the following bug reports:
193 http://mail.gnu.org/pipermail/bug-bison/2002-October/001764.html
194 http://mail.gnu.org/pipermail/bug-bison/2002-October/001769.html
195 and I hope it also fixes this bug report:
196 http://mail.gnu.org/pipermail/bug-bison/2002-October/001748.html
197
198 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
199 @acronym consistently. Standardize on "Yacc" instead of "YACC",
200 "Algol" instead of "ALGOL". Give a bit more history about BNF.
201
2022002-10-22 Akim Demaille <akim@epita.fr>
203
204 * data/README: New.
205
2062002-10-21 Paul Eggert <eggert@twinsun.com>
207
208 Be consistent about 'bool'; the old code used an enum in one
209 module and an int in another, and this violates the C standard.
210 * m4/stdbool.m4: New file, from coreutils 4.5.3.
211 * configure.ac (AC_HEADER_STDBOOL): Add.
212 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
213 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
214 * src/symtab.c (hash_compare_symbol_t): Likewise.
215 * src/system.h (bool, false, true): Use a definition consistent
216 with ../lib/hash.c. All uses changed.
217
218 * src/complain.c (warning_issued): Renamed from warn_message_count,
219 so that we needn't worry about integer overflow (!).
220 Now of type bool. All uses changed.
221 (complaint_issued): Renamed from complain_message_count; likewise.
222
223 * src/main.c (main): Use exit to exit with failure.
224
225 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
226 rather than 1 and 0.
227 * src/main.c (main): Likewise.
228 * src/getargs.c (getargs): Likewise.
229 * src/reader.c (reader): Likewise.
230
231 * src/getarg.c (getargs): Remove duplicate code for
232 "Try `bison --help'".
233
234 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
235 What was that "2" for?
236
237 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
238 * src/getargs.c (usage): Likewise.
239
240 * src/getargs.c (getargs): When there are too few operands, report
241 the last one. When there are too many, report the first extra
242 one. This is how diffutils does it.
243
2442002-10-20 Paul Eggert <eggert@twinsun.com>
245
246 Remove K&R vestiges.
247 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
248 * src/complain.c (VA_START): Remove. Assume prototypes.
249 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
250 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
251 fatal): Assume prototypes.
252 * src/complain.h: Assume prototypes.
253 * src/system.h (PARAMS): Remove.
254 Include <limits.h> unconditionally, since it's guaranteeed even
255 for a freestanding C89 compiler.
256 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
257 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
258
2592002-10-20 Akim Demaille <akim@epita.fr>
260
261 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
262 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
263 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
264 (yyresolveStates, yyresolveAction, yyresolveStack)
265 (yyprocessOneStack): Use them.
266 (yy_reduce_print): New.
267 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
268
2692002-10-20 Akim Demaille <akim@epita.fr>
270
271 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
272 arguments and output `void'.
273 (b4_c_function): Rename as...
274 (b4_c_function_def): this.
275 (b4_c_function_decl, b4_c_ansi_function_def)
276 (b4_c_ansi_function_decl): New.
277 Change the interpretation of the arguments: before `int, foo', now
278 `int foo, foo'.
279 * data/yacc.c (yyparse): Prototype and define thanks to these.
280 Adjust b4_c_function_def uses.
281 * data/glr.c (yyparse): Likewise, but ANSI only.
282
2832002-10-20 Akim Demaille <akim@epita.fr>
284
285 * src/output.c (prepare): Move the definition of `tokens_number',
286 `nterms_number', `undef_token_number', `user_token_number_max'
287 to...
288 (prepare_tokens): Here.
289 (prepare_tokens): Rename as...
290 (prepare_symbols): this.
291 (prepare): Move the definition of `rules_number' to...
292 (prepare_rules): here.
293 (prepare): Move the definition of `last', `final_state_number',
294 `states_number' to...
295 (prepare_states): here.
296 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
297
2982002-10-20 Akim Demaille <akim@epita.fr>
299
300 * src/tables.h, src/tables.c, src/output.c: Comment changes.
301
3022002-10-20 Akim Demaille <akim@epita.fr>
303
304 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
305 * data/c.m4: here.
306
3072002-10-20 Akim Demaille <akim@epita.fr>
308
309 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
310 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
311 `pair'.
312 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
313 `name' to...
314 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
315 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
316 These.
317
3182002-10-19 Paul Eggert <eggert@twinsun.com>
319
320 Do not create a temporary file, as that involves security and
321 cleanup headaches. Instead, use a pair of pipes.
322 Derived from a suggestion by Florian Krohm.
323 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
324 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
325 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
326 (BISON_PREREQ_SUBPIPE): Add.
327 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
328 Add subpipe.h, subpipe.c.
329 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
330 * po/POTFILES.in: Add lib/subpipe.c.
331 * src/output.c: Include "subpipe.h".
332 (m4_invoke): Remove decl.
333 (scan_skel): New decl.
334 (output_skeleton): Use pipe rather than temporary file for m4 input.
335 Check that m4sugar.m4 is readable, to avoid deadlock.
336 Check for pipe I/O error.
337 * src/scan-skel.l (readpipe): Remove decl.
338 (scan_skel): New function, to be used in place of m4_invoke.
339 Read from stream rather than file.
340
341 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
342 float, as this generates a warning on Solaris 8 + GCC 3.2 with
343 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
344 this generates a more-accurate value anyway.
345
346 * lib/timevar.c (timervar_accumulate): Rename locals to
347 avoid confusion with similarly-named more-global.
348 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
349
350 * src/output.c (prepare): Use xstrdup to convert char const *
351 to char *, to avoid GCC warning.
352
3532002-10-19 Akim Demaille <akim@epita.fr>
354
355 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
356 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
357 Use them to have `calc.y' ready for %pure-parser.
358 * data/yacc.c (YYLEX): Pass a yylex return type to
359 b4_c_function_call.
360
3612002-10-19 Akim Demaille <akim@epita.fr>
362
363 Prototype support of %lex-param and %parse-param.
364
365 * src/parse-gram.y: Add the definition of the %lex-param and
366 %parse-param tokens, plus their rules.
367 Drop the `_' version of %glr-parser.
368 Add the "," token.
369 * src/scan-gram.l (INITIAL): Scan them.
370 * src/muscle_tab.c: Comment changes.
371 (muscle_insert, muscle_find): Rename `pair' as `probe'.
372 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
373 (muscle_entry_s): The `value' member is no longer const.
374 Adjust all dependencies.
375 * src/muscle_tab.c (muscle_init): Adjust: use
376 MUSCLE_INSERT_STRING.
377 Initialize the obstack earlier.
378 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
379 (muscle_pair_list_grow): New.
380 * data/c.m4 (b4_c_function_call, b4_c_args): New.
381 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
382 * tests/calc.at: Use %locations, not --locations.
383 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
384
3852002-10-19 Akim Demaille <akim@epita.fr>
386
387 * src/getargs.c (usage): Take status as argument and exit
388 accordingly.
389 Report the traditional `Try ... --help' message when status != 0.
390 (usage, version): Don't take a FILE * as arg, it is pointless.
391 (getargs): When there is an incorrect number of arguments, make it
392 an error, and report it GNUlically thanks to `usage ()'.
393
3942002-10-18 Paul Eggert <eggert@twinsun.com>
395
396 * data/glr.c (yyreportParseError): Don't assume that sprintf
397 yields the length of the printed string, as this is not true
398 on SunOS 4.1.4. Reported by Peter Klein.
399
400 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
401 * tests/conflicts.at (%nonassoc and eof): Likewise.
402 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
403
4042002-10-17 Akim Demaille <akim@epita.fr>
405
406 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
407 * src/getargs.c (trace_types, trace_args): Adjust.
408 * src/reader.c (grammar_current_rule_prec_set)
409 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
410 Standardize error messages.
411 And s/@prec/%prec/!
412 (reader): Use trace_flag to enable scanner/parser debugging,
413 instead of an adhoc scheme.
414 * src/scan-gram.l: Remove trailing debugging code.
415
4162002-10-16 Paul Eggert <eggert@twinsun.com>
417
418 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
419 MUSCLE_TAB_H.
420
421 * NEWS: Officially drop support for building Bison with K&R C,
422 since it didn't work anyway and it's not worth worrying about.
423 * Makefile.maint (wget_files): Remove ansi2knr.c.
424 (ansi2knr.c-url_prefix): Remove.
425 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
426 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
427 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
428
4292002-10-15 Paul Eggert <eggert@twinsun.com>
430
431 Stop using the "enum_" trick for K&R-style function definitions;
432 it confused me, and I was the author! Instead, assume that people
433 who want to use K&R C compilers (when using these modules in GCC,
434 perhaps?) will run ansi2knr.
435
436 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
437 All uses of "enum_" changed to "enum ".
438 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
439 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
440
441 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
442 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
443 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
444 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
445 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
446 abitset_not, abitset_ones, abitset_or, abitset_or_and,
447 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
448 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
449 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
450 Use function prototypes; this removes the need for declaring
451 static functions simply to provide their prototypes.
452 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
453 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
454 bitset_count_, bitset_create, bitset_dump, bitset_first,
455 bitset_free, bitset_init, bitset_last, bitset_next,
456 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
457 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
458 bitset_print, bitset_release_memory, bitset_toggle_,
459 bitset_type_choose, bitset_type_get, bitset_type_name_get,
460 debug_bitset): Likewise.
461 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
462 * lib/bitset_stats.c (bitset_log_histogram_print,
463 bitset_percent_histogram_print, bitset_stats_and,
464 bitset_stats_and_cmp, bitset_stats_and_or,
465 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
466 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
467 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
468 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
469 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
470 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
471 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
472 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
473 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
474 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
475 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
476 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
477 bitset_stats_zero): Likewise.
478 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
479 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
480 bitsetv_dump, debug_bitsetv): Likewise.
481 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
482 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
483 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
484 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
485 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
486 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
487 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
488 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
489 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
490 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
491 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
492 Likewise.
493 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
494 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
495 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
496 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
497 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
498 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
499 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
500 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
501 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
502 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
503 lbitset_xor_cmp, lbitset_zero): Likewise.
504
5052002-10-14 Akim Demaille <akim@epita.fr>
506
507 Version 1.75.
508
5092002-10-14 Akim Demaille <akim@epita.fr>
510
511 * tests/Makefile.am (maintainer-check-posix): New.
512
5132002-10-14 Akim Demaille <akim@epita.fr>
514
515 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
516 member.
517
5182002-10-14 Akim Demaille <akim@epita.fr>
519
520 * src/tables.c (table_ninf_remap): base -> tab.
521 Reported by Matt Rosing.
522
5232002-10-14 Paul Eggert <eggert@twinsun.com>
524
525 * tests/action.at, tests/calc.at, tests/conflicts.at,
526 tests/cxx-type.at, tests/headers.at, tests/input.at,
527 tests/regression.at, tests/synclines.at, tests/torture.at:
528 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
529 so that the tests still work even if POSIXLY_CORRECT is set.
530 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
531
532 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
533 for portability to K&R hosts. Fix typo: signed char is guaranteed
534 only to 127, not to 128.
535 * data/glr.c (yysigned_char): New type.
536 * data/yacc.c (yysigned_char): Likewise.
537 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
538
5392002-10-13 Paul Eggert <eggert@twinsun.com>
540
541 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
542 true due to limited range of data type" warning from GCC.
543
544 * data/c.m4 (b4_token_defines): Protect against double-inclusion
545 by wrapping enum yytokentype's definition inside #ifndef
546 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
547
5482002-10-13 Akim Demaille <akim@epita.fr>
549
550 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
551 Un yy- yyrhs to avoid the name clash with the global YYRHS.
552
5532002-10-13 Akim Demaille <akim@epita.fr>
554
555 * Makefile.maint: Update from Autoconf 2.54.
556 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
557
5582002-10-13 Akim Demaille <akim@epita.fr>
559
560 * src/print.c (print_state): Separate the list of solved conflicts
561 from the other items.
562 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
563
5642002-10-13 Akim Demaille <akim@epita.fr>
565
566 Let nondeterministic skeletons be usable with deterministic
567 tables.
568
569 With the patch, GAWK compiled by GCC without -O2 passes its test
570 suite using a GLR parser driven by LALR tables. It fails with -O2
571 because `struct stat' gives two different answers on my machine:
572 88 (definition of an auto var) and later 96 (memset on this var).
573 Hence the stack is badly corrumpted. The headers inclusion is to
574 blame: if I move the awk.h inclusion before GLR's system header
575 inclusion, the two struct stat have the same size.
576
577 * src/tables.c (pack_table): Always create conflict_table.
578 (token_actions): Always create conflict_list.
579 * data/glr.c (YYFLAG): Remove, unused.
580
5812002-10-13 Akim Demaille <akim@epita.fr>
582
583 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
584 (O0FLAGS): New.
585 (VALGRIND, GXX): New.
586 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
587 * tests/bison.in: Run $PREBISON a pre-command.
588 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
589 (maintainer-check-g++): New.
590 * Makefile.am (maintainer-check): New.
591
5922002-10-13 Akim Demaille <akim@epita.fr>
593
594 * data/glr.c: Formatting changes.
595 Tweak some trace messages to match yacc.c's.
596
5972002-10-13 Akim Demaille <akim@epita.fr>
598
599 GLR parsers sometimes raise parse errors instead of performing the
600 default reduction.
601 Reported by Charles-Henry de Boysson.
602
603 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
604 check the length of the traces when %glr.
605 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
606 GLR's traces.
607 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
608 Test GLR parsers.
609 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
610 (yyltype): Remove the yy prefix from the member names.
611 (yytable): Complete its comment.
612 (yygetLRActions): Map error action number from YYTABLE from
613 YYTABLE_NINF to 0.
614 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
615 (which was a bug: it should have been YYTABEL_NINF, and yet it was
616 not satisfying as we could compare an YYACTION computed from
617 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
618 only value for error actions.
619 (yyreportParseError): In verbose parse error messages, don't issue
620 `error' in the list of expected tokens.
621 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
622 next action to perform to match glr.c's decoding.
623 (yytable): Complete its comment.
624
6252002-10-13 Paul Eggert <eggert@twinsun.com>
626
627 Fix problem reported by Henrik Grubbstroem in
628 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001670.html>:
629 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
630 because the Bison parser reads the second action before reducing
631 the first one.
632 * src/scan-gram.l (rule_length): New static var.
633 Use it to keep track of the rule length in the scanner, since
634 we can't expect the parser to be in lock-step sync with the scanner.
635 (handle_action_dollar, handle_action_at): Use this var.
636 * tests/actions.at (Exotic Dollars): Test for the problem.
637
6382002-10-12 Paul Eggert <eggert@twinsun.com>
639
640 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
641 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
642 Include <sys/time.h> when checking for clock_t and struct tms.
643 Use same include order as source.
644 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
645 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001674.html>.
646
647 * lib/timevar.c: Update copyright date and clarify comments.
648 (get_time) [IN_GCC]: Keep the GCC version for reference.
649
650 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
651 GCC version as of today, then merge Bison's changes.
652 Change "GCC" to "Bison" in copyright notice. timevar.def's
653 author is Akim, so change that too.
654
655 * src/reader.c (grammar_current_rule_check):
656 Don't worry about the default action if $$ is untyped.
657 Prevents bogus warnings reported by Jim Gifford in
658 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001673.html>.
659
660 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
661 * data/glr.c, data/lalr1.cc, data/yacc.c:
662 Output token definitions before the first part of user declarations.
663 Fixes compatibility problem reported by Jim Gifford for kbd in
664 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001672.html>.
665
6662002-10-11 Paul Eggert <eggert@twinsun.com>
667
668 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
669 (yyparse): here. This undoes some of the 2002-07-25 change.
670 Compatibility problem reported by Ralf S. Engelschall with
671 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
672
6732002-10-11 Akim Demaille <akim@epita.fr>
674
675 * tests/regression.at Characters Escapes): New.
676 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
677 characters.
678 Reported by Jan Nieuwenhuizen.
679
6802002-10-11 Akim Demaille <akim@epita.fr>
681
682 * po/id.po: New.
683
6842002-10-10 Paul Eggert <eggert@twinsun.com>
685
686 Portability fixes for bitsets; this also avoids several GCC
687 warnings.
688
689 * lib/abitset.c: Include <stddef.h>, for offsetof.
690 * lib/lbitset.c: Likewise.
691
692 * lib/abitset.c (abitset_bytes): Return a size that is aligned
693 properly for vectors of objects. Do not assume that adding a
694 header size to a multiple of a word size yields a value that is
695 properly aligned for the whole union.
696 * lib/bitsetv.c (bitsetv_alloc): Likewise.
697
698 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
699 unique names for structures.
700 * lib/ebitset.c (ebitset_bytes): Likewise.
701 * lib/lbitset.c (lbitset_bytes): Likewise.
702
703 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
704 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
705 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
706 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
707 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
708 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
709 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
710 to improve the type-checking that GCC can do.
711 * lib/bitset.c (bitset_op4_cmp): Likewise.
712 * lib/bitset_stats.c (bitset_stats_count,
713 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
714 bitset_stats_copy, bitset_stats_disjoint_p,
715 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
716 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
717 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
718 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
719 bitset_stats_and_or_cmp, bitset_stats_andn_or,
720 bitset_stats_andn_or_cmp, bitset_stats_or_and,
721 bitset_stats_or_and_cmp): Likewise.
722 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
723 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
724 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
725 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
726
727 * lib/abitset.h: Include bitset.h, not bbitset.h.
728 * lib/ebitset.h: Likewise.
729 * lib/lbitset.h: Likewise.
730
731 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
732 All instances of parameters of type enum bitset_opts are now of
733 type enum_bitset_opts, to conform to the C Standard, and similarly
734 for enum_bitset_type.
735 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
736 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
737
738 Do not use "struct bitset_struct" to mean different things in
739 different modules. Not only is this confusing, it violates
740 the C Standard, which requires that structure types in different
741 modules must be compatible if one is to be passed to the other.
742 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
743 All instances of "struct bitset_struct *" replaced with "bitset".
744 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
745 (union bitset_union, struct abitset_struct, struct ebitset_struct,
746 struct lbitset_struct, struct bitset_stats_struct): New types.
747 All uses of struct bitset_struct changed to union bitset_union,
748 etc.
749 * lib/abitset.c (struct abitset_struct, abitset,
750 struct bitset_struct): Remove.
751 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
752 struct bitset_struct): Remove.
753 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
754 bitset_struct): Remove.
755 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
756 Likewise.
757
758 Do not call a function of type T using a call that assumes the
759 function is of a different type U. Standard C requires that a
760 function must be called with a type that is compatible with its
761 definition.
762 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
763 New decls.
764 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
765 New functions.
766 * lib/ebitset.c (PFV): Remove.
767 * lib/lbitset.c (PFV): Likewise.
768 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
769 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
770 decls.
771 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
772 (ebitset_vtable): Use them.
773 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
774 lbitset_xor): New functions.
775 (lbitset_vtable): Use them.
776
777 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
778 Declare.
779
780 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
781 GCC warning.
782 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
783 Use offsetof, for simplicity.
784
7852002-10-06 Paul Eggert <eggert@twinsun.com>
786
787 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
788 the same width as int. This reapplies a hunk of the 2002-08-12 patch
789 <http://mail.gnu.org/pipermail/bison-patches/2002-August/001111.html>,
790 which was inadvertently undone by the 2002-09-30 patch.
791 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
792 the same width as int.
793
7942002-10-04 Paul Eggert <eggert@twinsun.com>
795
796 Version 1.50.
797
798 * configure.ac (AC_INIT), NEWS: Increment version number.
799
800 * doc/bison.texinfo: Minor spelling, grammar, and white space
801 fixes.
802 (Symbols): Mention that any negative value returned from yylex
803 signifies end-of-input. Warn about negative chars. Mention
804 the portable Standard C character set.
805
806 The GNU coding standard says CFLAGS and YFLAGS are reserved
807 for the installer to set.
808 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
809 * src/Makefile.am (AM_CFLAGS): Likewise.
810 (AM_YFLAGS): Renamed from YFLAGS.
811
812 Fix some MAX and MIN problems.
813 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
814 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
815 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
816 * src/reader.c (reader): Use it.
817
818 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
819 POSIX 1003.1-2001 has removed fgrep.
820
8212002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
822
823 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
824 interpreted as signed.
825 * lib/ebitset.c (ebitset_list): Fix bug.
826
8272002-10-01 Paul Eggert <eggert@twinsun.com>
828
829 More fixes for 64-bit hosts and large bitsets.
830
831 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
832 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
833 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
834 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
835 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
836 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
837 bitset_count_): Likewise.
838 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
839 bitset_first, bitset_last): Likewise.
840 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
841 bitset_stats_list_reverse, bitset_stats_size,
842 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
843 Likewise.
844 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
845 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
846 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
847 bitsetv_reflexive_transitive_closure): Likewise.
848 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
849 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
850 Likewise.
851 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
852 Likewise.
853
854 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
855 Use size_t, not unsigned int, to count bytes.
856 * lib/abitset.h (abitset_bytes): Likewise.
857 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
858 Likewise.
859 * lib/bitset.h (bitset_bytes): Likewise.
860 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
861 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
862 * lib/bitsetv.c (bitsetv_alloc): Likewise.
863 * lib/ebitset.c (ebitset_bytes): Likewise.
864 * lib/ebitset.h (ebitset_bytes): Likewise.
865 * lib/lbitset.c (lbitset_bytes): Likewise.
866 * lib/lbitset.h (lbitset_bytes): Likewise.
867
868 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
869 abitset_subset_p, abitset_disjoint_p, abitset_and,
870 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
871 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
872 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
873 abitset_or_and, abitset_or_and_cmp):
874 Use bitset_windex instead of unsigned int.
875 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
876 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
877 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
878 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
879 Likewise.
880 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
881
882 * lib/bitset.c (bitset_print):
883 Use proper printf formats for widths of integer types.
884 * lib/bitset_stats.c (bitset_percent_histogram_print,
885 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
886 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
887 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
888 * lib/lbitset.c (lbitset_bytes): Likewise.
889
890 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
891 BITSET_SIZE_MAX): New macros.
892 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
893 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
894 to BITSET_WINDEX_MAX.
895
896 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
897 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
898 since we now return the bitset_bindex type (not int).
899
900 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
901 when computing sizes.
902 * lib/ebitset.c (ebitset_elts_grow): Likewise.
903
904 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
905 and avoid cast to unsigned.
906
9072002-09-30 Akim Demaille <akim@epita.fr>
908
909 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
910 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
911 Updates from Michael Hayes.
912
9132002-09-30 Art Haas <ahaas@neosoft.com>
914
915 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
916 invocations.
917 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
918 defined.
919
9202002-09-27 Akim Demaille <akim@epita.fr>
921
922 Version 1.49c.
923
9242002-09-27 Akim Demaille <akim@epita.fr>
925
926 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
927 (Because of AC_LIBSOURCE).
928
9292002-09-27 Akim Demaille <akim@epita.fr>
930
931 Playing with Autoscan.
932
933 * configure.ac: Remove the old LIBOBJ tweaks.
934 (AC_REPLACE_FUNCS): Add strrchr and strtol.
935 * lib/strrchr.c: New.
936 * lib/strtol.c: New, from the Coreutils 4.5.1.
937
9382002-09-27 Akim Demaille <akim@epita.fr>
939
940 Playing with Autoscan.
941
942 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
943 * lib/Makefile.am (libbison_a_SOURCES): No longer include
944 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
945 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
946 Coreutils 4.5.1.
947
9482002-09-24 Akim Demaille <akim@epita.fr>
949
950 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
951 (Frequently Asked Questions, Parser Stack Overflow): New.
952
9532002-09-13 Akim Demaille <akim@epita.fr>
954
955 Playing with autoscan.
956
957 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
958 * src/files.c (skeleton_find): Remove, unused.
959 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
960 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
961
9622002-09-13 Akim Demaille <akim@epita.fr>
963
964 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
965 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
966
9672002-09-13 Akim Demaille <akim@epita.fr>
968
969 * configure.ac: Require 2.54.
970 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
971 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
972 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
973 Remove, provided by Autoconf macros.
974
9752002-09-12 Akim Demaille <akim@epita.fr>
976
977 * m4/prereq.m4: Update, from Coreutils 4.5.1.
978
9792002-09-12 Akim Demaille <akim@epita.fr>
980
981 * m4/prereq.m4: Update, from Fileutils 4.1.5.
982 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
983 Reported by Martin Mokrejs.
984
9852002-09-10 Akim Demaille <akim@epita.fr>
986
987 * src/parse-gram.y: Associate a human readable string to each
988 token type.
989 * tests/regression.at (Invalid inputs): Adjust.
990
9912002-09-10 Gary V. Vaughan <gary@gnu.org>
992
993 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
994 with an Autoconf-2.5x style configure.ac.
995
9962002-09-06 Paul Eggert <eggert@twinsun.com>
997
998 * doc/bison.texinfo (Conditions): Make explicit that the GPL
999 exception applies only to yacc.c. This is a modification of a
1000 patch originally suggested by Akim Demaille.
1001
10022002-09-06 Akim Demaille <akim@epita.fr>
1003
1004 * data/c.m4 (b4_copyright): Move the GPL exception comment from
1005 here to...
1006 * data/yacc.c: here.
1007
1008 * data/lalr1.cc (struct yyltype): Don't define it, since we use
1009 LocationType.
1010 (b4_ltype): Default to yy::Location from location.hh.
1011
10122002-09-04 Jim Meyering <jim@meyering.net>
1013
1014 * data/yacc.c: Guard the declaration of yytoknum also with
1015 `#ifdef YYPRINT', so it is declared only when used.
1016
10172002-09-04 Akim Demaille <akim@epita.fr>
1018
1019 * configure.in: Rename as...
1020 * configure.ac: this.
1021 Bump to 1.49c.
1022
10232002-09-04 Akim Demaille <akim@epita.fr>
1024
1025 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
1026 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
1027 translate maintainer only messages.
1028
10292002-08-12 Paul Eggert <eggert@twinsun.com>
1030
1031 Version 1.49b.
1032
1033 * Makefile.am (SUBDIRS): Remove intl.
1034 (DISTCLEANFILES): Remove.
1035 * NEWS: Mention that GNU M4 is now required. Clarify what is
1036 meant by "larger grammars". Mention the pt_BR translation.
1037 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
1038 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
1039 Bump version from 0.11.2 to 0.11.5.
1040 (BISON_PREREQ_STAGE): Remove.
1041 (AM_GNU_GETTEXT): Use external gettext.
1042 (AC_OUTPUT): Remove intl/Makefile.
1043
1044 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
1045
1046 * data/glr.c: Include string.h, for strlen.
1047 (yyreportParseError): Use size_t for yysize.
1048 (yy_yypstack): No longer nested inside yypstates, as nested
1049 functions are not portable. Do not assume size_t is the
1050 same width as int.
1051 (yypstates): Do not assume that ptrdiff_t is the same width
1052 as int, and similarly for yyposn and YYINDEX.
1053
1054 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
1055
1056 * lib/Makefile.am (INCLUDES): Do not include from the intl
1057 directory, which has been removed.
1058 * src/Makefile.am (INCLUDES): Likewise.
1059
1060 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
1061 (bitsets_sources, additional_bitsets_sources, timevars_sources):
1062 New vars.
1063
1064 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
1065 * tests/Makefile.am (EXTRA_DIST): Likewise.
1066
1067 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
1068 Do not assume that bitset_windex is the same width as unsigned.
1069
1070 * lib/abitset.c (abitset_unused_clear): Do not assume that
1071 bitset_word is the same width as int.
1072 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
1073 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
1074 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
1075 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
1076 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
1077
1078 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
1079 portability to one's complement hosts!).
1080 * lib/ebitset.c (ebitset_op1): Likewise.
1081 * lib/lbitset.c (lbitset_op1): Likewise.
1082
1083 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
1084 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
1085 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
1086 Sync with fileutils.
1087 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
1088 lib/gettext.h: Sync with diffutils.
1089
1090 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
1091 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
1092
1093 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
1094 PROTOTYPES to check for prototypes, and "defined __STDC__" to
1095 check for void *.
1096
1097 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
1098 size_t; the old version tried to do this but casted improperly.
1099 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
1100 (bitset_test): Now returns int, not unsigned long.
1101
1102 * lib/bitset_stats.c: Include "gettext.h".
1103 (_): New macro.
1104 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
1105 name locals "index", as it generates unnecessary warnings on some
1106 hosts that have an "index" function.
1107
1108 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
1109 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
1110 they need translation.
1111 * src/LR0.c (state_list_append, new_itemsets, get_state,
1112 append_states, generate_states): Likewise.
1113 * src/assoc.c (assoc_to_string): Likewise.
1114 * src/closure.c (print_closure, set_firsts, closure): Likewise.
1115 * src/gram.c (grammar_dump): Likewise.
1116 * src/injections.c (injections_compute): Likewise.
1117 * src/lalr.c (lookaheads_print): Likewise.
1118 * src/relation.c (relation_transpose): Likewise.
1119 * src/scan-gram.l: Likewise.
1120 * src/tables.c (table_grow, pack_vector): Likewise.
1121
1122 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
1123 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
1124 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
1125 * m4/mbstate_t.m4: Sync with fileutils.
1126 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
1127
1128 * po/LINGUAS: Add pt_BR.
1129 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
1130 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
1131 lib/timevar.c.
1132 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
1133 manual recommends.
1134 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
1135
1136 * src/complain.c (strerror_r): Remove decl; not needed.
1137 (strerror): Use same pattern as ../lib/error.c.
1138
1139 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
1140
1141 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
1142
1143 * src/main.c (main): Cast result of bindtextdomain and textdomain
1144 to void, to avoid a GCC warning when --disable-nls is in effect.
1145
1146 * src/scan-gram.l: Use strings rather than escapes when possible,
1147 to minimize the number of warnings from xgettext.
1148 (handle_action_dollar, handle_action_at): Don't use isdigit,
1149 as it mishandles negative chars and it may not work as expected
1150 outside the C locale.
1151
1152 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
1153 this is a GCC extension and is not portable to other compilers.
1154
1155 * src/system.h (alloca): Use same pattern as ../lib/error.c.
1156 Do not include <ctype.h>; no longer needed.
1157 Do not include <malloc.h>; no longer needed (and generates
1158 warnings on OpenBSD 3.0).
1159
1160 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
1161 it's not portable.
1162
1163 * tests/regression.at: Do not use 'cc -c input.c -o input';
1164 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
1165
1166 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
1167 exit status as failure, not just exit status 1. Sun C exits
1168 with status 2 sometimes.
1169
1170 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
1171 Use it for the two large tests.
1172
11732002-08-02 Akim Demaille <akim@epita.fr>
1174
1175 * src/conflicts.c (conflicts_output): Don't output rules never
1176 reduced here, since anyway that computation doesn't work.
1177 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
1178 (rule_useless_p, rule_never_reduced_p): New.
1179 (grammar_rules_partial_print): Use a filter instead of a range.
1180 Display the title only if needed.
1181 (grammar_rules_print): Adjust.
1182 (grammar_rules_never_reduced_report): New.
1183 * src/tables.c (action_row): Move the computation of rules never
1184 reduced to...
1185 (token_actions): here.
1186 * src/main.c (main): Make the parser before making the report, so
1187 that rules never reduced are computed.
1188 Call grammar_rules_never_reduced_report.
1189 * src/print.c (print_results): Report rules never reduced.
1190 * tests/conflicts.at, tests/reduce.at: Adjust.
1191
11922002-08-01 Akim Demaille <akim@epita.fr>
1193
1194 Instead of attaching lookaheads and duplicating the rules being
1195 reduced by a state, attach the lookaheads to the reductions.
1196
1197 * src/state.h (state_t): Remove the `lookaheads',
1198 `lookaheads_rule' member.
1199 (reductions_t): Add a `lookaheads' member.
1200 Use a regular array for the `rules'.
1201 * src/state.c (reductions_new): Initialize the lookaheads member
1202 to 0.
1203 (state_rule_lookaheads_print): Adjust.
1204 * src/state.h, src/state.c (state_reductions_find): New.
1205 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
1206 (count_rr_conflicts): Adjust.
1207 * src/lalr.c (LArule): Remove.
1208 (add_lookback_edge): Adjust.
1209 (state_lookaheads_count): New.
1210 (states_lookaheads_initialize): Merge into...
1211 (initialize_LA): this.
1212 (lalr_free): Adjust.
1213 * src/main.c (main): Don't free nullable and derives too early: it
1214 is used by --verbose.
1215 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
1216
12172002-08-01 Akim Demaille <akim@epita.fr>
1218
1219 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
1220 `rule_number_t**'.
1221 (set_derives, free_derives): Rename as...
1222 (derives_compute, derives_free): this.
1223 Adjust all dependencies.
1224 * src/nullable.c (set_nullable, free_nullable): Rename as...
1225 (nullable_compute, nullable_free): these.
1226 (rule_list_t): Store rule_t *, not rule_number_t.
1227 * src/state.c (state_rule_lookaheads_print): Directly compare rule
1228 pointers, instead of their numbers.
1229 * src/main.c (main): Call nullable_free, and derives_free earlier,
1230 as they were lo longer used.
1231
12322002-08-01 Akim Demaille <akim@epita.fr>
1233
1234 * lib/timevar.c (get_time): Include children time.
1235 * src/lalr.h (LA, LArule): Don't export them: used with the
1236 state_t.
1237 * src/lalr.c (LA, LArule): Static.
1238 * src/lalr.h, src/lalr.c (lalr_free): New.
1239 * src/main.c (main): Call it.
1240 * src/tables.c (pack_vector): Check whether loc is >= to the
1241 table_size, not >.
1242 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
1243 (tables_generate): do it, since that's also it which allocates
1244 them.
1245 Don't free LA and LArule, main does.
1246
12472002-07-31 Akim Demaille <akim@epita.fr>
1248
1249 Separate parser tables computation and output.
1250
1251 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
1252 (conflict_list, conflict_list_cnt, table, check, table_ninf)
1253 (yydefgoto, yydefact, high): Move to...
1254 * src/tables.h, src/tables.c: here.
1255 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
1256 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
1257 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
1258 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
1259 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
1260 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
1261 (action_row, save_row, token_actions, save_column, default_goto)
1262 (goto_actions, sort_actions, matching_state, pack_vector)
1263 (table_ninf_remap, pack_table, prepare_actions): Move to...
1264 * src/tables.c: here.
1265 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
1266 * src/output.c (token_actions, output_base, output_conflicts)
1267 (output_check): Merge into...
1268 (prepare_actions): this.
1269 (actions_output): Rename as...
1270 (user_actions_output): this.
1271 * src/main.c (main): Call tables_generate and tables_free.
1272
12732002-07-31 Akim Demaille <akim@epita.fr>
1274
1275 Steal GCC's --time-report support.
1276
1277 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
1278 stolen/adjusted from GCC.
1279 * m4/stage.m4: Remove time related checks.
1280 * m4/timevar.m4: New.
1281 * configure.in: Adjust.
1282 * src/system.h: Adjust to using timevar.h.
1283 * src/getargs.h, src/getargs.c: Support trace_time for
1284 --trace=time.
1285 * src/main.c (stage): Remove.
1286 (main): Replace `stage' invocations with timevar calls.
1287 * src/output.c: Insert pertinent timevar calls.
1288
12892002-07-31 Akim Demaille <akim@epita.fr>
1290
1291 Let --trace have arguments.
1292
1293 * src/getargs.h (enum trace_e): New.
1294 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
1295 (long_options, short_options): --trace/-T takes an optional
1296 argument.
1297 Change all the uses of trace_flag to reflect the new flags.
1298 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
1299
1300 Strengthen `stage' portability.
1301
1302 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
1303 * configure.in: Use it.
1304 Don't check for malloc.h and sys/times.h.
1305 * src/system.h: Include them when appropriate.
1306 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
1307 times and struct tms are available.
1308
13092002-07-30 Akim Demaille <akim@epita.fr>
1310
1311 In verbose parse error message, don't report `error' as an
1312 expected token.
1313 * tests/actions.at (Printers and Destructors): Adjust.
1314 * tests/calc.at (Calculator $1): Adjust.
1315 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
1316 error message, do not report the parser accepts the error token in
1317 that state.
1318
13192002-07-30 Akim Demaille <akim@epita.fr>
1320
1321 Normalize conflict related messages.
1322
1323 * src/complain.h, src/complain.c (warn, complain): New.
1324 * src/conflicts.c (conflicts_print): Use them.
1325 (conflict_report_yacc): New, extracted from...
1326 (conflicts_print): here.
1327 * tests/conflicts.at, tests/existing.at: Adjust.
1328
13292002-07-30 Akim Demaille <akim@epita.fr>
1330
1331 Report rules which are never reduced by the parser: those hidden
1332 by conflicts.
1333
1334 * src/LR0.c (save_reductions): Don't make the final state too
1335 different: save its reduction (accept) instead of having a state
1336 without any action (no shift or goto, no reduce).
1337 Note: the final state is now a ``regular'' state, i.e., the
1338 parsers now contain `reduce 0' as default reduction.
1339 Nevertheless, since they decide to `accept' when yystate =
1340 final_state, they still will not reduce rule 0.
1341 * src/print.c (print_actions, print_reduction): Adjust.
1342 * src/output.c (action_row): Track reduced rules.
1343 (token_actions): Report rules never reduced.
1344 * tests/conflicts.at, tests/regression.at: Adjust.
1345
13462002-07-30 Akim Demaille <akim@epita.fr>
1347
1348 `stage' was accidently included in a previous patch.
1349 Initiate its autoconfiscation.
1350
1351 * configure.in: Look for malloc.h and sys/times.h.
1352 * src/main.c (stage): Adjust.
1353 Report only when trace_flag.
1354
13552002-07-29 Akim Demaille <akim@epita.fr>
1356
1357 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
1358 state_number_t.
1359 (errs_t): symbol_t*, not symbol_number_t.
1360 (reductions_t): rule_t*, not rule_number_t.
1361 (FOR_EACH_SHIFT): New.
1362 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
1363 * src/print.c, src/print_graph.c: Adjust.
1364
13652002-07-29 Akim Demaille <akim@epita.fr>
1366
1367 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
1368
1369 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
1370 (endtoken, accept): these.
1371 * src/reader.c (reader): Set endtoken's default tag to "$end".
1372 Set undeftoken's tag to "$undefined" instead of "$undefined.".
1373 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
1374 Adjust.
1375
13762002-07-29 Akim Demaille <akim@epita.fr>
1377
1378 * src/reduce.c (reduce_grammar): When the language is empty,
1379 complain about the start symbol, not the axiom.
1380 Use its location.
1381 * tests/reduce.at (Empty Language): New.
1382
13832002-07-26 Akim Demaille <akim@epita.fr>
1384
1385 * src/reader.h, src/reader.c (gram_error): ... can't get
1386 yycontrol without making too strong assumptions on the parser
1387 itself.
1388 * src/output.c (prepare_tokens): Use the real 0th value of
1389 token_translations instead of `0'.
1390 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
1391 visible here.
1392 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
1393 for the time being: %locations ought to provide it to yyerror.
1394
13952002-07-25 Akim Demaille <akim@epita.fr>
1396
1397 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
1398 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
1399 * tests/regression.at (Web2c Actions): Adjust.
1400
14012002-07-25 Akim Demaille <akim@epita.fr>
1402
1403 Stop storing rules from 1 to nrules + 1.
1404
1405 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
1406 * src/nullable.c, src/output.c, src/print.c, src/reader.c
1407 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
1408 Iterate from 0 to nrules.
1409 Use rule_number_as_item_number and item_number_as_rule_number.
1410 Adjust to `derive' now containing possibly 0.
1411 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
1412 Handle the `- 1' part in rule numbers from/to item numbers.
1413 * src/conflicts.c (log_resolution): Fix the message which reversed
1414 shift and reduce.
1415 * src/output.c (action_row): Initialize default_rule to -1.
1416 (token_actions): Adjust.
1417 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
1418 expected output.
1419 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
1420
14212002-07-25 Akim Demaille <akim@epita.fr>
1422
1423 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
1424 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
1425 (b4_c_knr_arg_decl): New.
1426 * data/yacc.c: Use it to define yysymprint, yydestruct, and
1427 yyreport_parse_error.
1428
14292002-07-25 Akim Demaille <akim@epita.fr>
1430
1431 * data/yacc.c (yyreport_parse_error): New, extracted from...
1432 (yyparse): here.
1433 (yydestruct, yysymprint): Move above yyparse.
1434 Be K&R compliant.
1435
14362002-07-25 Akim Demaille <akim@epita.fr>
1437
1438 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
1439 replace...
1440 (b4_sint_type, b4_uint_type): these.
1441 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
1442 * tests/regression.at (Web2c Actions): Adjust.
1443
14442002-07-25 Akim Demaille <akim@epita.fr>
1445
1446 * src/gram.h (TIEM_NUMBER_MAX): New.
1447 (item_number_of_rule_number, rule_number_of_item_number): Rename
1448 as...
1449 (rule_number_as_item_number, item_number_as_rule_number): these.
1450 Adjust dependencies.
1451 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
1452 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
1453 (symbol_number_to_vector_number): New.
1454 (order): Of vector_number_t* type.
1455 (base_t, BASE_MAX, BASE_MIN): New.
1456 (froms, tos, width, pos, check): Of base_t type.
1457 (action_number_t, ACTION_MIN, ACTION_MAX): New.
1458 (actrow): Of action_number_t type.
1459 (conflrow): Of unsigned int type.
1460 (table_ninf, base_ninf): New.
1461 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
1462 (muscle_insert_int_table, muscle_insert_base_table)
1463 (muscle_insert_rule_number_table): New.
1464 (prepare_tokens): Output `toknum' as int_table.
1465 (action_row): Returns a rule_number_t.
1466 Use ACTION_MIN, not SHRT_MIN.
1467 (token_actions): yydefact is rule_number_t*.
1468 (table_ninf_remap): New.
1469 (pack_table): Use it for `base' and `table'.
1470 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
1471 replaced with...
1472 (YYPACT_NINF, YYTABLE_NINF): these.
1473 (yypact, yytable): Compute their types instead of hard-coded
1474 `short'.
1475 * tests/regression.at (Web2c Actions): Adjust.
1476
14772002-07-19 Akim Demaille <akim@epita.fr>
1478
1479 * src/scan-gram.l (id): Can start with an underscore.
1480
14812002-07-16 Akim Demaille <akim@epita.fr>
1482
1483 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
1484 Adjust all former `associativity' dependencies.
1485 * src/symtab.c (symbol_new): Default associativity is `undef', not
1486 `right'.
1487 (symbol_check_alias_consistence): Adjust.
1488
14892002-07-09 Akim Demaille <akim@epita.fr>
1490
1491 * doc/bison.texinfo: Properly set the ``header'' part.
1492 Use @dircategory ``GNU programming tools'' as per Texinfo's
1493 documentation.
1494 Use @copying.
1495
14962002-07-09 Akim Demaille <akim@epita.fr>
1497
1498 * lib/quotearg.h: Protect against multiple inclusions.
1499 * src/location.h (location_t): Add a `file' member.
1500 (LOCATION_RESET, LOCATION_PRINT): Adjust.
1501 * src/complain.c (warn_at, complain_at, fatal_at): Drop
1502 `error_one_per_line' support.
1503
15042002-07-09 Akim Demaille <akim@epita.fr>
1505
1506 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
1507 * src/reader.c (lineno): Remove.
1508 Adjust all dependencies.
1509 (get_merge_function): Take a location and use complain_at.
1510 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
1511 * tests/regression.at (Invalid inputs, Mixing %token styles):
1512 Adjust.
1513
15142002-07-09 Akim Demaille <akim@epita.fr>
1515
1516 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
1517 recovery rule, and forbid extensions when --yacc.
1518 (gram_error): Use complain_at.
1519 * src/reader.c (reader): Exit if there were parse errors.
1520
15212002-07-09 Akim Demaille <akim@epita.fr>
1522
1523 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
1524 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
1525 Reported by R Blake <blakers@mac.com>.
1526
15272002-07-09 Akim Demaille <akim@epita.fr>
1528
1529 * data/yacc.c: Output the copyright notive in the header.
1530
15312002-07-03 Akim Demaille <akim@epita.fr>
1532
1533 * src/output.c (froms, tos): Are state_number_t.
1534 (save_column): sp, sp1, and sp2 are state_number_t.
1535 (prepare): Rename `final' as `final_state_number', `nnts' as
1536 `nterms_number', `nrules' as `rules_number', `nstates' as
1537 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
1538 unused.
1539 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
1540 * data/lalr1.cc (nsym_): Remove, unused.
1541
15422002-07-03 Akim Demaille <akim@epita.fr>
1543
1544 * src/lalr.h, src/lalr.c (goto_number_t): New.
1545 * src/lalr.c (goto_list_t): New.
1546 Propagate them.
1547 * src/nullable.c (rule_list_t): New.
1548 Propagate.
1549 * src/types.h: Remove.
1550
15512002-07-03 Akim Demaille <akim@epita.fr>
1552
1553 * src/closure.c (print_fderives): Use rule_rhs_print.
1554 * src/derives.c (print_derives): Use rule_rhs_print.
1555 (rule_list_t): New, replaces `shorts'.
1556 (set_derives): Add comments.
1557 * tests/sets.at (Nullable, Firsts): Adjust.
1558
15592002-07-03 Akim Demaille <akim@epita.fr>
1560
1561 * src/output.c (prepare_actions): Free `tally' and `width'.
1562 (prepare_actions): Allocate and free `order'.
1563 * src/symtab.c (symbols_free): Free `symbols'.
1564 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
1565 * src/output.c (m4_invoke): Move to...
1566 * src/scan-skel.l: here.
1567 (<<EOF>>): Close yyout, and free its name.
1568
15692002-07-03 Akim Demaille <akim@epita.fr>
1570
1571 Fix some memory leaks, and fix a bug: state 0 was examined twice.
1572
1573 * src/LR0.c (new_state): Merge into...
1574 (state_list_append): this.
1575 (new_states): Merge into...
1576 (generate_states): here.
1577 (set_states): Don't ensure a proper `errs' state member here, do it...
1578 * src/conflicts.c (conflicts_solve): here.
1579 * src/state.h, src/state.c: Comment changes.
1580 (state_t): Rename member `shifts' as `transitions'.
1581 Adjust all dependencies.
1582 (errs_new): For consistency, also take the values as argument.
1583 (errs_dup): Remove.
1584 (state_errs_set): New.
1585 (state_reductions_set, state_transitions_set): Assert that no
1586 previous value was assigned.
1587 (state_free): New.
1588 (states_free): Use it.
1589 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
1590 temporary storage: use `errs' and `nerrs' as elsewhere.
1591 (set_conflicts): Allocate and free this `errs'.
1592
15932002-07-02 Akim Demaille <akim@epita.fr>
1594
1595 * lib/libiberty.h: New.
1596 * lib: Update the bitset implementation from upstream.
1597 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
1598 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
1599 * src/main.c: Adjust bitset stats calls.
1600
16012002-07-01 Paul Eggert <eggert@twinsun.com>
1602
1603 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
1604 char, so that negative chars don't collide with $.
1605
16062002-06-30 Akim Demaille <akim@epita.fr>
1607
1608 Have the GLR tests be `warning' checked, and fix the warnings.
1609
1610 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
1611 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
1612 (yyremoveDeletes): `yyi' and `yyj' are size_t.
1613 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
1614 (yyaddDeferredAction): static.
1615 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
1616 (yyreportParseError): yyprefix is const.
1617 yytokenp is used only when verbose.
1618 (yy__GNUC__): Replace with __GNUC__.
1619 (yypdumpstack): yyi is size_t.
1620 (yypreference): Un-yy local variables and arguments, to avoid
1621 clashes with `yyr1'. Anyway, we are not in the user name space.
1622 (yytname_size): be an int, as is compared with ints.
1623 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
1624 Use them.
1625 * tests/cxx-gram.at: Use quotation to protect $1.
1626 Use AT_COMPILE to enable warnings hunts.
1627 Prototype yylex and yyerror.
1628 `Use' argc.
1629 Include `string.h', not `strings.h'.
1630 Produce and prototype stmtMerge only when used.
1631 yylex takes a location.
1632
16332002-06-30 Akim Demaille <akim@epita.fr>
1634
1635 We spend a lot of time in quotearg, in particular when --verbose.
1636
1637 * src/symtab.c (symbol_get): Store a quoted version of the key.
1638 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
1639 Adjust all callers.
1640
16412002-06-30 Akim Demaille <akim@epita.fr>
1642
1643 * src/state.h (reductions_t): Rename member `nreds' as num.
1644 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
1645 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
1646
16472002-06-30 Akim Demaille <akim@epita.fr>
1648
1649 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
1650 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
1651 (shifts_to): Rename as...
1652 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
1653 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
1654 (TRANSITION_IS_DISABLED, transitions_to): these.
1655
16562002-06-30 Akim Demaille <akim@epita.fr>
1657
1658 * src/print.c (print_shifts, print_gotos): Merge into...
1659 (print_transitions): this.
1660 (print_transitions, print_errs, print_reductions): Align the
1661 lookaheads columns.
1662 (print_core, print_transitions, print_errs, print_state,
1663 print_grammar): Output empty lines separator before, not after.
1664 (state_default_rule_compute): Rename as...
1665 (state_default_rule): this.
1666 * tests/conflicts.at (Defaulted Conflicted Reduction),
1667 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
1668 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
1669
16702002-06-30 Akim Demaille <akim@epita.fr>
1671
1672 Display items as we display rules.
1673
1674 * src/gram.h, src/gram.c (rule_lhs_print): New.
1675 * src/gram.c (grammar_rules_partial_print): Use it.
1676 * src/print.c (print_core): Likewise.
1677 * tests/conflicts.at (Defaulted Conflicted Reduction),
1678 (Unresolved SR Conflicts): Adjust.
1679 (Unresolved SR Conflicts): Adjust and rename as...
1680 (Resolved SR Conflicts): this, as was meant.
1681 * tests/regression.at (Web2c Report): Adjust.
1682
16832002-06-30 Akim Demaille <akim@epita.fr>
1684
1685 * src/print.c (state_default_rule_compute): New, extracted from...
1686 (print_reductions): here.
1687 Pessimize, but clarify the code.
1688 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
1689
16902002-06-30 Akim Demaille <akim@epita.fr>
1691
1692 * src/output.c (action_row): Let default_rule be always a rule
1693 number.
1694
16952002-06-30 Akim Demaille <akim@epita.fr>
1696
1697 * src/closure.c (print_firsts, print_fderives, closure):
1698 Use BITSET_EXECUTE.
1699 * src/lalr.c (lookaheads_print): Likewise.
1700 * src/state.c (state_rule_lookaheads_print): Likewise.
1701 * src/print_graph.c (print_core): Likewise.
1702 * src/print.c (print_reductions): Likewise.
1703 * src/output.c (action_row): Likewise.
1704 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
1705
17062002-06-30 Akim Demaille <akim@epita.fr>
1707
1708 * src/print_graph.c: Use report_flag.
1709
17102002-06-30 Akim Demaille <akim@epita.fr>
1711
1712 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
1713 to...
1714 * src/relation.h, src/relation.c (traverse, relation_digraph)
1715 (relation_print, relation_transpose): New.
1716
17172002-06-30 Akim Demaille <akim@epita.fr>
1718
1719 * src/state.h, src/state.c (shifts_to): New.
1720 * src/lalr.c (build_relations): Use it.
1721
17222002-06-30 Akim Demaille <akim@epita.fr>
1723
1724 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
1725 (item_number_of_rule_number, rule_number_of_item_number): New.
1726 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
1727 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
1728 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
1729 Propagate their use.
1730 Much remains to be done, in particular wrt `shorts' from types.h.
1731
17322002-06-30 Akim Demaille <akim@epita.fr>
1733
1734 * src/symtab.c (symbol_new): Initialize the `printer' member.
1735
17362002-06-30 Akim Demaille <akim@epita.fr>
1737
1738 * src/LR0.c (save_reductions): Remove, replaced by...
1739 * src/state.h, src/state.c (state_reductions_set): New.
1740 (reductions, errs): Rename as...
1741 (reductions_t, errs_t): these.
1742 Adjust all dependencies.
1743
17442002-06-30 Akim Demaille <akim@epita.fr>
1745
1746 * src/LR0.c (state_list_t, state_list_append): New.
1747 (first_state, last_state): Now symbol_list_t.
1748 (this_state): Remove.
1749 (new_itemsets, append_states, save_reductions): Take a state_t as
1750 argument.
1751 (set_states, generate_states): Adjust.
1752 (save_shifts): Remove, replaced by...
1753 * src/state.h, src/state.c (state_shifts_set): New.
1754 (shifts): Rename as...
1755 (shifts_t): this.
1756 Adjust all dependencies.
1757 * src/state.h (state_t): Remove the `next' member.
1758
17592002-06-30 Akim Demaille <akim@epita.fr>
1760
1761 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
1762 escaped in slot 0.
1763
17642002-06-30 Akim Demaille <akim@epita.fr>
1765
1766 Use hash.h for the state hash table.
1767
1768 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
1769 (allocate_storage): Use state_hash_new.
1770 (free_storage): Use state_hash_free.
1771 (new_state, get_state): Adjust.
1772 * src/lalr.h, src/lalr.c (states): Move to...
1773 * src/states.h (state_t): Remove the `link' member, no longer
1774 used.
1775 * src/states.h, src/states.c: here.
1776 (state_hash_new, state_hash_free, state_hash_lookup)
1777 (state_hash_insert, states_free): New.
1778 * src/states.c (state_table, state_compare, state_hash): New.
1779 * src/output.c (output_actions): Do not free states now, since we
1780 still need to know the final_state number in `prepare', called
1781 afterwards. Do it...
1782 * src/main.c (main): here: call states_free after `output'.
1783
17842002-06-30 Akim Demaille <akim@epita.fr>
1785
1786 * src/state.h, src/state.c (state_new): New, extracted from...
1787 * src/LR0.c (new_state): here.
1788 * src/state.h (STATE_ALLOC): Move to...
1789 * src/state.c: here.
1790 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
1791 * src/state.h, src/state.c: here.
1792
17932002-06-30 Akim Demaille <akim@epita.fr>
1794
1795 * src/reader.c (gensym): Rename as...
1796 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
1797 (getsym): Rename as...
1798 (symbol_get): this.
1799
18002002-06-30 Akim Demaille <akim@epita.fr>
1801
1802 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
1803 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
1804 * src/output.c, src/print.c, src/print_graph.c: Propagate.
1805 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
1806
18072002-06-30 Akim Demaille <akim@epita.fr>
1808
1809 Make the test suite pass with warnings checked.
1810
1811 * tests/actions.at (Printers and Destructors): Improve.
1812 Avoid unsigned vs. signed issues.
1813 * tests/calc.at: Don't exercise the scanner here, do it...
1814 * tests/input.at (Torturing the Scanner): here.
1815
18162002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1817
1818 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
1819 reorganize first lines parallel to yacc.c.
1820
18212002-06-28 Akim Demaille <akim@epita.fr>
1822
1823 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
1824 (b4_token_enum, b4_token_defines): New, factored from...
1825 * data/lalr1.cc, data/yacc.c, glr.c: here.
1826
18272002-06-28 Akim Demaille <akim@epita.fr>
1828
1829 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
1830 unused variables.
1831 * src/output.c (merger_output): static.
1832
18332002-06-28 Akim Demaille <akim@epita.fr>
1834
1835 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
1836 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
1837 pacify GCC.
1838 * src/output.c (save_row): Initialize all the variables to pacify GCC.
1839
18402002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1841
1842 Accumulated changelog for new GLR parsing features.
1843
1844 * src/conflicts.c (count_total_conflicts): Change name to
1845 conflicts_total_count.
1846 * src/conflicts.h: Ditto.
1847 * src/output.c (token_actions): Use the new name.
1848 (output_conflicts): Change conflp => conflict_list_heads, and
1849 confl => conflict_list for better readability.
1850 * data/glr.c: Use the new names.
1851 * NEWS: Add self to GLR announcement.
1852
1853 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
1854
1855 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
1856 Akim Demaille.
1857
1858 * data/bison.glr: Change name to glr.c
1859 * data/glr.c: Renamed from bison.glr.
1860 * data/Makefile.am: Add glr.c
1861
1862 * src/getargs.c:
1863
1864 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
1865 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
1866
1867 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1868
1869 * data/bison.glr: Be sure to restore the
1870 current #line when returning to the skeleton contents after having
1871 exposed the input file's #line.
1872
1873 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1874
1875 * data/bison.glr: Bring up to date with changes to bison.simple.
1876
1877 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1878
1879 * data/bison.glr: Correct definitions that use b4_prefix.
1880 Various reformatting.
1881 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
1882 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
1883 yytokenp argument; now part of stack.
1884 (yychar): Define to behave as documented.
1885 (yyclearin): Ditto.
1886
1887 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1888
1889 * src/reader.h: Add declaration for free_merger_functions.
1890
1891 * src/reader.c (merge_functions): New variable.
1892 (get_merge_function): New function.
1893 (free_merger_functions): New function.
1894 (readgram): Check for %prec that is not followed by a symbol.
1895 Handle %dprec and %merge declarations.
1896 (packgram): Initialize dprec and merger fields in rules array.
1897
1898 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
1899 conflict_list_cnt, conflict_list_free): New variables.
1900 (table_grow): Also grow conflict_table.
1901 (prepare_rules): Output dprec and merger tables.
1902 (conflict_row): New function.
1903 (action_row): Output conflict lists for GLR parser. Don't use
1904 default reduction in conflicted states for GLR parser so that there
1905 are spaces for the conflict lists.
1906 (save_row): Also save conflict information.
1907 (token_actions): Allocate conflict list.
1908 (merger_output): New function.
1909 (pack_vector): Pack conflict table, too.
1910 (output_conflicts): New function to output yyconflp and yyconfl.
1911 (output_check): Allocate conflict_tos.
1912 (output_actions): Output conflict tables, also.
1913 (output_skeleton): Output b4_mergers definition.
1914 (prepare): Output b4_max_rhs_length definition.
1915 Use 'bison.glr' as default skeleton for GLR parsers.
1916
1917 * src/gram.c (glr_parser): New flag.
1918 (grammar_free): Call free_merger_functions.
1919
1920 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
1921 all pairs of conflicting reductions, rather than just all tokens
1922 causing conflicts. Needed to size conflict tables.
1923 (conflicts_output): Modify call to count_rr_conflicts for new
1924 interface.
1925 (conflicts_print): Ditto.
1926 (count_total_conflicts): New function.
1927
1928 * src/reader.h (merger_list): New type.
1929 (merge_functions): New variable.
1930
1931 * src/lex.h (tok_dprec, tok_merge): New token types.
1932
1933 * src/gram.h (rule_s): Add dprec and merger fields.
1934 (glr_parser): New flag.
1935
1936 * src/conflicts.h (count_total_conflicts): New function.
1937
1938 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
1939
1940 * doc/bison.texinfo (Generalized LR Parsing): New section.
1941 (GLR Parsers): New section.
1942 (Language and Grammar): Mention GLR parsing.
1943 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
1944 Correct typo ("tge" -> "the").
1945
1946 * data/bison.glr: New skeleton for GLR parsing.
1947
1948 * tests/cxx-gram.at: New tests for GLR parsing.
1949
1950 * tests/testsuite.at: Include cxx-gram.at.
1951
1952 * tests/Makefile.am: Add cxx-gram.at.
1953
1954 * src/parse-gram.y:
1955
1956 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
1957
1958 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
1959
19602002-06-27 Akim Demaille <akim@epita.fr>
1961
1962 * src/options.h, src/options.c: Remove.
1963 * src/getargs.c (short_options, long_options): New.
1964
19652002-06-27 Akim Demaille <akim@epita.fr>
1966
1967 * data/bison.simple, data/bison.c++: Rename as...
1968 * data/yacc.c, data/lalr1.cc: these.
1969 * doc/bison.texinfo (Environment Variables): Remove.
1970
19712002-06-25 Raja R Harinath <harinath@cs.umn.edu>
1972
1973 * src/getargs.c (report_argmatch): Initialize strtok().
1974
19752002-06-20 Akim Demaille <akim@epita.fr>
1976
1977 * data/bison.simple (b4_symbol_actions): New, replaces...
1978 (b4_symbol_destructor, b4_symbol_printer): these.
1979 (yysymprint): Be sure to call YYPRINT only for tokens, and using
1980 user token numbers.
1981
19822002-06-20 Akim Demaille <akim@epita.fr>
1983
1984 * data/bison.simple (yydestructor): Rename as...
1985 (yydestruct): this.
1986
19872002-06-20 Akim Demaille <akim@epita.fr>
1988
1989 * src/symtab.h, src/symtab.c (symbol_type_set)
1990 (symbol_destructor_set, symbol_precedence_set): The location is
1991 the last argument.
1992 Adjust all callers.
1993
19942002-06-20 Akim Demaille <akim@epita.fr>
1995
1996 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
1997 internals.
1998 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
1999 Takes a location.
2000 * src/symtab.h, src/symtab.c (symbol_class_set)
2001 (symbol_user_token_number_set): Likewise.
2002 Adjust all callers.
2003 Promote complain_at.
2004 * tests/input.at (Type Clashes): Adjust.
2005
20062002-06-20 Akim Demaille <akim@epita.fr>
2007
2008 * data/bison.simple (YYLEX): Fix the declaration when
2009 %pure-parser.
2010
20112002-06-20 Akim Demaille <akim@epita.fr>
2012
2013 * data/bison.simple (yysymprint): Don't print the token number,
2014 just its name.
2015 * tests/actions.at (Destructors): Rename as...
2016 (Printers and Destructors): this.
2017 Also exercise %printer.
2018
20192002-06-20 Akim Demaille <akim@epita.fr>
2020
2021 * data/bison.simple (YYDSYMPRINT): New.
2022 Use it to remove many of the #if YYDEBUG/if (yydebug).
2023
20242002-06-20 Akim Demaille <akim@epita.fr>
2025
2026 * src/symtab.h, src/symtab.c (symbol_t): printer and
2027 printer_location are new members.
2028 (symbol_printer_set): New.
2029 * src/parse-gram.y (PERCENT_PRINTER): New token.
2030 Handle its associated rule.
2031 * src/scan-gram.l: Adjust.
2032 (handle_destructor_at, handle_destructor_dollar): Rename as...
2033 (handle_symbol_code_at, handle_symbol_code_dollar): these.
2034 * src/output.c (symbol_printers_output): New.
2035 (output_skeleton): Call it.
2036 * data/bison.simple (yysymprint): New. Cannot be named yyprint
2037 since there are already many grammar files with a user `yyprint'.
2038 Replace the calls to YYPRINT to calls to yysymprint.
2039 * tests/calc.at: Adjust.
2040 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
2041 taking advantage of parser very internal details (stack size!).
2042
20432002-06-20 Akim Demaille <akim@epita.fr>
2044
2045 * src/scan-gram.l: Complete the scanner with the missing patterns
2046 to pacify Flex.
2047 Use `quote' and `symbol_tag_get' where appropriate.
2048
20492002-06-19 Akim Demaille <akim@epita.fr>
2050
2051 * tests/actions.at (Destructors): Augment to test locations.
2052 * data/bison.simple (yydestructor): Pass it the current location
2053 if locations are enabled.
2054 Prototype only when __STDC__ or C++.
2055 Change the argument names to move into the yy name space: there is
2056 user code here.
2057
20582002-06-19 Akim Demaille <akim@epita.fr>
2059
2060 * data/bison.simple (b4_pure_if): New.
2061 Use it instead of #ifdef YYPURE.
2062
20632002-06-19 Akim Demaille <akim@epita.fr>
2064
2065 * data/bison.simple (b4_location_if): New.
2066 Use it instead of #ifdef YYLSP_NEEDED.
2067
20682002-06-19 Akim Demaille <akim@epita.fr>
2069
2070 Prepare @$ in %destructor, but currently don't bind it in the
2071 skeleton, as %location use is not cleaned up yet.
2072
2073 * src/scan-gram.l (handle_dollar, handle_destructor_at)
2074 (handle_action_at): New.
2075 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
2076 a braced_code_t and a location as additional arguments.
2077 (handle_destructor_dollar): Instead of requiring `b4_eval', just
2078 unquote one when outputting `b4_dollar_dollar'.
2079 Adjust callers.
2080 * data/bison.simple (b4_eval): Remove.
2081 (b4_symbol_destructor): Adjust.
2082 * tests/input.at (Invalid @n): Adjust.
2083
20842002-06-19 Zack Weinberg <zack@codesourcery.com>
2085
2086 * doc/bison.texinfo: Document ability to have multiple
2087 prologue sections.
2088
20892002-06-18 Akim Demaille <akim@epita.fr>
2090
2091 * src/files.c (compute_base_names): When computing the output file
2092 names from the input file name, strip the directory part.
2093
20942002-06-18 Akim Demaille <akim@epita.fr>
2095
2096 * data/bison.simple.new: Comment changes.
2097 Reported by Andreas Schwab.
2098
20992002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
2100
2101 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
2102 there are no `label `yyoverflowlab' defined but not used' warnings
2103 when yyoverflow is defined.
2104
21052002-06-18 Akim Demaille <akim@epita.fr>
2106
2107 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
2108 new member.
2109 (symbol_destructor_set): Adjust.
2110 * src/output.c (symbol_destructors_output): Output the destructor
2111 locations.
2112 Output the symbol name.
2113 * data/bison.simple (b4_symbol_destructor): Adjust.
2114
21152002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
2116 and Akim Demaille <akim@epita.fr>
2117
2118 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
2119 what's left on the stack when the error recovery hits EOF.
2120 * tests/actions.at (Destructors): Complete to exercise this case.
2121
21222002-06-17 Akim Demaille <akim@epita.fr>
2123
2124 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
2125 arguments is really empty, not only equal to `[]'.
2126 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
2127 member.
2128 (symbol_destructor_set): New.
2129 * src/output.c (symbol_destructors_output): New.
2130 * src/reader.h (brace_code_t, current_braced_code): New.
2131 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
2132 (handle_dollar): Rename as...
2133 (handle_action_dollar): this.
2134 (handle_destructor_dollar): New.
2135 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
2136 (grammar_declaration): Use it.
2137 * data/bison.simple (yystos): Is always defined.
2138 (yydestructor): New.
2139 * tests/actions.at (Destructors): New.
2140 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
2141
21422002-06-17 Akim Demaille <akim@epita.fr>
2143
2144 * src/symlist.h, src/symlist.c (symbol_list_length): New.
2145 * src/scan-gram.l (handle_dollar, handle_at): Compute the
2146 rule_length only when needed.
2147 * src/output.c (actions_output, token_definitions_output): Output
2148 the full M4 block.
2149 * src/symtab.c: Don't access directly to the symbol tag, use
2150 symbol_tag_get.
2151 * src/parse-gram.y: Use symbol_list_free.
2152
21532002-06-17 Akim Demaille <akim@epita.fr>
2154
2155 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
2156 (symbol_list_prepend, get_type_name): Move to...
2157 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
2158 (symbol_list_prepend, symbol_list_n_type_name_get): here.
2159 Adjust all callers.
2160 (symbol_list_free): New.
2161 * src/scan-gram.l (handle_dollar): Takes a location.
2162 * tests/input.at (Invalid $n): Adjust.
2163
21642002-06-17 Akim Demaille <akim@epita.fr>
2165
2166 * src/reader.h, src/reader.c (symbol_list_new): Export it.
2167 (symbol_list_prepend): New.
2168 * src/parse-gram.y (%union): `list' is a new member.
2169 (symbols.1): New, replaces...
2170 (terms_to_prec.1, nterms_to_type.1): these.
2171 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
2172 Take a location as additional argument.
2173 Adjust all callers.
2174
21752002-06-15 Akim Demaille <akim@epita.fr>
2176
2177 * src/parse-gram.y: Move %token in the declaration section so that
2178 we don't depend upon CVS Bison.
2179
21802002-06-15 Akim Demaille <akim@epita.fr>
2181
2182 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
2183 * src/print.c (print_core): Use it.
2184
21852002-06-15 Akim Demaille <akim@epita.fr>
2186
2187 * src/conflicts.c (log_resolution): Accept the rule involved in
2188 the sr conflicts instead of the lookahead number that points to
2189 that rule.
2190 (flush_reduce): Accept the current lookahead vector as argument,
2191 instead of the index in LA.
2192 (resolve_sr_conflict): Accept the current number of lookahead
2193 bitset to consider for the STATE, instead of the index in LA.
2194 (set_conflicts): Adjust.
2195 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
2196
21972002-06-15 Akim Demaille <akim@epita.fr>
2198
2199 * src/state.h (state_t): Replace the `lookaheadsp' member, a
2200 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
2201 Adjust all dependencies.
2202 * src/lalr.c (initialize_lookaheads): Split into...
2203 (states_lookaheads_count, states_lookaheads_initialize): these.
2204 (lalr): Adjust.
2205
22062002-06-15 Akim Demaille <akim@epita.fr>
2207
2208 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
2209 out of...
2210 (grammar_rules_print): here.
2211 * src/reduce.c (reduce_output): Use it.
2212 * tests/reduce.at (Useless Rules, Reduced Automaton)
2213 (Underivable Rules): Adjust.
2214
22152002-06-15 Akim Demaille <akim@epita.fr>
2216
2217 Copy BYacc's nice way to report the grammar.
2218
2219 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
2220 New.
2221 Don't print the rules' location, it is confusing and useless.
2222 (rule_print): Use grammar_rhs_print.
2223 * src/print.c (print_grammar): Use grammar_rules_print.
2224
22252002-06-15 Akim Demaille <akim@epita.fr>
2226
2227 Complete and rationalize `useless thing' warnings.
2228
2229 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
2230 (symbol_tag_print): New.
2231 Use them everywhere in place of accessing directly the tag member.
2232 * src/gram.h, src/gram.c (rule_print): New.
2233 Use it where a rule used to be printed `by hand'.
2234 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
2235 (reduce_grammar_tables): Report the useless rules.
2236 (reduce_print): Useless things are a warning, not an error.
2237 Report it as such.
2238 * tests/reduce.at (Useless Nonterminals, Useless Rules):
2239 (Reduced Automaton, Underivable Rules): Adjust.
2240 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
2241 * tests/conflicts.at (Unresolved SR Conflicts)
2242 (Solved SR Conflicts): Adjust.
2243
22442002-06-15 Akim Demaille <akim@epita.fr>
2245
2246 Let symbols have a location.
2247
2248 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
2249 (getsym): Adjust.
2250 Adjust all callers.
2251 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
2252 Use location_t, not int.
2253 * src/symtab.c (symbol_check_defined): Take advantage of the
2254 location.
2255 * tests/regression.at (Invalid inputs): Adjust.
2256
22572002-06-15 Akim Demaille <akim@epita.fr>
2258
2259 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
2260 (input): Don't try to initialize yylloc here, do it in the
2261 scanner.
2262 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
2263 * src/gram.h (rule_t): Change line and action_line into location
2264 and action_location, of location_t type.
2265 Adjust all dependencies.
2266 * src/location.h, src/location.c (empty_location): New.
2267 * src/reader.h, src/reader.c (grammar_start_symbol_set)
2268 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
2269 (grammar_current_rule_symbol_append)
2270 (grammar_current_rule_action_append): Expect a location as argument.
2271 * src/reader.c (grammar_midrule_action): Adjust to attach an
2272 action's location as dummy symbol location.
2273 * src/symtab.h, src/symtab.c (startsymbol_location): New.
2274 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
2275 the line numbers.
2276
22772002-06-14 Akim Demaille <akim@epita.fr>
2278
2279 Grammar declarations may be found in the grammar section.
2280
2281 * src/parse-gram.y (rules_or_grammar_declaration): New.
2282 (declarations): Each declaration may end with a semicolon, not
2283 just...
2284 (grammar_declaration): `"%union"'.
2285 (grammar): Branch to rules_or_grammar_declaration.
2286
22872002-06-14 Akim Demaille <akim@epita.fr>
2288
2289 * src/main.c (main): Invoke scanner_free.
2290
22912002-06-14 Akim Demaille <akim@epita.fr>
2292
2293 * src/output.c (m4_invoke): Extracted from...
2294 (output_skeleton): here.
2295 Free tempfile.
2296
22972002-06-14 Akim Demaille <akim@epita.fr>
2298
2299 * src/parse-gram.y (directives, directive, gram)
2300 (grammar_directives, precedence_directives, precedence_directive):
2301 Rename as...
2302 (declarations, declaration, grammar, grammar_declaration)
2303 (precedence_declaration, precedence_declarator): these.
2304 (symbol_declaration): New.
2305
23062002-06-14 Akim Demaille <akim@epita.fr>
2307
2308 * src/files.c (action_obstack): Remove, unused.
2309 (output_obstack): Remove it, and all its dependencies, as it is no
2310 longer needed.
2311 * src/reader.c (epilogue_set): Build the epilogue in the
2312 muscle_obstack.
2313 * src/output.h, src/output.c (muscle_obstack): Move to...
2314 * src/muscle_tab.h, src/muscle_tab.h: here.
2315 (muscle_init): Initialize muscle_obstack.
2316 (muscle_free): New.
2317 * src/main.c (main): Call it.
2318
23192002-06-14 Akim Demaille <akim@epita.fr>
2320
2321 * src/location.h: New, extracted from...
2322 * src/reader.h: here.
2323 * src/Makefile.am (noinst_HEADERS): Merge into
2324 (bison_SOURCES): this.
2325 Add location.h.
2326 * src/parse-gram.y: Use location_t instead of Bison's.
2327 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
2328 Use location_t instead of ints.
2329
23302002-06-14 Akim Demaille <akim@epita.fr>
2331
2332 * data/bison.simple, data/bison.c++: Be sure to restore the
2333 current #line when returning to the skeleton contents after having
2334 exposed the input file's #line.
2335
23362002-06-12 Akim Demaille <akim@epita.fr>
2337
2338 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
2339 eager.
2340 * tests/actions.at (Exotic Dollars): New.
2341
23422002-06-12 Akim Demaille <akim@epita.fr>
2343
2344 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
2345 ['"/] too eagerly.
2346 * tests/input.at (Torturing the Scanner): New.
2347
23482002-06-11 Akim Demaille <akim@epita.fr>
2349
2350 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
2351 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
2352 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
2353 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
2354 * src/reader.c (reader): Use it.
2355
23562002-06-11 Akim Demaille <akim@epita.fr>
2357
2358 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
2359 Adjust all callers.
2360 (scanner_last_string_free): New.
2361
23622002-06-11 Akim Demaille <akim@epita.fr>
2363
2364 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
2365 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
2366 (last_string, YY_OBS_FREE): New.
2367 Use them when returning an ID.
2368
23692002-06-11 Akim Demaille <akim@epita.fr>
2370
2371 Have Bison grammars parsed by a Bison grammar.
2372
2373 * src/reader.c, src/reader.h (prologue_augment): New.
2374 * src/reader.c (copy_definition): Remove.
2375
2376 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
2377 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
2378 (grammar_current_rule_prec_set, grammar_current_rule_check)
2379 (grammar_current_rule_symbol_append)
2380 (grammar_current_rule_action_append): Export.
2381 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
2382 (symbol_list_action_append): Remove.
2383 Hook the routines from reader.
2384 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
2385 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
2386
2387 * src/reader.c (read_declarations): Remove, unused.
2388
2389 * src/parse-gram.y: Handle the epilogue.
2390 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
2391 (grammar_start_symbol_set): this.
2392 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
2393 * src/reader.c (readgram): Remove, unused.
2394 (reader): Adjust to insert eoftoken and axiom where appropriate.
2395
2396 * src/reader.c (copy_dollar): Replace with...
2397 * src/scan-gram.h (handle_dollar): this.
2398 * src/parse-gram.y: Remove `%thong'.
2399
2400 * src/reader.c (copy_at): Replace with...
2401 * src/scan-gram.h (handle_at): this.
2402
2403 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
2404 New.
2405
2406 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
2407 time being.
2408
2409 * src/reader.h, src/reader.c (grammar_rule_end): New.
2410
2411 * src/parse.y (current_type, current_class): New.
2412 Implement `%nterm', `%token' support.
2413 Merge `%term' into `%token'.
2414 (string_as_id): New.
2415 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
2416 type name.
2417
2418 * src/parse-gram.y: Be sure to handle properly the beginning of
2419 rules.
2420
2421 * src/parse-gram.y: Handle %type.
2422 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
2423
2424 * src/parse-gram.y: More directives support.
2425 * src/options.c: No longer handle source directives.
2426
2427 * src/parse-gram.y: Fix %output.
2428
2429 * src/parse-gram.y: Handle %union.
2430 Use the prologue locations.
2431 * src/reader.c (parse_union_decl): Remove.
2432
2433 * src/reader.h, src/reader.c (epilogue_set): New.
2434 * src/parse-gram.y: Use it.
2435
2436 * data/bison.simple, data/bison.c++: b4_stype is now either not
2437 defined, then default to int, or to the contents of %union,
2438 without `union' itself.
2439 Adjust.
2440 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
2441
2442 * src/output.c (actions_output): Don't output braces, as they are
2443 already handled by the scanner.
2444
2445 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
2446 characters to themselves.
2447
2448 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
2449 that the epilogue has a proper #line.
2450
2451 * src/parse-gram.y: Handle precedence/associativity.
2452
2453 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
2454 a terminal.
2455 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
2456 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
2457 at all to define terminals that cannot be emitted.
2458
2459 * src/scan-gram.l: Escape M4 characters.
2460
2461 * src/scan-gram.l: Working properly with escapes in user
2462 strings/characters.
2463
2464 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
2465 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
2466 grammar.
2467 Use more modest sizes, as for the time being the parser does not
2468 release memory, and therefore the process swallows a huge amount
2469 of memory.
2470
2471 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
2472 stricter %token grammar.
2473
2474 * src/symtab.h (associativity): Add `undef_assoc'.
2475 (symbol_precedence_set): Do nothing when passed an undef_assoc.
2476 * src/symtab.c (symbol_check_alias_consistence): Adjust.
2477
2478 * tests/regression.at (Invalid %directive): Remove, as it is now
2479 meaningless.
2480 (Invalid inputs): Adjust to the new error messages.
2481 (Token definitions): The new grammar doesn't allow too many
2482 eccentricities.
2483
2484 * src/lex.h, src/lex.c: Remove.
2485 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
2486 (copy_character, copy_string2, copy_string, copy_identifier)
2487 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
2488 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
2489 (parse_action): Remove.
2490 * po/POTFILES.in: Adjust.
2491
24922002-06-11 Akim Demaille <akim@epita.fr>
2493
2494 * src/reader.c (parse_action): Don't store directly into the
2495 rule's action member: return the action as a string.
2496 Don't require `rule_length' as an argument: compute it.
2497 (grammar_current_rule_symbol_append)
2498 (grammar_current_rule_action_append): New, eved out from
2499 (readgram): here.
2500 Remove `action_flag', `rulelength', unused now.
2501
25022002-06-11 Akim Demaille <akim@epita.fr>
2503
2504 * src/reader.c (grammar_current_rule_prec_set).
2505 (grammar_current_rule_check): New, eved out from...
2506 (readgram): here.
2507 Remove `xaction', `first_rhs': useless.
2508 * tests/input.at (Type clashes): New.
2509 * tests/existing.at (GNU Cim Grammar): Adjust.
2510
25112002-06-11 Akim Demaille <akim@epita.fr>
2512
2513 * src/reader.c (grammar_midrule_action): New, Eved out from
2514 (readgram): here.
2515
25162002-06-11 Akim Demaille <akim@epita.fr>
2517
2518 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
2519 New.
2520 (readgram): Use them as replacement of inlined code, crule and
2521 crule1.
2522
25232002-06-11 Akim Demaille <akim@epita.fr>
2524
2525 * src/reader.c (grammar_end, grammar_symbol_append): New.
2526 (readgram): Use them.
2527 Make the use of `p' as local as possible.
2528
25292002-06-10 Akim Demaille <akim@epita.fr>
2530
2531 GCJ's parser requires the tokens to be defined before the prologue.
2532
2533 * data/bison.simple: Output the token definition before the user's
2534 prologue.
2535 * tests/regression.at (Braces parsing, Duplicate string)
2536 (Mixing %token styles): Check the output from bison.
2537 (Early token definitions): New.
2538
25392002-06-10 Akim Demaille <akim@epita.fr>
2540
2541 * src/symtab.c (symbol_user_token_number_set): Don't complain when
2542 assigning twice the same user number to a token, so that we can
2543 use it in...
2544 * src/lex.c (lex): here.
2545 Also use `symbol_class_set' instead of hand written code.
2546 * src/reader.c (parse_assoc_decl): Likewise.
2547
25482002-06-10 Akim Demaille <akim@epita.fr>
2549
2550 * src/symtab.c, src/symtab.c (symbol_class_set)
2551 (symbol_user_token_number_set): New.
2552 * src/reader.c (parse_token_decl): Use them.
2553 Use a switch instead of ifs.
2554 Use a single argument.
2555
25562002-06-10 Akim Demaille <akim@epita.fr>
2557
2558 Remove `%thong' support as it is undocumented, unused, duplicates
2559 `%token's job, and creates useless e-mail traffic with people who
2560 want to know what it is, why it is undocumented, unused, and
2561 duplicates `%token's job.
2562
2563 * src/reader.c (parse_thong_decl): Remove.
2564 * src/options.c (option_table): Remove "thong".
2565 * src/lex.h (tok_thong): Remove.
2566
25672002-06-10 Akim Demaille <akim@epita.fr>
2568
2569 * src/symtab.c, src/symtab.c (symbol_type_set)
2570 (symbol_precedence_set): New.
2571 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
2572 (value_components_used): Remove, unused.
2573
25742002-06-09 Akim Demaille <akim@epita.fr>
2575
2576 Move symbols handling code out of the reader.
2577
2578 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
2579 (axiom): Move to...
2580 * src/symtab.h, src/symtab.c: here.
2581
2582 * src/gram.c (start_symbol): Remove: use startsymbol->number.
2583 * src/reader.c (startval): Rename as...
2584 * src/symtab.h, src/symtab.c (startsymbol): this.
2585 * src/reader.c: Adjust.
2586
2587 * src/reader.c (symbol_check_defined, symbol_make_alias)
2588 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
2589 (token_translations_init)
2590 Move to...
2591 * src/symtab.c: here.
2592 * src/reader.c (packsymbols): Move to...
2593 * src/symtab.h, src/symtab.c (symbols_pack): here.
2594 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
2595 argument.
2596
25972002-06-03 Akim Demaille <akim@epita.fr>
2598
2599 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
2600 then statements.
2601
26022002-06-03 Akim Demaille <akim@epita.fr>
2603
2604 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
2605 structs with non literals.
2606 * src/scan-skel.l: never-interactive.
2607 * src/conflicts.c (enum conflict_resolution_e): No trailing
2608 comma.
2609 * src/getargs.c (usage): Split long literal strings.
2610 Reported by Hans Aberg.
2611
26122002-05-28 Akim Demaille <akim@epita.fr>
2613
2614 * data/bison.c++: Use C++ ostreams.
2615 (cdebug_): New member.
2616
26172002-05-28 Akim Demaille <akim@epita.fr>
2618
2619 * src/output.c (output_skeleton): Be sure to allocate enough room
2620 for `/' _and_ for `\0' in full_skeleton.
2621
26222002-05-28 Akim Demaille <akim@epita.fr>
2623
2624 * data/bison.c++: Catch up with bison.simple:
2625 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2626 and Paul Eggert <eggert@twinsun.com>: `error' handing.
2627 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
2628 and popping traces.
2629
26302002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2631
2632 * src/output.c (output_skeleton): Put an explicit path in front of
2633 the skeleton file name, rather than relying on the -I directory,
2634 to partially alleviate effects of having a skeleton file lying around
2635 in the current directory.
2636
26372002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2638
2639 * src/conflicts.c (log_resolution): Correct typo:
2640 obstack_printf should be obstack_fgrow1.
2641
26422002-05-26 Akim Demaille <akim@epita.fr>
2643
2644 * src/state.h (state_t): `solved_conflicts' is a new member.
2645 * src/LR0.c (new_state): Set it to 0.
2646 * src/conflicts.h, src/conflicts.c (print_conflicts)
2647 (free_conflicts, solve_conflicts): Rename as...
2648 (conflicts_print, conflicts_free, conflicts_solve): these.
2649 Adjust callers.
2650 * src/conflicts.c (enum conflict_resolution_e)
2651 (solved_conflicts_obstack): New, used by...
2652 (log_resolution): this.
2653 Adjust to attach the conflict resolution to each state.
2654 Complete the description with the precedence/associativity
2655 information.
2656 (resolve_sr_conflict): Adjust.
2657 * src/print.c (print_state): Output its solved_conflicts.
2658 * tests/conflicts.at (Unresolved SR Conflicts)
2659 (Solved SR Conflicts): Exercise --report=all.
2660
26612002-05-26 Akim Demaille <akim@epita.fr>
2662
2663 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2664 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
2665 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
2666 (token_number_t, item_number_as_token_number)
2667 (token_number_as_item_number, muscle_insert_token_number_table):
2668 Rename as...
2669 (symbol_number_t, item_number_as_symbol_number)
2670 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
2671 these, since it is more appropriate.
2672
26732002-05-26 Akim Demaille <akim@epita.fr>
2674
2675 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
2676 `Error:' lines.
2677 * data/bison.simple (yystos) [YYDEBUG]: New.
2678 (yyparse) [YYDEBUG]: Display the symbols which are popped during
2679 error recovery.
2680 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
2681
26822002-05-25 Akim Demaille <akim@epita.fr>
2683
2684 * doc/bison.texinfo (Debugging): Split into...
2685 (Tracing): this new section, its former contents, and...
2686 (Understanding): this new section.
2687 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
2688 by...
2689 (report_flag): this.
2690 Adjust all dependencies.
2691 (report_args, report_types, report_argmatch): New.
2692 (usage, getargs): Report/support -r, --report.
2693 * src/options.h
2694 (struct option_table_struct): Rename as..,
2695 (struct option_table_s): this.
2696 Rename the `set_flag' member to `flag' to match with getopt_long's
2697 struct.
2698 * src/options.c (option_table): Split verbose into an entry for
2699 %verbose, and another for --verbose.
2700 Support --report/-r, so remove -r from the obsolete --raw.
2701 * src/print.c: Attach full item sets and lookaheads reports to
2702 report_flag instead of trace_flag.
2703 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
2704
27052002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2706 and Paul Eggert <eggert@twinsun.com>
2707
2708 * data/bison.simple (yyparse): Correct error handling to conform to
2709 POSIX and yacc. Specifically, after syntax error is discovered,
2710 do not reduce further before shifting the error token.
2711 Clean up the code a bit by removing the labels yyerrdefault,
2712 yyerrhandle, yyerrpop.
2713 * NEWS: Document the above.
2714
27152002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2716
2717 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
2718 type; it isn't always big enough, since it doesn't necessarily
2719 include non-terminals.
2720 (yytranslate): Expand definition of yy_token_number_type, so that
2721 the latter can be removed.
2722 (yy_token_number_type): Remove, only one use.
2723 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
2724 don't use TokenNumberType as element type.
2725
2726 * tests/regression.at: Modify expected output to agree with change
2727 to yyr1 and yytranslate.
2728
27292002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
2730
2731 * src/reader.c (parse_action): Use copy_character instead of
2732 obstack_1grow.
2733
27342002-05-13 Akim Demaille <akim@epita.fr>
2735
2736 * tests/regression.at (Token definitions): Prototype yylex and
2737 yyerror.
2738
27392002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2740
2741 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
2742 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
2743 32-bit arithmetic.
2744 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
2745
27462002-05-07 Akim Demaille <akim@epita.fr>
2747
2748 * tests/synclines.at: Be sure to prototype yylex and yyerror to
2749 avoid GCC warnings.
2750
27512002-05-07 Akim Demaille <akim@epita.fr>
2752
2753 Kill GCC warnings.
2754
2755 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
2756 over the RHS of each rule.
2757 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
2758 * src/state.h (state_t): Member `nitems' is unsigned short.
2759 * src/LR0.c (get_state): Adjust.
2760 * src/reader.c (packgram): Likewise.
2761 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
2762 `Type'.
2763 (muscle_insert_int_table): Remove, unused.
2764 (prepare_rules): Remove `max'.
2765
27662002-05-06 Akim Demaille <akim@epita.fr>
2767
2768 * src/closure.c (print_firsts): Display of the symbol tags.
2769 (bitmatrix_print): Move to...
2770 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
2771 here.
2772 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
2773
27742002-05-06 Akim Demaille <akim@epita.fr>
2775
2776 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
2777 hash_do_for_each.
2778
27792002-05-06 Akim Demaille <akim@epita.fr>
2780
2781 * src/LR0.c (new_state, get_state): Instead of using the global
2782 `kernel_size' and `kernel_base', have two new arguments:
2783 `core_size' and `core'.
2784 Adjust callers.
2785
27862002-05-06 Akim Demaille <akim@epita.fr>
2787
2788 * src/reader.c (packgram): No longer end `ritem' with a 0
2789 sentinel: it is not used.
2790
27912002-05-05 Akim Demaille <akim@epita.fr>
2792
2793 New experimental feature: display the lookaheads in the report and
2794 graph.
2795
2796 * src/print (print_core): When --trace-flag, display the rules
2797 lookaheads.
2798 * src/print_graph.c (print_core): Likewise.
2799 Swap the arguments.
2800 Adjust caller.
2801
28022002-05-05 Akim Demaille <akim@epita.fr>
2803
2804 * tests/torture.at (Many lookaheads): New test.
2805
28062002-05-05 Akim Demaille <akim@epita.fr>
2807
2808 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
2809 (GENERATE_MUSCLE_INSERT_TABLE): this.
2810 (output_int_table, output_unsigned_int_table, output_short_table)
2811 (output_token_number_table, output_item_number_table): Replace with...
2812 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
2813 (muscle_insert_short_table, muscle_insert_token_number_table)
2814 (muscle_insert_item_number_table): these.
2815 Adjust all callers.
2816 (prepare_tokens): Don't free `translations', since...
2817 * src/reader.h, src/reader.c (grammar_free): do it.
2818 Move to...
2819 * src/gram.h, src/gram.c (grammar_free): here.
2820 * data/bison.simple, data/bison.c++: b4_token_number_max is now
2821 b4_translate_max.
2822
28232002-05-05 Akim Demaille <akim@epita.fr>
2824
2825 * src/output.c (output_unsigned_int_table): New.
2826 (prepare_rules): `i' is unsigned.
2827 `prhs', `rline', `r2' are unsigned int.
2828 Rename muscle `rhs_number_max' as `rhs_max'.
2829 Output muscles `prhs_max', `rline_max', and `r2_max'.
2830 Free rline and r1.
2831 * data/bison.simple, data/bison.c++: Adjust to use these muscles
2832 to compute types instead of constant types.
2833 * tests/regression.at (Web2c Actions): Adjust.
2834
28352002-05-04 Akim Demaille <akim@epita.fr>
2836
2837 * src/symtab.h (SALIAS, SUNDEF): Rename as...
2838 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
2839 Adjust dependencies.
2840 * src/output.c (token_definitions_output): Be sure not to output a
2841 `#define 'a'' when fed with `%token 'a' "a"'.
2842 * tests/regression.at (Token definitions): New.
2843
28442002-05-03 Paul Eggert <eggert@twinsun.com>
2845
2846 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
2847 for K&R C.
2848
28492002-05-03 gettextize <bug-gnu-gettext@gnu.org>
2850
2851 * Makefile.am (SUBDIRS): Remove intl.
2852 (EXTRA_DIST): Add config/config.rpath.
2853
28542002-05-03 Akim Demaille <akim@epita.fr>
2855
2856 * data/bison.simple (m4_if): Don't output empty enums.
2857 And actually, output valid enum definitions :(.
2858
28592002-05-03 Akim Demaille <akim@epita.fr>
2860
2861 * configure.bat: Remove, completely obsolete.
2862 * Makefile.am (EXTRA_DIST): Adjust.
2863 Don't distribute config.rpath...
2864 * config/Makefile.am (EXTRA_DIST): Do it.
2865
28662002-05-03 Akim Demaille <akim@epita.fr>
2867
2868 * configure.in (GETTEXT_VERSION): New.
2869 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
2870
28712002-05-03 Akim Demaille <akim@epita.fr>
2872
2873 * data/bison.simple (b4_token_enum): New.
2874 (b4_token_defines): Use it to output tokens both as #define and
2875 enums.
2876 Suggested by Paul Eggert.
2877 * src/output.c (token_definitions_output): Don't output spurious
2878 white spaces.
2879
28802002-05-03 Akim Demaille <akim@epita.fr>
2881
2882 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2883
28842002-05-02 Robert Anisko <robert@lrde.epita.fr>
2885
2886 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
2887 Update the stack class, give a try to deque as the default container.
2888
28892002-05-02 Akim Demaille <akim@epita.fr>
2890
2891 * data/bison.simple (yyparse): Do not implement @$ = @1.
2892 (YYLLOC_DEFAULT): Adjust to do it.
2893 * doc/bison.texinfo (Location Default Action): Fix.
2894
28952002-05-02 Akim Demaille <akim@epita.fr>
2896
2897 * src/reader.c (parse_braces): Merge into...
2898 (parse_action): this.
2899
29002002-05-02 Akim Demaille <akim@epita.fr>
2901
2902 * configure.in (ALL_LINGUAS): Remove.
2903 * po/LINGUAS, hr.po: New.
2904
29052002-05-02 Akim Demaille <akim@epita.fr>
2906
2907 Remove the so called hairy (semantic) parsers.
2908
2909 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
2910 * src/gram.h, src/gram.c (semantic_parser): Remove.
2911 (rule_t): Remove the guard and guard_line members.
2912 * src/lex.h (token_t): remove tok_guard.
2913 * src/options.c (option_table): Remove %guard and %semantic_parser
2914 support.
2915 * src/output.c, src/output.h (guards_output): Remove.
2916 (prepare): Adjust.
2917 (token_definitions_output): Don't output the `T'
2918 tokens (???).
2919 (output_skeleton): Don't output the guards.
2920 * src/files.c, src/files.c (attrsfile): Remove.
2921 * src/reader.c (symbol_list): Remove the guard and guard_line
2922 members.
2923 Adjust dependencies.
2924 (parse_guard): Remove.
2925 * data/bison.hairy: Remove.
2926 * doc/bison.texinfo (Environment Variables): Remove occurrences of
2927 BISON_HAIRY.
2928
29292002-05-02 Akim Demaille <akim@epita.fr>
2930
2931 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
2932 (parse_guard): Rename the formal argument `stack_offset' as
2933 `rule_length', which is more readable.
2934 Adjust callers.
2935 (copy_at, copy_dollar): Instead of outputting the hard coded
2936 values of $$, $n and so forth, output invocation to b4_lhs_value,
2937 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
2938 Note: this patch partially drops `semantic-parser' support: it
2939 always does `rule_length - n', where semantic parsers ought to
2940 always use `-n'.
2941 * data/bison.simple, data/bison.c++ (b4_lhs_value)
2942 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
2943
29442002-05-02 Akim Demaille <akim@epita.fr>
2945
2946 * configure.in (AC_INIT): Bump to 1.49b.
2947 (AM_INIT_AUTOMAKE): Short invocation.
2948
29492002-05-02 Akim Demaille <akim@epita.fr>
2950
2951 Version 1.49a.
2952
29532002-05-01 Akim Demaille <akim@epita.fr>
2954
2955 * src/skeleton.h: Remove.
2956
29572002-05-01 Akim Demaille <akim@epita.fr>
2958
2959 * src/skeleton.h: Fix the #endif.
2960 Reported by Magnus Fromreide.
2961
29622002-04-26 Paul Eggert <eggert@twinsun.com>
2963
2964 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
2965 Define if we define YYSTYPE and YYLTYPE, respectively.
2966 (YYCOPY): Fix [] quoting problem in the non-GCC case.
2967
29682002-04-25 Robert Anisko <robert@lrde.epita.fr>
2969
2970 * src/scan-skel.l: Postprocess quadrigraphs.
2971
2972 * src/reader.c (copy_character): New function, used to output
2973 single characters while replacing `[' and `]' with quadrigraphs, to
2974 avoid troubles with M4 quotes.
2975 (copy_comment): Output characters with copy_character.
2976 (read_additionnal_code): Likewise.
2977 (copy_string2): Likewise.
2978 (copy_definition): Likewise.
2979
2980 * tests/calc.at: Exercise M4 quoting.
2981
29822002-04-25 Akim Demaille <akim@epita.fr>
2983
2984 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
2985 between `!' and the command.
2986 Reported by Paul Eggert.
2987
29882002-04-24 Robert Anisko <robert@lrde.epita.fr>
2989
2990 * tests/calc.at: Exercise prologue splitting.
2991
2992 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
2993 `b4_post_prologue' instead of `b4_prologue'.
2994
2995 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
2996 muscles.
2997 (output): Free pre_prologue_obstack and post_prologue_obstack.
2998 * src/files.h, src/files.c (attrs_obstack): Remove.
2999 (pre_prologue_obstack, post_prologue_obstack): New.
3000 * src/reader.c (copy_definition): Add a parameter to specify the
3001 obstack to fill, instead of using attrs_obstack unconditionally.
3002 (read_declarations): Pass pre_prologue_obstack to copy_definition if
3003 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
3004
30052002-04-23 Paul Eggert <eggert@twinsun.com>
3006
3007 * data/bison.simple: Remove unnecessary commentary and white
3008 space differences from 1_29-branch.
3009 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
3010
3011 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
3012 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
3013 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
3014 constructors or destructors.
3015
3016 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
3017
30182002-04-23 Akim Demaille <akim@epita.fr>
3019
3020 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
3021 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
3022 location with columns.
3023 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
3024 All reported by Paul Eggert.
3025
30262002-04-22 Akim Demaille <akim@epita.fr>
3027
3028 * src/reduce.c (dump_grammar): Move to...
3029 * src/gram.h, src/gram.c (grammar_dump): here.
3030 Be sure to separate long item numbers.
3031 Don't read the members of a rule's prec if its nil.
3032
30332002-04-22 Akim Demaille <akim@epita.fr>
3034
3035 * src/output.c (table_size, table_grow): New.
3036 (MAXTABLE): Remove, replace uses with table_size.
3037 (pack_vector): Instead of dying when the table is too big, grow it.
3038
30392002-04-22 Akim Demaille <akim@epita.fr>
3040
3041 * data/bison.simple (yyr1): Its type is that of a token number.
3042 * data/bison.c++ (r1_): Likewise.
3043 * tests/regression.at (Web2c Actions): Adjust.
3044
30452002-04-22 Akim Demaille <akim@epita.fr>
3046
3047 * src/reader.c (token_translations_init): 256 is now the default
3048 value for the error token, i.e., it will be assigned another
3049 number if the user assigned 256 to one of her tokens.
3050 (reader): Don't force 256 to error.
3051 * doc/bison.texinfo (Symbols): Adjust.
3052 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
3053 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
3054 etc. instead of 10, 20, 30 (which was used to `jump' over error
3055 (256) and undefined (2)).
3056
30572002-04-22 Akim Demaille <akim@epita.fr>
3058
3059 Propagate more token_number_t.
3060
3061 * src/gram.h (token_number_as_item_number)
3062 (item_number_as_token_number): New.
3063 * src/output.c (GENERATE_OUTPUT_TABLE): New.
3064 Use it to create output_item_number_table and
3065 output_token_number_table.
3066 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
3067 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
3068 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
3069 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
3070
30712002-04-22 Akim Demaille <akim@epita.fr>
3072
3073 * src/output.h, src/output.c (get_lines_number): Remove.
3074
30752002-04-19 Akim Demaille <akim@epita.fr>
3076
3077 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
3078 as Lex/Flex'.
3079 (Debugging): More details about enabling the debugging features.
3080 (Table of Symbols): Describe $$, $n, @$, and @n.
3081 Suggested by Tim Josling.
3082
30832002-04-19 Akim Demaille <akim@epita.fr>
3084
3085 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
3086
30872002-04-10 Akim Demaille <akim@epita.fr>
3088
3089 * src/system.h: Rely on HAVE_LIMITS_H.
3090 Suggested by Paul Eggert.
3091
30922002-04-09 Akim Demaille <akim@epita.fr>
3093
3094 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
3095 full stderr, and strip it according to the bison options, instead
3096 of composing the error message from different bits.
3097 This makes it easier to check for several error messages.
3098 Adjust all the invocations.
3099 Add an invocation exercising the error token.
3100 Add an invocation demonstrating a stupid error message.
3101 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
3102 Adjust the tests.
3103 Error message are for stderr, not stdout.
3104
31052002-04-09 Akim Demaille <akim@epita.fr>
3106
3107 * src/gram.h, src/gram.c (error_token_number): Remove, use
3108 errtoken->number.
3109 * src/reader.c (reader): Don't specify the user token number (2)
3110 for $undefined, as it uselessly prevents using it.
3111 * src/gram.h (token_number_t): Move to...
3112 * src/symtab.h: here.
3113 (state_t.number): Is a token_number_t.
3114 * src/print.c, src/reader.c: Use undeftoken->number instead of
3115 hard coded 2.
3116 (Even though this 2 is not the same as above: the number of the
3117 undeftoken remains being 2, it is its user token number which
3118 might not be 2).
3119 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
3120 `user_token_number_max'.
3121 Output `undef_token_number'.
3122 * data/bison.simple, data/bison.c++: Use them.
3123 Be sure to map invalid yylex return values to
3124 `undef_token_number'. This saves us from gratuitous SEGV.
3125
3126 * tests/conflicts.at (Solved SR Conflicts)
3127 (Unresolved SR Conflicts): Adjust.
3128 * tests/regression.at (Web2c Actions): Adjust.
3129
31302002-04-08 Akim Demaille <akim@epita.fr>
3131
3132 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
3133 Adding #line.
3134 Remove the duplicate `typedefs'.
3135 (RhsNumberType): Fix the declaration and various other typos.
3136 Use __ofile__.
3137 * data/bison.simple: Use __ofile__.
3138 * src/scan-skel.l: Handle __ofile__.
3139
31402002-04-08 Akim Demaille <akim@epita.fr>
3141
3142 * src/gram.h (item_number_t): New, the type of item numbers in
3143 RITEM. Note that it must be able to code symbol numbers as
3144 positive number, and the negation of rule numbers as negative
3145 numbers.
3146 Adjust all dependencies (pretty many).
3147 * src/reduce.c (rule): Remove this `short *' pointer: use
3148 item_number_t.
3149 * src/system.h (MINSHORT, MAXSHORT): Remove.
3150 Include `limits.h'.
3151 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
3152 (shortcpy): Remove.
3153 (MAXTABLE): Move to...
3154 * src/output.c (MAXTABLE): here.
3155 (prepare_rules): Use output_int_table to output rhs.
3156 * data/bison.simple, data/bison.c++: Adjust.
3157 * tests/torture.at (Big triangle): Move the limit from 254 to
3158 500.
3159 * tests/regression.at (Web2c Actions): Ajust.
3160
3161 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
3162 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
3163 passes, but produces negative #line number, once fixed, GCC is
3164 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
3165 C), it passes.
3166 * src/state.h (state_h): Code input lines on ints, not shorts.
3167
31682002-04-08 Akim Demaille <akim@epita.fr>
3169
3170 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
3171 and then the grammar.
3172
31732002-04-08 Akim Demaille <akim@epita.fr>
3174
3175 * src/system.h: No longer using strndup.
3176
31772002-04-07 Akim Demaille <akim@epita.fr>
3178
3179 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
3180 * src/output.c (output_table_data): Return the longest number.
3181 (prepare_tokens): Output `token_number_max').
3182 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
3183 New.
3184 Use them to define yy_token_number_type/TokenNumberType.
3185 Use this type for yytranslate.
3186 * tests/torture.at (Big triangle): Push the limit from 124 to
3187 253.
3188 * tests/regression.at (Web2c Actions): Adjust.
3189
31902002-04-07 Akim Demaille <akim@epita.fr>
3191
3192 * tests/torture.at (Big triangle): New.
3193 (GNU AWK Grammar, GNU Cim Grammar): Move to...
3194 * tests/existing.at: here.
3195
31962002-04-07 Akim Demaille <akim@epita.fr>
3197
3198 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
3199 nritems.
3200 Adjust dependencies.
3201
32022002-04-07 Akim Demaille <akim@epita.fr>
3203
3204 * src/reader.c: Normalize increments to prefix form.
3205
32062002-04-07 Akim Demaille <akim@epita.fr>
3207
3208 * src/reader.c, symtab.c: Remove debugging code.
3209
32102002-04-07 Akim Demaille <akim@epita.fr>
3211
3212 Rename all the `bucket's as `symbol_t'.
3213
3214 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
3215 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
3216 * src/symtab.c, src/symtab.h (bucket): Rename as...
3217 (symbol_t): this.
3218 (symbol_list_new, bucket_check_defined, bucket_make_alias)
3219 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
3220 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3221 (buckets_new, buckets_free, buckets_do): Rename as...
3222 (symbol_list_new, symbol_check_defined, symbol_make_alias)
3223 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
3224 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
3225 (symbols_new, symbols_free, symbols_do): these.
3226
32272002-04-07 Akim Demaille <akim@epita.fr>
3228
3229 Use lib/hash for the symbol table.
3230
3231 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
3232 EOF.
3233 * src/lex.c (lex): Set the `number' member of new terminals.
3234 * src/reader.c (bucket_check_defined, bucket_make_alias)
3235 (bucket_check_alias_consistence, bucket_translation): New.
3236 (reader, grammar_free, readgram, token_translations_init)
3237 (packsymbols): Adjust.
3238 (reader): Number the predefined tokens.
3239 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
3240 for predefined tokens.
3241 * src/symtab.h (bucket): Remove all the hash table related
3242 members.
3243 * src/symtab.c (symtab): Replace by...
3244 (bucket_table): this.
3245 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3246 (buckets_new, buckets_do): New.
3247
32482002-04-07 Akim Demaille <akim@epita.fr>
3249
3250 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
3251 (start_symbol, max_user_token_number, semantic_parser)
3252 (error_token_number): Initialize.
3253 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
3254 Initialize.
3255 (reader): Don't.
3256 (errtoken, eoftoken, undeftoken, axiom): Extern.
3257
32582002-04-07 Akim Demaille <akim@epita.fr>
3259
3260 * src/gram.h (rule_s): prec and precsym are now pointers
3261 to the bucket giving the priority/associativity.
3262 Member `associativity' removed: useless.
3263 * src/reduce.c, src/conflicts.c: Adjust.
3264
32652002-04-07 Akim Demaille <akim@epita.fr>
3266
3267 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
3268 Properly escape the symbols' TAG when outputting them.
3269
32702002-04-07 Akim Demaille <akim@epita.fr>
3271
3272 * src/lalr.h (LA): Is a bitsetv, not bitset*.
3273
32742002-04-07 Akim Demaille <akim@epita.fr>
3275
3276 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
3277 (LArule): this, which is an array to rule_t*.
3278 * src/print.c, src/conflicts.c: Adjust.
3279
32802002-04-07 Akim Demaille <akim@epita.fr>
3281
3282 * src/gram.h (rule_t): Rename `number' as `user_number'.
3283 `number' is a new member.
3284 Adjust dependencies.
3285 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
3286
32872002-04-07 Akim Demaille <akim@epita.fr>
3288
3289 As a result of the previous patch, it is no longer needed
3290 to reorder ritem itself.
3291
3292 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
3293
32942002-04-07 Akim Demaille <akim@epita.fr>
3295
3296 Be sure never to walk through RITEMS, but use only data related to
3297 the rules themselves. RITEMS should be banished.
3298
3299 * src/output.c (output_token_translations): Rename as...
3300 (prepare_tokens): this.
3301 In addition to `translate', prepare the muscles `tname' and
3302 `toknum', which were handled by...
3303 (output_rule_data): this.
3304 Remove, and move the remainder of its outputs into...
3305 (prepare_rules): this new routines, which also merges content from
3306 (output_gram): this.
3307 (prepare_rules): Be sure never to walk through RITEMS.
3308 (output_stos): Rename as...
3309 (prepare_stos): this.
3310 (output): Always invoke prepare_states, after all, just don't use it
3311 in the output if you don't need it.
3312
33132002-04-07 Akim Demaille <akim@epita.fr>
3314
3315 * src/LR0.c (new_state): Display `nstates' as the name of the
3316 newly created state.
3317 Adjust to initialize first_state and last_state if needed.
3318 Be sure to distinguish the initial from the final state.
3319 (new_states): Create the itemset of the initial state, and use
3320 new_state.
3321 * src/closure.c (closure): Now that the initial state has its
3322 items properly set, there is no need for a special case when
3323 creating `ruleset'.
3324
3325 As a result, now the rule 0, reducing to $axiom, is visible in the
3326 outputs. Adjust the test suite.
3327
3328 * tests/conflicts.at (Solved SR Conflicts)
3329 (Unresolved SR Conflicts): Adjust.
3330 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
3331 * tests/conflicts.at (S/R in initial): New.
3332
33332002-04-07 Akim Demaille <akim@epita.fr>
3334
3335 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
3336 the RHS of the rules.
3337 * src/output.c (output_gram): Likewise.
3338
33392002-04-07 Akim Demaille <akim@epita.fr>
3340
3341 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
3342 bucket.
3343 Adjust all dependencies.
3344 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
3345 `number' of the buckets too.
3346 * src/gram.h: Include `symtab.h'.
3347 (associativity): Move to...
3348 * src/symtab.h: here.
3349 No longer include `gram.h'.
3350
33512002-04-07 Akim Demaille <akim@epita.fr>
3352
3353 * src/gram.h, src/gram.c (rules_rhs_length): New.
3354 (ritem_longest_rhs): Use it.
3355 * src/gram.h (rule_t): `number' is a new member.
3356 * src/reader.c (packgram): Set it.
3357 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
3358 the end of `rules', and count them out of `nrules'.
3359 (reduce_output, dump_grammar): Adjust.
3360 * src/print.c (print_grammar): It is no longer needed to check for
3361 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
3362 * tests/reduce.at (Reduced Automaton): New test.
3363
33642002-04-07 Akim Demaille <akim@epita.fr>
3365
3366 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
3367 lacking `+ 1' to nrules, Bison reported as useless a token if it
3368 was used solely to set the precedence of the last rule...
3369
33702002-04-07 Akim Demaille <akim@epita.fr>
3371
3372 * data/bison.c++, data/bison.simple: Don't output the current file
3373 name in #line, to avoid useless diffs between two identical
3374 outputs under different names.
3375
33762002-04-07 Akim Demaille <akim@epita.fr>
3377
3378 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
3379 Normalize loops to using `< nrules + 1', not `<= nrules'.
3380
33812002-04-07 Akim Demaille <akim@epita.fr>
3382
3383 * TODO: Update.
3384
33852002-04-07 Akim Demaille <akim@epita.fr>
3386
3387 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
3388 bucket.value as bucket.number.
3389
33902002-04-07 Akim Demaille <akim@epita.fr>
3391
3392 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
3393 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
3394 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
3395 RHS, instead of being an index in RITEMS.
3396
33972002-04-04 Paul Eggert <eggert@twinsun.com>
3398
3399 * doc/bison.texinfo: Update copyright date.
3400 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
3401 (Symbols): Warn about running Bison in one character set,
3402 but compiling and/or running in an incompatible one.
3403 Warn about character code 256, too.
3404
34052002-04-03 Paul Eggert <eggert@twinsun.com>
3406
3407 * src/bison.data (YYSTACK_ALLOC): Depend on whether
3408 YYERROR_VERBOSE is nonzero, not whether it is defined.
3409
3410 Merge changes from bison-1_29-branch.
3411
34122002-03-20 Paul Eggert <eggert@twinsun.com>
3413
3414 Merge fixes from Debian bison_1.34-1.diff.
3415
3416 * configure.in (AC_PREREQ): 2.53.
3417
34182002-03-20 Akim Demaille <akim@epita.fr>
3419
3420 * src/conflicts.c (log_resolution): Argument `resolution' is const.
3421
34222002-03-19 Paul Eggert <eggert@twinsun.com>
3423
3424 * src/bison.simple (YYCOPY): New macro.
3425 (YYSTACK_RELOCATE): Use it.
3426 Remove Type arg; no longer needed. All callers changed.
3427 (yymemcpy): Remove; no longer needed.
3428
3429 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
3430 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3431
34322002-03-19 Akim Demaille <akim@epita.fr>
3433
3434 Test and fix the #line outputs.
3435
3436 * tests/atlocal.at (GCC): New.
3437 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
3438 (Prologue synch line, ,%union synch line, Postprologue synch line)
3439 (Action synch line, Epilogue synch line): New tests.
3440 * src/reader.c (parse_union_decl): Define the muscle stype_line.
3441 * data/bison.simple, data/bison.c++: Use it.
3442
34432002-03-19 Akim Demaille <akim@epita.fr>
3444
3445 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
3446 (Solved SR Conflicts, %expect not enough, %expect right)
3447 (%expect too much): Move to...
3448 * tests/conflicts.at: this new file.
3449
34502002-03-19 Akim Demaille <akim@epita.fr>
3451
3452 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
3453 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
3454 that we can move to enums for instance.
3455 * src/output.c (token_definitions_output): Output a list of
3456 `token-name, token-number' instead of the #define.
3457 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
3458
34592002-03-14 Akim Demaille <akim@epita.fr>
3460
3461 Use Gettext 0.11.1.
3462
34632002-03-09 Robert Anisko <robert@lrde.epita.fr>
3464
3465 * data/bison.c++: Make the user able to add members to the generated
3466 parser by subclassing.
3467
34682002-03-05 Robert Anisko <robert@lrde.epita.fr>
3469
3470 * src/reader.c (read_additionnal_code): `c' should be an integer, not
3471 a character.
3472 Reported by Nicolas Tisserand and Nicolas Burrus.
3473
34742002-03-04 Robert Anisko <robert@lrde.epita.fr>
3475
3476 * src/reader.c: Warn about lacking semi-colons, do not complain.
3477
34782002-03-04 Robert Anisko <robert@lrde.epita.fr>
3479
3480 * data/bison.c++: Remove a debug line.
3481
34822002-03-04 Robert Anisko <robert@lrde.epita.fr>
3483
3484 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
3485 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
3486 provide a default implementation.
3487
34882002-03-04 Akim Demaille <akim@epita.fr>
3489
3490 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
3491 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
3492 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
3493 * tests/semantic.at (Parsing Guards): Similarly.
3494 * src/reader.at (readgram): Complain if the last rule is not ended
3495 with a semi-colon.
3496
34972002-03-04 Akim Demaille <akim@epita.fr>
3498
3499 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
3500 * src/closure.c: here.
3501 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
3502 RTC.
3503 * src/warshall.h, src/warshall.c: Remove.
3504 * tests/sets.at (Broken Closure): Adjust.
3505
35062002-03-04 Akim Demaille <akim@epita.fr>
3507
3508 * src/output.c (output_skeleton): tempdir is const.
3509 bytes_read is unused.
3510
35112002-03-04 Akim Demaille <akim@epita.fr>
3512
3513 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
3514 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
3515 Update.
3516 From Michael Hayes.
3517
35182002-03-04 Akim Demaille <akim@epita.fr>
3519
3520 * src/closure.c (closure): `r' is unused.
3521
35222002-03-04 Akim Demaille <akim@epita.fr>
3523
3524 * tests/sets.at (Broken Closure): Add the ending `;'.
3525 * src/reader.at (readgram): Complain if a rule is not ended with a
3526 semi-colon.
3527
35282002-03-04 Akim Demaille <akim@epita.fr>
3529
3530 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
3531 (count_sr_conflicts): Use bitset_count.
3532 * src/reduce.c (inaccessable_symbols): Ditto.
3533 (bits_size): Remove.
3534 * src/warshall.h, src/warshall.c: Convert to bitsetv.
3535
35362002-03-04 Akim Demaille <akim@epita.fr>
3537
3538 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
3539 * src/reduce.c: Remove the `bitset_zero's following the
3540 `bitset_create's, as now it is performed by the latter.
3541
35422002-03-04 Akim Demaille <akim@epita.fr>
3543
3544 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
3545 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
3546 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
3547 latest sources from Michael.
3548
35492002-03-04 Akim Demaille <akim@epita.fr>
3550
3551 * src/output.c (output): Don't free the grammar.
3552 * src/reader.c (grammar_free): New.
3553 * src/main.c (main): Call it and don't free symtab here.
3554
35552002-03-04 Akim Demaille <akim@epita.fr>
3556
3557 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
3558 before returning.
3559 Reported by Benoit Perrot.
3560
35612002-03-04 Akim Demaille <akim@epita.fr>
3562
3563 Use bitset operations when possible, not loops over bits.
3564
3565 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
3566 bitset_or.
3567 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
3568 * src/reduce.c (useless_nonterminals): Formatting changes.
3569 * src/warshall.c (TC): Use bitset_or.
3570
35712002-03-04 Akim Demaille <akim@epita.fr>
3572
3573 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
3574 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
3575 Ditto.
3576
35772002-03-04 Akim Demaille <akim@epita.fr>
3578
3579 * src/lalr.c (F): Now a bitset*.
3580 Adjust all dependencies.
3581
35822002-03-04 Akim Demaille <akim@epita.fr>
3583
3584 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
3585 Adjust all dependencies.
3586
35872002-03-04 Akim Demaille <akim@epita.fr>
3588
3589 * src/L0.c, src/LR0.h (nstates): Be size_t.
3590 Adjust comparisons (signed vs unsigned).
3591 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
3592 bitset*.
3593 Adjust all dependencies.
3594
35952002-03-04 Akim Demaille <akim@epita.fr>
3596
3597 * src/closure.c (firsts): Now, also a bitset.
3598 Adjust all dependencies.
3599 (varsetsize): Remove, now unused.
3600 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
3601
36022002-03-04 Akim Demaille <akim@epita.fr>
3603
3604 * src/print.c: Convert to use bitset.h, not hand coded iterations
3605 over ints.
3606
36072002-03-04 Akim Demaille <akim@epita.fr>
3608
3609 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
3610
36112002-03-04 Akim Demaille <akim@epita.fr>
3612
3613 * src/closure.c (ruleset): Be a bitset.
3614 (rulesetsize): Remove.
3615
36162002-03-04 Akim Demaille <akim@epita.fr>
3617
3618 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
3619 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
3620 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
3621 * src/closure.c (fderives): Be an array of bitsets.
3622
36232002-02-28 Robert Anisko <robert@lrde.epita.fr>
3624
3625 * data/bison.c++: Merge the two generated headers. Insert a copyright
3626 notice in each output file.
3627
36282002-02-28 Akim Demaille <akim@epita.fr>
3629
3630 * data/bison.c++: Copy the prologue of bison.simple to fetch
3631 useful M4 definitions, such as b4_header_guard.
3632
36332002-02-25 Akim Demaille <akim@epita.fr>
3634
3635 * src/getargs.c (version): Give the name of the authors, and use a
3636 translator friendly scheme for the bgr
3637 copyright notice.
3638
36392002-02-25 Akim Demaille <akim@epita.fr>
3640
3641 * src/output.c (header_output): Remove, now handled completely via
3642 M4.
3643
36442002-02-25 Akim Demaille <akim@epita.fr>
3645
3646 * m4/m4.m4: New, from CVS Autoconf.
3647 * configure.in: Invoke it.
3648 * src/output.c (output_skeleton): Use its result instead of the
3649 hard coded name.
3650
36512002-02-25 Akim Demaille <akim@epita.fr>
3652
3653 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
3654 Fileutils 4.1.5.
3655 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
3656 * src/output.c (output_skeleton): Use mkstemp to create a real
3657 temporary file.
3658 Move the filling of `skeleton' and its muscle to...
3659 (prepare): here.
3660 (output): Move the definition of the prologue muscle to...
3661 (prepare): here.
3662 * src/system.h (DEFAULT_TMPDIR): New.
3663
36642002-02-14 Paul Eggert <eggert@twinsun.com>
3665
3666 Remove the support for C++ namespace cleanliness; it was
3667 causing more problems than it was curing, since it didn't work
3668 properly on some nonstandard C++ compilers. This can wait
3669 for a proper C++ parser.
3670
3671 * NEWS: Document this.
3672 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
3673 of C++, as it's treated like C now.
3674 * src/bison.simple (YYSTD): Remove.
3675 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
3676 Treat C++ just like Standard C instead of trying to support
3677 namespace cleanliness.
3678
36792002-02-14 Akim Demaille <akim@epita.fr>
3680
3681 * tests/regression.at (else): Adjust to Andreas' change.
3682
36832002-02-14 Akim Demaille <akim@epita.fr>
3684
3685 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
3686
36872002-02-13 Andreas Schwab <schwab@suse.de>
3688
3689 * src/output.c (output_rule_data): Don't output NULL, it might
3690 not be defined yet.
3691
36922002-02-11 Robert Anisko <robert@lrde.epita.fr>
3693
3694 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
3695 (Copyright notice): Update.
3696
36972002-02-11 Akim Demaille <akim@epita.fr>
3698
3699 * tests/regression.at (%nonassoc and eof): Don't include
3700 nonportable headers.
3701
37022002-02-08 Robert Anisko <robert@lrde.epita.fr>
3703
3704 * data/bison.c++: Correct error recovery. Make the user able to
3705 initialize the starting location.
3706
37072002-02-07 Akim Demaille <akim@epita.fr>
3708
3709 * tests/input.at: New.
3710
37112002-02-07 Robert Anisko <robert@lrde.epita.fr>
3712
3713 * data/bison.c++: Replace some direct m4 expansions by constants. Be
3714 more consistent when naming methods and variables. Put preprocessor
3715 directives around tables only needed for debugging.
3716
37172002-02-07 Robert Anisko <robert@lrde.epita.fr>
3718
3719 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
3720 C++ parsers.
3721 (yy::b4_name::parse): Use print_.
3722
37232002-02-07 Robert Anisko <robert@lrde.epita.fr>
3724
3725 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
3726
37272002-02-07 Robert Anisko <robert@lrde.epita.fr>
3728
3729 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
3730 C++ parsers.
3731 (yy::b4_name::parse): Build verbose error messages, and use error_.
3732
37332002-02-06 Robert Anisko <robert@lrde.epita.fr>
3734
3735 * data/bison.c++: Fix m4 quoting in comments.
3736
37372002-02-06 Robert Anisko <robert@lrde.epita.fr>
3738
3739 * data/bison.c++: Adjust the parser code. Fix some muscles that were
3740 not expanded by m4.
3741
37422002-02-05 Akim Demaille <akim@epita.fr>
3743
3744 * data/bison.c++: Adjust to the M4 back end.
3745 More is certainly needed.
3746
37472002-02-05 Akim Demaille <akim@epita.fr>
3748
3749 Give a try to M4 as a back end.
3750
3751 * lib/readpipe.c: New, from wdiff.
3752 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
3753 BISON_HAIRY.
3754 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
3755 specific values. Now it is m4 that performs the lookup.
3756 * src/parse-skel.y: Remove.
3757 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
3758 * src/output.c (actions_output, guards_output)
3759 (token_definitions_output): No longer keeps track of the output
3760 line number, hence remove the second argument.
3761 (guards_output): Check against the guard member of a rule, not the
3762 action member.
3763 Adjust callers.
3764 (output_skeleton): Don't look for the skeleton location, let m4 do
3765 that.
3766 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
3767 file will be used.
3768 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
3769 (prepare): Given that for the time being changesyntax is not
3770 usable in M4, rename the muscles using `-' to `_'.
3771 Define `defines_flag', `output_parser_name' and `output_header_name'.
3772 * src/output.h (actions_output, guards_output)
3773 (token_definitions_output): Adjust prototypes.
3774 * src/scan-skel.l: Instead of scanning the skeletons, it now
3775 processes the output of m4: `__oline__' and `#output'.
3776 * data/bison.simple: Adjust to be used by M4(sugar).
3777 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
3778 to date.
3779 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
3780 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
3781 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
3782 shamelessly stolen from CVS Autoconf.
3783
37842002-02-05 Akim Demaille <akim@epita.fr>
3785
3786 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
3787 * configure.in: Check for the declarations of free and malloc.
3788 * src/muscle_tab.c: Adjust.
3789
37902002-02-05 Akim Demaille <akim@epita.fr>
3791
3792 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
3793 which have no values.
3794
37952002-02-05 Akim Demaille <akim@epita.fr>
3796
3797 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
3798 * data/: here.
3799
38002002-01-29 Paul Eggert <eggert@twinsun.com>
3801
3802 * src/bison.simple (YYSIZE_T): Do not define merely because
3803 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
3804 On some platforms, <alloca.h> does not declare YYSTD (size_t).
3805
38062002-01-27 Akim Demaille <akim@epita.fr>
3807
3808 Fix `%nonassoc and eof'.
3809
3810 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
3811 which were not properly copied! Replace
3812 memcpy (res->errs, src->errs, src->nerrs);
3813 with
3814 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
3815 !!!
3816 * tests/regression.at (%nonassoc and eof): Adjust to newest
3817 Autotest: `.' is not in the PATH.
3818
38192002-01-27 Akim Demaille <akim@epita.fr>
3820
3821 * tests/sets.at (AT_EXTRACT_SETS): New.
3822 (Nullable): Use it.
3823 (Firsts): New.
3824
38252002-01-26 Akim Demaille <akim@epita.fr>
3826
3827 * tests/actions.at, tests/calc.at, tests/headers.at,
3828 * tests/torture.at: Adjust to the newest Autotest which no longer
3829 forces `.' in the PATH.
3830
38312002-01-25 Akim Demaille <akim@epita.fr>
3832
3833 * tests/regression.at (%nonassoc and eof): New.
3834 Suggested by Robert Anisko.
3835
38362002-01-24 Akim Demaille <akim@epita.fr>
3837
3838 Bison dumps core when trying to complain about broken input files.
3839 Reported by Cris van Pelt.
3840
3841 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
3842 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
3843 into...
3844 (Invalid inputs): Strengthen: exercise parse_percent_token.
3845
38462002-01-24 Robert Anisko <robert.anisko@epita.fr>
3847
3848 * src/Makefile.am: Add bison.c++.
3849 * src/bison.c++: New skeleton.
3850
38512002-01-21 Paolo Bonzini <bonzini@gnu.org>
3852
3853 * po/it.po: New.
3854
38552002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
3856
3857 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
3858
38592002-01-20 Marc Autret <marc@gnu.org>
3860
3861 * src/files.c (compute_output_file_names): Fix
3862
38632002-01-20 Marc Autret <marc@gnu.org>
3864
3865 * tests/output.at: New test.
3866 * src/files.c (compute_base_names): Don't map extensions when
3867 the YACC flag is set, use defaults.
3868 Reported by Evgeny Stambulchik.
3869
38702002-01-20 Marc Autret <marc@gnu.org>
3871
3872 * src/system.h: Need to define __attribute__ away for non-GCC
3873 compilers as well (i.e. the vendor C compiler).
3874 Suggested by Albert Chin-A-Young.
3875
38762002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
3877
3878 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
3879 canonical definition.
3880 * src/system.h: Use the canonical definition for PARAMS (avoids
3881 a conflict with the macro from lib/hash.h).
3882
38832002-01-11 Akim Demaille <akim@epita.fr>
3884
3885 * configure.in: Use AC_FUNC_STRNLEN.
3886 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
3887
38882002-01-09 Akim Demaille <akim@epita.fr>
3889
3890 * src/files.c, src/files.h (output_infix): New.
3891 (tab_extension): Remove.
3892 (compute_base_names): Compute the former, drop the latter.
3893 * src/output.c (prepare): Insert the muscles `output-infix', and
3894 `output-suffix'.
3895 * src/parse-skel.y (string, string.1): New.
3896 (section.header): Use it.
3897 (section.yacc): Remove.
3898 (prefix): Remove too.
3899 * src/scan-skel.l: Adjust.
3900 * src/bison.simple, src/bison.hairy: Adjust.
3901
39022002-01-09 Akim Demaille <akim@epita.fr>
3903
3904 * configure.in (WERROR_CFLAGS): Compute it.
3905 * src/Makefile.am (CFLAGS): Pass it.
3906 * tests/atlocal.in (CFLAGS): Idem.
3907 * src/files.c: Fix a few warnings.
3908 (get_extension_index): Remove, unused.
3909
39102002-01-08 Akim Demaille <akim@epita.fr>
3911
3912 * src/getargs.c (AS_FILE_NAME): New.
3913 (getargs): Use it to convert DOSish file names.
3914 * src/files.c (base_name): Rename as full_base_name to avoid
3915 clashes with `base_name ()'.
3916 (filename_split): New.
3917 (compute_base_names): N-th rewrite, using filename_split.
3918
39192002-01-08 Akim Demaille <akim@epita.fr>
3920
3921 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
3922 New, stolen from the Fileutils 4.1.
3923 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
3924 * configure.in: Check for the presence of memrchr, and of its
3925 prototype.
3926
39272002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
3928
3929 * lib/hash.h (__P): Added definition for this macro.
3930 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
3931 BUILT_SOURCES, to ensure they are generated first.
3932 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
3933 %error-verbose to allow bootstrapping with bison 1.30x.
3934
39352002-01-06 Akim Demaille <akim@epita.fr>
3936
3937 * src/reader.c (parse_braces): Don't fetch the next char, the
3938 convention is to fetch on entry.
3939 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
3940 'switch' without a following semicolon.
3941 * tests/regression.at (braces parsing): New.
3942
39432002-01-06 Akim Demaille <akim@epita.fr>
3944
3945 Bison is dead wrong in its RR conflict reports.
3946
3947 * tests/torture.at (GNU Cim Grammar): New.
3948 * src/conflicts.c (count_rr_conflicts): Fix.
3949
39502002-01-06 Akim Demaille <akim@epita.fr>
3951
3952 Creating package.m4 from configure.ac causes too many problems.
3953
3954 * tests/Makefile.am (package.m4): Create it by hand,
3955 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
3956
39572002-01-06 Akim Demaille <akim@epita.fr>
3958
3959 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
3960 skeleton.h.
3961
39622002-01-04 Paul Eggert <eggert@twinsun.com>
3963
3964 * doc/bison.texinfo (Debugging):
3965 Remove YYSTDERR; it's no longer defined or used.
3966 Also, s/cstdio.h/cstdio/.
3967
39682002-01-03 Akim Demaille <akim@epita.fr>
3969
3970 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
3971
39722002-01-03 Akim Demaille <akim@epita.fr>
3973
3974 * src/parse-skel.y (process_skeleton): Don't bind the parser's
3975 tracing code to --trace, wait for a better --trace option, with
3976 args.
3977
39782002-01-03 Akim Demaille <akim@epita.fr>
3979
3980 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
3981 The ISO C++ standard is extremely clear about it: stderr is
3982 considered a macro, not a regular symbol (see table 94 `Header
3983 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
3984 Therefore std:: does not apply to it. It still does with fprintf.
3985 Also, s/cstdio.h/cstdio/.
3986
39872002-01-03 Akim Demaille <akim@epita.fr>
3988
3989 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
3990 for non system headers.
3991
39922002-01-02 Akim Demaille <akim@epita.fr>
3993
3994 Equip the skeleton chain with location tracking, runtime trace,
3995 pure parser and scanner.
3996
3997 * src/parse-skel.y: Request a pure parser, locations, and prefix
3998 renaming.
3999 (%union): Having several members with the same type does not help
4000 type mismatches, simplify.
4001 (YYPRINT, yyprint): New.
4002 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
4003 (skel_error): this.
4004 Handle locations.
4005 * src/scan-skel.l: Adjust to these changes.
4006 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
4007 (LOCATION_PRINT, skel_control_t): New.
4008
40092001-12-30 Akim Demaille <akim@epita.fr>
4010
4011 * src/parse-skel.y: Get rid of the shift/reduce conflict:
4012 replace `gb' with BLANKS.
4013 * src/scan-skel.l: Adjust.
4014
40152001-12-30 Akim Demaille <akim@epita.fr>
4016
4017 * src/system.h: We don't need nor want bcopy.
4018 Throw away MS-DOS crap: we don't need getpid.
4019 * configure.in: We don't need strndup. It was even causing
4020 problems: because Flex includes the headers *before* us,
4021 _GNU_SOURCE is not defined by config.h, and therefore strndup was
4022 not visible.
4023 * lib/xstrndup.c: New.
4024 * src/scan-skel.l: Use it.
4025 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
4026 * src/parse-skel.y: Use %directives instead of #defines.
4027
40282001-12-30 Akim Demaille <akim@epita.fr>
4029
4030 * src/skeleton.h: New.
4031 * src/output.c (output_parser, output_master_parser): Remove, dead
4032 code.
4033 * src/output.h (get_lines_number, actions_output, guards_output)
4034 (token_definitions_output): Prototype them.
4035 * src/parse-skel.y: Add the license notice.
4036 Include output.h and skeleton.h.
4037 (process_skeleton): Returns void, and takes a single parameter.
4038 * src/scan-skel.l: Add the license notice.
4039 Include skeleton.h.
4040 Don't use %option yylineno: it seems that then Flex imagines
4041 REJECT has been used, and therefore it won't reallocate its
4042 buffers (which makes no other sense to me than a bug). It results
4043 in warnings for `unused: yy_flex_realloc'.
4044
40452001-12-30 Robert Anisko <robert.anisko@epita.fr>
4046
4047 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
4048 (MUSCLE_INSERT_PREFIX): ...to there.
4049 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
4050 (MUSCLE_INSERT_PREFIX): Move from here...
4051
4052 * src/bison.hairy: Add a section directive. Put braces around muscle
4053 names. This parser skeleton is still broken, but Bison should not
4054 choke on a bad muscle 'syntax'.
4055 * src/bison.simple: Add a section directive. Put braces around muscle
4056 names.
4057
4058 * src/files.h (strsuffix, stringappend): Add declarations.
4059 (tab_extension): Add declaration.
4060 (short_base_name): Add declaration.
4061
4062 * src/files.c (strsuffix, stringappend): No longer static. These
4063 functions are used in the skeleton parser.
4064 (tab_extension): New.
4065 (compute_base_names): Use the computations done in this function
4066 to guess if the generated parsers should have '.tab' in their
4067 names.
4068 (short_base_name): No longer static.
4069
4070 * src/output.c (output_skeleton): New.
4071 (output): Disable call to output_master_parser, and give a try to
4072 a new skeleton handling system.
4073 (guards_output, actions_output): No longer static.
4074 (token_definitions_output, get_lines_number): No longer static.
4075
4076 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
4077
4078 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
4079 parse-skel.y.
4080
4081 * src/parse-skel.y: New file.
4082 * src/scan-skel.l: New file.
4083
40842001-12-29 Akim Demaille <akim@epita.fr>
4085
4086 %name-prefix is broken.
4087
4088 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
4089 Adjust all dependencies.
4090 * tests/headers.at (export YYLTYPE): Strengthen this test: use
4091 %name-prefix.
4092
4093 Renaming yylval but not yylloc is not consistent. Now we do.
4094
4095 * src/bison.simple: Prefix yylloc if used.
4096 * doc/bison.texinfo (Decl Summary): Document that.
4097
40982001-12-29 Akim Demaille <akim@epita.fr>
4099
4100 * doc/bison.texinfo: Promote `%long-directive' over
4101 `%long_directive'.
4102 Remove all references to fixed-output-files, yacc is enough.
4103
41042001-12-29 Akim Demaille <akim@epita.fr>
4105
4106 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
4107 user prologue. These are defaults.
4108 * tests/actions.at (Mid-rule actions): Make sure the user can
4109 define YYDEBUG and YYERROR_VERBOSE.
4110
41112001-12-29 Akim Demaille <akim@epita.fr>
4112
4113 * src/output.c (header_output): Don't forget to export YYLTYPE and
4114 yylloc.
4115 * tests/headers.at (export YYLTYPE): New, make sure it does.
4116 * tests/regression.at (%union and --defines, Invalid CPP headers):
4117 Move to...
4118 * tests/headers.at: here.
4119
41202001-12-29 Akim Demaille <akim@epita.fr>
4121
4122 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
4123
41242001-12-29 Akim Demaille <akim@epita.fr>
4125
4126 * tests/actions.at (Mid-rule actions): Output on a single line
4127 instead of several.
4128
41292001-12-29 Akim Demaille <akim@epita.fr>
4130
4131 * doc/bison.texinfo: Formatting changes.
4132
41332001-12-29 Akim Demaille <akim@epita.fr>
4134
4135 Don't store the token defs in a muscle, just be ready to output it
4136 on command. Now possible via `symbols'. Fixes a memory leak.
4137
4138 * src/output.c (token_definitions_output): New.
4139 (output_parser, header_output): Use it.
4140 * src/reader.c (symbols_save): Remove.
4141
41422001-12-29 Akim Demaille <akim@epita.fr>
4143
4144 * src/bison.simple: Do not provide a default for YYSTYPE and
4145 YYLTYPE before the user's prologue. Otherwise it's hardly... a
4146 default.
4147
41482001-12-29 Akim Demaille <akim@epita.fr>
4149
4150 Mid-rule actions are simply... ignored!
4151
4152 * src/reader.c (readgram): Be sure to attach mid-rule actions to
4153 the empty-rule associated to the dummy symbol, not to the host
4154 rule.
4155 * tests/actions.at (Mid-rule actions): New.
4156
41572001-12-29 Akim Demaille <akim@epita.fr>
4158
4159 Memory leak.
4160
4161 * src/reader.c (reader): Free grammar.
4162
41632001-12-29 Akim Demaille <akim@epita.fr>
4164
4165 Memory leak.
4166
4167 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
4168 since it allocates it for each state, although only one is needed.
4169 (allocate_storage): Do it here.
4170
41712001-12-29 Akim Demaille <akim@epita.fr>
4172
4173 * src/options.h, src/options.c (create_long_option_table): Rename
4174 as...
4175 (long_option_table_new): this, with a clearer prototype.
4176 (percent_table): Remove, unused,
4177 * src/getargs.c (getargs): Adjust.
4178
41792001-12-29 Akim Demaille <akim@epita.fr>
4180
4181 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
4182 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
4183 as states.
4184
41852001-12-29 Akim Demaille <akim@epita.fr>
4186
4187 * src/lalr.c (build_relations): Rename `states' as `states1'.
4188 Sorry, I don't understand exactly what it is, no better name...
4189
41902001-12-29 Akim Demaille <akim@epita.fr>
4191
4192 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
4193 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
4194 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
4195 as rules.
4196
41972001-12-29 Akim Demaille <akim@epita.fr>
4198
4199 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
4200 ago.
4201
42022001-12-29 Akim Demaille <akim@epita.fr>
4203
4204 * src/reader.c, src/reader.h (user_toknums): Remove.
4205 Adjust all users to use symbols[i]->user_token_number.
4206
42072001-12-29 Akim Demaille <akim@epita.fr>
4208
4209 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
4210 Adjust all users to use symbols[i]->prec or ->assoc.
4211
42122001-12-29 Akim Demaille <akim@epita.fr>
4213
4214 * src/reader.c, src/reader.h (tags): Remove.
4215 Adjust all users to use symbols[i]->tag.
4216
42172001-12-29 Akim Demaille <akim@epita.fr>
4218
4219 * src/gram.h, src/gram.c (symbols): New, similar to state_table
4220 and rule_table.
4221 * src/reader.c (packsymbols): Fill this table.
4222 Drop sprec.
4223 * src/conflicts.c (resolve_sr_conflict): Adjust.
4224 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
4225 single table.
4226 Use symbols[i]->tag instead of tags[i].
4227
42282001-12-29 Akim Demaille <akim@epita.fr>
4229
4230 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
4231 In addition, put a comment in there, to replace...
4232 * tests/regression.at (%union and C comments): Remove.
4233
42342001-12-29 Akim Demaille <akim@epita.fr>
4235
4236 * tests/regression.at (Web2c Actions): Blindly move the actual
4237 output as expected output. The contents *seem* right to me, but I
4238 can't pretend reading perfectly parser tables... Nonetheless, all
4239 the other tests pass correctly, the table look OK, even though the
4240 presence of `$axiom' is to be noted: AFAICS it is useless (but
4241 harmless).
4242
42432001-12-29 Akim Demaille <akim@epita.fr>
4244
4245 * src/reader.c (readgram): Don't add the rule 0 if there were no
4246 rules read. In other words, add it _after_ having performed
4247 grammar sanity checks.
4248 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
4249
42502001-12-29 Akim Demaille <akim@epita.fr>
4251
4252 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
4253 visible, and some states have now a different number.
4254
42552001-12-29 Akim Demaille <akim@epita.fr>
4256
4257 * src/reader.c (readgram): Bind the initial rule's lineno to that
4258 of the first rule.
4259 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
4260 (Solved SR Conflicts): Adjust rule 0's line number.
4261
42622001-12-29 Akim Demaille <akim@epita.fr>
4263
4264 Fix the `GAWK Grammar' failure.
4265
4266 * src/LR0.c (final_state): Initialize to -1 so that we do compute
4267 the reductions of the first state which was mistakenly confused
4268 with the final state because precisely final_state was initialized
4269 to 0.
4270 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
4271 now noticed by Bison.
4272 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
4273 have a reduction on $default.
4274
42752001-12-29 Akim Demaille <akim@epita.fr>
4276
4277 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
4278 rule line numbers.
4279 * src/closure.c (print_closure): Likewise.
4280 * src/derives.c (print_derives): Likewise.
4281 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
4282 now.
4283
42842001-12-29 Akim Demaille <akim@epita.fr>
4285
4286 * src/lalr.c (lookaheads_print): New.
4287 (lalr): Call it when --trace-flag.
4288 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
4289 are dumped.
4290
42912001-12-29 Akim Demaille <akim@epita.fr>
4292
4293 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
4294 when walking through ritem, even via rule->rhs.
4295 * src/reduce.c (dump_grammar, useful_production, reduce_output)
4296 (useful_production, useless_nonterminals): Likewise.
4297 (reduce_grammar_tables): Likewise, plus update nritems.
4298 * src/nullable.c (set_nullable): Likewise.
4299 * src/lalr.c (build_relations): Likewise.
4300 * tests/sets.at (Nullable): Adjust.
4301 Fortunately, now, the $axiom is no longer nullable.
4302
43032001-12-29 Akim Demaille <akim@epita.fr>
4304
4305 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
4306 the 0-sentinel.
4307 * src/gram.c (ritem_longest_rhs): Likewise.
4308 * src/reduce.c (nonterminals_reduce): Likewise.
4309 * src/print_graph.c (print_graph): Likewise.
4310 * src/output.c (output_rule_data): Likewise.
4311 * src/nullable.c (set_nullable): Likewise.
4312
43132001-12-29 Akim Demaille <akim@epita.fr>
4314
4315 * src/output.c: Comment changes.
4316
43172001-12-27 Paul Eggert <eggert@twinsun.com>
4318
4319 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
4320 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
4321 Sparc, as they were causing more porting problems than the
4322 (minor) performance improvement was worth.
4323
4324 Also, catch up with 1.31's YYSTD.
4325
43262001-12-27 Akim Demaille <akim@epita.fr>
4327
4328 * src/output.c (output_gram): Rely on nritems, not the
4329 0-sentinel. See below.
4330 Use -1 as separator, not 0.
4331 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
4332 Rely on -1 as separator in yyrhs, instead of 0.
4333 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
4334 twice `Now at end of input', therefore there are two lines less to
4335 expect.
4336
43372001-12-27 Akim Demaille <akim@epita.fr>
4338
4339 * tests/regression.at (Unresolved SR Conflicts):
4340 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
4341 below.
4342
43432001-12-27 Akim Demaille <akim@epita.fr>
4344
4345 * src/LR0.c (new_state): Recognize the final state by the fact it
4346 is reached by eoftoken.
4347 (insert_start_shifting_state, insert_eof_shifting_state)
4348 (insert_accepting_state, augment_automaton): Remove, since now
4349 these states are automatically computed from the initial state.
4350 (generate_states): Adjust.
4351 * src/print.c: When reporting a rule number to the user, substract
4352 1, so that the axiom rule is rule 0, and the first user rule is 1.
4353 * src/reduce.c: Likewise.
4354 * src/print_graph.c (print_core): For the time being, just as for
4355 the report, depend upon --trace-flags to dump the full set of
4356 items.
4357 * src/reader.c (readgram): Once the grammar read, insert the rule
4358 0: `$axiom: START-SYMBOL $'.
4359 * tests/set.at: Adjust: rule 0 is now displayed, and since the
4360 number of the states has changed (the final state is no longer
4361 necessarily the last), catch up.
4362
43632001-12-27 Akim Demaille <akim@epita.fr>
4364
4365 Try to make the use of the eoftoken valid. Given that its value
4366 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
4367 is used instead of > 0 where appropriate, (ii), depend upon nritems
4368 instead of the 0-sentinel.
4369
4370 * src/gram.h, src/gram.c (nritems): New.
4371 Expected to be duplication of nitems, but for the time being...
4372 * src/reader.c (packgram): Assert nritems and nitems are equal.
4373 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
4374 * src/closure.c (print_closure, print_fderives): Likewise.
4375 * src/gram.c (ritem_print): Likewise.
4376 * src/print.c (print_core, print_grammar): Likewise.
4377 * src/print_graph.c: Likewise.
4378
43792001-12-27 Akim Demaille <akim@epita.fr>
4380
4381 * src/main.c (main): If there are complains after grammar
4382 reductions, then output the report anyway if requested, then die.
4383 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
4384 * src/reader.c (eoftoken): New.
4385 (parse_token_decl): If the token being defined has value `0', it
4386 is the eoftoken.
4387 (packsymbols): No longer hack `tags' to insert `$' by hand.
4388 Be sure to preserve the value of the eoftoken.
4389 (reader): Make sure eoftoken is defined.
4390 Initialize nsyms to 0: now eoftoken is created just like the others.
4391 * src/print.c (print_grammar): Don't special case the eof token.
4392 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
4393 lie anyway, albeit pleasant.
4394 * tests/calc.at: Exercise error messages with eoftoken.
4395 Change the grammar so that empty input is invalid.
4396 Adjust expectations.
4397 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
4398
43992001-12-27 Akim Demaille <akim@epita.fr>
4400
4401 * configure.in: Check the protos of strchr ans strspn.
4402 Replace strchr if needed.
4403 * src/system.h: Provide the protos of strchr, strspn and memchr if
4404 missing.
4405 * lib/strchr.c: New.
4406 * src/reader.c (symbols_save): Use strchr.
4407
44082001-12-27 Akim Demaille <akim@epita.fr>
4409
4410 * src/print.c, src/print_graph.c (escape): New.
4411 Use it to quote the TAGS outputs.
4412 * src/print_graph.c (print_state): Now errors are in red, and
4413 reductions in green.
4414 Prefer high to wide: output the state number on a line of its own.
4415
44162001-12-27 Akim Demaille <akim@epita.fr>
4417
4418 * src/state.h, src/state.c (reductions_new): New.
4419 * src/LR0.c (set_state_table): Let all the states have a
4420 `reductions', even if reduced to 0.
4421 (save_reductions): Adjust.
4422 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
4423 * src/print.c (print_reductions, print_actions): Adjust.
4424 * src/output.c (action_row): Adjust.
4425
44262001-12-27 Akim Demaille <akim@epita.fr>
4427
4428 * src/state.h, src/state.c (errs_new, errs_dup): New.
4429 * src/LR0.c (set_state_table): Let all the states have an errs,
4430 even if reduced to 0.
4431 * src/print.c (print_errs, print_reductions): Adjust.
4432 * src/output.c (output_actions, action_row): Adjust.
4433 * src/conflicts.c (resolve_sr_conflict): Adjust.
4434
44352001-12-27 Akim Demaille <akim@epita.fr>
4436
4437 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
4438
44392001-12-27 Akim Demaille <akim@epita.fr>
4440
4441 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
4442 * src/print.c: here.
4443 (lookaheadset, shiftset): New, used as additional storage by
4444 print_reductions.
4445 (print_results): Adjust.
4446 (print_shifts, print_gotos, print_errs): New, extracted from...
4447 (print_actions): here.
4448 * src/print_graph.c (print_actions): Remove dead code.
4449
44502001-12-27 Akim Demaille <akim@epita.fr>
4451
4452 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
4453 `$n' and `@n'.
4454
44552001-12-27 Akim Demaille <akim@epita.fr>
4456
4457 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
4458 (build_relations): Adjust.
4459
44602001-12-27 Akim Demaille <akim@epita.fr>
4461
4462 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
4463 duplication.
4464
44652001-12-27 Akim Demaille <akim@epita.fr>
4466
4467 * src/reader.c (packgram): Catch nitems overflows.
4468
44692001-12-27 Akim Demaille <akim@epita.fr>
4470
4471 * src/files.c, src/files.h (guard_obstack): Remove.
4472 * src/output.c (output): Adjust.
4473 * src/reader.c (parse_braces): New, factoring...
4474 (copy_action, copy_guard): these two which are renamed as...
4475 (parse_action, parse_guard): these.
4476 As a voluntary consequence, using braces around guards is now
4477 mandatory.
4478
44792001-12-27 Akim Demaille <akim@epita.fr>
4480
4481 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
4482 * src/reader.c (symbol_list): `guard' and `guard_line' are new
4483 members.
4484 (symbol_list_new): Adjust.
4485 (copy_action): action_line is the first line, not the last.
4486 (copy_guard): Just as for actions, store the `action' only, not
4487 the switch/case/break flesh.
4488 Don't parse the user action that might follow the guard, let...
4489 (readgram): do it, i.e., now, there can be an action after a
4490 guard.
4491 In other words the guard is just explicitly optional.
4492 (packgram): Adjust.
4493 * src/output.c (guards_output): New.
4494 (output_parser): Call it when needed.
4495 (output): Also free the guard and attrs obstacks.
4496 * src/files.c, src/files.h (obstack_save): Remove.
4497 (output_files): Remove.
4498 As a result, if one needs the former `.act' file, using an
4499 appropriate skeleton which requires actions and guards is now
4500 required.
4501 * src/main.c (main): Adjust.
4502 * tests/semantic.at: New.
4503 * tests/regression.at: Use `input.y' as input file name.
4504 Avoid 8+3 problems by requiring input.c when the test needs the
4505 parser.
4506
45072001-12-27 Akim Demaille <akim@epita.fr>
4508
4509 * src/reader.c (symbol_list_new): Be sure to initialize all the
4510 fields.
4511
45122001-12-27 Akim Demaille <akim@epita.fr>
4513
4514 All the hacks using a final pseudo state are now useless.
4515
4516 * src/LR0.c (set_state_table): state_table holds exactly nstates.
4517 * src/lalr.c (nLA): New.
4518 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
4519 instead of lookaheadsp from the pseudo state (nstate + 1).
4520
45212001-12-27 Akim Demaille <akim@epita.fr>
4522
4523 * src/output.c (action_row, token_actions): Use a state_t instead
4524 of a integer, and nlookaheads instead of the following state's
4525 lookaheadsp.
4526
45272001-12-27 Akim Demaille <akim@epita.fr>
4528
4529 * src/conflicts.c (log_resolution, flush_shift)
4530 (resolve_sr_conflict, set_conflicts, solve_conflicts)
4531 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
4532 (conflicts_print, print_reductions): Use a state_t instead of an
4533 integer when referring to a state.
4534 As much as possible, depend upon nlookaheads, instead of the
4535 `lookaheadsp' member of the following state (since lookaheads of
4536 successive states are successive, the difference between state n + 1
4537 and n served as the number of lookaheads for state n).
4538 * src/lalr.c (add_lookback_edge): Likewise.
4539 * src/print.c (print_core, print_actions, print_state)
4540 (print_results): Likewise.
4541 * src/print_graph.c (print_core, print_actions, print_state)
4542 (print_graph): Likewise.
4543 * src/conflicts.h: Adjust.
4544
45452001-12-27 Akim Demaille <akim@epita.fr>
4546
4547 * src/bison.hairy: Formatting/comment changes.
4548 ANSIfy.
4549 Remove `register' indications.
4550 Add plenty of `static'.
4551
45522001-12-27 Akim Demaille <akim@epita.fr>
4553
4554 * src/output.c (prepare): Drop the muscle `ntbase' which
4555 duplicates ntokens.
4556 * src/bison.simple: Formatting/comment changes.
4557 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
4558 is an undocumented synonym.
4559
45602001-12-22 Akim Demaille <akim@epita.fr>
4561
4562 * src/output.c (output_table_data): Change the prototype to use
4563 `int' for array ranges: some invocations do pass an int, not a
4564 short.
4565 Reported by Wayne Green.
4566
45672001-12-22 Akim Demaille <akim@epita.fr>
4568
4569 Some actions of web2c.y are improperly triggered.
4570 Reported by Mike Castle.
4571
4572 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
4573 * tests/regression.at (Web2c): Rename as...
4574 (Web2c Report): this.
4575 (Web2c Actions): New.
4576
45772001-12-22 Akim Demaille <akim@epita.fr>
4578
4579 Reductions in web2c.y are improperly reported.
4580 Reported by Mike Castle.
4581
4582 * src/conflicts.c (print_reductions): Fix.
4583 * tests/regression.at (Web2c): New.
4584
45852001-12-18 Akim Demaille <akim@epita.fr>
4586
4587 Some host fail on `assert (!"foo")', which expands to
4588 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
4589 Reported by Nelson Beebee.
4590
4591 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
4592 `#define it_succeeded 0' and `assert (it_succeeded)'.
4593
45942001-12-17 Marc Autret <autret_m@epita.fr>
4595
4596 * src/bison.simple: Don't hard code the skeleton line and filename.
4597 * src/output.c (output_parser): Rename 'line' as 'output_line'.
4598 New line counter 'skeleton_line' (skeleton-line muscle).
4599
46002001-12-17 Paul Eggert <eggert@twinsun.com>
4601
4602 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
4603 YYDEBUG must be defined to a nonzero value.
4604
4605 * src/bison.simple (yytname): Do not assume that the user defines
4606 YYDEBUG to a properly parenthesized expression.
4607
46082001-12-17 Akim Demaille <akim@epita.fr>
4609
4610 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
4611 nlookaheads is a new member.
4612 Adjust all users.
4613 * src/lalr.h (nlookaheads): Remove this orphan declaration.
4614 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
4615 state.
4616
46172001-12-17 Akim Demaille <akim@epita.fr>
4618
4619 * src/files.h, src/files.c (open_files, close_files): Remove.
4620 * src/main.c (main): Don't open/close files, nor invoke lex_free,
4621 let...
4622 * src/reader.c (reader): Do it.
4623
46242001-12-17 Akim Demaille <akim@epita.fr>
4625
4626 * src/conflicts.c (print_reductions): Formatting changes.
4627
46282001-12-17 Akim Demaille <akim@epita.fr>
4629
4630 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
4631 (flush_reduce): New.
4632 (resolve_sr_conflict): Adjust.
4633
46342001-12-17 Akim Demaille <akim@epita.fr>
4635
4636 * src/output.c (output_obstack): Be static and rename as...
4637 (format_obstack): this, to avoid any confusion with files.c's
4638 output_obstack.
4639 * src/reader.h (muscle_obstack): Move to...
4640 * src/output.h: here, since it's defined in output.c.
4641
46422001-12-17 Akim Demaille <akim@epita.fr>
4643
4644 * src/output.c (action_row, save_column, default_goto)
4645 (sort_actions, matching_state, pack_vector): Better variable
4646 locality.
4647
46482001-12-17 Akim Demaille <akim@epita.fr>
4649
4650 * src/output.c: Various formatting changes.
4651
46522001-12-17 Akim Demaille <akim@epita.fr>
4653
4654 * src/files.c (output_files): Free the output_obstack.
4655 * src/main.c (main): Call print and print_graph conditionally.
4656 * src/print.c (print): Work unconditionally.
4657 * src/print_graph.c (print_graph): Work unconditionally.
4658 * src/conflicts.c (log_resolution): Output only if verbose_flag.
4659
46602001-12-16 Marc Autret <autret_m@epita.fr>
4661
4662 * src/output.c (actions_output): Fix. When we use %no-lines,
4663 there is one less line per action.
4664
46652001-12-16 Marc Autret <autret_m@epita.fr>
4666
4667 * src/bison.simple: Remove a useless #line directive.
4668 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
4669 * src/output.c (get_lines_number): New.
4670 (output_parser): Adjust, now takes care about the lines of a
4671 output muscles.
4672 Fix line numbering.
4673 (actions_output): Computes the number of lines taken by actions.
4674 (output_master_parser): Insert new skeleton which is the name of
4675 the output parser file name.
4676
46772001-12-15 Marc Autret <autret_m@epita.fr>
4678
4679 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
4680
46812001-12-15 Marc Autret <autret_m@epita.fr>
4682
4683 * src/output.c (output_gram): Keep track of the hairy one.
4684
46852001-12-15 Akim Demaille <akim@epita.fr>
4686
4687 Make `make distcheck' work.
4688
4689 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
4690 system.h which uses libgettext.h.
4691
46922001-12-15 Akim Demaille <akim@epita.fr>
4693
4694 * src/nullable.c (set_nullable): Useless rules must be skipped,
4695 otherwise, since we range over their symbols, we might look at a
4696 nonterminal which no longer ``exists'', i.e., it is not counted in
4697 `nvars', hence we overflow our arrays.
4698
46992001-12-15 Akim Demaille <akim@epita.fr>
4700
4701 The header can also be produced directly, without any obstack!
4702 Yahoo!
4703
4704 * src/files.c, src/files.h (defines_obstack): Remove.
4705 (compute_header_macro): Global.
4706 (defines_obstack_save): Remove.
4707 * src/reader.c (parse_union_decl): No longer output to
4708 defines_obstack: its content can be found in the `stype' muscle
4709 anyway.
4710 (output_token_translations): Merge into...
4711 (symbols_output): this.
4712 Rename as...
4713 (symbols_save): this.
4714 (reader): Adjust.
4715 * src/output.c (header_output): New.
4716 (output): Call it.
4717
47182001-12-15 Akim Demaille <akim@epita.fr>
4719
4720 * src/reader.c (parse_union_decl): Instead of handling two obstack
4721 simultaneously, use one to define the `stype' muscle, and use the
4722 value of the latter to fill defines_obstack.
4723 (copy_comment): Remove.
4724 (copy_comment2): Work for a single obstack.
4725 Rename as...
4726 (copy_comment): this.
4727
47282001-12-15 Akim Demaille <akim@epita.fr>
4729
4730 * src/lex.c, src/lex.h (xgetc): No longer static.
4731 * src/reader.c (parse_union_decl): Revamp.
4732
47332001-12-15 Akim Demaille <akim@epita.fr>
4734
4735 Still making progress in separating Bison into (i) input, (ii)
4736 process, (iii) output: now we can directly output the parser file
4737 without using table_obstack at all.
4738
4739 * src/files.c, src/files.h (table_obstack): Bye bye.
4740 (parser_file_name): New.
4741 * src/files.c (compute_output_file_names): Compute it.
4742 * src/output.c (actions_output, output_parser)
4743 (output_master_parser): To a file instead of an obstack.
4744
47452001-12-15 Akim Demaille <akim@epita.fr>
4746
4747 Attach actions to rules, instead of pre-outputting them to
4748 actions_obstack.
4749
4750 * src/gram.h (rule_t): action and action_line are new members.
4751 * src/reader.c (symbol_list): Likewise.
4752 (copy_action): Save the actions within the rule.
4753 (packgram): Save them in rule_table.
4754 * src/output.c (actions_output): New.
4755 (output_parser): Use it on `%%actions'.
4756 (output_rule_data): Don't free rule_table.
4757 (output): Do it.
4758 (prepare): Don't save the `action' muscle.
4759 * src/bison.simple: s/%%action/%%actions/.
4760
47612001-12-15 Akim Demaille <akim@epita.fr>
4762
4763 * src/reader.c (copy_action): When --yacc, don't append a `;'
4764 to the user action: let it fail if lacking.
4765 Suggested by Arnold Robbins and Tom Tromey.
4766
47672001-12-14 Akim Demaille <akim@epita.fr>
4768
4769 * src/lex.c (literalchar): Simply return the char you decoded, non
4770 longer mess around with obstacks and int pointers.
4771 Adjust all callers.
4772
47732001-12-14 Akim Demaille <akim@epita.fr>
4774
4775 * src/lex.c (literalchar): Don't escape the special characters,
4776 just decode them, and keep them as char (before, eol was output as
4777 the 2 char string `\n' etc.).
4778 * src/output.c (output_rule_data): Use quotearg to output the
4779 token strings.
4780
47812001-12-13 Paul Eggert <eggert@twinsun.com>
4782
4783 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
4784 Do not infringe on the global user namespace when using C++.
4785 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
4786 All uses of `fprintf' and `stderr' changed.
4787
4788 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
4789
47902001-12-13 Akim Demaille <akim@epita.fr>
4791
4792 The computation of nullable is broken: it doesn't handle empty
4793 RHS's properly.
4794
4795 * tests/torture.at (GNU AWK Grammar): New.
4796 * tests/sets.at (Nullable): New.
4797 * src/nullable.c (set_nullable): Instead of blindly looping over
4798 `ritems', loop over the rules, and then over their rhs's.
4799
4800 Work around Autotest bugs.
4801
4802 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
4803 frame, because Autotest understand lines starting with a `+' as
4804 traces from the shell. Then, they are not processed properly.
4805 Admittedly an Autotest bug, but we don't have time to wait for
4806 Autotest to catch up.
4807 * tests/regression.at (Broken Closure): Adjust to the new table
4808 frames.
4809 Move to...
4810 * tests/sets.at: here.
4811
48122001-12-13 Akim Demaille <akim@epita.fr>
4813
4814 * src/closure.c (closure): Use nrules instead of playing tricks
4815 with BITS_PER_WORD.
4816
48172001-12-13 Akim Demaille <akim@epita.fr>
4818
4819 * src/print.c (print_actions): Output the handling of `$' as the
4820 traces do: shifting the token EOF. Before EOF was treated as a
4821 nonterminal.
4822 * tests/regression.at: Adjust some tests.
4823 * src/print_graph.c (print_core): Complete the set of items via
4824 closure. The next-to-final and final states are still unsatisfying,
4825 but that's to be addressed elsewhere.
4826 No longer output the rule numbers, but do output the state number.
4827 A single loop for the shifts + gotos is enough, but picked a
4828 distinct color for each.
4829 (print_graph): Initialize and finalize closure.
4830
48312001-12-13 Akim Demaille <akim@epita.fr>
4832
4833 * src/reader.c (readgram): Remove dead code, an strip useless
4834 braces.
4835 (get_type): Remove, unused.
4836
48372001-12-12 Akim Demaille <akim@epita.fr>
4838
4839 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
4840 on that of lib/error.c.
4841
48422001-12-12 Akim Demaille <akim@epita.fr>
4843
4844 Some hosts don't like `/' in includes.
4845
4846 * src/system.h: Include libgettext.h without qualifying the path.
4847 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
4848 $(top_srcdir).
4849
48502001-12-11 Marc Autret <autret_m@epita.fr>
4851
4852 * src/output.c (output_parser): Remove useless muscle.
4853
48542001-12-11 Marc Autret <autret_m@epita.fr>
4855
4856 * src/bison.simple: Remove #line just before %%epilogue. It
4857 is now handled in ...
4858 * src/reader.c (read_additionnal_code): Add the output of a
4859 #line for the epilogue.
4860
48612001-12-10 Marc Autret <autret_m@epita.fr>
4862
4863 * src/reader.c (copy_definition): Re-use CPP-outed code which
4864 replace precedent remove.
4865 * src/bison.simple: Remove #line before %%prologue because
4866 %%input-line is wrong at this time.
4867
48682001-12-10 Marc Autret <autret_m@epita.fr>
4869
4870 * src/reader.c (symbols_output): Clean up.
4871 * src/output.c (output_gram, output): Clean up.
4872
48732001-12-10 Akim Demaille <akim@epita.fr>
4874
4875 * src/lalr.c (initialize_lookaheads): New. Extracted from...
4876 * src/LR0.c (set_state_table): here.
4877 * src/lalr.c (lalr): Call it.
4878
48792001-12-10 Akim Demaille <akim@epita.fr>
4880
4881 * src/state.h (shifts): Remove the `number' member: shifts are
4882 attached to state, hence no longer need to be labelled with a
4883 state number.
4884
48852001-12-10 Akim Demaille <akim@epita.fr>
4886
4887 Now that states have a complete set of members, the linked list of
4888 shifts is useless: just fill directly the state's shifts member.
4889
4890 * src/state.h (shifts): Remove the `next' member.
4891 * src/LR0.c (first_state, last_state): Remove.
4892 Adjust the callers.
4893 (augment_automaton): Don't look for the shifts that must be added
4894 a shift on EOF: it is those of the state we looked for! But now,
4895 since shifts are attached, it is no longer needed to looking
4896 merely by its id: its number.
4897
48982001-12-10 Akim Demaille <akim@epita.fr>
4899
4900 * src/LR0.c (augment_automaton): Better variable locality.
4901 Remove an impossible branch: if there is a state corresponding to
4902 the start symbol being shifted, then there is shift for the start
4903 symbol from the initial state.
4904
49052001-12-10 Akim Demaille <akim@epita.fr>
4906
4907 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
4908 only when appropriate: when insert_start_shifting_state' is not
4909 invoked.
4910 * tests/regression.at (Rule Line Numbers): Adjust.
4911
49122001-12-10 Akim Demaille <akim@epita.fr>
4913
4914 * src/LR0.c (augment_automaton): Now that all states have shifts,
4915 merge the two cases addition shifts to the initial state.
4916
49172001-12-10 Akim Demaille <akim@epita.fr>
4918
4919 * src/lalr.c (set_state_table): Move to...
4920 * src/LR0.c: here.
4921 * src/lalr.c (lalr): Don't call it...
4922 * src/LR0.c (generate_states): do it.
4923 * src/LR0.h (first_state): Remove, only the table is used.
4924
49252001-12-10 Akim Demaille <akim@epita.fr>
4926
4927 * src/LR0.h (first_shift, first_reduction): Remove.
4928 * src/lalr.c: Don't use first_shift: find shifts through the
4929 states.
4930
49312001-12-10 Akim Demaille <akim@epita.fr>
4932
4933 * src/LR0.c: Attach shifts to states as soon as they are
4934 computed.
4935 * src/lalr.c (set_state_table): Instead of assigning shifts to
4936 state, just assert that the mapping was properly done.
4937
49382001-12-10 Akim Demaille <akim@epita.fr>
4939
4940 * src/LR0.c (insert_start_shift): Rename as...
4941 (insert_start_shifting_state): this.
4942 (insert_eof_shifting_state, insert_accepting_state): New.
4943 (augment_automaton): Adjust.
4944 Better locality of the variables.
4945 When looking if the start_symbol is shifted from the initial
4946 state, using `while (... symbol != start_symbol ...)' sounds
4947 better than `while (... symbol < start_symbol ...)': If fail
4948 to see how the order between symbols could be relevant!
4949
49502001-12-10 Akim Demaille <akim@epita.fr>
4951
4952 * src/getargs.h: Don't declare `spec_name_prefix' and
4953 `spec_file_prefix', declared by src/files.h.
4954 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
4955 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
4956 * src/output.c (prepare): Adjust.
4957 * src/reader.c (symbols_output): Likewise.
4958 * src/vmsgetargs.c: Vaguely adjust, but who cares?
4959
49602001-12-10 Akim Demaille <akim@epita.fr>
4961
4962 * src/muscle_tab.c (muscle_init): NULL is a better default than
4963 `"0"'.
4964
49652001-12-10 Akim Demaille <akim@epita.fr>
4966
4967 * src/reader.c (reader): Calling symbols_output once is enough.
4968
49692001-12-10 Akim Demaille <akim@epita.fr>
4970
4971 Now that states have a complete set of members, the linked list of
4972 reductions is useless: just fill directly the state's reductions
4973 member.
4974
4975 * src/state.h (struct reductions): Remove member `number' and
4976 `next'.
4977 * src/LR0.c (first_reduction, last_reduction): Remove.
4978 (save_reductions): Don't link the new reductions, store them in
4979 this_state.
4980 * src/lalr.c (set_state_table): No need to attach reductions to
4981 states, it's already done.
4982 * src/output.c (output_actions): No longer free the shifts, then
4983 the reductions, then the states: free all the states and their
4984 members.
4985
49862001-12-10 Akim Demaille <akim@epita.fr>
4987
4988 * src/options.c (OPTN, DRTV, BOTH): New.
4989 (option_table): Use them.
4990
4991 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
4992 the job of system.h.
4993 * src/options.c: Don't include stdio.h and xalloc.h for the same
4994 reasons.
4995
49962001-12-10 Akim Demaille <akim@epita.fr>
4997
4998 * src/output.c (output, prepare): Make sure the values of the
4999 muscles `action' and `prologue' are 0-terminated.
5000
50012001-12-10 Akim Demaille <akim@epita.fr>
5002
5003 Clean up GCC warnings.
5004
5005 * src/reader.c (copy_action): `buf' is not used.
5006 (parse_skel_decl): Be static.
5007 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
5008 * src/options.h (create_long_option_table): Have a real prototype.
5009 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
5010 (hash_delete_at): Return const void *.
5011 Adjust casts to preserve the const.
5012
50132001-12-10 Akim Demaille <akim@epita.fr>
5014
5015 * configure.in: Require 2.52g.
5016 M4 is not needed, but AUTOM4TE is.
5017 * m4/m4.m4: Remove.
5018 * tests/Makefile.am: Adjust.
5019
50202001-12-10 Akim Demaille <akim@epita.fr>
5021
5022 One structure for states is enough, even though theoretically
5023 there are LR(0) states and LALR(1) states.
5024
5025 * src/lalr.h (state_t): Remove.
5026 (state_table): Be state_t **, not state_t *.
5027 * src/state.h (core, CORE_ALLOC): Rename as...
5028 (state_t, STATE_ALLOC): this.
5029 Add the LALR(1) members: shifts, reductions, errs.
5030 * src/LR0.c (state_table): Rename as...
5031 (state_hash): this, to avoid name clashes with the global
5032 `state_table'.
5033 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
5034 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
5035
50362001-12-10 Akim Demaille <akim@epita.fr>
5037
5038 Bison dumps core on bash.y.
5039 Reported by Pascal Bart.
5040
5041 * src/warshall.c (bitmatrix_print): New.
5042 (TC): Use it.
5043 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
5044 j must be the outer loop.
5045 * tests/regression.at (Broken Closure): New.
5046
50472001-12-05 Akim Demaille <akim@epita.fr>
5048
5049 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
5050 its argument.
5051