]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
(Invalid inputs): No longer `expecting ";"
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-12-02 Paul Eggert <eggert@twinsun.com>
2
3 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
4 * lib/strtoul.c: New file, from gnulib.
5 This fixes a porting bug reported by Peter Klein in
6 <http://mail.gnu.org/pipermail/bug-bison/2002-December/001944.html>.
7
82002-11-30 Paul Eggert <eggert@twinsun.com>
9
10 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
11 and put only a forward declaration in the prologue. This is for
12 consistency with the other scanner helper functions.
13
14 Type clashes now generate warnings, not errors, since it
15 appears that POSIX may allow some grammars with type clashes.
16 * src/reader.c (grammar_current_rule_check): Warn about
17 type clashes instead of complaining.
18 * tests/input.at (Type Clashes): Expect warnings, not complaints.
19
20 Add Yacc library, since POSIX requires it.
21 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
22 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
23 * lib/main.c, lib/yyerror.c: New files.
24
25 gram_error can be static; it need not be extern.
26 * src/reader.h (gram_error): Remove decl.
27 * src/parse-gram.y (gram_error): Now static. Add static decl.
28 (print_token_value): Omit parameter names from forward decl,
29 for consistency.
30
312002-11-29 Paul Eggert <eggert@twinsun.com>
32
33 * doc/bison.texinfo: Emphasize that yylex and yyerror must
34 be declared before being used. E.g., one should typically
35 declare them in the prologue. Use GNU coding style in examples.
36 Put "const" consistently after the type it modifies. Mention
37 that C99 supports "inline". Mention that yyerror traditionally
38 returns "int".
39
40 %parse-param and %lex-param now take just one argument, the
41 declaration; the argument name is deduced from the declaration.
42
43 * doc/bison.texinfo (Parser Function, Pure Calling, Error
44 Reporting, Table of Symbols): Document this.
45 * src/parse-gram.y (add_param): New function.
46 (COMMA): Remove.
47 (declaration): Implement new rule for %parse-param and %lex-param.
48 * src/scan-gram.l: "," now elicits a warning, rather than being
49 a token; this is more compatible with byacc.
50 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
51
522002-11-27 Paul Eggert <eggert@twinsun.com>
53
54 Rename identifiers to avoid real and potential collisions.
55
56 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
57 to avoid collision with lex macro described by Bruce Lilly in
58 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001929.html>.
59 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
60 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
61 * src/parse-gram.y (print_token_value): Renamed from yyprint.
62 All uses changed.
63 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
64 The name "yycontrol" violates the name space rules, and this stuff
65 wasn't being used anyway.
66 (input): Remove action; this stuff wasn't being used.
67 (gram_error): Rename local variable yylloc -> loc.
68 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
69 (YY_DECL): Don't use "yy" at start of local variables.
70 All uses changed, e.g., yylloc -> loc.
71 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
72 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
73 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
74 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
75
76 * src/parse-gram.y (gram_error): loc is now const *.
77 * src/reader.h (gram_error): Likewise.
78
792002-11-24 Paul Eggert <eggert@twinsun.com>
80
81 Version 1.75c.
82
83 * tests/actions.at (Actions after errors): Use an output format
84 more similar to that of the Printers and Destructors test.
85 Test the position of the ';' token too.
86 (Printers and Destructors): Likewise.
87 (Printers and Destructors: %glr-parser): Remove for now, to avoid
88 unnecessarily alarming people when the test fails.
89
90 * data/yacc.c (yyerrlab1): Move this label down, so that the
91 parser does not discard the lookahead token if the user code
92 invokes YYERROR. This change is required for POSIX conformance.
93
94 * lib/error.c: Sync with gnulib.
95
962002-11-22 Paul Eggert <eggert@twinsun.com>
97
98 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
99 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
100 * lib/xmalloc.c: Likewise.
101
1022002-11-20 Paul Eggert <eggert@twinsun.com>
103
104 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
105
1062002-11-20 Paul Eggert <eggert@twinsun.com>
107
108 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
109 should use `if (! x) abort ();' rather than `assert (x);', and
110 anyway it's one less thing to worry about configuring.
111
112 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
113 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
114 and replace all instances of assert with abort.
115 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
116 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
117
118 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
119 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
120 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
121 hash_find_entry, hash_rehash, hash_insert): Likewise.
122 * src/conflicts.c (resolve_sr_conflict): Likewise.
123 * src/lalr.c (set_goto_map, map_goto): Likewise.
124 * src/nullable.c (nullable_compute): Likewise.
125 * src/output.c (prepare_rules, token_definitions_output): Likewise.
126 * src/reader.c (packgram, reader): Likewise.
127 * src/state.c (state_new, state_free, state_transitions_set,
128 state_reduction_find): Likewise.
129 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
130 symbol_pack): Likewise.
131 * src/tables.c (conflict_row, pack_vector): Likewise.
132 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
133 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
134 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
135 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
136
137 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
138 (ARGMATCH_CONSTRAINT): New macro.
139 (ARGMATCH_ASSERT): Use it.
140
141 * src/system.h (verify): New macro.
142 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
143 rather than assert.
144 * src/tables.c (tables_generate): Likewise.
145
146 * src/struniq.c (struniq_assert): Now returns void, and aborts
147 if the assertion is false.
148 (struniq_assert_p): Remove.
149 * src/struniq.h: Likewise.
150
1512002-11-18 Paul Eggert <eggert@twinsun.com>
152
153 * data/glr.c (yygetLRActions): Replace `yyindex' with
154 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
155 This fixes the regression with Sun ONE Studio 7 cc that I reported in
156 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001892.html>.
157
1582002-11-18 Akim Demaille <akim@epita.fr>
159
160 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
161 space.
162 From Tim Van Holder.
163
1642002-11-17 Paul Eggert <eggert@twinsun.com>
165
166 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
167 to "SyntaxError" for consistency with my 2002-11-15 change.
168
169 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
170 not define to {}, since this breaks the common use of `YYDPRINTF
171 ((...));' if a single statement is desired (e.g. before `else').
172 Work around GCC warnings by surrounding corresponding calls with
173 {} if needed.
174 (yyhasResolvedValue): Remove unused function.
175 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
176 loop body.
177 (yyreportSyntaxError): Renamed from yyreportParseError.
178 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
179 All uses changed.
180 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
181 extern when possible. Remove unused initializations.
182
1832002-11-16 Akim Demaille <akim@epita.fr>
184
185 Augment the similarity between GLR and LALR traces.
186
187 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
188 (YY_REDUCE_PRINT): New.
189 (yyparse): Use them.
190 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
191 YYDPRINT here.
192 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
193 state reached after the reduction/recovery, since...
194 (yyparse, yyprocessOneStack): Report the state we are entering in.
195
1962002-11-16 Akim Demaille <akim@epita.fr>
197
198 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
199 Add support for --trace=skeleton.
200 * src/scan-skel.l: %option debug.
201 Scan strings of non-@ or \n instead of character by character.
202 (scan_skel): Handle trace_skeleton.
203 (QPUTS): New.
204 (@output_parser_name@, @output_header_name@): ``Restore'' their
205 support (used to be M4 macros).
206 * data/yacc.c: Quote larger chunks, a la glr.c.
207 * data/lalr1.cc: Likewise.
208 The header guards are no longer available, so use some other
209 string than `YYLSP_NEEDED'.
210
2112002-11-16 Akim Demaille <akim@epita.fr>
212
213 Make the ``Printers and Destructors'' test more verbose, taking
214 `yacc.c''s behavior as (possibly wrong) reference.
215
216 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
217 instead of fprint on stdout.
218 Set and report the last_line of the symbols.
219 Consistently display values and locations.
220
2212002-11-16 Paul Eggert <eggert@twinsun.com>
222
223 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
224
2252002-11-15 Paul Eggert <eggert@twinsun.com>
226
227 * tests/actions.at (Actions after errors): New test case.
228
229 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
230 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
231 tests/action.at, tests/calc.at, tests/conflicts.at,
232 tests/cxx-type.at, tests/regression.at:
233 "parse error" -> "syntax error" for POSIX compatibility.
234 "parsing stack overflow..." -> "parser stack overflow" so
235 that code matches Bison documentation.
236
2372002-11-15 Akim Demaille <akim@epita.fr>
238
239 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
240 take two BRACED_CODE, not two string_content.
241 Free the scanner's obstack when we are done.
242 (code_content): New.
243 * tests/calc.at: Adjust.
244 * doc/bison.texinfo: Adjust.
245 Also, make sure to include the `,' for these declarations.
246
2472002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
248
249 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
250 definition; avoids potential autoreconf problems.
251
2522002-11-15 Akim Demaille <akim@epita.fr>
253
254 Always check the value returned by yyparse.
255
256 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
257 returned by yyparse.
258 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
259 Adjust calls.
260 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
261 returned by yyparse.
262
2632002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
264
265 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
266 on input.at test.
267
2682002-11-14 Paul Eggert <eggert@twinsun.com>
269
270 * src/output.c (output_skeleton): Call xfopen instead of
271 duplicating xfopen's body.
272
273 Fix bugs reported by Nelson H. F. Beebe in
274 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001893.html>.
275
276 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
277 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
278 Group compiler. Instead, use "$CC -E bar.c". Include the .h
279 file twice in the grammar, as an extra check.
280
281 * tests/input.at (Torturing the Scanner): Surround the
282 backslash-newline tests with "#if 0", to make it less likely that
283 we'll run into compiler bugs. Bring back solitary \ inside
284 comment, but add a closing comment to work around HP C bug. Don't
285 test backslash-newline in C character constant. This should fix
286 the input.at bug reported by Nelson H. F. Beebe in
287 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001893.html>.
288
2892002-11-14 Akim Demaille <akim@epita.fr>
290
291 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
292 status of the compiler.
293 Calling `exit 1' is no longer needed.
294 Reported by Nelson H. F. Beebe.
295
2962002-11-14 Akim Demaille <akim@epita.fr>
297
298 * tests/atlocal.in (CPPFLAGS): We have config.h.
299 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
300 New.
301 * tests/actions.at, tests/calc.at, tests/conflicts.at,
302 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
303 * tests/regression.at, tests/torture.at: Use them for all the
304 grammars that are to be compiled.
305 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
306 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
307 * doc/bison.texinfo (GLR Parsers): Document `inline'.
308
3092002-11-14 Akim Demaille <akim@epita.fr>
310
311 * doc/bison.texinfo: Various formatting changes (alignments in
312 samples, additional @group/@end group, GCS in samples.
313 Use @deffn instead of simple @table to define the directives,
314 macros, variables etc.
315
3162002-11-13 Paul Eggert <eggert@twinsun.com>
317
318 Fix some bugs reported by Albert Chin-A-Young in
319 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001881.html>.
320
321 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
322 -o c"; the HP C compiler chatters during compilation.
323 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
324 * tests/headers.at (export YYLTYPE): Likewise.
325
326 * tests/input.at (Torturing the Scanner): Remove lines containing
327 solitary backslashes, as they tickle a bug in the HP C compiler.
328
329 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
330 comments, since they're not portable. Use GNU coding style.
331
3322002-11-13 Akim Demaille <akim@epita.fr>
333
334 * data/yacc.c: Leave bigger chunks of quoted text.
335 (YYDSYMPRINTF): New.
336 Use it to report symbol activities.
337 * data/glr.c (YYDSYMPRINTF): New.
338 Use it.
339
3402002-11-12 Paul Eggert <eggert@twinsun.com>
341
342 Version 1.75b.
343
344 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
345 (yyglrReduce): Return yyok, not 0.
346 This should avoid the enumerated-type warnings reported
347 by Nelson H.F. Beebe in
348 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001872.html>.
349
350 * lib/bbitset.h (BITSET_INLINE): Remove.
351 * lib/bitset.h [! BITSET_INLINE]: Remove.
352 (bitset_set, bitset_reset, bitset_test): Rename local vars
353 to avoid shadowing warnings by GCC.
354
355 * data/glr.c (inline): Remove #define. It's the user's
356 responsibility to #define it away, just like 'const'.
357 This fixes one of the bugs reported by Nelson H.F. Beebe in
358 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001873.html>.
359
360 * Makefile.maint (po-check): Scan .l and .y files instead of the
361 .c and the .h files that they generate. This fixes the bug
362 reported by Tim Van Holder in:
363 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
364 Look for N_ as well as for _. Try to avoid matching #define for
365 N_ and _.
366 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
367 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
368 * src/scan-gram.l: Revamp regular expressions so that " and '
369 do not confuse xgettext.
370
371 * src/struniq.h (struniq_new): Do not declare the return type
372 to be 'const'; this violates the C standard.
373 * src/struniq.c (struniq_new): Likewise.
374
3752002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
376
377 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
378 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
379 linker.
380
3812002-11-12 Akim Demaille <akim@epita.fr>
382
383 * Makefile.maint: Sync with Autoconf:
384 (local_updates): New.
385
3862002-11-12 Akim Demaille <akim@epita.fr>
387
388 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
389
3902002-11-12 Akim Demaille <akim@epita.fr>
391
392 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
393 locations.
394
3952002-11-12 Akim Demaille <akim@epita.fr>
396
397 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
398 not yyvalue.
399
4002002-11-12 Akim Demaille <akim@epita.fr>
401
402 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
403 Use it to test the GLR parser.
404
4052002-11-12 Akim Demaille <akim@epita.fr>
406
407 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
408 defines it.
409 * data/glr.c (yystos): New.
410 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
411 (YYDSYMPRINT): New.
412 (yyval): Don't define it, it is handled via M4.
413 (yyrecoverParseError): Free verbosely the discarded symbols.
414 * data/yacc.c (yysymprint): Remove, rather...
415 (b4_yysymprint_generate): invoke.
416 * data/c.m4 (b4_yysymprint_generate): New.
417 Accept pointers as arguments, as opposed to the version from
418 yacc.c.
419 (b4_yydestruct_generate): Likewise.
420 * tests/cations.at (Printers and Destructors): Use Bison directives
421 instead of CPP macros.
422 Don't rely on internal details.
423
4242002-11-12 Akim Demaille <akim@epita.fr>
425
426 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
427 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
428 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
429 it against YYEMPTY and so forth), work on yytoken (i.e., set
430 it to YYEMPTY etc.).
431 (yydestruct): Replace with a b4_yydestruct_generate invocation.
432 (b4_symbol_actions): Remove.
433 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
434 for 0, end-of-input.
435
4362002-11-12 Akim Demaille <akim@epita.fr>
437
438 * doc/bison.texinfo (Destructor Decl): New.
439
4402002-11-12 Akim Demaille <akim@epita.fr>
441
442 * src/tables.c (tables_generate): Use free for pointers that
443 cannot be NULL, not XFREE.
444 (pack_vector): Use assert, not fatal, for bound violations.
445 * src/state.c (state_new): Likewise.
446 * src/reader.c (reader): Likewise.
447 * src/lalr.c (set_goto_map): Likewise.
448 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
449 the file name.
450
4512002-11-12 Akim Demaille <akim@epita.fr>
452
453 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
454 Restore.
455 * src/scan-gram.l (last_string): Is global to the file, not to
456 yylex.
457 * src/parse-gram.y (input): Don't append the epilogue here,
458 (epilogue.opt): do it here, and free the scanner's obstack.
459 * src/reader.c (epilogue_set): Rename as...
460 (epilogue_augment): this.
461 * data/c.m4 (b4_epilogue): Defaults to empty.
462
4632002-11-12 Akim Demaille <akim@epita.fr>
464
465 * src/getargs.c (long_options): Remove duplicates.
466 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
467 Remove.
468 * doc/bison.rnh: Remove.
469 * doc/bison.texinfo (VMS Invocation): Remove.
470
4712002-11-12 Akim Demaille <akim@epita.fr>
472
473 * src/struniq.h, src/struniq.c (struniq_t): Is const.
474 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
475
476 Use struniq for symbols.
477
478 * src/symtab.h (symbol_t): The tag member is a struniq.
479 (symbol_type_set): Adjust.
480 * src/symtab.c (symbol_new): Takes a struniq.
481 (symbol_free): Don't free the tag member.
482 (hash_compare_symbol_t, hash_symbol_t): Rename as...
483 (hash_compare_symbol, hash_symbol): these.
484 Use the fact that tags as struniqs.
485 (symbol_get): Use struniq_new.
486 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
487 Returns a strniq.
488 * src/reader.h (merger_list, grammar_currentmerge_set): The name
489 and type members are struniqs.
490 * src/reader.c (get_merge_function)
491 (grammar_current_rule_merge_set): Adjust.
492 (TYPE, current_type): Are struniq.
493
494 Use struniq for file names.
495
496 * src/files.h, src/files.c (infile): Split into...
497 (grammar_file, current_file): these.
498 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
499 * src/reduce.c (reduce_print): Likewise.
500 * src/getargs.c (getargs): Likewise.
501 * src/complain.h, src/complain.c: Likewise.
502 * src/main.c (main): Call struniqs_new early enough to use it for
503 file names.
504 Don't free the input file name.
505
5062002-11-12 Akim Demaille <akim@epita.fr>
507
508 * src/symtab.c (symbol_free): Remove dead deactivated code:
509 type_name are properly removed.
510 Don't use XFREE to free items that cannot be NULL.
511 * src/struniq.h, src/struniq.c: New.
512 * src/main.c (main): Initialize/free struniqs.
513 * src/parse-gram.y (%union): Add astruniq member.
514 (yyprint): Adjust.
515 * src/scan-gram.l (<{tag}>): Return a struniq.
516 Free the obstack bit that used to store it.
517 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
518
5192002-11-11 Paul Eggert <eggert@twinsun.com>
520
521 Revamp to fix many (but not all) of the C- and M4-related quoting
522 problems. Among other things, this fixes the Bison bug reported
523 by Jan Hubicka when processing the Bash grammar; see:
524 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001329.html>
525
526 Use new @ escapes consistently. Represent brackets with @{ and @}
527 rather than @<:@ and @:>@, since this works a bit better with dumb
528 editors like vi. Represent @ with @@, since @ is now consistently
529 an escape. Use @oline@ and @ofile@ rather than __oline__ and
530 __ofile__, to avoid unexpected expansions. Similarly, use @output
531 rather than #output.
532
533 * data/c.m4 (b4_copyright): Omit file name from comment, since
534 the file name could contain "*/".
535 (b4_synclines_flag): Don't quote the 2nd argument; it should already
536 be quoted. All uses changed.
537
538 * data/glr.c: Use new @ escapes consistently.
539 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
540 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
541 Remove, since they couldn't handle arbitrary characters in file
542 names.
543 * data/lalr1.cc: Likewise.
544 * data/yacc.c: Likewise.
545
546 * src/files.c (output_infix): Remove; all uses removed.
547 * src/files.h: Likewise.
548
549 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
550 mishandled funny characters in file names, and anyway it isn't
551 needed any more.
552 * data/yacc.c: Likewise.
553 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
554
555 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
556 * data/yacc.c: Likewise.
557
558 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
559 strings now.
560 (muscle_init): Quote filename as a C string.
561 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
562 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
563 * src/output.c (escaped_file_name_output): New function.
564 (prepare_symbols): Quote tokens for M4.
565 (prepare): Don't insert output_infix, output_prefix,
566 output_parser_name, output_header_name; this is now down by scan-skel.
567 Insert skeleton as a C string.
568
569 * src/output.c (user_actions_output, symbol_destructors_output,
570 symbol_printers_output): Quote filenames for C and M4.
571 * src/reader.c (prologue_augment, epilogue_set): Likewise.
572
573 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
574 escapes other than \\ and \'; this simplifies the code.
575 (<SC_STRING>): Likewise, for \\ and \".
576 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
577 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
578 Use new escapes @{ and @} for [ and ].
579
580 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
581 them with auto vars.
582 Switch to new escape scheme, where @ is the escape character uniformly.
583 Abort if a stray escape character is found. Avoid unbounded input
584 buffer when parsing non-escaped text.
585
586 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
587 __oline__, #output, $@, and @{ do not have unintended meanings.
588
5892002-11-09 Paul Eggert <eggert@twinsun.com>
590
591 Fix the test failure due to GCC warnings described in
592 <http://mail.gnu.org/pipermail/bug-bison/2002-November/001815.html>.
593 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
594 evaluate to 0 if it's impossible for NINF to be in the respective
595 table.
596 (yygetLRActions, yyrecoverParseError): Use them.
597
598 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
599 counted in the token inserted at end of file. Now takes
600 location_t *, not location_t, so that the location can be
601 adjusted. All uses changed.
602
603 * tests/regression.at (Invalid inputs): Adjust wording in
604 diagnostic to match the new behavior.
605
606 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
607 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
608 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
609 abort ();'. This reduces the runtime of the "Many lookaheads"
610 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
611 GCC 3.2.
612
6132002-11-07 Paul Eggert <eggert@twinsun.com>
614
615 * src/parse-gram.y (CHARACTER): Remove unused token.
616 All uses removed.
617
618 * src/scan-gram.l: Remove stack option. We no longer use the
619 stack, since the stack was never deeper than 1; instead, use the
620 new auto var c_context to record the stacked value.
621
622 Remove nounput option. At an unexpected end of file, we now unput
623 the minimal input necessary to end cleanly; this simplifies the
624 code.
625
626 Avoid unbounded token sizes where this is easy.
627
628 (unexpected_end_of_file): New function.
629 Use it to systematize the error message on unexpected EOF.
630 (last-string): Now auto, not static.
631 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
632 (scanner_last_string_free): Remove; not used.
633 (percent_percent_count): Move decl to just before use.
634 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
635 not the (never otherwised-used) CHARACTER.
636
6372002-11-07 Akim Demaille <akim@epita.fr>
638
639 Let yyerror always receive the msg as last argument, so that
640 yyerror can be variadic.
641
642 * data/yacc.c (b4_yyerror_args): New.
643 Use it when calling yyerror.
644 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
645 Use it when calling yyerror.
646 * doc/bison.texinfo (Error Reporting): Adjust.
647 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
648 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
649
6502002-11-06 Akim Demaille <akim@epita.fr>
651
652 #line should have quoted strings.
653 Ideally, this should be done by m4_quotearg.
654
655 * src/scan-skel.l: Include quotearg.h.
656 Quote __ofile__.
657 * src/output.c (symbol_printers_output)
658 (symbol_destructors_output): Quote the file name.
659
6602002-11-06 Akim Demaille <akim@epita.fr>
661
662 * tests/regression.at (Invalid inputs): Adjust to the recent
663 messages.
664
6652002-11-06 Akim Demaille <akim@epita.fr>
666
667 Restore --no-lines.
668 Reported by Jim Kent.
669
670 * data/c.m4 (b4_syncline): New.
671 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
672 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
673 * src/output.c (user_actions_output): Likewise.
674 (prepare): Define 'b4_synclines_flag'.
675 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
676
6772002-11-06 Akim Demaille <akim@epita.fr>
678
679 * src/main.c (main): Free `infile'.
680 * src/scan-gram.l (handle_syncline): New.
681 Recognize `#line'.
682 * src/output.c (user_actions_output, symbol_destructors_output)
683 (symbol_printers_output): Use the location's file name, not
684 infile.
685 * src/reader.c (prologue_augment, epilogue_set): Likewise.
686
6872002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
688
689 * src/tables.c (matching_state): Don't allow states to match if
690 either has GLR conflict entries.
691
6922002-11-05 Paul Eggert <eggert@twinsun.com>
693
694 * src/scan-gram.l: Use more accurate diagnostics, e.g.
695 "integer out of range" rather than "invalid value".
696 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
697 accordingly.
698
699 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
700 Also, remove one static variable in the scanner.
701
702 * src/scan-gram.l (braces_level): Now auto, not static.
703 Initialize to zero if the compiler is being picky.
704 (INITIAL): Clear braces_level instead of incrementing it.
705 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
706 as POSIX 1003.1-2001 requires.
707 * src/system.h (IF_LINT): New macro, taken from coreutils.
708 * configure.ac: Define "lint" if --enable-gcc-warnings.
709
7102002-11-05 Akim Demaille <akim@epita.fr>
711
712 * src/scan-gram.l: When it starts with `%', complain about the
713 whole directive, not just that `invalid character: %'.
714
7152002-11-04 Akim Demaille <akim@epita.fr>
716
717 * Makefile.maint: Update from Autoconf.
718 (update, cvs-update, po-update, do-po-update): New.
719
7202002-11-04 Akim Demaille <akim@epita.fr>
721
722 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
723 and yyerror.
724 Have yyerror `use' its arguments.
725 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
726 returns true when location & yacc & pure & parse-param.
727 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
728
7292002-11-04 Akim Demaille <akim@epita.fr>
730
731 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
732 clashes.
733 * src/scan-gram.l: Use [\'] instead of ['] to pacify
734 font-lock-mode.
735 Use complain_at.
736 Use quote, not quote_n since LOCATION_PRINT no longer uses the
737 slot 0.
738
7392002-11-03 Paul Eggert <eggert@twinsun.com>
740
741 * src/reader.c (get_merge_function, grammar_current_rule_check):
742 Use consistent diagnostics for reporting type name clashes.
743 Quote the types with <>, for consistency with Yacc.
744 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
745
7462002-11-03 Akim Demaille <akim@epita.fr>
747
748 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
749 New.
750 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
751 (b4_parse_param): Remove.
752 Use b4_identification.
753 Propagate b4_pure_args where needed to pass them to yyerror.
754 * data/glr.m4 (b4_parse_param): Remove.
755 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
756 (b4_lpure_formals): New.
757 Use b4_identification.
758 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
759 b4_user_formals and b4_user_args.
760 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
761 (yyreportAmbiguity): When using a pure parser, also need
762 the location, and the parse-params.
763 Adjust callers.
764 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
765 When using a pure parser, also need the parse-params.
766 Adjust callers.
767 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
768 (%pure-parser + %parse-param) LALR and GLR parsers.
769 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
770 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
771 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
772 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
773 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
774 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
775 * doc/bison.texinfo: Untabify the whole file.
776 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
777 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
778 (Error Reporting): Adjust to these new directives.
779 Document %error-verbose, deprecate YYERROR_VERBOSE.
780
7812002-11-03 Akim Demaille <akim@epita.fr>
782
783 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
784 AT_CHECK_CALC_GLR invocations to use % directives, instead of
785 command line options.
786 * tests/cxx-type.at: Formatting changes.
787
7882002-11-03 Paul Eggert <eggert@twinsun.com>
789
790 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
791 to count columns correctly, and to check for invalid inputs.
792
793 Use mbsnwidth to count columns correctly. Account for tabs, too.
794 Include mbswidth.h.
795 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
796 (extend_location): New function.
797 (YY_LINES): Remove.
798
799 Handle CRLF in C code rather than in Lex code.
800 (YY_INPUT): New macro.
801 (no_cr_read): New function.
802
803 Scan UCNs, even though we don't fully handle them yet.
804 (convert_ucn_to_byte): New function.
805
806 Handle backslash-newline correctly in C code.
807 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
808 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
809 all uses changed.
810 (tag, splice): New EREs. Do not allow NUL or newline in tags.
811 Use {splice} wherever C allows backslash-newline.
812 YY_STEP after space, newline, vertical-tab.
813 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
814
815 (letter, id): Don't assume ASCII; e.g., spell out a-z.
816
817 ({int}, handle_action_dollar, handle_action_at): Check for integer
818 overflow.
819
820 (YY_STEP): Omit trailing semicolon, so that it's more like C.
821
822 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
823 as well as \000. Check for UCHAR_MAX, not 255.
824 Allow \x with an arbitrary positive number of digits, as in C.
825 Check for overflow here.
826 Allow \? and UCNs, for compatibility with C.
827
828 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
829 with quote slot used by complain_at.
830
831 * tests/input.at: Add tests for backslash-newline, m4 quotes
832 in symbols, long literals, and funny escapes in strings.
833
834 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
835 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
836 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
837 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
838 * m4/mbswidth.m4: New file, from GNU coreutils.
839
840 * doc/bison.texinfo (Grammar Outline): Document // comments.
841 (Symbols): Document that trigraphs have no special meaning in Bison,
842 nor is backslash-newline allowed.
843 (Actions): Document that trigraphs have no special meaning.
844
845 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
846 no longer used.
847
8482002-11-02 Paul Eggert <eggert@twinsun.com>
849
850 * src/reader.c: Don't include quote.h; not needed.
851 (get_merge_function): Reword warning to be consistent with
852 type clash diagnostic in grammar_current_rule_check.
853
854 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
855 bug in trigraph handling.
856
857 * src/output.c (prepare_symbols): When printing token names,
858 escape "[" as "@<:@" and likewise for "]".
859
860 * src/system.h (errno): Remove declaration, as we are now
861 assuming C89 or better, and C89 guarantees errno.
862
8632002-10-30 Paul Eggert <eggert@twinsun.com>
864
865 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
866 Check for close failures.
867 * src/files.h (xfclose): Return void, not int, since it always
868 returned zero.
869 * src/files.c (xfclose): Likewise. Report I/O error if ferror
870 indicates one.
871 * src/output.c (output_skeleton): Use xfclose rather than fclose
872 and ferror. xfclose now checks ferror.
873
874 * data/glr.c (YYLEFTMOST_STATE): Remove.
875 (yyreportTree): Use a stack-based leftmost state. This avoids
876 our continuing battles with bogus warnings about initializers.
877
8782002-10-30 Akim Demaille <akim@epita.fr>
879
880 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
881 #if.
882
8832002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
884
885 * tests/glr-regr1.at: New test for reported regressions.
886 * tests/testsuite.at: Add glr-regr1.at test.
887 * tests/Makefile.am: Add glr-regr1.at test.
888
8892002-10-24 Paul Eggert <eggert@twinsun.com>
890
891 Version 1.75a.
892
893 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
894 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
895 we use malloc. Don't assume 'A' through 'Z' are contiguous.
896 Don't assume strdup exists; POSIX says its an XSI extension.
897 Check for buffer overflow on input.
898
8992002-10-24 Akim Demaille <akim@epita.fr>
900
901 * src/output.c (output_skeleton): Don't disable M4sugar comments
902 too soon: it results in comments being expanded.
903 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
904 first output.
905
9062002-10-24 Akim Demaille <akim@epita.fr>
907
908 * data/yacc.c (m4_int_type): New.
909 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
910 char' as only yacc.c wants K&R portability.
911 * data/glr.c (yysigned_char): Remove.
912 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
913 Reported by Quoc Peyrot.
914
9152002-10-23 Paul Eggert <eggert@twinsun.com>
916
917 * src/main.c (main): With --trace=time, report times even if a
918 non-fatal error occurs. Formerly, the times were reported in some
919 such cases but not in others.
920 * src/reader.c (reader): Just return if a complaint has been issued,
921 instead of exiting, so that 'main' can report times.
922
9232002-10-22 Akim Demaille <akim@epita.fr>
924
925 * src/system.h: Include sys/types.
926 Reported by Bert Deknuydt.
927
9282002-10-23 Paul Eggert <eggert@twinsun.com>
929
930 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
931 Suggested by Art Haas.
932
9332002-10-22 Paul Eggert <eggert@twinsun.com>
934
935 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
936 decl; not needed any more.
937 * src/main.c (main): Use return to exit, undoing yesterday's change.
938 The last OS that we could find where this wouldn't work is
939 SunOS 3.5, and that's too old to worry about now.
940
941 * data/glr.c (struct yyltype): Define members even when not
942 doing locations. This is more consistent with yacc.c, and it
943 works around the following bug reports:
944 http://mail.gnu.org/pipermail/bug-bison/2002-October/001764.html
945 http://mail.gnu.org/pipermail/bug-bison/2002-October/001769.html
946 and I hope it also fixes this bug report:
947 http://mail.gnu.org/pipermail/bug-bison/2002-October/001748.html
948
949 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
950 @acronym consistently. Standardize on "Yacc" instead of "YACC",
951 "Algol" instead of "ALGOL". Give a bit more history about BNF.
952
9532002-10-22 Akim Demaille <akim@epita.fr>
954
955 * data/README: New.
956
9572002-10-21 Paul Eggert <eggert@twinsun.com>
958
959 Be consistent about 'bool'; the old code used an enum in one
960 module and an int in another, and this violates the C standard.
961 * m4/stdbool.m4: New file, from coreutils 4.5.3.
962 * configure.ac (AC_HEADER_STDBOOL): Add.
963 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
964 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
965 * src/symtab.c (hash_compare_symbol_t): Likewise.
966 * src/system.h (bool, false, true): Use a definition consistent
967 with ../lib/hash.c. All uses changed.
968
969 * src/complain.c (warning_issued): Renamed from warn_message_count,
970 so that we needn't worry about integer overflow (!).
971 Now of type bool. All uses changed.
972 (complaint_issued): Renamed from complain_message_count; likewise.
973
974 * src/main.c (main): Use exit to exit with failure.
975
976 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
977 rather than 1 and 0.
978 * src/main.c (main): Likewise.
979 * src/getargs.c (getargs): Likewise.
980 * src/reader.c (reader): Likewise.
981
982 * src/getarg.c (getargs): Remove duplicate code for
983 "Try `bison --help'".
984
985 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
986 What was that "2" for?
987
988 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
989 * src/getargs.c (usage): Likewise.
990
991 * src/getargs.c (getargs): When there are too few operands, report
992 the last one. When there are too many, report the first extra
993 one. This is how diffutils does it.
994
9952002-10-20 Paul Eggert <eggert@twinsun.com>
996
997 Remove K&R vestiges.
998 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
999 * src/complain.c (VA_START): Remove. Assume prototypes.
1000 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
1001 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
1002 fatal): Assume prototypes.
1003 * src/complain.h: Assume prototypes.
1004 * src/system.h (PARAMS): Remove.
1005 Include <limits.h> unconditionally, since it's guaranteeed even
1006 for a freestanding C89 compiler.
1007 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
1008 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
1009
10102002-10-20 Akim Demaille <akim@epita.fr>
1011
1012 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
1013 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
1014 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
1015 (yyresolveStates, yyresolveAction, yyresolveStack)
1016 (yyprocessOneStack): Use them.
1017 (yy_reduce_print): New.
1018 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
1019
10202002-10-20 Akim Demaille <akim@epita.fr>
1021
1022 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
1023 arguments and output `void'.
1024 (b4_c_function): Rename as...
1025 (b4_c_function_def): this.
1026 (b4_c_function_decl, b4_c_ansi_function_def)
1027 (b4_c_ansi_function_decl): New.
1028 Change the interpretation of the arguments: before `int, foo', now
1029 `int foo, foo'.
1030 * data/yacc.c (yyparse): Prototype and define thanks to these.
1031 Adjust b4_c_function_def uses.
1032 * data/glr.c (yyparse): Likewise, but ANSI only.
1033
10342002-10-20 Akim Demaille <akim@epita.fr>
1035
1036 * src/output.c (prepare): Move the definition of `tokens_number',
1037 `nterms_number', `undef_token_number', `user_token_number_max'
1038 to...
1039 (prepare_tokens): Here.
1040 (prepare_tokens): Rename as...
1041 (prepare_symbols): this.
1042 (prepare): Move the definition of `rules_number' to...
1043 (prepare_rules): here.
1044 (prepare): Move the definition of `last', `final_state_number',
1045 `states_number' to...
1046 (prepare_states): here.
1047 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
1048
10492002-10-20 Akim Demaille <akim@epita.fr>
1050
1051 * src/tables.h, src/tables.c, src/output.c: Comment changes.
1052
10532002-10-20 Akim Demaille <akim@epita.fr>
1054
1055 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
1056 * data/c.m4: here.
1057
10582002-10-20 Akim Demaille <akim@epita.fr>
1059
1060 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
1061 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
1062 `pair'.
1063 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
1064 `name' to...
1065 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
1066 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
1067 These.
1068
10692002-10-19 Paul Eggert <eggert@twinsun.com>
1070
1071 Do not create a temporary file, as that involves security and
1072 cleanup headaches. Instead, use a pair of pipes.
1073 Derived from a suggestion by Florian Krohm.
1074 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
1075 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
1076 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
1077 (BISON_PREREQ_SUBPIPE): Add.
1078 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
1079 Add subpipe.h, subpipe.c.
1080 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
1081 * po/POTFILES.in: Add lib/subpipe.c.
1082 * src/output.c: Include "subpipe.h".
1083 (m4_invoke): Remove decl.
1084 (scan_skel): New decl.
1085 (output_skeleton): Use pipe rather than temporary file for m4 input.
1086 Check that m4sugar.m4 is readable, to avoid deadlock.
1087 Check for pipe I/O error.
1088 * src/scan-skel.l (readpipe): Remove decl.
1089 (scan_skel): New function, to be used in place of m4_invoke.
1090 Read from stream rather than file.
1091
1092 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
1093 float, as this generates a warning on Solaris 8 + GCC 3.2 with
1094 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
1095 this generates a more-accurate value anyway.
1096
1097 * lib/timevar.c (timervar_accumulate): Rename locals to
1098 avoid confusion with similarly-named more-global.
1099 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
1100
1101 * src/output.c (prepare): Use xstrdup to convert char const *
1102 to char *, to avoid GCC warning.
1103
11042002-10-19 Akim Demaille <akim@epita.fr>
1105
1106 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
1107 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
1108 Use them to have `calc.y' ready for %pure-parser.
1109 * data/yacc.c (YYLEX): Pass a yylex return type to
1110 b4_c_function_call.
1111
11122002-10-19 Akim Demaille <akim@epita.fr>
1113
1114 Prototype support of %lex-param and %parse-param.
1115
1116 * src/parse-gram.y: Add the definition of the %lex-param and
1117 %parse-param tokens, plus their rules.
1118 Drop the `_' version of %glr-parser.
1119 Add the "," token.
1120 * src/scan-gram.l (INITIAL): Scan them.
1121 * src/muscle_tab.c: Comment changes.
1122 (muscle_insert, muscle_find): Rename `pair' as `probe'.
1123 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
1124 (muscle_entry_s): The `value' member is no longer const.
1125 Adjust all dependencies.
1126 * src/muscle_tab.c (muscle_init): Adjust: use
1127 MUSCLE_INSERT_STRING.
1128 Initialize the obstack earlier.
1129 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
1130 (muscle_pair_list_grow): New.
1131 * data/c.m4 (b4_c_function_call, b4_c_args): New.
1132 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
1133 * tests/calc.at: Use %locations, not --locations.
1134 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
1135
11362002-10-19 Akim Demaille <akim@epita.fr>
1137
1138 * src/getargs.c (usage): Take status as argument and exit
1139 accordingly.
1140 Report the traditional `Try ... --help' message when status != 0.
1141 (usage, version): Don't take a FILE * as arg, it is pointless.
1142 (getargs): When there is an incorrect number of arguments, make it
1143 an error, and report it GNUlically thanks to `usage ()'.
1144
11452002-10-18 Paul Eggert <eggert@twinsun.com>
1146
1147 * data/glr.c (yyreportParseError): Don't assume that sprintf
1148 yields the length of the printed string, as this is not true
1149 on SunOS 4.1.4. Reported by Peter Klein.
1150
1151 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
1152 * tests/conflicts.at (%nonassoc and eof): Likewise.
1153 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
1154
11552002-10-17 Akim Demaille <akim@epita.fr>
1156
1157 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
1158 * src/getargs.c (trace_types, trace_args): Adjust.
1159 * src/reader.c (grammar_current_rule_prec_set)
1160 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
1161 Standardize error messages.
1162 And s/@prec/%prec/!
1163 (reader): Use trace_flag to enable scanner/parser debugging,
1164 instead of an adhoc scheme.
1165 * src/scan-gram.l: Remove trailing debugging code.
1166
11672002-10-16 Paul Eggert <eggert@twinsun.com>
1168
1169 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
1170 MUSCLE_TAB_H.
1171
1172 * NEWS: Officially drop support for building Bison with K&R C,
1173 since it didn't work anyway and it's not worth worrying about.
1174 * Makefile.maint (wget_files): Remove ansi2knr.c.
1175 (ansi2knr.c-url_prefix): Remove.
1176 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
1177 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1178 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1179
11802002-10-15 Paul Eggert <eggert@twinsun.com>
1181
1182 Stop using the "enum_" trick for K&R-style function definitions;
1183 it confused me, and I was the author! Instead, assume that people
1184 who want to use K&R C compilers (when using these modules in GCC,
1185 perhaps?) will run ansi2knr.
1186
1187 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
1188 All uses of "enum_" changed to "enum ".
1189 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
1190 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
1191
1192 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
1193 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
1194 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
1195 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
1196 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
1197 abitset_not, abitset_ones, abitset_or, abitset_or_and,
1198 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
1199 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
1200 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
1201 Use function prototypes; this removes the need for declaring
1202 static functions simply to provide their prototypes.
1203 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
1204 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
1205 bitset_count_, bitset_create, bitset_dump, bitset_first,
1206 bitset_free, bitset_init, bitset_last, bitset_next,
1207 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
1208 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
1209 bitset_print, bitset_release_memory, bitset_toggle_,
1210 bitset_type_choose, bitset_type_get, bitset_type_name_get,
1211 debug_bitset): Likewise.
1212 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
1213 * lib/bitset_stats.c (bitset_log_histogram_print,
1214 bitset_percent_histogram_print, bitset_stats_and,
1215 bitset_stats_and_cmp, bitset_stats_and_or,
1216 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
1217 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
1218 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
1219 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
1220 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
1221 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
1222 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
1223 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
1224 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
1225 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
1226 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
1227 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
1228 bitset_stats_zero): Likewise.
1229 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
1230 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
1231 bitsetv_dump, debug_bitsetv): Likewise.
1232 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
1233 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
1234 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
1235 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
1236 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
1237 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
1238 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
1239 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
1240 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
1241 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
1242 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
1243 Likewise.
1244 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
1245 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
1246 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
1247 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
1248 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
1249 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
1250 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
1251 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
1252 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
1253 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
1254 lbitset_xor_cmp, lbitset_zero): Likewise.
1255
12562002-10-14 Akim Demaille <akim@epita.fr>
1257
1258 Version 1.75.
1259
12602002-10-14 Akim Demaille <akim@epita.fr>
1261
1262 * tests/Makefile.am (maintainer-check-posix): New.
1263
12642002-10-14 Akim Demaille <akim@epita.fr>
1265
1266 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
1267 member.
1268
12692002-10-14 Akim Demaille <akim@epita.fr>
1270
1271 * src/tables.c (table_ninf_remap): base -> tab.
1272 Reported by Matt Rosing.
1273
12742002-10-14 Paul Eggert <eggert@twinsun.com>
1275
1276 * tests/action.at, tests/calc.at, tests/conflicts.at,
1277 tests/cxx-type.at, tests/headers.at, tests/input.at,
1278 tests/regression.at, tests/synclines.at, tests/torture.at:
1279 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
1280 so that the tests still work even if POSIXLY_CORRECT is set.
1281 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
1282
1283 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
1284 for portability to K&R hosts. Fix typo: signed char is guaranteed
1285 only to 127, not to 128.
1286 * data/glr.c (yysigned_char): New type.
1287 * data/yacc.c (yysigned_char): Likewise.
1288 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
1289
12902002-10-13 Paul Eggert <eggert@twinsun.com>
1291
1292 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
1293 true due to limited range of data type" warning from GCC.
1294
1295 * data/c.m4 (b4_token_defines): Protect against double-inclusion
1296 by wrapping enum yytokentype's definition inside #ifndef
1297 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
1298
12992002-10-13 Akim Demaille <akim@epita.fr>
1300
1301 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
1302 Un yy- yyrhs to avoid the name clash with the global YYRHS.
1303
13042002-10-13 Akim Demaille <akim@epita.fr>
1305
1306 * Makefile.maint: Update from Autoconf 2.54.
1307 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
1308
13092002-10-13 Akim Demaille <akim@epita.fr>
1310
1311 * src/print.c (print_state): Separate the list of solved conflicts
1312 from the other items.
1313 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
1314
13152002-10-13 Akim Demaille <akim@epita.fr>
1316
1317 Let nondeterministic skeletons be usable with deterministic
1318 tables.
1319
1320 With the patch, GAWK compiled by GCC without -O2 passes its test
1321 suite using a GLR parser driven by LALR tables. It fails with -O2
1322 because `struct stat' gives two different answers on my machine:
1323 88 (definition of an auto var) and later 96 (memset on this var).
1324 Hence the stack is badly corrumpted. The headers inclusion is to
1325 blame: if I move the awk.h inclusion before GLR's system header
1326 inclusion, the two struct stat have the same size.
1327
1328 * src/tables.c (pack_table): Always create conflict_table.
1329 (token_actions): Always create conflict_list.
1330 * data/glr.c (YYFLAG): Remove, unused.
1331
13322002-10-13 Akim Demaille <akim@epita.fr>
1333
1334 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
1335 (O0FLAGS): New.
1336 (VALGRIND, GXX): New.
1337 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
1338 * tests/bison.in: Run $PREBISON a pre-command.
1339 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
1340 (maintainer-check-g++): New.
1341 * Makefile.am (maintainer-check): New.
1342
13432002-10-13 Akim Demaille <akim@epita.fr>
1344
1345 * data/glr.c: Formatting changes.
1346 Tweak some trace messages to match yacc.c's.
1347
13482002-10-13 Akim Demaille <akim@epita.fr>
1349
1350 GLR parsers sometimes raise parse errors instead of performing the
1351 default reduction.
1352 Reported by Charles-Henry de Boysson.
1353
1354 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
1355 check the length of the traces when %glr.
1356 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
1357 GLR's traces.
1358 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
1359 Test GLR parsers.
1360 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
1361 (yyltype): Remove the yy prefix from the member names.
1362 (yytable): Complete its comment.
1363 (yygetLRActions): Map error action number from YYTABLE from
1364 YYTABLE_NINF to 0.
1365 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
1366 (which was a bug: it should have been YYTABEL_NINF, and yet it was
1367 not satisfying as we could compare an YYACTION computed from
1368 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
1369 only value for error actions.
1370 (yyreportParseError): In verbose parse error messages, don't issue
1371 `error' in the list of expected tokens.
1372 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
1373 next action to perform to match glr.c's decoding.
1374 (yytable): Complete its comment.
1375
13762002-10-13 Paul Eggert <eggert@twinsun.com>
1377
1378 Fix problem reported by Henrik Grubbstroem in
1379 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001670.html>:
1380 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
1381 because the Bison parser reads the second action before reducing
1382 the first one.
1383 * src/scan-gram.l (rule_length): New static var.
1384 Use it to keep track of the rule length in the scanner, since
1385 we can't expect the parser to be in lock-step sync with the scanner.
1386 (handle_action_dollar, handle_action_at): Use this var.
1387 * tests/actions.at (Exotic Dollars): Test for the problem.
1388
13892002-10-12 Paul Eggert <eggert@twinsun.com>
1390
1391 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
1392 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
1393 Include <sys/time.h> when checking for clock_t and struct tms.
1394 Use same include order as source.
1395 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
1396 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001674.html>.
1397
1398 * lib/timevar.c: Update copyright date and clarify comments.
1399 (get_time) [IN_GCC]: Keep the GCC version for reference.
1400
1401 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
1402 GCC version as of today, then merge Bison's changes.
1403 Change "GCC" to "Bison" in copyright notice. timevar.def's
1404 author is Akim, so change that too.
1405
1406 * src/reader.c (grammar_current_rule_check):
1407 Don't worry about the default action if $$ is untyped.
1408 Prevents bogus warnings reported by Jim Gifford in
1409 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001673.html>.
1410
1411 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
1412 * data/glr.c, data/lalr1.cc, data/yacc.c:
1413 Output token definitions before the first part of user declarations.
1414 Fixes compatibility problem reported by Jim Gifford for kbd in
1415 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001672.html>.
1416
14172002-10-11 Paul Eggert <eggert@twinsun.com>
1418
1419 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
1420 (yyparse): here. This undoes some of the 2002-07-25 change.
1421 Compatibility problem reported by Ralf S. Engelschall with
1422 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
1423
14242002-10-11 Akim Demaille <akim@epita.fr>
1425
1426 * tests/regression.at Characters Escapes): New.
1427 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
1428 characters.
1429 Reported by Jan Nieuwenhuizen.
1430
14312002-10-11 Akim Demaille <akim@epita.fr>
1432
1433 * po/id.po: New.
1434
14352002-10-10 Paul Eggert <eggert@twinsun.com>
1436
1437 Portability fixes for bitsets; this also avoids several GCC
1438 warnings.
1439
1440 * lib/abitset.c: Include <stddef.h>, for offsetof.
1441 * lib/lbitset.c: Likewise.
1442
1443 * lib/abitset.c (abitset_bytes): Return a size that is aligned
1444 properly for vectors of objects. Do not assume that adding a
1445 header size to a multiple of a word size yields a value that is
1446 properly aligned for the whole union.
1447 * lib/bitsetv.c (bitsetv_alloc): Likewise.
1448
1449 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
1450 unique names for structures.
1451 * lib/ebitset.c (ebitset_bytes): Likewise.
1452 * lib/lbitset.c (lbitset_bytes): Likewise.
1453
1454 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
1455 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
1456 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
1457 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
1458 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
1459 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
1460 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
1461 to improve the type-checking that GCC can do.
1462 * lib/bitset.c (bitset_op4_cmp): Likewise.
1463 * lib/bitset_stats.c (bitset_stats_count,
1464 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
1465 bitset_stats_copy, bitset_stats_disjoint_p,
1466 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
1467 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
1468 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
1469 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
1470 bitset_stats_and_or_cmp, bitset_stats_andn_or,
1471 bitset_stats_andn_or_cmp, bitset_stats_or_and,
1472 bitset_stats_or_and_cmp): Likewise.
1473 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
1474 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
1475 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
1476 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
1477
1478 * lib/abitset.h: Include bitset.h, not bbitset.h.
1479 * lib/ebitset.h: Likewise.
1480 * lib/lbitset.h: Likewise.
1481
1482 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
1483 All instances of parameters of type enum bitset_opts are now of
1484 type enum_bitset_opts, to conform to the C Standard, and similarly
1485 for enum_bitset_type.
1486 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
1487 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
1488
1489 Do not use "struct bitset_struct" to mean different things in
1490 different modules. Not only is this confusing, it violates
1491 the C Standard, which requires that structure types in different
1492 modules must be compatible if one is to be passed to the other.
1493 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
1494 All instances of "struct bitset_struct *" replaced with "bitset".
1495 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
1496 (union bitset_union, struct abitset_struct, struct ebitset_struct,
1497 struct lbitset_struct, struct bitset_stats_struct): New types.
1498 All uses of struct bitset_struct changed to union bitset_union,
1499 etc.
1500 * lib/abitset.c (struct abitset_struct, abitset,
1501 struct bitset_struct): Remove.
1502 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
1503 struct bitset_struct): Remove.
1504 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
1505 bitset_struct): Remove.
1506 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
1507 Likewise.
1508
1509 Do not call a function of type T using a call that assumes the
1510 function is of a different type U. Standard C requires that a
1511 function must be called with a type that is compatible with its
1512 definition.
1513 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
1514 New decls.
1515 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
1516 New functions.
1517 * lib/ebitset.c (PFV): Remove.
1518 * lib/lbitset.c (PFV): Likewise.
1519 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
1520 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
1521 decls.
1522 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
1523 (ebitset_vtable): Use them.
1524 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
1525 lbitset_xor): New functions.
1526 (lbitset_vtable): Use them.
1527
1528 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
1529 Declare.
1530
1531 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
1532 GCC warning.
1533 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
1534 Use offsetof, for simplicity.
1535
15362002-10-06 Paul Eggert <eggert@twinsun.com>
1537
1538 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
1539 the same width as int. This reapplies a hunk of the 2002-08-12 patch
1540 <http://mail.gnu.org/pipermail/bison-patches/2002-August/001111.html>,
1541 which was inadvertently undone by the 2002-09-30 patch.
1542 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
1543 the same width as int.
1544
15452002-10-04 Paul Eggert <eggert@twinsun.com>
1546
1547 Version 1.50.
1548
1549 * configure.ac (AC_INIT), NEWS: Increment version number.
1550
1551 * doc/bison.texinfo: Minor spelling, grammar, and white space
1552 fixes.
1553 (Symbols): Mention that any negative value returned from yylex
1554 signifies end-of-input. Warn about negative chars. Mention
1555 the portable Standard C character set.
1556
1557 The GNU coding standard says CFLAGS and YFLAGS are reserved
1558 for the installer to set.
1559 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
1560 * src/Makefile.am (AM_CFLAGS): Likewise.
1561 (AM_YFLAGS): Renamed from YFLAGS.
1562
1563 Fix some MAX and MIN problems.
1564 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
1565 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
1566 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
1567 * src/reader.c (reader): Use it.
1568
1569 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
1570 POSIX 1003.1-2001 has removed fgrep.
1571
15722002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
1573
1574 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
1575 interpreted as signed.
1576 * lib/ebitset.c (ebitset_list): Fix bug.
1577
15782002-10-01 Paul Eggert <eggert@twinsun.com>
1579
1580 More fixes for 64-bit hosts and large bitsets.
1581
1582 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
1583 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
1584 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
1585 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
1586 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
1587 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
1588 bitset_count_): Likewise.
1589 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
1590 bitset_first, bitset_last): Likewise.
1591 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
1592 bitset_stats_list_reverse, bitset_stats_size,
1593 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
1594 Likewise.
1595 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
1596 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
1597 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
1598 bitsetv_reflexive_transitive_closure): Likewise.
1599 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
1600 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
1601 Likewise.
1602 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
1603 Likewise.
1604
1605 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
1606 Use size_t, not unsigned int, to count bytes.
1607 * lib/abitset.h (abitset_bytes): Likewise.
1608 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
1609 Likewise.
1610 * lib/bitset.h (bitset_bytes): Likewise.
1611 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
1612 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
1613 * lib/bitsetv.c (bitsetv_alloc): Likewise.
1614 * lib/ebitset.c (ebitset_bytes): Likewise.
1615 * lib/ebitset.h (ebitset_bytes): Likewise.
1616 * lib/lbitset.c (lbitset_bytes): Likewise.
1617 * lib/lbitset.h (lbitset_bytes): Likewise.
1618
1619 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
1620 abitset_subset_p, abitset_disjoint_p, abitset_and,
1621 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
1622 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
1623 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
1624 abitset_or_and, abitset_or_and_cmp):
1625 Use bitset_windex instead of unsigned int.
1626 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
1627 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
1628 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
1629 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
1630 Likewise.
1631 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
1632
1633 * lib/bitset.c (bitset_print):
1634 Use proper printf formats for widths of integer types.
1635 * lib/bitset_stats.c (bitset_percent_histogram_print,
1636 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
1637 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
1638 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
1639 * lib/lbitset.c (lbitset_bytes): Likewise.
1640
1641 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
1642 BITSET_SIZE_MAX): New macros.
1643 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
1644 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
1645 to BITSET_WINDEX_MAX.
1646
1647 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
1648 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
1649 since we now return the bitset_bindex type (not int).
1650
1651 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
1652 when computing sizes.
1653 * lib/ebitset.c (ebitset_elts_grow): Likewise.
1654
1655 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
1656 and avoid cast to unsigned.
1657
16582002-09-30 Akim Demaille <akim@epita.fr>
1659
1660 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
1661 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
1662 Updates from Michael Hayes.
1663
16642002-09-30 Art Haas <ahaas@neosoft.com>
1665
1666 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
1667 invocations.
1668 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
1669 defined.
1670
16712002-09-27 Akim Demaille <akim@epita.fr>
1672
1673 Version 1.49c.
1674
16752002-09-27 Akim Demaille <akim@epita.fr>
1676
1677 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
1678 (Because of AC_LIBSOURCE).
1679
16802002-09-27 Akim Demaille <akim@epita.fr>
1681
1682 Playing with Autoscan.
1683
1684 * configure.ac: Remove the old LIBOBJ tweaks.
1685 (AC_REPLACE_FUNCS): Add strrchr and strtol.
1686 * lib/strrchr.c: New.
1687 * lib/strtol.c: New, from the Coreutils 4.5.1.
1688
16892002-09-27 Akim Demaille <akim@epita.fr>
1690
1691 Playing with Autoscan.
1692
1693 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
1694 * lib/Makefile.am (libbison_a_SOURCES): No longer include
1695 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
1696 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
1697 Coreutils 4.5.1.
1698
16992002-09-24 Akim Demaille <akim@epita.fr>
1700
1701 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
1702 (Frequently Asked Questions, Parser Stack Overflow): New.
1703
17042002-09-13 Akim Demaille <akim@epita.fr>
1705
1706 Playing with autoscan.
1707
1708 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
1709 * src/files.c (skeleton_find): Remove, unused.
1710 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
1711 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
1712
17132002-09-13 Akim Demaille <akim@epita.fr>
1714
1715 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
1716 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
1717
17182002-09-13 Akim Demaille <akim@epita.fr>
1719
1720 * configure.ac: Require 2.54.
1721 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
1722 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
1723 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
1724 Remove, provided by Autoconf macros.
1725
17262002-09-12 Akim Demaille <akim@epita.fr>
1727
1728 * m4/prereq.m4: Update, from Coreutils 4.5.1.
1729
17302002-09-12 Akim Demaille <akim@epita.fr>
1731
1732 * m4/prereq.m4: Update, from Fileutils 4.1.5.
1733 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
1734 Reported by Martin Mokrejs.
1735
17362002-09-10 Akim Demaille <akim@epita.fr>
1737
1738 * src/parse-gram.y: Associate a human readable string to each
1739 token type.
1740 * tests/regression.at (Invalid inputs): Adjust.
1741
17422002-09-10 Gary V. Vaughan <gary@gnu.org>
1743
1744 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
1745 with an Autoconf-2.5x style configure.ac.
1746
17472002-09-06 Paul Eggert <eggert@twinsun.com>
1748
1749 * doc/bison.texinfo (Conditions): Make explicit that the GPL
1750 exception applies only to yacc.c. This is a modification of a
1751 patch originally suggested by Akim Demaille.
1752
17532002-09-06 Akim Demaille <akim@epita.fr>
1754
1755 * data/c.m4 (b4_copyright): Move the GPL exception comment from
1756 here to...
1757 * data/yacc.c: here.
1758
1759 * data/lalr1.cc (struct yyltype): Don't define it, since we use
1760 LocationType.
1761 (b4_ltype): Default to yy::Location from location.hh.
1762
17632002-09-04 Jim Meyering <jim@meyering.net>
1764
1765 * data/yacc.c: Guard the declaration of yytoknum also with
1766 `#ifdef YYPRINT', so it is declared only when used.
1767
17682002-09-04 Akim Demaille <akim@epita.fr>
1769
1770 * configure.in: Rename as...
1771 * configure.ac: this.
1772 Bump to 1.49c.
1773
17742002-09-04 Akim Demaille <akim@epita.fr>
1775
1776 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
1777 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
1778 translate maintainer only messages.
1779
17802002-08-12 Paul Eggert <eggert@twinsun.com>
1781
1782 Version 1.49b.
1783
1784 * Makefile.am (SUBDIRS): Remove intl.
1785 (DISTCLEANFILES): Remove.
1786 * NEWS: Mention that GNU M4 is now required. Clarify what is
1787 meant by "larger grammars". Mention the pt_BR translation.
1788 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
1789 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
1790 Bump version from 0.11.2 to 0.11.5.
1791 (BISON_PREREQ_STAGE): Remove.
1792 (AM_GNU_GETTEXT): Use external gettext.
1793 (AC_OUTPUT): Remove intl/Makefile.
1794
1795 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
1796
1797 * data/glr.c: Include string.h, for strlen.
1798 (yyreportParseError): Use size_t for yysize.
1799 (yy_yypstack): No longer nested inside yypstates, as nested
1800 functions are not portable. Do not assume size_t is the
1801 same width as int.
1802 (yypstates): Do not assume that ptrdiff_t is the same width
1803 as int, and similarly for yyposn and YYINDEX.
1804
1805 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
1806
1807 * lib/Makefile.am (INCLUDES): Do not include from the intl
1808 directory, which has been removed.
1809 * src/Makefile.am (INCLUDES): Likewise.
1810
1811 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
1812 (bitsets_sources, additional_bitsets_sources, timevars_sources):
1813 New vars.
1814
1815 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
1816 * tests/Makefile.am (EXTRA_DIST): Likewise.
1817
1818 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
1819 Do not assume that bitset_windex is the same width as unsigned.
1820
1821 * lib/abitset.c (abitset_unused_clear): Do not assume that
1822 bitset_word is the same width as int.
1823 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
1824 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
1825 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
1826 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
1827 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
1828
1829 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
1830 portability to one's complement hosts!).
1831 * lib/ebitset.c (ebitset_op1): Likewise.
1832 * lib/lbitset.c (lbitset_op1): Likewise.
1833
1834 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
1835 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
1836 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
1837 Sync with fileutils.
1838 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
1839 lib/gettext.h: Sync with diffutils.
1840
1841 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
1842 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
1843
1844 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
1845 PROTOTYPES to check for prototypes, and "defined __STDC__" to
1846 check for void *.
1847
1848 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
1849 size_t; the old version tried to do this but casted improperly.
1850 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
1851 (bitset_test): Now returns int, not unsigned long.
1852
1853 * lib/bitset_stats.c: Include "gettext.h".
1854 (_): New macro.
1855 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
1856 name locals "index", as it generates unnecessary warnings on some
1857 hosts that have an "index" function.
1858
1859 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
1860 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
1861 they need translation.
1862 * src/LR0.c (state_list_append, new_itemsets, get_state,
1863 append_states, generate_states): Likewise.
1864 * src/assoc.c (assoc_to_string): Likewise.
1865 * src/closure.c (print_closure, set_firsts, closure): Likewise.
1866 * src/gram.c (grammar_dump): Likewise.
1867 * src/injections.c (injections_compute): Likewise.
1868 * src/lalr.c (lookaheads_print): Likewise.
1869 * src/relation.c (relation_transpose): Likewise.
1870 * src/scan-gram.l: Likewise.
1871 * src/tables.c (table_grow, pack_vector): Likewise.
1872
1873 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
1874 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
1875 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
1876 * m4/mbstate_t.m4: Sync with fileutils.
1877 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
1878
1879 * po/LINGUAS: Add pt_BR.
1880 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
1881 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
1882 lib/timevar.c.
1883 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
1884 manual recommends.
1885 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
1886
1887 * src/complain.c (strerror_r): Remove decl; not needed.
1888 (strerror): Use same pattern as ../lib/error.c.
1889
1890 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
1891
1892 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
1893
1894 * src/main.c (main): Cast result of bindtextdomain and textdomain
1895 to void, to avoid a GCC warning when --disable-nls is in effect.
1896
1897 * src/scan-gram.l: Use strings rather than escapes when possible,
1898 to minimize the number of warnings from xgettext.
1899 (handle_action_dollar, handle_action_at): Don't use isdigit,
1900 as it mishandles negative chars and it may not work as expected
1901 outside the C locale.
1902
1903 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
1904 this is a GCC extension and is not portable to other compilers.
1905
1906 * src/system.h (alloca): Use same pattern as ../lib/error.c.
1907 Do not include <ctype.h>; no longer needed.
1908 Do not include <malloc.h>; no longer needed (and generates
1909 warnings on OpenBSD 3.0).
1910
1911 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
1912 it's not portable.
1913
1914 * tests/regression.at: Do not use 'cc -c input.c -o input';
1915 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
1916
1917 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
1918 exit status as failure, not just exit status 1. Sun C exits
1919 with status 2 sometimes.
1920
1921 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
1922 Use it for the two large tests.
1923
19242002-08-02 Akim Demaille <akim@epita.fr>
1925
1926 * src/conflicts.c (conflicts_output): Don't output rules never
1927 reduced here, since anyway that computation doesn't work.
1928 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
1929 (rule_useless_p, rule_never_reduced_p): New.
1930 (grammar_rules_partial_print): Use a filter instead of a range.
1931 Display the title only if needed.
1932 (grammar_rules_print): Adjust.
1933 (grammar_rules_never_reduced_report): New.
1934 * src/tables.c (action_row): Move the computation of rules never
1935 reduced to...
1936 (token_actions): here.
1937 * src/main.c (main): Make the parser before making the report, so
1938 that rules never reduced are computed.
1939 Call grammar_rules_never_reduced_report.
1940 * src/print.c (print_results): Report rules never reduced.
1941 * tests/conflicts.at, tests/reduce.at: Adjust.
1942
19432002-08-01 Akim Demaille <akim@epita.fr>
1944
1945 Instead of attaching lookaheads and duplicating the rules being
1946 reduced by a state, attach the lookaheads to the reductions.
1947
1948 * src/state.h (state_t): Remove the `lookaheads',
1949 `lookaheads_rule' member.
1950 (reductions_t): Add a `lookaheads' member.
1951 Use a regular array for the `rules'.
1952 * src/state.c (reductions_new): Initialize the lookaheads member
1953 to 0.
1954 (state_rule_lookaheads_print): Adjust.
1955 * src/state.h, src/state.c (state_reductions_find): New.
1956 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
1957 (count_rr_conflicts): Adjust.
1958 * src/lalr.c (LArule): Remove.
1959 (add_lookback_edge): Adjust.
1960 (state_lookaheads_count): New.
1961 (states_lookaheads_initialize): Merge into...
1962 (initialize_LA): this.
1963 (lalr_free): Adjust.
1964 * src/main.c (main): Don't free nullable and derives too early: it
1965 is used by --verbose.
1966 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
1967
19682002-08-01 Akim Demaille <akim@epita.fr>
1969
1970 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
1971 `rule_number_t**'.
1972 (set_derives, free_derives): Rename as...
1973 (derives_compute, derives_free): this.
1974 Adjust all dependencies.
1975 * src/nullable.c (set_nullable, free_nullable): Rename as...
1976 (nullable_compute, nullable_free): these.
1977 (rule_list_t): Store rule_t *, not rule_number_t.
1978 * src/state.c (state_rule_lookaheads_print): Directly compare rule
1979 pointers, instead of their numbers.
1980 * src/main.c (main): Call nullable_free, and derives_free earlier,
1981 as they were lo longer used.
1982
19832002-08-01 Akim Demaille <akim@epita.fr>
1984
1985 * lib/timevar.c (get_time): Include children time.
1986 * src/lalr.h (LA, LArule): Don't export them: used with the
1987 state_t.
1988 * src/lalr.c (LA, LArule): Static.
1989 * src/lalr.h, src/lalr.c (lalr_free): New.
1990 * src/main.c (main): Call it.
1991 * src/tables.c (pack_vector): Check whether loc is >= to the
1992 table_size, not >.
1993 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
1994 (tables_generate): do it, since that's also it which allocates
1995 them.
1996 Don't free LA and LArule, main does.
1997
19982002-07-31 Akim Demaille <akim@epita.fr>
1999
2000 Separate parser tables computation and output.
2001
2002 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
2003 (conflict_list, conflict_list_cnt, table, check, table_ninf)
2004 (yydefgoto, yydefact, high): Move to...
2005 * src/tables.h, src/tables.c: here.
2006 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
2007 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
2008 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
2009 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
2010 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
2011 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
2012 (action_row, save_row, token_actions, save_column, default_goto)
2013 (goto_actions, sort_actions, matching_state, pack_vector)
2014 (table_ninf_remap, pack_table, prepare_actions): Move to...
2015 * src/tables.c: here.
2016 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
2017 * src/output.c (token_actions, output_base, output_conflicts)
2018 (output_check): Merge into...
2019 (prepare_actions): this.
2020 (actions_output): Rename as...
2021 (user_actions_output): this.
2022 * src/main.c (main): Call tables_generate and tables_free.
2023
20242002-07-31 Akim Demaille <akim@epita.fr>
2025
2026 Steal GCC's --time-report support.
2027
2028 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
2029 stolen/adjusted from GCC.
2030 * m4/stage.m4: Remove time related checks.
2031 * m4/timevar.m4: New.
2032 * configure.in: Adjust.
2033 * src/system.h: Adjust to using timevar.h.
2034 * src/getargs.h, src/getargs.c: Support trace_time for
2035 --trace=time.
2036 * src/main.c (stage): Remove.
2037 (main): Replace `stage' invocations with timevar calls.
2038 * src/output.c: Insert pertinent timevar calls.
2039
20402002-07-31 Akim Demaille <akim@epita.fr>
2041
2042 Let --trace have arguments.
2043
2044 * src/getargs.h (enum trace_e): New.
2045 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
2046 (long_options, short_options): --trace/-T takes an optional
2047 argument.
2048 Change all the uses of trace_flag to reflect the new flags.
2049 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
2050
2051 Strengthen `stage' portability.
2052
2053 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
2054 * configure.in: Use it.
2055 Don't check for malloc.h and sys/times.h.
2056 * src/system.h: Include them when appropriate.
2057 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
2058 times and struct tms are available.
2059
20602002-07-30 Akim Demaille <akim@epita.fr>
2061
2062 In verbose parse error message, don't report `error' as an
2063 expected token.
2064 * tests/actions.at (Printers and Destructors): Adjust.
2065 * tests/calc.at (Calculator $1): Adjust.
2066 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
2067 error message, do not report the parser accepts the error token in
2068 that state.
2069
20702002-07-30 Akim Demaille <akim@epita.fr>
2071
2072 Normalize conflict related messages.
2073
2074 * src/complain.h, src/complain.c (warn, complain): New.
2075 * src/conflicts.c (conflicts_print): Use them.
2076 (conflict_report_yacc): New, extracted from...
2077 (conflicts_print): here.
2078 * tests/conflicts.at, tests/existing.at: Adjust.
2079
20802002-07-30 Akim Demaille <akim@epita.fr>
2081
2082 Report rules which are never reduced by the parser: those hidden
2083 by conflicts.
2084
2085 * src/LR0.c (save_reductions): Don't make the final state too
2086 different: save its reduction (accept) instead of having a state
2087 without any action (no shift or goto, no reduce).
2088 Note: the final state is now a ``regular'' state, i.e., the
2089 parsers now contain `reduce 0' as default reduction.
2090 Nevertheless, since they decide to `accept' when yystate =
2091 final_state, they still will not reduce rule 0.
2092 * src/print.c (print_actions, print_reduction): Adjust.
2093 * src/output.c (action_row): Track reduced rules.
2094 (token_actions): Report rules never reduced.
2095 * tests/conflicts.at, tests/regression.at: Adjust.
2096
20972002-07-30 Akim Demaille <akim@epita.fr>
2098
2099 `stage' was accidently included in a previous patch.
2100 Initiate its autoconfiscation.
2101
2102 * configure.in: Look for malloc.h and sys/times.h.
2103 * src/main.c (stage): Adjust.
2104 Report only when trace_flag.
2105
21062002-07-29 Akim Demaille <akim@epita.fr>
2107
2108 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
2109 state_number_t.
2110 (errs_t): symbol_t*, not symbol_number_t.
2111 (reductions_t): rule_t*, not rule_number_t.
2112 (FOR_EACH_SHIFT): New.
2113 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
2114 * src/print.c, src/print_graph.c: Adjust.
2115
21162002-07-29 Akim Demaille <akim@epita.fr>
2117
2118 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
2119
2120 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
2121 (endtoken, accept): these.
2122 * src/reader.c (reader): Set endtoken's default tag to "$end".
2123 Set undeftoken's tag to "$undefined" instead of "$undefined.".
2124 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
2125 Adjust.
2126
21272002-07-29 Akim Demaille <akim@epita.fr>
2128
2129 * src/reduce.c (reduce_grammar): When the language is empty,
2130 complain about the start symbol, not the axiom.
2131 Use its location.
2132 * tests/reduce.at (Empty Language): New.
2133
21342002-07-26 Akim Demaille <akim@epita.fr>
2135
2136 * src/reader.h, src/reader.c (gram_error): ... can't get
2137 yycontrol without making too strong assumptions on the parser
2138 itself.
2139 * src/output.c (prepare_tokens): Use the real 0th value of
2140 token_translations instead of `0'.
2141 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
2142 visible here.
2143 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
2144 for the time being: %locations ought to provide it to yyerror.
2145
21462002-07-25 Akim Demaille <akim@epita.fr>
2147
2148 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
2149 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
2150 * tests/regression.at (Web2c Actions): Adjust.
2151
21522002-07-25 Akim Demaille <akim@epita.fr>
2153
2154 Stop storing rules from 1 to nrules + 1.
2155
2156 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
2157 * src/nullable.c, src/output.c, src/print.c, src/reader.c
2158 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
2159 Iterate from 0 to nrules.
2160 Use rule_number_as_item_number and item_number_as_rule_number.
2161 Adjust to `derive' now containing possibly 0.
2162 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
2163 Handle the `- 1' part in rule numbers from/to item numbers.
2164 * src/conflicts.c (log_resolution): Fix the message which reversed
2165 shift and reduce.
2166 * src/output.c (action_row): Initialize default_rule to -1.
2167 (token_actions): Adjust.
2168 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
2169 expected output.
2170 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
2171
21722002-07-25 Akim Demaille <akim@epita.fr>
2173
2174 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
2175 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
2176 (b4_c_knr_arg_decl): New.
2177 * data/yacc.c: Use it to define yysymprint, yydestruct, and
2178 yyreport_parse_error.
2179
21802002-07-25 Akim Demaille <akim@epita.fr>
2181
2182 * data/yacc.c (yyreport_parse_error): New, extracted from...
2183 (yyparse): here.
2184 (yydestruct, yysymprint): Move above yyparse.
2185 Be K&R compliant.
2186
21872002-07-25 Akim Demaille <akim@epita.fr>
2188
2189 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
2190 replace...
2191 (b4_sint_type, b4_uint_type): these.
2192 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
2193 * tests/regression.at (Web2c Actions): Adjust.
2194
21952002-07-25 Akim Demaille <akim@epita.fr>
2196
2197 * src/gram.h (TIEM_NUMBER_MAX): New.
2198 (item_number_of_rule_number, rule_number_of_item_number): Rename
2199 as...
2200 (rule_number_as_item_number, item_number_as_rule_number): these.
2201 Adjust dependencies.
2202 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
2203 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
2204 (symbol_number_to_vector_number): New.
2205 (order): Of vector_number_t* type.
2206 (base_t, BASE_MAX, BASE_MIN): New.
2207 (froms, tos, width, pos, check): Of base_t type.
2208 (action_number_t, ACTION_MIN, ACTION_MAX): New.
2209 (actrow): Of action_number_t type.
2210 (conflrow): Of unsigned int type.
2211 (table_ninf, base_ninf): New.
2212 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
2213 (muscle_insert_int_table, muscle_insert_base_table)
2214 (muscle_insert_rule_number_table): New.
2215 (prepare_tokens): Output `toknum' as int_table.
2216 (action_row): Returns a rule_number_t.
2217 Use ACTION_MIN, not SHRT_MIN.
2218 (token_actions): yydefact is rule_number_t*.
2219 (table_ninf_remap): New.
2220 (pack_table): Use it for `base' and `table'.
2221 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
2222 replaced with...
2223 (YYPACT_NINF, YYTABLE_NINF): these.
2224 (yypact, yytable): Compute their types instead of hard-coded
2225 `short'.
2226 * tests/regression.at (Web2c Actions): Adjust.
2227
22282002-07-19 Akim Demaille <akim@epita.fr>
2229
2230 * src/scan-gram.l (id): Can start with an underscore.
2231
22322002-07-16 Akim Demaille <akim@epita.fr>
2233
2234 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
2235 Adjust all former `associativity' dependencies.
2236 * src/symtab.c (symbol_new): Default associativity is `undef', not
2237 `right'.
2238 (symbol_check_alias_consistence): Adjust.
2239
22402002-07-09 Akim Demaille <akim@epita.fr>
2241
2242 * doc/bison.texinfo: Properly set the ``header'' part.
2243 Use @dircategory ``GNU programming tools'' as per Texinfo's
2244 documentation.
2245 Use @copying.
2246
22472002-07-09 Akim Demaille <akim@epita.fr>
2248
2249 * lib/quotearg.h: Protect against multiple inclusions.
2250 * src/location.h (location_t): Add a `file' member.
2251 (LOCATION_RESET, LOCATION_PRINT): Adjust.
2252 * src/complain.c (warn_at, complain_at, fatal_at): Drop
2253 `error_one_per_line' support.
2254
22552002-07-09 Akim Demaille <akim@epita.fr>
2256
2257 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
2258 * src/reader.c (lineno): Remove.
2259 Adjust all dependencies.
2260 (get_merge_function): Take a location and use complain_at.
2261 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
2262 * tests/regression.at (Invalid inputs, Mixing %token styles):
2263 Adjust.
2264
22652002-07-09 Akim Demaille <akim@epita.fr>
2266
2267 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
2268 recovery rule, and forbid extensions when --yacc.
2269 (gram_error): Use complain_at.
2270 * src/reader.c (reader): Exit if there were parse errors.
2271
22722002-07-09 Akim Demaille <akim@epita.fr>
2273
2274 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
2275 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
2276 Reported by R Blake <blakers@mac.com>.
2277
22782002-07-09 Akim Demaille <akim@epita.fr>
2279
2280 * data/yacc.c: Output the copyright notive in the header.
2281
22822002-07-03 Akim Demaille <akim@epita.fr>
2283
2284 * src/output.c (froms, tos): Are state_number_t.
2285 (save_column): sp, sp1, and sp2 are state_number_t.
2286 (prepare): Rename `final' as `final_state_number', `nnts' as
2287 `nterms_number', `nrules' as `rules_number', `nstates' as
2288 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
2289 unused.
2290 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
2291 * data/lalr1.cc (nsym_): Remove, unused.
2292
22932002-07-03 Akim Demaille <akim@epita.fr>
2294
2295 * src/lalr.h, src/lalr.c (goto_number_t): New.
2296 * src/lalr.c (goto_list_t): New.
2297 Propagate them.
2298 * src/nullable.c (rule_list_t): New.
2299 Propagate.
2300 * src/types.h: Remove.
2301
23022002-07-03 Akim Demaille <akim@epita.fr>
2303
2304 * src/closure.c (print_fderives): Use rule_rhs_print.
2305 * src/derives.c (print_derives): Use rule_rhs_print.
2306 (rule_list_t): New, replaces `shorts'.
2307 (set_derives): Add comments.
2308 * tests/sets.at (Nullable, Firsts): Adjust.
2309
23102002-07-03 Akim Demaille <akim@epita.fr>
2311
2312 * src/output.c (prepare_actions): Free `tally' and `width'.
2313 (prepare_actions): Allocate and free `order'.
2314 * src/symtab.c (symbols_free): Free `symbols'.
2315 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
2316 * src/output.c (m4_invoke): Move to...
2317 * src/scan-skel.l: here.
2318 (<<EOF>>): Close yyout, and free its name.
2319
23202002-07-03 Akim Demaille <akim@epita.fr>
2321
2322 Fix some memory leaks, and fix a bug: state 0 was examined twice.
2323
2324 * src/LR0.c (new_state): Merge into...
2325 (state_list_append): this.
2326 (new_states): Merge into...
2327 (generate_states): here.
2328 (set_states): Don't ensure a proper `errs' state member here, do it...
2329 * src/conflicts.c (conflicts_solve): here.
2330 * src/state.h, src/state.c: Comment changes.
2331 (state_t): Rename member `shifts' as `transitions'.
2332 Adjust all dependencies.
2333 (errs_new): For consistency, also take the values as argument.
2334 (errs_dup): Remove.
2335 (state_errs_set): New.
2336 (state_reductions_set, state_transitions_set): Assert that no
2337 previous value was assigned.
2338 (state_free): New.
2339 (states_free): Use it.
2340 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
2341 temporary storage: use `errs' and `nerrs' as elsewhere.
2342 (set_conflicts): Allocate and free this `errs'.
2343
23442002-07-02 Akim Demaille <akim@epita.fr>
2345
2346 * lib/libiberty.h: New.
2347 * lib: Update the bitset implementation from upstream.
2348 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
2349 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
2350 * src/main.c: Adjust bitset stats calls.
2351
23522002-07-01 Paul Eggert <eggert@twinsun.com>
2353
2354 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
2355 char, so that negative chars don't collide with $.
2356
23572002-06-30 Akim Demaille <akim@epita.fr>
2358
2359 Have the GLR tests be `warning' checked, and fix the warnings.
2360
2361 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
2362 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
2363 (yyremoveDeletes): `yyi' and `yyj' are size_t.
2364 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
2365 (yyaddDeferredAction): static.
2366 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
2367 (yyreportParseError): yyprefix is const.
2368 yytokenp is used only when verbose.
2369 (yy__GNUC__): Replace with __GNUC__.
2370 (yypdumpstack): yyi is size_t.
2371 (yypreference): Un-yy local variables and arguments, to avoid
2372 clashes with `yyr1'. Anyway, we are not in the user name space.
2373 (yytname_size): be an int, as is compared with ints.
2374 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
2375 Use them.
2376 * tests/cxx-gram.at: Use quotation to protect $1.
2377 Use AT_COMPILE to enable warnings hunts.
2378 Prototype yylex and yyerror.
2379 `Use' argc.
2380 Include `string.h', not `strings.h'.
2381 Produce and prototype stmtMerge only when used.
2382 yylex takes a location.
2383
23842002-06-30 Akim Demaille <akim@epita.fr>
2385
2386 We spend a lot of time in quotearg, in particular when --verbose.
2387
2388 * src/symtab.c (symbol_get): Store a quoted version of the key.
2389 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
2390 Adjust all callers.
2391
23922002-06-30 Akim Demaille <akim@epita.fr>
2393
2394 * src/state.h (reductions_t): Rename member `nreds' as num.
2395 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
2396 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
2397
23982002-06-30 Akim Demaille <akim@epita.fr>
2399
2400 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
2401 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
2402 (shifts_to): Rename as...
2403 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
2404 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
2405 (TRANSITION_IS_DISABLED, transitions_to): these.
2406
24072002-06-30 Akim Demaille <akim@epita.fr>
2408
2409 * src/print.c (print_shifts, print_gotos): Merge into...
2410 (print_transitions): this.
2411 (print_transitions, print_errs, print_reductions): Align the
2412 lookaheads columns.
2413 (print_core, print_transitions, print_errs, print_state,
2414 print_grammar): Output empty lines separator before, not after.
2415 (state_default_rule_compute): Rename as...
2416 (state_default_rule): this.
2417 * tests/conflicts.at (Defaulted Conflicted Reduction),
2418 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
2419 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
2420
24212002-06-30 Akim Demaille <akim@epita.fr>
2422
2423 Display items as we display rules.
2424
2425 * src/gram.h, src/gram.c (rule_lhs_print): New.
2426 * src/gram.c (grammar_rules_partial_print): Use it.
2427 * src/print.c (print_core): Likewise.
2428 * tests/conflicts.at (Defaulted Conflicted Reduction),
2429 (Unresolved SR Conflicts): Adjust.
2430 (Unresolved SR Conflicts): Adjust and rename as...
2431 (Resolved SR Conflicts): this, as was meant.
2432 * tests/regression.at (Web2c Report): Adjust.
2433
24342002-06-30 Akim Demaille <akim@epita.fr>
2435
2436 * src/print.c (state_default_rule_compute): New, extracted from...
2437 (print_reductions): here.
2438 Pessimize, but clarify the code.
2439 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
2440
24412002-06-30 Akim Demaille <akim@epita.fr>
2442
2443 * src/output.c (action_row): Let default_rule be always a rule
2444 number.
2445
24462002-06-30 Akim Demaille <akim@epita.fr>
2447
2448 * src/closure.c (print_firsts, print_fderives, closure):
2449 Use BITSET_EXECUTE.
2450 * src/lalr.c (lookaheads_print): Likewise.
2451 * src/state.c (state_rule_lookaheads_print): Likewise.
2452 * src/print_graph.c (print_core): Likewise.
2453 * src/print.c (print_reductions): Likewise.
2454 * src/output.c (action_row): Likewise.
2455 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
2456
24572002-06-30 Akim Demaille <akim@epita.fr>
2458
2459 * src/print_graph.c: Use report_flag.
2460
24612002-06-30 Akim Demaille <akim@epita.fr>
2462
2463 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
2464 to...
2465 * src/relation.h, src/relation.c (traverse, relation_digraph)
2466 (relation_print, relation_transpose): New.
2467
24682002-06-30 Akim Demaille <akim@epita.fr>
2469
2470 * src/state.h, src/state.c (shifts_to): New.
2471 * src/lalr.c (build_relations): Use it.
2472
24732002-06-30 Akim Demaille <akim@epita.fr>
2474
2475 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
2476 (item_number_of_rule_number, rule_number_of_item_number): New.
2477 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
2478 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
2479 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
2480 Propagate their use.
2481 Much remains to be done, in particular wrt `shorts' from types.h.
2482
24832002-06-30 Akim Demaille <akim@epita.fr>
2484
2485 * src/symtab.c (symbol_new): Initialize the `printer' member.
2486
24872002-06-30 Akim Demaille <akim@epita.fr>
2488
2489 * src/LR0.c (save_reductions): Remove, replaced by...
2490 * src/state.h, src/state.c (state_reductions_set): New.
2491 (reductions, errs): Rename as...
2492 (reductions_t, errs_t): these.
2493 Adjust all dependencies.
2494
24952002-06-30 Akim Demaille <akim@epita.fr>
2496
2497 * src/LR0.c (state_list_t, state_list_append): New.
2498 (first_state, last_state): Now symbol_list_t.
2499 (this_state): Remove.
2500 (new_itemsets, append_states, save_reductions): Take a state_t as
2501 argument.
2502 (set_states, generate_states): Adjust.
2503 (save_shifts): Remove, replaced by...
2504 * src/state.h, src/state.c (state_shifts_set): New.
2505 (shifts): Rename as...
2506 (shifts_t): this.
2507 Adjust all dependencies.
2508 * src/state.h (state_t): Remove the `next' member.
2509
25102002-06-30 Akim Demaille <akim@epita.fr>
2511
2512 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
2513 escaped in slot 0.
2514
25152002-06-30 Akim Demaille <akim@epita.fr>
2516
2517 Use hash.h for the state hash table.
2518
2519 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
2520 (allocate_storage): Use state_hash_new.
2521 (free_storage): Use state_hash_free.
2522 (new_state, get_state): Adjust.
2523 * src/lalr.h, src/lalr.c (states): Move to...
2524 * src/states.h (state_t): Remove the `link' member, no longer
2525 used.
2526 * src/states.h, src/states.c: here.
2527 (state_hash_new, state_hash_free, state_hash_lookup)
2528 (state_hash_insert, states_free): New.
2529 * src/states.c (state_table, state_compare, state_hash): New.
2530 * src/output.c (output_actions): Do not free states now, since we
2531 still need to know the final_state number in `prepare', called
2532 afterwards. Do it...
2533 * src/main.c (main): here: call states_free after `output'.
2534
25352002-06-30 Akim Demaille <akim@epita.fr>
2536
2537 * src/state.h, src/state.c (state_new): New, extracted from...
2538 * src/LR0.c (new_state): here.
2539 * src/state.h (STATE_ALLOC): Move to...
2540 * src/state.c: here.
2541 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
2542 * src/state.h, src/state.c: here.
2543
25442002-06-30 Akim Demaille <akim@epita.fr>
2545
2546 * src/reader.c (gensym): Rename as...
2547 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
2548 (getsym): Rename as...
2549 (symbol_get): this.
2550
25512002-06-30 Akim Demaille <akim@epita.fr>
2552
2553 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
2554 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
2555 * src/output.c, src/print.c, src/print_graph.c: Propagate.
2556 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
2557
25582002-06-30 Akim Demaille <akim@epita.fr>
2559
2560 Make the test suite pass with warnings checked.
2561
2562 * tests/actions.at (Printers and Destructors): Improve.
2563 Avoid unsigned vs. signed issues.
2564 * tests/calc.at: Don't exercise the scanner here, do it...
2565 * tests/input.at (Torturing the Scanner): here.
2566
25672002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2568
2569 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
2570 reorganize first lines parallel to yacc.c.
2571
25722002-06-28 Akim Demaille <akim@epita.fr>
2573
2574 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
2575 (b4_token_enum, b4_token_defines): New, factored from...
2576 * data/lalr1.cc, data/yacc.c, glr.c: here.
2577
25782002-06-28 Akim Demaille <akim@epita.fr>
2579
2580 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
2581 unused variables.
2582 * src/output.c (merger_output): static.
2583
25842002-06-28 Akim Demaille <akim@epita.fr>
2585
2586 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
2587 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
2588 pacify GCC.
2589 * src/output.c (save_row): Initialize all the variables to pacify GCC.
2590
25912002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2592
2593 Accumulated changelog for new GLR parsing features.
2594
2595 * src/conflicts.c (count_total_conflicts): Change name to
2596 conflicts_total_count.
2597 * src/conflicts.h: Ditto.
2598 * src/output.c (token_actions): Use the new name.
2599 (output_conflicts): Change conflp => conflict_list_heads, and
2600 confl => conflict_list for better readability.
2601 * data/glr.c: Use the new names.
2602 * NEWS: Add self to GLR announcement.
2603
2604 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
2605
2606 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
2607 Akim Demaille.
2608
2609 * data/bison.glr: Change name to glr.c
2610 * data/glr.c: Renamed from bison.glr.
2611 * data/Makefile.am: Add glr.c
2612
2613 * src/getargs.c:
2614
2615 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
2616 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
2617
2618 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2619
2620 * data/bison.glr: Be sure to restore the
2621 current #line when returning to the skeleton contents after having
2622 exposed the input file's #line.
2623
2624 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2625
2626 * data/bison.glr: Bring up to date with changes to bison.simple.
2627
2628 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2629
2630 * data/bison.glr: Correct definitions that use b4_prefix.
2631 Various reformatting.
2632 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
2633 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
2634 yytokenp argument; now part of stack.
2635 (yychar): Define to behave as documented.
2636 (yyclearin): Ditto.
2637
2638 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2639
2640 * src/reader.h: Add declaration for free_merger_functions.
2641
2642 * src/reader.c (merge_functions): New variable.
2643 (get_merge_function): New function.
2644 (free_merger_functions): New function.
2645 (readgram): Check for %prec that is not followed by a symbol.
2646 Handle %dprec and %merge declarations.
2647 (packgram): Initialize dprec and merger fields in rules array.
2648
2649 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
2650 conflict_list_cnt, conflict_list_free): New variables.
2651 (table_grow): Also grow conflict_table.
2652 (prepare_rules): Output dprec and merger tables.
2653 (conflict_row): New function.
2654 (action_row): Output conflict lists for GLR parser. Don't use
2655 default reduction in conflicted states for GLR parser so that there
2656 are spaces for the conflict lists.
2657 (save_row): Also save conflict information.
2658 (token_actions): Allocate conflict list.
2659 (merger_output): New function.
2660 (pack_vector): Pack conflict table, too.
2661 (output_conflicts): New function to output yyconflp and yyconfl.
2662 (output_check): Allocate conflict_tos.
2663 (output_actions): Output conflict tables, also.
2664 (output_skeleton): Output b4_mergers definition.
2665 (prepare): Output b4_max_rhs_length definition.
2666 Use 'bison.glr' as default skeleton for GLR parsers.
2667
2668 * src/gram.c (glr_parser): New flag.
2669 (grammar_free): Call free_merger_functions.
2670
2671 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
2672 all pairs of conflicting reductions, rather than just all tokens
2673 causing conflicts. Needed to size conflict tables.
2674 (conflicts_output): Modify call to count_rr_conflicts for new
2675 interface.
2676 (conflicts_print): Ditto.
2677 (count_total_conflicts): New function.
2678
2679 * src/reader.h (merger_list): New type.
2680 (merge_functions): New variable.
2681
2682 * src/lex.h (tok_dprec, tok_merge): New token types.
2683
2684 * src/gram.h (rule_s): Add dprec and merger fields.
2685 (glr_parser): New flag.
2686
2687 * src/conflicts.h (count_total_conflicts): New function.
2688
2689 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
2690
2691 * doc/bison.texinfo (Generalized LR Parsing): New section.
2692 (GLR Parsers): New section.
2693 (Language and Grammar): Mention GLR parsing.
2694 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
2695 Correct typo ("tge" -> "the").
2696
2697 * data/bison.glr: New skeleton for GLR parsing.
2698
2699 * tests/cxx-gram.at: New tests for GLR parsing.
2700
2701 * tests/testsuite.at: Include cxx-gram.at.
2702
2703 * tests/Makefile.am: Add cxx-gram.at.
2704
2705 * src/parse-gram.y:
2706
2707 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
2708
2709 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
2710
27112002-06-27 Akim Demaille <akim@epita.fr>
2712
2713 * src/options.h, src/options.c: Remove.
2714 * src/getargs.c (short_options, long_options): New.
2715
27162002-06-27 Akim Demaille <akim@epita.fr>
2717
2718 * data/bison.simple, data/bison.c++: Rename as...
2719 * data/yacc.c, data/lalr1.cc: these.
2720 * doc/bison.texinfo (Environment Variables): Remove.
2721
27222002-06-25 Raja R Harinath <harinath@cs.umn.edu>
2723
2724 * src/getargs.c (report_argmatch): Initialize strtok().
2725
27262002-06-20 Akim Demaille <akim@epita.fr>
2727
2728 * data/bison.simple (b4_symbol_actions): New, replaces...
2729 (b4_symbol_destructor, b4_symbol_printer): these.
2730 (yysymprint): Be sure to call YYPRINT only for tokens, and using
2731 user token numbers.
2732
27332002-06-20 Akim Demaille <akim@epita.fr>
2734
2735 * data/bison.simple (yydestructor): Rename as...
2736 (yydestruct): this.
2737
27382002-06-20 Akim Demaille <akim@epita.fr>
2739
2740 * src/symtab.h, src/symtab.c (symbol_type_set)
2741 (symbol_destructor_set, symbol_precedence_set): The location is
2742 the last argument.
2743 Adjust all callers.
2744
27452002-06-20 Akim Demaille <akim@epita.fr>
2746
2747 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
2748 internals.
2749 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
2750 Takes a location.
2751 * src/symtab.h, src/symtab.c (symbol_class_set)
2752 (symbol_user_token_number_set): Likewise.
2753 Adjust all callers.
2754 Promote complain_at.
2755 * tests/input.at (Type Clashes): Adjust.
2756
27572002-06-20 Akim Demaille <akim@epita.fr>
2758
2759 * data/bison.simple (YYLEX): Fix the declaration when
2760 %pure-parser.
2761
27622002-06-20 Akim Demaille <akim@epita.fr>
2763
2764 * data/bison.simple (yysymprint): Don't print the token number,
2765 just its name.
2766 * tests/actions.at (Destructors): Rename as...
2767 (Printers and Destructors): this.
2768 Also exercise %printer.
2769
27702002-06-20 Akim Demaille <akim@epita.fr>
2771
2772 * data/bison.simple (YYDSYMPRINT): New.
2773 Use it to remove many of the #if YYDEBUG/if (yydebug).
2774
27752002-06-20 Akim Demaille <akim@epita.fr>
2776
2777 * src/symtab.h, src/symtab.c (symbol_t): printer and
2778 printer_location are new members.
2779 (symbol_printer_set): New.
2780 * src/parse-gram.y (PERCENT_PRINTER): New token.
2781 Handle its associated rule.
2782 * src/scan-gram.l: Adjust.
2783 (handle_destructor_at, handle_destructor_dollar): Rename as...
2784 (handle_symbol_code_at, handle_symbol_code_dollar): these.
2785 * src/output.c (symbol_printers_output): New.
2786 (output_skeleton): Call it.
2787 * data/bison.simple (yysymprint): New. Cannot be named yyprint
2788 since there are already many grammar files with a user `yyprint'.
2789 Replace the calls to YYPRINT to calls to yysymprint.
2790 * tests/calc.at: Adjust.
2791 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
2792 taking advantage of parser very internal details (stack size!).
2793
27942002-06-20 Akim Demaille <akim@epita.fr>
2795
2796 * src/scan-gram.l: Complete the scanner with the missing patterns
2797 to pacify Flex.
2798 Use `quote' and `symbol_tag_get' where appropriate.
2799
28002002-06-19 Akim Demaille <akim@epita.fr>
2801
2802 * tests/actions.at (Destructors): Augment to test locations.
2803 * data/bison.simple (yydestructor): Pass it the current location
2804 if locations are enabled.
2805 Prototype only when __STDC__ or C++.
2806 Change the argument names to move into the yy name space: there is
2807 user code here.
2808
28092002-06-19 Akim Demaille <akim@epita.fr>
2810
2811 * data/bison.simple (b4_pure_if): New.
2812 Use it instead of #ifdef YYPURE.
2813
28142002-06-19 Akim Demaille <akim@epita.fr>
2815
2816 * data/bison.simple (b4_location_if): New.
2817 Use it instead of #ifdef YYLSP_NEEDED.
2818
28192002-06-19 Akim Demaille <akim@epita.fr>
2820
2821 Prepare @$ in %destructor, but currently don't bind it in the
2822 skeleton, as %location use is not cleaned up yet.
2823
2824 * src/scan-gram.l (handle_dollar, handle_destructor_at)
2825 (handle_action_at): New.
2826 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
2827 a braced_code_t and a location as additional arguments.
2828 (handle_destructor_dollar): Instead of requiring `b4_eval', just
2829 unquote one when outputting `b4_dollar_dollar'.
2830 Adjust callers.
2831 * data/bison.simple (b4_eval): Remove.
2832 (b4_symbol_destructor): Adjust.
2833 * tests/input.at (Invalid @n): Adjust.
2834
28352002-06-19 Zack Weinberg <zack@codesourcery.com>
2836
2837 * doc/bison.texinfo: Document ability to have multiple
2838 prologue sections.
2839
28402002-06-18 Akim Demaille <akim@epita.fr>
2841
2842 * src/files.c (compute_base_names): When computing the output file
2843 names from the input file name, strip the directory part.
2844
28452002-06-18 Akim Demaille <akim@epita.fr>
2846
2847 * data/bison.simple.new: Comment changes.
2848 Reported by Andreas Schwab.
2849
28502002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
2851
2852 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
2853 there are no `label `yyoverflowlab' defined but not used' warnings
2854 when yyoverflow is defined.
2855
28562002-06-18 Akim Demaille <akim@epita.fr>
2857
2858 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
2859 new member.
2860 (symbol_destructor_set): Adjust.
2861 * src/output.c (symbol_destructors_output): Output the destructor
2862 locations.
2863 Output the symbol name.
2864 * data/bison.simple (b4_symbol_destructor): Adjust.
2865
28662002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
2867 and Akim Demaille <akim@epita.fr>
2868
2869 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
2870 what's left on the stack when the error recovery hits EOF.
2871 * tests/actions.at (Destructors): Complete to exercise this case.
2872
28732002-06-17 Akim Demaille <akim@epita.fr>
2874
2875 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
2876 arguments is really empty, not only equal to `[]'.
2877 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
2878 member.
2879 (symbol_destructor_set): New.
2880 * src/output.c (symbol_destructors_output): New.
2881 * src/reader.h (brace_code_t, current_braced_code): New.
2882 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
2883 (handle_dollar): Rename as...
2884 (handle_action_dollar): this.
2885 (handle_destructor_dollar): New.
2886 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
2887 (grammar_declaration): Use it.
2888 * data/bison.simple (yystos): Is always defined.
2889 (yydestructor): New.
2890 * tests/actions.at (Destructors): New.
2891 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
2892
28932002-06-17 Akim Demaille <akim@epita.fr>
2894
2895 * src/symlist.h, src/symlist.c (symbol_list_length): New.
2896 * src/scan-gram.l (handle_dollar, handle_at): Compute the
2897 rule_length only when needed.
2898 * src/output.c (actions_output, token_definitions_output): Output
2899 the full M4 block.
2900 * src/symtab.c: Don't access directly to the symbol tag, use
2901 symbol_tag_get.
2902 * src/parse-gram.y: Use symbol_list_free.
2903
29042002-06-17 Akim Demaille <akim@epita.fr>
2905
2906 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
2907 (symbol_list_prepend, get_type_name): Move to...
2908 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
2909 (symbol_list_prepend, symbol_list_n_type_name_get): here.
2910 Adjust all callers.
2911 (symbol_list_free): New.
2912 * src/scan-gram.l (handle_dollar): Takes a location.
2913 * tests/input.at (Invalid $n): Adjust.
2914
29152002-06-17 Akim Demaille <akim@epita.fr>
2916
2917 * src/reader.h, src/reader.c (symbol_list_new): Export it.
2918 (symbol_list_prepend): New.
2919 * src/parse-gram.y (%union): `list' is a new member.
2920 (symbols.1): New, replaces...
2921 (terms_to_prec.1, nterms_to_type.1): these.
2922 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
2923 Take a location as additional argument.
2924 Adjust all callers.
2925
29262002-06-15 Akim Demaille <akim@epita.fr>
2927
2928 * src/parse-gram.y: Move %token in the declaration section so that
2929 we don't depend upon CVS Bison.
2930
29312002-06-15 Akim Demaille <akim@epita.fr>
2932
2933 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
2934 * src/print.c (print_core): Use it.
2935
29362002-06-15 Akim Demaille <akim@epita.fr>
2937
2938 * src/conflicts.c (log_resolution): Accept the rule involved in
2939 the sr conflicts instead of the lookahead number that points to
2940 that rule.
2941 (flush_reduce): Accept the current lookahead vector as argument,
2942 instead of the index in LA.
2943 (resolve_sr_conflict): Accept the current number of lookahead
2944 bitset to consider for the STATE, instead of the index in LA.
2945 (set_conflicts): Adjust.
2946 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
2947
29482002-06-15 Akim Demaille <akim@epita.fr>
2949
2950 * src/state.h (state_t): Replace the `lookaheadsp' member, a
2951 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
2952 Adjust all dependencies.
2953 * src/lalr.c (initialize_lookaheads): Split into...
2954 (states_lookaheads_count, states_lookaheads_initialize): these.
2955 (lalr): Adjust.
2956
29572002-06-15 Akim Demaille <akim@epita.fr>
2958
2959 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
2960 out of...
2961 (grammar_rules_print): here.
2962 * src/reduce.c (reduce_output): Use it.
2963 * tests/reduce.at (Useless Rules, Reduced Automaton)
2964 (Underivable Rules): Adjust.
2965
29662002-06-15 Akim Demaille <akim@epita.fr>
2967
2968 Copy BYacc's nice way to report the grammar.
2969
2970 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
2971 New.
2972 Don't print the rules' location, it is confusing and useless.
2973 (rule_print): Use grammar_rhs_print.
2974 * src/print.c (print_grammar): Use grammar_rules_print.
2975
29762002-06-15 Akim Demaille <akim@epita.fr>
2977
2978 Complete and rationalize `useless thing' warnings.
2979
2980 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
2981 (symbol_tag_print): New.
2982 Use them everywhere in place of accessing directly the tag member.
2983 * src/gram.h, src/gram.c (rule_print): New.
2984 Use it where a rule used to be printed `by hand'.
2985 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
2986 (reduce_grammar_tables): Report the useless rules.
2987 (reduce_print): Useless things are a warning, not an error.
2988 Report it as such.
2989 * tests/reduce.at (Useless Nonterminals, Useless Rules):
2990 (Reduced Automaton, Underivable Rules): Adjust.
2991 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
2992 * tests/conflicts.at (Unresolved SR Conflicts)
2993 (Solved SR Conflicts): Adjust.
2994
29952002-06-15 Akim Demaille <akim@epita.fr>
2996
2997 Let symbols have a location.
2998
2999 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
3000 (getsym): Adjust.
3001 Adjust all callers.
3002 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
3003 Use location_t, not int.
3004 * src/symtab.c (symbol_check_defined): Take advantage of the
3005 location.
3006 * tests/regression.at (Invalid inputs): Adjust.
3007
30082002-06-15 Akim Demaille <akim@epita.fr>
3009
3010 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
3011 (input): Don't try to initialize yylloc here, do it in the
3012 scanner.
3013 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
3014 * src/gram.h (rule_t): Change line and action_line into location
3015 and action_location, of location_t type.
3016 Adjust all dependencies.
3017 * src/location.h, src/location.c (empty_location): New.
3018 * src/reader.h, src/reader.c (grammar_start_symbol_set)
3019 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
3020 (grammar_current_rule_symbol_append)
3021 (grammar_current_rule_action_append): Expect a location as argument.
3022 * src/reader.c (grammar_midrule_action): Adjust to attach an
3023 action's location as dummy symbol location.
3024 * src/symtab.h, src/symtab.c (startsymbol_location): New.
3025 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
3026 the line numbers.
3027
30282002-06-14 Akim Demaille <akim@epita.fr>
3029
3030 Grammar declarations may be found in the grammar section.
3031
3032 * src/parse-gram.y (rules_or_grammar_declaration): New.
3033 (declarations): Each declaration may end with a semicolon, not
3034 just...
3035 (grammar_declaration): `"%union"'.
3036 (grammar): Branch to rules_or_grammar_declaration.
3037
30382002-06-14 Akim Demaille <akim@epita.fr>
3039
3040 * src/main.c (main): Invoke scanner_free.
3041
30422002-06-14 Akim Demaille <akim@epita.fr>
3043
3044 * src/output.c (m4_invoke): Extracted from...
3045 (output_skeleton): here.
3046 Free tempfile.
3047
30482002-06-14 Akim Demaille <akim@epita.fr>
3049
3050 * src/parse-gram.y (directives, directive, gram)
3051 (grammar_directives, precedence_directives, precedence_directive):
3052 Rename as...
3053 (declarations, declaration, grammar, grammar_declaration)
3054 (precedence_declaration, precedence_declarator): these.
3055 (symbol_declaration): New.
3056
30572002-06-14 Akim Demaille <akim@epita.fr>
3058
3059 * src/files.c (action_obstack): Remove, unused.
3060 (output_obstack): Remove it, and all its dependencies, as it is no
3061 longer needed.
3062 * src/reader.c (epilogue_set): Build the epilogue in the
3063 muscle_obstack.
3064 * src/output.h, src/output.c (muscle_obstack): Move to...
3065 * src/muscle_tab.h, src/muscle_tab.h: here.
3066 (muscle_init): Initialize muscle_obstack.
3067 (muscle_free): New.
3068 * src/main.c (main): Call it.
3069
30702002-06-14 Akim Demaille <akim@epita.fr>
3071
3072 * src/location.h: New, extracted from...
3073 * src/reader.h: here.
3074 * src/Makefile.am (noinst_HEADERS): Merge into
3075 (bison_SOURCES): this.
3076 Add location.h.
3077 * src/parse-gram.y: Use location_t instead of Bison's.
3078 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
3079 Use location_t instead of ints.
3080
30812002-06-14 Akim Demaille <akim@epita.fr>
3082
3083 * data/bison.simple, data/bison.c++: Be sure to restore the
3084 current #line when returning to the skeleton contents after having
3085 exposed the input file's #line.
3086
30872002-06-12 Akim Demaille <akim@epita.fr>
3088
3089 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
3090 eager.
3091 * tests/actions.at (Exotic Dollars): New.
3092
30932002-06-12 Akim Demaille <akim@epita.fr>
3094
3095 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
3096 ['"/] too eagerly.
3097 * tests/input.at (Torturing the Scanner): New.
3098
30992002-06-11 Akim Demaille <akim@epita.fr>
3100
3101 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
3102 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
3103 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
3104 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
3105 * src/reader.c (reader): Use it.
3106
31072002-06-11 Akim Demaille <akim@epita.fr>
3108
3109 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
3110 Adjust all callers.
3111 (scanner_last_string_free): New.
3112
31132002-06-11 Akim Demaille <akim@epita.fr>
3114
3115 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
3116 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
3117 (last_string, YY_OBS_FREE): New.
3118 Use them when returning an ID.
3119
31202002-06-11 Akim Demaille <akim@epita.fr>
3121
3122 Have Bison grammars parsed by a Bison grammar.
3123
3124 * src/reader.c, src/reader.h (prologue_augment): New.
3125 * src/reader.c (copy_definition): Remove.
3126
3127 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
3128 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
3129 (grammar_current_rule_prec_set, grammar_current_rule_check)
3130 (grammar_current_rule_symbol_append)
3131 (grammar_current_rule_action_append): Export.
3132 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
3133 (symbol_list_action_append): Remove.
3134 Hook the routines from reader.
3135 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
3136 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
3137
3138 * src/reader.c (read_declarations): Remove, unused.
3139
3140 * src/parse-gram.y: Handle the epilogue.
3141 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
3142 (grammar_start_symbol_set): this.
3143 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
3144 * src/reader.c (readgram): Remove, unused.
3145 (reader): Adjust to insert eoftoken and axiom where appropriate.
3146
3147 * src/reader.c (copy_dollar): Replace with...
3148 * src/scan-gram.h (handle_dollar): this.
3149 * src/parse-gram.y: Remove `%thong'.
3150
3151 * src/reader.c (copy_at): Replace with...
3152 * src/scan-gram.h (handle_at): this.
3153
3154 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
3155 New.
3156
3157 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
3158 time being.
3159
3160 * src/reader.h, src/reader.c (grammar_rule_end): New.
3161
3162 * src/parse.y (current_type, current_class): New.
3163 Implement `%nterm', `%token' support.
3164 Merge `%term' into `%token'.
3165 (string_as_id): New.
3166 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
3167 type name.
3168
3169 * src/parse-gram.y: Be sure to handle properly the beginning of
3170 rules.
3171
3172 * src/parse-gram.y: Handle %type.
3173 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
3174
3175 * src/parse-gram.y: More directives support.
3176 * src/options.c: No longer handle source directives.
3177
3178 * src/parse-gram.y: Fix %output.
3179
3180 * src/parse-gram.y: Handle %union.
3181 Use the prologue locations.
3182 * src/reader.c (parse_union_decl): Remove.
3183
3184 * src/reader.h, src/reader.c (epilogue_set): New.
3185 * src/parse-gram.y: Use it.
3186
3187 * data/bison.simple, data/bison.c++: b4_stype is now either not
3188 defined, then default to int, or to the contents of %union,
3189 without `union' itself.
3190 Adjust.
3191 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
3192
3193 * src/output.c (actions_output): Don't output braces, as they are
3194 already handled by the scanner.
3195
3196 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
3197 characters to themselves.
3198
3199 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
3200 that the epilogue has a proper #line.
3201
3202 * src/parse-gram.y: Handle precedence/associativity.
3203
3204 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
3205 a terminal.
3206 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
3207 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
3208 at all to define terminals that cannot be emitted.
3209
3210 * src/scan-gram.l: Escape M4 characters.
3211
3212 * src/scan-gram.l: Working properly with escapes in user
3213 strings/characters.
3214
3215 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
3216 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
3217 grammar.
3218 Use more modest sizes, as for the time being the parser does not
3219 release memory, and therefore the process swallows a huge amount
3220 of memory.
3221
3222 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
3223 stricter %token grammar.
3224
3225 * src/symtab.h (associativity): Add `undef_assoc'.
3226 (symbol_precedence_set): Do nothing when passed an undef_assoc.
3227 * src/symtab.c (symbol_check_alias_consistence): Adjust.
3228
3229 * tests/regression.at (Invalid %directive): Remove, as it is now
3230 meaningless.
3231 (Invalid inputs): Adjust to the new error messages.
3232 (Token definitions): The new grammar doesn't allow too many
3233 eccentricities.
3234
3235 * src/lex.h, src/lex.c: Remove.
3236 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
3237 (copy_character, copy_string2, copy_string, copy_identifier)
3238 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
3239 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
3240 (parse_action): Remove.
3241 * po/POTFILES.in: Adjust.
3242
32432002-06-11 Akim Demaille <akim@epita.fr>
3244
3245 * src/reader.c (parse_action): Don't store directly into the
3246 rule's action member: return the action as a string.
3247 Don't require `rule_length' as an argument: compute it.
3248 (grammar_current_rule_symbol_append)
3249 (grammar_current_rule_action_append): New, eved out from
3250 (readgram): here.
3251 Remove `action_flag', `rulelength', unused now.
3252
32532002-06-11 Akim Demaille <akim@epita.fr>
3254
3255 * src/reader.c (grammar_current_rule_prec_set).
3256 (grammar_current_rule_check): New, eved out from...
3257 (readgram): here.
3258 Remove `xaction', `first_rhs': useless.
3259 * tests/input.at (Type clashes): New.
3260 * tests/existing.at (GNU Cim Grammar): Adjust.
3261
32622002-06-11 Akim Demaille <akim@epita.fr>
3263
3264 * src/reader.c (grammar_midrule_action): New, Eved out from
3265 (readgram): here.
3266
32672002-06-11 Akim Demaille <akim@epita.fr>
3268
3269 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
3270 New.
3271 (readgram): Use them as replacement of inlined code, crule and
3272 crule1.
3273
32742002-06-11 Akim Demaille <akim@epita.fr>
3275
3276 * src/reader.c (grammar_end, grammar_symbol_append): New.
3277 (readgram): Use them.
3278 Make the use of `p' as local as possible.
3279
32802002-06-10 Akim Demaille <akim@epita.fr>
3281
3282 GCJ's parser requires the tokens to be defined before the prologue.
3283
3284 * data/bison.simple: Output the token definition before the user's
3285 prologue.
3286 * tests/regression.at (Braces parsing, Duplicate string)
3287 (Mixing %token styles): Check the output from bison.
3288 (Early token definitions): New.
3289
32902002-06-10 Akim Demaille <akim@epita.fr>
3291
3292 * src/symtab.c (symbol_user_token_number_set): Don't complain when
3293 assigning twice the same user number to a token, so that we can
3294 use it in...
3295 * src/lex.c (lex): here.
3296 Also use `symbol_class_set' instead of hand written code.
3297 * src/reader.c (parse_assoc_decl): Likewise.
3298
32992002-06-10 Akim Demaille <akim@epita.fr>
3300
3301 * src/symtab.c, src/symtab.c (symbol_class_set)
3302 (symbol_user_token_number_set): New.
3303 * src/reader.c (parse_token_decl): Use them.
3304 Use a switch instead of ifs.
3305 Use a single argument.
3306
33072002-06-10 Akim Demaille <akim@epita.fr>
3308
3309 Remove `%thong' support as it is undocumented, unused, duplicates
3310 `%token's job, and creates useless e-mail traffic with people who
3311 want to know what it is, why it is undocumented, unused, and
3312 duplicates `%token's job.
3313
3314 * src/reader.c (parse_thong_decl): Remove.
3315 * src/options.c (option_table): Remove "thong".
3316 * src/lex.h (tok_thong): Remove.
3317
33182002-06-10 Akim Demaille <akim@epita.fr>
3319
3320 * src/symtab.c, src/symtab.c (symbol_type_set)
3321 (symbol_precedence_set): New.
3322 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
3323 (value_components_used): Remove, unused.
3324
33252002-06-09 Akim Demaille <akim@epita.fr>
3326
3327 Move symbols handling code out of the reader.
3328
3329 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
3330 (axiom): Move to...
3331 * src/symtab.h, src/symtab.c: here.
3332
3333 * src/gram.c (start_symbol): Remove: use startsymbol->number.
3334 * src/reader.c (startval): Rename as...
3335 * src/symtab.h, src/symtab.c (startsymbol): this.
3336 * src/reader.c: Adjust.
3337
3338 * src/reader.c (symbol_check_defined, symbol_make_alias)
3339 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
3340 (token_translations_init)
3341 Move to...
3342 * src/symtab.c: here.
3343 * src/reader.c (packsymbols): Move to...
3344 * src/symtab.h, src/symtab.c (symbols_pack): here.
3345 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
3346 argument.
3347
33482002-06-03 Akim Demaille <akim@epita.fr>
3349
3350 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
3351 then statements.
3352
33532002-06-03 Akim Demaille <akim@epita.fr>
3354
3355 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
3356 structs with non literals.
3357 * src/scan-skel.l: never-interactive.
3358 * src/conflicts.c (enum conflict_resolution_e): No trailing
3359 comma.
3360 * src/getargs.c (usage): Split long literal strings.
3361 Reported by Hans Aberg.
3362
33632002-05-28 Akim Demaille <akim@epita.fr>
3364
3365 * data/bison.c++: Use C++ ostreams.
3366 (cdebug_): New member.
3367
33682002-05-28 Akim Demaille <akim@epita.fr>
3369
3370 * src/output.c (output_skeleton): Be sure to allocate enough room
3371 for `/' _and_ for `\0' in full_skeleton.
3372
33732002-05-28 Akim Demaille <akim@epita.fr>
3374
3375 * data/bison.c++: Catch up with bison.simple:
3376 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3377 and Paul Eggert <eggert@twinsun.com>: `error' handing.
3378 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
3379 and popping traces.
3380
33812002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3382
3383 * src/output.c (output_skeleton): Put an explicit path in front of
3384 the skeleton file name, rather than relying on the -I directory,
3385 to partially alleviate effects of having a skeleton file lying around
3386 in the current directory.
3387
33882002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3389
3390 * src/conflicts.c (log_resolution): Correct typo:
3391 obstack_printf should be obstack_fgrow1.
3392
33932002-05-26 Akim Demaille <akim@epita.fr>
3394
3395 * src/state.h (state_t): `solved_conflicts' is a new member.
3396 * src/LR0.c (new_state): Set it to 0.
3397 * src/conflicts.h, src/conflicts.c (print_conflicts)
3398 (free_conflicts, solve_conflicts): Rename as...
3399 (conflicts_print, conflicts_free, conflicts_solve): these.
3400 Adjust callers.
3401 * src/conflicts.c (enum conflict_resolution_e)
3402 (solved_conflicts_obstack): New, used by...
3403 (log_resolution): this.
3404 Adjust to attach the conflict resolution to each state.
3405 Complete the description with the precedence/associativity
3406 information.
3407 (resolve_sr_conflict): Adjust.
3408 * src/print.c (print_state): Output its solved_conflicts.
3409 * tests/conflicts.at (Unresolved SR Conflicts)
3410 (Solved SR Conflicts): Exercise --report=all.
3411
34122002-05-26 Akim Demaille <akim@epita.fr>
3413
3414 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
3415 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
3416 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
3417 (token_number_t, item_number_as_token_number)
3418 (token_number_as_item_number, muscle_insert_token_number_table):
3419 Rename as...
3420 (symbol_number_t, item_number_as_symbol_number)
3421 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
3422 these, since it is more appropriate.
3423
34242002-05-26 Akim Demaille <akim@epita.fr>
3425
3426 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
3427 `Error:' lines.
3428 * data/bison.simple (yystos) [YYDEBUG]: New.
3429 (yyparse) [YYDEBUG]: Display the symbols which are popped during
3430 error recovery.
3431 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
3432
34332002-05-25 Akim Demaille <akim@epita.fr>
3434
3435 * doc/bison.texinfo (Debugging): Split into...
3436 (Tracing): this new section, its former contents, and...
3437 (Understanding): this new section.
3438 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
3439 by...
3440 (report_flag): this.
3441 Adjust all dependencies.
3442 (report_args, report_types, report_argmatch): New.
3443 (usage, getargs): Report/support -r, --report.
3444 * src/options.h
3445 (struct option_table_struct): Rename as..,
3446 (struct option_table_s): this.
3447 Rename the `set_flag' member to `flag' to match with getopt_long's
3448 struct.
3449 * src/options.c (option_table): Split verbose into an entry for
3450 %verbose, and another for --verbose.
3451 Support --report/-r, so remove -r from the obsolete --raw.
3452 * src/print.c: Attach full item sets and lookaheads reports to
3453 report_flag instead of trace_flag.
3454 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
3455
34562002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3457 and Paul Eggert <eggert@twinsun.com>
3458
3459 * data/bison.simple (yyparse): Correct error handling to conform to
3460 POSIX and yacc. Specifically, after syntax error is discovered,
3461 do not reduce further before shifting the error token.
3462 Clean up the code a bit by removing the labels yyerrdefault,
3463 yyerrhandle, yyerrpop.
3464 * NEWS: Document the above.
3465
34662002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3467
3468 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
3469 type; it isn't always big enough, since it doesn't necessarily
3470 include non-terminals.
3471 (yytranslate): Expand definition of yy_token_number_type, so that
3472 the latter can be removed.
3473 (yy_token_number_type): Remove, only one use.
3474 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
3475 don't use TokenNumberType as element type.
3476
3477 * tests/regression.at: Modify expected output to agree with change
3478 to yyr1 and yytranslate.
3479
34802002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
3481
3482 * src/reader.c (parse_action): Use copy_character instead of
3483 obstack_1grow.
3484
34852002-05-13 Akim Demaille <akim@epita.fr>
3486
3487 * tests/regression.at (Token definitions): Prototype yylex and
3488 yyerror.
3489
34902002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3491
3492 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
3493 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
3494 32-bit arithmetic.
3495 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
3496
34972002-05-07 Akim Demaille <akim@epita.fr>
3498
3499 * tests/synclines.at: Be sure to prototype yylex and yyerror to
3500 avoid GCC warnings.
3501
35022002-05-07 Akim Demaille <akim@epita.fr>
3503
3504 Kill GCC warnings.
3505
3506 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
3507 over the RHS of each rule.
3508 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
3509 * src/state.h (state_t): Member `nitems' is unsigned short.
3510 * src/LR0.c (get_state): Adjust.
3511 * src/reader.c (packgram): Likewise.
3512 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
3513 `Type'.
3514 (muscle_insert_int_table): Remove, unused.
3515 (prepare_rules): Remove `max'.
3516
35172002-05-06 Akim Demaille <akim@epita.fr>
3518
3519 * src/closure.c (print_firsts): Display of the symbol tags.
3520 (bitmatrix_print): Move to...
3521 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
3522 here.
3523 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
3524
35252002-05-06 Akim Demaille <akim@epita.fr>
3526
3527 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
3528 hash_do_for_each.
3529
35302002-05-06 Akim Demaille <akim@epita.fr>
3531
3532 * src/LR0.c (new_state, get_state): Instead of using the global
3533 `kernel_size' and `kernel_base', have two new arguments:
3534 `core_size' and `core'.
3535 Adjust callers.
3536
35372002-05-06 Akim Demaille <akim@epita.fr>
3538
3539 * src/reader.c (packgram): No longer end `ritem' with a 0
3540 sentinel: it is not used.
3541
35422002-05-05 Akim Demaille <akim@epita.fr>
3543
3544 New experimental feature: display the lookaheads in the report and
3545 graph.
3546
3547 * src/print (print_core): When --trace-flag, display the rules
3548 lookaheads.
3549 * src/print_graph.c (print_core): Likewise.
3550 Swap the arguments.
3551 Adjust caller.
3552
35532002-05-05 Akim Demaille <akim@epita.fr>
3554
3555 * tests/torture.at (Many lookaheads): New test.
3556
35572002-05-05 Akim Demaille <akim@epita.fr>
3558
3559 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
3560 (GENERATE_MUSCLE_INSERT_TABLE): this.
3561 (output_int_table, output_unsigned_int_table, output_short_table)
3562 (output_token_number_table, output_item_number_table): Replace with...
3563 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
3564 (muscle_insert_short_table, muscle_insert_token_number_table)
3565 (muscle_insert_item_number_table): these.
3566 Adjust all callers.
3567 (prepare_tokens): Don't free `translations', since...
3568 * src/reader.h, src/reader.c (grammar_free): do it.
3569 Move to...
3570 * src/gram.h, src/gram.c (grammar_free): here.
3571 * data/bison.simple, data/bison.c++: b4_token_number_max is now
3572 b4_translate_max.
3573
35742002-05-05 Akim Demaille <akim@epita.fr>
3575
3576 * src/output.c (output_unsigned_int_table): New.
3577 (prepare_rules): `i' is unsigned.
3578 `prhs', `rline', `r2' are unsigned int.
3579 Rename muscle `rhs_number_max' as `rhs_max'.
3580 Output muscles `prhs_max', `rline_max', and `r2_max'.
3581 Free rline and r1.
3582 * data/bison.simple, data/bison.c++: Adjust to use these muscles
3583 to compute types instead of constant types.
3584 * tests/regression.at (Web2c Actions): Adjust.
3585
35862002-05-04 Akim Demaille <akim@epita.fr>
3587
3588 * src/symtab.h (SALIAS, SUNDEF): Rename as...
3589 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
3590 Adjust dependencies.
3591 * src/output.c (token_definitions_output): Be sure not to output a
3592 `#define 'a'' when fed with `%token 'a' "a"'.
3593 * tests/regression.at (Token definitions): New.
3594
35952002-05-03 Paul Eggert <eggert@twinsun.com>
3596
3597 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
3598 for K&R C.
3599
36002002-05-03 gettextize <bug-gnu-gettext@gnu.org>
3601
3602 * Makefile.am (SUBDIRS): Remove intl.
3603 (EXTRA_DIST): Add config/config.rpath.
3604
36052002-05-03 Akim Demaille <akim@epita.fr>
3606
3607 * data/bison.simple (m4_if): Don't output empty enums.
3608 And actually, output valid enum definitions :(.
3609
36102002-05-03 Akim Demaille <akim@epita.fr>
3611
3612 * configure.bat: Remove, completely obsolete.
3613 * Makefile.am (EXTRA_DIST): Adjust.
3614 Don't distribute config.rpath...
3615 * config/Makefile.am (EXTRA_DIST): Do it.
3616
36172002-05-03 Akim Demaille <akim@epita.fr>
3618
3619 * configure.in (GETTEXT_VERSION): New.
3620 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
3621
36222002-05-03 Akim Demaille <akim@epita.fr>
3623
3624 * data/bison.simple (b4_token_enum): New.
3625 (b4_token_defines): Use it to output tokens both as #define and
3626 enums.
3627 Suggested by Paul Eggert.
3628 * src/output.c (token_definitions_output): Don't output spurious
3629 white spaces.
3630
36312002-05-03 Akim Demaille <akim@epita.fr>
3632
3633 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
3634
36352002-05-02 Robert Anisko <robert@lrde.epita.fr>
3636
3637 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
3638 Update the stack class, give a try to deque as the default container.
3639
36402002-05-02 Akim Demaille <akim@epita.fr>
3641
3642 * data/bison.simple (yyparse): Do not implement @$ = @1.
3643 (YYLLOC_DEFAULT): Adjust to do it.
3644 * doc/bison.texinfo (Location Default Action): Fix.
3645
36462002-05-02 Akim Demaille <akim@epita.fr>
3647
3648 * src/reader.c (parse_braces): Merge into...
3649 (parse_action): this.
3650
36512002-05-02 Akim Demaille <akim@epita.fr>
3652
3653 * configure.in (ALL_LINGUAS): Remove.
3654 * po/LINGUAS, hr.po: New.
3655
36562002-05-02 Akim Demaille <akim@epita.fr>
3657
3658 Remove the so called hairy (semantic) parsers.
3659
3660 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
3661 * src/gram.h, src/gram.c (semantic_parser): Remove.
3662 (rule_t): Remove the guard and guard_line members.
3663 * src/lex.h (token_t): remove tok_guard.
3664 * src/options.c (option_table): Remove %guard and %semantic_parser
3665 support.
3666 * src/output.c, src/output.h (guards_output): Remove.
3667 (prepare): Adjust.
3668 (token_definitions_output): Don't output the `T'
3669 tokens (???).
3670 (output_skeleton): Don't output the guards.
3671 * src/files.c, src/files.c (attrsfile): Remove.
3672 * src/reader.c (symbol_list): Remove the guard and guard_line
3673 members.
3674 Adjust dependencies.
3675 (parse_guard): Remove.
3676 * data/bison.hairy: Remove.
3677 * doc/bison.texinfo (Environment Variables): Remove occurrences of
3678 BISON_HAIRY.
3679
36802002-05-02 Akim Demaille <akim@epita.fr>
3681
3682 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
3683 (parse_guard): Rename the formal argument `stack_offset' as
3684 `rule_length', which is more readable.
3685 Adjust callers.
3686 (copy_at, copy_dollar): Instead of outputting the hard coded
3687 values of $$, $n and so forth, output invocation to b4_lhs_value,
3688 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
3689 Note: this patch partially drops `semantic-parser' support: it
3690 always does `rule_length - n', where semantic parsers ought to
3691 always use `-n'.
3692 * data/bison.simple, data/bison.c++ (b4_lhs_value)
3693 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
3694
36952002-05-02 Akim Demaille <akim@epita.fr>
3696
3697 * configure.in (AC_INIT): Bump to 1.49b.
3698 (AM_INIT_AUTOMAKE): Short invocation.
3699
37002002-05-02 Akim Demaille <akim@epita.fr>
3701
3702 Version 1.49a.
3703
37042002-05-01 Akim Demaille <akim@epita.fr>
3705
3706 * src/skeleton.h: Remove.
3707
37082002-05-01 Akim Demaille <akim@epita.fr>
3709
3710 * src/skeleton.h: Fix the #endif.
3711 Reported by Magnus Fromreide.
3712
37132002-04-26 Paul Eggert <eggert@twinsun.com>
3714
3715 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
3716 Define if we define YYSTYPE and YYLTYPE, respectively.
3717 (YYCOPY): Fix [] quoting problem in the non-GCC case.
3718
37192002-04-25 Robert Anisko <robert@lrde.epita.fr>
3720
3721 * src/scan-skel.l: Postprocess quadrigraphs.
3722
3723 * src/reader.c (copy_character): New function, used to output
3724 single characters while replacing `[' and `]' with quadrigraphs, to
3725 avoid troubles with M4 quotes.
3726 (copy_comment): Output characters with copy_character.
3727 (read_additionnal_code): Likewise.
3728 (copy_string2): Likewise.
3729 (copy_definition): Likewise.
3730
3731 * tests/calc.at: Exercise M4 quoting.
3732
37332002-04-25 Akim Demaille <akim@epita.fr>
3734
3735 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
3736 between `!' and the command.
3737 Reported by Paul Eggert.
3738
37392002-04-24 Robert Anisko <robert@lrde.epita.fr>
3740
3741 * tests/calc.at: Exercise prologue splitting.
3742
3743 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
3744 `b4_post_prologue' instead of `b4_prologue'.
3745
3746 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
3747 muscles.
3748 (output): Free pre_prologue_obstack and post_prologue_obstack.
3749 * src/files.h, src/files.c (attrs_obstack): Remove.
3750 (pre_prologue_obstack, post_prologue_obstack): New.
3751 * src/reader.c (copy_definition): Add a parameter to specify the
3752 obstack to fill, instead of using attrs_obstack unconditionally.
3753 (read_declarations): Pass pre_prologue_obstack to copy_definition if
3754 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
3755
37562002-04-23 Paul Eggert <eggert@twinsun.com>
3757
3758 * data/bison.simple: Remove unnecessary commentary and white
3759 space differences from 1_29-branch.
3760 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
3761
3762 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
3763 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
3764 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
3765 constructors or destructors.
3766
3767 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
3768
37692002-04-23 Akim Demaille <akim@epita.fr>
3770
3771 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
3772 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
3773 location with columns.
3774 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
3775 All reported by Paul Eggert.
3776
37772002-04-22 Akim Demaille <akim@epita.fr>
3778
3779 * src/reduce.c (dump_grammar): Move to...
3780 * src/gram.h, src/gram.c (grammar_dump): here.
3781 Be sure to separate long item numbers.
3782 Don't read the members of a rule's prec if its nil.
3783
37842002-04-22 Akim Demaille <akim@epita.fr>
3785
3786 * src/output.c (table_size, table_grow): New.
3787 (MAXTABLE): Remove, replace uses with table_size.
3788 (pack_vector): Instead of dying when the table is too big, grow it.
3789
37902002-04-22 Akim Demaille <akim@epita.fr>
3791
3792 * data/bison.simple (yyr1): Its type is that of a token number.
3793 * data/bison.c++ (r1_): Likewise.
3794 * tests/regression.at (Web2c Actions): Adjust.
3795
37962002-04-22 Akim Demaille <akim@epita.fr>
3797
3798 * src/reader.c (token_translations_init): 256 is now the default
3799 value for the error token, i.e., it will be assigned another
3800 number if the user assigned 256 to one of her tokens.
3801 (reader): Don't force 256 to error.
3802 * doc/bison.texinfo (Symbols): Adjust.
3803 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
3804 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
3805 etc. instead of 10, 20, 30 (which was used to `jump' over error
3806 (256) and undefined (2)).
3807
38082002-04-22 Akim Demaille <akim@epita.fr>
3809
3810 Propagate more token_number_t.
3811
3812 * src/gram.h (token_number_as_item_number)
3813 (item_number_as_token_number): New.
3814 * src/output.c (GENERATE_OUTPUT_TABLE): New.
3815 Use it to create output_item_number_table and
3816 output_token_number_table.
3817 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
3818 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
3819 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
3820 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
3821
38222002-04-22 Akim Demaille <akim@epita.fr>
3823
3824 * src/output.h, src/output.c (get_lines_number): Remove.
3825
38262002-04-19 Akim Demaille <akim@epita.fr>
3827
3828 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
3829 as Lex/Flex'.
3830 (Debugging): More details about enabling the debugging features.
3831 (Table of Symbols): Describe $$, $n, @$, and @n.
3832 Suggested by Tim Josling.
3833
38342002-04-19 Akim Demaille <akim@epita.fr>
3835
3836 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
3837
38382002-04-10 Akim Demaille <akim@epita.fr>
3839
3840 * src/system.h: Rely on HAVE_LIMITS_H.
3841 Suggested by Paul Eggert.
3842
38432002-04-09 Akim Demaille <akim@epita.fr>
3844
3845 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
3846 full stderr, and strip it according to the bison options, instead
3847 of composing the error message from different bits.
3848 This makes it easier to check for several error messages.
3849 Adjust all the invocations.
3850 Add an invocation exercising the error token.
3851 Add an invocation demonstrating a stupid error message.
3852 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
3853 Adjust the tests.
3854 Error message are for stderr, not stdout.
3855
38562002-04-09 Akim Demaille <akim@epita.fr>
3857
3858 * src/gram.h, src/gram.c (error_token_number): Remove, use
3859 errtoken->number.
3860 * src/reader.c (reader): Don't specify the user token number (2)
3861 for $undefined, as it uselessly prevents using it.
3862 * src/gram.h (token_number_t): Move to...
3863 * src/symtab.h: here.
3864 (state_t.number): Is a token_number_t.
3865 * src/print.c, src/reader.c: Use undeftoken->number instead of
3866 hard coded 2.
3867 (Even though this 2 is not the same as above: the number of the
3868 undeftoken remains being 2, it is its user token number which
3869 might not be 2).
3870 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
3871 `user_token_number_max'.
3872 Output `undef_token_number'.
3873 * data/bison.simple, data/bison.c++: Use them.
3874 Be sure to map invalid yylex return values to
3875 `undef_token_number'. This saves us from gratuitous SEGV.
3876
3877 * tests/conflicts.at (Solved SR Conflicts)
3878 (Unresolved SR Conflicts): Adjust.
3879 * tests/regression.at (Web2c Actions): Adjust.
3880
38812002-04-08 Akim Demaille <akim@epita.fr>
3882
3883 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
3884 Adding #line.
3885 Remove the duplicate `typedefs'.
3886 (RhsNumberType): Fix the declaration and various other typos.
3887 Use __ofile__.
3888 * data/bison.simple: Use __ofile__.
3889 * src/scan-skel.l: Handle __ofile__.
3890
38912002-04-08 Akim Demaille <akim@epita.fr>
3892
3893 * src/gram.h (item_number_t): New, the type of item numbers in
3894 RITEM. Note that it must be able to code symbol numbers as
3895 positive number, and the negation of rule numbers as negative
3896 numbers.
3897 Adjust all dependencies (pretty many).
3898 * src/reduce.c (rule): Remove this `short *' pointer: use
3899 item_number_t.
3900 * src/system.h (MINSHORT, MAXSHORT): Remove.
3901 Include `limits.h'.
3902 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
3903 (shortcpy): Remove.
3904 (MAXTABLE): Move to...
3905 * src/output.c (MAXTABLE): here.
3906 (prepare_rules): Use output_int_table to output rhs.
3907 * data/bison.simple, data/bison.c++: Adjust.
3908 * tests/torture.at (Big triangle): Move the limit from 254 to
3909 500.
3910 * tests/regression.at (Web2c Actions): Ajust.
3911
3912 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
3913 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
3914 passes, but produces negative #line number, once fixed, GCC is
3915 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
3916 C), it passes.
3917 * src/state.h (state_h): Code input lines on ints, not shorts.
3918
39192002-04-08 Akim Demaille <akim@epita.fr>
3920
3921 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
3922 and then the grammar.
3923
39242002-04-08 Akim Demaille <akim@epita.fr>
3925
3926 * src/system.h: No longer using strndup.
3927
39282002-04-07 Akim Demaille <akim@epita.fr>
3929
3930 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
3931 * src/output.c (output_table_data): Return the longest number.
3932 (prepare_tokens): Output `token_number_max').
3933 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
3934 New.
3935 Use them to define yy_token_number_type/TokenNumberType.
3936 Use this type for yytranslate.
3937 * tests/torture.at (Big triangle): Push the limit from 124 to
3938 253.
3939 * tests/regression.at (Web2c Actions): Adjust.
3940
39412002-04-07 Akim Demaille <akim@epita.fr>
3942
3943 * tests/torture.at (Big triangle): New.
3944 (GNU AWK Grammar, GNU Cim Grammar): Move to...
3945 * tests/existing.at: here.
3946
39472002-04-07 Akim Demaille <akim@epita.fr>
3948
3949 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
3950 nritems.
3951 Adjust dependencies.
3952
39532002-04-07 Akim Demaille <akim@epita.fr>
3954
3955 * src/reader.c: Normalize increments to prefix form.
3956
39572002-04-07 Akim Demaille <akim@epita.fr>
3958
3959 * src/reader.c, symtab.c: Remove debugging code.
3960
39612002-04-07 Akim Demaille <akim@epita.fr>
3962
3963 Rename all the `bucket's as `symbol_t'.
3964
3965 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
3966 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
3967 * src/symtab.c, src/symtab.h (bucket): Rename as...
3968 (symbol_t): this.
3969 (symbol_list_new, bucket_check_defined, bucket_make_alias)
3970 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
3971 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3972 (buckets_new, buckets_free, buckets_do): Rename as...
3973 (symbol_list_new, symbol_check_defined, symbol_make_alias)
3974 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
3975 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
3976 (symbols_new, symbols_free, symbols_do): these.
3977
39782002-04-07 Akim Demaille <akim@epita.fr>
3979
3980 Use lib/hash for the symbol table.
3981
3982 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
3983 EOF.
3984 * src/lex.c (lex): Set the `number' member of new terminals.
3985 * src/reader.c (bucket_check_defined, bucket_make_alias)
3986 (bucket_check_alias_consistence, bucket_translation): New.
3987 (reader, grammar_free, readgram, token_translations_init)
3988 (packsymbols): Adjust.
3989 (reader): Number the predefined tokens.
3990 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
3991 for predefined tokens.
3992 * src/symtab.h (bucket): Remove all the hash table related
3993 members.
3994 * src/symtab.c (symtab): Replace by...
3995 (bucket_table): this.
3996 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3997 (buckets_new, buckets_do): New.
3998
39992002-04-07 Akim Demaille <akim@epita.fr>
4000
4001 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
4002 (start_symbol, max_user_token_number, semantic_parser)
4003 (error_token_number): Initialize.
4004 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
4005 Initialize.
4006 (reader): Don't.
4007 (errtoken, eoftoken, undeftoken, axiom): Extern.
4008
40092002-04-07 Akim Demaille <akim@epita.fr>
4010
4011 * src/gram.h (rule_s): prec and precsym are now pointers
4012 to the bucket giving the priority/associativity.
4013 Member `associativity' removed: useless.
4014 * src/reduce.c, src/conflicts.c: Adjust.
4015
40162002-04-07 Akim Demaille <akim@epita.fr>
4017
4018 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
4019 Properly escape the symbols' TAG when outputting them.
4020
40212002-04-07 Akim Demaille <akim@epita.fr>
4022
4023 * src/lalr.h (LA): Is a bitsetv, not bitset*.
4024
40252002-04-07 Akim Demaille <akim@epita.fr>
4026
4027 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
4028 (LArule): this, which is an array to rule_t*.
4029 * src/print.c, src/conflicts.c: Adjust.
4030
40312002-04-07 Akim Demaille <akim@epita.fr>
4032
4033 * src/gram.h (rule_t): Rename `number' as `user_number'.
4034 `number' is a new member.
4035 Adjust dependencies.
4036 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
4037
40382002-04-07 Akim Demaille <akim@epita.fr>
4039
4040 As a result of the previous patch, it is no longer needed
4041 to reorder ritem itself.
4042
4043 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
4044
40452002-04-07 Akim Demaille <akim@epita.fr>
4046
4047 Be sure never to walk through RITEMS, but use only data related to
4048 the rules themselves. RITEMS should be banished.
4049
4050 * src/output.c (output_token_translations): Rename as...
4051 (prepare_tokens): this.
4052 In addition to `translate', prepare the muscles `tname' and
4053 `toknum', which were handled by...
4054 (output_rule_data): this.
4055 Remove, and move the remainder of its outputs into...
4056 (prepare_rules): this new routines, which also merges content from
4057 (output_gram): this.
4058 (prepare_rules): Be sure never to walk through RITEMS.
4059 (output_stos): Rename as...
4060 (prepare_stos): this.
4061 (output): Always invoke prepare_states, after all, just don't use it
4062 in the output if you don't need it.
4063
40642002-04-07 Akim Demaille <akim@epita.fr>
4065
4066 * src/LR0.c (new_state): Display `nstates' as the name of the
4067 newly created state.
4068 Adjust to initialize first_state and last_state if needed.
4069 Be sure to distinguish the initial from the final state.
4070 (new_states): Create the itemset of the initial state, and use
4071 new_state.
4072 * src/closure.c (closure): Now that the initial state has its
4073 items properly set, there is no need for a special case when
4074 creating `ruleset'.
4075
4076 As a result, now the rule 0, reducing to $axiom, is visible in the
4077 outputs. Adjust the test suite.
4078
4079 * tests/conflicts.at (Solved SR Conflicts)
4080 (Unresolved SR Conflicts): Adjust.
4081 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
4082 * tests/conflicts.at (S/R in initial): New.
4083
40842002-04-07 Akim Demaille <akim@epita.fr>
4085
4086 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
4087 the RHS of the rules.
4088 * src/output.c (output_gram): Likewise.
4089
40902002-04-07 Akim Demaille <akim@epita.fr>
4091
4092 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
4093 bucket.
4094 Adjust all dependencies.
4095 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
4096 `number' of the buckets too.
4097 * src/gram.h: Include `symtab.h'.
4098 (associativity): Move to...
4099 * src/symtab.h: here.
4100 No longer include `gram.h'.
4101
41022002-04-07 Akim Demaille <akim@epita.fr>
4103
4104 * src/gram.h, src/gram.c (rules_rhs_length): New.
4105 (ritem_longest_rhs): Use it.
4106 * src/gram.h (rule_t): `number' is a new member.
4107 * src/reader.c (packgram): Set it.
4108 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
4109 the end of `rules', and count them out of `nrules'.
4110 (reduce_output, dump_grammar): Adjust.
4111 * src/print.c (print_grammar): It is no longer needed to check for
4112 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
4113 * tests/reduce.at (Reduced Automaton): New test.
4114
41152002-04-07 Akim Demaille <akim@epita.fr>
4116
4117 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
4118 lacking `+ 1' to nrules, Bison reported as useless a token if it
4119 was used solely to set the precedence of the last rule...
4120
41212002-04-07 Akim Demaille <akim@epita.fr>
4122
4123 * data/bison.c++, data/bison.simple: Don't output the current file
4124 name in #line, to avoid useless diffs between two identical
4125 outputs under different names.
4126
41272002-04-07 Akim Demaille <akim@epita.fr>
4128
4129 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
4130 Normalize loops to using `< nrules + 1', not `<= nrules'.
4131
41322002-04-07 Akim Demaille <akim@epita.fr>
4133
4134 * TODO: Update.
4135
41362002-04-07 Akim Demaille <akim@epita.fr>
4137
4138 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
4139 bucket.value as bucket.number.
4140
41412002-04-07 Akim Demaille <akim@epita.fr>
4142
4143 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
4144 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
4145 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
4146 RHS, instead of being an index in RITEMS.
4147
41482002-04-04 Paul Eggert <eggert@twinsun.com>
4149
4150 * doc/bison.texinfo: Update copyright date.
4151 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
4152 (Symbols): Warn about running Bison in one character set,
4153 but compiling and/or running in an incompatible one.
4154 Warn about character code 256, too.
4155
41562002-04-03 Paul Eggert <eggert@twinsun.com>
4157
4158 * src/bison.data (YYSTACK_ALLOC): Depend on whether
4159 YYERROR_VERBOSE is nonzero, not whether it is defined.
4160
4161 Merge changes from bison-1_29-branch.
4162
41632002-03-20 Paul Eggert <eggert@twinsun.com>
4164
4165 Merge fixes from Debian bison_1.34-1.diff.
4166
4167 * configure.in (AC_PREREQ): 2.53.
4168
41692002-03-20 Akim Demaille <akim@epita.fr>
4170
4171 * src/conflicts.c (log_resolution): Argument `resolution' is const.
4172
41732002-03-19 Paul Eggert <eggert@twinsun.com>
4174
4175 * src/bison.simple (YYCOPY): New macro.
4176 (YYSTACK_RELOCATE): Use it.
4177 Remove Type arg; no longer needed. All callers changed.
4178 (yymemcpy): Remove; no longer needed.
4179
4180 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
4181 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
4182
41832002-03-19 Akim Demaille <akim@epita.fr>
4184
4185 Test and fix the #line outputs.
4186
4187 * tests/atlocal.at (GCC): New.
4188 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
4189 (Prologue synch line, ,%union synch line, Postprologue synch line)
4190 (Action synch line, Epilogue synch line): New tests.
4191 * src/reader.c (parse_union_decl): Define the muscle stype_line.
4192 * data/bison.simple, data/bison.c++: Use it.
4193
41942002-03-19 Akim Demaille <akim@epita.fr>
4195
4196 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
4197 (Solved SR Conflicts, %expect not enough, %expect right)
4198 (%expect too much): Move to...
4199 * tests/conflicts.at: this new file.
4200
42012002-03-19 Akim Demaille <akim@epita.fr>
4202
4203 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
4204 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
4205 that we can move to enums for instance.
4206 * src/output.c (token_definitions_output): Output a list of
4207 `token-name, token-number' instead of the #define.
4208 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
4209
42102002-03-14 Akim Demaille <akim@epita.fr>
4211
4212 Use Gettext 0.11.1.
4213
42142002-03-09 Robert Anisko <robert@lrde.epita.fr>
4215
4216 * data/bison.c++: Make the user able to add members to the generated
4217 parser by subclassing.
4218
42192002-03-05 Robert Anisko <robert@lrde.epita.fr>
4220
4221 * src/reader.c (read_additionnal_code): `c' should be an integer, not
4222 a character.
4223 Reported by Nicolas Tisserand and Nicolas Burrus.
4224
42252002-03-04 Robert Anisko <robert@lrde.epita.fr>
4226
4227 * src/reader.c: Warn about lacking semi-colons, do not complain.
4228
42292002-03-04 Robert Anisko <robert@lrde.epita.fr>
4230
4231 * data/bison.c++: Remove a debug line.
4232
42332002-03-04 Robert Anisko <robert@lrde.epita.fr>
4234
4235 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
4236 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
4237 provide a default implementation.
4238
42392002-03-04 Akim Demaille <akim@epita.fr>
4240
4241 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
4242 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
4243 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
4244 * tests/semantic.at (Parsing Guards): Similarly.
4245 * src/reader.at (readgram): Complain if the last rule is not ended
4246 with a semi-colon.
4247
42482002-03-04 Akim Demaille <akim@epita.fr>
4249
4250 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
4251 * src/closure.c: here.
4252 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
4253 RTC.
4254 * src/warshall.h, src/warshall.c: Remove.
4255 * tests/sets.at (Broken Closure): Adjust.
4256
42572002-03-04 Akim Demaille <akim@epita.fr>
4258
4259 * src/output.c (output_skeleton): tempdir is const.
4260 bytes_read is unused.
4261
42622002-03-04 Akim Demaille <akim@epita.fr>
4263
4264 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
4265 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
4266 Update.
4267 From Michael Hayes.
4268
42692002-03-04 Akim Demaille <akim@epita.fr>
4270
4271 * src/closure.c (closure): `r' is unused.
4272
42732002-03-04 Akim Demaille <akim@epita.fr>
4274
4275 * tests/sets.at (Broken Closure): Add the ending `;'.
4276 * src/reader.at (readgram): Complain if a rule is not ended with a
4277 semi-colon.
4278
42792002-03-04 Akim Demaille <akim@epita.fr>
4280
4281 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
4282 (count_sr_conflicts): Use bitset_count.
4283 * src/reduce.c (inaccessable_symbols): Ditto.
4284 (bits_size): Remove.
4285 * src/warshall.h, src/warshall.c: Convert to bitsetv.
4286
42872002-03-04 Akim Demaille <akim@epita.fr>
4288
4289 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
4290 * src/reduce.c: Remove the `bitset_zero's following the
4291 `bitset_create's, as now it is performed by the latter.
4292
42932002-03-04 Akim Demaille <akim@epita.fr>
4294
4295 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
4296 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
4297 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
4298 latest sources from Michael.
4299
43002002-03-04 Akim Demaille <akim@epita.fr>
4301
4302 * src/output.c (output): Don't free the grammar.
4303 * src/reader.c (grammar_free): New.
4304 * src/main.c (main): Call it and don't free symtab here.
4305
43062002-03-04 Akim Demaille <akim@epita.fr>
4307
4308 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
4309 before returning.
4310 Reported by Benoit Perrot.
4311
43122002-03-04 Akim Demaille <akim@epita.fr>
4313
4314 Use bitset operations when possible, not loops over bits.
4315
4316 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
4317 bitset_or.
4318 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
4319 * src/reduce.c (useless_nonterminals): Formatting changes.
4320 * src/warshall.c (TC): Use bitset_or.
4321
43222002-03-04 Akim Demaille <akim@epita.fr>
4323
4324 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
4325 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
4326 Ditto.
4327
43282002-03-04 Akim Demaille <akim@epita.fr>
4329
4330 * src/lalr.c (F): Now a bitset*.
4331 Adjust all dependencies.
4332
43332002-03-04 Akim Demaille <akim@epita.fr>
4334
4335 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
4336 Adjust all dependencies.
4337
43382002-03-04 Akim Demaille <akim@epita.fr>
4339
4340 * src/L0.c, src/LR0.h (nstates): Be size_t.
4341 Adjust comparisons (signed vs unsigned).
4342 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
4343 bitset*.
4344 Adjust all dependencies.
4345
43462002-03-04 Akim Demaille <akim@epita.fr>
4347
4348 * src/closure.c (firsts): Now, also a bitset.
4349 Adjust all dependencies.
4350 (varsetsize): Remove, now unused.
4351 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
4352
43532002-03-04 Akim Demaille <akim@epita.fr>
4354
4355 * src/print.c: Convert to use bitset.h, not hand coded iterations
4356 over ints.
4357
43582002-03-04 Akim Demaille <akim@epita.fr>
4359
4360 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
4361
43622002-03-04 Akim Demaille <akim@epita.fr>
4363
4364 * src/closure.c (ruleset): Be a bitset.
4365 (rulesetsize): Remove.
4366
43672002-03-04 Akim Demaille <akim@epita.fr>
4368
4369 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
4370 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
4371 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
4372 * src/closure.c (fderives): Be an array of bitsets.
4373
43742002-02-28 Robert Anisko <robert@lrde.epita.fr>
4375
4376 * data/bison.c++: Merge the two generated headers. Insert a copyright
4377 notice in each output file.
4378
43792002-02-28 Akim Demaille <akim@epita.fr>
4380
4381 * data/bison.c++: Copy the prologue of bison.simple to fetch
4382 useful M4 definitions, such as b4_header_guard.
4383
43842002-02-25 Akim Demaille <akim@epita.fr>
4385
4386 * src/getargs.c (version): Give the name of the authors, and use a
4387 translator friendly scheme for the bgr
4388 copyright notice.
4389
43902002-02-25 Akim Demaille <akim@epita.fr>
4391
4392 * src/output.c (header_output): Remove, now handled completely via
4393 M4.
4394
43952002-02-25 Akim Demaille <akim@epita.fr>
4396
4397 * m4/m4.m4: New, from CVS Autoconf.
4398 * configure.in: Invoke it.
4399 * src/output.c (output_skeleton): Use its result instead of the
4400 hard coded name.
4401
44022002-02-25 Akim Demaille <akim@epita.fr>
4403
4404 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
4405 Fileutils 4.1.5.
4406 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
4407 * src/output.c (output_skeleton): Use mkstemp to create a real
4408 temporary file.
4409 Move the filling of `skeleton' and its muscle to...
4410 (prepare): here.
4411 (output): Move the definition of the prologue muscle to...
4412 (prepare): here.
4413 * src/system.h (DEFAULT_TMPDIR): New.
4414
44152002-02-14 Paul Eggert <eggert@twinsun.com>
4416
4417 Remove the support for C++ namespace cleanliness; it was
4418 causing more problems than it was curing, since it didn't work
4419 properly on some nonstandard C++ compilers. This can wait
4420 for a proper C++ parser.
4421
4422 * NEWS: Document this.
4423 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
4424 of C++, as it's treated like C now.
4425 * src/bison.simple (YYSTD): Remove.
4426 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
4427 Treat C++ just like Standard C instead of trying to support
4428 namespace cleanliness.
4429
44302002-02-14 Akim Demaille <akim@epita.fr>
4431
4432 * tests/regression.at (else): Adjust to Andreas' change.
4433
44342002-02-14 Akim Demaille <akim@epita.fr>
4435
4436 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
4437
44382002-02-13 Andreas Schwab <schwab@suse.de>
4439
4440 * src/output.c (output_rule_data): Don't output NULL, it might
4441 not be defined yet.
4442
44432002-02-11 Robert Anisko <robert@lrde.epita.fr>
4444
4445 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
4446 (Copyright notice): Update.
4447
44482002-02-11 Akim Demaille <akim@epita.fr>
4449
4450 * tests/regression.at (%nonassoc and eof): Don't include
4451 nonportable headers.
4452
44532002-02-08 Robert Anisko <robert@lrde.epita.fr>
4454
4455 * data/bison.c++: Correct error recovery. Make the user able to
4456 initialize the starting location.
4457
44582002-02-07 Akim Demaille <akim@epita.fr>
4459
4460 * tests/input.at: New.
4461
44622002-02-07 Robert Anisko <robert@lrde.epita.fr>
4463
4464 * data/bison.c++: Replace some direct m4 expansions by constants. Be
4465 more consistent when naming methods and variables. Put preprocessor
4466 directives around tables only needed for debugging.
4467
44682002-02-07 Robert Anisko <robert@lrde.epita.fr>
4469
4470 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
4471 C++ parsers.
4472 (yy::b4_name::parse): Use print_.
4473
44742002-02-07 Robert Anisko <robert@lrde.epita.fr>
4475
4476 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
4477
44782002-02-07 Robert Anisko <robert@lrde.epita.fr>
4479
4480 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
4481 C++ parsers.
4482 (yy::b4_name::parse): Build verbose error messages, and use error_.
4483
44842002-02-06 Robert Anisko <robert@lrde.epita.fr>
4485
4486 * data/bison.c++: Fix m4 quoting in comments.
4487
44882002-02-06 Robert Anisko <robert@lrde.epita.fr>
4489
4490 * data/bison.c++: Adjust the parser code. Fix some muscles that were
4491 not expanded by m4.
4492
44932002-02-05 Akim Demaille <akim@epita.fr>
4494
4495 * data/bison.c++: Adjust to the M4 back end.
4496 More is certainly needed.
4497
44982002-02-05 Akim Demaille <akim@epita.fr>
4499
4500 Give a try to M4 as a back end.
4501
4502 * lib/readpipe.c: New, from wdiff.
4503 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
4504 BISON_HAIRY.
4505 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
4506 specific values. Now it is m4 that performs the lookup.
4507 * src/parse-skel.y: Remove.
4508 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
4509 * src/output.c (actions_output, guards_output)
4510 (token_definitions_output): No longer keeps track of the output
4511 line number, hence remove the second argument.
4512 (guards_output): Check against the guard member of a rule, not the
4513 action member.
4514 Adjust callers.
4515 (output_skeleton): Don't look for the skeleton location, let m4 do
4516 that.
4517 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
4518 file will be used.
4519 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
4520 (prepare): Given that for the time being changesyntax is not
4521 usable in M4, rename the muscles using `-' to `_'.
4522 Define `defines_flag', `output_parser_name' and `output_header_name'.
4523 * src/output.h (actions_output, guards_output)
4524 (token_definitions_output): Adjust prototypes.
4525 * src/scan-skel.l: Instead of scanning the skeletons, it now
4526 processes the output of m4: `__oline__' and `#output'.
4527 * data/bison.simple: Adjust to be used by M4(sugar).
4528 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
4529 to date.
4530 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
4531 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
4532 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
4533 shamelessly stolen from CVS Autoconf.
4534
45352002-02-05 Akim Demaille <akim@epita.fr>
4536
4537 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
4538 * configure.in: Check for the declarations of free and malloc.
4539 * src/muscle_tab.c: Adjust.
4540
45412002-02-05 Akim Demaille <akim@epita.fr>
4542
4543 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
4544 which have no values.
4545
45462002-02-05 Akim Demaille <akim@epita.fr>
4547
4548 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
4549 * data/: here.
4550
45512002-01-29 Paul Eggert <eggert@twinsun.com>
4552
4553 * src/bison.simple (YYSIZE_T): Do not define merely because
4554 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
4555 On some platforms, <alloca.h> does not declare YYSTD (size_t).
4556
45572002-01-27 Akim Demaille <akim@epita.fr>
4558
4559 Fix `%nonassoc and eof'.
4560
4561 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
4562 which were not properly copied! Replace
4563 memcpy (res->errs, src->errs, src->nerrs);
4564 with
4565 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
4566 !!!
4567 * tests/regression.at (%nonassoc and eof): Adjust to newest
4568 Autotest: `.' is not in the PATH.
4569
45702002-01-27 Akim Demaille <akim@epita.fr>
4571
4572 * tests/sets.at (AT_EXTRACT_SETS): New.
4573 (Nullable): Use it.
4574 (Firsts): New.
4575
45762002-01-26 Akim Demaille <akim@epita.fr>
4577
4578 * tests/actions.at, tests/calc.at, tests/headers.at,
4579 * tests/torture.at: Adjust to the newest Autotest which no longer
4580 forces `.' in the PATH.
4581
45822002-01-25 Akim Demaille <akim@epita.fr>
4583
4584 * tests/regression.at (%nonassoc and eof): New.
4585 Suggested by Robert Anisko.
4586
45872002-01-24 Akim Demaille <akim@epita.fr>
4588
4589 Bison dumps core when trying to complain about broken input files.
4590 Reported by Cris van Pelt.
4591
4592 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
4593 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
4594 into...
4595 (Invalid inputs): Strengthen: exercise parse_percent_token.
4596
45972002-01-24 Robert Anisko <robert.anisko@epita.fr>
4598
4599 * src/Makefile.am: Add bison.c++.
4600 * src/bison.c++: New skeleton.
4601
46022002-01-21 Paolo Bonzini <bonzini@gnu.org>
4603
4604 * po/it.po: New.
4605
46062002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
4607
4608 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
4609
46102002-01-20 Marc Autret <marc@gnu.org>
4611
4612 * src/files.c (compute_output_file_names): Fix
4613
46142002-01-20 Marc Autret <marc@gnu.org>
4615
4616 * tests/output.at: New test.
4617 * src/files.c (compute_base_names): Don't map extensions when
4618 the YACC flag is set, use defaults.
4619 Reported by Evgeny Stambulchik.
4620
46212002-01-20 Marc Autret <marc@gnu.org>
4622
4623 * src/system.h: Need to define __attribute__ away for non-GCC
4624 compilers as well (i.e. the vendor C compiler).
4625 Suggested by Albert Chin-A-Young.
4626
46272002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
4628
4629 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
4630 canonical definition.
4631 * src/system.h: Use the canonical definition for PARAMS (avoids
4632 a conflict with the macro from lib/hash.h).
4633
46342002-01-11 Akim Demaille <akim@epita.fr>
4635
4636 * configure.in: Use AC_FUNC_STRNLEN.
4637 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
4638
46392002-01-09 Akim Demaille <akim@epita.fr>
4640
4641 * src/files.c, src/files.h (output_infix): New.
4642 (tab_extension): Remove.
4643 (compute_base_names): Compute the former, drop the latter.
4644 * src/output.c (prepare): Insert the muscles `output-infix', and
4645 `output-suffix'.
4646 * src/parse-skel.y (string, string.1): New.
4647 (section.header): Use it.
4648 (section.yacc): Remove.
4649 (prefix): Remove too.
4650 * src/scan-skel.l: Adjust.
4651 * src/bison.simple, src/bison.hairy: Adjust.
4652
46532002-01-09 Akim Demaille <akim@epita.fr>
4654
4655 * configure.in (WERROR_CFLAGS): Compute it.
4656 * src/Makefile.am (CFLAGS): Pass it.
4657 * tests/atlocal.in (CFLAGS): Idem.
4658 * src/files.c: Fix a few warnings.
4659 (get_extension_index): Remove, unused.
4660
46612002-01-08 Akim Demaille <akim@epita.fr>
4662
4663 * src/getargs.c (AS_FILE_NAME): New.
4664 (getargs): Use it to convert DOSish file names.
4665 * src/files.c (base_name): Rename as full_base_name to avoid
4666 clashes with `base_name ()'.
4667 (filename_split): New.
4668 (compute_base_names): N-th rewrite, using filename_split.
4669
46702002-01-08 Akim Demaille <akim@epita.fr>
4671
4672 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
4673 New, stolen from the Fileutils 4.1.
4674 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
4675 * configure.in: Check for the presence of memrchr, and of its
4676 prototype.
4677
46782002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
4679
4680 * lib/hash.h (__P): Added definition for this macro.
4681 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
4682 BUILT_SOURCES, to ensure they are generated first.
4683 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
4684 %error-verbose to allow bootstrapping with bison 1.30x.
4685
46862002-01-06 Akim Demaille <akim@epita.fr>
4687
4688 * src/reader.c (parse_braces): Don't fetch the next char, the
4689 convention is to fetch on entry.
4690 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
4691 'switch' without a following semicolon.
4692 * tests/regression.at (braces parsing): New.
4693
46942002-01-06 Akim Demaille <akim@epita.fr>
4695
4696 Bison is dead wrong in its RR conflict reports.
4697
4698 * tests/torture.at (GNU Cim Grammar): New.
4699 * src/conflicts.c (count_rr_conflicts): Fix.
4700
47012002-01-06 Akim Demaille <akim@epita.fr>
4702
4703 Creating package.m4 from configure.ac causes too many problems.
4704
4705 * tests/Makefile.am (package.m4): Create it by hand,
4706 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
4707
47082002-01-06 Akim Demaille <akim@epita.fr>
4709
4710 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
4711 skeleton.h.
4712
47132002-01-04 Paul Eggert <eggert@twinsun.com>
4714
4715 * doc/bison.texinfo (Debugging):
4716 Remove YYSTDERR; it's no longer defined or used.
4717 Also, s/cstdio.h/cstdio/.
4718
47192002-01-03 Akim Demaille <akim@epita.fr>
4720
4721 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
4722
47232002-01-03 Akim Demaille <akim@epita.fr>
4724
4725 * src/parse-skel.y (process_skeleton): Don't bind the parser's
4726 tracing code to --trace, wait for a better --trace option, with
4727 args.
4728
47292002-01-03 Akim Demaille <akim@epita.fr>
4730
4731 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
4732 The ISO C++ standard is extremely clear about it: stderr is
4733 considered a macro, not a regular symbol (see table 94 `Header
4734 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
4735 Therefore std:: does not apply to it. It still does with fprintf.
4736 Also, s/cstdio.h/cstdio/.
4737
47382002-01-03 Akim Demaille <akim@epita.fr>
4739
4740 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
4741 for non system headers.
4742
47432002-01-02 Akim Demaille <akim@epita.fr>
4744
4745 Equip the skeleton chain with location tracking, runtime trace,
4746 pure parser and scanner.
4747
4748 * src/parse-skel.y: Request a pure parser, locations, and prefix
4749 renaming.
4750 (%union): Having several members with the same type does not help
4751 type mismatches, simplify.
4752 (YYPRINT, yyprint): New.
4753 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
4754 (skel_error): this.
4755 Handle locations.
4756 * src/scan-skel.l: Adjust to these changes.
4757 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
4758 (LOCATION_PRINT, skel_control_t): New.
4759
47602001-12-30 Akim Demaille <akim@epita.fr>
4761
4762 * src/parse-skel.y: Get rid of the shift/reduce conflict:
4763 replace `gb' with BLANKS.
4764 * src/scan-skel.l: Adjust.
4765
47662001-12-30 Akim Demaille <akim@epita.fr>
4767
4768 * src/system.h: We don't need nor want bcopy.
4769 Throw away MS-DOS crap: we don't need getpid.
4770 * configure.in: We don't need strndup. It was even causing
4771 problems: because Flex includes the headers *before* us,
4772 _GNU_SOURCE is not defined by config.h, and therefore strndup was
4773 not visible.
4774 * lib/xstrndup.c: New.
4775 * src/scan-skel.l: Use it.
4776 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
4777 * src/parse-skel.y: Use %directives instead of #defines.
4778
47792001-12-30 Akim Demaille <akim@epita.fr>
4780
4781 * src/skeleton.h: New.
4782 * src/output.c (output_parser, output_master_parser): Remove, dead
4783 code.
4784 * src/output.h (get_lines_number, actions_output, guards_output)
4785 (token_definitions_output): Prototype them.
4786 * src/parse-skel.y: Add the license notice.
4787 Include output.h and skeleton.h.
4788 (process_skeleton): Returns void, and takes a single parameter.
4789 * src/scan-skel.l: Add the license notice.
4790 Include skeleton.h.
4791 Don't use %option yylineno: it seems that then Flex imagines
4792 REJECT has been used, and therefore it won't reallocate its
4793 buffers (which makes no other sense to me than a bug). It results
4794 in warnings for `unused: yy_flex_realloc'.
4795
47962001-12-30 Robert Anisko <robert.anisko@epita.fr>
4797
4798 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
4799 (MUSCLE_INSERT_PREFIX): ...to there.
4800 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
4801 (MUSCLE_INSERT_PREFIX): Move from here...
4802
4803 * src/bison.hairy: Add a section directive. Put braces around muscle
4804 names. This parser skeleton is still broken, but Bison should not
4805 choke on a bad muscle 'syntax'.
4806 * src/bison.simple: Add a section directive. Put braces around muscle
4807 names.
4808
4809 * src/files.h (strsuffix, stringappend): Add declarations.
4810 (tab_extension): Add declaration.
4811 (short_base_name): Add declaration.
4812
4813 * src/files.c (strsuffix, stringappend): No longer static. These
4814 functions are used in the skeleton parser.
4815 (tab_extension): New.
4816 (compute_base_names): Use the computations done in this function
4817 to guess if the generated parsers should have '.tab' in their
4818 names.
4819 (short_base_name): No longer static.
4820
4821 * src/output.c (output_skeleton): New.
4822 (output): Disable call to output_master_parser, and give a try to
4823 a new skeleton handling system.
4824 (guards_output, actions_output): No longer static.
4825 (token_definitions_output, get_lines_number): No longer static.
4826
4827 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
4828
4829 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
4830 parse-skel.y.
4831
4832 * src/parse-skel.y: New file.
4833 * src/scan-skel.l: New file.
4834
48352001-12-29 Akim Demaille <akim@epita.fr>
4836
4837 %name-prefix is broken.
4838
4839 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
4840 Adjust all dependencies.
4841 * tests/headers.at (export YYLTYPE): Strengthen this test: use
4842 %name-prefix.
4843
4844 Renaming yylval but not yylloc is not consistent. Now we do.
4845
4846 * src/bison.simple: Prefix yylloc if used.
4847 * doc/bison.texinfo (Decl Summary): Document that.
4848
48492001-12-29 Akim Demaille <akim@epita.fr>
4850
4851 * doc/bison.texinfo: Promote `%long-directive' over
4852 `%long_directive'.
4853 Remove all references to fixed-output-files, yacc is enough.
4854
48552001-12-29 Akim Demaille <akim@epita.fr>
4856
4857 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
4858 user prologue. These are defaults.
4859 * tests/actions.at (Mid-rule actions): Make sure the user can
4860 define YYDEBUG and YYERROR_VERBOSE.
4861
48622001-12-29 Akim Demaille <akim@epita.fr>
4863
4864 * src/output.c (header_output): Don't forget to export YYLTYPE and
4865 yylloc.
4866 * tests/headers.at (export YYLTYPE): New, make sure it does.
4867 * tests/regression.at (%union and --defines, Invalid CPP headers):
4868 Move to...
4869 * tests/headers.at: here.
4870
48712001-12-29 Akim Demaille <akim@epita.fr>
4872
4873 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
4874
48752001-12-29 Akim Demaille <akim@epita.fr>
4876
4877 * tests/actions.at (Mid-rule actions): Output on a single line
4878 instead of several.
4879
48802001-12-29 Akim Demaille <akim@epita.fr>
4881
4882 * doc/bison.texinfo: Formatting changes.
4883
48842001-12-29 Akim Demaille <akim@epita.fr>
4885
4886 Don't store the token defs in a muscle, just be ready to output it
4887 on command. Now possible via `symbols'. Fixes a memory leak.
4888
4889 * src/output.c (token_definitions_output): New.
4890 (output_parser, header_output): Use it.
4891 * src/reader.c (symbols_save): Remove.
4892
48932001-12-29 Akim Demaille <akim@epita.fr>
4894
4895 * src/bison.simple: Do not provide a default for YYSTYPE and
4896 YYLTYPE before the user's prologue. Otherwise it's hardly... a
4897 default.
4898
48992001-12-29 Akim Demaille <akim@epita.fr>
4900
4901 Mid-rule actions are simply... ignored!
4902
4903 * src/reader.c (readgram): Be sure to attach mid-rule actions to
4904 the empty-rule associated to the dummy symbol, not to the host
4905 rule.
4906 * tests/actions.at (Mid-rule actions): New.
4907
49082001-12-29 Akim Demaille <akim@epita.fr>
4909
4910 Memory leak.
4911
4912 * src/reader.c (reader): Free grammar.
4913
49142001-12-29 Akim Demaille <akim@epita.fr>
4915
4916 Memory leak.
4917
4918 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
4919 since it allocates it for each state, although only one is needed.
4920 (allocate_storage): Do it here.
4921
49222001-12-29 Akim Demaille <akim@epita.fr>
4923
4924 * src/options.h, src/options.c (create_long_option_table): Rename
4925 as...
4926 (long_option_table_new): this, with a clearer prototype.
4927 (percent_table): Remove, unused,
4928 * src/getargs.c (getargs): Adjust.
4929
49302001-12-29 Akim Demaille <akim@epita.fr>
4931
4932 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
4933 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
4934 as states.
4935
49362001-12-29 Akim Demaille <akim@epita.fr>
4937
4938 * src/lalr.c (build_relations): Rename `states' as `states1'.
4939 Sorry, I don't understand exactly what it is, no better name...
4940
49412001-12-29 Akim Demaille <akim@epita.fr>
4942
4943 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
4944 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
4945 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
4946 as rules.
4947
49482001-12-29 Akim Demaille <akim@epita.fr>
4949
4950 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
4951 ago.
4952
49532001-12-29 Akim Demaille <akim@epita.fr>
4954
4955 * src/reader.c, src/reader.h (user_toknums): Remove.
4956 Adjust all users to use symbols[i]->user_token_number.
4957
49582001-12-29 Akim Demaille <akim@epita.fr>
4959
4960 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
4961 Adjust all users to use symbols[i]->prec or ->assoc.
4962
49632001-12-29 Akim Demaille <akim@epita.fr>
4964
4965 * src/reader.c, src/reader.h (tags): Remove.
4966 Adjust all users to use symbols[i]->tag.
4967
49682001-12-29 Akim Demaille <akim@epita.fr>
4969
4970 * src/gram.h, src/gram.c (symbols): New, similar to state_table
4971 and rule_table.
4972 * src/reader.c (packsymbols): Fill this table.
4973 Drop sprec.
4974 * src/conflicts.c (resolve_sr_conflict): Adjust.
4975 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
4976 single table.
4977 Use symbols[i]->tag instead of tags[i].
4978
49792001-12-29 Akim Demaille <akim@epita.fr>
4980
4981 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
4982 In addition, put a comment in there, to replace...
4983 * tests/regression.at (%union and C comments): Remove.
4984
49852001-12-29 Akim Demaille <akim@epita.fr>
4986
4987 * tests/regression.at (Web2c Actions): Blindly move the actual
4988 output as expected output. The contents *seem* right to me, but I
4989 can't pretend reading perfectly parser tables... Nonetheless, all
4990 the other tests pass correctly, the table look OK, even though the
4991 presence of `$axiom' is to be noted: AFAICS it is useless (but
4992 harmless).
4993
49942001-12-29 Akim Demaille <akim@epita.fr>
4995
4996 * src/reader.c (readgram): Don't add the rule 0 if there were no
4997 rules read. In other words, add it _after_ having performed
4998 grammar sanity checks.
4999 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
5000
50012001-12-29 Akim Demaille <akim@epita.fr>
5002
5003 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
5004 visible, and some states have now a different number.
5005
50062001-12-29 Akim Demaille <akim@epita.fr>
5007
5008 * src/reader.c (readgram): Bind the initial rule's lineno to that
5009 of the first rule.
5010 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
5011 (Solved SR Conflicts): Adjust rule 0's line number.
5012
50132001-12-29 Akim Demaille <akim@epita.fr>
5014
5015 Fix the `GAWK Grammar' failure.
5016
5017 * src/LR0.c (final_state): Initialize to -1 so that we do compute
5018 the reductions of the first state which was mistakenly confused
5019 with the final state because precisely final_state was initialized
5020 to 0.
5021 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
5022 now noticed by Bison.
5023 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
5024 have a reduction on $default.
5025
50262001-12-29 Akim Demaille <akim@epita.fr>
5027
5028 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
5029 rule line numbers.
5030 * src/closure.c (print_closure): Likewise.
5031 * src/derives.c (print_derives): Likewise.
5032 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
5033 now.
5034
50352001-12-29 Akim Demaille <akim@epita.fr>
5036
5037 * src/lalr.c (lookaheads_print): New.
5038 (lalr): Call it when --trace-flag.
5039 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
5040 are dumped.
5041
50422001-12-29 Akim Demaille <akim@epita.fr>
5043
5044 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
5045 when walking through ritem, even via rule->rhs.
5046 * src/reduce.c (dump_grammar, useful_production, reduce_output)
5047 (useful_production, useless_nonterminals): Likewise.
5048 (reduce_grammar_tables): Likewise, plus update nritems.
5049 * src/nullable.c (set_nullable): Likewise.
5050 * src/lalr.c (build_relations): Likewise.
5051 * tests/sets.at (Nullable): Adjust.
5052 Fortunately, now, the $axiom is no longer nullable.
5053
50542001-12-29 Akim Demaille <akim@epita.fr>
5055
5056 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
5057 the 0-sentinel.
5058 * src/gram.c (ritem_longest_rhs): Likewise.
5059 * src/reduce.c (nonterminals_reduce): Likewise.
5060 * src/print_graph.c (print_graph): Likewise.
5061 * src/output.c (output_rule_data): Likewise.
5062 * src/nullable.c (set_nullable): Likewise.
5063
50642001-12-29 Akim Demaille <akim@epita.fr>
5065
5066 * src/output.c: Comment changes.
5067
50682001-12-27 Paul Eggert <eggert@twinsun.com>
5069
5070 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
5071 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
5072 Sparc, as they were causing more porting problems than the
5073 (minor) performance improvement was worth.
5074
5075 Also, catch up with 1.31's YYSTD.
5076
50772001-12-27 Akim Demaille <akim@epita.fr>
5078
5079 * src/output.c (output_gram): Rely on nritems, not the
5080 0-sentinel. See below.
5081 Use -1 as separator, not 0.
5082 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
5083 Rely on -1 as separator in yyrhs, instead of 0.
5084 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
5085 twice `Now at end of input', therefore there are two lines less to
5086 expect.
5087
50882001-12-27 Akim Demaille <akim@epita.fr>
5089
5090 * tests/regression.at (Unresolved SR Conflicts):
5091 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
5092 below.
5093
50942001-12-27 Akim Demaille <akim@epita.fr>
5095
5096 * src/LR0.c (new_state): Recognize the final state by the fact it
5097 is reached by eoftoken.
5098 (insert_start_shifting_state, insert_eof_shifting_state)
5099 (insert_accepting_state, augment_automaton): Remove, since now
5100 these states are automatically computed from the initial state.
5101 (generate_states): Adjust.
5102 * src/print.c: When reporting a rule number to the user, substract
5103 1, so that the axiom rule is rule 0, and the first user rule is 1.
5104 * src/reduce.c: Likewise.
5105 * src/print_graph.c (print_core): For the time being, just as for
5106 the report, depend upon --trace-flags to dump the full set of
5107 items.
5108 * src/reader.c (readgram): Once the grammar read, insert the rule
5109 0: `$axiom: START-SYMBOL $'.
5110 * tests/set.at: Adjust: rule 0 is now displayed, and since the
5111 number of the states has changed (the final state is no longer
5112 necessarily the last), catch up.
5113
51142001-12-27 Akim Demaille <akim@epita.fr>
5115
5116 Try to make the use of the eoftoken valid. Given that its value
5117 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
5118 is used instead of > 0 where appropriate, (ii), depend upon nritems
5119 instead of the 0-sentinel.
5120
5121 * src/gram.h, src/gram.c (nritems): New.
5122 Expected to be duplication of nitems, but for the time being...
5123 * src/reader.c (packgram): Assert nritems and nitems are equal.
5124 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
5125 * src/closure.c (print_closure, print_fderives): Likewise.
5126 * src/gram.c (ritem_print): Likewise.
5127 * src/print.c (print_core, print_grammar): Likewise.
5128 * src/print_graph.c: Likewise.
5129
51302001-12-27 Akim Demaille <akim@epita.fr>
5131
5132 * src/main.c (main): If there are complains after grammar
5133 reductions, then output the report anyway if requested, then die.
5134 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
5135 * src/reader.c (eoftoken): New.
5136 (parse_token_decl): If the token being defined has value `0', it
5137 is the eoftoken.
5138 (packsymbols): No longer hack `tags' to insert `$' by hand.
5139 Be sure to preserve the value of the eoftoken.
5140 (reader): Make sure eoftoken is defined.
5141 Initialize nsyms to 0: now eoftoken is created just like the others.
5142 * src/print.c (print_grammar): Don't special case the eof token.
5143 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
5144 lie anyway, albeit pleasant.
5145 * tests/calc.at: Exercise error messages with eoftoken.
5146 Change the grammar so that empty input is invalid.
5147 Adjust expectations.
5148 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
5149
51502001-12-27 Akim Demaille <akim@epita.fr>
5151
5152 * configure.in: Check the protos of strchr ans strspn.
5153 Replace strchr if needed.
5154 * src/system.h: Provide the protos of strchr, strspn and memchr if
5155 missing.
5156 * lib/strchr.c: New.
5157 * src/reader.c (symbols_save): Use strchr.
5158
51592001-12-27 Akim Demaille <akim@epita.fr>
5160
5161 * src/print.c, src/print_graph.c (escape): New.
5162 Use it to quote the TAGS outputs.
5163 * src/print_graph.c (print_state): Now errors are in red, and
5164 reductions in green.
5165 Prefer high to wide: output the state number on a line of its own.
5166
51672001-12-27 Akim Demaille <akim@epita.fr>
5168
5169 * src/state.h, src/state.c (reductions_new): New.
5170 * src/LR0.c (set_state_table): Let all the states have a
5171 `reductions', even if reduced to 0.
5172 (save_reductions): Adjust.
5173 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
5174 * src/print.c (print_reductions, print_actions): Adjust.
5175 * src/output.c (action_row): Adjust.
5176
51772001-12-27 Akim Demaille <akim@epita.fr>
5178
5179 * src/state.h, src/state.c (errs_new, errs_dup): New.
5180 * src/LR0.c (set_state_table): Let all the states have an errs,
5181 even if reduced to 0.
5182 * src/print.c (print_errs, print_reductions): Adjust.
5183 * src/output.c (output_actions, action_row): Adjust.
5184 * src/conflicts.c (resolve_sr_conflict): Adjust.
5185
51862001-12-27 Akim Demaille <akim@epita.fr>
5187
5188 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
5189
51902001-12-27 Akim Demaille <akim@epita.fr>
5191
5192 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
5193 * src/print.c: here.
5194 (lookaheadset, shiftset): New, used as additional storage by
5195 print_reductions.
5196 (print_results): Adjust.
5197 (print_shifts, print_gotos, print_errs): New, extracted from...
5198 (print_actions): here.
5199 * src/print_graph.c (print_actions): Remove dead code.
5200
52012001-12-27 Akim Demaille <akim@epita.fr>
5202
5203 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
5204 `$n' and `@n'.
5205
52062001-12-27 Akim Demaille <akim@epita.fr>
5207
5208 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
5209 (build_relations): Adjust.
5210
52112001-12-27 Akim Demaille <akim@epita.fr>
5212
5213 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
5214 duplication.
5215
52162001-12-27 Akim Demaille <akim@epita.fr>
5217
5218 * src/reader.c (packgram): Catch nitems overflows.
5219
52202001-12-27 Akim Demaille <akim@epita.fr>
5221
5222 * src/files.c, src/files.h (guard_obstack): Remove.
5223 * src/output.c (output): Adjust.
5224 * src/reader.c (parse_braces): New, factoring...
5225 (copy_action, copy_guard): these two which are renamed as...
5226 (parse_action, parse_guard): these.
5227 As a voluntary consequence, using braces around guards is now
5228 mandatory.
5229
52302001-12-27 Akim Demaille <akim@epita.fr>
5231
5232 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
5233 * src/reader.c (symbol_list): `guard' and `guard_line' are new
5234 members.
5235 (symbol_list_new): Adjust.
5236 (copy_action): action_line is the first line, not the last.
5237 (copy_guard): Just as for actions, store the `action' only, not
5238 the switch/case/break flesh.
5239 Don't parse the user action that might follow the guard, let...
5240 (readgram): do it, i.e., now, there can be an action after a
5241 guard.
5242 In other words the guard is just explicitly optional.
5243 (packgram): Adjust.
5244 * src/output.c (guards_output): New.
5245 (output_parser): Call it when needed.
5246 (output): Also free the guard and attrs obstacks.
5247 * src/files.c, src/files.h (obstack_save): Remove.
5248 (output_files): Remove.
5249 As a result, if one needs the former `.act' file, using an
5250 appropriate skeleton which requires actions and guards is now
5251 required.
5252 * src/main.c (main): Adjust.
5253 * tests/semantic.at: New.
5254 * tests/regression.at: Use `input.y' as input file name.
5255 Avoid 8+3 problems by requiring input.c when the test needs the
5256 parser.
5257
52582001-12-27 Akim Demaille <akim@epita.fr>
5259
5260 * src/reader.c (symbol_list_new): Be sure to initialize all the
5261 fields.
5262
52632001-12-27 Akim Demaille <akim@epita.fr>
5264
5265 All the hacks using a final pseudo state are now useless.
5266
5267 * src/LR0.c (set_state_table): state_table holds exactly nstates.
5268 * src/lalr.c (nLA): New.
5269 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
5270 instead of lookaheadsp from the pseudo state (nstate + 1).
5271
52722001-12-27 Akim Demaille <akim@epita.fr>
5273
5274 * src/output.c (action_row, token_actions): Use a state_t instead
5275 of a integer, and nlookaheads instead of the following state's
5276 lookaheadsp.
5277
52782001-12-27 Akim Demaille <akim@epita.fr>
5279
5280 * src/conflicts.c (log_resolution, flush_shift)
5281 (resolve_sr_conflict, set_conflicts, solve_conflicts)
5282 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
5283 (conflicts_print, print_reductions): Use a state_t instead of an
5284 integer when referring to a state.
5285 As much as possible, depend upon nlookaheads, instead of the
5286 `lookaheadsp' member of the following state (since lookaheads of
5287 successive states are successive, the difference between state n + 1
5288 and n served as the number of lookaheads for state n).
5289 * src/lalr.c (add_lookback_edge): Likewise.
5290 * src/print.c (print_core, print_actions, print_state)
5291 (print_results): Likewise.
5292 * src/print_graph.c (print_core, print_actions, print_state)
5293 (print_graph): Likewise.
5294 * src/conflicts.h: Adjust.
5295
52962001-12-27 Akim Demaille <akim@epita.fr>
5297
5298 * src/bison.hairy: Formatting/comment changes.
5299 ANSIfy.
5300 Remove `register' indications.
5301 Add plenty of `static'.
5302
53032001-12-27 Akim Demaille <akim@epita.fr>
5304
5305 * src/output.c (prepare): Drop the muscle `ntbase' which
5306 duplicates ntokens.
5307 * src/bison.simple: Formatting/comment changes.
5308 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
5309 is an undocumented synonym.
5310
53112001-12-22 Akim Demaille <akim@epita.fr>
5312
5313 * src/output.c (output_table_data): Change the prototype to use
5314 `int' for array ranges: some invocations do pass an int, not a
5315 short.
5316 Reported by Wayne Green.
5317
53182001-12-22 Akim Demaille <akim@epita.fr>
5319
5320 Some actions of web2c.y are improperly triggered.
5321 Reported by Mike Castle.
5322
5323 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
5324 * tests/regression.at (Web2c): Rename as...
5325 (Web2c Report): this.
5326 (Web2c Actions): New.
5327
53282001-12-22 Akim Demaille <akim@epita.fr>
5329
5330 Reductions in web2c.y are improperly reported.
5331 Reported by Mike Castle.
5332
5333 * src/conflicts.c (print_reductions): Fix.
5334 * tests/regression.at (Web2c): New.
5335
53362001-12-18 Akim Demaille <akim@epita.fr>
5337
5338 Some host fail on `assert (!"foo")', which expands to
5339 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
5340 Reported by Nelson Beebee.
5341
5342 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
5343 `#define it_succeeded 0' and `assert (it_succeeded)'.
5344
53452001-12-17 Marc Autret <autret_m@epita.fr>
5346
5347 * src/bison.simple: Don't hard code the skeleton line and filename.
5348 * src/output.c (output_parser): Rename 'line' as 'output_line'.
5349 New line counter 'skeleton_line' (skeleton-line muscle).
5350
53512001-12-17 Paul Eggert <eggert@twinsun.com>
5352
5353 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
5354 YYDEBUG must be defined to a nonzero value.
5355
5356 * src/bison.simple (yytname): Do not assume that the user defines
5357 YYDEBUG to a properly parenthesized expression.
5358
53592001-12-17 Akim Demaille <akim@epita.fr>
5360
5361 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
5362 nlookaheads is a new member.
5363 Adjust all users.
5364 * src/lalr.h (nlookaheads): Remove this orphan declaration.
5365 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
5366 state.
5367
53682001-12-17 Akim Demaille <akim@epita.fr>
5369
5370 * src/files.h, src/files.c (open_files, close_files): Remove.
5371 * src/main.c (main): Don't open/close files, nor invoke lex_free,
5372 let...
5373 * src/reader.c (reader): Do it.
5374
53752001-12-17 Akim Demaille <akim@epita.fr>
5376
5377 * src/conflicts.c (print_reductions): Formatting changes.
5378
53792001-12-17 Akim Demaille <akim@epita.fr>
5380
5381 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
5382 (flush_reduce): New.
5383 (resolve_sr_conflict): Adjust.
5384
53852001-12-17 Akim Demaille <akim@epita.fr>
5386
5387 * src/output.c (output_obstack): Be static and rename as...
5388 (format_obstack): this, to avoid any confusion with files.c's
5389 output_obstack.
5390 * src/reader.h (muscle_obstack): Move to...
5391 * src/output.h: here, since it's defined in output.c.
5392
53932001-12-17 Akim Demaille <akim@epita.fr>
5394
5395 * src/output.c (action_row, save_column, default_goto)
5396 (sort_actions, matching_state, pack_vector): Better variable
5397 locality.
5398
53992001-12-17 Akim Demaille <akim@epita.fr>
5400
5401 * src/output.c: Various formatting changes.
5402
54032001-12-17 Akim Demaille <akim@epita.fr>
5404
5405 * src/files.c (output_files): Free the output_obstack.
5406 * src/main.c (main): Call print and print_graph conditionally.
5407 * src/print.c (print): Work unconditionally.
5408 * src/print_graph.c (print_graph): Work unconditionally.
5409 * src/conflicts.c (log_resolution): Output only if verbose_flag.
5410
54112001-12-16 Marc Autret <autret_m@epita.fr>
5412
5413 * src/output.c (actions_output): Fix. When we use %no-lines,
5414 there is one less line per action.
5415
54162001-12-16 Marc Autret <autret_m@epita.fr>
5417
5418 * src/bison.simple: Remove a useless #line directive.
5419 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
5420 * src/output.c (get_lines_number): New.
5421 (output_parser): Adjust, now takes care about the lines of a
5422 output muscles.
5423 Fix line numbering.
5424 (actions_output): Computes the number of lines taken by actions.
5425 (output_master_parser): Insert new skeleton which is the name of
5426 the output parser file name.
5427
54282001-12-15 Marc Autret <autret_m@epita.fr>
5429
5430 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
5431
54322001-12-15 Marc Autret <autret_m@epita.fr>
5433
5434 * src/output.c (output_gram): Keep track of the hairy one.
5435
54362001-12-15 Akim Demaille <akim@epita.fr>
5437
5438 Make `make distcheck' work.
5439
5440 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
5441 system.h which uses libgettext.h.
5442
54432001-12-15 Akim Demaille <akim@epita.fr>
5444
5445 * src/nullable.c (set_nullable): Useless rules must be skipped,
5446 otherwise, since we range over their symbols, we might look at a
5447 nonterminal which no longer ``exists'', i.e., it is not counted in
5448 `nvars', hence we overflow our arrays.
5449
54502001-12-15 Akim Demaille <akim@epita.fr>
5451
5452 The header can also be produced directly, without any obstack!
5453 Yahoo!
5454
5455 * src/files.c, src/files.h (defines_obstack): Remove.
5456 (compute_header_macro): Global.
5457 (defines_obstack_save): Remove.
5458 * src/reader.c (parse_union_decl): No longer output to
5459 defines_obstack: its content can be found in the `stype' muscle
5460 anyway.
5461 (output_token_translations): Merge into...
5462 (symbols_output): this.
5463 Rename as...
5464 (symbols_save): this.
5465 (reader): Adjust.
5466 * src/output.c (header_output): New.
5467 (output): Call it.
5468
54692001-12-15 Akim Demaille <akim@epita.fr>
5470
5471 * src/reader.c (parse_union_decl): Instead of handling two obstack
5472 simultaneously, use one to define the `stype' muscle, and use the
5473 value of the latter to fill defines_obstack.
5474 (copy_comment): Remove.
5475 (copy_comment2): Work for a single obstack.
5476 Rename as...
5477 (copy_comment): this.
5478
54792001-12-15 Akim Demaille <akim@epita.fr>
5480
5481 * src/lex.c, src/lex.h (xgetc): No longer static.
5482 * src/reader.c (parse_union_decl): Revamp.
5483
54842001-12-15 Akim Demaille <akim@epita.fr>
5485
5486 Still making progress in separating Bison into (i) input, (ii)
5487 process, (iii) output: now we can directly output the parser file
5488 without using table_obstack at all.
5489
5490 * src/files.c, src/files.h (table_obstack): Bye bye.
5491 (parser_file_name): New.
5492 * src/files.c (compute_output_file_names): Compute it.
5493 * src/output.c (actions_output, output_parser)
5494 (output_master_parser): To a file instead of an obstack.
5495
54962001-12-15 Akim Demaille <akim@epita.fr>
5497
5498 Attach actions to rules, instead of pre-outputting them to
5499 actions_obstack.
5500
5501 * src/gram.h (rule_t): action and action_line are new members.
5502 * src/reader.c (symbol_list): Likewise.
5503 (copy_action): Save the actions within the rule.
5504 (packgram): Save them in rule_table.
5505 * src/output.c (actions_output): New.
5506 (output_parser): Use it on `%%actions'.
5507 (output_rule_data): Don't free rule_table.
5508 (output): Do it.
5509 (prepare): Don't save the `action' muscle.
5510 * src/bison.simple: s/%%action/%%actions/.
5511
55122001-12-15 Akim Demaille <akim@epita.fr>
5513
5514 * src/reader.c (copy_action): When --yacc, don't append a `;'
5515 to the user action: let it fail if lacking.
5516 Suggested by Arnold Robbins and Tom Tromey.
5517
55182001-12-14 Akim Demaille <akim@epita.fr>
5519
5520 * src/lex.c (literalchar): Simply return the char you decoded, non
5521 longer mess around with obstacks and int pointers.
5522 Adjust all callers.
5523
55242001-12-14 Akim Demaille <akim@epita.fr>
5525
5526 * src/lex.c (literalchar): Don't escape the special characters,
5527 just decode them, and keep them as char (before, eol was output as
5528 the 2 char string `\n' etc.).
5529 * src/output.c (output_rule_data): Use quotearg to output the
5530 token strings.
5531
55322001-12-13 Paul Eggert <eggert@twinsun.com>
5533
5534 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
5535 Do not infringe on the global user namespace when using C++.
5536 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
5537 All uses of `fprintf' and `stderr' changed.
5538
5539 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
5540
55412001-12-13 Akim Demaille <akim@epita.fr>
5542
5543 The computation of nullable is broken: it doesn't handle empty
5544 RHS's properly.
5545
5546 * tests/torture.at (GNU AWK Grammar): New.
5547 * tests/sets.at (Nullable): New.
5548 * src/nullable.c (set_nullable): Instead of blindly looping over
5549 `ritems', loop over the rules, and then over their rhs's.
5550
5551 Work around Autotest bugs.
5552
5553 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
5554 frame, because Autotest understand lines starting with a `+' as
5555 traces from the shell. Then, they are not processed properly.
5556 Admittedly an Autotest bug, but we don't have time to wait for
5557 Autotest to catch up.
5558 * tests/regression.at (Broken Closure): Adjust to the new table
5559 frames.
5560 Move to...
5561 * tests/sets.at: here.
5562
55632001-12-13 Akim Demaille <akim@epita.fr>
5564
5565 * src/closure.c (closure): Use nrules instead of playing tricks
5566 with BITS_PER_WORD.
5567
55682001-12-13 Akim Demaille <akim@epita.fr>
5569
5570 * src/print.c (print_actions): Output the handling of `$' as the
5571 traces do: shifting the token EOF. Before EOF was treated as a
5572 nonterminal.
5573 * tests/regression.at: Adjust some tests.
5574 * src/print_graph.c (print_core): Complete the set of items via
5575 closure. The next-to-final and final states are still unsatisfying,
5576 but that's to be addressed elsewhere.
5577 No longer output the rule numbers, but do output the state number.
5578 A single loop for the shifts + gotos is enough, but picked a
5579 distinct color for each.
5580 (print_graph): Initialize and finalize closure.
5581
55822001-12-13 Akim Demaille <akim@epita.fr>
5583
5584 * src/reader.c (readgram): Remove dead code, an strip useless
5585 braces.
5586 (get_type): Remove, unused.
5587
55882001-12-12 Akim Demaille <akim@epita.fr>
5589
5590 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
5591 on that of lib/error.c.
5592
55932001-12-12 Akim Demaille <akim@epita.fr>
5594
5595 Some hosts don't like `/' in includes.
5596
5597 * src/system.h: Include libgettext.h without qualifying the path.
5598 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
5599 $(top_srcdir).
5600
56012001-12-11 Marc Autret <autret_m@epita.fr>
5602
5603 * src/output.c (output_parser): Remove useless muscle.
5604
56052001-12-11 Marc Autret <autret_m@epita.fr>
5606
5607 * src/bison.simple: Remove #line just before %%epilogue. It
5608 is now handled in ...
5609 * src/reader.c (read_additionnal_code): Add the output of a
5610 #line for the epilogue.
5611
56122001-12-10 Marc Autret <autret_m@epita.fr>
5613
5614 * src/reader.c (copy_definition): Re-use CPP-outed code which
5615 replace precedent remove.
5616 * src/bison.simple: Remove #line before %%prologue because
5617 %%input-line is wrong at this time.
5618
56192001-12-10 Marc Autret <autret_m@epita.fr>
5620
5621 * src/reader.c (symbols_output): Clean up.
5622 * src/output.c (output_gram, output): Clean up.
5623
56242001-12-10 Akim Demaille <akim@epita.fr>
5625
5626 * src/lalr.c (initialize_lookaheads): New. Extracted from...
5627 * src/LR0.c (set_state_table): here.
5628 * src/lalr.c (lalr): Call it.
5629
56302001-12-10 Akim Demaille <akim@epita.fr>
5631
5632 * src/state.h (shifts): Remove the `number' member: shifts are
5633 attached to state, hence no longer need to be labelled with a
5634 state number.
5635
56362001-12-10 Akim Demaille <akim@epita.fr>
5637
5638 Now that states have a complete set of members, the linked list of
5639 shifts is useless: just fill directly the state's shifts member.
5640
5641 * src/state.h (shifts): Remove the `next' member.
5642 * src/LR0.c (first_state, last_state): Remove.
5643 Adjust the callers.
5644 (augment_automaton): Don't look for the shifts that must be added
5645 a shift on EOF: it is those of the state we looked for! But now,
5646 since shifts are attached, it is no longer needed to looking
5647 merely by its id: its number.
5648
56492001-12-10 Akim Demaille <akim@epita.fr>
5650
5651 * src/LR0.c (augment_automaton): Better variable locality.
5652 Remove an impossible branch: if there is a state corresponding to
5653 the start symbol being shifted, then there is shift for the start
5654 symbol from the initial state.
5655
56562001-12-10 Akim Demaille <akim@epita.fr>
5657
5658 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
5659 only when appropriate: when insert_start_shifting_state' is not
5660 invoked.
5661 * tests/regression.at (Rule Line Numbers): Adjust.
5662
56632001-12-10 Akim Demaille <akim@epita.fr>
5664
5665 * src/LR0.c (augment_automaton): Now that all states have shifts,
5666 merge the two cases addition shifts to the initial state.
5667
56682001-12-10 Akim Demaille <akim@epita.fr>
5669
5670 * src/lalr.c (set_state_table): Move to...
5671 * src/LR0.c: here.
5672 * src/lalr.c (lalr): Don't call it...
5673 * src/LR0.c (generate_states): do it.
5674 * src/LR0.h (first_state): Remove, only the table is used.
5675
56762001-12-10 Akim Demaille <akim@epita.fr>
5677
5678 * src/LR0.h (first_shift, first_reduction): Remove.
5679 * src/lalr.c: Don't use first_shift: find shifts through the
5680 states.
5681
56822001-12-10 Akim Demaille <akim@epita.fr>
5683
5684 * src/LR0.c: Attach shifts to states as soon as they are
5685 computed.
5686 * src/lalr.c (set_state_table): Instead of assigning shifts to
5687 state, just assert that the mapping was properly done.
5688
56892001-12-10 Akim Demaille <akim@epita.fr>
5690
5691 * src/LR0.c (insert_start_shift): Rename as...
5692 (insert_start_shifting_state): this.
5693 (insert_eof_shifting_state, insert_accepting_state): New.
5694 (augment_automaton): Adjust.
5695 Better locality of the variables.
5696 When looking if the start_symbol is shifted from the initial
5697 state, using `while (... symbol != start_symbol ...)' sounds
5698 better than `while (... symbol < start_symbol ...)': If fail
5699 to see how the order between symbols could be relevant!
5700
57012001-12-10 Akim Demaille <akim@epita.fr>
5702
5703 * src/getargs.h: Don't declare `spec_name_prefix' and
5704 `spec_file_prefix', declared by src/files.h.
5705 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
5706 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
5707 * src/output.c (prepare): Adjust.
5708 * src/reader.c (symbols_output): Likewise.
5709 * src/vmsgetargs.c: Vaguely adjust, but who cares?
5710
57112001-12-10 Akim Demaille <akim@epita.fr>
5712
5713 * src/muscle_tab.c (muscle_init): NULL is a better default than
5714 `"0"'.
5715
57162001-12-10 Akim Demaille <akim@epita.fr>
5717
5718 * src/reader.c (reader): Calling symbols_output once is enough.
5719
57202001-12-10 Akim Demaille <akim@epita.fr>
5721
5722 Now that states have a complete set of members, the linked list of
5723 reductions is useless: just fill directly the state's reductions
5724 member.
5725
5726 * src/state.h (struct reductions): Remove member `number' and
5727 `next'.
5728 * src/LR0.c (first_reduction, last_reduction): Remove.
5729 (save_reductions): Don't link the new reductions, store them in
5730 this_state.
5731 * src/lalr.c (set_state_table): No need to attach reductions to
5732 states, it's already done.
5733 * src/output.c (output_actions): No longer free the shifts, then
5734 the reductions, then the states: free all the states and their
5735 members.
5736
57372001-12-10 Akim Demaille <akim@epita.fr>
5738
5739 * src/options.c (OPTN, DRTV, BOTH): New.
5740 (option_table): Use them.
5741
5742 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
5743 the job of system.h.
5744 * src/options.c: Don't include stdio.h and xalloc.h for the same
5745 reasons.
5746
57472001-12-10 Akim Demaille <akim@epita.fr>
5748
5749 * src/output.c (output, prepare): Make sure the values of the
5750 muscles `action' and `prologue' are 0-terminated.
5751
57522001-12-10 Akim Demaille <akim@epita.fr>
5753
5754 Clean up GCC warnings.
5755
5756 * src/reader.c (copy_action): `buf' is not used.
5757 (parse_skel_decl): Be static.
5758 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
5759 * src/options.h (create_long_option_table): Have a real prototype.
5760 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
5761 (hash_delete_at): Return const void *.
5762 Adjust casts to preserve the const.
5763
57642001-12-10 Akim Demaille <akim@epita.fr>
5765
5766 * configure.in: Require 2.52g.
5767 M4 is not needed, but AUTOM4TE is.
5768 * m4/m4.m4: Remove.
5769 * tests/Makefile.am: Adjust.
5770
57712001-12-10 Akim Demaille <akim@epita.fr>
5772
5773 One structure for states is enough, even though theoretically
5774 there are LR(0) states and LALR(1) states.
5775
5776 * src/lalr.h (state_t): Remove.
5777 (state_table): Be state_t **, not state_t *.
5778 * src/state.h (core, CORE_ALLOC): Rename as...
5779 (state_t, STATE_ALLOC): this.
5780 Add the LALR(1) members: shifts, reductions, errs.
5781 * src/LR0.c (state_table): Rename as...
5782 (state_hash): this, to avoid name clashes with the global
5783 `state_table'.
5784 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
5785 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
5786
57872001-12-10 Akim Demaille <akim@epita.fr>
5788
5789 Bison dumps core on bash.y.
5790 Reported by Pascal Bart.
5791
5792 * src/warshall.c (bitmatrix_print): New.
5793 (TC): Use it.
5794 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
5795 j must be the outer loop.
5796 * tests/regression.at (Broken Closure): New.
5797
57982001-12-05 Akim Demaille <akim@epita.fr>
5799
5800 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
5801 its argument.
5802