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