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