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