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