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