]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* data/yacc.c: Avoid over-quoting of __line__ and __file__.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-11-16 Paul Eggert <eggert@twinsun.com>
2
3 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
4
52002-11-15 Paul Eggert <eggert@twinsun.com>
6
7 * tests/actions.at (Actions after errors): New test case.
8
9 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
11 tests/action.at, tests/calc.at, tests/conflicts.at,
12 tests/cxx-type.at, tests/regression.at:
13 "parse error" -> "syntax error" for POSIX compatibility.
14 "parsing stack overflow..." -> "parser stack overflow" so
15 that code matches Bison documentation.
16
172002-11-15 Akim Demaille <akim@epita.fr>
18
19 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
20 take two BRACED_CODE, not two string_content.
21 Free the scanner's obstack when we are done.
22 (code_content): New.
23 * tests/calc.at: Adjust.
24 * doc/bison.texinfo: Adjust.
25 Also, make sure to include the `,' for these declarations.
26
272002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
28
29 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
30 definition; avoids potential autoreconf problems.
31
322002-11-15 Akim Demaille <akim@epita.fr>
33
34 Always check the value returned by yyparse.
35
36 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
37 returned by yyparse.
38 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
39 Adjust calls.
40 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
41 returned by yyparse.
42
432002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
44
45 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
46 on input.at test.
47
482002-11-14 Paul Eggert <eggert@twinsun.com>
49
50 * src/output.c (output_skeleton): Call xfopen instead of
51 duplicating xfopen's body.
52
53 Fix bugs reported by Nelson H. F. Beebe in
54 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001893.html>.
55
56 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
57 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
58 Group compiler. Instead, use "$CC -E bar.c". Include the .h
59 file twice in the grammar, as an extra check.
60
61 * tests/input.at (Torturing the Scanner): Surround the
62 backslash-newline tests with "#if 0", to make it less likely that
63 we'll run into compiler bugs. Bring back solitary \ inside
64 comment, but add a closing comment to work around HP C bug. Don't
65 test backslash-newline in C character constant. This should fix
66 the input.at bug reported by Nelson H. F. Beebe in
67 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001893.html>.
68
692002-11-14 Akim Demaille <akim@epita.fr>
70
71 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
72 status of the compiler.
73 Calling `exit 1' is no longer needed.
74 Reported by Nelson H. F. Beebe.
75
762002-11-14 Akim Demaille <akim@epita.fr>
77
78 * tests/atlocal.in (CPPFLAGS): We have config.h.
79 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
80 New.
81 * tests/actions.at, tests/calc.at, tests/conflicts.at,
82 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
83 * tests/regression.at, tests/torture.at: Use them for all the
84 grammars that are to be compiled.
85 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
86 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
87 * doc/bison.texinfo (GLR Parsers): Document `inline'.
88
892002-11-14 Akim Demaille <akim@epita.fr>
90
91 * doc/bison.texinfo: Various formatting changes (alignments in
92 samples, additional @group/@end group, GCS in samples.
93 Use @deffn instead of simple @table to define the directives,
94 macros, variables etc.
95
962002-11-13 Paul Eggert <eggert@twinsun.com>
97
98 Fix some bugs reported by Albert Chin-A-Young in
99 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001881.html>.
100
101 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
102 -o c"; the HP C compiler chatters during compilation.
103 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
104 * tests/headers.at (export YYLTYPE): Likewise.
105
106 * tests/input.at (Torturing the Scanner): Remove lines containing
107 solitary backslashes, as they tickle a bug in the HP C compiler.
108
109 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
110 comments, since they're not portable. Use GNU coding style.
111
1122002-11-13 Akim Demaille <akim@epita.fr>
113
114 * data/yacc.c: Leave bigger chunks of quoted text.
115 (YYDSYMPRINTF): New.
116 Use it to report symbol activities.
117 * data/glr.c (YYDSYMPRINTF): New.
118 Use it.
119
1202002-11-12 Paul Eggert <eggert@twinsun.com>
121
122 Version 1.75b.
123
124 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
125 (yyglrReduce): Return yyok, not 0.
126 This should avoid the enumerated-type warnings reported
127 by Nelson H.F. Beebe in
128 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001872.html>.
129
130 * lib/bbitset.h (BITSET_INLINE): Remove.
131 * lib/bitset.h [! BITSET_INLINE]: Remove.
132 (bitset_set, bitset_reset, bitset_test): Rename local vars
133 to avoid shadowing warnings by GCC.
134
135 * data/glr.c (inline): Remove #define. It's the user's
136 responsibility to #define it away, just like 'const'.
137 This fixes one of the bugs reported by Nelson H.F. Beebe in
138 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001873.html>.
139
140 * Makefile.maint (po-check): Scan .l and .y files instead of the
141 .c and the .h files that they generate. This fixes the bug
142 reported by Tim Van Holder in:
143 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
144 Look for N_ as well as for _. Try to avoid matching #define for
145 N_ and _.
146 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
147 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
148 * src/scan-gram.l: Revamp regular expressions so that " and '
149 do not confuse xgettext.
150
151 * src/struniq.h (struniq_new): Do not declare the return type
152 to be 'const'; this violates the C standard.
153 * src/struniq.c (struniq_new): Likewise.
154
1552002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
156
157 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
158 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
159 linker.
160
1612002-11-12 Akim Demaille <akim@epita.fr>
162
163 * Makefile.maint: Sync with Autoconf:
164 (local_updates): New.
165
1662002-11-12 Akim Demaille <akim@epita.fr>
167
168 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
169
1702002-11-12 Akim Demaille <akim@epita.fr>
171
172 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
173 locations.
174
1752002-11-12 Akim Demaille <akim@epita.fr>
176
177 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
178 not yyvalue.
179
1802002-11-12 Akim Demaille <akim@epita.fr>
181
182 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
183 Use it to test the GLR parser.
184
1852002-11-12 Akim Demaille <akim@epita.fr>
186
187 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
188 defines it.
189 * data/glr.c (yystos): New.
190 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
191 (YYDSYMPRINT): New.
192 (yyval): Don't define it, it is handled via M4.
193 (yyrecoverParseError): Free verbosely the discarded symbols.
194 * data/yacc.c (yysymprint): Remove, rather...
195 (b4_yysymprint_generate): invoke.
196 * data/c.m4 (b4_yysymprint_generate): New.
197 Accept pointers as arguments, as opposed to the version from
198 yacc.c.
199 (b4_yydestruct_generate): Likewise.
200 * tests/cations.at (Printers and Destructors): Use Bison directives
201 instead of CPP macros.
202 Don't rely on internal details.
203
2042002-11-12 Akim Demaille <akim@epita.fr>
205
206 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
207 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
208 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
209 it against YYEMPTY and so forth), work on yytoken (i.e., set
210 it to YYEMPTY etc.).
211 (yydestruct): Replace with a b4_yydestruct_generate invocation.
212 (b4_symbol_actions): Remove.
213 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
214 for 0, end-of-input.
215
2162002-11-12 Akim Demaille <akim@epita.fr>
217
218 * doc/bison.texinfo (Destructor Decl): New.
219
2202002-11-12 Akim Demaille <akim@epita.fr>
221
222 * src/tables.c (tables_generate): Use free for pointers that
223 cannot be NULL, not XFREE.
224 (pack_vector): Use assert, not fatal, for bound violations.
225 * src/state.c (state_new): Likewise.
226 * src/reader.c (reader): Likewise.
227 * src/lalr.c (set_goto_map): Likewise.
228 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
229 the file name.
230
2312002-11-12 Akim Demaille <akim@epita.fr>
232
233 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
234 Restore.
235 * src/scan-gram.l (last_string): Is global to the file, not to
236 yylex.
237 * src/parse-gram.y (input): Don't append the epilogue here,
238 (epilogue.opt): do it here, and free the scanner's obstack.
239 * src/reader.c (epilogue_set): Rename as...
240 (epilogue_augment): this.
241 * data/c.m4 (b4_epilogue): Defaults to empty.
242
2432002-11-12 Akim Demaille <akim@epita.fr>
244
245 * src/getargs.c (long_options): Remove duplicates.
246 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
247 Remove.
248 * doc/bison.rnh: Remove.
249 * doc/bison.texinfo (VMS Invocation): Remove.
250
2512002-11-12 Akim Demaille <akim@epita.fr>
252
253 * src/struniq.h, src/struniq.c (struniq_t): Is const.
254 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
255
256 Use struniq for symbols.
257
258 * src/symtab.h (symbol_t): The tag member is a struniq.
259 (symbol_type_set): Adjust.
260 * src/symtab.c (symbol_new): Takes a struniq.
261 (symbol_free): Don't free the tag member.
262 (hash_compare_symbol_t, hash_symbol_t): Rename as...
263 (hash_compare_symbol, hash_symbol): these.
264 Use the fact that tags as struniqs.
265 (symbol_get): Use struniq_new.
266 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
267 Returns a strniq.
268 * src/reader.h (merger_list, grammar_currentmerge_set): The name
269 and type members are struniqs.
270 * src/reader.c (get_merge_function)
271 (grammar_current_rule_merge_set): Adjust.
272 (TYPE, current_type): Are struniq.
273
274 Use struniq for file names.
275
276 * src/files.h, src/files.c (infile): Split into...
277 (grammar_file, current_file): these.
278 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
279 * src/reduce.c (reduce_print): Likewise.
280 * src/getargs.c (getargs): Likewise.
281 * src/complain.h, src/complain.c: Likewise.
282 * src/main.c (main): Call struniqs_new early enough to use it for
283 file names.
284 Don't free the input file name.
285
2862002-11-12 Akim Demaille <akim@epita.fr>
287
288 * src/symtab.c (symbol_free): Remove dead deactivated code:
289 type_name are properly removed.
290 Don't use XFREE to free items that cannot be NULL.
291 * src/struniq.h, src/struniq.c: New.
292 * src/main.c (main): Initialize/free struniqs.
293 * src/parse-gram.y (%union): Add astruniq member.
294 (yyprint): Adjust.
295 * src/scan-gram.l (<{tag}>): Return a struniq.
296 Free the obstack bit that used to store it.
297 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
298
2992002-11-11 Paul Eggert <eggert@twinsun.com>
300
301 Revamp to fix many (but not all) of the C- and M4-related quoting
302 problems. Among other things, this fixes the Bison bug reported
303 by Jan Hubicka when processing the Bash grammar; see:
304 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001329.html>
305
306 Use new @ escapes consistently. Represent brackets with @{ and @}
307 rather than @<:@ and @:>@, since this works a bit better with dumb
308 editors like vi. Represent @ with @@, since @ is now consistently
309 an escape. Use @oline@ and @ofile@ rather than __oline__ and
310 __ofile__, to avoid unexpected expansions. Similarly, use @output
311 rather than #output.
312
313 * data/c.m4 (b4_copyright): Omit file name from comment, since
314 the file name could contain "*/".
315 (b4_synclines_flag): Don't quote the 2nd argument; it should already
316 be quoted. All uses changed.
317
318 * data/glr.c: Use new @ escapes consistently.
319 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
320 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
321 Remove, since they couldn't handle arbitrary characters in file
322 names.
323 * data/lalr1.cc: Likewise.
324 * data/yacc.c: Likewise.
325
326 * src/files.c (output_infix): Remove; all uses removed.
327 * src/files.h: Likewise.
328
329 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
330 mishandled funny characters in file names, and anyway it isn't
331 needed any more.
332 * data/yacc.c: Likewise.
333 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
334
335 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
336 * data/yacc.c: Likewise.
337
338 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
339 strings now.
340 (muscle_init): Quote filename as a C string.
341 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
342 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
343 * src/output.c (escaped_file_name_output): New function.
344 (prepare_symbols): Quote tokens for M4.
345 (prepare): Don't insert output_infix, output_prefix,
346 output_parser_name, output_header_name; this is now down by scan-skel.
347 Insert skeleton as a C string.
348
349 * src/output.c (user_actions_output, symbol_destructors_output,
350 symbol_printers_output): Quote filenames for C and M4.
351 * src/reader.c (prologue_augment, epilogue_set): Likewise.
352
353 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
354 escapes other than \\ and \'; this simplifies the code.
355 (<SC_STRING>): Likewise, for \\ and \".
356 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
357 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
358 Use new escapes @{ and @} for [ and ].
359
360 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
361 them with auto vars.
362 Switch to new escape scheme, where @ is the escape character uniformly.
363 Abort if a stray escape character is found. Avoid unbounded input
364 buffer when parsing non-escaped text.
365
366 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
367 __oline__, #output, $@, and @{ do not have unintended meanings.
368
3692002-11-09 Paul Eggert <eggert@twinsun.com>
370
371 Fix the test failure due to GCC warnings described in
372 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001815.html>.
373 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
374 evaluate to 0 if it's impossible for NINF to be in the respective
375 table.
376 (yygetLRActions, yyrecoverParseError): Use them.
377
378 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
379 counted in the token inserted at end of file. Now takes
380 location_t *, not location_t, so that the location can be
381 adjusted. All uses changed.
382
383 * tests/regression.at (Invalid inputs): Adjust wording in
384 diagnostic to match the new behavior.
385
386 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
387 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
388 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
389 abort ();'. This reduces the runtime of the "Many lookaheads"
390 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
391 GCC 3.2.
392
3932002-11-07 Paul Eggert <eggert@twinsun.com>
394
395 * src/parse-gram.y (CHARACTER): Remove unused token.
396 All uses removed.
397
398 * src/scan-gram.l: Remove stack option. We no longer use the
399 stack, since the stack was never deeper than 1; instead, use the
400 new auto var c_context to record the stacked value.
401
402 Remove nounput option. At an unexpected end of file, we now unput
403 the minimal input necessary to end cleanly; this simplifies the
404 code.
405
406 Avoid unbounded token sizes where this is easy.
407
408 (unexpected_end_of_file): New function.
409 Use it to systematize the error message on unexpected EOF.
410 (last-string): Now auto, not static.
411 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
412 (scanner_last_string_free): Remove; not used.
413 (percent_percent_count): Move decl to just before use.
414 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
415 not the (never otherwised-used) CHARACTER.
416
4172002-11-07 Akim Demaille <akim@epita.fr>
418
419 Let yyerror always receive the msg as last argument, so that
420 yyerror can be variadic.
421
422 * data/yacc.c (b4_yyerror_args): New.
423 Use it when calling yyerror.
424 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
425 Use it when calling yyerror.
426 * doc/bison.texinfo (Error Reporting): Adjust.
427 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
428 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
429
4302002-11-06 Akim Demaille <akim@epita.fr>
431
432 #line should have quoted strings.
433 Ideally, this should be done by m4_quotearg.
434
435 * src/scan-skel.l: Include quotearg.h.
436 Quote __ofile__.
437 * src/output.c (symbol_printers_output)
438 (symbol_destructors_output): Quote the file name.
439
4402002-11-06 Akim Demaille <akim@epita.fr>
441
442 * tests/regression.at (Invalid inputs): Adjust to the recent
443 messages.
444
4452002-11-06 Akim Demaille <akim@epita.fr>
446
447 Restore --no-lines.
448 Reported by Jim Kent.
449
450 * data/c.m4 (b4_syncline): New.
451 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
452 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
453 * src/output.c (user_actions_output): Likewise.
454 (prepare): Define 'b4_synclines_flag'.
455 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
456
4572002-11-06 Akim Demaille <akim@epita.fr>
458
459 * src/main.c (main): Free `infile'.
460 * src/scan-gram.l (handle_syncline): New.
461 Recognize `#line'.
462 * src/output.c (user_actions_output, symbol_destructors_output)
463 (symbol_printers_output): Use the location's file name, not
464 infile.
465 * src/reader.c (prologue_augment, epilogue_set): Likewise.
466
4672002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
468
469 * src/tables.c (matching_state): Don't allow states to match if
470 either has GLR conflict entries.
471
4722002-11-05 Paul Eggert <eggert@twinsun.com>
473
474 * src/scan-gram.l: Use more accurate diagnostics, e.g.
475 "integer out of range" rather than "invalid value".
476 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
477 accordingly.
478
479 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
480 Also, remove one static variable in the scanner.
481
482 * src/scan-gram.l (braces_level): Now auto, not static.
483 Initialize to zero if the compiler is being picky.
484 (INITIAL): Clear braces_level instead of incrementing it.
485 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
486 as POSIX 1003.1-2001 requires.
487 * src/system.h (IF_LINT): New macro, taken from coreutils.
488 * configure.ac: Define "lint" if --enable-gcc-warnings.
489
4902002-11-05 Akim Demaille <akim@epita.fr>
491
492 * src/scan-gram.l: When it starts with `%', complain about the
493 whole directive, not just that `invalid character: %'.
494
4952002-11-04 Akim Demaille <akim@epita.fr>
496
497 * Makefile.maint: Update from Autoconf.
498 (update, cvs-update, po-update, do-po-update): New.
499
5002002-11-04 Akim Demaille <akim@epita.fr>
501
502 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
503 and yyerror.
504 Have yyerror `use' its arguments.
505 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
506 returns true when location & yacc & pure & parse-param.
507 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
508
5092002-11-04 Akim Demaille <akim@epita.fr>
510
511 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
512 clashes.
513 * src/scan-gram.l: Use [\'] instead of ['] to pacify
514 font-lock-mode.
515 Use complain_at.
516 Use quote, not quote_n since LOCATION_PRINT no longer uses the
517 slot 0.
518
5192002-11-03 Paul Eggert <eggert@twinsun.com>
520
521 * src/reader.c (get_merge_function, grammar_current_rule_check):
522 Use consistent diagnostics for reporting type name clashes.
523 Quote the types with <>, for consistency with Yacc.
524 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
525
5262002-11-03 Akim Demaille <akim@epita.fr>
527
528 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
529 New.
530 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
531 (b4_parse_param): Remove.
532 Use b4_identification.
533 Propagate b4_pure_args where needed to pass them to yyerror.
534 * data/glr.m4 (b4_parse_param): Remove.
535 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
536 (b4_lpure_formals): New.
537 Use b4_identification.
538 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
539 b4_user_formals and b4_user_args.
540 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
541 (yyreportAmbiguity): When using a pure parser, also need
542 the location, and the parse-params.
543 Adjust callers.
544 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
545 When using a pure parser, also need the parse-params.
546 Adjust callers.
547 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
548 (%pure-parser + %parse-param) LALR and GLR parsers.
549 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
550 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
551 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
552 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
553 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
554 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
555 * doc/bison.texinfo: Untabify the whole file.
556 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
557 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
558 (Error Reporting): Adjust to these new directives.
559 Document %error-verbose, deprecate YYERROR_VERBOSE.
560
5612002-11-03 Akim Demaille <akim@epita.fr>
562
563 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
564 AT_CHECK_CALC_GLR invocations to use % directives, instead of
565 command line options.
566 * tests/cxx-type.at: Formatting changes.
567
5682002-11-03 Paul Eggert <eggert@twinsun.com>
569
570 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
571 to count columns correctly, and to check for invalid inputs.
572
573 Use mbsnwidth to count columns correctly. Account for tabs, too.
574 Include mbswidth.h.
575 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
576 (extend_location): New function.
577 (YY_LINES): Remove.
578
579 Handle CRLF in C code rather than in Lex code.
580 (YY_INPUT): New macro.
581 (no_cr_read): New function.
582
583 Scan UCNs, even though we don't fully handle them yet.
584 (convert_ucn_to_byte): New function.
585
586 Handle backslash-newline correctly in C code.
587 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
588 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
589 all uses changed.
590 (tag, splice): New EREs. Do not allow NUL or newline in tags.
591 Use {splice} wherever C allows backslash-newline.
592 YY_STEP after space, newline, vertical-tab.
593 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
594
595 (letter, id): Don't assume ASCII; e.g., spell out a-z.
596
597 ({int}, handle_action_dollar, handle_action_at): Check for integer
598 overflow.
599
600 (YY_STEP): Omit trailing semicolon, so that it's more like C.
601
602 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
603 as well as \000. Check for UCHAR_MAX, not 255.
604 Allow \x with an arbitrary positive number of digits, as in C.
605 Check for overflow here.
606 Allow \? and UCNs, for compatibility with C.
607
608 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
609 with quote slot used by complain_at.
610
611 * tests/input.at: Add tests for backslash-newline, m4 quotes
612 in symbols, long literals, and funny escapes in strings.
613
614 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
615 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
616 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
617 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
618 * m4/mbswidth.m4: New file, from GNU coreutils.
619
620 * doc/bison.texinfo (Grammar Outline): Document // comments.
621 (Symbols): Document that trigraphs have no special meaning in Bison,
622 nor is backslash-newline allowed.
623 (Actions): Document that trigraphs have no special meaning.
624
625 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
626 no longer used.
627
6282002-11-02 Paul Eggert <eggert@twinsun.com>
629
630 * src/reader.c: Don't include quote.h; not needed.
631 (get_merge_function): Reword warning to be consistent with
632 type clash diagnostic in grammar_current_rule_check.
633
634 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
635 bug in trigraph handling.
636
637 * src/output.c (prepare_symbols): When printing token names,
638 escape "[" as "@<:@" and likewise for "]".
639
640 * src/system.h (errno): Remove declaration, as we are now
641 assuming C89 or better, and C89 guarantees errno.
642
6432002-10-30 Paul Eggert <eggert@twinsun.com>
644
645 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
646 Check for close failures.
647 * src/files.h (xfclose): Return void, not int, since it always
648 returned zero.
649 * src/files.c (xfclose): Likewise. Report I/O error if ferror
650 indicates one.
651 * src/output.c (output_skeleton): Use xfclose rather than fclose
652 and ferror. xfclose now checks ferror.
653
654 * data/glr.c (YYLEFTMOST_STATE): Remove.
655 (yyreportTree): Use a stack-based leftmost state. This avoids
656 our continuing battles with bogus warnings about initializers.
657
6582002-10-30 Akim Demaille <akim@epita.fr>
659
660 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
661 #if.
662
6632002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
664
665 * tests/glr-regr1.at: New test for reported regressions.
666 * tests/testsuite.at: Add glr-regr1.at test.
667 * tests/Makefile.am: Add glr-regr1.at test.
668
6692002-10-24 Paul Eggert <eggert@twinsun.com>
670
671 Version 1.75a.
672
673 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
674 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
675 we use malloc. Don't assume 'A' through 'Z' are contiguous.
676 Don't assume strdup exists; POSIX says its an XSI extension.
677 Check for buffer overflow on input.
678
6792002-10-24 Akim Demaille <akim@epita.fr>
680
681 * src/output.c (output_skeleton): Don't disable M4sugar comments
682 too soon: it results in comments being expanded.
683 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
684 first output.
685
6862002-10-24 Akim Demaille <akim@epita.fr>
687
688 * data/yacc.c (m4_int_type): New.
689 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
690 char' as only yacc.c wants K&R portability.
691 * data/glr.c (yysigned_char): Remove.
692 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
693 Reported by Quoc Peyrot.
694
6952002-10-23 Paul Eggert <eggert@twinsun.com>
696
697 * src/main.c (main): With --trace=time, report times even if a
698 non-fatal error occurs. Formerly, the times were reported in some
699 such cases but not in others.
700 * src/reader.c (reader): Just return if a complaint has been issued,
701 instead of exiting, so that 'main' can report times.
702
7032002-10-22 Akim Demaille <akim@epita.fr>
704
705 * src/system.h: Include sys/types.
706 Reported by Bert Deknuydt.
707
7082002-10-23 Paul Eggert <eggert@twinsun.com>
709
710 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
711 Suggested by Art Haas.
712
7132002-10-22 Paul Eggert <eggert@twinsun.com>
714
715 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
716 decl; not needed any more.
717 * src/main.c (main): Use return to exit, undoing yesterday's change.
718 The last OS that we could find where this wouldn't work is
719 SunOS 3.5, and that's too old to worry about now.
720
721 * data/glr.c (struct yyltype): Define members even when not
722 doing locations. This is more consistent with yacc.c, and it
723 works around the following bug reports:
724 http://mail.gnu.org/pipermail/bug-bison/2002-October/001764.html
725 http://mail.gnu.org/pipermail/bug-bison/2002-October/001769.html
726 and I hope it also fixes this bug report:
727 http://mail.gnu.org/pipermail/bug-bison/2002-October/001748.html
728
729 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
730 @acronym consistently. Standardize on "Yacc" instead of "YACC",
731 "Algol" instead of "ALGOL". Give a bit more history about BNF.
732
7332002-10-22 Akim Demaille <akim@epita.fr>
734
735 * data/README: New.
736
7372002-10-21 Paul Eggert <eggert@twinsun.com>
738
739 Be consistent about 'bool'; the old code used an enum in one
740 module and an int in another, and this violates the C standard.
741 * m4/stdbool.m4: New file, from coreutils 4.5.3.
742 * configure.ac (AC_HEADER_STDBOOL): Add.
743 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
744 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
745 * src/symtab.c (hash_compare_symbol_t): Likewise.
746 * src/system.h (bool, false, true): Use a definition consistent
747 with ../lib/hash.c. All uses changed.
748
749 * src/complain.c (warning_issued): Renamed from warn_message_count,
750 so that we needn't worry about integer overflow (!).
751 Now of type bool. All uses changed.
752 (complaint_issued): Renamed from complain_message_count; likewise.
753
754 * src/main.c (main): Use exit to exit with failure.
755
756 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
757 rather than 1 and 0.
758 * src/main.c (main): Likewise.
759 * src/getargs.c (getargs): Likewise.
760 * src/reader.c (reader): Likewise.
761
762 * src/getarg.c (getargs): Remove duplicate code for
763 "Try `bison --help'".
764
765 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
766 What was that "2" for?
767
768 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
769 * src/getargs.c (usage): Likewise.
770
771 * src/getargs.c (getargs): When there are too few operands, report
772 the last one. When there are too many, report the first extra
773 one. This is how diffutils does it.
774
7752002-10-20 Paul Eggert <eggert@twinsun.com>
776
777 Remove K&R vestiges.
778 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
779 * src/complain.c (VA_START): Remove. Assume prototypes.
780 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
781 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
782 fatal): Assume prototypes.
783 * src/complain.h: Assume prototypes.
784 * src/system.h (PARAMS): Remove.
785 Include <limits.h> unconditionally, since it's guaranteeed even
786 for a freestanding C89 compiler.
787 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
788 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
789
7902002-10-20 Akim Demaille <akim@epita.fr>
791
792 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
793 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
794 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
795 (yyresolveStates, yyresolveAction, yyresolveStack)
796 (yyprocessOneStack): Use them.
797 (yy_reduce_print): New.
798 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
799
8002002-10-20 Akim Demaille <akim@epita.fr>
801
802 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
803 arguments and output `void'.
804 (b4_c_function): Rename as...
805 (b4_c_function_def): this.
806 (b4_c_function_decl, b4_c_ansi_function_def)
807 (b4_c_ansi_function_decl): New.
808 Change the interpretation of the arguments: before `int, foo', now
809 `int foo, foo'.
810 * data/yacc.c (yyparse): Prototype and define thanks to these.
811 Adjust b4_c_function_def uses.
812 * data/glr.c (yyparse): Likewise, but ANSI only.
813
8142002-10-20 Akim Demaille <akim@epita.fr>
815
816 * src/output.c (prepare): Move the definition of `tokens_number',
817 `nterms_number', `undef_token_number', `user_token_number_max'
818 to...
819 (prepare_tokens): Here.
820 (prepare_tokens): Rename as...
821 (prepare_symbols): this.
822 (prepare): Move the definition of `rules_number' to...
823 (prepare_rules): here.
824 (prepare): Move the definition of `last', `final_state_number',
825 `states_number' to...
826 (prepare_states): here.
827 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
828
8292002-10-20 Akim Demaille <akim@epita.fr>
830
831 * src/tables.h, src/tables.c, src/output.c: Comment changes.
832
8332002-10-20 Akim Demaille <akim@epita.fr>
834
835 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
836 * data/c.m4: here.
837
8382002-10-20 Akim Demaille <akim@epita.fr>
839
840 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
841 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
842 `pair'.
843 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
844 `name' to...
845 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
846 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
847 These.
848
8492002-10-19 Paul Eggert <eggert@twinsun.com>
850
851 Do not create a temporary file, as that involves security and
852 cleanup headaches. Instead, use a pair of pipes.
853 Derived from a suggestion by Florian Krohm.
854 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
855 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
856 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
857 (BISON_PREREQ_SUBPIPE): Add.
858 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
859 Add subpipe.h, subpipe.c.
860 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
861 * po/POTFILES.in: Add lib/subpipe.c.
862 * src/output.c: Include "subpipe.h".
863 (m4_invoke): Remove decl.
864 (scan_skel): New decl.
865 (output_skeleton): Use pipe rather than temporary file for m4 input.
866 Check that m4sugar.m4 is readable, to avoid deadlock.
867 Check for pipe I/O error.
868 * src/scan-skel.l (readpipe): Remove decl.
869 (scan_skel): New function, to be used in place of m4_invoke.
870 Read from stream rather than file.
871
872 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
873 float, as this generates a warning on Solaris 8 + GCC 3.2 with
874 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
875 this generates a more-accurate value anyway.
876
877 * lib/timevar.c (timervar_accumulate): Rename locals to
878 avoid confusion with similarly-named more-global.
879 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
880
881 * src/output.c (prepare): Use xstrdup to convert char const *
882 to char *, to avoid GCC warning.
883
8842002-10-19 Akim Demaille <akim@epita.fr>
885
886 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
887 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
888 Use them to have `calc.y' ready for %pure-parser.
889 * data/yacc.c (YYLEX): Pass a yylex return type to
890 b4_c_function_call.
891
8922002-10-19 Akim Demaille <akim@epita.fr>
893
894 Prototype support of %lex-param and %parse-param.
895
896 * src/parse-gram.y: Add the definition of the %lex-param and
897 %parse-param tokens, plus their rules.
898 Drop the `_' version of %glr-parser.
899 Add the "," token.
900 * src/scan-gram.l (INITIAL): Scan them.
901 * src/muscle_tab.c: Comment changes.
902 (muscle_insert, muscle_find): Rename `pair' as `probe'.
903 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
904 (muscle_entry_s): The `value' member is no longer const.
905 Adjust all dependencies.
906 * src/muscle_tab.c (muscle_init): Adjust: use
907 MUSCLE_INSERT_STRING.
908 Initialize the obstack earlier.
909 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
910 (muscle_pair_list_grow): New.
911 * data/c.m4 (b4_c_function_call, b4_c_args): New.
912 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
913 * tests/calc.at: Use %locations, not --locations.
914 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
915
9162002-10-19 Akim Demaille <akim@epita.fr>
917
918 * src/getargs.c (usage): Take status as argument and exit
919 accordingly.
920 Report the traditional `Try ... --help' message when status != 0.
921 (usage, version): Don't take a FILE * as arg, it is pointless.
922 (getargs): When there is an incorrect number of arguments, make it
923 an error, and report it GNUlically thanks to `usage ()'.
924
9252002-10-18 Paul Eggert <eggert@twinsun.com>
926
927 * data/glr.c (yyreportParseError): Don't assume that sprintf
928 yields the length of the printed string, as this is not true
929 on SunOS 4.1.4. Reported by Peter Klein.
930
931 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
932 * tests/conflicts.at (%nonassoc and eof): Likewise.
933 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
934
9352002-10-17 Akim Demaille <akim@epita.fr>
936
937 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
938 * src/getargs.c (trace_types, trace_args): Adjust.
939 * src/reader.c (grammar_current_rule_prec_set)
940 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
941 Standardize error messages.
942 And s/@prec/%prec/!
943 (reader): Use trace_flag to enable scanner/parser debugging,
944 instead of an adhoc scheme.
945 * src/scan-gram.l: Remove trailing debugging code.
946
9472002-10-16 Paul Eggert <eggert@twinsun.com>
948
949 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
950 MUSCLE_TAB_H.
951
952 * NEWS: Officially drop support for building Bison with K&R C,
953 since it didn't work anyway and it's not worth worrying about.
954 * Makefile.maint (wget_files): Remove ansi2knr.c.
955 (ansi2knr.c-url_prefix): Remove.
956 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
957 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
958 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
959
9602002-10-15 Paul Eggert <eggert@twinsun.com>
961
962 Stop using the "enum_" trick for K&R-style function definitions;
963 it confused me, and I was the author! Instead, assume that people
964 who want to use K&R C compilers (when using these modules in GCC,
965 perhaps?) will run ansi2knr.
966
967 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
968 All uses of "enum_" changed to "enum ".
969 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
970 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
971
972 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
973 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
974 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
975 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
976 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
977 abitset_not, abitset_ones, abitset_or, abitset_or_and,
978 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
979 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
980 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
981 Use function prototypes; this removes the need for declaring
982 static functions simply to provide their prototypes.
983 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
984 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
985 bitset_count_, bitset_create, bitset_dump, bitset_first,
986 bitset_free, bitset_init, bitset_last, bitset_next,
987 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
988 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
989 bitset_print, bitset_release_memory, bitset_toggle_,
990 bitset_type_choose, bitset_type_get, bitset_type_name_get,
991 debug_bitset): Likewise.
992 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
993 * lib/bitset_stats.c (bitset_log_histogram_print,
994 bitset_percent_histogram_print, bitset_stats_and,
995 bitset_stats_and_cmp, bitset_stats_and_or,
996 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
997 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
998 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
999 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
1000 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
1001 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
1002 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
1003 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
1004 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
1005 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
1006 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
1007 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
1008 bitset_stats_zero): Likewise.
1009 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
1010 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
1011 bitsetv_dump, debug_bitsetv): Likewise.
1012 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
1013 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
1014 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
1015 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
1016 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
1017 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
1018 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
1019 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
1020 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
1021 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
1022 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
1023 Likewise.
1024 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
1025 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
1026 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
1027 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
1028 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
1029 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
1030 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
1031 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
1032 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
1033 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
1034 lbitset_xor_cmp, lbitset_zero): Likewise.
1035
10362002-10-14 Akim Demaille <akim@epita.fr>
1037
1038 Version 1.75.
1039
10402002-10-14 Akim Demaille <akim@epita.fr>
1041
1042 * tests/Makefile.am (maintainer-check-posix): New.
1043
10442002-10-14 Akim Demaille <akim@epita.fr>
1045
1046 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
1047 member.
1048
10492002-10-14 Akim Demaille <akim@epita.fr>
1050
1051 * src/tables.c (table_ninf_remap): base -> tab.
1052 Reported by Matt Rosing.
1053
10542002-10-14 Paul Eggert <eggert@twinsun.com>
1055
1056 * tests/action.at, tests/calc.at, tests/conflicts.at,
1057 tests/cxx-type.at, tests/headers.at, tests/input.at,
1058 tests/regression.at, tests/synclines.at, tests/torture.at:
1059 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
1060 so that the tests still work even if POSIXLY_CORRECT is set.
1061 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
1062
1063 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
1064 for portability to K&R hosts. Fix typo: signed char is guaranteed
1065 only to 127, not to 128.
1066 * data/glr.c (yysigned_char): New type.
1067 * data/yacc.c (yysigned_char): Likewise.
1068 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
1069
10702002-10-13 Paul Eggert <eggert@twinsun.com>
1071
1072 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
1073 true due to limited range of data type" warning from GCC.
1074
1075 * data/c.m4 (b4_token_defines): Protect against double-inclusion
1076 by wrapping enum yytokentype's definition inside #ifndef
1077 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
1078
10792002-10-13 Akim Demaille <akim@epita.fr>
1080
1081 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
1082 Un yy- yyrhs to avoid the name clash with the global YYRHS.
1083
10842002-10-13 Akim Demaille <akim@epita.fr>
1085
1086 * Makefile.maint: Update from Autoconf 2.54.
1087 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
1088
10892002-10-13 Akim Demaille <akim@epita.fr>
1090
1091 * src/print.c (print_state): Separate the list of solved conflicts
1092 from the other items.
1093 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
1094
10952002-10-13 Akim Demaille <akim@epita.fr>
1096
1097 Let nondeterministic skeletons be usable with deterministic
1098 tables.
1099
1100 With the patch, GAWK compiled by GCC without -O2 passes its test
1101 suite using a GLR parser driven by LALR tables. It fails with -O2
1102 because `struct stat' gives two different answers on my machine:
1103 88 (definition of an auto var) and later 96 (memset on this var).
1104 Hence the stack is badly corrumpted. The headers inclusion is to
1105 blame: if I move the awk.h inclusion before GLR's system header
1106 inclusion, the two struct stat have the same size.
1107
1108 * src/tables.c (pack_table): Always create conflict_table.
1109 (token_actions): Always create conflict_list.
1110 * data/glr.c (YYFLAG): Remove, unused.
1111
11122002-10-13 Akim Demaille <akim@epita.fr>
1113
1114 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
1115 (O0FLAGS): New.
1116 (VALGRIND, GXX): New.
1117 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
1118 * tests/bison.in: Run $PREBISON a pre-command.
1119 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
1120 (maintainer-check-g++): New.
1121 * Makefile.am (maintainer-check): New.
1122
11232002-10-13 Akim Demaille <akim@epita.fr>
1124
1125 * data/glr.c: Formatting changes.
1126 Tweak some trace messages to match yacc.c's.
1127
11282002-10-13 Akim Demaille <akim@epita.fr>
1129
1130 GLR parsers sometimes raise parse errors instead of performing the
1131 default reduction.
1132 Reported by Charles-Henry de Boysson.
1133
1134 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
1135 check the length of the traces when %glr.
1136 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
1137 GLR's traces.
1138 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
1139 Test GLR parsers.
1140 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
1141 (yyltype): Remove the yy prefix from the member names.
1142 (yytable): Complete its comment.
1143 (yygetLRActions): Map error action number from YYTABLE from
1144 YYTABLE_NINF to 0.
1145 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
1146 (which was a bug: it should have been YYTABEL_NINF, and yet it was
1147 not satisfying as we could compare an YYACTION computed from
1148 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
1149 only value for error actions.
1150 (yyreportParseError): In verbose parse error messages, don't issue
1151 `error' in the list of expected tokens.
1152 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
1153 next action to perform to match glr.c's decoding.
1154 (yytable): Complete its comment.
1155
11562002-10-13 Paul Eggert <eggert@twinsun.com>
1157
1158 Fix problem reported by Henrik Grubbstroem in
1159 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001670.html>:
1160 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
1161 because the Bison parser reads the second action before reducing
1162 the first one.
1163 * src/scan-gram.l (rule_length): New static var.
1164 Use it to keep track of the rule length in the scanner, since
1165 we can't expect the parser to be in lock-step sync with the scanner.
1166 (handle_action_dollar, handle_action_at): Use this var.
1167 * tests/actions.at (Exotic Dollars): Test for the problem.
1168
11692002-10-12 Paul Eggert <eggert@twinsun.com>
1170
1171 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
1172 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
1173 Include <sys/time.h> when checking for clock_t and struct tms.
1174 Use same include order as source.
1175 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
1176 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001674.html>.
1177
1178 * lib/timevar.c: Update copyright date and clarify comments.
1179 (get_time) [IN_GCC]: Keep the GCC version for reference.
1180
1181 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
1182 GCC version as of today, then merge Bison's changes.
1183 Change "GCC" to "Bison" in copyright notice. timevar.def's
1184 author is Akim, so change that too.
1185
1186 * src/reader.c (grammar_current_rule_check):
1187 Don't worry about the default action if $$ is untyped.
1188 Prevents bogus warnings reported by Jim Gifford in
1189 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001673.html>.
1190
1191 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
1192 * data/glr.c, data/lalr1.cc, data/yacc.c:
1193 Output token definitions before the first part of user declarations.
1194 Fixes compatibility problem reported by Jim Gifford for kbd in
1195 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001672.html>.
1196
11972002-10-11 Paul Eggert <eggert@twinsun.com>
1198
1199 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
1200 (yyparse): here. This undoes some of the 2002-07-25 change.
1201 Compatibility problem reported by Ralf S. Engelschall with
1202 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
1203
12042002-10-11 Akim Demaille <akim@epita.fr>
1205
1206 * tests/regression.at Characters Escapes): New.
1207 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
1208 characters.
1209 Reported by Jan Nieuwenhuizen.
1210
12112002-10-11 Akim Demaille <akim@epita.fr>
1212
1213 * po/id.po: New.
1214
12152002-10-10 Paul Eggert <eggert@twinsun.com>
1216
1217 Portability fixes for bitsets; this also avoids several GCC
1218 warnings.
1219
1220 * lib/abitset.c: Include <stddef.h>, for offsetof.
1221 * lib/lbitset.c: Likewise.
1222
1223 * lib/abitset.c (abitset_bytes): Return a size that is aligned
1224 properly for vectors of objects. Do not assume that adding a
1225 header size to a multiple of a word size yields a value that is
1226 properly aligned for the whole union.
1227 * lib/bitsetv.c (bitsetv_alloc): Likewise.
1228
1229 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
1230 unique names for structures.
1231 * lib/ebitset.c (ebitset_bytes): Likewise.
1232 * lib/lbitset.c (lbitset_bytes): Likewise.
1233
1234 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
1235 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
1236 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
1237 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
1238 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
1239 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
1240 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
1241 to improve the type-checking that GCC can do.
1242 * lib/bitset.c (bitset_op4_cmp): Likewise.
1243 * lib/bitset_stats.c (bitset_stats_count,
1244 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
1245 bitset_stats_copy, bitset_stats_disjoint_p,
1246 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
1247 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
1248 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
1249 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
1250 bitset_stats_and_or_cmp, bitset_stats_andn_or,
1251 bitset_stats_andn_or_cmp, bitset_stats_or_and,
1252 bitset_stats_or_and_cmp): Likewise.
1253 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
1254 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
1255 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
1256 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
1257
1258 * lib/abitset.h: Include bitset.h, not bbitset.h.
1259 * lib/ebitset.h: Likewise.
1260 * lib/lbitset.h: Likewise.
1261
1262 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
1263 All instances of parameters of type enum bitset_opts are now of
1264 type enum_bitset_opts, to conform to the C Standard, and similarly
1265 for enum_bitset_type.
1266 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
1267 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
1268
1269 Do not use "struct bitset_struct" to mean different things in
1270 different modules. Not only is this confusing, it violates
1271 the C Standard, which requires that structure types in different
1272 modules must be compatible if one is to be passed to the other.
1273 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
1274 All instances of "struct bitset_struct *" replaced with "bitset".
1275 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
1276 (union bitset_union, struct abitset_struct, struct ebitset_struct,
1277 struct lbitset_struct, struct bitset_stats_struct): New types.
1278 All uses of struct bitset_struct changed to union bitset_union,
1279 etc.
1280 * lib/abitset.c (struct abitset_struct, abitset,
1281 struct bitset_struct): Remove.
1282 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
1283 struct bitset_struct): Remove.
1284 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
1285 bitset_struct): Remove.
1286 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
1287 Likewise.
1288
1289 Do not call a function of type T using a call that assumes the
1290 function is of a different type U. Standard C requires that a
1291 function must be called with a type that is compatible with its
1292 definition.
1293 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
1294 New decls.
1295 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
1296 New functions.
1297 * lib/ebitset.c (PFV): Remove.
1298 * lib/lbitset.c (PFV): Likewise.
1299 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
1300 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
1301 decls.
1302 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
1303 (ebitset_vtable): Use them.
1304 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
1305 lbitset_xor): New functions.
1306 (lbitset_vtable): Use them.
1307
1308 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
1309 Declare.
1310
1311 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
1312 GCC warning.
1313 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
1314 Use offsetof, for simplicity.
1315
13162002-10-06 Paul Eggert <eggert@twinsun.com>
1317
1318 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
1319 the same width as int. This reapplies a hunk of the 2002-08-12 patch
1320 <http://mail.gnu.org/pipermail/bison-patches/2002-August/001111.html>,
1321 which was inadvertently undone by the 2002-09-30 patch.
1322 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
1323 the same width as int.
1324
13252002-10-04 Paul Eggert <eggert@twinsun.com>
1326
1327 Version 1.50.
1328
1329 * configure.ac (AC_INIT), NEWS: Increment version number.
1330
1331 * doc/bison.texinfo: Minor spelling, grammar, and white space
1332 fixes.
1333 (Symbols): Mention that any negative value returned from yylex
1334 signifies end-of-input. Warn about negative chars. Mention
1335 the portable Standard C character set.
1336
1337 The GNU coding standard says CFLAGS and YFLAGS are reserved
1338 for the installer to set.
1339 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
1340 * src/Makefile.am (AM_CFLAGS): Likewise.
1341 (AM_YFLAGS): Renamed from YFLAGS.
1342
1343 Fix some MAX and MIN problems.
1344 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
1345 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
1346 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
1347 * src/reader.c (reader): Use it.
1348
1349 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
1350 POSIX 1003.1-2001 has removed fgrep.
1351
13522002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
1353
1354 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
1355 interpreted as signed.
1356 * lib/ebitset.c (ebitset_list): Fix bug.
1357
13582002-10-01 Paul Eggert <eggert@twinsun.com>
1359
1360 More fixes for 64-bit hosts and large bitsets.
1361
1362 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
1363 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
1364 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
1365 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
1366 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
1367 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
1368 bitset_count_): Likewise.
1369 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
1370 bitset_first, bitset_last): Likewise.
1371 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
1372 bitset_stats_list_reverse, bitset_stats_size,
1373 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
1374 Likewise.
1375 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
1376 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
1377 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
1378 bitsetv_reflexive_transitive_closure): Likewise.
1379 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
1380 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
1381 Likewise.
1382 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
1383 Likewise.
1384
1385 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
1386 Use size_t, not unsigned int, to count bytes.
1387 * lib/abitset.h (abitset_bytes): Likewise.
1388 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
1389 Likewise.
1390 * lib/bitset.h (bitset_bytes): Likewise.
1391 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
1392 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
1393 * lib/bitsetv.c (bitsetv_alloc): Likewise.
1394 * lib/ebitset.c (ebitset_bytes): Likewise.
1395 * lib/ebitset.h (ebitset_bytes): Likewise.
1396 * lib/lbitset.c (lbitset_bytes): Likewise.
1397 * lib/lbitset.h (lbitset_bytes): Likewise.
1398
1399 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
1400 abitset_subset_p, abitset_disjoint_p, abitset_and,
1401 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
1402 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
1403 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
1404 abitset_or_and, abitset_or_and_cmp):
1405 Use bitset_windex instead of unsigned int.
1406 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
1407 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
1408 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
1409 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
1410 Likewise.
1411 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
1412
1413 * lib/bitset.c (bitset_print):
1414 Use proper printf formats for widths of integer types.
1415 * lib/bitset_stats.c (bitset_percent_histogram_print,
1416 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
1417 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
1418 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
1419 * lib/lbitset.c (lbitset_bytes): Likewise.
1420
1421 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
1422 BITSET_SIZE_MAX): New macros.
1423 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
1424 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
1425 to BITSET_WINDEX_MAX.
1426
1427 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
1428 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
1429 since we now return the bitset_bindex type (not int).
1430
1431 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
1432 when computing sizes.
1433 * lib/ebitset.c (ebitset_elts_grow): Likewise.
1434
1435 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
1436 and avoid cast to unsigned.
1437
14382002-09-30 Akim Demaille <akim@epita.fr>
1439
1440 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
1441 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
1442 Updates from Michael Hayes.
1443
14442002-09-30 Art Haas <ahaas@neosoft.com>
1445
1446 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
1447 invocations.
1448 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
1449 defined.
1450
14512002-09-27 Akim Demaille <akim@epita.fr>
1452
1453 Version 1.49c.
1454
14552002-09-27 Akim Demaille <akim@epita.fr>
1456
1457 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
1458 (Because of AC_LIBSOURCE).
1459
14602002-09-27 Akim Demaille <akim@epita.fr>
1461
1462 Playing with Autoscan.
1463
1464 * configure.ac: Remove the old LIBOBJ tweaks.
1465 (AC_REPLACE_FUNCS): Add strrchr and strtol.
1466 * lib/strrchr.c: New.
1467 * lib/strtol.c: New, from the Coreutils 4.5.1.
1468
14692002-09-27 Akim Demaille <akim@epita.fr>
1470
1471 Playing with Autoscan.
1472
1473 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
1474 * lib/Makefile.am (libbison_a_SOURCES): No longer include
1475 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
1476 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
1477 Coreutils 4.5.1.
1478
14792002-09-24 Akim Demaille <akim@epita.fr>
1480
1481 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
1482 (Frequently Asked Questions, Parser Stack Overflow): New.
1483
14842002-09-13 Akim Demaille <akim@epita.fr>
1485
1486 Playing with autoscan.
1487
1488 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
1489 * src/files.c (skeleton_find): Remove, unused.
1490 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
1491 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
1492
14932002-09-13 Akim Demaille <akim@epita.fr>
1494
1495 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
1496 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
1497
14982002-09-13 Akim Demaille <akim@epita.fr>
1499
1500 * configure.ac: Require 2.54.
1501 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
1502 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
1503 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
1504 Remove, provided by Autoconf macros.
1505
15062002-09-12 Akim Demaille <akim@epita.fr>
1507
1508 * m4/prereq.m4: Update, from Coreutils 4.5.1.
1509
15102002-09-12 Akim Demaille <akim@epita.fr>
1511
1512 * m4/prereq.m4: Update, from Fileutils 4.1.5.
1513 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
1514 Reported by Martin Mokrejs.
1515
15162002-09-10 Akim Demaille <akim@epita.fr>
1517
1518 * src/parse-gram.y: Associate a human readable string to each
1519 token type.
1520 * tests/regression.at (Invalid inputs): Adjust.
1521
15222002-09-10 Gary V. Vaughan <gary@gnu.org>
1523
1524 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
1525 with an Autoconf-2.5x style configure.ac.
1526
15272002-09-06 Paul Eggert <eggert@twinsun.com>
1528
1529 * doc/bison.texinfo (Conditions): Make explicit that the GPL
1530 exception applies only to yacc.c. This is a modification of a
1531 patch originally suggested by Akim Demaille.
1532
15332002-09-06 Akim Demaille <akim@epita.fr>
1534
1535 * data/c.m4 (b4_copyright): Move the GPL exception comment from
1536 here to...
1537 * data/yacc.c: here.
1538
1539 * data/lalr1.cc (struct yyltype): Don't define it, since we use
1540 LocationType.
1541 (b4_ltype): Default to yy::Location from location.hh.
1542
15432002-09-04 Jim Meyering <jim@meyering.net>
1544
1545 * data/yacc.c: Guard the declaration of yytoknum also with
1546 `#ifdef YYPRINT', so it is declared only when used.
1547
15482002-09-04 Akim Demaille <akim@epita.fr>
1549
1550 * configure.in: Rename as...
1551 * configure.ac: this.
1552 Bump to 1.49c.
1553
15542002-09-04 Akim Demaille <akim@epita.fr>
1555
1556 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
1557 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
1558 translate maintainer only messages.
1559
15602002-08-12 Paul Eggert <eggert@twinsun.com>
1561
1562 Version 1.49b.
1563
1564 * Makefile.am (SUBDIRS): Remove intl.
1565 (DISTCLEANFILES): Remove.
1566 * NEWS: Mention that GNU M4 is now required. Clarify what is
1567 meant by "larger grammars". Mention the pt_BR translation.
1568 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
1569 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
1570 Bump version from 0.11.2 to 0.11.5.
1571 (BISON_PREREQ_STAGE): Remove.
1572 (AM_GNU_GETTEXT): Use external gettext.
1573 (AC_OUTPUT): Remove intl/Makefile.
1574
1575 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
1576
1577 * data/glr.c: Include string.h, for strlen.
1578 (yyreportParseError): Use size_t for yysize.
1579 (yy_yypstack): No longer nested inside yypstates, as nested
1580 functions are not portable. Do not assume size_t is the
1581 same width as int.
1582 (yypstates): Do not assume that ptrdiff_t is the same width
1583 as int, and similarly for yyposn and YYINDEX.
1584
1585 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
1586
1587 * lib/Makefile.am (INCLUDES): Do not include from the intl
1588 directory, which has been removed.
1589 * src/Makefile.am (INCLUDES): Likewise.
1590
1591 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
1592 (bitsets_sources, additional_bitsets_sources, timevars_sources):
1593 New vars.
1594
1595 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
1596 * tests/Makefile.am (EXTRA_DIST): Likewise.
1597
1598 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
1599 Do not assume that bitset_windex is the same width as unsigned.
1600
1601 * lib/abitset.c (abitset_unused_clear): Do not assume that
1602 bitset_word is the same width as int.
1603 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
1604 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
1605 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
1606 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
1607 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
1608
1609 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
1610 portability to one's complement hosts!).
1611 * lib/ebitset.c (ebitset_op1): Likewise.
1612 * lib/lbitset.c (lbitset_op1): Likewise.
1613
1614 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
1615 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
1616 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
1617 Sync with fileutils.
1618 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
1619 lib/gettext.h: Sync with diffutils.
1620
1621 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
1622 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
1623
1624 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
1625 PROTOTYPES to check for prototypes, and "defined __STDC__" to
1626 check for void *.
1627
1628 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
1629 size_t; the old version tried to do this but casted improperly.
1630 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
1631 (bitset_test): Now returns int, not unsigned long.
1632
1633 * lib/bitset_stats.c: Include "gettext.h".
1634 (_): New macro.
1635 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
1636 name locals "index", as it generates unnecessary warnings on some
1637 hosts that have an "index" function.
1638
1639 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
1640 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
1641 they need translation.
1642 * src/LR0.c (state_list_append, new_itemsets, get_state,
1643 append_states, generate_states): Likewise.
1644 * src/assoc.c (assoc_to_string): Likewise.
1645 * src/closure.c (print_closure, set_firsts, closure): Likewise.
1646 * src/gram.c (grammar_dump): Likewise.
1647 * src/injections.c (injections_compute): Likewise.
1648 * src/lalr.c (lookaheads_print): Likewise.
1649 * src/relation.c (relation_transpose): Likewise.
1650 * src/scan-gram.l: Likewise.
1651 * src/tables.c (table_grow, pack_vector): Likewise.
1652
1653 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
1654 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
1655 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
1656 * m4/mbstate_t.m4: Sync with fileutils.
1657 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
1658
1659 * po/LINGUAS: Add pt_BR.
1660 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
1661 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
1662 lib/timevar.c.
1663 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
1664 manual recommends.
1665 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
1666
1667 * src/complain.c (strerror_r): Remove decl; not needed.
1668 (strerror): Use same pattern as ../lib/error.c.
1669
1670 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
1671
1672 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
1673
1674 * src/main.c (main): Cast result of bindtextdomain and textdomain
1675 to void, to avoid a GCC warning when --disable-nls is in effect.
1676
1677 * src/scan-gram.l: Use strings rather than escapes when possible,
1678 to minimize the number of warnings from xgettext.
1679 (handle_action_dollar, handle_action_at): Don't use isdigit,
1680 as it mishandles negative chars and it may not work as expected
1681 outside the C locale.
1682
1683 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
1684 this is a GCC extension and is not portable to other compilers.
1685
1686 * src/system.h (alloca): Use same pattern as ../lib/error.c.
1687 Do not include <ctype.h>; no longer needed.
1688 Do not include <malloc.h>; no longer needed (and generates
1689 warnings on OpenBSD 3.0).
1690
1691 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
1692 it's not portable.
1693
1694 * tests/regression.at: Do not use 'cc -c input.c -o input';
1695 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
1696
1697 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
1698 exit status as failure, not just exit status 1. Sun C exits
1699 with status 2 sometimes.
1700
1701 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
1702 Use it for the two large tests.
1703
17042002-08-02 Akim Demaille <akim@epita.fr>
1705
1706 * src/conflicts.c (conflicts_output): Don't output rules never
1707 reduced here, since anyway that computation doesn't work.
1708 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
1709 (rule_useless_p, rule_never_reduced_p): New.
1710 (grammar_rules_partial_print): Use a filter instead of a range.
1711 Display the title only if needed.
1712 (grammar_rules_print): Adjust.
1713 (grammar_rules_never_reduced_report): New.
1714 * src/tables.c (action_row): Move the computation of rules never
1715 reduced to...
1716 (token_actions): here.
1717 * src/main.c (main): Make the parser before making the report, so
1718 that rules never reduced are computed.
1719 Call grammar_rules_never_reduced_report.
1720 * src/print.c (print_results): Report rules never reduced.
1721 * tests/conflicts.at, tests/reduce.at: Adjust.
1722
17232002-08-01 Akim Demaille <akim@epita.fr>
1724
1725 Instead of attaching lookaheads and duplicating the rules being
1726 reduced by a state, attach the lookaheads to the reductions.
1727
1728 * src/state.h (state_t): Remove the `lookaheads',
1729 `lookaheads_rule' member.
1730 (reductions_t): Add a `lookaheads' member.
1731 Use a regular array for the `rules'.
1732 * src/state.c (reductions_new): Initialize the lookaheads member
1733 to 0.
1734 (state_rule_lookaheads_print): Adjust.
1735 * src/state.h, src/state.c (state_reductions_find): New.
1736 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
1737 (count_rr_conflicts): Adjust.
1738 * src/lalr.c (LArule): Remove.
1739 (add_lookback_edge): Adjust.
1740 (state_lookaheads_count): New.
1741 (states_lookaheads_initialize): Merge into...
1742 (initialize_LA): this.
1743 (lalr_free): Adjust.
1744 * src/main.c (main): Don't free nullable and derives too early: it
1745 is used by --verbose.
1746 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
1747
17482002-08-01 Akim Demaille <akim@epita.fr>
1749
1750 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
1751 `rule_number_t**'.
1752 (set_derives, free_derives): Rename as...
1753 (derives_compute, derives_free): this.
1754 Adjust all dependencies.
1755 * src/nullable.c (set_nullable, free_nullable): Rename as...
1756 (nullable_compute, nullable_free): these.
1757 (rule_list_t): Store rule_t *, not rule_number_t.
1758 * src/state.c (state_rule_lookaheads_print): Directly compare rule
1759 pointers, instead of their numbers.
1760 * src/main.c (main): Call nullable_free, and derives_free earlier,
1761 as they were lo longer used.
1762
17632002-08-01 Akim Demaille <akim@epita.fr>
1764
1765 * lib/timevar.c (get_time): Include children time.
1766 * src/lalr.h (LA, LArule): Don't export them: used with the
1767 state_t.
1768 * src/lalr.c (LA, LArule): Static.
1769 * src/lalr.h, src/lalr.c (lalr_free): New.
1770 * src/main.c (main): Call it.
1771 * src/tables.c (pack_vector): Check whether loc is >= to the
1772 table_size, not >.
1773 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
1774 (tables_generate): do it, since that's also it which allocates
1775 them.
1776 Don't free LA and LArule, main does.
1777
17782002-07-31 Akim Demaille <akim@epita.fr>
1779
1780 Separate parser tables computation and output.
1781
1782 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
1783 (conflict_list, conflict_list_cnt, table, check, table_ninf)
1784 (yydefgoto, yydefact, high): Move to...
1785 * src/tables.h, src/tables.c: here.
1786 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
1787 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
1788 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
1789 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
1790 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
1791 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
1792 (action_row, save_row, token_actions, save_column, default_goto)
1793 (goto_actions, sort_actions, matching_state, pack_vector)
1794 (table_ninf_remap, pack_table, prepare_actions): Move to...
1795 * src/tables.c: here.
1796 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
1797 * src/output.c (token_actions, output_base, output_conflicts)
1798 (output_check): Merge into...
1799 (prepare_actions): this.
1800 (actions_output): Rename as...
1801 (user_actions_output): this.
1802 * src/main.c (main): Call tables_generate and tables_free.
1803
18042002-07-31 Akim Demaille <akim@epita.fr>
1805
1806 Steal GCC's --time-report support.
1807
1808 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
1809 stolen/adjusted from GCC.
1810 * m4/stage.m4: Remove time related checks.
1811 * m4/timevar.m4: New.
1812 * configure.in: Adjust.
1813 * src/system.h: Adjust to using timevar.h.
1814 * src/getargs.h, src/getargs.c: Support trace_time for
1815 --trace=time.
1816 * src/main.c (stage): Remove.
1817 (main): Replace `stage' invocations with timevar calls.
1818 * src/output.c: Insert pertinent timevar calls.
1819
18202002-07-31 Akim Demaille <akim@epita.fr>
1821
1822 Let --trace have arguments.
1823
1824 * src/getargs.h (enum trace_e): New.
1825 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
1826 (long_options, short_options): --trace/-T takes an optional
1827 argument.
1828 Change all the uses of trace_flag to reflect the new flags.
1829 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
1830
1831 Strengthen `stage' portability.
1832
1833 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
1834 * configure.in: Use it.
1835 Don't check for malloc.h and sys/times.h.
1836 * src/system.h: Include them when appropriate.
1837 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
1838 times and struct tms are available.
1839
18402002-07-30 Akim Demaille <akim@epita.fr>
1841
1842 In verbose parse error message, don't report `error' as an
1843 expected token.
1844 * tests/actions.at (Printers and Destructors): Adjust.
1845 * tests/calc.at (Calculator $1): Adjust.
1846 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
1847 error message, do not report the parser accepts the error token in
1848 that state.
1849
18502002-07-30 Akim Demaille <akim@epita.fr>
1851
1852 Normalize conflict related messages.
1853
1854 * src/complain.h, src/complain.c (warn, complain): New.
1855 * src/conflicts.c (conflicts_print): Use them.
1856 (conflict_report_yacc): New, extracted from...
1857 (conflicts_print): here.
1858 * tests/conflicts.at, tests/existing.at: Adjust.
1859
18602002-07-30 Akim Demaille <akim@epita.fr>
1861
1862 Report rules which are never reduced by the parser: those hidden
1863 by conflicts.
1864
1865 * src/LR0.c (save_reductions): Don't make the final state too
1866 different: save its reduction (accept) instead of having a state
1867 without any action (no shift or goto, no reduce).
1868 Note: the final state is now a ``regular'' state, i.e., the
1869 parsers now contain `reduce 0' as default reduction.
1870 Nevertheless, since they decide to `accept' when yystate =
1871 final_state, they still will not reduce rule 0.
1872 * src/print.c (print_actions, print_reduction): Adjust.
1873 * src/output.c (action_row): Track reduced rules.
1874 (token_actions): Report rules never reduced.
1875 * tests/conflicts.at, tests/regression.at: Adjust.
1876
18772002-07-30 Akim Demaille <akim@epita.fr>
1878
1879 `stage' was accidently included in a previous patch.
1880 Initiate its autoconfiscation.
1881
1882 * configure.in: Look for malloc.h and sys/times.h.
1883 * src/main.c (stage): Adjust.
1884 Report only when trace_flag.
1885
18862002-07-29 Akim Demaille <akim@epita.fr>
1887
1888 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
1889 state_number_t.
1890 (errs_t): symbol_t*, not symbol_number_t.
1891 (reductions_t): rule_t*, not rule_number_t.
1892 (FOR_EACH_SHIFT): New.
1893 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
1894 * src/print.c, src/print_graph.c: Adjust.
1895
18962002-07-29 Akim Demaille <akim@epita.fr>
1897
1898 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
1899
1900 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
1901 (endtoken, accept): these.
1902 * src/reader.c (reader): Set endtoken's default tag to "$end".
1903 Set undeftoken's tag to "$undefined" instead of "$undefined.".
1904 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
1905 Adjust.
1906
19072002-07-29 Akim Demaille <akim@epita.fr>
1908
1909 * src/reduce.c (reduce_grammar): When the language is empty,
1910 complain about the start symbol, not the axiom.
1911 Use its location.
1912 * tests/reduce.at (Empty Language): New.
1913
19142002-07-26 Akim Demaille <akim@epita.fr>
1915
1916 * src/reader.h, src/reader.c (gram_error): ... can't get
1917 yycontrol without making too strong assumptions on the parser
1918 itself.
1919 * src/output.c (prepare_tokens): Use the real 0th value of
1920 token_translations instead of `0'.
1921 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
1922 visible here.
1923 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
1924 for the time being: %locations ought to provide it to yyerror.
1925
19262002-07-25 Akim Demaille <akim@epita.fr>
1927
1928 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
1929 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
1930 * tests/regression.at (Web2c Actions): Adjust.
1931
19322002-07-25 Akim Demaille <akim@epita.fr>
1933
1934 Stop storing rules from 1 to nrules + 1.
1935
1936 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
1937 * src/nullable.c, src/output.c, src/print.c, src/reader.c
1938 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
1939 Iterate from 0 to nrules.
1940 Use rule_number_as_item_number and item_number_as_rule_number.
1941 Adjust to `derive' now containing possibly 0.
1942 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
1943 Handle the `- 1' part in rule numbers from/to item numbers.
1944 * src/conflicts.c (log_resolution): Fix the message which reversed
1945 shift and reduce.
1946 * src/output.c (action_row): Initialize default_rule to -1.
1947 (token_actions): Adjust.
1948 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
1949 expected output.
1950 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
1951
19522002-07-25 Akim Demaille <akim@epita.fr>
1953
1954 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
1955 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
1956 (b4_c_knr_arg_decl): New.
1957 * data/yacc.c: Use it to define yysymprint, yydestruct, and
1958 yyreport_parse_error.
1959
19602002-07-25 Akim Demaille <akim@epita.fr>
1961
1962 * data/yacc.c (yyreport_parse_error): New, extracted from...
1963 (yyparse): here.
1964 (yydestruct, yysymprint): Move above yyparse.
1965 Be K&R compliant.
1966
19672002-07-25 Akim Demaille <akim@epita.fr>
1968
1969 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
1970 replace...
1971 (b4_sint_type, b4_uint_type): these.
1972 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
1973 * tests/regression.at (Web2c Actions): Adjust.
1974
19752002-07-25 Akim Demaille <akim@epita.fr>
1976
1977 * src/gram.h (TIEM_NUMBER_MAX): New.
1978 (item_number_of_rule_number, rule_number_of_item_number): Rename
1979 as...
1980 (rule_number_as_item_number, item_number_as_rule_number): these.
1981 Adjust dependencies.
1982 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
1983 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
1984 (symbol_number_to_vector_number): New.
1985 (order): Of vector_number_t* type.
1986 (base_t, BASE_MAX, BASE_MIN): New.
1987 (froms, tos, width, pos, check): Of base_t type.
1988 (action_number_t, ACTION_MIN, ACTION_MAX): New.
1989 (actrow): Of action_number_t type.
1990 (conflrow): Of unsigned int type.
1991 (table_ninf, base_ninf): New.
1992 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
1993 (muscle_insert_int_table, muscle_insert_base_table)
1994 (muscle_insert_rule_number_table): New.
1995 (prepare_tokens): Output `toknum' as int_table.
1996 (action_row): Returns a rule_number_t.
1997 Use ACTION_MIN, not SHRT_MIN.
1998 (token_actions): yydefact is rule_number_t*.
1999 (table_ninf_remap): New.
2000 (pack_table): Use it for `base' and `table'.
2001 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
2002 replaced with...
2003 (YYPACT_NINF, YYTABLE_NINF): these.
2004 (yypact, yytable): Compute their types instead of hard-coded
2005 `short'.
2006 * tests/regression.at (Web2c Actions): Adjust.
2007
20082002-07-19 Akim Demaille <akim@epita.fr>
2009
2010 * src/scan-gram.l (id): Can start with an underscore.
2011
20122002-07-16 Akim Demaille <akim@epita.fr>
2013
2014 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
2015 Adjust all former `associativity' dependencies.
2016 * src/symtab.c (symbol_new): Default associativity is `undef', not
2017 `right'.
2018 (symbol_check_alias_consistence): Adjust.
2019
20202002-07-09 Akim Demaille <akim@epita.fr>
2021
2022 * doc/bison.texinfo: Properly set the ``header'' part.
2023 Use @dircategory ``GNU programming tools'' as per Texinfo's
2024 documentation.
2025 Use @copying.
2026
20272002-07-09 Akim Demaille <akim@epita.fr>
2028
2029 * lib/quotearg.h: Protect against multiple inclusions.
2030 * src/location.h (location_t): Add a `file' member.
2031 (LOCATION_RESET, LOCATION_PRINT): Adjust.
2032 * src/complain.c (warn_at, complain_at, fatal_at): Drop
2033 `error_one_per_line' support.
2034
20352002-07-09 Akim Demaille <akim@epita.fr>
2036
2037 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
2038 * src/reader.c (lineno): Remove.
2039 Adjust all dependencies.
2040 (get_merge_function): Take a location and use complain_at.
2041 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
2042 * tests/regression.at (Invalid inputs, Mixing %token styles):
2043 Adjust.
2044
20452002-07-09 Akim Demaille <akim@epita.fr>
2046
2047 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
2048 recovery rule, and forbid extensions when --yacc.
2049 (gram_error): Use complain_at.
2050 * src/reader.c (reader): Exit if there were parse errors.
2051
20522002-07-09 Akim Demaille <akim@epita.fr>
2053
2054 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
2055 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
2056 Reported by R Blake <blakers@mac.com>.
2057
20582002-07-09 Akim Demaille <akim@epita.fr>
2059
2060 * data/yacc.c: Output the copyright notive in the header.
2061
20622002-07-03 Akim Demaille <akim@epita.fr>
2063
2064 * src/output.c (froms, tos): Are state_number_t.
2065 (save_column): sp, sp1, and sp2 are state_number_t.
2066 (prepare): Rename `final' as `final_state_number', `nnts' as
2067 `nterms_number', `nrules' as `rules_number', `nstates' as
2068 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
2069 unused.
2070 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
2071 * data/lalr1.cc (nsym_): Remove, unused.
2072
20732002-07-03 Akim Demaille <akim@epita.fr>
2074
2075 * src/lalr.h, src/lalr.c (goto_number_t): New.
2076 * src/lalr.c (goto_list_t): New.
2077 Propagate them.
2078 * src/nullable.c (rule_list_t): New.
2079 Propagate.
2080 * src/types.h: Remove.
2081
20822002-07-03 Akim Demaille <akim@epita.fr>
2083
2084 * src/closure.c (print_fderives): Use rule_rhs_print.
2085 * src/derives.c (print_derives): Use rule_rhs_print.
2086 (rule_list_t): New, replaces `shorts'.
2087 (set_derives): Add comments.
2088 * tests/sets.at (Nullable, Firsts): Adjust.
2089
20902002-07-03 Akim Demaille <akim@epita.fr>
2091
2092 * src/output.c (prepare_actions): Free `tally' and `width'.
2093 (prepare_actions): Allocate and free `order'.
2094 * src/symtab.c (symbols_free): Free `symbols'.
2095 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
2096 * src/output.c (m4_invoke): Move to...
2097 * src/scan-skel.l: here.
2098 (<<EOF>>): Close yyout, and free its name.
2099
21002002-07-03 Akim Demaille <akim@epita.fr>
2101
2102 Fix some memory leaks, and fix a bug: state 0 was examined twice.
2103
2104 * src/LR0.c (new_state): Merge into...
2105 (state_list_append): this.
2106 (new_states): Merge into...
2107 (generate_states): here.
2108 (set_states): Don't ensure a proper `errs' state member here, do it...
2109 * src/conflicts.c (conflicts_solve): here.
2110 * src/state.h, src/state.c: Comment changes.
2111 (state_t): Rename member `shifts' as `transitions'.
2112 Adjust all dependencies.
2113 (errs_new): For consistency, also take the values as argument.
2114 (errs_dup): Remove.
2115 (state_errs_set): New.
2116 (state_reductions_set, state_transitions_set): Assert that no
2117 previous value was assigned.
2118 (state_free): New.
2119 (states_free): Use it.
2120 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
2121 temporary storage: use `errs' and `nerrs' as elsewhere.
2122 (set_conflicts): Allocate and free this `errs'.
2123
21242002-07-02 Akim Demaille <akim@epita.fr>
2125
2126 * lib/libiberty.h: New.
2127 * lib: Update the bitset implementation from upstream.
2128 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
2129 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
2130 * src/main.c: Adjust bitset stats calls.
2131
21322002-07-01 Paul Eggert <eggert@twinsun.com>
2133
2134 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
2135 char, so that negative chars don't collide with $.
2136
21372002-06-30 Akim Demaille <akim@epita.fr>
2138
2139 Have the GLR tests be `warning' checked, and fix the warnings.
2140
2141 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
2142 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
2143 (yyremoveDeletes): `yyi' and `yyj' are size_t.
2144 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
2145 (yyaddDeferredAction): static.
2146 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
2147 (yyreportParseError): yyprefix is const.
2148 yytokenp is used only when verbose.
2149 (yy__GNUC__): Replace with __GNUC__.
2150 (yypdumpstack): yyi is size_t.
2151 (yypreference): Un-yy local variables and arguments, to avoid
2152 clashes with `yyr1'. Anyway, we are not in the user name space.
2153 (yytname_size): be an int, as is compared with ints.
2154 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
2155 Use them.
2156 * tests/cxx-gram.at: Use quotation to protect $1.
2157 Use AT_COMPILE to enable warnings hunts.
2158 Prototype yylex and yyerror.
2159 `Use' argc.
2160 Include `string.h', not `strings.h'.
2161 Produce and prototype stmtMerge only when used.
2162 yylex takes a location.
2163
21642002-06-30 Akim Demaille <akim@epita.fr>
2165
2166 We spend a lot of time in quotearg, in particular when --verbose.
2167
2168 * src/symtab.c (symbol_get): Store a quoted version of the key.
2169 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
2170 Adjust all callers.
2171
21722002-06-30 Akim Demaille <akim@epita.fr>
2173
2174 * src/state.h (reductions_t): Rename member `nreds' as num.
2175 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
2176 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
2177
21782002-06-30 Akim Demaille <akim@epita.fr>
2179
2180 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
2181 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
2182 (shifts_to): Rename as...
2183 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
2184 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
2185 (TRANSITION_IS_DISABLED, transitions_to): these.
2186
21872002-06-30 Akim Demaille <akim@epita.fr>
2188
2189 * src/print.c (print_shifts, print_gotos): Merge into...
2190 (print_transitions): this.
2191 (print_transitions, print_errs, print_reductions): Align the
2192 lookaheads columns.
2193 (print_core, print_transitions, print_errs, print_state,
2194 print_grammar): Output empty lines separator before, not after.
2195 (state_default_rule_compute): Rename as...
2196 (state_default_rule): this.
2197 * tests/conflicts.at (Defaulted Conflicted Reduction),
2198 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
2199 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
2200
22012002-06-30 Akim Demaille <akim@epita.fr>
2202
2203 Display items as we display rules.
2204
2205 * src/gram.h, src/gram.c (rule_lhs_print): New.
2206 * src/gram.c (grammar_rules_partial_print): Use it.
2207 * src/print.c (print_core): Likewise.
2208 * tests/conflicts.at (Defaulted Conflicted Reduction),
2209 (Unresolved SR Conflicts): Adjust.
2210 (Unresolved SR Conflicts): Adjust and rename as...
2211 (Resolved SR Conflicts): this, as was meant.
2212 * tests/regression.at (Web2c Report): Adjust.
2213
22142002-06-30 Akim Demaille <akim@epita.fr>
2215
2216 * src/print.c (state_default_rule_compute): New, extracted from...
2217 (print_reductions): here.
2218 Pessimize, but clarify the code.
2219 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
2220
22212002-06-30 Akim Demaille <akim@epita.fr>
2222
2223 * src/output.c (action_row): Let default_rule be always a rule
2224 number.
2225
22262002-06-30 Akim Demaille <akim@epita.fr>
2227
2228 * src/closure.c (print_firsts, print_fderives, closure):
2229 Use BITSET_EXECUTE.
2230 * src/lalr.c (lookaheads_print): Likewise.
2231 * src/state.c (state_rule_lookaheads_print): Likewise.
2232 * src/print_graph.c (print_core): Likewise.
2233 * src/print.c (print_reductions): Likewise.
2234 * src/output.c (action_row): Likewise.
2235 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
2236
22372002-06-30 Akim Demaille <akim@epita.fr>
2238
2239 * src/print_graph.c: Use report_flag.
2240
22412002-06-30 Akim Demaille <akim@epita.fr>
2242
2243 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
2244 to...
2245 * src/relation.h, src/relation.c (traverse, relation_digraph)
2246 (relation_print, relation_transpose): New.
2247
22482002-06-30 Akim Demaille <akim@epita.fr>
2249
2250 * src/state.h, src/state.c (shifts_to): New.
2251 * src/lalr.c (build_relations): Use it.
2252
22532002-06-30 Akim Demaille <akim@epita.fr>
2254
2255 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
2256 (item_number_of_rule_number, rule_number_of_item_number): New.
2257 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
2258 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
2259 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
2260 Propagate their use.
2261 Much remains to be done, in particular wrt `shorts' from types.h.
2262
22632002-06-30 Akim Demaille <akim@epita.fr>
2264
2265 * src/symtab.c (symbol_new): Initialize the `printer' member.
2266
22672002-06-30 Akim Demaille <akim@epita.fr>
2268
2269 * src/LR0.c (save_reductions): Remove, replaced by...
2270 * src/state.h, src/state.c (state_reductions_set): New.
2271 (reductions, errs): Rename as...
2272 (reductions_t, errs_t): these.
2273 Adjust all dependencies.
2274
22752002-06-30 Akim Demaille <akim@epita.fr>
2276
2277 * src/LR0.c (state_list_t, state_list_append): New.
2278 (first_state, last_state): Now symbol_list_t.
2279 (this_state): Remove.
2280 (new_itemsets, append_states, save_reductions): Take a state_t as
2281 argument.
2282 (set_states, generate_states): Adjust.
2283 (save_shifts): Remove, replaced by...
2284 * src/state.h, src/state.c (state_shifts_set): New.
2285 (shifts): Rename as...
2286 (shifts_t): this.
2287 Adjust all dependencies.
2288 * src/state.h (state_t): Remove the `next' member.
2289
22902002-06-30 Akim Demaille <akim@epita.fr>
2291
2292 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
2293 escaped in slot 0.
2294
22952002-06-30 Akim Demaille <akim@epita.fr>
2296
2297 Use hash.h for the state hash table.
2298
2299 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
2300 (allocate_storage): Use state_hash_new.
2301 (free_storage): Use state_hash_free.
2302 (new_state, get_state): Adjust.
2303 * src/lalr.h, src/lalr.c (states): Move to...
2304 * src/states.h (state_t): Remove the `link' member, no longer
2305 used.
2306 * src/states.h, src/states.c: here.
2307 (state_hash_new, state_hash_free, state_hash_lookup)
2308 (state_hash_insert, states_free): New.
2309 * src/states.c (state_table, state_compare, state_hash): New.
2310 * src/output.c (output_actions): Do not free states now, since we
2311 still need to know the final_state number in `prepare', called
2312 afterwards. Do it...
2313 * src/main.c (main): here: call states_free after `output'.
2314
23152002-06-30 Akim Demaille <akim@epita.fr>
2316
2317 * src/state.h, src/state.c (state_new): New, extracted from...
2318 * src/LR0.c (new_state): here.
2319 * src/state.h (STATE_ALLOC): Move to...
2320 * src/state.c: here.
2321 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
2322 * src/state.h, src/state.c: here.
2323
23242002-06-30 Akim Demaille <akim@epita.fr>
2325
2326 * src/reader.c (gensym): Rename as...
2327 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
2328 (getsym): Rename as...
2329 (symbol_get): this.
2330
23312002-06-30 Akim Demaille <akim@epita.fr>
2332
2333 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
2334 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
2335 * src/output.c, src/print.c, src/print_graph.c: Propagate.
2336 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
2337
23382002-06-30 Akim Demaille <akim@epita.fr>
2339
2340 Make the test suite pass with warnings checked.
2341
2342 * tests/actions.at (Printers and Destructors): Improve.
2343 Avoid unsigned vs. signed issues.
2344 * tests/calc.at: Don't exercise the scanner here, do it...
2345 * tests/input.at (Torturing the Scanner): here.
2346
23472002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2348
2349 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
2350 reorganize first lines parallel to yacc.c.
2351
23522002-06-28 Akim Demaille <akim@epita.fr>
2353
2354 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
2355 (b4_token_enum, b4_token_defines): New, factored from...
2356 * data/lalr1.cc, data/yacc.c, glr.c: here.
2357
23582002-06-28 Akim Demaille <akim@epita.fr>
2359
2360 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
2361 unused variables.
2362 * src/output.c (merger_output): static.
2363
23642002-06-28 Akim Demaille <akim@epita.fr>
2365
2366 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
2367 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
2368 pacify GCC.
2369 * src/output.c (save_row): Initialize all the variables to pacify GCC.
2370
23712002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2372
2373 Accumulated changelog for new GLR parsing features.
2374
2375 * src/conflicts.c (count_total_conflicts): Change name to
2376 conflicts_total_count.
2377 * src/conflicts.h: Ditto.
2378 * src/output.c (token_actions): Use the new name.
2379 (output_conflicts): Change conflp => conflict_list_heads, and
2380 confl => conflict_list for better readability.
2381 * data/glr.c: Use the new names.
2382 * NEWS: Add self to GLR announcement.
2383
2384 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
2385
2386 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
2387 Akim Demaille.
2388
2389 * data/bison.glr: Change name to glr.c
2390 * data/glr.c: Renamed from bison.glr.
2391 * data/Makefile.am: Add glr.c
2392
2393 * src/getargs.c:
2394
2395 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
2396 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
2397
2398 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2399
2400 * data/bison.glr: Be sure to restore the
2401 current #line when returning to the skeleton contents after having
2402 exposed the input file's #line.
2403
2404 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2405
2406 * data/bison.glr: Bring up to date with changes to bison.simple.
2407
2408 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2409
2410 * data/bison.glr: Correct definitions that use b4_prefix.
2411 Various reformatting.
2412 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
2413 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
2414 yytokenp argument; now part of stack.
2415 (yychar): Define to behave as documented.
2416 (yyclearin): Ditto.
2417
2418 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2419
2420 * src/reader.h: Add declaration for free_merger_functions.
2421
2422 * src/reader.c (merge_functions): New variable.
2423 (get_merge_function): New function.
2424 (free_merger_functions): New function.
2425 (readgram): Check for %prec that is not followed by a symbol.
2426 Handle %dprec and %merge declarations.
2427 (packgram): Initialize dprec and merger fields in rules array.
2428
2429 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
2430 conflict_list_cnt, conflict_list_free): New variables.
2431 (table_grow): Also grow conflict_table.
2432 (prepare_rules): Output dprec and merger tables.
2433 (conflict_row): New function.
2434 (action_row): Output conflict lists for GLR parser. Don't use
2435 default reduction in conflicted states for GLR parser so that there
2436 are spaces for the conflict lists.
2437 (save_row): Also save conflict information.
2438 (token_actions): Allocate conflict list.
2439 (merger_output): New function.
2440 (pack_vector): Pack conflict table, too.
2441 (output_conflicts): New function to output yyconflp and yyconfl.
2442 (output_check): Allocate conflict_tos.
2443 (output_actions): Output conflict tables, also.
2444 (output_skeleton): Output b4_mergers definition.
2445 (prepare): Output b4_max_rhs_length definition.
2446 Use 'bison.glr' as default skeleton for GLR parsers.
2447
2448 * src/gram.c (glr_parser): New flag.
2449 (grammar_free): Call free_merger_functions.
2450
2451 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
2452 all pairs of conflicting reductions, rather than just all tokens
2453 causing conflicts. Needed to size conflict tables.
2454 (conflicts_output): Modify call to count_rr_conflicts for new
2455 interface.
2456 (conflicts_print): Ditto.
2457 (count_total_conflicts): New function.
2458
2459 * src/reader.h (merger_list): New type.
2460 (merge_functions): New variable.
2461
2462 * src/lex.h (tok_dprec, tok_merge): New token types.
2463
2464 * src/gram.h (rule_s): Add dprec and merger fields.
2465 (glr_parser): New flag.
2466
2467 * src/conflicts.h (count_total_conflicts): New function.
2468
2469 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
2470
2471 * doc/bison.texinfo (Generalized LR Parsing): New section.
2472 (GLR Parsers): New section.
2473 (Language and Grammar): Mention GLR parsing.
2474 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
2475 Correct typo ("tge" -> "the").
2476
2477 * data/bison.glr: New skeleton for GLR parsing.
2478
2479 * tests/cxx-gram.at: New tests for GLR parsing.
2480
2481 * tests/testsuite.at: Include cxx-gram.at.
2482
2483 * tests/Makefile.am: Add cxx-gram.at.
2484
2485 * src/parse-gram.y:
2486
2487 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
2488
2489 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
2490
24912002-06-27 Akim Demaille <akim@epita.fr>
2492
2493 * src/options.h, src/options.c: Remove.
2494 * src/getargs.c (short_options, long_options): New.
2495
24962002-06-27 Akim Demaille <akim@epita.fr>
2497
2498 * data/bison.simple, data/bison.c++: Rename as...
2499 * data/yacc.c, data/lalr1.cc: these.
2500 * doc/bison.texinfo (Environment Variables): Remove.
2501
25022002-06-25 Raja R Harinath <harinath@cs.umn.edu>
2503
2504 * src/getargs.c (report_argmatch): Initialize strtok().
2505
25062002-06-20 Akim Demaille <akim@epita.fr>
2507
2508 * data/bison.simple (b4_symbol_actions): New, replaces...
2509 (b4_symbol_destructor, b4_symbol_printer): these.
2510 (yysymprint): Be sure to call YYPRINT only for tokens, and using
2511 user token numbers.
2512
25132002-06-20 Akim Demaille <akim@epita.fr>
2514
2515 * data/bison.simple (yydestructor): Rename as...
2516 (yydestruct): this.
2517
25182002-06-20 Akim Demaille <akim@epita.fr>
2519
2520 * src/symtab.h, src/symtab.c (symbol_type_set)
2521 (symbol_destructor_set, symbol_precedence_set): The location is
2522 the last argument.
2523 Adjust all callers.
2524
25252002-06-20 Akim Demaille <akim@epita.fr>
2526
2527 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
2528 internals.
2529 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
2530 Takes a location.
2531 * src/symtab.h, src/symtab.c (symbol_class_set)
2532 (symbol_user_token_number_set): Likewise.
2533 Adjust all callers.
2534 Promote complain_at.
2535 * tests/input.at (Type Clashes): Adjust.
2536
25372002-06-20 Akim Demaille <akim@epita.fr>
2538
2539 * data/bison.simple (YYLEX): Fix the declaration when
2540 %pure-parser.
2541
25422002-06-20 Akim Demaille <akim@epita.fr>
2543
2544 * data/bison.simple (yysymprint): Don't print the token number,
2545 just its name.
2546 * tests/actions.at (Destructors): Rename as...
2547 (Printers and Destructors): this.
2548 Also exercise %printer.
2549
25502002-06-20 Akim Demaille <akim@epita.fr>
2551
2552 * data/bison.simple (YYDSYMPRINT): New.
2553 Use it to remove many of the #if YYDEBUG/if (yydebug).
2554
25552002-06-20 Akim Demaille <akim@epita.fr>
2556
2557 * src/symtab.h, src/symtab.c (symbol_t): printer and
2558 printer_location are new members.
2559 (symbol_printer_set): New.
2560 * src/parse-gram.y (PERCENT_PRINTER): New token.
2561 Handle its associated rule.
2562 * src/scan-gram.l: Adjust.
2563 (handle_destructor_at, handle_destructor_dollar): Rename as...
2564 (handle_symbol_code_at, handle_symbol_code_dollar): these.
2565 * src/output.c (symbol_printers_output): New.
2566 (output_skeleton): Call it.
2567 * data/bison.simple (yysymprint): New. Cannot be named yyprint
2568 since there are already many grammar files with a user `yyprint'.
2569 Replace the calls to YYPRINT to calls to yysymprint.
2570 * tests/calc.at: Adjust.
2571 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
2572 taking advantage of parser very internal details (stack size!).
2573
25742002-06-20 Akim Demaille <akim@epita.fr>
2575
2576 * src/scan-gram.l: Complete the scanner with the missing patterns
2577 to pacify Flex.
2578 Use `quote' and `symbol_tag_get' where appropriate.
2579
25802002-06-19 Akim Demaille <akim@epita.fr>
2581
2582 * tests/actions.at (Destructors): Augment to test locations.
2583 * data/bison.simple (yydestructor): Pass it the current location
2584 if locations are enabled.
2585 Prototype only when __STDC__ or C++.
2586 Change the argument names to move into the yy name space: there is
2587 user code here.
2588
25892002-06-19 Akim Demaille <akim@epita.fr>
2590
2591 * data/bison.simple (b4_pure_if): New.
2592 Use it instead of #ifdef YYPURE.
2593
25942002-06-19 Akim Demaille <akim@epita.fr>
2595
2596 * data/bison.simple (b4_location_if): New.
2597 Use it instead of #ifdef YYLSP_NEEDED.
2598
25992002-06-19 Akim Demaille <akim@epita.fr>
2600
2601 Prepare @$ in %destructor, but currently don't bind it in the
2602 skeleton, as %location use is not cleaned up yet.
2603
2604 * src/scan-gram.l (handle_dollar, handle_destructor_at)
2605 (handle_action_at): New.
2606 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
2607 a braced_code_t and a location as additional arguments.
2608 (handle_destructor_dollar): Instead of requiring `b4_eval', just
2609 unquote one when outputting `b4_dollar_dollar'.
2610 Adjust callers.
2611 * data/bison.simple (b4_eval): Remove.
2612 (b4_symbol_destructor): Adjust.
2613 * tests/input.at (Invalid @n): Adjust.
2614
26152002-06-19 Zack Weinberg <zack@codesourcery.com>
2616
2617 * doc/bison.texinfo: Document ability to have multiple
2618 prologue sections.
2619
26202002-06-18 Akim Demaille <akim@epita.fr>
2621
2622 * src/files.c (compute_base_names): When computing the output file
2623 names from the input file name, strip the directory part.
2624
26252002-06-18 Akim Demaille <akim@epita.fr>
2626
2627 * data/bison.simple.new: Comment changes.
2628 Reported by Andreas Schwab.
2629
26302002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
2631
2632 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
2633 there are no `label `yyoverflowlab' defined but not used' warnings
2634 when yyoverflow is defined.
2635
26362002-06-18 Akim Demaille <akim@epita.fr>
2637
2638 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
2639 new member.
2640 (symbol_destructor_set): Adjust.
2641 * src/output.c (symbol_destructors_output): Output the destructor
2642 locations.
2643 Output the symbol name.
2644 * data/bison.simple (b4_symbol_destructor): Adjust.
2645
26462002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
2647 and Akim Demaille <akim@epita.fr>
2648
2649 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
2650 what's left on the stack when the error recovery hits EOF.
2651 * tests/actions.at (Destructors): Complete to exercise this case.
2652
26532002-06-17 Akim Demaille <akim@epita.fr>
2654
2655 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
2656 arguments is really empty, not only equal to `[]'.
2657 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
2658 member.
2659 (symbol_destructor_set): New.
2660 * src/output.c (symbol_destructors_output): New.
2661 * src/reader.h (brace_code_t, current_braced_code): New.
2662 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
2663 (handle_dollar): Rename as...
2664 (handle_action_dollar): this.
2665 (handle_destructor_dollar): New.
2666 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
2667 (grammar_declaration): Use it.
2668 * data/bison.simple (yystos): Is always defined.
2669 (yydestructor): New.
2670 * tests/actions.at (Destructors): New.
2671 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
2672
26732002-06-17 Akim Demaille <akim@epita.fr>
2674
2675 * src/symlist.h, src/symlist.c (symbol_list_length): New.
2676 * src/scan-gram.l (handle_dollar, handle_at): Compute the
2677 rule_length only when needed.
2678 * src/output.c (actions_output, token_definitions_output): Output
2679 the full M4 block.
2680 * src/symtab.c: Don't access directly to the symbol tag, use
2681 symbol_tag_get.
2682 * src/parse-gram.y: Use symbol_list_free.
2683
26842002-06-17 Akim Demaille <akim@epita.fr>
2685
2686 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
2687 (symbol_list_prepend, get_type_name): Move to...
2688 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
2689 (symbol_list_prepend, symbol_list_n_type_name_get): here.
2690 Adjust all callers.
2691 (symbol_list_free): New.
2692 * src/scan-gram.l (handle_dollar): Takes a location.
2693 * tests/input.at (Invalid $n): Adjust.
2694
26952002-06-17 Akim Demaille <akim@epita.fr>
2696
2697 * src/reader.h, src/reader.c (symbol_list_new): Export it.
2698 (symbol_list_prepend): New.
2699 * src/parse-gram.y (%union): `list' is a new member.
2700 (symbols.1): New, replaces...
2701 (terms_to_prec.1, nterms_to_type.1): these.
2702 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
2703 Take a location as additional argument.
2704 Adjust all callers.
2705
27062002-06-15 Akim Demaille <akim@epita.fr>
2707
2708 * src/parse-gram.y: Move %token in the declaration section so that
2709 we don't depend upon CVS Bison.
2710
27112002-06-15 Akim Demaille <akim@epita.fr>
2712
2713 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
2714 * src/print.c (print_core): Use it.
2715
27162002-06-15 Akim Demaille <akim@epita.fr>
2717
2718 * src/conflicts.c (log_resolution): Accept the rule involved in
2719 the sr conflicts instead of the lookahead number that points to
2720 that rule.
2721 (flush_reduce): Accept the current lookahead vector as argument,
2722 instead of the index in LA.
2723 (resolve_sr_conflict): Accept the current number of lookahead
2724 bitset to consider for the STATE, instead of the index in LA.
2725 (set_conflicts): Adjust.
2726 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
2727
27282002-06-15 Akim Demaille <akim@epita.fr>
2729
2730 * src/state.h (state_t): Replace the `lookaheadsp' member, a
2731 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
2732 Adjust all dependencies.
2733 * src/lalr.c (initialize_lookaheads): Split into...
2734 (states_lookaheads_count, states_lookaheads_initialize): these.
2735 (lalr): Adjust.
2736
27372002-06-15 Akim Demaille <akim@epita.fr>
2738
2739 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
2740 out of...
2741 (grammar_rules_print): here.
2742 * src/reduce.c (reduce_output): Use it.
2743 * tests/reduce.at (Useless Rules, Reduced Automaton)
2744 (Underivable Rules): Adjust.
2745
27462002-06-15 Akim Demaille <akim@epita.fr>
2747
2748 Copy BYacc's nice way to report the grammar.
2749
2750 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
2751 New.
2752 Don't print the rules' location, it is confusing and useless.
2753 (rule_print): Use grammar_rhs_print.
2754 * src/print.c (print_grammar): Use grammar_rules_print.
2755
27562002-06-15 Akim Demaille <akim@epita.fr>
2757
2758 Complete and rationalize `useless thing' warnings.
2759
2760 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
2761 (symbol_tag_print): New.
2762 Use them everywhere in place of accessing directly the tag member.
2763 * src/gram.h, src/gram.c (rule_print): New.
2764 Use it where a rule used to be printed `by hand'.
2765 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
2766 (reduce_grammar_tables): Report the useless rules.
2767 (reduce_print): Useless things are a warning, not an error.
2768 Report it as such.
2769 * tests/reduce.at (Useless Nonterminals, Useless Rules):
2770 (Reduced Automaton, Underivable Rules): Adjust.
2771 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
2772 * tests/conflicts.at (Unresolved SR Conflicts)
2773 (Solved SR Conflicts): Adjust.
2774
27752002-06-15 Akim Demaille <akim@epita.fr>
2776
2777 Let symbols have a location.
2778
2779 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
2780 (getsym): Adjust.
2781 Adjust all callers.
2782 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
2783 Use location_t, not int.
2784 * src/symtab.c (symbol_check_defined): Take advantage of the
2785 location.
2786 * tests/regression.at (Invalid inputs): Adjust.
2787
27882002-06-15 Akim Demaille <akim@epita.fr>
2789
2790 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
2791 (input): Don't try to initialize yylloc here, do it in the
2792 scanner.
2793 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
2794 * src/gram.h (rule_t): Change line and action_line into location
2795 and action_location, of location_t type.
2796 Adjust all dependencies.
2797 * src/location.h, src/location.c (empty_location): New.
2798 * src/reader.h, src/reader.c (grammar_start_symbol_set)
2799 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
2800 (grammar_current_rule_symbol_append)
2801 (grammar_current_rule_action_append): Expect a location as argument.
2802 * src/reader.c (grammar_midrule_action): Adjust to attach an
2803 action's location as dummy symbol location.
2804 * src/symtab.h, src/symtab.c (startsymbol_location): New.
2805 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
2806 the line numbers.
2807
28082002-06-14 Akim Demaille <akim@epita.fr>
2809
2810 Grammar declarations may be found in the grammar section.
2811
2812 * src/parse-gram.y (rules_or_grammar_declaration): New.
2813 (declarations): Each declaration may end with a semicolon, not
2814 just...
2815 (grammar_declaration): `"%union"'.
2816 (grammar): Branch to rules_or_grammar_declaration.
2817
28182002-06-14 Akim Demaille <akim@epita.fr>
2819
2820 * src/main.c (main): Invoke scanner_free.
2821
28222002-06-14 Akim Demaille <akim@epita.fr>
2823
2824 * src/output.c (m4_invoke): Extracted from...
2825 (output_skeleton): here.
2826 Free tempfile.
2827
28282002-06-14 Akim Demaille <akim@epita.fr>
2829
2830 * src/parse-gram.y (directives, directive, gram)
2831 (grammar_directives, precedence_directives, precedence_directive):
2832 Rename as...
2833 (declarations, declaration, grammar, grammar_declaration)
2834 (precedence_declaration, precedence_declarator): these.
2835 (symbol_declaration): New.
2836
28372002-06-14 Akim Demaille <akim@epita.fr>
2838
2839 * src/files.c (action_obstack): Remove, unused.
2840 (output_obstack): Remove it, and all its dependencies, as it is no
2841 longer needed.
2842 * src/reader.c (epilogue_set): Build the epilogue in the
2843 muscle_obstack.
2844 * src/output.h, src/output.c (muscle_obstack): Move to...
2845 * src/muscle_tab.h, src/muscle_tab.h: here.
2846 (muscle_init): Initialize muscle_obstack.
2847 (muscle_free): New.
2848 * src/main.c (main): Call it.
2849
28502002-06-14 Akim Demaille <akim@epita.fr>
2851
2852 * src/location.h: New, extracted from...
2853 * src/reader.h: here.
2854 * src/Makefile.am (noinst_HEADERS): Merge into
2855 (bison_SOURCES): this.
2856 Add location.h.
2857 * src/parse-gram.y: Use location_t instead of Bison's.
2858 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
2859 Use location_t instead of ints.
2860
28612002-06-14 Akim Demaille <akim@epita.fr>
2862
2863 * data/bison.simple, data/bison.c++: Be sure to restore the
2864 current #line when returning to the skeleton contents after having
2865 exposed the input file's #line.
2866
28672002-06-12 Akim Demaille <akim@epita.fr>
2868
2869 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
2870 eager.
2871 * tests/actions.at (Exotic Dollars): New.
2872
28732002-06-12 Akim Demaille <akim@epita.fr>
2874
2875 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
2876 ['"/] too eagerly.
2877 * tests/input.at (Torturing the Scanner): New.
2878
28792002-06-11 Akim Demaille <akim@epita.fr>
2880
2881 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
2882 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
2883 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
2884 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
2885 * src/reader.c (reader): Use it.
2886
28872002-06-11 Akim Demaille <akim@epita.fr>
2888
2889 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
2890 Adjust all callers.
2891 (scanner_last_string_free): New.
2892
28932002-06-11 Akim Demaille <akim@epita.fr>
2894
2895 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
2896 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
2897 (last_string, YY_OBS_FREE): New.
2898 Use them when returning an ID.
2899
29002002-06-11 Akim Demaille <akim@epita.fr>
2901
2902 Have Bison grammars parsed by a Bison grammar.
2903
2904 * src/reader.c, src/reader.h (prologue_augment): New.
2905 * src/reader.c (copy_definition): Remove.
2906
2907 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
2908 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
2909 (grammar_current_rule_prec_set, grammar_current_rule_check)
2910 (grammar_current_rule_symbol_append)
2911 (grammar_current_rule_action_append): Export.
2912 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
2913 (symbol_list_action_append): Remove.
2914 Hook the routines from reader.
2915 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
2916 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
2917
2918 * src/reader.c (read_declarations): Remove, unused.
2919
2920 * src/parse-gram.y: Handle the epilogue.
2921 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
2922 (grammar_start_symbol_set): this.
2923 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
2924 * src/reader.c (readgram): Remove, unused.
2925 (reader): Adjust to insert eoftoken and axiom where appropriate.
2926
2927 * src/reader.c (copy_dollar): Replace with...
2928 * src/scan-gram.h (handle_dollar): this.
2929 * src/parse-gram.y: Remove `%thong'.
2930
2931 * src/reader.c (copy_at): Replace with...
2932 * src/scan-gram.h (handle_at): this.
2933
2934 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
2935 New.
2936
2937 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
2938 time being.
2939
2940 * src/reader.h, src/reader.c (grammar_rule_end): New.
2941
2942 * src/parse.y (current_type, current_class): New.
2943 Implement `%nterm', `%token' support.
2944 Merge `%term' into `%token'.
2945 (string_as_id): New.
2946 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
2947 type name.
2948
2949 * src/parse-gram.y: Be sure to handle properly the beginning of
2950 rules.
2951
2952 * src/parse-gram.y: Handle %type.
2953 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
2954
2955 * src/parse-gram.y: More directives support.
2956 * src/options.c: No longer handle source directives.
2957
2958 * src/parse-gram.y: Fix %output.
2959
2960 * src/parse-gram.y: Handle %union.
2961 Use the prologue locations.
2962 * src/reader.c (parse_union_decl): Remove.
2963
2964 * src/reader.h, src/reader.c (epilogue_set): New.
2965 * src/parse-gram.y: Use it.
2966
2967 * data/bison.simple, data/bison.c++: b4_stype is now either not
2968 defined, then default to int, or to the contents of %union,
2969 without `union' itself.
2970 Adjust.
2971 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
2972
2973 * src/output.c (actions_output): Don't output braces, as they are
2974 already handled by the scanner.
2975
2976 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
2977 characters to themselves.
2978
2979 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
2980 that the epilogue has a proper #line.
2981
2982 * src/parse-gram.y: Handle precedence/associativity.
2983
2984 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
2985 a terminal.
2986 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
2987 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
2988 at all to define terminals that cannot be emitted.
2989
2990 * src/scan-gram.l: Escape M4 characters.
2991
2992 * src/scan-gram.l: Working properly with escapes in user
2993 strings/characters.
2994
2995 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
2996 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
2997 grammar.
2998 Use more modest sizes, as for the time being the parser does not
2999 release memory, and therefore the process swallows a huge amount
3000 of memory.
3001
3002 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
3003 stricter %token grammar.
3004
3005 * src/symtab.h (associativity): Add `undef_assoc'.
3006 (symbol_precedence_set): Do nothing when passed an undef_assoc.
3007 * src/symtab.c (symbol_check_alias_consistence): Adjust.
3008
3009 * tests/regression.at (Invalid %directive): Remove, as it is now
3010 meaningless.
3011 (Invalid inputs): Adjust to the new error messages.
3012 (Token definitions): The new grammar doesn't allow too many
3013 eccentricities.
3014
3015 * src/lex.h, src/lex.c: Remove.
3016 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
3017 (copy_character, copy_string2, copy_string, copy_identifier)
3018 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
3019 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
3020 (parse_action): Remove.
3021 * po/POTFILES.in: Adjust.
3022
30232002-06-11 Akim Demaille <akim@epita.fr>
3024
3025 * src/reader.c (parse_action): Don't store directly into the
3026 rule's action member: return the action as a string.
3027 Don't require `rule_length' as an argument: compute it.
3028 (grammar_current_rule_symbol_append)
3029 (grammar_current_rule_action_append): New, eved out from
3030 (readgram): here.
3031 Remove `action_flag', `rulelength', unused now.
3032
30332002-06-11 Akim Demaille <akim@epita.fr>
3034
3035 * src/reader.c (grammar_current_rule_prec_set).
3036 (grammar_current_rule_check): New, eved out from...
3037 (readgram): here.
3038 Remove `xaction', `first_rhs': useless.
3039 * tests/input.at (Type clashes): New.
3040 * tests/existing.at (GNU Cim Grammar): Adjust.
3041
30422002-06-11 Akim Demaille <akim@epita.fr>
3043
3044 * src/reader.c (grammar_midrule_action): New, Eved out from
3045 (readgram): here.
3046
30472002-06-11 Akim Demaille <akim@epita.fr>
3048
3049 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
3050 New.
3051 (readgram): Use them as replacement of inlined code, crule and
3052 crule1.
3053
30542002-06-11 Akim Demaille <akim@epita.fr>
3055
3056 * src/reader.c (grammar_end, grammar_symbol_append): New.
3057 (readgram): Use them.
3058 Make the use of `p' as local as possible.
3059
30602002-06-10 Akim Demaille <akim@epita.fr>
3061
3062 GCJ's parser requires the tokens to be defined before the prologue.
3063
3064 * data/bison.simple: Output the token definition before the user's
3065 prologue.
3066 * tests/regression.at (Braces parsing, Duplicate string)
3067 (Mixing %token styles): Check the output from bison.
3068 (Early token definitions): New.
3069
30702002-06-10 Akim Demaille <akim@epita.fr>
3071
3072 * src/symtab.c (symbol_user_token_number_set): Don't complain when
3073 assigning twice the same user number to a token, so that we can
3074 use it in...
3075 * src/lex.c (lex): here.
3076 Also use `symbol_class_set' instead of hand written code.
3077 * src/reader.c (parse_assoc_decl): Likewise.
3078
30792002-06-10 Akim Demaille <akim@epita.fr>
3080
3081 * src/symtab.c, src/symtab.c (symbol_class_set)
3082 (symbol_user_token_number_set): New.
3083 * src/reader.c (parse_token_decl): Use them.
3084 Use a switch instead of ifs.
3085 Use a single argument.
3086
30872002-06-10 Akim Demaille <akim@epita.fr>
3088
3089 Remove `%thong' support as it is undocumented, unused, duplicates
3090 `%token's job, and creates useless e-mail traffic with people who
3091 want to know what it is, why it is undocumented, unused, and
3092 duplicates `%token's job.
3093
3094 * src/reader.c (parse_thong_decl): Remove.
3095 * src/options.c (option_table): Remove "thong".
3096 * src/lex.h (tok_thong): Remove.
3097
30982002-06-10 Akim Demaille <akim@epita.fr>
3099
3100 * src/symtab.c, src/symtab.c (symbol_type_set)
3101 (symbol_precedence_set): New.
3102 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
3103 (value_components_used): Remove, unused.
3104
31052002-06-09 Akim Demaille <akim@epita.fr>
3106
3107 Move symbols handling code out of the reader.
3108
3109 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
3110 (axiom): Move to...
3111 * src/symtab.h, src/symtab.c: here.
3112
3113 * src/gram.c (start_symbol): Remove: use startsymbol->number.
3114 * src/reader.c (startval): Rename as...
3115 * src/symtab.h, src/symtab.c (startsymbol): this.
3116 * src/reader.c: Adjust.
3117
3118 * src/reader.c (symbol_check_defined, symbol_make_alias)
3119 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
3120 (token_translations_init)
3121 Move to...
3122 * src/symtab.c: here.
3123 * src/reader.c (packsymbols): Move to...
3124 * src/symtab.h, src/symtab.c (symbols_pack): here.
3125 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
3126 argument.
3127
31282002-06-03 Akim Demaille <akim@epita.fr>
3129
3130 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
3131 then statements.
3132
31332002-06-03 Akim Demaille <akim@epita.fr>
3134
3135 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
3136 structs with non literals.
3137 * src/scan-skel.l: never-interactive.
3138 * src/conflicts.c (enum conflict_resolution_e): No trailing
3139 comma.
3140 * src/getargs.c (usage): Split long literal strings.
3141 Reported by Hans Aberg.
3142
31432002-05-28 Akim Demaille <akim@epita.fr>
3144
3145 * data/bison.c++: Use C++ ostreams.
3146 (cdebug_): New member.
3147
31482002-05-28 Akim Demaille <akim@epita.fr>
3149
3150 * src/output.c (output_skeleton): Be sure to allocate enough room
3151 for `/' _and_ for `\0' in full_skeleton.
3152
31532002-05-28 Akim Demaille <akim@epita.fr>
3154
3155 * data/bison.c++: Catch up with bison.simple:
3156 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3157 and Paul Eggert <eggert@twinsun.com>: `error' handing.
3158 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
3159 and popping traces.
3160
31612002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3162
3163 * src/output.c (output_skeleton): Put an explicit path in front of
3164 the skeleton file name, rather than relying on the -I directory,
3165 to partially alleviate effects of having a skeleton file lying around
3166 in the current directory.
3167
31682002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3169
3170 * src/conflicts.c (log_resolution): Correct typo:
3171 obstack_printf should be obstack_fgrow1.
3172
31732002-05-26 Akim Demaille <akim@epita.fr>
3174
3175 * src/state.h (state_t): `solved_conflicts' is a new member.
3176 * src/LR0.c (new_state): Set it to 0.
3177 * src/conflicts.h, src/conflicts.c (print_conflicts)
3178 (free_conflicts, solve_conflicts): Rename as...
3179 (conflicts_print, conflicts_free, conflicts_solve): these.
3180 Adjust callers.
3181 * src/conflicts.c (enum conflict_resolution_e)
3182 (solved_conflicts_obstack): New, used by...
3183 (log_resolution): this.
3184 Adjust to attach the conflict resolution to each state.
3185 Complete the description with the precedence/associativity
3186 information.
3187 (resolve_sr_conflict): Adjust.
3188 * src/print.c (print_state): Output its solved_conflicts.
3189 * tests/conflicts.at (Unresolved SR Conflicts)
3190 (Solved SR Conflicts): Exercise --report=all.
3191
31922002-05-26 Akim Demaille <akim@epita.fr>
3193
3194 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
3195 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
3196 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
3197 (token_number_t, item_number_as_token_number)
3198 (token_number_as_item_number, muscle_insert_token_number_table):
3199 Rename as...
3200 (symbol_number_t, item_number_as_symbol_number)
3201 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
3202 these, since it is more appropriate.
3203
32042002-05-26 Akim Demaille <akim@epita.fr>
3205
3206 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
3207 `Error:' lines.
3208 * data/bison.simple (yystos) [YYDEBUG]: New.
3209 (yyparse) [YYDEBUG]: Display the symbols which are popped during
3210 error recovery.
3211 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
3212
32132002-05-25 Akim Demaille <akim@epita.fr>
3214
3215 * doc/bison.texinfo (Debugging): Split into...
3216 (Tracing): this new section, its former contents, and...
3217 (Understanding): this new section.
3218 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
3219 by...
3220 (report_flag): this.
3221 Adjust all dependencies.
3222 (report_args, report_types, report_argmatch): New.
3223 (usage, getargs): Report/support -r, --report.
3224 * src/options.h
3225 (struct option_table_struct): Rename as..,
3226 (struct option_table_s): this.
3227 Rename the `set_flag' member to `flag' to match with getopt_long's
3228 struct.
3229 * src/options.c (option_table): Split verbose into an entry for
3230 %verbose, and another for --verbose.
3231 Support --report/-r, so remove -r from the obsolete --raw.
3232 * src/print.c: Attach full item sets and lookaheads reports to
3233 report_flag instead of trace_flag.
3234 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
3235
32362002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3237 and Paul Eggert <eggert@twinsun.com>
3238
3239 * data/bison.simple (yyparse): Correct error handling to conform to
3240 POSIX and yacc. Specifically, after syntax error is discovered,
3241 do not reduce further before shifting the error token.
3242 Clean up the code a bit by removing the labels yyerrdefault,
3243 yyerrhandle, yyerrpop.
3244 * NEWS: Document the above.
3245
32462002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3247
3248 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
3249 type; it isn't always big enough, since it doesn't necessarily
3250 include non-terminals.
3251 (yytranslate): Expand definition of yy_token_number_type, so that
3252 the latter can be removed.
3253 (yy_token_number_type): Remove, only one use.
3254 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
3255 don't use TokenNumberType as element type.
3256
3257 * tests/regression.at: Modify expected output to agree with change
3258 to yyr1 and yytranslate.
3259
32602002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
3261
3262 * src/reader.c (parse_action): Use copy_character instead of
3263 obstack_1grow.
3264
32652002-05-13 Akim Demaille <akim@epita.fr>
3266
3267 * tests/regression.at (Token definitions): Prototype yylex and
3268 yyerror.
3269
32702002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3271
3272 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
3273 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
3274 32-bit arithmetic.
3275 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
3276
32772002-05-07 Akim Demaille <akim@epita.fr>
3278
3279 * tests/synclines.at: Be sure to prototype yylex and yyerror to
3280 avoid GCC warnings.
3281
32822002-05-07 Akim Demaille <akim@epita.fr>
3283
3284 Kill GCC warnings.
3285
3286 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
3287 over the RHS of each rule.
3288 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
3289 * src/state.h (state_t): Member `nitems' is unsigned short.
3290 * src/LR0.c (get_state): Adjust.
3291 * src/reader.c (packgram): Likewise.
3292 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
3293 `Type'.
3294 (muscle_insert_int_table): Remove, unused.
3295 (prepare_rules): Remove `max'.
3296
32972002-05-06 Akim Demaille <akim@epita.fr>
3298
3299 * src/closure.c (print_firsts): Display of the symbol tags.
3300 (bitmatrix_print): Move to...
3301 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
3302 here.
3303 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
3304
33052002-05-06 Akim Demaille <akim@epita.fr>
3306
3307 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
3308 hash_do_for_each.
3309
33102002-05-06 Akim Demaille <akim@epita.fr>
3311
3312 * src/LR0.c (new_state, get_state): Instead of using the global
3313 `kernel_size' and `kernel_base', have two new arguments:
3314 `core_size' and `core'.
3315 Adjust callers.
3316
33172002-05-06 Akim Demaille <akim@epita.fr>
3318
3319 * src/reader.c (packgram): No longer end `ritem' with a 0
3320 sentinel: it is not used.
3321
33222002-05-05 Akim Demaille <akim@epita.fr>
3323
3324 New experimental feature: display the lookaheads in the report and
3325 graph.
3326
3327 * src/print (print_core): When --trace-flag, display the rules
3328 lookaheads.
3329 * src/print_graph.c (print_core): Likewise.
3330 Swap the arguments.
3331 Adjust caller.
3332
33332002-05-05 Akim Demaille <akim@epita.fr>
3334
3335 * tests/torture.at (Many lookaheads): New test.
3336
33372002-05-05 Akim Demaille <akim@epita.fr>
3338
3339 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
3340 (GENERATE_MUSCLE_INSERT_TABLE): this.
3341 (output_int_table, output_unsigned_int_table, output_short_table)
3342 (output_token_number_table, output_item_number_table): Replace with...
3343 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
3344 (muscle_insert_short_table, muscle_insert_token_number_table)
3345 (muscle_insert_item_number_table): these.
3346 Adjust all callers.
3347 (prepare_tokens): Don't free `translations', since...
3348 * src/reader.h, src/reader.c (grammar_free): do it.
3349 Move to...
3350 * src/gram.h, src/gram.c (grammar_free): here.
3351 * data/bison.simple, data/bison.c++: b4_token_number_max is now
3352 b4_translate_max.
3353
33542002-05-05 Akim Demaille <akim@epita.fr>
3355
3356 * src/output.c (output_unsigned_int_table): New.
3357 (prepare_rules): `i' is unsigned.
3358 `prhs', `rline', `r2' are unsigned int.
3359 Rename muscle `rhs_number_max' as `rhs_max'.
3360 Output muscles `prhs_max', `rline_max', and `r2_max'.
3361 Free rline and r1.
3362 * data/bison.simple, data/bison.c++: Adjust to use these muscles
3363 to compute types instead of constant types.
3364 * tests/regression.at (Web2c Actions): Adjust.
3365
33662002-05-04 Akim Demaille <akim@epita.fr>
3367
3368 * src/symtab.h (SALIAS, SUNDEF): Rename as...
3369 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
3370 Adjust dependencies.
3371 * src/output.c (token_definitions_output): Be sure not to output a
3372 `#define 'a'' when fed with `%token 'a' "a"'.
3373 * tests/regression.at (Token definitions): New.
3374
33752002-05-03 Paul Eggert <eggert@twinsun.com>
3376
3377 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
3378 for K&R C.
3379
33802002-05-03 gettextize <bug-gnu-gettext@gnu.org>
3381
3382 * Makefile.am (SUBDIRS): Remove intl.
3383 (EXTRA_DIST): Add config/config.rpath.
3384
33852002-05-03 Akim Demaille <akim@epita.fr>
3386
3387 * data/bison.simple (m4_if): Don't output empty enums.
3388 And actually, output valid enum definitions :(.
3389
33902002-05-03 Akim Demaille <akim@epita.fr>
3391
3392 * configure.bat: Remove, completely obsolete.
3393 * Makefile.am (EXTRA_DIST): Adjust.
3394 Don't distribute config.rpath...
3395 * config/Makefile.am (EXTRA_DIST): Do it.
3396
33972002-05-03 Akim Demaille <akim@epita.fr>
3398
3399 * configure.in (GETTEXT_VERSION): New.
3400 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
3401
34022002-05-03 Akim Demaille <akim@epita.fr>
3403
3404 * data/bison.simple (b4_token_enum): New.
3405 (b4_token_defines): Use it to output tokens both as #define and
3406 enums.
3407 Suggested by Paul Eggert.
3408 * src/output.c (token_definitions_output): Don't output spurious
3409 white spaces.
3410
34112002-05-03 Akim Demaille <akim@epita.fr>
3412
3413 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
3414
34152002-05-02 Robert Anisko <robert@lrde.epita.fr>
3416
3417 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
3418 Update the stack class, give a try to deque as the default container.
3419
34202002-05-02 Akim Demaille <akim@epita.fr>
3421
3422 * data/bison.simple (yyparse): Do not implement @$ = @1.
3423 (YYLLOC_DEFAULT): Adjust to do it.
3424 * doc/bison.texinfo (Location Default Action): Fix.
3425
34262002-05-02 Akim Demaille <akim@epita.fr>
3427
3428 * src/reader.c (parse_braces): Merge into...
3429 (parse_action): this.
3430
34312002-05-02 Akim Demaille <akim@epita.fr>
3432
3433 * configure.in (ALL_LINGUAS): Remove.
3434 * po/LINGUAS, hr.po: New.
3435
34362002-05-02 Akim Demaille <akim@epita.fr>
3437
3438 Remove the so called hairy (semantic) parsers.
3439
3440 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
3441 * src/gram.h, src/gram.c (semantic_parser): Remove.
3442 (rule_t): Remove the guard and guard_line members.
3443 * src/lex.h (token_t): remove tok_guard.
3444 * src/options.c (option_table): Remove %guard and %semantic_parser
3445 support.
3446 * src/output.c, src/output.h (guards_output): Remove.
3447 (prepare): Adjust.
3448 (token_definitions_output): Don't output the `T'
3449 tokens (???).
3450 (output_skeleton): Don't output the guards.
3451 * src/files.c, src/files.c (attrsfile): Remove.
3452 * src/reader.c (symbol_list): Remove the guard and guard_line
3453 members.
3454 Adjust dependencies.
3455 (parse_guard): Remove.
3456 * data/bison.hairy: Remove.
3457 * doc/bison.texinfo (Environment Variables): Remove occurrences of
3458 BISON_HAIRY.
3459
34602002-05-02 Akim Demaille <akim@epita.fr>
3461
3462 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
3463 (parse_guard): Rename the formal argument `stack_offset' as
3464 `rule_length', which is more readable.
3465 Adjust callers.
3466 (copy_at, copy_dollar): Instead of outputting the hard coded
3467 values of $$, $n and so forth, output invocation to b4_lhs_value,
3468 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
3469 Note: this patch partially drops `semantic-parser' support: it
3470 always does `rule_length - n', where semantic parsers ought to
3471 always use `-n'.
3472 * data/bison.simple, data/bison.c++ (b4_lhs_value)
3473 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
3474
34752002-05-02 Akim Demaille <akim@epita.fr>
3476
3477 * configure.in (AC_INIT): Bump to 1.49b.
3478 (AM_INIT_AUTOMAKE): Short invocation.
3479
34802002-05-02 Akim Demaille <akim@epita.fr>
3481
3482 Version 1.49a.
3483
34842002-05-01 Akim Demaille <akim@epita.fr>
3485
3486 * src/skeleton.h: Remove.
3487
34882002-05-01 Akim Demaille <akim@epita.fr>
3489
3490 * src/skeleton.h: Fix the #endif.
3491 Reported by Magnus Fromreide.
3492
34932002-04-26 Paul Eggert <eggert@twinsun.com>
3494
3495 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
3496 Define if we define YYSTYPE and YYLTYPE, respectively.
3497 (YYCOPY): Fix [] quoting problem in the non-GCC case.
3498
34992002-04-25 Robert Anisko <robert@lrde.epita.fr>
3500
3501 * src/scan-skel.l: Postprocess quadrigraphs.
3502
3503 * src/reader.c (copy_character): New function, used to output
3504 single characters while replacing `[' and `]' with quadrigraphs, to
3505 avoid troubles with M4 quotes.
3506 (copy_comment): Output characters with copy_character.
3507 (read_additionnal_code): Likewise.
3508 (copy_string2): Likewise.
3509 (copy_definition): Likewise.
3510
3511 * tests/calc.at: Exercise M4 quoting.
3512
35132002-04-25 Akim Demaille <akim@epita.fr>
3514
3515 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
3516 between `!' and the command.
3517 Reported by Paul Eggert.
3518
35192002-04-24 Robert Anisko <robert@lrde.epita.fr>
3520
3521 * tests/calc.at: Exercise prologue splitting.
3522
3523 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
3524 `b4_post_prologue' instead of `b4_prologue'.
3525
3526 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
3527 muscles.
3528 (output): Free pre_prologue_obstack and post_prologue_obstack.
3529 * src/files.h, src/files.c (attrs_obstack): Remove.
3530 (pre_prologue_obstack, post_prologue_obstack): New.
3531 * src/reader.c (copy_definition): Add a parameter to specify the
3532 obstack to fill, instead of using attrs_obstack unconditionally.
3533 (read_declarations): Pass pre_prologue_obstack to copy_definition if
3534 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
3535
35362002-04-23 Paul Eggert <eggert@twinsun.com>
3537
3538 * data/bison.simple: Remove unnecessary commentary and white
3539 space differences from 1_29-branch.
3540 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
3541
3542 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
3543 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
3544 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
3545 constructors or destructors.
3546
3547 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
3548
35492002-04-23 Akim Demaille <akim@epita.fr>
3550
3551 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
3552 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
3553 location with columns.
3554 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
3555 All reported by Paul Eggert.
3556
35572002-04-22 Akim Demaille <akim@epita.fr>
3558
3559 * src/reduce.c (dump_grammar): Move to...
3560 * src/gram.h, src/gram.c (grammar_dump): here.
3561 Be sure to separate long item numbers.
3562 Don't read the members of a rule's prec if its nil.
3563
35642002-04-22 Akim Demaille <akim@epita.fr>
3565
3566 * src/output.c (table_size, table_grow): New.
3567 (MAXTABLE): Remove, replace uses with table_size.
3568 (pack_vector): Instead of dying when the table is too big, grow it.
3569
35702002-04-22 Akim Demaille <akim@epita.fr>
3571
3572 * data/bison.simple (yyr1): Its type is that of a token number.
3573 * data/bison.c++ (r1_): Likewise.
3574 * tests/regression.at (Web2c Actions): Adjust.
3575
35762002-04-22 Akim Demaille <akim@epita.fr>
3577
3578 * src/reader.c (token_translations_init): 256 is now the default
3579 value for the error token, i.e., it will be assigned another
3580 number if the user assigned 256 to one of her tokens.
3581 (reader): Don't force 256 to error.
3582 * doc/bison.texinfo (Symbols): Adjust.
3583 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
3584 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
3585 etc. instead of 10, 20, 30 (which was used to `jump' over error
3586 (256) and undefined (2)).
3587
35882002-04-22 Akim Demaille <akim@epita.fr>
3589
3590 Propagate more token_number_t.
3591
3592 * src/gram.h (token_number_as_item_number)
3593 (item_number_as_token_number): New.
3594 * src/output.c (GENERATE_OUTPUT_TABLE): New.
3595 Use it to create output_item_number_table and
3596 output_token_number_table.
3597 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
3598 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
3599 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
3600 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
3601
36022002-04-22 Akim Demaille <akim@epita.fr>
3603
3604 * src/output.h, src/output.c (get_lines_number): Remove.
3605
36062002-04-19 Akim Demaille <akim@epita.fr>
3607
3608 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
3609 as Lex/Flex'.
3610 (Debugging): More details about enabling the debugging features.
3611 (Table of Symbols): Describe $$, $n, @$, and @n.
3612 Suggested by Tim Josling.
3613
36142002-04-19 Akim Demaille <akim@epita.fr>
3615
3616 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
3617
36182002-04-10 Akim Demaille <akim@epita.fr>
3619
3620 * src/system.h: Rely on HAVE_LIMITS_H.
3621 Suggested by Paul Eggert.
3622
36232002-04-09 Akim Demaille <akim@epita.fr>
3624
3625 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
3626 full stderr, and strip it according to the bison options, instead
3627 of composing the error message from different bits.
3628 This makes it easier to check for several error messages.
3629 Adjust all the invocations.
3630 Add an invocation exercising the error token.
3631 Add an invocation demonstrating a stupid error message.
3632 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
3633 Adjust the tests.
3634 Error message are for stderr, not stdout.
3635
36362002-04-09 Akim Demaille <akim@epita.fr>
3637
3638 * src/gram.h, src/gram.c (error_token_number): Remove, use
3639 errtoken->number.
3640 * src/reader.c (reader): Don't specify the user token number (2)
3641 for $undefined, as it uselessly prevents using it.
3642 * src/gram.h (token_number_t): Move to...
3643 * src/symtab.h: here.
3644 (state_t.number): Is a token_number_t.
3645 * src/print.c, src/reader.c: Use undeftoken->number instead of
3646 hard coded 2.
3647 (Even though this 2 is not the same as above: the number of the
3648 undeftoken remains being 2, it is its user token number which
3649 might not be 2).
3650 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
3651 `user_token_number_max'.
3652 Output `undef_token_number'.
3653 * data/bison.simple, data/bison.c++: Use them.
3654 Be sure to map invalid yylex return values to
3655 `undef_token_number'. This saves us from gratuitous SEGV.
3656
3657 * tests/conflicts.at (Solved SR Conflicts)
3658 (Unresolved SR Conflicts): Adjust.
3659 * tests/regression.at (Web2c Actions): Adjust.
3660
36612002-04-08 Akim Demaille <akim@epita.fr>
3662
3663 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
3664 Adding #line.
3665 Remove the duplicate `typedefs'.
3666 (RhsNumberType): Fix the declaration and various other typos.
3667 Use __ofile__.
3668 * data/bison.simple: Use __ofile__.
3669 * src/scan-skel.l: Handle __ofile__.
3670
36712002-04-08 Akim Demaille <akim@epita.fr>
3672
3673 * src/gram.h (item_number_t): New, the type of item numbers in
3674 RITEM. Note that it must be able to code symbol numbers as
3675 positive number, and the negation of rule numbers as negative
3676 numbers.
3677 Adjust all dependencies (pretty many).
3678 * src/reduce.c (rule): Remove this `short *' pointer: use
3679 item_number_t.
3680 * src/system.h (MINSHORT, MAXSHORT): Remove.
3681 Include `limits.h'.
3682 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
3683 (shortcpy): Remove.
3684 (MAXTABLE): Move to...
3685 * src/output.c (MAXTABLE): here.
3686 (prepare_rules): Use output_int_table to output rhs.
3687 * data/bison.simple, data/bison.c++: Adjust.
3688 * tests/torture.at (Big triangle): Move the limit from 254 to
3689 500.
3690 * tests/regression.at (Web2c Actions): Ajust.
3691
3692 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
3693 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
3694 passes, but produces negative #line number, once fixed, GCC is
3695 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
3696 C), it passes.
3697 * src/state.h (state_h): Code input lines on ints, not shorts.
3698
36992002-04-08 Akim Demaille <akim@epita.fr>
3700
3701 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
3702 and then the grammar.
3703
37042002-04-08 Akim Demaille <akim@epita.fr>
3705
3706 * src/system.h: No longer using strndup.
3707
37082002-04-07 Akim Demaille <akim@epita.fr>
3709
3710 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
3711 * src/output.c (output_table_data): Return the longest number.
3712 (prepare_tokens): Output `token_number_max').
3713 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
3714 New.
3715 Use them to define yy_token_number_type/TokenNumberType.
3716 Use this type for yytranslate.
3717 * tests/torture.at (Big triangle): Push the limit from 124 to
3718 253.
3719 * tests/regression.at (Web2c Actions): Adjust.
3720
37212002-04-07 Akim Demaille <akim@epita.fr>
3722
3723 * tests/torture.at (Big triangle): New.
3724 (GNU AWK Grammar, GNU Cim Grammar): Move to...
3725 * tests/existing.at: here.
3726
37272002-04-07 Akim Demaille <akim@epita.fr>
3728
3729 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
3730 nritems.
3731 Adjust dependencies.
3732
37332002-04-07 Akim Demaille <akim@epita.fr>
3734
3735 * src/reader.c: Normalize increments to prefix form.
3736
37372002-04-07 Akim Demaille <akim@epita.fr>
3738
3739 * src/reader.c, symtab.c: Remove debugging code.
3740
37412002-04-07 Akim Demaille <akim@epita.fr>
3742
3743 Rename all the `bucket's as `symbol_t'.
3744
3745 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
3746 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
3747 * src/symtab.c, src/symtab.h (bucket): Rename as...
3748 (symbol_t): this.
3749 (symbol_list_new, bucket_check_defined, bucket_make_alias)
3750 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
3751 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3752 (buckets_new, buckets_free, buckets_do): Rename as...
3753 (symbol_list_new, symbol_check_defined, symbol_make_alias)
3754 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
3755 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
3756 (symbols_new, symbols_free, symbols_do): these.
3757
37582002-04-07 Akim Demaille <akim@epita.fr>
3759
3760 Use lib/hash for the symbol table.
3761
3762 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
3763 EOF.
3764 * src/lex.c (lex): Set the `number' member of new terminals.
3765 * src/reader.c (bucket_check_defined, bucket_make_alias)
3766 (bucket_check_alias_consistence, bucket_translation): New.
3767 (reader, grammar_free, readgram, token_translations_init)
3768 (packsymbols): Adjust.
3769 (reader): Number the predefined tokens.
3770 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
3771 for predefined tokens.
3772 * src/symtab.h (bucket): Remove all the hash table related
3773 members.
3774 * src/symtab.c (symtab): Replace by...
3775 (bucket_table): this.
3776 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3777 (buckets_new, buckets_do): New.
3778
37792002-04-07 Akim Demaille <akim@epita.fr>
3780
3781 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
3782 (start_symbol, max_user_token_number, semantic_parser)
3783 (error_token_number): Initialize.
3784 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
3785 Initialize.
3786 (reader): Don't.
3787 (errtoken, eoftoken, undeftoken, axiom): Extern.
3788
37892002-04-07 Akim Demaille <akim@epita.fr>
3790
3791 * src/gram.h (rule_s): prec and precsym are now pointers
3792 to the bucket giving the priority/associativity.
3793 Member `associativity' removed: useless.
3794 * src/reduce.c, src/conflicts.c: Adjust.
3795
37962002-04-07 Akim Demaille <akim@epita.fr>
3797
3798 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
3799 Properly escape the symbols' TAG when outputting them.
3800
38012002-04-07 Akim Demaille <akim@epita.fr>
3802
3803 * src/lalr.h (LA): Is a bitsetv, not bitset*.
3804
38052002-04-07 Akim Demaille <akim@epita.fr>
3806
3807 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
3808 (LArule): this, which is an array to rule_t*.
3809 * src/print.c, src/conflicts.c: Adjust.
3810
38112002-04-07 Akim Demaille <akim@epita.fr>
3812
3813 * src/gram.h (rule_t): Rename `number' as `user_number'.
3814 `number' is a new member.
3815 Adjust dependencies.
3816 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
3817
38182002-04-07 Akim Demaille <akim@epita.fr>
3819
3820 As a result of the previous patch, it is no longer needed
3821 to reorder ritem itself.
3822
3823 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
3824
38252002-04-07 Akim Demaille <akim@epita.fr>
3826
3827 Be sure never to walk through RITEMS, but use only data related to
3828 the rules themselves. RITEMS should be banished.
3829
3830 * src/output.c (output_token_translations): Rename as...
3831 (prepare_tokens): this.
3832 In addition to `translate', prepare the muscles `tname' and
3833 `toknum', which were handled by...
3834 (output_rule_data): this.
3835 Remove, and move the remainder of its outputs into...
3836 (prepare_rules): this new routines, which also merges content from
3837 (output_gram): this.
3838 (prepare_rules): Be sure never to walk through RITEMS.
3839 (output_stos): Rename as...
3840 (prepare_stos): this.
3841 (output): Always invoke prepare_states, after all, just don't use it
3842 in the output if you don't need it.
3843
38442002-04-07 Akim Demaille <akim@epita.fr>
3845
3846 * src/LR0.c (new_state): Display `nstates' as the name of the
3847 newly created state.
3848 Adjust to initialize first_state and last_state if needed.
3849 Be sure to distinguish the initial from the final state.
3850 (new_states): Create the itemset of the initial state, and use
3851 new_state.
3852 * src/closure.c (closure): Now that the initial state has its
3853 items properly set, there is no need for a special case when
3854 creating `ruleset'.
3855
3856 As a result, now the rule 0, reducing to $axiom, is visible in the
3857 outputs. Adjust the test suite.
3858
3859 * tests/conflicts.at (Solved SR Conflicts)
3860 (Unresolved SR Conflicts): Adjust.
3861 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
3862 * tests/conflicts.at (S/R in initial): New.
3863
38642002-04-07 Akim Demaille <akim@epita.fr>
3865
3866 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
3867 the RHS of the rules.
3868 * src/output.c (output_gram): Likewise.
3869
38702002-04-07 Akim Demaille <akim@epita.fr>
3871
3872 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
3873 bucket.
3874 Adjust all dependencies.
3875 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
3876 `number' of the buckets too.
3877 * src/gram.h: Include `symtab.h'.
3878 (associativity): Move to...
3879 * src/symtab.h: here.
3880 No longer include `gram.h'.
3881
38822002-04-07 Akim Demaille <akim@epita.fr>
3883
3884 * src/gram.h, src/gram.c (rules_rhs_length): New.
3885 (ritem_longest_rhs): Use it.
3886 * src/gram.h (rule_t): `number' is a new member.
3887 * src/reader.c (packgram): Set it.
3888 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
3889 the end of `rules', and count them out of `nrules'.
3890 (reduce_output, dump_grammar): Adjust.
3891 * src/print.c (print_grammar): It is no longer needed to check for
3892 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
3893 * tests/reduce.at (Reduced Automaton): New test.
3894
38952002-04-07 Akim Demaille <akim@epita.fr>
3896
3897 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
3898 lacking `+ 1' to nrules, Bison reported as useless a token if it
3899 was used solely to set the precedence of the last rule...
3900
39012002-04-07 Akim Demaille <akim@epita.fr>
3902
3903 * data/bison.c++, data/bison.simple: Don't output the current file
3904 name in #line, to avoid useless diffs between two identical
3905 outputs under different names.
3906
39072002-04-07 Akim Demaille <akim@epita.fr>
3908
3909 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
3910 Normalize loops to using `< nrules + 1', not `<= nrules'.
3911
39122002-04-07 Akim Demaille <akim@epita.fr>
3913
3914 * TODO: Update.
3915
39162002-04-07 Akim Demaille <akim@epita.fr>
3917
3918 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
3919 bucket.value as bucket.number.
3920
39212002-04-07 Akim Demaille <akim@epita.fr>
3922
3923 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
3924 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
3925 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
3926 RHS, instead of being an index in RITEMS.
3927
39282002-04-04 Paul Eggert <eggert@twinsun.com>
3929
3930 * doc/bison.texinfo: Update copyright date.
3931 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
3932 (Symbols): Warn about running Bison in one character set,
3933 but compiling and/or running in an incompatible one.
3934 Warn about character code 256, too.
3935
39362002-04-03 Paul Eggert <eggert@twinsun.com>
3937
3938 * src/bison.data (YYSTACK_ALLOC): Depend on whether
3939 YYERROR_VERBOSE is nonzero, not whether it is defined.
3940
3941 Merge changes from bison-1_29-branch.
3942
39432002-03-20 Paul Eggert <eggert@twinsun.com>
3944
3945 Merge fixes from Debian bison_1.34-1.diff.
3946
3947 * configure.in (AC_PREREQ): 2.53.
3948
39492002-03-20 Akim Demaille <akim@epita.fr>
3950
3951 * src/conflicts.c (log_resolution): Argument `resolution' is const.
3952
39532002-03-19 Paul Eggert <eggert@twinsun.com>
3954
3955 * src/bison.simple (YYCOPY): New macro.
3956 (YYSTACK_RELOCATE): Use it.
3957 Remove Type arg; no longer needed. All callers changed.
3958 (yymemcpy): Remove; no longer needed.
3959
3960 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
3961 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3962
39632002-03-19 Akim Demaille <akim@epita.fr>
3964
3965 Test and fix the #line outputs.
3966
3967 * tests/atlocal.at (GCC): New.
3968 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
3969 (Prologue synch line, ,%union synch line, Postprologue synch line)
3970 (Action synch line, Epilogue synch line): New tests.
3971 * src/reader.c (parse_union_decl): Define the muscle stype_line.
3972 * data/bison.simple, data/bison.c++: Use it.
3973
39742002-03-19 Akim Demaille <akim@epita.fr>
3975
3976 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
3977 (Solved SR Conflicts, %expect not enough, %expect right)
3978 (%expect too much): Move to...
3979 * tests/conflicts.at: this new file.
3980
39812002-03-19 Akim Demaille <akim@epita.fr>
3982
3983 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
3984 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
3985 that we can move to enums for instance.
3986 * src/output.c (token_definitions_output): Output a list of
3987 `token-name, token-number' instead of the #define.
3988 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
3989
39902002-03-14 Akim Demaille <akim@epita.fr>
3991
3992 Use Gettext 0.11.1.
3993
39942002-03-09 Robert Anisko <robert@lrde.epita.fr>
3995
3996 * data/bison.c++: Make the user able to add members to the generated
3997 parser by subclassing.
3998
39992002-03-05 Robert Anisko <robert@lrde.epita.fr>
4000
4001 * src/reader.c (read_additionnal_code): `c' should be an integer, not
4002 a character.
4003 Reported by Nicolas Tisserand and Nicolas Burrus.
4004
40052002-03-04 Robert Anisko <robert@lrde.epita.fr>
4006
4007 * src/reader.c: Warn about lacking semi-colons, do not complain.
4008
40092002-03-04 Robert Anisko <robert@lrde.epita.fr>
4010
4011 * data/bison.c++: Remove a debug line.
4012
40132002-03-04 Robert Anisko <robert@lrde.epita.fr>
4014
4015 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
4016 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
4017 provide a default implementation.
4018
40192002-03-04 Akim Demaille <akim@epita.fr>
4020
4021 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
4022 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
4023 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
4024 * tests/semantic.at (Parsing Guards): Similarly.
4025 * src/reader.at (readgram): Complain if the last rule is not ended
4026 with a semi-colon.
4027
40282002-03-04 Akim Demaille <akim@epita.fr>
4029
4030 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
4031 * src/closure.c: here.
4032 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
4033 RTC.
4034 * src/warshall.h, src/warshall.c: Remove.
4035 * tests/sets.at (Broken Closure): Adjust.
4036
40372002-03-04 Akim Demaille <akim@epita.fr>
4038
4039 * src/output.c (output_skeleton): tempdir is const.
4040 bytes_read is unused.
4041
40422002-03-04 Akim Demaille <akim@epita.fr>
4043
4044 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
4045 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
4046 Update.
4047 From Michael Hayes.
4048
40492002-03-04 Akim Demaille <akim@epita.fr>
4050
4051 * src/closure.c (closure): `r' is unused.
4052
40532002-03-04 Akim Demaille <akim@epita.fr>
4054
4055 * tests/sets.at (Broken Closure): Add the ending `;'.
4056 * src/reader.at (readgram): Complain if a rule is not ended with a
4057 semi-colon.
4058
40592002-03-04 Akim Demaille <akim@epita.fr>
4060
4061 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
4062 (count_sr_conflicts): Use bitset_count.
4063 * src/reduce.c (inaccessable_symbols): Ditto.
4064 (bits_size): Remove.
4065 * src/warshall.h, src/warshall.c: Convert to bitsetv.
4066
40672002-03-04 Akim Demaille <akim@epita.fr>
4068
4069 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
4070 * src/reduce.c: Remove the `bitset_zero's following the
4071 `bitset_create's, as now it is performed by the latter.
4072
40732002-03-04 Akim Demaille <akim@epita.fr>
4074
4075 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
4076 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
4077 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
4078 latest sources from Michael.
4079
40802002-03-04 Akim Demaille <akim@epita.fr>
4081
4082 * src/output.c (output): Don't free the grammar.
4083 * src/reader.c (grammar_free): New.
4084 * src/main.c (main): Call it and don't free symtab here.
4085
40862002-03-04 Akim Demaille <akim@epita.fr>
4087
4088 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
4089 before returning.
4090 Reported by Benoit Perrot.
4091
40922002-03-04 Akim Demaille <akim@epita.fr>
4093
4094 Use bitset operations when possible, not loops over bits.
4095
4096 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
4097 bitset_or.
4098 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
4099 * src/reduce.c (useless_nonterminals): Formatting changes.
4100 * src/warshall.c (TC): Use bitset_or.
4101
41022002-03-04 Akim Demaille <akim@epita.fr>
4103
4104 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
4105 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
4106 Ditto.
4107
41082002-03-04 Akim Demaille <akim@epita.fr>
4109
4110 * src/lalr.c (F): Now a bitset*.
4111 Adjust all dependencies.
4112
41132002-03-04 Akim Demaille <akim@epita.fr>
4114
4115 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
4116 Adjust all dependencies.
4117
41182002-03-04 Akim Demaille <akim@epita.fr>
4119
4120 * src/L0.c, src/LR0.h (nstates): Be size_t.
4121 Adjust comparisons (signed vs unsigned).
4122 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
4123 bitset*.
4124 Adjust all dependencies.
4125
41262002-03-04 Akim Demaille <akim@epita.fr>
4127
4128 * src/closure.c (firsts): Now, also a bitset.
4129 Adjust all dependencies.
4130 (varsetsize): Remove, now unused.
4131 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
4132
41332002-03-04 Akim Demaille <akim@epita.fr>
4134
4135 * src/print.c: Convert to use bitset.h, not hand coded iterations
4136 over ints.
4137
41382002-03-04 Akim Demaille <akim@epita.fr>
4139
4140 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
4141
41422002-03-04 Akim Demaille <akim@epita.fr>
4143
4144 * src/closure.c (ruleset): Be a bitset.
4145 (rulesetsize): Remove.
4146
41472002-03-04 Akim Demaille <akim@epita.fr>
4148
4149 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
4150 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
4151 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
4152 * src/closure.c (fderives): Be an array of bitsets.
4153
41542002-02-28 Robert Anisko <robert@lrde.epita.fr>
4155
4156 * data/bison.c++: Merge the two generated headers. Insert a copyright
4157 notice in each output file.
4158
41592002-02-28 Akim Demaille <akim@epita.fr>
4160
4161 * data/bison.c++: Copy the prologue of bison.simple to fetch
4162 useful M4 definitions, such as b4_header_guard.
4163
41642002-02-25 Akim Demaille <akim@epita.fr>
4165
4166 * src/getargs.c (version): Give the name of the authors, and use a
4167 translator friendly scheme for the bgr
4168 copyright notice.
4169
41702002-02-25 Akim Demaille <akim@epita.fr>
4171
4172 * src/output.c (header_output): Remove, now handled completely via
4173 M4.
4174
41752002-02-25 Akim Demaille <akim@epita.fr>
4176
4177 * m4/m4.m4: New, from CVS Autoconf.
4178 * configure.in: Invoke it.
4179 * src/output.c (output_skeleton): Use its result instead of the
4180 hard coded name.
4181
41822002-02-25 Akim Demaille <akim@epita.fr>
4183
4184 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
4185 Fileutils 4.1.5.
4186 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
4187 * src/output.c (output_skeleton): Use mkstemp to create a real
4188 temporary file.
4189 Move the filling of `skeleton' and its muscle to...
4190 (prepare): here.
4191 (output): Move the definition of the prologue muscle to...
4192 (prepare): here.
4193 * src/system.h (DEFAULT_TMPDIR): New.
4194
41952002-02-14 Paul Eggert <eggert@twinsun.com>
4196
4197 Remove the support for C++ namespace cleanliness; it was
4198 causing more problems than it was curing, since it didn't work
4199 properly on some nonstandard C++ compilers. This can wait
4200 for a proper C++ parser.
4201
4202 * NEWS: Document this.
4203 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
4204 of C++, as it's treated like C now.
4205 * src/bison.simple (YYSTD): Remove.
4206 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
4207 Treat C++ just like Standard C instead of trying to support
4208 namespace cleanliness.
4209
42102002-02-14 Akim Demaille <akim@epita.fr>
4211
4212 * tests/regression.at (else): Adjust to Andreas' change.
4213
42142002-02-14 Akim Demaille <akim@epita.fr>
4215
4216 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
4217
42182002-02-13 Andreas Schwab <schwab@suse.de>
4219
4220 * src/output.c (output_rule_data): Don't output NULL, it might
4221 not be defined yet.
4222
42232002-02-11 Robert Anisko <robert@lrde.epita.fr>
4224
4225 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
4226 (Copyright notice): Update.
4227
42282002-02-11 Akim Demaille <akim@epita.fr>
4229
4230 * tests/regression.at (%nonassoc and eof): Don't include
4231 nonportable headers.
4232
42332002-02-08 Robert Anisko <robert@lrde.epita.fr>
4234
4235 * data/bison.c++: Correct error recovery. Make the user able to
4236 initialize the starting location.
4237
42382002-02-07 Akim Demaille <akim@epita.fr>
4239
4240 * tests/input.at: New.
4241
42422002-02-07 Robert Anisko <robert@lrde.epita.fr>
4243
4244 * data/bison.c++: Replace some direct m4 expansions by constants. Be
4245 more consistent when naming methods and variables. Put preprocessor
4246 directives around tables only needed for debugging.
4247
42482002-02-07 Robert Anisko <robert@lrde.epita.fr>
4249
4250 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
4251 C++ parsers.
4252 (yy::b4_name::parse): Use print_.
4253
42542002-02-07 Robert Anisko <robert@lrde.epita.fr>
4255
4256 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
4257
42582002-02-07 Robert Anisko <robert@lrde.epita.fr>
4259
4260 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
4261 C++ parsers.
4262 (yy::b4_name::parse): Build verbose error messages, and use error_.
4263
42642002-02-06 Robert Anisko <robert@lrde.epita.fr>
4265
4266 * data/bison.c++: Fix m4 quoting in comments.
4267
42682002-02-06 Robert Anisko <robert@lrde.epita.fr>
4269
4270 * data/bison.c++: Adjust the parser code. Fix some muscles that were
4271 not expanded by m4.
4272
42732002-02-05 Akim Demaille <akim@epita.fr>
4274
4275 * data/bison.c++: Adjust to the M4 back end.
4276 More is certainly needed.
4277
42782002-02-05 Akim Demaille <akim@epita.fr>
4279
4280 Give a try to M4 as a back end.
4281
4282 * lib/readpipe.c: New, from wdiff.
4283 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
4284 BISON_HAIRY.
4285 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
4286 specific values. Now it is m4 that performs the lookup.
4287 * src/parse-skel.y: Remove.
4288 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
4289 * src/output.c (actions_output, guards_output)
4290 (token_definitions_output): No longer keeps track of the output
4291 line number, hence remove the second argument.
4292 (guards_output): Check against the guard member of a rule, not the
4293 action member.
4294 Adjust callers.
4295 (output_skeleton): Don't look for the skeleton location, let m4 do
4296 that.
4297 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
4298 file will be used.
4299 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
4300 (prepare): Given that for the time being changesyntax is not
4301 usable in M4, rename the muscles using `-' to `_'.
4302 Define `defines_flag', `output_parser_name' and `output_header_name'.
4303 * src/output.h (actions_output, guards_output)
4304 (token_definitions_output): Adjust prototypes.
4305 * src/scan-skel.l: Instead of scanning the skeletons, it now
4306 processes the output of m4: `__oline__' and `#output'.
4307 * data/bison.simple: Adjust to be used by M4(sugar).
4308 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
4309 to date.
4310 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
4311 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
4312 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
4313 shamelessly stolen from CVS Autoconf.
4314
43152002-02-05 Akim Demaille <akim@epita.fr>
4316
4317 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
4318 * configure.in: Check for the declarations of free and malloc.
4319 * src/muscle_tab.c: Adjust.
4320
43212002-02-05 Akim Demaille <akim@epita.fr>
4322
4323 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
4324 which have no values.
4325
43262002-02-05 Akim Demaille <akim@epita.fr>
4327
4328 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
4329 * data/: here.
4330
43312002-01-29 Paul Eggert <eggert@twinsun.com>
4332
4333 * src/bison.simple (YYSIZE_T): Do not define merely because
4334 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
4335 On some platforms, <alloca.h> does not declare YYSTD (size_t).
4336
43372002-01-27 Akim Demaille <akim@epita.fr>
4338
4339 Fix `%nonassoc and eof'.
4340
4341 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
4342 which were not properly copied! Replace
4343 memcpy (res->errs, src->errs, src->nerrs);
4344 with
4345 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
4346 !!!
4347 * tests/regression.at (%nonassoc and eof): Adjust to newest
4348 Autotest: `.' is not in the PATH.
4349
43502002-01-27 Akim Demaille <akim@epita.fr>
4351
4352 * tests/sets.at (AT_EXTRACT_SETS): New.
4353 (Nullable): Use it.
4354 (Firsts): New.
4355
43562002-01-26 Akim Demaille <akim@epita.fr>
4357
4358 * tests/actions.at, tests/calc.at, tests/headers.at,
4359 * tests/torture.at: Adjust to the newest Autotest which no longer
4360 forces `.' in the PATH.
4361
43622002-01-25 Akim Demaille <akim@epita.fr>
4363
4364 * tests/regression.at (%nonassoc and eof): New.
4365 Suggested by Robert Anisko.
4366
43672002-01-24 Akim Demaille <akim@epita.fr>
4368
4369 Bison dumps core when trying to complain about broken input files.
4370 Reported by Cris van Pelt.
4371
4372 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
4373 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
4374 into...
4375 (Invalid inputs): Strengthen: exercise parse_percent_token.
4376
43772002-01-24 Robert Anisko <robert.anisko@epita.fr>
4378
4379 * src/Makefile.am: Add bison.c++.
4380 * src/bison.c++: New skeleton.
4381
43822002-01-21 Paolo Bonzini <bonzini@gnu.org>
4383
4384 * po/it.po: New.
4385
43862002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
4387
4388 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
4389
43902002-01-20 Marc Autret <marc@gnu.org>
4391
4392 * src/files.c (compute_output_file_names): Fix
4393
43942002-01-20 Marc Autret <marc@gnu.org>
4395
4396 * tests/output.at: New test.
4397 * src/files.c (compute_base_names): Don't map extensions when
4398 the YACC flag is set, use defaults.
4399 Reported by Evgeny Stambulchik.
4400
44012002-01-20 Marc Autret <marc@gnu.org>
4402
4403 * src/system.h: Need to define __attribute__ away for non-GCC
4404 compilers as well (i.e. the vendor C compiler).
4405 Suggested by Albert Chin-A-Young.
4406
44072002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
4408
4409 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
4410 canonical definition.
4411 * src/system.h: Use the canonical definition for PARAMS (avoids
4412 a conflict with the macro from lib/hash.h).
4413
44142002-01-11 Akim Demaille <akim@epita.fr>
4415
4416 * configure.in: Use AC_FUNC_STRNLEN.
4417 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
4418
44192002-01-09 Akim Demaille <akim@epita.fr>
4420
4421 * src/files.c, src/files.h (output_infix): New.
4422 (tab_extension): Remove.
4423 (compute_base_names): Compute the former, drop the latter.
4424 * src/output.c (prepare): Insert the muscles `output-infix', and
4425 `output-suffix'.
4426 * src/parse-skel.y (string, string.1): New.
4427 (section.header): Use it.
4428 (section.yacc): Remove.
4429 (prefix): Remove too.
4430 * src/scan-skel.l: Adjust.
4431 * src/bison.simple, src/bison.hairy: Adjust.
4432
44332002-01-09 Akim Demaille <akim@epita.fr>
4434
4435 * configure.in (WERROR_CFLAGS): Compute it.
4436 * src/Makefile.am (CFLAGS): Pass it.
4437 * tests/atlocal.in (CFLAGS): Idem.
4438 * src/files.c: Fix a few warnings.
4439 (get_extension_index): Remove, unused.
4440
44412002-01-08 Akim Demaille <akim@epita.fr>
4442
4443 * src/getargs.c (AS_FILE_NAME): New.
4444 (getargs): Use it to convert DOSish file names.
4445 * src/files.c (base_name): Rename as full_base_name to avoid
4446 clashes with `base_name ()'.
4447 (filename_split): New.
4448 (compute_base_names): N-th rewrite, using filename_split.
4449
44502002-01-08 Akim Demaille <akim@epita.fr>
4451
4452 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
4453 New, stolen from the Fileutils 4.1.
4454 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
4455 * configure.in: Check for the presence of memrchr, and of its
4456 prototype.
4457
44582002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
4459
4460 * lib/hash.h (__P): Added definition for this macro.
4461 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
4462 BUILT_SOURCES, to ensure they are generated first.
4463 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
4464 %error-verbose to allow bootstrapping with bison 1.30x.
4465
44662002-01-06 Akim Demaille <akim@epita.fr>
4467
4468 * src/reader.c (parse_braces): Don't fetch the next char, the
4469 convention is to fetch on entry.
4470 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
4471 'switch' without a following semicolon.
4472 * tests/regression.at (braces parsing): New.
4473
44742002-01-06 Akim Demaille <akim@epita.fr>
4475
4476 Bison is dead wrong in its RR conflict reports.
4477
4478 * tests/torture.at (GNU Cim Grammar): New.
4479 * src/conflicts.c (count_rr_conflicts): Fix.
4480
44812002-01-06 Akim Demaille <akim@epita.fr>
4482
4483 Creating package.m4 from configure.ac causes too many problems.
4484
4485 * tests/Makefile.am (package.m4): Create it by hand,
4486 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
4487
44882002-01-06 Akim Demaille <akim@epita.fr>
4489
4490 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
4491 skeleton.h.
4492
44932002-01-04 Paul Eggert <eggert@twinsun.com>
4494
4495 * doc/bison.texinfo (Debugging):
4496 Remove YYSTDERR; it's no longer defined or used.
4497 Also, s/cstdio.h/cstdio/.
4498
44992002-01-03 Akim Demaille <akim@epita.fr>
4500
4501 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
4502
45032002-01-03 Akim Demaille <akim@epita.fr>
4504
4505 * src/parse-skel.y (process_skeleton): Don't bind the parser's
4506 tracing code to --trace, wait for a better --trace option, with
4507 args.
4508
45092002-01-03 Akim Demaille <akim@epita.fr>
4510
4511 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
4512 The ISO C++ standard is extremely clear about it: stderr is
4513 considered a macro, not a regular symbol (see table 94 `Header
4514 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
4515 Therefore std:: does not apply to it. It still does with fprintf.
4516 Also, s/cstdio.h/cstdio/.
4517
45182002-01-03 Akim Demaille <akim@epita.fr>
4519
4520 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
4521 for non system headers.
4522
45232002-01-02 Akim Demaille <akim@epita.fr>
4524
4525 Equip the skeleton chain with location tracking, runtime trace,
4526 pure parser and scanner.
4527
4528 * src/parse-skel.y: Request a pure parser, locations, and prefix
4529 renaming.
4530 (%union): Having several members with the same type does not help
4531 type mismatches, simplify.
4532 (YYPRINT, yyprint): New.
4533 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
4534 (skel_error): this.
4535 Handle locations.
4536 * src/scan-skel.l: Adjust to these changes.
4537 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
4538 (LOCATION_PRINT, skel_control_t): New.
4539
45402001-12-30 Akim Demaille <akim@epita.fr>
4541
4542 * src/parse-skel.y: Get rid of the shift/reduce conflict:
4543 replace `gb' with BLANKS.
4544 * src/scan-skel.l: Adjust.
4545
45462001-12-30 Akim Demaille <akim@epita.fr>
4547
4548 * src/system.h: We don't need nor want bcopy.
4549 Throw away MS-DOS crap: we don't need getpid.
4550 * configure.in: We don't need strndup. It was even causing
4551 problems: because Flex includes the headers *before* us,
4552 _GNU_SOURCE is not defined by config.h, and therefore strndup was
4553 not visible.
4554 * lib/xstrndup.c: New.
4555 * src/scan-skel.l: Use it.
4556 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
4557 * src/parse-skel.y: Use %directives instead of #defines.
4558
45592001-12-30 Akim Demaille <akim@epita.fr>
4560
4561 * src/skeleton.h: New.
4562 * src/output.c (output_parser, output_master_parser): Remove, dead
4563 code.
4564 * src/output.h (get_lines_number, actions_output, guards_output)
4565 (token_definitions_output): Prototype them.
4566 * src/parse-skel.y: Add the license notice.
4567 Include output.h and skeleton.h.
4568 (process_skeleton): Returns void, and takes a single parameter.
4569 * src/scan-skel.l: Add the license notice.
4570 Include skeleton.h.
4571 Don't use %option yylineno: it seems that then Flex imagines
4572 REJECT has been used, and therefore it won't reallocate its
4573 buffers (which makes no other sense to me than a bug). It results
4574 in warnings for `unused: yy_flex_realloc'.
4575
45762001-12-30 Robert Anisko <robert.anisko@epita.fr>
4577
4578 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
4579 (MUSCLE_INSERT_PREFIX): ...to there.
4580 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
4581 (MUSCLE_INSERT_PREFIX): Move from here...
4582
4583 * src/bison.hairy: Add a section directive. Put braces around muscle
4584 names. This parser skeleton is still broken, but Bison should not
4585 choke on a bad muscle 'syntax'.
4586 * src/bison.simple: Add a section directive. Put braces around muscle
4587 names.
4588
4589 * src/files.h (strsuffix, stringappend): Add declarations.
4590 (tab_extension): Add declaration.
4591 (short_base_name): Add declaration.
4592
4593 * src/files.c (strsuffix, stringappend): No longer static. These
4594 functions are used in the skeleton parser.
4595 (tab_extension): New.
4596 (compute_base_names): Use the computations done in this function
4597 to guess if the generated parsers should have '.tab' in their
4598 names.
4599 (short_base_name): No longer static.
4600
4601 * src/output.c (output_skeleton): New.
4602 (output): Disable call to output_master_parser, and give a try to
4603 a new skeleton handling system.
4604 (guards_output, actions_output): No longer static.
4605 (token_definitions_output, get_lines_number): No longer static.
4606
4607 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
4608
4609 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
4610 parse-skel.y.
4611
4612 * src/parse-skel.y: New file.
4613 * src/scan-skel.l: New file.
4614
46152001-12-29 Akim Demaille <akim@epita.fr>
4616
4617 %name-prefix is broken.
4618
4619 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
4620 Adjust all dependencies.
4621 * tests/headers.at (export YYLTYPE): Strengthen this test: use
4622 %name-prefix.
4623
4624 Renaming yylval but not yylloc is not consistent. Now we do.
4625
4626 * src/bison.simple: Prefix yylloc if used.
4627 * doc/bison.texinfo (Decl Summary): Document that.
4628
46292001-12-29 Akim Demaille <akim@epita.fr>
4630
4631 * doc/bison.texinfo: Promote `%long-directive' over
4632 `%long_directive'.
4633 Remove all references to fixed-output-files, yacc is enough.
4634
46352001-12-29 Akim Demaille <akim@epita.fr>
4636
4637 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
4638 user prologue. These are defaults.
4639 * tests/actions.at (Mid-rule actions): Make sure the user can
4640 define YYDEBUG and YYERROR_VERBOSE.
4641
46422001-12-29 Akim Demaille <akim@epita.fr>
4643
4644 * src/output.c (header_output): Don't forget to export YYLTYPE and
4645 yylloc.
4646 * tests/headers.at (export YYLTYPE): New, make sure it does.
4647 * tests/regression.at (%union and --defines, Invalid CPP headers):
4648 Move to...
4649 * tests/headers.at: here.
4650
46512001-12-29 Akim Demaille <akim@epita.fr>
4652
4653 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
4654
46552001-12-29 Akim Demaille <akim@epita.fr>
4656
4657 * tests/actions.at (Mid-rule actions): Output on a single line
4658 instead of several.
4659
46602001-12-29 Akim Demaille <akim@epita.fr>
4661
4662 * doc/bison.texinfo: Formatting changes.
4663
46642001-12-29 Akim Demaille <akim@epita.fr>
4665
4666 Don't store the token defs in a muscle, just be ready to output it
4667 on command. Now possible via `symbols'. Fixes a memory leak.
4668
4669 * src/output.c (token_definitions_output): New.
4670 (output_parser, header_output): Use it.
4671 * src/reader.c (symbols_save): Remove.
4672
46732001-12-29 Akim Demaille <akim@epita.fr>
4674
4675 * src/bison.simple: Do not provide a default for YYSTYPE and
4676 YYLTYPE before the user's prologue. Otherwise it's hardly... a
4677 default.
4678
46792001-12-29 Akim Demaille <akim@epita.fr>
4680
4681 Mid-rule actions are simply... ignored!
4682
4683 * src/reader.c (readgram): Be sure to attach mid-rule actions to
4684 the empty-rule associated to the dummy symbol, not to the host
4685 rule.
4686 * tests/actions.at (Mid-rule actions): New.
4687
46882001-12-29 Akim Demaille <akim@epita.fr>
4689
4690 Memory leak.
4691
4692 * src/reader.c (reader): Free grammar.
4693
46942001-12-29 Akim Demaille <akim@epita.fr>
4695
4696 Memory leak.
4697
4698 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
4699 since it allocates it for each state, although only one is needed.
4700 (allocate_storage): Do it here.
4701
47022001-12-29 Akim Demaille <akim@epita.fr>
4703
4704 * src/options.h, src/options.c (create_long_option_table): Rename
4705 as...
4706 (long_option_table_new): this, with a clearer prototype.
4707 (percent_table): Remove, unused,
4708 * src/getargs.c (getargs): Adjust.
4709
47102001-12-29 Akim Demaille <akim@epita.fr>
4711
4712 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
4713 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
4714 as states.
4715
47162001-12-29 Akim Demaille <akim@epita.fr>
4717
4718 * src/lalr.c (build_relations): Rename `states' as `states1'.
4719 Sorry, I don't understand exactly what it is, no better name...
4720
47212001-12-29 Akim Demaille <akim@epita.fr>
4722
4723 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
4724 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
4725 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
4726 as rules.
4727
47282001-12-29 Akim Demaille <akim@epita.fr>
4729
4730 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
4731 ago.
4732
47332001-12-29 Akim Demaille <akim@epita.fr>
4734
4735 * src/reader.c, src/reader.h (user_toknums): Remove.
4736 Adjust all users to use symbols[i]->user_token_number.
4737
47382001-12-29 Akim Demaille <akim@epita.fr>
4739
4740 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
4741 Adjust all users to use symbols[i]->prec or ->assoc.
4742
47432001-12-29 Akim Demaille <akim@epita.fr>
4744
4745 * src/reader.c, src/reader.h (tags): Remove.
4746 Adjust all users to use symbols[i]->tag.
4747
47482001-12-29 Akim Demaille <akim@epita.fr>
4749
4750 * src/gram.h, src/gram.c (symbols): New, similar to state_table
4751 and rule_table.
4752 * src/reader.c (packsymbols): Fill this table.
4753 Drop sprec.
4754 * src/conflicts.c (resolve_sr_conflict): Adjust.
4755 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
4756 single table.
4757 Use symbols[i]->tag instead of tags[i].
4758
47592001-12-29 Akim Demaille <akim@epita.fr>
4760
4761 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
4762 In addition, put a comment in there, to replace...
4763 * tests/regression.at (%union and C comments): Remove.
4764
47652001-12-29 Akim Demaille <akim@epita.fr>
4766
4767 * tests/regression.at (Web2c Actions): Blindly move the actual
4768 output as expected output. The contents *seem* right to me, but I
4769 can't pretend reading perfectly parser tables... Nonetheless, all
4770 the other tests pass correctly, the table look OK, even though the
4771 presence of `$axiom' is to be noted: AFAICS it is useless (but
4772 harmless).
4773
47742001-12-29 Akim Demaille <akim@epita.fr>
4775
4776 * src/reader.c (readgram): Don't add the rule 0 if there were no
4777 rules read. In other words, add it _after_ having performed
4778 grammar sanity checks.
4779 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
4780
47812001-12-29 Akim Demaille <akim@epita.fr>
4782
4783 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
4784 visible, and some states have now a different number.
4785
47862001-12-29 Akim Demaille <akim@epita.fr>
4787
4788 * src/reader.c (readgram): Bind the initial rule's lineno to that
4789 of the first rule.
4790 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
4791 (Solved SR Conflicts): Adjust rule 0's line number.
4792
47932001-12-29 Akim Demaille <akim@epita.fr>
4794
4795 Fix the `GAWK Grammar' failure.
4796
4797 * src/LR0.c (final_state): Initialize to -1 so that we do compute
4798 the reductions of the first state which was mistakenly confused
4799 with the final state because precisely final_state was initialized
4800 to 0.
4801 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
4802 now noticed by Bison.
4803 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
4804 have a reduction on $default.
4805
48062001-12-29 Akim Demaille <akim@epita.fr>
4807
4808 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
4809 rule line numbers.
4810 * src/closure.c (print_closure): Likewise.
4811 * src/derives.c (print_derives): Likewise.
4812 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
4813 now.
4814
48152001-12-29 Akim Demaille <akim@epita.fr>
4816
4817 * src/lalr.c (lookaheads_print): New.
4818 (lalr): Call it when --trace-flag.
4819 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
4820 are dumped.
4821
48222001-12-29 Akim Demaille <akim@epita.fr>
4823
4824 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
4825 when walking through ritem, even via rule->rhs.
4826 * src/reduce.c (dump_grammar, useful_production, reduce_output)
4827 (useful_production, useless_nonterminals): Likewise.
4828 (reduce_grammar_tables): Likewise, plus update nritems.
4829 * src/nullable.c (set_nullable): Likewise.
4830 * src/lalr.c (build_relations): Likewise.
4831 * tests/sets.at (Nullable): Adjust.
4832 Fortunately, now, the $axiom is no longer nullable.
4833
48342001-12-29 Akim Demaille <akim@epita.fr>
4835
4836 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
4837 the 0-sentinel.
4838 * src/gram.c (ritem_longest_rhs): Likewise.
4839 * src/reduce.c (nonterminals_reduce): Likewise.
4840 * src/print_graph.c (print_graph): Likewise.
4841 * src/output.c (output_rule_data): Likewise.
4842 * src/nullable.c (set_nullable): Likewise.
4843
48442001-12-29 Akim Demaille <akim@epita.fr>
4845
4846 * src/output.c: Comment changes.
4847
48482001-12-27 Paul Eggert <eggert@twinsun.com>
4849
4850 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
4851 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
4852 Sparc, as they were causing more porting problems than the
4853 (minor) performance improvement was worth.
4854
4855 Also, catch up with 1.31's YYSTD.
4856
48572001-12-27 Akim Demaille <akim@epita.fr>
4858
4859 * src/output.c (output_gram): Rely on nritems, not the
4860 0-sentinel. See below.
4861 Use -1 as separator, not 0.
4862 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
4863 Rely on -1 as separator in yyrhs, instead of 0.
4864 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
4865 twice `Now at end of input', therefore there are two lines less to
4866 expect.
4867
48682001-12-27 Akim Demaille <akim@epita.fr>
4869
4870 * tests/regression.at (Unresolved SR Conflicts):
4871 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
4872 below.
4873
48742001-12-27 Akim Demaille <akim@epita.fr>
4875
4876 * src/LR0.c (new_state): Recognize the final state by the fact it
4877 is reached by eoftoken.
4878 (insert_start_shifting_state, insert_eof_shifting_state)
4879 (insert_accepting_state, augment_automaton): Remove, since now
4880 these states are automatically computed from the initial state.
4881 (generate_states): Adjust.
4882 * src/print.c: When reporting a rule number to the user, substract
4883 1, so that the axiom rule is rule 0, and the first user rule is 1.
4884 * src/reduce.c: Likewise.
4885 * src/print_graph.c (print_core): For the time being, just as for
4886 the report, depend upon --trace-flags to dump the full set of
4887 items.
4888 * src/reader.c (readgram): Once the grammar read, insert the rule
4889 0: `$axiom: START-SYMBOL $'.
4890 * tests/set.at: Adjust: rule 0 is now displayed, and since the
4891 number of the states has changed (the final state is no longer
4892 necessarily the last), catch up.
4893
48942001-12-27 Akim Demaille <akim@epita.fr>
4895
4896 Try to make the use of the eoftoken valid. Given that its value
4897 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
4898 is used instead of > 0 where appropriate, (ii), depend upon nritems
4899 instead of the 0-sentinel.
4900
4901 * src/gram.h, src/gram.c (nritems): New.
4902 Expected to be duplication of nitems, but for the time being...
4903 * src/reader.c (packgram): Assert nritems and nitems are equal.
4904 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
4905 * src/closure.c (print_closure, print_fderives): Likewise.
4906 * src/gram.c (ritem_print): Likewise.
4907 * src/print.c (print_core, print_grammar): Likewise.
4908 * src/print_graph.c: Likewise.
4909
49102001-12-27 Akim Demaille <akim@epita.fr>
4911
4912 * src/main.c (main): If there are complains after grammar
4913 reductions, then output the report anyway if requested, then die.
4914 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
4915 * src/reader.c (eoftoken): New.
4916 (parse_token_decl): If the token being defined has value `0', it
4917 is the eoftoken.
4918 (packsymbols): No longer hack `tags' to insert `$' by hand.
4919 Be sure to preserve the value of the eoftoken.
4920 (reader): Make sure eoftoken is defined.
4921 Initialize nsyms to 0: now eoftoken is created just like the others.
4922 * src/print.c (print_grammar): Don't special case the eof token.
4923 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
4924 lie anyway, albeit pleasant.
4925 * tests/calc.at: Exercise error messages with eoftoken.
4926 Change the grammar so that empty input is invalid.
4927 Adjust expectations.
4928 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
4929
49302001-12-27 Akim Demaille <akim@epita.fr>
4931
4932 * configure.in: Check the protos of strchr ans strspn.
4933 Replace strchr if needed.
4934 * src/system.h: Provide the protos of strchr, strspn and memchr if
4935 missing.
4936 * lib/strchr.c: New.
4937 * src/reader.c (symbols_save): Use strchr.
4938
49392001-12-27 Akim Demaille <akim@epita.fr>
4940
4941 * src/print.c, src/print_graph.c (escape): New.
4942 Use it to quote the TAGS outputs.
4943 * src/print_graph.c (print_state): Now errors are in red, and
4944 reductions in green.
4945 Prefer high to wide: output the state number on a line of its own.
4946
49472001-12-27 Akim Demaille <akim@epita.fr>
4948
4949 * src/state.h, src/state.c (reductions_new): New.
4950 * src/LR0.c (set_state_table): Let all the states have a
4951 `reductions', even if reduced to 0.
4952 (save_reductions): Adjust.
4953 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
4954 * src/print.c (print_reductions, print_actions): Adjust.
4955 * src/output.c (action_row): Adjust.
4956
49572001-12-27 Akim Demaille <akim@epita.fr>
4958
4959 * src/state.h, src/state.c (errs_new, errs_dup): New.
4960 * src/LR0.c (set_state_table): Let all the states have an errs,
4961 even if reduced to 0.
4962 * src/print.c (print_errs, print_reductions): Adjust.
4963 * src/output.c (output_actions, action_row): Adjust.
4964 * src/conflicts.c (resolve_sr_conflict): Adjust.
4965
49662001-12-27 Akim Demaille <akim@epita.fr>
4967
4968 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
4969
49702001-12-27 Akim Demaille <akim@epita.fr>
4971
4972 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
4973 * src/print.c: here.
4974 (lookaheadset, shiftset): New, used as additional storage by
4975 print_reductions.
4976 (print_results): Adjust.
4977 (print_shifts, print_gotos, print_errs): New, extracted from...
4978 (print_actions): here.
4979 * src/print_graph.c (print_actions): Remove dead code.
4980
49812001-12-27 Akim Demaille <akim@epita.fr>
4982
4983 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
4984 `$n' and `@n'.
4985
49862001-12-27 Akim Demaille <akim@epita.fr>
4987
4988 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
4989 (build_relations): Adjust.
4990
49912001-12-27 Akim Demaille <akim@epita.fr>
4992
4993 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
4994 duplication.
4995
49962001-12-27 Akim Demaille <akim@epita.fr>
4997
4998 * src/reader.c (packgram): Catch nitems overflows.
4999
50002001-12-27 Akim Demaille <akim@epita.fr>
5001
5002 * src/files.c, src/files.h (guard_obstack): Remove.
5003 * src/output.c (output): Adjust.
5004 * src/reader.c (parse_braces): New, factoring...
5005 (copy_action, copy_guard): these two which are renamed as...
5006 (parse_action, parse_guard): these.
5007 As a voluntary consequence, using braces around guards is now
5008 mandatory.
5009
50102001-12-27 Akim Demaille <akim@epita.fr>
5011
5012 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
5013 * src/reader.c (symbol_list): `guard' and `guard_line' are new
5014 members.
5015 (symbol_list_new): Adjust.
5016 (copy_action): action_line is the first line, not the last.
5017 (copy_guard): Just as for actions, store the `action' only, not
5018 the switch/case/break flesh.
5019 Don't parse the user action that might follow the guard, let...
5020 (readgram): do it, i.e., now, there can be an action after a
5021 guard.
5022 In other words the guard is just explicitly optional.
5023 (packgram): Adjust.
5024 * src/output.c (guards_output): New.
5025 (output_parser): Call it when needed.
5026 (output): Also free the guard and attrs obstacks.
5027 * src/files.c, src/files.h (obstack_save): Remove.
5028 (output_files): Remove.
5029 As a result, if one needs the former `.act' file, using an
5030 appropriate skeleton which requires actions and guards is now
5031 required.
5032 * src/main.c (main): Adjust.
5033 * tests/semantic.at: New.
5034 * tests/regression.at: Use `input.y' as input file name.
5035 Avoid 8+3 problems by requiring input.c when the test needs the
5036 parser.
5037
50382001-12-27 Akim Demaille <akim@epita.fr>
5039
5040 * src/reader.c (symbol_list_new): Be sure to initialize all the
5041 fields.
5042
50432001-12-27 Akim Demaille <akim@epita.fr>
5044
5045 All the hacks using a final pseudo state are now useless.
5046
5047 * src/LR0.c (set_state_table): state_table holds exactly nstates.
5048 * src/lalr.c (nLA): New.
5049 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
5050 instead of lookaheadsp from the pseudo state (nstate + 1).
5051
50522001-12-27 Akim Demaille <akim@epita.fr>
5053
5054 * src/output.c (action_row, token_actions): Use a state_t instead
5055 of a integer, and nlookaheads instead of the following state's
5056 lookaheadsp.
5057
50582001-12-27 Akim Demaille <akim@epita.fr>
5059
5060 * src/conflicts.c (log_resolution, flush_shift)
5061 (resolve_sr_conflict, set_conflicts, solve_conflicts)
5062 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
5063 (conflicts_print, print_reductions): Use a state_t instead of an
5064 integer when referring to a state.
5065 As much as possible, depend upon nlookaheads, instead of the
5066 `lookaheadsp' member of the following state (since lookaheads of
5067 successive states are successive, the difference between state n + 1
5068 and n served as the number of lookaheads for state n).
5069 * src/lalr.c (add_lookback_edge): Likewise.
5070 * src/print.c (print_core, print_actions, print_state)
5071 (print_results): Likewise.
5072 * src/print_graph.c (print_core, print_actions, print_state)
5073 (print_graph): Likewise.
5074 * src/conflicts.h: Adjust.
5075
50762001-12-27 Akim Demaille <akim@epita.fr>
5077
5078 * src/bison.hairy: Formatting/comment changes.
5079 ANSIfy.
5080 Remove `register' indications.
5081 Add plenty of `static'.
5082
50832001-12-27 Akim Demaille <akim@epita.fr>
5084
5085 * src/output.c (prepare): Drop the muscle `ntbase' which
5086 duplicates ntokens.
5087 * src/bison.simple: Formatting/comment changes.
5088 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
5089 is an undocumented synonym.
5090
50912001-12-22 Akim Demaille <akim@epita.fr>
5092
5093 * src/output.c (output_table_data): Change the prototype to use
5094 `int' for array ranges: some invocations do pass an int, not a
5095 short.
5096 Reported by Wayne Green.
5097
50982001-12-22 Akim Demaille <akim@epita.fr>
5099
5100 Some actions of web2c.y are improperly triggered.
5101 Reported by Mike Castle.
5102
5103 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
5104 * tests/regression.at (Web2c): Rename as...
5105 (Web2c Report): this.
5106 (Web2c Actions): New.
5107
51082001-12-22 Akim Demaille <akim@epita.fr>
5109
5110 Reductions in web2c.y are improperly reported.
5111 Reported by Mike Castle.
5112
5113 * src/conflicts.c (print_reductions): Fix.
5114 * tests/regression.at (Web2c): New.
5115
51162001-12-18 Akim Demaille <akim@epita.fr>
5117
5118 Some host fail on `assert (!"foo")', which expands to
5119 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
5120 Reported by Nelson Beebee.
5121
5122 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
5123 `#define it_succeeded 0' and `assert (it_succeeded)'.
5124
51252001-12-17 Marc Autret <autret_m@epita.fr>
5126
5127 * src/bison.simple: Don't hard code the skeleton line and filename.
5128 * src/output.c (output_parser): Rename 'line' as 'output_line'.
5129 New line counter 'skeleton_line' (skeleton-line muscle).
5130
51312001-12-17 Paul Eggert <eggert@twinsun.com>
5132
5133 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
5134 YYDEBUG must be defined to a nonzero value.
5135
5136 * src/bison.simple (yytname): Do not assume that the user defines
5137 YYDEBUG to a properly parenthesized expression.
5138
51392001-12-17 Akim Demaille <akim@epita.fr>
5140
5141 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
5142 nlookaheads is a new member.
5143 Adjust all users.
5144 * src/lalr.h (nlookaheads): Remove this orphan declaration.
5145 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
5146 state.
5147
51482001-12-17 Akim Demaille <akim@epita.fr>
5149
5150 * src/files.h, src/files.c (open_files, close_files): Remove.
5151 * src/main.c (main): Don't open/close files, nor invoke lex_free,
5152 let...
5153 * src/reader.c (reader): Do it.
5154
51552001-12-17 Akim Demaille <akim@epita.fr>
5156
5157 * src/conflicts.c (print_reductions): Formatting changes.
5158
51592001-12-17 Akim Demaille <akim@epita.fr>
5160
5161 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
5162 (flush_reduce): New.
5163 (resolve_sr_conflict): Adjust.
5164
51652001-12-17 Akim Demaille <akim@epita.fr>
5166
5167 * src/output.c (output_obstack): Be static and rename as...
5168 (format_obstack): this, to avoid any confusion with files.c's
5169 output_obstack.
5170 * src/reader.h (muscle_obstack): Move to...
5171 * src/output.h: here, since it's defined in output.c.
5172
51732001-12-17 Akim Demaille <akim@epita.fr>
5174
5175 * src/output.c (action_row, save_column, default_goto)
5176 (sort_actions, matching_state, pack_vector): Better variable
5177 locality.
5178
51792001-12-17 Akim Demaille <akim@epita.fr>
5180
5181 * src/output.c: Various formatting changes.
5182
51832001-12-17 Akim Demaille <akim@epita.fr>
5184
5185 * src/files.c (output_files): Free the output_obstack.
5186 * src/main.c (main): Call print and print_graph conditionally.
5187 * src/print.c (print): Work unconditionally.
5188 * src/print_graph.c (print_graph): Work unconditionally.
5189 * src/conflicts.c (log_resolution): Output only if verbose_flag.
5190
51912001-12-16 Marc Autret <autret_m@epita.fr>
5192
5193 * src/output.c (actions_output): Fix. When we use %no-lines,
5194 there is one less line per action.
5195
51962001-12-16 Marc Autret <autret_m@epita.fr>
5197
5198 * src/bison.simple: Remove a useless #line directive.
5199 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
5200 * src/output.c (get_lines_number): New.
5201 (output_parser): Adjust, now takes care about the lines of a
5202 output muscles.
5203 Fix line numbering.
5204 (actions_output): Computes the number of lines taken by actions.
5205 (output_master_parser): Insert new skeleton which is the name of
5206 the output parser file name.
5207
52082001-12-15 Marc Autret <autret_m@epita.fr>
5209
5210 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
5211
52122001-12-15 Marc Autret <autret_m@epita.fr>
5213
5214 * src/output.c (output_gram): Keep track of the hairy one.
5215
52162001-12-15 Akim Demaille <akim@epita.fr>
5217
5218 Make `make distcheck' work.
5219
5220 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
5221 system.h which uses libgettext.h.
5222
52232001-12-15 Akim Demaille <akim@epita.fr>
5224
5225 * src/nullable.c (set_nullable): Useless rules must be skipped,
5226 otherwise, since we range over their symbols, we might look at a
5227 nonterminal which no longer ``exists'', i.e., it is not counted in
5228 `nvars', hence we overflow our arrays.
5229
52302001-12-15 Akim Demaille <akim@epita.fr>
5231
5232 The header can also be produced directly, without any obstack!
5233 Yahoo!
5234
5235 * src/files.c, src/files.h (defines_obstack): Remove.
5236 (compute_header_macro): Global.
5237 (defines_obstack_save): Remove.
5238 * src/reader.c (parse_union_decl): No longer output to
5239 defines_obstack: its content can be found in the `stype' muscle
5240 anyway.
5241 (output_token_translations): Merge into...
5242 (symbols_output): this.
5243 Rename as...
5244 (symbols_save): this.
5245 (reader): Adjust.
5246 * src/output.c (header_output): New.
5247 (output): Call it.
5248
52492001-12-15 Akim Demaille <akim@epita.fr>
5250
5251 * src/reader.c (parse_union_decl): Instead of handling two obstack
5252 simultaneously, use one to define the `stype' muscle, and use the
5253 value of the latter to fill defines_obstack.
5254 (copy_comment): Remove.
5255 (copy_comment2): Work for a single obstack.
5256 Rename as...
5257 (copy_comment): this.
5258
52592001-12-15 Akim Demaille <akim@epita.fr>
5260
5261 * src/lex.c, src/lex.h (xgetc): No longer static.
5262 * src/reader.c (parse_union_decl): Revamp.
5263
52642001-12-15 Akim Demaille <akim@epita.fr>
5265
5266 Still making progress in separating Bison into (i) input, (ii)
5267 process, (iii) output: now we can directly output the parser file
5268 without using table_obstack at all.
5269
5270 * src/files.c, src/files.h (table_obstack): Bye bye.
5271 (parser_file_name): New.
5272 * src/files.c (compute_output_file_names): Compute it.
5273 * src/output.c (actions_output, output_parser)
5274 (output_master_parser): To a file instead of an obstack.
5275
52762001-12-15 Akim Demaille <akim@epita.fr>
5277
5278 Attach actions to rules, instead of pre-outputting them to
5279 actions_obstack.
5280
5281 * src/gram.h (rule_t): action and action_line are new members.
5282 * src/reader.c (symbol_list): Likewise.
5283 (copy_action): Save the actions within the rule.
5284 (packgram): Save them in rule_table.
5285 * src/output.c (actions_output): New.
5286 (output_parser): Use it on `%%actions'.
5287 (output_rule_data): Don't free rule_table.
5288 (output): Do it.
5289 (prepare): Don't save the `action' muscle.
5290 * src/bison.simple: s/%%action/%%actions/.
5291
52922001-12-15 Akim Demaille <akim@epita.fr>
5293
5294 * src/reader.c (copy_action): When --yacc, don't append a `;'
5295 to the user action: let it fail if lacking.
5296 Suggested by Arnold Robbins and Tom Tromey.
5297
52982001-12-14 Akim Demaille <akim@epita.fr>
5299
5300 * src/lex.c (literalchar): Simply return the char you decoded, non
5301 longer mess around with obstacks and int pointers.
5302 Adjust all callers.
5303
53042001-12-14 Akim Demaille <akim@epita.fr>
5305
5306 * src/lex.c (literalchar): Don't escape the special characters,
5307 just decode them, and keep them as char (before, eol was output as
5308 the 2 char string `\n' etc.).
5309 * src/output.c (output_rule_data): Use quotearg to output the
5310 token strings.
5311
53122001-12-13 Paul Eggert <eggert@twinsun.com>
5313
5314 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
5315 Do not infringe on the global user namespace when using C++.
5316 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
5317 All uses of `fprintf' and `stderr' changed.
5318
5319 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
5320
53212001-12-13 Akim Demaille <akim@epita.fr>
5322
5323 The computation of nullable is broken: it doesn't handle empty
5324 RHS's properly.
5325
5326 * tests/torture.at (GNU AWK Grammar): New.
5327 * tests/sets.at (Nullable): New.
5328 * src/nullable.c (set_nullable): Instead of blindly looping over
5329 `ritems', loop over the rules, and then over their rhs's.
5330
5331 Work around Autotest bugs.
5332
5333 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
5334 frame, because Autotest understand lines starting with a `+' as
5335 traces from the shell. Then, they are not processed properly.
5336 Admittedly an Autotest bug, but we don't have time to wait for
5337 Autotest to catch up.
5338 * tests/regression.at (Broken Closure): Adjust to the new table
5339 frames.
5340 Move to...
5341 * tests/sets.at: here.
5342
53432001-12-13 Akim Demaille <akim@epita.fr>
5344
5345 * src/closure.c (closure): Use nrules instead of playing tricks
5346 with BITS_PER_WORD.
5347
53482001-12-13 Akim Demaille <akim@epita.fr>
5349
5350 * src/print.c (print_actions): Output the handling of `$' as the
5351 traces do: shifting the token EOF. Before EOF was treated as a
5352 nonterminal.
5353 * tests/regression.at: Adjust some tests.
5354 * src/print_graph.c (print_core): Complete the set of items via
5355 closure. The next-to-final and final states are still unsatisfying,
5356 but that's to be addressed elsewhere.
5357 No longer output the rule numbers, but do output the state number.
5358 A single loop for the shifts + gotos is enough, but picked a
5359 distinct color for each.
5360 (print_graph): Initialize and finalize closure.
5361
53622001-12-13 Akim Demaille <akim@epita.fr>
5363
5364 * src/reader.c (readgram): Remove dead code, an strip useless
5365 braces.
5366 (get_type): Remove, unused.
5367
53682001-12-12 Akim Demaille <akim@epita.fr>
5369
5370 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
5371 on that of lib/error.c.
5372
53732001-12-12 Akim Demaille <akim@epita.fr>
5374
5375 Some hosts don't like `/' in includes.
5376
5377 * src/system.h: Include libgettext.h without qualifying the path.
5378 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
5379 $(top_srcdir).
5380
53812001-12-11 Marc Autret <autret_m@epita.fr>
5382
5383 * src/output.c (output_parser): Remove useless muscle.
5384
53852001-12-11 Marc Autret <autret_m@epita.fr>
5386
5387 * src/bison.simple: Remove #line just before %%epilogue. It
5388 is now handled in ...
5389 * src/reader.c (read_additionnal_code): Add the output of a
5390 #line for the epilogue.
5391
53922001-12-10 Marc Autret <autret_m@epita.fr>
5393
5394 * src/reader.c (copy_definition): Re-use CPP-outed code which
5395 replace precedent remove.
5396 * src/bison.simple: Remove #line before %%prologue because
5397 %%input-line is wrong at this time.
5398
53992001-12-10 Marc Autret <autret_m@epita.fr>
5400
5401 * src/reader.c (symbols_output): Clean up.
5402 * src/output.c (output_gram, output): Clean up.
5403
54042001-12-10 Akim Demaille <akim@epita.fr>
5405
5406 * src/lalr.c (initialize_lookaheads): New. Extracted from...
5407 * src/LR0.c (set_state_table): here.
5408 * src/lalr.c (lalr): Call it.
5409
54102001-12-10 Akim Demaille <akim@epita.fr>
5411
5412 * src/state.h (shifts): Remove the `number' member: shifts are
5413 attached to state, hence no longer need to be labelled with a
5414 state number.
5415
54162001-12-10 Akim Demaille <akim@epita.fr>
5417
5418 Now that states have a complete set of members, the linked list of
5419 shifts is useless: just fill directly the state's shifts member.
5420
5421 * src/state.h (shifts): Remove the `next' member.
5422 * src/LR0.c (first_state, last_state): Remove.
5423 Adjust the callers.
5424 (augment_automaton): Don't look for the shifts that must be added
5425 a shift on EOF: it is those of the state we looked for! But now,
5426 since shifts are attached, it is no longer needed to looking
5427 merely by its id: its number.
5428
54292001-12-10 Akim Demaille <akim@epita.fr>
5430
5431 * src/LR0.c (augment_automaton): Better variable locality.
5432 Remove an impossible branch: if there is a state corresponding to
5433 the start symbol being shifted, then there is shift for the start
5434 symbol from the initial state.
5435
54362001-12-10 Akim Demaille <akim@epita.fr>
5437
5438 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
5439 only when appropriate: when insert_start_shifting_state' is not
5440 invoked.
5441 * tests/regression.at (Rule Line Numbers): Adjust.
5442
54432001-12-10 Akim Demaille <akim@epita.fr>
5444
5445 * src/LR0.c (augment_automaton): Now that all states have shifts,
5446 merge the two cases addition shifts to the initial state.
5447
54482001-12-10 Akim Demaille <akim@epita.fr>
5449
5450 * src/lalr.c (set_state_table): Move to...
5451 * src/LR0.c: here.
5452 * src/lalr.c (lalr): Don't call it...
5453 * src/LR0.c (generate_states): do it.
5454 * src/LR0.h (first_state): Remove, only the table is used.
5455
54562001-12-10 Akim Demaille <akim@epita.fr>
5457
5458 * src/LR0.h (first_shift, first_reduction): Remove.
5459 * src/lalr.c: Don't use first_shift: find shifts through the
5460 states.
5461
54622001-12-10 Akim Demaille <akim@epita.fr>
5463
5464 * src/LR0.c: Attach shifts to states as soon as they are
5465 computed.
5466 * src/lalr.c (set_state_table): Instead of assigning shifts to
5467 state, just assert that the mapping was properly done.
5468
54692001-12-10 Akim Demaille <akim@epita.fr>
5470
5471 * src/LR0.c (insert_start_shift): Rename as...
5472 (insert_start_shifting_state): this.
5473 (insert_eof_shifting_state, insert_accepting_state): New.
5474 (augment_automaton): Adjust.
5475 Better locality of the variables.
5476 When looking if the start_symbol is shifted from the initial
5477 state, using `while (... symbol != start_symbol ...)' sounds
5478 better than `while (... symbol < start_symbol ...)': If fail
5479 to see how the order between symbols could be relevant!
5480
54812001-12-10 Akim Demaille <akim@epita.fr>
5482
5483 * src/getargs.h: Don't declare `spec_name_prefix' and
5484 `spec_file_prefix', declared by src/files.h.
5485 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
5486 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
5487 * src/output.c (prepare): Adjust.
5488 * src/reader.c (symbols_output): Likewise.
5489 * src/vmsgetargs.c: Vaguely adjust, but who cares?
5490
54912001-12-10 Akim Demaille <akim@epita.fr>
5492
5493 * src/muscle_tab.c (muscle_init): NULL is a better default than
5494 `"0"'.
5495
54962001-12-10 Akim Demaille <akim@epita.fr>
5497
5498 * src/reader.c (reader): Calling symbols_output once is enough.
5499
55002001-12-10 Akim Demaille <akim@epita.fr>
5501
5502 Now that states have a complete set of members, the linked list of
5503 reductions is useless: just fill directly the state's reductions
5504 member.
5505
5506 * src/state.h (struct reductions): Remove member `number' and
5507 `next'.
5508 * src/LR0.c (first_reduction, last_reduction): Remove.
5509 (save_reductions): Don't link the new reductions, store them in
5510 this_state.
5511 * src/lalr.c (set_state_table): No need to attach reductions to
5512 states, it's already done.
5513 * src/output.c (output_actions): No longer free the shifts, then
5514 the reductions, then the states: free all the states and their
5515 members.
5516
55172001-12-10 Akim Demaille <akim@epita.fr>
5518
5519 * src/options.c (OPTN, DRTV, BOTH): New.
5520 (option_table): Use them.
5521
5522 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
5523 the job of system.h.
5524 * src/options.c: Don't include stdio.h and xalloc.h for the same
5525 reasons.
5526
55272001-12-10 Akim Demaille <akim@epita.fr>
5528
5529 * src/output.c (output, prepare): Make sure the values of the
5530 muscles `action' and `prologue' are 0-terminated.
5531
55322001-12-10 Akim Demaille <akim@epita.fr>
5533
5534 Clean up GCC warnings.
5535
5536 * src/reader.c (copy_action): `buf' is not used.
5537 (parse_skel_decl): Be static.
5538 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
5539 * src/options.h (create_long_option_table): Have a real prototype.
5540 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
5541 (hash_delete_at): Return const void *.
5542 Adjust casts to preserve the const.
5543
55442001-12-10 Akim Demaille <akim@epita.fr>
5545
5546 * configure.in: Require 2.52g.
5547 M4 is not needed, but AUTOM4TE is.
5548 * m4/m4.m4: Remove.
5549 * tests/Makefile.am: Adjust.
5550
55512001-12-10 Akim Demaille <akim@epita.fr>
5552
5553 One structure for states is enough, even though theoretically
5554 there are LR(0) states and LALR(1) states.
5555
5556 * src/lalr.h (state_t): Remove.
5557 (state_table): Be state_t **, not state_t *.
5558 * src/state.h (core, CORE_ALLOC): Rename as...
5559 (state_t, STATE_ALLOC): this.
5560 Add the LALR(1) members: shifts, reductions, errs.
5561 * src/LR0.c (state_table): Rename as...
5562 (state_hash): this, to avoid name clashes with the global
5563 `state_table'.
5564 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
5565 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
5566
55672001-12-10 Akim Demaille <akim@epita.fr>
5568
5569 Bison dumps core on bash.y.
5570 Reported by Pascal Bart.
5571
5572 * src/warshall.c (bitmatrix_print): New.
5573 (TC): Use it.
5574 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
5575 j must be the outer loop.
5576 * tests/regression.at (Broken Closure): New.
5577
55782001-12-05 Akim Demaille <akim@epita.fr>
5579
5580 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
5581 its argument.
5582