]> git.saurik.com Git - bison.git/blame - ChangeLog
(Badly Collapsed GLR States): Avoid //
[bison.git] / ChangeLog
CommitLineData
9c1e26bd
AD
12002-11-13 Akim Demaille <akim@epita.fr>
2
3 * data/yacc.c: Leave bigger chunks of quoted text.
4 (YYDSYMPRINTF): New.
5 Use it to report symbol activities.
6 * data/glr.c (YYDSYMPRINTF): New.
7 Use it.
8
87f721cc
PE
92002-11-12 Paul Eggert <eggert@twinsun.com>
10
11 Version 1.75b.
12
13 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14 (yyglrReduce): Return yyok, not 0.
15 This should avoid the enumerated-type warnings reported
16 by Nelson H.F. Beebe in
17 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001872.html>.
18
19 * lib/bbitset.h (BITSET_INLINE): Remove.
20 * lib/bitset.h [! BITSET_INLINE]: Remove.
21 (bitset_set, bitset_reset, bitset_test): Rename local vars
22 to avoid shadowing warnings by GCC.
23
24 * data/glr.c (inline): Remove #define. It's the user's
25 responsibility to #define it away, just like 'const'.
26 This fixes one of the bugs reported by Nelson H.F. Beebe in
27 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001873.html>.
28
29 * Makefile.maint (po-check): Scan .l and .y files instead of the
30 .c and the .h files that they generate. This fixes the bug
31 reported by Tim Van Holder in:
32 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
33 Look for N_ as well as for _. Try to avoid matching #define for
34 N_ and _.
35 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
36 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
37 * src/scan-gram.l: Revamp regular expressions so that " and '
38 do not confuse xgettext.
39
40 * src/struniq.h (struniq_new): Do not declare the return type
41 to be 'const'; this violates the C standard.
42 * src/struniq.c (struniq_new): Likewise.
43
be14ade5
AD
442002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
45
46 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
47 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
48 linker.
49
05291fbc
AD
502002-11-12 Akim Demaille <akim@epita.fr>
51
52 * Makefile.maint: Sync with Autoconf:
53 (local_updates): New.
54
1f5fd52e
AD
552002-11-12 Akim Demaille <akim@epita.fr>
56
57 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
58
283f1e64
AD
592002-11-12 Akim Demaille <akim@epita.fr>
60
61 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
62 locations.
63
886b69d1
AD
642002-11-12 Akim Demaille <akim@epita.fr>
65
66 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
67 not yyvalue.
68
3df37415
AD
692002-11-12 Akim Demaille <akim@epita.fr>
70
71 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
72 Use it to test the GLR parser.
73
7bd6c77e
AD
742002-11-12 Akim Demaille <akim@epita.fr>
75
76 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
77 defines it.
78 * data/glr.c (yystos): New.
79 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
80 (YYDSYMPRINT): New.
81 (yyval): Don't define it, it is handled via M4.
82 (yyrecoverParseError): Free verbosely the discarded symbols.
83 * data/yacc.c (yysymprint): Remove, rather...
84 (b4_yysymprint_generate): invoke.
85 * data/c.m4 (b4_yysymprint_generate): New.
86 Accept pointers as arguments, as opposed to the version from
87 yacc.c.
88 (b4_yydestruct_generate): Likewise.
89 * tests/cations.at (Printers and Destructors): Use Bison directives
90 instead of CPP macros.
91 Don't rely on internal details.
92
b0400cc6
AD
932002-11-12 Akim Demaille <akim@epita.fr>
94
95 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
96 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
97 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
98 it against YYEMPTY and so forth), work on yytoken (i.e., set
99 it to YYEMPTY etc.).
100 (yydestruct): Replace with a b4_yydestruct_generate invocation.
101 (b4_symbol_actions): Remove.
102 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
103 for 0, end-of-input.
104
72f889cc
AD
1052002-11-12 Akim Demaille <akim@epita.fr>
106
107 * doc/bison.texinfo (Destructor Decl): New.
108
b1ae9233
AD
1092002-11-12 Akim Demaille <akim@epita.fr>
110
111 * src/tables.c (tables_generate): Use free for pointers that
112 cannot be NULL, not XFREE.
113 (pack_vector): Use assert, not fatal, for bound violations.
114 * src/state.c (state_new): Likewise.
115 * src/reader.c (reader): Likewise.
116 * src/lalr.c (set_goto_map): Likewise.
72f889cc 117 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
118 the file name.
119
7ec2d4cd
AD
1202002-11-12 Akim Demaille <akim@epita.fr>
121
122 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
123 Restore.
124 * src/scan-gram.l (last_string): Is global to the file, not to
125 yylex.
126 * src/parse-gram.y (input): Don't append the epilogue here,
127 (epilogue.opt): do it here, and free the scanner's obstack.
128 * src/reader.c (epilogue_set): Rename as...
129 (epilogue_augment): this.
130 * data/c.m4 (b4_epilogue): Defaults to empty.
131
573a6cd3
AD
1322002-11-12 Akim Demaille <akim@epita.fr>
133
134 * src/getargs.c (long_options): Remove duplicates.
135 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
136 Remove.
137 * doc/bison.rnh: Remove.
138 * doc/bison.texinfo (VMS Invocation): Remove.
139
95612cfa
AD
1402002-11-12 Akim Demaille <akim@epita.fr>
141
142 * src/struniq.h, src/struniq.c (struniq_t): Is const.
143 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
144
145 Use struniq for symbols.
146
147 * src/symtab.h (symbol_t): The tag member is a struniq.
148 (symbol_type_set): Adjust.
149 * src/symtab.c (symbol_new): Takes a struniq.
150 (symbol_free): Don't free the tag member.
151 (hash_compare_symbol_t, hash_symbol_t): Rename as...
152 (hash_compare_symbol, hash_symbol): these.
153 Use the fact that tags as struniqs.
154 (symbol_get): Use struniq_new.
155 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
156 Returns a strniq.
157 * src/reader.h (merger_list, grammar_currentmerge_set): The name
158 and type members are struniqs.
159 * src/reader.c (get_merge_function)
160 (grammar_current_rule_merge_set): Adjust.
161 (TYPE, current_type): Are struniq.
162
163 Use struniq for file names.
164
165 * src/files.h, src/files.c (infile): Split into...
166 (grammar_file, current_file): these.
167 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
168 * src/reduce.c (reduce_print): Likewise.
169 * src/getargs.c (getargs): Likewise.
170 * src/complain.h, src/complain.c: Likewise.
171 * src/main.c (main): Call struniqs_new early enough to use it for
172 file names.
173 Don't free the input file name.
174
3e6656f9
AD
1752002-11-12 Akim Demaille <akim@epita.fr>
176
177 * src/symtab.c (symbol_free): Remove dead deactivated code:
178 type_name are properly removed.
179 Don't use XFREE to free items that cannot be NULL.
180 * src/struniq.h, src/struniq.c: New.
181 * src/main.c (main): Initialize/free struniqs.
182 * src/parse-gram.y (%union): Add astruniq member.
183 (yyprint): Adjust.
184 * src/scan-gram.l (<{tag}>): Return a struniq.
185 Free the obstack bit that used to store it.
186 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
187
7672019c
PE
1882002-11-11 Paul Eggert <eggert@twinsun.com>
189
190 Revamp to fix many (but not all) of the C- and M4-related quoting
191 problems. Among other things, this fixes the Bison bug reported
192 by Jan Hubicka when processing the Bash grammar; see:
193 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001329.html>
194
195 Use new @ escapes consistently. Represent brackets with @{ and @}
196 rather than @<:@ and @:>@, since this works a bit better with dumb
197 editors like vi. Represent @ with @@, since @ is now consistently
198 an escape. Use @oline@ and @ofile@ rather than __oline__ and
199 __ofile__, to avoid unexpected expansions. Similarly, use @output
200 rather than #output.
201
202 * data/c.m4 (b4_copyright): Omit file name from comment, since
203 the file name could contain "*/".
204 (b4_synclines_flag): Don't quote the 2nd argument; it should already
205 be quoted. All uses changed.
206
207 * data/glr.c: Use new @ escapes consistently.
208 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
209 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
210 Remove, since they couldn't handle arbitrary characters in file
211 names.
212 * data/lalr1.cc: Likewise.
213 * data/yacc.c: Likewise.
214
215 * src/files.c (output_infix): Remove; all uses removed.
216 * src/files.h: Likewise.
217
218 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
219 mishandled funny characters in file names, and anyway it isn't
220 needed any more.
221 * data/yacc.c: Likewise.
222 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
223
224 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
225 * data/yacc.c: Likewise.
226
227 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
228 strings now.
229 (muscle_init): Quote filename as a C string.
230 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
231 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
232 * src/output.c (escaped_file_name_output): New function.
233 (prepare_symbols): Quote tokens for M4.
234 (prepare): Don't insert output_infix, output_prefix,
235 output_parser_name, output_header_name; this is now down by scan-skel.
236 Insert skeleton as a C string.
237
238 * src/output.c (user_actions_output, symbol_destructors_output,
239 symbol_printers_output): Quote filenames for C and M4.
240 * src/reader.c (prologue_augment, epilogue_set): Likewise.
241
242 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
243 escapes other than \\ and \'; this simplifies the code.
244 (<SC_STRING>): Likewise, for \\ and \".
245 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
246 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
247 Use new escapes @{ and @} for [ and ].
248
249 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
250 them with auto vars.
251 Switch to new escape scheme, where @ is the escape character uniformly.
252 Abort if a stray escape character is found. Avoid unbounded input
253 buffer when parsing non-escaped text.
254
255 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
256 __oline__, #output, $@, and @{ do not have unintended meanings.
257
acea4f3b
PE
2582002-11-09 Paul Eggert <eggert@twinsun.com>
259
260 Fix the test failure due to GCC warnings described in
261 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001815.html>.
262 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
263 evaluate to 0 if it's impossible for NINF to be in the respective
264 table.
265 (yygetLRActions, yyrecoverParseError): Use them.
266
267 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
268 counted in the token inserted at end of file. Now takes
269 location_t *, not location_t, so that the location can be
270 adjusted. All uses changed.
271
272 * tests/regression.at (Invalid inputs): Adjust wording in
273 diagnostic to match the new behavior.
274
275 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
276 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
277 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
278 abort ();'. This reduces the runtime of the "Many lookaheads"
279 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
280 GCC 3.2.
281
20ef1ad5
PE
2822002-11-07 Paul Eggert <eggert@twinsun.com>
283
284 * src/parse-gram.y (CHARACTER): Remove unused token.
285 All uses removed.
286
287 * src/scan-gram.l: Remove stack option. We no longer use the
288 stack, since the stack was never deeper than 1; instead, use the
289 new auto var c_context to record the stacked value.
290
291 Remove nounput option. At an unexpected end of file, we now unput
292 the minimal input necessary to end cleanly; this simplifies the
293 code.
294
295 Avoid unbounded token sizes where this is easy.
296
297 (unexpected_end_of_file): New function.
298 Use it to systematize the error message on unexpected EOF.
299 (last-string): Now auto, not static.
300 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
301 (scanner_last_string_free): Remove; not used.
302 (percent_percent_count): Move decl to just before use.
303 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
304 not the (never otherwised-used) CHARACTER.
305
93724f13
AD
3062002-11-07 Akim Demaille <akim@epita.fr>
307
308 Let yyerror always receive the msg as last argument, so that
309 yyerror can be variadic.
310
311 * data/yacc.c (b4_yyerror_args): New.
312 Use it when calling yyerror.
313 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
314 Use it when calling yyerror.
315 * doc/bison.texinfo (Error Reporting): Adjust.
316 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
317 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
318
6e40b4eb
AD
3192002-11-06 Akim Demaille <akim@epita.fr>
320
321 #line should have quoted strings.
322 Ideally, this should be done by m4_quotearg.
323
324 * src/scan-skel.l: Include quotearg.h.
325 Quote __ofile__.
326 * src/output.c (symbol_printers_output)
327 (symbol_destructors_output): Quote the file name.
328
2dfbfc12
AD
3292002-11-06 Akim Demaille <akim@epita.fr>
330
331 * tests/regression.at (Invalid inputs): Adjust to the recent
332 messages.
333
437c2d80
AD
3342002-11-06 Akim Demaille <akim@epita.fr>
335
336 Restore --no-lines.
337 Reported by Jim Kent.
338
339 * data/c.m4 (b4_syncline): New.
340 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
341 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
342 * src/output.c (user_actions_output): Likewise.
343 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 344 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 345
900c5db5
AD
3462002-11-06 Akim Demaille <akim@epita.fr>
347
348 * src/main.c (main): Free `infile'.
349 * src/scan-gram.l (handle_syncline): New.
350 Recognize `#line'.
351 * src/output.c (user_actions_output, symbol_destructors_output)
352 (symbol_printers_output): Use the location's file name, not
353 infile.
354 * src/reader.c (prologue_augment, epilogue_set): Likewise.
355
e183b123 3562002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 357
e183b123 358 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 359 either has GLR conflict entries.
e183b123 360
193eb6b7
PE
3612002-11-05 Paul Eggert <eggert@twinsun.com>
362
e183b123
PE
363 * src/scan-gram.l: Use more accurate diagnostics, e.g.
364 "integer out of range" rather than "invalid value".
365 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
366 accordingly.
367
193eb6b7
PE
368 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
369 Also, remove one static variable in the scanner.
370
371 * src/scan-gram.l (braces_level): Now auto, not static.
372 Initialize to zero if the compiler is being picky.
373 (INITIAL): Clear braces_level instead of incrementing it.
374 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
375 as POSIX 1003.1-2001 requires.
376 * src/system.h (IF_LINT): New macro, taken from coreutils.
377 * configure.ac: Define "lint" if --enable-gcc-warnings.
378
29c01725
AD
3792002-11-05 Akim Demaille <akim@epita.fr>
380
381 * src/scan-gram.l: When it starts with `%', complain about the
382 whole directive, not just that `invalid character: %'.
383
8aeac3ca
AD
3842002-11-04 Akim Demaille <akim@epita.fr>
385
386 * Makefile.maint: Update from Autoconf.
387 (update, cvs-update, po-update, do-po-update): New.
388
793a58bb
AD
3892002-11-04 Akim Demaille <akim@epita.fr>
390
391 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
392 and yyerror.
393 Have yyerror `use' its arguments.
394 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
395 returns true when location & yacc & pure & parse-param.
396 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
397
c4d720cd
AD
3982002-11-04 Akim Demaille <akim@epita.fr>
399
400 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
401 clashes.
402 * src/scan-gram.l: Use [\'] instead of ['] to pacify
403 font-lock-mode.
404 Use complain_at.
405 Use quote, not quote_n since LOCATION_PRINT no longer uses the
406 slot 0.
407
613a0dc5
PE
4082002-11-03 Paul Eggert <eggert@twinsun.com>
409
410 * src/reader.c (get_merge_function, grammar_current_rule_check):
411 Use consistent diagnostics for reporting type name clashes.
412 Quote the types with <>, for consistency with Yacc.
413 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
414
2a8d363a
AD
4152002-11-03 Akim Demaille <akim@epita.fr>
416
417 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
418 New.
419 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
420 (b4_parse_param): Remove.
421 Use b4_identification.
422 Propagate b4_pure_args where needed to pass them to yyerror.
423 * data/glr.m4 (b4_parse_param): Remove.
424 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
425 (b4_lpure_formals): New.
426 Use b4_identification.
427 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
428 b4_user_formals and b4_user_args.
429 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
430 (yyreportAmbiguity): When using a pure parser, also need
431 the location, and the parse-params.
432 Adjust callers.
433 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
434 When using a pure parser, also need the parse-params.
435 Adjust callers.
436 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
437 (%pure-parser + %parse-param) LALR and GLR parsers.
438 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
439 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
440 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
441 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
442 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
443 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
444 * doc/bison.texinfo: Untabify the whole file.
445 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
446 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
447 (Error Reporting): Adjust to these new directives.
448 Document %error-verbose, deprecate YYERROR_VERBOSE.
449
9e32add8
AD
4502002-11-03 Akim Demaille <akim@epita.fr>
451
452 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
453 AT_CHECK_CALC_GLR invocations to use % directives, instead of
454 command line options.
455 * tests/cxx-type.at: Formatting changes.
456
b02d90a5
PE
4572002-11-03 Paul Eggert <eggert@twinsun.com>
458
459 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
460 to count columns correctly, and to check for invalid inputs.
9e32add8 461
b02d90a5
PE
462 Use mbsnwidth to count columns correctly. Account for tabs, too.
463 Include mbswidth.h.
464 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
465 (extend_location): New function.
466 (YY_LINES): Remove.
467
468 Handle CRLF in C code rather than in Lex code.
469 (YY_INPUT): New macro.
470 (no_cr_read): New function.
471
472 Scan UCNs, even though we don't fully handle them yet.
473 (convert_ucn_to_byte): New function.
474
475 Handle backslash-newline correctly in C code.
476 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
477 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
478 all uses changed.
479 (tag, splice): New EREs. Do not allow NUL or newline in tags.
480 Use {splice} wherever C allows backslash-newline.
481 YY_STEP after space, newline, vertical-tab.
482 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 483
b02d90a5
PE
484 (letter, id): Don't assume ASCII; e.g., spell out a-z.
485
486 ({int}, handle_action_dollar, handle_action_at): Check for integer
487 overflow.
9e32add8 488
b02d90a5
PE
489 (YY_STEP): Omit trailing semicolon, so that it's more like C.
490
491 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
492 as well as \000. Check for UCHAR_MAX, not 255.
493 Allow \x with an arbitrary positive number of digits, as in C.
494 Check for overflow here.
495 Allow \? and UCNs, for compatibility with C.
496
497 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
498 with quote slot used by complain_at.
499
500 * tests/input.at: Add tests for backslash-newline, m4 quotes
501 in symbols, long literals, and funny escapes in strings.
502
503 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
504 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
505 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
506 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
507 * m4/mbswidth.m4: New file, from GNU coreutils.
508
509 * doc/bison.texinfo (Grammar Outline): Document // comments.
510 (Symbols): Document that trigraphs have no special meaning in Bison,
511 nor is backslash-newline allowed.
512 (Actions): Document that trigraphs have no special meaning.
513
514 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
515 no longer used.
516
5172002-11-02 Paul Eggert <eggert@twinsun.com>
518
519 * src/reader.c: Don't include quote.h; not needed.
520 (get_merge_function): Reword warning to be consistent with
521 type clash diagnostic in grammar_current_rule_check.
522
523 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
524 bug in trigraph handling.
525
526 * src/output.c (prepare_symbols): When printing token names,
527 escape "[" as "@<:@" and likewise for "]".
528
529 * src/system.h (errno): Remove declaration, as we are now
530 assuming C89 or better, and C89 guarantees errno.
531
762b212b
PE
5322002-10-30 Paul Eggert <eggert@twinsun.com>
533
534 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
535 Check for close failures.
536 * src/files.h (xfclose): Return void, not int, since it always
537 returned zero.
538 * src/files.c (xfclose): Likewise. Report I/O error if ferror
539 indicates one.
540 * src/output.c (output_skeleton): Use xfclose rather than fclose
541 and ferror. xfclose now checks ferror.
542
543 * data/glr.c (YYLEFTMOST_STATE): Remove.
544 (yyreportTree): Use a stack-based leftmost state. This avoids
545 our continuing battles with bogus warnings about initializers.
546
56100c60
AD
5472002-10-30 Akim Demaille <akim@epita.fr>
548
549 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
550 #if.
551
51b4a04c
PH
5522002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
553
554 * tests/glr-regr1.at: New test for reported regressions.
555 * tests/testsuite.at: Add glr-regr1.at test.
556 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 557
bf1ebda2
PE
5582002-10-24 Paul Eggert <eggert@twinsun.com>
559
5c16c6b1
PE
560 Version 1.75a.
561
bf1ebda2
PE
562 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
563 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
564 we use malloc. Don't assume 'A' through 'Z' are contiguous.
565 Don't assume strdup exists; POSIX says its an XSI extension.
566 Check for buffer overflow on input.
567
b526ee61
AD
5682002-10-24 Akim Demaille <akim@epita.fr>
569
570 * src/output.c (output_skeleton): Don't disable M4sugar comments
571 too soon: it results in comments being expanded.
572 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
573 first output.
574
f1886bb2
AD
5752002-10-24 Akim Demaille <akim@epita.fr>
576
577 * data/yacc.c (m4_int_type): New.
578 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
579 char' as only yacc.c wants K&R portability.
580 * data/glr.c (yysigned_char): Remove.
581 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
582 Reported by Quoc Peyrot.
583
c5576256
PE
5842002-10-23 Paul Eggert <eggert@twinsun.com>
585
586 * src/main.c (main): With --trace=time, report times even if a
587 non-fatal error occurs. Formerly, the times were reported in some
588 such cases but not in others.
589 * src/reader.c (reader): Just return if a complaint has been issued,
590 instead of exiting, so that 'main' can report times.
591
27b0ffea
AD
5922002-10-22 Akim Demaille <akim@epita.fr>
593
594 * src/system.h: Include sys/types.
595 Reported by Bert Deknuydt.
596
223a7883
PE
5972002-10-23 Paul Eggert <eggert@twinsun.com>
598
599 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
600 Suggested by Art Haas.
601
6022002-10-22 Paul Eggert <eggert@twinsun.com>
603
604 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
605 decl; not needed any more.
606 * src/main.c (main): Use return to exit, undoing yesterday's change.
607 The last OS that we could find where this wouldn't work is
608 SunOS 3.5, and that's too old to worry about now.
609
610 * data/glr.c (struct yyltype): Define members even when not
611 doing locations. This is more consistent with yacc.c, and it
612 works around the following bug reports:
613 http://mail.gnu.org/pipermail/bug-bison/2002-October/001764.html
614 http://mail.gnu.org/pipermail/bug-bison/2002-October/001769.html
615 and I hope it also fixes this bug report:
616 http://mail.gnu.org/pipermail/bug-bison/2002-October/001748.html
27b0ffea 617
223a7883
PE
618 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
619 @acronym consistently. Standardize on "Yacc" instead of "YACC",
620 "Algol" instead of "ALGOL". Give a bit more history about BNF.
621
8b76775a
AD
6222002-10-22 Akim Demaille <akim@epita.fr>
623
624 * data/README: New.
625
6db10d14
PE
6262002-10-21 Paul Eggert <eggert@twinsun.com>
627
628 Be consistent about 'bool'; the old code used an enum in one
629 module and an int in another, and this violates the C standard.
630 * m4/stdbool.m4: New file, from coreutils 4.5.3.
631 * configure.ac (AC_HEADER_STDBOOL): Add.
632 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
633 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
634 * src/symtab.c (hash_compare_symbol_t): Likewise.
635 * src/system.h (bool, false, true): Use a definition consistent
636 with ../lib/hash.c. All uses changed.
637
638 * src/complain.c (warning_issued): Renamed from warn_message_count,
639 so that we needn't worry about integer overflow (!).
640 Now of type bool. All uses changed.
641 (complaint_issued): Renamed from complain_message_count; likewise.
642
643 * src/main.c (main): Use exit to exit with failure.
27b0ffea 644
6db10d14
PE
645 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
646 rather than 1 and 0.
647 * src/main.c (main): Likewise.
648 * src/getargs.c (getargs): Likewise.
649 * src/reader.c (reader): Likewise.
650
651 * src/getarg.c (getargs): Remove duplicate code for
652 "Try `bison --help'".
653
654 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
655 What was that "2" for?
656
657 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
658 * src/getargs.c (usage): Likewise.
659
660 * src/getargs.c (getargs): When there are too few operands, report
661 the last one. When there are too many, report the first extra
662 one. This is how diffutils does it.
663
92a060fd
PE
6642002-10-20 Paul Eggert <eggert@twinsun.com>
665
666 Remove K&R vestiges.
667 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
668 * src/complain.c (VA_START): Remove. Assume prototypes.
669 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
670 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
671 fatal): Assume prototypes.
672 * src/complain.h: Assume prototypes.
673 * src/system.h (PARAMS): Remove.
674 Include <limits.h> unconditionally, since it's guaranteeed even
675 for a freestanding C89 compiler.
676 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
677 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 678
e7cb57c0
AD
6792002-10-20 Akim Demaille <akim@epita.fr>
680
681 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
682 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
683 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
684 (yyresolveStates, yyresolveAction, yyresolveStack)
685 (yyprocessOneStack): Use them.
686 (yy_reduce_print): New.
687 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
688
0245f82d
AD
6892002-10-20 Akim Demaille <akim@epita.fr>
690
691 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
692 arguments and output `void'.
693 (b4_c_function): Rename as...
694 (b4_c_function_def): this.
695 (b4_c_function_decl, b4_c_ansi_function_def)
696 (b4_c_ansi_function_decl): New.
697 Change the interpretation of the arguments: before `int, foo', now
698 `int foo, foo'.
699 * data/yacc.c (yyparse): Prototype and define thanks to these.
700 Adjust b4_c_function_def uses.
701 * data/glr.c (yyparse): Likewise, but ANSI only.
702
39912f52
AD
7032002-10-20 Akim Demaille <akim@epita.fr>
704
705 * src/output.c (prepare): Move the definition of `tokens_number',
706 `nterms_number', `undef_token_number', `user_token_number_max'
707 to...
708 (prepare_tokens): Here.
709 (prepare_tokens): Rename as...
710 (prepare_symbols): this.
711 (prepare): Move the definition of `rules_number' to...
712 (prepare_rules): here.
713 (prepare): Move the definition of `last', `final_state_number',
714 `states_number' to...
715 (prepare_states): here.
716 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
717
20c1e2ad
AD
7182002-10-20 Akim Demaille <akim@epita.fr>
719
720 * src/tables.h, src/tables.c, src/output.c: Comment changes.
721
21964f43
AD
7222002-10-20 Akim Demaille <akim@epita.fr>
723
724 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
725 * data/c.m4: here.
726
66d30cd4
AD
7272002-10-20 Akim Demaille <akim@epita.fr>
728
729 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
730 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
731 `pair'.
732 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
733 `name' to...
734 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
735 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
736 These.
737
95f2c9fe
PE
7382002-10-19 Paul Eggert <eggert@twinsun.com>
739
740 Do not create a temporary file, as that involves security and
741 cleanup headaches. Instead, use a pair of pipes.
742 Derived from a suggestion by Florian Krohm.
743 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
744 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
745 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
746 (BISON_PREREQ_SUBPIPE): Add.
747 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
748 Add subpipe.h, subpipe.c.
749 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
750 * po/POTFILES.in: Add lib/subpipe.c.
751 * src/output.c: Include "subpipe.h".
752 (m4_invoke): Remove decl.
753 (scan_skel): New decl.
754 (output_skeleton): Use pipe rather than temporary file for m4 input.
755 Check that m4sugar.m4 is readable, to avoid deadlock.
756 Check for pipe I/O error.
757 * src/scan-skel.l (readpipe): Remove decl.
758 (scan_skel): New function, to be used in place of m4_invoke.
759 Read from stream rather than file.
66d30cd4 760
95f2c9fe
PE
761 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
762 float, as this generates a warning on Solaris 8 + GCC 3.2 with
763 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
764 this generates a more-accurate value anyway.
765
766 * lib/timevar.c (timervar_accumulate): Rename locals to
767 avoid confusion with similarly-named more-global.
768 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
769
770 * src/output.c (prepare): Use xstrdup to convert char const *
771 to char *, to avoid GCC warning.
772
c19988b7
AD
7732002-10-19 Akim Demaille <akim@epita.fr>
774
775 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
776 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
777 Use them to have `calc.y' ready for %pure-parser.
778 * data/yacc.c (YYLEX): Pass a yylex return type to
779 b4_c_function_call.
780
ae7453f2
AD
7812002-10-19 Akim Demaille <akim@epita.fr>
782
783 Prototype support of %lex-param and %parse-param.
784
785 * src/parse-gram.y: Add the definition of the %lex-param and
786 %parse-param tokens, plus their rules.
787 Drop the `_' version of %glr-parser.
788 Add the "," token.
789 * src/scan-gram.l (INITIAL): Scan them.
790 * src/muscle_tab.c: Comment changes.
791 (muscle_insert, muscle_find): Rename `pair' as `probe'.
792 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
793 (muscle_entry_s): The `value' member is no longer const.
794 Adjust all dependencies.
795 * src/muscle_tab.c (muscle_init): Adjust: use
796 MUSCLE_INSERT_STRING.
797 Initialize the obstack earlier.
798 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
799 (muscle_pair_list_grow): New.
800 * data/c.m4 (b4_c_function_call, b4_c_args): New.
801 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
802 * tests/calc.at: Use %locations, not --locations.
803 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
804
0e575721
AD
8052002-10-19 Akim Demaille <akim@epita.fr>
806
807 * src/getargs.c (usage): Take status as argument and exit
808 accordingly.
809 Report the traditional `Try ... --help' message when status != 0.
810 (usage, version): Don't take a FILE * as arg, it is pointless.
811 (getargs): When there is an incorrect number of arguments, make it
812 an error, and report it GNUlically thanks to `usage ()'.
813
724ce7f5
PE
8142002-10-18 Paul Eggert <eggert@twinsun.com>
815
3a781eb2
PE
816 * data/glr.c (yyreportParseError): Don't assume that sprintf
817 yields the length of the printed string, as this is not true
818 on SunOS 4.1.4. Reported by Peter Klein.
819
724ce7f5
PE
820 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
821 * tests/conflicts.at (%nonassoc and eof): Likewise.
822 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
823
473d0a75
AD
8242002-10-17 Akim Demaille <akim@epita.fr>
825
826 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
827 * src/getargs.c (trace_types, trace_args): Adjust.
828 * src/reader.c (grammar_current_rule_prec_set)
829 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
830 Standardize error messages.
831 And s/@prec/%prec/!
832 (reader): Use trace_flag to enable scanner/parser debugging,
833 instead of an adhoc scheme.
834 * src/scan-gram.l: Remove trailing debugging code.
835
e76d2469
PE
8362002-10-16 Paul Eggert <eggert@twinsun.com>
837
93e2236a
PE
838 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
839 MUSCLE_TAB_H.
840
e76d2469
PE
841 * NEWS: Officially drop support for building Bison with K&R C,
842 since it didn't work anyway and it's not worth worrying about.
843 * Makefile.maint (wget_files): Remove ansi2knr.c.
844 (ansi2knr.c-url_prefix): Remove.
845 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
846 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
847 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
848
5bd1c419
PE
8492002-10-15 Paul Eggert <eggert@twinsun.com>
850
851 Stop using the "enum_" trick for K&R-style function definitions;
852 it confused me, and I was the author! Instead, assume that people
853 who want to use K&R C compilers (when using these modules in GCC,
854 perhaps?) will run ansi2knr.
855
856 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
857 All uses of "enum_" changed to "enum ".
858 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
859 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 860
5bd1c419
PE
861 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
862 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
863 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
864 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
865 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
866 abitset_not, abitset_ones, abitset_or, abitset_or_and,
867 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
868 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
869 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
870 Use function prototypes; this removes the need for declaring
871 static functions simply to provide their prototypes.
872 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
873 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
874 bitset_count_, bitset_create, bitset_dump, bitset_first,
875 bitset_free, bitset_init, bitset_last, bitset_next,
876 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
877 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
878 bitset_print, bitset_release_memory, bitset_toggle_,
879 bitset_type_choose, bitset_type_get, bitset_type_name_get,
880 debug_bitset): Likewise.
881 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
882 * lib/bitset_stats.c (bitset_log_histogram_print,
883 bitset_percent_histogram_print, bitset_stats_and,
884 bitset_stats_and_cmp, bitset_stats_and_or,
885 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
886 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
887 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
888 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
889 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
890 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
891 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
892 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
893 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
894 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
895 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
896 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
897 bitset_stats_zero): Likewise.
898 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
899 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
900 bitsetv_dump, debug_bitsetv): Likewise.
901 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
902 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
903 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
904 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
905 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
906 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
907 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
908 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
909 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
910 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
911 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
912 Likewise.
913 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
914 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
915 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
916 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
917 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
918 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
919 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
920 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
921 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
922 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
923 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 924
ae26e1f0
AD
9252002-10-14 Akim Demaille <akim@epita.fr>
926
927 Version 1.75.
928
d43baf71
AD
9292002-10-14 Akim Demaille <akim@epita.fr>
930
931 * tests/Makefile.am (maintainer-check-posix): New.
932
7ebc83e3
AD
9332002-10-14 Akim Demaille <akim@epita.fr>
934
935 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
936 member.
937
05846dae
AD
9382002-10-14 Akim Demaille <akim@epita.fr>
939
940 * src/tables.c (table_ninf_remap): base -> tab.
941 Reported by Matt Rosing.
942
1318e37d
PE
9432002-10-14 Paul Eggert <eggert@twinsun.com>
944
447fbb17
PE
945 * tests/action.at, tests/calc.at, tests/conflicts.at,
946 tests/cxx-type.at, tests/headers.at, tests/input.at,
947 tests/regression.at, tests/synclines.at, tests/torture.at:
948 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
949 so that the tests still work even if POSIXLY_CORRECT is set.
950 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 951
1318e37d
PE
952 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
953 for portability to K&R hosts. Fix typo: signed char is guaranteed
954 only to 127, not to 128.
955 * data/glr.c (yysigned_char): New type.
956 * data/yacc.c (yysigned_char): Likewise.
957 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
958
cc0f0794
PE
9592002-10-13 Paul Eggert <eggert@twinsun.com>
960
5038f418
PE
961 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
962 true due to limited range of data type" warning from GCC.
963
cc0f0794
PE
964 * data/c.m4 (b4_token_defines): Protect against double-inclusion
965 by wrapping enum yytokentype's definition inside #ifndef
966 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
967
6fed0802
AD
9682002-10-13 Akim Demaille <akim@epita.fr>
969
970 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
971 Un yy- yyrhs to avoid the name clash with the global YYRHS.
972
32f0598d
AD
9732002-10-13 Akim Demaille <akim@epita.fr>
974
975 * Makefile.maint: Update from Autoconf 2.54.
976 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
977
7ea9a33f
AD
9782002-10-13 Akim Demaille <akim@epita.fr>
979
980 * src/print.c (print_state): Separate the list of solved conflicts
981 from the other items.
982 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
983
ea99527d
AD
9842002-10-13 Akim Demaille <akim@epita.fr>
985
986 Let nondeterministic skeletons be usable with deterministic
987 tables.
988
989 With the patch, GAWK compiled by GCC without -O2 passes its test
990 suite using a GLR parser driven by LALR tables. It fails with -O2
991 because `struct stat' gives two different answers on my machine:
992 88 (definition of an auto var) and later 96 (memset on this var).
993 Hence the stack is badly corrumpted. The headers inclusion is to
994 blame: if I move the awk.h inclusion before GLR's system header
995 inclusion, the two struct stat have the same size.
996
997 * src/tables.c (pack_table): Always create conflict_table.
998 (token_actions): Always create conflict_list.
999 * data/glr.c (YYFLAG): Remove, unused.
1000
f377f69f
AD
10012002-10-13 Akim Demaille <akim@epita.fr>
1002
1003 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
1004 (O0FLAGS): New.
1005 (VALGRIND, GXX): New.
1006 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
1007 * tests/bison.in: Run $PREBISON a pre-command.
1008 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
1009 (maintainer-check-g++): New.
1010 * Makefile.am (maintainer-check): New.
1011
2a1fe6ed
AD
10122002-10-13 Akim Demaille <akim@epita.fr>
1013
1014 * data/glr.c: Formatting changes.
1015 Tweak some trace messages to match yacc.c's.
1016
f50adbbd
AD
10172002-10-13 Akim Demaille <akim@epita.fr>
1018
1019 GLR parsers sometimes raise parse errors instead of performing the
1020 default reduction.
1021 Reported by Charles-Henry de Boysson.
1022
1023 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
1024 check the length of the traces when %glr.
1025 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
1026 GLR's traces.
1027 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
1028 Test GLR parsers.
1029 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
1030 (yyltype): Remove the yy prefix from the member names.
1031 (yytable): Complete its comment.
1032 (yygetLRActions): Map error action number from YYTABLE from
1033 YYTABLE_NINF to 0.
1034 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
1035 (which was a bug: it should have been YYTABEL_NINF, and yet it was
1036 not satisfying as we could compare an YYACTION computed from
1037 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
1038 only value for error actions.
1039 (yyreportParseError): In verbose parse error messages, don't issue
1040 `error' in the list of expected tokens.
1041 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
1042 next action to perform to match glr.c's decoding.
1043 (yytable): Complete its comment.
1044
bcbad5b9
PE
10452002-10-13 Paul Eggert <eggert@twinsun.com>
1046
1047 Fix problem reported by Henrik Grubbstroem in
1048 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001670.html>:
1049 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
1050 because the Bison parser reads the second action before reducing
1051 the first one.
1052 * src/scan-gram.l (rule_length): New static var.
1053 Use it to keep track of the rule length in the scanner, since
1054 we can't expect the parser to be in lock-step sync with the scanner.
1055 (handle_action_dollar, handle_action_at): Use this var.
1056 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 1057
14904b89
PE
10582002-10-12 Paul Eggert <eggert@twinsun.com>
1059
1fe611e5
PE
1060 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
1061 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
1062 Include <sys/time.h> when checking for clock_t and struct tms.
1063 Use same include order as source.
1064 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
1065 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001674.html>.
05846dae 1066
1fe611e5
PE
1067 * lib/timevar.c: Update copyright date and clarify comments.
1068 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 1069
1fe611e5
PE
1070 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
1071 GCC version as of today, then merge Bison's changes.
1072 Change "GCC" to "Bison" in copyright notice. timevar.def's
1073 author is Akim, so change that too.
1074
98194095
PE
1075 * src/reader.c (grammar_current_rule_check):
1076 Don't worry about the default action if $$ is untyped.
1077 Prevents bogus warnings reported by Jim Gifford in
1078 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001673.html>.
1079
14904b89
PE
1080 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
1081 * data/glr.c, data/lalr1.cc, data/yacc.c:
1082 Output token definitions before the first part of user declarations.
1083 Fixes compatibility problem reported by Jim Gifford for kbd in
1084 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001672.html>.
1085
ff6dca18
PE
10862002-10-11 Paul Eggert <eggert@twinsun.com>
1087
1088 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
1089 (yyparse): here. This undoes some of the 2002-07-25 change.
1090 Compatibility problem reported by Ralf S. Engelschall with
1091 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
1092
eb714592
AD
10932002-10-11 Akim Demaille <akim@epita.fr>
1094
1095 * tests/regression.at Characters Escapes): New.
1096 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
1097 characters.
1098 Reported by Jan Nieuwenhuizen.
1099
b7195100
AD
11002002-10-11 Akim Demaille <akim@epita.fr>
1101
1102 * po/id.po: New.
1103
f28a0f2d
PE
11042002-10-10 Paul Eggert <eggert@twinsun.com>
1105
1106 Portability fixes for bitsets; this also avoids several GCC
1107 warnings.
1108
1109 * lib/abitset.c: Include <stddef.h>, for offsetof.
1110 * lib/lbitset.c: Likewise.
1111
1112 * lib/abitset.c (abitset_bytes): Return a size that is aligned
1113 properly for vectors of objects. Do not assume that adding a
1114 header size to a multiple of a word size yields a value that is
1115 properly aligned for the whole union.
1116 * lib/bitsetv.c (bitsetv_alloc): Likewise.
1117
1118 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
1119 unique names for structures.
1120 * lib/ebitset.c (ebitset_bytes): Likewise.
1121 * lib/lbitset.c (lbitset_bytes): Likewise.
1122
1123 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
1124 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
1125 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
1126 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
1127 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
1128 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
1129 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
1130 to improve the type-checking that GCC can do.
1131 * lib/bitset.c (bitset_op4_cmp): Likewise.
1132 * lib/bitset_stats.c (bitset_stats_count,
1133 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
1134 bitset_stats_copy, bitset_stats_disjoint_p,
1135 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
1136 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
1137 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
1138 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
1139 bitset_stats_and_or_cmp, bitset_stats_andn_or,
1140 bitset_stats_andn_or_cmp, bitset_stats_or_and,
1141 bitset_stats_or_and_cmp): Likewise.
1142 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
1143 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
1144 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
1145 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
1146
1147 * lib/abitset.h: Include bitset.h, not bbitset.h.
1148 * lib/ebitset.h: Likewise.
1149 * lib/lbitset.h: Likewise.
1150
1151 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
1152 All instances of parameters of type enum bitset_opts are now of
1153 type enum_bitset_opts, to conform to the C Standard, and similarly
1154 for enum_bitset_type.
1155 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
1156 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
1157
1158 Do not use "struct bitset_struct" to mean different things in
1159 different modules. Not only is this confusing, it violates
1160 the C Standard, which requires that structure types in different
1161 modules must be compatible if one is to be passed to the other.
1162 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
1163 All instances of "struct bitset_struct *" replaced with "bitset".
1164 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
1165 (union bitset_union, struct abitset_struct, struct ebitset_struct,
1166 struct lbitset_struct, struct bitset_stats_struct): New types.
1167 All uses of struct bitset_struct changed to union bitset_union,
1168 etc.
1169 * lib/abitset.c (struct abitset_struct, abitset,
1170 struct bitset_struct): Remove.
1171 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
1172 struct bitset_struct): Remove.
1173 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
1174 bitset_struct): Remove.
1175 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
1176 Likewise.
1177
1178 Do not call a function of type T using a call that assumes the
1179 function is of a different type U. Standard C requires that a
1180 function must be called with a type that is compatible with its
1181 definition.
1182 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
1183 New decls.
1184 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
1185 New functions.
1186 * lib/ebitset.c (PFV): Remove.
1187 * lib/lbitset.c (PFV): Likewise.
1188 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
1189 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
1190 decls.
1191 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
1192 (ebitset_vtable): Use them.
1193 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
1194 lbitset_xor): New functions.
1195 (lbitset_vtable): Use them.
1196
1197 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
1198 Declare.
1199
1200 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
1201 GCC warning.
1202 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
1203 Use offsetof, for simplicity.
1204
6fbe4984
PE
12052002-10-06 Paul Eggert <eggert@twinsun.com>
1206
1207 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
1208 the same width as int. This reapplies a hunk of the 2002-08-12 patch
1209 <http://mail.gnu.org/pipermail/bison-patches/2002-August/001111.html>,
1210 which was inadvertently undone by the 2002-09-30 patch.
1211 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
1212 the same width as int.
1213
420f93c8
PE
12142002-10-04 Paul Eggert <eggert@twinsun.com>
1215
1216 Version 1.50.
1217
1218 * configure.ac (AC_INIT), NEWS: Increment version number.
1219
1220 * doc/bison.texinfo: Minor spelling, grammar, and white space
1221 fixes.
1222 (Symbols): Mention that any negative value returned from yylex
1223 signifies end-of-input. Warn about negative chars. Mention
1224 the portable Standard C character set.
1225
1226 The GNU coding standard says CFLAGS and YFLAGS are reserved
1227 for the installer to set.
1228 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
1229 * src/Makefile.am (AM_CFLAGS): Likewise.
1230 (AM_YFLAGS): Renamed from YFLAGS.
1231
1232 Fix some MAX and MIN problems.
1233 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
1234 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
1235 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
1236 * src/reader.c (reader): Use it.
1237
1238 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
1239 POSIX 1003.1-2001 has removed fgrep.
1240
12412002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
1242
1243 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
1244 interpreted as signed.
1245 * lib/ebitset.c (ebitset_list): Fix bug.
1246
ff68026d
PE
12472002-10-01 Paul Eggert <eggert@twinsun.com>
1248
1249 More fixes for 64-bit hosts and large bitsets.
1250
1251 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
1252 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
1253 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
1254 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
1255 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
1256 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
1257 bitset_count_): Likewise.
1258 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
1259 bitset_first, bitset_last): Likewise.
1260 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
1261 bitset_stats_list_reverse, bitset_stats_size,
1262 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
1263 Likewise.
1264 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
1265 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
1266 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
1267 bitsetv_reflexive_transitive_closure): Likewise.
1268 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
1269 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
1270 Likewise.
1271 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
1272 Likewise.
420f93c8 1273
ff68026d
PE
1274 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
1275 Use size_t, not unsigned int, to count bytes.
1276 * lib/abitset.h (abitset_bytes): Likewise.
1277 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
1278 Likewise.
1279 * lib/bitset.h (bitset_bytes): Likewise.
1280 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
1281 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
1282 * lib/bitsetv.c (bitsetv_alloc): Likewise.
1283 * lib/ebitset.c (ebitset_bytes): Likewise.
1284 * lib/ebitset.h (ebitset_bytes): Likewise.
1285 * lib/lbitset.c (lbitset_bytes): Likewise.
1286 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 1287
ff68026d
PE
1288 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
1289 abitset_subset_p, abitset_disjoint_p, abitset_and,
1290 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
1291 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
1292 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
1293 abitset_or_and, abitset_or_and_cmp):
1294 Use bitset_windex instead of unsigned int.
1295 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
1296 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
1297 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
1298 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
1299 Likewise.
1300 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 1301
ff68026d
PE
1302 * lib/bitset.c (bitset_print):
1303 Use proper printf formats for widths of integer types.
1304 * lib/bitset_stats.c (bitset_percent_histogram_print,
1305 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
1306 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
1307 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
1308 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 1309
ff68026d
PE
1310 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
1311 BITSET_SIZE_MAX): New macros.
1312 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
1313 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
1314 to BITSET_WINDEX_MAX.
1315
1316 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
1317 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
1318 since we now return the bitset_bindex type (not int).
1319
1320 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
1321 when computing sizes.
1322 * lib/ebitset.c (ebitset_elts_grow): Likewise.
1323
1324 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
1325 and avoid cast to unsigned.
1326
6aa452a6
AD
13272002-09-30 Akim Demaille <akim@epita.fr>
1328
1329 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
1330 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
1331 Updates from Michael Hayes.
1332
927f7817
AD
13332002-09-30 Art Haas <ahaas@neosoft.com>
1334
1335 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
1336 invocations.
1337 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
1338 defined.
1339
9738f41e
AD
13402002-09-27 Akim Demaille <akim@epita.fr>
1341
1342 Version 1.49c.
1343
a5c75d7f
AD
13442002-09-27 Akim Demaille <akim@epita.fr>
1345
1346 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
1347 (Because of AC_LIBSOURCE).
1348
8280e179
AD
13492002-09-27 Akim Demaille <akim@epita.fr>
1350
1351 Playing with Autoscan.
1352
1353 * configure.ac: Remove the old LIBOBJ tweaks.
1354 (AC_REPLACE_FUNCS): Add strrchr and strtol.
1355 * lib/strrchr.c: New.
1356 * lib/strtol.c: New, from the Coreutils 4.5.1.
1357
ae64af35
AD
13582002-09-27 Akim Demaille <akim@epita.fr>
1359
1360 Playing with Autoscan.
1361
1362 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
1363 * lib/Makefile.am (libbison_a_SOURCES): No longer include
1364 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
1365 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
1366 Coreutils 4.5.1.
1367
d1a1114f
AD
13682002-09-24 Akim Demaille <akim@epita.fr>
1369
1370 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
1371 (Frequently Asked Questions, Parser Stack Overflow): New.
1372
b906441c
AD
13732002-09-13 Akim Demaille <akim@epita.fr>
1374
1375 Playing with autoscan.
1376
1377 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
1378 * src/files.c (skeleton_find): Remove, unused.
1379 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
1380 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
1381
bd701811
AD
13822002-09-13 Akim Demaille <akim@epita.fr>
1383
1384 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
1385 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
1386
e0a13e7b
AD
13872002-09-13 Akim Demaille <akim@epita.fr>
1388
1389 * configure.ac: Require 2.54.
1390 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
1391 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
1392 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
1393 Remove, provided by Autoconf macros.
1394
c97011bf
AD
13952002-09-12 Akim Demaille <akim@epita.fr>
1396
1397 * m4/prereq.m4: Update, from Coreutils 4.5.1.
1398
d862b1be
AD
13992002-09-12 Akim Demaille <akim@epita.fr>
1400
1401 * m4/prereq.m4: Update, from Fileutils 4.1.5.
1402 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
1403 Reported by Martin Mokrejs.
1404
3d38c03a
AD
14052002-09-10 Akim Demaille <akim@epita.fr>
1406
1407 * src/parse-gram.y: Associate a human readable string to each
1408 token type.
1409 * tests/regression.at (Invalid inputs): Adjust.
1410
b6347355
AD
14112002-09-10 Gary V. Vaughan <gary@gnu.org>
1412
1413 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
1414 with an Autoconf-2.5x style configure.ac.
1415
09ba4ab2
PE
14162002-09-06 Paul Eggert <eggert@twinsun.com>
1417
1418 * doc/bison.texinfo (Conditions): Make explicit that the GPL
1419 exception applies only to yacc.c. This is a modification of a
1420 patch originally suggested by Akim Demaille.
1421
21846f69
AD
14222002-09-06 Akim Demaille <akim@epita.fr>
1423
09ba4ab2
PE
1424 * data/c.m4 (b4_copyright): Move the GPL exception comment from
1425 here to...
1426 * data/yacc.c: here.
1427
21846f69
AD
1428 * data/lalr1.cc (struct yyltype): Don't define it, since we use
1429 LocationType.
1430 (b4_ltype): Default to yy::Location from location.hh.
1431
c0ad8bf3
AD
14322002-09-04 Jim Meyering <jim@meyering.net>
1433
1434 * data/yacc.c: Guard the declaration of yytoknum also with
1435 `#ifdef YYPRINT', so it is declared only when used.
1436
3a93251e
AD
14372002-09-04 Akim Demaille <akim@epita.fr>
1438
1439 * configure.in: Rename as...
1440 * configure.ac: this.
1441 Bump to 1.49c.
1442
427c0dda
AD
14432002-09-04 Akim Demaille <akim@epita.fr>
1444
1445 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
1446 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
1447 translate maintainer only messages.
1448
6a254321
PE
14492002-08-12 Paul Eggert <eggert@twinsun.com>
1450
645e30d1
PE
1451 Version 1.49b.
1452
6a254321
PE
1453 * Makefile.am (SUBDIRS): Remove intl.
1454 (DISTCLEANFILES): Remove.
1455 * NEWS: Mention that GNU M4 is now required. Clarify what is
1456 meant by "larger grammars". Mention the pt_BR translation.
1457 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
1458 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
1459 Bump version from 0.11.2 to 0.11.5.
1460 (BISON_PREREQ_STAGE): Remove.
1461 (AM_GNU_GETTEXT): Use external gettext.
1462 (AC_OUTPUT): Remove intl/Makefile.
1463
1464 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
1465
1466 * data/glr.c: Include string.h, for strlen.
1467 (yyreportParseError): Use size_t for yysize.
1468 (yy_yypstack): No longer nested inside yypstates, as nested
1469 functions are not portable. Do not assume size_t is the
1470 same width as int.
1471 (yypstates): Do not assume that ptrdiff_t is the same width
1472 as int, and similarly for yyposn and YYINDEX.
1473
1474 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
1475
1476 * lib/Makefile.am (INCLUDES): Do not include from the intl
1477 directory, which has been removed.
1478 * src/Makefile.am (INCLUDES): Likewise.
1479
1480 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
1481 (bitsets_sources, additional_bitsets_sources, timevars_sources):
1482 New vars.
1483
1484 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
1485 * tests/Makefile.am (EXTRA_DIST): Likewise.
1486
1487 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
1488 Do not assume that bitset_windex is the same width as unsigned.
1489
1490 * lib/abitset.c (abitset_unused_clear): Do not assume that
1491 bitset_word is the same width as int.
1492 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
1493 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
1494 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
1495 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
1496 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
1497
1498 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
1499 portability to one's complement hosts!).
1500 * lib/ebitset.c (ebitset_op1): Likewise.
1501 * lib/lbitset.c (lbitset_op1): Likewise.
1502
1503 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
1504 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
1505 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
1506 Sync with fileutils.
1507 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
1508 lib/gettext.h: Sync with diffutils.
1509
1510 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
1511 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
1512
1513 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
1514 PROTOTYPES to check for prototypes, and "defined __STDC__" to
1515 check for void *.
1516
1517 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
1518 size_t; the old version tried to do this but casted improperly.
1519 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
1520 (bitset_test): Now returns int, not unsigned long.
1521
1522 * lib/bitset_stats.c: Include "gettext.h".
1523 (_): New macro.
1524 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
1525 name locals "index", as it generates unnecessary warnings on some
1526 hosts that have an "index" function.
1527
1528 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
1529 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
1530 they need translation.
1531 * src/LR0.c (state_list_append, new_itemsets, get_state,
1532 append_states, generate_states): Likewise.
1533 * src/assoc.c (assoc_to_string): Likewise.
1534 * src/closure.c (print_closure, set_firsts, closure): Likewise.
1535 * src/gram.c (grammar_dump): Likewise.
1536 * src/injections.c (injections_compute): Likewise.
1537 * src/lalr.c (lookaheads_print): Likewise.
1538 * src/relation.c (relation_transpose): Likewise.
1539 * src/scan-gram.l: Likewise.
1540 * src/tables.c (table_grow, pack_vector): Likewise.
1541
1542 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
1543 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
1544 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
1545 * m4/mbstate_t.m4: Sync with fileutils.
1546 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
1547
1548 * po/LINGUAS: Add pt_BR.
1549 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
1550 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
1551 lib/timevar.c.
1552 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
1553 manual recommends.
1554 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
1555
1556 * src/complain.c (strerror_r): Remove decl; not needed.
1557 (strerror): Use same pattern as ../lib/error.c.
1558
1559 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
1560
1561 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
1562
1563 * src/main.c (main): Cast result of bindtextdomain and textdomain
1564 to void, to avoid a GCC warning when --disable-nls is in effect.
1565
1566 * src/scan-gram.l: Use strings rather than escapes when possible,
1567 to minimize the number of warnings from xgettext.
1568 (handle_action_dollar, handle_action_at): Don't use isdigit,
1569 as it mishandles negative chars and it may not work as expected
1570 outside the C locale.
1571
1572 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
1573 this is a GCC extension and is not portable to other compilers.
1574
1575 * src/system.h (alloca): Use same pattern as ../lib/error.c.
1576 Do not include <ctype.h>; no longer needed.
1577 Do not include <malloc.h>; no longer needed (and generates
1578 warnings on OpenBSD 3.0).
1579
1580 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
1581 it's not portable.
1582
1583 * tests/regression.at: Do not use 'cc -c input.c -o input';
1584 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
1585
1586 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
1587 exit status as failure, not just exit status 1. Sun C exits
1588 with status 2 sometimes.
1589
1590 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
1591 Use it for the two large tests.
1592
c8f002c7
AD
15932002-08-02 Akim Demaille <akim@epita.fr>
1594
1595 * src/conflicts.c (conflicts_output): Don't output rules never
1596 reduced here, since anyway that computation doesn't work.
1597 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
1598 (rule_useless_p, rule_never_reduced_p): New.
1599 (grammar_rules_partial_print): Use a filter instead of a range.
1600 Display the title only if needed.
1601 (grammar_rules_print): Adjust.
1602 (grammar_rules_never_reduced_report): New.
1603 * src/tables.c (action_row): Move the computation of rules never
1604 reduced to...
1605 (token_actions): here.
1606 * src/main.c (main): Make the parser before making the report, so
1607 that rules never reduced are computed.
1608 Call grammar_rules_never_reduced_report.
1609 * src/print.c (print_results): Report rules never reduced.
1610 * tests/conflicts.at, tests/reduce.at: Adjust.
1611
cd08e51e
AD
16122002-08-01 Akim Demaille <akim@epita.fr>
1613
1614 Instead of attaching lookaheads and duplicating the rules being
1615 reduced by a state, attach the lookaheads to the reductions.
1616
1617 * src/state.h (state_t): Remove the `lookaheads',
1618 `lookaheads_rule' member.
1619 (reductions_t): Add a `lookaheads' member.
1620 Use a regular array for the `rules'.
1621 * src/state.c (reductions_new): Initialize the lookaheads member
1622 to 0.
1623 (state_rule_lookaheads_print): Adjust.
1624 * src/state.h, src/state.c (state_reductions_find): New.
1625 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
1626 (count_rr_conflicts): Adjust.
1627 * src/lalr.c (LArule): Remove.
1628 (add_lookback_edge): Adjust.
1629 (state_lookaheads_count): New.
1630 (states_lookaheads_initialize): Merge into...
1631 (initialize_LA): this.
1632 (lalr_free): Adjust.
1633 * src/main.c (main): Don't free nullable and derives too early: it
1634 is used by --verbose.
1635 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
1636
bb0027a9
AD
16372002-08-01 Akim Demaille <akim@epita.fr>
1638
1639 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
1640 `rule_number_t**'.
1641 (set_derives, free_derives): Rename as...
1642 (derives_compute, derives_free): this.
1643 Adjust all dependencies.
1644 * src/nullable.c (set_nullable, free_nullable): Rename as...
1645 (nullable_compute, nullable_free): these.
1646 (rule_list_t): Store rule_t *, not rule_number_t.
1647 * src/state.c (state_rule_lookaheads_print): Directly compare rule
1648 pointers, instead of their numbers.
1649 * src/main.c (main): Call nullable_free, and derives_free earlier,
1650 as they were lo longer used.
1651
3325ddc4
AD
16522002-08-01 Akim Demaille <akim@epita.fr>
1653
1654 * lib/timevar.c (get_time): Include children time.
1655 * src/lalr.h (LA, LArule): Don't export them: used with the
1656 state_t.
1657 * src/lalr.c (LA, LArule): Static.
1658 * src/lalr.h, src/lalr.c (lalr_free): New.
1659 * src/main.c (main): Call it.
1660 * src/tables.c (pack_vector): Check whether loc is >= to the
1661 table_size, not >.
1662 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
1663 (tables_generate): do it, since that's also it which allocates
1664 them.
1665 Don't free LA and LArule, main does.
1666
c6f1a33c
AD
16672002-07-31 Akim Demaille <akim@epita.fr>
1668
1669 Separate parser tables computation and output.
1670
1671 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
1672 (conflict_list, conflict_list_cnt, table, check, table_ninf)
1673 (yydefgoto, yydefact, high): Move to...
1674 * src/tables.h, src/tables.c: here.
1675 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
1676 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
1677 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
1678 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
1679 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
1680 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
1681 (action_row, save_row, token_actions, save_column, default_goto)
1682 (goto_actions, sort_actions, matching_state, pack_vector)
1683 (table_ninf_remap, pack_table, prepare_actions): Move to...
1684 * src/tables.c: here.
1685 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
1686 * src/output.c (token_actions, output_base, output_conflicts)
1687 (output_check): Merge into...
1688 (prepare_actions): this.
1689 (actions_output): Rename as...
1690 (user_actions_output): this.
1691 * src/main.c (main): Call tables_generate and tables_free.
1692
1509d42f
AD
16932002-07-31 Akim Demaille <akim@epita.fr>
1694
1695 Steal GCC's --time-report support.
1696
1697 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
1698 stolen/adjusted from GCC.
1699 * m4/stage.m4: Remove time related checks.
1700 * m4/timevar.m4: New.
1701 * configure.in: Adjust.
1702 * src/system.h: Adjust to using timevar.h.
1703 * src/getargs.h, src/getargs.c: Support trace_time for
1704 --trace=time.
1705 * src/main.c (stage): Remove.
1706 (main): Replace `stage' invocations with timevar calls.
1707 * src/output.c: Insert pertinent timevar calls.
1708
273a74fa
AD
17092002-07-31 Akim Demaille <akim@epita.fr>
1710
1711 Let --trace have arguments.
1712
1713 * src/getargs.h (enum trace_e): New.
1714 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
1715 (long_options, short_options): --trace/-T takes an optional
1716 argument.
1717 Change all the uses of trace_flag to reflect the new flags.
1718 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
1719
1720 Strengthen `stage' portability.
1721
1722 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
1723 * configure.in: Use it.
1724 Don't check for malloc.h and sys/times.h.
1725 * src/system.h: Include them when appropriate.
1726 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
1727 times and struct tms are available.
1728
217598da
AD
17292002-07-30 Akim Demaille <akim@epita.fr>
1730
1731 In verbose parse error message, don't report `error' as an
1732 expected token.
1733 * tests/actions.at (Printers and Destructors): Adjust.
1734 * tests/calc.at (Calculator $1): Adjust.
1735 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
1736 error message, do not report the parser accepts the error token in
1737 that state.
1738
52489d44
AD
17392002-07-30 Akim Demaille <akim@epita.fr>
1740
1741 Normalize conflict related messages.
1742
1743 * src/complain.h, src/complain.c (warn, complain): New.
1744 * src/conflicts.c (conflicts_print): Use them.
1745 (conflict_report_yacc): New, extracted from...
1746 (conflicts_print): here.
1747 * tests/conflicts.at, tests/existing.at: Adjust.
1748
e8832397
AD
17492002-07-30 Akim Demaille <akim@epita.fr>
1750
1751 Report rules which are never reduced by the parser: those hidden
1752 by conflicts.
1753
1754 * src/LR0.c (save_reductions): Don't make the final state too
1755 different: save its reduction (accept) instead of having a state
1756 without any action (no shift or goto, no reduce).
1757 Note: the final state is now a ``regular'' state, i.e., the
1758 parsers now contain `reduce 0' as default reduction.
1759 Nevertheless, since they decide to `accept' when yystate =
1760 final_state, they still will not reduce rule 0.
1761 * src/print.c (print_actions, print_reduction): Adjust.
1762 * src/output.c (action_row): Track reduced rules.
1763 (token_actions): Report rules never reduced.
1764 * tests/conflicts.at, tests/regression.at: Adjust.
1765
caf23d24
AD
17662002-07-30 Akim Demaille <akim@epita.fr>
1767
1768 `stage' was accidently included in a previous patch.
1769 Initiate its autoconfiscation.
1770
1771 * configure.in: Look for malloc.h and sys/times.h.
1772 * src/main.c (stage): Adjust.
1773 Report only when trace_flag.
1774
640748ee
AD
17752002-07-29 Akim Demaille <akim@epita.fr>
1776
1777 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
1778 state_number_t.
1779 (errs_t): symbol_t*, not symbol_number_t.
1780 (reductions_t): rule_t*, not rule_number_t.
1781 (FOR_EACH_SHIFT): New.
1782 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
1783 * src/print.c, src/print_graph.c: Adjust.
1784
88bce5a2
AD
17852002-07-29 Akim Demaille <akim@epita.fr>
1786
1787 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
1788
1789 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
1790 (endtoken, accept): these.
1791 * src/reader.c (reader): Set endtoken's default tag to "$end".
1792 Set undeftoken's tag to "$undefined" instead of "$undefined.".
1793 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
1794 Adjust.
1795
1bfb97db
AD
17962002-07-29 Akim Demaille <akim@epita.fr>
1797
1798 * src/reduce.c (reduce_grammar): When the language is empty,
1799 complain about the start symbol, not the axiom.
1800 Use its location.
1801 * tests/reduce.at (Empty Language): New.
1802
fc5734fe
AD
18032002-07-26 Akim Demaille <akim@epita.fr>
1804
1805 * src/reader.h, src/reader.c (gram_error): ... can't get
1806 yycontrol without making too strong assumptions on the parser
1807 itself.
1808 * src/output.c (prepare_tokens): Use the real 0th value of
1809 token_translations instead of `0'.
1810 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
1811 visible here.
1812 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
1813 for the time being: %locations ought to provide it to yyerror.
1814
3650b4b8
AD
18152002-07-25 Akim Demaille <akim@epita.fr>
1816
1817 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
1818 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
1819 * tests/regression.at (Web2c Actions): Adjust.
1820
4b3d3a8e
AD
18212002-07-25 Akim Demaille <akim@epita.fr>
1822
1823 Stop storing rules from 1 to nrules + 1.
1824
1825 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
1826 * src/nullable.c, src/output.c, src/print.c, src/reader.c
1827 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
1828 Iterate from 0 to nrules.
1829 Use rule_number_as_item_number and item_number_as_rule_number.
1830 Adjust to `derive' now containing possibly 0.
1831 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
1832 Handle the `- 1' part in rule numbers from/to item numbers.
1833 * src/conflicts.c (log_resolution): Fix the message which reversed
1834 shift and reduce.
1835 * src/output.c (action_row): Initialize default_rule to -1.
1836 (token_actions): Adjust.
1837 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
1838 expected output.
1839 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
1840
4a2a22f4
AD
18412002-07-25 Akim Demaille <akim@epita.fr>
1842
1843 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
1844 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
1845 (b4_c_knr_arg_decl): New.
1846 * data/yacc.c: Use it to define yysymprint, yydestruct, and
1847 yyreport_parse_error.
1848
b8df3223
AD
18492002-07-25 Akim Demaille <akim@epita.fr>
1850
1851 * data/yacc.c (yyreport_parse_error): New, extracted from...
1852 (yyparse): here.
1853 (yydestruct, yysymprint): Move above yyparse.
1854 Be K&R compliant.
1855
a762e609
AD
18562002-07-25 Akim Demaille <akim@epita.fr>
1857
1858 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
1859 replace...
1860 (b4_sint_type, b4_uint_type): these.
1861 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
1862 * tests/regression.at (Web2c Actions): Adjust.
1863
12b0043a
AD
18642002-07-25 Akim Demaille <akim@epita.fr>
1865
1866 * src/gram.h (TIEM_NUMBER_MAX): New.
1867 (item_number_of_rule_number, rule_number_of_item_number): Rename
1868 as...
1869 (rule_number_as_item_number, item_number_as_rule_number): these.
1870 Adjust dependencies.
1871 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
1872 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
1873 (symbol_number_to_vector_number): New.
1874 (order): Of vector_number_t* type.
1875 (base_t, BASE_MAX, BASE_MIN): New.
1876 (froms, tos, width, pos, check): Of base_t type.
1877 (action_number_t, ACTION_MIN, ACTION_MAX): New.
1878 (actrow): Of action_number_t type.
1879 (conflrow): Of unsigned int type.
1880 (table_ninf, base_ninf): New.
1881 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
1882 (muscle_insert_int_table, muscle_insert_base_table)
1883 (muscle_insert_rule_number_table): New.
1884 (prepare_tokens): Output `toknum' as int_table.
1885 (action_row): Returns a rule_number_t.
1886 Use ACTION_MIN, not SHRT_MIN.
1887 (token_actions): yydefact is rule_number_t*.
1888 (table_ninf_remap): New.
1889 (pack_table): Use it for `base' and `table'.
1890 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
1891 replaced with...
1892 (YYPACT_NINF, YYTABLE_NINF): these.
1893 (yypact, yytable): Compute their types instead of hard-coded
1894 `short'.
1895 * tests/regression.at (Web2c Actions): Adjust.
1896
5dde258a
AD
18972002-07-19 Akim Demaille <akim@epita.fr>
1898
1899 * src/scan-gram.l (id): Can start with an underscore.
1900
a945ec39
AD
19012002-07-16 Akim Demaille <akim@epita.fr>
1902
1903 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
1904 Adjust all former `associativity' dependencies.
1905 * src/symtab.c (symbol_new): Default associativity is `undef', not
1906 `right'.
1907 (symbol_check_alias_consistence): Adjust.
1908
fae437e8
AD
19092002-07-09 Akim Demaille <akim@epita.fr>
1910
1911 * doc/bison.texinfo: Properly set the ``header'' part.
1912 Use @dircategory ``GNU programming tools'' as per Texinfo's
1913 documentation.
1914 Use @copying.
1915
1a715ef2
AD
19162002-07-09 Akim Demaille <akim@epita.fr>
1917
1918 * lib/quotearg.h: Protect against multiple inclusions.
1919 * src/location.h (location_t): Add a `file' member.
1920 (LOCATION_RESET, LOCATION_PRINT): Adjust.
1921 * src/complain.c (warn_at, complain_at, fatal_at): Drop
1922 `error_one_per_line' support.
1923
a5d50994
AD
19242002-07-09 Akim Demaille <akim@epita.fr>
1925
1926 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
1927 * src/reader.c (lineno): Remove.
1928 Adjust all dependencies.
1929 (get_merge_function): Take a location and use complain_at.
1930 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
1931 * tests/regression.at (Invalid inputs, Mixing %token styles):
1932 Adjust.
1933
b275314e
AD
19342002-07-09 Akim Demaille <akim@epita.fr>
1935
1936 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
1937 recovery rule, and forbid extensions when --yacc.
1938 (gram_error): Use complain_at.
1939 * src/reader.c (reader): Exit if there were parse errors.
1940
865b9df1
AD
19412002-07-09 Akim Demaille <akim@epita.fr>
1942
1943 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
1944 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
1945 Reported by R Blake <blakers@mac.com>.
1946
c76e14da
AD
19472002-07-09 Akim Demaille <akim@epita.fr>
1948
1949 * data/yacc.c: Output the copyright notive in the header.
1950
7db2ed2d
AD
19512002-07-03 Akim Demaille <akim@epita.fr>
1952
1953 * src/output.c (froms, tos): Are state_number_t.
1954 (save_column): sp, sp1, and sp2 are state_number_t.
1955 (prepare): Rename `final' as `final_state_number', `nnts' as
1956 `nterms_number', `nrules' as `rules_number', `nstates' as
1957 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
1958 unused.
1959 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
1960 * data/lalr1.cc (nsym_): Remove, unused.
1961
e68e0410
AD
19622002-07-03 Akim Demaille <akim@epita.fr>
1963
1964 * src/lalr.h, src/lalr.c (goto_number_t): New.
1965 * src/lalr.c (goto_list_t): New.
1966 Propagate them.
1967 * src/nullable.c (rule_list_t): New.
1968 Propagate.
1969 * src/types.h: Remove.
1970
e1a4f3a4
AD
19712002-07-03 Akim Demaille <akim@epita.fr>
1972
1973 * src/closure.c (print_fderives): Use rule_rhs_print.
1974 * src/derives.c (print_derives): Use rule_rhs_print.
1975 (rule_list_t): New, replaces `shorts'.
1976 (set_derives): Add comments.
1977 * tests/sets.at (Nullable, Firsts): Adjust.
1978
536545f3
AD
19792002-07-03 Akim Demaille <akim@epita.fr>
1980
1981 * src/output.c (prepare_actions): Free `tally' and `width'.
1982 (prepare_actions): Allocate and free `order'.
1983 * src/symtab.c (symbols_free): Free `symbols'.
1984 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
1985 * src/output.c (m4_invoke): Move to...
1986 * src/scan-skel.l: here.
1987 (<<EOF>>): Close yyout, and free its name.
1988
8b752b00
AD
19892002-07-03 Akim Demaille <akim@epita.fr>
1990
1991 Fix some memory leaks, and fix a bug: state 0 was examined twice.
1992
1993 * src/LR0.c (new_state): Merge into...
1994 (state_list_append): this.
1995 (new_states): Merge into...
1996 (generate_states): here.
1997 (set_states): Don't ensure a proper `errs' state member here, do it...
1998 * src/conflicts.c (conflicts_solve): here.
1999 * src/state.h, src/state.c: Comment changes.
2000 (state_t): Rename member `shifts' as `transitions'.
2001 Adjust all dependencies.
2002 (errs_new): For consistency, also take the values as argument.
2003 (errs_dup): Remove.
2004 (state_errs_set): New.
2005 (state_reductions_set, state_transitions_set): Assert that no
2006 previous value was assigned.
2007 (state_free): New.
2008 (states_free): Use it.
2009 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
2010 temporary storage: use `errs' and `nerrs' as elsewhere.
2011 (set_conflicts): Allocate and free this `errs'.
2012
613f5e1a
AD
20132002-07-02 Akim Demaille <akim@epita.fr>
2014
2015 * lib/libiberty.h: New.
2016 * lib: Update the bitset implementation from upstream.
2017 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
2018 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
2019 * src/main.c: Adjust bitset stats calls.
2020
26e0cadc
PE
20212002-07-01 Paul Eggert <eggert@twinsun.com>
2022
2023 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
2024 char, so that negative chars don't collide with $.
2025
1154cced
AD
20262002-06-30 Akim Demaille <akim@epita.fr>
2027
2028 Have the GLR tests be `warning' checked, and fix the warnings.
2029
2030 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
2031 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
2032 (yyremoveDeletes): `yyi' and `yyj' are size_t.
2033 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
2034 (yyaddDeferredAction): static.
2035 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
2036 (yyreportParseError): yyprefix is const.
2037 yytokenp is used only when verbose.
2038 (yy__GNUC__): Replace with __GNUC__.
2039 (yypdumpstack): yyi is size_t.
2040 (yypreference): Un-yy local variables and arguments, to avoid
2041 clashes with `yyr1'. Anyway, we are not in the user name space.
2042 (yytname_size): be an int, as is compared with ints.
2043 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
2044 Use them.
2045 * tests/cxx-gram.at: Use quotation to protect $1.
2046 Use AT_COMPILE to enable warnings hunts.
2047 Prototype yylex and yyerror.
2048 `Use' argc.
2049 Include `string.h', not `strings.h'.
2050 Produce and prototype stmtMerge only when used.
2051 yylex takes a location.
2052
97650f4e
AD
20532002-06-30 Akim Demaille <akim@epita.fr>
2054
2055 We spend a lot of time in quotearg, in particular when --verbose.
2056
2057 * src/symtab.c (symbol_get): Store a quoted version of the key.
2058 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
2059 Adjust all callers.
2060
d2576365
AD
20612002-06-30 Akim Demaille <akim@epita.fr>
2062
2063 * src/state.h (reductions_t): Rename member `nreds' as num.
2064 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
2065 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
2066
ccaf65bc
AD
20672002-06-30 Akim Demaille <akim@epita.fr>
2068
2069 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
2070 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
2071 (shifts_to): Rename as...
2072 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
2073 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
2074 (TRANSITION_IS_DISABLED, transitions_to): these.
2075
87675353
AD
20762002-06-30 Akim Demaille <akim@epita.fr>
2077
2078 * src/print.c (print_shifts, print_gotos): Merge into...
2079 (print_transitions): this.
2080 (print_transitions, print_errs, print_reductions): Align the
2081 lookaheads columns.
2082 (print_core, print_transitions, print_errs, print_state,
2083 print_grammar): Output empty lines separator before, not after.
2084 (state_default_rule_compute): Rename as...
2085 (state_default_rule): this.
2086 * tests/conflicts.at (Defaulted Conflicted Reduction),
2087 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
2088 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
2089
ce4ccb4b
AD
20902002-06-30 Akim Demaille <akim@epita.fr>
2091
2092 Display items as we display rules.
2093
2094 * src/gram.h, src/gram.c (rule_lhs_print): New.
2095 * src/gram.c (grammar_rules_partial_print): Use it.
2096 * src/print.c (print_core): Likewise.
2097 * tests/conflicts.at (Defaulted Conflicted Reduction),
2098 (Unresolved SR Conflicts): Adjust.
2099 (Unresolved SR Conflicts): Adjust and rename as...
2100 (Resolved SR Conflicts): this, as was meant.
2101 * tests/regression.at (Web2c Report): Adjust.
2102
bc933ef1
AD
21032002-06-30 Akim Demaille <akim@epita.fr>
2104
2105 * src/print.c (state_default_rule_compute): New, extracted from...
2106 (print_reductions): here.
2107 Pessimize, but clarify the code.
2108 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
2109
53d4308d
AD
21102002-06-30 Akim Demaille <akim@epita.fr>
2111
2112 * src/output.c (action_row): Let default_rule be always a rule
2113 number.
2114
574fb2d5
AD
21152002-06-30 Akim Demaille <akim@epita.fr>
2116
2117 * src/closure.c (print_firsts, print_fderives, closure):
2118 Use BITSET_EXECUTE.
2119 * src/lalr.c (lookaheads_print): Likewise.
2120 * src/state.c (state_rule_lookaheads_print): Likewise.
2121 * src/print_graph.c (print_core): Likewise.
2122 * src/print.c (print_reductions): Likewise.
2123 * src/output.c (action_row): Likewise.
2124 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
2125
05811fd7
AD
21262002-06-30 Akim Demaille <akim@epita.fr>
2127
2128 * src/print_graph.c: Use report_flag.
2129
0e4d5753
AD
21302002-06-30 Akim Demaille <akim@epita.fr>
2131
2132 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
2133 to...
2134 * src/relation.h, src/relation.c (traverse, relation_digraph)
2135 (relation_print, relation_transpose): New.
2136
24c7d800
AD
21372002-06-30 Akim Demaille <akim@epita.fr>
2138
2139 * src/state.h, src/state.c (shifts_to): New.
2140 * src/lalr.c (build_relations): Use it.
2141
9222837b
AD
21422002-06-30 Akim Demaille <akim@epita.fr>
2143
2144 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
2145 (item_number_of_rule_number, rule_number_of_item_number): New.
2146 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
2147 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
2148 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
2149 Propagate their use.
2150 Much remains to be done, in particular wrt `shorts' from types.h.
2151
260008e5
AD
21522002-06-30 Akim Demaille <akim@epita.fr>
2153
2154 * src/symtab.c (symbol_new): Initialize the `printer' member.
2155
8a731ca8
AD
21562002-06-30 Akim Demaille <akim@epita.fr>
2157
2158 * src/LR0.c (save_reductions): Remove, replaced by...
2159 * src/state.h, src/state.c (state_reductions_set): New.
2160 (reductions, errs): Rename as...
2161 (reductions_t, errs_t): these.
2162 Adjust all dependencies.
2163
32e1e0a4
AD
21642002-06-30 Akim Demaille <akim@epita.fr>
2165
2166 * src/LR0.c (state_list_t, state_list_append): New.
2167 (first_state, last_state): Now symbol_list_t.
2168 (this_state): Remove.
2169 (new_itemsets, append_states, save_reductions): Take a state_t as
2170 argument.
2171 (set_states, generate_states): Adjust.
2172 (save_shifts): Remove, replaced by...
2173 * src/state.h, src/state.c (state_shifts_set): New.
2174 (shifts): Rename as...
2175 (shifts_t): this.
2176 Adjust all dependencies.
2177 * src/state.h (state_t): Remove the `next' member.
2178
e5fb6710
AD
21792002-06-30 Akim Demaille <akim@epita.fr>
2180
2181 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
2182 escaped in slot 0.
2183
c7ca99d4
AD
21842002-06-30 Akim Demaille <akim@epita.fr>
2185
2186 Use hash.h for the state hash table.
2187
2188 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
2189 (allocate_storage): Use state_hash_new.
2190 (free_storage): Use state_hash_free.
2191 (new_state, get_state): Adjust.
2192 * src/lalr.h, src/lalr.c (states): Move to...
2193 * src/states.h (state_t): Remove the `link' member, no longer
2194 used.
2195 * src/states.h, src/states.c: here.
2196 (state_hash_new, state_hash_free, state_hash_lookup)
2197 (state_hash_insert, states_free): New.
2198 * src/states.c (state_table, state_compare, state_hash): New.
2199 * src/output.c (output_actions): Do not free states now, since we
2200 still need to know the final_state number in `prepare', called
2201 afterwards. Do it...
2202 * src/main.c (main): here: call states_free after `output'.
2203
df0e7316
AD
22042002-06-30 Akim Demaille <akim@epita.fr>
2205
2206 * src/state.h, src/state.c (state_new): New, extracted from...
2207 * src/LR0.c (new_state): here.
2208 * src/state.h (STATE_ALLOC): Move to...
2209 * src/state.c: here.
2210 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
2211 * src/state.h, src/state.c: here.
2212
39f41916
AD
22132002-06-30 Akim Demaille <akim@epita.fr>
2214
2215 * src/reader.c (gensym): Rename as...
2216 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
2217 (getsym): Rename as...
2218 (symbol_get): this.
2219
d57650a5
AD
22202002-06-30 Akim Demaille <akim@epita.fr>
2221
2222 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
2223 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
2224 * src/output.c, src/print.c, src/print_graph.c: Propagate.
2225 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
2226
5a08f1ce
AD
22272002-06-30 Akim Demaille <akim@epita.fr>
2228
2229 Make the test suite pass with warnings checked.
2230
2231 * tests/actions.at (Printers and Destructors): Improve.
2232 Avoid unsigned vs. signed issues.
2233 * tests/calc.at: Don't exercise the scanner here, do it...
2234 * tests/input.at (Torturing the Scanner): here.
2235
720623af
PH
22362002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2237
88e7e941 2238 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
2239 reorganize first lines parallel to yacc.c.
2240
fb8135fa
AD
22412002-06-28 Akim Demaille <akim@epita.fr>
2242
2243 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
2244 (b4_token_enum, b4_token_defines): New, factored from...
2245 * data/lalr1.cc, data/yacc.c, glr.c: here.
2246
41442480
AD
22472002-06-28 Akim Demaille <akim@epita.fr>
2248
2249 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
2250 unused variables.
2251 * src/output.c (merger_output): static.
2252
e0e5bf84
AD
22532002-06-28 Akim Demaille <akim@epita.fr>
2254
2255 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
2256 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
2257 pacify GCC.
2258 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 2259
676385e2
PH
22602002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2261
2262 Accumulated changelog for new GLR parsing features.
2263
6a254321 2264 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
2265 conflicts_total_count.
2266 * src/conflicts.h: Ditto.
2267 * src/output.c (token_actions): Use the new name.
2268 (output_conflicts): Change conflp => conflict_list_heads, and
2269 confl => conflict_list for better readability.
2270 * data/glr.c: Use the new names.
2271 * NEWS: Add self to GLR announcement.
e0e5bf84 2272
676385e2
PH
2273 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
2274
2275 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
2276 Akim Demaille.
2277
2278 * data/bison.glr: Change name to glr.c
2279 * data/glr.c: Renamed from bison.glr.
2280 * data/Makefile.am: Add glr.c
e0e5bf84
AD
2281
2282 * src/getargs.c:
2283
676385e2
PH
2284 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
2285 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 2286
676385e2
PH
2287 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2288
2289 * data/bison.glr: Be sure to restore the
2290 current #line when returning to the skeleton contents after having
2291 exposed the input file's #line.
2292
2293 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2294
2295 * data/bison.glr: Bring up to date with changes to bison.simple.
2296
2297 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2298
2299 * data/bison.glr: Correct definitions that use b4_prefix.
2300 Various reformatting.
2301 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
2302 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
2303 yytokenp argument; now part of stack.
2304 (yychar): Define to behave as documented.
2305 (yyclearin): Ditto.
e0e5bf84 2306
676385e2
PH
2307 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2308
2309 * src/reader.h: Add declaration for free_merger_functions.
2310
2311 * src/reader.c (merge_functions): New variable.
2312 (get_merge_function): New function.
2313 (free_merger_functions): New function.
2314 (readgram): Check for %prec that is not followed by a symbol.
2315 Handle %dprec and %merge declarations.
2316 (packgram): Initialize dprec and merger fields in rules array.
2317
2318 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
2319 conflict_list_cnt, conflict_list_free): New variables.
2320 (table_grow): Also grow conflict_table.
e0e5bf84 2321 (prepare_rules): Output dprec and merger tables.
676385e2 2322 (conflict_row): New function.
e0e5bf84 2323 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
2324 default reduction in conflicted states for GLR parser so that there
2325 are spaces for the conflict lists.
2326 (save_row): Also save conflict information.
2327 (token_actions): Allocate conflict list.
2328 (merger_output): New function.
2329 (pack_vector): Pack conflict table, too.
2330 (output_conflicts): New function to output yyconflp and yyconfl.
2331 (output_check): Allocate conflict_tos.
2332 (output_actions): Output conflict tables, also.
2333 (output_skeleton): Output b4_mergers definition.
2334 (prepare): Output b4_max_rhs_length definition.
2335 Use 'bison.glr' as default skeleton for GLR parsers.
2336
2337 * src/gram.c (glr_parser): New flag.
2338 (grammar_free): Call free_merger_functions.
2339
2340 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
2341 all pairs of conflicting reductions, rather than just all tokens
2342 causing conflicts. Needed to size conflict tables.
e0e5bf84 2343 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
2344 interface.
2345 (conflicts_print): Ditto.
2346 (count_total_conflicts): New function.
2347
2348 * src/reader.h (merger_list): New type.
2349 (merge_functions): New variable.
2350
2351 * src/lex.h (tok_dprec, tok_merge): New token types.
2352
2353 * src/gram.h (rule_s): Add dprec and merger fields.
2354 (glr_parser): New flag.
2355
2356 * src/conflicts.h (count_total_conflicts): New function.
2357
2358 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
2359
2360 * doc/bison.texinfo (Generalized LR Parsing): New section.
2361 (GLR Parsers): New section.
2362 (Language and Grammar): Mention GLR parsing.
2363 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
2364 Correct typo ("tge" -> "the").
2365
2366 * data/bison.glr: New skeleton for GLR parsing.
2367
2368 * tests/cxx-gram.at: New tests for GLR parsing.
2369
2370 * tests/testsuite.at: Include cxx-gram.at.
2371
2372 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 2373
676385e2
PH
2374 * src/parse-gram.y:
2375
2376 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
2377
2378 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 2379
b5480d74 23802002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
2381
2382 * src/options.h, src/options.c: Remove.
2383 * src/getargs.c (short_options, long_options): New.
2384
60491a94
AD
23852002-06-27 Akim Demaille <akim@epita.fr>
2386
2387 * data/bison.simple, data/bison.c++: Rename as...
2388 * data/yacc.c, data/lalr1.cc: these.
2389 * doc/bison.texinfo (Environment Variables): Remove.
2390
9be0c25b
AD
23912002-06-25 Raja R Harinath <harinath@cs.umn.edu>
2392
2393 * src/getargs.c (report_argmatch): Initialize strtok().
2394
1ae72863
AD
23952002-06-20 Akim Demaille <akim@epita.fr>
2396
2397 * data/bison.simple (b4_symbol_actions): New, replaces...
2398 (b4_symbol_destructor, b4_symbol_printer): these.
2399 (yysymprint): Be sure to call YYPRINT only for tokens, and using
2400 user token numbers.
2401
87542d29
AD
24022002-06-20 Akim Demaille <akim@epita.fr>
2403
2404 * data/bison.simple (yydestructor): Rename as...
2405 (yydestruct): this.
2406
1a31ed21
AD
24072002-06-20 Akim Demaille <akim@epita.fr>
2408
2409 * src/symtab.h, src/symtab.c (symbol_type_set)
2410 (symbol_destructor_set, symbol_precedence_set): The location is
2411 the last argument.
2412 Adjust all callers.
2413
e776192e
AD
24142002-06-20 Akim Demaille <akim@epita.fr>
2415
2416 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
2417 internals.
2418 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
2419 Takes a location.
2420 * src/symtab.h, src/symtab.c (symbol_class_set)
2421 (symbol_user_token_number_set): Likewise.
2422 Adjust all callers.
2423 Promote complain_at.
2424 * tests/input.at (Type Clashes): Adjust.
2425
5c1180b3
AD
24262002-06-20 Akim Demaille <akim@epita.fr>
2427
2428 * data/bison.simple (YYLEX): Fix the declaration when
2429 %pure-parser.
2430
e3170060
AD
24312002-06-20 Akim Demaille <akim@epita.fr>
2432
2433 * data/bison.simple (yysymprint): Don't print the token number,
2434 just its name.
2435 * tests/actions.at (Destructors): Rename as...
2436 (Printers and Destructors): this.
2437 Also exercise %printer.
2438
253862fd
AD
24392002-06-20 Akim Demaille <akim@epita.fr>
2440
2441 * data/bison.simple (YYDSYMPRINT): New.
2442 Use it to remove many of the #if YYDEBUG/if (yydebug).
2443
366eea36
AD
24442002-06-20 Akim Demaille <akim@epita.fr>
2445
2446 * src/symtab.h, src/symtab.c (symbol_t): printer and
2447 printer_location are new members.
2448 (symbol_printer_set): New.
2449 * src/parse-gram.y (PERCENT_PRINTER): New token.
2450 Handle its associated rule.
2451 * src/scan-gram.l: Adjust.
2452 (handle_destructor_at, handle_destructor_dollar): Rename as...
2453 (handle_symbol_code_at, handle_symbol_code_dollar): these.
2454 * src/output.c (symbol_printers_output): New.
2455 (output_skeleton): Call it.
2456 * data/bison.simple (yysymprint): New. Cannot be named yyprint
2457 since there are already many grammar files with a user `yyprint'.
2458 Replace the calls to YYPRINT to calls to yysymprint.
2459 * tests/calc.at: Adjust.
2460 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
2461 taking advantage of parser very internal details (stack size!).
2462
4f25ebb0
AD
24632002-06-20 Akim Demaille <akim@epita.fr>
2464
2465 * src/scan-gram.l: Complete the scanner with the missing patterns
2466 to pacify Flex.
2467 Use `quote' and `symbol_tag_get' where appropriate.
2468
93b68a0e
AD
24692002-06-19 Akim Demaille <akim@epita.fr>
2470
2471 * tests/actions.at (Destructors): Augment to test locations.
2472 * data/bison.simple (yydestructor): Pass it the current location
2473 if locations are enabled.
2474 Prototype only when __STDC__ or C++.
2475 Change the argument names to move into the yy name space: there is
2476 user code here.
2477
58612f1d
AD
24782002-06-19 Akim Demaille <akim@epita.fr>
2479
74310291
AD
2480 * data/bison.simple (b4_pure_if): New.
2481 Use it instead of #ifdef YYPURE.
2482
24832002-06-19 Akim Demaille <akim@epita.fr>
2484
2485 * data/bison.simple (b4_location_if): New.
58612f1d
AD
2486 Use it instead of #ifdef YYLSP_NEEDED.
2487
f25bfb75
AD
24882002-06-19 Akim Demaille <akim@epita.fr>
2489
2490 Prepare @$ in %destructor, but currently don't bind it in the
2491 skeleton, as %location use is not cleaned up yet.
2492
2493 * src/scan-gram.l (handle_dollar, handle_destructor_at)
2494 (handle_action_at): New.
2495 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
2496 a braced_code_t and a location as additional arguments.
2497 (handle_destructor_dollar): Instead of requiring `b4_eval', just
2498 unquote one when outputting `b4_dollar_dollar'.
2499 Adjust callers.
2500 * data/bison.simple (b4_eval): Remove.
2501 (b4_symbol_destructor): Adjust.
2502 * tests/input.at (Invalid @n): Adjust.
2503
c732d2c6
AD
25042002-06-19 Zack Weinberg <zack@codesourcery.com>
2505
2506 * doc/bison.texinfo: Document ability to have multiple
2507 prologue sections.
2508
8c165d89
AD
25092002-06-18 Akim Demaille <akim@epita.fr>
2510
2511 * src/files.c (compute_base_names): When computing the output file
2512 names from the input file name, strip the directory part.
2513
ca98bf57
AD
25142002-06-18 Akim Demaille <akim@epita.fr>
2515
2516 * data/bison.simple.new: Comment changes.
2517 Reported by Andreas Schwab.
2518
0bfb02ff
AD
25192002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
2520
2521 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
2522 there are no `label `yyoverflowlab' defined but not used' warnings
2523 when yyoverflow is defined.
2524
24c0aad7
AD
25252002-06-18 Akim Demaille <akim@epita.fr>
2526
2527 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
2528 new member.
2529 (symbol_destructor_set): Adjust.
2530 * src/output.c (symbol_destructors_output): Output the destructor
2531 locations.
2532 Output the symbol name.
2533 * data/bison.simple (b4_symbol_destructor): Adjust.
2534
5719c109
AD
25352002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
2536 and Akim Demaille <akim@epita.fr>
2537
2538 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
2539 what's left on the stack when the error recovery hits EOF.
2540 * tests/actions.at (Destructors): Complete to exercise this case.
2541
9280d3ef
AD
25422002-06-17 Akim Demaille <akim@epita.fr>
2543
2544 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
2545 arguments is really empty, not only equal to `[]'.
2546 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
2547 member.
2548 (symbol_destructor_set): New.
2549 * src/output.c (symbol_destructors_output): New.
2550 * src/reader.h (brace_code_t, current_braced_code): New.
2551 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
2552 (handle_dollar): Rename as...
2553 (handle_action_dollar): this.
2554 (handle_destructor_dollar): New.
2555 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
2556 (grammar_declaration): Use it.
2557 * data/bison.simple (yystos): Is always defined.
2558 (yydestructor): New.
2559 * tests/actions.at (Destructors): New.
2560 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
2561
dafdc66f
AD
25622002-06-17 Akim Demaille <akim@epita.fr>
2563
2564 * src/symlist.h, src/symlist.c (symbol_list_length): New.
2565 * src/scan-gram.l (handle_dollar, handle_at): Compute the
2566 rule_length only when needed.
2567 * src/output.c (actions_output, token_definitions_output): Output
2568 the full M4 block.
2569 * src/symtab.c: Don't access directly to the symbol tag, use
2570 symbol_tag_get.
2571 * src/parse-gram.y: Use symbol_list_free.
2572
56c47203
AD
25732002-06-17 Akim Demaille <akim@epita.fr>
2574
2575 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
2576 (symbol_list_prepend, get_type_name): Move to...
2577 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
2578 (symbol_list_prepend, symbol_list_n_type_name_get): here.
2579 Adjust all callers.
2580 (symbol_list_free): New.
2581 * src/scan-gram.l (handle_dollar): Takes a location.
2582 * tests/input.at (Invalid $n): Adjust.
2583
1e0bab92
AD
25842002-06-17 Akim Demaille <akim@epita.fr>
2585
2586 * src/reader.h, src/reader.c (symbol_list_new): Export it.
2587 (symbol_list_prepend): New.
2588 * src/parse-gram.y (%union): `list' is a new member.
2589 (symbols.1): New, replaces...
2590 (terms_to_prec.1, nterms_to_type.1): these.
2591 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
2592 Take a location as additional argument.
2593 Adjust all callers.
2594
04e60654
AD
25952002-06-15 Akim Demaille <akim@epita.fr>
2596
2597 * src/parse-gram.y: Move %token in the declaration section so that
2598 we don't depend upon CVS Bison.
2599
10e5b8bd
AD
26002002-06-15 Akim Demaille <akim@epita.fr>
2601
2602 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
2603 * src/print.c (print_core): Use it.
2604
9801d40c
AD
26052002-06-15 Akim Demaille <akim@epita.fr>
2606
2607 * src/conflicts.c (log_resolution): Accept the rule involved in
2608 the sr conflicts instead of the lookahead number that points to
2609 that rule.
2610 (flush_reduce): Accept the current lookahead vector as argument,
2611 instead of the index in LA.
2612 (resolve_sr_conflict): Accept the current number of lookahead
2613 bitset to consider for the STATE, instead of the index in LA.
2614 (set_conflicts): Adjust.
2615 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
2616
c0263492
AD
26172002-06-15 Akim Demaille <akim@epita.fr>
2618
2619 * src/state.h (state_t): Replace the `lookaheadsp' member, a
2620 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
2621 Adjust all dependencies.
2622 * src/lalr.c (initialize_lookaheads): Split into...
2623 (states_lookaheads_count, states_lookaheads_initialize): these.
2624 (lalr): Adjust.
2625
9757c359
AD
26262002-06-15 Akim Demaille <akim@epita.fr>
2627
2628 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
2629 out of...
2630 (grammar_rules_print): here.
2631 * src/reduce.c (reduce_output): Use it.
2632 * tests/reduce.at (Useless Rules, Reduced Automaton)
2633 (Underivable Rules): Adjust.
2634
6b98e4b5
AD
26352002-06-15 Akim Demaille <akim@epita.fr>
2636
2637 Copy BYacc's nice way to report the grammar.
2638
2639 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
2640 New.
2641 Don't print the rules' location, it is confusing and useless.
2642 (rule_print): Use grammar_rhs_print.
2643 * src/print.c (print_grammar): Use grammar_rules_print.
2644
6b98e4b5
AD
26452002-06-15 Akim Demaille <akim@epita.fr>
2646
2647 Complete and rationalize `useless thing' warnings.
2648
2649 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
2650 (symbol_tag_print): New.
2651 Use them everywhere in place of accessing directly the tag member.
2652 * src/gram.h, src/gram.c (rule_print): New.
2653 Use it where a rule used to be printed `by hand'.
2654 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
2655 (reduce_grammar_tables): Report the useless rules.
2656 (reduce_print): Useless things are a warning, not an error.
2657 Report it as such.
2658 * tests/reduce.at (Useless Nonterminals, Useless Rules):
2659 (Reduced Automaton, Underivable Rules): Adjust.
2660 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
2661 * tests/conflicts.at (Unresolved SR Conflicts)
2662 (Solved SR Conflicts): Adjust.
2663
ee000ba4
AD
26642002-06-15 Akim Demaille <akim@epita.fr>
2665
2666 Let symbols have a location.
2667
2668 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
2669 (getsym): Adjust.
2670 Adjust all callers.
2671 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
2672 Use location_t, not int.
2673 * src/symtab.c (symbol_check_defined): Take advantage of the
2674 location.
2675 * tests/regression.at (Invalid inputs): Adjust.
2676
8efe435c
AD
26772002-06-15 Akim Demaille <akim@epita.fr>
2678
2679 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
2680 (input): Don't try to initialize yylloc here, do it in the
2681 scanner.
2682 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
2683 * src/gram.h (rule_t): Change line and action_line into location
2684 and action_location, of location_t type.
2685 Adjust all dependencies.
2686 * src/location.h, src/location.c (empty_location): New.
2687 * src/reader.h, src/reader.c (grammar_start_symbol_set)
2688 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
2689 (grammar_current_rule_symbol_append)
2690 (grammar_current_rule_action_append): Expect a location as argument.
2691 * src/reader.c (grammar_midrule_action): Adjust to attach an
2692 action's location as dummy symbol location.
2693 * src/symtab.h, src/symtab.c (startsymbol_location): New.
2694 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
2695 the line numbers.
2696
1921f1d7
AD
26972002-06-14 Akim Demaille <akim@epita.fr>
2698
2699 Grammar declarations may be found in the grammar section.
2700
2701 * src/parse-gram.y (rules_or_grammar_declaration): New.
2702 (declarations): Each declaration may end with a semicolon, not
2703 just...
2704 (grammar_declaration): `"%union"'.
2705 (grammar): Branch to rules_or_grammar_declaration.
2706
4515534c
AD
27072002-06-14 Akim Demaille <akim@epita.fr>
2708
2709 * src/main.c (main): Invoke scanner_free.
2710
f958596b
AD
27112002-06-14 Akim Demaille <akim@epita.fr>
2712
2713 * src/output.c (m4_invoke): Extracted from...
2714 (output_skeleton): here.
2715 Free tempfile.
2716
2c569025
AD
27172002-06-14 Akim Demaille <akim@epita.fr>
2718
2719 * src/parse-gram.y (directives, directive, gram)
2720 (grammar_directives, precedence_directives, precedence_directive):
2721 Rename as...
2722 (declarations, declaration, grammar, grammar_declaration)
2723 (precedence_declaration, precedence_declarator): these.
2724 (symbol_declaration): New.
2725
592e8d4d
AD
27262002-06-14 Akim Demaille <akim@epita.fr>
2727
2728 * src/files.c (action_obstack): Remove, unused.
2729 (output_obstack): Remove it, and all its dependencies, as it is no
2730 longer needed.
2731 * src/reader.c (epilogue_set): Build the epilogue in the
2732 muscle_obstack.
2733 * src/output.h, src/output.c (muscle_obstack): Move to...
2734 * src/muscle_tab.h, src/muscle_tab.h: here.
2735 (muscle_init): Initialize muscle_obstack.
2736 (muscle_free): New.
2737 * src/main.c (main): Call it.
2738
0c15323d
AD
27392002-06-14 Akim Demaille <akim@epita.fr>
2740
2741 * src/location.h: New, extracted from...
2742 * src/reader.h: here.
2743 * src/Makefile.am (noinst_HEADERS): Merge into
2744 (bison_SOURCES): this.
2745 Add location.h.
2746 * src/parse-gram.y: Use location_t instead of Bison's.
2747 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
2748 Use location_t instead of ints.
2749
e96c9728
AD
27502002-06-14 Akim Demaille <akim@epita.fr>
2751
2752 * data/bison.simple, data/bison.c++: Be sure to restore the
2753 current #line when returning to the skeleton contents after having
2754 exposed the input file's #line.
2755
75d1fe16
AD
27562002-06-12 Akim Demaille <akim@epita.fr>
2757
2758 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
2759 eager.
2760 * tests/actions.at (Exotic Dollars): New.
2761
6c35d22c
AD
27622002-06-12 Akim Demaille <akim@epita.fr>
2763
2764 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
2765 ['"/] too eagerly.
2766 * tests/input.at (Torturing the Scanner): New.
2767
1d6412ad
AD
27682002-06-11 Akim Demaille <akim@epita.fr>
2769
2770 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
2771 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
2772 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
2773 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
2774 * src/reader.c (reader): Use it.
2775
4cdb01db
AD
27762002-06-11 Akim Demaille <akim@epita.fr>
2777
2778 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
2779 Adjust all callers.
2780 (scanner_last_string_free): New.
2781
44995b2e
AD
27822002-06-11 Akim Demaille <akim@epita.fr>
2783
2784 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
2785 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
2786 (last_string, YY_OBS_FREE): New.
2787 Use them when returning an ID.
2788
e9955c83
AD
27892002-06-11 Akim Demaille <akim@epita.fr>
2790
2791 Have Bison grammars parsed by a Bison grammar.
2792
2793 * src/reader.c, src/reader.h (prologue_augment): New.
2794 * src/reader.c (copy_definition): Remove.
2795
2796 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
2797 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
2798 (grammar_current_rule_prec_set, grammar_current_rule_check)
2799 (grammar_current_rule_symbol_append)
2800 (grammar_current_rule_action_append): Export.
2801 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
2802 (symbol_list_action_append): Remove.
2803 Hook the routines from reader.
2804 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
2805 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
2806
2807 * src/reader.c (read_declarations): Remove, unused.
2808
2809 * src/parse-gram.y: Handle the epilogue.
2810 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
2811 (grammar_start_symbol_set): this.
2812 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
2813 * src/reader.c (readgram): Remove, unused.
2814 (reader): Adjust to insert eoftoken and axiom where appropriate.
2815
2816 * src/reader.c (copy_dollar): Replace with...
2817 * src/scan-gram.h (handle_dollar): this.
2818 * src/parse-gram.y: Remove `%thong'.
2819
2820 * src/reader.c (copy_at): Replace with...
2821 * src/scan-gram.h (handle_at): this.
2822
2823 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
2824 New.
2825
2826 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
2827 time being.
2828
2829 * src/reader.h, src/reader.c (grammar_rule_end): New.
2830
2831 * src/parse.y (current_type, current_class): New.
2832 Implement `%nterm', `%token' support.
2833 Merge `%term' into `%token'.
2834 (string_as_id): New.
2835 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
2836 type name.
2837
2838 * src/parse-gram.y: Be sure to handle properly the beginning of
2839 rules.
2840
2841 * src/parse-gram.y: Handle %type.
2842 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
2843
2844 * src/parse-gram.y: More directives support.
2845 * src/options.c: No longer handle source directives.
2846
2847 * src/parse-gram.y: Fix %output.
2848
2849 * src/parse-gram.y: Handle %union.
2850 Use the prologue locations.
2851 * src/reader.c (parse_union_decl): Remove.
2852
2853 * src/reader.h, src/reader.c (epilogue_set): New.
2854 * src/parse-gram.y: Use it.
2855
2856 * data/bison.simple, data/bison.c++: b4_stype is now either not
2857 defined, then default to int, or to the contents of %union,
2858 without `union' itself.
2859 Adjust.
2860 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
2861
2862 * src/output.c (actions_output): Don't output braces, as they are
2863 already handled by the scanner.
2864
2865 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
2866 characters to themselves.
2867
2868 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
2869 that the epilogue has a proper #line.
2870
2871 * src/parse-gram.y: Handle precedence/associativity.
2872
2873 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
2874 a terminal.
2875 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
2876 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
2877 at all to define terminals that cannot be emitted.
2878
2879 * src/scan-gram.l: Escape M4 characters.
2880
2881 * src/scan-gram.l: Working properly with escapes in user
2882 strings/characters.
2883
2884 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
2885 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
2886 grammar.
2887 Use more modest sizes, as for the time being the parser does not
2888 release memory, and therefore the process swallows a huge amount
2889 of memory.
2890
2891 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
2892 stricter %token grammar.
2893
2894 * src/symtab.h (associativity): Add `undef_assoc'.
2895 (symbol_precedence_set): Do nothing when passed an undef_assoc.
2896 * src/symtab.c (symbol_check_alias_consistence): Adjust.
2897
2898 * tests/regression.at (Invalid %directive): Remove, as it is now
2899 meaningless.
2900 (Invalid inputs): Adjust to the new error messages.
2901 (Token definitions): The new grammar doesn't allow too many
2902 eccentricities.
2903
2904 * src/lex.h, src/lex.c: Remove.
2905 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
2906 (copy_character, copy_string2, copy_string, copy_identifier)
2907 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
2908 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
2909 (parse_action): Remove.
2910 * po/POTFILES.in: Adjust.
2911
2e047461
AD
29122002-06-11 Akim Demaille <akim@epita.fr>
2913
2914 * src/reader.c (parse_action): Don't store directly into the
2915 rule's action member: return the action as a string.
2916 Don't require `rule_length' as an argument: compute it.
2917 (grammar_current_rule_symbol_append)
2918 (grammar_current_rule_action_append): New, eved out from
2919 (readgram): here.
2920 Remove `action_flag', `rulelength', unused now.
2921
9af3fbce
AD
29222002-06-11 Akim Demaille <akim@epita.fr>
2923
2924 * src/reader.c (grammar_current_rule_prec_set).
2925 (grammar_current_rule_check): New, eved out from...
2926 (readgram): here.
2927 Remove `xaction', `first_rhs': useless.
2928 * tests/input.at (Type clashes): New.
2929 * tests/existing.at (GNU Cim Grammar): Adjust.
2930
1485e106
AD
29312002-06-11 Akim Demaille <akim@epita.fr>
2932
2933 * src/reader.c (grammar_midrule_action): New, Eved out from
2934 (readgram): here.
2935
da4160c3
AD
29362002-06-11 Akim Demaille <akim@epita.fr>
2937
2938 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
2939 New.
2940 (readgram): Use them as replacement of inlined code, crule and
2941 crule1.
2942
f6d0f937
AD
29432002-06-11 Akim Demaille <akim@epita.fr>
2944
2945 * src/reader.c (grammar_end, grammar_symbol_append): New.
2946 (readgram): Use them.
2947 Make the use of `p' as local as possible.
2948
69078d4b
AD
29492002-06-10 Akim Demaille <akim@epita.fr>
2950
2951 GCJ's parser requires the tokens to be defined before the prologue.
2952
2953 * data/bison.simple: Output the token definition before the user's
2954 prologue.
2955 * tests/regression.at (Braces parsing, Duplicate string)
2956 (Mixing %token styles): Check the output from bison.
2957 (Early token definitions): New.
2958
5e424082
AD
29592002-06-10 Akim Demaille <akim@epita.fr>
2960
2961 * src/symtab.c (symbol_user_token_number_set): Don't complain when
2962 assigning twice the same user number to a token, so that we can
2963 use it in...
2964 * src/lex.c (lex): here.
2965 Also use `symbol_class_set' instead of hand written code.
2966 * src/reader.c (parse_assoc_decl): Likewise.
2967
44536b35
AD
29682002-06-10 Akim Demaille <akim@epita.fr>
2969
2970 * src/symtab.c, src/symtab.c (symbol_class_set)
2971 (symbol_user_token_number_set): New.
2972 * src/reader.c (parse_token_decl): Use them.
2973 Use a switch instead of ifs.
2974 Use a single argument.
2975
8b9f2372
AD
29762002-06-10 Akim Demaille <akim@epita.fr>
2977
2978 Remove `%thong' support as it is undocumented, unused, duplicates
2979 `%token's job, and creates useless e-mail traffic with people who
2980 want to know what it is, why it is undocumented, unused, and
2981 duplicates `%token's job.
2982
2983 * src/reader.c (parse_thong_decl): Remove.
2984 * src/options.c (option_table): Remove "thong".
2985 * src/lex.h (tok_thong): Remove.
2986
3ae2b51f
AD
29872002-06-10 Akim Demaille <akim@epita.fr>
2988
2989 * src/symtab.c, src/symtab.c (symbol_type_set)
2990 (symbol_precedence_set): New.
2991 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
2992 (value_components_used): Remove, unused.
2993
2f1afb73
AD
29942002-06-09 Akim Demaille <akim@epita.fr>
2995
2996 Move symbols handling code out of the reader.
2997
2998 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
2999 (axiom): Move to...
3000 * src/symtab.h, src/symtab.c: here.
3001
3002 * src/gram.c (start_symbol): Remove: use startsymbol->number.
3003 * src/reader.c (startval): Rename as...
3004 * src/symtab.h, src/symtab.c (startsymbol): this.
3005 * src/reader.c: Adjust.
3006
3007 * src/reader.c (symbol_check_defined, symbol_make_alias)
3008 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
3009 (token_translations_init)
3010 Move to...
3011 * src/symtab.c: here.
3012 * src/reader.c (packsymbols): Move to...
3013 * src/symtab.h, src/symtab.c (symbols_pack): here.
3014 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
3015 argument.
3016
e9bca3ad
AD
30172002-06-03 Akim Demaille <akim@epita.fr>
3018
3019 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
3020 then statements.
3021
86eff183
AD
30222002-06-03 Akim Demaille <akim@epita.fr>
3023
3024 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
3025 structs with non literals.
3026 * src/scan-skel.l: never-interactive.
3027 * src/conflicts.c (enum conflict_resolution_e): No trailing
3028 comma.
3029 * src/getargs.c (usage): Split long literal strings.
3030 Reported by Hans Aberg.
3031
717be197
AD
30322002-05-28 Akim Demaille <akim@epita.fr>
3033
3034 * data/bison.c++: Use C++ ostreams.
3035 (cdebug_): New member.
3036
670ddffd
AD
30372002-05-28 Akim Demaille <akim@epita.fr>
3038
3039 * src/output.c (output_skeleton): Be sure to allocate enough room
3040 for `/' _and_ for `\0' in full_skeleton.
3041
769b430f
AD
30422002-05-28 Akim Demaille <akim@epita.fr>
3043
3044 * data/bison.c++: Catch up with bison.simple:
3045 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3046 and Paul Eggert <eggert@twinsun.com>: `error' handing.
3047 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
3048 and popping traces.
3049
7067cb36
PH
30502002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3051
3052 * src/output.c (output_skeleton): Put an explicit path in front of
3053 the skeleton file name, rather than relying on the -I directory,
3054 to partially alleviate effects of having a skeleton file lying around
3055 in the current directory.
769b430f 3056
4a713ec2
PH
30572002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3058
769b430f 3059 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
3060 obstack_printf should be obstack_fgrow1.
3061
b408954b
AD
30622002-05-26 Akim Demaille <akim@epita.fr>
3063
3064 * src/state.h (state_t): `solved_conflicts' is a new member.
3065 * src/LR0.c (new_state): Set it to 0.
3066 * src/conflicts.h, src/conflicts.c (print_conflicts)
3067 (free_conflicts, solve_conflicts): Rename as...
3068 (conflicts_print, conflicts_free, conflicts_solve): these.
3069 Adjust callers.
3070 * src/conflicts.c (enum conflict_resolution_e)
3071 (solved_conflicts_obstack): New, used by...
3072 (log_resolution): this.
3073 Adjust to attach the conflict resolution to each state.
3074 Complete the description with the precedence/associativity
3075 information.
3076 (resolve_sr_conflict): Adjust.
3077 * src/print.c (print_state): Output its solved_conflicts.
3078 * tests/conflicts.at (Unresolved SR Conflicts)
3079 (Solved SR Conflicts): Exercise --report=all.
3080
a49aecd5
AD
30812002-05-26 Akim Demaille <akim@epita.fr>
3082
3083 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
3084 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
3085 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
3086 (token_number_t, item_number_as_token_number)
3087 (token_number_as_item_number, muscle_insert_token_number_table):
3088 Rename as...
3089 (symbol_number_t, item_number_as_symbol_number)
3090 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
3091 these, since it is more appropriate.
3092
5504898e
AD
30932002-05-26 Akim Demaille <akim@epita.fr>
3094
3095 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
3096 `Error:' lines.
3097 * data/bison.simple (yystos) [YYDEBUG]: New.
3098 (yyparse) [YYDEBUG]: Display the symbols which are popped during
3099 error recovery.
3100 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
3101
ec3bc396
AD
31022002-05-25 Akim Demaille <akim@epita.fr>
3103
3104 * doc/bison.texinfo (Debugging): Split into...
3105 (Tracing): this new section, its former contents, and...
3106 (Understanding): this new section.
3107 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
3108 by...
3109 (report_flag): this.
3110 Adjust all dependencies.
3111 (report_args, report_types, report_argmatch): New.
3112 (usage, getargs): Report/support -r, --report.
3113 * src/options.h
3114 (struct option_table_struct): Rename as..,
3115 (struct option_table_s): this.
3116 Rename the `set_flag' member to `flag' to match with getopt_long's
3117 struct.
3118 * src/options.c (option_table): Split verbose into an entry for
3119 %verbose, and another for --verbose.
3120 Support --report/-r, so remove -r from the obsolete --raw.
3121 * src/print.c: Attach full item sets and lookaheads reports to
3122 report_flag instead of trace_flag.
3123 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
3124
78df8250
PE
31252002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3126 and Paul Eggert <eggert@twinsun.com>
769b430f 3127
78df8250
PE
3128 * data/bison.simple (yyparse): Correct error handling to conform to
3129 POSIX and yacc. Specifically, after syntax error is discovered,
3130 do not reduce further before shifting the error token.
3131 Clean up the code a bit by removing the labels yyerrdefault,
3132 yyerrhandle, yyerrpop.
3133 * NEWS: Document the above.
3134
c0c9ea05
PH
31352002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3136
3137 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
3138 type; it isn't always big enough, since it doesn't necessarily
3139 include non-terminals.
769b430f 3140 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
3141 the latter can be removed.
3142 (yy_token_number_type): Remove, only one use.
3143 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
3144 don't use TokenNumberType as element type.
769b430f 3145
c0c9ea05
PH
3146 * tests/regression.at: Modify expected output to agree with change
3147 to yyr1 and yytranslate.
769b430f 3148
6390a83f
FK
31492002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
3150
3151 * src/reader.c (parse_action): Use copy_character instead of
3152 obstack_1grow.
3153
db7c8e9a
AD
31542002-05-13 Akim Demaille <akim@epita.fr>
3155
3156 * tests/regression.at (Token definitions): Prototype yylex and
3157 yyerror.
3158
fcc61800
PH
31592002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3160
158c687b 3161 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
3162 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
3163 32-bit arithmetic.
3164 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
3165
5683e9b2
AD
31662002-05-07 Akim Demaille <akim@epita.fr>
3167
3168 * tests/synclines.at: Be sure to prototype yylex and yyerror to
3169 avoid GCC warnings.
3170
0c2d3f4c
AD
31712002-05-07 Akim Demaille <akim@epita.fr>
3172
3173 Kill GCC warnings.
3174
3175 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
3176 over the RHS of each rule.
3177 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
3178 * src/state.h (state_t): Member `nitems' is unsigned short.
3179 * src/LR0.c (get_state): Adjust.
3180 * src/reader.c (packgram): Likewise.
3181 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
3182 `Type'.
3183 (muscle_insert_int_table): Remove, unused.
3184 (prepare_rules): Remove `max'.
3185
1565b720
AD
31862002-05-06 Akim Demaille <akim@epita.fr>
3187
3188 * src/closure.c (print_firsts): Display of the symbol tags.
3189 (bitmatrix_print): Move to...
3190 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
3191 here.
3192 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
3193
cfaee611
AD
31942002-05-06 Akim Demaille <akim@epita.fr>
3195
3196 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
3197 hash_do_for_each.
3198
458be8e0
AD
31992002-05-06 Akim Demaille <akim@epita.fr>
3200
3201 * src/LR0.c (new_state, get_state): Instead of using the global
3202 `kernel_size' and `kernel_base', have two new arguments:
3203 `core_size' and `core'.
3204 Adjust callers.
3205
a900a624
AD
32062002-05-06 Akim Demaille <akim@epita.fr>
3207
3208 * src/reader.c (packgram): No longer end `ritem' with a 0
3209 sentinel: it is not used.
3210
d4e7d3a1
AD
32112002-05-05 Akim Demaille <akim@epita.fr>
3212
3213 New experimental feature: display the lookaheads in the report and
3214 graph.
3215
3216 * src/print (print_core): When --trace-flag, display the rules
3217 lookaheads.
3218 * src/print_graph.c (print_core): Likewise.
3219 Swap the arguments.
3220 Adjust caller.
3221
39ceb25b
AD
32222002-05-05 Akim Demaille <akim@epita.fr>
3223
3224 * tests/torture.at (Many lookaheads): New test.
3225
5372019f
AD
32262002-05-05 Akim Demaille <akim@epita.fr>
3227
3228 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
3229 (GENERATE_MUSCLE_INSERT_TABLE): this.
3230 (output_int_table, output_unsigned_int_table, output_short_table)
3231 (output_token_number_table, output_item_number_table): Replace with...
3232 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
3233 (muscle_insert_short_table, muscle_insert_token_number_table)
3234 (muscle_insert_item_number_table): these.
3235 Adjust all callers.
3236 (prepare_tokens): Don't free `translations', since...
3237 * src/reader.h, src/reader.c (grammar_free): do it.
3238 Move to...
3239 * src/gram.h, src/gram.c (grammar_free): here.
3240 * data/bison.simple, data/bison.c++: b4_token_number_max is now
3241 b4_translate_max.
3242
5df5f6d5
AD
32432002-05-05 Akim Demaille <akim@epita.fr>
3244
3245 * src/output.c (output_unsigned_int_table): New.
3246 (prepare_rules): `i' is unsigned.
3247 `prhs', `rline', `r2' are unsigned int.
3248 Rename muscle `rhs_number_max' as `rhs_max'.
3249 Output muscles `prhs_max', `rline_max', and `r2_max'.
3250 Free rline and r1.
3251 * data/bison.simple, data/bison.c++: Adjust to use these muscles
3252 to compute types instead of constant types.
3253 * tests/regression.at (Web2c Actions): Adjust.
3254
b87f8b21
AD
32552002-05-04 Akim Demaille <akim@epita.fr>
3256
3257 * src/symtab.h (SALIAS, SUNDEF): Rename as...
3258 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
3259 Adjust dependencies.
3260 * src/output.c (token_definitions_output): Be sure not to output a
3261 `#define 'a'' when fed with `%token 'a' "a"'.
3262 * tests/regression.at (Token definitions): New.
3263
8bb936e4
PE
32642002-05-03 Paul Eggert <eggert@twinsun.com>
3265
3266 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
3267 for K&R C.
3268
32692002-05-03 gettextize <bug-gnu-gettext@gnu.org>
3270
3271 * Makefile.am (SUBDIRS): Remove intl.
3272 (EXTRA_DIST): Add config/config.rpath.
3273
53c71a12
AD
32742002-05-03 Akim Demaille <akim@epita.fr>
3275
3276 * data/bison.simple (m4_if): Don't output empty enums.
3277 And actually, output valid enum definitions :(.
3278
289dd0cf
AD
32792002-05-03 Akim Demaille <akim@epita.fr>
3280
3281 * configure.bat: Remove, completely obsolete.
3282 * Makefile.am (EXTRA_DIST): Adjust.
3283 Don't distribute config.rpath...
3284 * config/Makefile.am (EXTRA_DIST): Do it.
3285
db85e524
AD
32862002-05-03 Akim Demaille <akim@epita.fr>
3287
3288 * configure.in (GETTEXT_VERSION): New.
3289 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
3290
83ccf991
AD
32912002-05-03 Akim Demaille <akim@epita.fr>
3292
3293 * data/bison.simple (b4_token_enum): New.
3294 (b4_token_defines): Use it to output tokens both as #define and
3295 enums.
3296 Suggested by Paul Eggert.
3297 * src/output.c (token_definitions_output): Don't output spurious
3298 white spaces.
3299
1f418995
AD
33002002-05-03 Akim Demaille <akim@epita.fr>
3301
3302 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
3303
45119f04
RA
33042002-05-02 Robert Anisko <robert@lrde.epita.fr>
3305
3306 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
3307 Update the stack class, give a try to deque as the default container.
3308
b2d52318
AD
33092002-05-02 Akim Demaille <akim@epita.fr>
3310
3311 * data/bison.simple (yyparse): Do not implement @$ = @1.
3312 (YYLLOC_DEFAULT): Adjust to do it.
3313 * doc/bison.texinfo (Location Default Action): Fix.
3314
3a8b4109
AD
33152002-05-02 Akim Demaille <akim@epita.fr>
3316
3317 * src/reader.c (parse_braces): Merge into...
3318 (parse_action): this.
3319
84614e13
AD
33202002-05-02 Akim Demaille <akim@epita.fr>
3321
3322 * configure.in (ALL_LINGUAS): Remove.
3323 * po/LINGUAS, hr.po: New.
3324
fdbcd8e2
AD
33252002-05-02 Akim Demaille <akim@epita.fr>
3326
3327 Remove the so called hairy (semantic) parsers.
3328
3329 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
3330 * src/gram.h, src/gram.c (semantic_parser): Remove.
3331 (rule_t): Remove the guard and guard_line members.
3332 * src/lex.h (token_t): remove tok_guard.
3333 * src/options.c (option_table): Remove %guard and %semantic_parser
3334 support.
3335 * src/output.c, src/output.h (guards_output): Remove.
3336 (prepare): Adjust.
3337 (token_definitions_output): Don't output the `T'
3338 tokens (???).
3339 (output_skeleton): Don't output the guards.
3340 * src/files.c, src/files.c (attrsfile): Remove.
3341 * src/reader.c (symbol_list): Remove the guard and guard_line
3342 members.
3343 Adjust dependencies.
3344 (parse_guard): Remove.
3345 * data/bison.hairy: Remove.
3346 * doc/bison.texinfo (Environment Variables): Remove occurrences of
3347 BISON_HAIRY.
3348
82b6cb3f
AD
33492002-05-02 Akim Demaille <akim@epita.fr>
3350
3351 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
3352 (parse_guard): Rename the formal argument `stack_offset' as
3353 `rule_length', which is more readable.
3354 Adjust callers.
3355 (copy_at, copy_dollar): Instead of outputting the hard coded
3356 values of $$, $n and so forth, output invocation to b4_lhs_value,
3357 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
3358 Note: this patch partially drops `semantic-parser' support: it
3359 always does `rule_length - n', where semantic parsers ought to
3360 always use `-n'.
82b6cb3f
AD
3361 * data/bison.simple, data/bison.c++ (b4_lhs_value)
3362 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
3363
6cbfbcc5
AD
33642002-05-02 Akim Demaille <akim@epita.fr>
3365
3366 * configure.in (AC_INIT): Bump to 1.49b.
3367 (AM_INIT_AUTOMAKE): Short invocation.
3368
b8548114
AD
33692002-05-02 Akim Demaille <akim@epita.fr>
3370
3371 Version 1.49a.
3372
c20cd1fa
AD
33732002-05-01 Akim Demaille <akim@epita.fr>
3374
3375 * src/skeleton.h: Remove.
3376
8a9566d4
AD
33772002-05-01 Akim Demaille <akim@epita.fr>
3378
3379 * src/skeleton.h: Fix the #endif.
3380 Reported by Magnus Fromreide.
3381
8c6d399a
PE
33822002-04-26 Paul Eggert <eggert@twinsun.com>
3383
3384 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
3385 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 3386 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 3387
2b7ed18a
RA
33882002-04-25 Robert Anisko <robert@lrde.epita.fr>
3389
3390 * src/scan-skel.l: Postprocess quadrigraphs.
3391
3392 * src/reader.c (copy_character): New function, used to output
3393 single characters while replacing `[' and `]' with quadrigraphs, to
3394 avoid troubles with M4 quotes.
3395 (copy_comment): Output characters with copy_character.
3396 (read_additionnal_code): Likewise.
3397 (copy_string2): Likewise.
3398 (copy_definition): Likewise.
3399
3400 * tests/calc.at: Exercise M4 quoting.
3401
34a89c50
AD
34022002-04-25 Akim Demaille <akim@epita.fr>
3403
3404 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
3405 between `!' and the command.
3406 Reported by Paul Eggert.
3407
0dd1580a
RA
34082002-04-24 Robert Anisko <robert@lrde.epita.fr>
3409
3410 * tests/calc.at: Exercise prologue splitting.
3411
3412 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
3413 `b4_post_prologue' instead of `b4_prologue'.
3414
3415 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
3416 muscles.
3417 (output): Free pre_prologue_obstack and post_prologue_obstack.
3418 * src/files.h, src/files.c (attrs_obstack): Remove.
3419 (pre_prologue_obstack, post_prologue_obstack): New.
3420 * src/reader.c (copy_definition): Add a parameter to specify the
3421 obstack to fill, instead of using attrs_obstack unconditionally.
3422 (read_declarations): Pass pre_prologue_obstack to copy_definition if
3423 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
3424
83c1796f
PE
34252002-04-23 Paul Eggert <eggert@twinsun.com>
3426
3427 * data/bison.simple: Remove unnecessary commentary and white
3428 space differences from 1_29-branch.
3429 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
3430
3431 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
3432 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
3433 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
3434 constructors or destructors.
3435
3436 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
3437
1207eeac
AD
34382002-04-23 Akim Demaille <akim@epita.fr>
3439
3440 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
3441 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
3442 location with columns.
3443 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
3444 All reported by Paul Eggert.
3445
78ab8f67
AD
34462002-04-22 Akim Demaille <akim@epita.fr>
3447
3448 * src/reduce.c (dump_grammar): Move to...
3449 * src/gram.h, src/gram.c (grammar_dump): here.
3450 Be sure to separate long item numbers.
3451 Don't read the members of a rule's prec if its nil.
3452
133c20e2
AD
34532002-04-22 Akim Demaille <akim@epita.fr>
3454
3455 * src/output.c (table_size, table_grow): New.
3456 (MAXTABLE): Remove, replace uses with table_size.
3457 (pack_vector): Instead of dying when the table is too big, grow it.
3458
9515e8a7
AD
34592002-04-22 Akim Demaille <akim@epita.fr>
3460
3461 * data/bison.simple (yyr1): Its type is that of a token number.
3462 * data/bison.c++ (r1_): Likewise.
3463 * tests/regression.at (Web2c Actions): Adjust.
3464
23c5a174
AD
34652002-04-22 Akim Demaille <akim@epita.fr>
3466
3467 * src/reader.c (token_translations_init): 256 is now the default
3468 value for the error token, i.e., it will be assigned another
3469 number if the user assigned 256 to one of her tokens.
3470 (reader): Don't force 256 to error.
3471 * doc/bison.texinfo (Symbols): Adjust.
3472 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
3473 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
3474 etc. instead of 10, 20, 30 (which was used to `jump' over error
3475 (256) and undefined (2)).
3476
5fbb0954
AD
34772002-04-22 Akim Demaille <akim@epita.fr>
3478
3479 Propagate more token_number_t.
3480
3481 * src/gram.h (token_number_as_item_number)
3482 (item_number_as_token_number): New.
3483 * src/output.c (GENERATE_OUTPUT_TABLE): New.
3484 Use it to create output_item_number_table and
3485 output_token_number_table.
3486 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
3487 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
3488 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
3489 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
3490
4f940944
AD
34912002-04-22 Akim Demaille <akim@epita.fr>
3492
3493 * src/output.h, src/output.c (get_lines_number): Remove.
3494
3ded9a63
AD
34952002-04-19 Akim Demaille <akim@epita.fr>
3496
3497 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
3498 as Lex/Flex'.
3499 (Debugging): More details about enabling the debugging features.
3500 (Table of Symbols): Describe $$, $n, @$, and @n.
3501 Suggested by Tim Josling.
3502
e0c471a9
AD
35032002-04-19 Akim Demaille <akim@epita.fr>
3504
3505 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
3506
fecc10cd
AD
35072002-04-10 Akim Demaille <akim@epita.fr>
3508
3509 * src/system.h: Rely on HAVE_LIMITS_H.
3510 Suggested by Paul Eggert.
3511
51dec47b
AD
35122002-04-09 Akim Demaille <akim@epita.fr>
3513
3514 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
3515 full stderr, and strip it according to the bison options, instead
3516 of composing the error message from different bits.
3517 This makes it easier to check for several error messages.
3518 Adjust all the invocations.
3519 Add an invocation exercising the error token.
3520 Add an invocation demonstrating a stupid error message.
3521 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
3522 Adjust the tests.
3523 Error message are for stderr, not stdout.
3524
007a50a4
AD
35252002-04-09 Akim Demaille <akim@epita.fr>
3526
3527 * src/gram.h, src/gram.c (error_token_number): Remove, use
3528 errtoken->number.
3529 * src/reader.c (reader): Don't specify the user token number (2)
3530 for $undefined, as it uselessly prevents using it.
3531 * src/gram.h (token_number_t): Move to...
3532 * src/symtab.h: here.
3533 (state_t.number): Is a token_number_t.
3534 * src/print.c, src/reader.c: Use undeftoken->number instead of
3535 hard coded 2.
3536 (Even though this 2 is not the same as above: the number of the
3537 undeftoken remains being 2, it is its user token number which
3538 might not be 2).
3539 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
3540 `user_token_number_max'.
3541 Output `undef_token_number'.
3542 * data/bison.simple, data/bison.c++: Use them.
3543 Be sure to map invalid yylex return values to
3544 `undef_token_number'. This saves us from gratuitous SEGV.
3545
3546 * tests/conflicts.at (Solved SR Conflicts)
3547 (Unresolved SR Conflicts): Adjust.
3548 * tests/regression.at (Web2c Actions): Adjust.
3549
06446ccf
AD
35502002-04-08 Akim Demaille <akim@epita.fr>
3551
3552 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
3553 Adding #line.
3554 Remove the duplicate `typedefs'.
3555 (RhsNumberType): Fix the declaration and various other typos.
3556 Use __ofile__.
3557 * data/bison.simple: Use __ofile__.
3558 * src/scan-skel.l: Handle __ofile__.
3559
62a3e4f0
AD
35602002-04-08 Akim Demaille <akim@epita.fr>
3561
3562 * src/gram.h (item_number_t): New, the type of item numbers in
3563 RITEM. Note that it must be able to code symbol numbers as
3564 positive number, and the negation of rule numbers as negative
3565 numbers.
3566 Adjust all dependencies (pretty many).
3567 * src/reduce.c (rule): Remove this `short *' pointer: use
3568 item_number_t.
3569 * src/system.h (MINSHORT, MAXSHORT): Remove.
3570 Include `limits.h'.
3571 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
3572 (shortcpy): Remove.
3573 (MAXTABLE): Move to...
3574 * src/output.c (MAXTABLE): here.
3575 (prepare_rules): Use output_int_table to output rhs.
3576 * data/bison.simple, data/bison.c++: Adjust.
3577 * tests/torture.at (Big triangle): Move the limit from 254 to
3578 500.
3579 * tests/regression.at (Web2c Actions): Ajust.
3580
3581 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
3582 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
3583 passes, but produces negative #line number, once fixed, GCC is
3584 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
3585 C), it passes.
3586 * src/state.h (state_h): Code input lines on ints, not shorts.
3587
bb88b0fc
AD
35882002-04-08 Akim Demaille <akim@epita.fr>
3589
3590 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
3591 and then the grammar.
3592
9a636f47
AD
35932002-04-08 Akim Demaille <akim@epita.fr>
3594
3595 * src/system.h: No longer using strndup.
3596
680e8701
AD
35972002-04-07 Akim Demaille <akim@epita.fr>
3598
3599 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
3600 * src/output.c (output_table_data): Return the longest number.
3601 (prepare_tokens): Output `token_number_max').
3602 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
3603 New.
3604 Use them to define yy_token_number_type/TokenNumberType.
3605 Use this type for yytranslate.
3606 * tests/torture.at (Big triangle): Push the limit from 124 to
3607 253.
3608 * tests/regression.at (Web2c Actions): Adjust.
3609
817e9f41
AD
36102002-04-07 Akim Demaille <akim@epita.fr>
3611
3612 * tests/torture.at (Big triangle): New.
3613 (GNU AWK Grammar, GNU Cim Grammar): Move to...
3614 * tests/existing.at: here.
3615
5123689b
AD
36162002-04-07 Akim Demaille <akim@epita.fr>
3617
3618 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
3619 nritems.
3620 Adjust dependencies.
3621
f3849179
AD
36222002-04-07 Akim Demaille <akim@epita.fr>
3623
3624 * src/reader.c: Normalize increments to prefix form.
3625
bd02036a
AD
36262002-04-07 Akim Demaille <akim@epita.fr>
3627
3628 * src/reader.c, symtab.c: Remove debugging code.
3629
db8837cb
AD
36302002-04-07 Akim Demaille <akim@epita.fr>
3631
3632 Rename all the `bucket's as `symbol_t'.
3633
3634 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
3635 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
3636 * src/symtab.c, src/symtab.h (bucket): Rename as...
3637 (symbol_t): this.
3638 (symbol_list_new, bucket_check_defined, bucket_make_alias)
3639 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
3640 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3641 (buckets_new, buckets_free, buckets_do): Rename as...
3642 (symbol_list_new, symbol_check_defined, symbol_make_alias)
3643 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
3644 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
3645 (symbols_new, symbols_free, symbols_do): these.
3646
72a23c97
AD
36472002-04-07 Akim Demaille <akim@epita.fr>
3648
3649 Use lib/hash for the symbol table.
3650
3651 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
3652 EOF.
3653 * src/lex.c (lex): Set the `number' member of new terminals.
3654 * src/reader.c (bucket_check_defined, bucket_make_alias)
3655 (bucket_check_alias_consistence, bucket_translation): New.
3656 (reader, grammar_free, readgram, token_translations_init)
3657 (packsymbols): Adjust.
3658 (reader): Number the predefined tokens.
3659 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
3660 for predefined tokens.
3661 * src/symtab.h (bucket): Remove all the hash table related
3662 members.
3663 * src/symtab.c (symtab): Replace by...
3664 (bucket_table): this.
3665 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3666 (buckets_new, buckets_do): New.
3667
280a38c3
AD
36682002-04-07 Akim Demaille <akim@epita.fr>
3669
3670 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
3671 (start_symbol, max_user_token_number, semantic_parser)
3672 (error_token_number): Initialize.
3673 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
3674 Initialize.
3675 (reader): Don't.
3676 (errtoken, eoftoken, undeftoken, axiom): Extern.
3677
03b31c0c
AD
36782002-04-07 Akim Demaille <akim@epita.fr>
3679
3680 * src/gram.h (rule_s): prec and precsym are now pointers
3681 to the bucket giving the priority/associativity.
3682 Member `associativity' removed: useless.
3683 * src/reduce.c, src/conflicts.c: Adjust.
3684
8b3df748
AD
36852002-04-07 Akim Demaille <akim@epita.fr>
3686
3687 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
3688 Properly escape the symbols' TAG when outputting them.
3689
e601aa1d
AD
36902002-04-07 Akim Demaille <akim@epita.fr>
3691
3692 * src/lalr.h (LA): Is a bitsetv, not bitset*.
3693
b0299a2e
AD
36942002-04-07 Akim Demaille <akim@epita.fr>
3695
3696 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
3697 (LArule): this, which is an array to rule_t*.
3698 * src/print.c, src/conflicts.c: Adjust.
3699
d7e1f00c
AD
37002002-04-07 Akim Demaille <akim@epita.fr>
3701
3702 * src/gram.h (rule_t): Rename `number' as `user_number'.
3703 `number' is a new member.
3704 Adjust dependencies.
3705 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
3706
cc9305dd
AD
37072002-04-07 Akim Demaille <akim@epita.fr>
3708
3709 As a result of the previous patch, it is no longer needed
3710 to reorder ritem itself.
3711
3712 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
3713
b0940840
AD
37142002-04-07 Akim Demaille <akim@epita.fr>
3715
3716 Be sure never to walk through RITEMS, but use only data related to
3717 the rules themselves. RITEMS should be banished.
3718
3719 * src/output.c (output_token_translations): Rename as...
3720 (prepare_tokens): this.
3721 In addition to `translate', prepare the muscles `tname' and
3722 `toknum', which were handled by...
3723 (output_rule_data): this.
3724 Remove, and move the remainder of its outputs into...
3725 (prepare_rules): this new routines, which also merges content from
3726 (output_gram): this.
3727 (prepare_rules): Be sure never to walk through RITEMS.
3728 (output_stos): Rename as...
3729 (prepare_stos): this.
3730 (output): Always invoke prepare_states, after all, just don't use it
3731 in the output if you don't need it.
3732
643a5994
AD
37332002-04-07 Akim Demaille <akim@epita.fr>
3734
3735 * src/LR0.c (new_state): Display `nstates' as the name of the
3736 newly created state.
3737 Adjust to initialize first_state and last_state if needed.
3738 Be sure to distinguish the initial from the final state.
3739 (new_states): Create the itemset of the initial state, and use
3740 new_state.
3741 * src/closure.c (closure): Now that the initial state has its
3742 items properly set, there is no need for a special case when
3743 creating `ruleset'.
3744
3745 As a result, now the rule 0, reducing to $axiom, is visible in the
3746 outputs. Adjust the test suite.
3747
3748 * tests/conflicts.at (Solved SR Conflicts)
3749 (Unresolved SR Conflicts): Adjust.
3750 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
3751 * tests/conflicts.at (S/R in initial): New.
3752
b4c4ccc2
AD
37532002-04-07 Akim Demaille <akim@epita.fr>
3754
3755 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
3756 the RHS of the rules.
3757 * src/output.c (output_gram): Likewise.
3758
bba97eb2
AD
37592002-04-07 Akim Demaille <akim@epita.fr>
3760
3761 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
3762 bucket.
3763 Adjust all dependencies.
3764 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
3765 `number' of the buckets too.
3766 * src/gram.h: Include `symtab.h'.
3767 (associativity): Move to...
3768 * src/symtab.h: here.
3769 No longer include `gram.h'.
3770
c3b407f4
AD
37712002-04-07 Akim Demaille <akim@epita.fr>
3772
3773 * src/gram.h, src/gram.c (rules_rhs_length): New.
3774 (ritem_longest_rhs): Use it.
3775 * src/gram.h (rule_t): `number' is a new member.
3776 * src/reader.c (packgram): Set it.
3777 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
3778 the end of `rules', and count them out of `nrules'.
3779 (reduce_output, dump_grammar): Adjust.
3780 * src/print.c (print_grammar): It is no longer needed to check for
3781 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
3782 * tests/reduce.at (Reduced Automaton): New test.
3783
11652ab3
AD
37842002-04-07 Akim Demaille <akim@epita.fr>
3785
3786 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
3787 lacking `+ 1' to nrules, Bison reported as useless a token if it
3788 was used solely to set the precedence of the last rule...
3789
26b23c1a
AD
37902002-04-07 Akim Demaille <akim@epita.fr>
3791
3792 * data/bison.c++, data/bison.simple: Don't output the current file
3793 name in #line, to avoid useless diffs between two identical
3794 outputs under different names.
3795
18bcecb0
AD
37962002-04-07 Akim Demaille <akim@epita.fr>
3797
3798 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
3799 Normalize loops to using `< nrules + 1', not `<= nrules'.
3800
fa770c86
AD
38012002-04-07 Akim Demaille <akim@epita.fr>
3802
3803 * TODO: Update.
3804
d9b739c3
AD
38052002-04-07 Akim Demaille <akim@epita.fr>
3806
3807 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
3808 bucket.value as bucket.number.
3809
99013900
AD
38102002-04-07 Akim Demaille <akim@epita.fr>
3811
3812 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
3813 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
3814 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
3815 RHS, instead of being an index in RITEMS.
3816
e966383b
PE
38172002-04-04 Paul Eggert <eggert@twinsun.com>
3818
3819 * doc/bison.texinfo: Update copyright date.
3820 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
3821 (Symbols): Warn about running Bison in one character set,
3822 but compiling and/or running in an incompatible one.
3823 Warn about character code 256, too.
3824
38252002-04-03 Paul Eggert <eggert@twinsun.com>
3826
3827 * src/bison.data (YYSTACK_ALLOC): Depend on whether
3828 YYERROR_VERBOSE is nonzero, not whether it is defined.
3829
3830 Merge changes from bison-1_29-branch.
c307773e 3831
8d6c48b9
PE
38322002-03-20 Paul Eggert <eggert@twinsun.com>
3833
3834 Merge fixes from Debian bison_1.34-1.diff.
3835
3836 * configure.in (AC_PREREQ): 2.53.
3837
e53c6322
AD
38382002-03-20 Akim Demaille <akim@epita.fr>
3839
3840 * src/conflicts.c (log_resolution): Argument `resolution' is const.
3841
9ffbeca7
PE
38422002-03-19 Paul Eggert <eggert@twinsun.com>
3843
21db0b2a
PE
3844 * src/bison.simple (YYCOPY): New macro.
3845 (YYSTACK_RELOCATE): Use it.
3846 Remove Type arg; no longer needed. All callers changed.
3847 (yymemcpy): Remove; no longer needed.
3848
9ffbeca7
PE
3849 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
3850 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3851
642cb8f8
AD
38522002-03-19 Akim Demaille <akim@epita.fr>
3853
3854 Test and fix the #line outputs.
3855
3856 * tests/atlocal.at (GCC): New.
3857 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
3858 (Prologue synch line, ,%union synch line, Postprologue synch line)
3859 (Action synch line, Epilogue synch line): New tests.
3860 * src/reader.c (parse_union_decl): Define the muscle stype_line.
3861 * data/bison.simple, data/bison.c++: Use it.
3862
3c31a486
AD
38632002-03-19 Akim Demaille <akim@epita.fr>
3864
3865 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
3866 (Solved SR Conflicts, %expect not enough, %expect right)
3867 (%expect too much): Move to...
3868 * tests/conflicts.at: this new file.
3869
0d8bed56
AD
38702002-03-19 Akim Demaille <akim@epita.fr>
3871
3872 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
3873 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
3874 that we can move to enums for instance.
3875 * src/output.c (token_definitions_output): Output a list of
3876 `token-name, token-number' instead of the #define.
3877 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
3878
9208d17f
AD
38792002-03-14 Akim Demaille <akim@epita.fr>
3880
3881 Use Gettext 0.11.1.
3882
af27eacb
RA
38832002-03-09 Robert Anisko <robert@lrde.epita.fr>
3884
3885 * data/bison.c++: Make the user able to add members to the generated
3886 parser by subclassing.
3887
9101a310
RA
38882002-03-05 Robert Anisko <robert@lrde.epita.fr>
3889
3890 * src/reader.c (read_additionnal_code): `c' should be an integer, not
3891 a character.
3892 Reported by Nicolas Tisserand and Nicolas Burrus.
3893
fff9bf0b
RA
38942002-03-04 Robert Anisko <robert@lrde.epita.fr>
3895
3896 * src/reader.c: Warn about lacking semi-colons, do not complain.
3897
64dba31e
RA
38982002-03-04 Robert Anisko <robert@lrde.epita.fr>
3899
3900 * data/bison.c++: Remove a debug line.
3901
374f5a14
RA
39022002-03-04 Robert Anisko <robert@lrde.epita.fr>
3903
3904 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
3905 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
3906 provide a default implementation.
3907
bfcf1f3a
AD
39082002-03-04 Akim Demaille <akim@epita.fr>
3909
3910 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
3911 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
3912 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
3913 * tests/semantic.at (Parsing Guards): Similarly.
3914 * src/reader.at (readgram): Complain if the last rule is not ended
3915 with a semi-colon.
3916
65ccf9fc
AD
39172002-03-04 Akim Demaille <akim@epita.fr>
3918
3919 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
3920 * src/closure.c: here.
3921 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
3922 RTC.
3923 * src/warshall.h, src/warshall.c: Remove.
3924 * tests/sets.at (Broken Closure): Adjust.
3925
d0039cbc
AD
39262002-03-04 Akim Demaille <akim@epita.fr>
3927
3928 * src/output.c (output_skeleton): tempdir is const.
3929 bytes_read is unused.
3930
345cea78
AD
39312002-03-04 Akim Demaille <akim@epita.fr>
3932
3933 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
3934 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
3935 Update.
3936 From Michael Hayes.
3937
564801f7
AD
39382002-03-04 Akim Demaille <akim@epita.fr>
3939
3940 * src/closure.c (closure): `r' is unused.
3941
e5352bc7
AD
39422002-03-04 Akim Demaille <akim@epita.fr>
3943
3944 * tests/sets.at (Broken Closure): Add the ending `;'.
3945 * src/reader.at (readgram): Complain if a rule is not ended with a
3946 semi-colon.
3947
914feea9
AD
39482002-03-04 Akim Demaille <akim@epita.fr>
3949
3950 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
3951 (count_sr_conflicts): Use bitset_count.
3952 * src/reduce.c (inaccessable_symbols): Ditto.
3953 (bits_size): Remove.
3954 * src/warshall.h, src/warshall.c: Convert to bitsetv.
3955
f0250de6
AD
39562002-03-04 Akim Demaille <akim@epita.fr>
3957
3958 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
3959 * src/reduce.c: Remove the `bitset_zero's following the
3960 `bitset_create's, as now it is performed by the latter.
3961
ef017502
AD
39622002-03-04 Akim Demaille <akim@epita.fr>
3963
3964 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
3965 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
3966 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
3967 latest sources from Michael.
3968
76514394
AD
39692002-03-04 Akim Demaille <akim@epita.fr>
3970
3971 * src/output.c (output): Don't free the grammar.
3972 * src/reader.c (grammar_free): New.
3973 * src/main.c (main): Call it and don't free symtab here.
3974
55024580
AD
39752002-03-04 Akim Demaille <akim@epita.fr>
3976
3977 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
3978 before returning.
3979 Reported by Benoit Perrot.
3980
f9abaa2c
AD
39812002-03-04 Akim Demaille <akim@epita.fr>
3982
3983 Use bitset operations when possible, not loops over bits.
3984
3985 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
3986 bitset_or.
3987 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
3988 * src/reduce.c (useless_nonterminals): Formatting changes.
3989 * src/warshall.c (TC): Use bitset_or.
3990
0e721e75
AD
39912002-03-04 Akim Demaille <akim@epita.fr>
3992
3993 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
3994 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
3995 Ditto.
3996
0fb1ffb1
AD
39972002-03-04 Akim Demaille <akim@epita.fr>
3998
3999 * src/lalr.c (F): Now a bitset*.
4000 Adjust all dependencies.
4001
b86796bf
AD
40022002-03-04 Akim Demaille <akim@epita.fr>
4003
4004 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
4005 Adjust all dependencies.
4006
602bbf31
AD
40072002-03-04 Akim Demaille <akim@epita.fr>
4008
4009 * src/L0.c, src/LR0.h (nstates): Be size_t.
4010 Adjust comparisons (signed vs unsigned).
4011 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
4012 bitset*.
4013 Adjust all dependencies.
4014
d8a0245c
AD
40152002-03-04 Akim Demaille <akim@epita.fr>
4016
4017 * src/closure.c (firsts): Now, also a bitset.
4018 Adjust all dependencies.
4019 (varsetsize): Remove, now unused.
4020 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
4021
34ba9743
AD
40222002-03-04 Akim Demaille <akim@epita.fr>
4023
4024 * src/print.c: Convert to use bitset.h, not hand coded iterations
4025 over ints.
4026
ed86e78c
AD
40272002-03-04 Akim Demaille <akim@epita.fr>
4028
4029 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
4030
dfdb1797
AD
40312002-03-04 Akim Demaille <akim@epita.fr>
4032
4033 * src/closure.c (ruleset): Be a bitset.
4034 (rulesetsize): Remove.
4035
7086e707
AD
40362002-03-04 Akim Demaille <akim@epita.fr>
4037
4038 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
4039 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
4040 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
4041 * src/closure.c (fderives): Be an array of bitsets.
4042
98254360
RA
40432002-02-28 Robert Anisko <robert@lrde.epita.fr>
4044
4045 * data/bison.c++: Merge the two generated headers. Insert a copyright
4046 notice in each output file.
4047
a75c057f
AD
40482002-02-28 Akim Demaille <akim@epita.fr>
4049
4050 * data/bison.c++: Copy the prologue of bison.simple to fetch
4051 useful M4 definitions, such as b4_header_guard.
4052
06b00abc
AD
40532002-02-25 Akim Demaille <akim@epita.fr>
4054
4055 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
4056 translator friendly scheme for the bgr
4057 copyright notice.
06b00abc 4058
70e7d534
AD
40592002-02-25 Akim Demaille <akim@epita.fr>
4060
4061 * src/output.c (header_output): Remove, now handled completely via
4062 M4.
4063
abe017f6
AD
40642002-02-25 Akim Demaille <akim@epita.fr>
4065
4066 * m4/m4.m4: New, from CVS Autoconf.
4067 * configure.in: Invoke it.
4068 * src/output.c (output_skeleton): Use its result instead of the
4069 hard coded name.
4070
381fb12e
AD
40712002-02-25 Akim Demaille <akim@epita.fr>
4072
4073 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
4074 Fileutils 4.1.5.
4075 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
4076 * src/output.c (output_skeleton): Use mkstemp to create a real
4077 temporary file.
4078 Move the filling of `skeleton' and its muscle to...
4079 (prepare): here.
4080 (output): Move the definition of the prologue muscle to...
4081 (prepare): here.
4082 * src/system.h (DEFAULT_TMPDIR): New.
4083
6f38107f
PE
40842002-02-14 Paul Eggert <eggert@twinsun.com>
4085
4086 Remove the support for C++ namespace cleanliness; it was
4087 causing more problems than it was curing, since it didn't work
4088 properly on some nonstandard C++ compilers. This can wait
4089 for a proper C++ parser.
4090
4091 * NEWS: Document this.
4092 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
4093 of C++, as it's treated like C now.
4094 * src/bison.simple (YYSTD): Remove.
4095 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
4096 Treat C++ just like Standard C instead of trying to support
4097 namespace cleanliness.
4098
80cce3da
AD
40992002-02-14 Akim Demaille <akim@epita.fr>
4100
4101 * tests/regression.at (else): Adjust to Andreas' change.
4102
842e8679
AD
41032002-02-14 Akim Demaille <akim@epita.fr>
4104
4105 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
4106
4bda3f10
AD
41072002-02-13 Andreas Schwab <schwab@suse.de>
4108
4109 * src/output.c (output_rule_data): Don't output NULL, it might
4110 not be defined yet.
4111
4162fa07 41122002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 4113
4162fa07
RA
4114 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
4115 (Copyright notice): Update.
b418ecd8 4116
bd16a5dc
AD
41172002-02-11 Akim Demaille <akim@epita.fr>
4118
4119 * tests/regression.at (%nonassoc and eof): Don't include
4120 nonportable headers.
4121
8d69a1a3
RA
41222002-02-08 Robert Anisko <robert@lrde.epita.fr>
4123
4124 * data/bison.c++: Correct error recovery. Make the user able to
4125 initialize the starting location.
4126
9b2d0677
AD
41272002-02-07 Akim Demaille <akim@epita.fr>
4128
4129 * tests/input.at: New.
4130
69e2658b
RA
41312002-02-07 Robert Anisko <robert@lrde.epita.fr>
4132
4133 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 4134 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
4135 directives around tables only needed for debugging.
4136
4aacc3a7
RA
41372002-02-07 Robert Anisko <robert@lrde.epita.fr>
4138
4139 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
4140 C++ parsers.
4141 (yy::b4_name::parse): Use print_.
4142
762a801e
RA
41432002-02-07 Robert Anisko <robert@lrde.epita.fr>
4144
4145 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
4146
4bb2bc3f
RA
41472002-02-07 Robert Anisko <robert@lrde.epita.fr>
4148
4149 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
4150 C++ parsers.
4151 (yy::b4_name::parse): Build verbose error messages, and use error_.
4152
6b45a3ca
RA
41532002-02-06 Robert Anisko <robert@lrde.epita.fr>
4154
4155 * data/bison.c++: Fix m4 quoting in comments.
4156
50997c6e
RA
41572002-02-06 Robert Anisko <robert@lrde.epita.fr>
4158
4159 * data/bison.c++: Adjust the parser code. Fix some muscles that were
4160 not expanded by m4.
4161
3f3eed27
AD
41622002-02-05 Akim Demaille <akim@epita.fr>
4163
4164 * data/bison.c++: Adjust to the M4 back end.
4165 More is certainly needed.
4166
be2a1a68
AD
41672002-02-05 Akim Demaille <akim@epita.fr>
4168
4169 Give a try to M4 as a back end.
4170
4171 * lib/readpipe.c: New, from wdiff.
4172 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
4173 BISON_HAIRY.
4174 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
4175 specific values. Now it is m4 that performs the lookup.
4176 * src/parse-skel.y: Remove.
4177 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
4178 * src/output.c (actions_output, guards_output)
4179 (token_definitions_output): No longer keeps track of the output
4180 line number, hence remove the second argument.
4181 (guards_output): Check against the guard member of a rule, not the
4182 action member.
4183 Adjust callers.
4184 (output_skeleton): Don't look for the skeleton location, let m4 do
4185 that.
4186 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
4187 file will be used.
4188 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
4189 (prepare): Given that for the time being changesyntax is not
4190 usable in M4, rename the muscles using `-' to `_'.
4191 Define `defines_flag', `output_parser_name' and `output_header_name'.
4192 * src/output.h (actions_output, guards_output)
4193 (token_definitions_output): Adjust prototypes.
4194 * src/scan-skel.l: Instead of scanning the skeletons, it now
4195 processes the output of m4: `__oline__' and `#output'.
4196 * data/bison.simple: Adjust to be used by M4(sugar).
4197 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
4198 to date.
4199 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
4200 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
4201 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
4202 shamelessly stolen from CVS Autoconf.
4203
beda758b
AD
42042002-02-05 Akim Demaille <akim@epita.fr>
4205
4206 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
4207 * configure.in: Check for the declarations of free and malloc.
4208 * src/muscle_tab.c: Adjust.
4209
5ece6d43
AD
42102002-02-05 Akim Demaille <akim@epita.fr>
4211
4212 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
4213 which have no values.
4214
5bb18f9a
AD
42152002-02-05 Akim Demaille <akim@epita.fr>
4216
4217 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
4218 * data/: here.
4219
894dd62e
PE
42202002-01-29 Paul Eggert <eggert@twinsun.com>
4221
4222 * src/bison.simple (YYSIZE_T): Do not define merely because
4223 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
4224 On some platforms, <alloca.h> does not declare YYSTD (size_t).
4225
82841af7
AD
42262002-01-27 Akim Demaille <akim@epita.fr>
4227
4228 Fix `%nonassoc and eof'.
4229
4230 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
4231 which were not properly copied! Replace
4232 memcpy (res->errs, src->errs, src->nerrs);
4233 with
4234 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
4235 !!!
4236 * tests/regression.at (%nonassoc and eof): Adjust to newest
4237 Autotest: `.' is not in the PATH.
4238
318b76e9
AD
42392002-01-27 Akim Demaille <akim@epita.fr>
4240
4241 * tests/sets.at (AT_EXTRACT_SETS): New.
4242 (Nullable): Use it.
4243 (Firsts): New.
4244
30d2f3d5
AD
42452002-01-26 Akim Demaille <akim@epita.fr>
4246
4247 * tests/actions.at, tests/calc.at, tests/headers.at,
4248 * tests/torture.at: Adjust to the newest Autotest which no longer
4249 forces `.' in the PATH.
4250
30f8c395
AD
42512002-01-25 Akim Demaille <akim@epita.fr>
4252
4253 * tests/regression.at (%nonassoc and eof): New.
4254 Suggested by Robert Anisko.
4255
29ae55f1
AD
42562002-01-24 Akim Demaille <akim@epita.fr>
4257
4258 Bison dumps core when trying to complain about broken input files.
4259 Reported by Cris van Pelt.
4260
4261 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
4262 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
4263 into...
4264 (Invalid inputs): Strengthen: exercise parse_percent_token.
4265
2b548aa6
RA
42662002-01-24 Robert Anisko <robert.anisko@epita.fr>
4267
4268 * src/Makefile.am: Add bison.c++.
4269 * src/bison.c++: New skeleton.
4270
bb0146c2
AD
42712002-01-21 Paolo Bonzini <bonzini@gnu.org>
4272
4273 * po/it.po: New.
4274
bec30531
AD
42752002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
4276
4277 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
4278
fc6edc45
MA
42792002-01-20 Marc Autret <marc@gnu.org>
4280
4281 * src/files.c (compute_output_file_names): Fix
4282
5e5d5415
MA
42832002-01-20 Marc Autret <marc@gnu.org>
4284
4285 * tests/output.at: New test.
4286 * src/files.c (compute_base_names): Don't map extensions when
4287 the YACC flag is set, use defaults.
4288 Reported by Evgeny Stambulchik.
4289
44ea3fbd
MA
42902002-01-20 Marc Autret <marc@gnu.org>
4291
bb0146c2 4292 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
4293 compilers as well (i.e. the vendor C compiler).
4294 Suggested by Albert Chin-A-Young.
4295
338963d1
TVH
42962002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
4297
4298 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
4299 canonical definition.
4300 * src/system.h: Use the canonical definition for PARAMS (avoids
4301 a conflict with the macro from lib/hash.h).
4302
c57b2479
AD
43032002-01-11 Akim Demaille <akim@epita.fr>
4304
4305 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 4306 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 4307
b85810ae
AD
43082002-01-09 Akim Demaille <akim@epita.fr>
4309
4310 * src/files.c, src/files.h (output_infix): New.
4311 (tab_extension): Remove.
4312 (compute_base_names): Compute the former, drop the latter.
4313 * src/output.c (prepare): Insert the muscles `output-infix', and
4314 `output-suffix'.
4315 * src/parse-skel.y (string, string.1): New.
4316 (section.header): Use it.
4317 (section.yacc): Remove.
4318 (prefix): Remove too.
4319 * src/scan-skel.l: Adjust.
4320 * src/bison.simple, src/bison.hairy: Adjust.
4321
cae60122
AD
43222002-01-09 Akim Demaille <akim@epita.fr>
4323
4324 * configure.in (WERROR_CFLAGS): Compute it.
4325 * src/Makefile.am (CFLAGS): Pass it.
4326 * tests/atlocal.in (CFLAGS): Idem.
4327 * src/files.c: Fix a few warnings.
4328 (get_extension_index): Remove, unused.
4329
ae404801
AD
43302002-01-08 Akim Demaille <akim@epita.fr>
4331
4332 * src/getargs.c (AS_FILE_NAME): New.
4333 (getargs): Use it to convert DOSish file names.
4334 * src/files.c (base_name): Rename as full_base_name to avoid
4335 clashes with `base_name ()'.
4336 (filename_split): New.
4337 (compute_base_names): N-th rewrite, using filename_split.
4338
22312b71
AD
43392002-01-08 Akim Demaille <akim@epita.fr>
4340
4341 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
4342 New, stolen from the Fileutils 4.1.
4343 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
4344 * configure.in: Check for the presence of memrchr, and of its
4345 prototype.
4346
a67cef01
TVH
43472002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
4348
4349 * lib/hash.h (__P): Added definition for this macro.
4350 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
4351 BUILT_SOURCES, to ensure they are generated first.
4352 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
4353 %error-verbose to allow bootstrapping with bison 1.30x.
4354
2b25d624
AD
43552002-01-06 Akim Demaille <akim@epita.fr>
4356
4357 * src/reader.c (parse_braces): Don't fetch the next char, the
4358 convention is to fetch on entry.
4359 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
4360 'switch' without a following semicolon.
4361 * tests/regression.at (braces parsing): New.
4362
3460813b
AD
43632002-01-06 Akim Demaille <akim@epita.fr>
4364
4365 Bison is dead wrong in its RR conflict reports.
4366
4367 * tests/torture.at (GNU Cim Grammar): New.
4368 * src/conflicts.c (count_rr_conflicts): Fix.
4369
73784c64
AD
43702002-01-06 Akim Demaille <akim@epita.fr>
4371
4372 Creating package.m4 from configure.ac causes too many problems.
4373
4374 * tests/Makefile.am (package.m4): Create it by hand,
4375 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
4376
25d81090
AD
43772002-01-06 Akim Demaille <akim@epita.fr>
4378
4379 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
4380 skeleton.h.
4381
a9b8959e
PE
43822002-01-04 Paul Eggert <eggert@twinsun.com>
4383
4384 * doc/bison.texinfo (Debugging):
4385 Remove YYSTDERR; it's no longer defined or used.
4386 Also, s/cstdio.h/cstdio/.
4387
25d81090
AD
43882002-01-03 Akim Demaille <akim@epita.fr>
4389
4390 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
4391
1109455c
AD
43922002-01-03 Akim Demaille <akim@epita.fr>
4393
4394 * src/parse-skel.y (process_skeleton): Don't bind the parser's
4395 tracing code to --trace, wait for a better --trace option, with
4396 args.
4397
7ea5e977
AD
43982002-01-03 Akim Demaille <akim@epita.fr>
4399
4400 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
4401 The ISO C++ standard is extremely clear about it: stderr is
4402 considered a macro, not a regular symbol (see table 94 `Header
4403 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
4404 Therefore std:: does not apply to it. It still does with fprintf.
4405 Also, s/cstdio.h/cstdio/.
4406
fab5b110
AD
44072002-01-03 Akim Demaille <akim@epita.fr>
4408
4409 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
4410 for non system headers.
4411
aed7fd9b
AD
44122002-01-02 Akim Demaille <akim@epita.fr>
4413
4414 Equip the skeleton chain with location tracking, runtime trace,
4415 pure parser and scanner.
4416
4417 * src/parse-skel.y: Request a pure parser, locations, and prefix
4418 renaming.
4419 (%union): Having several members with the same type does not help
4420 type mismatches, simplify.
4421 (YYPRINT, yyprint): New.
4422 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
4423 (skel_error): this.
4424 Handle locations.
4425 * src/scan-skel.l: Adjust to these changes.
4426 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
4427 (LOCATION_PRINT, skel_control_t): New.
4428
24fad99e
AD
44292001-12-30 Akim Demaille <akim@epita.fr>
4430
4431 * src/parse-skel.y: Get rid of the shift/reduce conflict:
4432 replace `gb' with BLANKS.
4433 * src/scan-skel.l: Adjust.
4434
a4b36db4
AD
44352001-12-30 Akim Demaille <akim@epita.fr>
4436
4437 * src/system.h: We don't need nor want bcopy.
4438 Throw away MS-DOS crap: we don't need getpid.
4439 * configure.in: We don't need strndup. It was even causing
4440 problems: because Flex includes the headers *before* us,
4441 _GNU_SOURCE is not defined by config.h, and therefore strndup was
4442 not visible.
4443 * lib/xstrndup.c: New.
4444 * src/scan-skel.l: Use it.
4445 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
4446 * src/parse-skel.y: Use %directives instead of #defines.
4447
1239777d
AD
44482001-12-30 Akim Demaille <akim@epita.fr>
4449
4450 * src/skeleton.h: New.
4451 * src/output.c (output_parser, output_master_parser): Remove, dead
4452 code.
4453 * src/output.h (get_lines_number, actions_output, guards_output)
4454 (token_definitions_output): Prototype them.
4455 * src/parse-skel.y: Add the license notice.
4456 Include output.h and skeleton.h.
4457 (process_skeleton): Returns void, and takes a single parameter.
4458 * src/scan-skel.l: Add the license notice.
4459 Include skeleton.h.
4460 Don't use %option yylineno: it seems that then Flex imagines
4461 REJECT has been used, and therefore it won't reallocate its
4462 buffers (which makes no other sense to me than a bug). It results
4463 in warnings for `unused: yy_flex_realloc'.
4464
9b3add5b
RA
44652001-12-30 Robert Anisko <robert.anisko@epita.fr>
4466
4467 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
4468 (MUSCLE_INSERT_PREFIX): ...to there.
4469 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
4470 (MUSCLE_INSERT_PREFIX): Move from here...
4471
4472 * src/bison.hairy: Add a section directive. Put braces around muscle
4473 names. This parser skeleton is still broken, but Bison should not
4474 choke on a bad muscle 'syntax'.
4475 * src/bison.simple: Add a section directive. Put braces around muscle
4476 names.
4477
4478 * src/files.h (strsuffix, stringappend): Add declarations.
4479 (tab_extension): Add declaration.
4480 (short_base_name): Add declaration.
4481
4482 * src/files.c (strsuffix, stringappend): No longer static. These
4483 functions are used in the skeleton parser.
4484 (tab_extension): New.
4485 (compute_base_names): Use the computations done in this function
fab5b110 4486 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
4487 names.
4488 (short_base_name): No longer static.
4489
4490 * src/output.c (output_skeleton): New.
4491 (output): Disable call to output_master_parser, and give a try to
4492 a new skeleton handling system.
4493 (guards_output, actions_output): No longer static.
4494 (token_definitions_output, get_lines_number): No longer static.
4495
4496 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
4497
fab5b110 4498 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
4499 parse-skel.y.
4500
4501 * src/parse-skel.y: New file.
4502 * src/scan-skel.l: New file.
4503
b5b61c61
AD
45042001-12-29 Akim Demaille <akim@epita.fr>
4505
4506 %name-prefix is broken.
4507
4508 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
4509 Adjust all dependencies.
4510 * tests/headers.at (export YYLTYPE): Strengthen this test: use
4511 %name-prefix.
4512
4513 Renaming yylval but not yylloc is not consistent. Now we do.
4514
4515 * src/bison.simple: Prefix yylloc if used.
4516 * doc/bison.texinfo (Decl Summary): Document that.
4517
8c9a50be
AD
45182001-12-29 Akim Demaille <akim@epita.fr>
4519
4520 * doc/bison.texinfo: Promote `%long-directive' over
4521 `%long_directive'.
4522 Remove all references to fixed-output-files, yacc is enough.
4523
d99361e6
AD
45242001-12-29 Akim Demaille <akim@epita.fr>
4525
4526 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
4527 user prologue. These are defaults.
4528 * tests/actions.at (Mid-rule actions): Make sure the user can
4529 define YYDEBUG and YYERROR_VERBOSE.
4530
b9cecb91
AD
45312001-12-29 Akim Demaille <akim@epita.fr>
4532
4533 * src/output.c (header_output): Don't forget to export YYLTYPE and
4534 yylloc.
4535 * tests/headers.at (export YYLTYPE): New, make sure it does.
4536 * tests/regression.at (%union and --defines, Invalid CPP headers):
4537 Move to...
4538 * tests/headers.at: here.
4539
aea13e97
AD
45402001-12-29 Akim Demaille <akim@epita.fr>
4541
4542 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
4543
931394cb
AD
45442001-12-29 Akim Demaille <akim@epita.fr>
4545
4546 * tests/actions.at (Mid-rule actions): Output on a single line
4547 instead of several.
4548
704a47c4
AD
45492001-12-29 Akim Demaille <akim@epita.fr>
4550
4551 * doc/bison.texinfo: Formatting changes.
4552
091e20bb
AD
45532001-12-29 Akim Demaille <akim@epita.fr>
4554
4555 Don't store the token defs in a muscle, just be ready to output it
4556 on command. Now possible via `symbols'. Fixes a memory leak.
4557
4558 * src/output.c (token_definitions_output): New.
4559 (output_parser, header_output): Use it.
4560 * src/reader.c (symbols_save): Remove.
4561
cce71710
AD
45622001-12-29 Akim Demaille <akim@epita.fr>
4563
4564 * src/bison.simple: Do not provide a default for YYSTYPE and
4565 YYLTYPE before the user's prologue. Otherwise it's hardly... a
4566 default.
4567
82c035a8
AD
45682001-12-29 Akim Demaille <akim@epita.fr>
4569
4570 Mid-rule actions are simply... ignored!
4571
4572 * src/reader.c (readgram): Be sure to attach mid-rule actions to
4573 the empty-rule associated to the dummy symbol, not to the host
4574 rule.
4575 * tests/actions.at (Mid-rule actions): New.
4576
8419d367
AD
45772001-12-29 Akim Demaille <akim@epita.fr>
4578
4579 Memory leak.
4580
4581 * src/reader.c (reader): Free grammar.
4582
375d5806
AD
45832001-12-29 Akim Demaille <akim@epita.fr>
4584
4585 Memory leak.
4586
4587 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
4588 since it allocates it for each state, although only one is needed.
4589 (allocate_storage): Do it here.
4590
f51cb8ff
AD
45912001-12-29 Akim Demaille <akim@epita.fr>
4592
4593 * src/options.h, src/options.c (create_long_option_table): Rename
4594 as...
4595 (long_option_table_new): this, with a clearer prototype.
4596 (percent_table): Remove, unused,
4597 * src/getargs.c (getargs): Adjust.
4598
29e88316
AD
45992001-12-29 Akim Demaille <akim@epita.fr>
4600
4601 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
4602 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
4603 as states.
4604
b9f71f19
AD
46052001-12-29 Akim Demaille <akim@epita.fr>
4606
4607 * src/lalr.c (build_relations): Rename `states' as `states1'.
4608 Sorry, I don't understand exactly what it is, no better name...
4609
1a2b5d37
AD
46102001-12-29 Akim Demaille <akim@epita.fr>
4611
4612 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
4613 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
4614 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
4615 as rules.
4616
1cca533e
AD
46172001-12-29 Akim Demaille <akim@epita.fr>
4618
4619 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
4620 ago.
4621
c03ae966
AD
46222001-12-29 Akim Demaille <akim@epita.fr>
4623
4624 * src/reader.c, src/reader.h (user_toknums): Remove.
4625 Adjust all users to use symbols[i]->user_token_number.
4626
5a670b1e
AD
46272001-12-29 Akim Demaille <akim@epita.fr>
4628
4629 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
4630 Adjust all users to use symbols[i]->prec or ->assoc.
4631
ad949da9
AD
46322001-12-29 Akim Demaille <akim@epita.fr>
4633
4634 * src/reader.c, src/reader.h (tags): Remove.
4635 Adjust all users to use symbols[i]->tag.
4636
0e78e603
AD
46372001-12-29 Akim Demaille <akim@epita.fr>
4638
4639 * src/gram.h, src/gram.c (symbols): New, similar to state_table
4640 and rule_table.
4641 * src/reader.c (packsymbols): Fill this table.
4642 Drop sprec.
4643 * src/conflicts.c (resolve_sr_conflict): Adjust.
4644 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
4645 single table.
4646 Use symbols[i]->tag instead of tags[i].
4647
213e640e
AD
46482001-12-29 Akim Demaille <akim@epita.fr>
4649
4650 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
4651 In addition, put a comment in there, to replace...
4652 * tests/regression.at (%union and C comments): Remove.
4653
e7b8bef1
AD
46542001-12-29 Akim Demaille <akim@epita.fr>
4655
4656 * tests/regression.at (Web2c Actions): Blindly move the actual
4657 output as expected output. The contents *seem* right to me, but I
4658 can't pretend reading perfectly parser tables... Nonetheless, all
4659 the other tests pass correctly, the table look OK, even though the
4660 presence of `$axiom' is to be noted: AFAICS it is useless (but
4661 harmless).
4662
b68e7744
AD
46632001-12-29 Akim Demaille <akim@epita.fr>
4664
4665 * src/reader.c (readgram): Don't add the rule 0 if there were no
4666 rules read. In other words, add it _after_ having performed
4667 grammar sanity checks.
4668 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
4669
78d5bae9
AD
46702001-12-29 Akim Demaille <akim@epita.fr>
4671
4672 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
4673 visible, and some states have now a different number.
4674
ff442794
AD
46752001-12-29 Akim Demaille <akim@epita.fr>
4676
4677 * src/reader.c (readgram): Bind the initial rule's lineno to that
4678 of the first rule.
4679 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
4680 (Solved SR Conflicts): Adjust rule 0's line number.
4681
610ab194
AD
46822001-12-29 Akim Demaille <akim@epita.fr>
4683
4684 Fix the `GAWK Grammar' failure.
4685
4686 * src/LR0.c (final_state): Initialize to -1 so that we do compute
4687 the reductions of the first state which was mistakenly confused
4688 with the final state because precisely final_state was initialized
4689 to 0.
4690 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
4691 now noticed by Bison.
4692 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
4693 have a reduction on $default.
4694
29d29c8f
AD
46952001-12-29 Akim Demaille <akim@epita.fr>
4696
4697 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
4698 rule line numbers.
4699 * src/closure.c (print_closure): Likewise.
4700 * src/derives.c (print_derives): Likewise.
4701 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
4702 now.
4703
7c6b64d0
AD
47042001-12-29 Akim Demaille <akim@epita.fr>
4705
4706 * src/lalr.c (lookaheads_print): New.
4707 (lalr): Call it when --trace-flag.
4708 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
4709 are dumped.
4710
3d4daee3
AD
47112001-12-29 Akim Demaille <akim@epita.fr>
4712
4713 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
4714 when walking through ritem, even via rule->rhs.
4715 * src/reduce.c (dump_grammar, useful_production, reduce_output)
4716 (useful_production, useless_nonterminals): Likewise.
4717 (reduce_grammar_tables): Likewise, plus update nritems.
4718 * src/nullable.c (set_nullable): Likewise.
4719 * src/lalr.c (build_relations): Likewise.
4720 * tests/sets.at (Nullable): Adjust.
4721 Fortunately, now, the $axiom is no longer nullable.
4722
9e7f6bbd
AD
47232001-12-29 Akim Demaille <akim@epita.fr>
4724
4725 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
4726 the 0-sentinel.
4727 * src/gram.c (ritem_longest_rhs): Likewise.
4728 * src/reduce.c (nonterminals_reduce): Likewise.
4729 * src/print_graph.c (print_graph): Likewise.
4730 * src/output.c (output_rule_data): Likewise.
4731 * src/nullable.c (set_nullable): Likewise.
4732
255ef638
AD
47332001-12-29 Akim Demaille <akim@epita.fr>
4734
4735 * src/output.c: Comment changes.
4736
0d8a7363
AD
47372001-12-27 Paul Eggert <eggert@twinsun.com>
4738
4739 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
4740 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
4741 Sparc, as they were causing more porting problems than the
4742 (minor) performance improvement was worth.
4743
4744 Also, catch up with 1.31's YYSTD.
4745
3db472b9
AD
47462001-12-27 Akim Demaille <akim@epita.fr>
4747
4748 * src/output.c (output_gram): Rely on nritems, not the
4749 0-sentinel. See below.
4750 Use -1 as separator, not 0.
4751 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
4752 Rely on -1 as separator in yyrhs, instead of 0.
4753 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
4754 twice `Now at end of input', therefore there are two lines less to
4755 expect.
4756
b365aa05
AD
47572001-12-27 Akim Demaille <akim@epita.fr>
4758
4759 * tests/regression.at (Unresolved SR Conflicts):
4760 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
4761 below.
4762
30171f79
AD
47632001-12-27 Akim Demaille <akim@epita.fr>
4764
4765 * src/LR0.c (new_state): Recognize the final state by the fact it
4766 is reached by eoftoken.
4767 (insert_start_shifting_state, insert_eof_shifting_state)
4768 (insert_accepting_state, augment_automaton): Remove, since now
4769 these states are automatically computed from the initial state.
4770 (generate_states): Adjust.
4771 * src/print.c: When reporting a rule number to the user, substract
4772 1, so that the axiom rule is rule 0, and the first user rule is 1.
4773 * src/reduce.c: Likewise.
4774 * src/print_graph.c (print_core): For the time being, just as for
4775 the report, depend upon --trace-flags to dump the full set of
4776 items.
4777 * src/reader.c (readgram): Once the grammar read, insert the rule
4778 0: `$axiom: START-SYMBOL $'.
4779 * tests/set.at: Adjust: rule 0 is now displayed, and since the
4780 number of the states has changed (the final state is no longer
4781 necessarily the last), catch up.
4782
75142d45
AD
47832001-12-27 Akim Demaille <akim@epita.fr>
4784
4785 Try to make the use of the eoftoken valid. Given that its value
4786 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
4787 is used instead of > 0 where appropriate, (ii), depend upon nritems
4788 instead of the 0-sentinel.
4789
4790 * src/gram.h, src/gram.c (nritems): New.
4791 Expected to be duplication of nitems, but for the time being...
4792 * src/reader.c (packgram): Assert nritems and nitems are equal.
4793 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
4794 * src/closure.c (print_closure, print_fderives): Likewise.
4795 * src/gram.c (ritem_print): Likewise.
4796 * src/print.c (print_core, print_grammar): Likewise.
4797 * src/print_graph.c: Likewise.
4798
b7c49edf
AD
47992001-12-27 Akim Demaille <akim@epita.fr>
4800
4801 * src/main.c (main): If there are complains after grammar
4802 reductions, then output the report anyway if requested, then die.
4803 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
4804 * src/reader.c (eoftoken): New.
4805 (parse_token_decl): If the token being defined has value `0', it
4806 is the eoftoken.
4807 (packsymbols): No longer hack `tags' to insert `$' by hand.
4808 Be sure to preserve the value of the eoftoken.
4809 (reader): Make sure eoftoken is defined.
4810 Initialize nsyms to 0: now eoftoken is created just like the others.
4811 * src/print.c (print_grammar): Don't special case the eof token.
4812 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
4813 lie anyway, albeit pleasant.
4814 * tests/calc.at: Exercise error messages with eoftoken.
4815 Change the grammar so that empty input is invalid.
4816 Adjust expectations.
4817 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
4818
ec2da99f
AD
48192001-12-27 Akim Demaille <akim@epita.fr>
4820
4821 * configure.in: Check the protos of strchr ans strspn.
4822 Replace strchr if needed.
4823 * src/system.h: Provide the protos of strchr, strspn and memchr if
4824 missing.
4825 * lib/strchr.c: New.
4826 * src/reader.c (symbols_save): Use strchr.
4827
8adfa272
AD
48282001-12-27 Akim Demaille <akim@epita.fr>
4829
4830 * src/print.c, src/print_graph.c (escape): New.
4831 Use it to quote the TAGS outputs.
4832 * src/print_graph.c (print_state): Now errors are in red, and
4833 reductions in green.
4834 Prefer high to wide: output the state number on a line of its own.
4835
80dac38c
AD
48362001-12-27 Akim Demaille <akim@epita.fr>
4837
4838 * src/state.h, src/state.c (reductions_new): New.
4839 * src/LR0.c (set_state_table): Let all the states have a
4840 `reductions', even if reduced to 0.
4841 (save_reductions): Adjust.
4842 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
4843 * src/print.c (print_reductions, print_actions): Adjust.
4844 * src/output.c (action_row): Adjust.
4845
2cec70b9
AD
48462001-12-27 Akim Demaille <akim@epita.fr>
4847
4848 * src/state.h, src/state.c (errs_new, errs_dup): New.
4849 * src/LR0.c (set_state_table): Let all the states have an errs,
4850 even if reduced to 0.
4851 * src/print.c (print_errs, print_reductions): Adjust.
4852 * src/output.c (output_actions, action_row): Adjust.
4853 * src/conflicts.c (resolve_sr_conflict): Adjust.
4854
13ca549a
AD
48552001-12-27 Akim Demaille <akim@epita.fr>
4856
4857 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
4858
5092aba5
AD
48592001-12-27 Akim Demaille <akim@epita.fr>
4860
4861 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
4862 * src/print.c: here.
4863 (lookaheadset, shiftset): New, used as additional storage by
4864 print_reductions.
4865 (print_results): Adjust.
4866 (print_shifts, print_gotos, print_errs): New, extracted from...
4867 (print_actions): here.
4868 * src/print_graph.c (print_actions): Remove dead code.
4869
11e2beca
AD
48702001-12-27 Akim Demaille <akim@epita.fr>
4871
4872 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
4873 `$n' and `@n'.
4874
dac3c910
AD
48752001-12-27 Akim Demaille <akim@epita.fr>
4876
4877 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
4878 (build_relations): Adjust.
4879
d0b0fefa
AD
48802001-12-27 Akim Demaille <akim@epita.fr>
4881
4882 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
4883 duplication.
4884
adc8c848
AD
48852001-12-27 Akim Demaille <akim@epita.fr>
4886
4887 * src/reader.c (packgram): Catch nitems overflows.
4888
14d293ac
AD
48892001-12-27 Akim Demaille <akim@epita.fr>
4890
4891 * src/files.c, src/files.h (guard_obstack): Remove.
4892 * src/output.c (output): Adjust.
4893 * src/reader.c (parse_braces): New, factoring...
4894 (copy_action, copy_guard): these two which are renamed as...
4895 (parse_action, parse_guard): these.
4896 As a voluntary consequence, using braces around guards is now
4897 mandatory.
4898
f499b062
AD
48992001-12-27 Akim Demaille <akim@epita.fr>
4900
4901 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
4902 * src/reader.c (symbol_list): `guard' and `guard_line' are new
4903 members.
4904 (symbol_list_new): Adjust.
4905 (copy_action): action_line is the first line, not the last.
4906 (copy_guard): Just as for actions, store the `action' only, not
4907 the switch/case/break flesh.
4908 Don't parse the user action that might follow the guard, let...
4909 (readgram): do it, i.e., now, there can be an action after a
4910 guard.
4911 In other words the guard is just explicitly optional.
4912 (packgram): Adjust.
4913 * src/output.c (guards_output): New.
4914 (output_parser): Call it when needed.
4915 (output): Also free the guard and attrs obstacks.
4916 * src/files.c, src/files.h (obstack_save): Remove.
4917 (output_files): Remove.
4918 As a result, if one needs the former `.act' file, using an
4919 appropriate skeleton which requires actions and guards is now
4920 required.
4921 * src/main.c (main): Adjust.
4922 * tests/semantic.at: New.
4923 * tests/regression.at: Use `input.y' as input file name.
4924 Avoid 8+3 problems by requiring input.c when the test needs the
4925 parser.
4926
d945f5cd
AD
49272001-12-27 Akim Demaille <akim@epita.fr>
4928
4929 * src/reader.c (symbol_list_new): Be sure to initialize all the
4930 fields.
4931
d200e455
AD
49322001-12-27 Akim Demaille <akim@epita.fr>
4933
4934 All the hacks using a final pseudo state are now useless.
4935
4936 * src/LR0.c (set_state_table): state_table holds exactly nstates.
4937 * src/lalr.c (nLA): New.
4938 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
4939 instead of lookaheadsp from the pseudo state (nstate + 1).
4940
f9507c28
AD
49412001-12-27 Akim Demaille <akim@epita.fr>
4942
4943 * src/output.c (action_row, token_actions): Use a state_t instead
4944 of a integer, and nlookaheads instead of the following state's
4945 lookaheadsp.
4946
065fbd27
AD
49472001-12-27 Akim Demaille <akim@epita.fr>
4948
4949 * src/conflicts.c (log_resolution, flush_shift)
4950 (resolve_sr_conflict, set_conflicts, solve_conflicts)
4951 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
4952 (conflicts_print, print_reductions): Use a state_t instead of an
4953 integer when referring to a state.
4954 As much as possible, depend upon nlookaheads, instead of the
4955 `lookaheadsp' member of the following state (since lookaheads of
4956 successive states are successive, the difference between state n + 1
4957 and n served as the number of lookaheads for state n).
4958 * src/lalr.c (add_lookback_edge): Likewise.
4959 * src/print.c (print_core, print_actions, print_state)
4960 (print_results): Likewise.
4961 * src/print_graph.c (print_core, print_actions, print_state)
4962 (print_graph): Likewise.
4963 * src/conflicts.h: Adjust.
4964
1b177bd7
AD
49652001-12-27 Akim Demaille <akim@epita.fr>
4966
4967 * src/bison.hairy: Formatting/comment changes.
4968 ANSIfy.
4969 Remove `register' indications.
4970 Add plenty of `static'.
4971
7742ddeb
AD
49722001-12-27 Akim Demaille <akim@epita.fr>
4973
4974 * src/output.c (prepare): Drop the muscle `ntbase' which
4975 duplicates ntokens.
4976 * src/bison.simple: Formatting/comment changes.
4977 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
4978 is an undocumented synonym.
4979
1fa14068
AD
49802001-12-22 Akim Demaille <akim@epita.fr>
4981
4982 * src/output.c (output_table_data): Change the prototype to use
4983 `int' for array ranges: some invocations do pass an int, not a
4984 short.
4985 Reported by Wayne Green.
4986
b9752825
AD
49872001-12-22 Akim Demaille <akim@epita.fr>
4988
4989 Some actions of web2c.y are improperly triggered.
4990 Reported by Mike Castle.
4991
4992 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
4993 * tests/regression.at (Web2c): Rename as...
4994 (Web2c Report): this.
4995 (Web2c Actions): New.
4996
776209d6
AD
49972001-12-22 Akim Demaille <akim@epita.fr>
4998
4999 Reductions in web2c.y are improperly reported.
5000 Reported by Mike Castle.
5001
5002 * src/conflicts.c (print_reductions): Fix.
5003 * tests/regression.at (Web2c): New.
5004
275fc3ad
AD
50052001-12-18 Akim Demaille <akim@epita.fr>
5006
5007 Some host fail on `assert (!"foo")', which expands to
5008 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
5009 Reported by Nelson Beebee.
5010
5011 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
5012 `#define it_succeeded 0' and `assert (it_succeeded)'.
5013
897668ee
MA
50142001-12-17 Marc Autret <autret_m@epita.fr>
5015
5016 * src/bison.simple: Don't hard code the skeleton line and filename.
5017 * src/output.c (output_parser): Rename 'line' as 'output_line'.
5018 New line counter 'skeleton_line' (skeleton-line muscle).
5019
ab3399e0
PE
50202001-12-17 Paul Eggert <eggert@twinsun.com>
5021
5022 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
5023 YYDEBUG must be defined to a nonzero value.
5024
5025 * src/bison.simple (yytname): Do not assume that the user defines
5026 YYDEBUG to a properly parenthesized expression.
5027
3877f72b
AD
50282001-12-17 Akim Demaille <akim@epita.fr>
5029
5030 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
5031 nlookaheads is a new member.
5032 Adjust all users.
5033 * src/lalr.h (nlookaheads): Remove this orphan declaration.
5034 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
5035 state.
776209d6 5036
331dbc1b
AD
50372001-12-17 Akim Demaille <akim@epita.fr>
5038
5039 * src/files.h, src/files.c (open_files, close_files): Remove.
5040 * src/main.c (main): Don't open/close files, nor invoke lex_free,
5041 let...
5042 * src/reader.c (reader): Do it.
776209d6 5043
be750e4c
AD
50442001-12-17 Akim Demaille <akim@epita.fr>
5045
5046 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 5047
709ae8c6
AD
50482001-12-17 Akim Demaille <akim@epita.fr>
5049
5050 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
5051 (flush_reduce): New.
5052 (resolve_sr_conflict): Adjust.
776209d6 5053
f87685c3
AD
50542001-12-17 Akim Demaille <akim@epita.fr>
5055
5056 * src/output.c (output_obstack): Be static and rename as...
5057 (format_obstack): this, to avoid any confusion with files.c's
5058 output_obstack.
5059 * src/reader.h (muscle_obstack): Move to...
5060 * src/output.h: here, since it's defined in output.c.
5061
837491d8
AD
50622001-12-17 Akim Demaille <akim@epita.fr>
5063
5064 * src/output.c (action_row, save_column, default_goto)
5065 (sort_actions, matching_state, pack_vector): Better variable
5066 locality.
5067
796d61fb
AD
50682001-12-17 Akim Demaille <akim@epita.fr>
5069
5070 * src/output.c: Various formatting changes.
776209d6 5071
64d15509
AD
50722001-12-17 Akim Demaille <akim@epita.fr>
5073
5074 * src/files.c (output_files): Free the output_obstack.
5075 * src/main.c (main): Call print and print_graph conditionally.
5076 * src/print.c (print): Work unconditionally.
5077 * src/print_graph.c (print_graph): Work unconditionally.
5078 * src/conflicts.c (log_resolution): Output only if verbose_flag.
5079
fbc8ecb7
MA
50802001-12-16 Marc Autret <autret_m@epita.fr>
5081
5082 * src/output.c (actions_output): Fix. When we use %no-lines,
5083 there is one less line per action.
5084
f0440388
MA
50852001-12-16 Marc Autret <autret_m@epita.fr>
5086
5087 * src/bison.simple: Remove a useless #line directive.
5088 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
5089 * src/output.c (get_lines_number): New.
776209d6 5090 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
5091 output muscles.
5092 Fix line numbering.
5093 (actions_output): Computes the number of lines taken by actions.
5094 (output_master_parser): Insert new skeleton which is the name of
5095 the output parser file name.
5096
a79986b8
MA
50972001-12-15 Marc Autret <autret_m@epita.fr>
5098
5099 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
5100
4ec8e00f
MA
51012001-12-15 Marc Autret <autret_m@epita.fr>
5102
5103 * src/output.c (output_gram): Keep track of the hairy one.
5104
1a4648ff
AD
51052001-12-15 Akim Demaille <akim@epita.fr>
5106
5107 Make `make distcheck' work.
5108
5109 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
5110 system.h which uses libgettext.h.
5111
9c2c67e6
AD
51122001-12-15 Akim Demaille <akim@epita.fr>
5113
5114 * src/nullable.c (set_nullable): Useless rules must be skipped,
5115 otherwise, since we range over their symbols, we might look at a
5116 nonterminal which no longer ``exists'', i.e., it is not counted in
5117 `nvars', hence we overflow our arrays.
5118
93ede233
AD
51192001-12-15 Akim Demaille <akim@epita.fr>
5120
5121 The header can also be produced directly, without any obstack!
5122 Yahoo!
5123
5124 * src/files.c, src/files.h (defines_obstack): Remove.
5125 (compute_header_macro): Global.
5126 (defines_obstack_save): Remove.
5127 * src/reader.c (parse_union_decl): No longer output to
5128 defines_obstack: its content can be found in the `stype' muscle
5129 anyway.
5130 (output_token_translations): Merge into...
5131 (symbols_output): this.
5132 Rename as...
5133 (symbols_save): this.
5134 (reader): Adjust.
5135 * src/output.c (header_output): New.
5136 (output): Call it.
5137
2666f928
AD
51382001-12-15 Akim Demaille <akim@epita.fr>
5139
5140 * src/reader.c (parse_union_decl): Instead of handling two obstack
5141 simultaneously, use one to define the `stype' muscle, and use the
5142 value of the latter to fill defines_obstack.
5143 (copy_comment): Remove.
5144 (copy_comment2): Work for a single obstack.
5145 Rename as...
5146 (copy_comment): this.
5147
428046f8
AD
51482001-12-15 Akim Demaille <akim@epita.fr>
5149
5150 * src/lex.c, src/lex.h (xgetc): No longer static.
5151 * src/reader.c (parse_union_decl): Revamp.
5152
ea52d706
AD
51532001-12-15 Akim Demaille <akim@epita.fr>
5154
5155 Still making progress in separating Bison into (i) input, (ii)
5156 process, (iii) output: now we can directly output the parser file
5157 without using table_obstack at all.
5158
5159 * src/files.c, src/files.h (table_obstack): Bye bye.
5160 (parser_file_name): New.
5161 * src/files.c (compute_output_file_names): Compute it.
5162 * src/output.c (actions_output, output_parser)
5163 (output_master_parser): To a file instead of an obstack.
5164
3f96f4dc
AD
51652001-12-15 Akim Demaille <akim@epita.fr>
5166
5167 Attach actions to rules, instead of pre-outputting them to
5168 actions_obstack.
5169
5170 * src/gram.h (rule_t): action and action_line are new members.
5171 * src/reader.c (symbol_list): Likewise.
5172 (copy_action): Save the actions within the rule.
5173 (packgram): Save them in rule_table.
5174 * src/output.c (actions_output): New.
5175 (output_parser): Use it on `%%actions'.
5176 (output_rule_data): Don't free rule_table.
5177 (output): Do it.
5178 (prepare): Don't save the `action' muscle.
5179 * src/bison.simple: s/%%action/%%actions/.
5180
51576fb3
AD
51812001-12-15 Akim Demaille <akim@epita.fr>
5182
5183 * src/reader.c (copy_action): When --yacc, don't append a `;'
5184 to the user action: let it fail if lacking.
dee049eb 5185 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 5186
2648a72d
AD
51872001-12-14 Akim Demaille <akim@epita.fr>
5188
5189 * src/lex.c (literalchar): Simply return the char you decoded, non
5190 longer mess around with obstacks and int pointers.
5191 Adjust all callers.
5192
92790e5b
AD
51932001-12-14 Akim Demaille <akim@epita.fr>
5194
5195 * src/lex.c (literalchar): Don't escape the special characters,
5196 just decode them, and keep them as char (before, eol was output as
5197 the 2 char string `\n' etc.).
5198 * src/output.c (output_rule_data): Use quotearg to output the
5199 token strings.
5200
927c1557
PE
52012001-12-13 Paul Eggert <eggert@twinsun.com>
5202
5203 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
5204 Do not infringe on the global user namespace when using C++.
5205 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
5206 All uses of `fprintf' and `stderr' changed.
5207
5208 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
5209
ed8e1f68
AD
52102001-12-13 Akim Demaille <akim@epita.fr>
5211
5212 The computation of nullable is broken: it doesn't handle empty
5213 RHS's properly.
5214
5215 * tests/torture.at (GNU AWK Grammar): New.
5216 * tests/sets.at (Nullable): New.
5217 * src/nullable.c (set_nullable): Instead of blindly looping over
5218 `ritems', loop over the rules, and then over their rhs's.
5219
5220 Work around Autotest bugs.
5221
5222 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
5223 frame, because Autotest understand lines starting with a `+' as
5224 traces from the shell. Then, they are not processed properly.
5225 Admittedly an Autotest bug, but we don't have time to wait for
5226 Autotest to catch up.
5227 * tests/regression.at (Broken Closure): Adjust to the new table
5228 frames.
5229 Move to...
5230 * tests/sets.at: here.
5231
cb581495
AD
52322001-12-13 Akim Demaille <akim@epita.fr>
5233
5234 * src/closure.c (closure): Use nrules instead of playing tricks
5235 with BITS_PER_WORD.
5236
2e729273
AD
52372001-12-13 Akim Demaille <akim@epita.fr>
5238
5239 * src/print.c (print_actions): Output the handling of `$' as the
5240 traces do: shifting the token EOF. Before EOF was treated as a
5241 nonterminal.
5242 * tests/regression.at: Adjust some tests.
5243 * src/print_graph.c (print_core): Complete the set of items via
5244 closure. The next-to-final and final states are still unsatisfying,
5245 but that's to be addressed elsewhere.
5246 No longer output the rule numbers, but do output the state number.
5247 A single loop for the shifts + gotos is enough, but picked a
5248 distinct color for each.
5249 (print_graph): Initialize and finalize closure.
5250
107f7dfb
AD
52512001-12-13 Akim Demaille <akim@epita.fr>
5252
5253 * src/reader.c (readgram): Remove dead code, an strip useless
5254 braces.
5255 (get_type): Remove, unused.
5256
9b53a24f
AD
52572001-12-12 Akim Demaille <akim@epita.fr>
5258
5259 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
5260 on that of lib/error.c.
5261
dbfb6dcd
AD
52622001-12-12 Akim Demaille <akim@epita.fr>
5263
5264 Some hosts don't like `/' in includes.
5265
5266 * src/system.h: Include libgettext.h without qualifying the path.
5267 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
5268 $(top_srcdir).
5269
c25fb648
MA
52702001-12-11 Marc Autret <autret_m@epita.fr>
5271
5272 * src/output.c (output_parser): Remove useless muscle.
5273
710ddc4f
MA
52742001-12-11 Marc Autret <autret_m@epita.fr>
5275
5276 * src/bison.simple: Remove #line just before %%epilogue. It
5277 is now handled in ...
5278 * src/reader.c (read_additionnal_code): Add the output of a
5279 #line for the epilogue.
5280
e83d80b8
MA
52812001-12-10 Marc Autret <autret_m@epita.fr>
5282
927c1557 5283 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
5284 replace precedent remove.
5285 * src/bison.simple: Remove #line before %%prologue because
5286 %%input-line is wrong at this time.
5287
971d5158
MA
52882001-12-10 Marc Autret <autret_m@epita.fr>
5289
5290 * src/reader.c (symbols_output): Clean up.
927c1557 5291 * src/output.c (output_gram, output): Clean up.
971d5158 5292
5edafffd
AD
52932001-12-10 Akim Demaille <akim@epita.fr>
5294
5295 * src/lalr.c (initialize_lookaheads): New. Extracted from...
5296 * src/LR0.c (set_state_table): here.
5297 * src/lalr.c (lalr): Call it.
5298
0279f8e9
AD
52992001-12-10 Akim Demaille <akim@epita.fr>
5300
5301 * src/state.h (shifts): Remove the `number' member: shifts are
5302 attached to state, hence no longer need to be labelled with a
5303 state number.
5304
190c4f5f
AD
53052001-12-10 Akim Demaille <akim@epita.fr>
5306
5307 Now that states have a complete set of members, the linked list of
5308 shifts is useless: just fill directly the state's shifts member.
5309
5310 * src/state.h (shifts): Remove the `next' member.
5311 * src/LR0.c (first_state, last_state): Remove.
5312 Adjust the callers.
5313 (augment_automaton): Don't look for the shifts that must be added
5314 a shift on EOF: it is those of the state we looked for! But now,
5315 since shifts are attached, it is no longer needed to looking
5316 merely by its id: its number.
5317
2a73b93d
AD
53182001-12-10 Akim Demaille <akim@epita.fr>
5319
5320 * src/LR0.c (augment_automaton): Better variable locality.
5321 Remove an impossible branch: if there is a state corresponding to
5322 the start symbol being shifted, then there is shift for the start
5323 symbol from the initial state.
5324
74392f6a
AD
53252001-12-10 Akim Demaille <akim@epita.fr>
5326
5327 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
5328 only when appropriate: when insert_start_shifting_state' is not
5329 invoked.
5330 * tests/regression.at (Rule Line Numbers): Adjust.
5331
37c82725
AD
53322001-12-10 Akim Demaille <akim@epita.fr>
5333
5334 * src/LR0.c (augment_automaton): Now that all states have shifts,
5335 merge the two cases addition shifts to the initial state.
5336
6a164e0c
AD
53372001-12-10 Akim Demaille <akim@epita.fr>
5338
5339 * src/lalr.c (set_state_table): Move to...
5340 * src/LR0.c: here.
5341 * src/lalr.c (lalr): Don't call it...
5342 * src/LR0.c (generate_states): do it.
5343 * src/LR0.h (first_state): Remove, only the table is used.
5344
7215de24
AD
53452001-12-10 Akim Demaille <akim@epita.fr>
5346
5347 * src/LR0.h (first_shift, first_reduction): Remove.
5348 * src/lalr.c: Don't use first_shift: find shifts through the
5349 states.
5350
80e25d4d
AD
53512001-12-10 Akim Demaille <akim@epita.fr>
5352
5353 * src/LR0.c: Attach shifts to states as soon as they are
5354 computed.
5355 * src/lalr.c (set_state_table): Instead of assigning shifts to
5356 state, just assert that the mapping was properly done.
5357
0ab3728b
AD
53582001-12-10 Akim Demaille <akim@epita.fr>
5359
5360 * src/LR0.c (insert_start_shift): Rename as...
5361 (insert_start_shifting_state): this.
5362 (insert_eof_shifting_state, insert_accepting_state): New.
5363 (augment_automaton): Adjust.
5364 Better locality of the variables.
5365 When looking if the start_symbol is shifted from the initial
5366 state, using `while (... symbol != start_symbol ...)' sounds
5367 better than `while (... symbol < start_symbol ...)': If fail
5368 to see how the order between symbols could be relevant!
5369
78af9bbc
AD
53702001-12-10 Akim Demaille <akim@epita.fr>
5371
5372 * src/getargs.h: Don't declare `spec_name_prefix' and
5373 `spec_file_prefix', declared by src/files.h.
5374 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
5375 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
5376 * src/output.c (prepare): Adjust.
5377 * src/reader.c (symbols_output): Likewise.
5378 * src/vmsgetargs.c: Vaguely adjust, but who cares?
5379
bdef2a41
AD
53802001-12-10 Akim Demaille <akim@epita.fr>
5381
5382 * src/muscle_tab.c (muscle_init): NULL is a better default than
5383 `"0"'.
5384
3735969c
AD
53852001-12-10 Akim Demaille <akim@epita.fr>
5386
5387 * src/reader.c (reader): Calling symbols_output once is enough.
5388
49701457
AD
53892001-12-10 Akim Demaille <akim@epita.fr>
5390
5391 Now that states have a complete set of members, the linked list of
5392 reductions is useless: just fill directly the state's reductions
5393 member.
5394
5395 * src/state.h (struct reductions): Remove member `number' and
5396 `next'.
5397 * src/LR0.c (first_reduction, last_reduction): Remove.
5398 (save_reductions): Don't link the new reductions, store them in
5399 this_state.
5400 * src/lalr.c (set_state_table): No need to attach reductions to
5401 states, it's already done.
5402 * src/output.c (output_actions): No longer free the shifts, then
5403 the reductions, then the states: free all the states and their
5404 members.
5405
0edad749
AD
54062001-12-10 Akim Demaille <akim@epita.fr>
5407
5408 * src/options.c (OPTN, DRTV, BOTH): New.
5409 (option_table): Use them.
5410
0edad749
AD
5411 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
5412 the job of system.h.
5413 * src/options.c: Don't include stdio.h and xalloc.h for the same
5414 reasons.
5415
5449dd0f
AD
54162001-12-10 Akim Demaille <akim@epita.fr>
5417
5418 * src/output.c (output, prepare): Make sure the values of the
5419 muscles `action' and `prologue' are 0-terminated.
5420
a870c567
AD
54212001-12-10 Akim Demaille <akim@epita.fr>
5422
5423 Clean up GCC warnings.
5424
5425 * src/reader.c (copy_action): `buf' is not used.
5426 (parse_skel_decl): Be static.
5427 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
5428 * src/options.h (create_long_option_table): Have a real prototype.
5429 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
5430 (hash_delete_at): Return const void *.
5431 Adjust casts to preserve the const.
5432
80df8768
AD
54332001-12-10 Akim Demaille <akim@epita.fr>
5434
5435 * configure.in: Require 2.52g.
5436 M4 is not needed, but AUTOM4TE is.
5437 * m4/m4.m4: Remove.
5438 * tests/Makefile.am: Adjust.
5439
f693ad14
AD
54402001-12-10 Akim Demaille <akim@epita.fr>
5441
5442 One structure for states is enough, even though theoretically
5443 there are LR(0) states and LALR(1) states.
5444
5445 * src/lalr.h (state_t): Remove.
5446 (state_table): Be state_t **, not state_t *.
5447 * src/state.h (core, CORE_ALLOC): Rename as...
5448 (state_t, STATE_ALLOC): this.
5449 Add the LALR(1) members: shifts, reductions, errs.
5450 * src/LR0.c (state_table): Rename as...
5451 (state_hash): this, to avoid name clashes with the global
5452 `state_table'.
5453 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
5454 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
5455
74ffbcb6
AD
54562001-12-10 Akim Demaille <akim@epita.fr>
5457
5458 Bison dumps core on bash.y.
5459 Reported by Pascal Bart.
5460
5461 * src/warshall.c (bitmatrix_print): New.
5462 (TC): Use it.
5463 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
5464 j must be the outer loop.
5465 * tests/regression.at (Broken Closure): New.
5466
07708e19
AD
54672001-12-05 Akim Demaille <akim@epita.fr>
5468
5469 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
5470 its argument.
5471