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