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