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