]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Bump 1.875b.
[bison.git] / ChangeLog
... / ...
CommitLineData
12003-02-04 Akim Demaille <akim@epita.fr>
2
3 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
4 Location as is defined.
5
62003-02-04 Akim Demaille <akim@epita.fr>
7
8 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9 name_ being defined.
10
112003-02-03 Paul Eggert <eggert@twinsun.com>
12
13 * src/gram.h (start_symbol): Remove unused decl.
14
15 Use more-consistent naming conventions for local vars.
16
17 * src/derives.c (derives_compute): Change type of local var from
18 int to rule_number.
19 * src/gram.c (grammar_rules_partial_print): Likewise.
20 * src/print.c (print_core): Likewise.
21 * src/reduce.c (reduce_grammar_tables): Likewise.
22
23 * src/gram.c (grammar_dump): Change name of item_number *
24 local var from r to rp.
25 * src/nullable.c (nullable_compute): Likewise.
26
27 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
28
29 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
30 for symbol or symbol_number var.
31 * src/reader.c (grammar_start_symbol_set): Likewise.
32 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
33 Likewise.
34 * src/state.c (transitions_to): Likewise.
35 * src/state.h: Likewise.
36 * src/tables.c (symbol_number_to_vector_number): Likewise.
37
38 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
39 char * var.
40
41 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
42 var.
43
44 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
45 var.
46
47 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
48 Use str, not s, for char * var. Use ch, not c, for character var.
49 Use size for size var.
50
51 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
52 char * var.
53 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
54 uniqstr var.
55 * src/uniqstr.h: Likewise.
56
57 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
58 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
59 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
60 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
61 param to have same name as that of enum, so that we don't use
62 "s" to stand for a non-state.
63
642003-02-02 Akim Demaille <akim@epita.fr>
65
66 * src/scan-skel.l: Scan more than one inert character per yylex
67 invocation.
68
692003-02-01 Paul Eggert <eggert@twinsun.com>
70
71 Version 1.875a.
72
73 * po/LINGUAS: Add ms.
74
752003-01-30 Akim Demaille <akim@epita.fr>
76
77 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
78
792003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
80
81 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
82 of $1.
83
84 Changes in response to error report by S. Eken: GLR mode does not
85 handle negative $ indices or $ indices in embedded rules correctly.
86 See <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
87
88 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
89 (b4_rhs_location): Ditto.
90 (yyfill): New function to copy from stack tree into array
91 incrementally.
92 (yyuserAction): Modify to allow incremental move of semantic values
93 to rhs array when in GLR mode.
94 Define YYFILL to use in user-defined actions to fill semantic array
95 as needed.
96 Remove dummy use of yystack, as there is now a guaranteed use.
97 (yydoAction): Modify to allow incremental move of semantic values
98 to rhs array when in GLR mode.
99 (yyresolveAction): Ditto.
100 (yyglrShiftDefer): Update comment.
101 (yyresolveStates): Use X == NULL for pointers, not !X.
102 (yyglrReduce): Ditto.
103 (yydoAction): Ditto
104
105 * tests/glr-regr1.at: Rename to ...
106 * tests/glr-regression.at: Add new regression test for the problems
107 described above (adapted from S. Eken).
108 Update copyright notice.
109 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
110 * tests/Makefile.am: Ditto.
111
1122003-01-28 Paul Eggert <eggert@twinsun.com>
113
114 * data/lalr1.cc: Do not use @output_header_name@ unless
115 b4_defines_flag is set. This fixes two bugs reported by
116 Tim Van Holder in
117 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
118 and <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
119
1202003-01-21 Paul Eggert <eggert@twinsun.com>
121
122 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
123 we don't need to worry about yyerrlab1 being reported as an
124 "unused label" by non-GCC C compilers. The downside is that if
125 locations are used then a couple of statements are duplicated each
126 time YYERROR is invoked, but the upside is that the warnings
127 should vanish.
128 (yyerrlab1): Move code to YERROR.
129 (yyerrlab2): Remove. Change uses back to yyerrlab1.
130 This reverts some of the 2002-12-27 change.
131
1322003-01-17 Paul Eggert <eggert@twinsun.com>
133
134 * src/output.c (symbol_printers_output): Fix typo that led
135 to core dump. Problem reported by Antonio Rus in
136 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
137
1382003-01-13 Akim Demaille <akim@epita.fr>,
139 Quoc Peyrot <chojin@lrde.epita.fr>,
140 Robert Anisko <anisko_r@lrde.epita.fr>
141
142 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
143 when the stacks contain one element, as the loop would otherwise
144 free the last state, and then use the top state (the one we just
145 popped). This means that the initial elements will not be freed
146 explicitly, as is the case in yacc.c; it is not a problem, as
147 these elements have fake values.
148
1492003-01-11 Paul Eggert <eggert@twinsun.com>
150
151 * NEWS: %expect-violations are now just warnings, reverting
152 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
153 bootstrapping problem reported by Matthias Klose; see
154 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
155 * src/conflicts.c (conflicts_print): Likewise.
156 * tests/conflicts.at (%expect not enough, %expect too much,
157 %expect with reduce conflicts): Likewise.
158 * doc/bison.texinfo (Expect Decl): Document this. Also mention
159 that the warning is enabled if the number of conflicts changes
160 (not necessarily increases).
161
162 * src/getargs.c (version): Update copyright year.
163
1642003-01-09 Akim Demaille <akim@epita.fr>
165
166 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
167
1682003-01-08 Paul Eggert <eggert@twinsun.com>
169
170 * Makefile.maint (WGETFLAGS):
171 New macro, containing "-C off" to disable proxy caches.
172 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
173 (rel-check): Use $(WGET) instead of wget.
174
1752003-01-06 Paul Eggert <eggert@twinsun.com>
176
177 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
178 the GLR paper of Scott, Johnstone and Hussain.
179
1802003-01-04 Paul Eggert <eggert@twinsun.com>
181
182 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
183 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
184 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
185 (EXTRA_LIBRARIES): New var, for liby.a.
186 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
187 (EXTRA_SCRIPTS): New var, for yacc.
188
189 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
190 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
191 Problem reported by Nelson H. F. Beebe.
192
1932003-01-03 Paul Eggert <eggert@twinsun.com>
194
195 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
196 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
197 when compiling Bison 1.875's `bitset bset = obstack_alloc
198 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
199
200 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
201 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
202 grow to a huge size with typical invocation.
203
204 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
205 Use the pattern recommended by Autoconf 2.57, except also protect
206 against double-definition.
207 * src/system.h: Likewise.
208 Portability issues reported by Nelson H. F. Beebe.
209
210 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
211 All uses changed. Provide a definition in both C and C++.
212 (yytrue, yyfalse): Define even if defined (__cplusplus).
213
214 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
215 Reported by Nelson H. F. Beebe.
216
217 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
218
2192003-01-02 Paul Eggert <eggert@twinsun.com>
220
221 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
222 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
223 Bug reported by Nelson H. F. Beebe.
224
2252003-01-01 Paul Eggert <eggert@twinsun.com>
226
227 * Version 1.875.
228
2292002-12-30 Paul Eggert <eggert@twinsun.com>
230
231 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
232 Moved here from...
233 (<INITIAL>","): Here. This causes stray "," to be treated
234 more uniformly.
235
236 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
237 last brace in braced code when not in Yacc mode, for compatibility
238 with Bison 1.35. This resurrects the 2001-12-15 patch to
239 src/reader.c.
240
241 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
242 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
243
2442002-12-28 Paul Eggert <eggert@twinsun.com>
245
246 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
247 that of SYM's type. This fixes Debian bug 168069, reported by
248 Thomas Olsson.
249
2502002-12-28 Paul Eggert <eggert@twinsun.com>
251
252 Version 1.75f.
253
254 Switch back to the Yacc style of conflict reports, undoing some
255 of the 2002-07-30 change.
256 * doc/bison.texinfo (Understanding): Use Yacc style for
257 conflict reports. Also, use new way of locating rules.
258 * src/conflicts.c (conflict_report):
259 Renamed from conflict_report_yacc, removing the old
260 'conflict_report'. Translate the entire conflict report at once,
261 so that we don't assume that "," has the same interpretation in
262 all languages.
263 (conflicts_output): Use Yacc-style conflict report for each state,
264 instead of our more-complicated style.
265 (conflicts_print): Use Yacc-style conflict report, except print
266 the input file name when not emulating Yacc.
267 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
268 Conflicted Reduction, %expect not enough, %expect too much,
269 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
270 * tests/existing.at (GNU Cim Grammar): Likewise.
271 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
272
273 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
274 fatal): Don't invoke fflush; it's not needed and it might even be
275 harmful for stdout, as stdout might not be open.
276 * src/reduce.c (reduce_print): Likewise.
277
2782002-12-27 Paul Eggert <eggert@twinsun.com>
279
280 Fix a bug where error locations were not being recorded correctly.
281 This problem was originally reported by Paul Hilfinger in
282 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
283
284 * data/yacc.c (yyparse): New local var yylerrsp, to record the
285 top of the location stack's error locations.
286 (yyerrlab): Set it. When discarding a token, push its location
287 onto yylerrsp so that we don't lose track of the error's end.
288 (yyerrlab1): Now is only the target of YYERROR, so that we can
289 properly record the location of the action that failed. For GCC
290 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
291 GCC warning about yyerrlab1 being unused if YYERROR is unused.
292 (yyerrlab2): New label, which yyerrlab now falls through to.
293 Compute the error's location by applying YYLLOC_DEFAULT to
294 the locations of all the symbols that went into the error.
295 * doc/bison.texinfo (Location Default Action): Mention that
296 YYLLOC_DEFAULT is also invoked for syntax errors.
297 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
298 Error locations include the locations of all the tokens that were
299 discarded, not just the last token.
300
3012002-12-26 Paul Eggert <eggert@twinsun.com>
302
303 * src/files.c: Include quote.h.
304 (compute_output_file_names): Warn if we detect conflicting
305 outputs to the same file. This should catch the misunderstanding
306 exemplified by Debian Bug 165349, reported by Bruce Stephens..
307
308 * src/conflicts.c (conflicts_print): If the user specifies
309 "%expect N", report an error if there are any reduce/reduce
310 conflicts. This is what the manual says should happen.
311 This fixes Debian bug 130890, reported by Anthony DeRobertis.
312 * tests/conflicts.at (%expect with reduce conflicts): New test.
313
314 Don't use m4_include on relative file names, as it doesn't work as
315 desired if there happens to be a file with that name under ".".
316
317 * m4sugar/version.m4: Remove; it was included but it wasn't used.
318 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
319 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
320 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
321 * src/output.c (output_skeleton): Use full path names when
322 specifying a file to include; don't rely on include path, as
323 it's unreliable when the working file contains a file with
324 that name.
325
3262002-12-25 Paul Eggert <eggert@twinsun.com>
327
328 Remove obsolete references to bison.simple and bison.hairy.
329 Problem mentioned by Aubin Mahe in
330 <http://mail.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
331 * data/glr.c: Comment fix.
332 * doc/bison.1: Remove references. Also, mention "yacc".
333
334 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
335 with -g option.
336
337 * src/parse-gram.y (declaration): Use enum "report_states" rather
338 than its numeric value 1.
339
340 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
341 opening a new one. This fixes Debian bug 165349, reported by
342 Bruce Stephens.
343
3442002-12-24 Paul Eggert <eggert@twinsun.com>
345
346 Version 1.75e.
347
348 * Makefile.maint (cvs-update): Don't assume that the shell
349 supports $(...), as Solaris sh doesn't.
350
351 * src/parse-gram.y (lloc_default): Remove test for empty
352 nonterminals at the end, since it didn't change the result.
353
3542002-12-24 Paul Eggert <eggert@twinsun.com>
355
356 If the user does not define YYSTYPE as a macro, Bison now declares it
357 using typedef instead of defining it as a macro. POSIX requires this.
358 For consistency, YYLTYPE is also declared instead of defined.
359
360 %union directives can now have a tag before the `{', e.g., the
361 directive `%union foo {...}' now generates the C code
362 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
363 The default union tag is `YYSTYPE', for compatibility with Solaris 9
364 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
365 instead of `yyltype'.
366
367 `yystype' and `yyltype' are now obsolescent macros instead of being
368 typedefs or tags; they are no longer documented and will be
369 withdrawn in a future release.
370
371 * data/glr.c (b4_location_type): Remove.
372 (YYSTYPE): Renamed from yystype.
373 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
374 (struct YYLTYPE): Renamed from struct yyltype.
375 (YYLTYPE): Renamed from yyltype.
376 (yyltype, yystype): New (and obsolescent) macros,
377 for backward compatibility.
378 * data/yacc.c: Likewise.
379
380 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
381 does not specify a union tag. This is for compatibility with
382 Solaris 9 yacc.
383
384 * src/parse-gram.y (add_param): 2nd arg is now char * not char
385 const *, since it is now modified by stripping surrounding { }.
386 (current_braced_code): Remove.
387 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
388 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
389 trailing " {...}". Now of type <chars>.
390 (grammar_declaration): Adjust to bundled tokens.
391 (code_content): Remove; stripping is now done by add_param.
392 (print_token_value): Print contents of bundled tokens.
393 (token_name): New function.
394
395 * src/reader.h (braced_code, current_braced_code): Remove.
396 (token_name): New decl.
397
398 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
399 token_type, not braced_code code_kind. All uses changed.
400 (SC_PRE_CODE): New state, for scanning after a keyword that
401 has (or usually has) an immediately-following braced code.
402 (token_type): New local var, to keep track of which token type
403 to return when scanning braced code.
404 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
405 <INITIAL>"%parse-param", <INITIAL>"%printer",
406 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
407 instead of returning a token type immediately.
408 (<INITIAL>"{"): Set token type.
409 (<SC_BRACED_CODE>"}"): Use it.
410 (handle_action_dollar, handle_action_at): Now returns bool
411 indicating success. Fail if ! current_rule; this prevents a core dump.
412 (handle_symbol_code_dollar, handle_symbol_code_at):
413 Remove; merge body into caller.
414 (handle_dollar, handle_at): Complain in invalid contexts.
415
416 * NEWS, doc/bison.texinfo: Document the above.
417 * NEWS: Fix years and program names in copyright notice.
418
4192002-12-17 Paul Eggert <eggert@twinsun.com>
420
421 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
422 Reporting, Table of Symbols): Omit mentions of %lex-param and
423 %parse-param from the documentation for now.
424
4252002-12-15 Paul Eggert <eggert@twinsun.com>
426
427 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
428 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
429 lookahead symbol, and which sets yychar in parser actions) and it
430 disagreed with the Bison documentation. Bug
431 reported by Andrew Walrond.
432
433 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
434 as the caller now does that.
435 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
436 (YYEMPTY): Parenthesize right hand side, since others use it.
437 (yyparse): Don't assume that our generated code is the only code
438 that sets yychar.
439
4402002-12-13 Paul Eggert <eggert@twinsun.com>
441
442 Version 1.75d.
443
444 POSIX requires a "yacc" command.
445 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
446 (MOSTLYCLEANFILES): Add yacc.
447 (yacc): New rule.
448 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
449 as an alias for bison y.
450
451 * po/LINGUAS: Add da.
452
453 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
454 problem with latest <getopt.h>.
455 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
456
457 * doc/fdl.texi: Upgrade to 1.2.
458 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
459 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
460 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
461 gnulib.
462 * config/install-sh: Sync with autotools.
463
464 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
465 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
466 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
467 locations are requested.
468 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
469 locations are requested.
470
4712002-12-12 Paul Eggert <eggert@twinsun.com>
472
473 Remove unportable casts and storage allocation tricks.
474 While we're at it, remove almost all casts, since they
475 usually aren't needed and are a sign of trouble.
476
477 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
478
479 * src/derives.c (derives_compute): Do not subtract NTOKENS from
480 the pointer DSET returned by malloc; this isn't portable.
481 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
482 Similarly for DERIVES.
483 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
484 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
485 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
486
487 * src/derives.c (derives_compute): Do not bother invoking
488 int_of_rule_number, since rule numbers are integers.
489
490 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
491 rather than XMALLOC (char, N).
492
493 * src/files.c (filename_split): Rewrite to avoid cast.
494
495 * src/gram.h (symbol_number_as_item_number,
496 item_number_as_symbol_number, rule_number_as_item_number,
497 item_number_as_rule_number):
498 Now inline functions rather than macros, to avoid casts.
499 * src/state.h (state_number_as_int): Likewise.
500 * src/tables.c (state_number_to_vector_number,
501 symbol_number_to_vector_number): Likewise.
502
503 * src/gram.h (int_of_rule_number): Remove; no longer used.
504
505 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
506 since the resulting storage is always stored into.
507
508 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
509 where it's needed.
510
511 * src/muscle_tab.c (muscle_m4_output):
512 Now inline. Return bool, not int.
513 * src/state.c (state_compare): Likewise.
514 * src/symtab.c (symbol_check_defined,
515 symbol_check_alias_consistency, symbol_pack, symbol_translation,
516 hash_compare_symbol, hash_symbol):
517 Likewise.
518 * src/uniqstr.c (uniqstr_print): Likewise.
519 * src/muscle_tab.c (muscle_m4_output_processor):
520 New function, to avoid casts.
521 * src/state.c (state_comparator, stage_hasher): Likewise.
522 * src/symtab.c (symbol_check_defined_processor,
523 symbol_check_alias_consistency_processor, symbol_pack_processor,
524 symbol_translation_processor, hash_symbol_comparator,
525 hash_symbol_hasher): Likewise.
526 * src/uniqstr.c (uniqstr_print_processor): Likewise.
527 * src/muscle_tab.c (muscles_m4_output):
528 Use new functions instead of casting old functions unportably.
529 * src/state.c (state_hash_new): Likewise.
530 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
531 symbols_token_translations_init):
532 Likewise.
533 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
534
535 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
536 var instead of casting to long, to avoid casts.
537 (prepare_states): Use MALLOC rather than alloca, so that we don't
538 have to worry about alloca.
539 * src/state.c (state_hash_lookup): Likewise.
540
541 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
542 local var instead of casting to unsigned char, to avoid casts.
543
544 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
545 STATE_ALLOC): Remove.
546 (transitions_new, errs_new, reductions_new, state_new): Use malloc
547 rather than calloc, and use offsetof to avoid allocating slightly
548 too much storage.
549 (state_new): Initialize all members.
550
551 * src/state.c (state_hash): Use unsigned accumulator, not signed.
552
553 * src/symtab.c (symbol_free): Remove; unused.
554 (symbol_get): Remove cast in lhs of assignment.
555 (symbols_do): Now static. Accept generic arguments, not
556 hashing-related ones.
557
558 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
559 (symbol_processor): Remove.
560 (symbols_do): Remove decl; now static.
561
562 * src/system.h (alloca): Remove; decl no longer needed.
563 (<stddef.h>): Include, for offsetof.
564 (<inttypes.>, <stdint.h>): Include if available.
565 (uintptr_t): New type, if system lacks it.
566 (CALLOC, MALLOC, REALLOC): New macros.
567 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
568 new macros.
569
570 * src/tables.c (table_size): Now int, to pacify GCC.
571 (table_grow, table_ninf_remap): Use signed table size.
572 (save_row): Don't bother initializing locals when not needed.
573 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
574 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
575
576 * src/vcg.h: Correct misspellings.
577
578 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
579
580
581 * src/getargs.c (getargs): Don't assume EOF == -1.
582
5832002-12-09 Paul Eggert <eggert@twinsun.com>
584
585 Change identifier spellings to avoid collisions with names
586 that are reserved by POSIX.
587
588 Don't use names ending in _t, since POSIX reserves them.
589 For consistency, remove _e and _s endings -- they're weren't
590 needed to remove ambiguity. All uses changed.
591 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
592 turn was just renamed from struniq_t.
593 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
594 which in turn was just renamed from struniq_processor_t.
595 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
596 in turn was renamed from hash_compare_struniq_t.
597 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
598 (state_list): Renamed from state_list_t.
599 * src/assoc.h (assoc): Renamed from assoc_t.
600 * src/conflicts.c (enum conflict_resolution): Renamed from
601 enum conflict_resolution_e.
602 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
603 (rule_list): Renamed from rule_list_t.
604 * src/getargs.h (enum trace): Renamed from enum trace_e.
605 (enum report): Renamed from enum report_e.
606 * src/gram.h (item_number): Renamed from item_number_t.
607 (rule_number): Renamed from rule_number_t.
608 (struct rule_s): Remove the "rule_s" part; not used.
609 (rule): Renamed from rule_t.
610 (rule_filter): Renamed from rule_filter_t.
611 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
612 (goto_list): Renamed from goto_list_t.
613 * src/lalr.h (goto_number): Renamed from goto_number_t.
614 * src/location.h (location): Renamed from location_t.
615 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
616 and moved here from:
617 * src/muscle_tab.h (muscle_entry_t): here.
618 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
619 (rule_list): Renamed from rule_list_t.
620 * src/print_graph.c (static_graph): Renamed from graph.
621 * src/reader.h (braced_code): Renamed from braced_code_t.
622 Remove brace_code_e tag.
623 * src/relation.h (relation_node): Renamed from relation_node_t.
624 (relation_nodes): Renamed from relation_nodes_t.
625 (relation): Renamed from relation_t.
626 * src/state.h (state_number): Renamed from state_number_t.
627 (struct state): Renamed from struct state_s.
628 (state): Renamed from state_t.
629 (transitions): Renamed from transitions_t. Unused (and
630 misspelled) transtion_s tag removed.
631 (errs): Renamed from errs_t. Unused errs_s tag removed.
632 (reductions): Renamed from reductions_t. Unused tag
633 reductions_s removed.
634 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
635 (struct symbol_list): Renamed from struct symbol_list_s.
636 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
637 (struct symbol): Renamed from struct symbol_s.
638 (symbol): Renamed from symbol_t.
639 * src/tables.c (vector_number): Renamed from vector_number_t.
640 (action_number): Renamed from action_t.
641 * src/tables.h (base_number): Renamed from base_t.
642 * src/vcg.h (enum color): Renamed from enum color_e.
643 (enum textmode): Renamed from enum textmode_e.
644 (enum shape): Renamed from enum shape_e.
645 (struct colorentry): Renamed from struct colorentry_s.
646 (struct classname): Renamed from struct classname_s.
647 (struct infoname): Renamed from struct infoname_s.
648 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
649 (enum decision): Renamed from enum decision_e.
650 (enum orientation): Renamed from enum orientation_e.
651 (enum alignment): Renamed from enum alignment_e.
652 (enum arrow_mode): Renamed from enum arrow_mode_e.
653 (enum crossing_type): Renamed from enum crossing_type_e.
654 (enum view): Renamed from enum view_e.
655 (struct node): Renamed from struct node_s.
656 (node): Renamed from node_t.
657 (enum linestyle): Renamed from enum linestyle_e.
658 (enum arrowstyle): Renamed from enum arrowstyle_e.
659 (struct edge): Renamed from struct edge.
660 (edge): Renamed from edge_t.
661 (struct graph): Renamed from struct graph_s.
662 (graph): Renamed from graph_t.
663 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
664 Rename value_t -> value.
665 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
666 value_t_as_yystype -> value_as_yystype.
667
668 Don't include <errno.h> in the mainstream code, since it
669 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
670 * lib/get-errno.c, lib/get-errno.h: New files.
671 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
672 get-errno.c.
673 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
674 * src/output.c (output_skeleton): Likewise.
675 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
676 instead of errno.
677 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
678 Likewise.
679 (handle_action_dollar, handle_action_at): Likewise.
680 * src/system.h: Do not include <errno.h>.
681 (TAB_EXT): Renamed from EXT_TAB.
682 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
683
684 Avoid str[a-z]*, since <string.h> reserves that name space.
685 Change all instances of "struniq" in names to "uniqstr", and
686 likewise for "STRUNIQ" and "UNIQSTR".
687 * src/uniqstr.c: Renamed from src/struniq.c.
688 * src/uniqstr.h: Renamed from src/struniq.h.
689 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
690 * src/files.c (strsuffix): Remove; unused.
691 (concat2): Renamed from stringappend. Now static.
692 * src/files.h (strsuffix, stringappend): Remove; unused.
693 * src/parse-gram.y (<chars>): Renamed from <string>.
694 (<uniqstr>): Renamed from <struniq>.
695 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
696 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
697 (struct graph_s.expand): Renamed from struct graph_s.stretch.
698 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
699 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
700 (N_EXPAND): Renamed from N_STRETCH.
701
702 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
703 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
704 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
705 Remove; unused.
706 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
707 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
708 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
709 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
710 (BASE_MAXIMUM): Renamed from BASE_MAX.
711 (BASE_MINIMUM): Renamed from BASE_MIN.
712 (ACTION_MAX): Remove; unused.
713 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
714 Unnecessary casts removed from above defines.
715
716
717 Fix misspelling in names.
718 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
719 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
720 G_NODE_ALIGNEMENT.
721
722
723 * lib/timevar.c (timevar_report): Renamed from time_report,
724 for consistency with other names.
725 * lib/timevar.h (timevar_report): New decl.
726 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
727
728
729 Sort include-file uses.
730
731 Reorder all include files under src to be in the order "system.h".
732 then the ../lib include files in angle brackets (alphabetized),
733 then the . include files in double-quotes (alphabetized). Fix
734 dependency breakages encountered in this process, as follows:
735 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
736 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
737 * src/state.h: Include "symtab.h".
738
7392002-12-08 Paul Eggert <eggert@twinsun.com>
740
741 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
742 since this causes problems when __file__ contains character
743 sequences like "@" that are treated specially by src/scan-skel.l.
744 Instead, just use the file's basename. This fixes the bug
745 reported by Martin Mokrejs in
746 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
747
7482002-12-06 Paul Eggert <eggert@twinsun.com>
749
750 Add support for rules that do not have trailing semicolons, as
751 POSIX requires. Improve the quality of locations in Bison
752 diagnostics.
753
754 * src/location.c: Include <quotearg.h>.
755 (empty_location): Now const.
756 (location_print): New function. Follow the recommendation of the
757 GNU Coding Standards for locations that span file boundaries.
758 * src/location.h: Do not include <quotearg.h>; no longer needed.
759 (boundary): New type.
760 (location_t): Use it. This allows locations to span file boundaries.
761 All member uses changed: file -> start.file or end.file (as needed),
762 first_line -> start.line, first_column -> start.column,
763 last_line -> end.line, last_column -> end.column.
764 (equal_boundaries): New function.
765 (LOCATION_RESET, LOCATION_STEP): Remove.
766 (LOCATION_PRINT): Remove. All callers changed to use location_print.
767 (empty_location): Now const.
768 (location_print): New decl.
769 * src/parse-gram.y (lloc_default): New function, which handles
770 empty locations more accurately.
771 (YYLLOC_DEFAULT): Use it.
772 (%token COLON): Remove.
773 (%token ID_COLON): New token.
774 (rules): Use it.
775 (declarations, rules): Remove trailing semicolon.
776 (declaration, rules_or_grammar_declaration):
777 Allow empty (";") declaration.
778 (symbol_def): Remove empty actions; no longer needed.
779 (rules_or_grammar_declaration): Remove trailing semicolon.
780 (semi_colon.opt): Remove.
781 * src/reader.h: Include location.h.
782 (scanner_cursor): New decl.
783 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
784 rolling our own.
785 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
786 of *loc.
787 (STEP): Remove. No longer needed, now that adjust_location does
788 the work. All uses removed.
789 (scanner_cursor): New var.
790 (adjust_location): Renamed from extend_location. It now sets
791 *loc and adjusts the scanner cursor. All uses changed.
792 Don't bother testing for CR.
793 (handle_syncline): Remove location arg; now updates scanner cursor.
794 All callers changed.
795 (unexpected_end_of_file): Now accepts start boundary of token or
796 comment, not location. All callers changed. Update scanner cursor,
797 not the location.
798 (SC_AFTER_IDENTIFIER): New state.
799 (context_state): Renamed from c_context. All uses changed.
800 (id_loc, code_start, token_start): New local vars.
801 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
802 processing of Yacc white space and equivalents here.
803 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
804 instead of returning ID immediately, since we need to search for
805 a subsequent colon.
806 (<INITIAL>"'", "\""): Save token_start.
807 (<INITIAL>"%{", "{", "%%"): Save code_start.
808 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
809 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
810 BEGIN context_state at end, not INITIAL.
811 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
812 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
813 Return correct token start.
814 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
815 the start of a character, string or multiline comment is found.
816 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
817 Reduction): Adjust reported locations to match the more-precise
818 results now expected.
819 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
820 * tests/reduce.at (Useless Rules, Reduced Automaton,
821 Underivable Rules): Likewise.
822 * tests/regression.at (Invalid inputs): No longer `expecting ";"
823 or "|"' now that so many other tokens are allowed by the new grammar.
824
825 * src/complain.h (current_file): Remove duplicate decl;
826 current_file is now owned by files.h.
827 * src/complain.c, src/scan-gram.l: Include files.h.
828
8292002-12-06 Paul Eggert <eggert@twinsun.com>
830
831 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
832 promotes to int; it might be unsigned int.
833 * data/yacc.c (yy_reduce_print): Likewise.
834
835 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
836 be #defined in the prologue, not in the Bison declarations.
837 This fixes Debian Bug 102878, reported by Shaul Karl.
838
8392002-12-02 Paul Eggert <eggert@twinsun.com>
840
841 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
842 * lib/strtoul.c: New file, from gnulib.
843 This fixes a porting bug reported by Peter Klein in
844 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
845
8462002-11-30 Paul Eggert <eggert@twinsun.com>
847
848 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
849 and put only a forward declaration in the prologue. This is for
850 consistency with the other scanner helper functions.
851
852 Type clashes now generate warnings, not errors, since it
853 appears that POSIX may allow some grammars with type clashes.
854 * src/reader.c (grammar_current_rule_check): Warn about
855 type clashes instead of complaining.
856 * tests/input.at (Type Clashes): Expect warnings, not complaints.
857
858 Add Yacc library, since POSIX requires it.
859 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
860 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
861 * lib/main.c, lib/yyerror.c: New files.
862
863 gram_error can be static; it need not be extern.
864 * src/reader.h (gram_error): Remove decl.
865 * src/parse-gram.y (gram_error): Now static. Add static decl.
866 (print_token_value): Omit parameter names from forward decl,
867 for consistency.
868
8692002-11-29 Paul Eggert <eggert@twinsun.com>
870
871 * doc/bison.texinfo: Emphasize that yylex and yyerror must
872 be declared before being used. E.g., one should typically
873 declare them in the prologue. Use GNU coding style in examples.
874 Put "const" consistently after the type it modifies. Mention
875 that C99 supports "inline". Mention that yyerror traditionally
876 returns "int".
877
878 %parse-param and %lex-param now take just one argument, the
879 declaration; the argument name is deduced from the declaration.
880
881 * doc/bison.texinfo (Parser Function, Pure Calling, Error
882 Reporting, Table of Symbols): Document this.
883 * src/parse-gram.y (add_param): New function.
884 (COMMA): Remove.
885 (declaration): Implement new rule for %parse-param and %lex-param.
886 * src/scan-gram.l: "," now elicits a warning, rather than being
887 a token; this is more compatible with byacc.
888 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
889
8902002-11-27 Paul Eggert <eggert@twinsun.com>
891
892 Rename identifiers to avoid real and potential collisions.
893
894 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
895 to avoid collision with lex macro described by Bruce Lilly in
896 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
897 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
898 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
899 * src/parse-gram.y (print_token_value): Renamed from yyprint.
900 All uses changed.
901 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
902 The name "yycontrol" violates the name space rules, and this stuff
903 wasn't being used anyway.
904 (input): Remove action; this stuff wasn't being used.
905 (gram_error): Rename local variable yylloc -> loc.
906 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
907 (YY_DECL): Don't use "yy" at start of local variables.
908 All uses changed, e.g., yylloc -> loc.
909 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
910 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
911 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
912 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
913
914 * src/parse-gram.y (gram_error): loc is now const *.
915 * src/reader.h (gram_error): Likewise.
916
9172002-11-24 Paul Eggert <eggert@twinsun.com>
918
919 Version 1.75c.
920
921 * tests/actions.at (Actions after errors): Use an output format
922 more similar to that of the Printers and Destructors test.
923 Test the position of the ';' token too.
924 (Printers and Destructors): Likewise.
925 (Printers and Destructors: %glr-parser): Remove for now, to avoid
926 unnecessarily alarming people when the test fails.
927
928 * data/yacc.c (yyerrlab1): Move this label down, so that the
929 parser does not discard the lookahead token if the user code
930 invokes YYERROR. This change is required for POSIX conformance.
931
932 * lib/error.c: Sync with gnulib.
933
9342002-11-22 Paul Eggert <eggert@twinsun.com>
935
936 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
937 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
938 * lib/xmalloc.c: Likewise.
939
9402002-11-20 Paul Eggert <eggert@twinsun.com>
941
942 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
943
9442002-11-20 Paul Eggert <eggert@twinsun.com>
945
946 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
947 should use `if (! x) abort ();' rather than `assert (x);', and
948 anyway it's one less thing to worry about configuring.
949
950 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
951 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
952 and replace all instances of assert with abort.
953 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
954 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
955
956 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
957 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
958 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
959 hash_find_entry, hash_rehash, hash_insert): Likewise.
960 * src/conflicts.c (resolve_sr_conflict): Likewise.
961 * src/lalr.c (set_goto_map, map_goto): Likewise.
962 * src/nullable.c (nullable_compute): Likewise.
963 * src/output.c (prepare_rules, token_definitions_output): Likewise.
964 * src/reader.c (packgram, reader): Likewise.
965 * src/state.c (state_new, state_free, state_transitions_set,
966 state_reduction_find): Likewise.
967 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
968 symbol_pack): Likewise.
969 * src/tables.c (conflict_row, pack_vector): Likewise.
970 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
971 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
972 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
973 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
974
975 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
976 (ARGMATCH_CONSTRAINT): New macro.
977 (ARGMATCH_ASSERT): Use it.
978
979 * src/system.h (verify): New macro.
980 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
981 rather than assert.
982 * src/tables.c (tables_generate): Likewise.
983
984 * src/struniq.c (struniq_assert): Now returns void, and aborts
985 if the assertion is false.
986 (struniq_assert_p): Remove.
987 * src/struniq.h: Likewise.
988
9892002-11-18 Paul Eggert <eggert@twinsun.com>
990
991 * data/glr.c (yygetLRActions): Replace `yyindex' with
992 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
993 This fixes the regression with Sun ONE Studio 7 cc that I reported in
994 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
995
9962002-11-18 Akim Demaille <akim@epita.fr>
997
998 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
999 space.
1000 From Tim Van Holder.
1001
10022002-11-17 Paul Eggert <eggert@twinsun.com>
1003
1004 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
1005 to "SyntaxError" for consistency with my 2002-11-15 change.
1006
1007 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
1008 not define to {}, since this breaks the common use of `YYDPRINTF
1009 ((...));' if a single statement is desired (e.g. before `else').
1010 Work around GCC warnings by surrounding corresponding calls with
1011 {} if needed.
1012 (yyhasResolvedValue): Remove unused function.
1013 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
1014 loop body.
1015 (yyreportSyntaxError): Renamed from yyreportParseError.
1016 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
1017 All uses changed.
1018 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
1019 extern when possible. Remove unused initializations.
1020
10212002-11-16 Akim Demaille <akim@epita.fr>
1022
1023 Augment the similarity between GLR and LALR traces.
1024
1025 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
1026 (YY_REDUCE_PRINT): New.
1027 (yyparse): Use them.
1028 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
1029 YYDPRINT here.
1030 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
1031 state reached after the reduction/recovery, since...
1032 (yyparse, yyprocessOneStack): Report the state we are entering in.
1033
10342002-11-16 Akim Demaille <akim@epita.fr>
1035
1036 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
1037 Add support for --trace=skeleton.
1038 * src/scan-skel.l: %option debug.
1039 Scan strings of non-@ or \n instead of character by character.
1040 (scan_skel): Handle trace_skeleton.
1041 (QPUTS): New.
1042 (@output_parser_name@, @output_header_name@): ``Restore'' their
1043 support (used to be M4 macros).
1044 * data/yacc.c: Quote larger chunks, a la glr.c.
1045 * data/lalr1.cc: Likewise.
1046 The header guards are no longer available, so use some other
1047 string than `YYLSP_NEEDED'.
1048
10492002-11-16 Akim Demaille <akim@epita.fr>
1050
1051 Make the ``Printers and Destructors'' test more verbose, taking
1052 `yacc.c''s behavior as (possibly wrong) reference.
1053
1054 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
1055 instead of fprint on stdout.
1056 Set and report the last_line of the symbols.
1057 Consistently display values and locations.
1058
10592002-11-16 Paul Eggert <eggert@twinsun.com>
1060
1061 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
1062
10632002-11-15 Paul Eggert <eggert@twinsun.com>
1064
1065 * tests/actions.at (Actions after errors): New test case.
1066
1067 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
1068 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
1069 tests/action.at, tests/calc.at, tests/conflicts.at,
1070 tests/cxx-type.at, tests/regression.at:
1071 "parse error" -> "syntax error" for POSIX compatibility.
1072 "parsing stack overflow..." -> "parser stack overflow" so
1073 that code matches Bison documentation.
1074
10752002-11-15 Akim Demaille <akim@epita.fr>
1076
1077 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
1078 take two BRACED_CODE, not two string_content.
1079 Free the scanner's obstack when we are done.
1080 (code_content): New.
1081 * tests/calc.at: Adjust.
1082 * doc/bison.texinfo: Adjust.
1083 Also, make sure to include the `,' for these declarations.
1084
10852002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
1086
1087 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
1088 definition; avoids potential autoreconf problems.
1089
10902002-11-15 Akim Demaille <akim@epita.fr>
1091
1092 Always check the value returned by yyparse.
1093
1094 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
1095 returned by yyparse.
1096 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
1097 Adjust calls.
1098 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
1099 returned by yyparse.
1100
11012002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1102
1103 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
1104 on input.at test.
1105
11062002-11-14 Paul Eggert <eggert@twinsun.com>
1107
1108 * src/output.c (output_skeleton): Call xfopen instead of
1109 duplicating xfopen's body.
1110
1111 Fix bugs reported by Nelson H. F. Beebe in
1112 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
1113
1114 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
1115 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
1116 Group compiler. Instead, use "$CC -E bar.c". Include the .h
1117 file twice in the grammar, as an extra check.
1118
1119 * tests/input.at (Torturing the Scanner): Surround the
1120 backslash-newline tests with "#if 0", to make it less likely that
1121 we'll run into compiler bugs. Bring back solitary \ inside
1122 comment, but add a closing comment to work around HP C bug. Don't
1123 test backslash-newline in C character constant.
1124
11252002-11-14 Akim Demaille <akim@epita.fr>
1126
1127 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
1128 status of the compiler.
1129 Calling `exit 1' is no longer needed.
1130 Reported by Nelson H. F. Beebe.
1131
11322002-11-14 Akim Demaille <akim@epita.fr>
1133
1134 * tests/atlocal.in (CPPFLAGS): We have config.h.
1135 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
1136 New.
1137 * tests/actions.at, tests/calc.at, tests/conflicts.at,
1138 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
1139 * tests/regression.at, tests/torture.at: Use them for all the
1140 grammars that are to be compiled.
1141 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
1142 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
1143 * doc/bison.texinfo (GLR Parsers): Document `inline'.
1144
11452002-11-14 Akim Demaille <akim@epita.fr>
1146
1147 * doc/bison.texinfo: Various formatting changes (alignments in
1148 samples, additional @group/@end group, GCS in samples.
1149 Use @deffn instead of simple @table to define the directives,
1150 macros, variables etc.
1151
11522002-11-13 Paul Eggert <eggert@twinsun.com>
1153
1154 Fix some bugs reported by Albert Chin-A-Young in
1155 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
1156
1157 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
1158 -o c"; the HP C compiler chatters during compilation.
1159 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
1160 * tests/headers.at (export YYLTYPE): Likewise.
1161
1162 * tests/input.at (Torturing the Scanner): Remove lines containing
1163 solitary backslashes, as they tickle a bug in the HP C compiler.
1164
1165 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
1166 comments, since they're not portable. Use GNU coding style.
1167
11682002-11-13 Akim Demaille <akim@epita.fr>
1169
1170 * data/yacc.c: Leave bigger chunks of quoted text.
1171 (YYDSYMPRINTF): New.
1172 Use it to report symbol activities.
1173 * data/glr.c (YYDSYMPRINTF): New.
1174 Use it.
1175
11762002-11-12 Paul Eggert <eggert@twinsun.com>
1177
1178 Version 1.75b.
1179
1180 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
1181 (yyglrReduce): Return yyok, not 0.
1182 This should avoid the enumerated-type warnings reported
1183 by Nelson H. F. Beebe in
1184 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
1185
1186 * lib/bbitset.h (BITSET_INLINE): Remove.
1187 * lib/bitset.h [! BITSET_INLINE]: Remove.
1188 (bitset_set, bitset_reset, bitset_test): Rename local vars
1189 to avoid shadowing warnings by GCC.
1190
1191 * data/glr.c (inline): Remove #define. It's the user's
1192 responsibility to #define it away, just like 'const'.
1193 This fixes one of the bugs reported by Nelson H. F. Beebe in
1194 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
1195
1196 * Makefile.maint (po-check): Scan .l and .y files instead of the
1197 .c and the .h files that they generate. This fixes the bug
1198 reported by Tim Van Holder in:
1199 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
1200 Look for N_ as well as for _. Try to avoid matching #define for
1201 N_ and _.
1202 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
1203 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
1204 * src/scan-gram.l: Revamp regular expressions so that " and '
1205 do not confuse xgettext.
1206
1207 * src/struniq.h (struniq_new): Do not declare the return type
1208 to be 'const'; this violates the C standard.
1209 * src/struniq.c (struniq_new): Likewise.
1210
12112002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
1212
1213 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
1214 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
1215 linker.
1216
12172002-11-12 Akim Demaille <akim@epita.fr>
1218
1219 * Makefile.maint: Sync with Autoconf:
1220 (local_updates): New.
1221
12222002-11-12 Akim Demaille <akim@epita.fr>
1223
1224 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
1225
12262002-11-12 Akim Demaille <akim@epita.fr>
1227
1228 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
1229 locations.
1230
12312002-11-12 Akim Demaille <akim@epita.fr>
1232
1233 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
1234 not yyvalue.
1235
12362002-11-12 Akim Demaille <akim@epita.fr>
1237
1238 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
1239 Use it to test the GLR parser.
1240
12412002-11-12 Akim Demaille <akim@epita.fr>
1242
1243 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
1244 defines it.
1245 * data/glr.c (yystos): New.
1246 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
1247 (YYDSYMPRINT): New.
1248 (yyval): Don't define it, it is handled via M4.
1249 (yyrecoverParseError): Free verbosely the discarded symbols.
1250 * data/yacc.c (yysymprint): Remove, rather...
1251 (b4_yysymprint_generate): invoke.
1252 * data/c.m4 (b4_yysymprint_generate): New.
1253 Accept pointers as arguments, as opposed to the version from
1254 yacc.c.
1255 (b4_yydestruct_generate): Likewise.
1256 * tests/cations.at (Printers and Destructors): Use Bison directives
1257 instead of CPP macros.
1258 Don't rely on internal details.
1259
12602002-11-12 Akim Demaille <akim@epita.fr>
1261
1262 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
1263 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
1264 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
1265 it against YYEMPTY and so forth), work on yytoken (i.e., set
1266 it to YYEMPTY etc.).
1267 (yydestruct): Replace with a b4_yydestruct_generate invocation.
1268 (b4_symbol_actions): Remove.
1269 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
1270 for 0, end-of-input.
1271
12722002-11-12 Akim Demaille <akim@epita.fr>
1273
1274 * doc/bison.texinfo (Destructor Decl): New.
1275
12762002-11-12 Akim Demaille <akim@epita.fr>
1277
1278 * src/tables.c (tables_generate): Use free for pointers that
1279 cannot be NULL, not XFREE.
1280 (pack_vector): Use assert, not fatal, for bound violations.
1281 * src/state.c (state_new): Likewise.
1282 * src/reader.c (reader): Likewise.
1283 * src/lalr.c (set_goto_map): Likewise.
1284 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
1285 the file name.
1286
12872002-11-12 Akim Demaille <akim@epita.fr>
1288
1289 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
1290 Restore.
1291 * src/scan-gram.l (last_string): Is global to the file, not to
1292 yylex.
1293 * src/parse-gram.y (input): Don't append the epilogue here,
1294 (epilogue.opt): do it here, and free the scanner's obstack.
1295 * src/reader.c (epilogue_set): Rename as...
1296 (epilogue_augment): this.
1297 * data/c.m4 (b4_epilogue): Defaults to empty.
1298
12992002-11-12 Akim Demaille <akim@epita.fr>
1300
1301 * src/getargs.c (long_options): Remove duplicates.
1302 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
1303 Remove.
1304 * doc/bison.rnh: Remove.
1305 * doc/bison.texinfo (VMS Invocation): Remove.
1306
13072002-11-12 Akim Demaille <akim@epita.fr>
1308
1309 * src/struniq.h, src/struniq.c (struniq_t): Is const.
1310 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
1311
1312 Use struniq for symbols.
1313
1314 * src/symtab.h (symbol_t): The tag member is a struniq.
1315 (symbol_type_set): Adjust.
1316 * src/symtab.c (symbol_new): Takes a struniq.
1317 (symbol_free): Don't free the tag member.
1318 (hash_compare_symbol_t, hash_symbol_t): Rename as...
1319 (hash_compare_symbol, hash_symbol): these.
1320 Use the fact that tags as struniqs.
1321 (symbol_get): Use struniq_new.
1322 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
1323 Returns a strniq.
1324 * src/reader.h (merger_list, grammar_currentmerge_set): The name
1325 and type members are struniqs.
1326 * src/reader.c (get_merge_function)
1327 (grammar_current_rule_merge_set): Adjust.
1328 (TYPE, current_type): Are struniq.
1329
1330 Use struniq for file names.
1331
1332 * src/files.h, src/files.c (infile): Split into...
1333 (grammar_file, current_file): these.
1334 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
1335 * src/reduce.c (reduce_print): Likewise.
1336 * src/getargs.c (getargs): Likewise.
1337 * src/complain.h, src/complain.c: Likewise.
1338 * src/main.c (main): Call struniqs_new early enough to use it for
1339 file names.
1340 Don't free the input file name.
1341
13422002-11-12 Akim Demaille <akim@epita.fr>
1343
1344 * src/symtab.c (symbol_free): Remove dead deactivated code:
1345 type_name are properly removed.
1346 Don't use XFREE to free items that cannot be NULL.
1347 * src/struniq.h, src/struniq.c: New.
1348 * src/main.c (main): Initialize/free struniqs.
1349 * src/parse-gram.y (%union): Add astruniq member.
1350 (yyprint): Adjust.
1351 * src/scan-gram.l (<{tag}>): Return a struniq.
1352 Free the obstack bit that used to store it.
1353 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
1354
13552002-11-11 Paul Eggert <eggert@twinsun.com>
1356
1357 Revamp to fix many (but not all) of the C- and M4-related quoting
1358 problems. Among other things, this fixes the Bison bug reported
1359 by Jan Hubicka when processing the Bash grammar; see:
1360 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
1361
1362 Use new @ escapes consistently. Represent brackets with @{ and @}
1363 rather than @<:@ and @:>@, since this works a bit better with dumb
1364 editors like vi. Represent @ with @@, since @ is now consistently
1365 an escape. Use @oline@ and @ofile@ rather than __oline__ and
1366 __ofile__, to avoid unexpected expansions. Similarly, use @output
1367 rather than #output.
1368
1369 * data/c.m4 (b4_copyright): Omit file name from comment, since
1370 the file name could contain "*/".
1371 (b4_synclines_flag): Don't quote the 2nd argument; it should already
1372 be quoted. All uses changed.
1373
1374 * data/glr.c: Use new @ escapes consistently.
1375 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
1376 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
1377 Remove, since they couldn't handle arbitrary characters in file
1378 names.
1379 * data/lalr1.cc: Likewise.
1380 * data/yacc.c: Likewise.
1381
1382 * src/files.c (output_infix): Remove; all uses removed.
1383 * src/files.h: Likewise.
1384
1385 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
1386 mishandled funny characters in file names, and anyway it isn't
1387 needed any more.
1388 * data/yacc.c: Likewise.
1389 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
1390
1391 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
1392 * data/yacc.c: Likewise.
1393
1394 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
1395 strings now.
1396 (muscle_init): Quote filename as a C string.
1397 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
1398 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
1399 * src/output.c (escaped_file_name_output): New function.
1400 (prepare_symbols): Quote tokens for M4.
1401 (prepare): Don't insert output_infix, output_prefix,
1402 output_parser_name, output_header_name; this is now down by scan-skel.
1403 Insert skeleton as a C string.
1404
1405 * src/output.c (user_actions_output, symbol_destructors_output,
1406 symbol_printers_output): Quote filenames for C and M4.
1407 * src/reader.c (prologue_augment, epilogue_set): Likewise.
1408
1409 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
1410 escapes other than \\ and \'; this simplifies the code.
1411 (<SC_STRING>): Likewise, for \\ and \".
1412 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
1413 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
1414 Use new escapes @{ and @} for [ and ].
1415
1416 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
1417 them with auto vars.
1418 Switch to new escape scheme, where @ is the escape character uniformly.
1419 Abort if a stray escape character is found. Avoid unbounded input
1420 buffer when parsing non-escaped text.
1421
1422 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
1423 __oline__, #output, $@, and @{ do not have unintended meanings.
1424
14252002-11-09 Paul Eggert <eggert@twinsun.com>
1426
1427 Fix the test failure due to GCC warnings described in
1428 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
1429 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
1430 evaluate to 0 if it's impossible for NINF to be in the respective
1431 table.
1432 (yygetLRActions, yyrecoverParseError): Use them.
1433
1434 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
1435 counted in the token inserted at end of file. Now takes
1436 location_t *, not location_t, so that the location can be
1437 adjusted. All uses changed.
1438
1439 * tests/regression.at (Invalid inputs): Adjust wording in
1440 diagnostic to match the new behavior.
1441
1442 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
1443 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
1444 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
1445 abort ();'. This reduces the runtime of the "Many lookaheads"
1446 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
1447 GCC 3.2.
1448
14492002-11-07 Paul Eggert <eggert@twinsun.com>
1450
1451 * src/parse-gram.y (CHARACTER): Remove unused token.
1452 All uses removed.
1453
1454 * src/scan-gram.l: Remove stack option. We no longer use the
1455 stack, since the stack was never deeper than 1; instead, use the
1456 new auto var c_context to record the stacked value.
1457
1458 Remove nounput option. At an unexpected end of file, we now unput
1459 the minimal input necessary to end cleanly; this simplifies the
1460 code.
1461
1462 Avoid unbounded token sizes where this is easy.
1463
1464 (unexpected_end_of_file): New function.
1465 Use it to systematize the error message on unexpected EOF.
1466 (last-string): Now auto, not static.
1467 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
1468 (scanner_last_string_free): Remove; not used.
1469 (percent_percent_count): Move decl to just before use.
1470 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
1471 not the (never otherwised-used) CHARACTER.
1472
14732002-11-07 Akim Demaille <akim@epita.fr>
1474
1475 Let yyerror always receive the msg as last argument, so that
1476 yyerror can be variadic.
1477
1478 * data/yacc.c (b4_yyerror_args): New.
1479 Use it when calling yyerror.
1480 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
1481 Use it when calling yyerror.
1482 * doc/bison.texinfo (Error Reporting): Adjust.
1483 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
1484 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
1485
14862002-11-06 Akim Demaille <akim@epita.fr>
1487
1488 #line should have quoted strings.
1489 Ideally, this should be done by m4_quotearg.
1490
1491 * src/scan-skel.l: Include quotearg.h.
1492 Quote __ofile__.
1493 * src/output.c (symbol_printers_output)
1494 (symbol_destructors_output): Quote the file name.
1495
14962002-11-06 Akim Demaille <akim@epita.fr>
1497
1498 * tests/regression.at (Invalid inputs): Adjust to the recent
1499 messages.
1500
15012002-11-06 Akim Demaille <akim@epita.fr>
1502
1503 Restore --no-lines.
1504 Reported by Jim Kent.
1505
1506 * data/c.m4 (b4_syncline): New.
1507 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
1508 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
1509 * src/output.c (user_actions_output): Likewise.
1510 (prepare): Define 'b4_synclines_flag'.
1511 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
1512
15132002-11-06 Akim Demaille <akim@epita.fr>
1514
1515 * src/main.c (main): Free `infile'.
1516 * src/scan-gram.l (handle_syncline): New.
1517 Recognize `#line'.
1518 * src/output.c (user_actions_output, symbol_destructors_output)
1519 (symbol_printers_output): Use the location's file name, not
1520 infile.
1521 * src/reader.c (prologue_augment, epilogue_set): Likewise.
1522
15232002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1524
1525 * src/tables.c (matching_state): Don't allow states to match if
1526 either has GLR conflict entries.
1527
15282002-11-05 Paul Eggert <eggert@twinsun.com>
1529
1530 * src/scan-gram.l: Use more accurate diagnostics, e.g.
1531 "integer out of range" rather than "invalid value".
1532 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
1533 accordingly.
1534
1535 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
1536 Also, remove one static variable in the scanner.
1537
1538 * src/scan-gram.l (braces_level): Now auto, not static.
1539 Initialize to zero if the compiler is being picky.
1540 (INITIAL): Clear braces_level instead of incrementing it.
1541 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
1542 as POSIX 1003.1-2001 requires.
1543 * src/system.h (IF_LINT): New macro, taken from coreutils.
1544 * configure.ac: Define "lint" if --enable-gcc-warnings.
1545
15462002-11-05 Akim Demaille <akim@epita.fr>
1547
1548 * src/scan-gram.l: When it starts with `%', complain about the
1549 whole directive, not just that `invalid character: %'.
1550
15512002-11-04 Akim Demaille <akim@epita.fr>
1552
1553 * Makefile.maint: Update from Autoconf.
1554 (update, cvs-update, po-update, do-po-update): New.
1555
15562002-11-04 Akim Demaille <akim@epita.fr>
1557
1558 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
1559 and yyerror.
1560 Have yyerror `use' its arguments.
1561 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
1562 returns true when location & yacc & pure & parse-param.
1563 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
1564
15652002-11-04 Akim Demaille <akim@epita.fr>
1566
1567 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
1568 clashes.
1569 * src/scan-gram.l: Use [\'] instead of ['] to pacify
1570 font-lock-mode.
1571 Use complain_at.
1572 Use quote, not quote_n since LOCATION_PRINT no longer uses the
1573 slot 0.
1574
15752002-11-03 Paul Eggert <eggert@twinsun.com>
1576
1577 * src/reader.c (get_merge_function, grammar_current_rule_check):
1578 Use consistent diagnostics for reporting type name clashes.
1579 Quote the types with <>, for consistency with Yacc.
1580 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
1581
15822002-11-03 Akim Demaille <akim@epita.fr>
1583
1584 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
1585 New.
1586 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
1587 (b4_parse_param): Remove.
1588 Use b4_identification.
1589 Propagate b4_pure_args where needed to pass them to yyerror.
1590 * data/glr.m4 (b4_parse_param): Remove.
1591 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
1592 (b4_lpure_formals): New.
1593 Use b4_identification.
1594 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
1595 b4_user_formals and b4_user_args.
1596 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
1597 (yyreportAmbiguity): When using a pure parser, also need
1598 the location, and the parse-params.
1599 Adjust callers.
1600 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
1601 When using a pure parser, also need the parse-params.
1602 Adjust callers.
1603 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
1604 (%pure-parser + %parse-param) LALR and GLR parsers.
1605 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
1606 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
1607 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
1608 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
1609 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
1610 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
1611 * doc/bison.texinfo: Untabify the whole file.
1612 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
1613 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
1614 (Error Reporting): Adjust to these new directives.
1615 Document %error-verbose, deprecate YYERROR_VERBOSE.
1616
16172002-11-03 Akim Demaille <akim@epita.fr>
1618
1619 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
1620 AT_CHECK_CALC_GLR invocations to use % directives, instead of
1621 command line options.
1622 * tests/cxx-type.at: Formatting changes.
1623
16242002-11-03 Paul Eggert <eggert@twinsun.com>
1625
1626 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
1627 to count columns correctly, and to check for invalid inputs.
1628
1629 Use mbsnwidth to count columns correctly. Account for tabs, too.
1630 Include mbswidth.h.
1631 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
1632 (extend_location): New function.
1633 (YY_LINES): Remove.
1634
1635 Handle CRLF in C code rather than in Lex code.
1636 (YY_INPUT): New macro.
1637 (no_cr_read): New function.
1638
1639 Scan UCNs, even though we don't fully handle them yet.
1640 (convert_ucn_to_byte): New function.
1641
1642 Handle backslash-newline correctly in C code.
1643 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
1644 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
1645 all uses changed.
1646 (tag, splice): New EREs. Do not allow NUL or newline in tags.
1647 Use {splice} wherever C allows backslash-newline.
1648 YY_STEP after space, newline, vertical-tab.
1649 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
1650
1651 (letter, id): Don't assume ASCII; e.g., spell out a-z.
1652
1653 ({int}, handle_action_dollar, handle_action_at): Check for integer
1654 overflow.
1655
1656 (YY_STEP): Omit trailing semicolon, so that it's more like C.
1657
1658 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
1659 as well as \000. Check for UCHAR_MAX, not 255.
1660 Allow \x with an arbitrary positive number of digits, as in C.
1661 Check for overflow here.
1662 Allow \? and UCNs, for compatibility with C.
1663
1664 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
1665 with quote slot used by complain_at.
1666
1667 * tests/input.at: Add tests for backslash-newline, m4 quotes
1668 in symbols, long literals, and funny escapes in strings.
1669
1670 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
1671 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
1672 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
1673 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
1674 * m4/mbswidth.m4: New file, from GNU coreutils.
1675
1676 * doc/bison.texinfo (Grammar Outline): Document // comments.
1677 (Symbols): Document that trigraphs have no special meaning in Bison,
1678 nor is backslash-newline allowed.
1679 (Actions): Document that trigraphs have no special meaning.
1680
1681 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
1682 no longer used.
1683
16842002-11-02 Paul Eggert <eggert@twinsun.com>
1685
1686 * src/reader.c: Don't include quote.h; not needed.
1687 (get_merge_function): Reword warning to be consistent with
1688 type clash diagnostic in grammar_current_rule_check.
1689
1690 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
1691 bug in trigraph handling.
1692
1693 * src/output.c (prepare_symbols): When printing token names,
1694 escape "[" as "@<:@" and likewise for "]".
1695
1696 * src/system.h (errno): Remove declaration, as we are now
1697 assuming C89 or better, and C89 guarantees errno.
1698
16992002-10-30 Paul Eggert <eggert@twinsun.com>
1700
1701 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
1702 Check for close failures.
1703 * src/files.h (xfclose): Return void, not int, since it always
1704 returned zero.
1705 * src/files.c (xfclose): Likewise. Report I/O error if ferror
1706 indicates one.
1707 * src/output.c (output_skeleton): Use xfclose rather than fclose
1708 and ferror. xfclose now checks ferror.
1709
1710 * data/glr.c (YYLEFTMOST_STATE): Remove.
1711 (yyreportTree): Use a stack-based leftmost state. This avoids
1712 our continuing battles with bogus warnings about initializers.
1713
17142002-10-30 Akim Demaille <akim@epita.fr>
1715
1716 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
1717 #if.
1718
17192002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1720
1721 * tests/glr-regr1.at: New test for reported regressions.
1722 * tests/testsuite.at: Add glr-regr1.at test.
1723 * tests/Makefile.am: Add glr-regr1.at test.
1724
17252002-10-24 Paul Eggert <eggert@twinsun.com>
1726
1727 Version 1.75a.
1728
1729 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
1730 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
1731 we use malloc. Don't assume 'A' through 'Z' are contiguous.
1732 Don't assume strdup exists; POSIX says its an XSI extension.
1733 Check for buffer overflow on input.
1734
17352002-10-24 Akim Demaille <akim@epita.fr>
1736
1737 * src/output.c (output_skeleton): Don't disable M4sugar comments
1738 too soon: it results in comments being expanded.
1739 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
1740 first output.
1741
17422002-10-24 Akim Demaille <akim@epita.fr>
1743
1744 * data/yacc.c (m4_int_type): New.
1745 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
1746 char' as only yacc.c wants K&R portability.
1747 * data/glr.c (yysigned_char): Remove.
1748 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
1749 Reported by Quoc Peyrot.
1750
17512002-10-23 Paul Eggert <eggert@twinsun.com>
1752
1753 * src/main.c (main): With --trace=time, report times even if a
1754 non-fatal error occurs. Formerly, the times were reported in some
1755 such cases but not in others.
1756 * src/reader.c (reader): Just return if a complaint has been issued,
1757 instead of exiting, so that 'main' can report times.
1758
17592002-10-22 Akim Demaille <akim@epita.fr>
1760
1761 * src/system.h: Include sys/types.
1762 Reported by Bert Deknuydt.
1763
17642002-10-23 Paul Eggert <eggert@twinsun.com>
1765
1766 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
1767 Suggested by Art Haas.
1768
17692002-10-22 Paul Eggert <eggert@twinsun.com>
1770
1771 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
1772 decl; not needed any more.
1773 * src/main.c (main): Use return to exit, undoing yesterday's change.
1774 The last OS that we could find where this wouldn't work is
1775 SunOS 3.5, and that's too old to worry about now.
1776
1777 * data/glr.c (struct yyltype): Define members even when not
1778 doing locations. This is more consistent with yacc.c, and it
1779 works around the following bug reports:
1780 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
1781 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
1782
1783 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
1784 @acronym consistently. Standardize on "Yacc" instead of "YACC",
1785 "Algol" instead of "ALGOL". Give a bit more history about BNF.
1786
17872002-10-22 Akim Demaille <akim@epita.fr>
1788
1789 * data/README: New.
1790
17912002-10-21 Paul Eggert <eggert@twinsun.com>
1792
1793 Be consistent about 'bool'; the old code used an enum in one
1794 module and an int in another, and this violates the C standard.
1795 * m4/stdbool.m4: New file, from coreutils 4.5.3.
1796 * configure.ac (AC_HEADER_STDBOOL): Add.
1797 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
1798 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
1799 * src/symtab.c (hash_compare_symbol_t): Likewise.
1800 * src/system.h (bool, false, true): Use a definition consistent
1801 with ../lib/hash.c. All uses changed.
1802
1803 * src/complain.c (warning_issued): Renamed from warn_message_count,
1804 so that we needn't worry about integer overflow (!).
1805 Now of type bool. All uses changed.
1806 (complaint_issued): Renamed from complain_message_count; likewise.
1807
1808 * src/main.c (main): Use exit to exit with failure.
1809
1810 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
1811 rather than 1 and 0.
1812 * src/main.c (main): Likewise.
1813 * src/getargs.c (getargs): Likewise.
1814 * src/reader.c (reader): Likewise.
1815
1816 * src/getarg.c (getargs): Remove duplicate code for
1817 "Try `bison --help'".
1818
1819 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
1820 What was that "2" for?
1821
1822 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
1823 * src/getargs.c (usage): Likewise.
1824
1825 * src/getargs.c (getargs): When there are too few operands, report
1826 the last one. When there are too many, report the first extra
1827 one. This is how diffutils does it.
1828
18292002-10-20 Paul Eggert <eggert@twinsun.com>
1830
1831 Remove K&R vestiges.
1832 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
1833 * src/complain.c (VA_START): Remove. Assume prototypes.
1834 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
1835 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
1836 fatal): Assume prototypes.
1837 * src/complain.h: Assume prototypes.
1838 * src/system.h (PARAMS): Remove.
1839 Include <limits.h> unconditionally, since it's guaranteeed even
1840 for a freestanding C89 compiler.
1841 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
1842 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
1843
18442002-10-20 Akim Demaille <akim@epita.fr>
1845
1846 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
1847 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
1848 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
1849 (yyresolveStates, yyresolveAction, yyresolveStack)
1850 (yyprocessOneStack): Use them.
1851 (yy_reduce_print): New.
1852 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
1853
18542002-10-20 Akim Demaille <akim@epita.fr>
1855
1856 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
1857 arguments and output `void'.
1858 (b4_c_function): Rename as...
1859 (b4_c_function_def): this.
1860 (b4_c_function_decl, b4_c_ansi_function_def)
1861 (b4_c_ansi_function_decl): New.
1862 Change the interpretation of the arguments: before `int, foo', now
1863 `int foo, foo'.
1864 * data/yacc.c (yyparse): Prototype and define thanks to these.
1865 Adjust b4_c_function_def uses.
1866 * data/glr.c (yyparse): Likewise, but ANSI only.
1867
18682002-10-20 Akim Demaille <akim@epita.fr>
1869
1870 * src/output.c (prepare): Move the definition of `tokens_number',
1871 `nterms_number', `undef_token_number', `user_token_number_max'
1872 to...
1873 (prepare_tokens): Here.
1874 (prepare_tokens): Rename as...
1875 (prepare_symbols): this.
1876 (prepare): Move the definition of `rules_number' to...
1877 (prepare_rules): here.
1878 (prepare): Move the definition of `last', `final_state_number',
1879 `states_number' to...
1880 (prepare_states): here.
1881 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
1882
18832002-10-20 Akim Demaille <akim@epita.fr>
1884
1885 * src/tables.h, src/tables.c, src/output.c: Comment changes.
1886
18872002-10-20 Akim Demaille <akim@epita.fr>
1888
1889 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
1890 * data/c.m4: here.
1891
18922002-10-20 Akim Demaille <akim@epita.fr>
1893
1894 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
1895 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
1896 `pair'.
1897 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
1898 `name' to...
1899 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
1900 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
1901 These.
1902
19032002-10-19 Paul Eggert <eggert@twinsun.com>
1904
1905 Do not create a temporary file, as that involves security and
1906 cleanup headaches. Instead, use a pair of pipes.
1907 Derived from a suggestion by Florian Krohm.
1908 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
1909 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
1910 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
1911 (BISON_PREREQ_SUBPIPE): Add.
1912 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
1913 Add subpipe.h, subpipe.c.
1914 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
1915 * po/POTFILES.in: Add lib/subpipe.c.
1916 * src/output.c: Include "subpipe.h".
1917 (m4_invoke): Remove decl.
1918 (scan_skel): New decl.
1919 (output_skeleton): Use pipe rather than temporary file for m4 input.
1920 Check that m4sugar.m4 is readable, to avoid deadlock.
1921 Check for pipe I/O error.
1922 * src/scan-skel.l (readpipe): Remove decl.
1923 (scan_skel): New function, to be used in place of m4_invoke.
1924 Read from stream rather than file.
1925
1926 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
1927 float, as this generates a warning on Solaris 8 + GCC 3.2 with
1928 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
1929 this generates a more-accurate value anyway.
1930
1931 * lib/timevar.c (timervar_accumulate): Rename locals to
1932 avoid confusion with similarly-named more-global.
1933 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
1934
1935 * src/output.c (prepare): Use xstrdup to convert char const *
1936 to char *, to avoid GCC warning.
1937
19382002-10-19 Akim Demaille <akim@epita.fr>
1939
1940 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
1941 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
1942 Use them to have `calc.y' ready for %pure-parser.
1943 * data/yacc.c (YYLEX): Pass a yylex return type to
1944 b4_c_function_call.
1945
19462002-10-19 Akim Demaille <akim@epita.fr>
1947
1948 Prototype support of %lex-param and %parse-param.
1949
1950 * src/parse-gram.y: Add the definition of the %lex-param and
1951 %parse-param tokens, plus their rules.
1952 Drop the `_' version of %glr-parser.
1953 Add the "," token.
1954 * src/scan-gram.l (INITIAL): Scan them.
1955 * src/muscle_tab.c: Comment changes.
1956 (muscle_insert, muscle_find): Rename `pair' as `probe'.
1957 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
1958 (muscle_entry_s): The `value' member is no longer const.
1959 Adjust all dependencies.
1960 * src/muscle_tab.c (muscle_init): Adjust: use
1961 MUSCLE_INSERT_STRING.
1962 Initialize the obstack earlier.
1963 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
1964 (muscle_pair_list_grow): New.
1965 * data/c.m4 (b4_c_function_call, b4_c_args): New.
1966 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
1967 * tests/calc.at: Use %locations, not --locations.
1968 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
1969
19702002-10-19 Akim Demaille <akim@epita.fr>
1971
1972 * src/getargs.c (usage): Take status as argument and exit
1973 accordingly.
1974 Report the traditional `Try ... --help' message when status != 0.
1975 (usage, version): Don't take a FILE * as arg, it is pointless.
1976 (getargs): When there is an incorrect number of arguments, make it
1977 an error, and report it GNUlically thanks to `usage ()'.
1978
19792002-10-18 Paul Eggert <eggert@twinsun.com>
1980
1981 * data/glr.c (yyreportParseError): Don't assume that sprintf
1982 yields the length of the printed string, as this is not true
1983 on SunOS 4.1.4. Reported by Peter Klein.
1984
1985 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
1986 * tests/conflicts.at (%nonassoc and eof): Likewise.
1987 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
1988
19892002-10-17 Akim Demaille <akim@epita.fr>
1990
1991 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
1992 * src/getargs.c (trace_types, trace_args): Adjust.
1993 * src/reader.c (grammar_current_rule_prec_set)
1994 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
1995 Standardize error messages.
1996 And s/@prec/%prec/!
1997 (reader): Use trace_flag to enable scanner/parser debugging,
1998 instead of an adhoc scheme.
1999 * src/scan-gram.l: Remove trailing debugging code.
2000
20012002-10-16 Paul Eggert <eggert@twinsun.com>
2002
2003 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
2004 MUSCLE_TAB_H.
2005
2006 * NEWS: Officially drop support for building Bison with K&R C,
2007 since it didn't work anyway and it's not worth worrying about.
2008 * Makefile.maint (wget_files): Remove ansi2knr.c.
2009 (ansi2knr.c-url_prefix): Remove.
2010 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
2011 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2012 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2013
20142002-10-15 Paul Eggert <eggert@twinsun.com>
2015
2016 Stop using the "enum_" trick for K&R-style function definitions;
2017 it confused me, and I was the author! Instead, assume that people
2018 who want to use K&R C compilers (when using these modules in GCC,
2019 perhaps?) will run ansi2knr.
2020
2021 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
2022 All uses of "enum_" changed to "enum ".
2023 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
2024 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
2025
2026 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
2027 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
2028 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
2029 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
2030 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
2031 abitset_not, abitset_ones, abitset_or, abitset_or_and,
2032 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
2033 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
2034 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
2035 Use function prototypes; this removes the need for declaring
2036 static functions simply to provide their prototypes.
2037 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
2038 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
2039 bitset_count_, bitset_create, bitset_dump, bitset_first,
2040 bitset_free, bitset_init, bitset_last, bitset_next,
2041 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
2042 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
2043 bitset_print, bitset_release_memory, bitset_toggle_,
2044 bitset_type_choose, bitset_type_get, bitset_type_name_get,
2045 debug_bitset): Likewise.
2046 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
2047 * lib/bitset_stats.c (bitset_log_histogram_print,
2048 bitset_percent_histogram_print, bitset_stats_and,
2049 bitset_stats_and_cmp, bitset_stats_and_or,
2050 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
2051 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
2052 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
2053 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
2054 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
2055 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
2056 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
2057 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
2058 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
2059 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
2060 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
2061 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
2062 bitset_stats_zero): Likewise.
2063 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
2064 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
2065 bitsetv_dump, debug_bitsetv): Likewise.
2066 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
2067 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
2068 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
2069 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
2070 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
2071 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
2072 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
2073 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
2074 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
2075 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
2076 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
2077 Likewise.
2078 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
2079 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
2080 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
2081 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
2082 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
2083 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
2084 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
2085 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
2086 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
2087 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
2088 lbitset_xor_cmp, lbitset_zero): Likewise.
2089
20902002-10-14 Akim Demaille <akim@epita.fr>
2091
2092 Version 1.75.
2093
20942002-10-14 Akim Demaille <akim@epita.fr>
2095
2096 * tests/Makefile.am (maintainer-check-posix): New.
2097
20982002-10-14 Akim Demaille <akim@epita.fr>
2099
2100 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
2101 member.
2102
21032002-10-14 Akim Demaille <akim@epita.fr>
2104
2105 * src/tables.c (table_ninf_remap): base -> tab.
2106 Reported by Matt Rosing.
2107
21082002-10-14 Paul Eggert <eggert@twinsun.com>
2109
2110 * tests/action.at, tests/calc.at, tests/conflicts.at,
2111 tests/cxx-type.at, tests/headers.at, tests/input.at,
2112 tests/regression.at, tests/synclines.at, tests/torture.at:
2113 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
2114 so that the tests still work even if POSIXLY_CORRECT is set.
2115 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
2116
2117 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
2118 for portability to K&R hosts. Fix typo: signed char is guaranteed
2119 only to 127, not to 128.
2120 * data/glr.c (yysigned_char): New type.
2121 * data/yacc.c (yysigned_char): Likewise.
2122 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
2123
21242002-10-13 Paul Eggert <eggert@twinsun.com>
2125
2126 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
2127 true due to limited range of data type" warning from GCC.
2128
2129 * data/c.m4 (b4_token_defines): Protect against double-inclusion
2130 by wrapping enum yytokentype's definition inside #ifndef
2131 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
2132
21332002-10-13 Akim Demaille <akim@epita.fr>
2134
2135 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
2136 Un yy- yyrhs to avoid the name clash with the global YYRHS.
2137
21382002-10-13 Akim Demaille <akim@epita.fr>
2139
2140 * Makefile.maint: Update from Autoconf 2.54.
2141 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
2142
21432002-10-13 Akim Demaille <akim@epita.fr>
2144
2145 * src/print.c (print_state): Separate the list of solved conflicts
2146 from the other items.
2147 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
2148
21492002-10-13 Akim Demaille <akim@epita.fr>
2150
2151 Let nondeterministic skeletons be usable with deterministic
2152 tables.
2153
2154 With the patch, GAWK compiled by GCC without -O2 passes its test
2155 suite using a GLR parser driven by LALR tables. It fails with -O2
2156 because `struct stat' gives two different answers on my machine:
2157 88 (definition of an auto var) and later 96 (memset on this var).
2158 Hence the stack is badly corrumpted. The headers inclusion is to
2159 blame: if I move the awk.h inclusion before GLR's system header
2160 inclusion, the two struct stat have the same size.
2161
2162 * src/tables.c (pack_table): Always create conflict_table.
2163 (token_actions): Always create conflict_list.
2164 * data/glr.c (YYFLAG): Remove, unused.
2165
21662002-10-13 Akim Demaille <akim@epita.fr>
2167
2168 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
2169 (O0FLAGS): New.
2170 (VALGRIND, GXX): New.
2171 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
2172 * tests/bison.in: Run $PREBISON a pre-command.
2173 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
2174 (maintainer-check-g++): New.
2175 * Makefile.am (maintainer-check): New.
2176
21772002-10-13 Akim Demaille <akim@epita.fr>
2178
2179 * data/glr.c: Formatting changes.
2180 Tweak some trace messages to match yacc.c's.
2181
21822002-10-13 Akim Demaille <akim@epita.fr>
2183
2184 GLR parsers sometimes raise parse errors instead of performing the
2185 default reduction.
2186 Reported by Charles-Henry de Boysson.
2187
2188 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
2189 check the length of the traces when %glr.
2190 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
2191 GLR's traces.
2192 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
2193 Test GLR parsers.
2194 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
2195 (yyltype): Remove the yy prefix from the member names.
2196 (yytable): Complete its comment.
2197 (yygetLRActions): Map error action number from YYTABLE from
2198 YYTABLE_NINF to 0.
2199 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
2200 (which was a bug: it should have been YYTABEL_NINF, and yet it was
2201 not satisfying as we could compare an YYACTION computed from
2202 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
2203 only value for error actions.
2204 (yyreportParseError): In verbose parse error messages, don't issue
2205 `error' in the list of expected tokens.
2206 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
2207 next action to perform to match glr.c's decoding.
2208 (yytable): Complete its comment.
2209
22102002-10-13 Paul Eggert <eggert@twinsun.com>
2211
2212 Fix problem reported by Henrik Grubbstroem in
2213 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
2214 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
2215 because the Bison parser reads the second action before reducing
2216 the first one.
2217 * src/scan-gram.l (rule_length): New static var.
2218 Use it to keep track of the rule length in the scanner, since
2219 we can't expect the parser to be in lock-step sync with the scanner.
2220 (handle_action_dollar, handle_action_at): Use this var.
2221 * tests/actions.at (Exotic Dollars): Test for the problem.
2222
22232002-10-12 Paul Eggert <eggert@twinsun.com>
2224
2225 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
2226 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
2227 Include <sys/time.h> when checking for clock_t and struct tms.
2228 Use same include order as source.
2229 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
2230 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
2231
2232 * lib/timevar.c: Update copyright date and clarify comments.
2233 (get_time) [IN_GCC]: Keep the GCC version for reference.
2234
2235 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
2236 GCC version as of today, then merge Bison's changes.
2237 Change "GCC" to "Bison" in copyright notice. timevar.def's
2238 author is Akim, so change that too.
2239
2240 * src/reader.c (grammar_current_rule_check):
2241 Don't worry about the default action if $$ is untyped.
2242 Prevents bogus warnings reported by Jim Gifford in
2243 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
2244
2245 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
2246 * data/glr.c, data/lalr1.cc, data/yacc.c:
2247 Output token definitions before the first part of user declarations.
2248 Fixes compatibility problem reported by Jim Gifford for kbd in
2249 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
2250
22512002-10-11 Paul Eggert <eggert@twinsun.com>
2252
2253 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
2254 (yyparse): here. This undoes some of the 2002-07-25 change.
2255 Compatibility problem reported by Ralf S. Engelschall with
2256 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
2257
22582002-10-11 Akim Demaille <akim@epita.fr>
2259
2260 * tests/regression.at Characters Escapes): New.
2261 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
2262 characters.
2263 Reported by Jan Nieuwenhuizen.
2264
22652002-10-11 Akim Demaille <akim@epita.fr>
2266
2267 * po/id.po: New.
2268
22692002-10-10 Paul Eggert <eggert@twinsun.com>
2270
2271 Portability fixes for bitsets; this also avoids several GCC
2272 warnings.
2273
2274 * lib/abitset.c: Include <stddef.h>, for offsetof.
2275 * lib/lbitset.c: Likewise.
2276
2277 * lib/abitset.c (abitset_bytes): Return a size that is aligned
2278 properly for vectors of objects. Do not assume that adding a
2279 header size to a multiple of a word size yields a value that is
2280 properly aligned for the whole union.
2281 * lib/bitsetv.c (bitsetv_alloc): Likewise.
2282
2283 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
2284 unique names for structures.
2285 * lib/ebitset.c (ebitset_bytes): Likewise.
2286 * lib/lbitset.c (lbitset_bytes): Likewise.
2287
2288 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
2289 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
2290 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
2291 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
2292 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
2293 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
2294 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
2295 to improve the type-checking that GCC can do.
2296 * lib/bitset.c (bitset_op4_cmp): Likewise.
2297 * lib/bitset_stats.c (bitset_stats_count,
2298 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
2299 bitset_stats_copy, bitset_stats_disjoint_p,
2300 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
2301 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
2302 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
2303 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
2304 bitset_stats_and_or_cmp, bitset_stats_andn_or,
2305 bitset_stats_andn_or_cmp, bitset_stats_or_and,
2306 bitset_stats_or_and_cmp): Likewise.
2307 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
2308 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
2309 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
2310 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
2311
2312 * lib/abitset.h: Include bitset.h, not bbitset.h.
2313 * lib/ebitset.h: Likewise.
2314 * lib/lbitset.h: Likewise.
2315
2316 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
2317 All instances of parameters of type enum bitset_opts are now of
2318 type enum_bitset_opts, to conform to the C Standard, and similarly
2319 for enum_bitset_type.
2320 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
2321 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
2322
2323 Do not use "struct bitset_struct" to mean different things in
2324 different modules. Not only is this confusing, it violates
2325 the C Standard, which requires that structure types in different
2326 modules must be compatible if one is to be passed to the other.
2327 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
2328 All instances of "struct bitset_struct *" replaced with "bitset".
2329 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
2330 (union bitset_union, struct abitset_struct, struct ebitset_struct,
2331 struct lbitset_struct, struct bitset_stats_struct): New types.
2332 All uses of struct bitset_struct changed to union bitset_union,
2333 etc.
2334 * lib/abitset.c (struct abitset_struct, abitset,
2335 struct bitset_struct): Remove.
2336 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
2337 struct bitset_struct): Remove.
2338 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
2339 bitset_struct): Remove.
2340 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
2341 Likewise.
2342
2343 Do not call a function of type T using a call that assumes the
2344 function is of a different type U. Standard C requires that a
2345 function must be called with a type that is compatible with its
2346 definition.
2347 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
2348 New decls.
2349 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
2350 New functions.
2351 * lib/ebitset.c (PFV): Remove.
2352 * lib/lbitset.c (PFV): Likewise.
2353 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
2354 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
2355 decls.
2356 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
2357 (ebitset_vtable): Use them.
2358 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
2359 lbitset_xor): New functions.
2360 (lbitset_vtable): Use them.
2361
2362 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
2363 Declare.
2364
2365 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
2366 GCC warning.
2367 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
2368 Use offsetof, for simplicity.
2369
23702002-10-06 Paul Eggert <eggert@twinsun.com>
2371
2372 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
2373 the same width as int. This reapplies a hunk of the 2002-08-12 patch
2374 <http://mail.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
2375 which was inadvertently undone by the 2002-09-30 patch.
2376 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
2377 the same width as int.
2378
23792002-10-04 Paul Eggert <eggert@twinsun.com>
2380
2381 Version 1.50.
2382
2383 * configure.ac (AC_INIT), NEWS: Increment version number.
2384
2385 * doc/bison.texinfo: Minor spelling, grammar, and white space
2386 fixes.
2387 (Symbols): Mention that any negative value returned from yylex
2388 signifies end-of-input. Warn about negative chars. Mention
2389 the portable Standard C character set.
2390
2391 The GNU coding standard says CFLAGS and YFLAGS are reserved
2392 for the installer to set.
2393 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
2394 * src/Makefile.am (AM_CFLAGS): Likewise.
2395 (AM_YFLAGS): Renamed from YFLAGS.
2396
2397 Fix some MAX and MIN problems.
2398 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
2399 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
2400 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
2401 * src/reader.c (reader): Use it.
2402
2403 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
2404 POSIX 1003.1-2001 has removed fgrep.
2405
24062002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
2407
2408 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
2409 interpreted as signed.
2410 * lib/ebitset.c (ebitset_list): Fix bug.
2411
24122002-10-01 Paul Eggert <eggert@twinsun.com>
2413
2414 More fixes for 64-bit hosts and large bitsets.
2415
2416 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
2417 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
2418 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
2419 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
2420 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
2421 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
2422 bitset_count_): Likewise.
2423 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
2424 bitset_first, bitset_last): Likewise.
2425 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
2426 bitset_stats_list_reverse, bitset_stats_size,
2427 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
2428 Likewise.
2429 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
2430 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
2431 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
2432 bitsetv_reflexive_transitive_closure): Likewise.
2433 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
2434 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
2435 Likewise.
2436 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
2437 Likewise.
2438
2439 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
2440 Use size_t, not unsigned int, to count bytes.
2441 * lib/abitset.h (abitset_bytes): Likewise.
2442 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
2443 Likewise.
2444 * lib/bitset.h (bitset_bytes): Likewise.
2445 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
2446 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
2447 * lib/bitsetv.c (bitsetv_alloc): Likewise.
2448 * lib/ebitset.c (ebitset_bytes): Likewise.
2449 * lib/ebitset.h (ebitset_bytes): Likewise.
2450 * lib/lbitset.c (lbitset_bytes): Likewise.
2451 * lib/lbitset.h (lbitset_bytes): Likewise.
2452
2453 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
2454 abitset_subset_p, abitset_disjoint_p, abitset_and,
2455 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
2456 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
2457 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
2458 abitset_or_and, abitset_or_and_cmp):
2459 Use bitset_windex instead of unsigned int.
2460 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
2461 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
2462 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
2463 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
2464 Likewise.
2465 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
2466
2467 * lib/bitset.c (bitset_print):
2468 Use proper printf formats for widths of integer types.
2469 * lib/bitset_stats.c (bitset_percent_histogram_print,
2470 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
2471 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
2472 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
2473 * lib/lbitset.c (lbitset_bytes): Likewise.
2474
2475 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
2476 BITSET_SIZE_MAX): New macros.
2477 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
2478 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
2479 to BITSET_WINDEX_MAX.
2480
2481 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
2482 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
2483 since we now return the bitset_bindex type (not int).
2484
2485 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
2486 when computing sizes.
2487 * lib/ebitset.c (ebitset_elts_grow): Likewise.
2488
2489 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
2490 and avoid cast to unsigned.
2491
24922002-09-30 Akim Demaille <akim@epita.fr>
2493
2494 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
2495 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
2496 Updates from Michael Hayes.
2497
24982002-09-30 Art Haas <ahaas@neosoft.com>
2499
2500 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
2501 invocations.
2502 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
2503 defined.
2504
25052002-09-27 Akim Demaille <akim@epita.fr>
2506
2507 Version 1.49c.
2508
25092002-09-27 Akim Demaille <akim@epita.fr>
2510
2511 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
2512 (Because of AC_LIBSOURCE).
2513
25142002-09-27 Akim Demaille <akim@epita.fr>
2515
2516 Playing with Autoscan.
2517
2518 * configure.ac: Remove the old LIBOBJ tweaks.
2519 (AC_REPLACE_FUNCS): Add strrchr and strtol.
2520 * lib/strrchr.c: New.
2521 * lib/strtol.c: New, from the Coreutils 4.5.1.
2522
25232002-09-27 Akim Demaille <akim@epita.fr>
2524
2525 Playing with Autoscan.
2526
2527 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
2528 * lib/Makefile.am (libbison_a_SOURCES): No longer include
2529 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
2530 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
2531 Coreutils 4.5.1.
2532
25332002-09-24 Akim Demaille <akim@epita.fr>
2534
2535 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
2536 (Frequently Asked Questions, Parser Stack Overflow): New.
2537
25382002-09-13 Akim Demaille <akim@epita.fr>
2539
2540 Playing with autoscan.
2541
2542 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
2543 * src/files.c (skeleton_find): Remove, unused.
2544 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
2545 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
2546
25472002-09-13 Akim Demaille <akim@epita.fr>
2548
2549 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
2550 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
2551
25522002-09-13 Akim Demaille <akim@epita.fr>
2553
2554 * configure.ac: Require 2.54.
2555 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
2556 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
2557 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
2558 Remove, provided by Autoconf macros.
2559
25602002-09-12 Akim Demaille <akim@epita.fr>
2561
2562 * m4/prereq.m4: Update, from Coreutils 4.5.1.
2563
25642002-09-12 Akim Demaille <akim@epita.fr>
2565
2566 * m4/prereq.m4: Update, from Fileutils 4.1.5.
2567 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
2568 Reported by Martin Mokrejs.
2569
25702002-09-10 Akim Demaille <akim@epita.fr>
2571
2572 * src/parse-gram.y: Associate a human readable string to each
2573 token type.
2574 * tests/regression.at (Invalid inputs): Adjust.
2575
25762002-09-10 Gary V. Vaughan <gary@gnu.org>
2577
2578 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
2579 with an Autoconf-2.5x style configure.ac.
2580
25812002-09-06 Paul Eggert <eggert@twinsun.com>
2582
2583 * doc/bison.texinfo (Conditions): Make explicit that the GPL
2584 exception applies only to yacc.c. This is a modification of a
2585 patch originally suggested by Akim Demaille.
2586
25872002-09-06 Akim Demaille <akim@epita.fr>
2588
2589 * data/c.m4 (b4_copyright): Move the GPL exception comment from
2590 here to...
2591 * data/yacc.c: here.
2592
2593 * data/lalr1.cc (struct yyltype): Don't define it, since we use
2594 LocationType.
2595 (b4_ltype): Default to yy::Location from location.hh.
2596
25972002-09-04 Jim Meyering <jim@meyering.net>
2598
2599 * data/yacc.c: Guard the declaration of yytoknum also with
2600 `#ifdef YYPRINT', so it is declared only when used.
2601
26022002-09-04 Akim Demaille <akim@epita.fr>
2603
2604 * configure.in: Rename as...
2605 * configure.ac: this.
2606 Bump to 1.49c.
2607
26082002-09-04 Akim Demaille <akim@epita.fr>
2609
2610 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
2611 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
2612 translate maintainer only messages.
2613
26142002-08-12 Paul Eggert <eggert@twinsun.com>
2615
2616 Version 1.49b.
2617
2618 * Makefile.am (SUBDIRS): Remove intl.
2619 (DISTCLEANFILES): Remove.
2620 * NEWS: Mention that GNU M4 is now required. Clarify what is
2621 meant by "larger grammars". Mention the pt_BR translation.
2622 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
2623 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
2624 Bump version from 0.11.2 to 0.11.5.
2625 (BISON_PREREQ_STAGE): Remove.
2626 (AM_GNU_GETTEXT): Use external gettext.
2627 (AC_OUTPUT): Remove intl/Makefile.
2628
2629 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
2630
2631 * data/glr.c: Include string.h, for strlen.
2632 (yyreportParseError): Use size_t for yysize.
2633 (yy_yypstack): No longer nested inside yypstates, as nested
2634 functions are not portable. Do not assume size_t is the
2635 same width as int.
2636 (yypstates): Do not assume that ptrdiff_t is the same width
2637 as int, and similarly for yyposn and YYINDEX.
2638
2639 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
2640
2641 * lib/Makefile.am (INCLUDES): Do not include from the intl
2642 directory, which has been removed.
2643 * src/Makefile.am (INCLUDES): Likewise.
2644
2645 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
2646 (bitsets_sources, additional_bitsets_sources, timevars_sources):
2647 New vars.
2648
2649 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
2650 * tests/Makefile.am (EXTRA_DIST): Likewise.
2651
2652 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
2653 Do not assume that bitset_windex is the same width as unsigned.
2654
2655 * lib/abitset.c (abitset_unused_clear): Do not assume that
2656 bitset_word is the same width as int.
2657 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
2658 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
2659 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
2660 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
2661 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
2662
2663 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
2664 portability to one's complement hosts!).
2665 * lib/ebitset.c (ebitset_op1): Likewise.
2666 * lib/lbitset.c (lbitset_op1): Likewise.
2667
2668 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
2669 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
2670 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
2671 Sync with fileutils.
2672 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
2673 lib/gettext.h: Sync with diffutils.
2674
2675 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
2676 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
2677
2678 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
2679 PROTOTYPES to check for prototypes, and "defined __STDC__" to
2680 check for void *.
2681
2682 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
2683 size_t; the old version tried to do this but casted improperly.
2684 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
2685 (bitset_test): Now returns int, not unsigned long.
2686
2687 * lib/bitset_stats.c: Include "gettext.h".
2688 (_): New macro.
2689 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
2690 name locals "index", as it generates unnecessary warnings on some
2691 hosts that have an "index" function.
2692
2693 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
2694 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
2695 they need translation.
2696 * src/LR0.c (state_list_append, new_itemsets, get_state,
2697 append_states, generate_states): Likewise.
2698 * src/assoc.c (assoc_to_string): Likewise.
2699 * src/closure.c (print_closure, set_firsts, closure): Likewise.
2700 * src/gram.c (grammar_dump): Likewise.
2701 * src/injections.c (injections_compute): Likewise.
2702 * src/lalr.c (lookaheads_print): Likewise.
2703 * src/relation.c (relation_transpose): Likewise.
2704 * src/scan-gram.l: Likewise.
2705 * src/tables.c (table_grow, pack_vector): Likewise.
2706
2707 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
2708 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
2709 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
2710 * m4/mbstate_t.m4: Sync with fileutils.
2711 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
2712
2713 * po/LINGUAS: Add pt_BR.
2714 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
2715 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
2716 lib/timevar.c.
2717 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
2718 manual recommends.
2719 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
2720
2721 * src/complain.c (strerror_r): Remove decl; not needed.
2722 (strerror): Use same pattern as ../lib/error.c.
2723
2724 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
2725
2726 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
2727
2728 * src/main.c (main): Cast result of bindtextdomain and textdomain
2729 to void, to avoid a GCC warning when --disable-nls is in effect.
2730
2731 * src/scan-gram.l: Use strings rather than escapes when possible,
2732 to minimize the number of warnings from xgettext.
2733 (handle_action_dollar, handle_action_at): Don't use isdigit,
2734 as it mishandles negative chars and it may not work as expected
2735 outside the C locale.
2736
2737 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
2738 this is a GCC extension and is not portable to other compilers.
2739
2740 * src/system.h (alloca): Use same pattern as ../lib/error.c.
2741 Do not include <ctype.h>; no longer needed.
2742 Do not include <malloc.h>; no longer needed (and generates
2743 warnings on OpenBSD 3.0).
2744
2745 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
2746 it's not portable.
2747
2748 * tests/regression.at: Do not use 'cc -c input.c -o input';
2749 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
2750
2751 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
2752 exit status as failure, not just exit status 1. Sun C exits
2753 with status 2 sometimes.
2754
2755 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
2756 Use it for the two large tests.
2757
27582002-08-02 Akim Demaille <akim@epita.fr>
2759
2760 * src/conflicts.c (conflicts_output): Don't output rules never
2761 reduced here, since anyway that computation doesn't work.
2762 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
2763 (rule_useless_p, rule_never_reduced_p): New.
2764 (grammar_rules_partial_print): Use a filter instead of a range.
2765 Display the title only if needed.
2766 (grammar_rules_print): Adjust.
2767 (grammar_rules_never_reduced_report): New.
2768 * src/tables.c (action_row): Move the computation of rules never
2769 reduced to...
2770 (token_actions): here.
2771 * src/main.c (main): Make the parser before making the report, so
2772 that rules never reduced are computed.
2773 Call grammar_rules_never_reduced_report.
2774 * src/print.c (print_results): Report rules never reduced.
2775 * tests/conflicts.at, tests/reduce.at: Adjust.
2776
27772002-08-01 Akim Demaille <akim@epita.fr>
2778
2779 Instead of attaching lookaheads and duplicating the rules being
2780 reduced by a state, attach the lookaheads to the reductions.
2781
2782 * src/state.h (state_t): Remove the `lookaheads',
2783 `lookaheads_rule' member.
2784 (reductions_t): Add a `lookaheads' member.
2785 Use a regular array for the `rules'.
2786 * src/state.c (reductions_new): Initialize the lookaheads member
2787 to 0.
2788 (state_rule_lookaheads_print): Adjust.
2789 * src/state.h, src/state.c (state_reductions_find): New.
2790 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
2791 (count_rr_conflicts): Adjust.
2792 * src/lalr.c (LArule): Remove.
2793 (add_lookback_edge): Adjust.
2794 (state_lookaheads_count): New.
2795 (states_lookaheads_initialize): Merge into...
2796 (initialize_LA): this.
2797 (lalr_free): Adjust.
2798 * src/main.c (main): Don't free nullable and derives too early: it
2799 is used by --verbose.
2800 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
2801
28022002-08-01 Akim Demaille <akim@epita.fr>
2803
2804 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
2805 `rule_number_t**'.
2806 (set_derives, free_derives): Rename as...
2807 (derives_compute, derives_free): this.
2808 Adjust all dependencies.
2809 * src/nullable.c (set_nullable, free_nullable): Rename as...
2810 (nullable_compute, nullable_free): these.
2811 (rule_list_t): Store rule_t *, not rule_number_t.
2812 * src/state.c (state_rule_lookaheads_print): Directly compare rule
2813 pointers, instead of their numbers.
2814 * src/main.c (main): Call nullable_free, and derives_free earlier,
2815 as they were lo longer used.
2816
28172002-08-01 Akim Demaille <akim@epita.fr>
2818
2819 * lib/timevar.c (get_time): Include children time.
2820 * src/lalr.h (LA, LArule): Don't export them: used with the
2821 state_t.
2822 * src/lalr.c (LA, LArule): Static.
2823 * src/lalr.h, src/lalr.c (lalr_free): New.
2824 * src/main.c (main): Call it.
2825 * src/tables.c (pack_vector): Check whether loc is >= to the
2826 table_size, not >.
2827 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
2828 (tables_generate): do it, since that's also it which allocates
2829 them.
2830 Don't free LA and LArule, main does.
2831
28322002-07-31 Akim Demaille <akim@epita.fr>
2833
2834 Separate parser tables computation and output.
2835
2836 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
2837 (conflict_list, conflict_list_cnt, table, check, table_ninf)
2838 (yydefgoto, yydefact, high): Move to...
2839 * src/tables.h, src/tables.c: here.
2840 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
2841 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
2842 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
2843 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
2844 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
2845 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
2846 (action_row, save_row, token_actions, save_column, default_goto)
2847 (goto_actions, sort_actions, matching_state, pack_vector)
2848 (table_ninf_remap, pack_table, prepare_actions): Move to...
2849 * src/tables.c: here.
2850 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
2851 * src/output.c (token_actions, output_base, output_conflicts)
2852 (output_check): Merge into...
2853 (prepare_actions): this.
2854 (actions_output): Rename as...
2855 (user_actions_output): this.
2856 * src/main.c (main): Call tables_generate and tables_free.
2857
28582002-07-31 Akim Demaille <akim@epita.fr>
2859
2860 Steal GCC's --time-report support.
2861
2862 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
2863 stolen/adjusted from GCC.
2864 * m4/stage.m4: Remove time related checks.
2865 * m4/timevar.m4: New.
2866 * configure.in: Adjust.
2867 * src/system.h: Adjust to using timevar.h.
2868 * src/getargs.h, src/getargs.c: Support trace_time for
2869 --trace=time.
2870 * src/main.c (stage): Remove.
2871 (main): Replace `stage' invocations with timevar calls.
2872 * src/output.c: Insert pertinent timevar calls.
2873
28742002-07-31 Akim Demaille <akim@epita.fr>
2875
2876 Let --trace have arguments.
2877
2878 * src/getargs.h (enum trace_e): New.
2879 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
2880 (long_options, short_options): --trace/-T takes an optional
2881 argument.
2882 Change all the uses of trace_flag to reflect the new flags.
2883 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
2884
2885 Strengthen `stage' portability.
2886
2887 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
2888 * configure.in: Use it.
2889 Don't check for malloc.h and sys/times.h.
2890 * src/system.h: Include them when appropriate.
2891 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
2892 times and struct tms are available.
2893
28942002-07-30 Akim Demaille <akim@epita.fr>
2895
2896 In verbose parse error message, don't report `error' as an
2897 expected token.
2898 * tests/actions.at (Printers and Destructors): Adjust.
2899 * tests/calc.at (Calculator $1): Adjust.
2900 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
2901 error message, do not report the parser accepts the error token in
2902 that state.
2903
29042002-07-30 Akim Demaille <akim@epita.fr>
2905
2906 Normalize conflict related messages.
2907
2908 * src/complain.h, src/complain.c (warn, complain): New.
2909 * src/conflicts.c (conflicts_print): Use them.
2910 (conflict_report_yacc): New, extracted from...
2911 (conflicts_print): here.
2912 * tests/conflicts.at, tests/existing.at: Adjust.
2913
29142002-07-30 Akim Demaille <akim@epita.fr>
2915
2916 Report rules which are never reduced by the parser: those hidden
2917 by conflicts.
2918
2919 * src/LR0.c (save_reductions): Don't make the final state too
2920 different: save its reduction (accept) instead of having a state
2921 without any action (no shift or goto, no reduce).
2922 Note: the final state is now a ``regular'' state, i.e., the
2923 parsers now contain `reduce 0' as default reduction.
2924 Nevertheless, since they decide to `accept' when yystate =
2925 final_state, they still will not reduce rule 0.
2926 * src/print.c (print_actions, print_reduction): Adjust.
2927 * src/output.c (action_row): Track reduced rules.
2928 (token_actions): Report rules never reduced.
2929 * tests/conflicts.at, tests/regression.at: Adjust.
2930
29312002-07-30 Akim Demaille <akim@epita.fr>
2932
2933 `stage' was accidently included in a previous patch.
2934 Initiate its autoconfiscation.
2935
2936 * configure.in: Look for malloc.h and sys/times.h.
2937 * src/main.c (stage): Adjust.
2938 Report only when trace_flag.
2939
29402002-07-29 Akim Demaille <akim@epita.fr>
2941
2942 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
2943 state_number_t.
2944 (errs_t): symbol_t*, not symbol_number_t.
2945 (reductions_t): rule_t*, not rule_number_t.
2946 (FOR_EACH_SHIFT): New.
2947 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
2948 * src/print.c, src/print_graph.c: Adjust.
2949
29502002-07-29 Akim Demaille <akim@epita.fr>
2951
2952 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
2953
2954 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
2955 (endtoken, accept): these.
2956 * src/reader.c (reader): Set endtoken's default tag to "$end".
2957 Set undeftoken's tag to "$undefined" instead of "$undefined.".
2958 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
2959 Adjust.
2960
29612002-07-29 Akim Demaille <akim@epita.fr>
2962
2963 * src/reduce.c (reduce_grammar): When the language is empty,
2964 complain about the start symbol, not the axiom.
2965 Use its location.
2966 * tests/reduce.at (Empty Language): New.
2967
29682002-07-26 Akim Demaille <akim@epita.fr>
2969
2970 * src/reader.h, src/reader.c (gram_error): ... can't get
2971 yycontrol without making too strong assumptions on the parser
2972 itself.
2973 * src/output.c (prepare_tokens): Use the real 0th value of
2974 token_translations instead of `0'.
2975 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
2976 visible here.
2977 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
2978 for the time being: %locations ought to provide it to yyerror.
2979
29802002-07-25 Akim Demaille <akim@epita.fr>
2981
2982 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
2983 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
2984 * tests/regression.at (Web2c Actions): Adjust.
2985
29862002-07-25 Akim Demaille <akim@epita.fr>
2987
2988 Stop storing rules from 1 to nrules + 1.
2989
2990 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
2991 * src/nullable.c, src/output.c, src/print.c, src/reader.c
2992 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
2993 Iterate from 0 to nrules.
2994 Use rule_number_as_item_number and item_number_as_rule_number.
2995 Adjust to `derive' now containing possibly 0.
2996 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
2997 Handle the `- 1' part in rule numbers from/to item numbers.
2998 * src/conflicts.c (log_resolution): Fix the message which reversed
2999 shift and reduce.
3000 * src/output.c (action_row): Initialize default_rule to -1.
3001 (token_actions): Adjust.
3002 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
3003 expected output.
3004 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
3005
30062002-07-25 Akim Demaille <akim@epita.fr>
3007
3008 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
3009 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
3010 (b4_c_knr_arg_decl): New.
3011 * data/yacc.c: Use it to define yysymprint, yydestruct, and
3012 yyreport_parse_error.
3013
30142002-07-25 Akim Demaille <akim@epita.fr>
3015
3016 * data/yacc.c (yyreport_parse_error): New, extracted from...
3017 (yyparse): here.
3018 (yydestruct, yysymprint): Move above yyparse.
3019 Be K&R compliant.
3020
30212002-07-25 Akim Demaille <akim@epita.fr>
3022
3023 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
3024 replace...
3025 (b4_sint_type, b4_uint_type): these.
3026 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
3027 * tests/regression.at (Web2c Actions): Adjust.
3028
30292002-07-25 Akim Demaille <akim@epita.fr>
3030
3031 * src/gram.h (TIEM_NUMBER_MAX): New.
3032 (item_number_of_rule_number, rule_number_of_item_number): Rename
3033 as...
3034 (rule_number_as_item_number, item_number_as_rule_number): these.
3035 Adjust dependencies.
3036 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
3037 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
3038 (symbol_number_to_vector_number): New.
3039 (order): Of vector_number_t* type.
3040 (base_t, BASE_MAX, BASE_MIN): New.
3041 (froms, tos, width, pos, check): Of base_t type.
3042 (action_number_t, ACTION_MIN, ACTION_MAX): New.
3043 (actrow): Of action_number_t type.
3044 (conflrow): Of unsigned int type.
3045 (table_ninf, base_ninf): New.
3046 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
3047 (muscle_insert_int_table, muscle_insert_base_table)
3048 (muscle_insert_rule_number_table): New.
3049 (prepare_tokens): Output `toknum' as int_table.
3050 (action_row): Returns a rule_number_t.
3051 Use ACTION_MIN, not SHRT_MIN.
3052 (token_actions): yydefact is rule_number_t*.
3053 (table_ninf_remap): New.
3054 (pack_table): Use it for `base' and `table'.
3055 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
3056 replaced with...
3057 (YYPACT_NINF, YYTABLE_NINF): these.
3058 (yypact, yytable): Compute their types instead of hard-coded
3059 `short'.
3060 * tests/regression.at (Web2c Actions): Adjust.
3061
30622002-07-19 Akim Demaille <akim@epita.fr>
3063
3064 * src/scan-gram.l (id): Can start with an underscore.
3065
30662002-07-16 Akim Demaille <akim@epita.fr>
3067
3068 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
3069 Adjust all former `associativity' dependencies.
3070 * src/symtab.c (symbol_new): Default associativity is `undef', not
3071 `right'.
3072 (symbol_check_alias_consistence): Adjust.
3073
30742002-07-09 Akim Demaille <akim@epita.fr>
3075
3076 * doc/bison.texinfo: Properly set the ``header'' part.
3077 Use @dircategory ``GNU programming tools'' as per Texinfo's
3078 documentation.
3079 Use @copying.
3080
30812002-07-09 Akim Demaille <akim@epita.fr>
3082
3083 * lib/quotearg.h: Protect against multiple inclusions.
3084 * src/location.h (location_t): Add a `file' member.
3085 (LOCATION_RESET, LOCATION_PRINT): Adjust.
3086 * src/complain.c (warn_at, complain_at, fatal_at): Drop
3087 `error_one_per_line' support.
3088
30892002-07-09 Akim Demaille <akim@epita.fr>
3090
3091 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
3092 * src/reader.c (lineno): Remove.
3093 Adjust all dependencies.
3094 (get_merge_function): Take a location and use complain_at.
3095 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
3096 * tests/regression.at (Invalid inputs, Mixing %token styles):
3097 Adjust.
3098
30992002-07-09 Akim Demaille <akim@epita.fr>
3100
3101 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
3102 recovery rule, and forbid extensions when --yacc.
3103 (gram_error): Use complain_at.
3104 * src/reader.c (reader): Exit if there were parse errors.
3105
31062002-07-09 Akim Demaille <akim@epita.fr>
3107
3108 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
3109 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
3110 Reported by R Blake <blakers@mac.com>.
3111
31122002-07-09 Akim Demaille <akim@epita.fr>
3113
3114 * data/yacc.c: Output the copyright notive in the header.
3115
31162002-07-03 Akim Demaille <akim@epita.fr>
3117
3118 * src/output.c (froms, tos): Are state_number_t.
3119 (save_column): sp, sp1, and sp2 are state_number_t.
3120 (prepare): Rename `final' as `final_state_number', `nnts' as
3121 `nterms_number', `nrules' as `rules_number', `nstates' as
3122 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
3123 unused.
3124 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
3125 * data/lalr1.cc (nsym_): Remove, unused.
3126
31272002-07-03 Akim Demaille <akim@epita.fr>
3128
3129 * src/lalr.h, src/lalr.c (goto_number_t): New.
3130 * src/lalr.c (goto_list_t): New.
3131 Propagate them.
3132 * src/nullable.c (rule_list_t): New.
3133 Propagate.
3134 * src/types.h: Remove.
3135
31362002-07-03 Akim Demaille <akim@epita.fr>
3137
3138 * src/closure.c (print_fderives): Use rule_rhs_print.
3139 * src/derives.c (print_derives): Use rule_rhs_print.
3140 (rule_list_t): New, replaces `shorts'.
3141 (set_derives): Add comments.
3142 * tests/sets.at (Nullable, Firsts): Adjust.
3143
31442002-07-03 Akim Demaille <akim@epita.fr>
3145
3146 * src/output.c (prepare_actions): Free `tally' and `width'.
3147 (prepare_actions): Allocate and free `order'.
3148 * src/symtab.c (symbols_free): Free `symbols'.
3149 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
3150 * src/output.c (m4_invoke): Move to...
3151 * src/scan-skel.l: here.
3152 (<<EOF>>): Close yyout, and free its name.
3153
31542002-07-03 Akim Demaille <akim@epita.fr>
3155
3156 Fix some memory leaks, and fix a bug: state 0 was examined twice.
3157
3158 * src/LR0.c (new_state): Merge into...
3159 (state_list_append): this.
3160 (new_states): Merge into...
3161 (generate_states): here.
3162 (set_states): Don't ensure a proper `errs' state member here, do it...
3163 * src/conflicts.c (conflicts_solve): here.
3164 * src/state.h, src/state.c: Comment changes.
3165 (state_t): Rename member `shifts' as `transitions'.
3166 Adjust all dependencies.
3167 (errs_new): For consistency, also take the values as argument.
3168 (errs_dup): Remove.
3169 (state_errs_set): New.
3170 (state_reductions_set, state_transitions_set): Assert that no
3171 previous value was assigned.
3172 (state_free): New.
3173 (states_free): Use it.
3174 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
3175 temporary storage: use `errs' and `nerrs' as elsewhere.
3176 (set_conflicts): Allocate and free this `errs'.
3177
31782002-07-02 Akim Demaille <akim@epita.fr>
3179
3180 * lib/libiberty.h: New.
3181 * lib: Update the bitset implementation from upstream.
3182 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
3183 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
3184 * src/main.c: Adjust bitset stats calls.
3185
31862002-07-01 Paul Eggert <eggert@twinsun.com>
3187
3188 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
3189 char, so that negative chars don't collide with $.
3190
31912002-06-30 Akim Demaille <akim@epita.fr>
3192
3193 Have the GLR tests be `warning' checked, and fix the warnings.
3194
3195 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
3196 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
3197 (yyremoveDeletes): `yyi' and `yyj' are size_t.
3198 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
3199 (yyaddDeferredAction): static.
3200 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
3201 (yyreportParseError): yyprefix is const.
3202 yytokenp is used only when verbose.
3203 (yy__GNUC__): Replace with __GNUC__.
3204 (yypdumpstack): yyi is size_t.
3205 (yypreference): Un-yy local variables and arguments, to avoid
3206 clashes with `yyr1'. Anyway, we are not in the user name space.
3207 (yytname_size): be an int, as is compared with ints.
3208 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
3209 Use them.
3210 * tests/cxx-gram.at: Use quotation to protect $1.
3211 Use AT_COMPILE to enable warnings hunts.
3212 Prototype yylex and yyerror.
3213 `Use' argc.
3214 Include `string.h', not `strings.h'.
3215 Produce and prototype stmtMerge only when used.
3216 yylex takes a location.
3217
32182002-06-30 Akim Demaille <akim@epita.fr>
3219
3220 We spend a lot of time in quotearg, in particular when --verbose.
3221
3222 * src/symtab.c (symbol_get): Store a quoted version of the key.
3223 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
3224 Adjust all callers.
3225
32262002-06-30 Akim Demaille <akim@epita.fr>
3227
3228 * src/state.h (reductions_t): Rename member `nreds' as num.
3229 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
3230 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
3231
32322002-06-30 Akim Demaille <akim@epita.fr>
3233
3234 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
3235 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
3236 (shifts_to): Rename as...
3237 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
3238 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
3239 (TRANSITION_IS_DISABLED, transitions_to): these.
3240
32412002-06-30 Akim Demaille <akim@epita.fr>
3242
3243 * src/print.c (print_shifts, print_gotos): Merge into...
3244 (print_transitions): this.
3245 (print_transitions, print_errs, print_reductions): Align the
3246 lookaheads columns.
3247 (print_core, print_transitions, print_errs, print_state,
3248 print_grammar): Output empty lines separator before, not after.
3249 (state_default_rule_compute): Rename as...
3250 (state_default_rule): this.
3251 * tests/conflicts.at (Defaulted Conflicted Reduction),
3252 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
3253 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
3254
32552002-06-30 Akim Demaille <akim@epita.fr>
3256
3257 Display items as we display rules.
3258
3259 * src/gram.h, src/gram.c (rule_lhs_print): New.
3260 * src/gram.c (grammar_rules_partial_print): Use it.
3261 * src/print.c (print_core): Likewise.
3262 * tests/conflicts.at (Defaulted Conflicted Reduction),
3263 (Unresolved SR Conflicts): Adjust.
3264 (Unresolved SR Conflicts): Adjust and rename as...
3265 (Resolved SR Conflicts): this, as was meant.
3266 * tests/regression.at (Web2c Report): Adjust.
3267
32682002-06-30 Akim Demaille <akim@epita.fr>
3269
3270 * src/print.c (state_default_rule_compute): New, extracted from...
3271 (print_reductions): here.
3272 Pessimize, but clarify the code.
3273 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
3274
32752002-06-30 Akim Demaille <akim@epita.fr>
3276
3277 * src/output.c (action_row): Let default_rule be always a rule
3278 number.
3279
32802002-06-30 Akim Demaille <akim@epita.fr>
3281
3282 * src/closure.c (print_firsts, print_fderives, closure):
3283 Use BITSET_EXECUTE.
3284 * src/lalr.c (lookaheads_print): Likewise.
3285 * src/state.c (state_rule_lookaheads_print): Likewise.
3286 * src/print_graph.c (print_core): Likewise.
3287 * src/print.c (print_reductions): Likewise.
3288 * src/output.c (action_row): Likewise.
3289 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
3290
32912002-06-30 Akim Demaille <akim@epita.fr>
3292
3293 * src/print_graph.c: Use report_flag.
3294
32952002-06-30 Akim Demaille <akim@epita.fr>
3296
3297 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
3298 to...
3299 * src/relation.h, src/relation.c (traverse, relation_digraph)
3300 (relation_print, relation_transpose): New.
3301
33022002-06-30 Akim Demaille <akim@epita.fr>
3303
3304 * src/state.h, src/state.c (shifts_to): New.
3305 * src/lalr.c (build_relations): Use it.
3306
33072002-06-30 Akim Demaille <akim@epita.fr>
3308
3309 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
3310 (item_number_of_rule_number, rule_number_of_item_number): New.
3311 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
3312 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
3313 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
3314 Propagate their use.
3315 Much remains to be done, in particular wrt `shorts' from types.h.
3316
33172002-06-30 Akim Demaille <akim@epita.fr>
3318
3319 * src/symtab.c (symbol_new): Initialize the `printer' member.
3320
33212002-06-30 Akim Demaille <akim@epita.fr>
3322
3323 * src/LR0.c (save_reductions): Remove, replaced by...
3324 * src/state.h, src/state.c (state_reductions_set): New.
3325 (reductions, errs): Rename as...
3326 (reductions_t, errs_t): these.
3327 Adjust all dependencies.
3328
33292002-06-30 Akim Demaille <akim@epita.fr>
3330
3331 * src/LR0.c (state_list_t, state_list_append): New.
3332 (first_state, last_state): Now symbol_list_t.
3333 (this_state): Remove.
3334 (new_itemsets, append_states, save_reductions): Take a state_t as
3335 argument.
3336 (set_states, generate_states): Adjust.
3337 (save_shifts): Remove, replaced by...
3338 * src/state.h, src/state.c (state_shifts_set): New.
3339 (shifts): Rename as...
3340 (shifts_t): this.
3341 Adjust all dependencies.
3342 * src/state.h (state_t): Remove the `next' member.
3343
33442002-06-30 Akim Demaille <akim@epita.fr>
3345
3346 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
3347 escaped in slot 0.
3348
33492002-06-30 Akim Demaille <akim@epita.fr>
3350
3351 Use hash.h for the state hash table.
3352
3353 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
3354 (allocate_storage): Use state_hash_new.
3355 (free_storage): Use state_hash_free.
3356 (new_state, get_state): Adjust.
3357 * src/lalr.h, src/lalr.c (states): Move to...
3358 * src/states.h (state_t): Remove the `link' member, no longer
3359 used.
3360 * src/states.h, src/states.c: here.
3361 (state_hash_new, state_hash_free, state_hash_lookup)
3362 (state_hash_insert, states_free): New.
3363 * src/states.c (state_table, state_compare, state_hash): New.
3364 * src/output.c (output_actions): Do not free states now, since we
3365 still need to know the final_state number in `prepare', called
3366 afterwards. Do it...
3367 * src/main.c (main): here: call states_free after `output'.
3368
33692002-06-30 Akim Demaille <akim@epita.fr>
3370
3371 * src/state.h, src/state.c (state_new): New, extracted from...
3372 * src/LR0.c (new_state): here.
3373 * src/state.h (STATE_ALLOC): Move to...
3374 * src/state.c: here.
3375 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
3376 * src/state.h, src/state.c: here.
3377
33782002-06-30 Akim Demaille <akim@epita.fr>
3379
3380 * src/reader.c (gensym): Rename as...
3381 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
3382 (getsym): Rename as...
3383 (symbol_get): this.
3384
33852002-06-30 Akim Demaille <akim@epita.fr>
3386
3387 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
3388 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
3389 * src/output.c, src/print.c, src/print_graph.c: Propagate.
3390 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
3391
33922002-06-30 Akim Demaille <akim@epita.fr>
3393
3394 Make the test suite pass with warnings checked.
3395
3396 * tests/actions.at (Printers and Destructors): Improve.
3397 Avoid unsigned vs. signed issues.
3398 * tests/calc.at: Don't exercise the scanner here, do it...
3399 * tests/input.at (Torturing the Scanner): here.
3400
34012002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3402
3403 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
3404 reorganize first lines parallel to yacc.c.
3405
34062002-06-28 Akim Demaille <akim@epita.fr>
3407
3408 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
3409 (b4_token_enum, b4_token_defines): New, factored from...
3410 * data/lalr1.cc, data/yacc.c, glr.c: here.
3411
34122002-06-28 Akim Demaille <akim@epita.fr>
3413
3414 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
3415 unused variables.
3416 * src/output.c (merger_output): static.
3417
34182002-06-28 Akim Demaille <akim@epita.fr>
3419
3420 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
3421 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
3422 pacify GCC.
3423 * src/output.c (save_row): Initialize all the variables to pacify GCC.
3424
34252002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3426
3427 Accumulated changelog for new GLR parsing features.
3428
3429 * src/conflicts.c (count_total_conflicts): Change name to
3430 conflicts_total_count.
3431 * src/conflicts.h: Ditto.
3432 * src/output.c (token_actions): Use the new name.
3433 (output_conflicts): Change conflp => conflict_list_heads, and
3434 confl => conflict_list for better readability.
3435 * data/glr.c: Use the new names.
3436 * NEWS: Add self to GLR announcement.
3437
3438 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
3439
3440 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
3441 Akim Demaille.
3442
3443 * data/bison.glr: Change name to glr.c
3444 * data/glr.c: Renamed from bison.glr.
3445 * data/Makefile.am: Add glr.c
3446
3447 * src/getargs.c:
3448
3449 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
3450 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
3451
3452 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3453
3454 * data/bison.glr: Be sure to restore the
3455 current #line when returning to the skeleton contents after having
3456 exposed the input file's #line.
3457
3458 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3459
3460 * data/bison.glr: Bring up to date with changes to bison.simple.
3461
3462 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3463
3464 * data/bison.glr: Correct definitions that use b4_prefix.
3465 Various reformatting.
3466 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
3467 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
3468 yytokenp argument; now part of stack.
3469 (yychar): Define to behave as documented.
3470 (yyclearin): Ditto.
3471
3472 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3473
3474 * src/reader.h: Add declaration for free_merger_functions.
3475
3476 * src/reader.c (merge_functions): New variable.
3477 (get_merge_function): New function.
3478 (free_merger_functions): New function.
3479 (readgram): Check for %prec that is not followed by a symbol.
3480 Handle %dprec and %merge declarations.
3481 (packgram): Initialize dprec and merger fields in rules array.
3482
3483 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
3484 conflict_list_cnt, conflict_list_free): New variables.
3485 (table_grow): Also grow conflict_table.
3486 (prepare_rules): Output dprec and merger tables.
3487 (conflict_row): New function.
3488 (action_row): Output conflict lists for GLR parser. Don't use
3489 default reduction in conflicted states for GLR parser so that there
3490 are spaces for the conflict lists.
3491 (save_row): Also save conflict information.
3492 (token_actions): Allocate conflict list.
3493 (merger_output): New function.
3494 (pack_vector): Pack conflict table, too.
3495 (output_conflicts): New function to output yyconflp and yyconfl.
3496 (output_check): Allocate conflict_tos.
3497 (output_actions): Output conflict tables, also.
3498 (output_skeleton): Output b4_mergers definition.
3499 (prepare): Output b4_max_rhs_length definition.
3500 Use 'bison.glr' as default skeleton for GLR parsers.
3501
3502 * src/gram.c (glr_parser): New flag.
3503 (grammar_free): Call free_merger_functions.
3504
3505 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
3506 all pairs of conflicting reductions, rather than just all tokens
3507 causing conflicts. Needed to size conflict tables.
3508 (conflicts_output): Modify call to count_rr_conflicts for new
3509 interface.
3510 (conflicts_print): Ditto.
3511 (count_total_conflicts): New function.
3512
3513 * src/reader.h (merger_list): New type.
3514 (merge_functions): New variable.
3515
3516 * src/lex.h (tok_dprec, tok_merge): New token types.
3517
3518 * src/gram.h (rule_s): Add dprec and merger fields.
3519 (glr_parser): New flag.
3520
3521 * src/conflicts.h (count_total_conflicts): New function.
3522
3523 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
3524
3525 * doc/bison.texinfo (Generalized LR Parsing): New section.
3526 (GLR Parsers): New section.
3527 (Language and Grammar): Mention GLR parsing.
3528 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
3529 Correct typo ("tge" -> "the").
3530
3531 * data/bison.glr: New skeleton for GLR parsing.
3532
3533 * tests/cxx-gram.at: New tests for GLR parsing.
3534
3535 * tests/testsuite.at: Include cxx-gram.at.
3536
3537 * tests/Makefile.am: Add cxx-gram.at.
3538
3539 * src/parse-gram.y:
3540
3541 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
3542
3543 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
3544
35452002-06-27 Akim Demaille <akim@epita.fr>
3546
3547 * src/options.h, src/options.c: Remove.
3548 * src/getargs.c (short_options, long_options): New.
3549
35502002-06-27 Akim Demaille <akim@epita.fr>
3551
3552 * data/bison.simple, data/bison.c++: Rename as...
3553 * data/yacc.c, data/lalr1.cc: these.
3554 * doc/bison.texinfo (Environment Variables): Remove.
3555
35562002-06-25 Raja R Harinath <harinath@cs.umn.edu>
3557
3558 * src/getargs.c (report_argmatch): Initialize strtok().
3559
35602002-06-20 Akim Demaille <akim@epita.fr>
3561
3562 * data/bison.simple (b4_symbol_actions): New, replaces...
3563 (b4_symbol_destructor, b4_symbol_printer): these.
3564 (yysymprint): Be sure to call YYPRINT only for tokens, and using
3565 user token numbers.
3566
35672002-06-20 Akim Demaille <akim@epita.fr>
3568
3569 * data/bison.simple (yydestructor): Rename as...
3570 (yydestruct): this.
3571
35722002-06-20 Akim Demaille <akim@epita.fr>
3573
3574 * src/symtab.h, src/symtab.c (symbol_type_set)
3575 (symbol_destructor_set, symbol_precedence_set): The location is
3576 the last argument.
3577 Adjust all callers.
3578
35792002-06-20 Akim Demaille <akim@epita.fr>
3580
3581 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
3582 internals.
3583 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
3584 Takes a location.
3585 * src/symtab.h, src/symtab.c (symbol_class_set)
3586 (symbol_user_token_number_set): Likewise.
3587 Adjust all callers.
3588 Promote complain_at.
3589 * tests/input.at (Type Clashes): Adjust.
3590
35912002-06-20 Akim Demaille <akim@epita.fr>
3592
3593 * data/bison.simple (YYLEX): Fix the declaration when
3594 %pure-parser.
3595
35962002-06-20 Akim Demaille <akim@epita.fr>
3597
3598 * data/bison.simple (yysymprint): Don't print the token number,
3599 just its name.
3600 * tests/actions.at (Destructors): Rename as...
3601 (Printers and Destructors): this.
3602 Also exercise %printer.
3603
36042002-06-20 Akim Demaille <akim@epita.fr>
3605
3606 * data/bison.simple (YYDSYMPRINT): New.
3607 Use it to remove many of the #if YYDEBUG/if (yydebug).
3608
36092002-06-20 Akim Demaille <akim@epita.fr>
3610
3611 * src/symtab.h, src/symtab.c (symbol_t): printer and
3612 printer_location are new members.
3613 (symbol_printer_set): New.
3614 * src/parse-gram.y (PERCENT_PRINTER): New token.
3615 Handle its associated rule.
3616 * src/scan-gram.l: Adjust.
3617 (handle_destructor_at, handle_destructor_dollar): Rename as...
3618 (handle_symbol_code_at, handle_symbol_code_dollar): these.
3619 * src/output.c (symbol_printers_output): New.
3620 (output_skeleton): Call it.
3621 * data/bison.simple (yysymprint): New. Cannot be named yyprint
3622 since there are already many grammar files with a user `yyprint'.
3623 Replace the calls to YYPRINT to calls to yysymprint.
3624 * tests/calc.at: Adjust.
3625 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
3626 taking advantage of parser very internal details (stack size!).
3627
36282002-06-20 Akim Demaille <akim@epita.fr>
3629
3630 * src/scan-gram.l: Complete the scanner with the missing patterns
3631 to pacify Flex.
3632 Use `quote' and `symbol_tag_get' where appropriate.
3633
36342002-06-19 Akim Demaille <akim@epita.fr>
3635
3636 * tests/actions.at (Destructors): Augment to test locations.
3637 * data/bison.simple (yydestructor): Pass it the current location
3638 if locations are enabled.
3639 Prototype only when __STDC__ or C++.
3640 Change the argument names to move into the yy name space: there is
3641 user code here.
3642
36432002-06-19 Akim Demaille <akim@epita.fr>
3644
3645 * data/bison.simple (b4_pure_if): New.
3646 Use it instead of #ifdef YYPURE.
3647
36482002-06-19 Akim Demaille <akim@epita.fr>
3649
3650 * data/bison.simple (b4_location_if): New.
3651 Use it instead of #ifdef YYLSP_NEEDED.
3652
36532002-06-19 Akim Demaille <akim@epita.fr>
3654
3655 Prepare @$ in %destructor, but currently don't bind it in the
3656 skeleton, as %location use is not cleaned up yet.
3657
3658 * src/scan-gram.l (handle_dollar, handle_destructor_at)
3659 (handle_action_at): New.
3660 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
3661 a braced_code_t and a location as additional arguments.
3662 (handle_destructor_dollar): Instead of requiring `b4_eval', just
3663 unquote one when outputting `b4_dollar_dollar'.
3664 Adjust callers.
3665 * data/bison.simple (b4_eval): Remove.
3666 (b4_symbol_destructor): Adjust.
3667 * tests/input.at (Invalid @n): Adjust.
3668
36692002-06-19 Zack Weinberg <zack@codesourcery.com>
3670
3671 * doc/bison.texinfo: Document ability to have multiple
3672 prologue sections.
3673
36742002-06-18 Akim Demaille <akim@epita.fr>
3675
3676 * src/files.c (compute_base_names): When computing the output file
3677 names from the input file name, strip the directory part.
3678
36792002-06-18 Akim Demaille <akim@epita.fr>
3680
3681 * data/bison.simple.new: Comment changes.
3682 Reported by Andreas Schwab.
3683
36842002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
3685
3686 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
3687 there are no `label `yyoverflowlab' defined but not used' warnings
3688 when yyoverflow is defined.
3689
36902002-06-18 Akim Demaille <akim@epita.fr>
3691
3692 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
3693 new member.
3694 (symbol_destructor_set): Adjust.
3695 * src/output.c (symbol_destructors_output): Output the destructor
3696 locations.
3697 Output the symbol name.
3698 * data/bison.simple (b4_symbol_destructor): Adjust.
3699
37002002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
3701 and Akim Demaille <akim@epita.fr>
3702
3703 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
3704 what's left on the stack when the error recovery hits EOF.
3705 * tests/actions.at (Destructors): Complete to exercise this case.
3706
37072002-06-17 Akim Demaille <akim@epita.fr>
3708
3709 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
3710 arguments is really empty, not only equal to `[]'.
3711 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
3712 member.
3713 (symbol_destructor_set): New.
3714 * src/output.c (symbol_destructors_output): New.
3715 * src/reader.h (brace_code_t, current_braced_code): New.
3716 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
3717 (handle_dollar): Rename as...
3718 (handle_action_dollar): this.
3719 (handle_destructor_dollar): New.
3720 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
3721 (grammar_declaration): Use it.
3722 * data/bison.simple (yystos): Is always defined.
3723 (yydestructor): New.
3724 * tests/actions.at (Destructors): New.
3725 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
3726
37272002-06-17 Akim Demaille <akim@epita.fr>
3728
3729 * src/symlist.h, src/symlist.c (symbol_list_length): New.
3730 * src/scan-gram.l (handle_dollar, handle_at): Compute the
3731 rule_length only when needed.
3732 * src/output.c (actions_output, token_definitions_output): Output
3733 the full M4 block.
3734 * src/symtab.c: Don't access directly to the symbol tag, use
3735 symbol_tag_get.
3736 * src/parse-gram.y: Use symbol_list_free.
3737
37382002-06-17 Akim Demaille <akim@epita.fr>
3739
3740 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
3741 (symbol_list_prepend, get_type_name): Move to...
3742 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
3743 (symbol_list_prepend, symbol_list_n_type_name_get): here.
3744 Adjust all callers.
3745 (symbol_list_free): New.
3746 * src/scan-gram.l (handle_dollar): Takes a location.
3747 * tests/input.at (Invalid $n): Adjust.
3748
37492002-06-17 Akim Demaille <akim@epita.fr>
3750
3751 * src/reader.h, src/reader.c (symbol_list_new): Export it.
3752 (symbol_list_prepend): New.
3753 * src/parse-gram.y (%union): `list' is a new member.
3754 (symbols.1): New, replaces...
3755 (terms_to_prec.1, nterms_to_type.1): these.
3756 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
3757 Take a location as additional argument.
3758 Adjust all callers.
3759
37602002-06-15 Akim Demaille <akim@epita.fr>
3761
3762 * src/parse-gram.y: Move %token in the declaration section so that
3763 we don't depend upon CVS Bison.
3764
37652002-06-15 Akim Demaille <akim@epita.fr>
3766
3767 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
3768 * src/print.c (print_core): Use it.
3769
37702002-06-15 Akim Demaille <akim@epita.fr>
3771
3772 * src/conflicts.c (log_resolution): Accept the rule involved in
3773 the sr conflicts instead of the lookahead number that points to
3774 that rule.
3775 (flush_reduce): Accept the current lookahead vector as argument,
3776 instead of the index in LA.
3777 (resolve_sr_conflict): Accept the current number of lookahead
3778 bitset to consider for the STATE, instead of the index in LA.
3779 (set_conflicts): Adjust.
3780 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
3781
37822002-06-15 Akim Demaille <akim@epita.fr>
3783
3784 * src/state.h (state_t): Replace the `lookaheadsp' member, a
3785 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
3786 Adjust all dependencies.
3787 * src/lalr.c (initialize_lookaheads): Split into...
3788 (states_lookaheads_count, states_lookaheads_initialize): these.
3789 (lalr): Adjust.
3790
37912002-06-15 Akim Demaille <akim@epita.fr>
3792
3793 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
3794 out of...
3795 (grammar_rules_print): here.
3796 * src/reduce.c (reduce_output): Use it.
3797 * tests/reduce.at (Useless Rules, Reduced Automaton)
3798 (Underivable Rules): Adjust.
3799
38002002-06-15 Akim Demaille <akim@epita.fr>
3801
3802 Copy BYacc's nice way to report the grammar.
3803
3804 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
3805 New.
3806 Don't print the rules' location, it is confusing and useless.
3807 (rule_print): Use grammar_rhs_print.
3808 * src/print.c (print_grammar): Use grammar_rules_print.
3809
38102002-06-15 Akim Demaille <akim@epita.fr>
3811
3812 Complete and rationalize `useless thing' warnings.
3813
3814 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
3815 (symbol_tag_print): New.
3816 Use them everywhere in place of accessing directly the tag member.
3817 * src/gram.h, src/gram.c (rule_print): New.
3818 Use it where a rule used to be printed `by hand'.
3819 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
3820 (reduce_grammar_tables): Report the useless rules.
3821 (reduce_print): Useless things are a warning, not an error.
3822 Report it as such.
3823 * tests/reduce.at (Useless Nonterminals, Useless Rules):
3824 (Reduced Automaton, Underivable Rules): Adjust.
3825 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
3826 * tests/conflicts.at (Unresolved SR Conflicts)
3827 (Solved SR Conflicts): Adjust.
3828
38292002-06-15 Akim Demaille <akim@epita.fr>
3830
3831 Let symbols have a location.
3832
3833 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
3834 (getsym): Adjust.
3835 Adjust all callers.
3836 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
3837 Use location_t, not int.
3838 * src/symtab.c (symbol_check_defined): Take advantage of the
3839 location.
3840 * tests/regression.at (Invalid inputs): Adjust.
3841
38422002-06-15 Akim Demaille <akim@epita.fr>
3843
3844 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
3845 (input): Don't try to initialize yylloc here, do it in the
3846 scanner.
3847 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
3848 * src/gram.h (rule_t): Change line and action_line into location
3849 and action_location, of location_t type.
3850 Adjust all dependencies.
3851 * src/location.h, src/location.c (empty_location): New.
3852 * src/reader.h, src/reader.c (grammar_start_symbol_set)
3853 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
3854 (grammar_current_rule_symbol_append)
3855 (grammar_current_rule_action_append): Expect a location as argument.
3856 * src/reader.c (grammar_midrule_action): Adjust to attach an
3857 action's location as dummy symbol location.
3858 * src/symtab.h, src/symtab.c (startsymbol_location): New.
3859 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
3860 the line numbers.
3861
38622002-06-14 Akim Demaille <akim@epita.fr>
3863
3864 Grammar declarations may be found in the grammar section.
3865
3866 * src/parse-gram.y (rules_or_grammar_declaration): New.
3867 (declarations): Each declaration may end with a semicolon, not
3868 just...
3869 (grammar_declaration): `"%union"'.
3870 (grammar): Branch to rules_or_grammar_declaration.
3871
38722002-06-14 Akim Demaille <akim@epita.fr>
3873
3874 * src/main.c (main): Invoke scanner_free.
3875
38762002-06-14 Akim Demaille <akim@epita.fr>
3877
3878 * src/output.c (m4_invoke): Extracted from...
3879 (output_skeleton): here.
3880 Free tempfile.
3881
38822002-06-14 Akim Demaille <akim@epita.fr>
3883
3884 * src/parse-gram.y (directives, directive, gram)
3885 (grammar_directives, precedence_directives, precedence_directive):
3886 Rename as...
3887 (declarations, declaration, grammar, grammar_declaration)
3888 (precedence_declaration, precedence_declarator): these.
3889 (symbol_declaration): New.
3890
38912002-06-14 Akim Demaille <akim@epita.fr>
3892
3893 * src/files.c (action_obstack): Remove, unused.
3894 (output_obstack): Remove it, and all its dependencies, as it is no
3895 longer needed.
3896 * src/reader.c (epilogue_set): Build the epilogue in the
3897 muscle_obstack.
3898 * src/output.h, src/output.c (muscle_obstack): Move to...
3899 * src/muscle_tab.h, src/muscle_tab.h: here.
3900 (muscle_init): Initialize muscle_obstack.
3901 (muscle_free): New.
3902 * src/main.c (main): Call it.
3903
39042002-06-14 Akim Demaille <akim@epita.fr>
3905
3906 * src/location.h: New, extracted from...
3907 * src/reader.h: here.
3908 * src/Makefile.am (noinst_HEADERS): Merge into
3909 (bison_SOURCES): this.
3910 Add location.h.
3911 * src/parse-gram.y: Use location_t instead of Bison's.
3912 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
3913 Use location_t instead of ints.
3914
39152002-06-14 Akim Demaille <akim@epita.fr>
3916
3917 * data/bison.simple, data/bison.c++: Be sure to restore the
3918 current #line when returning to the skeleton contents after having
3919 exposed the input file's #line.
3920
39212002-06-12 Akim Demaille <akim@epita.fr>
3922
3923 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
3924 eager.
3925 * tests/actions.at (Exotic Dollars): New.
3926
39272002-06-12 Akim Demaille <akim@epita.fr>
3928
3929 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
3930 ['"/] too eagerly.
3931 * tests/input.at (Torturing the Scanner): New.
3932
39332002-06-11 Akim Demaille <akim@epita.fr>
3934
3935 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
3936 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
3937 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
3938 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
3939 * src/reader.c (reader): Use it.
3940
39412002-06-11 Akim Demaille <akim@epita.fr>
3942
3943 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
3944 Adjust all callers.
3945 (scanner_last_string_free): New.
3946
39472002-06-11 Akim Demaille <akim@epita.fr>
3948
3949 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
3950 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
3951 (last_string, YY_OBS_FREE): New.
3952 Use them when returning an ID.
3953
39542002-06-11 Akim Demaille <akim@epita.fr>
3955
3956 Have Bison grammars parsed by a Bison grammar.
3957
3958 * src/reader.c, src/reader.h (prologue_augment): New.
3959 * src/reader.c (copy_definition): Remove.
3960
3961 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
3962 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
3963 (grammar_current_rule_prec_set, grammar_current_rule_check)
3964 (grammar_current_rule_symbol_append)
3965 (grammar_current_rule_action_append): Export.
3966 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
3967 (symbol_list_action_append): Remove.
3968 Hook the routines from reader.
3969 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
3970 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
3971
3972 * src/reader.c (read_declarations): Remove, unused.
3973
3974 * src/parse-gram.y: Handle the epilogue.
3975 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
3976 (grammar_start_symbol_set): this.
3977 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
3978 * src/reader.c (readgram): Remove, unused.
3979 (reader): Adjust to insert eoftoken and axiom where appropriate.
3980
3981 * src/reader.c (copy_dollar): Replace with...
3982 * src/scan-gram.h (handle_dollar): this.
3983 * src/parse-gram.y: Remove `%thong'.
3984
3985 * src/reader.c (copy_at): Replace with...
3986 * src/scan-gram.h (handle_at): this.
3987
3988 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
3989 New.
3990
3991 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
3992 time being.
3993
3994 * src/reader.h, src/reader.c (grammar_rule_end): New.
3995
3996 * src/parse.y (current_type, current_class): New.
3997 Implement `%nterm', `%token' support.
3998 Merge `%term' into `%token'.
3999 (string_as_id): New.
4000 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
4001 type name.
4002
4003 * src/parse-gram.y: Be sure to handle properly the beginning of
4004 rules.
4005
4006 * src/parse-gram.y: Handle %type.
4007 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
4008
4009 * src/parse-gram.y: More directives support.
4010 * src/options.c: No longer handle source directives.
4011
4012 * src/parse-gram.y: Fix %output.
4013
4014 * src/parse-gram.y: Handle %union.
4015 Use the prologue locations.
4016 * src/reader.c (parse_union_decl): Remove.
4017
4018 * src/reader.h, src/reader.c (epilogue_set): New.
4019 * src/parse-gram.y: Use it.
4020
4021 * data/bison.simple, data/bison.c++: b4_stype is now either not
4022 defined, then default to int, or to the contents of %union,
4023 without `union' itself.
4024 Adjust.
4025 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
4026
4027 * src/output.c (actions_output): Don't output braces, as they are
4028 already handled by the scanner.
4029
4030 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
4031 characters to themselves.
4032
4033 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
4034 that the epilogue has a proper #line.
4035
4036 * src/parse-gram.y: Handle precedence/associativity.
4037
4038 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
4039 a terminal.
4040 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
4041 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
4042 at all to define terminals that cannot be emitted.
4043
4044 * src/scan-gram.l: Escape M4 characters.
4045
4046 * src/scan-gram.l: Working properly with escapes in user
4047 strings/characters.
4048
4049 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
4050 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
4051 grammar.
4052 Use more modest sizes, as for the time being the parser does not
4053 release memory, and therefore the process swallows a huge amount
4054 of memory.
4055
4056 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
4057 stricter %token grammar.
4058
4059 * src/symtab.h (associativity): Add `undef_assoc'.
4060 (symbol_precedence_set): Do nothing when passed an undef_assoc.
4061 * src/symtab.c (symbol_check_alias_consistence): Adjust.
4062
4063 * tests/regression.at (Invalid %directive): Remove, as it is now
4064 meaningless.
4065 (Invalid inputs): Adjust to the new error messages.
4066 (Token definitions): The new grammar doesn't allow too many
4067 eccentricities.
4068
4069 * src/lex.h, src/lex.c: Remove.
4070 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
4071 (copy_character, copy_string2, copy_string, copy_identifier)
4072 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
4073 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
4074 (parse_action): Remove.
4075 * po/POTFILES.in: Adjust.
4076
40772002-06-11 Akim Demaille <akim@epita.fr>
4078
4079 * src/reader.c (parse_action): Don't store directly into the
4080 rule's action member: return the action as a string.
4081 Don't require `rule_length' as an argument: compute it.
4082 (grammar_current_rule_symbol_append)
4083 (grammar_current_rule_action_append): New, eved out from
4084 (readgram): here.
4085 Remove `action_flag', `rulelength', unused now.
4086
40872002-06-11 Akim Demaille <akim@epita.fr>
4088
4089 * src/reader.c (grammar_current_rule_prec_set).
4090 (grammar_current_rule_check): New, eved out from...
4091 (readgram): here.
4092 Remove `xaction', `first_rhs': useless.
4093 * tests/input.at (Type clashes): New.
4094 * tests/existing.at (GNU Cim Grammar): Adjust.
4095
40962002-06-11 Akim Demaille <akim@epita.fr>
4097
4098 * src/reader.c (grammar_midrule_action): New, Eved out from
4099 (readgram): here.
4100
41012002-06-11 Akim Demaille <akim@epita.fr>
4102
4103 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
4104 New.
4105 (readgram): Use them as replacement of inlined code, crule and
4106 crule1.
4107
41082002-06-11 Akim Demaille <akim@epita.fr>
4109
4110 * src/reader.c (grammar_end, grammar_symbol_append): New.
4111 (readgram): Use them.
4112 Make the use of `p' as local as possible.
4113
41142002-06-10 Akim Demaille <akim@epita.fr>
4115
4116 GCJ's parser requires the tokens to be defined before the prologue.
4117
4118 * data/bison.simple: Output the token definition before the user's
4119 prologue.
4120 * tests/regression.at (Braces parsing, Duplicate string)
4121 (Mixing %token styles): Check the output from bison.
4122 (Early token definitions): New.
4123
41242002-06-10 Akim Demaille <akim@epita.fr>
4125
4126 * src/symtab.c (symbol_user_token_number_set): Don't complain when
4127 assigning twice the same user number to a token, so that we can
4128 use it in...
4129 * src/lex.c (lex): here.
4130 Also use `symbol_class_set' instead of hand written code.
4131 * src/reader.c (parse_assoc_decl): Likewise.
4132
41332002-06-10 Akim Demaille <akim@epita.fr>
4134
4135 * src/symtab.c, src/symtab.c (symbol_class_set)
4136 (symbol_user_token_number_set): New.
4137 * src/reader.c (parse_token_decl): Use them.
4138 Use a switch instead of ifs.
4139 Use a single argument.
4140
41412002-06-10 Akim Demaille <akim@epita.fr>
4142
4143 Remove `%thong' support as it is undocumented, unused, duplicates
4144 `%token's job, and creates useless e-mail traffic with people who
4145 want to know what it is, why it is undocumented, unused, and
4146 duplicates `%token's job.
4147
4148 * src/reader.c (parse_thong_decl): Remove.
4149 * src/options.c (option_table): Remove "thong".
4150 * src/lex.h (tok_thong): Remove.
4151
41522002-06-10 Akim Demaille <akim@epita.fr>
4153
4154 * src/symtab.c, src/symtab.c (symbol_type_set)
4155 (symbol_precedence_set): New.
4156 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
4157 (value_components_used): Remove, unused.
4158
41592002-06-09 Akim Demaille <akim@epita.fr>
4160
4161 Move symbols handling code out of the reader.
4162
4163 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
4164 (axiom): Move to...
4165 * src/symtab.h, src/symtab.c: here.
4166
4167 * src/gram.c (start_symbol): Remove: use startsymbol->number.
4168 * src/reader.c (startval): Rename as...
4169 * src/symtab.h, src/symtab.c (startsymbol): this.
4170 * src/reader.c: Adjust.
4171
4172 * src/reader.c (symbol_check_defined, symbol_make_alias)
4173 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
4174 (token_translations_init)
4175 Move to...
4176 * src/symtab.c: here.
4177 * src/reader.c (packsymbols): Move to...
4178 * src/symtab.h, src/symtab.c (symbols_pack): here.
4179 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
4180 argument.
4181
41822002-06-03 Akim Demaille <akim@epita.fr>
4183
4184 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
4185 then statements.
4186
41872002-06-03 Akim Demaille <akim@epita.fr>
4188
4189 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
4190 structs with non literals.
4191 * src/scan-skel.l: never-interactive.
4192 * src/conflicts.c (enum conflict_resolution_e): No trailing
4193 comma.
4194 * src/getargs.c (usage): Split long literal strings.
4195 Reported by Hans Aberg.
4196
41972002-05-28 Akim Demaille <akim@epita.fr>
4198
4199 * data/bison.c++: Use C++ ostreams.
4200 (cdebug_): New member.
4201
42022002-05-28 Akim Demaille <akim@epita.fr>
4203
4204 * src/output.c (output_skeleton): Be sure to allocate enough room
4205 for `/' _and_ for `\0' in full_skeleton.
4206
42072002-05-28 Akim Demaille <akim@epita.fr>
4208
4209 * data/bison.c++: Catch up with bison.simple:
4210 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4211 and Paul Eggert <eggert@twinsun.com>: `error' handing.
4212 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
4213 and popping traces.
4214
42152002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4216
4217 * src/output.c (output_skeleton): Put an explicit path in front of
4218 the skeleton file name, rather than relying on the -I directory,
4219 to partially alleviate effects of having a skeleton file lying around
4220 in the current directory.
4221
42222002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4223
4224 * src/conflicts.c (log_resolution): Correct typo:
4225 obstack_printf should be obstack_fgrow1.
4226
42272002-05-26 Akim Demaille <akim@epita.fr>
4228
4229 * src/state.h (state_t): `solved_conflicts' is a new member.
4230 * src/LR0.c (new_state): Set it to 0.
4231 * src/conflicts.h, src/conflicts.c (print_conflicts)
4232 (free_conflicts, solve_conflicts): Rename as...
4233 (conflicts_print, conflicts_free, conflicts_solve): these.
4234 Adjust callers.
4235 * src/conflicts.c (enum conflict_resolution_e)
4236 (solved_conflicts_obstack): New, used by...
4237 (log_resolution): this.
4238 Adjust to attach the conflict resolution to each state.
4239 Complete the description with the precedence/associativity
4240 information.
4241 (resolve_sr_conflict): Adjust.
4242 * src/print.c (print_state): Output its solved_conflicts.
4243 * tests/conflicts.at (Unresolved SR Conflicts)
4244 (Solved SR Conflicts): Exercise --report=all.
4245
42462002-05-26 Akim Demaille <akim@epita.fr>
4247
4248 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
4249 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
4250 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
4251 (token_number_t, item_number_as_token_number)
4252 (token_number_as_item_number, muscle_insert_token_number_table):
4253 Rename as...
4254 (symbol_number_t, item_number_as_symbol_number)
4255 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
4256 these, since it is more appropriate.
4257
42582002-05-26 Akim Demaille <akim@epita.fr>
4259
4260 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
4261 `Error:' lines.
4262 * data/bison.simple (yystos) [YYDEBUG]: New.
4263 (yyparse) [YYDEBUG]: Display the symbols which are popped during
4264 error recovery.
4265 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
4266
42672002-05-25 Akim Demaille <akim@epita.fr>
4268
4269 * doc/bison.texinfo (Debugging): Split into...
4270 (Tracing): this new section, its former contents, and...
4271 (Understanding): this new section.
4272 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
4273 by...
4274 (report_flag): this.
4275 Adjust all dependencies.
4276 (report_args, report_types, report_argmatch): New.
4277 (usage, getargs): Report/support -r, --report.
4278 * src/options.h
4279 (struct option_table_struct): Rename as..,
4280 (struct option_table_s): this.
4281 Rename the `set_flag' member to `flag' to match with getopt_long's
4282 struct.
4283 * src/options.c (option_table): Split verbose into an entry for
4284 %verbose, and another for --verbose.
4285 Support --report/-r, so remove -r from the obsolete --raw.
4286 * src/print.c: Attach full item sets and lookaheads reports to
4287 report_flag instead of trace_flag.
4288 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
4289
42902002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4291 and Paul Eggert <eggert@twinsun.com>
4292
4293 * data/bison.simple (yyparse): Correct error handling to conform to
4294 POSIX and yacc. Specifically, after syntax error is discovered,
4295 do not reduce further before shifting the error token.
4296 Clean up the code a bit by removing the labels yyerrdefault,
4297 yyerrhandle, yyerrpop.
4298 * NEWS: Document the above.
4299
43002002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4301
4302 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
4303 type; it isn't always big enough, since it doesn't necessarily
4304 include non-terminals.
4305 (yytranslate): Expand definition of yy_token_number_type, so that
4306 the latter can be removed.
4307 (yy_token_number_type): Remove, only one use.
4308 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
4309 don't use TokenNumberType as element type.
4310
4311 * tests/regression.at: Modify expected output to agree with change
4312 to yyr1 and yytranslate.
4313
43142002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
4315
4316 * src/reader.c (parse_action): Use copy_character instead of
4317 obstack_1grow.
4318
43192002-05-13 Akim Demaille <akim@epita.fr>
4320
4321 * tests/regression.at (Token definitions): Prototype yylex and
4322 yyerror.
4323
43242002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4325
4326 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
4327 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
4328 32-bit arithmetic.
4329 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
4330
43312002-05-07 Akim Demaille <akim@epita.fr>
4332
4333 * tests/synclines.at: Be sure to prototype yylex and yyerror to
4334 avoid GCC warnings.
4335
43362002-05-07 Akim Demaille <akim@epita.fr>
4337
4338 Kill GCC warnings.
4339
4340 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
4341 over the RHS of each rule.
4342 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
4343 * src/state.h (state_t): Member `nitems' is unsigned short.
4344 * src/LR0.c (get_state): Adjust.
4345 * src/reader.c (packgram): Likewise.
4346 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
4347 `Type'.
4348 (muscle_insert_int_table): Remove, unused.
4349 (prepare_rules): Remove `max'.
4350
43512002-05-06 Akim Demaille <akim@epita.fr>
4352
4353 * src/closure.c (print_firsts): Display of the symbol tags.
4354 (bitmatrix_print): Move to...
4355 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
4356 here.
4357 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
4358
43592002-05-06 Akim Demaille <akim@epita.fr>
4360
4361 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
4362 hash_do_for_each.
4363
43642002-05-06 Akim Demaille <akim@epita.fr>
4365
4366 * src/LR0.c (new_state, get_state): Instead of using the global
4367 `kernel_size' and `kernel_base', have two new arguments:
4368 `core_size' and `core'.
4369 Adjust callers.
4370
43712002-05-06 Akim Demaille <akim@epita.fr>
4372
4373 * src/reader.c (packgram): No longer end `ritem' with a 0
4374 sentinel: it is not used.
4375
43762002-05-05 Akim Demaille <akim@epita.fr>
4377
4378 New experimental feature: display the lookaheads in the report and
4379 graph.
4380
4381 * src/print (print_core): When --trace-flag, display the rules
4382 lookaheads.
4383 * src/print_graph.c (print_core): Likewise.
4384 Swap the arguments.
4385 Adjust caller.
4386
43872002-05-05 Akim Demaille <akim@epita.fr>
4388
4389 * tests/torture.at (Many lookaheads): New test.
4390
43912002-05-05 Akim Demaille <akim@epita.fr>
4392
4393 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
4394 (GENERATE_MUSCLE_INSERT_TABLE): this.
4395 (output_int_table, output_unsigned_int_table, output_short_table)
4396 (output_token_number_table, output_item_number_table): Replace with...
4397 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
4398 (muscle_insert_short_table, muscle_insert_token_number_table)
4399 (muscle_insert_item_number_table): these.
4400 Adjust all callers.
4401 (prepare_tokens): Don't free `translations', since...
4402 * src/reader.h, src/reader.c (grammar_free): do it.
4403 Move to...
4404 * src/gram.h, src/gram.c (grammar_free): here.
4405 * data/bison.simple, data/bison.c++: b4_token_number_max is now
4406 b4_translate_max.
4407
44082002-05-05 Akim Demaille <akim@epita.fr>
4409
4410 * src/output.c (output_unsigned_int_table): New.
4411 (prepare_rules): `i' is unsigned.
4412 `prhs', `rline', `r2' are unsigned int.
4413 Rename muscle `rhs_number_max' as `rhs_max'.
4414 Output muscles `prhs_max', `rline_max', and `r2_max'.
4415 Free rline and r1.
4416 * data/bison.simple, data/bison.c++: Adjust to use these muscles
4417 to compute types instead of constant types.
4418 * tests/regression.at (Web2c Actions): Adjust.
4419
44202002-05-04 Akim Demaille <akim@epita.fr>
4421
4422 * src/symtab.h (SALIAS, SUNDEF): Rename as...
4423 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
4424 Adjust dependencies.
4425 * src/output.c (token_definitions_output): Be sure not to output a
4426 `#define 'a'' when fed with `%token 'a' "a"'.
4427 * tests/regression.at (Token definitions): New.
4428
44292002-05-03 Paul Eggert <eggert@twinsun.com>
4430
4431 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
4432 for K&R C.
4433
44342002-05-03 gettextize <bug-gnu-gettext@gnu.org>
4435
4436 * Makefile.am (SUBDIRS): Remove intl.
4437 (EXTRA_DIST): Add config/config.rpath.
4438
44392002-05-03 Akim Demaille <akim@epita.fr>
4440
4441 * data/bison.simple (m4_if): Don't output empty enums.
4442 And actually, output valid enum definitions :(.
4443
44442002-05-03 Akim Demaille <akim@epita.fr>
4445
4446 * configure.bat: Remove, completely obsolete.
4447 * Makefile.am (EXTRA_DIST): Adjust.
4448 Don't distribute config.rpath...
4449 * config/Makefile.am (EXTRA_DIST): Do it.
4450
44512002-05-03 Akim Demaille <akim@epita.fr>
4452
4453 * configure.in (GETTEXT_VERSION): New.
4454 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
4455
44562002-05-03 Akim Demaille <akim@epita.fr>
4457
4458 * data/bison.simple (b4_token_enum): New.
4459 (b4_token_defines): Use it to output tokens both as #define and
4460 enums.
4461 Suggested by Paul Eggert.
4462 * src/output.c (token_definitions_output): Don't output spurious
4463 white spaces.
4464
44652002-05-03 Akim Demaille <akim@epita.fr>
4466
4467 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
4468
44692002-05-02 Robert Anisko <robert@lrde.epita.fr>
4470
4471 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
4472 Update the stack class, give a try to deque as the default container.
4473
44742002-05-02 Akim Demaille <akim@epita.fr>
4475
4476 * data/bison.simple (yyparse): Do not implement @$ = @1.
4477 (YYLLOC_DEFAULT): Adjust to do it.
4478 * doc/bison.texinfo (Location Default Action): Fix.
4479
44802002-05-02 Akim Demaille <akim@epita.fr>
4481
4482 * src/reader.c (parse_braces): Merge into...
4483 (parse_action): this.
4484
44852002-05-02 Akim Demaille <akim@epita.fr>
4486
4487 * configure.in (ALL_LINGUAS): Remove.
4488 * po/LINGUAS, hr.po: New.
4489
44902002-05-02 Akim Demaille <akim@epita.fr>
4491
4492 Remove the so called hairy (semantic) parsers.
4493
4494 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
4495 * src/gram.h, src/gram.c (semantic_parser): Remove.
4496 (rule_t): Remove the guard and guard_line members.
4497 * src/lex.h (token_t): remove tok_guard.
4498 * src/options.c (option_table): Remove %guard and %semantic_parser
4499 support.
4500 * src/output.c, src/output.h (guards_output): Remove.
4501 (prepare): Adjust.
4502 (token_definitions_output): Don't output the `T'
4503 tokens (???).
4504 (output_skeleton): Don't output the guards.
4505 * src/files.c, src/files.c (attrsfile): Remove.
4506 * src/reader.c (symbol_list): Remove the guard and guard_line
4507 members.
4508 Adjust dependencies.
4509 (parse_guard): Remove.
4510 * data/bison.hairy: Remove.
4511 * doc/bison.texinfo (Environment Variables): Remove occurrences of
4512 BISON_HAIRY.
4513
45142002-05-02 Akim Demaille <akim@epita.fr>
4515
4516 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
4517 (parse_guard): Rename the formal argument `stack_offset' as
4518 `rule_length', which is more readable.
4519 Adjust callers.
4520 (copy_at, copy_dollar): Instead of outputting the hard coded
4521 values of $$, $n and so forth, output invocation to b4_lhs_value,
4522 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
4523 Note: this patch partially drops `semantic-parser' support: it
4524 always does `rule_length - n', where semantic parsers ought to
4525 always use `-n'.
4526 * data/bison.simple, data/bison.c++ (b4_lhs_value)
4527 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
4528
45292002-05-02 Akim Demaille <akim@epita.fr>
4530
4531 * configure.in (AC_INIT): Bump to 1.49b.
4532 (AM_INIT_AUTOMAKE): Short invocation.
4533
45342002-05-02 Akim Demaille <akim@epita.fr>
4535
4536 Version 1.49a.
4537
45382002-05-01 Akim Demaille <akim@epita.fr>
4539
4540 * src/skeleton.h: Remove.
4541
45422002-05-01 Akim Demaille <akim@epita.fr>
4543
4544 * src/skeleton.h: Fix the #endif.
4545 Reported by Magnus Fromreide.
4546
45472002-04-26 Paul Eggert <eggert@twinsun.com>
4548
4549 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
4550 Define if we define YYSTYPE and YYLTYPE, respectively.
4551 (YYCOPY): Fix [] quoting problem in the non-GCC case.
4552
45532002-04-25 Robert Anisko <robert@lrde.epita.fr>
4554
4555 * src/scan-skel.l: Postprocess quadrigraphs.
4556
4557 * src/reader.c (copy_character): New function, used to output
4558 single characters while replacing `[' and `]' with quadrigraphs, to
4559 avoid troubles with M4 quotes.
4560 (copy_comment): Output characters with copy_character.
4561 (read_additionnal_code): Likewise.
4562 (copy_string2): Likewise.
4563 (copy_definition): Likewise.
4564
4565 * tests/calc.at: Exercise M4 quoting.
4566
45672002-04-25 Akim Demaille <akim@epita.fr>
4568
4569 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
4570 between `!' and the command.
4571 Reported by Paul Eggert.
4572
45732002-04-24 Robert Anisko <robert@lrde.epita.fr>
4574
4575 * tests/calc.at: Exercise prologue splitting.
4576
4577 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
4578 `b4_post_prologue' instead of `b4_prologue'.
4579
4580 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
4581 muscles.
4582 (output): Free pre_prologue_obstack and post_prologue_obstack.
4583 * src/files.h, src/files.c (attrs_obstack): Remove.
4584 (pre_prologue_obstack, post_prologue_obstack): New.
4585 * src/reader.c (copy_definition): Add a parameter to specify the
4586 obstack to fill, instead of using attrs_obstack unconditionally.
4587 (read_declarations): Pass pre_prologue_obstack to copy_definition if
4588 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
4589
45902002-04-23 Paul Eggert <eggert@twinsun.com>
4591
4592 * data/bison.simple: Remove unnecessary commentary and white
4593 space differences from 1_29-branch.
4594 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
4595
4596 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
4597 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
4598 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
4599 constructors or destructors.
4600
4601 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
4602
46032002-04-23 Akim Demaille <akim@epita.fr>
4604
4605 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
4606 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
4607 location with columns.
4608 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
4609 All reported by Paul Eggert.
4610
46112002-04-22 Akim Demaille <akim@epita.fr>
4612
4613 * src/reduce.c (dump_grammar): Move to...
4614 * src/gram.h, src/gram.c (grammar_dump): here.
4615 Be sure to separate long item numbers.
4616 Don't read the members of a rule's prec if its nil.
4617
46182002-04-22 Akim Demaille <akim@epita.fr>
4619
4620 * src/output.c (table_size, table_grow): New.
4621 (MAXTABLE): Remove, replace uses with table_size.
4622 (pack_vector): Instead of dying when the table is too big, grow it.
4623
46242002-04-22 Akim Demaille <akim@epita.fr>
4625
4626 * data/bison.simple (yyr1): Its type is that of a token number.
4627 * data/bison.c++ (r1_): Likewise.
4628 * tests/regression.at (Web2c Actions): Adjust.
4629
46302002-04-22 Akim Demaille <akim@epita.fr>
4631
4632 * src/reader.c (token_translations_init): 256 is now the default
4633 value for the error token, i.e., it will be assigned another
4634 number if the user assigned 256 to one of her tokens.
4635 (reader): Don't force 256 to error.
4636 * doc/bison.texinfo (Symbols): Adjust.
4637 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
4638 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
4639 etc. instead of 10, 20, 30 (which was used to `jump' over error
4640 (256) and undefined (2)).
4641
46422002-04-22 Akim Demaille <akim@epita.fr>
4643
4644 Propagate more token_number_t.
4645
4646 * src/gram.h (token_number_as_item_number)
4647 (item_number_as_token_number): New.
4648 * src/output.c (GENERATE_OUTPUT_TABLE): New.
4649 Use it to create output_item_number_table and
4650 output_token_number_table.
4651 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
4652 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
4653 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
4654 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
4655
46562002-04-22 Akim Demaille <akim@epita.fr>
4657
4658 * src/output.h, src/output.c (get_lines_number): Remove.
4659
46602002-04-19 Akim Demaille <akim@epita.fr>
4661
4662 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
4663 as Lex/Flex'.
4664 (Debugging): More details about enabling the debugging features.
4665 (Table of Symbols): Describe $$, $n, @$, and @n.
4666 Suggested by Tim Josling.
4667
46682002-04-19 Akim Demaille <akim@epita.fr>
4669
4670 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
4671
46722002-04-10 Akim Demaille <akim@epita.fr>
4673
4674 * src/system.h: Rely on HAVE_LIMITS_H.
4675 Suggested by Paul Eggert.
4676
46772002-04-09 Akim Demaille <akim@epita.fr>
4678
4679 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
4680 full stderr, and strip it according to the bison options, instead
4681 of composing the error message from different bits.
4682 This makes it easier to check for several error messages.
4683 Adjust all the invocations.
4684 Add an invocation exercising the error token.
4685 Add an invocation demonstrating a stupid error message.
4686 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
4687 Adjust the tests.
4688 Error message are for stderr, not stdout.
4689
46902002-04-09 Akim Demaille <akim@epita.fr>
4691
4692 * src/gram.h, src/gram.c (error_token_number): Remove, use
4693 errtoken->number.
4694 * src/reader.c (reader): Don't specify the user token number (2)
4695 for $undefined, as it uselessly prevents using it.
4696 * src/gram.h (token_number_t): Move to...
4697 * src/symtab.h: here.
4698 (state_t.number): Is a token_number_t.
4699 * src/print.c, src/reader.c: Use undeftoken->number instead of
4700 hard coded 2.
4701 (Even though this 2 is not the same as above: the number of the
4702 undeftoken remains being 2, it is its user token number which
4703 might not be 2).
4704 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
4705 `user_token_number_max'.
4706 Output `undef_token_number'.
4707 * data/bison.simple, data/bison.c++: Use them.
4708 Be sure to map invalid yylex return values to
4709 `undef_token_number'. This saves us from gratuitous SEGV.
4710
4711 * tests/conflicts.at (Solved SR Conflicts)
4712 (Unresolved SR Conflicts): Adjust.
4713 * tests/regression.at (Web2c Actions): Adjust.
4714
47152002-04-08 Akim Demaille <akim@epita.fr>
4716
4717 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
4718 Adding #line.
4719 Remove the duplicate `typedefs'.
4720 (RhsNumberType): Fix the declaration and various other typos.
4721 Use __ofile__.
4722 * data/bison.simple: Use __ofile__.
4723 * src/scan-skel.l: Handle __ofile__.
4724
47252002-04-08 Akim Demaille <akim@epita.fr>
4726
4727 * src/gram.h (item_number_t): New, the type of item numbers in
4728 RITEM. Note that it must be able to code symbol numbers as
4729 positive number, and the negation of rule numbers as negative
4730 numbers.
4731 Adjust all dependencies (pretty many).
4732 * src/reduce.c (rule): Remove this `short *' pointer: use
4733 item_number_t.
4734 * src/system.h (MINSHORT, MAXSHORT): Remove.
4735 Include `limits.h'.
4736 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
4737 (shortcpy): Remove.
4738 (MAXTABLE): Move to...
4739 * src/output.c (MAXTABLE): here.
4740 (prepare_rules): Use output_int_table to output rhs.
4741 * data/bison.simple, data/bison.c++: Adjust.
4742 * tests/torture.at (Big triangle): Move the limit from 254 to
4743 500.
4744 * tests/regression.at (Web2c Actions): Ajust.
4745
4746 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
4747 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
4748 passes, but produces negative #line number, once fixed, GCC is
4749 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
4750 C), it passes.
4751 * src/state.h (state_h): Code input lines on ints, not shorts.
4752
47532002-04-08 Akim Demaille <akim@epita.fr>
4754
4755 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
4756 and then the grammar.
4757
47582002-04-08 Akim Demaille <akim@epita.fr>
4759
4760 * src/system.h: No longer using strndup.
4761
47622002-04-07 Akim Demaille <akim@epita.fr>
4763
4764 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
4765 * src/output.c (output_table_data): Return the longest number.
4766 (prepare_tokens): Output `token_number_max').
4767 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
4768 New.
4769 Use them to define yy_token_number_type/TokenNumberType.
4770 Use this type for yytranslate.
4771 * tests/torture.at (Big triangle): Push the limit from 124 to
4772 253.
4773 * tests/regression.at (Web2c Actions): Adjust.
4774
47752002-04-07 Akim Demaille <akim@epita.fr>
4776
4777 * tests/torture.at (Big triangle): New.
4778 (GNU AWK Grammar, GNU Cim Grammar): Move to...
4779 * tests/existing.at: here.
4780
47812002-04-07 Akim Demaille <akim@epita.fr>
4782
4783 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
4784 nritems.
4785 Adjust dependencies.
4786
47872002-04-07 Akim Demaille <akim@epita.fr>
4788
4789 * src/reader.c: Normalize increments to prefix form.
4790
47912002-04-07 Akim Demaille <akim@epita.fr>
4792
4793 * src/reader.c, symtab.c: Remove debugging code.
4794
47952002-04-07 Akim Demaille <akim@epita.fr>
4796
4797 Rename all the `bucket's as `symbol_t'.
4798
4799 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
4800 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
4801 * src/symtab.c, src/symtab.h (bucket): Rename as...
4802 (symbol_t): this.
4803 (symbol_list_new, bucket_check_defined, bucket_make_alias)
4804 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
4805 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
4806 (buckets_new, buckets_free, buckets_do): Rename as...
4807 (symbol_list_new, symbol_check_defined, symbol_make_alias)
4808 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
4809 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
4810 (symbols_new, symbols_free, symbols_do): these.
4811
48122002-04-07 Akim Demaille <akim@epita.fr>
4813
4814 Use lib/hash for the symbol table.
4815
4816 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
4817 EOF.
4818 * src/lex.c (lex): Set the `number' member of new terminals.
4819 * src/reader.c (bucket_check_defined, bucket_make_alias)
4820 (bucket_check_alias_consistence, bucket_translation): New.
4821 (reader, grammar_free, readgram, token_translations_init)
4822 (packsymbols): Adjust.
4823 (reader): Number the predefined tokens.
4824 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
4825 for predefined tokens.
4826 * src/symtab.h (bucket): Remove all the hash table related
4827 members.
4828 * src/symtab.c (symtab): Replace by...
4829 (bucket_table): this.
4830 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
4831 (buckets_new, buckets_do): New.
4832
48332002-04-07 Akim Demaille <akim@epita.fr>
4834
4835 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
4836 (start_symbol, max_user_token_number, semantic_parser)
4837 (error_token_number): Initialize.
4838 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
4839 Initialize.
4840 (reader): Don't.
4841 (errtoken, eoftoken, undeftoken, axiom): Extern.
4842
48432002-04-07 Akim Demaille <akim@epita.fr>
4844
4845 * src/gram.h (rule_s): prec and precsym are now pointers
4846 to the bucket giving the priority/associativity.
4847 Member `associativity' removed: useless.
4848 * src/reduce.c, src/conflicts.c: Adjust.
4849
48502002-04-07 Akim Demaille <akim@epita.fr>
4851
4852 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
4853 Properly escape the symbols' TAG when outputting them.
4854
48552002-04-07 Akim Demaille <akim@epita.fr>
4856
4857 * src/lalr.h (LA): Is a bitsetv, not bitset*.
4858
48592002-04-07 Akim Demaille <akim@epita.fr>
4860
4861 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
4862 (LArule): this, which is an array to rule_t*.
4863 * src/print.c, src/conflicts.c: Adjust.
4864
48652002-04-07 Akim Demaille <akim@epita.fr>
4866
4867 * src/gram.h (rule_t): Rename `number' as `user_number'.
4868 `number' is a new member.
4869 Adjust dependencies.
4870 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
4871
48722002-04-07 Akim Demaille <akim@epita.fr>
4873
4874 As a result of the previous patch, it is no longer needed
4875 to reorder ritem itself.
4876
4877 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
4878
48792002-04-07 Akim Demaille <akim@epita.fr>
4880
4881 Be sure never to walk through RITEMS, but use only data related to
4882 the rules themselves. RITEMS should be banished.
4883
4884 * src/output.c (output_token_translations): Rename as...
4885 (prepare_tokens): this.
4886 In addition to `translate', prepare the muscles `tname' and
4887 `toknum', which were handled by...
4888 (output_rule_data): this.
4889 Remove, and move the remainder of its outputs into...
4890 (prepare_rules): this new routines, which also merges content from
4891 (output_gram): this.
4892 (prepare_rules): Be sure never to walk through RITEMS.
4893 (output_stos): Rename as...
4894 (prepare_stos): this.
4895 (output): Always invoke prepare_states, after all, just don't use it
4896 in the output if you don't need it.
4897
48982002-04-07 Akim Demaille <akim@epita.fr>
4899
4900 * src/LR0.c (new_state): Display `nstates' as the name of the
4901 newly created state.
4902 Adjust to initialize first_state and last_state if needed.
4903 Be sure to distinguish the initial from the final state.
4904 (new_states): Create the itemset of the initial state, and use
4905 new_state.
4906 * src/closure.c (closure): Now that the initial state has its
4907 items properly set, there is no need for a special case when
4908 creating `ruleset'.
4909
4910 As a result, now the rule 0, reducing to $axiom, is visible in the
4911 outputs. Adjust the test suite.
4912
4913 * tests/conflicts.at (Solved SR Conflicts)
4914 (Unresolved SR Conflicts): Adjust.
4915 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
4916 * tests/conflicts.at (S/R in initial): New.
4917
49182002-04-07 Akim Demaille <akim@epita.fr>
4919
4920 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
4921 the RHS of the rules.
4922 * src/output.c (output_gram): Likewise.
4923
49242002-04-07 Akim Demaille <akim@epita.fr>
4925
4926 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
4927 bucket.
4928 Adjust all dependencies.
4929 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
4930 `number' of the buckets too.
4931 * src/gram.h: Include `symtab.h'.
4932 (associativity): Move to...
4933 * src/symtab.h: here.
4934 No longer include `gram.h'.
4935
49362002-04-07 Akim Demaille <akim@epita.fr>
4937
4938 * src/gram.h, src/gram.c (rules_rhs_length): New.
4939 (ritem_longest_rhs): Use it.
4940 * src/gram.h (rule_t): `number' is a new member.
4941 * src/reader.c (packgram): Set it.
4942 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
4943 the end of `rules', and count them out of `nrules'.
4944 (reduce_output, dump_grammar): Adjust.
4945 * src/print.c (print_grammar): It is no longer needed to check for
4946 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
4947 * tests/reduce.at (Reduced Automaton): New test.
4948
49492002-04-07 Akim Demaille <akim@epita.fr>
4950
4951 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
4952 lacking `+ 1' to nrules, Bison reported as useless a token if it
4953 was used solely to set the precedence of the last rule...
4954
49552002-04-07 Akim Demaille <akim@epita.fr>
4956
4957 * data/bison.c++, data/bison.simple: Don't output the current file
4958 name in #line, to avoid useless diffs between two identical
4959 outputs under different names.
4960
49612002-04-07 Akim Demaille <akim@epita.fr>
4962
4963 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
4964 Normalize loops to using `< nrules + 1', not `<= nrules'.
4965
49662002-04-07 Akim Demaille <akim@epita.fr>
4967
4968 * TODO: Update.
4969
49702002-04-07 Akim Demaille <akim@epita.fr>
4971
4972 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
4973 bucket.value as bucket.number.
4974
49752002-04-07 Akim Demaille <akim@epita.fr>
4976
4977 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
4978 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
4979 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
4980 RHS, instead of being an index in RITEMS.
4981
49822002-04-04 Paul Eggert <eggert@twinsun.com>
4983
4984 * doc/bison.texinfo: Update copyright date.
4985 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
4986 (Symbols): Warn about running Bison in one character set,
4987 but compiling and/or running in an incompatible one.
4988 Warn about character code 256, too.
4989
49902002-04-03 Paul Eggert <eggert@twinsun.com>
4991
4992 * src/bison.data (YYSTACK_ALLOC): Depend on whether
4993 YYERROR_VERBOSE is nonzero, not whether it is defined.
4994
4995 Merge changes from bison-1_29-branch.
4996
49972002-03-20 Paul Eggert <eggert@twinsun.com>
4998
4999 Merge fixes from Debian bison_1.34-1.diff.
5000
5001 * configure.in (AC_PREREQ): 2.53.
5002
50032002-03-20 Akim Demaille <akim@epita.fr>
5004
5005 * src/conflicts.c (log_resolution): Argument `resolution' is const.
5006
50072002-03-19 Paul Eggert <eggert@twinsun.com>
5008
5009 * src/bison.simple (YYCOPY): New macro.
5010 (YYSTACK_RELOCATE): Use it.
5011 Remove Type arg; no longer needed. All callers changed.
5012 (yymemcpy): Remove; no longer needed.
5013
5014 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
5015 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5016
50172002-03-19 Akim Demaille <akim@epita.fr>
5018
5019 Test and fix the #line outputs.
5020
5021 * tests/atlocal.at (GCC): New.
5022 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
5023 (Prologue synch line, ,%union synch line, Postprologue synch line)
5024 (Action synch line, Epilogue synch line): New tests.
5025 * src/reader.c (parse_union_decl): Define the muscle stype_line.
5026 * data/bison.simple, data/bison.c++: Use it.
5027
50282002-03-19 Akim Demaille <akim@epita.fr>
5029
5030 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
5031 (Solved SR Conflicts, %expect not enough, %expect right)
5032 (%expect too much): Move to...
5033 * tests/conflicts.at: this new file.
5034
50352002-03-19 Akim Demaille <akim@epita.fr>
5036
5037 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5038 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
5039 that we can move to enums for instance.
5040 * src/output.c (token_definitions_output): Output a list of
5041 `token-name, token-number' instead of the #define.
5042 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
5043
50442002-03-14 Akim Demaille <akim@epita.fr>
5045
5046 Use Gettext 0.11.1.
5047
50482002-03-09 Robert Anisko <robert@lrde.epita.fr>
5049
5050 * data/bison.c++: Make the user able to add members to the generated
5051 parser by subclassing.
5052
50532002-03-05 Robert Anisko <robert@lrde.epita.fr>
5054
5055 * src/reader.c (read_additionnal_code): `c' should be an integer, not
5056 a character.
5057 Reported by Nicolas Tisserand and Nicolas Burrus.
5058
50592002-03-04 Robert Anisko <robert@lrde.epita.fr>
5060
5061 * src/reader.c: Warn about lacking semi-colons, do not complain.
5062
50632002-03-04 Robert Anisko <robert@lrde.epita.fr>
5064
5065 * data/bison.c++: Remove a debug line.
5066
50672002-03-04 Robert Anisko <robert@lrde.epita.fr>
5068
5069 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
5070 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
5071 provide a default implementation.
5072
50732002-03-04 Akim Demaille <akim@epita.fr>
5074
5075 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
5076 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
5077 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
5078 * tests/semantic.at (Parsing Guards): Similarly.
5079 * src/reader.at (readgram): Complain if the last rule is not ended
5080 with a semi-colon.
5081
50822002-03-04 Akim Demaille <akim@epita.fr>
5083
5084 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
5085 * src/closure.c: here.
5086 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
5087 RTC.
5088 * src/warshall.h, src/warshall.c: Remove.
5089 * tests/sets.at (Broken Closure): Adjust.
5090
50912002-03-04 Akim Demaille <akim@epita.fr>
5092
5093 * src/output.c (output_skeleton): tempdir is const.
5094 bytes_read is unused.
5095
50962002-03-04 Akim Demaille <akim@epita.fr>
5097
5098 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
5099 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
5100 Update.
5101 From Michael Hayes.
5102
51032002-03-04 Akim Demaille <akim@epita.fr>
5104
5105 * src/closure.c (closure): `r' is unused.
5106
51072002-03-04 Akim Demaille <akim@epita.fr>
5108
5109 * tests/sets.at (Broken Closure): Add the ending `;'.
5110 * src/reader.at (readgram): Complain if a rule is not ended with a
5111 semi-colon.
5112
51132002-03-04 Akim Demaille <akim@epita.fr>
5114
5115 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
5116 (count_sr_conflicts): Use bitset_count.
5117 * src/reduce.c (inaccessable_symbols): Ditto.
5118 (bits_size): Remove.
5119 * src/warshall.h, src/warshall.c: Convert to bitsetv.
5120
51212002-03-04 Akim Demaille <akim@epita.fr>
5122
5123 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
5124 * src/reduce.c: Remove the `bitset_zero's following the
5125 `bitset_create's, as now it is performed by the latter.
5126
51272002-03-04 Akim Demaille <akim@epita.fr>
5128
5129 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
5130 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
5131 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
5132 latest sources from Michael.
5133
51342002-03-04 Akim Demaille <akim@epita.fr>
5135
5136 * src/output.c (output): Don't free the grammar.
5137 * src/reader.c (grammar_free): New.
5138 * src/main.c (main): Call it and don't free symtab here.
5139
51402002-03-04 Akim Demaille <akim@epita.fr>
5141
5142 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
5143 before returning.
5144 Reported by Benoit Perrot.
5145
51462002-03-04 Akim Demaille <akim@epita.fr>
5147
5148 Use bitset operations when possible, not loops over bits.
5149
5150 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
5151 bitset_or.
5152 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
5153 * src/reduce.c (useless_nonterminals): Formatting changes.
5154 * src/warshall.c (TC): Use bitset_or.
5155
51562002-03-04 Akim Demaille <akim@epita.fr>
5157
5158 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
5159 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
5160 Ditto.
5161
51622002-03-04 Akim Demaille <akim@epita.fr>
5163
5164 * src/lalr.c (F): Now a bitset*.
5165 Adjust all dependencies.
5166
51672002-03-04 Akim Demaille <akim@epita.fr>
5168
5169 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
5170 Adjust all dependencies.
5171
51722002-03-04 Akim Demaille <akim@epita.fr>
5173
5174 * src/L0.c, src/LR0.h (nstates): Be size_t.
5175 Adjust comparisons (signed vs unsigned).
5176 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
5177 bitset*.
5178 Adjust all dependencies.
5179
51802002-03-04 Akim Demaille <akim@epita.fr>
5181
5182 * src/closure.c (firsts): Now, also a bitset.
5183 Adjust all dependencies.
5184 (varsetsize): Remove, now unused.
5185 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
5186
51872002-03-04 Akim Demaille <akim@epita.fr>
5188
5189 * src/print.c: Convert to use bitset.h, not hand coded iterations
5190 over ints.
5191
51922002-03-04 Akim Demaille <akim@epita.fr>
5193
5194 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
5195
51962002-03-04 Akim Demaille <akim@epita.fr>
5197
5198 * src/closure.c (ruleset): Be a bitset.
5199 (rulesetsize): Remove.
5200
52012002-03-04 Akim Demaille <akim@epita.fr>
5202
5203 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
5204 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
5205 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
5206 * src/closure.c (fderives): Be an array of bitsets.
5207
52082002-02-28 Robert Anisko <robert@lrde.epita.fr>
5209
5210 * data/bison.c++: Merge the two generated headers. Insert a copyright
5211 notice in each output file.
5212
52132002-02-28 Akim Demaille <akim@epita.fr>
5214
5215 * data/bison.c++: Copy the prologue of bison.simple to fetch
5216 useful M4 definitions, such as b4_header_guard.
5217
52182002-02-25 Akim Demaille <akim@epita.fr>
5219
5220 * src/getargs.c (version): Give the name of the authors, and use a
5221 translator friendly scheme for the bgr
5222 copyright notice.
5223
52242002-02-25 Akim Demaille <akim@epita.fr>
5225
5226 * src/output.c (header_output): Remove, now handled completely via
5227 M4.
5228
52292002-02-25 Akim Demaille <akim@epita.fr>
5230
5231 * m4/m4.m4: New, from CVS Autoconf.
5232 * configure.in: Invoke it.
5233 * src/output.c (output_skeleton): Use its result instead of the
5234 hard coded name.
5235
52362002-02-25 Akim Demaille <akim@epita.fr>
5237
5238 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
5239 Fileutils 4.1.5.
5240 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
5241 * src/output.c (output_skeleton): Use mkstemp to create a real
5242 temporary file.
5243 Move the filling of `skeleton' and its muscle to...
5244 (prepare): here.
5245 (output): Move the definition of the prologue muscle to...
5246 (prepare): here.
5247 * src/system.h (DEFAULT_TMPDIR): New.
5248
52492002-02-14 Paul Eggert <eggert@twinsun.com>
5250
5251 Remove the support for C++ namespace cleanliness; it was
5252 causing more problems than it was curing, since it didn't work
5253 properly on some nonstandard C++ compilers. This can wait
5254 for a proper C++ parser.
5255
5256 * NEWS: Document this.
5257 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
5258 of C++, as it's treated like C now.
5259 * src/bison.simple (YYSTD): Remove.
5260 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
5261 Treat C++ just like Standard C instead of trying to support
5262 namespace cleanliness.
5263
52642002-02-14 Akim Demaille <akim@epita.fr>
5265
5266 * tests/regression.at (else): Adjust to Andreas' change.
5267
52682002-02-14 Akim Demaille <akim@epita.fr>
5269
5270 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
5271
52722002-02-13 Andreas Schwab <schwab@suse.de>
5273
5274 * src/output.c (output_rule_data): Don't output NULL, it might
5275 not be defined yet.
5276
52772002-02-11 Robert Anisko <robert@lrde.epita.fr>
5278
5279 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
5280 (Copyright notice): Update.
5281
52822002-02-11 Akim Demaille <akim@epita.fr>
5283
5284 * tests/regression.at (%nonassoc and eof): Don't include
5285 nonportable headers.
5286
52872002-02-08 Robert Anisko <robert@lrde.epita.fr>
5288
5289 * data/bison.c++: Correct error recovery. Make the user able to
5290 initialize the starting location.
5291
52922002-02-07 Akim Demaille <akim@epita.fr>
5293
5294 * tests/input.at: New.
5295
52962002-02-07 Robert Anisko <robert@lrde.epita.fr>
5297
5298 * data/bison.c++: Replace some direct m4 expansions by constants. Be
5299 more consistent when naming methods and variables. Put preprocessor
5300 directives around tables only needed for debugging.
5301
53022002-02-07 Robert Anisko <robert@lrde.epita.fr>
5303
5304 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
5305 C++ parsers.
5306 (yy::b4_name::parse): Use print_.
5307
53082002-02-07 Robert Anisko <robert@lrde.epita.fr>
5309
5310 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
5311
53122002-02-07 Robert Anisko <robert@lrde.epita.fr>
5313
5314 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
5315 C++ parsers.
5316 (yy::b4_name::parse): Build verbose error messages, and use error_.
5317
53182002-02-06 Robert Anisko <robert@lrde.epita.fr>
5319
5320 * data/bison.c++: Fix m4 quoting in comments.
5321
53222002-02-06 Robert Anisko <robert@lrde.epita.fr>
5323
5324 * data/bison.c++: Adjust the parser code. Fix some muscles that were
5325 not expanded by m4.
5326
53272002-02-05 Akim Demaille <akim@epita.fr>
5328
5329 * data/bison.c++: Adjust to the M4 back end.
5330 More is certainly needed.
5331
53322002-02-05 Akim Demaille <akim@epita.fr>
5333
5334 Give a try to M4 as a back end.
5335
5336 * lib/readpipe.c: New, from wdiff.
5337 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
5338 BISON_HAIRY.
5339 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
5340 specific values. Now it is m4 that performs the lookup.
5341 * src/parse-skel.y: Remove.
5342 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
5343 * src/output.c (actions_output, guards_output)
5344 (token_definitions_output): No longer keeps track of the output
5345 line number, hence remove the second argument.
5346 (guards_output): Check against the guard member of a rule, not the
5347 action member.
5348 Adjust callers.
5349 (output_skeleton): Don't look for the skeleton location, let m4 do
5350 that.
5351 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
5352 file will be used.
5353 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
5354 (prepare): Given that for the time being changesyntax is not
5355 usable in M4, rename the muscles using `-' to `_'.
5356 Define `defines_flag', `output_parser_name' and `output_header_name'.
5357 * src/output.h (actions_output, guards_output)
5358 (token_definitions_output): Adjust prototypes.
5359 * src/scan-skel.l: Instead of scanning the skeletons, it now
5360 processes the output of m4: `__oline__' and `#output'.
5361 * data/bison.simple: Adjust to be used by M4(sugar).
5362 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
5363 to date.
5364 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
5365 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
5366 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
5367 shamelessly stolen from CVS Autoconf.
5368
53692002-02-05 Akim Demaille <akim@epita.fr>
5370
5371 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
5372 * configure.in: Check for the declarations of free and malloc.
5373 * src/muscle_tab.c: Adjust.
5374
53752002-02-05 Akim Demaille <akim@epita.fr>
5376
5377 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
5378 which have no values.
5379
53802002-02-05 Akim Demaille <akim@epita.fr>
5381
5382 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
5383 * data/: here.
5384
53852002-01-29 Paul Eggert <eggert@twinsun.com>
5386
5387 * src/bison.simple (YYSIZE_T): Do not define merely because
5388 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
5389 On some platforms, <alloca.h> does not declare YYSTD (size_t).
5390
53912002-01-27 Akim Demaille <akim@epita.fr>
5392
5393 Fix `%nonassoc and eof'.
5394
5395 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
5396 which were not properly copied! Replace
5397 memcpy (res->errs, src->errs, src->nerrs);
5398 with
5399 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
5400 !!!
5401 * tests/regression.at (%nonassoc and eof): Adjust to newest
5402 Autotest: `.' is not in the PATH.
5403
54042002-01-27 Akim Demaille <akim@epita.fr>
5405
5406 * tests/sets.at (AT_EXTRACT_SETS): New.
5407 (Nullable): Use it.
5408 (Firsts): New.
5409
54102002-01-26 Akim Demaille <akim@epita.fr>
5411
5412 * tests/actions.at, tests/calc.at, tests/headers.at,
5413 * tests/torture.at: Adjust to the newest Autotest which no longer
5414 forces `.' in the PATH.
5415
54162002-01-25 Akim Demaille <akim@epita.fr>
5417
5418 * tests/regression.at (%nonassoc and eof): New.
5419 Suggested by Robert Anisko.
5420
54212002-01-24 Akim Demaille <akim@epita.fr>
5422
5423 Bison dumps core when trying to complain about broken input files.
5424 Reported by Cris van Pelt.
5425
5426 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
5427 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
5428 into...
5429 (Invalid inputs): Strengthen: exercise parse_percent_token.
5430
54312002-01-24 Robert Anisko <robert.anisko@epita.fr>
5432
5433 * src/Makefile.am: Add bison.c++.
5434 * src/bison.c++: New skeleton.
5435
54362002-01-21 Paolo Bonzini <bonzini@gnu.org>
5437
5438 * po/it.po: New.
5439
54402002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
5441
5442 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
5443
54442002-01-20 Marc Autret <marc@gnu.org>
5445
5446 * src/files.c (compute_output_file_names): Fix
5447
54482002-01-20 Marc Autret <marc@gnu.org>
5449
5450 * tests/output.at: New test.
5451 * src/files.c (compute_base_names): Don't map extensions when
5452 the YACC flag is set, use defaults.
5453 Reported by Evgeny Stambulchik.
5454
54552002-01-20 Marc Autret <marc@gnu.org>
5456
5457 * src/system.h: Need to define __attribute__ away for non-GCC
5458 compilers as well (i.e. the vendor C compiler).
5459 Suggested by Albert Chin-A-Young.
5460
54612002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
5462
5463 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
5464 canonical definition.
5465 * src/system.h: Use the canonical definition for PARAMS (avoids
5466 a conflict with the macro from lib/hash.h).
5467
54682002-01-11 Akim Demaille <akim@epita.fr>
5469
5470 * configure.in: Use AC_FUNC_STRNLEN.
5471 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
5472
54732002-01-09 Akim Demaille <akim@epita.fr>
5474
5475 * src/files.c, src/files.h (output_infix): New.
5476 (tab_extension): Remove.
5477 (compute_base_names): Compute the former, drop the latter.
5478 * src/output.c (prepare): Insert the muscles `output-infix', and
5479 `output-suffix'.
5480 * src/parse-skel.y (string, string.1): New.
5481 (section.header): Use it.
5482 (section.yacc): Remove.
5483 (prefix): Remove too.
5484 * src/scan-skel.l: Adjust.
5485 * src/bison.simple, src/bison.hairy: Adjust.
5486
54872002-01-09 Akim Demaille <akim@epita.fr>
5488
5489 * configure.in (WERROR_CFLAGS): Compute it.
5490 * src/Makefile.am (CFLAGS): Pass it.
5491 * tests/atlocal.in (CFLAGS): Idem.
5492 * src/files.c: Fix a few warnings.
5493 (get_extension_index): Remove, unused.
5494
54952002-01-08 Akim Demaille <akim@epita.fr>
5496
5497 * src/getargs.c (AS_FILE_NAME): New.
5498 (getargs): Use it to convert DOSish file names.
5499 * src/files.c (base_name): Rename as full_base_name to avoid
5500 clashes with `base_name ()'.
5501 (filename_split): New.
5502 (compute_base_names): N-th rewrite, using filename_split.
5503
55042002-01-08 Akim Demaille <akim@epita.fr>
5505
5506 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
5507 New, stolen from the Fileutils 4.1.
5508 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
5509 * configure.in: Check for the presence of memrchr, and of its
5510 prototype.
5511
55122002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
5513
5514 * lib/hash.h (__P): Added definition for this macro.
5515 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
5516 BUILT_SOURCES, to ensure they are generated first.
5517 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
5518 %error-verbose to allow bootstrapping with bison 1.30x.
5519
55202002-01-06 Akim Demaille <akim@epita.fr>
5521
5522 * src/reader.c (parse_braces): Don't fetch the next char, the
5523 convention is to fetch on entry.
5524 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
5525 'switch' without a following semicolon.
5526 * tests/regression.at (braces parsing): New.
5527
55282002-01-06 Akim Demaille <akim@epita.fr>
5529
5530 Bison is dead wrong in its RR conflict reports.
5531
5532 * tests/torture.at (GNU Cim Grammar): New.
5533 * src/conflicts.c (count_rr_conflicts): Fix.
5534
55352002-01-06 Akim Demaille <akim@epita.fr>
5536
5537 Creating package.m4 from configure.ac causes too many problems.
5538
5539 * tests/Makefile.am (package.m4): Create it by hand,
5540 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
5541
55422002-01-06 Akim Demaille <akim@epita.fr>
5543
5544 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
5545 skeleton.h.
5546
55472002-01-04 Paul Eggert <eggert@twinsun.com>
5548
5549 * doc/bison.texinfo (Debugging):
5550 Remove YYSTDERR; it's no longer defined or used.
5551 Also, s/cstdio.h/cstdio/.
5552
55532002-01-03 Akim Demaille <akim@epita.fr>
5554
5555 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
5556
55572002-01-03 Akim Demaille <akim@epita.fr>
5558
5559 * src/parse-skel.y (process_skeleton): Don't bind the parser's
5560 tracing code to --trace, wait for a better --trace option, with
5561 args.
5562
55632002-01-03 Akim Demaille <akim@epita.fr>
5564
5565 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
5566 The ISO C++ standard is extremely clear about it: stderr is
5567 considered a macro, not a regular symbol (see table 94 `Header
5568 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
5569 Therefore std:: does not apply to it. It still does with fprintf.
5570 Also, s/cstdio.h/cstdio/.
5571
55722002-01-03 Akim Demaille <akim@epita.fr>
5573
5574 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
5575 for non system headers.
5576
55772002-01-02 Akim Demaille <akim@epita.fr>
5578
5579 Equip the skeleton chain with location tracking, runtime trace,
5580 pure parser and scanner.
5581
5582 * src/parse-skel.y: Request a pure parser, locations, and prefix
5583 renaming.
5584 (%union): Having several members with the same type does not help
5585 type mismatches, simplify.
5586 (YYPRINT, yyprint): New.
5587 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
5588 (skel_error): this.
5589 Handle locations.
5590 * src/scan-skel.l: Adjust to these changes.
5591 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
5592 (LOCATION_PRINT, skel_control_t): New.
5593
55942001-12-30 Akim Demaille <akim@epita.fr>
5595
5596 * src/parse-skel.y: Get rid of the shift/reduce conflict:
5597 replace `gb' with BLANKS.
5598 * src/scan-skel.l: Adjust.
5599
56002001-12-30 Akim Demaille <akim@epita.fr>
5601
5602 * src/system.h: We don't need nor want bcopy.
5603 Throw away MS-DOS crap: we don't need getpid.
5604 * configure.in: We don't need strndup. It was even causing
5605 problems: because Flex includes the headers *before* us,
5606 _GNU_SOURCE is not defined by config.h, and therefore strndup was
5607 not visible.
5608 * lib/xstrndup.c: New.
5609 * src/scan-skel.l: Use it.
5610 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
5611 * src/parse-skel.y: Use %directives instead of #defines.
5612
56132001-12-30 Akim Demaille <akim@epita.fr>
5614
5615 * src/skeleton.h: New.
5616 * src/output.c (output_parser, output_master_parser): Remove, dead
5617 code.
5618 * src/output.h (get_lines_number, actions_output, guards_output)
5619 (token_definitions_output): Prototype them.
5620 * src/parse-skel.y: Add the license notice.
5621 Include output.h and skeleton.h.
5622 (process_skeleton): Returns void, and takes a single parameter.
5623 * src/scan-skel.l: Add the license notice.
5624 Include skeleton.h.
5625 Don't use %option yylineno: it seems that then Flex imagines
5626 REJECT has been used, and therefore it won't reallocate its
5627 buffers (which makes no other sense to me than a bug). It results
5628 in warnings for `unused: yy_flex_realloc'.
5629
56302001-12-30 Robert Anisko <robert.anisko@epita.fr>
5631
5632 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
5633 (MUSCLE_INSERT_PREFIX): ...to there.
5634 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
5635 (MUSCLE_INSERT_PREFIX): Move from here...
5636
5637 * src/bison.hairy: Add a section directive. Put braces around muscle
5638 names. This parser skeleton is still broken, but Bison should not
5639 choke on a bad muscle 'syntax'.
5640 * src/bison.simple: Add a section directive. Put braces around muscle
5641 names.
5642
5643 * src/files.h (strsuffix, stringappend): Add declarations.
5644 (tab_extension): Add declaration.
5645 (short_base_name): Add declaration.
5646
5647 * src/files.c (strsuffix, stringappend): No longer static. These
5648 functions are used in the skeleton parser.
5649 (tab_extension): New.
5650 (compute_base_names): Use the computations done in this function
5651 to guess if the generated parsers should have '.tab' in their
5652 names.
5653 (short_base_name): No longer static.
5654
5655 * src/output.c (output_skeleton): New.
5656 (output): Disable call to output_master_parser, and give a try to
5657 a new skeleton handling system.
5658 (guards_output, actions_output): No longer static.
5659 (token_definitions_output, get_lines_number): No longer static.
5660
5661 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
5662
5663 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
5664 parse-skel.y.
5665
5666 * src/parse-skel.y: New file.
5667 * src/scan-skel.l: New file.
5668
56692001-12-29 Akim Demaille <akim@epita.fr>
5670
5671 %name-prefix is broken.
5672
5673 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
5674 Adjust all dependencies.
5675 * tests/headers.at (export YYLTYPE): Strengthen this test: use
5676 %name-prefix.
5677
5678 Renaming yylval but not yylloc is not consistent. Now we do.
5679
5680 * src/bison.simple: Prefix yylloc if used.
5681 * doc/bison.texinfo (Decl Summary): Document that.
5682
56832001-12-29 Akim Demaille <akim@epita.fr>
5684
5685 * doc/bison.texinfo: Promote `%long-directive' over
5686 `%long_directive'.
5687 Remove all references to fixed-output-files, yacc is enough.
5688
56892001-12-29 Akim Demaille <akim@epita.fr>
5690
5691 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
5692 user prologue. These are defaults.
5693 * tests/actions.at (Mid-rule actions): Make sure the user can
5694 define YYDEBUG and YYERROR_VERBOSE.
5695
56962001-12-29 Akim Demaille <akim@epita.fr>
5697
5698 * src/output.c (header_output): Don't forget to export YYLTYPE and
5699 yylloc.
5700 * tests/headers.at (export YYLTYPE): New, make sure it does.
5701 * tests/regression.at (%union and --defines, Invalid CPP headers):
5702 Move to...
5703 * tests/headers.at: here.
5704
57052001-12-29 Akim Demaille <akim@epita.fr>
5706
5707 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
5708
57092001-12-29 Akim Demaille <akim@epita.fr>
5710
5711 * tests/actions.at (Mid-rule actions): Output on a single line
5712 instead of several.
5713
57142001-12-29 Akim Demaille <akim@epita.fr>
5715
5716 * doc/bison.texinfo: Formatting changes.
5717
57182001-12-29 Akim Demaille <akim@epita.fr>
5719
5720 Don't store the token defs in a muscle, just be ready to output it
5721 on command. Now possible via `symbols'. Fixes a memory leak.
5722
5723 * src/output.c (token_definitions_output): New.
5724 (output_parser, header_output): Use it.
5725 * src/reader.c (symbols_save): Remove.
5726
57272001-12-29 Akim Demaille <akim@epita.fr>
5728
5729 * src/bison.simple: Do not provide a default for YYSTYPE and
5730 YYLTYPE before the user's prologue. Otherwise it's hardly... a
5731 default.
5732
57332001-12-29 Akim Demaille <akim@epita.fr>
5734
5735 Mid-rule actions are simply... ignored!
5736
5737 * src/reader.c (readgram): Be sure to attach mid-rule actions to
5738 the empty-rule associated to the dummy symbol, not to the host
5739 rule.
5740 * tests/actions.at (Mid-rule actions): New.
5741
57422001-12-29 Akim Demaille <akim@epita.fr>
5743
5744 Memory leak.
5745
5746 * src/reader.c (reader): Free grammar.
5747
57482001-12-29 Akim Demaille <akim@epita.fr>
5749
5750 Memory leak.
5751
5752 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
5753 since it allocates it for each state, although only one is needed.
5754 (allocate_storage): Do it here.
5755
57562001-12-29 Akim Demaille <akim@epita.fr>
5757
5758 * src/options.h, src/options.c (create_long_option_table): Rename
5759 as...
5760 (long_option_table_new): this, with a clearer prototype.
5761 (percent_table): Remove, unused,
5762 * src/getargs.c (getargs): Adjust.
5763
57642001-12-29 Akim Demaille <akim@epita.fr>
5765
5766 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
5767 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
5768 as states.
5769
57702001-12-29 Akim Demaille <akim@epita.fr>
5771
5772 * src/lalr.c (build_relations): Rename `states' as `states1'.
5773 Sorry, I don't understand exactly what it is, no better name...
5774
57752001-12-29 Akim Demaille <akim@epita.fr>
5776
5777 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
5778 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
5779 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
5780 as rules.
5781
57822001-12-29 Akim Demaille <akim@epita.fr>
5783
5784 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
5785 ago.
5786
57872001-12-29 Akim Demaille <akim@epita.fr>
5788
5789 * src/reader.c, src/reader.h (user_toknums): Remove.
5790 Adjust all users to use symbols[i]->user_token_number.
5791
57922001-12-29 Akim Demaille <akim@epita.fr>
5793
5794 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
5795 Adjust all users to use symbols[i]->prec or ->assoc.
5796
57972001-12-29 Akim Demaille <akim@epita.fr>
5798
5799 * src/reader.c, src/reader.h (tags): Remove.
5800 Adjust all users to use symbols[i]->tag.
5801
58022001-12-29 Akim Demaille <akim@epita.fr>
5803
5804 * src/gram.h, src/gram.c (symbols): New, similar to state_table
5805 and rule_table.
5806 * src/reader.c (packsymbols): Fill this table.
5807 Drop sprec.
5808 * src/conflicts.c (resolve_sr_conflict): Adjust.
5809 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
5810 single table.
5811 Use symbols[i]->tag instead of tags[i].
5812
58132001-12-29 Akim Demaille <akim@epita.fr>
5814
5815 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
5816 In addition, put a comment in there, to replace...
5817 * tests/regression.at (%union and C comments): Remove.
5818
58192001-12-29 Akim Demaille <akim@epita.fr>
5820
5821 * tests/regression.at (Web2c Actions): Blindly move the actual
5822 output as expected output. The contents *seem* right to me, but I
5823 can't pretend reading perfectly parser tables... Nonetheless, all
5824 the other tests pass correctly, the table look OK, even though the
5825 presence of `$axiom' is to be noted: AFAICS it is useless (but
5826 harmless).
5827
58282001-12-29 Akim Demaille <akim@epita.fr>
5829
5830 * src/reader.c (readgram): Don't add the rule 0 if there were no
5831 rules read. In other words, add it _after_ having performed
5832 grammar sanity checks.
5833 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
5834
58352001-12-29 Akim Demaille <akim@epita.fr>
5836
5837 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
5838 visible, and some states have now a different number.
5839
58402001-12-29 Akim Demaille <akim@epita.fr>
5841
5842 * src/reader.c (readgram): Bind the initial rule's lineno to that
5843 of the first rule.
5844 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
5845 (Solved SR Conflicts): Adjust rule 0's line number.
5846
58472001-12-29 Akim Demaille <akim@epita.fr>
5848
5849 Fix the `GAWK Grammar' failure.
5850
5851 * src/LR0.c (final_state): Initialize to -1 so that we do compute
5852 the reductions of the first state which was mistakenly confused
5853 with the final state because precisely final_state was initialized
5854 to 0.
5855 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
5856 now noticed by Bison.
5857 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
5858 have a reduction on $default.
5859
58602001-12-29 Akim Demaille <akim@epita.fr>
5861
5862 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
5863 rule line numbers.
5864 * src/closure.c (print_closure): Likewise.
5865 * src/derives.c (print_derives): Likewise.
5866 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
5867 now.
5868
58692001-12-29 Akim Demaille <akim@epita.fr>
5870
5871 * src/lalr.c (lookaheads_print): New.
5872 (lalr): Call it when --trace-flag.
5873 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
5874 are dumped.
5875
58762001-12-29 Akim Demaille <akim@epita.fr>
5877
5878 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
5879 when walking through ritem, even via rule->rhs.
5880 * src/reduce.c (dump_grammar, useful_production, reduce_output)
5881 (useful_production, useless_nonterminals): Likewise.
5882 (reduce_grammar_tables): Likewise, plus update nritems.
5883 * src/nullable.c (set_nullable): Likewise.
5884 * src/lalr.c (build_relations): Likewise.
5885 * tests/sets.at (Nullable): Adjust.
5886 Fortunately, now, the $axiom is no longer nullable.
5887
58882001-12-29 Akim Demaille <akim@epita.fr>
5889
5890 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
5891 the 0-sentinel.
5892 * src/gram.c (ritem_longest_rhs): Likewise.
5893 * src/reduce.c (nonterminals_reduce): Likewise.
5894 * src/print_graph.c (print_graph): Likewise.
5895 * src/output.c (output_rule_data): Likewise.
5896 * src/nullable.c (set_nullable): Likewise.
5897
58982001-12-29 Akim Demaille <akim@epita.fr>
5899
5900 * src/output.c: Comment changes.
5901
59022001-12-27 Paul Eggert <eggert@twinsun.com>
5903
5904 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
5905 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
5906 Sparc, as they were causing more porting problems than the
5907 (minor) performance improvement was worth.
5908
5909 Also, catch up with 1.31's YYSTD.
5910
59112001-12-27 Akim Demaille <akim@epita.fr>
5912
5913 * src/output.c (output_gram): Rely on nritems, not the
5914 0-sentinel. See below.
5915 Use -1 as separator, not 0.
5916 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
5917 Rely on -1 as separator in yyrhs, instead of 0.
5918 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
5919 twice `Now at end of input', therefore there are two lines less to
5920 expect.
5921
59222001-12-27 Akim Demaille <akim@epita.fr>
5923
5924 * tests/regression.at (Unresolved SR Conflicts):
5925 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
5926 below.
5927
59282001-12-27 Akim Demaille <akim@epita.fr>
5929
5930 * src/LR0.c (new_state): Recognize the final state by the fact it
5931 is reached by eoftoken.
5932 (insert_start_shifting_state, insert_eof_shifting_state)
5933 (insert_accepting_state, augment_automaton): Remove, since now
5934 these states are automatically computed from the initial state.
5935 (generate_states): Adjust.
5936 * src/print.c: When reporting a rule number to the user, substract
5937 1, so that the axiom rule is rule 0, and the first user rule is 1.
5938 * src/reduce.c: Likewise.
5939 * src/print_graph.c (print_core): For the time being, just as for
5940 the report, depend upon --trace-flags to dump the full set of
5941 items.
5942 * src/reader.c (readgram): Once the grammar read, insert the rule
5943 0: `$axiom: START-SYMBOL $'.
5944 * tests/set.at: Adjust: rule 0 is now displayed, and since the
5945 number of the states has changed (the final state is no longer
5946 necessarily the last), catch up.
5947
59482001-12-27 Akim Demaille <akim@epita.fr>
5949
5950 Try to make the use of the eoftoken valid. Given that its value
5951 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
5952 is used instead of > 0 where appropriate, (ii), depend upon nritems
5953 instead of the 0-sentinel.
5954
5955 * src/gram.h, src/gram.c (nritems): New.
5956 Expected to be duplication of nitems, but for the time being...
5957 * src/reader.c (packgram): Assert nritems and nitems are equal.
5958 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
5959 * src/closure.c (print_closure, print_fderives): Likewise.
5960 * src/gram.c (ritem_print): Likewise.
5961 * src/print.c (print_core, print_grammar): Likewise.
5962 * src/print_graph.c: Likewise.
5963
59642001-12-27 Akim Demaille <akim@epita.fr>
5965
5966 * src/main.c (main): If there are complains after grammar
5967 reductions, then output the report anyway if requested, then die.
5968 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
5969 * src/reader.c (eoftoken): New.
5970 (parse_token_decl): If the token being defined has value `0', it
5971 is the eoftoken.
5972 (packsymbols): No longer hack `tags' to insert `$' by hand.
5973 Be sure to preserve the value of the eoftoken.
5974 (reader): Make sure eoftoken is defined.
5975 Initialize nsyms to 0: now eoftoken is created just like the others.
5976 * src/print.c (print_grammar): Don't special case the eof token.
5977 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
5978 lie anyway, albeit pleasant.
5979 * tests/calc.at: Exercise error messages with eoftoken.
5980 Change the grammar so that empty input is invalid.
5981 Adjust expectations.
5982 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
5983
59842001-12-27 Akim Demaille <akim@epita.fr>
5985
5986 * configure.in: Check the protos of strchr ans strspn.
5987 Replace strchr if needed.
5988 * src/system.h: Provide the protos of strchr, strspn and memchr if
5989 missing.
5990 * lib/strchr.c: New.
5991 * src/reader.c (symbols_save): Use strchr.
5992
59932001-12-27 Akim Demaille <akim@epita.fr>
5994
5995 * src/print.c, src/print_graph.c (escape): New.
5996 Use it to quote the TAGS outputs.
5997 * src/print_graph.c (print_state): Now errors are in red, and
5998 reductions in green.
5999 Prefer high to wide: output the state number on a line of its own.
6000
60012001-12-27 Akim Demaille <akim@epita.fr>
6002
6003 * src/state.h, src/state.c (reductions_new): New.
6004 * src/LR0.c (set_state_table): Let all the states have a
6005 `reductions', even if reduced to 0.
6006 (save_reductions): Adjust.
6007 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
6008 * src/print.c (print_reductions, print_actions): Adjust.
6009 * src/output.c (action_row): Adjust.
6010
60112001-12-27 Akim Demaille <akim@epita.fr>
6012
6013 * src/state.h, src/state.c (errs_new, errs_dup): New.
6014 * src/LR0.c (set_state_table): Let all the states have an errs,
6015 even if reduced to 0.
6016 * src/print.c (print_errs, print_reductions): Adjust.
6017 * src/output.c (output_actions, action_row): Adjust.
6018 * src/conflicts.c (resolve_sr_conflict): Adjust.
6019
60202001-12-27 Akim Demaille <akim@epita.fr>
6021
6022 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
6023
60242001-12-27 Akim Demaille <akim@epita.fr>
6025
6026 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
6027 * src/print.c: here.
6028 (lookaheadset, shiftset): New, used as additional storage by
6029 print_reductions.
6030 (print_results): Adjust.
6031 (print_shifts, print_gotos, print_errs): New, extracted from...
6032 (print_actions): here.
6033 * src/print_graph.c (print_actions): Remove dead code.
6034
60352001-12-27 Akim Demaille <akim@epita.fr>
6036
6037 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
6038 `$n' and `@n'.
6039
60402001-12-27 Akim Demaille <akim@epita.fr>
6041
6042 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
6043 (build_relations): Adjust.
6044
60452001-12-27 Akim Demaille <akim@epita.fr>
6046
6047 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
6048 duplication.
6049
60502001-12-27 Akim Demaille <akim@epita.fr>
6051
6052 * src/reader.c (packgram): Catch nitems overflows.
6053
60542001-12-27 Akim Demaille <akim@epita.fr>
6055
6056 * src/files.c, src/files.h (guard_obstack): Remove.
6057 * src/output.c (output): Adjust.
6058 * src/reader.c (parse_braces): New, factoring...
6059 (copy_action, copy_guard): these two which are renamed as...
6060 (parse_action, parse_guard): these.
6061 As a voluntary consequence, using braces around guards is now
6062 mandatory.
6063
60642001-12-27 Akim Demaille <akim@epita.fr>
6065
6066 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
6067 * src/reader.c (symbol_list): `guard' and `guard_line' are new
6068 members.
6069 (symbol_list_new): Adjust.
6070 (copy_action): action_line is the first line, not the last.
6071 (copy_guard): Just as for actions, store the `action' only, not
6072 the switch/case/break flesh.
6073 Don't parse the user action that might follow the guard, let...
6074 (readgram): do it, i.e., now, there can be an action after a
6075 guard.
6076 In other words the guard is just explicitly optional.
6077 (packgram): Adjust.
6078 * src/output.c (guards_output): New.
6079 (output_parser): Call it when needed.
6080 (output): Also free the guard and attrs obstacks.
6081 * src/files.c, src/files.h (obstack_save): Remove.
6082 (output_files): Remove.
6083 As a result, if one needs the former `.act' file, using an
6084 appropriate skeleton which requires actions and guards is now
6085 required.
6086 * src/main.c (main): Adjust.
6087 * tests/semantic.at: New.
6088 * tests/regression.at: Use `input.y' as input file name.
6089 Avoid 8+3 problems by requiring input.c when the test needs the
6090 parser.
6091
60922001-12-27 Akim Demaille <akim@epita.fr>
6093
6094 * src/reader.c (symbol_list_new): Be sure to initialize all the
6095 fields.
6096
60972001-12-27 Akim Demaille <akim@epita.fr>
6098
6099 All the hacks using a final pseudo state are now useless.
6100
6101 * src/LR0.c (set_state_table): state_table holds exactly nstates.
6102 * src/lalr.c (nLA): New.
6103 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
6104 instead of lookaheadsp from the pseudo state (nstate + 1).
6105
61062001-12-27 Akim Demaille <akim@epita.fr>
6107
6108 * src/output.c (action_row, token_actions): Use a state_t instead
6109 of a integer, and nlookaheads instead of the following state's
6110 lookaheadsp.
6111
61122001-12-27 Akim Demaille <akim@epita.fr>
6113
6114 * src/conflicts.c (log_resolution, flush_shift)
6115 (resolve_sr_conflict, set_conflicts, solve_conflicts)
6116 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
6117 (conflicts_print, print_reductions): Use a state_t instead of an
6118 integer when referring to a state.
6119 As much as possible, depend upon nlookaheads, instead of the
6120 `lookaheadsp' member of the following state (since lookaheads of
6121 successive states are successive, the difference between state n + 1
6122 and n served as the number of lookaheads for state n).
6123 * src/lalr.c (add_lookback_edge): Likewise.
6124 * src/print.c (print_core, print_actions, print_state)
6125 (print_results): Likewise.
6126 * src/print_graph.c (print_core, print_actions, print_state)
6127 (print_graph): Likewise.
6128 * src/conflicts.h: Adjust.
6129
61302001-12-27 Akim Demaille <akim@epita.fr>
6131
6132 * src/bison.hairy: Formatting/comment changes.
6133 ANSIfy.
6134 Remove `register' indications.
6135 Add plenty of `static'.
6136
61372001-12-27 Akim Demaille <akim@epita.fr>
6138
6139 * src/output.c (prepare): Drop the muscle `ntbase' which
6140 duplicates ntokens.
6141 * src/bison.simple: Formatting/comment changes.
6142 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
6143 is an undocumented synonym.
6144
61452001-12-22 Akim Demaille <akim@epita.fr>
6146
6147 * src/output.c (output_table_data): Change the prototype to use
6148 `int' for array ranges: some invocations do pass an int, not a
6149 short.
6150 Reported by Wayne Green.
6151
61522001-12-22 Akim Demaille <akim@epita.fr>
6153
6154 Some actions of web2c.y are improperly triggered.
6155 Reported by Mike Castle.
6156
6157 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
6158 * tests/regression.at (Web2c): Rename as...
6159 (Web2c Report): this.
6160 (Web2c Actions): New.
6161
61622001-12-22 Akim Demaille <akim@epita.fr>
6163
6164 Reductions in web2c.y are improperly reported.
6165 Reported by Mike Castle.
6166
6167 * src/conflicts.c (print_reductions): Fix.
6168 * tests/regression.at (Web2c): New.
6169
61702001-12-18 Akim Demaille <akim@epita.fr>
6171
6172 Some host fail on `assert (!"foo")', which expands to
6173 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
6174 Reported by Nelson Beebee.
6175
6176 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
6177 `#define it_succeeded 0' and `assert (it_succeeded)'.
6178
61792001-12-17 Marc Autret <autret_m@epita.fr>
6180
6181 * src/bison.simple: Don't hard code the skeleton line and filename.
6182 * src/output.c (output_parser): Rename 'line' as 'output_line'.
6183 New line counter 'skeleton_line' (skeleton-line muscle).
6184
61852001-12-17 Paul Eggert <eggert@twinsun.com>
6186
6187 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
6188 YYDEBUG must be defined to a nonzero value.
6189
6190 * src/bison.simple (yytname): Do not assume that the user defines
6191 YYDEBUG to a properly parenthesized expression.
6192
61932001-12-17 Akim Demaille <akim@epita.fr>
6194
6195 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
6196 nlookaheads is a new member.
6197 Adjust all users.
6198 * src/lalr.h (nlookaheads): Remove this orphan declaration.
6199 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
6200 state.
6201
62022001-12-17 Akim Demaille <akim@epita.fr>
6203
6204 * src/files.h, src/files.c (open_files, close_files): Remove.
6205 * src/main.c (main): Don't open/close files, nor invoke lex_free,
6206 let...
6207 * src/reader.c (reader): Do it.
6208
62092001-12-17 Akim Demaille <akim@epita.fr>
6210
6211 * src/conflicts.c (print_reductions): Formatting changes.
6212
62132001-12-17 Akim Demaille <akim@epita.fr>
6214
6215 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
6216 (flush_reduce): New.
6217 (resolve_sr_conflict): Adjust.
6218
62192001-12-17 Akim Demaille <akim@epita.fr>
6220
6221 * src/output.c (output_obstack): Be static and rename as...
6222 (format_obstack): this, to avoid any confusion with files.c's
6223 output_obstack.
6224 * src/reader.h (muscle_obstack): Move to...
6225 * src/output.h: here, since it's defined in output.c.
6226
62272001-12-17 Akim Demaille <akim@epita.fr>
6228
6229 * src/output.c (action_row, save_column, default_goto)
6230 (sort_actions, matching_state, pack_vector): Better variable
6231 locality.
6232
62332001-12-17 Akim Demaille <akim@epita.fr>
6234
6235 * src/output.c: Various formatting changes.
6236
62372001-12-17 Akim Demaille <akim@epita.fr>
6238
6239 * src/files.c (output_files): Free the output_obstack.
6240 * src/main.c (main): Call print and print_graph conditionally.
6241 * src/print.c (print): Work unconditionally.
6242 * src/print_graph.c (print_graph): Work unconditionally.
6243 * src/conflicts.c (log_resolution): Output only if verbose_flag.
6244
62452001-12-16 Marc Autret <autret_m@epita.fr>
6246
6247 * src/output.c (actions_output): Fix. When we use %no-lines,
6248 there is one less line per action.
6249
62502001-12-16 Marc Autret <autret_m@epita.fr>
6251
6252 * src/bison.simple: Remove a useless #line directive.
6253 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
6254 * src/output.c (get_lines_number): New.
6255 (output_parser): Adjust, now takes care about the lines of a
6256 output muscles.
6257 Fix line numbering.
6258 (actions_output): Computes the number of lines taken by actions.
6259 (output_master_parser): Insert new skeleton which is the name of
6260 the output parser file name.
6261
62622001-12-15 Marc Autret <autret_m@epita.fr>
6263
6264 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
6265
62662001-12-15 Marc Autret <autret_m@epita.fr>
6267
6268 * src/output.c (output_gram): Keep track of the hairy one.
6269
62702001-12-15 Akim Demaille <akim@epita.fr>
6271
6272 Make `make distcheck' work.
6273
6274 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
6275 system.h which uses libgettext.h.
6276
62772001-12-15 Akim Demaille <akim@epita.fr>
6278
6279 * src/nullable.c (set_nullable): Useless rules must be skipped,
6280 otherwise, since we range over their symbols, we might look at a
6281 nonterminal which no longer ``exists'', i.e., it is not counted in
6282 `nvars', hence we overflow our arrays.
6283
62842001-12-15 Akim Demaille <akim@epita.fr>
6285
6286 The header can also be produced directly, without any obstack!
6287 Yahoo!
6288
6289 * src/files.c, src/files.h (defines_obstack): Remove.
6290 (compute_header_macro): Global.
6291 (defines_obstack_save): Remove.
6292 * src/reader.c (parse_union_decl): No longer output to
6293 defines_obstack: its content can be found in the `stype' muscle
6294 anyway.
6295 (output_token_translations): Merge into...
6296 (symbols_output): this.
6297 Rename as...
6298 (symbols_save): this.
6299 (reader): Adjust.
6300 * src/output.c (header_output): New.
6301 (output): Call it.
6302
63032001-12-15 Akim Demaille <akim@epita.fr>
6304
6305 * src/reader.c (parse_union_decl): Instead of handling two obstack
6306 simultaneously, use one to define the `stype' muscle, and use the
6307 value of the latter to fill defines_obstack.
6308 (copy_comment): Remove.
6309 (copy_comment2): Work for a single obstack.
6310 Rename as...
6311 (copy_comment): this.
6312
63132001-12-15 Akim Demaille <akim@epita.fr>
6314
6315 * src/lex.c, src/lex.h (xgetc): No longer static.
6316 * src/reader.c (parse_union_decl): Revamp.
6317
63182001-12-15 Akim Demaille <akim@epita.fr>
6319
6320 Still making progress in separating Bison into (i) input, (ii)
6321 process, (iii) output: now we can directly output the parser file
6322 without using table_obstack at all.
6323
6324 * src/files.c, src/files.h (table_obstack): Bye bye.
6325 (parser_file_name): New.
6326 * src/files.c (compute_output_file_names): Compute it.
6327 * src/output.c (actions_output, output_parser)
6328 (output_master_parser): To a file instead of an obstack.
6329
63302001-12-15 Akim Demaille <akim@epita.fr>
6331
6332 Attach actions to rules, instead of pre-outputting them to
6333 actions_obstack.
6334
6335 * src/gram.h (rule_t): action and action_line are new members.
6336 * src/reader.c (symbol_list): Likewise.
6337 (copy_action): Save the actions within the rule.
6338 (packgram): Save them in rule_table.
6339 * src/output.c (actions_output): New.
6340 (output_parser): Use it on `%%actions'.
6341 (output_rule_data): Don't free rule_table.
6342 (output): Do it.
6343 (prepare): Don't save the `action' muscle.
6344 * src/bison.simple: s/%%action/%%actions/.
6345
63462001-12-15 Akim Demaille <akim@epita.fr>
6347
6348 * src/reader.c (copy_action): When --yacc, don't append a `;'
6349 to the user action: let it fail if lacking.
6350 Suggested by Arnold Robbins and Tom Tromey.
6351
63522001-12-14 Akim Demaille <akim@epita.fr>
6353
6354 * src/lex.c (literalchar): Simply return the char you decoded, non
6355 longer mess around with obstacks and int pointers.
6356 Adjust all callers.
6357
63582001-12-14 Akim Demaille <akim@epita.fr>
6359
6360 * src/lex.c (literalchar): Don't escape the special characters,
6361 just decode them, and keep them as char (before, eol was output as
6362 the 2 char string `\n' etc.).
6363 * src/output.c (output_rule_data): Use quotearg to output the
6364 token strings.
6365
63662001-12-13 Paul Eggert <eggert@twinsun.com>
6367
6368 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
6369 Do not infringe on the global user namespace when using C++.
6370 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
6371 All uses of `fprintf' and `stderr' changed.
6372
6373 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
6374
63752001-12-13 Akim Demaille <akim@epita.fr>
6376
6377 The computation of nullable is broken: it doesn't handle empty
6378 RHS's properly.
6379
6380 * tests/torture.at (GNU AWK Grammar): New.
6381 * tests/sets.at (Nullable): New.
6382 * src/nullable.c (set_nullable): Instead of blindly looping over
6383 `ritems', loop over the rules, and then over their rhs's.
6384
6385 Work around Autotest bugs.
6386
6387 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
6388 frame, because Autotest understand lines starting with a `+' as
6389 traces from the shell. Then, they are not processed properly.
6390 Admittedly an Autotest bug, but we don't have time to wait for
6391 Autotest to catch up.
6392 * tests/regression.at (Broken Closure): Adjust to the new table
6393 frames.
6394 Move to...
6395 * tests/sets.at: here.
6396
63972001-12-13 Akim Demaille <akim@epita.fr>
6398
6399 * src/closure.c (closure): Use nrules instead of playing tricks
6400 with BITS_PER_WORD.
6401
64022001-12-13 Akim Demaille <akim@epita.fr>
6403
6404 * src/print.c (print_actions): Output the handling of `$' as the
6405 traces do: shifting the token EOF. Before EOF was treated as a
6406 nonterminal.
6407 * tests/regression.at: Adjust some tests.
6408 * src/print_graph.c (print_core): Complete the set of items via
6409 closure. The next-to-final and final states are still unsatisfying,
6410 but that's to be addressed elsewhere.
6411 No longer output the rule numbers, but do output the state number.
6412 A single loop for the shifts + gotos is enough, but picked a
6413 distinct color for each.
6414 (print_graph): Initialize and finalize closure.
6415
64162001-12-13 Akim Demaille <akim@epita.fr>
6417
6418 * src/reader.c (readgram): Remove dead code, an strip useless
6419 braces.
6420 (get_type): Remove, unused.
6421
64222001-12-12 Akim Demaille <akim@epita.fr>
6423
6424 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
6425 on that of lib/error.c.
6426
64272001-12-12 Akim Demaille <akim@epita.fr>
6428
6429 Some hosts don't like `/' in includes.
6430
6431 * src/system.h: Include libgettext.h without qualifying the path.
6432 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
6433 $(top_srcdir).
6434
64352001-12-11 Marc Autret <autret_m@epita.fr>
6436
6437 * src/output.c (output_parser): Remove useless muscle.
6438
64392001-12-11 Marc Autret <autret_m@epita.fr>
6440
6441 * src/bison.simple: Remove #line just before %%epilogue. It
6442 is now handled in ...
6443 * src/reader.c (read_additionnal_code): Add the output of a
6444 #line for the epilogue.
6445
64462001-12-10 Marc Autret <autret_m@epita.fr>
6447
6448 * src/reader.c (copy_definition): Re-use CPP-outed code which
6449 replace precedent remove.
6450 * src/bison.simple: Remove #line before %%prologue because
6451 %%input-line is wrong at this time.
6452
64532001-12-10 Marc Autret <autret_m@epita.fr>
6454
6455 * src/reader.c (symbols_output): Clean up.
6456 * src/output.c (output_gram, output): Clean up.
6457
64582001-12-10 Akim Demaille <akim@epita.fr>
6459
6460 * src/lalr.c (initialize_lookaheads): New. Extracted from...
6461 * src/LR0.c (set_state_table): here.
6462 * src/lalr.c (lalr): Call it.
6463
64642001-12-10 Akim Demaille <akim@epita.fr>
6465
6466 * src/state.h (shifts): Remove the `number' member: shifts are
6467 attached to state, hence no longer need to be labelled with a
6468 state number.
6469
64702001-12-10 Akim Demaille <akim@epita.fr>
6471
6472 Now that states have a complete set of members, the linked list of
6473 shifts is useless: just fill directly the state's shifts member.
6474
6475 * src/state.h (shifts): Remove the `next' member.
6476 * src/LR0.c (first_state, last_state): Remove.
6477 Adjust the callers.
6478 (augment_automaton): Don't look for the shifts that must be added
6479 a shift on EOF: it is those of the state we looked for! But now,
6480 since shifts are attached, it is no longer needed to looking
6481 merely by its id: its number.
6482
64832001-12-10 Akim Demaille <akim@epita.fr>
6484
6485 * src/LR0.c (augment_automaton): Better variable locality.
6486 Remove an impossible branch: if there is a state corresponding to
6487 the start symbol being shifted, then there is shift for the start
6488 symbol from the initial state.
6489
64902001-12-10 Akim Demaille <akim@epita.fr>
6491
6492 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
6493 only when appropriate: when insert_start_shifting_state' is not
6494 invoked.
6495 * tests/regression.at (Rule Line Numbers): Adjust.
6496
64972001-12-10 Akim Demaille <akim@epita.fr>
6498
6499 * src/LR0.c (augment_automaton): Now that all states have shifts,
6500 merge the two cases addition shifts to the initial state.
6501
65022001-12-10 Akim Demaille <akim@epita.fr>
6503
6504 * src/lalr.c (set_state_table): Move to...
6505 * src/LR0.c: here.
6506 * src/lalr.c (lalr): Don't call it...
6507 * src/LR0.c (generate_states): do it.
6508 * src/LR0.h (first_state): Remove, only the table is used.
6509
65102001-12-10 Akim Demaille <akim@epita.fr>
6511
6512 * src/LR0.h (first_shift, first_reduction): Remove.
6513 * src/lalr.c: Don't use first_shift: find shifts through the
6514 states.
6515
65162001-12-10 Akim Demaille <akim@epita.fr>
6517
6518 * src/LR0.c: Attach shifts to states as soon as they are
6519 computed.
6520 * src/lalr.c (set_state_table): Instead of assigning shifts to
6521 state, just assert that the mapping was properly done.
6522
65232001-12-10 Akim Demaille <akim@epita.fr>
6524
6525 * src/LR0.c (insert_start_shift): Rename as...
6526 (insert_start_shifting_state): this.
6527 (insert_eof_shifting_state, insert_accepting_state): New.
6528 (augment_automaton): Adjust.
6529 Better locality of the variables.
6530 When looking if the start_symbol is shifted from the initial
6531 state, using `while (... symbol != start_symbol ...)' sounds
6532 better than `while (... symbol < start_symbol ...)': If fail
6533 to see how the order between symbols could be relevant!
6534
65352001-12-10 Akim Demaille <akim@epita.fr>
6536
6537 * src/getargs.h: Don't declare `spec_name_prefix' and
6538 `spec_file_prefix', declared by src/files.h.
6539 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
6540 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
6541 * src/output.c (prepare): Adjust.
6542 * src/reader.c (symbols_output): Likewise.
6543 * src/vmsgetargs.c: Vaguely adjust, but who cares?
6544
65452001-12-10 Akim Demaille <akim@epita.fr>
6546
6547 * src/muscle_tab.c (muscle_init): NULL is a better default than
6548 `"0"'.
6549
65502001-12-10 Akim Demaille <akim@epita.fr>
6551
6552 * src/reader.c (reader): Calling symbols_output once is enough.
6553
65542001-12-10 Akim Demaille <akim@epita.fr>
6555
6556 Now that states have a complete set of members, the linked list of
6557 reductions is useless: just fill directly the state's reductions
6558 member.
6559
6560 * src/state.h (struct reductions): Remove member `number' and
6561 `next'.
6562 * src/LR0.c (first_reduction, last_reduction): Remove.
6563 (save_reductions): Don't link the new reductions, store them in
6564 this_state.
6565 * src/lalr.c (set_state_table): No need to attach reductions to
6566 states, it's already done.
6567 * src/output.c (output_actions): No longer free the shifts, then
6568 the reductions, then the states: free all the states and their
6569 members.
6570
65712001-12-10 Akim Demaille <akim@epita.fr>
6572
6573 * src/options.c (OPTN, DRTV, BOTH): New.
6574 (option_table): Use them.
6575
6576 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
6577 the job of system.h.
6578 * src/options.c: Don't include stdio.h and xalloc.h for the same
6579 reasons.
6580
65812001-12-10 Akim Demaille <akim@epita.fr>
6582
6583 * src/output.c (output, prepare): Make sure the values of the
6584 muscles `action' and `prologue' are 0-terminated.
6585
65862001-12-10 Akim Demaille <akim@epita.fr>
6587
6588 Clean up GCC warnings.
6589
6590 * src/reader.c (copy_action): `buf' is not used.
6591 (parse_skel_decl): Be static.
6592 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
6593 * src/options.h (create_long_option_table): Have a real prototype.
6594 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
6595 (hash_delete_at): Return const void *.
6596 Adjust casts to preserve the const.
6597
65982001-12-10 Akim Demaille <akim@epita.fr>
6599
6600 * configure.in: Require 2.52g.
6601 M4 is not needed, but AUTOM4TE is.
6602 * m4/m4.m4: Remove.
6603 * tests/Makefile.am: Adjust.
6604
66052001-12-10 Akim Demaille <akim@epita.fr>
6606
6607 One structure for states is enough, even though theoretically
6608 there are LR(0) states and LALR(1) states.
6609
6610 * src/lalr.h (state_t): Remove.
6611 (state_table): Be state_t **, not state_t *.
6612 * src/state.h (core, CORE_ALLOC): Rename as...
6613 (state_t, STATE_ALLOC): this.
6614 Add the LALR(1) members: shifts, reductions, errs.
6615 * src/LR0.c (state_table): Rename as...
6616 (state_hash): this, to avoid name clashes with the global
6617 `state_table'.
6618 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
6619 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
6620
66212001-12-10 Akim Demaille <akim@epita.fr>
6622
6623 Bison dumps core on bash.y.
6624 Reported by Pascal Bart.
6625
6626 * src/warshall.c (bitmatrix_print): New.
6627 (TC): Use it.
6628 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
6629 j must be the outer loop.
6630 * tests/regression.at (Broken Closure): New.
6631
66322001-12-05 Akim Demaille <akim@epita.fr>
6633
6634 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
6635 its argument.
6636