]> git.saurik.com Git - bison.git/blob - ChangeLog
Improve C++ namespace support. Discussed starting at
[bison.git] / ChangeLog
1 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Improve C++ namespace support. Discussed starting at
4 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
6 b4_namespace_close): New macros that interpret the %define variable
7 "namespace" so its value can contain "::" to indicate nested
8 namespaces.
9 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
10 the above macros.
11 * data/lalr1.cc (b4_namespace): Likewise.
12 * data/location.cc (b4_namespace): Likewise.
13 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
14 inside a new table in the general %define entry. Document `%define
15 namespace' there as well. Point the %name-prefix entry to it since it
16 explains it more completely in the case of C++.
17 (C++ Bison Interface): Mention `%define namespace' instead of
18 %name-prefix.
19 (Table of Symbols): Remove the `%define push_pull' entry. The %define
20 entry suffices.
21 * tests/c++.at (Relative namespace references): New test case.
22 (Absolute namespace references): New test case.
23 (Syntactically invalid namespace references): New test case.
24 * tests/input.at (C++ namespace reference errors): New test case.
25
26 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
27
28 Add syncline support and location accessor to internal %define
29 interfaces.
30 * data/bison.m4 (b4_percent_define_get_loc): New.
31 (b4_percent_define_get_syncline): New.
32 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
33 (b4_percent_define_default): Record defining location as line 1 rather
34 than 0 for the sake of synchronizing #line's, and define
35 b4_percent_define_syncline(VARIABLE).
36 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
37 * src/muscle_tab.c (muscle_syncline_grow): New.
38 (muscle_code_grow): Use muscle_syncline_grow.
39 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
40 define b4_percent_define_syncline(VARIABLE).
41 (muscle_percent_define_get_loc): New.
42 (muscle_percent_define_get_syncline): New.
43 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
44 remove some unused variables.
45 (muscle_percent_define_default): Record defining location as line 1
46 rather than 0 for the sake of synchronizing #line's, and define
47 b4_percent_define_syncline(VARIABLE).
48 (muscle_percent_define_check_values): Use
49 muscle_percent_define_get_loc.
50 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
51 (muscle_percent_define_get_syncline): Prototype.
52 * tests/skeletons.at (%define Boolean variables: invalid skeleton
53 defaults): Update output for location change.
54 (Complaining during macro argument expansion): Extend to test
55 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
56
57 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
58
59 Fix some error-reporting macro bugs.
60 * data/bison.m4 (b4_cat): New.
61 (b4_error, b4_error_at): Use b4_cat to send error directives directly
62 to stdout so they don't become arguments to other macros. Update
63 comments and add examples.
64 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
65 add examples.
66 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
67 after printing the error directive so that M4 doesn't report subsequent
68 problems that are induced by this problem.
69 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
70 instead of just in them. Recognize @\n in both places. Both expand to
71 the empty string. Needed by b4_cat.
72 * tests/skeletons.at (Complaining during macro argument expansion):
73 New test case.
74 (Fatal errors make M4 exit immediately): New test case.
75
76 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
77
78 Implement --print-datadir.
79 * src/getargs.c (usage): Mention.
80 (PRINT_DATADIR_OPTION): New anonymous enum member.
81 (long_options): Add entry for it.
82 (getargs): Add case for it calling compute_pkgdatadir.
83 * src/output.c (output_skeleton): Encapsulate data directory
84 computation from here...
85 (prepare): ... and from here...
86 (compute_pkgdatadir): ... into this new function.
87 * src/output.h (compute_pkgdatadir): Prototype.
88
89 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
90
91 * src/print-xml.c (escape_bufs): New static global variable
92 replacing...
93 (xml_escape_n): ... the static local variable buf here.
94 (print_xml): Free memory for escape_bufs.
95 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
96
97 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
98
99 Replace `%push-parser' and `%push-pull-parser' with
100 `%define push_pull "push"' and `%define push_pull "both"'.
101 `%define push_pull "pull"' is the default.
102 * doc/bison.texinfo (Push Decl, Push Parser Function,
103 Pull Parser Function, Parser Create Function, Parser Delete Function):
104 Update declarations.
105 (Decl Summary, Table of Symbols): Replace %push-parser and
106 %push-pull-parser entries with a %define push_pull entry.
107 * data/bison.m4 (b4_percent_define_check_values): New macro.
108 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
109 definitions...
110 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
111 definitions...
112 * data/push.c: ... to here and compute them from the value of the
113 %define variable push_pull.
114 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
115 parsing requests here...
116 * data/yacc.c: ... hack this to switch to push.c any time
117 b4_use_push_pull_flag or the %define variable push_pull is set. This
118 will go away when we mv push.c yacc.c.
119 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
120 push parsing is not supported since unused %define variables are
121 reported anyway.
122 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
123 * src/muscle_tab.h (muscle_percent_define_check_values): Update
124 comments for consistency with b4_percent_define_check_values.
125 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
126 muscles.
127 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
128 Remove.
129 (prologue_declaration): Remove %push-parser and %push-pull-parser
130 rules.
131 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
132 * tests/calc.at: Update declarations.
133 * tests/input.at (%define enum variables): New test case.
134 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
135 declaration.
136 (Push Parsing: Multiple impure instances): Update declaration.
137 (Push Parsing: Unsupported Skeletons): New test case.
138 * tests/torture.at (Exploding the Stack Size with Alloca): Update
139 declaration.
140 (Exploding the Stack Size with Malloc): Update declaration.
141
142 2007-09-24 Wojciech Polak <polak@gnu.org>
143
144 Add XSLT transformations.
145
146 * data/xslt/xml2dot.xsl: Transform XML into DOT.
147 * data/xslt/xml2text.xsl: Transform XML into plain text.
148 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
149 * data/Makefile.am (xsltdir): New variable.
150 (dist_xslt_DATA): Add xslt/*.xsl files.
151
152 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
153
154 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
155 Problem reported by Wojciech Polak.
156 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
157 (xml_printf): Undo change I made on 21 September; that is,
158 indent 2 spaces, not 1.
159
160 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
161
162 Pacify ./configure --enable-gcc-warnings.
163 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
164 `char const *' instead of `char *'.
165 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
166 local variable `sep'.
167
168 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
169
170 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
171 elsewhere.
172 * src/print-xml.c: Prefer "const" after types; that's more consistent.
173 (xml_printf): Indent just 1 space for level.
174 (e_char, xlate_char): Remove.
175 (xml_escape_string): Rewrite to avoid undefined behavior (used
176 storage that was freed from the stack).
177 (xml_escape_n): Don't bother checking for subscript error.
178
179 2007-09-21 Wojciech Polak <polak@gnu.org>
180
181 Add Bison XML Automaton Report.
182
183 Add support for an -x option to generate an XML report.
184 It is not documented yet.
185 * src/print-xml.c: New file.
186 * src/print-xml.h: Likewise.
187 * lib/timevar.def (TV_XML): New var.
188 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
189 * src/conflicts.c: Include print-xml.h.
190 (solved_conflicts_xml_obstack): New var.
191 (log_resolution, conflicts_solve, conflicts_free):
192 Add support for XML report.
193 (conflicts_output_val): New function.
194 * src/conflicts.h (conflicts_output_val): New decl.
195 * src/files.c (spec_xml_file): New var.
196 (compute_output_file_names, output_file_names_free): Add XML support.
197 * src/files.h (spec_xml_file): New decl.
198 * src/getargs.c (xml_flag): New var.
199 (usage, short_options, long_options, getargs): Add XML support.
200 * src/getargs.h (xml_flag): New decl.
201 * src/gram.c: Include print-xml.h.
202 (rule_lhs_print_xml, rule_rhs_print_xml):
203 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
204 New functions.
205 * src/gram.h: Declare external ones.
206 * src/main.c: Include print-xml.h.
207 (main): Add XML support.
208 * src/reduce.c: Include print-xml.h.
209 (reduce_xml): New function.
210 * src/reduce.h: Declare it.
211 * src/state.c: Include print-xml.h.
212 (state_new): Add XML support.
213 (state_rule_lookahead_tokens_print_xml): New function.
214 * src/state.h: Declare it.
215 (struct state): New member solved_conflicts_xml.
216 * src/symtab.c (symbol_class_get_string): New function.
217 * src/symtab.h: Declare it.
218
219 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
220
221 * GNUmakefile: Switch to coreutils's version.
222 * bootstrap: Likewise.
223 * Makefile.cfg: Adjust to new GNUmakefile.
224 * README-hacking: Likewise.
225
226 Import from gnulib:
227
228 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
229 Bruno Haible <bruno@clisp.org>
230
231 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
232 and is a script that invokes bison. Tighten the code. Add comments.
233
234 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
235
236 Spell "boolean" as "Boolean". Reported by Akim Demaille.
237 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
238 * doc/bison.texinfo (Decl Summary): Fix.
239 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
240 * tests/input.at (Boolean %define variables): Update output.
241 * tests/skeletons.at (%define boolean variables: invalid skeleton
242 defaults): Rename to...
243 (%define Boolean variables: invalid skeleton defaults): ... this and
244 update output.
245
246 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
247
248 In impure push mode, don't allow more than one yypstate to be allocated
249 since multiple impure parsers would corrupt yynerrs.
250 * data/push.c (yypstate_allocated): New static global variable
251 initialized to 0.
252 (yypull_parse): If yypstate_new returns 0, don't report it as memory
253 exhaustion if yypstate_allocated is 1, but still return 2.
254 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
255 already 1. Otherwise, set it to 1.
256 (yypstate_delete): Set it to 0.
257 * tests/push.at (Push Parsing: Multiple impure instances): New test
258 case.
259
260 2007-08-17 Bob Rossi <bob@brasko.net>
261
262 * doc/bison.texinfo (Push Decl): Document the push parser.
263 (Table of Symbols): Ditto.
264 (Pure Decl): Ditto.
265 (Decl Summary): Ditto.
266 (Multiple Parsers, Push Parser Function, Pull Parser Function,
267 Parser Create Function, Parser Delete Function):
268 Add new push parser symbols.
269 (Table of Symbols): Document push-parser, push-pull-parser,
270 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
271
272 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
273
274 Update to GPLv3.
275 * doc/gpl-3.0.texi: New file.
276 * doc/gpl.texi: Remove.
277 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
278 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
279 * README-hacking, TODO, bootstrap, bootstrap.conf:
280 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
281 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
282 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
283 * data/lalr1.cc, data/lalr1.java, data/location.cc:
284 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
285 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
286 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
287 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
288 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
289 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
290 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
291 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
292 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
293 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
294 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
295 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
296 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
297 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
298 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
299 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
300 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
301 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
302 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
303 * src/complain.c, src/complain.h, src/conflicts.c:
304 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
305 * src/files.h, src/flex-scanner.h, src/getargs.c:
306 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
307 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
308 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
309 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
310 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
311 * src/print.c, src/print.h, src/print_graph.c:
312 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
313 * src/reduce.h, src/relation.c, src/relation.h:
314 * src/revision.h, src/scan-code.h, src/scan-code.l:
315 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
316 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
317 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
318 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
319 * tests/Makefile.am, tests/actions.at, tests/c++.at:
320 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
321 * tests/existing.at, tests/glr-regression.at:
322 * tests/headers.at, tests/input.at, tests/java.at:
323 * tests/local.at, tests/output.at, tests/push.at:
324 * tests/reduce.at, tests/regression.at, tests/sets.at:
325 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
326 * tests/torture.at:
327 Update to GPLv3.
328
329 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
330
331 Get rid of broken %no-parser, -n, and --no-parser implementation and
332 documentation.
333 * TODO: Don't mention them.
334 * doc/bison.1: Likewise.
335 * doc/bison.texinfo (Decl Summary): Likewise.
336 (Bison Options): Likewise.
337 (Option Cross Key): Likewise.
338 * src/getargs.c (no_parser_flag): Remove global variable.
339 (usage): Don't print description of -n and --no-parser.
340 (long_options): Remove --no-parser entry here.
341 (getargs): Remove -n case in the switch here.
342 * src/getargs.h (no_parser_flag): Remove extern.
343 * tests/regression.at (Web2c Actions): Remove comment that mentions
344 --no-parser.
345
346 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
347
348 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
349 name user variables starting with `yy'. Just pass NULL instead of a
350 dummy local &yylval to yypush_parse.
351 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
352 starting with `yy'.
353
354 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
355
356 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
357 true since it's then always used regardless of whether yyoverflow is
358 defined. Reported by Christian Burger at
359 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
360 * THANKS: Add Christian Burger.
361
362 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
363 node names: say "Decl Summary" not "Bison Declaration Summary".
364
365 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
366
367 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
368 determine whether this function has already complained about an invalid
369 value for a %define boolean variable, don't check whether Bison has
370 ever examined the value. As written, the check was a tautology.
371 Instead, record and check for this complaint using a separate muscle.
372
373 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
374
375 Fix push parsing memory leak reported by Brandon Lucia at
376 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
377 * THANKS: Add Brandon Lucia.
378 * data/push.c (yypstate_delete): Free the stack if it was reallocated
379 but the parse never completed and thus freed it.
380 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
381 * tests/testsuite.at: Include push.at.
382 * test/push.at: New.
383 (Push Parsing: Memory Leak for Early Deletion): New test case.
384
385 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
386
387 Improve handling of multiple S/R conflicts in the same state and of S/R
388 conflicts involving multiple reductions.
389 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
390 set for a state here or Bison will abort if it is reassigned on a
391 later conflicted reduction in the same state.
392 Similarly, don't finalize and assign the solved conflicts report here
393 or it will be lost if it is reassigned on a later conflicted reduction
394 in the same state.
395 (set_conflicts): Instead, assign them both here after all S/R conflicts
396 in the state have been fully examined.
397 * src/print.c (shift_set): Rename to...
398 (no_reduce_set): ... this.
399 (print_reductions): Update for rename, and add %nonassoc error action
400 tokens to no_reduce_set so that, when printing the first remaining
401 reduction on an error action token, the reduction is enclosed in
402 brackets.
403 (print_results): Update for rename.
404 * tests/conflicts.at (Solved conflicts report for multiple reductions
405 in a state): New test case.
406 (%nonassoc error actions for multiple reductions in a state): New test
407 case.
408
409 * src/main.c (main): Don't depend on C99 features.
410
411 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
412
413 * build-aux/.cvsignore: Add compile.
414 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
415 uniwidth.
416
417 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
418
419 * bootstrap (slurp): Create target directories that don't exist.
420 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
421
422 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
423
424 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
425 than item number.
426 * closure.c (closure): Likewise.
427 * state.h (reductions): Comment sorting of rules.
428 (state): Comment sorting of items.
429
430 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
431
432 Fix C++ test cases after recent Gnulib changes. Discussed starting at
433 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
434 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
435 definition in order to avoid Gnulib headers since we don't use config.h
436 here.
437 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
438 rather than AT_DATA so that config.h is included.
439
440 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
441
442 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
443 instead of fprintf. Guard these functions with #if YYDEBUG instead of
444 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
445 and so that YYFPRINTF is guaranteed to be defined here.
446
447 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
448
449 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
450 with...
451 (muscle_percent_define_check_values): ... this more helpful function.
452 Again, it's not used yet, but it will be.
453 * src/muscle_tab.h: Likewise.
454
455 Improve some comments in parser table construction.
456 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
457 (generate_states): Don't mention ruleset, which is internal to closure.
458 * src/closure.c (closure): Explain sorting of core and itemset, which
459 is required for this function to behave correctly.
460 * src/closure.h (closure): Mention sorting.
461
462 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
463
464 * src/lalr.c (state_lookahead_tokens_count): For code readability,
465 move the check for disabled transitions to an aver since conflict
466 resolution hasn't happened yet.
467
468 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
469 labels a state as inconsistent just because it has error transitions.
470 The original form of this check appeared in revision 1.1 of lalr.c,
471 which was committed on 1991-12-21. Now (at least), changing the
472 consistency label on such a state appears to have no useful effect in
473 any of the places it is examined, which I enumerate below. The key
474 point to understanding each item in this enumeration is that a state
475 with an error transition is labelled consistent in the first place only
476 if it has no rules, so the check cannot matter for states that have
477 rules. (1) Labelling a state as inconsistent will cause set_conflicts
478 to try to identify its conflicts, and a state must have *rules* to have
479 conflicts. (2) Labelling a state as inconsistent will affect how
480 action_row sets the default *rule* for the state. (3) Labelling a
481 state as inconsistent will cause build_relations to add lookback edges
482 to *rules* in that state.
483 * src/state.h (struct state): Word the comment for member consistent
484 more carefully.
485
486 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
487
488 Don't depend on C99 features.
489 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
490 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
491 * src/reader.c (check_and_convert_grammar): Fix for-loop.
492 * src/state.c (state_mark_reachable_states): Fix for-loop.
493 (state_remove_unreachable_states): Fix for-loop.
494
495 Don't widen struct state with member reachable just to temporarily
496 record reachability. Instead, use a local bitset.
497 * src/state.h (struct state): Remove member.
498 * src/state.c (state_new): Don't initialize it.
499 (state_mark_reachable_states): Rename to...
500 (state_record_reachable_states): ... this, and use bitset.
501 (state_remove_unreachable_states): Use bitset.
502
503 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
504
505 * src/Makefile.am (yacc): Quote target action commands properly so
506 that the yacc script isn't corrupt. Reported by Hans Aberg at
507 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
508
509 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
510 the case of pure parsers. Reported by Frans Englich at
511 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
512 * THANKS: Add Frans Englich.
513
514 * NEWS (2.3a+): In the %code entry, reference section `Bison
515 Declaration Summary' from the manual now since the %code summary has
516 moved there.
517 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
518 in the rules section must be terminated by semicolons.
519
520 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
521
522 Extend the front-end API for %define variables to more completely
523 mirror the back-end. This will be useful in the future.
524 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
525 Update comments to mention the new front-end counterparts of these
526 macros.
527 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
528 for muscle_string_decode and muscle_location_decode.
529 (muscle_string_decode): New static function.
530 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
531 (muscle_percent_define_get, muscle_percent_define_ifdef): New
532 functions.
533 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
534 muscle_percent_define_get to mimic the b4_percent_define_flag_if
535 implementation more closely.
536 (muscle_percent_define_invalid_value): New function.
537 * src/muscle_tab.h (muscle_percent_define_get,
538 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
539 Prototype.
540
541 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
542
543 * NEWS (2.3a+): Mention yesterday's state-removal change.
544 (2.3a): Remove the %language entry, which was added after 2.3a.
545 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
546 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
547 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
548 tests/existing.at: Update copyright date.
549
550 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
551
552 If conflict resolution makes states unreachable, remove those states,
553 report rules that are then unused, and don't report conflicts in those
554 states.
555 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
556 New global function.
557 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
558 function.
559 * src/main.c (main): After conflict resolution, remove the unreachable
560 states and update all data structures that reference states by number.
561 * src/state.c (state_new): Initialize each state's reachable member to
562 false.
563 (state_mark_reachable_states): New static function.
564 (state_remove_unreachable_states): New global function.
565 * src/state.h (struct state): Add member bool reachable.
566 (state_remove_unreachable_states): Prototype.
567 * tests/conflicts.at (Unreachable States After Conflict Resolution):
568 New test case.
569 * tests/existing.at (GNU pic Grammar): Update test case output now that
570 an unused rule is discovered.
571
572 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
573
574 Minor code cleanup in parser table construction.
575 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
576 (new_itemsets, save_reductions): Update for rename to nitemset.
577 * src/closure.c (nritemset): Rename to...
578 (nitemset): ... this since the "r" appears to meaningless and isn't
579 used in the comments.
580 (closure): Update for rename.
581 * src/closure.h (nritemset): Update extern to...
582 (nitemset): ... this.
583 * src/lalr.c (LA): Fix a typo in comments.
584 * src/print.c (print_core): Update for rename to nitemset.
585 * src/print_graph.c (print_graph): Likewise.
586 * src/state.h: Fix some typos in header comments.
587
588 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
589
590 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
591 still sticks to ASCII. Sorry!
592
593 * README-hacking: New file, taken mostly from coreutils, with changes
594 for Bison. Contains much of the contents of:
595 * README-cvs: Remove.
596 * bootstrap: Sync from gnulib.
597 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
598 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
599
600 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
601
602 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
603 Setzer.
604 (Java Differences): Fix some typos.
605 * THANKS: Add Sebastian Setzer.
606
607 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
608
609 * data/java.m4 (b4_single_class_if): Remove.
610 (b4_abstract_if): Look at "%define abstract".
611 (b4_lexer_if): New.
612 (b4_union_name): Rename...
613 (b4_yystype): ... to this. Map to "%define stype".
614 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
615 b4_maybe_throws): Fix quoting.
616 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
617 * data/lalr1.java (Lexer interface): Always define.
618 (Lexer interface within parser class): Remove.
619 (YYLexer class): New, used when "%code lexer" is present.
620 (constructor): When "%code lexer" is used, pass %lex-param
621 to the lexer constructor.
622 (yylex, yyparse): Remove %lex-param from method invocations
623 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
624
625 * doc/bison.texinfo (Java Bison Interface): Mention "%define
626 abstract". Rename "%define union_name" to "%define stype".
627 Rename method names according to previous patch.
628 (Java Scanner Interface): Describe "%code lexer" instead of
629 "%pure-parser" and "%define single_class".
630 (Java Differences): Mention "%code lexer".
631
632 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
633 Include scanner here, using macros from tests/local.at.
634 (AT_DATA_CALC_Y): Remove final argument.
635 (_AT_CHECK_JAVA_CALC): Likewise.
636 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
637 of %locations and %error-verbose.
638 (main): Test with and without %lex-param.
639 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
640 (AT_BISON_OPTION_POPDEFS): Pop it.
641
642 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
643
644 DJGPP spefic issue. Inhibit the use of disallowed characters for
645 file name genertion on Win98, WinXP, etc. These are |<>":?*\
646 and concern testsuite case 46.
647 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
648 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
649 * djgpp/config.bat: Inhibit the use of disallowed characters.
650
651 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
652
653 Miscellaneous %define and %code cleanup.
654 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
655 values are interpreted.
656 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
657 documentation a little more.
658 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
659 muscle_percent_define_insert, muscle_percent_code_grow): New
660 functions/macros.
661 * src/muscle_tab.h (muscle_percent_define_insert,
662 muscle_percent_code_grow): Prototype.
663 * src/parse-gram.y (prologue_declaration): Use
664 muscle_percent_define_insert and muscle_percent_code_grow when parsing
665 %define and %code directives.
666
667 Make it easy to share %define boolean variables between the front-end
668 and back-end. Though not used yet, this will be useful in the future.
669 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
670 Bison uses of names rather than just skeleton uses of names.
671 (b4_percent_define_get, b4_percent_define_ifdef): Rename
672 b4_percent_define_skeleton_variables(VARIABLE) to
673 b4_percent_define_bison_variables(VARIABLE).
674 (b4_percent_code_get, b4_percent_code_ifdef): Rename
675 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
676 b4_percent_code_bison_qualifiers(QUALIFIER).
677 (b4_check_user_names_wrap): Update for renames.
678 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
679 muscle_percent_define_default): New functions mimicking
680 b4_percent_define_flag_if and b4_percent_define_default.
681
682 For %define variables, report locations for invalid values and
683 redefinitions.
684 * data/bison.m4 (b4_percent_define_flag_if): Read
685 b4_percent_define_loc(VARIABLE) to report the location of an invalid
686 value for VARIABLE.
687 (b4_percent_define_default): Save a special location in
688 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
689 must later be reported as invalid.
690 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
691 functions.
692 (muscle_percent_define_insert): Record the location of VARIABLE in
693 muscle percent_define_loc(VARIABLE), and use it to report the previous
694 location for a redefinition.
695 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
696 (muscle_percent_define_default): Update like b4_percent_define_default.
697 (muscle_grow_user_name_list): Rename to...
698 (muscle_user_name_list_grow): ... this for consistency and use
699 muscle_location_grow.
700 * src/muscle_tab.h (muscle_location_grow): Prototype.
701 * tests/input.at (%define errors): Update expected output.
702 * tests/skeletons.at (%define boolean variables: invalid skeleton
703 defaults): New test case.
704
705 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
706
707 * src/print.c (lookahead_set, state_default_rule): Remove.
708 (print_reductions): Replace state_default_rule invocation with
709 equivalent use of yydefact, which was computed in token_actions in
710 tables.c.
711 (print_results): Don't allocate lookahead_set.
712
713 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
714
715 * data/lalr1.java: Prefix all private members with yy.
716
717 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
718
719 Use YYFPRINTF instead of fprintf where appropriate. Reported by
720 Sebastien Fricker at
721 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
722 * THANKS: Add Sebastien Fricker.
723 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
724 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
725 accept a variable number of arguments.
726
727 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
728
729 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
730
731 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
732
733 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
734 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
735 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
736
737 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
738
739 Undo my 2007-02-07 change, switching back to the c-strcase module
740 introduced in the 2007-02-03 change. Bruno Haible reported that
741 the 2007-02-07 change would be dangerous in Turkish if we add a
742 language whose name contains "i", since "i" is not lowercase "I"
743 in Turkish.
744 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
745 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
746 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
747 * m4/.cvsignore: Remove strcase.m4.
748 * src/getargs.c: Revert 2007-02-07 change, as follows.
749 Include c-strcase.h.
750 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
751
752 2007-02-11 Bruno Haible <bruno@clisp.org>
753
754 Enable the Java related testsuite tests when the only Java compiler
755 found is a gcj < 4.3. Discussed at
756 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
757 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
758
759 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
760
761 * data/Makefile.am: Update copyright date.
762 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
763 yypstate_new returns NULL.
764 (yypstate_new): Return NULL if malloc does.
765 * src/reader.c (packgram): Move translation of rule actions from the
766 beginning of packgram to...
767 (check_and_convert_grammar): ... here right before packgram is invoked
768 so it's easier to write more complete comments, and remove redundant
769 code.
770
771 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
772
773 As in semantic actions, make @$ in %initial-action, %destructor, and
774 %printer imply %locations.
775 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
776 scanning @$.
777 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
778 (@$ in %initial-action implies %locations,
779 @$ in %destructor implies %locations,
780 @$ in %printer implies %locations): ... these new test cases.
781
782 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
783
784 Undo most of the 2007-02-03 change, switching to the strcase module
785 now that gnulib strcase has been fixed.
786 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
787 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
788 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
789 * m4/.cvsignore: Add strcase.m4.
790 * src/getargs.c: Revert 2007-02-03 change, as follows.
791 Don't include c-strcase.h.
792 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
793 strcasecmp has "unspecified behavior" outside the POSIX locale,
794 but it works fine in practice if at least one argument is ASCII,
795 as is the case in Bison.
796
797 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
798
799 * tests/java.at: Skip tests if only one of javac/java is present.
800 Reported by Joel E. Denny.
801 * tests/atlocal.in: Adjust copyright years.
802
803 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
804
805 * data/lalr1.java (Stack): Work around old verifiers that disallow
806 access to the private fields of an inner class, from the outer class.
807 We can make Stack's fields public because user code doesn't have access
808 to the instance of Stack used by parse(). Reported by Paul Eggert.
809
810 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
811
812 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
813 the right spot for these files?
814 * bootstrap.conf (gnulib_modules): Add c-strcase.
815 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
816 c-strncasecmp.c.
817 * src/getargs.c: Include c-strcase.h.
818 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
819 to avoid unspecified behavior.
820
821 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
822
823 * doc/bison.texinfo (Decl Summary): Correct typo.
824
825 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
826
827 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
828 Complain if the value does not match empty, "true" or "false".
829 * data/c++.m4: Adjust default definitions of %define variables.
830 * data/java.m4: Adjust default definitions of %define variables.
831 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
832 to above behavior.
833 * tests/input.at (Boolean %define variables): Test new behavior.
834
835 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
836
837 * NEWS: Mention java.
838 * TODO: Remove things that are done.
839 * bootstrap.conf: Add javacomp-script and javaexec-script.
840 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
841
842 * data/Makefile.am: Add new files.
843 * data/java-skel.m4: New.
844 * data/java.m4: New.
845 * data/lalr1.java: New.
846
847 * doc/bison.texinfo: Put "A Complete C++ Example" under
848 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
849 under Other Languages.
850
851 * src/getargs.c (valid_languages): Add Java.
852 * src/getargs.h (struct bison_language): Update size of string fields.
853
854 * tests/Makefile.am: Add java.at.
855 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
856 * tests/java.at: New.
857 * tests/testsuite.at: Include it.
858
859 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
860
861 Clean up.
862 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
863 at_directive_argv arguments so these no longer have to be global
864 variables. Also, update the implementation for the following changes.
865 (fail_for_at_directive_too_many_args,
866 fail_for_at_directive_too_few_args): Add at_directive_name argument.
867 (at_directive_name): Remove as at_directive_argv[0] will be used for
868 this now.
869 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
870 for the directive name.
871 (at_directive_argc, at_directive_argv): Make these local within
872 skel_lex instead of global.
873 (INITIAL): Update directive start action for above changes.
874 (SC_AT_DIRECTIVE_ARG): Rename to...
875 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
876 (SC_AT_DIRECTIVE_SKIP_WS): Update.
877 (scan_skel): Move yylex_destroy to...
878 (skel_scanner_free): ... here.
879 * tests/skeletons.at (installed skeleton file name): Rename to...
880 (installed skeleton file names): ... this.
881
882 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
883
884 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
885 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
886 Summary" not "Directives".
887 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
888 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
889 since the former is now the more complete one.
890 (Prologue Alternatives): Likewise and do the same for %defines.
891 (Table of Symbols): Add summary of %code, add summary of %define, and
892 move full %code documentation to...
893 (Decl Summary): ... here for consistency with other entries in these
894 sections.
895 Move %define entry in order to keep this list alphabetized.
896 Reword %define entry a little to put less emphasis on the skeleton
897 concept, which most users shouldn't have to think about.
898
899 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
900
901 Adjust to recent gnulib changes.
902 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
903 Add string.h, string_.h, unistd_.h, wchar_.h.
904 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
905 * src/system.h: Don't include <stpcpy.h>; this is now done by
906 <string.h>.
907
908 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
909
910 Simplify implementation of unqualified %code, implement macros for
911 uniform treatment of boolean %define flags. Document %define.
912 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
913 b4_percent_code_ifdef): New.
914 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
915 * data/c++.m4: Define default value for global_tokens_and_yystype.
916 * data/glr.cc: Likewise.
917 * data/location.cc: Use b4_percent_define_flag_if.
918
919 * doc/bison.texinfo (Decl Summary): Document %define.
920
921 * src/parse-gram.y (Unqualified %code): Change muscle name to
922 b4_percent_code().
923 (content.opt): Default to empty.
924
925 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
926
927 Implement support for relative and absolute skeleton file names.
928 Discussed starting at
929 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
930 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
931 (Bison Options): Document in --skeleton entry.
932 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
933 full_skeleton can't necessarily hold all of pkgdatadir.
934 If the specified skeleton file name contains a `/', don't prepend
935 pkgdatadir.
936 * src/parse-gram.y (prologue_declaration): If the specified skeleton
937 file name contains a `/', prepend the grammar file directory.
938 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
939 * skeletons.at: New file.
940 (relative skeleton file names): New test case.
941 (installed skeleton file names): New test case.
942 * tests/testsuite.at: Include skeletons.at.
943
944 * bootstrap: Update copyright to 2007.
945
946 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
947
948 * bootstrap: Remove occurrences of .#bootmp from the files.
949
950 2007-01-17 Akim Demaille <akim@epita.fr>
951
952 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
953 nonterminals.
954 Use per-type %printer.
955
956 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
957
958 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
959 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
960 djgpp/config.site, src/files.c, src/files.h, src/main.c,
961 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
962 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
963 tests/glr-regression.at, tests/input.at, tests/local.at,
964 tests/output.at, tests/torture.at: Update copyright to 2007.
965
966 2007-01-16 Akim Demaille <akim@epita.fr>
967
968 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
969 error code.
970 (Calc++ Scanner): Exit with failure if we can't open the input
971 file.
972 Accept "-" standing for stdin.
973 (Calc++ Top Level): Print the result only if the parsing was
974 successful.
975
976 2007-01-16 Akim Demaille <akim@epita.fr>
977
978 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
979
980 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
981 and Joel E. Denny <jdenny@ces.clemson.edu>
982
983 Clean up %define and %code implementation in M4 some. Most
984 importantly, rename all related macros to be in the b4_percent_define
985 and b4_percent_code namespaces. Also, complete support for `.' in
986 %define variable names and %code qualifiers.
987 * data/bison.m4 (b4_check_user_names): Check for special
988 "SKELETON-NAMESPACE(name)" macros instead of using two nested
989 m4_foreach loops.
990 (b4_get_percent_define, b4_get_percent_code): Rename to...
991 (b4_percent_define_get, b4_percent_code_get): ... these.
992 Extend documentation with examples.
993 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
994 b4_percent_define_skeleton_variables and
995 b4_percent_code_skeleton_qualifiers.
996 Expect any value for the %define variable `foo' to be stored in the
997 macro named `b4_percent_define(foo)'; expect any %code blocks for the
998 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
999 expect any unqualified %code blocks to be stored in a macro named
1000 `b4_percent_code_unqualified'.
1001 Use m4_indir so that %define variable names and %code qualifiers can
1002 contain `.', which is allowed by the grammar parser.
1003 (b4_percent_define_default): New macro to set a default value for a
1004 %define variable.
1005 (m4_wrap): Update wrapped code, and fix some underquoting.
1006 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1007 Expect grammar uses of %define variables and %code qualifiers to be
1008 defined in b4_percent_define_user_variables and
1009 b4_percent_code_user_qualifiers.
1010 * data/c++.m4: Use b4_percent_define_default rather than
1011 m4_define_default. Fix some underquoting. Skeleton usage of %define
1012 variable define_location_comparison now implies skeleton usage of
1013 %define variable filename_type.
1014 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1015 data/push.c, data/yacc.c: Update macro names.
1016 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1017 muscle names.
1018
1019 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1020
1021 DJGPP specific issues.
1022
1023 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1024 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1025
1026 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1027
1028 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1029 run parsers in all tests so that Valgrind is invoked during
1030 maintainer-check-valgrind.
1031 (Duplicate representation of merged trees): Free all semantic values.
1032 (Duplicated user destructor for lookahead): Likewise.
1033
1034 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1035
1036 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1037 command-line prefix.
1038 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1039 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1040 miss Valgrind messages.
1041 (Exploding the Stack Size with Malloc): Likewise.
1042
1043 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1044
1045 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1046 locals. Reported by Juan Manuel Guerrero at
1047 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1048 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1049 Fix some indentation also.
1050 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1051 explaining this issue.
1052
1053 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
1054 and Joel E. Denny <jdenny@ces.clemson.edu>
1055
1056 Simplify union and prologue handling, and escape union and lex/parse
1057 params with digraphs.
1058 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1059 values to the empty string since these are no longer guaranteed
1060 initialized by the front-end.
1061 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1062 braces around b4_user_stype since this is no longer done by the
1063 front-end.
1064 * src/files.c, src/files.h (pre_prologue_obstack,
1065 post_prologue_obstack): Remove.
1066 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1067 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1068 with digraphs. This fixes lex params and parse params.
1069 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1070 * src/output.c (prepare): Remove muscle insertion of the prologues.
1071 (output): Remove freeing of pre_prologue_obstack and
1072 post_prologue_obstack.
1073 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1074 than prologue_augment for prologue parsing so you don't need prologue
1075 obstacks.
1076 (grammar_declaration): For %union RHS, use `braceless' instead of
1077 "{...}" so that braces are already stripped and code is escaped with
1078 digraphs.
1079 * src/reader.c (prologue_augment): Remove.
1080 (reader): Remove initialization of pre_prologue_obstack and
1081 post_prologue_obstack.
1082 * src/reader.h (prologue_augment): Remove.
1083
1084 * data/c.m4: Remove stray parenthesis.
1085
1086 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1087
1088 Remove quotes from variables names in %define directives and from
1089 qualifiers in %code directives, and restrict the characters that are
1090 allowed in them to M4-friendly ones. For %define, continue to support
1091 the quoted form as a deprecated feature. Discussed starting at
1092 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1093 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1094 %code.
1095 * doc/bison.texinfo (Prologue Alternatives): Update.
1096 (Decl Summary): In %defines entry, update mention of `%code requires'
1097 and `%code provides'.
1098 (C++ Location Values): Update %define uses.
1099 (Calc++ Parser Interface): Likewise.
1100 (Calc++ Parser): Likewise, and update `%code requires' uses.
1101 (Table of Symbols): Update %code documentation.
1102 * src/parse-gram.y (prologue_declaration): For %define variables, use
1103 `variable' instead of `STRING'.
1104 (grammar_declaration): For %code qualifiers, use `ID' instead of
1105 `STRING'.
1106 (variable): New nonterminal that takes an `ID' or a `STRING'.
1107 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1108 and %define uses.
1109 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1110 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1111 (%define errors): Update %define uses.
1112
1113 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1114
1115 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1116 instead of muscle_insert for %define values so that M4-special
1117 characters are replaced with digraphs.
1118 * tests/input.at (%define errors): Extend to check weird values.
1119
1120 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1121
1122 Instead of having skeletons declare all valid %define variables and
1123 %code qualifiers, provide macros that retrieve the associated values
1124 and build these lists automatically. Thus Bison will now warn when a
1125 variable or qualifier is not used by the skeleton in the current
1126 invocation regardless of whether it might sometimes be used by that
1127 skeleton in other invocations. Also, move all %define value macros to
1128 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1129 form, which is replaced by %code.
1130 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1131 (b4_check_user_names): ... this, and change the series of valid name
1132 arguments to a single list argument for names used in the skeleton
1133 similar to the existing list argument for names used in the grammar.
1134 Warn instead of complaining.
1135 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1136 values and %code code, to format %code code properly, and to build
1137 lists of all %define variables and %code qualifiers used in the
1138 skeleton: b4_skeleton_percent_define_variables and
1139 b4_skeleton_percent_code_qualifiers.
1140 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1141 Remove, and...
1142 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1143 the skeleton names lists can finish building first. In place of
1144 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1145 expect the lists b4_user_percent_define_variables and
1146 b4_user_percent_code_qualifiers.
1147 * data/c++.m4: Where setting default values for b4_parser_class_name,
1148 b4_location_type, b4_filename_type, b4_namespace, and
1149 b4_define_location_comparison, update their names to the
1150 b4_percent_define_ namespace.
1151 * data/glr.c: Don't use b4_check_percent_define_variables and
1152 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1153 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1154 (b4_parser_class_name, b4_namespace): Define these using
1155 b4_get_percent_define for parser_class_name and namespace.
1156 * data/location.cc: Use b4_get_percent_define.
1157 * data/push.c: Don't use b4_check_percent_define_variables and
1158 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1159 * data/yacc.c: Likewise, and don't call m4_exit in
1160 b4_use_push_for_pull_if or m4_wrap code will never execute.
1161 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1162 Rename to...
1163 (muscle_grow_user_name_list): ... this for consistency with the
1164 terminology used in bison.m4.
1165 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1166 %define variable names, and rename muscle used_percent_define_variables
1167 to user_percent_define_variables.
1168 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1169 user_percent_code_qualifiers.
1170 (content): Remove.
1171 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1172 {CODE} form is no longer accepted.
1173 * tests/input.at (Reject bad %code qualifiers): Rename to...
1174 (Reject unused %code qualifiers): ... this, and update test output.
1175 (%define error): Update test output.
1176
1177 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1178
1179 Check for unrecognized %define variables similar to checking for
1180 unrecognized %code qualifiers. Check for redefined %define variables.
1181 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1182 generalizes...
1183 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1184 (b4_check_percent_define_variables): New, also wraps it.
1185 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1186 variables using b4_check_percent_define_variables.
1187 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1188 all those exercised in the test suite and all those listed in the
1189 `Default values' section of c++.m4. Are there others?
1190 * data/push.c, data/yacc.c: Declare no valid %define variables.
1191 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1192 similar to muscle_find, but it works even when the muscle stores a
1193 const value.
1194 (muscle_grow_used_name_list): New function for constructing the used
1195 name list muscles that b4_check_for_unrecognized_names requires.
1196 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1197 %define'd more than once. Define the b4_used_percent_define_variables
1198 muscle with muscle_grow_used_name_list.
1199 (grammar_declaration): Abbreviate %code code with
1200 muscle_grow_used_name_list.
1201 * tests/input.at (%define errors): New.
1202
1203 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1204
1205 Provide warn_at, complain_at, and fatal_at function callbacks to the
1206 skeletons, and use this for %code qualifier complaints.
1207 * data/bison.m4 (b4_error_at): New, invoked by...
1208 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1209 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1210 @fatal_at(...@) directives.
1211 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1212 qualifiers in b4_used_percent_code_qualifiers and to use
1213 b4_complain_at.
1214 * src/location.c, src/location.h (boundary_set_from_string): New global
1215 function.
1216 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1217 function.
1218 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1219 to b4_used_percent_code_qualifiers.
1220 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1221 function.
1222 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1223 (lineno): Rename to...
1224 (out_lineno): ... this so I don't misunderstand it again.
1225 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1226 here; these newlines are in the input but not the output file.
1227 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1228 (at_directive_perform): ... this new static function, and add handling
1229 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1230 directives.
1231 * tests/input.at (Reject bad %code qualifiers): Update test output with
1232 locations and extend.
1233
1234 * tests/output.at (Output file name: [, Output file name: ]): Remove
1235 bogus comment about these tests failing.
1236
1237 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1238
1239 Clean up b4_check_percent_code_qualifiers a little.
1240 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1241 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1242 documentation and add examples.
1243 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1244 qualifiers here.
1245
1246 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1247
1248 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1249 unreliable -- especially when they're hidden inside another macro.
1250 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1251 data/c.m4: Remove m4_divert(-1).
1252 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1253 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1254 m4_divert_push(0) and m4_divert_pop(0).
1255 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
1256 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1257 pushed and popped by m4sugar, should be first on the stack.
1258
1259 Provide warn, complain, and fatal function callbacks to the skeletons.
1260 This provides more flexibility than m4_fatal, improves the error
1261 message format, and captures messages for translation. Discussed
1262 starting at
1263 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1264 * data/bison.m4 (b4_error): New, invoked by...
1265 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1266 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1267 directives. Because these M4 macros might be called when the current
1268 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1269 the previous removal of uses of m4_divert, which caused trouble.
1270 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1271 m4_fatal to report unrecognized %code qualifiers.
1272 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1273 push parser requests.
1274 * data/glr.c: Use b4_complain instead of m4_fatal to report
1275 non-deterministic push parser requests.
1276 Update @output usage to @output(...@) form.
1277 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1278 report missing %defines. Update @output usage to @output(...@) form.
1279 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1280 @output(...@) form.
1281 * src/main.c (main): Invoke skel_scanner_free.
1282 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1283 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1284 obstack_for_string from flex-scanner.h.
1285 (YY_DECL): Use to declare skel_lex static.
1286 (decode_at_digraphs): Remove; now handled in the new
1287 SC_AT_DIRECTIVE_ARG start condition.
1288 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
1289 functions.
1290 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
1291 at_directive_argv): New static globals.
1292 (INITIAL): Use fail_for_invalid_at.
1293 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
1294 recognize the start of a generalized `@directive(...@)' form and
1295 start...
1296 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
1297 directive args (using the new obstack_for_string), to decode the
1298 contained @ diagraphs, and to perform the directive. It recognizes
1299 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
1300 @output(...@).
1301 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
1302 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
1303 `@,'.
1304 (scan_skel): Initialize obstack_for_string on the first call.
1305 (skel_scanner_free): New function to free obstack_for_string.
1306 * tests/input.at (Reject bad %code qualifiers): Update test output.
1307
1308 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
1309
1310 Consolidate the 4 prologue alternative directives (%code, %requires,
1311 %provides, and %code-top) into a single %code directive with an
1312 optional qualifier field. Discussed at
1313 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
1314 * NEWS (2.3a+): Rewrite the existing entry for the prologue
1315 alternatives.
1316 * doc/bison.texinfo (Prologue Alternatives): Update.
1317 (Decl Summary): Update to %code "requires" and %code "provides".
1318 (Calc++ Parser): Update to %code "requires".
1319 (Table of Symbols): Remove entries for %requires, %provides, and
1320 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
1321 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
1322 are replaced by b4_percent_code_provides and b4_percent_code_requires,
1323 which are skeleton-specific.
1324 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
1325 declare what %code qualifiers it supports and to complain if any other
1326 qualifiers were used in the grammar.
1327 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
1328 and b4_user_code([b4_percent_code_provides]) in place of
1329 b4_user_requires and b4_user_provides.
1330 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
1331 Add b4_user_code([b4_percent_code_top]) and
1332 b4_user_code([b4_percent_code]).
1333 Invoke b4_check_percent_code_qualifiers.
1334 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1335 PERCENT_REQUIRES): Remove.
1336 (grammar_declaration): Remove RHS's for %code-top, %provides, and
1337 %requires. Rewrite the %code RHS as the unqualified form defining the
1338 muscle b4_percent_code. Add another RHS for the qualified %code form,
1339 which defines muscles of the form b4_percent_code_QUALIFIER and the
1340 b4_used_percent_code_qualifiers muscle.
1341 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1342 PERCENT_REQUIRES): Remove.
1343 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
1344 %code "requires" and %code "provides".
1345 * tests/input.at (Reject bad %code qualifiers): New.
1346
1347 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1348
1349 Use the new code_props interface for destructors and printers.
1350 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
1351 printer_location members, and change the type of the destructor and
1352 printer members to code_props.
1353 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
1354 symbol_printer_get, semantic_type_destructor_set,
1355 semantic_type_printer_set, default_tagged_destructor_set,
1356 default_tagless_destructor_set, default_tagged_printer_set,
1357 default_tagless_printer_set): Use code_props in arguments and return
1358 types in place of char const * and location.
1359 (symbol_destructor_location_get, symbol_printer_location_get): Remove
1360 since the locations are now contained in the return of
1361 symbol_destructor_get and symbol_printer_get.
1362 * src/output.c (symbol_destructors_output, symbol_printers_output):
1363 Replace with...
1364 (symbol_code_props_output): ... this to eliminate duplicate code.
1365 (output_skeleton): Update to use symbol_code_props_output.
1366 * src/reader.c (symbol_should_be_used): Update use of
1367 symbol_destructor_get.
1368 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1369 Update uses of the various _destructor_set and _printer_set functions.
1370 * src/symtab.c: (default_tagged_destructor_location,
1371 default_tagless_destructor_location, default_tagged_printer_location,
1372 default_tagless_printer_location): Remove since we...
1373 (default_tagged_destructor, default_tagless_destructor,
1374 default_tagged_printer, default_tagless_printer): ... change the type
1375 of these to code_props.
1376 (symbol_new, semantic_type_new, symbol_destructor_set,
1377 semantic_type_destructor_set, symbol_destructor_get,
1378 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
1379 symbol_check_alias_consistency, default_tagged_destructor_set,
1380 default_tagless_destructor_set, default_tagged_printer_set,
1381 default_tagless_printer_set): Update.
1382 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
1383 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
1384 code_props members.
1385 (symbol_print): Use SYMBOL_CODE_PRINT.
1386
1387 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1388
1389 Use the new code_props interface for rule actions.
1390 * src/symlist.h (symbol_list): Replace action, action_location, and
1391 used members with a code_props action_props member.
1392 * src/reader.c (symbol_should_be_used, grammar_rule_check,
1393 grammar_midrule_action, grammar_current_rule_merge_set,
1394 grammar_current_rule_symbol_append, packgram): Update.
1395 * src/scan-code.h (translate_rule_action): Remove, no longer used.
1396 * src/scan-code.l (handle_action_dollar): Update.
1397 (translate_rule_action): Remove, no longer used.
1398 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
1399
1400 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1401
1402 Use the new code_props interface in parse-gram.y.
1403 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
1404 Update all uses of translate_* functions to use the new code_props
1405 interface and to use gram_scanner_last_string_free and
1406 code_scanner_last_string_free where possible.
1407 (grammar_declaration): symbol_list_destructor_set and
1408 symbol_list_printer_set now perform the translation, so don't do it
1409 here. Use gram_scanner_last_string_free where possible.
1410 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
1411 translate_code): Remove, no longer used.
1412 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
1413 symbol_list_printer_set): Perform code translation here rather than
1414 depending on the caller to do so.
1415
1416 * src/symlist.h (struct symbol_list): Correct some documentation typos.
1417 * src/scan-gram.h (gram_last_string): Remove declaration.
1418 * src/scan-gram.l (last_string): Declare it static.
1419
1420 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1421
1422 Encapsulate code properties and related functionality for the various
1423 destructors, printers, and actions into a code_props structure and
1424 interface. This patch merely implements code_props in scan-code.h and
1425 scan-code.l. Future patches will rewrite other modules to use it.
1426 Discussed starting at
1427 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
1428 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
1429 consistently initialize const structs that have an empty location
1430 field.
1431 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
1432 to ensure consistency.
1433 * src/scan-code.h (code_props): New structure.
1434 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
1435 function, macro, and const global variable for initializing a
1436 code_props with no code.
1437 (code_props_plain_init, code_props_symbol_action_init,
1438 code_props_rule_action_init, code_props_translate_code): The rest of
1439 the new code_props functional interface. Among other things, the init
1440 functions set the code_props kind field so that
1441 code_props_translate_code will know whether to behave like
1442 translate_symbol_action, translate_rule_action, or translate_code.
1443 These old translate functions must remain until all other modules are
1444 updated to use the new code_props interface.
1445 (code_scanner_last_string_free): New function similar to
1446 gram_scanner_last_string_free.
1447 (code_scanner_free): Add documentation.
1448 * src/scan-code.l: Implement the new interface.
1449 (code_lex): Make it static, add a code_props* argument, and remove the
1450 rule argument.
1451 (last_string): New static global similar to the one in scan-gram.l.
1452 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
1453 instead of rule.
1454 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
1455 code_props since Bison may one day use this information for destructors
1456 and printers.
1457 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
1458 (handle_action_dollar): Use symbol_list_n_get and set used flag
1459 directly since symbol_list_n_used_set is removed.
1460 (translate_action): Add a code_props* argument and remove the rule,
1461 action, and location arguments. Pass the code_props* on to code_lex.
1462 (translate_rule_action, translate_symbol_action, translate_code):
1463 Rewrite as wrappers around the new code_props interface.
1464 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
1465 it would eventually need to break the encapsulation of code_props.
1466
1467 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1468
1469 * etc/.cvsignore: New.
1470
1471 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1472
1473 Add maintainer-push-check to run maintainer-check using push parsing in
1474 place of pull parsing where available.
1475 * Makefile.am (maintainer-push-check): New.
1476 * data/bison.m4 (b4_use_push_for_pull_if): New.
1477 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
1478 appropriately based on their existing values.
1479 (yypush_parse): Don't print push-parser-specific diagnostics if push
1480 parsing is being used in place of pull parsing.
1481 * data/yacc.c: If push parsing should replace pull parsing, redirect to
1482 push.c.
1483 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
1484 variable, and insert b4_use_push_for_pull_flag into muscles.
1485 * tests/Makefile.am (maintainer-push-check): New.
1486
1487 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1488
1489 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
1490 (whether successful or failed) so that yypush_parse can be invoked
1491 again to start a new parse using the same yypstate.
1492 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
1493 check multiple yypull_parse invocations on the same yypstate. For pull
1494 mode, extend to check multiple yyparse invocations.
1495 (Exploding the Stack Size with Alloca): Extend to try with
1496 %push-pull-parser.
1497 (Exploding the Stack Size with Malloc): Likewise.
1498
1499 * tests/calc.at (Simple LALR Calculator): Don't specify
1500 %skeleton "push.c" since %push-pull-parser implies that now.
1501 * tests/headers.at (export YYLTYPE): Don't check for the push
1502 declarations. Otherwise, this test case can't be used to see if push
1503 mode can truly emulate pull mode.
1504 * tests/input.at (Torturing the Scanner): Likewise.
1505 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
1506 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
1507 AT_YACC_IF, which now includes the case of push mode since %skeleton
1508 need not be used for push mode. This will be more intuitive once
1509 push.c is renamed to yacc.c.
1510
1511 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1512
1513 For push mode, convert yyparse from a macro to a function, invoke yylex
1514 instead of passing a yylexp argument to yypull_parse, and don't
1515 generate yypull_parse or yyparse unless %push-pull-parser is declared.
1516 Discussed starting at
1517 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
1518 * data/bison.m4 (b4_pull_if): New.
1519 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
1520 * data/push.c: Improve M4 quoting a little.
1521 (b4_generate_macro_args, b4_parenthesize): Remove.
1522 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
1523 any time a pull parser is requested.
1524 Don't #define this as a wrapper around yypull_parse. Instead, when
1525 both push and pull are requested, make it a function that does that
1526 same thing.
1527 (yypull_parse): If there's a b4_prefix, #define this to
1528 b4_prefix[pull_parse] when both push and pull are requested.
1529 Don't define this as a function unless both push and pull are
1530 requested.
1531 Remove the yylexp argument and hard-code yylex invocation instead.
1532 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
1533 %push-parser.
1534 * src/getargs.c (pull_parser): New global initialized to true.
1535 * getargs.h (pull_parser): extern it.
1536 * src/output.c (prepare): Insert pull_flag muscle.
1537 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
1538 (prologue_declaration): Set both push_parser and pull_parser = true for
1539 %push-pull-parser. Set push_parser = true and pull_parser = false for
1540 %push-parser.
1541 * src/scan-gram.l: Don't accept %push_parser as an alternative to
1542 %push-parser since there's no backward-compatibility concern here.
1543 Scan %push-pull-parser.
1544 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
1545 instead of %push-parser.
1546 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
1547 prototype it in the module that calls yyparse.
1548 * tests/input.at (Torturing the Scanner): Likewise.
1549 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
1550
1551 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
1552
1553 Update etc/bench.pl. Optimize push mode a little (the yyn change
1554 deserves most of the credit).
1555 * Makefile.am (SUBDIRS): Add etc subdirectory.
1556 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
1557 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
1558 yytoken, yyval, and yyloc declarations to...
1559 (yyparse or yypush_parse): ... here to improve performance. For
1560 yypush_parse invocations after the first, be sure to assign yyn its old
1561 value again.
1562 (yypstate_new): Don't bother initializing the yyresult field since the
1563 initial value isn't used.
1564 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
1565 remove the #define that, in push mode, set it to yyps->NAME.
1566 * etc/Makefile.am: New.
1567 * etc/bench.pl: Remove and build it instead from...
1568 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
1569 "tests/bison" from the build directory by default rather than just
1570 invoking "bison" from $PATH.
1571 (calc_grammar): Update push parser code: don't declare yylval globally,
1572 don't define yyparse_wrapper, and don't #define yyparse.
1573 (bench_grammar): Update to check all working combinations of yacc.c,
1574 push.c, impure, pure, pull, and push.
1575
1576 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1577
1578 For push mode, add pull wrappers around yypush_parse.
1579 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
1580 (yypull_parse): New function wrapping yypush_parse.
1581 (yyparse): New #define wrapping yypull_parse.
1582 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
1583 is declared.
1584 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
1585 prototype yylex in the module that calls yyparse, and don't prototype
1586 yyparse there. Otherwise, the yyparse expansion won't compile.
1587 * tests/input.at (Torturing the Scanner): Likewise.
1588
1589 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1590
1591 Enable push parsers to operate in impure mode. Thus, %push-parser no
1592 longer implies %pure-parser. The point of this change is to move
1593 towards being able to test the push parser code by running the entire
1594 test suite as if %push-parser had been declared.
1595 * data/push.c (yypush_parse): For impure mode, remove the
1596 yypushed_char, yypushed_val, and yypushed_loc arguments.
1597 Instead, declare these as local variables initialized to the global
1598 yychar, yylval, and yylloc.
1599 For the first yypush_parse invocation only, restore the initial values
1600 of these global variables when it's time to read a token since they
1601 have been overwritten.
1602 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
1603 %push-parser.
1604 * tests/calc.at (Simple LALR(1) Calculator): Always declare
1605 %pure-parser along with %push-parser since this test case was designed
1606 for pure push parsers.
1607 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
1608 (AT_YACC_OR_PUSH_IF): New.
1609 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
1610 add a note that it's still wrong for some cases (as it has been for a
1611 while).
1612 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
1613 %push-parser no longer implies %pure-parser.
1614
1615 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1616
1617 Remove some unnecessary differences between the pull parser code and
1618 the push parser code. This patch enables yynerrs in push mode.
1619 * data/push.c: Reformat M4 a little.
1620 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
1621 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
1622 because push mode is on. Instead, if pure mode is on, move yynerrs
1623 to...
1624 (b4_declare_parser_state_variables): ... here.
1625 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
1626 to yyps->NAME so it can be used in yypush_parse.
1627 (yypush_parse): Don't omit uses of yynerrs in push mode.
1628
1629 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1630
1631 Fix bug such that the first pushed token's value and location are
1632 sometimes overwritten (sometimes by %initial-action) before being used.
1633 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
1634 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
1635 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
1636 more closely mimic the pull parser logic.
1637 Don't copy the pushed token to yychar, yylval, and yylloc until it's
1638 time to read a token, which is after any initialization of yylval and
1639 yylloc.
1640 (gottoken): Rename label to...
1641 (yyread_pushed_token): ... for clarity and to avoid infringing on the
1642 user namespace.
1643
1644 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1645
1646 Rearrange initialization of the parser state variables so that the
1647 skeleton doesn't have to have a copy for pull mode and another for push
1648 mode. This patch also fixes at least a bug such that yylloc was not
1649 initialized (with b4_location_initial_line and
1650 b4_location_initial_column) upon calling yypush_parse. However, that
1651 initialization now overwrites the first token's location;
1652 %initial-action assigning @$ already did the same thing, and both bugs
1653 will be fixed in a later patch.
1654 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
1655 (b4_declare_parser_state_variables): Remove initialization of yytoken,
1656 yyss, yyvs, yyls, and yystacksize.
1657 (yypstate_new): Remove initialization of some yypstate fields: yystate,
1658 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
1659 yylsp.
1660 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
1661 yyps->NAME so it can be used in yypush_parse.
1662 (yyparse or yypush_parse): For yypush_parse, don't print the
1663 "Starting parse" diagnostic for invocations after the first.
1664 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
1665 yypush_parse, only do it for the first invocation.
1666 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
1667 initialization to occur in yypush_parse but only on the first
1668 invocation.
1669
1670 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1671
1672 * data/push.c: Add CPP guards around push parser declarations in both
1673 the header and the code file.
1674 In the code file, move the push parser declarations to the same place
1675 they appear in the header file.
1676 Clean up the M4 some, especially the inconsistent underquoting in
1677 some b4_c_function_def and b4_c_function_decl uses.
1678
1679 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1680
1681 Encapsulate the push parser state variables into an M4 macro so the
1682 push skeleton doesn't have to list them again for pull mode's yyparse.
1683 For push mode, remove yypush_parse's local equivalents of these
1684 variables to eliminate unnecessary copying between the two sets at
1685 run-time. This patch also fixes at least a bug related to multiple
1686 %initial-action invocations in push mode.
1687 * data/push.c (b4_declare_parser_variables): Rename to...
1688 (b4_declare_scanner_communication_variables): ... this for clarity and
1689 update both uses.
1690 (b4_declare_yyparse_variables): Remove and move its contents to the one
1691 spot where it was invoked.
1692 (b4_declare_parser_state_variables): New macro containing the parser
1693 state variables required by push mode.
1694 (struct yypstate): Replace all fields but yynew with
1695 b4_declare_parser_state_variables.
1696 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
1697 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
1698 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
1699 (yyparse or yypush_parse): For yyparse in pull mode, replace local
1700 parser state variable declarations with
1701 b4_declare_parser_state_variables.
1702 Don't initialize parser state variables when calling yypush_parse since
1703 yypstate_new already does that.
1704 Invoke the user's initial action only upon the first yypush_parse
1705 invocation.
1706 Remove all code that copies between the local parser state variables
1707 and the yypstate.
1708
1709 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1710
1711 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
1712 prevent a name collision in a future patch where these names will
1713 sometimes be #define'd.
1714 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
1715 since it no longer has the same name as the existing argument.
1716 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
1717
1718 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
1719 and Joel E. Denny <jdenny@ces.clemson.edu>
1720
1721 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1722 that the argument is case-insensitive, and there's no `=' here.
1723 For the %skeleton entry, mention that %language is better.
1724 (Bison Options): Likewise for --language and --skeleton. Move the
1725 --skeleton entry so that the `Tuning the parser' section is sorted
1726 alphabetically on long options.
1727 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
1728 %language directive in detail here; cross-reference the %language
1729 documentation instead.
1730 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
1731 `%require "2.3b"' so that the example is always up-to-date.
1732 (Table of Symbols): Add entries for %language and %skeleton.
1733 * examples/extexi (normalize): Instead of replacing every %require
1734 argument with the current Bison version, just substitute for
1735 `@value{VERSION}'. This guarantees that we're testing what actually
1736 appears in the documentation.
1737 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
1738 rather than `@VERSION@'.
1739
1740 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1741
1742 * NEWS: Reword the %language news a bit, and put it earlier.
1743
1744 * src/getargs.c (skeleton_arg): Last arg is now location const *.
1745 Rewrite to simplify the logic.
1746 (language_argmatch): Likewise.
1747 (program_name): We now own this var.
1748 * src/getargs.h (struct bison_language): Use char[] rather than
1749 const char *.
1750
1751 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
1752 Java is supported.
1753 * src/complain.c (program_name): Remove decl; no longer needed.
1754 * src/main.c (program_name): Remove; now belongs to getargs.
1755
1756 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
1757
1758 * NEWS: Document %language.
1759
1760 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
1761
1762 * data/c-skel.m4, data/c++-skel.m4: New files.
1763 * data/glr.c: Complain on push parsers.
1764
1765 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
1766 over %skeleton.
1767 (Decl Summary): Document %language and %skeleton.
1768 (Command line): Document -L.
1769
1770 * examples/extexi: Rewrite %require directive.
1771 * examples/calc++/Makefile.am: Pass VERSION to extexi.
1772
1773 * src/files.c (compute_exts_from_gc): Look in language structure
1774 for .y extension.
1775 (compute_file_name_parts): Check whether .tab should be added.
1776 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
1777 (language, skeleton_arg, language_argmatch): New.
1778 (long_options): Add --language.
1779 (getargs): Use skeleton_arg, add -L/--language.
1780 * src/getargs.h: Include location.h.
1781 (struct bison_language, language, skeleton_arg, language_argmatch): New.
1782 * src/output.c (prepare): Pick default skeleton from struct language.
1783 Don't dispatch C skeletons here.
1784 * src/parse-gram.y (PERCENT_LANGUAGE): New.
1785 (prologue_declaration): Add "%language" rule, use skeleton_arg.
1786 * src/scan-gram.l ("%language"): New rule.
1787
1788 * tests/calc.at: Test %skeleton and %language.
1789 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
1790 (AT_GLR_IF): Look for %skeleton "glr.cc".
1791 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
1792 (AT_YACC_IF): Reject %language.
1793
1794 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1795
1796 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
1797 since it wasn't used; only the typedef name 'semantic_type' is needed.
1798 Also, omit trailing white space.
1799
1800 * bootstrap: Sync from coreutils.
1801 (gnulib_extra_files): Add build-aux/announce.gen.
1802 (slurp): Adjust .gitignore files like .cvsignore files.
1803 * build-aux/announce-gen: Remove from CVS, since bootstrap
1804 now creates this.
1805
1806 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
1807
1808 Make %push-parser imply %pure-parser. This fixes several bugs; see
1809 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
1810 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
1811 pure_parser = true.
1812 * data/push.c: Don't bother testing b4_push_if when deciding whether
1813 to expand b4_declare_parser_variables globally.
1814 (yypush_parse): Likewise in here.
1815
1816 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
1817 (yy_reduce_print): Reformat M4 for readability.
1818
1819 2006-12-15 Bob Rossi <bob@brasko.net>
1820 and Joel Denny <jdenny@ces.clemson.edu>
1821
1822 * data/push.c (yypstate): Add typedef, and update all uses of
1823 struct yypstate to just yypstate.
1824 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
1825
1826 2006-12-14 Bob Rossi <bob@brasko.net>
1827
1828 * data/push.c (yypush_parse): Declare prototype regardless of
1829 %locations option.
1830
1831 2006-12-14 Bob Rossi <bob@brasko.net>
1832
1833 * data/push.c (yyparse): Remove the prototype and the #define when in
1834 push-parser mode.
1835
1836 2006-12-13 Bob Rossi <bob@brasko.net>
1837
1838 * data/push.c (yypstate_init): Rename to...
1839 (yypstate_new): ... this and use b4_c_function_def.
1840 (yypstate_delete): New.
1841 (yypush_parse): Change parameters yynval and yynlloc to be const.
1842 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
1843 yypstate_delete functions.
1844
1845 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
1846
1847 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
1848 strange test case titles. Reported by Bob Rossi.
1849
1850 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
1851
1852 * TODO: Add pointer to Sylvain Schmitz's work on static detection
1853 of potential ambiguities in GLR grammers.
1854
1855 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
1856
1857 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
1858 `bison ', use m4_index instead of m4_substr since chopping up a string
1859 containing M4-special characters causes problems here.
1860
1861 Fix a couple of bugs related to special characters in user-specified
1862 file names, and make it easier for skeletons to compute output file
1863 names with the same file name prefix as Bison-computed output file
1864 names.
1865 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
1866 b4_parser_file_name and b4_spec_defines_file instead of
1867 @output_parser_name@ and @output_header_name@, which are now redundant.
1868 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
1869 b4_parser_file_name, b4_spec_defines_file, and the new
1870 @basename(FILENAME@) instead of @output_parser_name@ and
1871 @output_header_name@, which inappropriately escaped the file names as
1872 C string literals.
1873 * src/files.c (all_but_ext): Remove static qualifier.
1874 (compute_output_file_names): Move `free (all_but_ext)' to...
1875 (output_file_names_free): ... here since all_but_ext is needed later.
1876 * src/files.h (all_but_ext): Extern.
1877 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
1878 exactly what MUSCLE_INSERT_STRING used to do.
1879 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
1880 characters are escaped properly.
1881 * src/output.c (prepare): Define muscle file_name_all_but_ext as
1882 all_but_ext.
1883 For pkgdatadir muscle, maintain previous functionality by using
1884 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
1885 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
1886 digraphs would never be expanded. Hopefully no one has M4-special
1887 characters in his Bison installation path.
1888 * src/scan-skel.l: Don't parse @output_header_name@ and
1889 @output_parser_name@ anymore since they're now redundant.
1890 In @output, use decode_at_digraphs.
1891 Parse a new @basename command that invokes last_component.
1892 (decode_at_digraphs): New.
1893 (BASE_QPUTS): Remove unused.
1894 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
1895 (Output file name): New tests.
1896
1897 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
1898
1899 Warn about output files that are generated by the skeletons and that
1900 conflict with other output files.
1901 * data/glr.c: Don't generate the header file here when glr.cc does.
1902 * src/files.c (file_names, file_names_count): New static globals.
1903 (compute_output_file_names): Invoke output_file_name_check for files
1904 not generated by the skeletons and remove existing checks.
1905 (output_file_name_check): New function that warns about conflicting
1906 output file names.
1907 (output_file_names_free): Free file_names.
1908 * src/files.h (output_file_name_check): Declare.
1909 * src/scan-skel.l: Invoke output_file_name_check for files generated by
1910 the skeletons.
1911 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
1912 (Conflicting output files): New tests.
1913
1914 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1915
1916 * doc/bison.texinfo: Fix a couple of typos.
1917
1918 2006-12-08 Bob Rossi <bob@brasko.net>
1919
1920 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
1921 Rename to...
1922 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
1923 update all uses.
1924 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
1925 (yypush_parse): Rename yypvars argument to yyps and remove redundant
1926 local pv.
1927 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
1928 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
1929
1930 2006-12-07 Bob Rossi <bob@brasko.net>
1931 and Joel Denny <jdenny@ces.clemson.edu>
1932
1933 * data/push.c (yypvarsinit): Change return type from void* to struct
1934 yypvars*. No longer cast to void* on return.
1935 (struct yypvars): Remove yylen since it need not be remembered between
1936 yypushparse invocations.
1937 (yypushparse): Don't copy between yylen and pv->yylen.
1938
1939 2006-12-05 Bob Rossi <bob@brasko.net>
1940
1941 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
1942 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
1943 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
1944 (struct yypvars): Remove b4_declare_parser_variables.
1945 (yypvarsinit): Remove init code for removed variables.
1946 (global scope): Do not declare b4_declare_parser_variables if
1947 push or pure mode.
1948 (yypushparse): Add b4_declare_parser_variables.
1949 Init new local variables, and remove init code for removed
1950 yypvars variables.
1951 (yyparse): Delete.
1952 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
1953 and yyparse for other modes.
1954 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
1955 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
1956 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
1957 (AT_PURE_LEX_IF): True if pure or push parser.
1958
1959 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
1960
1961 Document Yacc prologue alternatives and default %destructor's and
1962 %printer's as experimental. Don't mention Java yet. Discussed at
1963 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
1964 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
1965 (2.3a): Annotate this entry to say the old forms of these features were
1966 also experimental.
1967 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
1968 Table of Symbols): Say they're experimental. Comment out any mention
1969 of Java (we'll want this back eventually).
1970
1971 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1972
1973 Support a file name argument to %defines. Deprecate `=' in
1974 %file-prefix, %name-prefix, and %output. Discussed at
1975 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
1976 * NEWS (2.3a+): Mention.
1977 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
1978 form of %defines, and remove `=' from entries for %file-prefix,
1979 %name-prefix, and %output.
1980 * src/parse-gram.y (prologue_declaration): Implement.
1981 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
1982 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
1983 all but one occurrence of %name-prefix.
1984 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
1985 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
1986 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
1987 occurrence of each of %file-prefix and %output. Add check for %defines
1988 with argument.
1989 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
1990 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
1991 Remove the `=' from %output.
1992
1993 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
1994
1995 Don't escape $ in test case titles since Autoconf 2.61 now does that
1996 correctly.
1997 * tests/actions.at (Default %printer and %destructor are not for error
1998 or $undefined): Here.
1999 (Default %printer and %destructor are not for $accept): Here.
2000 * tests/input.at (Invalid $n and @n): Here.
2001
2002 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2003
2004 Rename <!> to <>. Discussed starting at
2005 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2006 * NEWS (2.3a+): Update.
2007 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
2008 Update.
2009 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2010 * src/scan-gram.l (INITIAL): Implement.
2011 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2012 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2013 comment.
2014 * tests/actions.at (Default tagless %printer and %destructor,
2015 Default tagged and per-type %printer and %destructor,
2016 Default %printer and %destructor are not for error or $undefined,
2017 Default %printer and %destructor are not for $accept,
2018 Default %printer and %destructor for mid-rule values): Update.
2019 * tests/input.at (Default %printer and %destructor redeclared,
2020 Unused values with default %destructor): Update.
2021
2022 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2023
2024 Don't let %prec take a nonterminal.
2025 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2026 token.
2027 * tests/input.at (%prec takes a token): New test checking that %prec
2028 won't take a nonterminal.
2029
2030 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2031
2032 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2033 it was double-quoted.
2034 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2035 grammar is maintained with Bison's highest standards.
2036 * src/getargs.c: Fix some typos in Doxygen comments.
2037
2038 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2039
2040 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2041 later. Reported by Paul Eggert in
2042 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2043 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2044 * src/scan-code.l (translate_action): Don't bother invoking
2045 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2046 (code_scanner_free): Instead of invoking
2047 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2048 which frees more.
2049 * src/scan-gram.l (gram_scanner_free): Likewise.
2050 * src/scan-skel.l (scan_skel): Likewise.
2051
2052 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2053
2054 * src/files.c (tr): Change return type to void.
2055 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2056 has been called previously for the same key.
2057 (muscle_find): Return storage instead of value so that
2058 --enable-gcc-warnings doesn't produce warnings that the return discards
2059 const. aver that the value and storage are the same since storage
2060 could potentially be NULL when value is not.
2061 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2062 same as 0.
2063
2064 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2065
2066 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2067 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2068 us a slightly cleaner distribution, and also works.
2069 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2070 gnulib changes.
2071
2072 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2073 and Paul Eggert <eggert@cs.ucla.edu>
2074
2075 Don't let Bison leak memory except when it complains.
2076 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2077 (spec_defines_file, dir_prefix): Now char *, not const char *,
2078 since they are freed.
2079 * src/files.c: Likewise.
2080 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2081 Likewise.
2082 (tr): Now operates in-place. All uses changed.
2083 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2084 values.
2085 (compute_file_name_parts, compute_output_file_names): Don't store
2086 read-only data in variables that will be freed.
2087 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2088 src_extension, and header_extension.
2089 (output_file_names_free): New public function to free
2090 spec_verbose_file, spec_graph_file, spec_defines_file,
2091 parser_file_name, and dir_prefix.
2092 * src/getargs.c (getargs): Don't store read-only data in variables that
2093 will be freed.
2094 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2095 (which previously existed but was unused), and quotearg_free.
2096 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2097 * src/muscle_tab.c: Likewise.
2098 (muscle_entry): Make the value char const *,
2099 and add a new storage member that is char * and can be freed.
2100 (muscle_entry_free): New private function.
2101 (muscle_init): Use it instead of free.
2102 (muscle_insert, muscle_grow): Update and use new storage member.
2103 (muscle_code_grow): Free the string passed to muscle_grow
2104 since it's not needed anymore.
2105 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2106 add a new `char *code' member.
2107 ("{...}"): Declare semantic type as code.
2108 * src/scan-code.h (translate_rule_action):
2109 (translate_symbol_action, translate_code, translate_action): Return
2110 `char const *' rather than `char *' since external code should not free
2111 these strings.
2112 * src/scan-code.l: Likewise.
2113 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2114 which is "{...}" in the parser.
2115 * tests/Makefile.am (maintainer-check-valgrind): Set
2116 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2117 Valgrind.
2118 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2119 complain.
2120 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2121 expecting a non-zero exit status sets --leak-check=summary and
2122 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2123 this case, and we don't want to hear about it.
2124
2125 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2126
2127 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2128 instead of from the template, to simplify configuration a bit.
2129 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2130 and m4/wint_t.m4, as they are needed with the latest gnulib.
2131
2132 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2133
2134 Disable unset/unused mid-rule value warnings by default, and recognize
2135 --warnings=midrule-values to enable them. Discussed starting at
2136 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2137 * NEWS (2.3a+): Mention.
2138 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2139 warnings): Add entry for midrule-values subargument.
2140 * src/reader.c (symbol_should_be_used): Don't return true just because
2141 the value is a set/used mid-rule value unless
2142 --warnings=midrule-values was specified.
2143 * tests/input.at (Unused values, Unused values before symbol
2144 declarations): Run tests with and without --warnings=midrule-values.
2145
2146 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2147 than LIST_FREE directly.
2148
2149 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2150
2151 Finish implementing --warnings=error, which should not be implied by
2152 --warnings=all (or by its synonyms -W and --warnings without
2153 subarguments).
2154 * src/complain.c (set_warning_issued): New function to report that
2155 warnings are being treated as errors and to record an error if so.
2156 Invoke...
2157 (warn_at, warn): ... here.
2158 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2159 "error - warnings are errors" does not appear above "all - all of the
2160 above".
2161 (getargs): For -W and --warnings without subarguments, don't let
2162 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2163 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2164
2165 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2166
2167 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2168 empty subargument list. For example: `bison --warnings= parser.y'.
2169
2170 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2171
2172 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2173 the parser header file so that gcc doesn't warn.
2174
2175 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2176
2177 Split the default %destructor/%printer into two kinds: <*> and <!>.
2178 Discussed starting at
2179 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2180 * NEWS (2.3a+): Mention.
2181 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2182 previous change today related to mid-rules.
2183 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
2184 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
2185 (TYPE_TAG_ANY): Add as <*>.
2186 (TYPE_TAG_NONE): Add as <!>.
2187 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2188 for <*> and <!>.
2189 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2190 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2191 * src/symlist.c (symbol_list_default_new): Split into tagged and
2192 tagless versions.
2193 (symbol_list_destructor_set, symbol_list_printer_set): Split
2194 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2195 SYMLIST_DEFAULT_TAGLESS.
2196 * src/symlist.h: Update symbol_list_default*_new prototypes.
2197 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2198 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2199 * src/symtab.c (default_destructor, default_destructor_location,
2200 default_printer, default_printer_location): Split each into tagged and
2201 tagless versions.
2202 (symbol_destructor_get, symbol_destructor_location_get,
2203 symbol_printer_get, symbol_printer_location_get): Implement tagged
2204 default and tagless default cases.
2205 (default_destructor_set, default_printer_set): Split each into tagged
2206 and tagless versions.
2207 * src/symtab.h: Update prototypes.
2208 * tests/actions.at (Default %printer and %destructor): Rename to...
2209 (Default tagless %printer and %destructor): ... this, and extend.
2210 (Per-type %printer and %destructor): Rename to...
2211 (Default tagged and per-type %printer and %destructor): ... this, and
2212 extend.
2213 (Default %printer and %destructor for user-defined end token): Extend.
2214 (Default %printer and %destructor are not for error or $undefined):
2215 Update.
2216 (Default %printer and %destructor are not for $accept): Update.
2217 (Default %printer and %destructor for mid-rule values): Extend.
2218 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2219 (Unused values with default %destructor): Extend.
2220
2221 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2222
2223 Don't apply the default %destructor/%printer to an unreferenced midrule
2224 value. Mentioned at
2225 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2226 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2227 like $@n instead of just @n so that the default %destructor/%printer
2228 logic doesn't see them as user-defined symbols.
2229 (symbol_is_dummy): Check for both forms of the name.
2230 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2231 name for which the midrule value is referenced in any action.
2232 * tests/actions.at (Default %printer and %destructor for mid-rule
2233 values): New test.
2234 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2235 for change to dummy symbol names.
2236
2237 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2238
2239 Warn about unset midrule $$ if the corresponding $n is used.
2240 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2241 $n usage.
2242 (packgram): Before invoking grammar_rule_check on any rule, make sure
2243 all actions have already been scanned in order to set `used' flags.
2244 Otherwise, checking that a midrule's $$ is set will not always work
2245 properly because the midrule check must forward-reference the midrule's
2246 parent rule.
2247 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2248 warning.
2249
2250 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2251
2252 More improvements to the documentation of the prologue alternatives:
2253 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2254 Bison manual.
2255 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2256 some text to clarify the relative importance of the new directives and
2257 to show how these directives may be viewed as code labels.
2258
2259 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2260
2261 Similar to the recently removed %before-header, add %code-top as the
2262 alternative to the pre-prologue. Mentioned at
2263 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2264 Also, let the prologue alternatives appear in the grammar section.
2265 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2266 (prologue_declaration): Move the existing prologue alternatives to...
2267 (grammar_declaration): ... here and add %code-top.
2268 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2269
2270 Clean up and extend documentation for the prologue alternatives.
2271 * NEWS (2.3a+): Describe prologue alternatives.
2272 * doc/bison.texinfo (Prologue): Move discussion of prologue
2273 alternatives to...
2274 (Prologue Alternatives): ... this new section, and extend it to discuss
2275 all 4 directives in detail.
2276 (Table of Symbols): Clean up discussion of prologue alternatives and
2277 add %code-top.
2278
2279 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2280
2281 DJGPP specific issues.
2282
2283 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2284 config.bat accordingly.
2285 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2286 * djgpp/config.site: Likewise.
2287
2288 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
2289
2290 Replace %*-header with %provides, %requires, %code. See discussion at
2291 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
2292
2293 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
2294 (b4_user_start_header): Remove.
2295 * data/glr.c: Use new macros instead of b4_*start_header
2296 and b4_*end_header.
2297 * data/glr.cc: Likewise.
2298 * data/lalr1.cc: Likewise.
2299 * data/push.c: Likewise.
2300 * data/yacc.c: Likewise.
2301
2302 * doc/bison.texinfo: Remove %before-header, rename
2303 %{start,end,after}-header to %requires, %provides, %code.
2304
2305 * src/parse-gram.y: Likewise (also rename token names accordingly).
2306 * src/scan-gram.l: Likewise.
2307 * tests/actions.at: Likewise.
2308
2309 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
2310
2311 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
2312 Problem reported by Joel E. Denny.
2313
2314 2006-10-14 Jim Meyering <jim@meyering.net>
2315
2316 (Sync from coreutils.)
2317 Work also when the working directory (with e.g. coreutils sources)
2318 is version controlled with git, rather than CVS.
2319 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
2320 rather than CVS.
2321 In messages and comments, say e.g., "checked-out sources",
2322 rather than "CVS sources".
2323 (version_controlled_file): New function. Work for git as well as
2324 for CVS. Don't use grep's -q option.
2325 (slurp): Call it here, in place of CVS-specific code.
2326
2327 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
2328
2329 Fix testsuite for ./configure --enable-gcc-warnings:
2330 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
2331 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
2332 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
2333 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
2334 * test/regression.at (Diagnostic that expects two alternatives):
2335 Likewise.
2336
2337 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2338
2339 * bootstrap.conf (gnulib_modules): Add config-h.
2340 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
2341 worry about HAVE_CONFIG_H.
2342 * lib/abitset.c: Likewise.
2343 * lib/bitset.c: Likewise.
2344 * lib/bitset_stats.c: Likewise.
2345 * lib/bitsetv-print.c: Likewise.
2346 * lib/bitsetv.c: Likewise.
2347 * lib/ebitset.c: Likewise.
2348 * lib/get-errno.c: Likewise.
2349 * lib/lbitset.c: Likewise.
2350 * lib/subpipe.c: Likewise.
2351 * lib/timevar.c: Likewise.
2352 * lib/vbitset.c: Likewise.
2353 * lib/bitset.c: Include "bitset.h" first, to test interface.
2354 * lib/bitset_stats.c: Include "bitset_stats.h" first.
2355 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
2356 * lib/bitsetv.c: Include "bitsetv.h" first.
2357 * lib/get-errno.c: Include "get-errno.h" first.
2358 * m4/.cvsignore: Add config-h.m4.
2359 * tests/actions.at (Default %printer and %destructor for ...):
2360 Adjust expected line numbers in output to reflect removal of #if
2361 HAVE_CONFIG_H lines.
2362 * tests/glr-regression.at (Missed %merge type warnings when ...):
2363 Likewise.
2364 * tests/regression.at (Braced code in declaration in rules section):
2365 Likewise.
2366 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
2367 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
2368 Include <config.h> unconditionally.
2369
2370 * bootstrap: Sync from coreutils, as follows:
2371
2372 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2373
2374 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
2375 variable was sometimes used without being initialized. This
2376 messed up the installation of the INSTALL file in some cases.
2377
2378 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2379
2380 * bootstrap (usage, main program, symlink_to_gnulib): Add option
2381 --copy. Inspired by a suggestion from Bruno Haible.
2382
2383 2006-10-03 Jim Meyering <jim@meyering.net>
2384
2385 * bootstrap: Undo last change to this file, since now gnulib-tool
2386 sticks with the automake default in generating dependencies.
2387
2388 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2389
2390 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
2391 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
2392
2393 * doc/bison.1: Add copyright notice.
2394
2395 * data/glr.c: Don't include <stdarg.h>; not used.
2396
2397 * NEWS: The -g and --graph options now output graphs in Graphviz
2398 DOT format, not VCG format.
2399 * doc/bison.1: Likewise.
2400 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
2401 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
2402 of this change in
2403 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
2404 * TODO: Remove Graphviz entry.
2405 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
2406 remove vcg.c, vcg.h, vcg_defaults.h.
2407 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
2408 * src/graphviz.c, src/graphviz.h: New files.
2409 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
2410 * src/files.h: Make comment more generic.
2411 * src/main.c (main): Likewise.
2412 * src/print_graph.h: Likewise.
2413 * src/getargs.c (usage): Make usage description more generic.
2414 * src/print_graph.c: Include graphviz.h rather than vcg.h.
2415 (static_graph, fgraph): Remove. All uses changed to pass
2416 arguments instead of sharing a static var.
2417 (print_core, print_actions, print_state, print_graph):
2418 Output graphviz format rather than VCG format.
2419 * tests/.cvsignore: Remove *.vcg; add *.dot.
2420 * tests/output.at: Expect *.dot files, not *.vcg files.
2421
2422 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
2423 accommodates the 2006-10-08 change.
2424
2425 2006-10-11 Bob Rossi <bob@brasko.net>
2426
2427 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
2428 (b4_yyssa, b4_yyerror_range): New macros.
2429 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
2430 (yypvarsinit): Remove init of removed fields.
2431 (yypushparse): Remove use of removed fields; use new macros instead.
2432
2433 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2434
2435 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
2436 in a push parser. Reindent slightly to match yacc.c better.
2437
2438 2006-10-11 Bob Rossi <bob@brasko.net>
2439
2440 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
2441 yymsg_alloc fields.
2442 (yypvarsinit, yypushparse): Remove init of removed fields.
2443 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
2444
2445 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2446
2447 * THANKS: Add Paolo Bonzini and Bob Rossi.
2448
2449 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
2450
2451 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
2452 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
2453 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
2454 b4_define_user_cde and uses): Remove.
2455 (b4_comment, b4_prefix, b4_sync_start): New.
2456 * data/bison.m4: New file, with most of the content removed from c.m4.
2457 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
2458 * src/output.c (output_skeleton): Pass bison.m4.
2459 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
2460 only if specified.
2461
2462 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
2463
2464 Fix test failure reported by Tom Lane in
2465 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
2466 and try to make such failures easier to catch in the future.
2467 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
2468 that's now the caller's responsibility.
2469 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
2470 Set yychar = YYEOF if it's negative.
2471 * tests/actions.at (yylex): Abort if asked to read past EOF.
2472 * tests/conflicts.at (yylex): Likewise.
2473 * tests/cxx-type.at (yylex): Likewise.
2474 * tests/glr-regression.at (yylex): Likewise.
2475 * tests/input.at (yylex): Likewise.
2476 * tests/regression.at (yylex): Likewise.
2477 * tests/torture.at (yylex): Likewise.
2478
2479 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
2480
2481 Fix problems with translating English-language diagnostics.
2482 * bootstrap: Fix bug introduced in recent bootstrap changes, with
2483 respect to bison-runtime pot generation. The YY_ stuff
2484 wasn't being captured.
2485 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
2486 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
2487 * runtime-po/POTFILES.in: Add data/push.c.
2488
2489 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
2490
2491 Merge bootstrap changes from coreutils.
2492
2493 2006-09-28 Jim Meyering <jim@meyering.net>
2494
2495 Automatically generated dependencies are important even
2496 when all of the sources in a directory come from gnulib.
2497 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
2498 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
2499
2500 2006-09-23 Jim Meyering <jim@meyering.net>
2501
2502 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
2503
2504 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2505
2506 * bootstrap: Add support for --force.
2507 (usage): New function. Describe usage less tersely.
2508 (CVS_only_file): New var.
2509
2510 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
2511
2512 * data/push.c (YYPUSH_MORE): Make it an enum instead.
2513 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
2514 Adjust white space and comments to match GNU style better.
2515
2516 2006-09-20 Bob Rossi <bob@brasko.net>
2517
2518 * data/push.c (yyresult_get): Remove function.
2519 (YYPUSH_MORE): Add #define.
2520 (yypushparse): Modify return value.
2521
2522 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2523
2524 * stamp-h.in: Remove; no longer needed.
2525 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
2526 Remove config.h, config.hin, intl (no longer created).
2527 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
2528 stamp-h1.
2529
2530 Sync bootstrap from coreutils, as follows:
2531
2532 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
2533
2534 * bootstrap (symlink_to_gnulib): New function.
2535 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
2536 to copies-of-gnulib.
2537 (cp_mark_as_generated, slurp, gnulib_files):
2538 Avoid making a copy if it's the same as the old version.
2539 (gnulib_files): Add support for this variable (used by Bison).
2540
2541 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2542
2543 * src/getargs.c (usage): Rework to use conventions similar to
2544 coreutils, to make translation a bit easier and the code a bit
2545 smaller. Problem reported by Tim Van Holder.
2546
2547 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
2548
2549 Use some of gnulib's new modules, taken from coreutils.
2550
2551 * bootstrap: Sync from coreutils, except add support for gnulib_files.
2552 * bootstrap.conf: New file.
2553 (gnulib_modules): Add configmake, inttypes, unistd.
2554 (XGETTEXT_OPTIONS): Add complain, complain_at,
2555 fatal, fatal_at, warn, warn_at, unexpected_end.
2556 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
2557 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
2558 (gl_EARLY): Add.
2559 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
2560 (gl_INIT): Add
2561 (GNULIB_AUTOCONF_SNIPPET): Remove.
2562 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
2563 the pickiest.
2564 * lib/.cvsignore: Add inttypes_.h.
2565 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
2566 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
2567 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
2568 no-longer-necessary initializations.
2569 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
2570 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
2571 use the unistd module.
2572 * src/system.h: Likewise.
2573 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
2574 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
2575 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
2576 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
2577 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
2578 * src/system.h: Include inttypes.h unconditionally, now that we
2579 use the inttypes module. Don't bother to include stdint.h, since
2580 inttypes.h now does that for us.
2581 (LOCALEDIR): Remove, now that we use the configmake module.
2582 * src/getargs.c: Include configmake.h.
2583 * src/main.c: Likewise.
2584 * src/output.c: Likewise.
2585 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
2586 not from $abs_top_builddir, since config.h moved.
2587
2588
2589 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
2590 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
2591
2592 * src/parse-gram.y (symbol_declaration): Don't put statements
2593 before declarations; it's not portable to C89.
2594 * src/scan-code.l (handle_action_at): Likewise.
2595
2596 * src/scan-code.l: Always initialize braces_level; the old code
2597 left it uninitialized and therefore had undefined behavior.
2598
2599 Don't attempt to redefine 'assert', since it runs afoul of
2600 systems where standard headers (mistakenly) include <assert.h>.
2601 Instead, define and use our own alternative, called 'aver'.
2602 * src/reader.c: Don't include assert.h, since we no longer
2603 use assert.
2604 * src/scan-code.l: Likewise.
2605 * src/system.h (assert): Remove, replacing with....
2606 (aver): New function, taking a bool arg. All uses changed.
2607 * src/tables.c (pack_vector): Ensure that aver arg is bool,
2608 not merely an integer.
2609
2610 2006-09-15 Bob Rossi <bob@brasko.net>
2611
2612 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
2613 * data/c.m4 (YYPUSH): New.
2614 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
2615 * src/getargs.c (push_parser): New var.
2616 * src/getargs.h (push_parser): New declaration.
2617 * src/output.c (prepare): Add macro insertion of `push_flag'.
2618 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
2619 (prologue_declaration): Parse %push-parser.
2620 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
2621 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
2622 list of removed lines from the traces observed.
2623 (AT_CHECK_CALC_LALR): Added push parser tests.
2624
2625 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
2626
2627 * NEWS: Version 2.3a.
2628 * configure.ac (AC_INIT): Likewise.
2629
2630 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
2631 "#define YYSTYPE int" that caused "make maintainer-check" to fail
2632 due to header ordering dependencies. I don't know why the #define
2633 was there.
2634
2635 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
2636 runtime cost when YYDEBUG is not defined, and so that some tests
2637 that used to fail now work. Problem and initial suggestion by
2638 Paolo Bonzini.
2639 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
2640 * data/glr.cc (b4_parser_class_name):
2641 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
2642 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
2643 (yydebug_) [YYDEBUG]: New member.
2644 (yycdebug_): Now defined only if YYDEBUG.
2645 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
2646 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
2647 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
2648 if YYYDEBUG.
2649 (debug_stream, set_debug_stream, debug_level, set_debug_level):
2650 Define only if YYDEBUG.
2651 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
2652 set_debug_level.
2653 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
2654 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
2655 AT_CHECK_CALC_GLR_CC that are working now.
2656
2657 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
2658
2659 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
2660 We don't need them in glr.cc, and glr.c defines them.
2661 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
2662 assumes that defining it to anything is the same as defining
2663 it to 1. Problem reported by Paolo Bonzini.
2664
2665 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2666
2667 * data/c.m4 (b4_null, b4_case): Define.
2668 * src/output.c (prepare_symbols): Use b4_null.
2669 (user_actions_output): Use b4_case.
2670
2671 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
2672
2673 * data/glr.c (b4_shared_declarations): Put start-header first,
2674 before any #includes that we generate, so that feature-test
2675 macros work. Problem reported by Michael Deutschmann in
2676 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
2677 * data/lalr1.cc: Likewise.
2678 * doc/bison.texinfo (Prologue): Document that feature-test macros
2679 should be defined before any Bison declarations.
2680 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
2681 that depend on location.hh after, not before, Bison decls, since
2682 we now include location.hh after the first user prologue.
2683
2684 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
2685 Sander Brandenburg in
2686 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
2687 Also, fix minor white space and comment issues.
2688 (Prologue): Mention that it's better to define feature-test macros
2689 before Bison declarations. Problem reported by Michael Deutschmann.
2690
2691 * README-cvs: Fix typo: "&" should be "&&". Problem reported
2692 by Jim Meyering.
2693 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
2694 This adjusts to recent gnulib changes.
2695
2696 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2697
2698 Finish implementation of per-type %destructor/%printer. Discussed
2699 starting at
2700 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
2701 and
2702 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
2703 * NEWS (2.3+): Add a description of this feature to the default
2704 %destructor/%printer description.
2705 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
2706 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2707 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
2708 list node contains a semantic type.
2709 * src/symtab.c, src/symtab.h: Extend with a table that associates
2710 semantic types with their %destructor's and %printer's.
2711 (semantic_type_from_uniqstr, semantic_type_get,
2712 semantic_type_destructor_set, semantic_type_printer_set): New functions
2713 composing the public interface of that table.
2714 (symbol_destructor_get, symbol_destructor_location_get,
2715 symbol_printer_get, symbol_printer_location_get): If there's no
2716 per-symbol %destructor/%printer, look up the per-type before trying
2717 the default.
2718 * tests/actions.at (Per-type %printer and %destructor): New test case.
2719 * tests/input.at (Default %printer and %destructor redeclared):
2720 Extend to check that multiple occurrences of %symbol-default in a
2721 single %destructor/%printer declaration is an error.
2722 (Per-type %printer and %destructor redeclared, Unused values with
2723 per-type %destructor): New test cases.
2724
2725 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2726
2727 Require default %destructor/%printer to be declared using
2728 %symbol-default instead of an empty symbol list, and start working on
2729 new per-type %destructor/%printer. Discussed at
2730 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
2731 * NEWS (2.3+): Add %symbol-default to example.
2732 * bison.texinfo (Freeing Discarded Symbols): Likewise.
2733 (Table of Symbols): Add entry for %symbol-default.
2734 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
2735 (generic_symlist, generic_symlist_item): New nonterminals for creating
2736 a list in which each item is a symbol, semantic type, or
2737 %symbol-default.
2738 (grammar_declaration): Use generic_symlist in %destructor and %printer
2739 declarations instead of symbols.1 or an empty list.
2740 (symbol_declaration, precedence_declaration, symbols.1): Update actions
2741 for changes to symbol_list.
2742 * src/reader.c: Update for changes to symbol_list.
2743 * src/scan-code.l: Likewise.
2744 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
2745 * src/symlist.c, src/symlist.h: Extend such that a list node may
2746 represent a semantic type or a %symbol-default in addition to just an
2747 ordinary symbol. Add switched functions for setting %destructor's and
2748 %printer's.
2749 * tests/actions.at, tests/input.at: Add %symbol-default to all default
2750 %destructor/%printer declarations.
2751
2752 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
2753
2754 Whether the default %destructor/%printer applies to a particular symbol
2755 isn't a question of whether the user *declares* that symbol (in %token,
2756 for example). It's a question of whether the user by any means
2757 *defines* the symbol at all (by simply using a char token, for
2758 example). $end is defined by Bison whereas any other token with token
2759 number 0 is defined by the user. The error token is always defined by
2760 Bison regardless of whether the user declares it with %token, but we
2761 may one day let the user define error as a nonterminal instead.
2762 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
2763 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
2764 the meaning of "user-defined".
2765 * tests/actions.at (Default %printer and %destructor for user-declared
2766 end token): Rename to...
2767 (Default %printer and %destructor for user-defined end token): ...
2768 this.
2769
2770 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
2771 computation of whether to apply the default, don't maintain a list of
2772 every Bison-defined symbol. Instead, just check for a first character
2773 of '$', which a user symbol cannot have, and check for the error token.
2774
2775 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
2776
2777 Don't apply the default %destructor or %printer to the error token,
2778 $undefined, or $accept. This change fits the general rule that the
2779 default %destructor and %printer are only for user-declared symbols,
2780 and it solves several difficulties that are described in the new test
2781 cases listed below.
2782 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
2783 * tests/actions.at (Default %printer and %destructor are not for error
2784 or $undefined, Default %printer and %destructor are not for $accept):
2785 New test cases.
2786
2787 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
2788
2789 Allow %start after the first rule.
2790 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
2791 when parsing the first rule.
2792 (check_and_convert_grammar): Search for it here after all grammar
2793 declarations have been parsed. Skip midrules, which have dummy LHS
2794 nonterminals.
2795 * src/symtab.c (symbol_is_dummy): New function.
2796 * src/symtab.h (symbol_is_dummy): Declare it.
2797 * tests/input.at (%start after first rule): New test.
2798
2799 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2800
2801 Redo some of the previous commit: add back the ability to use
2802 non-aliased/undeclared string literals since it might be useful to
2803 those declaring %token-table.
2804 * src/reader.c (check_and_convert_grammar): Undo changes in previous
2805 commit: don't worry about complaints from symbols_pack.
2806 * src/symtab.c (symbol_new, symbol_class_set,
2807 symbol_check_alias_consistency): Undo changes in previous commit: count
2808 each string literal as a new symbol and token, assign it a symbol
2809 number, and don't complain about non-aliased string literals.
2810 (symbols_pack): Since symbol_make_alias still does not decrement symbol
2811 and token counts but does still set aliased tokens to the same number,
2812 symbol_pack_processor now leaves empty slots in the symbols array.
2813 Remove those slots.
2814 * tests/regression.at (Undeclared string literal): Remove test case
2815 added in previous commit since non-aliased string literals are allowed
2816 again.
2817 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
2818 remove unnecessary string literal declarations.
2819 * tests/sets.at (Firsts): Likewise.
2820
2821 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2822
2823 Don't allow an undeclared string literal, but allow a string literal to
2824 be used before its declaration.
2825 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
2826 symbols_pack complained.
2827 * src/symtab.c (symbol_new): Don't count a string literal as a new
2828 symbol.
2829 (symbol_class_set): Don't count a string literal as a new token, and
2830 don't assign it a symbol number since symbol_make_alias does that.
2831 (symbol_make_alias): It's not necessary to decrement the symbol and
2832 token counts anymore. Don't assume that an alias declaration occurs
2833 before any uses of the identifier or string, and thus don't assert that
2834 one of them has the highest symbol number so far.
2835 (symbol_check_alias_consistency): Complain if there's a string literal
2836 that wasn't declared as an alias.
2837 (symbols_pack): Bail if symbol_check_alias_consistency failed since
2838 symbol_pack asserts that every token has been assigned a symbol number
2839 although undeclared string literals have not.
2840 * tests/regression.at (String alias declared after use, Undeclared
2841 string literal): New test cases.
2842 (Characters Escapes, Web2c Actions): Declare string literals as
2843 aliases.
2844 * tests/sets.at (Firsts): Likewise.
2845
2846 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
2847
2848 In the grammar scanner, STRING_FINISH unclosed constructs and return
2849 them to the parser in order to improve error messages.
2850 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
2851 SC_BRACED_CODE, SC_PROLOGUE): Implement.
2852 * tests/input.at (Unclosed constructs): New test case.
2853 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
2854 seen.
2855
2856 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
2857 unused global.
2858
2859 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
2860
2861 Handle string aliases for character tokens correctly.
2862 * src/symtab.c (symbol_user_token_number_set): If the token has an
2863 alias, check and set its alias's user token number instead of its own,
2864 which is set to indicate the alias. Previously, every occurrence of
2865 the character token in the grammar overwrote that alias indicator with
2866 the character code.
2867 * tests/input.at (String aliases for character tokens): New test.
2868
2869 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
2870
2871 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
2872
2873 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
2874
2875 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
2876 to prevent failures when building on older platforms.
2877 Check for autopoint failure.
2878 Set XGETTEXT_OPTIONS to values that check for C format strings,
2879 so that translators are warned about them (this also helps
2880 prevent core dumps).
2881
2882 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
2883 function, since it simplifies our code a bit.
2884
2885 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
2886 rather than -W, so we don't get bogus warnings about sign comparisons.
2887 Add -Wpointer-arith, since that warning is useful (it reports code
2888 that does not conform to C89 and that some compilers reject).
2889 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
2890 since it's no longer needed.
2891
2892 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
2893
2894 Clean up scanners a bit.
2895 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
2896 definitions so gcc won't warn when obstack_for_string is unused.
2897 * src/scan-code.l: config.h and system.h are already #include'd by
2898 scan-code-c.c, so get rid of them here.
2899 * src/scan-gram.l: Likewise.
2900 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
2901 definitions rather than duplicating the rest of it.
2902 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
2903
2904 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
2905
2906 Suppress signed/unsigned comparison warnings for yycheck.
2907 * data/c.m4 (b4_safest_int_type): New macro.
2908 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
2909 a signed int type, cast it to b4_safest_int_type first.
2910 * data/yacc.c: Likewise.
2911 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
2912 also overwritten.
2913
2914 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2915
2916 * doc/bison.texinfo: Fix some typos.
2917
2918 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
2919
2920 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
2921 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
2922
2923 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
2924 the latest gnulib does this a different way.
2925 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
2926 translation was patched, so stop omitting it.
2927
2928 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2929
2930 Enable declaration of default %printer/%destructor. Make the parser
2931 use these for all user-declared grammar symbols for which the user does
2932 not declare a specific %printer/%destructor. Thus, the parser uses it
2933 for token 0 if the user declares it but not if Bison generates it as
2934 $end. Discussed starting at
2935 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
2936 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
2937 and
2938 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
2939 * NEWS (2.3+): Mention.
2940 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
2941 declare a %destructor for a mid-rule's semantic value. It's just
2942 impossible to declare one specific to it.
2943 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
2944 code. Describe default %destructor form.
2945 * src/parse-gram.y (grammar_declaration): Parse default
2946 %printer/%destructor declarations.
2947 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
2948 and symbol_destructor_location_get rather than accessing the destructor
2949 and destructor_location members of struct symbol.
2950 (symbol_printers_output): Likewise but for %printer's.
2951 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
2952 again.
2953 * src/symtab.c (default_destructor, default_destructor_location,
2954 default_printer, default_printer_location): New static global
2955 variables to record the default %destructor and %printer.
2956 (symbol_destructor_get, symbol_destructor_location_get,
2957 symbol_printer_get, symbol_printer_location_get): New functions to
2958 compute the appropriate %destructor and %printer for a symbol.
2959 (default_destructor_set, default_printer_set): New functions to set the
2960 default %destructor and %printer.
2961 * src/symtab.h: Prototype all those new functions.
2962 * tests/actions.at (Default %printer and %destructor): New test to
2963 check that the right %printer and %destructor are called, that they're
2964 not called for $end, and that $$ and @$ work correctly.
2965 (Default %printer and %destructor for user-declared end token): New
2966 test to check that the default %printer and %destructor are called for
2967 a user-declared end token.
2968 * tests/input.at (Default %printer and %destructor redeclared, Unused
2969 values with default %destructor): New tests to check related grammar
2970 warnings and errors.
2971
2972 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2973
2974 Clean up handling of %destructor for the end token (token 0).
2975 Discussed starting at
2976 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
2977 and
2978 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
2979
2980 Make the skeletons consistent in how they pop the end token and invoke
2981 its %destructor.
2982 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
2983 state, which has token number 0, since this would invoke the
2984 %destructor for the end token.
2985 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
2986 until after shifting the end token, or else it won't be popped.
2987 * data/yacc.c (yyparse): Likewise.
2988
2989 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
2990 it's the end token. Upon termination, destroy an unshifted lookahead
2991 even when it's the end token.
2992 * data/lalr1.cc (yy::parser::parse): Likewise.
2993 * data/yacc.c (yyparse): Likewise.
2994
2995 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
2996 value warnings for the end token when the user gives the end token a
2997 %destructor.
2998
2999 * tests/actions.at (Printers and Destructors): Test all the above.
3000
3001 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3002
3003 Update to latest gnulib and gettext versions.
3004 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3005 Add fopen-safer.
3006 (gnulib_files): Add m4/warning.m4. Don't worry about files
3007 overwritten by autopoint.
3008 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3009 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3010 rejects them.
3011 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3012 so that we can remove the intl files at a better time.
3013 (intl_files_to_remove): Remove aclocal.m4, since it gets
3014 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3015 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3016 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3017 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3018 Remove datarootdir hack; no longer needed.
3019 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3020 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3021 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3022 strdup.h.
3023 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3024 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3025
3026 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3027
3028 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3029 it with --assume-autoconf='latest-stable'.
3030
3031 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3032
3033 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3034 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3035 YYSTYPE' and `{'.
3036 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3037 those from muscle_tab.c since the old ones are misleading.
3038
3039 2006-07-13 Akim Demaille <akim@epita.fr>
3040
3041 Support %define "KEY" {VALUE}.
3042 * src/scan-code.h, src/scan-code.l (translate_action)
3043 (translate_rule_action, translate_symbol_action, translate_code):
3044 Return char *, not const char *.
3045 * src/parse-gram.y (declaration): Rename as...
3046 (prologue_declaration): this.
3047 (string_content): Remove this nonterminal, use STRING.
3048 (braceless, content, content.opt): New nonterminal.
3049 Use them.
3050 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3051 as value.
3052 * src/scan-gram.l (getargs.h): Don't include it.
3053
3054 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3055
3056 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3057 rather than a for-loop that declares a local bool variable. This
3058 should work around a compatibility problem with a Cray x1e C++
3059 compiler reported by Hung Nguyen in
3060 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3061 The for-loop was introduced in the 2004-11-17 change but I don't
3062 know why it was needed.
3063
3064 2006-07-12 Akim Demaille <akim@epita.fr>
3065
3066 * data/c.m4: Comment changes.
3067
3068 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
3069
3070 * src/complain.c (error_message, ERROR_MESSAGE): New.
3071 To factor...
3072 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3073 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3074
3075 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3076
3077 * NEWS: Instead of %union, you can define and use your own union type
3078 YYSTYPE if your grammar contains at least one <type> tag.
3079 Your YYSTYPE need not be a macro; it can be a typedef.
3080 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3081 (Union Decl, Decl Summary): Document this.
3082 * data/glr.c (YYSTYPE): Implement this.
3083 * data/glr.cc (YYSTYPE): Likewise.
3084 * data/lalr1.cc (YYSTYPE): Likewise.
3085 * data/yacc.c (YYSTYPE): Likewise.
3086 * src/output.c (prepare): Output tag_seen_flag.
3087 * src/parse-gram.y (declaration, grammar_declaration):
3088 Use 'union_seen' rather than 'typed' to determine whether
3089 %union has been seen, since grammars can now be typed without
3090 %union.
3091 (symbol_declaration, type.opt, symbol_def):
3092 Keep track of whether a tag has been seen.
3093 * src/reader.c (union_seen, tag_seen): New vars.
3094 (typed): remove.
3095 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3096 * src/scan-code.l (untyped_var_seen): New variable.
3097 (handle_action_dollar): Adjust to above changes.
3098 (handle_action_dollar, handle_action_at):
3099 Improve overflow checking for outlandish numbers.
3100 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3101 avoid new diagnostics generated by above changes.
3102 * tests/regression.at (YYSTYPE typedef): Add test to check
3103 for type tags without %union.
3104
3105 * src/symlist.c (symbol_list_length): Return int, not unsigned
3106 int, since callers expect int. This may need to get revisited
3107 once we have proper integer overflow checking.
3108
3109 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3110 object is now static.
3111
3112 * src/getargs.c (flags_argmatch): Return void, not int,
3113 to pacify ./configure --enable-gcc-warnings.
3114
3115 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3116 since last_string is already defined to FLEX_PREFIX (last_string).
3117
3118 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
3119
3120 Implement --warnings/-W.
3121 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3122 replaced by...
3123 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3124 Adjust callers.
3125 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3126 (warnings_args, warnings_types): New.
3127 (getargs, short_options, long_options): Accept -W/--warnings.
3128 Sort the options by alphabetical order, upper case letter right
3129 before its lower case.
3130
3131 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3132
3133 Change %merge result type clash warnings to errors. Discussed at
3134 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3135 * src/reader.c (record_merge_function_type): Use complain_at.
3136 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3137 declared later): Update test case results.
3138
3139 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
3140
3141 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3142 to be in alphabetical order.
3143 (trace_args): Spelling fixes.
3144
3145 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3146
3147 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3148 so they don't collide with user-defined macros.
3149 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3150 this was never guaranteed, and now that we're using gnulib stdint,
3151 which defines int_fast16_t to long int, the problem is exposed.
3152
3153 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3154
3155 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3156 need the full POSIX semantics (and weren't implementing them
3157 anyway).
3158
3159 Adjust to Autoconf 2.60 and today's gnulib.
3160 * bootstrap (gnulib_modules): Add stdint.
3161 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3162 no longer copies it.
3163 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3164 since stdint needs the former and wcwidth (which is now required
3165 by mbswidth) needs the latter.
3166 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3167 work around a compatibility glitch between gettext 0.14.6 and
3168 Autoconf 2.60.
3169 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3170 Do not check for uintptr_t, since new stdint module does the right
3171 thing.
3172 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3173 Add stdint.h, stdint_.h, wcwidth.h.
3174 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3175 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3176 stdint.m4, wchar_t.m4, wcwidth.m4.
3177 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3178 usual order for ../lib/*.h files.
3179 (file_name_split): Use last_component, not base_name, to adjust
3180 to gnulib changes.
3181 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3182 for ../lib/*.h files.
3183 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3184 Define unconditionally, since we now assume the stdint module.
3185 * src/scan-skel.l: Include <dirname.h>.
3186 (BASE_QPUTS): Use last_component, not base_name.
3187 * src/system.h: Include <unlocked-io.h> in the usual order
3188 for ../lib/*.h files. Include <stdint.h> unconditionally,
3189 since we now use the stdint module.
3190 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3191 HAVE_UINTPTR_T, since we now use the stdint module.
3192 (base_name): Remove decl, since files now include <dirname.h>
3193 to get the decl.
3194
3195 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
3196
3197 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3198 New, default to 1.
3199 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3200 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3201 default.
3202 * tests/calc.at: Adjust.
3203
3204 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
3205
3206 * data/c.m4 (b4_basename): New.
3207 (b4_syncline): Also output the location of its invocation (from
3208 the skeleton).
3209 (b4_user_action, b4_define_user_action, b4_user_actions)
3210 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3211 (b4_user_stype): New.
3212 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3213
3214 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3215
3216 In the grammar file, the first column is 1 not 0 on the first line as
3217 on every other line.
3218 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3219 * tests/input.at (Torturing the Scanner): Update output.
3220
3221 * src/scan-gram.l (scanner_cursor): Declare it static.
3222
3223 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3224
3225 In warnings, say "previous declaration" rather than "first
3226 declaration".
3227 * src/symtab.c (redeclaration): Do that here.
3228 * src/reader.c (record_merge_function_type): In the case of a result
3229 type clash, report the previous declaration rather than the very first
3230 one in the grammar file.
3231 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3232 declared later): Add a third declaration to check this behavior.
3233 * tests/input.at (Incompatible Aliases): Update output.
3234
3235 2006-06-27 Akim Demaille <akim@epita.fr>
3236
3237 * doc/Doxyfile.in: New.
3238 * doc/Makefile.am: Use it.
3239 * src/lalr.h, src/symtab.h: Initial doxygenation.
3240
3241 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3242
3243 Don't miss %merge result type warnings just because the LHS types are
3244 declared after the %merge. This continues the effort of the previous
3245 patch.
3246 * src/reader.c (get_merge_function): Don't set the merger type yet.
3247 (record_merge_function_type): New function for setting the merger type
3248 and checking for clashes.
3249 (grammar_current_rule_merge_set): Set the location of the %merge for
3250 the current rule.
3251 (packgram): Invoke record_merge_function_type for each rule now that
3252 all symbol type declarations have been parsed.
3253 * src/reader.h (merger_list.type_declaration_location): New member
3254 storing the location of the first %merge from which the type for this
3255 merging function was derived.
3256 * src/symlist.h (symbol_list.merger_declaration_location): New member
3257 storing the location of a rule's %merge, if any.
3258 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3259 declared later): New test to catch the error fixed by the above patch.
3260
3261 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3262
3263 Get action warnings (grammar_rule_check) right even when symbol
3264 declarations appear after the rules. Discussed at
3265 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3266 and
3267 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3268 Don't mistake the type of $$ in a midrule to be that of its parent
3269 rule's $$.
3270 * src/reader.c (grammar_current_rule_end): Don't invoke
3271 grammar_rule_check yet since not all symbol declarations may have been
3272 parsed yet.
3273 (grammar_midrule_action): Likewise.
3274 Don't record whether the midrule's $$ has been used yet since actions
3275 haven't been translated yet.
3276 Record the midrule's parent rule and its RHS index within the parent
3277 rule.
3278 (grammar_current_rule_action_append): Don't translate the action yet
3279 since not all symbol declarations may have been parsed yet and, thus,
3280 warnings about types for $$, $n, @$, and @n can't be reported yet.
3281 (packgram): Translate the action and invoke grammar_rule_check now that
3282 all symbol declarations have been parsed.
3283 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3284 after parsing the entire grammar file, the symbol list here in the case
3285 of a midrule is actually the midrule's empty RHS, so reference its
3286 parent rule's RHS where necessary.
3287 On the other hand, now that you can already know it's a midrule, you
3288 aren't forced to think $$ has the same type as its parent rule's $$.
3289 (handle_action_at): In the case of a midrule, reference the parent rule
3290 where necessary.
3291 * src/symlist.c (symbol_list_new): Initialize new midrule-related
3292 members.
3293 (symbol_list_length): Now that this is invoked after all rules have
3294 been parsed, a NULL symbol (rather than a NULL symbol list node)
3295 terminates a rule. symbol_list_print already does this correctly.
3296 * src/symlist.h (symbol_list.midrule_parent_rule,
3297 symbol_list.midrule_parent_rhs_index): New members so that midrules can
3298 remember their relationships with their parents.
3299 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
3300 fixed by the above patch.
3301 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
3302 implementing...
3303 (Unused values): ... this old test case and...
3304 (Unused values before symbol declarations): ... this new test case.
3305 This one is the same as `Unused values' except that all symbol
3306 declarations appear after the rules in order to catch the rest of the
3307 errors fixed by the above patch.
3308
3309 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3310
3311 More cleanup.
3312 * src/reader.c (current_rule): Declare it static since it's no longer
3313 used outside this file.
3314 (grammar_current_rule_action_append): Remove redundant arguments from
3315 translate_rule_action invocation.
3316 * src/reader.h (current_rule): Remove this unused extern.
3317 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
3318 * src/scan-code.l (translate_rule_action): Likewise.
3319
3320 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
3321
3322 Clean up yesterday's patch.
3323 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
3324 to...
3325 * src/reader.c (grammar_current_rule_action_append): ... here for
3326 consistency with grammar_current_rule_symbol_append.
3327 * tests/regression.at (Braced code in declaration in rules section):
3328 Make yyerror and yylex static as usual.
3329
3330 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
3331
3332 Fix bug that mistakes braced code in a declaration in the rules section
3333 to be a rule action. Mentioned at
3334 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
3335 * src/scan-gram.l: Move midrule action detection from the start of the
3336 scanning of any braced code to...
3337 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
3338 action. For readability, use $2 and @2 rather than the equivalent
3339 global variables.
3340 * tests/regression.at (Braced code in declaration in rules section):
3341 New test to catch the error fixed by the above patch.
3342
3343 Work on code readability some.
3344 * src/scan-code.l (current_rule): Get rid of this misleading and
3345 redundant declaration: it's actually extern'ed in reader.h.
3346 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
3347 translate_action): Add a rule argument and use it instead of the global
3348 current_rule.
3349 (translate_rule_action): This already receives current_rule through an
3350 argument, so pass it on to translate_action instead of assigning
3351 current_rule to current_rule.
3352 (translate_symbol_action, translate_code): Pass rule = NULL to
3353 translate_action.
3354
3355 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
3356
3357 Rename %before-definitions to %start-header and %after-definitions to
3358 %end-header. Don't use these declarations to separate pre-prologue
3359 blocks from post-prologue blocks. Add new order-independent
3360 declarations %before-header and %after-header as alternatives to the
3361 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
3362 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
3363 * NEWS (2.3+): Update for these changes.
3364 * data/glr.c (b4_before_definitions): Update to...
3365 (b4_start_header): ... this.
3366 (b4_after_definitions): Update to...
3367 (b4_end_header): ... this.
3368 * data/glr.cc: Likewise.
3369 * data/lalr1.cc: Likewise.
3370 * data/yacc.c: Likewise.
3371 * doc/bison.texinfo (The prologue): Update names, and replace remaining
3372 prologue blocks with %*-header declarations.
3373 (Calc++ Parser): Likewise.
3374 (Decl Summary): Update names.
3375 (Table of Symbols): Update description.
3376 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
3377 (PERCENT_END_HEADER): ... this.
3378 (PERCENT_BEFORE_DEFINITIONS): Update to...
3379 (PERCENT_START_HEADER): ... this.
3380 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3381 (declaration): Update token names and m4 macro names.
3382 When parsing %end-header and %start-header, invoke translate_code
3383 before muscle_code_grow, and no longer set global booleans to remember
3384 whether these declarations have been seen.
3385 Parse new %after-header and %before-header.
3386 * src/reader.c (before_definitions, after_definitions): Remove.
3387 (prologue_augment): Accept a new bool argument to specify whether to
3388 augment the pre-prologue or post-prologue.
3389 * src/reader.h (before_definitions, after_definitions): Remove these
3390 extern's.
3391 (prologue_augment): Add new bool argument.
3392 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
3393 (PERCENT_END_HEADER): ... this.
3394 (PERCENT_BEFORE_DEFINITIONS): Update to...
3395 (PERCENT_START_HEADER): ... this.
3396 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3397 * tests/actions.at (Printers and Destructors): Update names.
3398
3399 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
3400
3401 Add comparison operators for C++ location classes. Discussed at
3402 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
3403 * data/c++.m4 (b4_define_location_comparison): New boolean %define
3404 declaration indicating whether filename_type has an operator==. If
3405 filename_type is `std::string', it defaults to `1', `0' otherwise.
3406 * data/location.cc: Iff b4_define_location_comparison is `1', add
3407 operator== and operator!= for class position and for class location.
3408
3409 Some minor fixes.
3410 * src/scan-action.l: Remove unused file.
3411 * src/symtab.c (symbol_printer_set): Use printer_location not
3412 destructor_location.
3413 * src/symtab.h (struct symbol): Replace incorrect source comment for
3414 printer members.
3415 * tests/input.at (Incompatible Aliases): Update output with correct
3416 printer location.
3417
3418 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
3419
3420 Don't put the pre-prologue in the header file. For the yacc.c code
3421 file and the glr.c header and code files, move the pre-prologue before
3422 the token definitions. Add new %before-definitions and
3423 %after-definitions to declare code that will go in both the header file
3424 and code file. Discussed at
3425 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
3426 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
3427 and
3428 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
3429 * NEWS (2.3+): Describe these changes.
3430 * data/glr.c (b4_pre_prologue): Move from within to before...
3431 (b4_shared_declarations): ... this.
3432 Add new b4_before_definitions before b4_token_enums.
3433 Add new b4_after_definitions at the end.
3434 * data/glr.cc (b4_pre_prologue): Replace with...
3435 (b4_before_definitions): ... this in the header file.
3436 (b4_after_definitions): New near the end of the header file.
3437 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
3438 code file right before including the header file.
3439 (b4_before_definitions): New in the previous position of
3440 b4_pre_prologue in the header file.
3441 (b4_after_definitions): New near the end of the header file.
3442 * data/yacc.c: Clean up some m4 quoting especially in the header file.
3443 (b4_token_enums_defines): In the code file, move to right before
3444 YYSTYPE for consistency with the header file.
3445 (b4_before_definitions): New right before b4_token_enums_defines in
3446 both the header and code file.
3447 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
3448 header and code file.
3449 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
3450 of prologues for %union dependencies.
3451 (Decl Summary): In %defines description, mention the effect of
3452 %before-definitions and %after-definitions on the header file.
3453 (Calc++ Parser): Forward declare driver in a %before-definitions rather
3454 than in the pre-prologue so that make check succeeds.
3455 (Table of Symbols): Add entries for %before-definitions and
3456 %after-definitions.
3457 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
3458 %before-definitions.
3459 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
3460 (declaration): Parse those declarations and append to
3461 b4_before_definitions and b4_after_definitions, respectively.
3462 * src/reader.c (before_definitions, after_definitions): New bools to
3463 track whether those declarations have been seen.
3464 (prologue_augment): Add to the post-prologue if %union,
3465 %before-definitions, or %after-definitions has been seen.
3466 * src/reader.h (before_definitions, after_definitions): New extern's.
3467 * src/scan-gram.l: Scan the new declarations.
3468 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
3469 prologue block in a %before-definitions or a %after-definitions based
3470 on whether the %union is declared.
3471 * tests/regression.at (Early token definitions with --yacc, Early token
3472 definitions without --yacc): Move tests for token definitions into the
3473 post-prologue since token names are no longer defined in the
3474 pre-prologue.
3475
3476 2006-06-20 Akim Demaille <akim@epita.fr>
3477
3478 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
3479 (symbol_get): Use it.
3480 * src/parse-gram.y: Use it.
3481
3482 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
3483
3484 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
3485 build succeeds when configured with --enable-gcc-warnings.
3486
3487 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
3488
3489 * src/parse-gram.y (char_name): New function.
3490 (CHAR, STRING, string_content): For %printer, properly escape.
3491 (ID): Prefer fputs to fprintf.
3492 (id): Reindent to be consistent with other rules.
3493 Properly quote char.
3494
3495 The Translation Project changed its way of publishing translations
3496 to maintainers. I haven't received any responses to my request
3497 for supporting the old way, or for documenting the new way. I
3498 have modified 'bootstrap' to use screen scraping
3499 (in this case, HTML scraping). This is unreliable and inelegant,
3500 but I don't see any better way. Yuck.
3501 * bootstrap (TP_URL, WGET_COMMAND): New vars.
3502 (get_translations): New function, which uses HTML scraping to
3503 deduce locations of latest translations.
3504 Use this function to grab both bison and bison-runtime .po files.
3505 Don't bother priming the pump for the runtime-po domain any more,
3506 as it's now translated better than bison is.
3507
3508 2006-06-19 Akim Demaille <akim@epita.fr>
3509
3510 * src/scan-gram.l: No longer "parse" things after `%union' until
3511 `{'. Rather, return a single "%union" token.
3512 No longer make symbols: return strings, and leave the conversion
3513 to symbols to the parser.
3514 (SC_PRE_CODE, token_type): Remove.
3515 * src/parse-gram.y (%union): New field `character'.
3516 Sort tokens.
3517 (CHAR): New token.
3518 (ID, ID_COLON): Now that the scanner no longer makes them
3519 identifiers, adjust all uses to invoke symbol_get.
3520 (id_colon): New, wraps the conversion from string to symbol.
3521 (%union): Accept a possible union_name.
3522 (symbol): Now can be a char.
3523 * data/c.m4 (b4_union_name): Leave a default value.
3524 * data/glr.c, data/yacc.c: Use it.
3525
3526 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
3527
3528 For associating token numbers with token names for "yacc.c", don't use
3529 #define statements unless `--yacc' is specified; always use enum
3530 yytokentype. Most important discussions start at:
3531 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
3532 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
3533 and
3534 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
3535 * NEWS (2.3+): Mention.
3536 * data/c.m4 (b4_yacc_if): New.
3537 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
3538 token #define's.
3539 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
3540 on token name definitions.
3541 * src/getargs.c (usage): Capitalize `Yacc' in English.
3542 * src/output.c (prepare): Define b4_yacc_flag.
3543 * tests/regression.at (Early token definitions): Test that tokens names
3544 are defined before the pre-prologue not just before the post-prologue.
3545 Remove this test case and copy to...
3546 (Early token definitions with --yacc): ... this to test #define's.
3547 (Early token definitions without --yacc): ... and this to test enums.
3548
3549 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
3550
3551 * NEWS: Reword the post-2.3 change to not be so optimistic about
3552 removing the old "look-ahead" spelling.
3553 Update previous look-ahead/lookahead change reports.
3554 * REFERENCES: look-ahead -> lookahead (since that's
3555 what he actually wrote).
3556 * doc/refcard.tex: look ahead -> lookahead,
3557 look-ahead -> lookahead
3558
3559 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
3560
3561 For consistency, use `lookahead' instead of `look-ahead' or
3562 `look_ahead'. Discussed starting at
3563 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
3564 and then at
3565 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
3566 * NEWS: For the next release, note the change to `--report'.
3567 * TODO, doc/bison.1: Update English.
3568 * doc/bison.texinfo: Update English.
3569 (Understanding Your Parser, Bison Options): Document as
3570 `--report=lookahead' rather than `--report=look-ahead'.
3571 * src/conflicts.c: Update English in comments.
3572 (lookahead_set): Rename from look_ahead_set.
3573 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
3574 (resolve_sr_conflict): Rename local look_ahead_tokens to
3575 lookahead_tokens, and update other uses.
3576 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
3577 count_rr_conflicts, conflicts_free): Update uses.
3578 * src/getargs.c (report_args): Move "lookahead" before alternate
3579 spellings.
3580 (report_types): Update uses.
3581 (usage): For `--report' usage description, state `lookahead' spelling
3582 rather than `look-ahead'.
3583 * src/getargs.h (report.report_lookahead_tokens): Rename from
3584 report_look_ahead_tokens.
3585 * src/lalr.c: Update English in comments.
3586 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
3587 (state_lookahead_tokens_count): Rename from
3588 state_look_ahead_tokens_count.
3589 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3590 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
3591 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3592 Update other uses.
3593 Update English in output.
3594 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
3595 * src/print.c: Update English in comments.
3596 (lookahead_set): Rename from look_ahead_set.
3597 (print_reduction): Rename argument lookahead_token from
3598 look_ahead_token.
3599 (print_core, state_default_rule, print_reductions, print_results):
3600 Update uses.
3601 * src/print_graph.c: Update English in comments.
3602 (print_core): Update uses.
3603 * src/state.c: Update English in comments.
3604 (reductions_new): Update uses.
3605 (state_rule_lookahead_tokens_print): Rename from
3606 state_rule_look_ahead_tokens_print, and update other uses.
3607 * src/state.h: Update English in comments.
3608 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
3609 (state_rule_lookahead_tokens_print): Rename from
3610 state_rule_look_ahead_tokens_print.
3611 * src/tables.c: Update English in comments.
3612 (conflict_row, action_row): Update uses.
3613 * tests/glr-regression.at
3614 (Incorrect lookahead during deterministic GLR,
3615 Incorrect lookahead during nondeterministic GLR): Rename
3616 print_look_ahead to print_lookahead.
3617 * tests/torture.at: Update English in comments.
3618 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
3619 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
3620 (Many lookahead tokens): Update uses.
3621 * data/glr.c: Update English in comments.
3622 * lalr1.cc: Likewise.
3623 * yacc.c: Likewise.
3624 * src/conflicts.h: Likewise.
3625 * src/lalr.h: Likewise.
3626 * src/main.c: Likewise.
3627 * src/output.c: Likewise.
3628 * src/parse-gram.c: Likewise.
3629 * src/tables.h: Likewise.
3630 * tests/calc.at: Likewise.
3631
3632 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
3633
3634 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
3635
3636 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
3637
3638 * TODO: Add request from Nelson H. F. Beebe to be able to install
3639 Bison without installing the yacc script.
3640
3641 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3642
3643 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
3644 and yytext if they're already #define'd.
3645 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
3646 * src/scan-code-c.c: ... here.
3647 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
3648 <config.h>.
3649
3650 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3651
3652 Get Bison to build again when configured with --enable-gcc-warnings.
3653 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
3654 missing #include's.
3655 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
3656 loc argument as it shadows a global.
3657 * src/scan-gram.l: Remove stray comma that prevents boundary_set
3658 invocation.
3659
3660 * src/.cvsignore: Add scan-code.c.
3661
3662 2006-06-07 Akim Demaille <akim@epita.fr>
3663
3664 * src/scan-gram.l: Move the "add a trailing ; to actions" code
3665 to...
3666 * src/scan-code.l: here.
3667 * tests/input.at (Torturing the Scanner): Fix another location
3668 error.
3669
3670 2006-06-07 Akim Demaille <akim@epita.fr>
3671
3672 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
3673
3674 2006-06-06 Akim Demaille <akim@epita.fr>
3675
3676 Extract the parsing of user actions from the grammar scanner.
3677 As a consequence, the relation between the grammar scanner and
3678 parser is much simpler. We can also split "composite tokens" back
3679 into simple tokens.
3680 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
3681 * src/scan-gram.l (add_column_width, adjust_location): Move to and
3682 rename as...
3683 * src/location.h, src/location.c (add_column_width)
3684 (location_compute): these.
3685 Fix the column count: the initial column is 0.
3686 (location_print): Be robust to ending column being 0.
3687 * src/location.h (boundary_set): New.
3688 * src/main.c: Adjust to scanner_free being renamed as
3689 gram_scanner_free.
3690 * src/output.c: Include scan-code.h.
3691 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
3692 Use boundary_set.
3693 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
3694 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
3695 which is now, again, a separate token.
3696 Adjust all dependencies.
3697 Whereever actions with $ and @ are used, use translate_code.
3698 (action): Remove this nonterminal which is now useless.
3699 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
3700 (grammar_current_rule_action_append): Use translate_code.
3701 (packgram): Bound check ruleno, itemno, and rule_length.
3702 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
3703 (last_string, last_braced_code_loc, max_left_semantic_context)
3704 (scanner_initialize, scanner_free, scanner_last_string_free)
3705 (gram_out, gram_lineno, YY_DECL_): Move to...
3706 * src/scan-gram.h: this new file.
3707 (YY_DECL): Rename as...
3708 (GRAM_DECL): this.
3709 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
3710 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3711 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3712 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3713 Move these declarations, and...
3714 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
3715 these to...
3716 * src/flex-scanner.h: this new file.
3717 * src/scan-gram.l (rule_length, rule_length_overflow)
3718 (increment_rule_length): Remove.
3719 (last_braced_code_loc): Rename as...
3720 (gram_last_braced_code_loc): this.
3721 Adjust to the changes of the parser.
3722 Move all the handling of $ and @ into...
3723 * src/scan-code.l: here.
3724 * src/scan-gram.l (handle_dollar, handle_at): Remove.
3725 (handle_action_dollar, handle_action_at): Move to...
3726 * src/scan-code.l: here.
3727 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
3728 scan-code.h, scan-code-c.c, scan-gram.h.
3729 (EXTRA_bison_SOURCES): Add scan-code.l.
3730 (BUILT_SOURCES): Add scan-code.c.
3731 (yacc): Be robust to white spaces.
3732
3733 * tests/conflicts.at, tests/input.at, tests/reduce.at,
3734 * tests/regression.at: Adjust the column numbers.
3735 * tests/regression.at: Adjust the error message.
3736
3737 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3738
3739 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3740 Use Akim's wording from
3741 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
3742
3743 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3744
3745 Between Bison releases, manually append `+' to the previous Bison
3746 release number, and use that as a signal to automatically print the
3747 ChangeLog's CVS Id keyword from --version. Discussed starting at
3748 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
3749 * ChangeLog: Add Id header.
3750 * configure.ac (AC_INIT): Append `+' to `2.3'.
3751 * src/.cvsignore: Add revision.c.
3752 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
3753 (BUILT_SOURCES): Add revision.c.
3754 (revision.c): New target rule. This file defines a new global variable
3755 named revision. It initializes it with either the Id from ChangeLog
3756 or, if VERSION doesn't contain `+', with the empty string.
3757 * src/getargs.c (version): Print the value of revision.
3758 * src/revision.h: Extern revision.
3759
3760 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
3761
3762 * NEWS: Version 2.3.
3763 * configure.ac (AC_INIT): Likewise.
3764
3765 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
3766
3767 * data/glr.c (YYRECOVERING): Define to be a function-like macro
3768 with no arguments, not as an object-like macro. This is for
3769 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
3770 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
3771 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
3772 Document this.
3773
3774 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
3775
3776 * src/getargs.c (usage): Back out yesterday's modification of the
3777 --help output so that we don't have to wait for translation before
3778 releasing 2.3.
3779
3780 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
3781
3782 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
3783 Problem reported by Akim Demaille.
3784
3785 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3786
3787 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3788
3789 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
3790
3791 * data/yacc.c (yy_reduce_print): Omit trailing white space in
3792 generated source code. Problem reported by Frans Englich in
3793 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
3794
3795 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
3796
3797 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
3798 shell, not within 'make', so that 'make' by an ordinary builder
3799 (using GNU make) does not worry about configuring gzip. This also
3800 works around a bug reported independently by Keith Thompson and by
3801 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
3802 stderr rather than stdout, messing up the build logs.
3803
3804 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3805
3806 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
3807 to make sure that YYID will never be unused. This fixes a 'make
3808 maintainer-check' failure caused by the recent changes to the 'Trivial
3809 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
3810 not used.
3811 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
3812
3813 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3814
3815 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
3816 state before an empty RHS is always resolved here. Only the location
3817 of that state is guaranteed to be resolved, and that's enough. This
3818 fixes the remaining bug reported by Derek M. Jones in
3819 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3820 * tests/glr-regression.at (Uninitialized location when reporting
3821 ambiguity): Test the above case.
3822 Also, the embedded comments in this test case claim it checks the case
3823 of an empty RHS that has inherited the initial location. However, the
3824 corresponding LHS was already resolved, so yyresolveLocations didn't
3825 actually have reason to modify it. Fix this by forcing
3826 nondeterministic operation at the beginning of the parse.
3827
3828 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
3829
3830 * data/c.m4 (b4_yy_symbol_print_generate):
3831 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
3832 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
3833 of the bugs reported today by Derek M Jones in
3834 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3835 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
3836 defined to be a type name without parens or brackets.
3837 (Location Type): Similarly for YYLTYPE.
3838 * tests/regression.at (Trivial grammars): Put in a test for this
3839 bug that will be caught by 'make maintainer-check' (though not,
3840 alas, by 'make check' unless your compiler is picky).
3841
3842 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
3843
3844 * NEWS: Version 2.2.
3845 * configure.ac (AC_INIT): Likewise.
3846
3847 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
3848
3849 * data/glr.c (yyreportTree): Make room in yystates for the state
3850 preceding the RHS. This fixes the segmentation fault reported by Derek
3851 M. Jones in
3852 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
3853 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
3854 to the user. Reported for yyreportTree by Derek M. Jones later in the
3855 same thread.
3856 * THANKS: Add Derek M. Jones.
3857 Update my email address.
3858 Fix typo in Steve Murphy's name.
3859
3860 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
3861
3862 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
3863 checking against YYLAST that caused the parser to miss a potential
3864 alternative in its diagnostic.
3865 Problem reported by Maria Jose Moron Fernandez in
3866 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
3867 * data/lalr1.cc (yysyntax_error_): Likewise.
3868 * data/yacc.c (yysyntax_error): Likewise.
3869 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
3870 tokens, in case we run into an older C compiler.
3871 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
3872 Use them to check for the off-by-one error fixed above.
3873
3874 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
3875 YYSIZE_T, not size_t.
3876 * tests/regression.at (Trivial grammars): New test, to catch
3877 the error fixed by the above patch.
3878
3879 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3880
3881 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
3882 scheme.
3883 Reported by Steve Murphy.
3884
3885 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3886
3887 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
3888 * data/glr.cc: b4_location_flag is now b4_locations_flag.
3889
3890 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3891
3892 Implement --trace=m4.
3893 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
3894 * src/output.c (output_skeleton): When set, pass -dV to m4.
3895
3896 Factor the handling of flags in m4.
3897 * src/output.c (prepare): Rename the muscle names debug, defines,
3898 error_verbose to debug_flag, defines_flag, error_verbose_flag.
3899 * data/c.m4: Adjust.
3900 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
3901 Use b4_define_flag_if to define other b4_FLAG_if macros.
3902 (b4_location_if): As a consequence, rename as...
3903 (b4_locations_if): this, for consistency.
3904 Adjust all the skeletons.
3905
3906 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3907
3908 * etc/bench.pm: Shorten bench names.
3909
3910 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3911
3912 * src/output.h, src/output.c (error_verbose): Move to...
3913 * src/getargs.h, src/getargs.c: here.
3914 Sort the flags.
3915 Adjust dependencies.
3916
3917 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
3918
3919 * data/c.m4 (b4_copyright): Put the special exception for Bison
3920 skeletons here, so we don't have to put it in each skeleton. All
3921 uses changed. Suggested by Akim Demaille. Also, wrap the
3922 copyright notice, in case it is longer than 80 columns. Replace
3923 comma by newline after title.
3924
3925 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
3926
3927 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
3928 incompatibility, not a bug. Mention that it wasn't fixed as of
3929 flex 2.5.33.
3930
3931 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
3932
3933 * examples/extexi: Enforce the precedence of concatenation over
3934 >>.
3935 Reported by Tommy Nordgren.
3936
3937 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
3938
3939 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
3940 with the member "token".
3941 Reported by Martin Nylin.
3942
3943 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
3944
3945 * data/glr.c: Switch to Bison 2.2 special-exception language in
3946 the copyright notice. Use more-regular format for titles and
3947 copyright notices.
3948 * data/glr.cc: Likewise.
3949 * data/location.cc: Likewise.
3950 * data/yacc.cc: Likewise.
3951 * doc/bison.texinfo (Conditions): Document this.
3952 * NEWS: likewise. Upgrade version to 2.2.
3953
3954 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
3955
3956 * data/glr.cc: Remove dead code.
3957
3958 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
3959
3960 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
3961 that variable and the line breaks the bootstrap. Problem reported
3962 by Juan M. Guerrero.
3963
3964 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
3965
3966 * doc/bison.texinfo (Multiple start-symbols): New.
3967
3968 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
3969
3970 * etc/README, etc/bench.pl: New.
3971
3972 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
3973
3974 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
3975 rule.
3976 Reported by Mickael Labau.
3977 * tests/input.at (Torturing the Scanner): Test it.
3978
3979 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
3980
3981 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
3982 Problem reported by Bob Rossi.
3983
3984 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
3985
3986 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
3987 and didn't really work.
3988 For the index, use @ifnotinfo, not @iftex.
3989 Minor cleanups of spacing and terminology.
3990
3991 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
3992
3993 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
3994 of AT_NAME_PREFIX when %name-prefix is not used.
3995
3996 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
3997
3998 Apply --prefix to C++ skeletons too: they change the namespace.
3999 The test suite already exercize these cases.
4000 * data/c++.m4 (b4_namespace): New.
4001 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4002 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4003 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4004 * doc/bison.texinfo: Document it.
4005 (Option Cross Key): Use @multitable in all formats. It looks
4006 nicer, even in TeX outputs.
4007 (Rules): Use the same code whatever the output type is.
4008 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4009 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4010 * tests/calc.at: Use it, instead of hard coding `yy'.
4011
4012 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4013
4014 * TODO: Remove dead items.
4015
4016 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4017
4018 * doc/FAQ: Remove, merged into...
4019 * doc/bison.texinfo (FAQ): this.
4020 * doc/Makefile.am (EXTRA_DIST): Adjust.
4021
4022 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4023
4024 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4025 even if empty.
4026 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4027 * doc/bison.texinfo (Calc++ Scanner): Use it.
4028
4029 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4030
4031 Fix two nits reported by twlevo, plus one more that I discovered.
4032
4033 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4034 this is the usual Bison style.
4035 * src/location.h (location_print): Likewise.
4036
4037 * src/reader.h (token_name): Likewise.
4038
4039 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4040
4041 Fix some nits reported by twlevo.
4042 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4043 and "POSIX". Use more-modern syntax for URLs. Mention C++
4044 and ask for Java. Don't hardwire OS version numbers. Add
4045 copyright notice.
4046 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4047 * src/conflicts.c (solved_conflicts_obstack): Now static.
4048
4049 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4050
4051 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4052 page. Say "you can use it" not "you may use it" as on the web page;
4053 we're describing capabilities not granting permission.
4054
4055 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4056
4057 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4058 shadowing warnings. Use usual patter for iterating through RHS.
4059 * tests/glr-regression.at
4060 (Uninitialized location when reporting ambiguity):
4061 Modify yylex so that it uses its argument, rather than trying
4062 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4063 const char -> char const.
4064
4065 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4066 Don't use tabs inside commands; it messes up 'ps'.
4067 Problem reported by twlevo.
4068
4069 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4070
4071 * tests/glr-regression.at (Uninitialized location when reporting
4072 ambiguity): New test case.
4073 * data/glr.c (yyresolveLocations): New function, which uses
4074 YYLLOC_DEFAULT.
4075 (yyresolveValue): Invoke yyresolveLocations before reporting an
4076 ambiguity.
4077 * doc/bison.texinfo (Default Action for Locations): Note
4078 YYLLOC_DEFAULT's usage for ambiguity locations.
4079 (GLR Semantic Actions): Cross-reference those notes.
4080
4081 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4082
4083 * tests/glr-regression.at (Leaked semantic values when reporting
4084 ambiguity): Remove unnecessary union and type declarations.
4085 (Leaked lookahead after nondeterministic parse syntax error): New test
4086 case.
4087 * data/glr.c (yyparse): Check for zero stacks remaining before
4088 attempting to shift the lookahead so that you don't lose it.
4089
4090 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4091
4092 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4093 * tests/glr-regression.at (Leaked semantic values when reporting
4094 ambiguity): New test case.
4095 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4096 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4097 now unnecessary yystackp parameter.
4098 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4099 destructors can be called.
4100
4101 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4102 in existing testcases.
4103
4104 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4105
4106 Don't leak semantic values for parent RHS when a user action cuts the
4107 parser, and clean up related code a bit.
4108 * tests/glr-regression.at (Leaked merged semantic value if user action
4109 cuts parse): Rename to...
4110 (Leaked semantic values if user action cuts parse): ... this. Add check
4111 for leaked parent RHS values.
4112 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4113 between an unresolved state (non-empty chain of semantic options) and
4114 an incomplete one (signaled by an empty chain).
4115 (yyresolveStates): Document the interface. Move all manipulation of a
4116 successfully or unsuccessfully resolved yyGLRState to...
4117 (yyresolveValue): ... here so that yyresolveValue always leaves a
4118 yyGLRState with consistent data and thus is easier to understand.
4119 Remove the yyvalp and yylocp parameters since they are always just
4120 taken from the yys parameter. When reporting a discarded merged value
4121 in debugging output, note that it is incompletely merged. Document the
4122 interface.
4123 (yyresolveAction): If resolving any of the RHS states fails, destroy
4124 them all rather than leaking them. Thus, as long as user actions are
4125 written to clean up the RHS correctly, yyresolveAction always cleans up
4126 the RHS of a semantic option. Document the interface.
4127
4128 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4129
4130 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4131 led to a segmentation fault in GNU Pascal. Problem reported
4132 by Waldek Hebisch.
4133
4134 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4135
4136 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4137 mid-rule action inside a nonterminal symbol in order to declare a
4138 destructor for its semantic value.
4139
4140 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4141
4142 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4143 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4144 __cplusplus && ! defined _STDLIB_H && !
4145 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4146 defined free))]: Include <stdlib.h> rather than rolling our own
4147 declarations of malloc and free, to avoid problems with
4148 incompatible declarations (using 'throw') C++'s stdlib.h. This
4149 should fix Debian bug 340012
4150 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4151 reported by Guillaume Melquiond.
4152
4153 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4154
4155 * NEWS: Clarify symbols versus types in unused-value warnings.
4156
4157 * configure.ac (AC_INIT): Bump version number.
4158
4159 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4160
4161 * NEWS: Version 2.1a.
4162 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4163 since C99 requires this.
4164
4165 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4166
4167 * m4/c-working.m4: New file.
4168 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4169
4170 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4171
4172 * Makefile.maint: Merge from coreutils.
4173
4174 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4175
4176 More portability fixes for problems summarized by Nelson H. F. Beebe.
4177
4178 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4179 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4180 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4181 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4182 messes up because C++ code is compiled in 32-bit mode but linked
4183 in 64-bit mode.
4184
4185 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4186
4187 More portability fixes for problems summarized by Nelson H. F. Beebe.
4188
4189 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4190 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4191
4192 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4193 nodist_PROGRAMS, since we don't need to actually compile the
4194 example if we're just doing a plain 'make'. This avoids bothering
4195 the installer unnecessarily about problems due to weird C++
4196 compilers.
4197
4198 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4199
4200 More portability fixes for problems summarized by Nelson H. F. Beebe.
4201
4202 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4203 than #include "...", and compile with -I'.'. The old method was
4204 not portable, according to Posix and the C standard, and it does
4205 not work with Sun C 5.7, where previous #line directives affect
4206 the working directory used in later #include "..." directives.
4207
4208 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4209
4210 Various DJGGP specific issues in /djgpp
4211
4212 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4213
4214 More portability fixes for problems summarized by Nelson H. F. Beebe.
4215
4216 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4217 '#include <map>' works and that you can apply ++ to iterators.
4218
4219 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4220
4221 Work around portability problems summarized by Nelson H. F. Beebe in
4222 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4223
4224 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4225 that '#include <string>' works.
4226
4227 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4228 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4229 "warning: sorry: semantics of inline function static data `const
4230 unsigned char translate_table[262]' are wrong (you'll wind up with
4231 multiple copies)".
4232
4233 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4234 or, xor to not_, and_, or_, and xor_, respectively. This works
4235 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4236 random system header somewhere that includes the equivalent of
4237 <iso646.h>.
4238
4239 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4240 -E" works; it apparently doesn't work with PathScale EKO Compiler
4241 Suite Version 2.0.
4242
4243 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4244
4245 During deterministic GLR operation, user actions should be able to
4246 influence the parse by changing yychar. To make this easier to fix and
4247 to make glr.c easier to evolve in general, don't maintain yytoken in
4248 parallel with yychar; just compute yytoken when needed.
4249 * tests/glr-regression.at (Incorrect lookahead during deterministic
4250 GLR): Check that setting yychar in a user action has the intended
4251 effect.
4252 * data/glr.c (yyGLRStack): Remove yytokenp member.
4253 (yyclearin): Don't set *yytokenp.
4254 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4255 yychar rather than *yytokenp to determine the current lookahead.
4256 Compute yytoken locally when needed.
4257 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4258 point to.
4259
4260 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4261 after `--report' documentation.
4262
4263 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4264
4265 * src/parse-gram.y (grammar_declaration): Location of printer
4266 symbol is @1, not list->location. Bug reported by twlevo.
4267 * tests/input.at (Incompatible Aliases): Adjust to above change.
4268
4269 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4270
4271 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4272 all the test at once. This makes the output easier to read in the
4273 normal case.
4274
4275 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4276 got from <http://bro-ids.org/download.html>. The bug is that
4277 when two actions appeared in succession, the second one was
4278 scanned before the first one was added to the grammar rule
4279 as a midrule action. Bison then output the incorrect warning
4280 "parse.y:905.17-906.36: warning: unused value: $3".
4281 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4282 associated with a value.
4283 (rhs): Don't invoke grammar_current_rule_action_append.
4284 (action): Invoke it here instead.
4285 * src/reader.c (grammar_midrule_action): Now extern.
4286 (grammar_current_rule_action_append): Don't invoke
4287 grammar_midrule_action; that is now the scanner's job.
4288 * src/reader.h (last_string, last_braced_code_loc):
4289 (grammar_midrule_action): New decls.
4290 * src/scan-gram.l (last_string): Now extern, sigh.
4291 (last_braced_code_loc): New extern variable.
4292 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
4293 rule already has an action.
4294 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
4295 * tests/input.at (AT_CHECK_UNUSED_VALUES):
4296 Add some tests to check that the above changes fixed the bug.
4297
4298 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
4299
4300 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
4301 All used changed. Check whether the symbol has a destructor,
4302 not whether it is typed.
4303 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
4304 that the values are still reported as unused. All line numbers
4305 adjusted.
4306
4307 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
4308
4309 Work around a bug in bro 0.8, which underparenthesizes its
4310 definition of YYLLOC_DEFAULT.
4311 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
4312 their arguments.
4313 * data/lalr1.cc: Likewise.
4314 * data/yacc.cc: Likewise.
4315
4316 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
4317
4318 Work around a bug in Pike 7.0, and give the Pike folks a
4319 better way to override the usual int widths.
4320 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
4321 user can override the types.
4322 (short): #undef, to work around a bug in Pike 7.0.
4323 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
4324 (union yyalloc.yyss): Use yytype_int16 rather than short.
4325 All uses changed.
4326 (yysigned_char): Remove.
4327 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
4328 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
4329 * tests/regression.at (Web2c Actions): Adjust to above changes.
4330
4331 * src/reader.c (check_and_convert_grammar): New function.
4332 (reader): Close the input file even if something went wrong during
4333 parsing. Minor file descriptor leak reported by twlevo.
4334
4335 * src/assoc.c (assoc_to_string): Use a default: abort (); case
4336 to pacify gcc -Wswitch-default.
4337 * src/scan-gram.l (adjust_location): Use a default: break; case
4338 to pacify gcc -Wswitch-default.
4339 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
4340 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4341 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4342 Move these decls to scan-skel.l, since they don't need to be
4343 visible elsewhere.
4344 * src/scan-skel.l: Accept the above decls.
4345 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
4346 is used.
4347
4348 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
4349
4350 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
4351 since we don't want to insist on a version number at the start
4352 of the changelog every time.
4353 * Makefile.maint: Sync from coreutils a bit better.
4354 (sc_trailing_blank): Renamed from sc_trailing_space.
4355 All uses changed.
4356 (sc_no_if_have_config_h, sc_require_config_h):
4357 (sc_prohibit_assert_without_use): New rules.
4358 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
4359 (sc_dd_max_sym_length): Fix leading spaces in rule.
4360 (sc_system_h_headers): Prefix with @.
4361 (sc_useless_cpp_parens, m4-check): Output line numbers.
4362 (changelog-check): Allow version only in head.
4363 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
4364 satisfy new Makefile.maint rule.
4365 * data/glr.c: Likewise.
4366 * data/glr.cc: Likewise.
4367 * data/lalr1.cc: Likewise.
4368 * data/yacc.c: Likewise.
4369 * lib/ebitsetv.c: Likewise.
4370 * lib/lbitset.c: Likewise.
4371 * lib/subpipe.c: Likewise.
4372 * lib/timevar.c: Likewise.
4373 * src/system.h: Likewise.
4374 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
4375 * djgpp/Makefile.maint: Add copyright notice.
4376 * djgpp/README.in: Likewise.
4377 * djgpp/config.bat: Likewise.
4378 * djgpp/config.site: Likewise.
4379 * djgpp/config_h.sed: Likewise.
4380 * djgpp/djunpack.bat: Likewise.
4381 * djgpp/config.sed: Fix copyright notice to match standard format.
4382 * djgpp/subpipe.h: Likewise.
4383 * lib/bitsetv-print.c: Likewise.
4384 * lib/bitsetv.c: Likewise.
4385 * lib/subpipe.h: Likewise.
4386 * lib/timevar.c: Likewise.
4387 * lib/timevar.h: Likewise.
4388 * djgpp/subpipe.c: Use standard recipe for config.h.
4389 * lib/abitset.c: Likewise.
4390 * lib/bitset.c: Likewise.
4391 * lib/bitset_stats.c: Likewise.
4392 * lib/bitsetv-print.c: Likewise.
4393 * lib/bitsetv.c: Likewise.
4394 * lib/ebitsetv.c: Likewise.
4395 * lib/get-errno.c: Likewise.
4396 * lib/lbitset.c: Likewise.
4397 * lib/subpipe.c: Likewise.
4398 * lib/timevar.c: Likewise.
4399 * lib/vbitset.c: Likewise.
4400 * tests/local.at: Likewise.
4401 * src/scan-gram.l: Don't include verify.h, since system.h does
4402 that for us.
4403 * .x-sc_require_config_h: New file.
4404 * .x-sc_unmarked_diagnostics: New file.
4405
4406 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
4407
4408 Be a bit more systematic about using 'abort'.
4409 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
4410 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
4411 Put 'default: abort ();' before some other case, to satisfy older
4412 pedantic compilers.
4413 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4414 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
4415 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
4416 * src/conflicts.c (resolve_sr_conflict): Likewise.
4417 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
4418 (get_decision_str, get_orientation_str, get_node_alignment_str):
4419 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
4420 (get_linestyle_str, get_arrowstyle_str): Likewise.
4421 * src/conflicts.c (resolve_sr_conflict):
4422 Use a default case rather than one for the one remaining enum
4423 value, to catch invalid enum values as well.
4424 * src/lalr.c (set_goto_map, map_goto):
4425 Prefer "assert (FOO);" to "if (!FOO) abort ();".
4426 * src/nullable.c (nullable_compute, token_definitions_output):
4427 Likewise.
4428 * src/reader.c (packgram, reader): Likewise.
4429 * src/state.c (transitions_to, state_new, state_reduction_find):
4430 Likewise.
4431 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
4432 (symbol_pack): Likewise.
4433 * src/tables.c (conflict_row, pack_vector): Likewise.
4434 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
4435 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
4436 * src/system.h: Don't include <assert.h>.
4437 (assert): New macro.
4438
4439 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
4440 (Destructor Decl, Parser Function, Pure Calling):
4441 Describe rules for braces inside C code more carefully.
4442
4443 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
4444
4445 Fix some porting glitches found by Nelson H. F. Beebe.
4446 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
4447 compilers that don't understand that abort () does not return.
4448 * src/state.c (transitions_to): Likewise.
4449 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4450 that '#include <cstdlib>' works.
4451 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
4452 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
4453 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
4454 for the benefit of some pre-C99 compilers.
4455
4456 * bootstrap: Undo changes to gnulib files that autoreconf made.
4457
4458 Minor fixups to get 'make maintainer-check' to work.
4459 * configure.ac: Don't use -Wnested-externs, as it's incompatible
4460 with the new verify.h implementation.
4461 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
4462 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
4463 * data/yacc.c (YYUSE): Likewise.
4464 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
4465 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
4466 * src/parse-gram.y (declaration): Don't pass a string constant
4467 to a function that expects char *, since GCC might complain
4468 about the constant value.
4469 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
4470 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
4471 before #defining them.
4472 * tests/glr-regression.at
4473 (Incorrectly initialized location for empty right-hand side in GLR):
4474 In yyerror, use the msg arg.
4475 (Corrupted semantic options if user action cuts parse):
4476 (Incorrect lookahead during deterministic GLR):
4477 (Incorrect lookahead during nondeterministic GLR):
4478 Don't name a local var 'index'; it shadows string.h's 'index'.
4479
4480 2006-01-19 Akim Demaille <akim@epita.fr>
4481
4482 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
4483 location, not just parts of it.
4484
4485 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
4486
4487 * NEWS: Document the fact that multiple %unions are now allowed.
4488 * doc/bison.texinfo (Union Decl): Likewise.
4489 * TODO: This feature is now implemented, so remove it from
4490 the wishlist.
4491
4492 * Makefile.maint: Merge with coreutils Makefile.maint.
4493 (CVS_LIST): Use build-aux version if available.
4494 (VERSION_REGEXP): New macro.
4495 (syntax-check-rules): Add sc_no_if_have_config_h,
4496 sc_prohibit_assert_without_use, sc_require_config_h,
4497 sc_useless_cpp_parens.
4498 (sc_obsolete_symbols): Check for O_NDELAY.
4499 (sc_dd_max_sym_length): Track coreutils.
4500 (sc_unmarked_diagnostics): Look in all files, not just *.c.
4501 (sc_useless_cpp_parens): New rule.
4502 (news-date-check): Look for version or today's date.
4503 (changelog-check): Don't require version number near head.
4504 (copyright-check): Use current year instead of hardwiring 2005.
4505 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
4506 (announcement): Add --gpg-key-ID.
4507
4508 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
4509 with "file system".
4510
4511 Avoid undefined behavior that addressed just before the start of an
4512 array. Problem reported by twlevo.
4513 * src/reader.c (packgram): Prepend a new sentinel before ritem.
4514 * src/lalr.c (build_relations): Rely on new sentinel.
4515 * src/gram.c (gram_free): Adjust to new sentinel.
4516
4517 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
4518
4519 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
4520 yylookaheadNeeds. All uses updated.
4521 (yysplitStack): Rename local yynewLookaheadStatuses to
4522 yynewLookaheadNeeds.
4523 * data/glr-regression.at (Incorrect lookahead during nondeterministic
4524 GLR): In comments, change `lookahead status' to `lookahead need'.
4525
4526 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4527
4528 * data/glr.c (yysplitStack): A little stylistic rewrite.
4529
4530 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4531
4532 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
4533
4534 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
4535
4536 * doc/bison.texinfo: Fix some typos.
4537 (GLR Semantic Actions): New subsection discussing special
4538 considerations because GLR semantic actions might be deferred.
4539 (Actions): Mention look-ahead usage of yylval.
4540 (Actions and Locations): Mention look-ahead usage of yylloc.
4541 (Special Features for Use in Actions): Add YYEOF entry and mention it
4542 in the yychar entry.
4543 In the yychar entry, remove mention of the local yychar case (pure
4544 parser) since this is irrelevant information when writing semantic
4545 actions and since it's already discussed in `Table of Symbols' where
4546 yychar is otherwise described as an external variable.
4547 In the yychar entry, don't call it the `current' look-ahead since it
4548 isn't when semantic actions are deferred.
4549 In the yychar and yyclearin entries, add note about deferred semantic
4550 actions.
4551 Add yylloc and yylval entries discussing look-ahead usage.
4552 (Look-Ahead Tokens): When discussing yychar, don't call it the
4553 `current' look-ahead, and do mention yylval and yylloc.
4554 (Error Recovery): Cross-reference `Action Features' when mentioning
4555 yyclearin.
4556 (Table of Symbols): In the yychar entry, don't call it the `current'
4557 look-ahead.
4558 In the yylloc and yylval entries, mention look-ahead usage.
4559
4560 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4561
4562 * tests/glr-regression.at: Update copyright year to 2006.
4563
4564 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4565
4566 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
4567 use during nondeterministic operation to track which stacks have
4568 actually needed the current lookahead.
4569 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
4570 Allocate, deallocate, resize, and otherwise shuffle space for
4571 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
4572 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
4573 appropriately during nondeterministic operation.
4574 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
4575 members to store the current lookahead to be used by the deferred
4576 user action.
4577 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
4578 from which the RHS is taken. Set the lookahead members of the new
4579 yySemanticOption according to the lookahead status for stack yyk.
4580 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
4581 yyaddDeferredAction.
4582 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
4583 members of yySemanticOption before invoking yyuserAction, and then set
4584 them back to their current values afterward.
4585 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
4586 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
4587 * tests/glr-regression.at: Remove `.' from the ends of recent test case
4588 titles for consistency.
4589 (Leaked merged semantic value if user action cuts parse): In order to
4590 suppress lint warnings, use arguments in merge function, and assign
4591 char value < 128 in main.
4592 (Incorrect lookahead during deterministic GLR): New test case.
4593 (Incorrect lookahead during nondeterministic GLR): New test case.
4594
4595 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4596
4597 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
4598 !yyvaluep as signal that no semantic value is available to print.
4599 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
4600 to print a semantic value.
4601
4602 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4603
4604 * tests/glr-regression.at: For consistency with my newer test cases,
4605 don't thank myself.
4606
4607 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4608
4609 * data/glr.c (yyresolveValue): When merging semantic options, if at
4610 least one user action succeeds but a later one cuts the parse, then
4611 destroy the semantic value before returning rather than leaking it.
4612 (yyresolveStates): If a user action cuts the parse and thus
4613 yyresolveValue fails, ignore the (unset) semantic value rather than
4614 corrupting the yyGLRState, and empty the semantic options list since
4615 the user actions should have called all necessary destructors.
4616 Simplify code with YYCHK.
4617 * tests/glr-regression.at (Corrupted semantic options if user action
4618 cuts parse): New test case.
4619 (Undesirable destructors if user action cuts parse): New test case.
4620 Before applying any of this patch, this test case never actually failed
4621 for me... but only because the corrupted semantic options usually
4622 masked this bug.
4623 (Leaked merged semantic value if user action cuts parse): New test
4624 case.
4625
4626 2006-01-05 Akim Demaille <akim@epita.fr>
4627
4628 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
4629
4630 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
4631
4632 * data/c.m4 (b4_c_modern): New macro, with a new provision for
4633 _MSC_VER. Problem reported by Cenzato Marco.
4634 (b4_c_function_def): Use it.
4635 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
4636 b4_c_modern.
4637 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
4638 than rolling our own.
4639
4640 2006-01-04 Akim Demaille <akim@epita.fr>
4641
4642 Also warn about non-used mid-rule values.
4643 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
4644 member.
4645 (symbol_list_new): Adjust.
4646 * src/reader.c (symbol_typed_p): New.
4647 (grammar_rule_check): Use it.
4648 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
4649 Check its rule.
4650 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
4651 Use it.
4652 * tests/actions.at (Exotic Dollars): Adjust.
4653
4654 2006-01-04 Akim Demaille <akim@epita.fr>
4655
4656 * src/reader.c (grammar_midrule_action): If $$ is set in a
4657 mid-rule, move the `used' bit to its lhs.
4658 * tests/input.at (Unused values): New.
4659 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
4660
4661 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
4662
4663 * doc/bison.texinfo (Bison Options): Say more accurately what
4664 --yacc does.
4665 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
4666 about declarations in the grammar when in Yacc mode, as POSIX does
4667 not require a diagnostic when the grammar uses extensions.
4668
4669 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
4670
4671 Warn about dubious constructions like "%token T T".
4672 Reported by twlevo.
4673 * src/symtab.h (struct symbol.declared): New member.
4674 * src/symtab.c (symbol_new): Initialize it to false.
4675 (symbol_class_set): New arg DECLARING, specifying whether
4676 this is a declaration that we want to warn about, if there
4677 is more than one of them. All uses changed.
4678
4679 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
4680 Allow multiple %union directives, whose contents concatenate.
4681 * src/parse-gram.y (grammar_declaration): Likewise.
4682 Use muscle_code_grow, so that we don't need stype_line any more.
4683 All uses changed.
4684
4685 * src/muscle_tab.c (muscle_grow): Fix comment.
4686
4687 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
4688 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
4689 Update copyright year to 2006.
4690
4691 2006-01-03 Akim Demaille <akim@epita.fr>
4692
4693 Have glr.cc pass (some of) the calc.at tests.
4694 * data/glr.cc (b4_parse_param_orig): New.
4695 (b4_parse_param): Improve its definition, and bound it more
4696 clearly in the skeleton.
4697 (b4_epilogue): Append, instead of prepending, in order to keep
4698 #line consistency.
4699 Simplify the generation of auxiliary functions: locations and
4700 purity are mandated.
4701 (b4_global_tokens_and_yystype): Honor it.
4702 * data/location.cc (c++.m4): Don't include it.
4703 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
4704 and AT_SKEL_CC_IF.
4705 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
4706 AT_LALR1_CC_IF.
4707 Be sure to initialize the first position's filename.
4708 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
4709 mandated anyway.
4710 (AT_CHECK_CALC_GLR_CC): New.
4711 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
4712
4713 2006-01-02 Akim Demaille <akim@epita.fr>
4714
4715 * src/output.c (output_skeleton): Don't hard wire the inclusion of
4716 c.m4.
4717 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
4718 * data/glr.cc: Do not include stack.hh.
4719
4720 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4721
4722 * data/glr.c: Reformat whitespace with tabs.
4723 (b4_lpure_formals): Remove this unused m4 macro.
4724 * tests/cxx-type.at: Reformat whitespace with tabs.
4725 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
4726 since it's a member. Rename type to isNterm for clarity.
4727
4728 2005-12-29 Akim <akim@sulaco.local>
4729
4730 Let glr.cc catch up with symbol_value_print.
4731 * data/glr.cc (b4_yysymprint_generate): Replace by...
4732 (b4_yy_symbol_print_generate): this.
4733 (yy_symbol_print, yy_symbol_value_print): Declare them.
4734
4735 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
4736
4737 * src/location.h (boundary): Note that a line or column equal
4738 to INT_MAX indicates an overflow.
4739 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
4740 (rule_length_overflow, increment_rule_length, add_column_width):
4741 New functions.
4742 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
4743 (<SC_BRACED_CODE>"}"):
4744 Use increment_rule_length rather than incrementing it by hand.
4745 (adjust_location, handle_syncline): Diagnose overflow.
4746 (handle_action_dollar, handle_action_at):
4747 Fix bug with monstrosities like $-2147483648.
4748 Remove now-unnecessary checks.
4749 (scan_integer): Verify assumptions and remove now-unnecessary checks.
4750 (convert_ucn_to_byte): Verify assumptions.
4751 (handle_syncline): New arg LOC. All callers changed.
4752 Don't store through a value derived from char const * pointer.
4753
4754 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
4755 GCC warnings.
4756
4757 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
4758
4759 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
4760 Remove unnecessary forward static decls.
4761
4762 2005-12-27 Akim Demaille <akim@epita.fr>
4763
4764 * src/reader.c (grammar_current_rule_check): Also check that $$
4765 is used.
4766 Take the rule to check as argument, hence rename as...
4767 (grammar_rule_check): this.
4768 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
4769 Rename as...
4770 (grammar_rule_begin, grammar_rule_end): these, for consistency.
4771 (grammar_midrule_action, grammar_symbol_append): Now static.
4772 * tests/torture.at (input): Don't rely on the default action
4773 being always performed.
4774 * tests/calc.at: "Set" $$ even when the action is "cut" with
4775 YYERROR or other.
4776 * tests/actions.at (Exotic Dollars): Instead of using unused
4777 values, check that the warning is issued.
4778
4779 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
4780
4781 * NEWS: Improve wording for unused-value warnings.
4782
4783 2005-12-22 Akim Demaille <akim@epita.fr>
4784
4785 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
4786 (b4_yysymprint_generate): Rename as...
4787 (b4_yy_symbol_print_generate): this.
4788 Generate yy_symbol_print instead of yysymprint.
4789 Generate also yy_symbol_value_print, and use it.
4790
4791 2005-12-22 Akim Demaille <akim@epita.fr>
4792
4793 * NEWS: Warn about unused values.
4794 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
4795 a `used' member.
4796 (symbol_list_n_get, symbol_list_n_used_set): New.
4797 (symbol_list_n_type_name_get): Use symbol_list_n_get.
4798 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
4799 * src/reader.c (grammar_current_rule_check): Check that values are
4800 used.
4801 * src/symtab.c (symbol_print): Accept 0.
4802 * tests/existing.at: Remove the type information.
4803 Empty the actions.
4804 Remove useless actions (beware of mid-rule actions: perl -000
4805 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
4806 * tests/actions.at (Exotic Dollars): Use unused values.
4807 * tests/calc.at: Likewise.
4808 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4809 Likewise.
4810
4811 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
4812 rule_useful_p.
4813
4814 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
4815
4816 Undo 2005-12-01 tentative license wording change. The wording is
4817 still being reviewed by the lawyers, and we don't want to wait for
4818 them before publishing a test release. For now, revert to the
4819 previous wording.
4820 * NEWS: Undo 2005-12-01 change.
4821 * data/glr.c: Revert to previous license wording.
4822 * data/glr.cc: Likewise.
4823 * data/lalr1.cc: Likewise.
4824 * data/location.cc: Likewise.
4825 * data/yacc.c: Likewise.
4826
4827 * NEWS: Reword %destructor vs YYABORT etc.
4828 * data/glr.c: Use American spacing, for consistency.
4829 * data/glr.cc: Likewise.
4830 * data/lalr1.cc: Likewise.
4831 * data/yacc.c: Likewise.
4832 * data/yacc.c: Reformat comments slightly.
4833 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
4834 for consistency. Fix some spelling errors and reword recently-included
4835 text slightly.
4836 * tests/cxx-type.at: Cast results of malloc, for C++.
4837
4838 2005-12-21 Joel E. Denny <address@hidden>
4839
4840 * tests/cxx-type.at: Construct a tree, count the parents of shared
4841 nodes, and free each node once and only once. Previously, the memory
4842 for semantic values was leaked instead.
4843
4844 2005-12-21 Joel E. Denny <address@hidden>
4845
4846 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
4847 (yylval, yylloc): If pure, #define to yystackp->yyval and
4848 yystackp->yyloc similar to yychar and yynerrs.
4849 (yyparse): If pure, remove local yylval and yylloc. Add local
4850 yystackp to accommodate pure definitions of yylval and yylloc.
4851 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
4852 yylvalp and yyllocp to &yylval and &yylloc.
4853 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
4854 namespace. Previously, nerrs and char were missing, but lval and lloc
4855 weren't necessary.
4856 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
4857 yylvalp and yyllocp parameters since, if pure, these are now always
4858 accessible through yystackp. If not pure, they are still accessible
4859 globally.
4860 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
4861 `if (YYID (N))' to pacify lint.
4862
4863 2005-12-21 Akim Demaille <akim@epita.fr>
4864
4865 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
4866 destroy the RHS symbols of a rule.
4867 * data/yacc.c (yylen): Initialize to 0.
4868 Keep its value to the number of items to possibly shift.
4869 In particular, a regular successful parse that ends on YYFINAL by
4870 a (internal) YYACCEPT must not have yylen != 0.
4871 (yyerrorlab, yyreturn): Pop the RHS.
4872 Reorder a bit to emphasize the `shifting' bits of code.
4873 (YYPOPSTACK): Now accept a number of items to pop.
4874 * data/lalr1.cc: Likewise.
4875 * data/glr.c: Formatting changes.
4876 Use goto instead of fall through.
4877 * doc/bison.texinfo (Destructor Decl): Complete.
4878
4879 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4880
4881 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4882 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
4883 * djgpp/config.bat: Replace every occurence of the file name
4884 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4885 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4886 * djgpp/config.sed: Replace every occurence of the file name
4887 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4888 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4889 * djgpp/djunpack.bat: DJGPP specific file.
4890 * djgpp/fnchange.lst: DJGPP specific file.
4891 * djgpp/README.in: Add new information about how to unpack the bison
4892 source on MSDOS and other systems which have 8.3 file name restrictions
4893 using djunpack.bat and fnchange.lst.
4894
4895 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
4896
4897 * bootstrap (build_cvs_prefix): Remove; unused.
4898 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
4899 when getting gnulib.
4900
4901 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
4902
4903 * data/glr.c: Reorder typedef declarations for structs to match order
4904 of struct declarations.
4905 Rename yystack everywhere to yystackp except in yyparse where it's not
4906 a pointer.
4907 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
4908 consistency.
4909 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
4910 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
4911 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
4912 lint.
4913
4914 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
4915
4916 * tests/sets.at (Accept): Fix typos in regular expression used to
4917 sed out the final state number.
4918
4919 Work around portability problem on Solaris 10: flex-generated
4920 files include <stdio.h> before <config.h>, which messes up
4921 because the latter defines __EXTENSIONS__. Address the problem
4922 by creating two new little files that include <config.h> first,
4923 then include the flex-generated files. Rewrite everyone else
4924 to include <config.h> first, as well.
4925 * lib/timevar.c: Always include "config.h".
4926 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
4927 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
4928 (EXTRA_bison_SOURCES): New macro.
4929 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
4930 * src/system.h: Don't include config.h.
4931 * src/LR0.c: Include <config.h> first.
4932 * src/assoc.c: Likewise.
4933 * src/closure.c: Likewise.
4934 * src/complain.c: Likewise.
4935 * src/conflicts.c: Likewise.
4936 * src/derives.c: Likewise.
4937 * src/files.c: Likewise.
4938 * src/getargs.c: Likewise.
4939 * src/gram.c: Likewise.
4940 * src/lalr.c: Likewise.
4941 * src/location.c: Likewise.
4942 * src/main.c: Likewise.
4943 * src/muscle_tab.c: Likewise.
4944 * src/nullable.c: Likewise.
4945 * src/output.c: Likewise.
4946 * src/parse-gram.y: Likewise.
4947 * src/print.c: Likewise.
4948 * src/print_graph.c: Likewise.
4949 * src/reader.c: Likewise.
4950 * src/reduce.c: Likewise.
4951 * src/relation.c: Likewise.
4952 * src/state.c: Likewise.
4953 * src/symlist.c: Likewise.
4954 * src/symtab.c: Likewise.
4955 * src/tables.c: Likewise.
4956 * src/uniqstr.c: Likewise.
4957 * src/vcg.c: Likewise.
4958
4959 * src/parse-gram.y: Fix minor problems uncovered by lint.
4960 (current_lhs, current_lhs_location): Now static.
4961 (current_assoc): Remove unused variable.
4962
4963 Cleanups so that Bison-generated parsers have less lint.
4964 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
4965 Prepend /*ARGSUSED*/, for lint's sake.
4966 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
4967 definition if 'lint' is defined.
4968 (YYID): New macro (or function, if lint).
4969 All uses of /*CONSTCOND*/0 replaced by YYID(0).
4970 * data/yacc.c: Likewise.
4971 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
4972 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
4973 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
4974 is C++ only.
4975 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
4976 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
4977 Use YYID(0) rather than 0, for lint.
4978 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
4979 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
4980
4981 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
4982
4983 * tests/glr-regression.at
4984 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4985 Close memory leak reported by twlevo.
4986
4987 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
4988
4989 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
4990 all stacks.
4991 (yyparse): Iterate another stack in order to call user destructors.
4992 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4993 New test case.
4994 (Duplicated user destructor for lookahead): This test now is expected
4995 to succeed.
4996
4997 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
4998
4999 * NEWS: Document the following change.
5000 * data/yacc.c: Say "parser skeleton" rather than "file", since
5001 it's no longer just a file.
5002 * data/glr.c: Grant a special exception for C GLR parsers, that
5003 reads like the already-existing exception for C LALR(1) parsers.
5004 * data/glr.cc: Likewise.
5005 * data/lalr1.cc: Likewise.
5006 * data/location.cc: Likewise.
5007 * data/yacc.c: Reword the "written by" statement to clarify that
5008 it was the parser skeleton, not the entire output file.
5009 * data/glr.c: Written by Paul Hilfinger.
5010 * data/glr.cc: Written by Akim Demaille.
5011 * data/lalr1.cc: Likewise.
5012
5013 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5014
5015 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5016 Fix typos in previous change that broke 'make check'.
5017 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5018 supported in C.
5019 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5020 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5021 We can revert this once things settle down.
5022
5023 * src/conflicts.c (conflicts_print): Don't print file name twice
5024 when %expect fails because there were no conflicts.
5025 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5026 change.
5027 * tests/conflicts.at (%expect not enough, %expect too much):
5028 (%expect with reduce conflicts): Adjust to new behavior.
5029
5030 2005-11-18 Akim Demaille <akim@epita.fr>
5031
5032 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5033 errors.
5034 * NEWS: Document this.
5035 * doc/bison.texinfo (Expect Decl): Likewise.
5036
5037 2005-11-16 Akim Demaille <akim@epita.fr>
5038
5039 Generalize the display of semantic values and locations in traces.
5040 * data/glr.c (yy_reduce_print): Fix indices (again).
5041 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5042 literal integers.
5043 * data/lalr1.cc (yyreduce_print): Rename as...
5044 (yy_reduce_print): this.
5045 Display values and locations.
5046 * data/yacc.c (yy_reduce_print): Likewise.
5047 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5048 (yysymprint): Move higher to be visible from yy_reduce_print).
5049 (yyparse): Adjust.
5050 * tests/calc.at: Adjust the expected length of the traces.
5051
5052 2005-11-14 Akim Demaille <akim@epita.fr>
5053
5054 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5055 from 1 to N, while values and location start at 0.
5056 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5057
5058 2005-11-14 Akim Demaille <akim@epita.fr>
5059
5060 * data/glr.c (yy_reduce_print): Fix the $ number.
5061
5062 2005-11-14 Akim Demaille <akim@epita.fr>
5063
5064 "Use" parse parameters.
5065 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5066 * data/glr.c, data/glr.cc: Use them.
5067 * data/glr.c (YYUSE): Have a C++ definition that supports
5068 non-pointer types.
5069
5070 2005-11-14 Akim Demaille <akim@epita.fr>
5071
5072 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5073
5074 2005-11-14 Akim Demaille <akim@epita.fr>
5075
5076 * data/glr.cc: New.
5077 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5078
5079 2005-11-12 Akim Demaille <akim@epita.fr>
5080
5081 Let position and location be PODs.
5082 * data/location.cc (position::initialize, location::initialize): New.
5083 (position::position, location::location): Define only if
5084 b4_location_constructors is defined.
5085 * data/lalr1.cc (b4_location_constructors): Define it for backward
5086 compatibility.
5087 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5088
5089 2005-11-12 Akim Demaille <akim@epita.fr>
5090
5091 * data/lalr1.cc: Move the body of the ctor and dtor into the
5092 parser file (instead of the header).
5093 Wrap the implementations in a "namespace yy".
5094
5095 2005-11-12 Akim Demaille <akim@epita.fr>
5096
5097 Have glr.c include its header file when created.
5098 * data/glr.c (b4_shared_declarations): New.
5099 Output them verbatim in the parser if !%defines, otherwise
5100 output then in the header file, and include it instead.
5101
5102 2005-11-11 Akim Demaille <akim@epita.fr>
5103
5104 * data/glr.c: Comment changes.
5105
5106 2005-11-11 Akim Demaille <akim@epita.fr>
5107
5108 When yydebug, report semantic and location values for reductions.
5109 * data/glr.c (yy_reduce_print): Report the semantic values and the
5110 locations.
5111 (YY_REDUCE_PRINT): Adjust.
5112 (yyglrReduce): Use them.
5113 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5114 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5115 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5116 traces.
5117
5118 2005-11-10 Akim Demaille <akim@epita.fr>
5119
5120 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5121 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5122 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5123
5124 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5125
5126 * m4/cxx.m4, examples/Makefile.am: Don't build
5127 examples/calc++ if no C++ compiler is available. (trivial change)
5128
5129 2005-11-09 Akim Demaille <akim@epita.fr>
5130
5131 * src/scan-skel.l: Use a couple of asserts.
5132
5133 2005-11-03 Akim Demaille <akim@epita.fr>
5134
5135 In some (weird) cases, the final state number is incorrect.
5136 Reported by Alexandre Duret-Lutz.
5137 * src/LR0.c (state_list_append): Remove the computation of
5138 final_state.
5139 (save_reductions): Do it here.
5140 (get_state): Alpha conversion.
5141 (generate_states): Use a for loop.
5142 * src/gram.h (item_number_is_rule_number)
5143 (item_number_is_symbol_number): New.
5144 * src/state.c: Use assert.
5145 * src/system.h: Include assert.h.
5146 * tests/sets.at (Accept): New.
5147
5148 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5149
5150 * data/glr.c (yyfill): Adjust comment.
5151 (yyresolveAction): Initialize default location properly
5152 for empty right-hand sides.
5153 (yydoAction): Ditto.
5154 Add comment explaining apparently dead code.
5155 * tests/glr-regression.at
5156 (Incorrectly initialized location for empty right-hand side in GLR):
5157 New test.
5158
5159 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5160
5161 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5162 gnulib when interrupted. This fixes some race conditions and
5163 works around some portability problems (one noted by Paul
5164 Hilfinger).
5165
5166 2005-10-22 Akim <akim@epita.fr>
5167
5168 * Makefile.cfg: Adjust to config -> build-aux.
5169 Reported by twledo.
5170
5171 2005-10-21 Akim Demaille <akim@epita.fr>
5172
5173 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5174 the %parse-params.
5175 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5176 * data/yacc.c (b4_Pure_if): Rename as...
5177 (b4_yacc_pure_if): this.
5178 (YY_SYMBOL_PRINT, yyparse): Adjust.
5179 * doc/bison.texinfo: Formatting changes.
5180
5181 2005-10-21 Akim Demaille <akim@epita.fr>
5182
5183 Finish the transition config -> build-aux.
5184 * configure.ac, Makefile.am: Use build-aux.
5185 * config/prev-version, config/announce-gen, config/Makefile.am:
5186 Move to...
5187 * build-aux/prev-version, build-aux/announce-gen,
5188 * build-aux/Makefile.am: here.
5189
5190 2005-10-14 Akim Demaille <akim@epita.fr>
5191
5192 * examples/calc++/test: Use set -x only when VERBOSE.
5193
5194 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5195
5196 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5197 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5198
5199 2005-10-13 Akim Demaille <akim@epita.fr>
5200
5201 * src/scan-skel.l: Output the base name parts of the parser and
5202 header file names.
5203 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
5204 additional checks.
5205 Use this to exercise C++ outputs in subdirs.
5206 Reported by Oleg Smolsky.
5207
5208 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5209
5210 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5211 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5212 Problem reported by John P. Hartmann.
5213 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5214 already defined it.
5215
5216 2005-10-12 Akim Demaille <akim@epita.fr>
5217
5218 * src/parse-gram.y (version_check): Exit 63 to please missing
5219 (stands for "version mismatch).
5220 * tests/input.at, doc/bison.texinfo: Adjust.
5221
5222 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5223
5224 Work around portability problems with Visual Age C compiler
5225 (xlc and xlC_r) reported by John P. Hartmann.
5226 * data/location.cc (initial_column, initial_line): Remove.
5227 All uses replaced by 0 and 1.
5228 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5229 that xlc complains about.
5230 * src/scan-skel.l (skel_wrap): Likewise.
5231 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
5232 as __STDC__.
5233 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5234 __STDC_VERSION__. Use it everywhere instead of looking at
5235 __STDC__ and __cplusplus.
5236
5237 2005-10-10 Akim Demaille <akim@epita.fr>
5238
5239 * examples/calc++/test: Be quiet unless VERBOSE.
5240
5241 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5242
5243 * data/c.m4 (yydestruct, yysymprint):
5244 Use YYUSE instead of casting to void.
5245 * data/glr.c (YYUSE): New macro.
5246 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5247 Use it instead of rolling our own.
5248 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5249 (YYCHK1):
5250 Use /*CONSTCOND*/ to suppress lint warnings.
5251 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5252 (YY_STACK_PRINT): Use 'false' not '0'.
5253 (YYUSE): New macro.
5254 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5255 * data/yacc.c (YYUSE): New macro.
5256 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5257 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5258 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5259
5260
5261 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5262 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5263
5264 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5265
5266 Undo the parts of the unlocked-I/O change that substituted
5267 putc or puts for printf. This might hurt performance a bit,
5268 but some people prefer the printf style.
5269 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5270 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5271 All uses replaced by YYFPRINTF and YYDPRINTF.
5272 * data/yacc.c: Likewise.
5273 * lib/bitset.c (bitset_print): Likewise.
5274 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5275 putc and puts.
5276 * lib/lbitset.c (debug_lbitset): Likewise.
5277 * src/closure.c (print_firsts, print_fderives): Likewise.
5278 * src/gram.c (grammar_dump): Likewise.
5279 * src/lalr.c (look_ahead_tokens_print): Likewise.
5280 * src/output.c (escaped_output): Likewise.
5281 (user_actions_output): Break apart two printfs.
5282 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5283 * src/reduce.c (reduce_print): Likewise.
5284 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5285 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5286
5287 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5288 Use assignments rather than casts-to-void to suppress
5289 unused-variable warnings. This pacifies 'lint'.
5290 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
5291 unused-variable warnings.
5292
5293 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5294
5295 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5296
5297 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
5298
5299 Use unlocked I/O for a minor performance improvement on hosts like
5300 GNU/Linux and Solaris that support unlocked I/O. The basic idea
5301 is to use the gnlib unlocked-io module, and to prefer putc and
5302 puts to printf when either will work (since the latter doesn't
5303 come in an unlocked flavor).
5304 * bootstrap (gnulib_modules): Add unlocked-io.
5305 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
5306 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
5307 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
5308 and similarly for puts and putc and printf.
5309 * data/yacc.c: Likewise.
5310 * lib/bitset.c (bitset_print): Likewise.
5311 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
5312 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
5313 to printf.
5314 * lib/lbitset.c (debug_lbitset): Likewise.
5315 * src/closure.c (print_firsts, print_fderives): Likewise.
5316 * src/gram.c (grammar_dump): Likewise.
5317 * src/lalr.c (look_ahead_tokens_print): Likewise.
5318 * src/output.c (escaped_output): Likewise.
5319 (user_actions_output): Coalesce two printfs.
5320 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
5321 * src/reduce.c (reduce_print): Likewise.
5322 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5323 * src/system.h: Include unlocked-io.h rather than stdio.h.
5324
5325 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
5326 this confuses xgettext.
5327
5328 2005-10-02 Akim Demaille <akim@epita.fr>
5329
5330 * bootstrap (gnulib_modules): Add strverscmp.
5331 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
5332 * m4/.cvsignore: Add strverscmp.m4.
5333 * src/parse-gram.y (%require): New token, new rule.
5334 (version_check): New.
5335 * src/scan-gram.l (%require): Adjust.
5336 * tests/input.at (AT_REQUIRE): New.
5337 Use it.
5338 * doc/bison.texinfo (Require Decl): New.
5339 (Calc++ Parser): Use %require.
5340
5341 2005-10-02 Akim Demaille <akim@epita.fr>
5342
5343 * data/location.cc: New.
5344
5345 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
5346 Akim Demaille <akim@epita.fr>
5347
5348 Make sure -odir/foo.cc creates dir/location.hh etc.
5349 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
5350 (spec_file_prefix, spec_verbose_file, spec_graph_file)
5351 (spec_defines_file): Now const.
5352 (dir_prefix): New.
5353 (short_base_name): Remove.
5354 * src/files.c: Adjust.
5355 (dirname.h): Include.
5356 (base_name): Don't prototype it.
5357 (finput): Remove, duplicates gram_in.
5358 (full_base_name, short_base_name): Replace by...
5359 (all_but_ext, all_but_tab_ext): these.
5360 (compute_base_names): Rename as...
5361 (compute_file_name_parts): this.
5362 Update to compute the new variables, including dir_prefix.
5363 Adjust dependencies.
5364 * src/output.c (prepare): Output them.
5365 * src/reader.c: Adjust to use gram_in, not finput.
5366 * src/scan-skel.l (@dir_prefix@): New.
5367
5368 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5369
5370 * lib/subpipe.c: New function end_of_output_subpipe() added
5371 to allow support for non-posix systems. This is a no-op function
5372 for posix systems.
5373
5374 * lib/subpipe.h: New function end_of_output_subpipe() added
5375 to allow support for non-posix systems. This is a no-op function
5376 for posix systems.
5377
5378 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
5379 handle the lack of pipe/fork functionality on non-posix systems.
5380
5381 * djgpp/Makefile.maint: DJGPP specific file.
5382
5383 * djgpp/README.in: DJGPP specific file.
5384
5385 * djgpp/config.bat: DJGPP specific configuration file.
5386
5387 * djgpp/config.sed: DJGPP specific configuration file.
5388
5389 * djgpp/config.site: DJGPP specific configuration file.
5390
5391 * djgpp/config_h.sed: DJGPP specific configuration file.
5392
5393 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
5394
5395 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
5396
5397 2005-10-02 Akim Demaille <akim@epita.fr>
5398
5399 * data/location.cc: New, extract from...
5400 * data/lalr1.cc: here.
5401 (location.hh): Include it after the user prologue, in case the
5402 filename type is defined by the user.
5403 Forward declation location and position before the pre-prologue.
5404 (yyresult_): Rename as...
5405 (yyresult): this, it's a local variable, not an attribute.
5406 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
5407
5408 2005-10-01 Akim Demaille <akim@epita.fr>
5409
5410 * examples/extexi: Restore the #line generation.
5411
5412 2005-09-30 Akim Demaille <akim@epita.fr>,
5413 Alexandre Duret-Lutz <adl@gnu.org>
5414
5415 Move the token type and YYSTYPE in the parser class.
5416 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
5417 (parser::token): New, from the moved free definition of tokens.
5418 (parser::semantic_value): Now a full definition instead of an
5419 indirection to YYSTYPE.
5420 (b4_post_prologue): No longer included in the header file, but
5421 in the implementation file.
5422 * doc/bison.texi (C+ Language Interface): Update.
5423 * src/parse-gram.y: Support unary %define.
5424 * tests/actions.at: Define global_tokens_and_yystype for backward
5425 compatibility until we update the tests.
5426 * tests/calc.at: Idem.
5427 (first_line, first_column, last_line, last_column): Define for lalr1.cc
5428 to simplify the code.
5429
5430 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
5431
5432 Port to SunOS 4.1.4, which lacks strtoul and strerror.
5433 Ah, the good old days! Problem reported by Peter Klein.
5434 * bootstrap (gnulib_modules): Add strerror, strtoul.
5435 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
5436 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
5437
5438 2005-09-29 Akim Demaille <akim@epita.fr>
5439
5440 * data/c.m4 (b4_error_verbose_if): New.
5441 * data/lalr1.cc: Use it.
5442 (YYERROR_VERBOSE_IF): Remove.
5443 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
5444 parser members, replaced by...
5445 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
5446 local variables.
5447 (yysyntax_error_): Takes the state number as argument.
5448 (yyreduce_print_): Use the argument yyrule, not the former
5449 attribute yyn_.
5450
5451 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
5452
5453 * bootstrap (gnulib_modules): Add verify.
5454 * lib/.cvsignore: Add verify.h.
5455 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
5456 * src/system.h (verify): Remove.
5457 Include verify.h instead.
5458 * src/tables.c (tables_generate): Use new API for 'verify'.
5459
5460 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
5461
5462 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
5463 local variables whose names begin with 'yy'.
5464 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
5465 Trivial changes from Joel E. Denny.
5466
5467 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
5468 it itself.
5469 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
5470 don't use alloca any more.
5471
5472 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
5473 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
5474 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
5475 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
5476 to match yacc.c, to test more hosts.
5477
5478 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
5479
5480 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
5481 doesn't affect behavior.
5482 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
5483 Solaris, AIX, MSC.
5484 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
5485 This works a bit better with glibc, if user code has already included
5486 stdlib.h.
5487 * doc/bison.texinfo (Bison Parser): Document that users can't
5488 arbitrarily use malloc and free for other purposes. Document
5489 that <alloca.h> and <malloc.h> might be included.
5490 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
5491 user must declare alloca.
5492
5493 * HACKING (release): Forwarn the Translation Project about
5494 stable releses.
5495
5496 2005-09-20 Akim Demaille <akim@epita.fr>
5497
5498 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
5499
5500 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
5501
5502 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
5503 (YYSTACK_ALLOC_MAXIMUM): Use it.
5504 (yysyntax_error): New function.
5505 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
5506 multiple syntax errors are reported, and alloca is being used.
5507 Instead, reallocate buffers twice as big each time, so that
5508 we waste at most half the allocated memory. Start with a small
5509 (128-byte) buffer that will suffice in most cases anyway.
5510 Use yysyntax_error to do most of the work.
5511
5512 * doc/bison.texinfo (Error Reporting, Table of Symbols):
5513 yynerrs is the number of errors reported, not the number of
5514 errors encountered.
5515
5516 * tests/glr-regression.at (Duplicated user destructor for lookahead):
5517 Mark it as expected to fail.
5518 Cast result of malloc; problem reported by twlevo@xs4all.nl.
5519 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
5520 Don't start user-code symbols with "yy", to avoid name space problems.
5521
5522 2005-09-19 Akim Demaille <akim@epita.fr>
5523
5524 Remove the traits, failed experiment.
5525 It never proved useful, and anyway because of the current
5526 definition, it was not possible to have several specialization of
5527 this traits, making it useless.
5528 * data/lalr1.cc (yy:traits): Remove.
5529 Inline its definitions in the parser class.
5530
5531 2005-09-19 Akim Demaille <akim@epita.fr>
5532
5533 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
5534 least Mac OSX with a /usr/local install of gettext.
5535
5536 2005-09-19 Akim Demaille <akim@epita.fr>
5537
5538 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
5539 and yytoken for similarity with the other skeletons.
5540
5541 2005-09-19 Akim Demaille <akim@epita.fr>
5542
5543 * NEWS, configure.ac: update version number to 2.1a.
5544
5545 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
5546
5547 * NEWS: Version 2.1.
5548
5549 * NEWS: Remove notice of yytname change, since it was never in an
5550 official release.
5551 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
5552 diagnostic.
5553 * src/output.c (prepare): Likewise.
5554 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
5555 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
5556 is not defined. This is an awful hack, but it's enough for now.
5557 All callers changed.
5558 * tests/glr-regression-at (make_value): Args are const pointers now,
5559 to avoid GCC warning.
5560 (Duplicated user destructor for lookahead): New test. Currently
5561 skipped. It fails on my host but I'm not sure it'll always fail.
5562
5563 2005-09-16 Akim Demaille <akim@epita.fr>
5564
5565 * src/symtab.h (struct symbol): Declare the printer and destructor
5566 as const, to avoid accidental calls to free.
5567 (symbol_destructor_set, symbol_printer_set): Adjust.
5568 * src/symtab.c: Adjust.
5569
5570 2005-09-16 Akim Demaille <akim@epita.fr>
5571
5572 * data/c.m4 (b4_token_enums): New.
5573 (b4_token_defines): Rename as...
5574 (b4_token_enums_defines): this.
5575 (b4_token_defines): New, output only the #defines.
5576 * data/yacc.c, data/glr.c: Adjust.
5577 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
5578 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
5579 as default values.
5580
5581 2005-09-16 Akim Demaille <akim@epita.fr>
5582
5583 * data/lalr1.cc (yylex_): Remove, inline its code.
5584 (yyreport_syntax_error_): Remove, replaced by...
5585 (yysyntax_error_): this which returns a string and leaves to the
5586 caller the call to the users' error function.
5587 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
5588 Move from members of the parser object...
5589 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
5590 to local variables of the parse function.
5591
5592 2005-09-16 Akim Demaille <akim@epita.fr>
5593
5594 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
5595 since it's in Bison's name space.
5596
5597 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
5598
5599 * data/glr.c (yyresolveValue): Add default case to pacify
5600 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
5601
5602 * NEWS: Document when yyparse started to return 2.
5603 * doc/bison.texinfo (Parser Function): Document when yyparse
5604 returns 2.
5605
5606 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
5607 (b4_filename_type): Renamed back from b4_file_name_type. All uses
5608 changed.
5609 (class position): file_name -> filename (reverting). All uses changed.
5610
5611 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
5612
5613 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
5614 do anything if $@ exists. This reverts part of the 2005-07-07
5615 patch.
5616
5617 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
5618
5619 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
5620 contains obsolete information and isn't worth distributing as a
5621 separate file anyway.
5622 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
5623 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
5624 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
5625 (yyparse): Abort if user code uses longjmp to throw an unexpected
5626 value.
5627
5628 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
5629
5630 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
5631 Suggested by twlevo@xs4all.nl.
5632
5633 * data/glr.c (YYCHK1): Do not assume YYE is in range.
5634 This avoids a diagnostic from gcc -Wswitch-enum.
5635 Problem reported by twlevo@xs4all.nl.
5636
5637 * doc/bison.texinfo: Don't use "filename", as per GNU coding
5638 standards. Use "file name" or "file" or "name", depending on
5639 the context.
5640 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
5641 not to hack/foo.tab.c.
5642 (Calc++ Top Level): 2nd arg of main is not const.
5643 * data/glr.c: b4_filename -> b4_file_name.
5644 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
5645 All uses changed.
5646 (class position): filename -> file_name. All uses changed.
5647 * data/yacc.c: b4_filename -> b4_file_name.
5648 * lib/bitset.h: filename -> file_name in local vars.
5649 * lib/bitset_stats.c: Likewise.
5650 * src/files.c: Likewise.
5651 * src/scan-skel.l ("@output ".*\n): Likewise.
5652 * src/files.c (file_name_split): Renamed from filename_split.
5653 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
5654
5655 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
5656
5657 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
5658 to accommodate latest gnulib.
5659
5660 * tests/glr-regression.at (Duplicate representation of merged trees):
5661 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
5662
5663 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
5664 needed.
5665
5666 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
5667
5668 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
5669 All uses changed. Invoke user destructor after an error during a
5670 split parse (trivial change from Joel E. Denny).
5671
5672 * tests/glr-regression.at
5673 (User destructor after an error during a split parse): New test case.
5674 Problem reported by Joel E. Denny in:
5675 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
5676
5677 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
5678
5679 * README-cvs: Give URLs for recommended tools.
5680 Mention Gzip version problem, and bootstrapping issues.
5681 Remove troubleshooting section, as it's somewhat obsolete.
5682
5683 * bootstrap (no_cache): New var, to accommodate different wget
5684 variants. Use it instead of '-C off'. Problem reported by
5685 twlevo@xs4all.nl.
5686
5687 * data/glr.c (yydestroyStackItem): New function.
5688 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
5689 debugging information. Problem reported by Joel E. Denny.
5690
5691 2005-08-25 Akim Demaille <akim@epita.fr>
5692
5693 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
5694
5695 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
5696
5697 * data/glr.c (yyrecoverSyntaxError, yyreturn):
5698 Don't invoke destructor on unresolved entries.
5699 * tests/glr-regression.at
5700 (User destructor for unresolved GLR semantic value): New test case.
5701 Problem reported by Joel E. Denny in:
5702 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
5703
5704 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
5705
5706 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
5707 Add strnlen.c.
5708 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
5709 lib-prefix.m4, po.m4.
5710
5711 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
5712 in yydestruct diagnostic, since it might not be an error.
5713 Problem reported by Joel Denny near end of
5714 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5715 * data/lalr1.cc (yyerturn): Likewise.
5716 * data/yacc.c (yyreturn): Likewise.
5717 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
5718
5719 * src/files.c: Remove obsolete FIXME comment.
5720
5721 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
5722 with the other templates, and to fix bogus run-on messages such
5723 as the one reported at the end of
5724 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5725 All callers changed to avoid the newline.
5726 (yyprocessOneStack): Output two lines rather than one, to accommodate
5727 the above change. This changes the debug output format slightly.
5728
5729 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
5730 reported by Joel E. Denny in
5731 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
5732 (trivial change).
5733 * tests/glr-regression.at (Duplicate representation of merged trees):
5734 New test, from Joel E. Denny in:
5735 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
5736 * THANKS: Add Joel E. Denny.
5737
5738 * configure.ac (AC_INIT): Bump to 2.0c.
5739
5740 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
5741
5742 * NEWS: Version 2.0b.
5743
5744 * Makefile.am (SUBDIRS): Put examples before tests, so that
5745 "make check" doesn't finish with "All 1 tests passed".
5746
5747 * tests/regression.at (Token definitions): Don't rely on
5748 AT_PARSER_CHECK for data that contains backslashes. It currently
5749 uses 'echo', and 'echo' isn't portable if its argument contains
5750 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
5751 that the byte '\0xff' is not printable in the C locale; it is,
5752 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
5753 not printable, so use '\0x81' to test.
5754
5755 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
5756 version of GCC, since the macro is used with non-GCC compilers.
5757
5758 Fix core dump reported by Pablo De Napoli in
5759 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
5760 * tests/regression.at (Invalid inputs with {}): New test.
5761 * src/parse-gram.y (token_name): Translate type before using
5762 it as an index.
5763
5764 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
5765 the user's name space. All uses changed to __attribute__
5766 ((__unused__)).
5767 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
5768 Add __attribute__ ((__noreturn__)).
5769
5770 * etc/clcommit: Remove. We weren't using it, and it failed
5771 "make maintainer-distcheck".
5772 * Makefile.maint: Merge from coreutils.
5773 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
5774 (syntax-check-rules): Change list of rules as described below.
5775 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
5776 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
5777 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
5778 (sc_trailing_space): New rules.
5779 (sc_xalloc_h_in_src): Remove.
5780 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
5781 (sc_space_tab, sc_error_exit_success, sc_changelog):
5782 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
5783 (makefile-check, po-check, author_mark_check):
5784 (makefile_path_separator_check, copyright-check):
5785 Use grep -n, to make it easier to find violations.
5786 Use CVS_LIST and CVS_LIST_EXCEPT.
5787 (header_regexp, h_re): Remove.
5788 (dd_c): New macro.
5789 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
5790 (my-distcheck): Use more-modern GCC flags.
5791 (signatures, %.asc): Remove.
5792 (rel-files, announcement): Remove signatures.
5793 Restore old updating code, even though we don't use it, so
5794 that we're the same as coreutils.
5795 (alpha, beta, major): Depend on news-date-check.
5796 Make the upload commands.
5797
5798 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
5799 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
5800 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
5801 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
5802 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
5803 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
5804 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
5805 * tests/sets.at: Likewise.
5806
5807 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
5808 we comment out the Autoconf version number.
5809 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
5810 it's error-prone and "make maintainer-distcheck" rejects it.
5811
5812 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
5813 Indent calls to "error" to pacify "make maintainer-distcheck",
5814 when the calls are not intended to be translated.
5815 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
5816
5817 * src/Makefile.am (DEFS): Use +=, to pacify
5818 "make maintainer-distcheck".
5819 (bison_SOURCES): Add scan-skel.h.
5820 (sc_tight_scope): New rule, from coreutils.
5821
5822 * src/files.c (src_extension, header_extension):
5823 Now static, not extern.
5824 * src/getargs.c (short_options): Likewise.
5825 * src/muscle_tab.c (muscle_table): Likewise.
5826 * src/parse-gram.y (current_class, current_type, current_prec):
5827 Likewise.
5828 * src/reader.c (grammar_end, previous_rule_end): Likewise.
5829 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
5830 * src/main.c (main): Cast bindtextdomain and textdomain calls to
5831 void, to avoid warning when NLS is disabled.
5832 * src/output.c: Include scan-skel.h.
5833 (scan_skel): Remove decl, since scan-skel.h does this.
5834 (output_skeleton):
5835 Indent calls to "error" to pacify "make maintainer-distcheck".
5836 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
5837 * src/reader.h (gram_end, gram_lineno): New decls to pacify
5838 "make maintainer-distcheck".
5839 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
5840 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
5841 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
5842 (skel_lex_destroy, scan_skel): Move these decls to...
5843 * src/scan-skel.h: New file.
5844 * src/uniqstr.c (uniqstr_assert):
5845 Indent calls to "error" to pacify "make maintainer-distcheck".
5846
5847 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
5848 not @VAR@.
5849
5850 * tests/torture.at: Revamp to avoid misuse of atoi that
5851 "make maintainer-distcheck" complained about.
5852
5853 * examples/extexi (message): Don't print a message more than once,
5854 and omit line-number decoration that makes Emacs compile think
5855 that informative messages are worth worrying about.
5856
5857 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
5858
5859 * configure.ac: Update version number.
5860
5861 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
5862 accidentally.
5863 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
5864 autogenerated by the maintainer.
5865 * examples/calc++/.cvsignore: Add *.yy.
5866
5867 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
5868 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5869 * lib/bitsetv.c (bitsetv_alloc): Likewise.
5870
5871 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
5872
5873 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
5874 from maintainer-distcheck about casting the argument of 'free'.
5875
5876 * NEWS: Mention recent yytname changes.
5877 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
5878
5879 * bootstrap: For translations that have not yet been upgraded to
5880 the new runtime-po domain, prime the pump by extracting the
5881 relevant strings from the obsolete translations. This code can be
5882 removed once the bison-runtime domain has been translated by each
5883 team.
5884
5885 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
5886 now that token names are already quoted.
5887
5888 Fix problem reported by Anthony Heading.
5889 * data/glr.c (YYTOKEN_TABLE): New macro.
5890 (yytname): Define if YYTOKEN_TABLE.
5891 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
5892 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
5893 (YYERROR_VERBOSE): Define the same way the other skeletons do.
5894 * src/output.c (prepare_symbols): Output token_table_flag.
5895
5896 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
5897
5898 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
5899 again if the first call fails.
5900
5901 * data/glr.c (yytnamerr): New function.
5902 (yyreportSyntaxError): Use it to dequote most string literals.
5903 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
5904 with other skeletons. All uses changed.
5905 (yytnameerr_): New function.
5906 (yyreport_syntax_error): Use it to dequote most string literals.
5907 * data/yacc.c (yytnamerr): New function.
5908 (yyerrlab): Use it to decode most string literals.
5909 * doc/bison.texinfo (Decl Summary, Calling Convention):
5910 Clarify quoting convention of yytname.
5911 * src/output.c (prepare_symbols): Quote all names. This undoes
5912 the 2005-04-17 change, which is now accomplished (mostly) via
5913 changes in the parsers as described above.
5914 * tests/regression.at (Token definitions, Web2c Actions):
5915 Undo most 2005-04-17 change here, too.
5916
5917 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
5918
5919 Fix more problems reported by twlevo@xs4all.nl.
5920 * tests/cxx-type.at: Don't pipe output of ./types through sed to
5921 remove trailing spaces. This loses the exit status of ./types,
5922 and isn't needed since ./types shouldn't be emitting trailing
5923 spaces.
5924 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
5925 as the stack isn't valid in that case.
5926
5927 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5928 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5929 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5930 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
5931 is used.
5932 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
5933 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5934 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5935 Likewise.
5936
5937 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
5938 overly-picky compilers that reject 'char *foo = "bar";'.
5939
5940 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
5941 to FILE * parameter, not to stderr. This fixes a typo introduced
5942 in the 2005-07-12 change.
5943
5944 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
5945 warnings from GCC 4.
5946
5947 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
5948 (yyglrShiftDefer, yysplitStack):
5949 Remove unused parameters b4_pure_formals. All uses changed.
5950 (yyglrShift): Remove unused parameters b4_user_formals.
5951 All uses changed.
5952 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
5953
5954 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
5955
5956 Destructor cleanups and regularization among the three skeletons.
5957 * NEWS: Document the behavior changes.
5958 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
5959 stack before failing, as the cleanup code will do it for us now.
5960 * data/lalr1.cc (yyerrlab): Likewise.
5961 * data/glr.c (yyparse): Pop everything off the stack before
5962 freeing it, so that destructors get called properly.
5963 * data/lalr1.cc (yyreturn): Likewise.
5964 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
5965 This is more consistent.
5966 * doc/bison.texinfo (Destructor Decl): Mention more reasons
5967 why destructors might be called. 1.875 -> 2.1.
5968 (Destructor Decl, Decl Summary, Table of Symbols):
5969 Some English-language cleanups for %destructor.
5970 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5971 Add output line for destructor of start symbol.
5972 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
5973 because of that same extra output line.
5974
5975 * NEWS: Document minor wording changes in diagnostics of
5976 Bison-generated parsers.
5977 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
5978 Remove unused formals. All uses changed.
5979 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
5980 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
5981 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
5982 Rename yyoverflowab to yyexhaustedlab.
5983 When memory exhaustion occurs during syntax-error reporting,
5984 report it separately rather than in a single diagnostic; this
5985 eases translation.
5986 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
5987 (Memory Exhausted): Renamed from Parser Stack Overflow.
5988 Revamp wording slightly to prefer "memory exhaustion".
5989 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
5990
5991 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
5992
5993 Add i18n support to the GLR skeleton. Partially fix the C++
5994 skeleton; a C++ expert needs to finish this. Remove debugging
5995 msgids; there's little point to having them translated, since they
5996 can be understood only by someone who can read the
5997 (English-language) source code.
5998
5999 Generate runtime-po/bison-runtime.pot automatically, so that we
6000 don't have to worry about garbage getting in that file. We'll
6001 make sure after the next official release that old msgids don't
6002 get lost. See
6003 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6004
6005 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6006 Now auto-generated.
6007 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6008 Fix typos in explanations of the runtime file.
6009 * bootstrap: Change gettext keyword from YYI18N to YY_.
6010 Use standard Makefile.in.in in runtime-po, since we'll arrange
6011 for backward-compatible bison-runtime.po files in a different way.
6012 * data/glr.c (YY_): New macro, from yacc.c.
6013 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6014 Translate messages intended for users.
6015 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6016 the wording in the other skeletons. We don't know that the memory
6017 is virtual.
6018 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6019 Use same method that yacc.c uses.
6020 Don't translate debugging messages.
6021 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6022 it doesn't work (yet), and requires C++ expertise to fix.
6023 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6024 Move defn to a more logical place, to be consistent with other
6025 skeletons.
6026 Don't translate debugging messages.
6027 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6028 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6029 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6030 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6031
6032 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6033 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6034 void, not int.
6035 * tests/glr-regression.at (Badly Collapsed GLR States):
6036 Likewise.
6037 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6038 yylex should return 0 at EOF rather than aborting.
6039
6040 Improve tests for stack overflow in GLR parser.
6041 Problem reported by twlevo@xs4all.nl.
6042 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6043 All uses removed.
6044 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6045 can handle the problem.
6046 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6047 (yyparse): New local variable yyresult to record the result.
6048 Use result of setjmp to set it, rather than storing itinto
6049 struct.
6050 (yyDone): Remove label.
6051 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6052 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6053 if YYABORT is used).
6054 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6055 yyparse status; put status > 1 into diagnostic.
6056 Check that status==2 works.
6057 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6058 Use exit status 3 for failure to open (which shouldn't happen).
6059
6060 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6061
6062 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6063 1 on syntax error; just let yyparse do its thing.
6064 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6065 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6066 (Exploding the Stack Size with Alloca):
6067 (Exploding the Stack Size with Malloc):
6068 Expect exit status 2, not 1, since the parser is supposed to blow
6069 its stack. Problem reported by twlevo@xs4all.nl.
6070
6071 * data/glr.c (yyparse): Don't assume that the initial calls
6072 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6073 Print a stack-overflow message and fail instead.
6074 Initialize the line-number information before creating the stack,
6075 so that the stack-overflow message can report line zero safely.
6076
6077 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6078
6079 Fix problems reported by twlevo@xs4all.nl.
6080 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6081 (yyuserMerge): Provide a default case if b4_mergers is empty.
6082 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6083 * tests/glr-regression.at
6084 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6085 Add casts to pacify C++ compilers.
6086 * tests/glr-regression.at (Improper merging of GLR delayed action
6087 sets): Declare yylex before using it.
6088 * tests/Makefile.am (maintainer-check-g++): Fix a stray
6089 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6090 test for valgrind; valgrind is independent of g++.
6091 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6092 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6093 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6094 Use a destructor, so that we can expand the stack. Change
6095 YYSTYPE to char * so that we can free it. Cast result of malloc.
6096
6097 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6098
6099 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6100 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6101
6102 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6103
6104 * PACKAGING: New file, suggested by Bruno Haible and taken from
6105 similar wording in gettext's PACKAGING file.
6106 * NEWS: Mention PACKAGING.
6107 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6108
6109 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6110
6111 * NEWS: Document recent i18n improvements.
6112 * bootstrap: Get runtime translations into runtime-po.
6113 Create runtime-po files automatically, if possible.
6114 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6115 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6116 does not infringe on the user's name space.
6117 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6118 * doc/bison.texinfo (Internationalization): Revamp the English
6119 and Texinfo syntax a bit, to try to make it clearer.
6120 (Bison Options, Option Cross Key): Mention --print-localedir.
6121 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6122 YYENABLE_NLS. Quote a bit more.
6123 * runtime-po/.cvsignore: New file.
6124 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6125 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6126 * runtime-po/quot.sed: Likewise.
6127 * runtime-po/boldquot.sed: Likewise.
6128 * runtime-po/en@quot.header: Likewise.
6129 * runtime-po/en@boldquot.header: Likewise.
6130 * runtime-po/insert-header.sin: Likewise.
6131 * runtime-po/remove-potcdate.sin: Likewise.
6132 * runtime-po/Makevars: Likewise.
6133 * runtime-po/LINGUAS: Likewise.
6134 * runtime-po/de.po: Likewise; we will rely on the translation project
6135 to maintain this, so "bootstrap" should get it.
6136 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
6137 its value.
6138 * src/main.c (main): Bind the bison-runtime domain, too.
6139
6140 2005-07-12 Bruno Haible <bruno@clisp.org>
6141
6142 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6143 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6144 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6145 * runtime-po: New directory.
6146 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6147 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6148 * runtime-po/Rules-quot: New file, copied from po/.
6149 * runtime-po/quot.sed: Likewise.
6150 * runtime-po/boldquot.sed: Likewise.
6151 * runtime-po/en@quot.header: Likewise.
6152 * runtime-po/en@boldquot.header: Likewise.
6153 * runtime-po/insert-header.sin: Likewise.
6154 * runtime-po/remove-potcdate.sin: Likewise.
6155 * runtime-po/Makevars: New file.
6156 * runtime-po/POTFILES.in: New file.
6157 * runtime-po/LINGUAS: New file.
6158 * runtime-po/bison-runtime.pot: New file.
6159 * runtime-po/de.po: New file.
6160 * m4/bison.m4: New file.
6161 * Makefile.am (SUBDIRS): Add runtime-po.
6162 (aclocaldir, aclocal_DATA): New variables.
6163 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6164 Define aclocaldir.
6165 * src/getargs.c (usage): Document --print-localedir option.
6166 (PRINT_LOCALEDIR_OPTION): New enum item.
6167 (long_options): Add --print-localedir option.
6168 (getargs): Handle --print-localedir option.
6169 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6170 (Internationalization): New section.
6171
6172 2005-07-12 Akim Demaille <akim@epita.fr>
6173
6174 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6175 for consistency with the rest of the code.
6176 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6177 Add separators.
6178
6179 2005-07-12 Akim Demaille <akim@epita.fr>
6180
6181 * src/parse-gram.y: Use %printer instead of YYPRINT.
6182
6183 2005-07-12 Akim Demaille <akim@epita.fr>
6184
6185 * src/symtab.h, src/symtab.c (symbol_print): New.
6186 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6187 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6188
6189 2005-07-12 Akim Demaille <akim@epita.fr>
6190
6191 * data/glr.c (b4_syncline): Fix (swap) the definitions of
6192 b4_at_dollar and b4_dollar_dollar.
6193
6194 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6195
6196 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6197 and Pennello's paper.
6198
6199 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6200
6201 * data/yacc.c (yyparse): Undo previous patch. Instead,
6202 set yylsp[0] and yyvsp[0] only if the initial action
6203 sets yylloc and yylval, respectively.
6204
6205 * data/yacc.c (yyparse): In the initial action, set
6206 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6207 This avoids the use of undefined variables if the initial
6208 action does not set yylloc and/or yylval.
6209
6210 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6211
6212 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6213 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6214 Remove from CVS. These files are automatically generated.
6215 * examples/extexi: Clarify that this file is now part of Bison,
6216 not GNU M4, and that it works with any POSIX-compatible Awk.
6217 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6218 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6219 so that we also get calc++-parser.yy. Geneate it.
6220 Use $(AWK), not gawk, since any conforming Awk will do.
6221 Put comment before action, since older 'make' can't handle comment
6222 in action.
6223 $(BUILT_SOURCES): List all built sources, not just some of them.
6224 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6225 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6226 $($(calc_sources_generated)): Remove unnecessary test for existence
6227 of target. (This had a shell syntax error anyway; a stray "x".)
6228 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6229 calc++-parser.yy.
6230 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6231
6232 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6233 implied by the other modules.
6234
6235 2005-07-06 Akim Demaille <akim@epita.fr>
6236
6237 Bind examples/calc++ to the package.
6238 * examples/calc++/Makefile: Remove, replaced by...
6239 * examples/calc++/Makefile.am: ... this new file.
6240 * examples/calc++/test: Remove input.
6241 * examples/calc++/compile: Remove.
6242 * examples/Makefile.am: New.
6243 * configure.ac, Makefile.am: Adjust.
6244 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6245
6246 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6247
6248 * data/glr.c (yyFail): Drastically simplify; since the format argument
6249 never had any % directives, we can simply pass it to yyerror.
6250 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6251 be modified later, as that is the usual style in glr.c.
6252 Problems reported by Paul Hilfinger.
6253
6254 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6255 and size overflow errors.
6256 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6257 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6258 (YYSIZEMAX): New macro.
6259 (yystpcpy): New function, taken from yacc.c.
6260 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6261 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6262 so that we don't have to maintain their signatures.
6263 (yyFail): Check for buffer overflow, by using vsnprintf rather
6264 than vsprintf. Allocate a bigger buffer if possible.
6265 Report an error if buffer allocation fails.
6266 (yyStackOverflow): New function.
6267 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6268 the initialization was successful. It might fail if storage was
6269 exhausted.
6270 (yyexpandGLRStack): Add more checks for storage allocation failure.
6271 Use yyStackOverflow to report failures.
6272 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6273 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6274 Don't assume stack number fits in int.
6275 (yysplitStack): Check for storage allocation failure.
6276 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6277 can print diagnostics on storage allocation failure. All callers
6278 changed.
6279 (yyresolveValue): Use yybool for boolean.
6280 (yyreportSyntaxError): Check for size-calculation overflow.
6281 This code is taken from yacc.c.
6282 (yyparse): Check for storage allocation errors when allocating
6283 the initial stack.
6284
6285 2005-07-05 Akim Demaille <akim@epita.fr>
6286
6287 Extract calc++ from the documentation.
6288 * doc/bison.texinfo (Calc++): Add the extraction marks.
6289 * examples/extexi: New, from the aborted GNU Programming 2E.
6290 Separate the different paragraph of a file with empty lines.
6291 * examples/Makefile: Use it to extract the whole calc++ example.
6292
6293 2005-06-24 Akim Demaille <akim@epita.fr>
6294
6295 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
6296 class typedefs.
6297
6298 2005-06-22 Akim Demaille <akim@epita.fr>
6299
6300 * doc/bison.texinfo (C++ Language Interface): First stab.
6301 (C++ Parsers): Remove.
6302
6303 2005-06-22 Akim Demaille <akim@epita.fr>
6304
6305 * data/lalr1.cc (yylex_): Honor %lex-param.
6306
6307 2005-06-22 Akim Demaille <akim@epita.fr>
6308
6309 Start a set of simple examples.
6310 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
6311 * examples/calc++/calc++-driver.hh,
6312 * examples/calc++/calc++-parser.yy,
6313 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
6314 * examples/calc++/compile, examples/calc++/test: New.
6315
6316 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
6317
6318 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
6319 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
6320 which stems from the 2005-05-27 patch.
6321
6322 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6323
6324 * data/glr.c: Modify treatment of unused parameters to permit use
6325 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
6326
6327 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
6328
6329 Fix infringement on user name space reported by Janos Zoltan Szabo.
6330 * data/yacc.c (yyparse): strlen -> yystrlen.
6331
6332 2005-05-30 Akim Demaille <akim@epita.fr>
6333
6334 * data/lalr1.cc (_): New.
6335 Translate the various messages.
6336
6337 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
6338
6339 Fix infringement on user name space reported by Bruno Haible.
6340 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
6341 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
6342 the user's name space.
6343 (alloca): Include <stdlib.h> to get it, if it's not built in.
6344 (YYMALLOC, YYFREE): Define only if needed.
6345 (malloc, free): Declare, but only if needed, as this infringes on
6346 the user name space.
6347
6348 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
6349
6350 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
6351 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
6352 with %d format.
6353 * lib/ebitset.c (min, max): Undef before defining.
6354 * lib/vbitset.c (min, max): Likewise.
6355 * lib/subpipe.c (create_subpipe): Save local variables in case
6356 vfork clobbers them.
6357
6358 2005-05-24 Bruno Haible <bruno@clisp.org>
6359
6360 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
6361 error message syntax used by gcc-4.0.
6362
6363 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
6364
6365 * README: Mention m4 1.4.3. Remove obsolete advice about
6366 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
6367
6368 * bootstrap: Remove workaround for problem I encountered with
6369 gettext 0.14.1; it seems to be fixed now.
6370
6371 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
6372
6373 * NEWS: Version 2.0a.
6374
6375 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
6376 the previous change.
6377
6378 Various maintainer cleanups.
6379 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
6380 conftest*, for benefit of CVS commands run at the same time as
6381 "configure". Add build-aux, since "bootstrap" now creates it and
6382 its subfiles.
6383 * Makefile.cfg (move_if_change): Remove.
6384 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
6385 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
6386 (po_repo, do-po-update, po-update, wget_files, get-targets):
6387 (config.guess-url_prefix, config.sub-url_prefix):
6388 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
6389 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
6390 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
6391 Remove.
6392 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
6393 this is now the recommended name.
6394 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
6395 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
6396 ylwrap. These files now go into build-aux.
6397 * config/move-if-change: Remove.
6398 * config/prev-version.txt: Bump from 1.75 to 2.0.
6399
6400 * bootstrap: Add stdio-safer, unistd-safer modules.
6401 Remove m4/glibc2.m4 (introduced by latest gnulib, but
6402 we don't need it).
6403 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
6404 fopen-safer.c, stdio-safer.h, unistd-safer.h.
6405 * lib/subpipe.c: Include "unistd-safer.h".
6406 (create_subpipe): Make sure all the newly-created
6407 file descriptors are > 2, so that diagnostics don't
6408 get sent down them (which might cause Bison to hang, in theory).
6409 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
6410 * src/files.c (xfopen): Use fopen_safer, not fopen.
6411
6412 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
6413 yesterday's yacc.c fix.
6414
6415 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
6416
6417 * data/glr.c, data/lalr1.cc: Update copyright date.
6418
6419 Fix a destructor bug reported by Wolfgang Spraul in
6420 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
6421 * data/yacc.c (yyabortlab): Don't call destructor, and
6422 don't set yychar to EMPTY.
6423 (yyoverflowlab): Don't call destructor.
6424 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
6425 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
6426 since we no longer output the message "discarding lookahead token
6427 end of input ()".
6428
6429 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6430
6431 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
6432 fix a small glitch in debugging output.
6433 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
6434 after YY_SYMBOL_PRINT where needed.
6435
6436 (struct yyGLRState): Add some comments.
6437 (struct yySemanticOption): Add some comments.
6438 (union yyGLRStackItem): Add comment.
6439
6440 (yymergeOptionSets): Correct this to properly perform the union,
6441 avoiding infinite reported by Michael Rosien.
6442 Update comment.
6443
6444 * tests/glr-regression.at: Add test for GLR merging error reported
6445 by M. Rosien.
6446
6447 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
6448
6449 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
6450 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
6451 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
6452 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
6453 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
6454 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
6455 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
6456 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
6457 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
6458 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
6459 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
6460 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
6461 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
6462 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
6463 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
6464 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
6465 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
6466 src/derives.h, src/files.c, src/files.h, src/getargs.c,
6467 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
6468 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
6469 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
6470 src/output.h, src/parse-gram.c, src/parse-gram.h,
6471 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
6472 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
6473 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
6474 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
6475 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
6476 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
6477 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
6478 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
6479 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
6480 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
6481 tests/reduce.at, tests/regression.at, tests/sets.at,
6482 tests/synclines.at, tests/testsuite.at, tests/torture.at:
6483 Update FSF postal mail address.
6484
6485 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
6486
6487 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
6488 Problem reported by Ralf Menzel.
6489
6490 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
6491
6492 * tests/actions.at: Test that stack overflow invokes destructors.
6493 From Marcus Holland-Moritz.
6494 * data/yacc.c (yyerrlab): Move the code that destroys the stack
6495 from here....
6496 (yyreturn): to here. That way, destructors are called properly
6497 even if the stack overflows, or the user calls YYACCEPT or
6498 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
6499 (yyoverflowlab): Destroy the lookahead.
6500
6501 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
6502
6503 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
6504
6505 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
6506
6507 * NEWS: Bison-generated C parsers no longer quote literal strings
6508 associated with tokens.
6509 * src/output.c (prepare_symbols): Don't escape strings,
6510 since users don't want to see C escapes.
6511 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
6512 in diagnostics.
6513 * tests/input.at (Torturing the Scanner): Likewise.
6514 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
6515
6516 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
6517
6518 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
6519 the data size is known to be too small and we can't increase it.
6520 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
6521
6522 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
6523
6524 * src/parse-gram.y: Include quotearg.h.
6525 (string_as_id): Quote $1 before using it as a key, since the
6526 lexer no longer quotes it for us.
6527 (string_content): Don't strip quotes, since lexer no longer
6528 quotes it for us.
6529 * src/scan-gram.l: Include quotearg.h.
6530 ("\""): Omit quote.
6531 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
6532 a key, since the rest of the lexer doesn't quote it.
6533 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
6534 * tests/regression.at (Token definitions): Check for backslashes
6535 in token strings.
6536
6537 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
6538 (YYSIZE_T): Define to unsigned long int when using an older compiler.
6539 (yyparse): Revamp code to generate long syntax error message, to
6540 make it easier to translate, and to avoid problems with arithmetic
6541 overflow. Change "virtual memory" to "memory" in diagnostic, since
6542 we don't know whether the memory is virtual.
6543
6544 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
6545
6546 * NEWS: Bison-generated C parsers now use the _ macro to
6547 translate strings.
6548 * data/yacc.c (_) [!defined _]: New macro.
6549 All English strings wrapped inside this macro.
6550 * doc/bison.texinfo (Bison Parser): Document _.
6551 * po/POTFILES.in: Include src/parse-gram.c, since it now
6552 includes translateable strings that parse-gram.y doesn't.
6553
6554 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
6555
6556 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
6557 reverting the 2004-10-11 change to this function.
6558 (symbol_check_alias_consistency): Don't call symbol_type_set
6559 if the type name is already correct.
6560 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
6561
6562 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
6563
6564 * tests/regression.at (Token definitions): Don't use a token named
6565 c, as that generates a "#define c ..." that runs afoul of buggy
6566 stdlib.h that uses the identifier c as a member of struct
6567 drand48_data. Problem reported by Horst Wente.
6568
6569 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
6570
6571 * bootstrap: Change translation URL from
6572 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
6573 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
6574 redirection glitches. Problem reported by twlevo@xs4all.nl.
6575
6576 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
6577
6578 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
6579 after operands; POSIX says this isn't portable for the c99 command.
6580
6581 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
6582
6583 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
6584 immediately if a data overrun has occurred; this may help us track
6585 down what may be a spurious failure on MacOS.
6586
6587 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
6588
6589 Respond to problems reported by twlevo@xs4all.nl.
6590
6591 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
6592
6593 * src/vcg.h: Comment fix.
6594 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
6595 (G_CMAX): Change to -1 instead of INT_MAX.
6596
6597 * data/yacc.c (yyparse): Omit spaces before #line.
6598
6599 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
6600
6601 * src/tables.c (state_number_to_vector_number): Put it inside an
6602 "#if 0", since it's not currently used. Problem reported by
6603 Roland McGrath.
6604
6605 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
6606
6607 * src/output.c (escaped_output): Renamed from
6608 escaped_file_name_output, since we now use it for symbol tags as
6609 well. All uses changed.
6610 (symbol_destructors_output, symbol_printers_output):
6611 Escape symbol tags too.
6612 Problem reported by Matyas Forstner in
6613 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
6614
6615 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
6616 not needed.
6617 * src/output.c (user_actions_output, token_definitions_output,
6618 symbol_destructors_output, symbol_printers_output): Likewise.
6619 * src/reader.c (prologue_augment): Likewise.
6620 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
6621
6622 * src/vcg.c (output_edge): Don't quote linestyle arg.
6623 Problem reported by twlevo@xs4all.nl.
6624
6625 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
6626
6627 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
6628 example, reported by Derek M Jones. Also, make the example even
6629 more outrageous, to better illustrate how bad the problem is.
6630
6631 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
6632
6633 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
6634 putsym. Typo reported by Sebastian Piping.
6635
6636 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
6637
6638 * doc/bison.texinfo (Language and Grammar): some -> same
6639 (Epilogue): int he -> in the
6640 Typos reported by Sebastian Piping via Justin Pence.
6641
6642 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
6643
6644 * tests/glr-regression.at (Improper handling of embedded actions
6645 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
6646 embedded actions and $-N in GLR parsers", work around an Autoconf bug
6647 with dollar signs in test names.
6648 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
6649 for a similar reason.
6650
6651 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
6652
6653 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
6654 wants to redefine G_VIEW.
6655
6656 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
6657
6658 * src/vcg.c (get_view_str): Remove case for normal_view.
6659 Problem reported by twlevo@xs4all.nl.
6660
6661 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
6662
6663 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
6664 Problem reported by twlevo@xs4all.nl.
6665
6666 * doc/bison.texinfo: Change @dircategory from "GNU programming
6667 tools" to "Software development". Requested by Richard Stallman
6668 via Karl Berry.
6669
6670 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
6671
6672 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
6673 Problem reported by twlevo@xs4all.nl.
6674
6675 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
6676
6677 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
6678 keyword; it's not needed with modern compilers, and it doesn't
6679 affect correctness with older compilers. Suggested by
6680 twlevo@xs4all.nl.
6681
6682 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
6683
6684 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
6685 gcc -Wswitch-default.
6686 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6687 * data/yacc.c (yyparse): Likewise.
6688
6689 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
6690
6691 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
6692 already. Let config.h define any nonstandard values.
6693
6694 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
6695
6696 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
6697 for the benefit of slower hosts. Problem reported by
6698 Nelson H. F. Beebe.
6699
6700 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
6701
6702 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
6703 being defined and not used.
6704 * data/lalr1.cc (yyparse): Likewise.
6705 Use "if (false)" rather than "if (0)".
6706
6707 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
6708
6709 * TODO: Mention that we should allow NUL bytes in tokens.
6710
6711 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
6712
6713 * src/scan-skel.l (<<EOF>>): Don't close standard output.
6714 Problem reported by Hans Aberg.
6715
6716 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
6717
6718 * src/getargs.c (version): Happy new year; update overall
6719 program copyright date from 2004 to 2005.
6720
6721 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
6722 Problem reported by Hans Aberg.
6723 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
6724 (Output file names.): Add a test for the case when standard output
6725 is closed.
6726
6727 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
6728
6729 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
6730 to fix an oversight in the Bison 2.0 manual.
6731
6732 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
6733
6734 * NEWS: Version 2.0. Reformat the existing news items since
6735 1.875, so that related items are grouped together.
6736 * configure.ac (AC_INIT): Bump version to 2.0.
6737 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
6738
6739 * tests/torture.at (Exploding the Stack Size with Alloca): Set
6740 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
6741 otherwise, we're not testing alloca. Unfortunately there's no
6742 simple way to consult HAVE_ALLOCA here.
6743
6744 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
6745 for yymsg, too.
6746
6747 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
6748 hand. This avoids a warning about comparing int to size_t when
6749 GCC warnings are enabled.
6750
6751 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
6752
6753 * NEWS: Bison-generated parsers no longer default to using the
6754 alloca function (when available) to extend the parser stack, due
6755 to widespread problems in unchecked stack-overflow detection.
6756 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
6757 responsibility to set it to a positive value. This lets the user
6758 specify a value that is not a preprocessor constant.
6759 * data/yacc.c (YYMAXDEPTH): Likewise.
6760 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
6761 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
6762 to be a compile-time constant. However, explain the constraints on it.
6763 Also, explain the constraints on YYINITDEPTH.
6764 (Table of Symbols): Explain that alloca is no longer the default.
6765 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
6766 to 1.
6767
6768 * doc/bison.texinfo (Location Default Action): Mention that n must
6769 be zero when k is zero. Suggested by Frank Heckenbach.
6770
6771 2004-12-22 Akim Demaille <akim@epita.fr>
6772
6773 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
6774 (parser::state_type, parser::semantic_type, parser::location_type):
6775 Private, not public.
6776 (parser::parse): Return ints, not bool.
6777 Returning a bool introduces a problem: 0 corresponds to false, and
6778 it seems weird to return false on success. Returning true changes
6779 the conventions for yyparse.
6780 Alternatively we could return void and send an exception.
6781 There is no clear consensus (yet?).
6782 (state_stack, semantic_stack, location_stack): Rename as...
6783 (state_stack_type, semantic_stack_type, location_stack_type): these.
6784 Private, not public.
6785 * tests/c++.at: New.
6786 * tests/testsuite.at, tests/Makefile.am: Adjust.
6787
6788 2004-12-21 Akim Demaille <akim@epita.fr>
6789
6790 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
6791
6792 2004-12-21 Akim Demaille <akim@epita.fr>
6793
6794 Don't impose std::string for filenames.
6795
6796 * data/lalr1.cc (b4_filename_type): New.
6797 (position::filename): Use it.
6798 (parser.hh): Move the inclusion of stack.hh and location.hh below
6799 the user code, so that needed headers for the filename type can be
6800 included first.
6801 Forward declare them before the user code.
6802 * tests/Makefile.am (check-local, installcheck-local): Pass
6803 TESTSUITEFLAGS to the TESTSUITE.
6804
6805 2004-12-20 Akim Demaille <akim@epita.fr>
6806
6807 Use more STL like names: my_class instead of MyClass.
6808
6809 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
6810 (SemanticStack, SemanticType, StateStack, StateType)
6811 (TokenNumberType, Stack, Slice, Traits, Parser::location)
6812 (Parser::value): Rename as...
6813 (location_stack, location_type, rhs_number_type, semantic_stack)
6814 (semantic_type, state_stack, state_type, token_number_type, stack)
6815 (slice, traits, parser::yylloc, parser::yylval): these.
6816
6817 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
6818
6819 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
6820
6821 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
6822 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6823
6824 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
6825
6826 Remove uses of 'short int' and 'unsigned short int'. This raises
6827 some arbitrary limits. It uses more memory but nowadays that's
6828 not much of an issue.
6829
6830 This change does not affect the generated parsers; that's a different
6831 task, as some users will want to conserve memory there.
6832
6833 Ideally we should use size_t to represent all object counts, and
6834 something like ptrdiff_t to represent signed differences of object
6835 counts; but that will require more code-cleanup than I have the
6836 time to do right now.
6837
6838 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
6839 Use size_t, not int or short int, to count objects.
6840 * src/closure.c (nritemset, closure): Likewise.
6841 * src/closure.h (nritemset, closure): Likewise.
6842 * src/nullable.c (nullable_compute): Likewise.
6843 * src/print.c (print_core): Likewise.
6844 * src/print_graph.c (print_core): Likewise.
6845 * src/state.c (state_compare, state_hash): Likewise.
6846 * src/state.h (struct state): Likewise.
6847 * src/tables.c (default_goto, goto_actions): Likewise.
6848
6849 * src/gram.h (rule_number, rule): Use int, not short int.
6850 * src/output.c (prepare_rules): Likewise.
6851 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
6852 errs, reductions): Likewise.
6853 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
6854 Likewise.
6855 * src/tables.c (vector_number, tally, action_number,
6856 ACTION_NUMBER_MINIMUM): Likewise.
6857 * src/output.c (muscle_insert_short_int_table): Remove.
6858
6859 2004-12-17 Akim Demaille <akim@epita.fr>
6860
6861 * data/lalr1.cc: Extensive Doxygenation.
6862 (error_): Rename as...
6863 (error): this, since it is visible to the user.
6864 Adjust callers.
6865 (Parser::message): Now an automatic variable from...
6866 (Parser::yyreport_syntax_error_): here.
6867 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
6868 Parser::error.
6869 * tests/input.at: Escape $.
6870
6871 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
6872
6873 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
6874 Parenthesize rhs to avoid obscure problems with mistakes like
6875 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
6876 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6877 b4_rhs_location): Likewise.
6878 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6879 b4_rhs_location): Likewise.
6880
6881 2004-12-16 Akim Demaille <akim@epita.fr>
6882
6883 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
6884 yacc.c: be sure to stay within yycheck_.
6885 * tests/actions.at: Re-enable C++ tests.
6886
6887 2004-12-16 Akim Demaille <akim@epita.fr>
6888
6889 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
6890 real.
6891
6892 2004-12-16 Akim Demaille <akim@epita.fr>
6893
6894 Use #define to handle the %name-prefix.
6895
6896 * data/glr.c, data/yacc.c: Comment changes.
6897 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
6898 so that one can refer to yylex in the parser file, and have it
6899 renamed, as is the case with other skeletons.
6900
6901 2004-12-16 Akim Demaille <akim@epita.fr>
6902
6903 Move lalr1.cc internals into yy*.
6904
6905 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
6906 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
6907 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
6908 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
6909 (empty_, final_, terror_, errcode_, ntokens_)
6910 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
6911 (looka_, ilooka_, error_range_, nerrs_):
6912 Rename as...
6913 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
6914 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
6915 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
6916 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
6917 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
6918 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
6919 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
6920 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
6921 these.
6922
6923 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
6924
6925 Fix some problems reported by twlevo at xs4all.
6926 * src/symtab.c (symbol_new): Report an error if the input grammar
6927 contains too many symbols. This is better than calling abort() later.
6928 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
6929 (struct node, struct graph):
6930 Rename member expand to stretch. All uses changed.
6931 (struct graph): Remove member layoutalgorithm. All uses removed.
6932 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
6933 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
6934 All uses changed.
6935 (N_STRETCH): Rename from N_EXPAND. All uses changed.
6936
6937 2004-12-15 Akim Demaille <akim@epita.fr>
6938
6939 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
6940 Add more Doxygen comments.
6941 (symprint_, stack_print_, reduce_print_, destruct_, pop)
6942 (report_syntax_error_, translate_): Rename as...
6943 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
6944 (yypop_, yyreport_syntax_error_, yytranslate_): this.
6945
6946 2004-12-15 Akim Demaille <akim@epita.fr>
6947
6948 * data/lalr1.cc (lex_): Rename as...
6949 (yylex_): this.
6950 Move the trace here.
6951 Take the %name-prefix into account.
6952 Reported by Alexandre Duret-Lutz.
6953
6954 2004-12-15 Akim Demaille <akim@epita.fr>
6955
6956 Simplify the C++ parser constructor.
6957
6958 * data/lalr1.cc (debug_): Rename as...
6959 (yydebug_): so that the parser's internals are always in the yy*
6960 pseudo namespace.
6961 Adjust uses.
6962 (b4_parse_param_decl): Remove the leading comma as it is now only
6963 called as unique argument list.
6964 (Parser::Parser): Remove the constructor accepting a location and
6965 an initial debugging level.
6966 Remove from the other ctor the argument for the debugging level.
6967 (debug_level_type, debug_level, set_debug_level): New.
6968
6969 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
6970 constructor calls.
6971
6972 2004-12-15 Akim Demaille <akim@epita.fr>
6973
6974 Remove b4_root related material: failure experiment
6975 (which goal was to allow to derive from a class).
6976
6977 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
6978 definitions and uses.
6979
6980 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
6981
6982 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
6983 not 2, since it's not portable to subtract 1 from the start of an
6984 array. The new item 0 is never set or used. All uses changed.
6985
6986 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
6987 the default definition of YYLLOC_DEFAULT. Problem reported
6988 by Frank Heckenbach.
6989
6990 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
6991
6992 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
6993 the normal case and one for the error case. Just use the
6994 first one uniformly. Problem reported by Frank Heckenbach.
6995 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
6996 use exactly the same macro in both places.
6997 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
6998 so that the normal-case YYRHSLOC works for the error case too.
6999 All uses changed.
7000 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7001 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7002 * doc/bison.texinfo (Location Default Action): Don't claim that
7003 we have an array of locations. Use the same macro for both glr
7004 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7005 the index is 0.
7006
7007 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7008
7009 * HACKING: Update email addresses to send announcements to.
7010
7011 * configure.ac (AC_INIT): Bump version to 1.875f.
7012
7013 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7014
7015 * NEWS: Version 1.875e.
7016 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7017
7018 * src/scan-skel.l: Include "complain.h", for "fatal".
7019
7020 * src/relation.h (relation_print, relation_digraph):
7021 Relation sizes are of type relation_node, not size_t (this is
7022 merely a doc fix, since the two types are equivalent).
7023 (relation_transpose): Relation sizes are of type relation_node,
7024 not int.
7025 * src/relation.c: Likewise.
7026 (top, infinity): Now of type relation_node, not int.
7027 (traverse, relation_transpose): Use relation_node, not int.
7028
7029 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7030 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7031 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7032
7033 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
7034 specifying whether the test should be skipped. Use it tp
7035 specify that the [%defines %skeleton "lalr1.cc"] tests currently
7036 fail on some hosts, and should be skipped.
7037
7038 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7039
7040 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7041 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7042 unless otherwise specified below.
7043
7044 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7045 to allocate kernel_base, kernel_items, kernel_size, since
7046 they needn't be initialized to 0.
7047 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7048 * src/closure.c (new_closure): Likewise, for itemset.
7049 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7050 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7051 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7052 (build_relations): Likewise for edge, states1, includes.
7053 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7054 * src/reader.c (packgram): Likewise, for ritem, rules.
7055 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7056 * src/relation.c (relation_digraph): Likewise for VERTICES.
7057 (relation_transpose): Likewise for new_R, end_R.
7058 * src/symtab.c (symbols_token_translations_init): Likewise for
7059 token_translations.
7060 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7061 (token_actions): Likewise for yydefact, actrow, conflrow,
7062 conflict_list.
7063 (save_column): Likewise for froms[symno], tos[symno].
7064 (goto_actions): Likewise for state_count.
7065 (pack_table): Likewise for base, pos, check.
7066 (tables_generate): Likewise for width.
7067
7068 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7069 for initial core. Just have a separate core, so we needn't worry
7070 about whether kernel_size and kernel_base are initialized.
7071
7072 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7073 kernel_size, kernel_items): Remove unnecessary initialization.
7074 * src/conflicts.c (conflicts): Likewise.
7075 * src/derives.c (derives): Likewise.
7076 * src/muscle_tablc (muscle_insert): Likewise.
7077 * src/relation.c (relation_digraph): Likewise.
7078 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7079 conflrow, conflict_table, conflict_list, table, check):
7080 Likewise.
7081
7082 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7083 This is because all callers pass unsigned int.
7084 * src/closure.h (new_closure): Likewise.
7085
7086 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7087 (build_relations): Initialize includes[i] in all cases.
7088 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7089 and rules[ruleno].precsym. Initialize members in order.
7090 * src/relation.c (relation_transpose): Always initialize new_R[i]
7091 and end_R[i].
7092 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7093
7094 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7095 conflict_list[0] was always 0, but now it isn't initialized.
7096
7097 * src/table.c (table_grow): When conflict_table grew, the grown
7098 area wasn't cleared. Fix this.
7099
7100 * lib/.cvsignore: Add strdup.c, strdup.h.
7101 * m4/.cvsignore: Add strdup.m4.
7102
7103 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7106 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7107 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7108 ngotos + 1 without checking for overflow.
7109 (build_relations): Use END_NODE, not -1, to denote end of edges.
7110 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7111 build_relations): Use goto_number, not int, for goto numbers.
7112 * src/tables.c (save_column, default_goto): Likewise.
7113
7114 2004-11-23 Akim Demaille <akim@epita.fr>
7115
7116 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7117 of #defining from yystype.
7118 Don't typedef yystype, C++ does not need it.
7119 This lets it possible to forward declare it as union.
7120
7121 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7122
7123 * bootstrap (gnulib_modules): Add extensions.
7124 Problem reported by Jim Meyering.
7125
7126 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7127
7128 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7129 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7130 src/system.h, src/tables.c: XFREE -> free, to accommodate
7131 recent change to gnulib xalloc.h.
7132 Problem reported by Jim Meyering.
7133
7134 2004-11-17 Akim Demaille <akim@epita.fr>
7135
7136 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7137
7138 2004-11-17 Akim Demaille <akim@epita.fr>,
7139 Alexandre Duret-Lutz <adl@gnu.org>
7140
7141 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7142 changes.
7143 (YYCDEBUG): Adjust.
7144 Use it instead of cdebug_.
7145 (Parser::debug_stream, Parser::set_debug_stream): New.
7146 (Parser::symprint_): Define cdebug_ for temporary backward
7147 compatibility.
7148 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7149 debug_stream ().
7150
7151 2004-11-17 Akim Demaille <akim@epita.fr>
7152
7153 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7154 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7155 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7156 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7157
7158 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7159
7160 * data/glr.c (yyloc_default): Remove; not used.
7161 Problem reported by Frank Heckenbach.
7162
7163 2004-10-25 Akim Demaille <akim@epita.fr>
7164
7165 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7166 Introduce another definition to address simple location arrays.
7167 (yyGLRStack): New member: yyerror_range.
7168 (yyrecoverSyntaxError, yyparse): Update it.
7169 (yyrecoverSyntaxError): Use it when shifting the error token to
7170 have an accurate range, equivalent to the one computed by both
7171 yacc.c and lalr1.cc.
7172 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7173 that column numbers start at column 0, as per GNU Coding
7174 Standards, the others tests, and the doc.
7175 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7176 Adjust to the above change (first column is 0).
7177 And adjust the location of the "<error>", now covering the whole
7178 line.
7179
7180 2004-10-22 Akim Demaille <akim@epita.fr>
7181 and Paul Eggert <eggert@cs.ucla.edu>
7182
7183 Remove some arbitrary limits on goto numbers and relations.
7184 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7185 initial values, since they're never used.
7186 (set_goto_map): ngotos is now unsigned, so test for overflow
7187 by seeing whether it wraps around to zero.
7188 * src/lalr.h (goto_number): Now size_t, not short int.
7189 (GOTO_NUMBER_MAXIMUM): Remove.
7190 * src/relation.c (relation_print, traverse, relation_transpose):
7191 Check for END_NODE rather than looking at sign.
7192 * src/relation.h (END_NODE): New macro.
7193 (relation_node): Now size_t, not short int.
7194
7195 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7196
7197 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7198 keyword, not an identifier. Problem reported by Baron Schwartz in
7199 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7200
7201 2004-10-11 Akim Demaille <akim@epita.fr>
7202
7203 * src/symtab.c (symbol_check_alias_consistency): Also check
7204 type names, destructors, and printers.
7205 Reported by Alexandre Duret-Lutz.
7206 Recode the handling of associativity and precedence in terms
7207 of symbol_precedence_set.
7208 Accept no redeclaration at all, not even equal to the previous
7209 value.
7210 (redeclaration): New.
7211 Use it to factor redeclaration complaints.
7212 (symbol_make_alias): Don't set the type of the alias, let
7213 symbol_check_alias_consistency do it as for other features.
7214 * src/symtab.h (symbol): Add new member prec_location, and
7215 type_location.
7216 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7217 * tests/input.at (Incompatible Aliases): New.
7218
7219 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7220
7221 .cvsignore fixes to accommodate gnulib changes,
7222 and the practice of naming build directories "_build".
7223 * .cvsignore: Add "_*". Sort.
7224 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7225 * m4/.cvsignore: Add "*_gl.m4".
7226
7227 2004-10-06 Akim Demaille <akim@epita.fr>
7228
7229 * src/parse-gram.y (add_param): Fix the truncation of trailing
7230 spaces.
7231
7232 2004-10-05 Akim Demaille <akim@epita.fr>
7233
7234 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7235 whether the reducion was empty or not. This leaves room to
7236 improve the use of YYLLOC_DEFAULT in such a case.
7237 lalr1.cc is still experimental, so changing this is acceptable.
7238 And finally, there are probably not many users who changed the
7239 handling of locations in GLR, so changing is admissible too.
7240
7241 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7242 empty reduction, set @$ to an empty location ending the previously
7243 stacked symbol.
7244 Adjust uses to make sure the code is triggered on empty
7245 reductions.
7246 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7247 expected output: empty reductions have empty locations.
7248
7249 2004-09-29 Akim Demaille <akim@epita.fr>
7250
7251 * data/lalr1.cc: Move towards a more standard C++ coding style
7252 for templates: Class < T > -> Class<T>.
7253
7254 2004-09-29 Akim Demaille <akim@epita.fr>
7255
7256 * data/lalr1.cc: Reinstall the former ctor, for sake of
7257 compatibility, but warn it will be removed.
7258 Move towards a more standard C++ coding style (i.e., type *var ->
7259 type* var).
7260
7261 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7262
7263 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7264 since it's less likely to work if NULs are involved in the future.
7265
7266 2004-09-27 Akim Demaille <akim@epita.fr>
7267
7268 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7269
7270 2004-09-27 Akim Demaille <akim@epita.fr>
7271
7272 * data/lalr1.cc (b4_parse_param_decl_1): New.
7273 (b4_parse_param_decl): Use it to have different names between attribute
7274 and argument names.
7275 (b4_cc_constructor_call): Likewise.
7276
7277 2004-09-24 Akim Demaille <akim@epita.fr>
7278
7279 * src/parse-gram.y (add_param): Strip the leading and trailing
7280 blanks from a formal argument declaration.
7281 (YY_LOCATION_PRINT): New.
7282
7283 2004-09-24 Akim Demaille <akim@epita.fr>
7284
7285 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7286 after the location.
7287
7288 2004-09-24 Akim Demaille <akim@epita.fr>
7289
7290 * doc/bison.texinfo (Table of Symbols): Sort.
7291
7292 2004-09-21 Akim Demaille <akim@epita.fr>
7293
7294 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
7295 the useless parentheses.
7296 Suggested by Paul Eggert.
7297
7298 2004-09-20 Akim Demaille <akim@epita.fr>
7299
7300 Let the initial-action act on the look-ahead, and use it for the
7301 "initial push" (corresponding to an hypothetical beginning-of-file).
7302 And let lalr1.cc honor %initial-action.
7303
7304 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
7305 example.
7306 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
7307 (Parser::Parser): Remove the ctor that used to initialize it.
7308 (Parser::parse): Like in the other skeletons, issue the "starting
7309 parse" message before any action.
7310 Honor %initial-action.
7311 Initialize the stacks with the lookahead.
7312 * data/yacc.c: Let $$ and @$ in %initial-action designate the
7313 look-ahead.
7314 Push them in the stacks.
7315 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
7316
7317 2004-09-20 Akim Demaille <akim@epita.fr>
7318
7319 * doc/bison.texinfo (Initial Action Decl): New.
7320
7321 2004-09-20 Akim Demaille <akim@epita.fr>
7322
7323 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
7324 clearer criterion to define it.
7325 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
7326 When reducing on an empty RHS, use the latest stacked location as
7327 location.
7328 yylloc is not always available.
7329 * data/glr.c: Likewise.
7330 Also, honor initial-actions.
7331
7332 2004-09-20 Akim Demaille <akim@epita.fr>
7333
7334 * data/yacc.c (YY_LOCATION_PRINT): New.
7335 Define when we know YYLTYPE's structure, i.e., when the default
7336 YYLLOC_DEFAULT is used.
7337 * data/c.m4 (b4_yysymprint_generate): Use it.
7338 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
7339 value of the result.
7340 (error_start_): Replace with...
7341 (error_range_): this location array.
7342 This allows to replace code relying on the implementation of
7343 locations by portable code.
7344 * data/yacc.c (yylerrsp): Replace with...
7345 (yyerror_range): this.
7346 Every time a token is popped, update yyerror_range[0], to have an
7347 accurate location for the error token.
7348 * data/glr.c (YY_LOCATION_PRINT): New.
7349 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
7350 deference a pointer.
7351 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
7352 report the location in %printers.
7353
7354 * src/scan-skel.l: Instead of abort, report error messages to ease
7355 understanding skeleton scanning failures.
7356
7357 2004-09-16 Akim Demaille <akim@epita.fr>
7358
7359 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
7360 (iterator, const_iterator): these, to be more in the C++ spirit.
7361 Also, return reverse iterators so that when displaying the stack
7362 we display its bottom first.
7363 (Parser::stack_print_, Parser::reduce_print_): Match the messages
7364 from yacc.c.
7365 We should probably use vector here though.
7366
7367 2004-09-16 Akim Demaille <akim@epita.fr>
7368
7369 Have more complete shift traces.
7370
7371 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
7372 to report Shifts instead of ad hoc YYDPRINTF invocations,
7373 including for the error token.
7374 * data/lalr1.cc (symprint_): Output the location.
7375 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
7376 output the location within the %printer.
7377 Activate GLR tests, at least to make sure they compile properly.
7378 They still don't pass though.
7379 * tests/calc.at: Adjust expect verbose output, since now "Entering
7380 state..." is on a different line than the "Shifting" message.
7381
7382 2004-09-08 Akim Demaille <akim@epita.fr>
7383
7384 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
7385 Bison directive from the Bison file to the invocation of this
7386 macro, so that these directives are passed to
7387 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
7388 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
7389 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
7390 the extra Bison directives instead of the whole series.
7391 Change the grammar so that there are recoverable errors, and
7392 unrecoverable errors. Now we can have the parser give up before
7393 consuming the whole input. As a result we now can observe that
7394 the lookahead is freed when needed.
7395 Change the parser source to parse argv[1] instead of a hard coded
7396 string.
7397 Simplify yylex, and give a value and location to EOF.
7398 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
7399 passed directives already coded in the file.
7400 Add some tests to check the location of "error".
7401 For some tests, the C++ parser is correct, and not yacc.c.
7402 For other tests, they provide different, but unsatisfying, values,
7403 so keep the C++ value so that at least one parser is "correct"
7404 according to the test suite.
7405 (Actions after errors): Remove, this is subsumed by the
7406 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
7407
7408 2004-09-06 Akim Demaille <akim@epita.fr>
7409
7410 * data/lalr1.cc: Adjust the indentation of the labels.
7411 (Parser::pop): New.
7412 Use it.
7413
7414 2004-09-06 Akim Demaille <akim@epita.fr>
7415
7416 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
7417 argument, an informative message.
7418 Call YY_SYMBOL_PRINT.
7419 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
7420 * data/lalr1.cc (destruct_): Likewise.
7421 In addition, no longer depend on b4_yysymprint_generate and
7422 b4_yydestruct_generate to generate these functions, do it "by
7423 hand".
7424
7425 2004-09-03 Akim Demaille <akim@epita.fr>
7426
7427 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
7428 invoked, yydestruct the lookahead.
7429 * tests/calc.at (Calculator $1): Update the expected lengths of
7430 traces: there is an added line for the discarded lookahead.
7431 * doc/bison.texinfo (Destructor Decl): Some rewording.
7432 Define "discarded" symbols.
7433
7434 2004-09-02 Akim Demaille <akim@epita.fr>
7435
7436 * data/lalr1.cc (translate_, destruct_): No reason to be static.
7437
7438 2004-09-02 Akim Demaille <akim@epita.fr>
7439
7440 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
7441 (YYDSYMPRINTF): Rename as...
7442 (YY_SYMBOL_PRINT): this.
7443 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
7444 two.
7445 Use it instead of direct symprint_ calls.
7446 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
7447 one.
7448
7449 2004-09-02 Akim Demaille <akim@epita.fr>
7450
7451 * data/lalr1.cc (b4_yysymprint_generate): New.
7452 (symprint_): New member function, defined when YYDEBUG.
7453 Use it consistently instead of token/nterm debugging output by
7454 hand.
7455 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
7456 %printer calls to use cdebug_ when using lalr1.cc.
7457
7458 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
7459
7460 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
7461 with #ifdef YYDEBUG.
7462
7463 2004-08-26 Akim Demaille <akim@epita.fr>
7464
7465 * doc/bison.texinfo (Implementing Loops): Rename as...
7466 (Implementing Gotos/Loops): this.
7467
7468 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
7469
7470 Adjust to latest gnulib.
7471 * bootstrap (gnulib_modules): Add xalloc-die.
7472 Set LC_ALL=C so that file names sort consistently.
7473 Prefer the gnulib copies of gettext.m4, glibc21.m4,
7474 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
7475 uintmax_t.m4, ulonglong.m4.
7476 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
7477 po.m4 since we are now using _gl.m4 instead.
7478
7479 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
7480
7481 * src/scan-action.l: Remove. Scanning of semantic actions is
7482 handled in scan-gram.l.
7483
7484 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
7485
7486 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
7487
7488 * src/location.h (struct): The file member is a uniqstr.
7489 (equal_boundaries): Use UNIQSTR_EQ for comparison.
7490
7491 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
7492
7493 Fix bug with non-%union parsers that have printers or destructors,
7494 which led to a Bison core dump. Reported by Peter Fales in
7495 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
7496
7497 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
7498 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
7499 not to our own type.
7500 * src/output.c (symbol_destructors_output, symbol_printers_output):
7501 Don't assume %union.
7502 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
7503 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
7504 UNION-FLAG. All callers changed.
7505 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
7506 Use type char, not unsigned int, when declaring an array of char;
7507 this lets us remove a cast.
7508 (Printers and Destructors): Add non-%union test cases.
7509
7510 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7511
7512 * doc/bison.texinfo: Minor editorial changes, mostly to the new
7513 GLR writeups. E.g., avoid frenchspacing and the future tense,
7514 change "lookahead" to "look-ahead", and change "wrt" to "with
7515 respect to".
7516
7517 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7518
7519 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
7520 New sections, split off from the GLR Parsers section. Put the new
7521 Simple GLR Parser near the start of the GLR section, for clarity.
7522 Rewrite connective text.
7523
7524 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
7525
7526 * doc/bison.texinfo (Simple GLR Parsers): New section.
7527
7528 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7529
7530 * NEWS, TODO, doc/bison.texinfo:
7531 Use "look-ahead" instead of "lookahead", to be consistent.
7532 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
7533 while we're fixing "look-ahead".
7534 * src/conflicts.c (shift_set): Renamed from shiftset.
7535 (look_ahead_set): Renamed from lookaheadset.
7536 * src/print.c: Likewise.
7537 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
7538 name for "lookahead".
7539 (report_types, usage): Likewise.
7540 * src/getargs.h (report_look_ahead_tokens): Renamed from
7541 report_lookaheads.
7542 * src/lalr.c (compute_look_ahead_tokens): Renamed from
7543 compute_lookaheads.
7544 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
7545 (look_ahead_tokens_print): Renamed from lookaheads_print.
7546 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
7547 state_rule_lookaheads_print.
7548 * src/state.h: Likewise.
7549 (reductions.look_ahead_tokens): Renamed from lookaheads.
7550 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
7551 AT_DATA_LOOKAHEADS_GRAMMAR.
7552
7553 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
7554
7555 * README: Update location of patched M4 distribution.
7556
7557 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
7558
7559 Don't assume the C++ compiler takes the same arguments as the C compiler
7560 (trivial change).
7561 * configure.ac (O0CXXFLAGS): New var.
7562 * tests/atlocal.in (CXXFLAGS): Use it.
7563
7564 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
7565
7566 Fix some "make check" problems with C++ reported by
7567 Albert Chin-A-Young for Tru64 C++ in this thread:
7568 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
7569
7570 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
7571 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7572 Output to a .cc file for C++, not to a .c file.
7573 * tests/calc.at (AT_CHECK_CALC): Likewise.
7574 * tests/regression.at (AT_CHECK_DANCER): Likewise.
7575 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
7576
7577 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
7578
7579 * tests/calc.at, tests/actions.at: Workaround for SGI
7580 C++ compiler. (trivial change)
7581
7582 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
7583
7584 Spent a few hours checking out which prerequisite versions the
7585 current sources actually require. I went all the way back to
7586 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
7587 a seemingly endless set of combinations of versions more recent
7588 than that. The bottom line is that the current sources require
7589 fairly recent versions of the build tools, and it'll be some work
7590 to change this.
7591 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
7592 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
7593 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
7594 Add comments explaining why those particular versions are
7595 currently needed.
7596
7597 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
7598 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
7599 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
7600
7601 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
7602 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
7603
7604 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
7605
7606 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
7607 0.11.5. Suggested by Bruno Haible.
7608 * bootstrap: Remove gettext version checking.
7609
7610 * doc/bison.texinfo (Decl Summary): Also mention that %union
7611 can depend on prerequisite types. Problem reported by Tim
7612 Van Holder.
7613
7614 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
7615
7616 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
7617 * README-alpha: Don't tell people not to package this.
7618
7619 * bootstrap: Don't assume $(...) works; use `...` instead.
7620 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
7621 gettext better.
7622
7623 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
7624 put into the -d output file, and mention what to do if YYSTYPE is
7625 defined as a macro.
7626
7627 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
7628
7629 Undo change made earlier today: it caused autopoint to not bring
7630 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
7631 autopoint's.
7632
7633 * bootstrap: Check that gettext version matches what's in
7634 configure.ac. Warn users to ignore robots.txt ERROR 404.
7635 * bootstrap: Undo today's earlier change (logged below).
7636 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
7637
7638 The gettext version checking is causing more trouble than it's
7639 curing; remove it. Problem reported by Paul Hilfinger.
7640
7641 * bootstrap: Issue a warning that one can expect a message
7642 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
7643 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
7644
7645 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
7646
7647 Ensure that the C++ compiler used for testing actually works on a
7648 simple test program; if not, skip the C++-related tests. Problem
7649 reported by Vin Shelton in:
7650 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
7651
7652 * m4/cxx.m4: New file.
7653 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
7654 * tests/atlocal.in (BISON_CXX_WORKS): Add.
7655 * tests/local.at (AT_COMPILE_CXX): Use it.
7656
7657 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7658
7659 * data/glr.c (yylloc): Output this macro even if locations are not
7660 being generated, as the GLR parser needs it even in that case.
7661 Problem reported by Troy A. Johnson
7662 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
7663
7664 * configure.ac (AC_INIT): Update to 1.875e.
7665
7666 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7667
7668 * NEWS: Version 1.875d.
7669 * configure.ac (AC_INIT): Likewise.
7670 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
7671
7672 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
7673 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
7674 lalr1.cc runs afoul of the first, and the last two are no longer
7675 supported by GCC 3.4.0.
7676 * README: Mention GNU m4 1.4 or later; mention m4 patches.
7677 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
7678
7679 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
7680
7681 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
7682 unsigned int, for compatibility with latest gnulib hash module.
7683 * src/state.c (state_hash, state_hasher): Likewise.
7684 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
7685 * src/uniqstr.c (hash_uniqstr): Likewise.
7686
7687 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
7688
7689 * NEWS: Unescaped newlines are no longer allowed in char & strings.
7690
7691 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
7692 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
7693 character and string literals.
7694 (unexpected_end): New function.
7695 (unexpected_eof): Use it.
7696 (unexpected_newline): New function.
7697 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
7698 actions.
7699
7700 * NEWS: Document %expect-rr.
7701
7702 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
7703 Fix typo by replacing $1 with $option.
7704 Remove more 'intl'-related files.
7705 Don't DEFUN AM_INTL_SUBDIR twice.
7706
7707 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
7708 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
7709 strtoul.c.
7710 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
7711 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
7712 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
7713 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
7714 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
7715 * src/.cvsignore: Add *.output.
7716
7717 * src/parse-gram.y: Put copyright notice inside %{ %} so it
7718 gets copied to the output file.
7719
7720 2004-04-28 Paul Eggert <eggert@twinsun.com>
7721
7722 Get files from the gnulib and po repositories, instead of relying
7723 on them being in our CVS. Upgrade to latest versions of gnulib
7724 and Automake.
7725
7726 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
7727 * bootstrap: Bootstrap from gnulib and po repositories.
7728 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
7729 * README-cvs: Document these changes. Remove version numbers from
7730 mentions of build tools, since they change so often. Mention Flex.
7731
7732 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
7733 (gl_USE_SYSTEM_EXTENSIONS): Add.
7734 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
7735 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
7736 does this for us.
7737 (AC_ISC_POSIX): Remove; we no longer support this
7738 ancient OS, as it gets in the way of latest Autoconf & gnulib.
7739 (AC_HEADER_STDC): Remove: we now assume C89 or better.
7740 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
7741 Do not check for C89 headers, except for locale.h which is used
7742 by the Yacc library and must port to K&R hosts.
7743 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
7744 Do not check for C89 functions, except for setlocale which is
7745 used by the Yacc library.
7746 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
7747 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
7748 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
7749 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
7750 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
7751 AM_GNU_GETTEXT): Remove; now done by:
7752 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
7753 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
7754 for us.
7755
7756 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
7757 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
7758 Define to empty, as gnulib.mk will do the rest for us.
7759 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
7760 for us.
7761 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
7762 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
7763
7764 * src/files.c: Include gnulib's xstrndup.h.
7765
7766 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
7767 (REALLOC): Use xnrealloc, for likewise.
7768 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
7769 (strnlen, memrchr): Remove decls; functions no longer used.
7770 Include <stpcpy.h>.
7771
7772 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
7773 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7774 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
7775 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
7776 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
7777 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
7778 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
7779 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
7780 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
7781 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
7782 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
7783 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7784 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
7785 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
7786 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
7787 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
7788 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
7789 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
7790 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
7791 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
7792 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
7793 Remove, as these files are now generated automatically
7794 by bootstrap or automake.
7795
7796 * po/ChangeLog: Remove: all but one entry was a duplicate
7797 of this file, and I moved that 2000-11-02 entry here.
7798
7799 * config/.cvsignore: Add Makefile, depcomp, install-sh.
7800 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
7801 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
7802 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
7803 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
7804 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
7805 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
7806 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
7807 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
7808 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
7809 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
7810 xstrndup.h.
7811 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
7812 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
7813 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
7814 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
7815 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
7816 * src/.cvsignore: Remove *_.c.
7817
7818
7819 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
7820 support it. (The latest stable gzip doesn't.)
7821
7822 2004-04-27 Paul Eggert <eggert@twinsun.com>
7823
7824 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
7825 case, as stos_ is now used by destructors due to the 2004-02-09
7826 change.
7827
7828 Remove more K&R C support.
7829 * lib/libiberty.y (PARAMS): Remove. All uses removed.
7830 * lib/subpipe.c (errno): Remove decl.
7831 Include <stdlib.h> unconditionally.
7832 (EXIT_FAILURE): Remove macro.
7833 * src/complain.c (vfprintf, strerror): Remove.
7834 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
7835 unconditionally.
7836 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
7837 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
7838 (strchr, strspn, memchr): Remove decls.
7839 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
7840 unconditionally. Do not declare perror.
7841 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
7842 unconditionally.
7843
7844 * src/complain.c (_): Remove useless defn, as system.h defines this.
7845
7846 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
7847 with latest obstack.h.
7848 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
7849 to procedure types, as obstack.h now does that for us.
7850 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
7851
7852 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
7853 so that this include file can stand alone.
7854 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
7855 does this now. Include subpipe.h first after config.h, to
7856 test whether it can stand alone.
7857
7858 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
7859 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
7860 unused declaration.
7861
7862 * tests/synclines.at (%union synch line): Put a dummy member in
7863 the union, because empty unions aren't allowed in C. Caught
7864 by GCC 3.4.0.
7865
7866 2004-04-13 Jim Meyering <jim@meyering.net>
7867
7868 * src/conflicts.c (conflicts_print): Correct format string typo:
7869 use `%%' to produce literal `%'. (trivial change)
7870
7871 2004-03-30 Paul Eggert <eggert@twinsun.com>
7872
7873 * src/getargs.c (version): Update copyright year to 2004.
7874
7875 * data/c.m4 (b4_int_type): Use 'short int' rather than
7876 'short', and similarly for 'long', 'unsigned', etc.
7877 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
7878 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
7879 yy_yypstack, yydumpstack): Likewise.
7880 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
7881 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
7882 Likewise.
7883 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
7884 yy_stack_print, yyparse): Likewise.
7885 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
7886 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
7887 * lib/bitset.c (bitset_print): Likewise.
7888 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
7889 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7890 * lib/bitsetv.c (bitsetv_dump): Likewise.
7891 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
7892 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
7893 Likewise.
7894 * src/LR0.c (allocate_itemsets): Likewise.
7895 * src/gram.h (rule_number, rule): Likewise.
7896 * src/lalr.h (goto_number): Likewise.
7897 * src/nullable.c (nullable_compute): Likewise.
7898 * src/output.c (prepare_rules): Likewise.
7899 * src/relation.c (relation_print, relation_digraph): Likewise.
7900 * src/relation.h (relation_node): Likewise.
7901 * src/state.h (state_number, transitions, errs, reductions,
7902 struct state): Likewise.
7903 * src/symtab.h (symbol_number, struct symbol): Likewise.
7904 * src/tables.c (vector_number, tally, action_number,
7905 default_goto, goto_actions): Likewise.
7906 * tests/existing.at (GNU Cim Grammar): Likewise.
7907 * tests/regression.at (Web2c Actions): Likewise.
7908
7909 * src/output.c (muscle_insert_short_int_table): Renamed from
7910 muscle_insert_short_table. All uses changed.
7911
7912 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7913
7914 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
7915 (declaration): Replace expected_conflicts with expected_sr_conflicts.
7916 Add %expect-rr rule.
7917
7918 * src/scan-gram.l: Recognize %expect-rr.
7919
7920 * src/conflicts.h (expected_sr_conflicts): Rename from
7921 expected_conflicts.
7922 (expected_rr_conflicts): Declare.
7923
7924 * src/conflicts.c (expected_sr_conflicts): Rename from
7925 expected_conflicts.
7926 (expected_rr_conflicts): Define.
7927 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
7928 for GLR parsers.
7929 Use expected_sr_conflicts in place of expected_conflicts.
7930 Warn if expected_rr_conflicts used in non-GLR parser.
7931
7932 * doc/bison.texinfo: Add documentation for %expect-rr.
7933
7934 2004-03-08 Paul Eggert <eggert@gnu.org>
7935
7936 Add support for hex token numbers. Suggested by Odd Arild Olsen in
7937 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
7938
7939 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
7940 in lalr1.cc.
7941 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
7942 * src/scan-gram.l (scan_integer): New function.
7943 ({int}): Use it.
7944 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
7945 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
7946 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
7947 Say "long int", not "long", for uniformity with GNU style.
7948
7949 2004-02-25 Paul Eggert <eggert@twinsun.com>
7950
7951 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
7952 compilers. This fixes a problem with Intel's C++ compiler being
7953 chatty, reported by Guido Trentalancia in
7954 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
7955
7956 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
7957
7958 Support %destructor and merge error locations in lalr1.cc.
7959
7960 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
7961 (Parser::stos_): Define unconditionally.
7962 (Parser::destruct_): New method. Generate its body with
7963 b4_yydestruct_generate.
7964 (Parser::error_start_): New attribute.
7965 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
7966 token which are discarded.
7967 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
7968 error_start_ when erroneous token are discarded.
7969 (Parser::parse) <yyerrlab1>: Compute the location of the error
7970 token so that it covers all the discarded tokens.
7971 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
7972 it can be called with `%skeleton "lalr1.cc"', and do that.
7973
7974 2004-02-02 Paul Eggert <eggert@twinsun.com>
7975
7976 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
7977 $(top_srcdir)/lib and ../lib. This fixes a bug reported
7978 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
7979 There's no need to mention top_builddir since Automake does that
7980 for us.
7981 (INCLUDES): Remove, as Automake says it's obsolescent.
7982 Contents migrated into AM_CPPFLAGS as described above.
7983 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
7984
7985 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7986
7987 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
7988 (yyreportSyntaxError): Handle case where lookahead token is
7989 YYEMPTY.
7990
7991 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7992
7993 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
7994 resulting parsers are compilable with C++.
7995
7996 2003-12-23 Paul Eggert <eggert@twinsun.com>
7997
7998 * config/depcomp, config/install-sh: Sync with Automake 1.8.
7999 * src/output.c (output_skeleton): Rename local var.
8000 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8001 Bison tokens, as this runs afoul of the 2003-10-07 change that
8002 disallowed NUL bytes in character constants or string literals.
8003
8004 * tests/local.at: Require Autoconf 2.59's Autotest.
8005 * tests/testsuite.at: Don't include local.at, since we now assume
8006 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8007 including it.
8008 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8009 multiple inclusion warnings.
8010
8011 2003-12-02 Akim Demaille <akim@epita.fr>
8012
8013 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8014 conditions.
8015 From Bruno Haible.
8016
8017 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8018
8019 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8020
8021 2003-10-07 Paul Eggert <eggert@twinsun.com>
8022
8023 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8024 if testsuite doesn't exist.
8025
8026 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8027 literals, unfortunately.
8028 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8029 Complain about NUL bytes in character constants or string literals.
8030
8031 2003-10-05 Paul Eggert <eggert@twinsun.com>
8032
8033 * NEWS: Don't document %no-default-prec, as it's still
8034 too experimental.
8035 * doc/bison.texinfo: Document %no-default-prec only if
8036 the defaultprec flag is set. Normally it's not.
8037
8038 2003-10-04 Paul Eggert <eggert@twinsun.com>
8039
8040 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8041 non-modifiable lvalue, instead of a modifiable one.
8042 * doc/bison.texinfo (Actions): Document that $$ can
8043 be assigned to. Do not claim that $$ and $N are
8044 array element references: user code should not rely on this.
8045
8046 2003-10-01 Paul Eggert <eggert@twinsun.com>
8047
8048 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8049 (grammar_declaration): Use it.
8050 * src/scan-gram.l: New token %no-default-prec.
8051 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8052 * NEWS, doc/bison.texinfo: Document the above.
8053
8054 2003-10-01 Akim Demaille <akim@epita.fr>
8055
8056 VCG no longer supports long_straight_phase.
8057
8058 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8059 * src/print_graph.c (print_graph): Adjust.
8060
8061 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
8062 and Paul Eggert <eggert@twinsun.com>
8063
8064 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8065 Table of Symbols): Document %default-prec.
8066 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8067 (grammar_declaration): Set default_prec on %default-prec.
8068 * src/scan-gram.l (%default-prec): New token.
8069 * src/reader.h (default_prec): New flag.
8070 * src/reader.c: Likewise.
8071 (packgram): Handle it.
8072 * tests/conflicts.at (%default-prec without %prec,
8073 %default-prec with %prec, %default-prec 1): New tests.
8074
8075 2003-09-30 Paul Eggert <eggert@twinsun.com>
8076
8077 * tests/testsuite.at: Include local.at, not input.at, fixing
8078 a typo in the 2003-08-25 patch.
8079
8080 2003-08-27 Akim Demaille <akim@epita.fr>
8081
8082 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8083 GCC warnings.
8084
8085 2003-08-26 Akim Demaille <akim@epita.fr>
8086
8087 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8088 "<\#" to avoid magic from Gnus when posting parts of this script.
8089
8090 2003-08-26 Akim Demaille <akim@epita.fr>
8091
8092 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8093 (Parser::parse): here.
8094 Adjust: nerrs and errstatus is now replaced by...
8095 (Parser::nerrs_, Parser::errstatus_): New.
8096
8097 2003-08-25 Akim Demaille <akim@epita.fr>
8098
8099 * config/announce-gen, Makefile.cfg: New.
8100 * Makefile.am: Adjust.
8101 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8102 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8103
8104 2003-08-25 Akim Demaille <akim@epita.fr>
8105
8106 When reducing initial empty rules, Bison parser read an initial
8107 location that is not defined. This results in garbage, and that
8108 affects Bison's own parser. Therefore we need (i) to extend Bison
8109 to support a means to initialize this location, and (ii) to use
8110 this CVS Bison to fix CVS Bison's parser.
8111
8112 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8113 with...
8114 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8115 * src/parse-gram.y: Adjust.
8116 (%initial-action): New.
8117 (%error-verbose): Since we require CVS Bison, there is no reason
8118 not to use it.
8119 * src/scan-gram.l: Adjust.
8120 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8121 * data/yacc.c (yyparse): Use b4_initial_action.
8122
8123 2003-08-25 Akim Demaille <akim@epita.fr>
8124
8125 * doc/bison.texinfo: Don't promote stdout for error messages.
8126
8127 2003-08-25 Akim Demaille <akim@epita.fr>
8128
8129 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8130 From Alexandre Duret-Lutz.
8131
8132 2003-08-25 Akim Demaille <akim@epita.fr>
8133
8134 Version 1.875c.
8135
8136 2003-08-25 Akim Demaille <akim@epita.fr>
8137
8138 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8139 Use them.
8140
8141 2003-08-25 Akim Demaille <akim@epita.fr>
8142
8143 * data/lalr1.cc (Parser::reduce_print_): New.
8144 Use it.
8145
8146 2003-08-25 Akim Demaille <akim@epita.fr>
8147
8148 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8149 error recovery loops. This patch is based on
8150 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
8151 Also, augment the similarity between lalr1.cc and yacc.c.
8152 Note: the locations of error recovery rules are not correct yet.
8153
8154 * data/lalr1.cc: Comment changes to augment the similarity between
8155 lalr1.cc and yacc.c.
8156 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8157 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8158 yyerrlab), when hitting EOF, pop the whole stack here instead of
8159 merely falling thru the default error handling mechanism.
8160 (yyerrorlab): New label, with the old contents of YYERROR,
8161 plus the following change: pop the stack of rhs corresponding
8162 to the production that invoked YYERROR. That is how Yacc
8163 behaves (required by POSIX).
8164 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8165 fail.
8166
8167 2003-08-25 Akim Demaille <akim@epita.fr>
8168
8169 Tune local.at so that people can "autom4te -l autotest calc.at -o
8170 calc" for instance, to extract a sub test suite.
8171
8172 * tests/testsuite.at: Move the initialization, Autotest version
8173 requirement, and AT_TESTED invocation into...
8174 * tests/local.at: here.
8175 * tests/testsuite.at: Include it for compatibility with Autoconf
8176 2.57.
8177 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8178 be ignore.
8179
8180 2003-08-04 Paul Eggert <eggert@twinsun.com>
8181
8182 Rework code slightly to avoid gcc -Wtraditional warnings.
8183 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8184 The returned value is now stored in *YY0. All callers changed.
8185 * src/output.c (merge_output): Adjust to the above change.
8186
8187 2003-07-26 Paul Eggert <eggert@twinsun.com>
8188
8189 * data/glr.c (YYASSERT): New macro.
8190 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8191 yyresolveStates, yyprocessOneStack):
8192 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8193 Derived from a suggestion by Frank Heckenbach.
8194
8195 2003-07-25 Paul Eggert <eggert@twinsun.com>
8196
8197 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8198 for portability to K&R C (after ansi2knr, presumably). See
8199 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
8200 by Frank Heckenbach, though I have omitted the structure-initialization
8201 part of his glr-knr.diff patch since I recall that the Portable
8202 C Compiler didn't require that change.
8203
8204 Let the user specify how to allocate and free memory.
8205 Derived from a suggestion by Frank Heckenbach in
8206 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
8207 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8208 All uses of free, malloc, realloc changed to use these macros,
8209 and unnecessary casts removed.
8210 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8211
8212 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8213
8214 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8215 use s.empty() rather than s == "" to test for empty string; see
8216 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
8217 (trivial change)
8218
8219 2003-06-25 Akim Demaille <akim@epita.fr>
8220
8221 * config/depcomp, config/install-sh: Update from masters.
8222
8223 2003-06-20 Paul Eggert <eggert@twinsun.com>
8224
8225 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8226 and return properly parenthesized result.
8227 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8228 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8229 Remove unnecessary parentheses from uses.
8230 * doc/bison.texinfo (Location Default Action): Describe the
8231 conventions for parentheses.
8232
8233 2003-06-19 Paul Eggert <eggert@twinsun.com>
8234
8235 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8236 yyreportTree): Do not assume that size_t is the same width as int,
8237 when printing sizes. Print sizes using an unsigned format.
8238 Problem reported by Frank Heckenbach in
8239 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
8240
8241 Port to Forte Developer 7 C compiler.
8242 * data/glr.c (struct YYLTYPE): If locations are not being used,
8243 declare a single dummy member, as empty structs do not conform
8244 to the C standard.
8245 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8246 the Forte Developer 7 C compiler complains that end-of-loop
8247 code is not reached.
8248
8249 2003-06-17 Paul Eggert <eggert@twinsun.com>
8250
8251 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8252 avoid warnings from picky compilers about redefinition of PARAMS.
8253
8254 2003-06-17 Paul Eggert <eggert@twinsun.com>
8255
8256 Version 1.875b.
8257
8258 * NEWS: Document 1.875b.
8259
8260 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8261 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8262 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8263 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8264 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8265 per recent gettext manual's suggestion.
8266 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8267 Use prototypes, not old-style definitions.
8268 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8269 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8270 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8271 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8272 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8273 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8274 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8275 vbitset_or_and_cmp, vbitset_copy): Likewise.
8276
8277 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8278 Do not include <stdlib.h>.
8279 (PARAMS): Define unconditionally for C89.
8280 (ATTRIBUTE_NORETURN): Remove.
8281 (ATTRIBUTE_UNUSED): Define unconditionally.
8282
8283 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
8284 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8285 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8286 * lib/vbitset.c, lib/vbitset.h: New files.
8287 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8288 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
8289 from libbitset.
8290
8291 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
8292 `How Can I Reset @code{yyparse}', since texinfo does not allow
8293 arbitrary @ in node names.
8294
8295 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
8296 shouldn't be needed according to the gettext 0.12.1 documentation
8297 but which seem to be needed anyway: codeset.m4 glibc21.m4
8298 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8299 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
8300 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
8301
8302 * lib/.cvsignore: Add stdbool.h.
8303 * m4/.cvsignore: Add nls.m4, po.m4.
8304
8305 Upgrade to CVS gnulib.
8306 * stdbool_.h: File renamed from stdbool.h.in.
8307 * configure.ac (AM_STDBOOL_H): Invoke this instead of
8308 AC_HEADER_STDBOOL.
8309 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
8310 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
8311 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
8312 (MOSTLYCLEANFILES): New var.
8313 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
8314 (stdbool.h): New rule.
8315 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
8316 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
8317 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
8318 m4/quote.m4: Upgrade to today's gnulib.
8319
8320 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
8321 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
8322 the tests right now.
8323 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
8324 yyerror are declared before use; C99 requires this.
8325
8326 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8327
8328 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
8329 first.
8330 (yyrecoverSyntaxError): Correct the logic for setting and testing
8331 yyerrState.
8332 Correct comment on handling EOF.
8333 Allow states with only a default reduction, rather than failing
8334 (I can't quite reconstruct why these were not allowed before).
8335
8336 Fixes to avoid problem that $-N rules in GLR parsers can cause
8337 buffer overruns, corrupting state.
8338
8339 * src/output.c (prepare_rules): Output max_left_semantic_context
8340 definition.
8341 * src/reader.h (max_left_semantic_context): New variable declaration.
8342 * src/scan-gram.l (max_left_semantic_context): Define.
8343 (handle_action_dollar): Update max_left_semantic_context.
8344 * data/glr.c (YYMAXLEFT): New definition.
8345 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
8346 (yyresolveAction): Ditto.
8347
8348 Fixes to problems with location handling in GLR parsers reported by
8349 Frank Heckenbach (2003/06/05).
8350
8351 * data/glr.c (YYLTYPE): Make trivial if locations not used.
8352 (YYRHSLOC): Add parentheses, and define only if locations used.
8353 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
8354 locations not used.
8355 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
8356 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8357
8358 * tests/cxx-type.at: Exercise location information; update tests
8359 to differentiate output with and without locations.
8360 Remove forward declarations of yylex and yyerror---caused errors
8361 because default YYLTYPE not yet defined.
8362 Change semantic actions to compute strings, rather than printing
8363 them directly (to test proper passing of semantics values). Change
8364 output to prefix notation and update test data and expected results.
8365 (yylex): Track locations.
8366 (stmtMerge): Return value rather than printing, and include arguments
8367 in value.
8368
8369 2003-06-03 Paul Eggert <eggert@twinsun.com>
8370
8371 Avoid warnings generated by GCC 2.95.4 when Bison is
8372 configured with --enable-gcc-warnings.
8373 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
8374 yy::]b4_parser_class_name[::translate_,
8375 yy::Stack::operator[] (unsigned),
8376 yy::Stack::operator[] (unsigned) const,
8377 yy::Slice::operator[] (unsigned),
8378 yy::Slice::operator[] (unsigned) const):
8379 Rename local vars to avoid warnings.
8380 * tests/glr-regression.at (Improper handling of embedded actions
8381 and $-N in GLR parsers): Remove unused local variable from yylex.
8382 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
8383 (void) as arg when not pure, since we now assume C89 when building
8384 Bison. Pacify GCC by using parameter.
8385
8386 2003-06-02 Paul Eggert <eggert@twinsun.com>
8387
8388 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
8389 yy::Location::lines, yy::Location::columns): Rename arguments
8390 to avoid shadowing; this removes a warning generated by GCC 3.3.
8391
8392 2003-06-01 Paul Eggert <eggert@twinsun.com>
8393
8394 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
8395 to g++, as GCC 3.3 complains if you do it.
8396 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
8397 everything that WARNING_CFLAGS has, except omit warnings
8398 not suitable for C++.
8399 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
8400 * tests/atlocal.in (CXXFLAGS): New var.
8401 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
8402
8403 Fix a GLR parser bug I reported in February; see
8404 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
8405 The problem was that GLR parsers did not conform to the C standard,
8406 because actions like { $1 = $2 + $3; } expanded to expressions
8407 that invoked YYFILL in separate subexpressions, and YYFILL assigned
8408 to a local variable. The C standard says that expressions
8409 like (var = f ()) + (var = f ()) have undefined behavior.
8410 Another problem was that GCC sometimes issues warnings that
8411 yyfill and its parameters are unused.
8412
8413 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
8414 as possibly unused.
8415 (yyfill): New function.
8416 (YYFILL): Use it.
8417 (yyuserAction): Change type of yynormal to bool, so that it matches
8418 the new yyfill signature. Mark it as possibly unused.
8419
8420
8421 Follow up on a bug I reported in February, where a Bison-generated
8422 parser can loop. Provide a test case and a fix for yacc.c. I
8423 don't have a fix for lalr1.cc or for glr.c, unfortunately.
8424 The original bug report is in:
8425 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
8426
8427 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
8428 macro's size was becoming unwieldy.
8429 (yyerrlab): Do not discard an empty lookahead symbol, as this
8430 might destroy garbage.
8431 (yyerrorlab): New label, with the old contents of YYERROR,
8432 plus the following change: pop the stack of rhs corresponding
8433 to the production that invoked YYERROR. That is how Yacc
8434 behaves, and POSIX requires this behavior.
8435 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
8436 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
8437 Define 'alarm' to do nothing if unistd.h is not available.
8438 Add a new rule "exp: '-' error;" to test the above change to
8439 data/yacc.c. Use 'alarm' to abort any test taking longer than
8440 10 seconds, as it's probably looping.
8441 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
8442 Also, the new yacc.c generates two fewer diagnostics for an
8443 existing test.
8444
8445 2003-05-24 Paul Eggert <eggert@twinsun.com>
8446
8447 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
8448 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
8449 This fixes a problem reported by John Bowman when the Compaq/HP
8450 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
8451 -ansi -Wall -gall).
8452 * data/yacc.c (union yyalloc): Likewise.
8453 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
8454
8455 Switch from 'int' to 'bool' where that makes sense.
8456
8457 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
8458 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
8459 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
8460 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
8461 Return or accept bool, not int. All callers changed.
8462 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
8463 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
8464 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
8465 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
8466 bitset_or_and_cmp_): Likewise.
8467 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
8468 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
8469 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
8470 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
8471 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
8472 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
8473 bitset_stats_or_and_cmp): Likewise.
8474 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
8475 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
8476 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
8477 ebitset_xor_cmp): Likewise.
8478 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
8479 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
8480 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
8481 lbitset_xor_cmp): Likewise.
8482 * lib/bbitset.h: Include <stdbool.h>.
8483 (struct bitset_vtable): The following members now return bool, not
8484 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
8485 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
8486 or_and_cmp).
8487 * src/conflicts.c (count_rr_conflicts): Likewise.
8488 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
8489 All uses changed.
8490 * lib/ebitset.c (ebitset_obstack_init): Likewise.
8491 * lib/lbitset.c (lbitset_obstack_init): Likewise.
8492 * src/getargs.c (debug_flag, defines_flag, locations_flag,
8493 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8494 graph_flag): Likewise.
8495 * src/getargs.h (debug_flag, defines_flag, locations_flag,
8496 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8497 graph_flag): Likewise.
8498 * src/output.c (error_verbose): Likewise.
8499 * src/output.h (error_verbose): Likewise.
8500 * src/reader.c (start_flag, typed): Likewise.
8501 * src/reader.h (typed): Likewise.
8502 * src/getargs.c (LOCATIONS_OPTION): New constant.
8503 (long_options, getargs): Use it.
8504 * src/lalr.c (build_relations): Use bool, not int.
8505 * src/nullable.c (nullable_compute): Likewise.
8506 * src/print.c (print_reductions): Likewise.
8507 * src/tables.c (action_row, pack_vector): Likewise.
8508 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
8509 * src/output.c (prepare): Use it.
8510 * src/output.c (token_definitions_output,
8511 symbol_destructors_output, symbol_destructors_output): Use string,
8512 not boolean integer, to keep track of whether to output separator.
8513 * src/print_graph.c (print_core): Likewise.
8514 * src/state.c (state_rule_lookaheads_print): Likewise.
8515
8516 * config/install-sh: Sync from automake 1.7.5.
8517
8518 2003-05-14 Paul Eggert <eggert@twinsun.com>
8519
8520 * src/parse-gram.y (rules_or_grammar_declaration): Require a
8521 semicolon after a grammar declaration, in the interest of possible
8522 future changes to the Bison input language.
8523 Do not allow a stray semicolon at the start of the grammar.
8524 (rhses.1): Allow one or more semicolons after any rule, including
8525 just before "|" as required by POSIX.
8526 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
8527 grammar.
8528
8529 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
8530
8531 %parse-param support for lalr1.cc.
8532
8533 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
8534 b4_cc_constructor_calls, b4_cc_constructor_call,
8535 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
8536 definitions.
8537 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
8538 parse-param arguments.
8539 (yy::b4_parser_class_name): Declare instance variables to
8540 hold parse-param arguments.
8541 * tests/calc.at: s/value/semantic_value/ because value clashes
8542 with a member of yy::b4_parser_class_name. Adjust C++ code
8543 to handle %parse-param. Enable %parse-param test in C++.
8544
8545 2003-05-12 Paul Eggert <eggert@twinsun.com>
8546
8547 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
8548 English a bit. Fix fclose typo. Change "const char" to "char
8549 const", and use ANSI C rather than K&R for "main". Suggest
8550 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
8551 and suggest yy_switch_to_buffer.
8552
8553 2003-05-05 Paul Eggert <eggert@twinsun.com>
8554
8555 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
8556 C89. This avoids a diagnostic on compilers that define __STDC__
8557 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
8558 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
8559
8560 2003-05-03 Paul Eggert <eggert@twinsun.com>
8561
8562 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
8563 Do not overrun array bounds.
8564 This should fix a bug reported today by Olatunji Oluwabukunmi in
8565 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
8566
8567 2003-04-29 Akim Demaille <akim@epita.fr>
8568
8569 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
8570 * src/getargs.c, src/getargs.h: here, as bool, not int.
8571 (nondeterministic_parser): New.
8572 * src/parse-gram.y, src/scan-gram.l: Support
8573 %nondeterministic-parser.
8574 * src/output.c (prepare): Use nondeterministic_parser instead
8575 of glr_parser where appropriate.
8576 * src/tables.c (conflict_row, action_row, save_row)
8577 (token_actions, token_actions, pack_vector): Ditto.
8578
8579 2003-04-29 Akim Demaille <akim@epita.fr>
8580
8581 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
8582
8583 2003-04-29 Akim Demaille <akim@epita.fr>
8584
8585 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
8586 with %pure-parser and %locations to exercise the patch from Yakov
8587 Markovitch below.
8588
8589 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
8590
8591 * data/yacc.c: (b4_lex_param): Corrected for the case where
8592 %lex-param is provided and %pure-parser isn't.
8593
8594 2003-04-27 Paul Eggert <eggert@twinsun.com>
8595
8596 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
8597 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
8598 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
8599 if it is not defined.
8600 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
8601
8602 2003-04-26 Paul Eggert <eggert@twinsun.com>
8603
8604 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
8605 Declare to be of type suitable for the ninf value itself, not of
8606 type suitable for the corresponding table, since the latter might
8607 be unsigned but the ninf value might be negative. This fixes a
8608 bug reported by Alexandre Duret-Lutz in
8609 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
8610
8611 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
8612 invokes it. We shouldn't invoke it twice because it will attempt
8613 to put error.o in the archive twice. This fixes a glitch reported
8614 by Martin Mokrejs in
8615 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
8616
8617 2003-04-21 Paul Eggert <eggert@twinsun.com>
8618
8619 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
8620 to gnulib.
8621
8622 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
8623
8624 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
8625 Fix obvious typo that results in uncompilable GLR parsers
8626 when both %pure-parser and %locations are used. (trivial change)
8627
8628 2003-04-17 Paul Eggert <eggert@twinsun.com>
8629
8630 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
8631 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
8632 Do not insert the expected token via unput, as this runs afoul
8633 of a POSIX-compatibility bug in flex 2.5.31.
8634 All uses changed to BEGIN the parent state,
8635 since we no longer insert the expected token via unput.
8636 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
8637 that is no longer emitted after the above change.
8638
8639 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
8640 the first one. This change is from Paul Hilfinger, and it fixes
8641 regression reported by Werner Lemberg in
8642 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
8643
8644 (resolve_sr_conflict): Don't invoke state_errs_set
8645 unless one or more tokens have been explicitly made errors.
8646 Otherwise, the above change causes Bison to abort.
8647
8648 * tests/existing.at (GNU pic Grammar): New test case, taken from
8649 Lemberg's email.
8650
8651 2003-03-31 Akim Demaille <akim@epita.fr>
8652
8653 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
8654
8655 2003-03-31 Akim Demaille <akim@epita.fr>
8656
8657 * src/output.c (prepare_symbols): Avoid trailing spaces in the
8658 output.
8659
8660 2003-03-31 Akim Demaille <akim@epita.fr>
8661
8662 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
8663 From Paul Hilfinger.
8664
8665 2003-03-29 Akim Demaille <akim@epita.fr>
8666
8667 * m4/error.m4: Do not put under dynamic conditions some code which
8668 expansion is under static control.
8669
8670 2003-03-29 Akim Demaille <akim@epita.fr>
8671
8672 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
8673
8674 2003-03-29 Akim Demaille <akim@epita.fr>
8675
8676 * doc/bison.texinfo (Strings are Destroyed): New.
8677
8678 2003-03-13 Paul Eggert <eggert@twinsun.com>
8679
8680 * .cvsignore: Add configure.lineno.
8681 * src/.cvsignore: Add yacc.
8682 * tests/.cvsignore: Add testsuite.log.
8683 * doc/fdl.texi: Sync with latest FSF version.
8684
8685 2003-03-12 Paul Eggert <eggert@twinsun.com>
8686
8687 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
8688 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
8689 cursor, instead of leaving it undefined. This fixes a bug
8690 reported by Tim Van Holder in
8691 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
8692 * tests/input.at (Torturing the Scanner): Test the scanner on
8693 an empty input file, which was Tim Van Holder's test case.
8694
8695 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
8696 <sys/resource.h> can be included, include sys/time.h and
8697 sys/times.h first, if available. This works around the SunOS
8698 4.1.4 porting bug reported by Bruce Becker in
8699 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
8700
8701 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
8702 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
8703 AC_HEADER_SYS_WAIT.
8704
8705 Merge changes from gnulib. This was prompted because the CVS
8706 snapshot didn't build on Solaris 7 due to strnlen problems.
8707
8708 These changes need to be merged back into gnulib:
8709 * lib/hash.c: Include <stdbool.h> unconditionally.
8710 * m4/onceonly.m4 (m4_quote): New macro.
8711 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
8712 Quote AC_FOREACH variable-expansions properly.
8713 The 2003-01-03 obstack.h change also needs merging.
8714 {end of changes requiring merging}
8715
8716 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8717 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
8718 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
8719 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
8720 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
8721 New files, imported from gnulib.
8722 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
8723 above.
8724
8725 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
8726 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
8727 gnulib sources.
8728
8729 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
8730 Add.
8731 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
8732 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
8733 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
8734 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
8735 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
8736 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
8737 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
8738 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
8739 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
8740 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
8741 (jm_PREREQ_ARGMATCH): Remove.
8742 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
8743 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
8744
8745 * src/system.h: Include <stdbool.h> unconditionally.
8746
8747 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
8748 assuming at least C89 in the bitset code for some time now.
8749
8750 2003-03-03 Akim Demaille <akim@epita.fr>
8751
8752 * ro.po: New.
8753
8754 2003-03-02 Akim Demaille <akim@epita.fr>
8755
8756 * doc/bison.texinfo (Table of Symbols): Reactivate the
8757 documentation for %lex-param, and %parse-param.
8758
8759 2003-03-02 Akim Demaille <akim@epita.fr>
8760
8761 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
8762 generate verbose error messages.
8763 Use the number of tokens as an upper bound in yytname, as it
8764 cannot be a non terminal.
8765
8766 2003-03-02 Akim Demaille <akim@epita.fr>
8767
8768 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
8769 message.
8770
8771 2003-03-02 Akim Demaille <akim@epita.fr>
8772
8773 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
8774 Use them to exercise yycheck overrun.
8775 Based on Andrew Suffield's grammar.
8776
8777 2003-03-02 Akim Demaille <akim@epita.fr>
8778
8779 Create tests/local.at for Bison generic testing macros.
8780
8781 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
8782 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
8783 This new file.
8784 * tests/calc.at (AT_CHECK_CALC): Adjust.
8785 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
8786 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
8787 * tests/local.at: here.
8788 (AT_COMPILE_CXX): Tags the tests using it as c++.
8789 Ignore the test if CXX is not functional.
8790
8791 2003-03-01 Paul Eggert <eggert@twinsun.com>
8792
8793 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
8794 not loc->end, since loc->end might contain garbage and this leads
8795 to undefined behavior on some platforms.
8796 (id_loc, token_start): Use (IF_LINTed) initial values that do not
8797 depend on *loc, so that the reader doesn't give the the false
8798 impression that *loc is initialized.
8799 (<INITIAL>"%%"): Do not bother setting code_start, since its value
8800 does not survive the return.
8801
8802 2003-03-01 Akim Demaille <akim@epita.fr>
8803
8804 * src/scan-gram.l (code_start): Always initialize it when entering
8805 into yylex, as SC_EPILOGUE is activated *before* the corresponding
8806 yylex invocation. An alternative would be making it static, but
8807 then it starts with the second %%'s beginning, instead of its end.
8808
8809 2003-02-28 Paul Eggert <eggert@twinsun.com>
8810
8811 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
8812 around a UnixWare 7.1.1 porting bug reported by John Hughes in
8813 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
8814
8815 2003-02-26 Paul Eggert <eggert@twinsun.com>
8816
8817 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
8818 Remove Sequent/Pyramid discussion (nobody uses them any more).
8819 Merge VMS and MS-DOS discussion; these ports may well be dead
8820 but let's keep mentioning them for now. Put <> around email
8821 addresses. Add copyright notice.
8822
8823 2003-02-24 Paul Eggert <eggert@twinsun.com>
8824
8825 * data/glr.c (yy_reduce_print): yylineno -> yylno,
8826 to avoid collision with flex use of yylineno.
8827 Problem reported by Bruce Lilly in
8828 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
8829 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8830 * data/yacc.c (yy_reduce_print): Likewise.
8831
8832 * config/depcomp: Sync with Automake 1.7.3.
8833
8834 2003-02-21 Akim Demaille <akim@epita.fr>
8835
8836 * data/lalr1.cc: Use temporary variables instead of casts to
8837 change integer types.
8838 Suggested by Paul Eggert.
8839
8840 2003-02-21 Akim Demaille <akim@epita.fr>
8841
8842 * doc/bison.texinfo: Use "location" consistently to refer to @n,
8843 to avoid confusions with lalr1.cc's notion of Position.
8844 Suggested by Paul Eggert.
8845
8846 2003-02-20 Akim Demaille <akim@epita.fr>
8847
8848 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
8849 before initial_columns.
8850 (location.hh): Use consistent variable names when defining the
8851 operator<<.
8852 Use "last" so that we subtract from Positions, not from unsigned.
8853
8854 2003-02-20 Akim Demaille <akim@epita.fr>
8855
8856 * data/lalr1.cc (position.hh): New subfile, including the extended
8857 and Doxygen'ed documentation of class Position.
8858 (location.hh): Use it.
8859 Document a` la Doxygen.
8860 With the help of Benoit Perrot.
8861
8862 2003-02-20 Akim Demaille <akim@epita.fr>
8863
8864 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
8865 AT_YACC_IF.
8866 Redefine AT_YYERROR_SEES_LOC_IF using it.
8867 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
8868 not defined.
8869 Don't use the location in yy::Parser::error_ and
8870 yy::Parser::print_ when not %locations.
8871 Activate more lalr1.cc tests.
8872
8873 2003-02-19 Akim Demaille <akim@epita.fr>
8874
8875 * data/lalr1.cc: When displaying a line number, be sure to make it
8876 an int.
8877
8878 2003-02-19 Akim Demaille <akim@epita.fr>
8879
8880 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
8881 Remove, useless.
8882 (YYABORT, YYACCEPT, YYERROR): New.
8883 * tests/calc.at: Renable the lalr1.cc test.
8884
8885 2003-02-19 Akim Demaille <akim@epita.fr>
8886
8887 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
8888 error recovery, mixing with/without pops and discarding of the
8889 lookahead.
8890 Exercise YYERROR.
8891 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
8892
8893 2003-02-17 Paul Eggert <eggert@twinsun.com>
8894
8895 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
8896 * tests/testsuite.at (AT_COMPILE): Use them.
8897 This fixes the testsuite problem reported by Robert Lentz in
8898 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
8899
8900 2003-02-12 Paul Eggert <eggert@twinsun.com>
8901
8902 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
8903 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
8904 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
8905 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
8906 Check for malloc failure, for consistency with yacc.c.
8907 (yytname_size): Remove, for consistency with yacc.c.
8908
8909 The bug still remains in data/lalr1.cc, as I didn't have time
8910 to fix it there.
8911
8912 2003-02-06 Akim Demaille <akim@epita.fr>
8913
8914 * configure.ac (GXX): Rename as...
8915 (CXX): this, to keep the original Autoconf semantics.
8916 Require 2.57.
8917 * data/lalr1.cc: Fix b4_copyright invocations.
8918 If YYDEBUG is not defined, don't depend upon name_ being defined.
8919 (location.hh): Include string and iostream.
8920 (Position::filename): New member.
8921 (Position::Position ()): New.
8922 (operator<< (Position)): New.
8923 (operator- (Position, int)): New.
8924 (Location::first, Location::last): Rename as...
8925 (Location::begin, Location::end): these, to mock the conventional
8926 iterator names.
8927 (operator<< (Location)): New.
8928 * tests/atlocal.in (CXX): New.
8929 * tests/testsuite.at (AT_COMPILE_CXX): New.
8930 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
8931 locations in a more synthetic way.
8932 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
8933 lalr1.cc is used.
8934 Adjust the C locations to match those from Emacs: first column is
8935 column 0.
8936 Change all the expected results.
8937 Conform to the GCS: simplify the locations when applicable.
8938 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
8939 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
8940 these CPP macros with the m4 macros new defined by...
8941 (AT_CHECK_PUSHDEFS): this, i.e.:
8942 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
8943 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
8944 New macros.
8945 (AT_CHECK_POPDEFS): Undefine them.
8946 (AT_CHECK_CALC_LALR1_CC): New.
8947 Use it for the first lalr1.cc test.
8948
8949 2003-02-04 Akim Demaille <akim@epita.fr>
8950
8951 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
8952 Location as is defined.
8953
8954 2003-02-04 Akim Demaille <akim@epita.fr>
8955
8956 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
8957 name_ being defined.
8958
8959 2003-02-03 Paul Eggert <eggert@twinsun.com>
8960
8961 * src/gram.h (start_symbol): Remove unused decl.
8962
8963 Use more-consistent naming conventions for local vars.
8964
8965 * src/derives.c (derives_compute): Change type of local var from
8966 int to rule_number.
8967 * src/gram.c (grammar_rules_partial_print): Likewise.
8968 * src/print.c (print_core): Likewise.
8969 * src/reduce.c (reduce_grammar_tables): Likewise.
8970
8971 * src/gram.c (grammar_dump): Change name of item_number *
8972 local var from r to rp.
8973 * src/nullable.c (nullable_compute): Likewise.
8974
8975 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
8976
8977 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
8978 for symbol or symbol_number var.
8979 * src/reader.c (grammar_start_symbol_set): Likewise.
8980 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
8981 Likewise.
8982 * src/state.c (transitions_to): Likewise.
8983 * src/state.h: Likewise.
8984 * src/tables.c (symbol_number_to_vector_number): Likewise.
8985
8986 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
8987 char * var.
8988
8989 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
8990 var.
8991
8992 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
8993 var.
8994
8995 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
8996 Use str, not s, for char * var. Use ch, not c, for character var.
8997 Use size for size var.
8998
8999 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9000 char * var.
9001 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9002 uniqstr var.
9003 * src/uniqstr.h: Likewise.
9004
9005 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9006 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9007 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9008 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9009 param to have same name as that of enum, so that we don't use
9010 "s" to stand for a non-state.
9011
9012 2003-02-02 Akim Demaille <akim@epita.fr>
9013
9014 * src/scan-skel.l: Scan more than one inert character per yylex
9015 invocation.
9016
9017 2003-02-01 Paul Eggert <eggert@twinsun.com>
9018
9019 Version 1.875a.
9020
9021 * po/LINGUAS: Add ms.
9022
9023 2003-01-30 Akim Demaille <akim@epita.fr>
9024
9025 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9026
9027 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9028
9029 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9030 of $1.
9031
9032 Changes in response to error report by S. Eken: GLR mode does not
9033 handle negative $ indices or $ indices in embedded rules correctly.
9034 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
9035
9036 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9037 (b4_rhs_location): Ditto.
9038 (yyfill): New function to copy from stack tree into array
9039 incrementally.
9040 (yyuserAction): Modify to allow incremental move of semantic values
9041 to rhs array when in GLR mode.
9042 Define YYFILL to use in user-defined actions to fill semantic array
9043 as needed.
9044 Remove dummy use of yystack, as there is now a guaranteed use.
9045 (yydoAction): Modify to allow incremental move of semantic values
9046 to rhs array when in GLR mode.
9047 (yyresolveAction): Ditto.
9048 (yyglrShiftDefer): Update comment.
9049 (yyresolveStates): Use X == NULL for pointers, not !X.
9050 (yyglrReduce): Ditto.
9051 (yydoAction): Ditto
9052
9053 * tests/glr-regr1.at: Rename to ...
9054 * tests/glr-regression.at: Add new regression test for the problems
9055 described above (adapted from S. Eken).
9056 Update copyright notice.
9057 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9058 * tests/Makefile.am: Ditto.
9059
9060 2003-01-28 Paul Eggert <eggert@twinsun.com>
9061
9062 * data/lalr1.cc: Do not use @output_header_name@ unless
9063 b4_defines_flag is set. This fixes two bugs reported by
9064 Tim Van Holder in
9065 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9066 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
9067
9068 2003-01-21 Paul Eggert <eggert@twinsun.com>
9069
9070 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9071 we don't need to worry about yyerrlab1 being reported as an
9072 "unused label" by non-GCC C compilers. The downside is that if
9073 locations are used then a couple of statements are duplicated each
9074 time YYERROR is invoked, but the upside is that the warnings
9075 should vanish.
9076 (yyerrlab1): Move code to YERROR.
9077 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9078 This reverts some of the 2002-12-27 change.
9079
9080 2003-01-17 Paul Eggert <eggert@twinsun.com>
9081
9082 * src/output.c (symbol_printers_output): Fix typo that led
9083 to core dump. Problem reported by Antonio Rus in
9084 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
9085
9086 2003-01-13 Akim Demaille <akim@epita.fr>,
9087 Quoc Peyrot <chojin@lrde.epita.fr>,
9088 Robert Anisko <anisko_r@lrde.epita.fr>
9089
9090 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9091 when the stacks contain one element, as the loop would otherwise
9092 free the last state, and then use the top state (the one we just
9093 popped). This means that the initial elements will not be freed
9094 explicitly, as is the case in yacc.c; it is not a problem, as
9095 these elements have fake values.
9096
9097 2003-01-11 Paul Eggert <eggert@twinsun.com>
9098
9099 * NEWS: %expect-violations are now just warnings, reverting
9100 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9101 bootstrapping problem reported by Matthias Klose; see
9102 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
9103 * src/conflicts.c (conflicts_print): Likewise.
9104 * tests/conflicts.at (%expect not enough, %expect too much,
9105 %expect with reduce conflicts): Likewise.
9106 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9107 that the warning is enabled if the number of conflicts changes
9108 (not necessarily increases).
9109
9110 * src/getargs.c (version): Update copyright year.
9111
9112 2003-01-09 Akim Demaille <akim@epita.fr>
9113
9114 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9115
9116 2003-01-08 Paul Eggert <eggert@twinsun.com>
9117
9118 * Makefile.maint (WGETFLAGS):
9119 New macro, containing "-C off" to disable proxy caches.
9120 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9121 (rel-check): Use $(WGET) instead of wget.
9122
9123 2003-01-06 Paul Eggert <eggert@twinsun.com>
9124
9125 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9126 the GLR paper of Scott, Johnstone and Hussain.
9127
9128 2003-01-04 Paul Eggert <eggert@twinsun.com>
9129
9130 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9131 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9132 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9133 (EXTRA_LIBRARIES): New var, for liby.a.
9134 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9135 (EXTRA_SCRIPTS): New var, for yacc.
9136
9137 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9138 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9139 Problem reported by Nelson H. F. Beebe.
9140
9141 2003-01-03 Paul Eggert <eggert@twinsun.com>
9142
9143 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9144 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9145 when compiling Bison 1.875's `bitset bset = obstack_alloc
9146 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9147
9148 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9149 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9150 grow to a huge size with typical invocation.
9151
9152 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9153 Use the pattern recommended by Autoconf 2.57, except also protect
9154 against double-definition.
9155 * src/system.h: Likewise.
9156 Portability issues reported by Nelson H. F. Beebe.
9157
9158 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9159 All uses changed. Provide a definition in both C and C++.
9160 (yytrue, yyfalse): Define even if defined (__cplusplus).
9161
9162 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9163 Reported by Nelson H. F. Beebe.
9164
9165 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9166
9167 2003-01-02 Paul Eggert <eggert@twinsun.com>
9168
9169 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9170 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9171 Bug reported by Nelson H. F. Beebe.
9172
9173 2003-01-01 Paul Eggert <eggert@twinsun.com>
9174
9175 * Version 1.875.
9176
9177 2002-12-30 Paul Eggert <eggert@twinsun.com>
9178
9179 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9180 Moved here from...
9181 (<INITIAL>","): Here. This causes stray "," to be treated
9182 more uniformly.
9183
9184 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
9185 last brace in braced code when not in Yacc mode, for compatibility
9186 with Bison 1.35. This resurrects the 2001-12-15 patch to
9187 src/reader.c.
9188
9189 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9190 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9191
9192 2002-12-28 Paul Eggert <eggert@twinsun.com>
9193
9194 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9195 that of SYM's type. This fixes Debian bug 168069, reported by
9196 Thomas Olsson.
9197
9198 2002-12-28 Paul Eggert <eggert@twinsun.com>
9199
9200 Version 1.75f.
9201
9202 Switch back to the Yacc style of conflict reports, undoing some
9203 of the 2002-07-30 change.
9204 * doc/bison.texinfo (Understanding): Use Yacc style for
9205 conflict reports. Also, use new way of locating rules.
9206 * src/conflicts.c (conflict_report):
9207 Renamed from conflict_report_yacc, removing the old
9208 'conflict_report'. Translate the entire conflict report at once,
9209 so that we don't assume that "," has the same interpretation in
9210 all languages.
9211 (conflicts_output): Use Yacc-style conflict report for each state,
9212 instead of our more-complicated style.
9213 (conflicts_print): Use Yacc-style conflict report, except print
9214 the input file name when not emulating Yacc.
9215 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9216 Conflicted Reduction, %expect not enough, %expect too much,
9217 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9218 * tests/existing.at (GNU Cim Grammar): Likewise.
9219 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9220
9221 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9222 fatal): Don't invoke fflush; it's not needed and it might even be
9223 harmful for stdout, as stdout might not be open.
9224 * src/reduce.c (reduce_print): Likewise.
9225
9226 2002-12-27 Paul Eggert <eggert@twinsun.com>
9227
9228 Fix a bug where error locations were not being recorded correctly.
9229 This problem was originally reported by Paul Hilfinger in
9230 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
9231
9232 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9233 top of the location stack's error locations.
9234 (yyerrlab): Set it. When discarding a token, push its location
9235 onto yylerrsp so that we don't lose track of the error's end.
9236 (yyerrlab1): Now is only the target of YYERROR, so that we can
9237 properly record the location of the action that failed. For GCC
9238 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9239 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9240 (yyerrlab2): New label, which yyerrlab now falls through to.
9241 Compute the error's location by applying YYLLOC_DEFAULT to
9242 the locations of all the symbols that went into the error.
9243 * doc/bison.texinfo (Location Default Action): Mention that
9244 YYLLOC_DEFAULT is also invoked for syntax errors.
9245 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9246 Error locations include the locations of all the tokens that were
9247 discarded, not just the last token.
9248
9249 2002-12-26 Paul Eggert <eggert@twinsun.com>
9250
9251 * src/files.c: Include quote.h.
9252 (compute_output_file_names): Warn if we detect conflicting
9253 outputs to the same file. This should catch the misunderstanding
9254 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9255
9256 * src/conflicts.c (conflicts_print): If the user specifies
9257 "%expect N", report an error if there are any reduce/reduce
9258 conflicts. This is what the manual says should happen.
9259 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9260 * tests/conflicts.at (%expect with reduce conflicts): New test.
9261
9262 Don't use m4_include on relative file names, as it doesn't work as
9263 desired if there happens to be a file with that name under ".".
9264
9265 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9266 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9267 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9268 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9269 * src/output.c (output_skeleton): Use full path names when
9270 specifying a file to include; don't rely on include path, as
9271 it's unreliable when the working file contains a file with
9272 that name.
9273
9274 2002-12-25 Paul Eggert <eggert@twinsun.com>
9275
9276 Remove obsolete references to bison.simple and bison.hairy.
9277 Problem mentioned by Aubin Mahe in
9278 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
9279 * data/glr.c: Comment fix.
9280 * doc/bison.1: Remove references. Also, mention "yacc".
9281
9282 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9283 with -g option.
9284
9285 * src/parse-gram.y (declaration): Use enum "report_states" rather
9286 than its numeric value 1.
9287
9288 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
9289 opening a new one. This fixes Debian bug 165349, reported by
9290 Bruce Stephens.
9291
9292 2002-12-24 Paul Eggert <eggert@twinsun.com>
9293
9294 Version 1.75e.
9295
9296 * Makefile.maint (cvs-update): Don't assume that the shell
9297 supports $(...), as Solaris sh doesn't.
9298
9299 * src/parse-gram.y (lloc_default): Remove test for empty
9300 nonterminals at the end, since it didn't change the result.
9301
9302 2002-12-24 Paul Eggert <eggert@twinsun.com>
9303
9304 If the user does not define YYSTYPE as a macro, Bison now declares it
9305 using typedef instead of defining it as a macro. POSIX requires this.
9306 For consistency, YYLTYPE is also declared instead of defined.
9307
9308 %union directives can now have a tag before the `{', e.g., the
9309 directive `%union foo {...}' now generates the C code
9310 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
9311 The default union tag is `YYSTYPE', for compatibility with Solaris 9
9312 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
9313 instead of `yyltype'.
9314
9315 `yystype' and `yyltype' are now obsolescent macros instead of being
9316 typedefs or tags; they are no longer documented and will be
9317 withdrawn in a future release.
9318
9319 * data/glr.c (b4_location_type): Remove.
9320 (YYSTYPE): Renamed from yystype.
9321 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
9322 (struct YYLTYPE): Renamed from struct yyltype.
9323 (YYLTYPE): Renamed from yyltype.
9324 (yyltype, yystype): New (and obsolescent) macros,
9325 for backward compatibility.
9326 * data/yacc.c: Likewise.
9327
9328 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
9329 does not specify a union tag. This is for compatibility with
9330 Solaris 9 yacc.
9331
9332 * src/parse-gram.y (add_param): 2nd arg is now char * not char
9333 const *, since it is now modified by stripping surrounding { }.
9334 (current_braced_code): Remove.
9335 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
9336 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
9337 trailing " {...}". Now of type <chars>.
9338 (grammar_declaration): Adjust to bundled tokens.
9339 (code_content): Remove; stripping is now done by add_param.
9340 (print_token_value): Print contents of bundled tokens.
9341 (token_name): New function.
9342
9343 * src/reader.h (braced_code, current_braced_code): Remove.
9344 (token_name): New decl.
9345
9346 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
9347 token_type, not braced_code code_kind. All uses changed.
9348 (SC_PRE_CODE): New state, for scanning after a keyword that
9349 has (or usually has) an immediately-following braced code.
9350 (token_type): New local var, to keep track of which token type
9351 to return when scanning braced code.
9352 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
9353 <INITIAL>"%parse-param", <INITIAL>"%printer",
9354 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
9355 instead of returning a token type immediately.
9356 (<INITIAL>"{"): Set token type.
9357 (<SC_BRACED_CODE>"}"): Use it.
9358 (handle_action_dollar, handle_action_at): Now returns bool
9359 indicating success. Fail if ! current_rule; this prevents a core dump.
9360 (handle_symbol_code_dollar, handle_symbol_code_at):
9361 Remove; merge body into caller.
9362 (handle_dollar, handle_at): Complain in invalid contexts.
9363
9364 * NEWS, doc/bison.texinfo: Document the above.
9365 * NEWS: Fix years and program names in copyright notice.
9366
9367 2002-12-17 Paul Eggert <eggert@twinsun.com>
9368
9369 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
9370 Reporting, Table of Symbols): Omit mentions of %lex-param and
9371 %parse-param from the documentation for now.
9372
9373 2002-12-15 Paul Eggert <eggert@twinsun.com>
9374
9375 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
9376 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
9377 lookahead symbol, and which sets yychar in parser actions) and it
9378 disagreed with the Bison documentation. Bug
9379 reported by Andrew Walrond.
9380
9381 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
9382 as the caller now does that.
9383 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
9384 (YYEMPTY): Parenthesize right hand side, since others use it.
9385 (yyparse): Don't assume that our generated code is the only code
9386 that sets yychar.
9387
9388 2002-12-13 Paul Eggert <eggert@twinsun.com>
9389
9390 Version 1.75d.
9391
9392 POSIX requires a "yacc" command.
9393 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
9394 (MOSTLYCLEANFILES): Add yacc.
9395 (yacc): New rule.
9396 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
9397 as an alias for bison y.
9398
9399 * po/LINGUAS: Add da.
9400
9401 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
9402 problem with latest <getopt.h>.
9403 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
9404
9405 * doc/fdl.texi: Upgrade to 1.2.
9406 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
9407 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
9408 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
9409 gnulib.
9410 * config/install-sh: Sync with autotools.
9411
9412 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
9413 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
9414 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
9415 locations are requested.
9416 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
9417 locations are requested.
9418
9419 2002-12-12 Paul Eggert <eggert@twinsun.com>
9420
9421 Remove unportable casts and storage allocation tricks.
9422 While we're at it, remove almost all casts, since they
9423 usually aren't needed and are a sign of trouble.
9424
9425 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
9426
9427 * src/derives.c (derives_compute): Do not subtract NTOKENS from
9428 the pointer DSET returned by malloc; this isn't portable.
9429 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
9430 Similarly for DERIVES.
9431 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
9432 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
9433 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
9434
9435 * src/derives.c (derives_compute): Do not bother invoking
9436 int_of_rule_number, since rule numbers are integers.
9437
9438 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
9439 rather than XMALLOC (char, N).
9440
9441 * src/files.c (filename_split): Rewrite to avoid cast.
9442
9443 * src/gram.h (symbol_number_as_item_number,
9444 item_number_as_symbol_number, rule_number_as_item_number,
9445 item_number_as_rule_number):
9446 Now inline functions rather than macros, to avoid casts.
9447 * src/state.h (state_number_as_int): Likewise.
9448 * src/tables.c (state_number_to_vector_number,
9449 symbol_number_to_vector_number): Likewise.
9450
9451 * src/gram.h (int_of_rule_number): Remove; no longer used.
9452
9453 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
9454 since the resulting storage is always stored into.
9455
9456 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
9457 where it's needed.
9458
9459 * src/muscle_tab.c (muscle_m4_output):
9460 Now inline. Return bool, not int.
9461 * src/state.c (state_compare): Likewise.
9462 * src/symtab.c (symbol_check_defined,
9463 symbol_check_alias_consistency, symbol_pack, symbol_translation,
9464 hash_compare_symbol, hash_symbol):
9465 Likewise.
9466 * src/uniqstr.c (uniqstr_print): Likewise.
9467 * src/muscle_tab.c (muscle_m4_output_processor):
9468 New function, to avoid casts.
9469 * src/state.c (state_comparator, stage_hasher): Likewise.
9470 * src/symtab.c (symbol_check_defined_processor,
9471 symbol_check_alias_consistency_processor, symbol_pack_processor,
9472 symbol_translation_processor, hash_symbol_comparator,
9473 hash_symbol_hasher): Likewise.
9474 * src/uniqstr.c (uniqstr_print_processor): Likewise.
9475 * src/muscle_tab.c (muscles_m4_output):
9476 Use new functions instead of casting old functions unportably.
9477 * src/state.c (state_hash_new): Likewise.
9478 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
9479 symbols_token_translations_init):
9480 Likewise.
9481 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
9482
9483 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
9484 var instead of casting to long, to avoid casts.
9485 (prepare_states): Use MALLOC rather than alloca, so that we don't
9486 have to worry about alloca.
9487 * src/state.c (state_hash_lookup): Likewise.
9488
9489 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
9490 local var instead of casting to unsigned char, to avoid casts.
9491
9492 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
9493 STATE_ALLOC): Remove.
9494 (transitions_new, errs_new, reductions_new, state_new): Use malloc
9495 rather than calloc, and use offsetof to avoid allocating slightly
9496 too much storage.
9497 (state_new): Initialize all members.
9498
9499 * src/state.c (state_hash): Use unsigned accumulator, not signed.
9500
9501 * src/symtab.c (symbol_free): Remove; unused.
9502 (symbol_get): Remove cast in lhs of assignment.
9503 (symbols_do): Now static. Accept generic arguments, not
9504 hashing-related ones.
9505
9506 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
9507 (symbol_processor): Remove.
9508 (symbols_do): Remove decl; now static.
9509
9510 * src/system.h (alloca): Remove; decl no longer needed.
9511 (<stddef.h>): Include, for offsetof.
9512 (<inttypes.>, <stdint.h>): Include if available.
9513 (uintptr_t): New type, if system lacks it.
9514 (CALLOC, MALLOC, REALLOC): New macros.
9515 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
9516 new macros.
9517
9518 * src/tables.c (table_size): Now int, to pacify GCC.
9519 (table_grow, table_ninf_remap): Use signed table size.
9520 (save_row): Don't bother initializing locals when not needed.
9521 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
9522 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
9523
9524 * src/vcg.h: Correct misspellings.
9525
9526 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
9527
9528
9529 * src/getargs.c (getargs): Don't assume EOF == -1.
9530
9531 2002-12-09 Paul Eggert <eggert@twinsun.com>
9532
9533 Change identifier spellings to avoid collisions with names
9534 that are reserved by POSIX.
9535
9536 Don't use names ending in _t, since POSIX reserves them.
9537 For consistency, remove _e and _s endings -- they're weren't
9538 needed to remove ambiguity. All uses changed.
9539 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
9540 turn was just renamed from struniq_t.
9541 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
9542 which in turn was just renamed from struniq_processor_t.
9543 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
9544 in turn was renamed from hash_compare_struniq_t.
9545 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
9546 (state_list): Renamed from state_list_t.
9547 * src/assoc.h (assoc): Renamed from assoc_t.
9548 * src/conflicts.c (enum conflict_resolution): Renamed from
9549 enum conflict_resolution_e.
9550 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
9551 (rule_list): Renamed from rule_list_t.
9552 * src/getargs.h (enum trace): Renamed from enum trace_e.
9553 (enum report): Renamed from enum report_e.
9554 * src/gram.h (item_number): Renamed from item_number_t.
9555 (rule_number): Renamed from rule_number_t.
9556 (struct rule_s): Remove the "rule_s" part; not used.
9557 (rule): Renamed from rule_t.
9558 (rule_filter): Renamed from rule_filter_t.
9559 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
9560 (goto_list): Renamed from goto_list_t.
9561 * src/lalr.h (goto_number): Renamed from goto_number_t.
9562 * src/location.h (location): Renamed from location_t.
9563 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
9564 and moved here from:
9565 * src/muscle_tab.h (muscle_entry_t): here.
9566 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
9567 (rule_list): Renamed from rule_list_t.
9568 * src/print_graph.c (static_graph): Renamed from graph.
9569 * src/reader.h (braced_code): Renamed from braced_code_t.
9570 Remove brace_code_e tag.
9571 * src/relation.h (relation_node): Renamed from relation_node_t.
9572 (relation_nodes): Renamed from relation_nodes_t.
9573 (relation): Renamed from relation_t.
9574 * src/state.h (state_number): Renamed from state_number_t.
9575 (struct state): Renamed from struct state_s.
9576 (state): Renamed from state_t.
9577 (transitions): Renamed from transitions_t. Unused (and
9578 misspelled) transtion_s tag removed.
9579 (errs): Renamed from errs_t. Unused errs_s tag removed.
9580 (reductions): Renamed from reductions_t. Unused tag
9581 reductions_s removed.
9582 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
9583 (struct symbol_list): Renamed from struct symbol_list_s.
9584 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
9585 (struct symbol): Renamed from struct symbol_s.
9586 (symbol): Renamed from symbol_t.
9587 * src/tables.c (vector_number): Renamed from vector_number_t.
9588 (action_number): Renamed from action_t.
9589 * src/tables.h (base_number): Renamed from base_t.
9590 * src/vcg.h (enum color): Renamed from enum color_e.
9591 (enum textmode): Renamed from enum textmode_e.
9592 (enum shape): Renamed from enum shape_e.
9593 (struct colorentry): Renamed from struct colorentry_s.
9594 (struct classname): Renamed from struct classname_s.
9595 (struct infoname): Renamed from struct infoname_s.
9596 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
9597 (enum decision): Renamed from enum decision_e.
9598 (enum orientation): Renamed from enum orientation_e.
9599 (enum alignment): Renamed from enum alignment_e.
9600 (enum arrow_mode): Renamed from enum arrow_mode_e.
9601 (enum crossing_type): Renamed from enum crossing_type_e.
9602 (enum view): Renamed from enum view_e.
9603 (struct node): Renamed from struct node_s.
9604 (node): Renamed from node_t.
9605 (enum linestyle): Renamed from enum linestyle_e.
9606 (enum arrowstyle): Renamed from enum arrowstyle_e.
9607 (struct edge): Renamed from struct edge.
9608 (edge): Renamed from edge_t.
9609 (struct graph): Renamed from struct graph_s.
9610 (graph): Renamed from graph_t.
9611 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
9612 Rename value_t -> value.
9613 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
9614 value_t_as_yystype -> value_as_yystype.
9615
9616 Don't include <errno.h> in the mainstream code, since it
9617 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
9618 * lib/get-errno.c, lib/get-errno.h: New files.
9619 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
9620 get-errno.c.
9621 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
9622 * src/output.c (output_skeleton): Likewise.
9623 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
9624 instead of errno.
9625 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
9626 Likewise.
9627 (handle_action_dollar, handle_action_at): Likewise.
9628 * src/system.h: Do not include <errno.h>.
9629 (TAB_EXT): Renamed from EXT_TAB.
9630 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
9631
9632 Avoid str[a-z]*, since <string.h> reserves that name space.
9633 Change all instances of "struniq" in names to "uniqstr", and
9634 likewise for "STRUNIQ" and "UNIQSTR".
9635 * src/uniqstr.c: Renamed from src/struniq.c.
9636 * src/uniqstr.h: Renamed from src/struniq.h.
9637 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
9638 * src/files.c (strsuffix): Remove; unused.
9639 (concat2): Renamed from stringappend. Now static.
9640 * src/files.h (strsuffix, stringappend): Remove; unused.
9641 * src/parse-gram.y (<chars>): Renamed from <string>.
9642 (<uniqstr>): Renamed from <struniq>.
9643 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
9644 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
9645 (struct graph_s.expand): Renamed from struct graph_s.stretch.
9646 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
9647 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
9648 (N_EXPAND): Renamed from N_STRETCH.
9649
9650 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
9651 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
9652 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
9653 Remove; unused.
9654 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
9655 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
9656 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
9657 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
9658 (BASE_MAXIMUM): Renamed from BASE_MAX.
9659 (BASE_MINIMUM): Renamed from BASE_MIN.
9660 (ACTION_MAX): Remove; unused.
9661 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
9662 Unnecessary casts removed from above defines.
9663
9664
9665 Fix misspelling in names.
9666 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
9667 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
9668 G_NODE_ALIGNEMENT.
9669
9670
9671 * lib/timevar.c (timevar_report): Renamed from time_report,
9672 for consistency with other names.
9673 * lib/timevar.h (timevar_report): New decl.
9674 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
9675
9676
9677 Sort include-file uses.
9678
9679 Reorder all include files under src to be in the order "system.h".
9680 then the ../lib include files in angle brackets (alphabetized),
9681 then the . include files in double-quotes (alphabetized). Fix
9682 dependency breakages encountered in this process, as follows:
9683 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
9684 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
9685 * src/state.h: Include "symtab.h".
9686
9687 2002-12-08 Paul Eggert <eggert@twinsun.com>
9688
9689 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
9690 since this causes problems when __file__ contains character
9691 sequences like "@" that are treated specially by src/scan-skel.l.
9692 Instead, just use the file's basename. This fixes the bug
9693 reported by Martin Mokrejs in
9694 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
9695
9696 2002-12-06 Paul Eggert <eggert@twinsun.com>
9697
9698 Add support for rules that do not have trailing semicolons, as
9699 POSIX requires. Improve the quality of locations in Bison
9700 diagnostics.
9701
9702 * src/location.c: Include <quotearg.h>.
9703 (empty_location): Now const.
9704 (location_print): New function. Follow the recommendation of the
9705 GNU Coding Standards for locations that span file boundaries.
9706 * src/location.h: Do not include <quotearg.h>; no longer needed.
9707 (boundary): New type.
9708 (location_t): Use it. This allows locations to span file boundaries.
9709 All member uses changed: file -> start.file or end.file (as needed),
9710 first_line -> start.line, first_column -> start.column,
9711 last_line -> end.line, last_column -> end.column.
9712 (equal_boundaries): New function.
9713 (LOCATION_RESET, LOCATION_STEP): Remove.
9714 (LOCATION_PRINT): Remove. All callers changed to use location_print.
9715 (empty_location): Now const.
9716 (location_print): New decl.
9717 * src/parse-gram.y (lloc_default): New function, which handles
9718 empty locations more accurately.
9719 (YYLLOC_DEFAULT): Use it.
9720 (%token COLON): Remove.
9721 (%token ID_COLON): New token.
9722 (rules): Use it.
9723 (declarations, rules): Remove trailing semicolon.
9724 (declaration, rules_or_grammar_declaration):
9725 Allow empty (";") declaration.
9726 (symbol_def): Remove empty actions; no longer needed.
9727 (rules_or_grammar_declaration): Remove trailing semicolon.
9728 (semi_colon.opt): Remove.
9729 * src/reader.h: Include location.h.
9730 (scanner_cursor): New decl.
9731 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
9732 rolling our own.
9733 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
9734 of *loc.
9735 (STEP): Remove. No longer needed, now that adjust_location does
9736 the work. All uses removed.
9737 (scanner_cursor): New var.
9738 (adjust_location): Renamed from extend_location. It now sets
9739 *loc and adjusts the scanner cursor. All uses changed.
9740 Don't bother testing for CR.
9741 (handle_syncline): Remove location arg; now updates scanner cursor.
9742 All callers changed.
9743 (unexpected_end_of_file): Now accepts start boundary of token or
9744 comment, not location. All callers changed. Update scanner cursor,
9745 not the location.
9746 (SC_AFTER_IDENTIFIER): New state.
9747 (context_state): Renamed from c_context. All uses changed.
9748 (id_loc, code_start, token_start): New local vars.
9749 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
9750 processing of Yacc white space and equivalents here.
9751 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
9752 instead of returning ID immediately, since we need to search for
9753 a subsequent colon.
9754 (<INITIAL>"'", "\""): Save token_start.
9755 (<INITIAL>"%{", "{", "%%"): Save code_start.
9756 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
9757 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
9758 BEGIN context_state at end, not INITIAL.
9759 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
9760 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
9761 Return correct token start.
9762 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
9763 the start of a character, string or multiline comment is found.
9764 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
9765 Reduction): Adjust reported locations to match the more-precise
9766 results now expected.
9767 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
9768 * tests/reduce.at (Useless Rules, Reduced Automaton,
9769 Underivable Rules): Likewise.
9770 * tests/regression.at (Invalid inputs): No longer `expecting ";"
9771 or "|"' now that so many other tokens are allowed by the new grammar.
9772
9773 * src/complain.h (current_file): Remove duplicate decl;
9774 current_file is now owned by files.h.
9775 * src/complain.c, src/scan-gram.l: Include files.h.
9776
9777 2002-12-06 Paul Eggert <eggert@twinsun.com>
9778
9779 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
9780 promotes to int; it might be unsigned int.
9781 * data/yacc.c (yy_reduce_print): Likewise.
9782
9783 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
9784 be #defined in the prologue, not in the Bison declarations.
9785 This fixes Debian Bug 102878, reported by Shaul Karl.
9786
9787 2002-12-02 Paul Eggert <eggert@twinsun.com>
9788
9789 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
9790 * lib/strtoul.c: New file, from gnulib.
9791 This fixes a porting bug reported by Peter Klein in
9792 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
9793
9794 2002-11-30 Paul Eggert <eggert@twinsun.com>
9795
9796 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
9797 and put only a forward declaration in the prologue. This is for
9798 consistency with the other scanner helper functions.
9799
9800 Type clashes now generate warnings, not errors, since it
9801 appears that POSIX may allow some grammars with type clashes.
9802 * src/reader.c (grammar_current_rule_check): Warn about
9803 type clashes instead of complaining.
9804 * tests/input.at (Type Clashes): Expect warnings, not complaints.
9805
9806 Add Yacc library, since POSIX requires it.
9807 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
9808 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
9809 * lib/main.c, lib/yyerror.c: New files.
9810
9811 gram_error can be static; it need not be extern.
9812 * src/reader.h (gram_error): Remove decl.
9813 * src/parse-gram.y (gram_error): Now static. Add static decl.
9814 (print_token_value): Omit parameter names from forward decl,
9815 for consistency.
9816
9817 2002-11-29 Paul Eggert <eggert@twinsun.com>
9818
9819 * doc/bison.texinfo: Emphasize that yylex and yyerror must
9820 be declared before being used. E.g., one should typically
9821 declare them in the prologue. Use GNU coding style in examples.
9822 Put "const" consistently after the type it modifies. Mention
9823 that C99 supports "inline". Mention that yyerror traditionally
9824 returns "int".
9825
9826 %parse-param and %lex-param now take just one argument, the
9827 declaration; the argument name is deduced from the declaration.
9828
9829 * doc/bison.texinfo (Parser Function, Pure Calling, Error
9830 Reporting, Table of Symbols): Document this.
9831 * src/parse-gram.y (add_param): New function.
9832 (COMMA): Remove.
9833 (declaration): Implement new rule for %parse-param and %lex-param.
9834 * src/scan-gram.l: "," now elicits a warning, rather than being
9835 a token; this is more compatible with byacc.
9836 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
9837
9838 2002-11-27 Paul Eggert <eggert@twinsun.com>
9839
9840 Rename identifiers to avoid real and potential collisions.
9841
9842 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
9843 to avoid collision with lex macro described by Bruce Lilly in
9844 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
9845 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9846 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
9847 * src/parse-gram.y (print_token_value): Renamed from yyprint.
9848 All uses changed.
9849 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
9850 The name "yycontrol" violates the name space rules, and this stuff
9851 wasn't being used anyway.
9852 (input): Remove action; this stuff wasn't being used.
9853 (gram_error): Rename local variable yylloc -> loc.
9854 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
9855 (YY_DECL): Don't use "yy" at start of local variables.
9856 All uses changed, e.g., yylloc -> loc.
9857 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
9858 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
9859 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
9860 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
9861
9862 * src/parse-gram.y (gram_error): loc is now const *.
9863 * src/reader.h (gram_error): Likewise.
9864
9865 2002-11-24 Paul Eggert <eggert@twinsun.com>
9866
9867 Version 1.75c.
9868
9869 * tests/actions.at (Actions after errors): Use an output format
9870 more similar to that of the Printers and Destructors test.
9871 Test the position of the ';' token too.
9872 (Printers and Destructors): Likewise.
9873 (Printers and Destructors: %glr-parser): Remove for now, to avoid
9874 unnecessarily alarming people when the test fails.
9875
9876 * data/yacc.c (yyerrlab1): Move this label down, so that the
9877 parser does not discard the lookahead token if the user code
9878 invokes YYERROR. This change is required for POSIX conformance.
9879
9880 * lib/error.c: Sync with gnulib.
9881
9882 2002-11-22 Paul Eggert <eggert@twinsun.com>
9883
9884 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
9885 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
9886 * lib/xmalloc.c: Likewise.
9887
9888 2002-11-20 Paul Eggert <eggert@twinsun.com>
9889
9890 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
9891
9892 2002-11-20 Paul Eggert <eggert@twinsun.com>
9893
9894 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
9895 should use `if (! x) abort ();' rather than `assert (x);', and
9896 anyway it's one less thing to worry about configuring.
9897
9898 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
9899 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
9900 and replace all instances of assert with abort.
9901 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9902 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
9903
9904 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
9905 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
9906 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
9907 hash_find_entry, hash_rehash, hash_insert): Likewise.
9908 * src/conflicts.c (resolve_sr_conflict): Likewise.
9909 * src/lalr.c (set_goto_map, map_goto): Likewise.
9910 * src/nullable.c (nullable_compute): Likewise.
9911 * src/output.c (prepare_rules, token_definitions_output): Likewise.
9912 * src/reader.c (packgram, reader): Likewise.
9913 * src/state.c (state_new, state_free, state_transitions_set,
9914 state_reduction_find): Likewise.
9915 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
9916 symbol_pack): Likewise.
9917 * src/tables.c (conflict_row, pack_vector): Likewise.
9918 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9919 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9920 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
9921 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
9922
9923 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
9924 (ARGMATCH_CONSTRAINT): New macro.
9925 (ARGMATCH_ASSERT): Use it.
9926
9927 * src/system.h (verify): New macro.
9928 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
9929 rather than assert.
9930 * src/tables.c (tables_generate): Likewise.
9931
9932 * src/struniq.c (struniq_assert): Now returns void, and aborts
9933 if the assertion is false.
9934 (struniq_assert_p): Remove.
9935 * src/struniq.h: Likewise.
9936
9937 2002-11-18 Paul Eggert <eggert@twinsun.com>
9938
9939 * data/glr.c (yygetLRActions): Replace `yyindex' with
9940 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
9941 This fixes the regression with Sun ONE Studio 7 cc that I reported in
9942 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
9943
9944 2002-11-18 Akim Demaille <akim@epita.fr>
9945
9946 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
9947 space.
9948 From Tim Van Holder.
9949
9950 2002-11-17 Paul Eggert <eggert@twinsun.com>
9951
9952 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
9953 to "SyntaxError" for consistency with my 2002-11-15 change.
9954
9955 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
9956 not define to {}, since this breaks the common use of `YYDPRINTF
9957 ((...));' if a single statement is desired (e.g. before `else').
9958 Work around GCC warnings by surrounding corresponding calls with
9959 {} if needed.
9960 (yyhasResolvedValue): Remove unused function.
9961 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
9962 loop body.
9963 (yyreportSyntaxError): Renamed from yyreportParseError.
9964 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
9965 All uses changed.
9966 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
9967 extern when possible. Remove unused initializations.
9968
9969 2002-11-16 Akim Demaille <akim@epita.fr>
9970
9971 Augment the similarity between GLR and LALR traces.
9972
9973 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
9974 (YY_REDUCE_PRINT): New.
9975 (yyparse): Use them.
9976 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
9977 YYDPRINT here.
9978 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
9979 state reached after the reduction/recovery, since...
9980 (yyparse, yyprocessOneStack): Report the state we are entering in.
9981
9982 2002-11-16 Akim Demaille <akim@epita.fr>
9983
9984 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
9985 Add support for --trace=skeleton.
9986 * src/scan-skel.l: %option debug.
9987 Scan strings of non-@ or \n instead of character by character.
9988 (scan_skel): Handle trace_skeleton.
9989 (QPUTS): New.
9990 (@output_parser_name@, @output_header_name@): ``Restore'' their
9991 support (used to be M4 macros).
9992 * data/yacc.c: Quote larger chunks, a la glr.c.
9993 * data/lalr1.cc: Likewise.
9994 The header guards are no longer available, so use some other
9995 string than `YYLSP_NEEDED'.
9996
9997 2002-11-16 Akim Demaille <akim@epita.fr>
9998
9999 Make the ``Printers and Destructors'' test more verbose, taking
10000 `yacc.c''s behavior as (possibly wrong) reference.
10001
10002 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10003 instead of fprint on stdout.
10004 Set and report the last_line of the symbols.
10005 Consistently display values and locations.
10006
10007 2002-11-16 Paul Eggert <eggert@twinsun.com>
10008
10009 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10010
10011 2002-11-15 Paul Eggert <eggert@twinsun.com>
10012
10013 * tests/actions.at (Actions after errors): New test case.
10014
10015 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10016 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10017 tests/action.at, tests/calc.at, tests/conflicts.at,
10018 tests/cxx-type.at, tests/regression.at:
10019 "parse error" -> "syntax error" for POSIX compatibility.
10020 "parsing stack overflow..." -> "parser stack overflow" so
10021 that code matches Bison documentation.
10022
10023 2002-11-15 Akim Demaille <akim@epita.fr>
10024
10025 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10026 take two BRACED_CODE, not two string_content.
10027 Free the scanner's obstack when we are done.
10028 (code_content): New.
10029 * tests/calc.at: Adjust.
10030 * doc/bison.texinfo: Adjust.
10031 Also, make sure to include the `,' for these declarations.
10032
10033 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10034
10035 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10036 definition; avoids potential autoreconf problems.
10037
10038 2002-11-15 Akim Demaille <akim@epita.fr>
10039
10040 Always check the value returned by yyparse.
10041
10042 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10043 returned by yyparse.
10044 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10045 Adjust calls.
10046 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10047 returned by yyparse.
10048
10049 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10050
10051 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10052 on input.at test.
10053
10054 2002-11-14 Paul Eggert <eggert@twinsun.com>
10055
10056 * src/output.c (output_skeleton): Call xfopen instead of
10057 duplicating xfopen's body.
10058
10059 Fix bugs reported by Nelson H. F. Beebe in
10060 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
10061
10062 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10063 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10064 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10065 file twice in the grammar, as an extra check.
10066
10067 * tests/input.at (Torturing the Scanner): Surround the
10068 backslash-newline tests with "#if 0", to make it less likely that
10069 we'll run into compiler bugs. Bring back solitary \ inside
10070 comment, but add a closing comment to work around HP C bug. Don't
10071 test backslash-newline in C character constant.
10072
10073 2002-11-14 Akim Demaille <akim@epita.fr>
10074
10075 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10076 status of the compiler.
10077 Calling `exit 1' is no longer needed.
10078 Reported by Nelson H. F. Beebe.
10079
10080 2002-11-14 Akim Demaille <akim@epita.fr>
10081
10082 * tests/atlocal.in (CPPFLAGS): We have config.h.
10083 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10084 New.
10085 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10086 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10087 * tests/regression.at, tests/torture.at: Use them for all the
10088 grammars that are to be compiled.
10089 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10090 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10091 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10092
10093 2002-11-14 Akim Demaille <akim@epita.fr>
10094
10095 * doc/bison.texinfo: Various formatting changes (alignments in
10096 samples, additional @group/@end group, GCS in samples.
10097 Use @deffn instead of simple @table to define the directives,
10098 macros, variables etc.
10099
10100 2002-11-13 Paul Eggert <eggert@twinsun.com>
10101
10102 Fix some bugs reported by Albert Chin-A-Young in
10103 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
10104
10105 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
10106 -o c"; the HP C compiler chatters during compilation.
10107 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10108 * tests/headers.at (export YYLTYPE): Likewise.
10109
10110 * tests/input.at (Torturing the Scanner): Remove lines containing
10111 solitary backslashes, as they tickle a bug in the HP C compiler.
10112
10113 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10114 comments, since they're not portable. Use GNU coding style.
10115
10116 2002-11-13 Akim Demaille <akim@epita.fr>
10117
10118 * data/yacc.c: Leave bigger chunks of quoted text.
10119 (YYDSYMPRINTF): New.
10120 Use it to report symbol activities.
10121 * data/glr.c (YYDSYMPRINTF): New.
10122 Use it.
10123
10124 2002-11-12 Paul Eggert <eggert@twinsun.com>
10125
10126 Version 1.75b.
10127
10128 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10129 (yyglrReduce): Return yyok, not 0.
10130 This should avoid the enumerated-type warnings reported
10131 by Nelson H. F. Beebe in
10132 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
10133
10134 * lib/bbitset.h (BITSET_INLINE): Remove.
10135 * lib/bitset.h [! BITSET_INLINE]: Remove.
10136 (bitset_set, bitset_reset, bitset_test): Rename local vars
10137 to avoid shadowing warnings by GCC.
10138
10139 * data/glr.c (inline): Remove #define. It's the user's
10140 responsibility to #define it away, just like 'const'.
10141 This fixes one of the bugs reported by Nelson H. F. Beebe in
10142 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
10143
10144 * Makefile.maint (po-check): Scan .l and .y files instead of the
10145 .c and the .h files that they generate. This fixes the bug
10146 reported by Tim Van Holder in:
10147 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
10148 Look for N_ as well as for _. Try to avoid matching #define for
10149 N_ and _.
10150 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10151 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10152 * src/scan-gram.l: Revamp regular expressions so that " and '
10153 do not confuse xgettext.
10154
10155 * src/struniq.h (struniq_new): Do not declare the return type
10156 to be 'const'; this violates the C standard.
10157 * src/struniq.c (struniq_new): Likewise.
10158
10159 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10160
10161 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10162 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10163 linker.
10164
10165 2002-11-12 Akim Demaille <akim@epita.fr>
10166
10167 * Makefile.maint: Sync with Autoconf:
10168 (local_updates): New.
10169
10170 2002-11-12 Akim Demaille <akim@epita.fr>
10171
10172 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10173
10174 2002-11-12 Akim Demaille <akim@epita.fr>
10175
10176 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10177 locations.
10178
10179 2002-11-12 Akim Demaille <akim@epita.fr>
10180
10181 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10182 not yyvalue.
10183
10184 2002-11-12 Akim Demaille <akim@epita.fr>
10185
10186 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10187 Use it to test the GLR parser.
10188
10189 2002-11-12 Akim Demaille <akim@epita.fr>
10190
10191 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10192 defines it.
10193 * data/glr.c (yystos): New.
10194 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10195 (YYDSYMPRINT): New.
10196 (yyval): Don't define it, it is handled via M4.
10197 (yyrecoverParseError): Free verbosely the discarded symbols.
10198 * data/yacc.c (yysymprint): Remove, rather...
10199 (b4_yysymprint_generate): invoke.
10200 * data/c.m4 (b4_yysymprint_generate): New.
10201 Accept pointers as arguments, as opposed to the version from
10202 yacc.c.
10203 (b4_yydestruct_generate): Likewise.
10204 * tests/cations.at (Printers and Destructors): Use Bison directives
10205 instead of CPP macros.
10206 Don't rely on internal details.
10207
10208 2002-11-12 Akim Demaille <akim@epita.fr>
10209
10210 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10211 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10212 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10213 it against YYEMPTY and so forth), work on yytoken (i.e., set
10214 it to YYEMPTY etc.).
10215 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10216 (b4_symbol_actions): Remove.
10217 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10218 for 0, end-of-input.
10219
10220 2002-11-12 Akim Demaille <akim@epita.fr>
10221
10222 * doc/bison.texinfo (Destructor Decl): New.
10223
10224 2002-11-12 Akim Demaille <akim@epita.fr>
10225
10226 * src/tables.c (tables_generate): Use free for pointers that
10227 cannot be NULL, not XFREE.
10228 (pack_vector): Use assert, not fatal, for bound violations.
10229 * src/state.c (state_new): Likewise.
10230 * src/reader.c (reader): Likewise.
10231 * src/lalr.c (set_goto_map): Likewise.
10232 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
10233 the file name.
10234
10235 2002-11-12 Akim Demaille <akim@epita.fr>
10236
10237 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10238 Restore.
10239 * src/scan-gram.l (last_string): Is global to the file, not to
10240 yylex.
10241 * src/parse-gram.y (input): Don't append the epilogue here,
10242 (epilogue.opt): do it here, and free the scanner's obstack.
10243 * src/reader.c (epilogue_set): Rename as...
10244 (epilogue_augment): this.
10245 * data/c.m4 (b4_epilogue): Defaults to empty.
10246
10247 2002-11-12 Akim Demaille <akim@epita.fr>
10248
10249 * src/getargs.c (long_options): Remove duplicates.
10250 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10251 Remove.
10252 * doc/bison.rnh: Remove.
10253 * doc/bison.texinfo (VMS Invocation): Remove.
10254
10255 2002-11-12 Akim Demaille <akim@epita.fr>
10256
10257 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10258 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10259
10260 Use struniq for symbols.
10261
10262 * src/symtab.h (symbol_t): The tag member is a struniq.
10263 (symbol_type_set): Adjust.
10264 * src/symtab.c (symbol_new): Takes a struniq.
10265 (symbol_free): Don't free the tag member.
10266 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10267 (hash_compare_symbol, hash_symbol): these.
10268 Use the fact that tags as struniqs.
10269 (symbol_get): Use struniq_new.
10270 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10271 Returns a strniq.
10272 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10273 and type members are struniqs.
10274 * src/reader.c (get_merge_function)
10275 (grammar_current_rule_merge_set): Adjust.
10276 (TYPE, current_type): Are struniq.
10277
10278 Use struniq for file names.
10279
10280 * src/files.h, src/files.c (infile): Split into...
10281 (grammar_file, current_file): these.
10282 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10283 * src/reduce.c (reduce_print): Likewise.
10284 * src/getargs.c (getargs): Likewise.
10285 * src/complain.h, src/complain.c: Likewise.
10286 * src/main.c (main): Call struniqs_new early enough to use it for
10287 file names.
10288 Don't free the input file name.
10289
10290 2002-11-12 Akim Demaille <akim@epita.fr>
10291
10292 * src/symtab.c (symbol_free): Remove dead deactivated code:
10293 type_name are properly removed.
10294 Don't use XFREE to free items that cannot be NULL.
10295 * src/struniq.h, src/struniq.c: New.
10296 * src/main.c (main): Initialize/free struniqs.
10297 * src/parse-gram.y (%union): Add astruniq member.
10298 (yyprint): Adjust.
10299 * src/scan-gram.l (<{tag}>): Return a struniq.
10300 Free the obstack bit that used to store it.
10301 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
10302
10303 2002-11-11 Paul Eggert <eggert@twinsun.com>
10304
10305 Revamp to fix many (but not all) of the C- and M4-related quoting
10306 problems. Among other things, this fixes the Bison bug reported
10307 by Jan Hubicka when processing the Bash grammar; see:
10308 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
10309
10310 Use new @ escapes consistently. Represent brackets with @{ and @}
10311 rather than @<:@ and @:>@, since this works a bit better with dumb
10312 editors like vi. Represent @ with @@, since @ is now consistently
10313 an escape. Use @oline@ and @ofile@ rather than __oline__ and
10314 __ofile__, to avoid unexpected expansions. Similarly, use @output
10315 rather than #output.
10316
10317 * data/c.m4 (b4_copyright): Omit file name from comment, since
10318 the file name could contain "*/".
10319 (b4_synclines_flag): Don't quote the 2nd argument; it should already
10320 be quoted. All uses changed.
10321
10322 * data/glr.c: Use new @ escapes consistently.
10323 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
10324 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
10325 Remove, since they couldn't handle arbitrary characters in file
10326 names.
10327 * data/lalr1.cc: Likewise.
10328 * data/yacc.c: Likewise.
10329
10330 * src/files.c (output_infix): Remove; all uses removed.
10331 * src/files.h: Likewise.
10332
10333 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
10334 mishandled funny characters in file names, and anyway it isn't
10335 needed any more.
10336 * data/yacc.c: Likewise.
10337 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
10338
10339 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
10340 * data/yacc.c: Likewise.
10341
10342 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
10343 strings now.
10344 (muscle_init): Quote filename as a C string.
10345 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
10346 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
10347 * src/output.c (escaped_file_name_output): New function.
10348 (prepare_symbols): Quote tokens for M4.
10349 (prepare): Don't insert output_infix, output_prefix,
10350 output_parser_name, output_header_name; this is now down by scan-skel.
10351 Insert skeleton as a C string.
10352
10353 * src/output.c (user_actions_output, symbol_destructors_output,
10354 symbol_printers_output): Quote filenames for C and M4.
10355 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10356
10357 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
10358 escapes other than \\ and \'; this simplifies the code.
10359 (<SC_STRING>): Likewise, for \\ and \".
10360 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
10361 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
10362 Use new escapes @{ and @} for [ and ].
10363
10364 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
10365 them with auto vars.
10366 Switch to new escape scheme, where @ is the escape character uniformly.
10367 Abort if a stray escape character is found. Avoid unbounded input
10368 buffer when parsing non-escaped text.
10369
10370 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
10371 __oline__, #output, $@, and @{ do not have unintended meanings.
10372
10373 2002-11-09 Paul Eggert <eggert@twinsun.com>
10374
10375 Fix the test failure due to GCC warnings described in
10376 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
10377 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
10378 evaluate to 0 if it's impossible for NINF to be in the respective
10379 table.
10380 (yygetLRActions, yyrecoverParseError): Use them.
10381
10382 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
10383 counted in the token inserted at end of file. Now takes
10384 location_t *, not location_t, so that the location can be
10385 adjusted. All uses changed.
10386
10387 * tests/regression.at (Invalid inputs): Adjust wording in
10388 diagnostic to match the new behavior.
10389
10390 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
10391 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
10392 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
10393 abort ();'. This reduces the runtime of the "Many lookaheads"
10394 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
10395 GCC 3.2.
10396
10397 2002-11-07 Paul Eggert <eggert@twinsun.com>
10398
10399 * src/parse-gram.y (CHARACTER): Remove unused token.
10400 All uses removed.
10401
10402 * src/scan-gram.l: Remove stack option. We no longer use the
10403 stack, since the stack was never deeper than 1; instead, use the
10404 new auto var c_context to record the stacked value.
10405
10406 Remove nounput option. At an unexpected end of file, we now unput
10407 the minimal input necessary to end cleanly; this simplifies the
10408 code.
10409
10410 Avoid unbounded token sizes where this is easy.
10411
10412 (unexpected_end_of_file): New function.
10413 Use it to systematize the error message on unexpected EOF.
10414 (last-string): Now auto, not static.
10415 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
10416 (scanner_last_string_free): Remove; not used.
10417 (percent_percent_count): Move decl to just before use.
10418 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
10419 not the (never otherwised-used) CHARACTER.
10420
10421 2002-11-07 Akim Demaille <akim@epita.fr>
10422
10423 Let yyerror always receive the msg as last argument, so that
10424 yyerror can be variadic.
10425
10426 * data/yacc.c (b4_yyerror_args): New.
10427 Use it when calling yyerror.
10428 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
10429 Use it when calling yyerror.
10430 * doc/bison.texinfo (Error Reporting): Adjust.
10431 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
10432 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
10433
10434 2002-11-06 Akim Demaille <akim@epita.fr>
10435
10436 #line should have quoted strings.
10437 Ideally, this should be done by m4_quotearg.
10438
10439 * src/scan-skel.l: Include quotearg.h.
10440 Quote __ofile__.
10441 * src/output.c (symbol_printers_output)
10442 (symbol_destructors_output): Quote the file name.
10443
10444 2002-11-06 Akim Demaille <akim@epita.fr>
10445
10446 * tests/regression.at (Invalid inputs): Adjust to the recent
10447 messages.
10448
10449 2002-11-06 Akim Demaille <akim@epita.fr>
10450
10451 Restore --no-lines.
10452 Reported by Jim Kent.
10453
10454 * data/c.m4 (b4_syncline): New.
10455 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
10456 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
10457 * src/output.c (user_actions_output): Likewise.
10458 (prepare): Define 'b4_synclines_flag'.
10459 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
10460
10461 2002-11-06 Akim Demaille <akim@epita.fr>
10462
10463 * src/main.c (main): Free `infile'.
10464 * src/scan-gram.l (handle_syncline): New.
10465 Recognize `#line'.
10466 * src/output.c (user_actions_output, symbol_destructors_output)
10467 (symbol_printers_output): Use the location's file name, not
10468 infile.
10469 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10470
10471 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10472
10473 * src/tables.c (matching_state): Don't allow states to match if
10474 either has GLR conflict entries.
10475
10476 2002-11-05 Paul Eggert <eggert@twinsun.com>
10477
10478 * src/scan-gram.l: Use more accurate diagnostics, e.g.
10479 "integer out of range" rather than "invalid value".
10480 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
10481 accordingly.
10482
10483 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
10484 Also, remove one static variable in the scanner.
10485
10486 * src/scan-gram.l (braces_level): Now auto, not static.
10487 Initialize to zero if the compiler is being picky.
10488 (INITIAL): Clear braces_level instead of incrementing it.
10489 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
10490 as POSIX 1003.1-2001 requires.
10491 * src/system.h (IF_LINT): New macro, taken from coreutils.
10492 * configure.ac: Define "lint" if --enable-gcc-warnings.
10493
10494 2002-11-05 Akim Demaille <akim@epita.fr>
10495
10496 * src/scan-gram.l: When it starts with `%', complain about the
10497 whole directive, not just that `invalid character: %'.
10498
10499 2002-11-04 Akim Demaille <akim@epita.fr>
10500
10501 * Makefile.maint: Update from Autoconf.
10502 (update, cvs-update, po-update, do-po-update): New.
10503
10504 2002-11-04 Akim Demaille <akim@epita.fr>
10505
10506 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
10507 and yyerror.
10508 Have yyerror `use' its arguments.
10509 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
10510 returns true when location & yacc & pure & parse-param.
10511 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
10512
10513 2002-11-04 Akim Demaille <akim@epita.fr>
10514
10515 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
10516 clashes.
10517 * src/scan-gram.l: Use [\'] instead of ['] to pacify
10518 font-lock-mode.
10519 Use complain_at.
10520 Use quote, not quote_n since LOCATION_PRINT no longer uses the
10521 slot 0.
10522
10523 2002-11-03 Paul Eggert <eggert@twinsun.com>
10524
10525 * src/reader.c (get_merge_function, grammar_current_rule_check):
10526 Use consistent diagnostics for reporting type name clashes.
10527 Quote the types with <>, for consistency with Yacc.
10528 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
10529
10530 2002-11-03 Akim Demaille <akim@epita.fr>
10531
10532 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
10533 New.
10534 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
10535 (b4_parse_param): Remove.
10536 Use b4_identification.
10537 Propagate b4_pure_args where needed to pass them to yyerror.
10538 * data/glr.m4 (b4_parse_param): Remove.
10539 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
10540 (b4_lpure_formals): New.
10541 Use b4_identification.
10542 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
10543 b4_user_formals and b4_user_args.
10544 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
10545 (yyreportAmbiguity): When using a pure parser, also need
10546 the location, and the parse-params.
10547 Adjust callers.
10548 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
10549 When using a pure parser, also need the parse-params.
10550 Adjust callers.
10551 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
10552 (%pure-parser + %parse-param) LALR and GLR parsers.
10553 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
10554 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
10555 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
10556 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
10557 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
10558 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
10559 * doc/bison.texinfo: Untabify the whole file.
10560 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
10561 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
10562 (Error Reporting): Adjust to these new directives.
10563 Document %error-verbose, deprecate YYERROR_VERBOSE.
10564
10565 2002-11-03 Akim Demaille <akim@epita.fr>
10566
10567 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
10568 AT_CHECK_CALC_GLR invocations to use % directives, instead of
10569 command line options.
10570 * tests/cxx-type.at: Formatting changes.
10571
10572 2002-11-03 Paul Eggert <eggert@twinsun.com>
10573
10574 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
10575 to count columns correctly, and to check for invalid inputs.
10576
10577 Use mbsnwidth to count columns correctly. Account for tabs, too.
10578 Include mbswidth.h.
10579 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
10580 (extend_location): New function.
10581 (YY_LINES): Remove.
10582
10583 Handle CRLF in C code rather than in Lex code.
10584 (YY_INPUT): New macro.
10585 (no_cr_read): New function.
10586
10587 Scan UCNs, even though we don't fully handle them yet.
10588 (convert_ucn_to_byte): New function.
10589
10590 Handle backslash-newline correctly in C code.
10591 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
10592 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
10593 all uses changed.
10594 (tag, splice): New EREs. Do not allow NUL or newline in tags.
10595 Use {splice} wherever C allows backslash-newline.
10596 YY_STEP after space, newline, vertical-tab.
10597 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
10598
10599 (letter, id): Don't assume ASCII; e.g., spell out a-z.
10600
10601 ({int}, handle_action_dollar, handle_action_at): Check for integer
10602 overflow.
10603
10604 (YY_STEP): Omit trailing semicolon, so that it's more like C.
10605
10606 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
10607 as well as \000. Check for UCHAR_MAX, not 255.
10608 Allow \x with an arbitrary positive number of digits, as in C.
10609 Check for overflow here.
10610 Allow \? and UCNs, for compatibility with C.
10611
10612 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
10613 with quote slot used by complain_at.
10614
10615 * tests/input.at: Add tests for backslash-newline, m4 quotes
10616 in symbols, long literals, and funny escapes in strings.
10617
10618 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
10619 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
10620 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
10621 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
10622 * m4/mbswidth.m4: New file, from GNU coreutils.
10623
10624 * doc/bison.texinfo (Grammar Outline): Document // comments.
10625 (Symbols): Document that trigraphs have no special meaning in Bison,
10626 nor is backslash-newline allowed.
10627 (Actions): Document that trigraphs have no special meaning.
10628
10629 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
10630 no longer used.
10631
10632 2002-11-02 Paul Eggert <eggert@twinsun.com>
10633
10634 * src/reader.c: Don't include quote.h; not needed.
10635 (get_merge_function): Reword warning to be consistent with
10636 type clash diagnostic in grammar_current_rule_check.
10637
10638 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
10639 bug in trigraph handling.
10640
10641 * src/output.c (prepare_symbols): When printing token names,
10642 escape "[" as "@<:@" and likewise for "]".
10643
10644 * src/system.h (errno): Remove declaration, as we are now
10645 assuming C89 or better, and C89 guarantees errno.
10646
10647 2002-10-30 Paul Eggert <eggert@twinsun.com>
10648
10649 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
10650 Check for close failures.
10651 * src/files.h (xfclose): Return void, not int, since it always
10652 returned zero.
10653 * src/files.c (xfclose): Likewise. Report I/O error if ferror
10654 indicates one.
10655 * src/output.c (output_skeleton): Use xfclose rather than fclose
10656 and ferror. xfclose now checks ferror.
10657
10658 * data/glr.c (YYLEFTMOST_STATE): Remove.
10659 (yyreportTree): Use a stack-based leftmost state. This avoids
10660 our continuing battles with bogus warnings about initializers.
10661
10662 2002-10-30 Akim Demaille <akim@epita.fr>
10663
10664 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
10665 #if.
10666
10667 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10668
10669 * tests/glr-regr1.at: New test for reported regressions.
10670 * tests/testsuite.at: Add glr-regr1.at test.
10671 * tests/Makefile.am: Add glr-regr1.at test.
10672
10673 2002-10-24 Paul Eggert <eggert@twinsun.com>
10674
10675 Version 1.75a.
10676
10677 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
10678 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
10679 we use malloc. Don't assume 'A' through 'Z' are contiguous.
10680 Don't assume strdup exists; POSIX says its an XSI extension.
10681 Check for buffer overflow on input.
10682
10683 2002-10-24 Akim Demaille <akim@epita.fr>
10684
10685 * src/output.c (output_skeleton): Don't disable M4sugar comments
10686 too soon: it results in comments being expanded.
10687 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
10688 first output.
10689
10690 2002-10-24 Akim Demaille <akim@epita.fr>
10691
10692 * data/yacc.c (m4_int_type): New.
10693 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
10694 char' as only yacc.c wants K&R portability.
10695 * data/glr.c (yysigned_char): Remove.
10696 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
10697 Reported by Quoc Peyrot.
10698
10699 2002-10-23 Paul Eggert <eggert@twinsun.com>
10700
10701 * src/main.c (main): With --trace=time, report times even if a
10702 non-fatal error occurs. Formerly, the times were reported in some
10703 such cases but not in others.
10704 * src/reader.c (reader): Just return if a complaint has been issued,
10705 instead of exiting, so that 'main' can report times.
10706
10707 2002-10-22 Akim Demaille <akim@epita.fr>
10708
10709 * src/system.h: Include sys/types.
10710 Reported by Bert Deknuydt.
10711
10712 2002-10-23 Paul Eggert <eggert@twinsun.com>
10713
10714 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
10715 Suggested by Art Haas.
10716
10717 2002-10-22 Paul Eggert <eggert@twinsun.com>
10718
10719 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
10720 decl; not needed any more.
10721 * src/main.c (main): Use return to exit, undoing yesterday's change.
10722 The last OS that we could find where this wouldn't work is
10723 SunOS 3.5, and that's too old to worry about now.
10724
10725 * data/glr.c (struct yyltype): Define members even when not
10726 doing locations. This is more consistent with yacc.c, and it
10727 works around the following bug reports:
10728 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
10729 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
10730
10731 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
10732 @acronym consistently. Standardize on "Yacc" instead of "YACC",
10733 "Algol" instead of "ALGOL". Give a bit more history about BNF.
10734
10735 2002-10-22 Akim Demaille <akim@epita.fr>
10736
10737 * data/README: New.
10738
10739 2002-10-21 Paul Eggert <eggert@twinsun.com>
10740
10741 Be consistent about 'bool'; the old code used an enum in one
10742 module and an int in another, and this violates the C standard.
10743 * m4/stdbool.m4: New file, from coreutils 4.5.3.
10744 * configure.ac (AC_HEADER_STDBOOL): Add.
10745 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
10746 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
10747 * src/symtab.c (hash_compare_symbol_t): Likewise.
10748 * src/system.h (bool, false, true): Use a definition consistent
10749 with ../lib/hash.c. All uses changed.
10750
10751 * src/complain.c (warning_issued): Renamed from warn_message_count,
10752 so that we needn't worry about integer overflow (!).
10753 Now of type bool. All uses changed.
10754 (complaint_issued): Renamed from complain_message_count; likewise.
10755
10756 * src/main.c (main): Use exit to exit with failure.
10757
10758 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
10759 rather than 1 and 0.
10760 * src/main.c (main): Likewise.
10761 * src/getargs.c (getargs): Likewise.
10762 * src/reader.c (reader): Likewise.
10763
10764 * src/getarg.c (getargs): Remove duplicate code for
10765 "Try `bison --help'".
10766
10767 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
10768 What was that "2" for?
10769
10770 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
10771 * src/getargs.c (usage): Likewise.
10772
10773 * src/getargs.c (getargs): When there are too few operands, report
10774 the last one. When there are too many, report the first extra
10775 one. This is how diffutils does it.
10776
10777 2002-10-20 Paul Eggert <eggert@twinsun.com>
10778
10779 Remove K&R vestiges.
10780 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
10781 * src/complain.c (VA_START): Remove. Assume prototypes.
10782 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
10783 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
10784 fatal): Assume prototypes.
10785 * src/complain.h: Assume prototypes.
10786 * src/system.h (PARAMS): Remove.
10787 Include <limits.h> unconditionally, since it's guaranteeed even
10788 for a freestanding C89 compiler.
10789 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
10790 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
10791
10792 2002-10-20 Akim Demaille <akim@epita.fr>
10793
10794 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
10795 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
10796 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
10797 (yyresolveStates, yyresolveAction, yyresolveStack)
10798 (yyprocessOneStack): Use them.
10799 (yy_reduce_print): New.
10800 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
10801
10802 2002-10-20 Akim Demaille <akim@epita.fr>
10803
10804 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
10805 arguments and output `void'.
10806 (b4_c_function): Rename as...
10807 (b4_c_function_def): this.
10808 (b4_c_function_decl, b4_c_ansi_function_def)
10809 (b4_c_ansi_function_decl): New.
10810 Change the interpretation of the arguments: before `int, foo', now
10811 `int foo, foo'.
10812 * data/yacc.c (yyparse): Prototype and define thanks to these.
10813 Adjust b4_c_function_def uses.
10814 * data/glr.c (yyparse): Likewise, but ANSI only.
10815
10816 2002-10-20 Akim Demaille <akim@epita.fr>
10817
10818 * src/output.c (prepare): Move the definition of `tokens_number',
10819 `nterms_number', `undef_token_number', `user_token_number_max'
10820 to...
10821 (prepare_tokens): Here.
10822 (prepare_tokens): Rename as...
10823 (prepare_symbols): this.
10824 (prepare): Move the definition of `rules_number' to...
10825 (prepare_rules): here.
10826 (prepare): Move the definition of `last', `final_state_number',
10827 `states_number' to...
10828 (prepare_states): here.
10829 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
10830
10831 2002-10-20 Akim Demaille <akim@epita.fr>
10832
10833 * src/tables.h, src/tables.c, src/output.c: Comment changes.
10834
10835 2002-10-20 Akim Demaille <akim@epita.fr>
10836
10837 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
10838 * data/c.m4: here.
10839
10840 2002-10-20 Akim Demaille <akim@epita.fr>
10841
10842 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
10843 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
10844 `pair'.
10845 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
10846 `name' to...
10847 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
10848 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
10849 These.
10850
10851 2002-10-19 Paul Eggert <eggert@twinsun.com>
10852
10853 Do not create a temporary file, as that involves security and
10854 cleanup headaches. Instead, use a pair of pipes.
10855 Derived from a suggestion by Florian Krohm.
10856 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
10857 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
10858 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
10859 (BISON_PREREQ_SUBPIPE): Add.
10860 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
10861 Add subpipe.h, subpipe.c.
10862 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
10863 * po/POTFILES.in: Add lib/subpipe.c.
10864 * src/output.c: Include "subpipe.h".
10865 (m4_invoke): Remove decl.
10866 (scan_skel): New decl.
10867 (output_skeleton): Use pipe rather than temporary file for m4 input.
10868 Check that m4sugar.m4 is readable, to avoid deadlock.
10869 Check for pipe I/O error.
10870 * src/scan-skel.l (readpipe): Remove decl.
10871 (scan_skel): New function, to be used in place of m4_invoke.
10872 Read from stream rather than file.
10873
10874 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
10875 float, as this generates a warning on Solaris 8 + GCC 3.2 with
10876 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
10877 this generates a more-accurate value anyway.
10878
10879 * lib/timevar.c (timervar_accumulate): Rename locals to
10880 avoid confusion with similarly-named more-global.
10881 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
10882
10883 * src/output.c (prepare): Use xstrdup to convert char const *
10884 to char *, to avoid GCC warning.
10885
10886 2002-10-19 Akim Demaille <akim@epita.fr>
10887
10888 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
10889 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
10890 Use them to have `calc.y' ready for %pure-parser.
10891 * data/yacc.c (YYLEX): Pass a yylex return type to
10892 b4_c_function_call.
10893
10894 2002-10-19 Akim Demaille <akim@epita.fr>
10895
10896 Prototype support of %lex-param and %parse-param.
10897
10898 * src/parse-gram.y: Add the definition of the %lex-param and
10899 %parse-param tokens, plus their rules.
10900 Drop the `_' version of %glr-parser.
10901 Add the "," token.
10902 * src/scan-gram.l (INITIAL): Scan them.
10903 * src/muscle_tab.c: Comment changes.
10904 (muscle_insert, muscle_find): Rename `pair' as `probe'.
10905 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
10906 (muscle_entry_s): The `value' member is no longer const.
10907 Adjust all dependencies.
10908 * src/muscle_tab.c (muscle_init): Adjust: use
10909 MUSCLE_INSERT_STRING.
10910 Initialize the obstack earlier.
10911 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
10912 (muscle_pair_list_grow): New.
10913 * data/c.m4 (b4_c_function_call, b4_c_args): New.
10914 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
10915 * tests/calc.at: Use %locations, not --locations.
10916 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
10917
10918 2002-10-19 Akim Demaille <akim@epita.fr>
10919
10920 * src/getargs.c (usage): Take status as argument and exit
10921 accordingly.
10922 Report the traditional `Try ... --help' message when status != 0.
10923 (usage, version): Don't take a FILE * as arg, it is pointless.
10924 (getargs): When there is an incorrect number of arguments, make it
10925 an error, and report it GNUlically thanks to `usage ()'.
10926
10927 2002-10-18 Paul Eggert <eggert@twinsun.com>
10928
10929 * data/glr.c (yyreportParseError): Don't assume that sprintf
10930 yields the length of the printed string, as this is not true
10931 on SunOS 4.1.4. Reported by Peter Klein.
10932
10933 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
10934 * tests/conflicts.at (%nonassoc and eof): Likewise.
10935 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
10936
10937 2002-10-17 Akim Demaille <akim@epita.fr>
10938
10939 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
10940 * src/getargs.c (trace_types, trace_args): Adjust.
10941 * src/reader.c (grammar_current_rule_prec_set)
10942 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
10943 Standardize error messages.
10944 And s/@prec/%prec/!
10945 (reader): Use trace_flag to enable scanner/parser debugging,
10946 instead of an adhoc scheme.
10947 * src/scan-gram.l: Remove trailing debugging code.
10948
10949 2002-10-16 Paul Eggert <eggert@twinsun.com>
10950
10951 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
10952 MUSCLE_TAB_H.
10953
10954 * NEWS: Officially drop support for building Bison with K&R C,
10955 since it didn't work anyway and it's not worth worrying about.
10956 * Makefile.maint (wget_files): Remove ansi2knr.c.
10957 (ansi2knr.c-url_prefix): Remove.
10958 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
10959 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10960 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10961
10962 2002-10-15 Paul Eggert <eggert@twinsun.com>
10963
10964 Stop using the "enum_" trick for K&R-style function definitions;
10965 it confused me, and I was the author! Instead, assume that people
10966 who want to use K&R C compilers (when using these modules in GCC,
10967 perhaps?) will run ansi2knr.
10968
10969 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
10970 All uses of "enum_" changed to "enum ".
10971 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10972 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10973
10974 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
10975 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
10976 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
10977 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
10978 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
10979 abitset_not, abitset_ones, abitset_or, abitset_or_and,
10980 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
10981 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
10982 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
10983 Use function prototypes; this removes the need for declaring
10984 static functions simply to provide their prototypes.
10985 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
10986 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
10987 bitset_count_, bitset_create, bitset_dump, bitset_first,
10988 bitset_free, bitset_init, bitset_last, bitset_next,
10989 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
10990 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
10991 bitset_print, bitset_release_memory, bitset_toggle_,
10992 bitset_type_choose, bitset_type_get, bitset_type_name_get,
10993 debug_bitset): Likewise.
10994 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
10995 * lib/bitset_stats.c (bitset_log_histogram_print,
10996 bitset_percent_histogram_print, bitset_stats_and,
10997 bitset_stats_and_cmp, bitset_stats_and_or,
10998 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
10999 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11000 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11001 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11002 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11003 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11004 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11005 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11006 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11007 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11008 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11009 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11010 bitset_stats_zero): Likewise.
11011 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11012 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11013 bitsetv_dump, debug_bitsetv): Likewise.
11014 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11015 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11016 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11017 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11018 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11019 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11020 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11021 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11022 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11023 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11024 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11025 Likewise.
11026 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11027 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11028 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11029 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11030 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11031 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11032 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11033 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11034 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11035 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11036 lbitset_xor_cmp, lbitset_zero): Likewise.
11037
11038 2002-10-14 Akim Demaille <akim@epita.fr>
11039
11040 Version 1.75.
11041
11042 2002-10-14 Akim Demaille <akim@epita.fr>
11043
11044 * tests/Makefile.am (maintainer-check-posix): New.
11045
11046 2002-10-14 Akim Demaille <akim@epita.fr>
11047
11048 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11049 member.
11050
11051 2002-10-14 Akim Demaille <akim@epita.fr>
11052
11053 * src/tables.c (table_ninf_remap): base -> tab.
11054 Reported by Matt Rosing.
11055
11056 2002-10-14 Paul Eggert <eggert@twinsun.com>
11057
11058 * tests/action.at, tests/calc.at, tests/conflicts.at,
11059 tests/cxx-type.at, tests/headers.at, tests/input.at,
11060 tests/regression.at, tests/synclines.at, tests/torture.at:
11061 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11062 so that the tests still work even if POSIXLY_CORRECT is set.
11063 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
11064
11065 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11066 for portability to K&R hosts. Fix typo: signed char is guaranteed
11067 only to 127, not to 128.
11068 * data/glr.c (yysigned_char): New type.
11069 * data/yacc.c (yysigned_char): Likewise.
11070 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11071
11072 2002-10-13 Paul Eggert <eggert@twinsun.com>
11073
11074 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11075 true due to limited range of data type" warning from GCC.
11076
11077 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11078 by wrapping enum yytokentype's definition inside #ifndef
11079 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11080
11081 2002-10-13 Akim Demaille <akim@epita.fr>
11082
11083 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11084 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11085
11086 2002-10-13 Akim Demaille <akim@epita.fr>
11087
11088 * Makefile.maint: Update from Autoconf 2.54.
11089 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11090
11091 2002-10-13 Akim Demaille <akim@epita.fr>
11092
11093 * src/print.c (print_state): Separate the list of solved conflicts
11094 from the other items.
11095 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11096
11097 2002-10-13 Akim Demaille <akim@epita.fr>
11098
11099 Let nondeterministic skeletons be usable with deterministic
11100 tables.
11101
11102 With the patch, GAWK compiled by GCC without -O2 passes its test
11103 suite using a GLR parser driven by LALR tables. It fails with -O2
11104 because `struct stat' gives two different answers on my machine:
11105 88 (definition of an auto var) and later 96 (memset on this var).
11106 Hence the stack is badly corrumpted. The headers inclusion is to
11107 blame: if I move the awk.h inclusion before GLR's system header
11108 inclusion, the two struct stat have the same size.
11109
11110 * src/tables.c (pack_table): Always create conflict_table.
11111 (token_actions): Always create conflict_list.
11112 * data/glr.c (YYFLAG): Remove, unused.
11113
11114 2002-10-13 Akim Demaille <akim@epita.fr>
11115
11116 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11117 (O0FLAGS): New.
11118 (VALGRIND, GXX): New.
11119 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11120 * tests/bison.in: Run $PREBISON a pre-command.
11121 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11122 (maintainer-check-g++): New.
11123 * Makefile.am (maintainer-check): New.
11124
11125 2002-10-13 Akim Demaille <akim@epita.fr>
11126
11127 * data/glr.c: Formatting changes.
11128 Tweak some trace messages to match yacc.c's.
11129
11130 2002-10-13 Akim Demaille <akim@epita.fr>
11131
11132 GLR parsers sometimes raise parse errors instead of performing the
11133 default reduction.
11134 Reported by Charles-Henry de Boysson.
11135
11136 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
11137 check the length of the traces when %glr.
11138 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11139 GLR's traces.
11140 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11141 Test GLR parsers.
11142 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11143 (yyltype): Remove the yy prefix from the member names.
11144 (yytable): Complete its comment.
11145 (yygetLRActions): Map error action number from YYTABLE from
11146 YYTABLE_NINF to 0.
11147 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11148 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11149 not satisfying as we could compare an YYACTION computed from
11150 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11151 only value for error actions.
11152 (yyreportParseError): In verbose parse error messages, don't issue
11153 `error' in the list of expected tokens.
11154 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11155 next action to perform to match glr.c's decoding.
11156 (yytable): Complete its comment.
11157
11158 2002-10-13 Paul Eggert <eggert@twinsun.com>
11159
11160 Fix problem reported by Henrik Grubbstroem in
11161 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
11162 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11163 because the Bison parser reads the second action before reducing
11164 the first one.
11165 * src/scan-gram.l (rule_length): New static var.
11166 Use it to keep track of the rule length in the scanner, since
11167 we can't expect the parser to be in lock-step sync with the scanner.
11168 (handle_action_dollar, handle_action_at): Use this var.
11169 * tests/actions.at (Exotic Dollars): Test for the problem.
11170
11171 2002-10-12 Paul Eggert <eggert@twinsun.com>
11172
11173 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11174 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11175 Include <sys/time.h> when checking for clock_t and struct tms.
11176 Use same include order as source.
11177 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
11178 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
11179
11180 * lib/timevar.c: Update copyright date and clarify comments.
11181 (get_time) [IN_GCC]: Keep the GCC version for reference.
11182
11183 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11184 GCC version as of today, then merge Bison's changes.
11185 Change "GCC" to "Bison" in copyright notice. timevar.def's
11186 author is Akim, so change that too.
11187
11188 * src/reader.c (grammar_current_rule_check):
11189 Don't worry about the default action if $$ is untyped.
11190 Prevents bogus warnings reported by Jim Gifford in
11191 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
11192
11193 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11194 * data/glr.c, data/lalr1.cc, data/yacc.c:
11195 Output token definitions before the first part of user declarations.
11196 Fixes compatibility problem reported by Jim Gifford for kbd in
11197 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
11198
11199 2002-10-11 Paul Eggert <eggert@twinsun.com>
11200
11201 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11202 (yyparse): here. This undoes some of the 2002-07-25 change.
11203 Compatibility problem reported by Ralf S. Engelschall with
11204 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11205
11206 2002-10-11 Akim Demaille <akim@epita.fr>
11207
11208 * tests/regression.at Characters Escapes): New.
11209 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11210 characters.
11211 Reported by Jan Nieuwenhuizen.
11212
11213 2002-10-11 Akim Demaille <akim@epita.fr>
11214
11215 * po/id.po: New.
11216
11217 2002-10-10 Paul Eggert <eggert@twinsun.com>
11218
11219 Portability fixes for bitsets; this also avoids several GCC
11220 warnings.
11221
11222 * lib/abitset.c: Include <stddef.h>, for offsetof.
11223 * lib/lbitset.c: Likewise.
11224
11225 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11226 properly for vectors of objects. Do not assume that adding a
11227 header size to a multiple of a word size yields a value that is
11228 properly aligned for the whole union.
11229 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11230
11231 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11232 unique names for structures.
11233 * lib/ebitset.c (ebitset_bytes): Likewise.
11234 * lib/lbitset.c (lbitset_bytes): Likewise.
11235
11236 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11237 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11238 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11239 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11240 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11241 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11242 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11243 to improve the type-checking that GCC can do.
11244 * lib/bitset.c (bitset_op4_cmp): Likewise.
11245 * lib/bitset_stats.c (bitset_stats_count,
11246 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11247 bitset_stats_copy, bitset_stats_disjoint_p,
11248 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11249 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11250 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11251 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11252 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11253 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11254 bitset_stats_or_and_cmp): Likewise.
11255 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11256 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11257 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11258 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11259
11260 * lib/abitset.h: Include bitset.h, not bbitset.h.
11261 * lib/ebitset.h: Likewise.
11262 * lib/lbitset.h: Likewise.
11263
11264 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11265 All instances of parameters of type enum bitset_opts are now of
11266 type enum_bitset_opts, to conform to the C Standard, and similarly
11267 for enum_bitset_type.
11268 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11269 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11270
11271 Do not use "struct bitset_struct" to mean different things in
11272 different modules. Not only is this confusing, it violates
11273 the C Standard, which requires that structure types in different
11274 modules must be compatible if one is to be passed to the other.
11275 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11276 All instances of "struct bitset_struct *" replaced with "bitset".
11277 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11278 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11279 struct lbitset_struct, struct bitset_stats_struct): New types.
11280 All uses of struct bitset_struct changed to union bitset_union,
11281 etc.
11282 * lib/abitset.c (struct abitset_struct, abitset,
11283 struct bitset_struct): Remove.
11284 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11285 struct bitset_struct): Remove.
11286 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11287 bitset_struct): Remove.
11288 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
11289 Likewise.
11290
11291 Do not call a function of type T using a call that assumes the
11292 function is of a different type U. Standard C requires that a
11293 function must be called with a type that is compatible with its
11294 definition.
11295 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11296 New decls.
11297 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11298 New functions.
11299 * lib/ebitset.c (PFV): Remove.
11300 * lib/lbitset.c (PFV): Likewise.
11301 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
11302 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
11303 decls.
11304 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
11305 (ebitset_vtable): Use them.
11306 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
11307 lbitset_xor): New functions.
11308 (lbitset_vtable): Use them.
11309
11310 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
11311 Declare.
11312
11313 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
11314 GCC warning.
11315 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
11316 Use offsetof, for simplicity.
11317
11318 2002-10-06 Paul Eggert <eggert@twinsun.com>
11319
11320 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
11321 the same width as int. This reapplies a hunk of the 2002-08-12 patch
11322 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
11323 which was inadvertently undone by the 2002-09-30 patch.
11324 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
11325 the same width as int.
11326
11327 2002-10-04 Paul Eggert <eggert@twinsun.com>
11328
11329 Version 1.50.
11330
11331 * configure.ac (AC_INIT), NEWS: Increment version number.
11332
11333 * doc/bison.texinfo: Minor spelling, grammar, and white space
11334 fixes.
11335 (Symbols): Mention that any negative value returned from yylex
11336 signifies end-of-input. Warn about negative chars. Mention
11337 the portable Standard C character set.
11338
11339 The GNU coding standard says CFLAGS and YFLAGS are reserved
11340 for the installer to set.
11341 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
11342 * src/Makefile.am (AM_CFLAGS): Likewise.
11343 (AM_YFLAGS): Renamed from YFLAGS.
11344
11345 Fix some MAX and MIN problems.
11346 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
11347 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
11348 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
11349 * src/reader.c (reader): Use it.
11350
11351 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
11352 POSIX 1003.1-2001 has removed fgrep.
11353
11354 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
11355
11356 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
11357 interpreted as signed.
11358 * lib/ebitset.c (ebitset_list): Fix bug.
11359
11360 2002-10-01 Paul Eggert <eggert@twinsun.com>
11361
11362 More fixes for 64-bit hosts and large bitsets.
11363
11364 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
11365 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
11366 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
11367 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
11368 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
11369 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
11370 bitset_count_): Likewise.
11371 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
11372 bitset_first, bitset_last): Likewise.
11373 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
11374 bitset_stats_list_reverse, bitset_stats_size,
11375 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
11376 Likewise.
11377 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11378 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11379 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11380 bitsetv_reflexive_transitive_closure): Likewise.
11381 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
11382 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
11383 Likewise.
11384 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
11385 Likewise.
11386
11387 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
11388 Use size_t, not unsigned int, to count bytes.
11389 * lib/abitset.h (abitset_bytes): Likewise.
11390 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
11391 Likewise.
11392 * lib/bitset.h (bitset_bytes): Likewise.
11393 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
11394 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
11395 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11396 * lib/ebitset.c (ebitset_bytes): Likewise.
11397 * lib/ebitset.h (ebitset_bytes): Likewise.
11398 * lib/lbitset.c (lbitset_bytes): Likewise.
11399 * lib/lbitset.h (lbitset_bytes): Likewise.
11400
11401 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
11402 abitset_subset_p, abitset_disjoint_p, abitset_and,
11403 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
11404 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
11405 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
11406 abitset_or_and, abitset_or_and_cmp):
11407 Use bitset_windex instead of unsigned int.
11408 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11409 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
11410 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
11411 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
11412 Likewise.
11413 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
11414
11415 * lib/bitset.c (bitset_print):
11416 Use proper printf formats for widths of integer types.
11417 * lib/bitset_stats.c (bitset_percent_histogram_print,
11418 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
11419 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11420 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11421 * lib/lbitset.c (lbitset_bytes): Likewise.
11422
11423 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
11424 BITSET_SIZE_MAX): New macros.
11425 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
11426 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
11427 to BITSET_WINDEX_MAX.
11428
11429 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
11430 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
11431 since we now return the bitset_bindex type (not int).
11432
11433 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
11434 when computing sizes.
11435 * lib/ebitset.c (ebitset_elts_grow): Likewise.
11436
11437 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
11438 and avoid cast to unsigned.
11439
11440 2002-09-30 Akim Demaille <akim@epita.fr>
11441
11442 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11443 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
11444 Updates from Michael Hayes.
11445
11446 2002-09-30 Art Haas <ahaas@neosoft.com>
11447
11448 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
11449 invocations.
11450 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
11451 defined.
11452
11453 2002-09-27 Akim Demaille <akim@epita.fr>
11454
11455 Version 1.49c.
11456
11457 2002-09-27 Akim Demaille <akim@epita.fr>
11458
11459 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
11460 (Because of AC_LIBSOURCE).
11461
11462 2002-09-27 Akim Demaille <akim@epita.fr>
11463
11464 Playing with Autoscan.
11465
11466 * configure.ac: Remove the old LIBOBJ tweaks.
11467 (AC_REPLACE_FUNCS): Add strrchr and strtol.
11468 * lib/strrchr.c: New.
11469 * lib/strtol.c: New, from the Coreutils 4.5.1.
11470
11471 2002-09-27 Akim Demaille <akim@epita.fr>
11472
11473 Playing with Autoscan.
11474
11475 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
11476 * lib/Makefile.am (libbison_a_SOURCES): No longer include
11477 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
11478 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
11479 Coreutils 4.5.1.
11480
11481 2002-09-24 Akim Demaille <akim@epita.fr>
11482
11483 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
11484 (Frequently Asked Questions, Parser Stack Overflow): New.
11485
11486 2002-09-13 Akim Demaille <akim@epita.fr>
11487
11488 Playing with autoscan.
11489
11490 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
11491 * src/files.c (skeleton_find): Remove, unused.
11492 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
11493 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
11494
11495 2002-09-13 Akim Demaille <akim@epita.fr>
11496
11497 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
11498 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
11499
11500 2002-09-13 Akim Demaille <akim@epita.fr>
11501
11502 * configure.ac: Require 2.54.
11503 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
11504 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
11505 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
11506 Remove, provided by Autoconf macros.
11507
11508 2002-09-12 Akim Demaille <akim@epita.fr>
11509
11510 * m4/prereq.m4: Update, from Coreutils 4.5.1.
11511
11512 2002-09-12 Akim Demaille <akim@epita.fr>
11513
11514 * m4/prereq.m4: Update, from Fileutils 4.1.5.
11515 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
11516 Reported by Martin Mokrejs.
11517
11518 2002-09-10 Akim Demaille <akim@epita.fr>
11519
11520 * src/parse-gram.y: Associate a human readable string to each
11521 token type.
11522 * tests/regression.at (Invalid inputs): Adjust.
11523
11524 2002-09-10 Gary V. Vaughan <gary@gnu.org>
11525
11526 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
11527 with an Autoconf-2.5x style configure.ac.
11528
11529 2002-09-06 Paul Eggert <eggert@twinsun.com>
11530
11531 * doc/bison.texinfo (Conditions): Make explicit that the GPL
11532 exception applies only to yacc.c. This is a modification of a
11533 patch originally suggested by Akim Demaille.
11534
11535 2002-09-06 Akim Demaille <akim@epita.fr>
11536
11537 * data/c.m4 (b4_copyright): Move the GPL exception comment from
11538 here to...
11539 * data/yacc.c: here.
11540
11541 * data/lalr1.cc (struct yyltype): Don't define it, since we use
11542 LocationType.
11543 (b4_ltype): Default to yy::Location from location.hh.
11544
11545 2002-09-04 Jim Meyering <jim@meyering.net>
11546
11547 * data/yacc.c: Guard the declaration of yytoknum also with
11548 `#ifdef YYPRINT', so it is declared only when used.
11549
11550 2002-09-04 Akim Demaille <akim@epita.fr>
11551
11552 * configure.in: Rename as...
11553 * configure.ac: this.
11554 Bump to 1.49c.
11555
11556 2002-09-04 Akim Demaille <akim@epita.fr>
11557
11558 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
11559 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
11560 translate maintainer only messages.
11561
11562 2002-08-12 Paul Eggert <eggert@twinsun.com>
11563
11564 Version 1.49b.
11565
11566 * Makefile.am (SUBDIRS): Remove intl.
11567 (DISTCLEANFILES): Remove.
11568 * NEWS: Mention that GNU M4 is now required. Clarify what is
11569 meant by "larger grammars". Mention the pt_BR translation.
11570 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
11571 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
11572 Bump version from 0.11.2 to 0.11.5.
11573 (BISON_PREREQ_STAGE): Remove.
11574 (AM_GNU_GETTEXT): Use external gettext.
11575 (AC_OUTPUT): Remove intl/Makefile.
11576
11577 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
11578
11579 * data/glr.c: Include string.h, for strlen.
11580 (yyreportParseError): Use size_t for yysize.
11581 (yy_yypstack): No longer nested inside yypstates, as nested
11582 functions are not portable. Do not assume size_t is the
11583 same width as int.
11584 (yypstates): Do not assume that ptrdiff_t is the same width
11585 as int, and similarly for yyposn and YYINDEX.
11586
11587 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
11588
11589 * lib/Makefile.am (INCLUDES): Do not include from the intl
11590 directory, which has been removed.
11591 * src/Makefile.am (INCLUDES): Likewise.
11592
11593 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
11594 (bitsets_sources, additional_bitsets_sources, timevars_sources):
11595 New vars.
11596
11597 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
11598 * tests/Makefile.am (EXTRA_DIST): Likewise.
11599
11600 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
11601 Do not assume that bitset_windex is the same width as unsigned.
11602
11603 * lib/abitset.c (abitset_unused_clear): Do not assume that
11604 bitset_word is the same width as int.
11605 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
11606 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
11607 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
11608 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
11609 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
11610
11611 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
11612 portability to one's complement hosts!).
11613 * lib/ebitset.c (ebitset_op1): Likewise.
11614 * lib/lbitset.c (lbitset_op1): Likewise.
11615
11616 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
11617 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11618 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
11619 Sync with fileutils.
11620 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
11621 lib/gettext.h: Sync with diffutils.
11622
11623 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
11624 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
11625
11626 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
11627 PROTOTYPES to check for prototypes, and "defined __STDC__" to
11628 check for void *.
11629
11630 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
11631 size_t; the old version tried to do this but casted improperly.
11632 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
11633 (bitset_test): Now returns int, not unsigned long.
11634
11635 * lib/bitset_stats.c: Include "gettext.h".
11636 (_): New macro.
11637 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
11638 name locals "index", as it generates unnecessary warnings on some
11639 hosts that have an "index" function.
11640
11641 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
11642 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
11643 they need translation.
11644 * src/LR0.c (state_list_append, new_itemsets, get_state,
11645 append_states, generate_states): Likewise.
11646 * src/assoc.c (assoc_to_string): Likewise.
11647 * src/closure.c (print_closure, set_firsts, closure): Likewise.
11648 * src/gram.c (grammar_dump): Likewise.
11649 * src/injections.c (injections_compute): Likewise.
11650 * src/lalr.c (lookaheads_print): Likewise.
11651 * src/relation.c (relation_transpose): Likewise.
11652 * src/scan-gram.l: Likewise.
11653 * src/tables.c (table_grow, pack_vector): Likewise.
11654
11655 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
11656 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
11657 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
11658 * m4/mbstate_t.m4: Sync with fileutils.
11659 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
11660
11661 * po/LINGUAS: Add pt_BR.
11662 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
11663 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
11664 lib/timevar.c.
11665 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
11666 manual recommends.
11667 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
11668
11669 * src/complain.c (strerror_r): Remove decl; not needed.
11670 (strerror): Use same pattern as ../lib/error.c.
11671
11672 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
11673
11674 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
11675
11676 * src/main.c (main): Cast result of bindtextdomain and textdomain
11677 to void, to avoid a GCC warning when --disable-nls is in effect.
11678
11679 * src/scan-gram.l: Use strings rather than escapes when possible,
11680 to minimize the number of warnings from xgettext.
11681 (handle_action_dollar, handle_action_at): Don't use isdigit,
11682 as it mishandles negative chars and it may not work as expected
11683 outside the C locale.
11684
11685 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
11686 this is a GCC extension and is not portable to other compilers.
11687
11688 * src/system.h (alloca): Use same pattern as ../lib/error.c.
11689 Do not include <ctype.h>; no longer needed.
11690 Do not include <malloc.h>; no longer needed (and generates
11691 warnings on OpenBSD 3.0).
11692
11693 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
11694 it's not portable.
11695
11696 * tests/regression.at: Do not use 'cc -c input.c -o input';
11697 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
11698
11699 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
11700 exit status as failure, not just exit status 1. Sun C exits
11701 with status 2 sometimes.
11702
11703 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
11704 Use it for the two large tests.
11705
11706 2002-08-02 Akim Demaille <akim@epita.fr>
11707
11708 * src/conflicts.c (conflicts_output): Don't output rules never
11709 reduced here, since anyway that computation doesn't work.
11710 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
11711 (rule_useless_p, rule_never_reduced_p): New.
11712 (grammar_rules_partial_print): Use a filter instead of a range.
11713 Display the title only if needed.
11714 (grammar_rules_print): Adjust.
11715 (grammar_rules_never_reduced_report): New.
11716 * src/tables.c (action_row): Move the computation of rules never
11717 reduced to...
11718 (token_actions): here.
11719 * src/main.c (main): Make the parser before making the report, so
11720 that rules never reduced are computed.
11721 Call grammar_rules_never_reduced_report.
11722 * src/print.c (print_results): Report rules never reduced.
11723 * tests/conflicts.at, tests/reduce.at: Adjust.
11724
11725 2002-08-01 Akim Demaille <akim@epita.fr>
11726
11727 Instead of attaching lookaheads and duplicating the rules being
11728 reduced by a state, attach the lookaheads to the reductions.
11729
11730 * src/state.h (state_t): Remove the `lookaheads',
11731 `lookaheads_rule' member.
11732 (reductions_t): Add a `lookaheads' member.
11733 Use a regular array for the `rules'.
11734 * src/state.c (reductions_new): Initialize the lookaheads member
11735 to 0.
11736 (state_rule_lookaheads_print): Adjust.
11737 * src/state.h, src/state.c (state_reductions_find): New.
11738 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
11739 (count_rr_conflicts): Adjust.
11740 * src/lalr.c (LArule): Remove.
11741 (add_lookback_edge): Adjust.
11742 (state_lookaheads_count): New.
11743 (states_lookaheads_initialize): Merge into...
11744 (initialize_LA): this.
11745 (lalr_free): Adjust.
11746 * src/main.c (main): Don't free nullable and derives too early: it
11747 is used by --verbose.
11748 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
11749
11750 2002-08-01 Akim Demaille <akim@epita.fr>
11751
11752 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
11753 `rule_number_t**'.
11754 (set_derives, free_derives): Rename as...
11755 (derives_compute, derives_free): this.
11756 Adjust all dependencies.
11757 * src/nullable.c (set_nullable, free_nullable): Rename as...
11758 (nullable_compute, nullable_free): these.
11759 (rule_list_t): Store rule_t *, not rule_number_t.
11760 * src/state.c (state_rule_lookaheads_print): Directly compare rule
11761 pointers, instead of their numbers.
11762 * src/main.c (main): Call nullable_free, and derives_free earlier,
11763 as they were lo longer used.
11764
11765 2002-08-01 Akim Demaille <akim@epita.fr>
11766
11767 * lib/timevar.c (get_time): Include children time.
11768 * src/lalr.h (LA, LArule): Don't export them: used with the
11769 state_t.
11770 * src/lalr.c (LA, LArule): Static.
11771 * src/lalr.h, src/lalr.c (lalr_free): New.
11772 * src/main.c (main): Call it.
11773 * src/tables.c (pack_vector): Check whether loc is >= to the
11774 table_size, not >.
11775 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
11776 (tables_generate): do it, since that's also it which allocates
11777 them.
11778 Don't free LA and LArule, main does.
11779
11780 2002-07-31 Akim Demaille <akim@epita.fr>
11781
11782 Separate parser tables computation and output.
11783
11784 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
11785 (conflict_list, conflict_list_cnt, table, check, table_ninf)
11786 (yydefgoto, yydefact, high): Move to...
11787 * src/tables.h, src/tables.c: here.
11788 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11789 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11790 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
11791 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
11792 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
11793 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
11794 (action_row, save_row, token_actions, save_column, default_goto)
11795 (goto_actions, sort_actions, matching_state, pack_vector)
11796 (table_ninf_remap, pack_table, prepare_actions): Move to...
11797 * src/tables.c: here.
11798 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
11799 * src/output.c (token_actions, output_base, output_conflicts)
11800 (output_check): Merge into...
11801 (prepare_actions): this.
11802 (actions_output): Rename as...
11803 (user_actions_output): this.
11804 * src/main.c (main): Call tables_generate and tables_free.
11805
11806 2002-07-31 Akim Demaille <akim@epita.fr>
11807
11808 Steal GCC's --time-report support.
11809
11810 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
11811 stolen/adjusted from GCC.
11812 * m4/stage.m4: Remove time related checks.
11813 * m4/timevar.m4: New.
11814 * configure.in: Adjust.
11815 * src/system.h: Adjust to using timevar.h.
11816 * src/getargs.h, src/getargs.c: Support trace_time for
11817 --trace=time.
11818 * src/main.c (stage): Remove.
11819 (main): Replace `stage' invocations with timevar calls.
11820 * src/output.c: Insert pertinent timevar calls.
11821
11822 2002-07-31 Akim Demaille <akim@epita.fr>
11823
11824 Let --trace have arguments.
11825
11826 * src/getargs.h (enum trace_e): New.
11827 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
11828 (long_options, short_options): --trace/-T takes an optional
11829 argument.
11830 Change all the uses of trace_flag to reflect the new flags.
11831 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
11832
11833 Strengthen `stage' portability.
11834
11835 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
11836 * configure.in: Use it.
11837 Don't check for malloc.h and sys/times.h.
11838 * src/system.h: Include them when appropriate.
11839 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
11840 times and struct tms are available.
11841
11842 2002-07-30 Akim Demaille <akim@epita.fr>
11843
11844 In verbose parse error message, don't report `error' as an
11845 expected token.
11846 * tests/actions.at (Printers and Destructors): Adjust.
11847 * tests/calc.at (Calculator $1): Adjust.
11848 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
11849 error message, do not report the parser accepts the error token in
11850 that state.
11851
11852 2002-07-30 Akim Demaille <akim@epita.fr>
11853
11854 Normalize conflict related messages.
11855
11856 * src/complain.h, src/complain.c (warn, complain): New.
11857 * src/conflicts.c (conflicts_print): Use them.
11858 (conflict_report_yacc): New, extracted from...
11859 (conflicts_print): here.
11860 * tests/conflicts.at, tests/existing.at: Adjust.
11861
11862 2002-07-30 Akim Demaille <akim@epita.fr>
11863
11864 Report rules which are never reduced by the parser: those hidden
11865 by conflicts.
11866
11867 * src/LR0.c (save_reductions): Don't make the final state too
11868 different: save its reduction (accept) instead of having a state
11869 without any action (no shift or goto, no reduce).
11870 Note: the final state is now a ``regular'' state, i.e., the
11871 parsers now contain `reduce 0' as default reduction.
11872 Nevertheless, since they decide to `accept' when yystate =
11873 final_state, they still will not reduce rule 0.
11874 * src/print.c (print_actions, print_reduction): Adjust.
11875 * src/output.c (action_row): Track reduced rules.
11876 (token_actions): Report rules never reduced.
11877 * tests/conflicts.at, tests/regression.at: Adjust.
11878
11879 2002-07-30 Akim Demaille <akim@epita.fr>
11880
11881 `stage' was accidently included in a previous patch.
11882 Initiate its autoconfiscation.
11883
11884 * configure.in: Look for malloc.h and sys/times.h.
11885 * src/main.c (stage): Adjust.
11886 Report only when trace_flag.
11887
11888 2002-07-29 Akim Demaille <akim@epita.fr>
11889
11890 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
11891 state_number_t.
11892 (errs_t): symbol_t*, not symbol_number_t.
11893 (reductions_t): rule_t*, not rule_number_t.
11894 (FOR_EACH_SHIFT): New.
11895 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
11896 * src/print.c, src/print_graph.c: Adjust.
11897
11898 2002-07-29 Akim Demaille <akim@epita.fr>
11899
11900 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
11901
11902 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
11903 (endtoken, accept): these.
11904 * src/reader.c (reader): Set endtoken's default tag to "$end".
11905 Set undeftoken's tag to "$undefined" instead of "$undefined.".
11906 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
11907 Adjust.
11908
11909 2002-07-29 Akim Demaille <akim@epita.fr>
11910
11911 * src/reduce.c (reduce_grammar): When the language is empty,
11912 complain about the start symbol, not the axiom.
11913 Use its location.
11914 * tests/reduce.at (Empty Language): New.
11915
11916 2002-07-26 Akim Demaille <akim@epita.fr>
11917
11918 * src/reader.h, src/reader.c (gram_error): ... can't get
11919 yycontrol without making too strong assumptions on the parser
11920 itself.
11921 * src/output.c (prepare_tokens): Use the real 0th value of
11922 token_translations instead of `0'.
11923 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
11924 visible here.
11925 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
11926 for the time being: %locations ought to provide it to yyerror.
11927
11928 2002-07-25 Akim Demaille <akim@epita.fr>
11929
11930 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
11931 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
11932 * tests/regression.at (Web2c Actions): Adjust.
11933
11934 2002-07-25 Akim Demaille <akim@epita.fr>
11935
11936 Stop storing rules from 1 to nrules + 1.
11937
11938 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
11939 * src/nullable.c, src/output.c, src/print.c, src/reader.c
11940 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
11941 Iterate from 0 to nrules.
11942 Use rule_number_as_item_number and item_number_as_rule_number.
11943 Adjust to `derive' now containing possibly 0.
11944 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
11945 Handle the `- 1' part in rule numbers from/to item numbers.
11946 * src/conflicts.c (log_resolution): Fix the message which reversed
11947 shift and reduce.
11948 * src/output.c (action_row): Initialize default_rule to -1.
11949 (token_actions): Adjust.
11950 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
11951 expected output.
11952 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
11953
11954 2002-07-25 Akim Demaille <akim@epita.fr>
11955
11956 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
11957 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
11958 (b4_c_knr_arg_decl): New.
11959 * data/yacc.c: Use it to define yysymprint, yydestruct, and
11960 yyreport_parse_error.
11961
11962 2002-07-25 Akim Demaille <akim@epita.fr>
11963
11964 * data/yacc.c (yyreport_parse_error): New, extracted from...
11965 (yyparse): here.
11966 (yydestruct, yysymprint): Move above yyparse.
11967 Be K&R compliant.
11968
11969 2002-07-25 Akim Demaille <akim@epita.fr>
11970
11971 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
11972 replace...
11973 (b4_sint_type, b4_uint_type): these.
11974 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
11975 * tests/regression.at (Web2c Actions): Adjust.
11976
11977 2002-07-25 Akim Demaille <akim@epita.fr>
11978
11979 * src/gram.h (TIEM_NUMBER_MAX): New.
11980 (item_number_of_rule_number, rule_number_of_item_number): Rename
11981 as...
11982 (rule_number_as_item_number, item_number_as_rule_number): these.
11983 Adjust dependencies.
11984 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11985 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11986 (symbol_number_to_vector_number): New.
11987 (order): Of vector_number_t* type.
11988 (base_t, BASE_MAX, BASE_MIN): New.
11989 (froms, tos, width, pos, check): Of base_t type.
11990 (action_number_t, ACTION_MIN, ACTION_MAX): New.
11991 (actrow): Of action_number_t type.
11992 (conflrow): Of unsigned int type.
11993 (table_ninf, base_ninf): New.
11994 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
11995 (muscle_insert_int_table, muscle_insert_base_table)
11996 (muscle_insert_rule_number_table): New.
11997 (prepare_tokens): Output `toknum' as int_table.
11998 (action_row): Returns a rule_number_t.
11999 Use ACTION_MIN, not SHRT_MIN.
12000 (token_actions): yydefact is rule_number_t*.
12001 (table_ninf_remap): New.
12002 (pack_table): Use it for `base' and `table'.
12003 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12004 replaced with...
12005 (YYPACT_NINF, YYTABLE_NINF): these.
12006 (yypact, yytable): Compute their types instead of hard-coded
12007 `short'.
12008 * tests/regression.at (Web2c Actions): Adjust.
12009
12010 2002-07-19 Akim Demaille <akim@epita.fr>
12011
12012 * src/scan-gram.l (id): Can start with an underscore.
12013
12014 2002-07-16 Akim Demaille <akim@epita.fr>
12015
12016 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12017 Adjust all former `associativity' dependencies.
12018 * src/symtab.c (symbol_new): Default associativity is `undef', not
12019 `right'.
12020 (symbol_check_alias_consistence): Adjust.
12021
12022 2002-07-09 Akim Demaille <akim@epita.fr>
12023
12024 * doc/bison.texinfo: Properly set the ``header'' part.
12025 Use @dircategory ``GNU programming tools'' as per Texinfo's
12026 documentation.
12027 Use @copying.
12028
12029 2002-07-09 Akim Demaille <akim@epita.fr>
12030
12031 * lib/quotearg.h: Protect against multiple inclusions.
12032 * src/location.h (location_t): Add a `file' member.
12033 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12034 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12035 `error_one_per_line' support.
12036
12037 2002-07-09 Akim Demaille <akim@epita.fr>
12038
12039 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12040 * src/reader.c (lineno): Remove.
12041 Adjust all dependencies.
12042 (get_merge_function): Take a location and use complain_at.
12043 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12044 * tests/regression.at (Invalid inputs, Mixing %token styles):
12045 Adjust.
12046
12047 2002-07-09 Akim Demaille <akim@epita.fr>
12048
12049 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12050 recovery rule, and forbid extensions when --yacc.
12051 (gram_error): Use complain_at.
12052 * src/reader.c (reader): Exit if there were parse errors.
12053
12054 2002-07-09 Akim Demaille <akim@epita.fr>
12055
12056 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12057 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12058 Reported by R Blake <blakers@mac.com>.
12059
12060 2002-07-09 Akim Demaille <akim@epita.fr>
12061
12062 * data/yacc.c: Output the copyright notive in the header.
12063
12064 2002-07-03 Akim Demaille <akim@epita.fr>
12065
12066 * src/output.c (froms, tos): Are state_number_t.
12067 (save_column): sp, sp1, and sp2 are state_number_t.
12068 (prepare): Rename `final' as `final_state_number', `nnts' as
12069 `nterms_number', `nrules' as `rules_number', `nstates' as
12070 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12071 unused.
12072 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12073 * data/lalr1.cc (nsym_): Remove, unused.
12074
12075 2002-07-03 Akim Demaille <akim@epita.fr>
12076
12077 * src/lalr.h, src/lalr.c (goto_number_t): New.
12078 * src/lalr.c (goto_list_t): New.
12079 Propagate them.
12080 * src/nullable.c (rule_list_t): New.
12081 Propagate.
12082 * src/types.h: Remove.
12083
12084 2002-07-03 Akim Demaille <akim@epita.fr>
12085
12086 * src/closure.c (print_fderives): Use rule_rhs_print.
12087 * src/derives.c (print_derives): Use rule_rhs_print.
12088 (rule_list_t): New, replaces `shorts'.
12089 (set_derives): Add comments.
12090 * tests/sets.at (Nullable, Firsts): Adjust.
12091
12092 2002-07-03 Akim Demaille <akim@epita.fr>
12093
12094 * src/output.c (prepare_actions): Free `tally' and `width'.
12095 (prepare_actions): Allocate and free `order'.
12096 * src/symtab.c (symbols_free): Free `symbols'.
12097 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12098 * src/output.c (m4_invoke): Move to...
12099 * src/scan-skel.l: here.
12100 (<<EOF>>): Close yyout, and free its name.
12101
12102 2002-07-03 Akim Demaille <akim@epita.fr>
12103
12104 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12105
12106 * src/LR0.c (new_state): Merge into...
12107 (state_list_append): this.
12108 (new_states): Merge into...
12109 (generate_states): here.
12110 (set_states): Don't ensure a proper `errs' state member here, do it...
12111 * src/conflicts.c (conflicts_solve): here.
12112 * src/state.h, src/state.c: Comment changes.
12113 (state_t): Rename member `shifts' as `transitions'.
12114 Adjust all dependencies.
12115 (errs_new): For consistency, also take the values as argument.
12116 (errs_dup): Remove.
12117 (state_errs_set): New.
12118 (state_reductions_set, state_transitions_set): Assert that no
12119 previous value was assigned.
12120 (state_free): New.
12121 (states_free): Use it.
12122 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12123 temporary storage: use `errs' and `nerrs' as elsewhere.
12124 (set_conflicts): Allocate and free this `errs'.
12125
12126 2002-07-02 Akim Demaille <akim@epita.fr>
12127
12128 * lib/libiberty.h: New.
12129 * lib: Update the bitset implementation from upstream.
12130 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12131 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12132 * src/main.c: Adjust bitset stats calls.
12133
12134 2002-07-01 Paul Eggert <eggert@twinsun.com>
12135
12136 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12137 char, so that negative chars don't collide with $.
12138
12139 2002-06-30 Akim Demaille <akim@epita.fr>
12140
12141 Have the GLR tests be `warning' checked, and fix the warnings.
12142
12143 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12144 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12145 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12146 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12147 (yyaddDeferredAction): static.
12148 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12149 (yyreportParseError): yyprefix is const.
12150 yytokenp is used only when verbose.
12151 (yy__GNUC__): Replace with __GNUC__.
12152 (yypdumpstack): yyi is size_t.
12153 (yypreference): Un-yy local variables and arguments, to avoid
12154 clashes with `yyr1'. Anyway, we are not in the user name space.
12155 (yytname_size): be an int, as is compared with ints.
12156 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12157 Use them.
12158 * tests/cxx-gram.at: Use quotation to protect $1.
12159 Use AT_COMPILE to enable warnings hunts.
12160 Prototype yylex and yyerror.
12161 `Use' argc.
12162 Include `string.h', not `strings.h'.
12163 Produce and prototype stmtMerge only when used.
12164 yylex takes a location.
12165
12166 2002-06-30 Akim Demaille <akim@epita.fr>
12167
12168 We spend a lot of time in quotearg, in particular when --verbose.
12169
12170 * src/symtab.c (symbol_get): Store a quoted version of the key.
12171 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12172 Adjust all callers.
12173
12174 2002-06-30 Akim Demaille <akim@epita.fr>
12175
12176 * src/state.h (reductions_t): Rename member `nreds' as num.
12177 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12178 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12179
12180 2002-06-30 Akim Demaille <akim@epita.fr>
12181
12182 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12183 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12184 (shifts_to): Rename as...
12185 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12186 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12187 (TRANSITION_IS_DISABLED, transitions_to): these.
12188
12189 2002-06-30 Akim Demaille <akim@epita.fr>
12190
12191 * src/print.c (print_shifts, print_gotos): Merge into...
12192 (print_transitions): this.
12193 (print_transitions, print_errs, print_reductions): Align the
12194 lookaheads columns.
12195 (print_core, print_transitions, print_errs, print_state,
12196 print_grammar): Output empty lines separator before, not after.
12197 (state_default_rule_compute): Rename as...
12198 (state_default_rule): this.
12199 * tests/conflicts.at (Defaulted Conflicted Reduction),
12200 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12201 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12202
12203 2002-06-30 Akim Demaille <akim@epita.fr>
12204
12205 Display items as we display rules.
12206
12207 * src/gram.h, src/gram.c (rule_lhs_print): New.
12208 * src/gram.c (grammar_rules_partial_print): Use it.
12209 * src/print.c (print_core): Likewise.
12210 * tests/conflicts.at (Defaulted Conflicted Reduction),
12211 (Unresolved SR Conflicts): Adjust.
12212 (Unresolved SR Conflicts): Adjust and rename as...
12213 (Resolved SR Conflicts): this, as was meant.
12214 * tests/regression.at (Web2c Report): Adjust.
12215
12216 2002-06-30 Akim Demaille <akim@epita.fr>
12217
12218 * src/print.c (state_default_rule_compute): New, extracted from...
12219 (print_reductions): here.
12220 Pessimize, but clarify the code.
12221 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12222
12223 2002-06-30 Akim Demaille <akim@epita.fr>
12224
12225 * src/output.c (action_row): Let default_rule be always a rule
12226 number.
12227
12228 2002-06-30 Akim Demaille <akim@epita.fr>
12229
12230 * src/closure.c (print_firsts, print_fderives, closure):
12231 Use BITSET_EXECUTE.
12232 * src/lalr.c (lookaheads_print): Likewise.
12233 * src/state.c (state_rule_lookaheads_print): Likewise.
12234 * src/print_graph.c (print_core): Likewise.
12235 * src/print.c (print_reductions): Likewise.
12236 * src/output.c (action_row): Likewise.
12237 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12238
12239 2002-06-30 Akim Demaille <akim@epita.fr>
12240
12241 * src/print_graph.c: Use report_flag.
12242
12243 2002-06-30 Akim Demaille <akim@epita.fr>
12244
12245 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12246 to...
12247 * src/relation.h, src/relation.c (traverse, relation_digraph)
12248 (relation_print, relation_transpose): New.
12249
12250 2002-06-30 Akim Demaille <akim@epita.fr>
12251
12252 * src/state.h, src/state.c (shifts_to): New.
12253 * src/lalr.c (build_relations): Use it.
12254
12255 2002-06-30 Akim Demaille <akim@epita.fr>
12256
12257 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12258 (item_number_of_rule_number, rule_number_of_item_number): New.
12259 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12260 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12261 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12262 Propagate their use.
12263 Much remains to be done, in particular wrt `shorts' from types.h.
12264
12265 2002-06-30 Akim Demaille <akim@epita.fr>
12266
12267 * src/symtab.c (symbol_new): Initialize the `printer' member.
12268
12269 2002-06-30 Akim Demaille <akim@epita.fr>
12270
12271 * src/LR0.c (save_reductions): Remove, replaced by...
12272 * src/state.h, src/state.c (state_reductions_set): New.
12273 (reductions, errs): Rename as...
12274 (reductions_t, errs_t): these.
12275 Adjust all dependencies.
12276
12277 2002-06-30 Akim Demaille <akim@epita.fr>
12278
12279 * src/LR0.c (state_list_t, state_list_append): New.
12280 (first_state, last_state): Now symbol_list_t.
12281 (this_state): Remove.
12282 (new_itemsets, append_states, save_reductions): Take a state_t as
12283 argument.
12284 (set_states, generate_states): Adjust.
12285 (save_shifts): Remove, replaced by...
12286 * src/state.h, src/state.c (state_shifts_set): New.
12287 (shifts): Rename as...
12288 (shifts_t): this.
12289 Adjust all dependencies.
12290 * src/state.h (state_t): Remove the `next' member.
12291
12292 2002-06-30 Akim Demaille <akim@epita.fr>
12293
12294 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
12295 escaped in slot 0.
12296
12297 2002-06-30 Akim Demaille <akim@epita.fr>
12298
12299 Use hash.h for the state hash table.
12300
12301 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
12302 (allocate_storage): Use state_hash_new.
12303 (free_storage): Use state_hash_free.
12304 (new_state, get_state): Adjust.
12305 * src/lalr.h, src/lalr.c (states): Move to...
12306 * src/states.h (state_t): Remove the `link' member, no longer
12307 used.
12308 * src/states.h, src/states.c: here.
12309 (state_hash_new, state_hash_free, state_hash_lookup)
12310 (state_hash_insert, states_free): New.
12311 * src/states.c (state_table, state_compare, state_hash): New.
12312 * src/output.c (output_actions): Do not free states now, since we
12313 still need to know the final_state number in `prepare', called
12314 afterwards. Do it...
12315 * src/main.c (main): here: call states_free after `output'.
12316
12317 2002-06-30 Akim Demaille <akim@epita.fr>
12318
12319 * src/state.h, src/state.c (state_new): New, extracted from...
12320 * src/LR0.c (new_state): here.
12321 * src/state.h (STATE_ALLOC): Move to...
12322 * src/state.c: here.
12323 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
12324 * src/state.h, src/state.c: here.
12325
12326 2002-06-30 Akim Demaille <akim@epita.fr>
12327
12328 * src/reader.c (gensym): Rename as...
12329 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
12330 (getsym): Rename as...
12331 (symbol_get): this.
12332
12333 2002-06-30 Akim Demaille <akim@epita.fr>
12334
12335 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
12336 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
12337 * src/output.c, src/print.c, src/print_graph.c: Propagate.
12338 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
12339
12340 2002-06-30 Akim Demaille <akim@epita.fr>
12341
12342 Make the test suite pass with warnings checked.
12343
12344 * tests/actions.at (Printers and Destructors): Improve.
12345 Avoid unsigned vs. signed issues.
12346 * tests/calc.at: Don't exercise the scanner here, do it...
12347 * tests/input.at (Torturing the Scanner): here.
12348
12349 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12350
12351 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
12352 reorganize first lines parallel to yacc.c.
12353
12354 2002-06-28 Akim Demaille <akim@epita.fr>
12355
12356 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
12357 (b4_token_enum, b4_token_defines): New, factored from...
12358 * data/lalr1.cc, data/yacc.c, glr.c: here.
12359
12360 2002-06-28 Akim Demaille <akim@epita.fr>
12361
12362 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
12363 unused variables.
12364 * src/output.c (merger_output): static.
12365
12366 2002-06-28 Akim Demaille <akim@epita.fr>
12367
12368 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
12369 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
12370 pacify GCC.
12371 * src/output.c (save_row): Initialize all the variables to pacify GCC.
12372
12373 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12374
12375 Accumulated changelog for new GLR parsing features.
12376
12377 * src/conflicts.c (count_total_conflicts): Change name to
12378 conflicts_total_count.
12379 * src/conflicts.h: Ditto.
12380 * src/output.c (token_actions): Use the new name.
12381 (output_conflicts): Change conflp => conflict_list_heads, and
12382 confl => conflict_list for better readability.
12383 * data/glr.c: Use the new names.
12384 * NEWS: Add self to GLR announcement.
12385
12386 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
12387
12388 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
12389 Akim Demaille.
12390
12391 * data/bison.glr: Change name to glr.c
12392 * data/glr.c: Renamed from bison.glr.
12393 * data/Makefile.am: Add glr.c
12394
12395 * src/getargs.c:
12396
12397 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
12398 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
12399
12400 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12401
12402 * data/bison.glr: Be sure to restore the
12403 current #line when returning to the skeleton contents after having
12404 exposed the input file's #line.
12405
12406 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12407
12408 * data/bison.glr: Bring up to date with changes to bison.simple.
12409
12410 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12411
12412 * data/bison.glr: Correct definitions that use b4_prefix.
12413 Various reformatting.
12414 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
12415 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
12416 yytokenp argument; now part of stack.
12417 (yychar): Define to behave as documented.
12418 (yyclearin): Ditto.
12419
12420 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12421
12422 * src/reader.h: Add declaration for free_merger_functions.
12423
12424 * src/reader.c (merge_functions): New variable.
12425 (get_merge_function): New function.
12426 (free_merger_functions): New function.
12427 (readgram): Check for %prec that is not followed by a symbol.
12428 Handle %dprec and %merge declarations.
12429 (packgram): Initialize dprec and merger fields in rules array.
12430
12431 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
12432 conflict_list_cnt, conflict_list_free): New variables.
12433 (table_grow): Also grow conflict_table.
12434 (prepare_rules): Output dprec and merger tables.
12435 (conflict_row): New function.
12436 (action_row): Output conflict lists for GLR parser. Don't use
12437 default reduction in conflicted states for GLR parser so that there
12438 are spaces for the conflict lists.
12439 (save_row): Also save conflict information.
12440 (token_actions): Allocate conflict list.
12441 (merger_output): New function.
12442 (pack_vector): Pack conflict table, too.
12443 (output_conflicts): New function to output yyconflp and yyconfl.
12444 (output_check): Allocate conflict_tos.
12445 (output_actions): Output conflict tables, also.
12446 (output_skeleton): Output b4_mergers definition.
12447 (prepare): Output b4_max_rhs_length definition.
12448 Use 'bison.glr' as default skeleton for GLR parsers.
12449
12450 * src/gram.c (glr_parser): New flag.
12451 (grammar_free): Call free_merger_functions.
12452
12453 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
12454 all pairs of conflicting reductions, rather than just all tokens
12455 causing conflicts. Needed to size conflict tables.
12456 (conflicts_output): Modify call to count_rr_conflicts for new
12457 interface.
12458 (conflicts_print): Ditto.
12459 (count_total_conflicts): New function.
12460
12461 * src/reader.h (merger_list): New type.
12462 (merge_functions): New variable.
12463
12464 * src/lex.h (tok_dprec, tok_merge): New token types.
12465
12466 * src/gram.h (rule_s): Add dprec and merger fields.
12467 (glr_parser): New flag.
12468
12469 * src/conflicts.h (count_total_conflicts): New function.
12470
12471 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
12472
12473 * doc/bison.texinfo (Generalized LR Parsing): New section.
12474 (GLR Parsers): New section.
12475 (Language and Grammar): Mention GLR parsing.
12476 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
12477 Correct typo ("tge" -> "the").
12478
12479 * data/bison.glr: New skeleton for GLR parsing.
12480
12481 * tests/cxx-gram.at: New tests for GLR parsing.
12482
12483 * tests/testsuite.at: Include cxx-gram.at.
12484
12485 * tests/Makefile.am: Add cxx-gram.at.
12486
12487 * src/parse-gram.y:
12488
12489 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
12490
12491 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
12492
12493 2002-06-27 Akim Demaille <akim@epita.fr>
12494
12495 * src/options.h, src/options.c: Remove.
12496 * src/getargs.c (short_options, long_options): New.
12497
12498 2002-06-27 Akim Demaille <akim@epita.fr>
12499
12500 * data/bison.simple, data/bison.c++: Rename as...
12501 * data/yacc.c, data/lalr1.cc: these.
12502 * doc/bison.texinfo (Environment Variables): Remove.
12503
12504 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
12505
12506 * src/getargs.c (report_argmatch): Initialize strtok().
12507
12508 2002-06-20 Akim Demaille <akim@epita.fr>
12509
12510 * data/bison.simple (b4_symbol_actions): New, replaces...
12511 (b4_symbol_destructor, b4_symbol_printer): these.
12512 (yysymprint): Be sure to call YYPRINT only for tokens, and using
12513 user token numbers.
12514
12515 2002-06-20 Akim Demaille <akim@epita.fr>
12516
12517 * data/bison.simple (yydestructor): Rename as...
12518 (yydestruct): this.
12519
12520 2002-06-20 Akim Demaille <akim@epita.fr>
12521
12522 * src/symtab.h, src/symtab.c (symbol_type_set)
12523 (symbol_destructor_set, symbol_precedence_set): The location is
12524 the last argument.
12525 Adjust all callers.
12526
12527 2002-06-20 Akim Demaille <akim@epita.fr>
12528
12529 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
12530 internals.
12531 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
12532 Takes a location.
12533 * src/symtab.h, src/symtab.c (symbol_class_set)
12534 (symbol_user_token_number_set): Likewise.
12535 Adjust all callers.
12536 Promote complain_at.
12537 * tests/input.at (Type Clashes): Adjust.
12538
12539 2002-06-20 Akim Demaille <akim@epita.fr>
12540
12541 * data/bison.simple (YYLEX): Fix the declaration when
12542 %pure-parser.
12543
12544 2002-06-20 Akim Demaille <akim@epita.fr>
12545
12546 * data/bison.simple (yysymprint): Don't print the token number,
12547 just its name.
12548 * tests/actions.at (Destructors): Rename as...
12549 (Printers and Destructors): this.
12550 Also exercise %printer.
12551
12552 2002-06-20 Akim Demaille <akim@epita.fr>
12553
12554 * data/bison.simple (YYDSYMPRINT): New.
12555 Use it to remove many of the #if YYDEBUG/if (yydebug).
12556
12557 2002-06-20 Akim Demaille <akim@epita.fr>
12558
12559 * src/symtab.h, src/symtab.c (symbol_t): printer and
12560 printer_location are new members.
12561 (symbol_printer_set): New.
12562 * src/parse-gram.y (PERCENT_PRINTER): New token.
12563 Handle its associated rule.
12564 * src/scan-gram.l: Adjust.
12565 (handle_destructor_at, handle_destructor_dollar): Rename as...
12566 (handle_symbol_code_at, handle_symbol_code_dollar): these.
12567 * src/output.c (symbol_printers_output): New.
12568 (output_skeleton): Call it.
12569 * data/bison.simple (yysymprint): New. Cannot be named yyprint
12570 since there are already many grammar files with a user `yyprint'.
12571 Replace the calls to YYPRINT to calls to yysymprint.
12572 * tests/calc.at: Adjust.
12573 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
12574 taking advantage of parser very internal details (stack size!).
12575
12576 2002-06-20 Akim Demaille <akim@epita.fr>
12577
12578 * src/scan-gram.l: Complete the scanner with the missing patterns
12579 to pacify Flex.
12580 Use `quote' and `symbol_tag_get' where appropriate.
12581
12582 2002-06-19 Akim Demaille <akim@epita.fr>
12583
12584 * tests/actions.at (Destructors): Augment to test locations.
12585 * data/bison.simple (yydestructor): Pass it the current location
12586 if locations are enabled.
12587 Prototype only when __STDC__ or C++.
12588 Change the argument names to move into the yy name space: there is
12589 user code here.
12590
12591 2002-06-19 Akim Demaille <akim@epita.fr>
12592
12593 * data/bison.simple (b4_pure_if): New.
12594 Use it instead of #ifdef YYPURE.
12595
12596 2002-06-19 Akim Demaille <akim@epita.fr>
12597
12598 * data/bison.simple (b4_location_if): New.
12599 Use it instead of #ifdef YYLSP_NEEDED.
12600
12601 2002-06-19 Akim Demaille <akim@epita.fr>
12602
12603 Prepare @$ in %destructor, but currently don't bind it in the
12604 skeleton, as %location use is not cleaned up yet.
12605
12606 * src/scan-gram.l (handle_dollar, handle_destructor_at)
12607 (handle_action_at): New.
12608 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
12609 a braced_code_t and a location as additional arguments.
12610 (handle_destructor_dollar): Instead of requiring `b4_eval', just
12611 unquote one when outputting `b4_dollar_dollar'.
12612 Adjust callers.
12613 * data/bison.simple (b4_eval): Remove.
12614 (b4_symbol_destructor): Adjust.
12615 * tests/input.at (Invalid @n): Adjust.
12616
12617 2002-06-19 Zack Weinberg <zack@codesourcery.com>
12618
12619 * doc/bison.texinfo: Document ability to have multiple
12620 prologue sections.
12621
12622 2002-06-18 Akim Demaille <akim@epita.fr>
12623
12624 * src/files.c (compute_base_names): When computing the output file
12625 names from the input file name, strip the directory part.
12626
12627 2002-06-18 Akim Demaille <akim@epita.fr>
12628
12629 * data/bison.simple.new: Comment changes.
12630 Reported by Andreas Schwab.
12631
12632 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
12633
12634 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
12635 there are no `label `yyoverflowlab' defined but not used' warnings
12636 when yyoverflow is defined.
12637
12638 2002-06-18 Akim Demaille <akim@epita.fr>
12639
12640 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
12641 new member.
12642 (symbol_destructor_set): Adjust.
12643 * src/output.c (symbol_destructors_output): Output the destructor
12644 locations.
12645 Output the symbol name.
12646 * data/bison.simple (b4_symbol_destructor): Adjust.
12647
12648 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
12649 and Akim Demaille <akim@epita.fr>
12650
12651 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
12652 what's left on the stack when the error recovery hits EOF.
12653 * tests/actions.at (Destructors): Complete to exercise this case.
12654
12655 2002-06-17 Akim Demaille <akim@epita.fr>
12656
12657 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
12658 arguments is really empty, not only equal to `[]'.
12659 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
12660 member.
12661 (symbol_destructor_set): New.
12662 * src/output.c (symbol_destructors_output): New.
12663 * src/reader.h (brace_code_t, current_braced_code): New.
12664 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
12665 (handle_dollar): Rename as...
12666 (handle_action_dollar): this.
12667 (handle_destructor_dollar): New.
12668 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
12669 (grammar_declaration): Use it.
12670 * data/bison.simple (yystos): Is always defined.
12671 (yydestructor): New.
12672 * tests/actions.at (Destructors): New.
12673 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
12674
12675 2002-06-17 Akim Demaille <akim@epita.fr>
12676
12677 * src/symlist.h, src/symlist.c (symbol_list_length): New.
12678 * src/scan-gram.l (handle_dollar, handle_at): Compute the
12679 rule_length only when needed.
12680 * src/output.c (actions_output, token_definitions_output): Output
12681 the full M4 block.
12682 * src/symtab.c: Don't access directly to the symbol tag, use
12683 symbol_tag_get.
12684 * src/parse-gram.y: Use symbol_list_free.
12685
12686 2002-06-17 Akim Demaille <akim@epita.fr>
12687
12688 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
12689 (symbol_list_prepend, get_type_name): Move to...
12690 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
12691 (symbol_list_prepend, symbol_list_n_type_name_get): here.
12692 Adjust all callers.
12693 (symbol_list_free): New.
12694 * src/scan-gram.l (handle_dollar): Takes a location.
12695 * tests/input.at (Invalid $n): Adjust.
12696
12697 2002-06-17 Akim Demaille <akim@epita.fr>
12698
12699 * src/reader.h, src/reader.c (symbol_list_new): Export it.
12700 (symbol_list_prepend): New.
12701 * src/parse-gram.y (%union): `list' is a new member.
12702 (symbols.1): New, replaces...
12703 (terms_to_prec.1, nterms_to_type.1): these.
12704 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
12705 Take a location as additional argument.
12706 Adjust all callers.
12707
12708 2002-06-15 Akim Demaille <akim@epita.fr>
12709
12710 * src/parse-gram.y: Move %token in the declaration section so that
12711 we don't depend upon CVS Bison.
12712
12713 2002-06-15 Akim Demaille <akim@epita.fr>
12714
12715 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
12716 * src/print.c (print_core): Use it.
12717
12718 2002-06-15 Akim Demaille <akim@epita.fr>
12719
12720 * src/conflicts.c (log_resolution): Accept the rule involved in
12721 the sr conflicts instead of the lookahead number that points to
12722 that rule.
12723 (flush_reduce): Accept the current lookahead vector as argument,
12724 instead of the index in LA.
12725 (resolve_sr_conflict): Accept the current number of lookahead
12726 bitset to consider for the STATE, instead of the index in LA.
12727 (set_conflicts): Adjust.
12728 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
12729
12730 2002-06-15 Akim Demaille <akim@epita.fr>
12731
12732 * src/state.h (state_t): Replace the `lookaheadsp' member, a
12733 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
12734 Adjust all dependencies.
12735 * src/lalr.c (initialize_lookaheads): Split into...
12736 (states_lookaheads_count, states_lookaheads_initialize): these.
12737 (lalr): Adjust.
12738
12739 2002-06-15 Akim Demaille <akim@epita.fr>
12740
12741 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
12742 out of...
12743 (grammar_rules_print): here.
12744 * src/reduce.c (reduce_output): Use it.
12745 * tests/reduce.at (Useless Rules, Reduced Automaton)
12746 (Underivable Rules): Adjust.
12747
12748 2002-06-15 Akim Demaille <akim@epita.fr>
12749
12750 Copy BYacc's nice way to report the grammar.
12751
12752 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
12753 New.
12754 Don't print the rules' location, it is confusing and useless.
12755 (rule_print): Use grammar_rhs_print.
12756 * src/print.c (print_grammar): Use grammar_rules_print.
12757
12758 2002-06-15 Akim Demaille <akim@epita.fr>
12759
12760 Complete and rationalize `useless thing' warnings.
12761
12762 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
12763 (symbol_tag_print): New.
12764 Use them everywhere in place of accessing directly the tag member.
12765 * src/gram.h, src/gram.c (rule_print): New.
12766 Use it where a rule used to be printed `by hand'.
12767 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
12768 (reduce_grammar_tables): Report the useless rules.
12769 (reduce_print): Useless things are a warning, not an error.
12770 Report it as such.
12771 * tests/reduce.at (Useless Nonterminals, Useless Rules):
12772 (Reduced Automaton, Underivable Rules): Adjust.
12773 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
12774 * tests/conflicts.at (Unresolved SR Conflicts)
12775 (Solved SR Conflicts): Adjust.
12776
12777 2002-06-15 Akim Demaille <akim@epita.fr>
12778
12779 Let symbols have a location.
12780
12781 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
12782 (getsym): Adjust.
12783 Adjust all callers.
12784 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
12785 Use location_t, not int.
12786 * src/symtab.c (symbol_check_defined): Take advantage of the
12787 location.
12788 * tests/regression.at (Invalid inputs): Adjust.
12789
12790 2002-06-15 Akim Demaille <akim@epita.fr>
12791
12792 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
12793 (input): Don't try to initialize yylloc here, do it in the
12794 scanner.
12795 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
12796 * src/gram.h (rule_t): Change line and action_line into location
12797 and action_location, of location_t type.
12798 Adjust all dependencies.
12799 * src/location.h, src/location.c (empty_location): New.
12800 * src/reader.h, src/reader.c (grammar_start_symbol_set)
12801 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
12802 (grammar_current_rule_symbol_append)
12803 (grammar_current_rule_action_append): Expect a location as argument.
12804 * src/reader.c (grammar_midrule_action): Adjust to attach an
12805 action's location as dummy symbol location.
12806 * src/symtab.h, src/symtab.c (startsymbol_location): New.
12807 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
12808 the line numbers.
12809
12810 2002-06-14 Akim Demaille <akim@epita.fr>
12811
12812 Grammar declarations may be found in the grammar section.
12813
12814 * src/parse-gram.y (rules_or_grammar_declaration): New.
12815 (declarations): Each declaration may end with a semicolon, not
12816 just...
12817 (grammar_declaration): `"%union"'.
12818 (grammar): Branch to rules_or_grammar_declaration.
12819
12820 2002-06-14 Akim Demaille <akim@epita.fr>
12821
12822 * src/main.c (main): Invoke scanner_free.
12823
12824 2002-06-14 Akim Demaille <akim@epita.fr>
12825
12826 * src/output.c (m4_invoke): Extracted from...
12827 (output_skeleton): here.
12828 Free tempfile.
12829
12830 2002-06-14 Akim Demaille <akim@epita.fr>
12831
12832 * src/parse-gram.y (directives, directive, gram)
12833 (grammar_directives, precedence_directives, precedence_directive):
12834 Rename as...
12835 (declarations, declaration, grammar, grammar_declaration)
12836 (precedence_declaration, precedence_declarator): these.
12837 (symbol_declaration): New.
12838
12839 2002-06-14 Akim Demaille <akim@epita.fr>
12840
12841 * src/files.c (action_obstack): Remove, unused.
12842 (output_obstack): Remove it, and all its dependencies, as it is no
12843 longer needed.
12844 * src/reader.c (epilogue_set): Build the epilogue in the
12845 muscle_obstack.
12846 * src/output.h, src/output.c (muscle_obstack): Move to...
12847 * src/muscle_tab.h, src/muscle_tab.h: here.
12848 (muscle_init): Initialize muscle_obstack.
12849 (muscle_free): New.
12850 * src/main.c (main): Call it.
12851
12852 2002-06-14 Akim Demaille <akim@epita.fr>
12853
12854 * src/location.h: New, extracted from...
12855 * src/reader.h: here.
12856 * src/Makefile.am (noinst_HEADERS): Merge into
12857 (bison_SOURCES): this.
12858 Add location.h.
12859 * src/parse-gram.y: Use location_t instead of Bison's.
12860 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
12861 Use location_t instead of ints.
12862
12863 2002-06-14 Akim Demaille <akim@epita.fr>
12864
12865 * data/bison.simple, data/bison.c++: Be sure to restore the
12866 current #line when returning to the skeleton contents after having
12867 exposed the input file's #line.
12868
12869 2002-06-12 Akim Demaille <akim@epita.fr>
12870
12871 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
12872 eager.
12873 * tests/actions.at (Exotic Dollars): New.
12874
12875 2002-06-12 Akim Demaille <akim@epita.fr>
12876
12877 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
12878 ['"/] too eagerly.
12879 * tests/input.at (Torturing the Scanner): New.
12880
12881 2002-06-11 Akim Demaille <akim@epita.fr>
12882
12883 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
12884 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
12885 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
12886 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
12887 * src/reader.c (reader): Use it.
12888
12889 2002-06-11 Akim Demaille <akim@epita.fr>
12890
12891 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
12892 Adjust all callers.
12893 (scanner_last_string_free): New.
12894
12895 2002-06-11 Akim Demaille <akim@epita.fr>
12896
12897 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
12898 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
12899 (last_string, YY_OBS_FREE): New.
12900 Use them when returning an ID.
12901
12902 2002-06-11 Akim Demaille <akim@epita.fr>
12903
12904 Have Bison grammars parsed by a Bison grammar.
12905
12906 * src/reader.c, src/reader.h (prologue_augment): New.
12907 * src/reader.c (copy_definition): Remove.
12908
12909 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
12910 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
12911 (grammar_current_rule_prec_set, grammar_current_rule_check)
12912 (grammar_current_rule_symbol_append)
12913 (grammar_current_rule_action_append): Export.
12914 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
12915 (symbol_list_action_append): Remove.
12916 Hook the routines from reader.
12917 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
12918 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
12919
12920 * src/reader.c (read_declarations): Remove, unused.
12921
12922 * src/parse-gram.y: Handle the epilogue.
12923 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
12924 (grammar_start_symbol_set): this.
12925 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
12926 * src/reader.c (readgram): Remove, unused.
12927 (reader): Adjust to insert eoftoken and axiom where appropriate.
12928
12929 * src/reader.c (copy_dollar): Replace with...
12930 * src/scan-gram.h (handle_dollar): this.
12931 * src/parse-gram.y: Remove `%thong'.
12932
12933 * src/reader.c (copy_at): Replace with...
12934 * src/scan-gram.h (handle_at): this.
12935
12936 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
12937 New.
12938
12939 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
12940 time being.
12941
12942 * src/reader.h, src/reader.c (grammar_rule_end): New.
12943
12944 * src/parse.y (current_type, current_class): New.
12945 Implement `%nterm', `%token' support.
12946 Merge `%term' into `%token'.
12947 (string_as_id): New.
12948 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
12949 type name.
12950
12951 * src/parse-gram.y: Be sure to handle properly the beginning of
12952 rules.
12953
12954 * src/parse-gram.y: Handle %type.
12955 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
12956
12957 * src/parse-gram.y: More directives support.
12958 * src/options.c: No longer handle source directives.
12959
12960 * src/parse-gram.y: Fix %output.
12961
12962 * src/parse-gram.y: Handle %union.
12963 Use the prologue locations.
12964 * src/reader.c (parse_union_decl): Remove.
12965
12966 * src/reader.h, src/reader.c (epilogue_set): New.
12967 * src/parse-gram.y: Use it.
12968
12969 * data/bison.simple, data/bison.c++: b4_stype is now either not
12970 defined, then default to int, or to the contents of %union,
12971 without `union' itself.
12972 Adjust.
12973 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
12974
12975 * src/output.c (actions_output): Don't output braces, as they are
12976 already handled by the scanner.
12977
12978 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
12979 characters to themselves.
12980
12981 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
12982 that the epilogue has a proper #line.
12983
12984 * src/parse-gram.y: Handle precedence/associativity.
12985
12986 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
12987 a terminal.
12988 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
12989 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
12990 at all to define terminals that cannot be emitted.
12991
12992 * src/scan-gram.l: Escape M4 characters.
12993
12994 * src/scan-gram.l: Working properly with escapes in user
12995 strings/characters.
12996
12997 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
12998 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
12999 grammar.
13000 Use more modest sizes, as for the time being the parser does not
13001 release memory, and therefore the process swallows a huge amount
13002 of memory.
13003
13004 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13005 stricter %token grammar.
13006
13007 * src/symtab.h (associativity): Add `undef_assoc'.
13008 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13009 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13010
13011 * tests/regression.at (Invalid %directive): Remove, as it is now
13012 meaningless.
13013 (Invalid inputs): Adjust to the new error messages.
13014 (Token definitions): The new grammar doesn't allow too many
13015 eccentricities.
13016
13017 * src/lex.h, src/lex.c: Remove.
13018 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13019 (copy_character, copy_string2, copy_string, copy_identifier)
13020 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13021 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13022 (parse_action): Remove.
13023 * po/POTFILES.in: Adjust.
13024
13025 2002-06-11 Akim Demaille <akim@epita.fr>
13026
13027 * src/reader.c (parse_action): Don't store directly into the
13028 rule's action member: return the action as a string.
13029 Don't require `rule_length' as an argument: compute it.
13030 (grammar_current_rule_symbol_append)
13031 (grammar_current_rule_action_append): New, eved out from
13032 (readgram): here.
13033 Remove `action_flag', `rulelength', unused now.
13034
13035 2002-06-11 Akim Demaille <akim@epita.fr>
13036
13037 * src/reader.c (grammar_current_rule_prec_set).
13038 (grammar_current_rule_check): New, eved out from...
13039 (readgram): here.
13040 Remove `xaction', `first_rhs': useless.
13041 * tests/input.at (Type clashes): New.
13042 * tests/existing.at (GNU Cim Grammar): Adjust.
13043
13044 2002-06-11 Akim Demaille <akim@epita.fr>
13045
13046 * src/reader.c (grammar_midrule_action): New, Eved out from
13047 (readgram): here.
13048
13049 2002-06-11 Akim Demaille <akim@epita.fr>
13050
13051 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13052 New.
13053 (readgram): Use them as replacement of inlined code, crule and
13054 crule1.
13055
13056 2002-06-11 Akim Demaille <akim@epita.fr>
13057
13058 * src/reader.c (grammar_end, grammar_symbol_append): New.
13059 (readgram): Use them.
13060 Make the use of `p' as local as possible.
13061
13062 2002-06-10 Akim Demaille <akim@epita.fr>
13063
13064 GCJ's parser requires the tokens to be defined before the prologue.
13065
13066 * data/bison.simple: Output the token definition before the user's
13067 prologue.
13068 * tests/regression.at (Braces parsing, Duplicate string)
13069 (Mixing %token styles): Check the output from bison.
13070 (Early token definitions): New.
13071
13072 2002-06-10 Akim Demaille <akim@epita.fr>
13073
13074 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13075 assigning twice the same user number to a token, so that we can
13076 use it in...
13077 * src/lex.c (lex): here.
13078 Also use `symbol_class_set' instead of hand written code.
13079 * src/reader.c (parse_assoc_decl): Likewise.
13080
13081 2002-06-10 Akim Demaille <akim@epita.fr>
13082
13083 * src/symtab.c, src/symtab.c (symbol_class_set)
13084 (symbol_user_token_number_set): New.
13085 * src/reader.c (parse_token_decl): Use them.
13086 Use a switch instead of ifs.
13087 Use a single argument.
13088
13089 2002-06-10 Akim Demaille <akim@epita.fr>
13090
13091 Remove `%thong' support as it is undocumented, unused, duplicates
13092 `%token's job, and creates useless e-mail traffic with people who
13093 want to know what it is, why it is undocumented, unused, and
13094 duplicates `%token's job.
13095
13096 * src/reader.c (parse_thong_decl): Remove.
13097 * src/options.c (option_table): Remove "thong".
13098 * src/lex.h (tok_thong): Remove.
13099
13100 2002-06-10 Akim Demaille <akim@epita.fr>
13101
13102 * src/symtab.c, src/symtab.c (symbol_type_set)
13103 (symbol_precedence_set): New.
13104 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13105 (value_components_used): Remove, unused.
13106
13107 2002-06-09 Akim Demaille <akim@epita.fr>
13108
13109 Move symbols handling code out of the reader.
13110
13111 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13112 (axiom): Move to...
13113 * src/symtab.h, src/symtab.c: here.
13114
13115 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13116 * src/reader.c (startval): Rename as...
13117 * src/symtab.h, src/symtab.c (startsymbol): this.
13118 * src/reader.c: Adjust.
13119
13120 * src/reader.c (symbol_check_defined, symbol_make_alias)
13121 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13122 (token_translations_init)
13123 Move to...
13124 * src/symtab.c: here.
13125 * src/reader.c (packsymbols): Move to...
13126 * src/symtab.h, src/symtab.c (symbols_pack): here.
13127 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13128 argument.
13129
13130 2002-06-03 Akim Demaille <akim@epita.fr>
13131
13132 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13133 then statements.
13134
13135 2002-06-03 Akim Demaille <akim@epita.fr>
13136
13137 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13138 structs with non literals.
13139 * src/scan-skel.l: never-interactive.
13140 * src/conflicts.c (enum conflict_resolution_e): No trailing
13141 comma.
13142 * src/getargs.c (usage): Split long literal strings.
13143 Reported by Hans Aberg.
13144
13145 2002-05-28 Akim Demaille <akim@epita.fr>
13146
13147 * data/bison.c++: Use C++ ostreams.
13148 (cdebug_): New member.
13149
13150 2002-05-28 Akim Demaille <akim@epita.fr>
13151
13152 * src/output.c (output_skeleton): Be sure to allocate enough room
13153 for `/' _and_ for `\0' in full_skeleton.
13154
13155 2002-05-28 Akim Demaille <akim@epita.fr>
13156
13157 * data/bison.c++: Catch up with bison.simple:
13158 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13159 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13160 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13161 and popping traces.
13162
13163 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13164
13165 * src/output.c (output_skeleton): Put an explicit path in front of
13166 the skeleton file name, rather than relying on the -I directory,
13167 to partially alleviate effects of having a skeleton file lying around
13168 in the current directory.
13169
13170 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13171
13172 * src/conflicts.c (log_resolution): Correct typo:
13173 obstack_printf should be obstack_fgrow1.
13174
13175 2002-05-26 Akim Demaille <akim@epita.fr>
13176
13177 * src/state.h (state_t): `solved_conflicts' is a new member.
13178 * src/LR0.c (new_state): Set it to 0.
13179 * src/conflicts.h, src/conflicts.c (print_conflicts)
13180 (free_conflicts, solve_conflicts): Rename as...
13181 (conflicts_print, conflicts_free, conflicts_solve): these.
13182 Adjust callers.
13183 * src/conflicts.c (enum conflict_resolution_e)
13184 (solved_conflicts_obstack): New, used by...
13185 (log_resolution): this.
13186 Adjust to attach the conflict resolution to each state.
13187 Complete the description with the precedence/associativity
13188 information.
13189 (resolve_sr_conflict): Adjust.
13190 * src/print.c (print_state): Output its solved_conflicts.
13191 * tests/conflicts.at (Unresolved SR Conflicts)
13192 (Solved SR Conflicts): Exercise --report=all.
13193
13194 2002-05-26 Akim Demaille <akim@epita.fr>
13195
13196 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13197 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13198 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13199 (token_number_t, item_number_as_token_number)
13200 (token_number_as_item_number, muscle_insert_token_number_table):
13201 Rename as...
13202 (symbol_number_t, item_number_as_symbol_number)
13203 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13204 these, since it is more appropriate.
13205
13206 2002-05-26 Akim Demaille <akim@epita.fr>
13207
13208 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13209 `Error:' lines.
13210 * data/bison.simple (yystos) [YYDEBUG]: New.
13211 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13212 error recovery.
13213 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13214
13215 2002-05-25 Akim Demaille <akim@epita.fr>
13216
13217 * doc/bison.texinfo (Debugging): Split into...
13218 (Tracing): this new section, its former contents, and...
13219 (Understanding): this new section.
13220 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13221 by...
13222 (report_flag): this.
13223 Adjust all dependencies.
13224 (report_args, report_types, report_argmatch): New.
13225 (usage, getargs): Report/support -r, --report.
13226 * src/options.h
13227 (struct option_table_struct): Rename as..,
13228 (struct option_table_s): this.
13229 Rename the `set_flag' member to `flag' to match with getopt_long's
13230 struct.
13231 * src/options.c (option_table): Split verbose into an entry for
13232 %verbose, and another for --verbose.
13233 Support --report/-r, so remove -r from the obsolete --raw.
13234 * src/print.c: Attach full item sets and lookaheads reports to
13235 report_flag instead of trace_flag.
13236 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13237
13238 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13239 and Paul Eggert <eggert@twinsun.com>
13240
13241 * data/bison.simple (yyparse): Correct error handling to conform to
13242 POSIX and yacc. Specifically, after syntax error is discovered,
13243 do not reduce further before shifting the error token.
13244 Clean up the code a bit by removing the labels yyerrdefault,
13245 yyerrhandle, yyerrpop.
13246 * NEWS: Document the above.
13247
13248 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13249
13250 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13251 type; it isn't always big enough, since it doesn't necessarily
13252 include non-terminals.
13253 (yytranslate): Expand definition of yy_token_number_type, so that
13254 the latter can be removed.
13255 (yy_token_number_type): Remove, only one use.
13256 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13257 don't use TokenNumberType as element type.
13258
13259 * tests/regression.at: Modify expected output to agree with change
13260 to yyr1 and yytranslate.
13261
13262 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13263
13264 * src/reader.c (parse_action): Use copy_character instead of
13265 obstack_1grow.
13266
13267 2002-05-13 Akim Demaille <akim@epita.fr>
13268
13269 * tests/regression.at (Token definitions): Prototype yylex and
13270 yyerror.
13271
13272 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13273
13274 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
13275 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13276 32-bit arithmetic.
13277 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13278
13279 2002-05-07 Akim Demaille <akim@epita.fr>
13280
13281 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13282 avoid GCC warnings.
13283
13284 2002-05-07 Akim Demaille <akim@epita.fr>
13285
13286 Kill GCC warnings.
13287
13288 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
13289 over the RHS of each rule.
13290 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
13291 * src/state.h (state_t): Member `nitems' is unsigned short.
13292 * src/LR0.c (get_state): Adjust.
13293 * src/reader.c (packgram): Likewise.
13294 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
13295 `Type'.
13296 (muscle_insert_int_table): Remove, unused.
13297 (prepare_rules): Remove `max'.
13298
13299 2002-05-06 Akim Demaille <akim@epita.fr>
13300
13301 * src/closure.c (print_firsts): Display of the symbol tags.
13302 (bitmatrix_print): Move to...
13303 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
13304 here.
13305 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
13306
13307 2002-05-06 Akim Demaille <akim@epita.fr>
13308
13309 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
13310 hash_do_for_each.
13311
13312 2002-05-06 Akim Demaille <akim@epita.fr>
13313
13314 * src/LR0.c (new_state, get_state): Instead of using the global
13315 `kernel_size' and `kernel_base', have two new arguments:
13316 `core_size' and `core'.
13317 Adjust callers.
13318
13319 2002-05-06 Akim Demaille <akim@epita.fr>
13320
13321 * src/reader.c (packgram): No longer end `ritem' with a 0
13322 sentinel: it is not used.
13323
13324 2002-05-05 Akim Demaille <akim@epita.fr>
13325
13326 New experimental feature: display the lookaheads in the report and
13327 graph.
13328
13329 * src/print (print_core): When --trace-flag, display the rules
13330 lookaheads.
13331 * src/print_graph.c (print_core): Likewise.
13332 Swap the arguments.
13333 Adjust caller.
13334
13335 2002-05-05 Akim Demaille <akim@epita.fr>
13336
13337 * tests/torture.at (Many lookaheads): New test.
13338
13339 2002-05-05 Akim Demaille <akim@epita.fr>
13340
13341 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
13342 (GENERATE_MUSCLE_INSERT_TABLE): this.
13343 (output_int_table, output_unsigned_int_table, output_short_table)
13344 (output_token_number_table, output_item_number_table): Replace with...
13345 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
13346 (muscle_insert_short_table, muscle_insert_token_number_table)
13347 (muscle_insert_item_number_table): these.
13348 Adjust all callers.
13349 (prepare_tokens): Don't free `translations', since...
13350 * src/reader.h, src/reader.c (grammar_free): do it.
13351 Move to...
13352 * src/gram.h, src/gram.c (grammar_free): here.
13353 * data/bison.simple, data/bison.c++: b4_token_number_max is now
13354 b4_translate_max.
13355
13356 2002-05-05 Akim Demaille <akim@epita.fr>
13357
13358 * src/output.c (output_unsigned_int_table): New.
13359 (prepare_rules): `i' is unsigned.
13360 `prhs', `rline', `r2' are unsigned int.
13361 Rename muscle `rhs_number_max' as `rhs_max'.
13362 Output muscles `prhs_max', `rline_max', and `r2_max'.
13363 Free rline and r1.
13364 * data/bison.simple, data/bison.c++: Adjust to use these muscles
13365 to compute types instead of constant types.
13366 * tests/regression.at (Web2c Actions): Adjust.
13367
13368 2002-05-04 Akim Demaille <akim@epita.fr>
13369
13370 * src/symtab.h (SALIAS, SUNDEF): Rename as...
13371 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
13372 Adjust dependencies.
13373 * src/output.c (token_definitions_output): Be sure not to output a
13374 `#define 'a'' when fed with `%token 'a' "a"'.
13375 * tests/regression.at (Token definitions): New.
13376
13377 2002-05-03 Paul Eggert <eggert@twinsun.com>
13378
13379 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
13380 for K&R C.
13381
13382 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
13383
13384 * Makefile.am (SUBDIRS): Remove intl.
13385 (EXTRA_DIST): Add config/config.rpath.
13386
13387 2002-05-03 Akim Demaille <akim@epita.fr>
13388
13389 * data/bison.simple (m4_if): Don't output empty enums.
13390 And actually, output valid enum definitions :(.
13391
13392 2002-05-03 Akim Demaille <akim@epita.fr>
13393
13394 * configure.bat: Remove, completely obsolete.
13395 * Makefile.am (EXTRA_DIST): Adjust.
13396 Don't distribute config.rpath...
13397 * config/Makefile.am (EXTRA_DIST): Do it.
13398
13399 2002-05-03 Akim Demaille <akim@epita.fr>
13400
13401 * configure.in (GETTEXT_VERSION): New.
13402 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
13403
13404 2002-05-03 Akim Demaille <akim@epita.fr>
13405
13406 * data/bison.simple (b4_token_enum): New.
13407 (b4_token_defines): Use it to output tokens both as #define and
13408 enums.
13409 Suggested by Paul Eggert.
13410 * src/output.c (token_definitions_output): Don't output spurious
13411 white spaces.
13412
13413 2002-05-03 Akim Demaille <akim@epita.fr>
13414
13415 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13416
13417 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
13418
13419 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
13420 Update the stack class, give a try to deque as the default container.
13421
13422 2002-05-02 Akim Demaille <akim@epita.fr>
13423
13424 * data/bison.simple (yyparse): Do not implement @$ = @1.
13425 (YYLLOC_DEFAULT): Adjust to do it.
13426 * doc/bison.texinfo (Location Default Action): Fix.
13427
13428 2002-05-02 Akim Demaille <akim@epita.fr>
13429
13430 * src/reader.c (parse_braces): Merge into...
13431 (parse_action): this.
13432
13433 2002-05-02 Akim Demaille <akim@epita.fr>
13434
13435 * configure.in (ALL_LINGUAS): Remove.
13436 * po/LINGUAS, hr.po: New.
13437
13438 2002-05-02 Akim Demaille <akim@epita.fr>
13439
13440 Remove the so called hairy (semantic) parsers.
13441
13442 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
13443 * src/gram.h, src/gram.c (semantic_parser): Remove.
13444 (rule_t): Remove the guard and guard_line members.
13445 * src/lex.h (token_t): remove tok_guard.
13446 * src/options.c (option_table): Remove %guard and %semantic_parser
13447 support.
13448 * src/output.c, src/output.h (guards_output): Remove.
13449 (prepare): Adjust.
13450 (token_definitions_output): Don't output the `T'
13451 tokens (???).
13452 (output_skeleton): Don't output the guards.
13453 * src/files.c, src/files.c (attrsfile): Remove.
13454 * src/reader.c (symbol_list): Remove the guard and guard_line
13455 members.
13456 Adjust dependencies.
13457 (parse_guard): Remove.
13458 * data/bison.hairy: Remove.
13459 * doc/bison.texinfo (Environment Variables): Remove occurrences of
13460 BISON_HAIRY.
13461
13462 2002-05-02 Akim Demaille <akim@epita.fr>
13463
13464 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
13465 (parse_guard): Rename the formal argument `stack_offset' as
13466 `rule_length', which is more readable.
13467 Adjust callers.
13468 (copy_at, copy_dollar): Instead of outputting the hard coded
13469 values of $$, $n and so forth, output invocation to b4_lhs_value,
13470 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
13471 Note: this patch partially drops `semantic-parser' support: it
13472 always does `rule_length - n', where semantic parsers ought to
13473 always use `-n'.
13474 * data/bison.simple, data/bison.c++ (b4_lhs_value)
13475 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
13476
13477 2002-05-02 Akim Demaille <akim@epita.fr>
13478
13479 * configure.in (AC_INIT): Bump to 1.49b.
13480 (AM_INIT_AUTOMAKE): Short invocation.
13481
13482 2002-05-02 Akim Demaille <akim@epita.fr>
13483
13484 Version 1.49a.
13485
13486 2002-05-01 Akim Demaille <akim@epita.fr>
13487
13488 * src/skeleton.h: Remove.
13489
13490 2002-05-01 Akim Demaille <akim@epita.fr>
13491
13492 * src/skeleton.h: Fix the #endif.
13493 Reported by Magnus Fromreide.
13494
13495 2002-04-26 Paul Eggert <eggert@twinsun.com>
13496
13497 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
13498 Define if we define YYSTYPE and YYLTYPE, respectively.
13499 (YYCOPY): Fix [] quoting problem in the non-GCC case.
13500
13501 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
13502
13503 * src/scan-skel.l: Postprocess quadrigraphs.
13504
13505 * src/reader.c (copy_character): New function, used to output
13506 single characters while replacing `[' and `]' with quadrigraphs, to
13507 avoid troubles with M4 quotes.
13508 (copy_comment): Output characters with copy_character.
13509 (read_additionnal_code): Likewise.
13510 (copy_string2): Likewise.
13511 (copy_definition): Likewise.
13512
13513 * tests/calc.at: Exercise M4 quoting.
13514
13515 2002-04-25 Akim Demaille <akim@epita.fr>
13516
13517 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
13518 between `!' and the command.
13519 Reported by Paul Eggert.
13520
13521 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
13522
13523 * tests/calc.at: Exercise prologue splitting.
13524
13525 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
13526 `b4_post_prologue' instead of `b4_prologue'.
13527
13528 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
13529 muscles.
13530 (output): Free pre_prologue_obstack and post_prologue_obstack.
13531 * src/files.h, src/files.c (attrs_obstack): Remove.
13532 (pre_prologue_obstack, post_prologue_obstack): New.
13533 * src/reader.c (copy_definition): Add a parameter to specify the
13534 obstack to fill, instead of using attrs_obstack unconditionally.
13535 (read_declarations): Pass pre_prologue_obstack to copy_definition if
13536 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
13537
13538 2002-04-23 Paul Eggert <eggert@twinsun.com>
13539
13540 * data/bison.simple: Remove unnecessary commentary and white
13541 space differences from 1_29-branch.
13542 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
13543
13544 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
13545 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
13546 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
13547 constructors or destructors.
13548
13549 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
13550
13551 2002-04-23 Akim Demaille <akim@epita.fr>
13552
13553 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
13554 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
13555 location with columns.
13556 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
13557 All reported by Paul Eggert.
13558
13559 2002-04-22 Akim Demaille <akim@epita.fr>
13560
13561 * src/reduce.c (dump_grammar): Move to...
13562 * src/gram.h, src/gram.c (grammar_dump): here.
13563 Be sure to separate long item numbers.
13564 Don't read the members of a rule's prec if its nil.
13565
13566 2002-04-22 Akim Demaille <akim@epita.fr>
13567
13568 * src/output.c (table_size, table_grow): New.
13569 (MAXTABLE): Remove, replace uses with table_size.
13570 (pack_vector): Instead of dying when the table is too big, grow it.
13571
13572 2002-04-22 Akim Demaille <akim@epita.fr>
13573
13574 * data/bison.simple (yyr1): Its type is that of a token number.
13575 * data/bison.c++ (r1_): Likewise.
13576 * tests/regression.at (Web2c Actions): Adjust.
13577
13578 2002-04-22 Akim Demaille <akim@epita.fr>
13579
13580 * src/reader.c (token_translations_init): 256 is now the default
13581 value for the error token, i.e., it will be assigned another
13582 number if the user assigned 256 to one of her tokens.
13583 (reader): Don't force 256 to error.
13584 * doc/bison.texinfo (Symbols): Adjust.
13585 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
13586 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
13587 etc. instead of 10, 20, 30 (which was used to `jump' over error
13588 (256) and undefined (2)).
13589
13590 2002-04-22 Akim Demaille <akim@epita.fr>
13591
13592 Propagate more token_number_t.
13593
13594 * src/gram.h (token_number_as_item_number)
13595 (item_number_as_token_number): New.
13596 * src/output.c (GENERATE_OUTPUT_TABLE): New.
13597 Use it to create output_item_number_table and
13598 output_token_number_table.
13599 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13600 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
13601 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
13602 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
13603
13604 2002-04-22 Akim Demaille <akim@epita.fr>
13605
13606 * src/output.h, src/output.c (get_lines_number): Remove.
13607
13608 2002-04-19 Akim Demaille <akim@epita.fr>
13609
13610 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
13611 as Lex/Flex'.
13612 (Debugging): More details about enabling the debugging features.
13613 (Table of Symbols): Describe $$, $n, @$, and @n.
13614 Suggested by Tim Josling.
13615
13616 2002-04-19 Akim Demaille <akim@epita.fr>
13617
13618 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
13619
13620 2002-04-10 Akim Demaille <akim@epita.fr>
13621
13622 * src/system.h: Rely on HAVE_LIMITS_H.
13623 Suggested by Paul Eggert.
13624
13625 2002-04-09 Akim Demaille <akim@epita.fr>
13626
13627 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
13628 full stderr, and strip it according to the bison options, instead
13629 of composing the error message from different bits.
13630 This makes it easier to check for several error messages.
13631 Adjust all the invocations.
13632 Add an invocation exercising the error token.
13633 Add an invocation demonstrating a stupid error message.
13634 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
13635 Adjust the tests.
13636 Error message are for stderr, not stdout.
13637
13638 2002-04-09 Akim Demaille <akim@epita.fr>
13639
13640 * src/gram.h, src/gram.c (error_token_number): Remove, use
13641 errtoken->number.
13642 * src/reader.c (reader): Don't specify the user token number (2)
13643 for $undefined, as it uselessly prevents using it.
13644 * src/gram.h (token_number_t): Move to...
13645 * src/symtab.h: here.
13646 (state_t.number): Is a token_number_t.
13647 * src/print.c, src/reader.c: Use undeftoken->number instead of
13648 hard coded 2.
13649 (Even though this 2 is not the same as above: the number of the
13650 undeftoken remains being 2, it is its user token number which
13651 might not be 2).
13652 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
13653 `user_token_number_max'.
13654 Output `undef_token_number'.
13655 * data/bison.simple, data/bison.c++: Use them.
13656 Be sure to map invalid yylex return values to
13657 `undef_token_number'. This saves us from gratuitous SEGV.
13658
13659 * tests/conflicts.at (Solved SR Conflicts)
13660 (Unresolved SR Conflicts): Adjust.
13661 * tests/regression.at (Web2c Actions): Adjust.
13662
13663 2002-04-08 Akim Demaille <akim@epita.fr>
13664
13665 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
13666 Adding #line.
13667 Remove the duplicate `typedefs'.
13668 (RhsNumberType): Fix the declaration and various other typos.
13669 Use __ofile__.
13670 * data/bison.simple: Use __ofile__.
13671 * src/scan-skel.l: Handle __ofile__.
13672
13673 2002-04-08 Akim Demaille <akim@epita.fr>
13674
13675 * src/gram.h (item_number_t): New, the type of item numbers in
13676 RITEM. Note that it must be able to code symbol numbers as
13677 positive number, and the negation of rule numbers as negative
13678 numbers.
13679 Adjust all dependencies (pretty many).
13680 * src/reduce.c (rule): Remove this `short *' pointer: use
13681 item_number_t.
13682 * src/system.h (MINSHORT, MAXSHORT): Remove.
13683 Include `limits.h'.
13684 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
13685 (shortcpy): Remove.
13686 (MAXTABLE): Move to...
13687 * src/output.c (MAXTABLE): here.
13688 (prepare_rules): Use output_int_table to output rhs.
13689 * data/bison.simple, data/bison.c++: Adjust.
13690 * tests/torture.at (Big triangle): Move the limit from 254 to
13691 500.
13692 * tests/regression.at (Web2c Actions): Ajust.
13693
13694 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
13695 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
13696 passes, but produces negative #line number, once fixed, GCC is
13697 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
13698 C), it passes.
13699 * src/state.h (state_h): Code input lines on ints, not shorts.
13700
13701 2002-04-08 Akim Demaille <akim@epita.fr>
13702
13703 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
13704 and then the grammar.
13705
13706 2002-04-08 Akim Demaille <akim@epita.fr>
13707
13708 * src/system.h: No longer using strndup.
13709
13710 2002-04-07 Akim Demaille <akim@epita.fr>
13711
13712 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
13713 * src/output.c (output_table_data): Return the longest number.
13714 (prepare_tokens): Output `token_number_max').
13715 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
13716 New.
13717 Use them to define yy_token_number_type/TokenNumberType.
13718 Use this type for yytranslate.
13719 * tests/torture.at (Big triangle): Push the limit from 124 to
13720 253.
13721 * tests/regression.at (Web2c Actions): Adjust.
13722
13723 2002-04-07 Akim Demaille <akim@epita.fr>
13724
13725 * tests/torture.at (Big triangle): New.
13726 (GNU AWK Grammar, GNU Cim Grammar): Move to...
13727 * tests/existing.at: here.
13728
13729 2002-04-07 Akim Demaille <akim@epita.fr>
13730
13731 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
13732 nritems.
13733 Adjust dependencies.
13734
13735 2002-04-07 Akim Demaille <akim@epita.fr>
13736
13737 * src/reader.c: Normalize increments to prefix form.
13738
13739 2002-04-07 Akim Demaille <akim@epita.fr>
13740
13741 * src/reader.c, symtab.c: Remove debugging code.
13742
13743 2002-04-07 Akim Demaille <akim@epita.fr>
13744
13745 Rename all the `bucket's as `symbol_t'.
13746
13747 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
13748 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
13749 * src/symtab.c, src/symtab.h (bucket): Rename as...
13750 (symbol_t): this.
13751 (symbol_list_new, bucket_check_defined, bucket_make_alias)
13752 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
13753 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13754 (buckets_new, buckets_free, buckets_do): Rename as...
13755 (symbol_list_new, symbol_check_defined, symbol_make_alias)
13756 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13757 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
13758 (symbols_new, symbols_free, symbols_do): these.
13759
13760 2002-04-07 Akim Demaille <akim@epita.fr>
13761
13762 Use lib/hash for the symbol table.
13763
13764 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
13765 EOF.
13766 * src/lex.c (lex): Set the `number' member of new terminals.
13767 * src/reader.c (bucket_check_defined, bucket_make_alias)
13768 (bucket_check_alias_consistence, bucket_translation): New.
13769 (reader, grammar_free, readgram, token_translations_init)
13770 (packsymbols): Adjust.
13771 (reader): Number the predefined tokens.
13772 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
13773 for predefined tokens.
13774 * src/symtab.h (bucket): Remove all the hash table related
13775 members.
13776 * src/symtab.c (symtab): Replace by...
13777 (bucket_table): this.
13778 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13779 (buckets_new, buckets_do): New.
13780
13781 2002-04-07 Akim Demaille <akim@epita.fr>
13782
13783 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
13784 (start_symbol, max_user_token_number, semantic_parser)
13785 (error_token_number): Initialize.
13786 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
13787 Initialize.
13788 (reader): Don't.
13789 (errtoken, eoftoken, undeftoken, axiom): Extern.
13790
13791 2002-04-07 Akim Demaille <akim@epita.fr>
13792
13793 * src/gram.h (rule_s): prec and precsym are now pointers
13794 to the bucket giving the priority/associativity.
13795 Member `associativity' removed: useless.
13796 * src/reduce.c, src/conflicts.c: Adjust.
13797
13798 2002-04-07 Akim Demaille <akim@epita.fr>
13799
13800 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
13801 Properly escape the symbols' TAG when outputting them.
13802
13803 2002-04-07 Akim Demaille <akim@epita.fr>
13804
13805 * src/lalr.h (LA): Is a bitsetv, not bitset*.
13806
13807 2002-04-07 Akim Demaille <akim@epita.fr>
13808
13809 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
13810 (LArule): this, which is an array to rule_t*.
13811 * src/print.c, src/conflicts.c: Adjust.
13812
13813 2002-04-07 Akim Demaille <akim@epita.fr>
13814
13815 * src/gram.h (rule_t): Rename `number' as `user_number'.
13816 `number' is a new member.
13817 Adjust dependencies.
13818 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
13819
13820 2002-04-07 Akim Demaille <akim@epita.fr>
13821
13822 As a result of the previous patch, it is no longer needed
13823 to reorder ritem itself.
13824
13825 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
13826
13827 2002-04-07 Akim Demaille <akim@epita.fr>
13828
13829 Be sure never to walk through RITEMS, but use only data related to
13830 the rules themselves. RITEMS should be banished.
13831
13832 * src/output.c (output_token_translations): Rename as...
13833 (prepare_tokens): this.
13834 In addition to `translate', prepare the muscles `tname' and
13835 `toknum', which were handled by...
13836 (output_rule_data): this.
13837 Remove, and move the remainder of its outputs into...
13838 (prepare_rules): this new routines, which also merges content from
13839 (output_gram): this.
13840 (prepare_rules): Be sure never to walk through RITEMS.
13841 (output_stos): Rename as...
13842 (prepare_stos): this.
13843 (output): Always invoke prepare_states, after all, just don't use it
13844 in the output if you don't need it.
13845
13846 2002-04-07 Akim Demaille <akim@epita.fr>
13847
13848 * src/LR0.c (new_state): Display `nstates' as the name of the
13849 newly created state.
13850 Adjust to initialize first_state and last_state if needed.
13851 Be sure to distinguish the initial from the final state.
13852 (new_states): Create the itemset of the initial state, and use
13853 new_state.
13854 * src/closure.c (closure): Now that the initial state has its
13855 items properly set, there is no need for a special case when
13856 creating `ruleset'.
13857
13858 As a result, now the rule 0, reducing to $axiom, is visible in the
13859 outputs. Adjust the test suite.
13860
13861 * tests/conflicts.at (Solved SR Conflicts)
13862 (Unresolved SR Conflicts): Adjust.
13863 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
13864 * tests/conflicts.at (S/R in initial): New.
13865
13866 2002-04-07 Akim Demaille <akim@epita.fr>
13867
13868 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
13869 the RHS of the rules.
13870 * src/output.c (output_gram): Likewise.
13871
13872 2002-04-07 Akim Demaille <akim@epita.fr>
13873
13874 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
13875 bucket.
13876 Adjust all dependencies.
13877 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
13878 `number' of the buckets too.
13879 * src/gram.h: Include `symtab.h'.
13880 (associativity): Move to...
13881 * src/symtab.h: here.
13882 No longer include `gram.h'.
13883
13884 2002-04-07 Akim Demaille <akim@epita.fr>
13885
13886 * src/gram.h, src/gram.c (rules_rhs_length): New.
13887 (ritem_longest_rhs): Use it.
13888 * src/gram.h (rule_t): `number' is a new member.
13889 * src/reader.c (packgram): Set it.
13890 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
13891 the end of `rules', and count them out of `nrules'.
13892 (reduce_output, dump_grammar): Adjust.
13893 * src/print.c (print_grammar): It is no longer needed to check for
13894 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
13895 * tests/reduce.at (Reduced Automaton): New test.
13896
13897 2002-04-07 Akim Demaille <akim@epita.fr>
13898
13899 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
13900 lacking `+ 1' to nrules, Bison reported as useless a token if it
13901 was used solely to set the precedence of the last rule...
13902
13903 2002-04-07 Akim Demaille <akim@epita.fr>
13904
13905 * data/bison.c++, data/bison.simple: Don't output the current file
13906 name in #line, to avoid useless diffs between two identical
13907 outputs under different names.
13908
13909 2002-04-07 Akim Demaille <akim@epita.fr>
13910
13911 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
13912 Normalize loops to using `< nrules + 1', not `<= nrules'.
13913
13914 2002-04-07 Akim Demaille <akim@epita.fr>
13915
13916 * TODO: Update.
13917
13918 2002-04-07 Akim Demaille <akim@epita.fr>
13919
13920 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
13921 bucket.value as bucket.number.
13922
13923 2002-04-07 Akim Demaille <akim@epita.fr>
13924
13925 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
13926 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13927 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
13928 RHS, instead of being an index in RITEMS.
13929
13930 2002-04-04 Paul Eggert <eggert@twinsun.com>
13931
13932 * doc/bison.texinfo: Update copyright date.
13933 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
13934 (Symbols): Warn about running Bison in one character set,
13935 but compiling and/or running in an incompatible one.
13936 Warn about character code 256, too.
13937
13938 2002-04-03 Paul Eggert <eggert@twinsun.com>
13939
13940 * src/bison.data (YYSTACK_ALLOC): Depend on whether
13941 YYERROR_VERBOSE is nonzero, not whether it is defined.
13942
13943 Merge changes from bison-1_29-branch.
13944
13945 2002-03-20 Paul Eggert <eggert@twinsun.com>
13946
13947 Merge fixes from Debian bison_1.34-1.diff.
13948
13949 * configure.in (AC_PREREQ): 2.53.
13950
13951 2002-03-20 Akim Demaille <akim@epita.fr>
13952
13953 * src/conflicts.c (log_resolution): Argument `resolution' is const.
13954
13955 2002-03-19 Paul Eggert <eggert@twinsun.com>
13956
13957 * src/bison.simple (YYCOPY): New macro.
13958 (YYSTACK_RELOCATE): Use it.
13959 Remove Type arg; no longer needed. All callers changed.
13960 (yymemcpy): Remove; no longer needed.
13961
13962 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
13963 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13964
13965 2002-03-19 Akim Demaille <akim@epita.fr>
13966
13967 Test and fix the #line outputs.
13968
13969 * tests/atlocal.at (GCC): New.
13970 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
13971 (Prologue synch line, %union synch line, Postprologue synch line)
13972 (Action synch line, Epilogue synch line): New tests.
13973 * src/reader.c (parse_union_decl): Define the muscle stype_line.
13974 * data/bison.simple, data/bison.c++: Use it.
13975
13976 2002-03-19 Akim Demaille <akim@epita.fr>
13977
13978 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
13979 (Solved SR Conflicts, %expect not enough, %expect right)
13980 (%expect too much): Move to...
13981 * tests/conflicts.at: this new file.
13982
13983 2002-03-19 Akim Demaille <akim@epita.fr>
13984
13985 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13986 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
13987 that we can move to enums for instance.
13988 * src/output.c (token_definitions_output): Output a list of
13989 `token-name, token-number' instead of the #define.
13990 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
13991
13992 2002-03-14 Akim Demaille <akim@epita.fr>
13993
13994 Use Gettext 0.11.1.
13995
13996 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
13997
13998 * data/bison.c++: Make the user able to add members to the generated
13999 parser by subclassing.
14000
14001 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
14002
14003 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14004 a character.
14005 Reported by Nicolas Tisserand and Nicolas Burrus.
14006
14007 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14008
14009 * src/reader.c: Warn about lacking semi-colons, do not complain.
14010
14011 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14012
14013 * data/bison.c++: Remove a debug line.
14014
14015 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14016
14017 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14018 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14019 provide a default implementation.
14020
14021 2002-03-04 Akim Demaille <akim@epita.fr>
14022
14023 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14024 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14025 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14026 * tests/semantic.at (Parsing Guards): Similarly.
14027 * src/reader.at (readgram): Complain if the last rule is not ended
14028 with a semi-colon.
14029
14030 2002-03-04 Akim Demaille <akim@epita.fr>
14031
14032 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14033 * src/closure.c: here.
14034 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14035 RTC.
14036 * src/warshall.h, src/warshall.c: Remove.
14037 * tests/sets.at (Broken Closure): Adjust.
14038
14039 2002-03-04 Akim Demaille <akim@epita.fr>
14040
14041 * src/output.c (output_skeleton): tempdir is const.
14042 bytes_read is unused.
14043
14044 2002-03-04 Akim Demaille <akim@epita.fr>
14045
14046 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14047 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14048 Update.
14049 From Michael Hayes.
14050
14051 2002-03-04 Akim Demaille <akim@epita.fr>
14052
14053 * src/closure.c (closure): `r' is unused.
14054
14055 2002-03-04 Akim Demaille <akim@epita.fr>
14056
14057 * tests/sets.at (Broken Closure): Add the ending `;'.
14058 * src/reader.at (readgram): Complain if a rule is not ended with a
14059 semi-colon.
14060
14061 2002-03-04 Akim Demaille <akim@epita.fr>
14062
14063 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14064 (count_sr_conflicts): Use bitset_count.
14065 * src/reduce.c (inaccessable_symbols): Ditto.
14066 (bits_size): Remove.
14067 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14068
14069 2002-03-04 Akim Demaille <akim@epita.fr>
14070
14071 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14072 * src/reduce.c: Remove the `bitset_zero's following the
14073 `bitset_create's, as now it is performed by the latter.
14074
14075 2002-03-04 Akim Demaille <akim@epita.fr>
14076
14077 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14078 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14079 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14080 latest sources from Michael.
14081
14082 2002-03-04 Akim Demaille <akim@epita.fr>
14083
14084 * src/output.c (output): Don't free the grammar.
14085 * src/reader.c (grammar_free): New.
14086 * src/main.c (main): Call it and don't free symtab here.
14087
14088 2002-03-04 Akim Demaille <akim@epita.fr>
14089
14090 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14091 before returning.
14092 Reported by Benoit Perrot.
14093
14094 2002-03-04 Akim Demaille <akim@epita.fr>
14095
14096 Use bitset operations when possible, not loops over bits.
14097
14098 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14099 bitset_or.
14100 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14101 * src/reduce.c (useless_nonterminals): Formatting changes.
14102 * src/warshall.c (TC): Use bitset_or.
14103
14104 2002-03-04 Akim Demaille <akim@epita.fr>
14105
14106 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14107 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14108 Ditto.
14109
14110 2002-03-04 Akim Demaille <akim@epita.fr>
14111
14112 * src/lalr.c (F): Now a bitset*.
14113 Adjust all dependencies.
14114
14115 2002-03-04 Akim Demaille <akim@epita.fr>
14116
14117 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14118 Adjust all dependencies.
14119
14120 2002-03-04 Akim Demaille <akim@epita.fr>
14121
14122 * src/L0.c, src/LR0.h (nstates): Be size_t.
14123 Adjust comparisons (signed vs unsigned).
14124 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14125 bitset*.
14126 Adjust all dependencies.
14127
14128 2002-03-04 Akim Demaille <akim@epita.fr>
14129
14130 * src/closure.c (firsts): Now, also a bitset.
14131 Adjust all dependencies.
14132 (varsetsize): Remove, now unused.
14133 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14134
14135 2002-03-04 Akim Demaille <akim@epita.fr>
14136
14137 * src/print.c: Convert to use bitset.h, not hand coded iterations
14138 over ints.
14139
14140 2002-03-04 Akim Demaille <akim@epita.fr>
14141
14142 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14143
14144 2002-03-04 Akim Demaille <akim@epita.fr>
14145
14146 * src/closure.c (ruleset): Be a bitset.
14147 (rulesetsize): Remove.
14148
14149 2002-03-04 Akim Demaille <akim@epita.fr>
14150
14151 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14152 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14153 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14154 * src/closure.c (fderives): Be an array of bitsets.
14155
14156 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
14157
14158 * data/bison.c++: Merge the two generated headers. Insert a copyright
14159 notice in each output file.
14160
14161 2002-02-28 Akim Demaille <akim@epita.fr>
14162
14163 * data/bison.c++: Copy the prologue of bison.simple to fetch
14164 useful M4 definitions, such as b4_header_guard.
14165
14166 2002-02-25 Akim Demaille <akim@epita.fr>
14167
14168 * src/getargs.c (version): Give the name of the authors, and use a
14169 translator friendly scheme for the bgr
14170 copyright notice.
14171
14172 2002-02-25 Akim Demaille <akim@epita.fr>
14173
14174 * src/output.c (header_output): Remove, now handled completely via
14175 M4.
14176
14177 2002-02-25 Akim Demaille <akim@epita.fr>
14178
14179 * m4/m4.m4: New, from CVS Autoconf.
14180 * configure.in: Invoke it.
14181 * src/output.c (output_skeleton): Use its result instead of the
14182 hard coded name.
14183
14184 2002-02-25 Akim Demaille <akim@epita.fr>
14185
14186 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14187 Fileutils 4.1.5.
14188 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14189 * src/output.c (output_skeleton): Use mkstemp to create a real
14190 temporary file.
14191 Move the filling of `skeleton' and its muscle to...
14192 (prepare): here.
14193 (output): Move the definition of the prologue muscle to...
14194 (prepare): here.
14195 * src/system.h (DEFAULT_TMPDIR): New.
14196
14197 2002-02-14 Paul Eggert <eggert@twinsun.com>
14198
14199 Remove the support for C++ namespace cleanliness; it was
14200 causing more problems than it was curing, since it didn't work
14201 properly on some nonstandard C++ compilers. This can wait
14202 for a proper C++ parser.
14203
14204 * NEWS: Document this.
14205 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14206 of C++, as it's treated like C now.
14207 * src/bison.simple (YYSTD): Remove.
14208 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14209 Treat C++ just like Standard C instead of trying to support
14210 namespace cleanliness.
14211
14212 2002-02-14 Akim Demaille <akim@epita.fr>
14213
14214 * tests/regression.at (else): Adjust to Andreas' change.
14215
14216 2002-02-14 Akim Demaille <akim@epita.fr>
14217
14218 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14219
14220 2002-02-13 Andreas Schwab <schwab@suse.de>
14221
14222 * src/output.c (output_rule_data): Don't output NULL, it might
14223 not be defined yet.
14224
14225 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
14226
14227 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14228 (Copyright notice): Update.
14229
14230 2002-02-11 Akim Demaille <akim@epita.fr>
14231
14232 * tests/regression.at (%nonassoc and eof): Don't include
14233 nonportable headers.
14234
14235 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
14236
14237 * data/bison.c++: Correct error recovery. Make the user able to
14238 initialize the starting location.
14239
14240 2002-02-07 Akim Demaille <akim@epita.fr>
14241
14242 * tests/input.at: New.
14243
14244 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14245
14246 * data/bison.c++: Replace some direct m4 expansions by constants. Be
14247 more consistent when naming methods and variables. Put preprocessor
14248 directives around tables only needed for debugging.
14249
14250 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14251
14252 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14253 C++ parsers.
14254 (yy::b4_name::parse): Use print_.
14255
14256 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14257
14258 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14259
14260 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14261
14262 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14263 C++ parsers.
14264 (yy::b4_name::parse): Build verbose error messages, and use error_.
14265
14266 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
14267
14268 * data/bison.c++: Fix m4 quoting in comments.
14269
14270 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
14271
14272 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14273 not expanded by m4.
14274
14275 2002-02-05 Akim Demaille <akim@epita.fr>
14276
14277 * data/bison.c++: Adjust to the M4 back end.
14278 More is certainly needed.
14279
14280 2002-02-05 Akim Demaille <akim@epita.fr>
14281
14282 Give a try to M4 as a back end.
14283
14284 * lib/readpipe.c: New, from wdiff.
14285 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14286 BISON_HAIRY.
14287 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
14288 specific values. Now it is m4 that performs the lookup.
14289 * src/parse-skel.y: Remove.
14290 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
14291 * src/output.c (actions_output, guards_output)
14292 (token_definitions_output): No longer keeps track of the output
14293 line number, hence remove the second argument.
14294 (guards_output): Check against the guard member of a rule, not the
14295 action member.
14296 Adjust callers.
14297 (output_skeleton): Don't look for the skeleton location, let m4 do
14298 that.
14299 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
14300 file will be used.
14301 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
14302 (prepare): Given that for the time being changesyntax is not
14303 usable in M4, rename the muscles using `-' to `_'.
14304 Define `defines_flag', `output_parser_name' and `output_header_name'.
14305 * src/output.h (actions_output, guards_output)
14306 (token_definitions_output): Adjust prototypes.
14307 * src/scan-skel.l: Instead of scanning the skeletons, it now
14308 processes the output of m4: `__oline__' and `#output'.
14309 * data/bison.simple: Adjust to be used by M4(sugar).
14310 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
14311 to date.
14312 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
14313 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
14314 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
14315 shamelessly stolen from CVS Autoconf.
14316
14317 2002-02-05 Akim Demaille <akim@epita.fr>
14318
14319 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
14320 * configure.in: Check for the declarations of free and malloc.
14321 * src/muscle_tab.c: Adjust.
14322
14323 2002-02-05 Akim Demaille <akim@epita.fr>
14324
14325 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
14326 which have no values.
14327
14328 2002-02-05 Akim Demaille <akim@epita.fr>
14329
14330 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
14331 * data/: here.
14332
14333 2002-01-29 Paul Eggert <eggert@twinsun.com>
14334
14335 * src/bison.simple (YYSIZE_T): Do not define merely because
14336 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
14337 On some platforms, <alloca.h> does not declare YYSTD (size_t).
14338
14339 2002-01-27 Akim Demaille <akim@epita.fr>
14340
14341 Fix `%nonassoc and eof'.
14342
14343 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
14344 which were not properly copied! Replace
14345 memcpy (res->errs, src->errs, src->nerrs);
14346 with
14347 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
14348 !!!
14349 * tests/regression.at (%nonassoc and eof): Adjust to newest
14350 Autotest: `.' is not in the PATH.
14351
14352 2002-01-27 Akim Demaille <akim@epita.fr>
14353
14354 * tests/sets.at (AT_EXTRACT_SETS): New.
14355 (Nullable): Use it.
14356 (Firsts): New.
14357
14358 2002-01-26 Akim Demaille <akim@epita.fr>
14359
14360 * tests/actions.at, tests/calc.at, tests/headers.at,
14361 * tests/torture.at: Adjust to the newest Autotest which no longer
14362 forces `.' in the PATH.
14363
14364 2002-01-25 Akim Demaille <akim@epita.fr>
14365
14366 * tests/regression.at (%nonassoc and eof): New.
14367 Suggested by Robert Anisko.
14368
14369 2002-01-24 Akim Demaille <akim@epita.fr>
14370
14371 Bison dumps core when trying to complain about broken input files.
14372 Reported by Cris van Pelt.
14373
14374 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
14375 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
14376 into...
14377 (Invalid inputs): Strengthen: exercise parse_percent_token.
14378
14379 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
14380
14381 * src/Makefile.am: Add bison.c++.
14382 * src/bison.c++: New skeleton.
14383
14384 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
14385
14386 * po/it.po: New.
14387
14388 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
14389
14390 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
14391
14392 2002-01-20 Marc Autret <marc@gnu.org>
14393
14394 * src/files.c (compute_output_file_names): Fix
14395
14396 2002-01-20 Marc Autret <marc@gnu.org>
14397
14398 * tests/output.at: New test.
14399 * src/files.c (compute_base_names): Don't map extensions when
14400 the YACC flag is set, use defaults.
14401 Reported by Evgeny Stambulchik.
14402
14403 2002-01-20 Marc Autret <marc@gnu.org>
14404
14405 * src/system.h: Need to define __attribute__ away for non-GCC
14406 compilers as well (i.e., the vendor C compiler).
14407 Suggested by Albert Chin-A-Young.
14408
14409 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
14410
14411 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
14412 canonical definition.
14413 * src/system.h: Use the canonical definition for PARAMS (avoids
14414 a conflict with the macro from lib/hash.h).
14415
14416 2002-01-11 Akim Demaille <akim@epita.fr>
14417
14418 * configure.in: Use AC_FUNC_STRNLEN.
14419 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
14420
14421 2002-01-09 Akim Demaille <akim@epita.fr>
14422
14423 * src/files.c, src/files.h (output_infix): New.
14424 (tab_extension): Remove.
14425 (compute_base_names): Compute the former, drop the latter.
14426 * src/output.c (prepare): Insert the muscles `output-infix', and
14427 `output-suffix'.
14428 * src/parse-skel.y (string, string.1): New.
14429 (section.header): Use it.
14430 (section.yacc): Remove.
14431 (prefix): Remove too.
14432 * src/scan-skel.l: Adjust.
14433 * src/bison.simple, src/bison.hairy: Adjust.
14434
14435 2002-01-09 Akim Demaille <akim@epita.fr>
14436
14437 * configure.in (WERROR_CFLAGS): Compute it.
14438 * src/Makefile.am (CFLAGS): Pass it.
14439 * tests/atlocal.in (CFLAGS): Idem.
14440 * src/files.c: Fix a few warnings.
14441 (get_extension_index): Remove, unused.
14442
14443 2002-01-08 Akim Demaille <akim@epita.fr>
14444
14445 * src/getargs.c (AS_FILE_NAME): New.
14446 (getargs): Use it to convert DOSish file names.
14447 * src/files.c (base_name): Rename as full_base_name to avoid
14448 clashes with `base_name ()'.
14449 (filename_split): New.
14450 (compute_base_names): N-th rewrite, using filename_split.
14451
14452 2002-01-08 Akim Demaille <akim@epita.fr>
14453
14454 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
14455 New, stolen from the Fileutils 4.1.
14456 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14457 * configure.in: Check for the presence of memrchr, and of its
14458 prototype.
14459
14460 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
14461
14462 * lib/hash.h (__P): Added definition for this macro.
14463 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
14464 BUILT_SOURCES, to ensure they are generated first.
14465 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
14466 %error-verbose to allow bootstrapping with bison 1.30x.
14467
14468 2002-01-06 Akim Demaille <akim@epita.fr>
14469
14470 * src/reader.c (parse_braces): Don't fetch the next char, the
14471 convention is to fetch on entry.
14472 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
14473 'switch' without a following semicolon.
14474 * tests/regression.at (braces parsing): New.
14475
14476 2002-01-06 Akim Demaille <akim@epita.fr>
14477
14478 Bison is dead wrong in its RR conflict reports.
14479
14480 * tests/torture.at (GNU Cim Grammar): New.
14481 * src/conflicts.c (count_rr_conflicts): Fix.
14482
14483 2002-01-06 Akim Demaille <akim@epita.fr>
14484
14485 Creating package.m4 from configure.ac causes too many problems.
14486
14487 * tests/Makefile.am (package.m4): Create it by hand,
14488 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
14489
14490 2002-01-06 Akim Demaille <akim@epita.fr>
14491
14492 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
14493 skeleton.h.
14494
14495 2002-01-04 Paul Eggert <eggert@twinsun.com>
14496
14497 * doc/bison.texinfo (Debugging):
14498 Remove YYSTDERR; it's no longer defined or used.
14499 Also, s/cstdio.h/cstdio/.
14500
14501 2002-01-03 Akim Demaille <akim@epita.fr>
14502
14503 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
14504
14505 2002-01-03 Akim Demaille <akim@epita.fr>
14506
14507 * src/parse-skel.y (process_skeleton): Don't bind the parser's
14508 tracing code to --trace, wait for a better --trace option, with
14509 args.
14510
14511 2002-01-03 Akim Demaille <akim@epita.fr>
14512
14513 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
14514 The ISO C++ standard is extremely clear about it: stderr is
14515 considered a macro, not a regular symbol (see table 94 `Header
14516 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
14517 Therefore std:: does not apply to it. It still does with fprintf.
14518 Also, s/cstdio.h/cstdio/.
14519
14520 2002-01-03 Akim Demaille <akim@epita.fr>
14521
14522 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
14523 for non system headers.
14524
14525 2002-01-02 Akim Demaille <akim@epita.fr>
14526
14527 Equip the skeleton chain with location tracking, runtime trace,
14528 pure parser and scanner.
14529
14530 * src/parse-skel.y: Request a pure parser, locations, and prefix
14531 renaming.
14532 (%union): Having several members with the same type does not help
14533 type mismatches, simplify.
14534 (YYPRINT, yyprint): New.
14535 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
14536 (skel_error): this.
14537 Handle locations.
14538 * src/scan-skel.l: Adjust to these changes.
14539 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
14540 (LOCATION_PRINT, skel_control_t): New.
14541
14542 2001-12-30 Akim Demaille <akim@epita.fr>
14543
14544 * src/parse-skel.y: Get rid of the shift/reduce conflict:
14545 replace `gb' with BLANKS.
14546 * src/scan-skel.l: Adjust.
14547
14548 2001-12-30 Akim Demaille <akim@epita.fr>
14549
14550 * src/system.h: We don't need nor want bcopy.
14551 Throw away MS-DOS crap: we don't need getpid.
14552 * configure.in: We don't need strndup. It was even causing
14553 problems: because Flex includes the headers *before* us,
14554 _GNU_SOURCE is not defined by config.h, and therefore strndup was
14555 not visible.
14556 * lib/xstrndup.c: New.
14557 * src/scan-skel.l: Use it.
14558 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
14559 * src/parse-skel.y: Use %directives instead of #defines.
14560
14561 2001-12-30 Akim Demaille <akim@epita.fr>
14562
14563 * src/skeleton.h: New.
14564 * src/output.c (output_parser, output_master_parser): Remove, dead
14565 code.
14566 * src/output.h (get_lines_number, actions_output, guards_output)
14567 (token_definitions_output): Prototype them.
14568 * src/parse-skel.y: Add the license notice.
14569 Include output.h and skeleton.h.
14570 (process_skeleton): Returns void, and takes a single parameter.
14571 * src/scan-skel.l: Add the license notice.
14572 Include skeleton.h.
14573 Don't use %option yylineno: it seems that then Flex imagines
14574 REJECT has been used, and therefore it won't reallocate its
14575 buffers (which makes no other sense to me than a bug). It results
14576 in warnings for `unused: yy_flex_realloc'.
14577
14578 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
14579
14580 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14581 (MUSCLE_INSERT_PREFIX): ...to there.
14582 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14583 (MUSCLE_INSERT_PREFIX): Move from here...
14584
14585 * src/bison.hairy: Add a section directive. Put braces around muscle
14586 names. This parser skeleton is still broken, but Bison should not
14587 choke on a bad muscle 'syntax'.
14588 * src/bison.simple: Add a section directive. Put braces around muscle
14589 names.
14590
14591 * src/files.h (strsuffix, stringappend): Add declarations.
14592 (tab_extension): Add declaration.
14593 (short_base_name): Add declaration.
14594
14595 * src/files.c (strsuffix, stringappend): No longer static. These
14596 functions are used in the skeleton parser.
14597 (tab_extension): New.
14598 (compute_base_names): Use the computations done in this function
14599 to guess if the generated parsers should have '.tab' in their
14600 names.
14601 (short_base_name): No longer static.
14602
14603 * src/output.c (output_skeleton): New.
14604 (output): Disable call to output_master_parser, and give a try to
14605 a new skeleton handling system.
14606 (guards_output, actions_output): No longer static.
14607 (token_definitions_output, get_lines_number): No longer static.
14608
14609 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
14610
14611 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
14612 parse-skel.y.
14613
14614 * src/parse-skel.y: New file.
14615 * src/scan-skel.l: New file.
14616
14617 2001-12-29 Akim Demaille <akim@epita.fr>
14618
14619 %name-prefix is broken.
14620
14621 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
14622 Adjust all dependencies.
14623 * tests/headers.at (export YYLTYPE): Strengthen this test: use
14624 %name-prefix.
14625
14626 Renaming yylval but not yylloc is not consistent. Now we do.
14627
14628 * src/bison.simple: Prefix yylloc if used.
14629 * doc/bison.texinfo (Decl Summary): Document that.
14630
14631 2001-12-29 Akim Demaille <akim@epita.fr>
14632
14633 * doc/bison.texinfo: Promote `%long-directive' over
14634 `%long_directive'.
14635 Remove all references to fixed-output-files, yacc is enough.
14636
14637 2001-12-29 Akim Demaille <akim@epita.fr>
14638
14639 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
14640 user prologue. These are defaults.
14641 * tests/actions.at (Mid-rule actions): Make sure the user can
14642 define YYDEBUG and YYERROR_VERBOSE.
14643
14644 2001-12-29 Akim Demaille <akim@epita.fr>
14645
14646 * src/output.c (header_output): Don't forget to export YYLTYPE and
14647 yylloc.
14648 * tests/headers.at (export YYLTYPE): New, make sure it does.
14649 * tests/regression.at (%union and --defines, Invalid CPP headers):
14650 Move to...
14651 * tests/headers.at: here.
14652
14653 2001-12-29 Akim Demaille <akim@epita.fr>
14654
14655 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
14656
14657 2001-12-29 Akim Demaille <akim@epita.fr>
14658
14659 * tests/actions.at (Mid-rule actions): Output on a single line
14660 instead of several.
14661
14662 2001-12-29 Akim Demaille <akim@epita.fr>
14663
14664 * doc/bison.texinfo: Formatting changes.
14665
14666 2001-12-29 Akim Demaille <akim@epita.fr>
14667
14668 Don't store the token defs in a muscle, just be ready to output it
14669 on command. Now possible via `symbols'. Fixes a memory leak.
14670
14671 * src/output.c (token_definitions_output): New.
14672 (output_parser, header_output): Use it.
14673 * src/reader.c (symbols_save): Remove.
14674
14675 2001-12-29 Akim Demaille <akim@epita.fr>
14676
14677 * src/bison.simple: Do not provide a default for YYSTYPE and
14678 YYLTYPE before the user's prologue. Otherwise it's hardly... a
14679 default.
14680
14681 2001-12-29 Akim Demaille <akim@epita.fr>
14682
14683 Mid-rule actions are simply... ignored!
14684
14685 * src/reader.c (readgram): Be sure to attach mid-rule actions to
14686 the empty-rule associated to the dummy symbol, not to the host
14687 rule.
14688 * tests/actions.at (Mid-rule actions): New.
14689
14690 2001-12-29 Akim Demaille <akim@epita.fr>
14691
14692 Memory leak.
14693
14694 * src/reader.c (reader): Free grammar.
14695
14696 2001-12-29 Akim Demaille <akim@epita.fr>
14697
14698 Memory leak.
14699
14700 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
14701 since it allocates it for each state, although only one is needed.
14702 (allocate_storage): Do it here.
14703
14704 2001-12-29 Akim Demaille <akim@epita.fr>
14705
14706 * src/options.h, src/options.c (create_long_option_table): Rename
14707 as...
14708 (long_option_table_new): this, with a clearer prototype.
14709 (percent_table): Remove, unused,
14710 * src/getargs.c (getargs): Adjust.
14711
14712 2001-12-29 Akim Demaille <akim@epita.fr>
14713
14714 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
14715 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
14716 as states.
14717
14718 2001-12-29 Akim Demaille <akim@epita.fr>
14719
14720 * src/lalr.c (build_relations): Rename `states' as `states1'.
14721 Sorry, I don't understand exactly what it is, no better name...
14722
14723 2001-12-29 Akim Demaille <akim@epita.fr>
14724
14725 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
14726 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
14727 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
14728 as rules.
14729
14730 2001-12-29 Akim Demaille <akim@epita.fr>
14731
14732 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
14733 ago.
14734
14735 2001-12-29 Akim Demaille <akim@epita.fr>
14736
14737 * src/reader.c, src/reader.h (user_toknums): Remove.
14738 Adjust all users to use symbols[i]->user_token_number.
14739
14740 2001-12-29 Akim Demaille <akim@epita.fr>
14741
14742 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
14743 Adjust all users to use symbols[i]->prec or ->assoc.
14744
14745 2001-12-29 Akim Demaille <akim@epita.fr>
14746
14747 * src/reader.c, src/reader.h (tags): Remove.
14748 Adjust all users to use symbols[i]->tag.
14749
14750 2001-12-29 Akim Demaille <akim@epita.fr>
14751
14752 * src/gram.h, src/gram.c (symbols): New, similar to state_table
14753 and rule_table.
14754 * src/reader.c (packsymbols): Fill this table.
14755 Drop sprec.
14756 * src/conflicts.c (resolve_sr_conflict): Adjust.
14757 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
14758 single table.
14759 Use symbols[i]->tag instead of tags[i].
14760
14761 2001-12-29 Akim Demaille <akim@epita.fr>
14762
14763 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
14764 In addition, put a comment in there, to replace...
14765 * tests/regression.at (%union and C comments): Remove.
14766
14767 2001-12-29 Akim Demaille <akim@epita.fr>
14768
14769 * tests/regression.at (Web2c Actions): Blindly move the actual
14770 output as expected output. The contents *seem* right to me, but I
14771 can't pretend reading perfectly parser tables... Nonetheless, all
14772 the other tests pass correctly, the table look OK, even though the
14773 presence of `$axiom' is to be noted: AFAICS it is useless (but
14774 harmless).
14775
14776 2001-12-29 Akim Demaille <akim@epita.fr>
14777
14778 * src/reader.c (readgram): Don't add the rule 0 if there were no
14779 rules read. In other words, add it _after_ having performed
14780 grammar sanity checks.
14781 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
14782
14783 2001-12-29 Akim Demaille <akim@epita.fr>
14784
14785 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
14786 visible, and some states have now a different number.
14787
14788 2001-12-29 Akim Demaille <akim@epita.fr>
14789
14790 * src/reader.c (readgram): Bind the initial rule's lineno to that
14791 of the first rule.
14792 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
14793 (Solved SR Conflicts): Adjust rule 0's line number.
14794
14795 2001-12-29 Akim Demaille <akim@epita.fr>
14796
14797 Fix the `GAWK Grammar' failure.
14798
14799 * src/LR0.c (final_state): Initialize to -1 so that we do compute
14800 the reductions of the first state which was mistakenly confused
14801 with the final state because precisely final_state was initialized
14802 to 0.
14803 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
14804 now noticed by Bison.
14805 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
14806 have a reduction on $default.
14807
14808 2001-12-29 Akim Demaille <akim@epita.fr>
14809
14810 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
14811 rule line numbers.
14812 * src/closure.c (print_closure): Likewise.
14813 * src/derives.c (print_derives): Likewise.
14814 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
14815 now.
14816
14817 2001-12-29 Akim Demaille <akim@epita.fr>
14818
14819 * src/lalr.c (lookaheads_print): New.
14820 (lalr): Call it when --trace-flag.
14821 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
14822 are dumped.
14823
14824 2001-12-29 Akim Demaille <akim@epita.fr>
14825
14826 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
14827 when walking through ritem, even via rule->rhs.
14828 * src/reduce.c (dump_grammar, useful_production, reduce_output)
14829 (useful_production, useless_nonterminals): Likewise.
14830 (reduce_grammar_tables): Likewise, plus update nritems.
14831 * src/nullable.c (set_nullable): Likewise.
14832 * src/lalr.c (build_relations): Likewise.
14833 * tests/sets.at (Nullable): Adjust.
14834 Fortunately, now, the $axiom is no longer nullable.
14835
14836 2001-12-29 Akim Demaille <akim@epita.fr>
14837
14838 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
14839 the 0-sentinel.
14840 * src/gram.c (ritem_longest_rhs): Likewise.
14841 * src/reduce.c (nonterminals_reduce): Likewise.
14842 * src/print_graph.c (print_graph): Likewise.
14843 * src/output.c (output_rule_data): Likewise.
14844 * src/nullable.c (set_nullable): Likewise.
14845
14846 2001-12-29 Akim Demaille <akim@epita.fr>
14847
14848 * src/output.c: Comment changes.
14849
14850 2001-12-27 Paul Eggert <eggert@twinsun.com>
14851
14852 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
14853 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
14854 Sparc, as they were causing more porting problems than the
14855 (minor) performance improvement was worth.
14856
14857 Also, catch up with 1.31's YYSTD.
14858
14859 2001-12-27 Akim Demaille <akim@epita.fr>
14860
14861 * src/output.c (output_gram): Rely on nritems, not the
14862 0-sentinel. See below.
14863 Use -1 as separator, not 0.
14864 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
14865 Rely on -1 as separator in yyrhs, instead of 0.
14866 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
14867 twice `Now at end of input', therefore there are two lines less to
14868 expect.
14869
14870 2001-12-27 Akim Demaille <akim@epita.fr>
14871
14872 * tests/regression.at (Unresolved SR Conflicts):
14873 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
14874 below.
14875
14876 2001-12-27 Akim Demaille <akim@epita.fr>
14877
14878 * src/LR0.c (new_state): Recognize the final state by the fact it
14879 is reached by eoftoken.
14880 (insert_start_shifting_state, insert_eof_shifting_state)
14881 (insert_accepting_state, augment_automaton): Remove, since now
14882 these states are automatically computed from the initial state.
14883 (generate_states): Adjust.
14884 * src/print.c: When reporting a rule number to the user, substract
14885 1, so that the axiom rule is rule 0, and the first user rule is 1.
14886 * src/reduce.c: Likewise.
14887 * src/print_graph.c (print_core): For the time being, just as for
14888 the report, depend upon --trace-flags to dump the full set of
14889 items.
14890 * src/reader.c (readgram): Once the grammar read, insert the rule
14891 0: `$axiom: START-SYMBOL $'.
14892 * tests/set.at: Adjust: rule 0 is now displayed, and since the
14893 number of the states has changed (the final state is no longer
14894 necessarily the last), catch up.
14895
14896 2001-12-27 Akim Demaille <akim@epita.fr>
14897
14898 Try to make the use of the eoftoken valid. Given that its value
14899 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
14900 is used instead of > 0 where appropriate, (ii), depend upon nritems
14901 instead of the 0-sentinel.
14902
14903 * src/gram.h, src/gram.c (nritems): New.
14904 Expected to be duplication of nitems, but for the time being...
14905 * src/reader.c (packgram): Assert nritems and nitems are equal.
14906 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
14907 * src/closure.c (print_closure, print_fderives): Likewise.
14908 * src/gram.c (ritem_print): Likewise.
14909 * src/print.c (print_core, print_grammar): Likewise.
14910 * src/print_graph.c: Likewise.
14911
14912 2001-12-27 Akim Demaille <akim@epita.fr>
14913
14914 * src/main.c (main): If there are complains after grammar
14915 reductions, then output the report anyway if requested, then die.
14916 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
14917 * src/reader.c (eoftoken): New.
14918 (parse_token_decl): If the token being defined has value `0', it
14919 is the eoftoken.
14920 (packsymbols): No longer hack `tags' to insert `$' by hand.
14921 Be sure to preserve the value of the eoftoken.
14922 (reader): Make sure eoftoken is defined.
14923 Initialize nsyms to 0: now eoftoken is created just like the others.
14924 * src/print.c (print_grammar): Don't special case the eof token.
14925 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
14926 lie anyway, albeit pleasant.
14927 * tests/calc.at: Exercise error messages with eoftoken.
14928 Change the grammar so that empty input is invalid.
14929 Adjust expectations.
14930 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
14931
14932 2001-12-27 Akim Demaille <akim@epita.fr>
14933
14934 * configure.in: Check the protos of strchr ans strspn.
14935 Replace strchr if needed.
14936 * src/system.h: Provide the protos of strchr, strspn and memchr if
14937 missing.
14938 * lib/strchr.c: New.
14939 * src/reader.c (symbols_save): Use strchr.
14940
14941 2001-12-27 Akim Demaille <akim@epita.fr>
14942
14943 * src/print.c, src/print_graph.c (escape): New.
14944 Use it to quote the TAGS outputs.
14945 * src/print_graph.c (print_state): Now errors are in red, and
14946 reductions in green.
14947 Prefer high to wide: output the state number on a line of its own.
14948
14949 2001-12-27 Akim Demaille <akim@epita.fr>
14950
14951 * src/state.h, src/state.c (reductions_new): New.
14952 * src/LR0.c (set_state_table): Let all the states have a
14953 `reductions', even if reduced to 0.
14954 (save_reductions): Adjust.
14955 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
14956 * src/print.c (print_reductions, print_actions): Adjust.
14957 * src/output.c (action_row): Adjust.
14958
14959 2001-12-27 Akim Demaille <akim@epita.fr>
14960
14961 * src/state.h, src/state.c (errs_new, errs_dup): New.
14962 * src/LR0.c (set_state_table): Let all the states have an errs,
14963 even if reduced to 0.
14964 * src/print.c (print_errs, print_reductions): Adjust.
14965 * src/output.c (output_actions, action_row): Adjust.
14966 * src/conflicts.c (resolve_sr_conflict): Adjust.
14967
14968 2001-12-27 Akim Demaille <akim@epita.fr>
14969
14970 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
14971
14972 2001-12-27 Akim Demaille <akim@epita.fr>
14973
14974 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
14975 * src/print.c: here.
14976 (lookaheadset, shiftset): New, used as additional storage by
14977 print_reductions.
14978 (print_results): Adjust.
14979 (print_shifts, print_gotos, print_errs): New, extracted from...
14980 (print_actions): here.
14981 * src/print_graph.c (print_actions): Remove dead code.
14982
14983 2001-12-27 Akim Demaille <akim@epita.fr>
14984
14985 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
14986 `$n' and `@n'.
14987
14988 2001-12-27 Akim Demaille <akim@epita.fr>
14989
14990 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
14991 (build_relations): Adjust.
14992
14993 2001-12-27 Akim Demaille <akim@epita.fr>
14994
14995 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
14996 duplication.
14997
14998 2001-12-27 Akim Demaille <akim@epita.fr>
14999
15000 * src/reader.c (packgram): Catch nitems overflows.
15001
15002 2001-12-27 Akim Demaille <akim@epita.fr>
15003
15004 * src/files.c, src/files.h (guard_obstack): Remove.
15005 * src/output.c (output): Adjust.
15006 * src/reader.c (parse_braces): New, factoring...
15007 (copy_action, copy_guard): these two which are renamed as...
15008 (parse_action, parse_guard): these.
15009 As a voluntary consequence, using braces around guards is now
15010 mandatory.
15011
15012 2001-12-27 Akim Demaille <akim@epita.fr>
15013
15014 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15015 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15016 members.
15017 (symbol_list_new): Adjust.
15018 (copy_action): action_line is the first line, not the last.
15019 (copy_guard): Just as for actions, store the `action' only, not
15020 the switch/case/break flesh.
15021 Don't parse the user action that might follow the guard, let...
15022 (readgram): do it, i.e., now, there can be an action after a
15023 guard.
15024 In other words the guard is just explicitly optional.
15025 (packgram): Adjust.
15026 * src/output.c (guards_output): New.
15027 (output_parser): Call it when needed.
15028 (output): Also free the guard and attrs obstacks.
15029 * src/files.c, src/files.h (obstack_save): Remove.
15030 (output_files): Remove.
15031 As a result, if one needs the former `.act' file, using an
15032 appropriate skeleton which requires actions and guards is now
15033 required.
15034 * src/main.c (main): Adjust.
15035 * tests/semantic.at: New.
15036 * tests/regression.at: Use `input.y' as input file name.
15037 Avoid 8+3 problems by requiring input.c when the test needs the
15038 parser.
15039
15040 2001-12-27 Akim Demaille <akim@epita.fr>
15041
15042 * src/reader.c (symbol_list_new): Be sure to initialize all the
15043 fields.
15044
15045 2001-12-27 Akim Demaille <akim@epita.fr>
15046
15047 All the hacks using a final pseudo state are now useless.
15048
15049 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15050 * src/lalr.c (nLA): New.
15051 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15052 instead of lookaheadsp from the pseudo state (nstate + 1).
15053
15054 2001-12-27 Akim Demaille <akim@epita.fr>
15055
15056 * src/output.c (action_row, token_actions): Use a state_t instead
15057 of a integer, and nlookaheads instead of the following state's
15058 lookaheadsp.
15059
15060 2001-12-27 Akim Demaille <akim@epita.fr>
15061
15062 * src/conflicts.c (log_resolution, flush_shift)
15063 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15064 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15065 (conflicts_print, print_reductions): Use a state_t instead of an
15066 integer when referring to a state.
15067 As much as possible, depend upon nlookaheads, instead of the
15068 `lookaheadsp' member of the following state (since lookaheads of
15069 successive states are successive, the difference between state n + 1
15070 and n served as the number of lookaheads for state n).
15071 * src/lalr.c (add_lookback_edge): Likewise.
15072 * src/print.c (print_core, print_actions, print_state)
15073 (print_results): Likewise.
15074 * src/print_graph.c (print_core, print_actions, print_state)
15075 (print_graph): Likewise.
15076 * src/conflicts.h: Adjust.
15077
15078 2001-12-27 Akim Demaille <akim@epita.fr>
15079
15080 * src/bison.hairy: Formatting/comment changes.
15081 ANSIfy.
15082 Remove `register' indications.
15083 Add plenty of `static'.
15084
15085 2001-12-27 Akim Demaille <akim@epita.fr>
15086
15087 * src/output.c (prepare): Drop the muscle `ntbase' which
15088 duplicates ntokens.
15089 * src/bison.simple: Formatting/comment changes.
15090 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15091 is an undocumented synonym.
15092
15093 2001-12-22 Akim Demaille <akim@epita.fr>
15094
15095 * src/output.c (output_table_data): Change the prototype to use
15096 `int' for array ranges: some invocations do pass an int, not a
15097 short.
15098 Reported by Wayne Green.
15099
15100 2001-12-22 Akim Demaille <akim@epita.fr>
15101
15102 Some actions of web2c.y are improperly triggered.
15103 Reported by Mike Castle.
15104
15105 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15106 * tests/regression.at (Web2c): Rename as...
15107 (Web2c Report): this.
15108 (Web2c Actions): New.
15109
15110 2001-12-22 Akim Demaille <akim@epita.fr>
15111
15112 Reductions in web2c.y are improperly reported.
15113 Reported by Mike Castle.
15114
15115 * src/conflicts.c (print_reductions): Fix.
15116 * tests/regression.at (Web2c): New.
15117
15118 2001-12-18 Akim Demaille <akim@epita.fr>
15119
15120 Some host fail on `assert (!"foo")', which expands to
15121 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15122 Reported by Nelson Beebee.
15123
15124 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15125 `#define it_succeeded 0' and `assert (it_succeeded)'.
15126
15127 2001-12-17 Marc Autret <autret_m@epita.fr>
15128
15129 * src/bison.simple: Don't hard code the skeleton line and filename.
15130 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15131 New line counter 'skeleton_line' (skeleton-line muscle).
15132
15133 2001-12-17 Paul Eggert <eggert@twinsun.com>
15134
15135 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15136 YYDEBUG must be defined to a nonzero value.
15137
15138 * src/bison.simple (yytname): Do not assume that the user defines
15139 YYDEBUG to a properly parenthesized expression.
15140
15141 2001-12-17 Akim Demaille <akim@epita.fr>
15142
15143 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15144 nlookaheads is a new member.
15145 Adjust all users.
15146 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15147 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15148 state.
15149
15150 2001-12-17 Akim Demaille <akim@epita.fr>
15151
15152 * src/files.h, src/files.c (open_files, close_files): Remove.
15153 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15154 let...
15155 * src/reader.c (reader): Do it.
15156
15157 2001-12-17 Akim Demaille <akim@epita.fr>
15158
15159 * src/conflicts.c (print_reductions): Formatting changes.
15160
15161 2001-12-17 Akim Demaille <akim@epita.fr>
15162
15163 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15164 (flush_reduce): New.
15165 (resolve_sr_conflict): Adjust.
15166
15167 2001-12-17 Akim Demaille <akim@epita.fr>
15168
15169 * src/output.c (output_obstack): Be static and rename as...
15170 (format_obstack): this, to avoid any confusion with files.c's
15171 output_obstack.
15172 * src/reader.h (muscle_obstack): Move to...
15173 * src/output.h: here, since it's defined in output.c.
15174
15175 2001-12-17 Akim Demaille <akim@epita.fr>
15176
15177 * src/output.c (action_row, save_column, default_goto)
15178 (sort_actions, matching_state, pack_vector): Better variable
15179 locality.
15180
15181 2001-12-17 Akim Demaille <akim@epita.fr>
15182
15183 * src/output.c: Various formatting changes.
15184
15185 2001-12-17 Akim Demaille <akim@epita.fr>
15186
15187 * src/files.c (output_files): Free the output_obstack.
15188 * src/main.c (main): Call print and print_graph conditionally.
15189 * src/print.c (print): Work unconditionally.
15190 * src/print_graph.c (print_graph): Work unconditionally.
15191 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15192
15193 2001-12-16 Marc Autret <autret_m@epita.fr>
15194
15195 * src/output.c (actions_output): Fix. When we use %no-lines,
15196 there is one less line per action.
15197
15198 2001-12-16 Marc Autret <autret_m@epita.fr>
15199
15200 * src/bison.simple: Remove a useless #line directive.
15201 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15202 * src/output.c (get_lines_number): New.
15203 (output_parser): Adjust, now takes care about the lines of a
15204 output muscles.
15205 Fix line numbering.
15206 (actions_output): Computes the number of lines taken by actions.
15207 (output_master_parser): Insert new skeleton which is the name of
15208 the output parser file name.
15209
15210 2001-12-15 Marc Autret <autret_m@epita.fr>
15211
15212 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15213
15214 2001-12-15 Marc Autret <autret_m@epita.fr>
15215
15216 * src/output.c (output_gram): Keep track of the hairy one.
15217
15218 2001-12-15 Akim Demaille <akim@epita.fr>
15219
15220 Make `make distcheck' work.
15221
15222 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15223 system.h which uses libgettext.h.
15224
15225 2001-12-15 Akim Demaille <akim@epita.fr>
15226
15227 * src/nullable.c (set_nullable): Useless rules must be skipped,
15228 otherwise, since we range over their symbols, we might look at a
15229 nonterminal which no longer ``exists'', i.e., it is not counted in
15230 `nvars', hence we overflow our arrays.
15231
15232 2001-12-15 Akim Demaille <akim@epita.fr>
15233
15234 The header can also be produced directly, without any obstack!
15235 Yahoo!
15236
15237 * src/files.c, src/files.h (defines_obstack): Remove.
15238 (compute_header_macro): Global.
15239 (defines_obstack_save): Remove.
15240 * src/reader.c (parse_union_decl): No longer output to
15241 defines_obstack: its content can be found in the `stype' muscle
15242 anyway.
15243 (output_token_translations): Merge into...
15244 (symbols_output): this.
15245 Rename as...
15246 (symbols_save): this.
15247 (reader): Adjust.
15248 * src/output.c (header_output): New.
15249 (output): Call it.
15250
15251 2001-12-15 Akim Demaille <akim@epita.fr>
15252
15253 * src/reader.c (parse_union_decl): Instead of handling two obstack
15254 simultaneously, use one to define the `stype' muscle, and use the
15255 value of the latter to fill defines_obstack.
15256 (copy_comment): Remove.
15257 (copy_comment2): Work for a single obstack.
15258 Rename as...
15259 (copy_comment): this.
15260
15261 2001-12-15 Akim Demaille <akim@epita.fr>
15262
15263 * src/lex.c, src/lex.h (xgetc): No longer static.
15264 * src/reader.c (parse_union_decl): Revamp.
15265
15266 2001-12-15 Akim Demaille <akim@epita.fr>
15267
15268 Still making progress in separating Bison into (i) input, (ii)
15269 process, (iii) output: now we can directly output the parser file
15270 without using table_obstack at all.
15271
15272 * src/files.c, src/files.h (table_obstack): Bye bye.
15273 (parser_file_name): New.
15274 * src/files.c (compute_output_file_names): Compute it.
15275 * src/output.c (actions_output, output_parser)
15276 (output_master_parser): To a file instead of an obstack.
15277
15278 2001-12-15 Akim Demaille <akim@epita.fr>
15279
15280 Attach actions to rules, instead of pre-outputting them to
15281 actions_obstack.
15282
15283 * src/gram.h (rule_t): action and action_line are new members.
15284 * src/reader.c (symbol_list): Likewise.
15285 (copy_action): Save the actions within the rule.
15286 (packgram): Save them in rule_table.
15287 * src/output.c (actions_output): New.
15288 (output_parser): Use it on `%%actions'.
15289 (output_rule_data): Don't free rule_table.
15290 (output): Do it.
15291 (prepare): Don't save the `action' muscle.
15292 * src/bison.simple: s/%%action/%%actions/.
15293
15294 2001-12-15 Akim Demaille <akim@epita.fr>
15295
15296 * src/reader.c (copy_action): When --yacc, don't append a `;'
15297 to the user action: let it fail if lacking.
15298 Suggested by Arnold Robbins and Tom Tromey.
15299
15300 2001-12-14 Akim Demaille <akim@epita.fr>
15301
15302 * src/lex.c (literalchar): Simply return the char you decoded, non
15303 longer mess around with obstacks and int pointers.
15304 Adjust all callers.
15305
15306 2001-12-14 Akim Demaille <akim@epita.fr>
15307
15308 * src/lex.c (literalchar): Don't escape the special characters,
15309 just decode them, and keep them as char (before, eol was output as
15310 the 2 char string `\n' etc.).
15311 * src/output.c (output_rule_data): Use quotearg to output the
15312 token strings.
15313
15314 2001-12-13 Paul Eggert <eggert@twinsun.com>
15315
15316 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
15317 Do not infringe on the global user namespace when using C++.
15318 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
15319 All uses of `fprintf' and `stderr' changed.
15320
15321 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
15322
15323 2001-12-13 Akim Demaille <akim@epita.fr>
15324
15325 The computation of nullable is broken: it doesn't handle empty
15326 RHS's properly.
15327
15328 * tests/torture.at (GNU AWK Grammar): New.
15329 * tests/sets.at (Nullable): New.
15330 * src/nullable.c (set_nullable): Instead of blindly looping over
15331 `ritems', loop over the rules, and then over their rhs's.
15332
15333 Work around Autotest bugs.
15334
15335 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
15336 frame, because Autotest understand lines starting with a `+' as
15337 traces from the shell. Then, they are not processed properly.
15338 Admittedly an Autotest bug, but we don't have time to wait for
15339 Autotest to catch up.
15340 * tests/regression.at (Broken Closure): Adjust to the new table
15341 frames.
15342 Move to...
15343 * tests/sets.at: here.
15344
15345 2001-12-13 Akim Demaille <akim@epita.fr>
15346
15347 * src/closure.c (closure): Use nrules instead of playing tricks
15348 with BITS_PER_WORD.
15349
15350 2001-12-13 Akim Demaille <akim@epita.fr>
15351
15352 * src/print.c (print_actions): Output the handling of `$' as the
15353 traces do: shifting the token EOF. Before EOF was treated as a
15354 nonterminal.
15355 * tests/regression.at: Adjust some tests.
15356 * src/print_graph.c (print_core): Complete the set of items via
15357 closure. The next-to-final and final states are still unsatisfying,
15358 but that's to be addressed elsewhere.
15359 No longer output the rule numbers, but do output the state number.
15360 A single loop for the shifts + gotos is enough, but picked a
15361 distinct color for each.
15362 (print_graph): Initialize and finalize closure.
15363
15364 2001-12-13 Akim Demaille <akim@epita.fr>
15365
15366 * src/reader.c (readgram): Remove dead code, an strip useless
15367 braces.
15368 (get_type): Remove, unused.
15369
15370 2001-12-12 Akim Demaille <akim@epita.fr>
15371
15372 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
15373 on that of lib/error.c.
15374
15375 2001-12-12 Akim Demaille <akim@epita.fr>
15376
15377 Some hosts don't like `/' in includes.
15378
15379 * src/system.h: Include libgettext.h without qualifying the path.
15380 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
15381 $(top_srcdir).
15382
15383 2001-12-11 Marc Autret <autret_m@epita.fr>
15384
15385 * src/output.c (output_parser): Remove useless muscle.
15386
15387 2001-12-11 Marc Autret <autret_m@epita.fr>
15388
15389 * src/bison.simple: Remove #line just before %%epilogue. It
15390 is now handled in ...
15391 * src/reader.c (read_additionnal_code): Add the output of a
15392 #line for the epilogue.
15393
15394 2001-12-10 Marc Autret <autret_m@epita.fr>
15395
15396 * src/reader.c (copy_definition): Re-use CPP-outed code which
15397 replace precedent remove.
15398 * src/bison.simple: Remove #line before %%prologue because
15399 %%input-line is wrong at this time.
15400
15401 2001-12-10 Marc Autret <autret_m@epita.fr>
15402
15403 * src/reader.c (symbols_output): Clean up.
15404 * src/output.c (output_gram, output): Clean up.
15405
15406 2001-12-10 Akim Demaille <akim@epita.fr>
15407
15408 * src/lalr.c (initialize_lookaheads): New. Extracted from...
15409 * src/LR0.c (set_state_table): here.
15410 * src/lalr.c (lalr): Call it.
15411
15412 2001-12-10 Akim Demaille <akim@epita.fr>
15413
15414 * src/state.h (shifts): Remove the `number' member: shifts are
15415 attached to state, hence no longer need to be labelled with a
15416 state number.
15417
15418 2001-12-10 Akim Demaille <akim@epita.fr>
15419
15420 Now that states have a complete set of members, the linked list of
15421 shifts is useless: just fill directly the state's shifts member.
15422
15423 * src/state.h (shifts): Remove the `next' member.
15424 * src/LR0.c (first_state, last_state): Remove.
15425 Adjust the callers.
15426 (augment_automaton): Don't look for the shifts that must be added
15427 a shift on EOF: it is those of the state we looked for! But now,
15428 since shifts are attached, it is no longer needed to looking
15429 merely by its id: its number.
15430
15431 2001-12-10 Akim Demaille <akim@epita.fr>
15432
15433 * src/LR0.c (augment_automaton): Better variable locality.
15434 Remove an impossible branch: if there is a state corresponding to
15435 the start symbol being shifted, then there is shift for the start
15436 symbol from the initial state.
15437
15438 2001-12-10 Akim Demaille <akim@epita.fr>
15439
15440 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
15441 only when appropriate: when insert_start_shifting_state' is not
15442 invoked.
15443 * tests/regression.at (Rule Line Numbers): Adjust.
15444
15445 2001-12-10 Akim Demaille <akim@epita.fr>
15446
15447 * src/LR0.c (augment_automaton): Now that all states have shifts,
15448 merge the two cases addition shifts to the initial state.
15449
15450 2001-12-10 Akim Demaille <akim@epita.fr>
15451
15452 * src/lalr.c (set_state_table): Move to...
15453 * src/LR0.c: here.
15454 * src/lalr.c (lalr): Don't call it...
15455 * src/LR0.c (generate_states): do it.
15456 * src/LR0.h (first_state): Remove, only the table is used.
15457
15458 2001-12-10 Akim Demaille <akim@epita.fr>
15459
15460 * src/LR0.h (first_shift, first_reduction): Remove.
15461 * src/lalr.c: Don't use first_shift: find shifts through the
15462 states.
15463
15464 2001-12-10 Akim Demaille <akim@epita.fr>
15465
15466 * src/LR0.c: Attach shifts to states as soon as they are
15467 computed.
15468 * src/lalr.c (set_state_table): Instead of assigning shifts to
15469 state, just assert that the mapping was properly done.
15470
15471 2001-12-10 Akim Demaille <akim@epita.fr>
15472
15473 * src/LR0.c (insert_start_shift): Rename as...
15474 (insert_start_shifting_state): this.
15475 (insert_eof_shifting_state, insert_accepting_state): New.
15476 (augment_automaton): Adjust.
15477 Better locality of the variables.
15478 When looking if the start_symbol is shifted from the initial
15479 state, using `while (... symbol != start_symbol ...)' sounds
15480 better than `while (... symbol < start_symbol ...)': If fail
15481 to see how the order between symbols could be relevant!
15482
15483 2001-12-10 Akim Demaille <akim@epita.fr>
15484
15485 * src/getargs.h: Don't declare `spec_name_prefix' and
15486 `spec_file_prefix', declared by src/files.h.
15487 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
15488 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
15489 * src/output.c (prepare): Adjust.
15490 * src/reader.c (symbols_output): Likewise.
15491 * src/vmsgetargs.c: Vaguely adjust, but who cares?
15492
15493 2001-12-10 Akim Demaille <akim@epita.fr>
15494
15495 * src/muscle_tab.c (muscle_init): NULL is a better default than
15496 `"0"'.
15497
15498 2001-12-10 Akim Demaille <akim@epita.fr>
15499
15500 * src/reader.c (reader): Calling symbols_output once is enough.
15501
15502 2001-12-10 Akim Demaille <akim@epita.fr>
15503
15504 Now that states have a complete set of members, the linked list of
15505 reductions is useless: just fill directly the state's reductions
15506 member.
15507
15508 * src/state.h (struct reductions): Remove member `number' and
15509 `next'.
15510 * src/LR0.c (first_reduction, last_reduction): Remove.
15511 (save_reductions): Don't link the new reductions, store them in
15512 this_state.
15513 * src/lalr.c (set_state_table): No need to attach reductions to
15514 states, it's already done.
15515 * src/output.c (output_actions): No longer free the shifts, then
15516 the reductions, then the states: free all the states and their
15517 members.
15518
15519 2001-12-10 Akim Demaille <akim@epita.fr>
15520
15521 * src/options.c (OPTN, DRTV, BOTH): New.
15522 (option_table): Use them.
15523
15524 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
15525 the job of system.h.
15526 * src/options.c: Don't include stdio.h and xalloc.h for the same
15527 reasons.
15528
15529 2001-12-10 Akim Demaille <akim@epita.fr>
15530
15531 * src/output.c (output, prepare): Make sure the values of the
15532 muscles `action' and `prologue' are 0-terminated.
15533
15534 2001-12-10 Akim Demaille <akim@epita.fr>
15535
15536 Clean up GCC warnings.
15537
15538 * src/reader.c (copy_action): `buf' is not used.
15539 (parse_skel_decl): Be static.
15540 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
15541 * src/options.h (create_long_option_table): Have a real prototype.
15542 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
15543 (hash_delete_at): Return const void *.
15544 Adjust casts to preserve the const.
15545
15546 2001-12-10 Akim Demaille <akim@epita.fr>
15547
15548 * configure.in: Require 2.52g.
15549 M4 is not needed, but AUTOM4TE is.
15550 * m4/m4.m4: Remove.
15551 * tests/Makefile.am: Adjust.
15552
15553 2001-12-10 Akim Demaille <akim@epita.fr>
15554
15555 One structure for states is enough, even though theoretically
15556 there are LR(0) states and LALR(1) states.
15557
15558 * src/lalr.h (state_t): Remove.
15559 (state_table): Be state_t **, not state_t *.
15560 * src/state.h (core, CORE_ALLOC): Rename as...
15561 (state_t, STATE_ALLOC): this.
15562 Add the LALR(1) members: shifts, reductions, errs.
15563 * src/LR0.c (state_table): Rename as...
15564 (state_hash): this, to avoid name clashes with the global
15565 `state_table'.
15566 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
15567 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
15568
15569 2001-12-10 Akim Demaille <akim@epita.fr>
15570
15571 Bison dumps core on bash.y.
15572 Reported by Pascal Bart.
15573
15574 * src/warshall.c (bitmatrix_print): New.
15575 (TC): Use it.
15576 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
15577 j must be the outer loop.
15578 * tests/regression.at (Broken Closure): New.
15579
15580 2001-12-05 Akim Demaille <akim@epita.fr>
15581
15582 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
15583 its argument.
15584 Reported by Peter Hamorsky.
15585
15586 2001-12-05 Akim Demaille <akim@epita.fr>
15587
15588 * src/conflicts.c (err_table): Remove.
15589 (resolve_sr_conflict): Adjust.
15590 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
15591 Rename as...
15592 (state_t.reductions, state_t.shifts): this.
15593
15594 2001-12-05 Akim Demaille <akim@epita.fr>
15595
15596 * src/reduce.c (reduce_grammar_tables): No longer disable the
15597 removal of useless rules via CPP but via `if (0)', so that the
15598 compiler still check the code is valid.
15599 For instance, it should have noticed `rline' no longer exists: use
15600 the `line' member of rule_t.
15601 * src/gram.c (dummy, rline): Remove, unused.
15602
15603 2001-12-05 Akim Demaille <akim@epita.fr>
15604
15605 * src/output.c (pack_vector): Use assert, not berror.
15606 * src/main.c (berror): Remove, unused.
15607
15608 2001-12-05 Akim Demaille <akim@epita.fr>
15609
15610 New experimental feature: if --verbose --trace output all the
15611 items of a state, not only its kernel.
15612
15613 * src/print.c (print_core): If `trace_flag', then invoke closure
15614 before outputting the items of the state (print_core is no longer
15615 a correct name them).
15616 (print_results): Invoke new_closure/free_closure if needed.
15617
15618 2001-12-05 Akim Demaille <akim@epita.fr>
15619
15620 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
15621 * src/closure.c, src/closure.h (itemsetsize): Rename as...
15622 (nitemset): for consistency with the rest of the project.
15623
15624 2001-12-05 Akim Demaille <akim@epita.fr>
15625
15626 * src/closure.c (print_closure): Improve.
15627 (closure): Use it for printing input and output.
15628
15629 2001-12-05 Akim Demaille <akim@epita.fr>
15630
15631 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
15632 indexed by nonterminals.
15633
15634 2001-12-05 Akim Demaille <akim@epita.fr>
15635
15636 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
15637 what it was!).
15638 * src/warshall.h: Remove accidental duplication of the content.
15639
15640 2001-12-05 Akim Demaille <akim@epita.fr>
15641
15642 * src/closure.c (set_fderives): De-obfuscate.
15643
15644 2001-12-05 Akim Demaille <akim@epita.fr>
15645
15646 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
15647
15648 2001-12-05 Akim Demaille <akim@epita.fr>
15649
15650 * src/closure.c (set_firsts): De-obfuscate.
15651
15652 2001-12-05 Akim Demaille <akim@epita.fr>
15653
15654 * src/output.c (action_row): De-obfuscate
15655 using the good o' techniques: arrays not pointers, variable
15656 locality, BITISSET, RESETBIT etc.
15657
15658 2001-12-05 Akim Demaille <akim@epita.fr>
15659
15660 Pessimize the code to simplify it: from now on, all the states
15661 have a valid SHIFTS, which NSHIFTS is possibly 0.
15662
15663 * src/LR0.c (shifts_new): Be global and move to..
15664 * src/state.c, src/state.h: here.
15665 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
15666 * src/print_graph: Adjust.
15667
15668 2001-12-05 Akim Demaille <akim@epita.fr>
15669
15670 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
15671 * src/conflicts.c: Use it.
15672 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
15673 incorrectly ``simplified''.
15674
15675 2001-12-05 Akim Demaille <akim@epita.fr>
15676
15677 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
15678 using the good o' techniques: arrays not pointers, variable
15679 locality, BITISSET, RESETBIT etc.
15680
15681 2001-12-05 Akim Demaille <akim@epita.fr>
15682
15683 * src/state.h (SHIFT_SYMBOL): New.
15684 * src/conflicts.c: Use it to deobfuscate.
15685
15686 2001-12-05 Akim Demaille <akim@epita.fr>
15687
15688 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
15689 (print_reductions): De-obfuscate using the good o' techniques:
15690 arrays not pointers, variable locality, BITISSET.
15691
15692 2001-12-05 Akim Demaille <akim@epita.fr>
15693
15694 * src/conflicts.c (print_reductions): Arrays, not pointers.
15695 Use BITISSET.
15696
15697 2001-12-05 Akim Demaille <akim@epita.fr>
15698
15699 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15700
15701 2001-12-05 Akim Demaille <akim@epita.fr>
15702
15703 * src/conflicts.c (print_reductions): Improve variable locality.
15704
15705 2001-12-05 Akim Demaille <akim@epita.fr>
15706
15707 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15708
15709 2001-12-05 Akim Demaille <akim@epita.fr>
15710
15711 * src/conflicts.c (print_reductions): Improve variable locality.
15712
15713 2001-12-05 Akim Demaille <akim@epita.fr>
15714
15715 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
15716 * src/lalr.c: Use them.
15717
15718 2001-12-05 Akim Demaille <akim@epita.fr>
15719
15720 * src/LR0.c (augment_automaton): Formatting changes.
15721 Better variable locality.
15722
15723 2001-12-05 Akim Demaille <akim@epita.fr>
15724
15725 * src/lalr.c (matrix_print): New.
15726 (transpose): Use it.
15727 Use arrays instead of pointers.
15728
15729 2001-12-05 Akim Demaille <akim@epita.fr>
15730
15731 * src/lalr.c (maxrhs): Move to...
15732 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
15733 * src/lalr.c (build_relations): Adjust.
15734
15735 2001-12-05 Akim Demaille <akim@epita.fr>
15736
15737 * src/lalr.c (transpose): Free the memory allocated to the
15738 argument, as it is replaced by the results by the unique caller.
15739 (build_relations): Merely invoke transpose: it handles the memory
15740 deallocation.
15741 Improve variable locality.
15742 Avoid variables used as mere abbreviations.
15743 (compute_lookaheads): Use arrays instead of pointers.
15744
15745 2001-12-05 Akim Demaille <akim@epita.fr>
15746
15747 * src/lalr.c (initialize_F): Improve variable locality.
15748 Avoid variables used as mere abbreviations.
15749
15750 2001-12-05 Akim Demaille <akim@epita.fr>
15751
15752 * src/derives.c (print_derives): Display the ruleno.
15753 * src/lalr.c (initialize_F, transpose): Better variable locality
15754 to improve readability.
15755 Avoid variables used as mere abbreviations.
15756
15757 2001-12-05 Akim Demaille <akim@epita.fr>
15758
15759 * src/lalr.c (traverse): Use arrays instead of pointers.
15760
15761 2001-12-05 Akim Demaille <akim@epita.fr>
15762
15763 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
15764 the handling of squeue.
15765 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15766
15767 2001-12-05 Akim Demaille <akim@epita.fr>
15768
15769 Because useless nonterminals are now kept alive (instead of being
15770 `destroyed'), we now sometimes examine them, and store information
15771 related to them. Hence we need to know their number, and adjust
15772 memory allocations.
15773
15774 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
15775 static.
15776 * src/LR0.c (allocate_itemsets): The memory allocated to
15777 `symbol_count' was used for two different purpose: once to count
15778 the number of occurrences of each symbol, and later reassigned to
15779 `shift_symbol', containing the symbol that can be shifted from a
15780 given state.
15781 Deobfuscate, i.e., allocate, use and free `symbol_count' here
15782 only, and...
15783 (new_itemsets): Allocate `shift_symbol' here.
15784 (allocate_itemsets): symbol_count includes useless nonterminals.
15785 Make room for them.
15786 (free_storage): Use `free', not `XFREE', for pointers that cannot
15787 be null.
15788
15789 2001-12-05 Akim Demaille <akim@epita.fr>
15790
15791 * src/nullable.c (set_nullable): Deobfuscate the handling of
15792 ritem.
15793 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15794
15795 2001-12-05 Akim Demaille <akim@epita.fr>
15796
15797 * src/gram.c, src/gram.h (ritem_print): New.
15798 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
15799 (This useless function was defined only to work around VMS linkers
15800 that can't handle compilation units with variables only).
15801 * src/reduce.c (dump_grammar): Use it to trace the construction of
15802 ritem.
15803
15804 2001-12-04 Paul Eggert <eggert@twinsun.com>
15805
15806 * src/bison.simple (union yyalloc): Change member names
15807 to be the same as the stack names.
15808 (yyparse): yyptr is now union yyalloc *, not char *.
15809 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
15810 and may generate better code on some machines.
15811 (yystpcpy): Use prototype if __STDC__ is defined, not just
15812 if __cplusplus is defined.
15813
15814 2001-11-30 Akim Demaille <akim@epita.fr>
15815
15816 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
15817 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
15818 Gettext doesn't compile cleanly, and dies with -Werror.
15819 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
15820 Include WARNING_CFLAGS here.
15821 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
15822 before being defined.
15823
15824 2001-11-27 Paul Eggert <eggert@twinsun.com>
15825
15826 * lib/quotearg.h (quotearg_n, quotearg_n_style):
15827 First arg is int, not unsigned.
15828 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
15829 (SIZE_MAX, UINT_MAX): New macros.
15830 (quotearg_n_options): Abort if N is negative.
15831 Avoid overflow check on hosts where size_t is 64 bits and int
15832 is 32 bits, as overflow is impossible there.
15833 Fix off-by-one typo that caused unnecessary reallocation.
15834
15835 2001-11-29 Paul Eggert <eggert@twinsun.com>
15836
15837 Name space cleanup in generated parser.
15838
15839 * doc/bison.texinfo (Bison Parser): Discuss system headers
15840 and their effect on the user name space.
15841
15842 * src/bison.simple:
15843 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
15844 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
15845 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
15846
15847 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
15848 on user names when possible.
15849
15850 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
15851 Simplify test for whather <alloca.h> exists.
15852
15853 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
15854
15855 (<stdio.h>): Include if YYDEBUG.
15856
15857 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
15858 ! defined (yyoverflow) && ! defined (yymemcpy).
15859
15860 (yymemcpy, yyparse): Rename local variables as needed so that
15861 they all begin with 'yy'.
15862
15863 (yystrlen, yystpcpy): New functions.
15864
15865 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
15866 All uses changed.
15867
15868 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
15869 instead of relying on string.h functions. Use YYSTACK_ALLOC
15870 and YYSTACK_FREE instead of malloc and free.
15871
15872 2001-11-30 Akim Demaille <akim@epita.fr>
15873
15874 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
15875 before their first uses.
15876 (YYBISON, YYPURE): Move to the top of the output.
15877
15878 2001-11-30 Akim Demaille <akim@epita.fr>
15879
15880 * tests/reduce.at (Useless Nonterminals): Fix.
15881
15882 2001-11-30 Akim Demaille <akim@epita.fr>
15883
15884 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
15885 if body instead of `;' to pacify GCC's warnings.
15886
15887 2001-11-30 Akim Demaille <akim@epita.fr>
15888
15889 Instead of mapping the LHS of unused rules to -1, keep the LHS
15890 valid, but flag the rules as invalid.
15891
15892 * src/gram.h (rule_t): `useful' is a new member.
15893 * src/print.c (print_grammar): Adjust.
15894 * src/derives.c (set_derives): Likewise.
15895 * src/reader.c (packgram, reduce_output): Likewise.
15896 * src/reduce.c (reduce_grammar_tables): Likewise.
15897 * tests/reduce.at (Underivable Rules, Useless Rules): New.
15898
15899 2001-11-30 Akim Demaille <akim@epita.fr>
15900
15901 * src/reduce.c (reduce_output): Formatting changes.
15902 * src/print.c (print_results, print_grammar): Likewise.
15903 * tests/regression.at (Rule Line Numbers)
15904 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
15905
15906 2001-11-30 Akim Demaille <akim@epita.fr>
15907
15908 * src/reduce.c (nonterminals_reduce): Instead of throwing away
15909 useless nonterminals, move them at the end of the symbol arrays.
15910 (reduce_output): Adjust.
15911 * tests/reduce.at (Useless Nonterminals): Adjust.
15912
15913 2001-11-30 Akim Demaille <akim@epita.fr>
15914
15915 * src/reduce.c: Various comment/formatting changes.
15916 (nonterminals_reduce): New, extracted from...
15917 (reduce_grammar_tables): here.
15918 (reduce_grammar): Call nonterminals_reduce.
15919
15920 2001-11-29 Paul Eggert <eggert@twinsun.com>
15921
15922 * src/bison.simple (YYSTACK_REALLOC): Remove.
15923 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
15924 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
15925 New macros.
15926 (union yyalloc): New type.
15927 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
15928 an arbitrary restriction on hosts where size_t is wider than int.
15929
15930 (yyparse): Don't dump core if alloca or malloc fails; instead, report
15931 a parser stack overflow. Allocate just one block of memory for all
15932 three stacks, instead of allocating three blocks; this typically is
15933 faster and reduces fragmentation.
15934
15935 Do not limit the number of items in the stack to a value that fits
15936 in 'int', as this is an arbitrary limit on hosts with 64-bit
15937 size_t and 32-bit int.
15938
15939 2001-11-29 Marc Autret <autret_m@epita.fr>
15940
15941 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
15942 of defining YYERROR_VERBOSE.
15943 [AT_DATA]: $4 is now out of C declarations in the prologue.
15944
15945 2001-11-28 Marc Autret <autret_m@epita.fr>
15946
15947 * src/reader.c (parse_dquoted_param): New.
15948 (parse_skel_decl): Use it.
15949 * src/lex.h: Add its prototype.
15950 * src/lex.c (literalchar): Become not static.
15951
15952 2001-11-28 Marc Autret <autret_m@epita.fr>
15953
15954 * src/output.h: And put its extern declaration here.
15955 * src/output.c (error_verbose): Define here.
15956 (prepare): Echo name modification.
15957 * src/getargs.h: Clean its extern declaration.
15958 * src/getargs.c (error_verbose_flag): Remove.
15959 (getargs): Remove case 'e'.
15960 * src/options.c (option_table): 'error-verbose' is now seen as simple
15961 percent option.
15962 Include output.h.
15963
15964 * src/reader.c (read_declarations): Remove case tok_include.
15965 (parse_include_decl): Remove.
15966 * src/lex.h (token_t): Remove tok_include.
15967 * src/options.c (option_table): 'include' is now a simple command line
15968 option.
15969
15970 2001-11-28 Marc Autret <autret_m@epita.fr>
15971
15972 * src/bison.simple: Adjust muscle names.
15973 * src/muscle_tab.c (muscle_init): Also rename the muscles.
15974 * src/output.c (prepare): s/_/-/ for the muscles names.
15975 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
15976
15977 2001-11-28 Marc Autret <autret_m@epita.fr>
15978
15979 * src/bison.simple: Fix debug.
15980 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
15981
15982 2001-11-28 Akim Demaille <akim@epita.fr>
15983
15984 * src/LR0.c (shifts_new): New.
15985 (save_shifts, insert_start_shift, augment_automaton): Use it.
15986
15987 2001-11-28 Akim Demaille <akim@epita.fr>
15988
15989 * src/closure.c (closure): `b' and `ruleno' denote the same value:
15990 keep ruleno only.
15991
15992 2001-11-28 Akim Demaille <akim@epita.fr>
15993
15994 * src/closure.c (closure): Instead of looping over word in array
15995 then bits in words, loop over bits in array.
15996
15997 2001-11-28 Akim Demaille <akim@epita.fr>
15998
15999 * src/closure.c (closure): No longer optimize the special case
16000 where all the bits of `ruleset[r]' are set to 0, to make the code
16001 clearer.
16002
16003 2001-11-28 Akim Demaille <akim@epita.fr>
16004
16005 * src/closure.c (closure): `r' and `c' are new variables, used to
16006 de-obfuscate accesses to RULESET and CORE.
16007
16008 2001-11-28 Akim Demaille <akim@epita.fr>
16009
16010 * src/reduce.c (reduce_print): Use ngettext.
16011 (dump_grammar): Improve the trace accuracy.
16012
16013 2001-11-28 Akim Demaille <akim@epita.fr>
16014
16015 * src/reduce.c (dump_grammar): Don't translate trace messages.
16016
16017 2001-11-28 Akim Demaille <akim@epita.fr>
16018
16019 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16020 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16021 as all tags are free'ed afterwards.
16022 From Enrico Scholz.
16023
16024 2001-11-27 Paul Eggert <eggert@twinsun.com>
16025
16026 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16027 use alloca when we didn't want to, and vice versa.
16028
16029 2001-11-27 Marc Autret <autret_m@epita.fr>
16030
16031 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16032 initialization.
16033 * src/output.c (prepare): Remove its update.
16034
16035 2001-11-27 Marc Autret <autret_m@epita.fr>
16036
16037 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16038 Use %error-verbose.
16039
16040 2001-11-27 Marc Autret <autret_m@epita.fr>
16041
16042 * src/bison.simple: Remove YYERROR_VERBOSE using.
16043 Use %%error_verbose.
16044 (yyparse): Likewise.
16045 * src/output.c (prepare): Give its final value.
16046 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16047 * src/getargs.h: Add its extern declaration.
16048 * src/getargs.c (error_verbose_flag): New int.
16049 (getargs): Update to catch new case.
16050 * src/options.c (option_table): 'error-verbose' is a new option.
16051 (shortopts): Update.
16052
16053 2001-11-27 Akim Demaille <akim@epita.fr>
16054
16055 * src/system.h: Use intl/libgettext.h.
16056 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16057
16058 2001-11-27 Akim Demaille <akim@epita.fr>
16059
16060 * tests/torture.at (Exploding the Stack Size with Malloc):
16061 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16062
16063 2001-11-27 Akim Demaille <akim@epita.fr>
16064
16065 * src/files.c: Include error.h.
16066 Reported by Hans Aberg.
16067
16068 2001-11-26 Marc Autret <autret_m@epita.fr>
16069
16070 * src/reader.c (parse_include_decl): New, not yet implemented.
16071 (read_declarations): Add case tok_include.
16072 * src/getargs.h (include): Add its extern definition.
16073 * src/getargs.c (include): New const char *.
16074 (getargs): Add case '-I'.
16075 * src/options.c (option_table): Add include as command line and
16076 percent option.
16077 * src/lex.h (token_t): Add tok_include.
16078
16079 2001-11-26 Akim Demaille <akim@epita.fr>
16080
16081 * src/reader.c (readgram): Make sure rules for mid-rule actions
16082 have a lineno equal to that of their host rule.
16083 Reported by Hans Aberg.
16084 * tests/regression.at (Rule Line Numbers): New.
16085
16086 2001-11-26 Akim Demaille <akim@epita.fr>
16087
16088 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16089 size_ts.
16090
16091 2001-11-26 Akim Demaille <akim@epita.fr>
16092
16093 * src/complain.c, src/complain.h (error): Remove, provided by
16094 lib/error.[ch].
16095
16096 2001-11-26 Akim Demaille <akim@epita.fr>
16097
16098 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16099 issue an error message.
16100 * tests/regression.at (Invalid %directive): New.
16101 Reported by Hans Aberg.
16102
16103 2001-11-26 Akim Demaille <akim@epita.fr>
16104
16105 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16106 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16107
16108 2001-11-26 Akim Demaille <akim@epita.fr>
16109
16110 * src/conflicts.c (conflicts_print): Don't complain at all when
16111 there are no reduce/reduce conflicts, and as many shift/reduce
16112 conflicts as expected.
16113 * tests/regression.at (%expect right): Adjust.
16114
16115 2001-11-23 Akim Demaille <akim@epita.fr>
16116
16117 * lib/alloca.c: Update, from fileutils.
16118
16119 2001-11-23 Akim Demaille <akim@epita.fr>
16120
16121 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16122
16123 2001-11-23 Akim Demaille <akim@epita.fr>
16124
16125 * src/system.h: Include alloca.h.
16126 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16127
16128 2001-11-23 Akim Demaille <akim@epita.fr>
16129
16130 * src/print_graph.c (print_actions): Remove `rule', unused.
16131 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16132 pacify GCC's signed < unsigned warnings.
16133 * src/closure.c (itemsetsize): Likewise.
16134 * src/reader.c (symbol_list_new): Static.
16135
16136 2001-11-23 Akim Demaille <akim@epita.fr>
16137
16138 Attaching lineno to buckets is stupid, since only one copy of each
16139 symbol is kept, only the line of the first occurrence is kept too.
16140
16141 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16142 * src/reader.c (rline_allocated): Remove, unused.
16143 (symbol_list): Have a `line' member.
16144 (symbol_list_new): New.
16145 (readgram): Use it.
16146 * src/print.c (print_grammar): Output the rule line numbers.
16147 * tests/regression.at (Solved SR Conflicts)
16148 (Unresolved SR Conflicts): Adjust.
16149 Reported by Hans Aberg.
16150
16151 2001-11-22 Marc Autret <autret_m@epita.fr>
16152
16153 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16154
16155 2001-11-22 Marc Autret <autret_m@epita.fr>
16156
16157 * src/muscle_tab.c (muscle_init): Remove initialization of
16158 skeleton muscle.
16159 * src/output.c (output_master_parser): Do it here.
16160
16161 2001-11-20 Akim Demaille <akim@epita.fr>
16162
16163 * po/sv.po: New.
16164 * configure.in (ALL_LINGUAS): Adjust.
16165 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16166 longer contains strings to translate.
16167
16168 2001-11-19 Akim Demaille <akim@epita.fr>
16169
16170 * src/conflicts.c (conflicts_print): Add a missing \n.
16171
16172 2001-11-19 Akim Demaille <akim@epita.fr>
16173
16174 * src/nullable.c (nullable_print): New.
16175 (set_nullable): Call it when tracing.
16176 Better locality of variables.
16177
16178 2001-11-19 Akim Demaille <akim@epita.fr>
16179
16180 * src/print.c (print_actions): Better locality of variables.
16181
16182 2001-11-19 Akim Demaille <akim@epita.fr>
16183
16184 * src/derives.c (print_derives): Fix and enrich.
16185 * src/closure.c (print_fderives): Likewise.
16186
16187 2001-11-19 Akim Demaille <akim@epita.fr>
16188
16189 * src/closure.c (itemsetend): Remove, replaced with...
16190 (itemsetsize): new.
16191
16192 2001-11-19 Akim Demaille <akim@epita.fr>
16193
16194 * src/LR0.c (kernel_end): Remove, replaced with...
16195 (kernel_size): new.
16196
16197 2001-11-19 Akim Demaille <akim@epita.fr>
16198
16199 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16200 to clarify.
16201
16202 2001-11-19 Akim Demaille <akim@epita.fr>
16203
16204 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16205
16206 2001-11-19 Akim Demaille <akim@epita.fr>
16207
16208 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16209 trace messages.
16210 * src/LR0.c: Likewise.
16211 (allocate_itemsets): Use arrays instead of pointers to clarify.
16212
16213 2001-11-19 Akim Demaille <akim@epita.fr>
16214
16215 * src/getargs.c (statistics_flag): Replace with...
16216 (trace_flag): New.
16217 (longopts): Accept --trace instead of --statistics.
16218 * src/getargs.h, src/options.c: Adjust.
16219 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16220 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16221
16222 2001-11-19 Akim Demaille <akim@epita.fr>
16223
16224 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
16225 pointers to clarify the code.
16226 (save_reductions, save_shifts): Factor common parts of alternatives.
16227
16228 2001-11-19 Akim Demaille <akim@epita.fr>
16229
16230 * src/LR0.c (new_state, get_state): Complete TRACE code.
16231 * src/closure.c: Include `reader.h' to get `tags', needed by the
16232 trace code.
16233 Rename the conditional DEBUG as TRACE.
16234 Output consistently TRACEs to stderr, not stdout.
16235 * src/derives.c: Likewise.
16236 * src/reduce.c: (inaccessable_symbols): Using if is better style
16237 than goto.
16238 Use `#if TRACE' instead of `#if 0' for tracing code.
16239
16240 2001-11-19 Akim Demaille <akim@epita.fr>
16241
16242 * src/system.h (LIST_FREE, shortcpy): New.
16243 * src/LR0.c: Use them.
16244 * src/output.c (free_itemsets, free_reductions, free_shifts):
16245 Remove, replaced by LIST_FREE.
16246
16247 2001-11-19 Akim Demaille <akim@epita.fr>
16248
16249 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16250 (REDUCTIONS_ALLOC): New.
16251 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16252 allocation.
16253
16254 2001-11-19 Akim Demaille <akim@epita.fr>
16255
16256 * src/LR0.c (new_state): Complete trace code.
16257 * src/nullable.c (set_nullable): Don't translate traces.
16258
16259 2001-11-19 Akim Demaille <akim@epita.fr>
16260
16261 * src/print_graph.c (print_core): Better locality of variables.
16262 * src/print.c (print_core): Likewise.
16263
16264 2001-11-19 Akim Demaille <akim@epita.fr>
16265
16266 * src/vcg.c: You do the output, so you are responsible of the
16267 handling of VCG syntax, in particular: use quotearg.
16268 * src/print_graph.c: Don't.
16269 (print_actions): Don't output the actions as part of the nodes,
16270 since that's the job of the edges.
16271 (print_state): Don't output by hand: fill the node description,
16272 and ask for its output.
16273
16274 2001-11-19 Akim Demaille <akim@epita.fr>
16275
16276 * src/bison.simple (yyparse): When verbosely reporting an error,
16277 no longer put additional quotes around token names.
16278 * tests/calc.at: Adjust.
16279
16280 2001-11-19 Akim Demaille <akim@epita.fr>
16281
16282 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16283 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16284 * src/output.c: Adjust.
16285
16286 2001-11-19 Akim Demaille <akim@epita.fr>
16287
16288 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
16289 (rule_t): this.
16290 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
16291
16292 2001-11-19 Akim Demaille <akim@epita.fr>
16293
16294 * src/gram.h (rule_t): New.
16295 (rule_table): New.
16296 (rrhs, rlhs): Remove, part of state_t.
16297 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
16298 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16299 * src/reader.c, src/reduce.c: Adjust.
16300
16301 2001-11-19 Akim Demaille <akim@epita.fr>
16302
16303 * src/reader.c (symbols_output): New, extracted from...
16304 (packsymbols): Here.
16305 (reader): Call it.
16306
16307 2001-11-19 Akim Demaille <akim@epita.fr>
16308
16309 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
16310 (maxrhs): this new function.
16311
16312 2001-11-19 Akim Demaille <akim@epita.fr>
16313
16314 * src/lalr.c (F): New macro to access the variable F.
16315 Adjust.
16316
16317 2001-11-19 Akim Demaille <akim@epita.fr>
16318
16319 * src/lalr.h (LA): New macro to access the variable LA.
16320 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16321 * src/lalr.c: Adjust.
16322
16323 2001-11-19 Akim Demaille <akim@epita.fr>
16324
16325 * src/lalr.c (initialize_LA): Only initialize LA. Let...
16326 (set_state_table): handle the `lookaheads' members.
16327
16328 2001-11-19 Akim Demaille <akim@epita.fr>
16329
16330 * src/lalr.h (lookaheads): Removed array, whose contents is now
16331 a member of...
16332 (state_t): this structure.
16333 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16334 Adjust.
16335
16336 2001-11-19 Akim Demaille <akim@epita.fr>
16337
16338 * src/lalr.h (consistent): Removed array, whose contents is now
16339 a member of...
16340 (state_t): this structure.
16341 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16342 Adjust.
16343
16344 2001-11-19 Akim Demaille <akim@epita.fr>
16345
16346 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
16347 contents are now members of...
16348 (state_t): this structure.
16349 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16350 Adjust.
16351
16352 2001-11-19 Akim Demaille <akim@epita.fr>
16353
16354 * src/lalr.h (state_t): New.
16355 (state_table): Be a state_t * instead of a core **.
16356 (accessing_symbol): Remove, part of state_t.
16357 * src/lalr.c: Adjust.
16358 (set_accessing_symbol): Merge into...
16359 (set_state_table): this.
16360 * src/print_graph.c, src/conflicts.c: Adjust.
16361
16362 2001-11-14 Akim Demaille <akim@epita.fr>
16363
16364 * tests/calc.at, tests/output.at, tests/regression.at,
16365 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
16366 now the tests are run in private dirs, therefore AC_CLEANUP and
16367 family can be simplified to 0-ary.
16368 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
16369 use abs. path to find config.h.
16370 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
16371 stderr, there can be way too much random noise.
16372 Instead pass -Werror to GCC and rely on the exit status.
16373 Reported by Wolfram Wagner.
16374
16375 2001-11-14 Akim Demaille <akim@epita.fr>
16376
16377 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
16378 defined only if yyoverflow is defined, to avoid `warning: unused
16379 variable `yyvs1''.
16380 Reported by The Test Suite.
16381
16382 2001-11-14 Akim Demaille <akim@epita.fr>
16383
16384 * src/print.c: Include reduce.h.
16385 Reported by Hans Aberg.
16386
16387 2001-11-14 Akim Demaille <akim@epita.fr>
16388
16389 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
16390 Revert a previous patch: these are really const.
16391 * src/conflicts.c (conflict_report): Additional useless pair of
16392 braces to pacify GCC's warnings for `if () if () {} else {}'.
16393 * src/lex.c (parse_percent_token): Replace equal_offset with
16394 arg_offset.
16395 arg is const.
16396 Be sure to strdup `arg' when used, since there is no reason for
16397 token_buffer not to change.
16398
16399 2001-11-14 Akim Demaille <akim@epita.fr>
16400
16401 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
16402 definition.
16403 * src/main.c (main): Use them.
16404 Suggested by Hans Aberg.
16405
16406 2001-11-12 Akim Demaille <akim@epita.fr>
16407
16408 * src/system.h (ngettext): Now that we use ngettext, be sure to
16409 provide a default definition when NLS are not used.
16410
16411 2001-11-12 Akim Demaille <akim@epita.fr>
16412
16413 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
16414 Use @kbd to denote user input.
16415 (Language and Grammar): ANSIfy the example.
16416 Adjust its layout for info/notinfo.
16417 (Location Tracking Calc): Output error messages to stderr.
16418 Output locations in a more GNUtically correct way.
16419 Fix a couple of Englishos.
16420 Adjust @group/@end group pairs.
16421
16422 2001-11-12 Akim Demaille <akim@epita.fr>
16423
16424 %expect was not functioning at all.
16425
16426 * src/conflicts.c (expected_conflicts): Set to -1.
16427 (conflict_report): Use ngettext.
16428 (conflicts_print): Check %expect and make its violation an error.
16429 * doc/bison.texinfo (Expect Decl): Adjust.
16430 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
16431 * tests/regression.at (%expect not enough, %expect right)
16432 (%expect too much): New.
16433
16434 2001-11-12 Akim Demaille <akim@epita.fr>
16435
16436 * tests/regression.at (Conflicts): Rename as...
16437 (Unresolved SR Conflicts): this.
16438 (Solved SR Conflicts): New.
16439
16440 2001-11-12 Akim Demaille <akim@epita.fr>
16441
16442 * src/reduce.c (print_results): Rename as...
16443 (reduce_output): This.
16444 Output to OUT, passed as argument, instead of output_obstack.
16445 (dump_grammar): Likewise.
16446 (reduce_free): New.
16447 Also free V1.
16448 (reduce_grammar): No longer call reduce_output, since...
16449 * src/print.c (print_results): do it.
16450 * src/main.c (main): Call reduce_free;
16451
16452 2001-11-12 Akim Demaille <akim@epita.fr>
16453
16454 * src/conflicts.c (print_reductions): Accept OUT as argument.
16455 Output to it, not to output_obstack.
16456 * src/print.c (print_actions): Adjust.
16457
16458 2001-11-12 Akim Demaille <akim@epita.fr>
16459
16460 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
16461 the result instead of using...
16462 (src_total, rrc_total, src_count, rrc_count): Remove.
16463 (any_conflicts): Remove.
16464 (print_conflicts): Split into...
16465 (conflicts_print, conflicts_output): New.
16466 * src/conflicts.h: Adjust.
16467 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
16468 * src/print.c (print_grammar): Issue `\n' between two rules.
16469 * tests/regression.at (Conflicts): New.
16470 Reported by Tom Lane.
16471
16472 2001-11-12 Akim Demaille <akim@epita.fr>
16473
16474 * tests/regression.at (Invalid input): Remove, duplicate with
16475 ``Invalid input: 1''.
16476
16477 2001-11-12 Akim Demaille <akim@epita.fr>
16478
16479 * tests/torture.at (AT_DATA_STACK_TORTURE)
16480 (Exploding the Stack Size with Alloca)
16481 (Exploding the Stack Size with Malloc): New.
16482
16483 2001-11-12 Akim Demaille <akim@epita.fr>
16484
16485 * src/bison.simple (YYSTACK_REALLOC): New.
16486 (yyparse) [!yyoverflow]: Use it and free the old stack.
16487 Reported by Per Allansson.
16488
16489 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
16490
16491 * src/bison.simple: Define type yystype instead of YYSTYPE, and
16492 define CPP macro, which substitute YYSTYPE by yystype.
16493 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
16494 with yyltype/YYLTYPE. This allows inclusion of the generated
16495 header within the parser if the compiler, such as GGC, accepts
16496 multiple equivalent #defines.
16497 From Akim.
16498
16499 2001-11-05 Akim Demaille <akim@epita.fr>
16500
16501 * src/reader.c (symbols_output): New, extracted from...
16502 (packsymbols): here.
16503 (reader): Adjust.
16504
16505 2001-11-05 Akim Demaille <akim@epita.fr>
16506
16507 * src/lex.c (parse_percent_token): s/quotearg/quote/.
16508
16509 2001-11-05 Akim Demaille <akim@epita.fr>
16510
16511 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
16512 pattern.
16513
16514 2001-11-05 Akim Demaille <akim@epita.fr>
16515
16516 * src/options.h (struct option_table_struct): set_flags is void*.
16517 * src/options.c (longopts): Support `--output' and `%output'.
16518 (usage): Adjust.
16519 * src/lex.h (tok_setopt): Remove, replaced with...
16520 (tok_intopt, tok_stropt): these new guys.
16521 * src/lex.c (getopt.h): Not needed.
16522 (token_buffer, unlexed_token_buffer): Not const.
16523 (percent_table): Promote `-' over `_' in directive names.
16524 Active `%name-prefix', `file-prefix', and `output'.
16525 (parse_percent_token): Accept possible arguments to directives.
16526 Promote `-' over `_' in directive names.
16527
16528 2001-11-04 Akim Demaille <akim@epita.fr>
16529
16530 * doc/bison.texinfo (Decl Summary): Split the list into
16531 `directives for grammars' and `directives for bison'.
16532 Sort'em.
16533 Add description of `%name-prefix', `file-prefix', and `output'.
16534 Promote `-' over `_' in directive names.
16535 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
16536 Simplify the description of `--name-prefix'.
16537 Promote `-' over `_' in directive names.
16538 Promote `--output' over `--output-file'.
16539 Fix the description of `--defines'.
16540 * tests/output.at: Exercise %file-prefix and %output.
16541
16542 2001-11-02 Akim Demaille <akim@epita.fr>
16543
16544 * doc/refcard.tex: Update.
16545
16546 2001-11-02 Akim Demaille <akim@epita.fr>
16547
16548 * src/symtab.h (SUNDEF): New.
16549 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
16550 stand for `uninitialized', instead of 0.
16551 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
16552 * src/lex.c (lex): Adjust.
16553
16554 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
16555 Number it 0.
16556 Let yylex return it instead of a plain 0.
16557 Reported by Dick Streefland.
16558
16559 2001-11-02 Akim Demaille <akim@epita.fr>
16560
16561 * tests/regression.at (Mixing %token styles): New test.
16562
16563 2001-11-02 Akim Demaille <akim@epita.fr>
16564
16565 * src/reader.c (parse_thong_decl): Formatting changes.
16566 (token_translations_init): New, extracted from...
16567 (packsymbols): Here.
16568 Adjust.
16569
16570 2001-11-01 Akim Demaille <akim@epita.fr>
16571
16572 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
16573 Check that `9foo.y' produces correct cpp guards.
16574 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
16575 guards.
16576 Reported by Wwp.
16577
16578 2001-11-01 Akim Demaille <akim@epita.fr>
16579
16580 * tests/regression.at (Invalid input: 2): New.
16581 * src/lex.c (unlexed_token_buffer): New.
16582 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
16583 too.
16584 Reported by Wwp.
16585
16586 2001-11-01 Akim Demaille <akim@epita.fr>
16587
16588 * tests/calc.at: Catch up with 1.30.
16589 * configure.in: Bump to 1.49a.
16590 Adjust to newer Autotest.
16591
16592 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
16593
16594 * src/conflicts.c: Move global variables rrc_total and src_total ...
16595 (print_conflicts): here.
16596 * src/output.c (output): Free global variable user_toknums.
16597 * src/lex.c (token_obstack): Become static.
16598
16599 2001-10-18 Akim Demaille <akim@epita.fr>
16600
16601 * tests/atlocal.in (GCC): Add.
16602 * tests/calc.at: s/m4_match/m4_bmatch/.
16603 s/m4_patsubst/m4_bpatsubst/.
16604 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
16605 * configure.in: AC_SUBST(GCC).
16606
16607 2001-10-14 Marc Autret <autret_m@epita.fr>
16608
16609 * src/options.c (create_long_option_table): Fix.
16610
16611 2001-10-10 Akim Demaille <akim@epita.fr>
16612
16613 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
16614
16615 2001-10-04 Akim Demaille <akim@epita.fr>
16616
16617 * src/reader.c (parse_union_decl): Push the caracters in
16618 union_obstack, not attrs_obstack.
16619
16620 2001-10-04 Akim Demaille <akim@epita.fr>
16621
16622 Merge in the branch 1.29.
16623
16624 * src/reader.c (packsymbols): Use a temporary obstack for
16625 `%%tokendef', since output_stack is already used elsewhere.
16626
16627 2001-10-02 Akim Demaille <akim@epita.fr>
16628
16629 Bump 1.29d.
16630
16631 2001-10-02 Akim Demaille <akim@epita.fr>
16632
16633 Version 1.29c.
16634
16635 2001-10-02 Akim Demaille <akim@epita.fr>
16636
16637 * tests/regression.at (Invalid CPP headers): New.
16638 From Alexander Belopolsky.
16639 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
16640
16641 2001-10-02 Akim Demaille <akim@epita.fr>
16642
16643 * tests/regression.at (Invalid input): New.
16644 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
16645 Reported by Shura.
16646
16647 2001-10-02 Akim Demaille <akim@epita.fr>
16648
16649 * tests/calc.at: Now that --debug works, the tests must be adjusted.
16650
16651 2001-10-02 Akim Demaille <akim@epita.fr>
16652
16653 * src/output.c (output_parser): Assert `skeleton'.
16654 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
16655 systems.
16656 From Shura.
16657
16658 2001-10-01 Marc Autret <autret_m@epita.fr>
16659
16660 * src/lex.h: Echo modifications.
16661 * src/lex.c (unlex): Parameter is now token_t.
16662 From Hans Aberg.
16663
16664 2001-10-01 Marc Autret <autret_m@epita.fr>
16665
16666 * src/main.c: Include lex.h.
16667 From Hans Aberg.
16668
16669 2001-09-29 Akim Demaille <akim@epita.fr>
16670
16671 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
16672
16673 2001-09-28 Akim Demaille <akim@epita.fr>
16674
16675 * tests/testsuite.at: Update to newer Autotest.
16676 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
16677
16678 2001-09-27 Akim Demaille <akim@epita.fr>
16679
16680 Position independent wrapper.
16681
16682 * tests/bison: Remove.
16683 * tests/bison.in: New.
16684 * configure.in: Adjust.
16685
16686 2001-09-27 Paul Eggert <eggert@twinsun.com>
16687
16688 Port quotearg fixes from tar 1.13.24.
16689
16690 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
16691 tm to be declared.
16692 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
16693 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
16694
16695 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
16696 * m4/mbrtowc.m4: New file.
16697 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
16698 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
16699
16700 2001-09-27 Akim Demaille <akim@epita.fr>
16701
16702 Bump to 1.29c.
16703
16704 2001-09-27 Akim Demaille <akim@epita.fr>
16705
16706 Version 1.29b.
16707
16708 2001-09-25 Akim Demaille <akim@epita.fr>
16709
16710 * src/system.h: Include `xalloc.h'.
16711 Remove it from the C files.
16712 * src/files.c (output_files): Free the obstacks.
16713 * src/lex.c (init_lex): Rename as...
16714 (lex_init): this.
16715 (lex_free): New.
16716 * src/main.c (main): Use it.
16717
16718 2001-09-24 Marc Autret <autret_m@epita.fr>
16719
16720 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
16721 to output informations in fout (FILE*).
16722 (open_graph, close_graph): Likewise.
16723 (output_graph, output_edge, output_node): Likewise.
16724 * src/vcg.h: Update function prototypes.
16725 * src/print_graph.c (print_graph): Open output graph file.
16726 (print_actions): Adjust.
16727 * src/files.h: Remove extern declaration.
16728 * src/files.c: Remove graph_obstack declaration.
16729 (open_files): Remove graph_obstack initialization.
16730 (output_files): Remove graph_obstack saving.
16731
16732 2001-09-24 Marc Autret <autret_m@epita.fr>
16733
16734 * src/files.c (compute_output_file_names): Fix.
16735
16736 2001-09-24 Marc Autret <autret_m@epita.fr>,
16737 Akim Demaille <akim@epita.fr>
16738
16739 * src/reader.c (reader): Remove call to free_symtab ().
16740 * src/main.c (main): Call it here.
16741 Include symtab.h.
16742 * src/conflicts.c (initialize_conflicts): Rename as...
16743 (solve_conflicts): this.
16744 * src/print.c (print_core, print_actions, print_state)
16745 (print_grammar): Dump to a file instead a `output_obstack'.
16746 (print_results): Dump `output_obstack', and then proceed with the
16747 FILE *.
16748 * src/files.c (compute_output_file_names, close_files): New.
16749 (output_files): Adjust.
16750 * src/main.c (main): Adjust.
16751
16752 2001-09-23 Marc Autret <autret_m@epita.fr>
16753
16754 * src/files.c (compute_header_macro): Computes header macro name
16755 from spec_defines_file when given.
16756
16757 2001-09-23 Marc Autret <autret_m@epita.fr>
16758
16759 * src/files.c (output_files): Add default extensions.
16760
16761 2001-09-22 Akim Demaille <akim@epita.fr>
16762
16763 * src/conflicts.c (finalize_conflicts): Rename as...
16764 (free_conflicts): this.
16765
16766 2001-09-22 Akim Demaille <akim@epita.fr>
16767
16768 * src/gram.c (gram_free): Rename back as...
16769 (dummy): this.
16770 (output_token_translations): Free `token_translations'.
16771 * src/symtab.c (free_symtab): Free the tag field.
16772
16773 2001-09-22 Akim Demaille <akim@epita.fr>
16774
16775 Remove `translations' as it is always set to true.
16776
16777 * src/gram.h: Adjust.
16778 * src/reader.c (packsymbols, parse_token_decl): Adjust
16779 * src/print.c (print_grammar): Adjust.
16780 * src/output.c (output_token_translations): Adjust.
16781 * src/lex.c (lex): Adjust.
16782 * src/gram.c: Be sure the set pointers to NULL.
16783 (dummy): Rename as...
16784 (gram_free): this.
16785
16786 2001-09-22 Akim Demaille <akim@epita.fr>
16787
16788 * configure.in: Invoke AM_LIB_DMALLOC.
16789 * src/system.h: Use dmalloc.
16790 * src/LR0.c: Be sure to have pointers initialized to NULL.
16791 (allocate_itemsets): Allocate kernel_items only if needed.
16792
16793 2001-09-22 Akim Demaille <akim@epita.fr>
16794
16795 * configure.in: Bump to 1.29b.
16796 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
16797 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
16798 need xmalloc.c in calc.y.
16799 From Pascal Bart.
16800
16801 2001-09-21 Akim Demaille <akim@epita.fr>
16802
16803 Version 1.29a.
16804 * Makefile.maint, config/config.guess, config/config.sub,
16805 * config/missing: Update from masters.
16806 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
16807 upon package.m4.
16808 * configure.in (ALL_LINGUAS): Add `tr'.
16809
16810 2001-09-21 Akim Demaille <akim@epita.fr>
16811
16812 * tests/Makefile.am (package.m4): Move to...
16813 ($(srcdir)/$(TESTSUITE)): here.
16814
16815 2001-09-20 Akim Demaille <akim@epita.fr>
16816
16817 * src/complain.c: No longer try to be standalone: use system.h.
16818 Don't assume __STDC__ is defined to 1. Just test if it is defined.
16819 * src/complain.h: Likewise.
16820 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
16821 Remove the unused variable `n'.
16822 From Albert Chin-A-Young.
16823
16824 2001-09-18 Marc Autret <autret_m@epita.fr>
16825
16826 * doc/bison.1: Update.
16827 * doc/bison.texinfo (Bison Options): Update --defines and --graph
16828 descriptions.
16829 (Option Cross Key): Update.
16830 Add --graph.
16831
16832 2001-09-18 Marc Autret <autret_m@epita.fr>
16833
16834 * tests/regression.at: New test (comment in %union).
16835
16836 2001-09-18 Marc Autret <autret_m@epita.fr>
16837
16838 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
16839 do that.
16840 Reported by Keith Browne.
16841
16842 2001-09-18 Marc Autret <autret_m@epita.fr>
16843
16844 * tests/output.at: Add tests for --defines and --graph.
16845
16846 2001-09-18 Marc Autret <autret_m@epita.fr>
16847
16848 * tests/output.at: Removes tests of %{header,src}_extension features.
16849
16850 2001-09-18 Akim Demaille <akim@epita.fr>
16851
16852 * tests/Makefile.am (package.m4): New.
16853 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
16854 (_AT_CHECK_CALC_ERROR): Likewise.
16855 Factor the `, ' part of verbose error messages.
16856
16857 2001-09-18 Marc Autret <autret_m@epita.fr>
16858
16859 * src/getargs.c (longopts): Declare --defines and --graph as options
16860 with optional arguments.
16861 * src/files.h: Add extern declarations.
16862 * src/files.c (spec_graph_file, spec_defines_file): New.
16863 (output_files): Update.
16864 Remove CPP-outed code.
16865
16866 2001-09-18 Marc Autret <autret_m@epita.fr>
16867
16868 Turn off %{source,header}_extension feature.
16869
16870 * src/files.c (compute_exts_from_gf): Update.
16871 (compute_exts_from_src): Update.
16872 (output_files): CPP-out useless code.
16873 * src/files.h: Remove {header,source}_extension extern declarations.
16874 * src/reader.c (parse_dquoted_param): CPP-out.
16875 (parse_header_extension_decl): Remove.
16876 (parse_source_extension_decl): Remove.
16877 (read_declarations): Remove cases tok_{hdrext,srcext}.
16878 * src/lex.c (percent_table): Remove {header,source}_extension entries.
16879 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
16880
16881 2001-09-10 Akim Demaille <akim@epita.fr>
16882
16883 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
16884 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
16885 (AT_CHECK_OUTPUT): this.
16886 Merely check ls' exit status, its output is useless.
16887
16888 2001-09-10 Akim Demaille <akim@epita.fr>
16889
16890 * tests/calc.at: Use m4_match.
16891 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
16892
16893 2001-09-10 Marc Autret <autret_m@epita.fr>,
16894 Akim Demaille <akim@epita.fr>
16895
16896 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
16897 enum color_e.
16898 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
16899 to `normal'.
16900 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
16901 * src/lex.h: Adjust prototype.
16902 (token_t): Add `tok_undef'.
16903 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
16904 (parse_percent_token): Now returns token_t.
16905 Add default statement in switch.
16906 (lex): Separate `c' as an input variable, from the token_t result
16907 part.
16908 (unlexed): Is a token_t.
16909
16910 2001-09-10 Akim Demaille <akim@epita.fr>
16911
16912 * configure.in: Bump to 1.29a.
16913
16914 2001-09-07 Akim Demaille <akim@epita.fr>
16915
16916 Version 1.29.
16917
16918 2001-08-30 Akim Demaille <akim@epita.fr>
16919
16920 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
16921 * m4/atconfig.m4: Remove.
16922 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
16923 * tests/bison: New.
16924 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
16925 m4_if, m4_patsubst, and m4_regexp.
16926 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
16927 `input' file instead of echo.
16928
16929 2001-08-29 Akim Demaille <akim@epita.fr>
16930
16931 Bump to 1.28e.
16932
16933 2001-08-29 Akim Demaille <akim@epita.fr>
16934
16935 Version 1.28d.
16936
16937 2001-08-29 Paul Eggert <eggert@twinsun.com>
16938
16939 * src/bison.simple (yyparse): Don't take the address of an
16940 item before the start of an array, as that doesn't conform to
16941 the C Standard.
16942
16943 2001-08-29 Robert Anisko <anisko_r@epita.fr>
16944
16945 * doc/bison.texinfo (Location Tracking Calc): New node.
16946
16947 2001-08-29 Paul Eggert <eggert@twinsun.com>
16948
16949 * src/output.c (output): Do not define const, as this now
16950 causes more problems than it cures.
16951
16952 2001-08-29 Akim Demaille <akim@epita.fr>
16953
16954 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
16955 the nodes.
16956 Be sure to tag the `detailmenu'.
16957
16958 2001-08-29 Akim Demaille <akim@epita.fr>
16959
16960 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
16961 download in a tmp dir.
16962
16963 2001-08-28 Marc Autret <autret_m@epita.fr>
16964
16965 * config/depcomp: New file.
16966
16967 2001-08-28 Marc Autret <autret_m@epita.fr>
16968
16969 * doc/bison.1 (mandoc): Adjust.
16970 From Juan Manuel Guerrero.
16971
16972 2001-08-28 Marc Autret <autret_m@epita.fr>
16973
16974 * src/print_graph.c (print_state): Fix.
16975
16976 2001-08-27 Marc Autret <autret_m@epita.fr>
16977
16978 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
16979 char * members.
16980 Echo modifications to the functions prototypes.
16981 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
16982
16983 2001-08-27 Marc Autret <autret_m@epita.fr>
16984
16985 * src/vcg.c: Include `xalloc.h'.
16986 (add_colorentry): New.
16987 (add_classname): New.
16988 (add_infoname): New.
16989 * src/vcg.h: Add new prototypes.
16990
16991 2001-08-27 Akim Demaille <akim@epita.fr>
16992
16993 * Makefile.maint: Sync. again with CVS Autoconf.
16994
16995 2001-08-27 Akim Demaille <akim@epita.fr>
16996
16997 * Makefile.maint: Formatting changes.
16998 (po-update, cvs-update, update): New targets.
16999 (AMTAR): Remove.
17000
17001 2001-08-27 Akim Demaille <akim@epita.fr>
17002
17003 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17004 * Makefile.maint: Sync. with CVS Autoconf.
17005
17006 2001-08-27 Marc Autret <autret_m@epita.fr>
17007
17008 * src/vcg.h (struct infoname_s): New.
17009 (struct colorentry_s): New.
17010 (graph_s): New fields {vertical,horizontal}_order in structure.
17011 Add `infoname' field.
17012 Add `colorentry' field;
17013 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17014 (G_HORIZONTAL_ORDER): New.
17015 (G_INFONAME): New.
17016 (G_COLORENTRY): New.
17017 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17018 Add output of `infoname'.
17019 Add output of `colorentry'.
17020
17021 2001-08-27 Marc Autret <autret_m@epita.fr>
17022
17023 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17024 This one shadowed a global parameter.
17025
17026 2001-08-24 Marc Autret <autret_m@epita.fr>
17027
17028 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17029 instead of `unsigned'.
17030 (print_state): Do not call obstack_object_size () in obstack_grow ()
17031 to avoid macro variables shadowing.
17032
17033 2001-08-23 Marc Autret <autret_m@epita.fr>
17034
17035 * src/lex.c (percent_table): Typo: s/naem/name/.
17036 Add graph option.
17037 Normalize new options declarations.
17038
17039 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17040
17041 * tests/suite.at: Exercise %header_extension and %source_extension.
17042
17043 2001-08-16 Marc Autret <autret_m@epita.fr>
17044
17045 * src/reader.c (parse_dquoted_param): New.
17046 (parse_header_extension_decl): Use it.
17047 (parse_source_extension_decl): Likewise.
17048
17049 2001-08-16 Marc Autret <autret_m@epita.fr>
17050
17051 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17052 (get_xxxx_str): Use assert () instead of complain ().
17053 Remove return invokations in default cases.
17054 (get_decision_str): Modify default behaviour. Remove second argument.
17055 Echo modifications on calls.
17056 (output_graph): Fix.
17057
17058 2001-08-16 Marc Autret <autret_m@epita.fr>
17059
17060 * src/getargs.c (usage): Update with ``-g, --graph''.
17061
17062 2001-08-16 Marc Autret <autret_m@epita.fr>
17063
17064 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17065 (Option Cross Key): Likewise.
17066 * doc/bison.1: Update.
17067
17068 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
17069
17070 * src/output.c (output_master_parser): Don't finish action_obstack.
17071 (output_parser): Don't care about the muscle action, here.
17072 (prepare): Copy the action_obstack in the action muscle.
17073 (output): Free action_obstack.
17074
17075 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
17076
17077 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17078 will contain `%union' declaration.
17079 (parse_union_decl): Delete #line directive output.
17080 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17081 informations about %union.
17082 (parse_union_decl): Copy the union_obstack in the muscle stype.
17083 * src/bison.simple: Add new #line directive.
17084 Add typdef %%stype YYSTYPE.
17085
17086 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
17087
17088 * src/bison.simple: Add new `#line' directive.
17089
17090 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
17091
17092 * src/bison.simple: New `#line' directive.
17093 * src/output.c (output_parser): Support new dynamic muscle input_line.
17094
17095 2001-09-22 Marc Autret <autret_m@epita.fr>
17096
17097 * src/output.c (output_master_parser): New.
17098 (output_parser): Be more re-entrant.
17099
17100 2001-09-21 Marc Autret <autret_m@epita.fr>
17101
17102 * src/reader.c (copy_definition, parse_union_decl): Update and use
17103 `linef' muscle.
17104 (copy_action): Likewise.
17105 Use obstack_1grow ().
17106 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17107
17108 2001-09-21 Marc Autret <autret_m@epita.fr>
17109
17110 * src/options.c (option_table): Adjust.
17111 * src/lex.c (parse_percent_token): Fix.
17112
17113 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
17114
17115 * src/options.c (symtab.h): Include it, need by lex.h.
17116
17117 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
17118
17119 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17120 is now an option_table_struct*.
17121 (option_strcmp): New function option_strcmp.
17122 (parse_percent_token): Call option_strcmp.
17123 * src/getargs.c (xalloc.h, options.h): Include it.
17124 (getargs): Call create_long_option_table.
17125 (getargs): Free longopts at the end of the function.
17126 (shortopts): Move in options.c.
17127 * src/options.c (create_long_option_table): New function. Convert
17128 information from option_table to option structure.
17129 * src/reader.c (options.h): Include it.
17130
17131 * src/Makefile.am: Adjust.
17132 * src/options.c (option_table): Create from longopts and percent_table.
17133 * src/getargs.c (longopts): Delete.
17134 * src/lex.c (struct percent_table_struct): Delete.
17135 (percent_table): Delete.
17136 (options.h): Include it.
17137 * src/options.c: Create.
17138 * src/options.h: Create.
17139 Declare enum opt_access_e.
17140 Define struct option_table_struct.
17141
17142 2001-09-20 Marc Autret <autret_m@epita.fr>
17143
17144 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17145 sections of Bison.
17146
17147 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
17148
17149 * src/bison.simple: s/%%filename/%%skeleton.
17150 * src/muscle_tab.c (getargs.h): Include it.
17151 (muscle_init): Insert new muscle skeleton.
17152
17153 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
17154
17155 * src/output.c (output_parser): Delete unused variable actions_dumped.
17156
17157 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
17158
17159 * src/output.c (output): Delete call to reader_output_yylsp.
17160 * src/reader.c (reader): Likewise.
17161 * src/reader.h: Delete declaration of reader_output_yylsp.
17162
17163 2001-09-02 Marc Autret <autret_m@epita.fr>
17164
17165 * src/reader.c: Include muscle_tab.h.
17166 (parse_union_decl): Update.
17167 (parse_macro_decl): Rename parse_muscle_decl.
17168 Update to use renamed functions and variable.
17169 (read_declarations, copy_action, read_additionnal_code, : Updated
17170 with correct variables and functions names.
17171 (packsymbols, reader): Likewise.
17172
17173 * src/reader.h (muscle_obstack): Extern declaration update.
17174
17175 * src/output.c: Include muscle_tab.h
17176 In all functions using macro_insert, change by using muscle_insert ().
17177 (macro_obstack): Rename muscle_obstack.
17178 Echo modifications in the whole file.
17179 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17180 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17181 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17182
17183 * src/muscle_tab.h: Update double inclusion macros.
17184 (macro_entry_s): Rename muscle_entry_s.
17185 Update prototypes.
17186
17187 * src/muscle_tab.c: Include muscle_tab.h.
17188 Rename macro_tabble to muscle_table.
17189 (mhash1, mhash2, mcmp): Use muscle_entry.
17190 (macro_init): Rename muscle_init. Update.
17191 (macro_insert): Rename muscle_insert. Update.
17192 (macro_find): Rename muscle_find. Update.
17193
17194 * src/main.c: Include muscle_tab.h.
17195 (main): Call muscle_init ().
17196 * src/Makefile.am (bison_SOURCES): Echo modifications.
17197
17198 2001-09-02 Marc Autret <autret_m@epita.fr>
17199
17200 Now the files macro_tab.[ch] are named muscle_tab.[ch].
17201
17202 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17203
17204 2001-09-02 Marc Autret <autret_m@epita.fr>
17205
17206 * src/macrotab.c, src/macrotab.h: Remove.
17207
17208 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
17209
17210 * src/reader.c (copy_guard): Use muscle to specify the `#line'
17211 filename.
17212
17213 2001-09-01 Marc Autret <autret_m@epita.fr>
17214
17215 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17216 to an explicit value to activate the feature. We do it here.
17217
17218 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17219
17220 * src/output.c (prepare): Delete the `filename' muscule insertion.
17221 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17222 (parse_union_decl): Likewise.
17223 * src/macrotab.c (macro_init): Initialize filename by infile.
17224
17225 2001-08-31 Marc Autret <autret_m@epita.fr>
17226
17227 * src/bison.simple (YYLSP_NEEDED): New definition.
17228 * src/output.c (prepare): Add macro insertion of `locations_flag'
17229
17230 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17231
17232 * src/output.c (prepare): Delete insertion of previous muscles,
17233 and insert the `prefix' muscles.
17234 * src/macrotab.c (macro_init): Likewise.
17235 (macro_init): Initialization prefix directive by `yy'.
17236 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17237 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17238 yylval, yydebug, yyerror, yynerrs and yyparse.
17239 New directive `#define' to substitute yydebug, ... with option
17240 name_prefix.
17241
17242 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17243
17244 * src/main.c (main): Standardize.
17245 * src/output.c (output_table_data, output_parser): Likewise.
17246 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17247
17248 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17249
17250 * src/reader.c (read_additionnal_code): Rename %%user_code to
17251 %%epilogue.
17252 * src/output.c (output): Rename %%declarations to %%prologue.
17253 * src/bison.simple: Echo modifications.
17254
17255 2001-08-31 Marc Autret <autret_m@epita.fr>
17256
17257 * src/reader.c (readgram): CleanUp.
17258 (output_token_defines): Likewise.
17259 (packsymbols): Likewise.
17260 (reader): Likewise.
17261 * src/output.c (output): CPP-out useless code.
17262
17263 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17264
17265 * src/reader.c (reader): Delete obsolete call to function
17266 output_trailers and output_headers.
17267 * src/output.h: Remove obsolete functions prototypes of output_headers
17268 and output_trailers.
17269
17270 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
17271
17272 * src/main.c: Include macrotab.h.
17273 * src/macrotab.h (macro_entry_s): Constify fields.
17274 Adjust functions prototypes.
17275 * src/macrotab.c (macro_insert): Constify key and value.
17276 (macro_find): Constify key.
17277 (macro_insert): Include 'xalloc.h'
17278 (macro_insert): Use XMALLOC.
17279 (macro_find): Constify return value.
17280 * src/output.c (output_table_data): Rename table to table_data.
17281 (output_parser): Constify macro_key, macro_value.
17282
17283 2001-08-30 Marc Autret <autret_m@epita.fr>
17284
17285 * src/reader.c (parse_skel_decl): New.
17286 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
17287 * src/lex.h (token_t): New token `tok_skel'.
17288 * src/lex.c (percent_table): Add skeleton option entry.
17289 Standardize.
17290
17291 2001-08-29 Marc Autret <autret_m@epita.fr>
17292
17293 * src/bison.simple: Add %%user_code directive at the end.
17294 * src/reader.c (read_additionnal_code): New.
17295 (reader): Use it.
17296 * src/output.c (output_program): Remove.
17297 (output): Update.
17298
17299 2001-08-28 Marc Autret <autret_m@epita.fr>
17300
17301 * src/output.c (output_actions): Clean up.
17302 (output_gram): CPP-out useless code.
17303 * src/reader.c (reader): Clean up, CPP-out useless code.
17304
17305 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
17306
17307 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
17308 directive.
17309 * src/bison.simple: Add `%%definitions'.
17310
17311 2001-08-28 Marc Autret <autret_m@epita.fr>
17312
17313 * config/depcomp: New file.
17314
17315 2001-08-27 Paul Eggert <eggert@twinsun.com>
17316
17317 * src/bison.simple (yyparse): Don't take the address of an
17318 item before the start of an array, as that doesn't conform to
17319 the C Standard.
17320
17321 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
17322
17323 * src/output.c (output): Remove the initialization of the macro
17324 obstack. It was done too late here.
17325
17326 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
17327 completely wrong.
17328 (reader): Initialize the macro obstack here, since we need it to grow
17329 '%define' directives.
17330
17331 * src/reader.h: Declare the macro obstack as extern.
17332
17333 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
17334
17335 * src/output.c (output_parser): Fix. Store single '%' characters in
17336 the output obstack instead of throwing them away.
17337
17338 2001-08-27 Akim Demaille <akim@epita.fr>
17339
17340 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17341
17342 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17343
17344 * lib/Makefile.am: Adjust.
17345
17346 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17347
17348 * src/bison.simple: Update and add '%%' directives.
17349
17350 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17351
17352 * src/reader.c (reader): Remove calls to 'output_headers' and
17353 'output_trailers'. Remove some C output.
17354 (readgram): Disable a piece of code that was writing a default
17355 definition for 'YYSTYPE'.
17356 (reader_output_yylsp): Remove.
17357 (packsymbols): Output token defintions to a macro.
17358 (copy_definition): Disable C output.
17359
17360 * src/reader.c (parse_macro_decl): New function used to parse macro
17361 declarations.
17362 (copy_string2): Put the body of copy_string into this new function.
17363 Add a parameter to let the caller choose whether he wants to copy the
17364 string delimiters or not.
17365 (copy_string): Be a simple call to copy_string2 with the last argument
17366 bound to true.
17367 (read_declarations): Add case for macro definition.
17368 (copy_identifier): New.
17369 (parse_macro_decl): Read macro identifiers using copy_identifier
17370 rather than lex.
17371
17372 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17373
17374 * src/output.c (prepare): Add prefixed names.
17375 (output_parser): Output semantic actions.
17376 (output_parser): Fix bug on '%%line' directives.
17377
17378 * src/output.c (output_headers): Remove. The C code printed by this
17379 function should now be in the skeletons.
17380 (output_trailers): Remove.
17381 (output): Disable call to 'reader_output_yylsp'.
17382 (output_rule_data): Do not output tables to the table obstack.
17383
17384 * src/output.c: Remove some C dedicated output.
17385 Improve the use of macro and output obstacks.
17386 (output_defines): Remove.
17387
17388 * src/output.c (output_token_translations): Associate 'translate'
17389 table with a macro. No output to the table obstack.
17390 (output_gram): Same for 'rhs' and 'prhs'.
17391 (output_stos): Same for 'stos'.
17392 (output_rule_data): Same for 'r1' and 'r2'.
17393 (token_actions): Same for 'defact'.
17394 (goto_actions): Same for 'defgoto'.
17395 (output_base): Same for 'pact' and 'pgoto'.
17396 (output_table): Same for 'table'.
17397 (output_check): Same for 'check'.
17398
17399 * src/output.c (output_table_data): New function.
17400 (output_short_table): Remove.
17401 (output_short_or_char_table): Remove.
17402
17403 * src/output.c (output_parser): Replace most of the skeleton copy code
17404 with something new. Skeletons are now processed character by character
17405 rather than line by line, and Bison looks for '%%' macros. This is the
17406 first step in making Bison's output process (a lot) more flexible.
17407 (output_parser): Use the macro table.
17408
17409 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17410
17411 * src/main.c (main): Initialize the macro table.
17412
17413 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17414
17415 * src/lex.c (percent_table): Add tok_define.
17416 * src/lex.h: Add tok_define.
17417
17418 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17419
17420 * src/macrotab.c: New file.
17421 * src/macrotab.h: New file.
17422 * src/Makefile.am: Update.
17423
17424 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17425
17426 * lib/hash.c: New file.
17427 * lib/hash.h: New file.
17428 * lib/Makefile.am: Update.
17429
17430 2001-08-15 Akim Demaille <akim@epita.fr>
17431
17432 Version 1.28c.
17433
17434 2001-08-15 Marc Autret <autret_m@epita.fr>
17435
17436 * src/reader.c (readgram): Indent output macro YYSTYPE.
17437 (packsymbols): Likewise.
17438 (output_token_defines): Likewise.
17439 * src/files.c: Standardize.
17440 (compute_header_macro): New.
17441 (defines_obstack_save): New. Use compute_header_macro.
17442 (output_files): Update. Use defines_obstack_save.
17443
17444 2001-08-15 Akim Demaille <akim@epita.fr>
17445
17446 * doc/bison.texinfo (Table of Symbols): Document
17447 YYSTACK_USE_ALLOCA.
17448
17449 2001-08-15 Akim Demaille <akim@epita.fr>
17450
17451 * missing: Update from CVS Automake.
17452 * config/config.guess, config/config.sub, config/texinfo.tex:
17453 Update from gnu.org.
17454
17455 2001-08-15 Akim Demaille <akim@epita.fr>
17456
17457 * Makefile.maint: Sync with CVS Autoconf.
17458
17459 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
17460
17461 * doc/bison.texinfo: Include GNU Free Documentation License from
17462 `fdl.texi'.
17463 * doc/fdl.texi: Add to package.
17464
17465 2001-08-14 Marc Autret <autret_m@epita.fr>
17466
17467 Turn on %{source,header}_extension features.
17468
17469 * src/lex.c (percent_table): Un-CPP out header_extension and
17470 source_extension.
17471 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
17472 (compute_exts_from_src): Remove conditions. It restores priorities
17473 between options.
17474
17475 2001-08-14 Marc Autret <autret_m@epita.fr>
17476
17477 * src/files.c (compute_base_names): Add extensions computing when
17478 `--file-prefix' used.
17479 Standardize function calls.
17480
17481 2001-08-13 Marc Autret <autret_m@epita.fr>
17482
17483 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
17484 defining it (defined but null disables alloca).
17485
17486 2001-08-13 Marc Autret <autret_m@epita.fr>
17487
17488 * src/bison.simple (_yy_memcpy): CPP reformat.
17489
17490 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
17491
17492 * tests/atconfig.in (CPPFLAGS): Fix.
17493
17494 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
17495
17496 * doc/bison.texinfo: Include GNU General Public License from
17497 `gpl.texi'.
17498 * doc/gpl.texi: Add to package.
17499
17500 2001-08-10 Marc Autret <autret_m@epita.fr>
17501
17502 * src/print_graph.h: Fix.
17503 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
17504
17505 2001-08-10 Akim Demaille <akim@epita.fr>
17506
17507 * src/system.h: Provide default declarations for stpcpy, strndup,
17508 and strnlen.
17509
17510 2001-08-10 Robert Anisko <anisko_r@epita.fr>
17511
17512 * doc/bison.texinfo (Locations): Update @$ stuff.
17513
17514 2001-08-09 Robert Anisko <anisko_r@epita.fr>
17515
17516 * src/bison.simple (YYLLOC_DEFAULT): Update.
17517 (yyparse): Adjust.
17518
17519 2001-08-08 Marc Autret <autret_m@epita.fr>
17520
17521 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
17522 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
17523 Reported by Fabrice Bauzac.
17524
17525 2001-08-08 Marc Autret <autret_m@epita.fr>
17526
17527 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
17528 * src/vcg.c (output_node): Fix.
17529 * src/vcg.h: Cleanup.
17530 * src/print_graph.c: Add comments.
17531 (node_output_size): New global variable. Simplify the formatting of
17532 the VCG graph output.
17533 (print_actions): Unused code is now used. It notifies the final state
17534 and no action states in the VCG graph. It also give the reduce actions.
17535 The `shift and goto' edges are red and the `go to state' edges are
17536 blue.
17537 Get the current node name and node_obstack by argument.
17538 (node_obstack): New variable.
17539 (print_state): Manage node_obstack.
17540 (print_core): Use node_obstack given by argument.
17541 A node is not only computed here but in print_actions also.
17542 (print_graph): CPP out useless code instead of commenting it.
17543
17544 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
17545
17546 * tests/atconfig.in (CPPFLAGS): Fix.
17547
17548 2001-08-07 Akim Demaille <akim@epita.fr>
17549
17550 * src/print_graph.c (quote): New.
17551 (print_core): Use it.
17552
17553 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
17554
17555 * src/vcg.c (complain.h): Include it.
17556 Unepitaize `return' invocations.
17557 [NDEBUG] (main): Remove.
17558 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
17559 * src/files.c (open_files): Initialize graph_obstack.
17560 * src/print_graph.c (print_actions): CPP out useless code.
17561 (print_core): Don't output the last `\n' in labels.
17562 Use `quote'.
17563 * src/files.c (output_files): Output the VCG file.
17564 * src/main.c (main): Invoke print_graph ();
17565
17566 2001-08-06 Marc Autret <autret_m@epita.fr>
17567
17568 Automaton VCG graph output.
17569 Using option ``-g'' or long option ``--graph'', you can generate
17570 a gram_filename.vcg file containing a VCG description of the LALR (1)
17571 automaton of your grammar.
17572
17573 * src/main.c: Call to print_graph() function.
17574 * src/getargs.h: Update.
17575 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
17576 (graph_flag): New flag.
17577 (longopts): Update.
17578 (getargs): Add case `g'.
17579 * src/files.c (graph_obstack): New obstack struct.
17580 (open_files): Initialize new obstack.
17581 (output_files): Saves graph_obstack if required.
17582 * src/files.h (graph_obstack): New extern declaration.
17583 * src/Makefile.am: Add new source files.
17584
17585 2001-08-06 Marc Autret <autret_m@epita.fr>
17586
17587 * src/print_graph.c, src/print_graph.h (graph): New.
17588 * src/vcg.h: New file.
17589 * src/vcg.c: New file, VCG graph handling.
17590
17591 2001-08-06 Marc Autret <autret_m@epita.fr>
17592
17593 Add of %source_extension and %header_extension which specify
17594 the source or/and the header output file extension.
17595
17596 * src/files.c (compute_base_names): Remove initialisation of
17597 src_extension and header_extension.
17598 (compute_exts_from_gf): Update.
17599 (compute_exts_from_src): Update.
17600 (output_files): Update.
17601 * src/reader.c (parse_header_extension_decl): New.
17602 (parse_source_extension_decl): New.
17603 (read_declarations): New case statements for the new tokens.
17604 * src/lex.c (percent_table): Add entries for %source_extension
17605 and %header_extension.
17606 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
17607
17608 2001-08-06 Marc Autret <autret_m@epita.fr>
17609
17610 * configure.in: Bump to 1.28c.
17611 * doc/bison.texinfo: Texinfo thingies.
17612
17613 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
17614
17615 * tests/atconfig.in (CPPFLAGS): Add.
17616 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
17617
17618 2001-08-03 Akim Demaille <akim@epita.fr>
17619
17620 Version 1.28b.
17621
17622 2001-08-03 Akim Demaille <akim@epita.fr>
17623
17624 * tests/Makefile.am (check-local): Ship testsuite.
17625 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
17626 Include `string.h'.
17627
17628 2001-08-03 Akim Demaille <akim@epita.fr>
17629
17630 * configure.in: Try using -Wformat when compiling.
17631
17632 2001-08-03 Akim Demaille <akim@epita.fr>
17633
17634 * configure.in: Bump to 1.28b.
17635
17636 2001-08-03 Akim Demaille <akim@epita.fr>
17637
17638 * src/complain.c: Adjust strerror_r portability issues.
17639
17640 2001-08-03 Akim Demaille <akim@epita.fr>
17641
17642 Version 1.28a.
17643
17644 2001-08-03 Akim Demaille <akim@epita.fr>
17645
17646 * src/getargs.c, src/getarg.h (skeleton)): Constify.
17647 * src/lex.c (literalchar): Avoid name clashes on `buf'.
17648 * src/getargs.c: Include complain.h.
17649 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
17650 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
17651
17652 2001-08-03 Akim Demaille <akim@epita.fr>
17653
17654 * src/reader.c (readgram): Display hidden chars in error messages.
17655
17656 2001-08-03 Akim Demaille <akim@epita.fr>
17657
17658 Update to gettext 0.10.39.
17659
17660 2001-08-03 Akim Demaille <akim@epita.fr>
17661
17662 * lib/strspn.c: New.
17663
17664 2001-08-01 Marc Autret <autret_m@epita.fr>
17665
17666 * doc/bison.texinfo: Update.
17667 * doc/bison.1 (mandoc): Update.
17668 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
17669 * src/files.c: Support output files extensions computing.
17670 (src_extension): New static variable.
17671 (header_extension): New static variable.
17672 (tr): New function.
17673 (get_extension_index): New function, gets the index of an extension
17674 filename in a string.
17675 (compute_exts_from_gf): New function, computes extensions from the
17676 grammar file extension.
17677 (compute_exts_from_src): New functions, computes extensions from the
17678 C source file extension, file given by ``-o'' option.
17679 (compute_base_names): Update.
17680 (output_files): Update.
17681
17682 2001-08-01 Robert Anisko <anisko_r@epita.fr>
17683
17684 * doc/bison.texi: Document @$.
17685 (Locations): New section.
17686
17687 2001-07-18 Akim Demaille <akim@epita.fr>
17688
17689 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
17690 * config/prev-version.txt, config/move-if-change: New.
17691 * Makefile.am: Adjust.
17692
17693 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
17694
17695 * src/bison.simple (yyparse): Suppress warning `comparaison
17696 between signed and unsigned'.
17697
17698 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
17699
17700 * src/getargs.h (raw_flag): Remove.
17701 * src/getargs.c: Die on `-r'/`--raw'.
17702 * src/lex.c (parse_percent_token): Die on `%raw'.
17703 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
17704 * tests/calc.at: Suppress test with option `--raw'.
17705
17706 2001-07-14 Akim Demaille <akim@epita.fr>
17707
17708 * config/: New.
17709 * configure.in: Require Autoconf 2.50.
17710 Update to gettext 0.10.38.
17711
17712 2001-03-16 Akim Demaille <akim@epita.fr>
17713
17714 * doc/bison.texinfo: ANSIfy the examples.
17715
17716 2001-03-16 Akim Demaille <akim@epita.fr>
17717
17718 * getargs.c (skeleton): New variable.
17719 (longopts): --skeleton is a new option.
17720 (shortopts, getargs): -S is a new option.
17721 * getargs.h: Declare skeleton.
17722 * output.c (output_parser): Use it.
17723
17724 2001-03-16 Akim Demaille <akim@epita.fr>
17725
17726 * m4/strerror_r.m4: New.
17727 * m4/error.m4: Run AC_FUNC_STRERROR_R.
17728 * lib/error.h, lib/error.c: Update.
17729
17730 2001-03-16 Akim Demaille <akim@epita.fr>
17731
17732 * src/getargs.c (longopts): Clean up.
17733
17734 2001-02-21 Akim Demaille <akim@epita.fr>
17735
17736 * src/reader.c (gensym): `gensym_count' is your own.
17737 Use a static buf to create the symbol name, as token_buffer is no
17738 longer a buffer.
17739
17740 2001-02-08 Akim Demaille <akim@epita.fr>
17741
17742 * src/conflicts.c (conflict_report): Be sure not to append to res
17743 between two calls, which could happen if both first sprintf were
17744 skipped, but not the first cp += strlen.
17745
17746 2001-02-08 Akim Demaille <akim@epita.fr>
17747
17748 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
17749 New, from fileutils 4.0.37.
17750 * configure.in: Require Autoconf 2.49c. I took some time before
17751 making this decision. This is the only way out for portability
17752 issues in Bison, it would mean way too much duplicate effort to
17753 import in Bison features implemented in 2.49c since 2.13.
17754 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
17755
17756 2001-02-02 Akim Demaille <akim@epita.fr>
17757
17758 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
17759 * lib/xalloc.h, lib/xmalloc.c: Update.
17760
17761 2001-01-19 Akim Demaille <akim@epita.fr>
17762
17763 Get rid of the ad hoc handling of token_buffer in the scanner: use
17764 the obstacks.
17765
17766 * src/lex.c (token_obstack): New.
17767 (init_lex): Initialize it. No longer call...
17768 (grow_token_buffer): this. Remove it.
17769 Adjust all the places which used it to use the obstack.
17770
17771 2001-01-19 Akim Demaille <akim@epita.fr>
17772
17773 * src/lex.h: Rename all the tokens:
17774 s/\bENDFILE\b/tok_eof/g;
17775 s/\bIDENTIFIER\b/tok_identifier/g;
17776 etc.
17777 Let them be enums, not #define, to ease debugging.
17778 Adjust all the code.
17779
17780 2001-01-18 Akim Demaille <akim@epita.fr>
17781
17782 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
17783 * src/lex.c (maxtoken, grow_token_buffer): Static.
17784
17785 2001-01-18 Akim Demaille <akim@epita.fr>
17786
17787 Since we now use obstacks, more % directives can be enabled.
17788
17789 * src/lex.c (percent_table): Also accept `%yacc',
17790 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
17791 `%debug'.
17792 Handle the actions for `%semantic_parser' and `%pure_parser' here,
17793 instead of returning a token.
17794 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
17795 * src/reader.c (read_declarations): Adjust.
17796 * src/files.c (open_files): Don't call `compute_base_names', don't
17797 compute `attrsfile' since they depend upon data which might be
17798 *in* the input file now.
17799 (output_files): Do it here.
17800 * src/output.c (output_headers): Document the fact that this patch
17801 introduces a guaranteed SEGV for semantic parsers.
17802 * doc/bison.texinfo: Document them.
17803 * tests/suite.at: Exercise these %options.
17804
17805 2000-12-20 Akim Demaille <akim@epita.fr>
17806
17807 Also handle the output file (--verbose) with obstacks.
17808
17809 * files.c (foutput): Remove.
17810 (output_obstack): New.
17811 Adjust all dependencies.
17812 * src/conflicts.c: Return a string.
17813 * src/system.h (obstack_grow_string): Rename as...
17814 (obstack_sgrow): this. Be ready to work with non literals.
17815 (obstack_fgrow4): New.
17816
17817 2000-12-20 Akim Demaille <akim@epita.fr>
17818
17819 * src/files.c (open_files): Fix the computation of short_base_name
17820 in the case of `-o foo.tab.c'.
17821
17822 2000-12-20 Akim Demaille <akim@epita.fr>
17823
17824 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
17825 (copy_dollar): Now that everything uses obstacks, get rid of the
17826 FILE * parameters.
17827
17828 2000-12-20 Akim Demaille <akim@epita.fr>
17829
17830 * src/files.c (open_files): Actually the `.output' file is based
17831 on the short_base_name, not base_name.
17832 * tests/suite.at (Checking output file names): Adjust.
17833
17834 2000-12-20 Akim Demaille <akim@epita.fr>
17835
17836 * src/bison.s1: Remove, we now use directly...
17837 * src/bison.simple: this.
17838 * src/Makefile.am: Use pkgdata instead of data.
17839
17840 2000-12-20 Akim Demaille <akim@epita.fr>
17841
17842 * src/files.c (guard_obstack): New.
17843 (open_files): Initialize it.
17844 (output_files): Dump it...
17845 * src/files.h: Export it.
17846 * src/reader.c (copy_guard): Use it.
17847
17848 2000-12-19 Akim Demaille <akim@epita.fr>
17849
17850 * src/files.c (outfile, defsfile, actfile): Removed as global
17851 vars.
17852 (open_files): Don't compute them.
17853 (output_files): Adjust.
17854 (base_name, short_base_name): Be global.
17855 Adjust dependencies.
17856
17857 2000-12-19 Akim Demaille <akim@epita.fr>
17858
17859 * src/files.c (strsuffix): New.
17860 (stringappend): Be just like strcat but allocate.
17861 (base_names): Eve out from open_files.
17862 Try to simplify the rather hairy computation of base_name and
17863 short_base_name.
17864 (open_files): Use it.
17865 * tests/suite.at (Checking output file names): New test.
17866
17867 2000-12-19 Akim Demaille <akim@epita.fr>
17868
17869 * src/system.h (obstack_grow_literal_string): Rename as...
17870 (obstack_grow_string): this.
17871 * src/output.c (output_parser): Recognize `%% actions' instead of
17872 `$'.
17873 * src/bison.s1: s/$/%% actions/.
17874 * src/bison.hairy: Likewise.
17875
17876 2000-12-19 Akim Demaille <akim@epita.fr>
17877
17878 * src/output.c (output_parser): Compute the `#line' lines when
17879 there are.
17880 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
17881 Suggested by Hans Aberg.
17882
17883 2000-12-19 Akim Demaille <akim@epita.fr>
17884
17885 Let the handling of the skeleton files be local to the procedures
17886 that use it.
17887
17888 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
17889 longer static.
17890 (fparser, open_extra_files): Remove.
17891 (open_files, output_files): Don't take care of fparser.
17892 * src/files.h: Adjust.
17893 * src/output.c (output_parser): Open and close the file to the
17894 skeleton.
17895 * src/reader.c (read_declarations): When %semantic_parser, open
17896 fguard.
17897
17898 2000-12-19 Akim Demaille <akim@epita.fr>
17899
17900 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
17901 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
17902
17903 2000-12-19 Akim Demaille <akim@epita.fr>
17904
17905 * src/files.c (open_files): Yipee! We no longer need all the code
17906 looking for `/tmp' since we have no tmp file.
17907
17908 2000-12-19 Akim Demaille <akim@epita.fr>
17909
17910 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
17911 New macros.
17912 * src/files.c (open_files): Less dependency on MSDOS etc.
17913
17914 2000-12-14 Akim Demaille <akim@epita.fr>
17915
17916 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
17917 Provide a default definition.
17918 Use it when executing the default @ action.
17919 * src/reader.c (reader_output_yylsp): No longer include
17920 `timestamp' and `text' in the default YYLTYPE.
17921
17922 2000-12-12 Akim Demaille <akim@epita.fr>
17923
17924 * src/reader.c (copy_definition, parse_union_decl, copy_action)
17925 (copy_guard): Quote the file names.
17926 Reported by Laurent Mascherpa.
17927
17928 2000-12-12 Akim Demaille <akim@epita.fr>
17929
17930 * src/output.c (output_headers, output_program, output): Be sure
17931 to escape special characters when outputting filenames.
17932 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
17933 (output_headers): Don't depend on them, Use ACTSTR.
17934
17935 2000-11-17 Akim Demaille <akim@epita.fr>
17936
17937 * lib/obstack.h: Formatting changes.
17938 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
17939 prevents type checking.
17940 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
17941 cast the value to (void *): assigning a `foo *' to a `void *'
17942 variable is valid.
17943 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
17944 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
17945 append characters.
17946
17947 2000-11-17 Akim Demaille <akim@epita.fr>
17948
17949 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
17950 as...
17951 (suite.m4, regression.m4, calc.m4): these.
17952 * tests/atgeneral.m4: Update from CVS Autoconf.
17953
17954 2000-11-17 Akim Demaille <akim@epita.fr>
17955
17956 * tests/regression.m4 (%union and --defines): New test,
17957 demonstrating a current bug in the obstack implementation.
17958
17959 2000-11-17 Akim Demaille <akim@epita.fr>
17960
17961 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
17962 macros.
17963 Use them to declare the variables which are global or local to
17964 `yyparse'.
17965
17966 2000-11-17 Akim Demaille <akim@epita.fr>
17967
17968 * acconfig.h: Remove, no longer used.
17969
17970 2000-11-07 Akim Demaille <akim@epita.fr>
17971
17972 * src: s/Copyright (C)/Copyright/g.
17973
17974 2000-11-07 Akim Demaille <akim@epita.fr>
17975
17976 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
17977 defining.
17978 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
17979
17980 2000-11-07 Akim Demaille <akim@epita.fr>
17981
17982 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
17983 Merge in a single CPP if/else.
17984
17985 2000-11-07 Akim Demaille <akim@epita.fr>
17986
17987 * src/output.c (output): Remove useless variables.
17988 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
17989 argument `data' for consistency with the prototypes.
17990 Qualify it `const'.
17991 (obstack_copy, obstack_copy0): Rename the second argument as
17992 `address' for consistency. Qualify it `const'.
17993 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
17994 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
17995 `const' their input argument (`data' or `address').
17996 Adjust the corresponding macros to include `const' in casts.
17997
17998 2000-11-03 Akim Demaille <akim@epita.fr>
17999
18000 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18001 s/PFILE1/BISON_HAIRY/.
18002 Adjust dependencies.
18003
18004 2000-11-03 Akim Demaille <akim@epita.fr>
18005
18006 For some reason, this was not applied.
18007
18008 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18009 `unlink': it's no longer used.
18010
18011 2000-11-03 Akim Demaille <akim@epita.fr>
18012
18013 * src/files.c (skeleton_find): New function, eved out of...
18014 (open_files, open_extra_files): here.
18015
18016 2000-11-03 Akim Demaille <akim@epita.fr>
18017
18018 Don't use `atexit'.
18019
18020 * src/files.c (obstack_save): New function.
18021 (done): Rename as...
18022 (output_files): this.
18023 Use `obstack_save'.
18024 * src/main.c (main): Don't use `atexit' to register `done', since
18025 it no longer has to remove tmp files, just call `output_files'
18026 when there are no errors.
18027
18028 2000-11-02 Akim Demaille <akim@epita.fr>
18029
18030 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18031 `unlink': it's no longer used.
18032 * src/files.h: Formatting changes.
18033
18034 2000-11-02 Akim Demaille <akim@epita.fr>
18035
18036 Remove the last uses of mktemp and unlink/delete.
18037
18038 * src/files.c (fdefines, ftable): Removed.
18039 (defines_ostack, table_obstack): New.
18040 Adjust dependencies of the former into uses of the latter.
18041 * src/output.c (output_short_or_char_table, output_short_table):
18042 Convert to using obstacks.
18043 * src/reader.c (copy_comment2): Accept one FILE * and two
18044 obstacks.
18045 (output_token_defines, reader_output_yylsp): Use obstacks.
18046 * src/system.h (obstack_fgrow3): New.
18047 * po/POTFILES.in: Adjust.
18048
18049 2000-11-01 Akim Demaille <akim@epita.fr>
18050
18051 Change each use of `fattrs' into a use of `attrs_obstack'.
18052
18053 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18054 * src/files.c (fattrs): Remove.
18055 (attrs_obstack): New.
18056 Adjust all dependencies.
18057 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18058
18059 2000-11-01 Akim Demaille <akim@epita.fr>
18060
18061 Introduce obstacks.
18062 Change each use of `faction' into a use of `action_obstack'.
18063
18064 * lib/obstack.h, lib/obstack.c: New files.
18065 * src/files.c (faction): Remove.
18066 (action_obstack): New.
18067 Adjust all dependencies.
18068
18069 2000-10-20 Akim Demaille <akim@epita.fr>
18070
18071 * lib/quote.h (PARAMS): New macro. Use it.
18072
18073 2000-10-16 Akim Demaille <akim@epita.fr>
18074
18075 * src/output.c (output_short_or_char_table): New function.
18076 (output_short_table, output_token_translations): Use it.
18077 (goto_actions): Use output_short_table.
18078
18079 2000-10-16 Akim Demaille <akim@epita.fr>
18080
18081 * src/symtab.c (bucket_new): New function.
18082 (getsym): Use it.
18083
18084 * src/output.c (output_short_table): New argument to display the
18085 comment associated with the table.
18086 Adjust dependencies.
18087 (output_gram): Use it.
18088 (output_rule_data): Nicer output layout for YYTNAME.
18089
18090 2000-10-16 Akim Demaille <akim@epita.fr>
18091
18092 * src/lex.c (read_typename): New function.
18093 (lex): Use it.
18094 * src/reader.c (copy_dollar): Likewise.
18095
18096 2000-10-16 Akim Demaille <akim@epita.fr>
18097
18098 * src/reader.c (copy_comment2): Expect the input stream to be on
18099 the `/' which is suspected to open a comment, instead of being
18100 called after `//' or `/*' was read.
18101 (copy_comment, copy_definition, parse_union_decl, copy_action)
18102 (copy_guard): Adjust.
18103
18104 2000-10-16 Akim Demaille <akim@epita.fr>
18105
18106 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18107 `read_signed_integer'.
18108
18109 2000-10-16 Akim Demaille <akim@epita.fr>
18110
18111 * src/reader.c (copy_dollar): New function.
18112 (copy_guard, copy_action): Use it.
18113
18114 2000-10-16 Akim Demaille <akim@epita.fr>
18115
18116 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18117 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18118 New files, from Fileutils 4.0.27.
18119 * src/main.c (printable_version): Remove.
18120 * src/lex.c, src/reader.c: Use `quote'.
18121
18122 2000-10-04 Akim Demaille <akim@epita.fr>
18123
18124 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18125
18126 2000-10-04 Akim Demaille <akim@epita.fr>
18127
18128 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18129
18130 2000-10-04 Akim Demaille <akim@epita.fr>
18131
18132 When a literal string is used to define two different tokens,
18133 `bison -v' segfaults.
18134 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18135
18136 * tests/regression.m4: New file.
18137 Include the core of the sample provided by Piotr Gackiewicz.
18138 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18139 properly.
18140
18141 2000-10-04 Akim Demaille <akim@epita.fr>
18142
18143 * src/reader.c (parse_expect_decl): Keep `count' within the size
18144 of `buffer'.
18145 From Neil Booth.
18146
18147 2000-10-02 Paul Eggert <eggert@twinsun.com>
18148
18149 * bison.s1 (yyparse): Assign the default value
18150 unconditionally, to avoid a GCC warning and make the parser a
18151 tad smaller.
18152
18153 2000-10-02 Akim Demaille <akim@epita.fr>
18154
18155 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18156 options.
18157
18158 2000-10-02 Akim Demaille <akim@epita.fr>
18159
18160 * src/derives.c, src/print.c, src/reduce.c: To ease the
18161 translation, move some `\n' out of the translated strings.
18162
18163 2000-10-02 Akim Demaille <akim@epita.fr>
18164
18165 The location tracking mechanism is precious for parse error
18166 messages. Nevertheless, it is enabled only when `@n' is used in
18167 the grammar, which is a different issue (you can use it in error
18168 message, but not in the grammar per se). Therefore, there should
18169 be another means to enable it.
18170
18171 * src/getargs.c (getargs): Support `--locations'.
18172 (usage): Report it.
18173 * src/getargs.h (locationsflag): Export it.
18174 * src/lex.c (percent_table): Support `%locations'.
18175 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18176 with `locationsflag'.
18177 * doc/bison.texinfo: Document `--locations' and `%locations'.
18178 Sort the options.
18179 * tests/calc.m4: Test it.
18180
18181 For regularity of the names, replace each
18182 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18183 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18184 In addition replace each `flag' with `_flag'.
18185
18186 2000-10-02 Akim Demaille <akim@epita.fr>
18187
18188 Also test parse error messages, including with YYERROR_VERBOSE.
18189
18190 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18191 associative).
18192 Use it to check the computations.
18193 Use it to check `nonassoc' is honored.
18194 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18195 `--yyerror-verbose'.
18196 (_AT_CHECK_CALC): Adjust to this option.
18197 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18198
18199 2000-10-02 Akim Demaille <akim@epita.fr>
18200
18201 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18202 the latter demonstrates a flaw in the handling of non debugging
18203 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18204 was used in order to simplify:
18205
18206 #if YYDEBUG
18207 if (yydebug)
18208 {
18209 ...
18210 }
18211 #endif
18212
18213 into
18214
18215 if (yydebug)
18216 {
18217 ...
18218 }
18219
18220 unfortunately this leads to a CPP conflict when
18221 `--name-prefix=foo' is used since it produces `#define yydebug
18222 foodebug'.
18223
18224 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18225 (YYDPRINTF): New macro.
18226 Spread its use.
18227 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18228 the bison options.
18229 Also test `--verbose', `--defines' and `--name-prefix'.
18230
18231 2000-10-02 Akim Demaille <akim@epita.fr>
18232
18233 Improve the readability of the produced parsers.
18234
18235 * src/bison.s1: Formatting changes.
18236 Improve the comment related to the `$' mark.
18237 (yydefault): Don't fall through to `yyresume': `goto' there.
18238 * src/output.c (output_parser): When the `$' is met, skip the end
18239 of its line.
18240 New variable, `number_of_dollar_signs', to check there's exactly
18241 one `$' in the parser skeleton.
18242
18243 2000-10-02 Akim Demaille <akim@epita.fr>
18244
18245 * lib/xstrdup.c: New file, from the fileutils.
18246 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18247 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18248 instead of strlen + xmalloc + strcpy.
18249 * src/symtab.c (copys): Remove, use xstrdup instead.
18250
18251 2000-10-02 Akim Demaille <akim@epita.fr>
18252
18253 * src/gram.h (associativity): New enum type which replaces the
18254 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18255 `right_assoc', `left_assoc' and `non_assoc'.
18256 Adjust all dependencies.
18257 * src/reader.c: Formatting changes.
18258 (LTYPESTR): Don't define it, use it as a literal in
18259 `reader_output_yylsp'.
18260 * src/symtab.h (symbol_class): New enum type which replaces the
18261 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18262 `sunknown', `stoken and `snterm'.
18263
18264 2000-10-02 Akim Demaille <akim@epita.fr>
18265
18266 * src/getargs.c (fixed_outfiles): Rename as...
18267 (yaccflag): for consistency and accuracy.
18268 Adjust dependencies.
18269
18270 2000-10-02 Akim Demaille <akim@epita.fr>
18271
18272 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18273 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18274 difficult and introduced a lot of core dump. It turns out that
18275 Bison used an implementation of `xmalloc' based on `calloc', and
18276 at various places it does depend upon the initialization to 0. I
18277 have not tried to isolate the pertinent places, and all the former
18278 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18279 someone should address this issue.
18280
18281 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18282 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18283 files.
18284 Adjust dependencies.
18285 * src/warshall.h: New file.
18286 Propagate.
18287
18288 2000-10-02 Akim Demaille <akim@epita.fr>
18289
18290 Various anti-`extern in *.c' changes.
18291
18292 * src/system.h: Include `assert.h'.
18293
18294 2000-10-02 Akim Demaille <akim@epita.fr>
18295
18296 * src/state.h (nstates, final_state, first_state, first_shift)
18297 (first_reduction): Move their exportation from here...
18298 * src/LR0.h: to here.
18299 Adjust dependencies.
18300 * src/getargs.c (statisticsflag): New variable.
18301 Add support for `--statistics'.
18302 Adjust dependencies.
18303
18304 Remove a lot of now useless `extern' statements in most files.
18305
18306 2000-10-02 Akim Demaille <akim@epita.fr>
18307
18308 * src/LR0.h: New file.
18309 Propagate its use.
18310
18311 2000-10-02 Akim Demaille <akim@epita.fr>
18312
18313 * src/print.h: New file.
18314 Propagate its use.
18315 * src/print.c: Formatting and ordering changes.
18316 (verbose, terse): Replace with...
18317 (print_results): this new function.
18318 Adjust dependencies.
18319
18320 2000-10-02 Akim Demaille <akim@epita.fr>
18321
18322 * src/conflicts.c (conflict_report): New function.
18323 (conflict_log, verbose_conflict_log): Replace with...
18324 (print_conflicts): this function.
18325 Adjust dependencies.
18326 * src/conflicts.h: New file.
18327 Propagate its inclusion.
18328
18329 2000-10-02 Akim Demaille <akim@epita.fr>
18330
18331 * src/nullable.h: New file.
18332 Propagate its inclusion.
18333 * src/nullable.c: Formatting changes.
18334
18335 2000-10-02 Akim Demaille <akim@epita.fr>
18336
18337 * src/reduce.h: New file.
18338 Propagate its inclusion.
18339 * src/reduce.c: Topological sort and other formatting changes.
18340 (bool, TRUE, FALSE): Move their definition to...
18341 * src/system.h: here.
18342
18343 2000-10-02 Akim Demaille <akim@epita.fr>
18344
18345 * src/files.c: Formatting changes.
18346 (tryopen, tryclose, openfiles): Rename as...
18347 (xfopen, xfclose, open_files): this.
18348 (stringappend): static.
18349 * src/files.h: Complete the list of exported symbols.
18350 Propagate its use.
18351
18352 2000-10-02 Akim Demaille <akim@epita.fr>
18353
18354 * src/reader.h: New file.
18355 Propagate its use instead of tedious list of `extern' and
18356 prototypes.
18357 * src/reader.c: Formatting changes, topological sort,
18358 s/register//.
18359
18360 2000-10-02 Akim Demaille <akim@epita.fr>
18361
18362 * src/lex.h: Prototype `lex.c' exported functions.
18363 * src/reader.c: Adjust.
18364 * src/lex.c: Formatting changes.
18365 (safegetc): Rename as...
18366 (xgetc): this.
18367
18368 2000-10-02 Akim Demaille <akim@epita.fr>
18369
18370 * src/lalr.h: New file.
18371 Propagate its inclusion instead of prototypes and `extern'.
18372 * src/lalr.c: Formatting changes, topological sorting etc.
18373
18374 2000-10-02 Akim Demaille <akim@epita.fr>
18375
18376 * src/output.c (token_actions): Introduce a temporary array,
18377 YYDEFACT, that makes it possible for this function to use
18378 output_short_table.
18379
18380 2000-10-02 Akim Demaille <akim@epita.fr>
18381
18382 `user_toknums' is output as a `short[]' in `output.c', while it is
18383 defined as a `int[]' in `reader.c'. For consistency with the
18384 other output tables, `user_toknums' is now defined as a table of
18385 shorts.
18386
18387 * src/reader.c (user_toknums): Be a short table instead of an int
18388 table.
18389 Adjust dependencies.
18390
18391 Factor the short table outputs.
18392
18393 * src/output.c (output_short_table): New function.
18394 * src/output.c (output_gram, output_stos, output_rule_data)
18395 (output_base, output_table, output_check): Use it.
18396
18397 2000-10-02 Akim Demaille <akim@epita.fr>
18398
18399 * src/output.c (output): Topological sort of the functions, in
18400 order to get rid of the `static' prototypes.
18401 No longer use `register'.
18402 * src/output.h: New file.
18403 Propagate its inclusion in files explicitly prototyping functions
18404 from output.c.
18405
18406 2000-09-21 Akim Demaille <akim@epita.fr>
18407
18408 * src/atgeneral.m4: Update from Autoconf.
18409
18410 2000-09-21 Akim Demaille <akim@epita.fr>
18411
18412 * src/closure.h: New file.
18413 * src/closure.c: Formatting changes, topological sort over the
18414 functions, use of closure.h.
18415 (initialize_closure, finalize_closure): Rename as...
18416 (new_closure, free_closure): these. Adjust dependencies.
18417 * src/LR0.c: Formatting changes, topological sort, use of
18418 cloture.h.
18419 (initialize_states): Rename as...
18420 (new_states): this.
18421 * src/Makefile.am (noinst_HEADERS): Adjust.
18422
18423 2000-09-20 Akim Demaille <akim@epita.fr>
18424
18425 * src/acconfig.h: Don't protect config.h against multiple
18426 inclusion.
18427 Don't define PARAMS.
18428 * src/system.h: Define PARAMS.
18429 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
18430 purpose of config.h. system.h must not try to fix wrong
18431 definitions in config.h.
18432
18433 2000-09-20 Akim Demaille <akim@epita.fr>
18434
18435 * src/derives.h: New file.
18436 * src/main.c, src/derives.h: Use it.
18437 Formatting changes.
18438 * src/Makefile.am (noinst_HEADERS): Adjust.
18439
18440 2000-09-20 Akim Demaille <akim@epita.fr>
18441
18442 * tests/atgeneral.m4: Update from Autoconf.
18443 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
18444 (AT_CHECK_CALC): New macros.
18445 Use these macros to test bison with options `', `--raw',
18446 `--debug', `--yacc', `--yacc --debug'.
18447
18448 2000-09-19 Akim Demaille <akim@epita.fr>
18449
18450 * src/output.c: Formatting changes.
18451 * src/machine.h: Remove, leaving its contents in...
18452 * src/system.h: here.
18453 Include stdio.h.
18454 Adjust all dependencies on stdio.h and machine.h.
18455 * src/getargs.h: New file.
18456 Let all `extern' declarations about getargs.c be replaced with
18457 inclusion of `getargs.h'.
18458 * src/Makefile.am (noinst_HEADERS): Adjust.
18459
18460 * tests/calc.m4 (yyin): Be initialized in main, not on the global
18461 scope.
18462 (yyerror): Returns void, not int.
18463 * doc/bison.texinfo: Formatting changes.
18464
18465 2000-09-19 Akim Demaille <akim@epita.fr>
18466
18467 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
18468 portable.
18469
18470 2000-09-18 Akim Demaille <akim@epita.fr>
18471
18472 * configure.in: Append WARNING_CFLAGS to CFLAGS.
18473 * src/Makefile.am (INCLUDES): Don't.
18474 Be ready to fetch headers in lib/.
18475
18476 2000-09-18 Akim Demaille <akim@epita.fr>
18477
18478 * doc/bison.texinfo: Update the copyright.
18479 ANSIfy and GNUify the examples.
18480 Remove the old menu.
18481
18482 2000-09-18 Akim Demaille <akim@epita.fr>
18483
18484 First set of tests: use the `calc' example from the documentation.
18485
18486 * src/bison.s1 (yyparse): Condition the code using `yytname' which
18487 is defined only when YYDEBUG is.
18488 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
18489 * src/files.c (tryopen, tryclose): Formatting changes.
18490 Move to the top and be static.
18491 * src/reader.c (read_signed_integer): Likewise.
18492 * tests/calc.m4: New file.
18493 * Makefile.am, suite.m4: Adjust.
18494 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
18495
18496 2000-09-18 Akim Demaille <akim@epita.fr>
18497
18498 Add support for an Autotest test suite for Bison.
18499
18500 * m4/m4.m4, m4/atconfig.m4: New files.
18501 * m4/Makefile.am (EXTRA_DIST): Adjust.
18502 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
18503 files.
18504 * src/getargs.c: Display a more standard --version message.
18505 * src/reader.c (reader): Formatting changes.
18506 No longer depend upon VERSION_STRING.
18507 * configure.in: No longer use `dnl'.
18508 Set up the test suite and the new directory `tests/.
18509 (VERSION_STRING): Remove.
18510
18511 2000-04-14 Akim Demaille <akim@epita.fr>
18512
18513 * src/reader.c (copy_comment2): New function, same as former
18514 `copy_comment', but outputs into two FILE *.
18515 (copy_comment): Use it.
18516 (parse_union_decl): Use it.
18517 (get_type, parse_start_decl): Use the same `invalid' message.
18518 (parse_start_decl, parse_union_decl): Use the same `multiple'
18519 message.
18520 (parse_union_decl, copy_guard, copy_action): Use the same
18521 `unmatched' message.
18522 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
18523
18524 2000-03-31 Akim Demaille <akim@epita.fr>
18525
18526 * src/files.c (tryopen, tryclose): Move to the top.
18527 Be static.
18528
18529 2000-03-31 Akim Demaille <akim@epita.fr>
18530
18531 * src/main.c (main): Don't call `done', exit does it.
18532
18533 2000-03-31 Akim Demaille <akim@epita.fr>
18534
18535 * allocate.c: s/return (foo)/return foo/.
18536 * lalr.c: Likewise.
18537 * LR0.c: Likewise.
18538 * output.c: Likewise.
18539 * reader.c: Likewise.
18540 * symtab.c: Likewise.
18541 * vmsgetargs.c: Likewise.
18542
18543 2000-03-31 Akim Demaille <akim@epita.fr>
18544
18545 Clean up the error reporting functions.
18546
18547 * src/report.c: New file.
18548 * src/report.h: Likewise.
18549 * src/Makefile.am: Adjust.
18550 * m4/error.m4: New file.
18551 * m4/Makefile.am: Adjust.
18552 * configure.in (jm_PREREQ_ERROR): Call it.
18553 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
18554 Remove.
18555 (fatal, fatals): Remove. All callers use complain.c::fatal.
18556 (warn, warni, warns, warnss, warnss): Remove. All callers use
18557 complain.c::complain.
18558 (toomany): Remove, use fatal instead.
18559 * src/files.c (done): No argument, use complain_message_count.
18560 * src/main.c (main): Register `done' to `atexit'.
18561
18562 * src/getargs.c (usage): More `fputs', less `fprintf'.
18563
18564 2000-03-28 Akim Demaille <akim@epita.fr>
18565
18566 * lib/: New directory.
18567 * Makefile.am (SUBDIRS): Adjust.
18568 * configure.in: Adjust.
18569 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
18570 useless.
18571 * src/alloca.c: Moved to lib/.
18572 * src/getopt.c: Likewise.
18573 * src/getopt1.c: Likewise.
18574 * src/getopt.h: Likewise.
18575 * src/ansi2knr.c: Likewise.
18576 * src/ansi2knr.1: Likewise.
18577 * src/Makefile.am: Adjust.
18578 * lib/Makefile.am: New file.
18579
18580 2000-03-28 Akim Demaille <akim@epita.fr>
18581
18582 * src/getargs.c (usage): Refresh the help message.
18583
18584 2000-03-17 Akim Demaille <akim@epita.fr>
18585
18586 * src/getopt1.c: Updated from textutils 2.0e
18587 * src/getopt.c: Likewise.
18588 * src/getopt.h: Likewise.
18589
18590 2000-03-17 Akim Demaille <akim@epita.fr>
18591
18592 * src/Makefile.am (bison.simple): Fix the awk program: quote only
18593 the file name, not the whole `#line LINE FILE'.
18594
18595 2000-03-17 Akim Demaille <akim@epita.fr>
18596
18597 On syntax errors, report the token on which we choked.
18598
18599 * src/bison.s1 (yyparse): In the label yyerrlab, when
18600 YYERROR_VERBOSE, add yychar in msg.
18601
18602 2000-03-17 Akim Demaille <akim@epita.fr>
18603
18604 * src/reader.c (copy_at): New function.
18605 (copy_guard): Use it.
18606 (copy_action): Use it.
18607
18608 2000-03-17 Akim Demaille <akim@epita.fr>
18609
18610 Be kind to translators, save some useless translations.
18611
18612 * src/main.c (banner): New function.
18613 (fatal_banner): Use it.
18614 (warn_banner): Use it.
18615
18616 2000-03-17 Akim Demaille <akim@epita.fr>
18617
18618 * src/reader.c (copy_definition): Use copy_string and
18619 copy_comment. Removed now unused `match', `ended',
18620 `cplus_comment'.
18621 (copy_comment, copy_string): Moved, to be visible from
18622 copy_definition.
18623
18624 2000-03-17 Akim Demaille <akim@epita.fr>
18625
18626 * src/reader.c (copy_string): Declare `static inline'. No
18627 problems with inline, since it is checked by configure.
18628 (copy_comment): Likewise.
18629
18630 2000-03-17 Akim Demaille <akim@epita.fr>
18631
18632 * src/reader.c (packsymbols): Formatting changes.
18633
18634 2000-03-17 Akim Demaille <akim@epita.fr>
18635
18636 * src/reader.c (copy_comment): New function, factored out from:
18637 (copy_action): Use it. Removed now unused `match', `ended',
18638 `cplus_comment'.
18639 (copy_guard): Likewise.
18640
18641 2000-03-17 Akim Demaille <akim@epita.fr>
18642
18643 * src/reader.c (copy_string): New function, factored out from:
18644 (copy_action): Use it.
18645 (copy_guard): Likewise.
18646
18647 2000-03-17 Akim Demaille <akim@epita.fr>
18648
18649 Change the handling of @s so that they behave exactly like $s.
18650 There is now a pseudo variable @$ (readble and writable), location
18651 of the lhs of the rule (by default ranging from the location of
18652 the first symbol of the rhs, to the location of the last symbol,
18653 or, if the rhs is empty, YYLLOC).
18654
18655 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
18656 yyval.
18657 (yyparse): When providing a default semantic action, provide a
18658 default location action.
18659 (after the $): No longer change `*YYLSP', just stack YYLOC the
18660 same way you stack YYVAL.
18661 * src/reader.c (read_declarations): Use warns.
18662 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
18663 (copy_action, case '@'): Likewise.
18664 Use a standard error message, to save useless work from
18665 translators.
18666
18667 2000-03-17 Akim Demaille <akim@epita.fr>
18668
18669 * src/bison.s1: Formatting and cosmetics changes.
18670 * src/reader.c: Likewise.
18671 Update the Copyright notice.
18672
18673 2000-03-17 Akim Demaille <akim@epita.fr>
18674
18675 * src/bison.s1 (#line): All set to `#line' only, since the
18676 Makefile now handles them.
18677
18678 2000-03-16 Akim Demaille <akim@epita.fr>
18679
18680 * src/output.c (output_rule_data): Output the documentation of
18681 some of the tables.
18682 (Copyright notice): Update.
18683 Formatting changes.
18684
18685 2000-03-16 Akim Demaille <akim@epita.fr>
18686
18687 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
18688 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
18689 One `#if YYDEBUG' remains, since it uses variables which are
18690 defined only if `YYDEBUG != 0'.
18691
18692 2000-03-16 Akim Demaille <akim@epita.fr>
18693
18694 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
18695 and related variables so that the similarities are highlighted.
18696
18697 2000-03-16 Akim Demaille <akim@epita.fr>
18698
18699 * src/bison.s1: Properly indent CPP directives.
18700
18701 2000-03-16 Akim Demaille <akim@epita.fr>
18702
18703 * src/bison.s1: Properly indent the `alloca' CPP section.
18704
18705 2000-03-16 Akim Demaille <akim@epita.fr>
18706
18707 Do not hard code values of directories in `configure.in'.
18708 Update the `configure' tool chain.
18709
18710 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
18711 src/makefile.am.
18712 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
18713 (AC_OUTPUT): Add m4/Makefile.
18714 Bump to bison 1.28a, 1.29 has never been released.
18715 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
18716 handled via src/Makefile.am.
18717 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
18718 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
18719 autoheader.
18720 * Makefile.am (SUBDIRS): Add m4.
18721 (ACLOCAL_AM_FLAGS): New variable.
18722 (AUTOMAKE_OPTIONS): Add check-news.
18723 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
18724 the proper line number and file name.
18725 (DEFS): Propagate the location of bison library files and of the
18726 locale files.
18727 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
18728 builddir.
18729 * acinclude.m4: Remove, replaced by the directory m4.
18730 * m4/Makefile.am (EXTRA_DIST): New variable.
18731 * m4/gettext.m4: New file, from the fileutils.
18732 * m4/lcmessage.m4: Likewise
18733 * m4/progtest.m4: Likewise.
18734 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
18735
18736 2000-03-10 Akim Demaille <akim@epita.fr>
18737
18738 * src/closure.c:
18739 Formatting changes of various comments.
18740 Respect the GNU coding standards at various places.
18741 Don't use `_()' when no translation is needed.
18742
18743 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18744
18745 * src/files.c:
18746 OS/2 honors TMPDIR environment variable.
18747
18748 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18749
18750 * doc/bison.texinfo: Tweaked spelling and grammar.
18751 Updated ISBN.
18752 Removed reference to price of printed copy.
18753 Mention BISON_SIMPLE and BISON_HAIRY.
18754
18755 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18756
18757 * configure.in, NEWS:
18758 Bison 1.29 released.
18759
18760 1999-10-27 Jesse Thilo <jthilo@gnu.org>
18761
18762 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
18763 Added reference card.
18764
18765 1999-07-26 Jesse Thilo <jthilo@gnu.org>
18766
18767 * po/ru.po: Added Russian translation.
18768
18769 1999-07-26 Jesse Thilo <jthilo@gnu.org>
18770
18771 * configure.in: Added Russian translation.
18772
18773 1999-07-06 Jesse Thilo <jthilo@gnu.org>
18774
18775 * configure.in, NEWS, README:
18776 Released version 1.28.
18777
18778 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18779
18780 * src/system.h:
18781 Squashed redefinition warning on some systems.
18782
18783 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
18784 Have configure build version string instead of relying on ANSI string
18785 concatentation.
18786
18787 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18788
18789 * po/POTFILES.in: Got rid of version.c.
18790
18791 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18792
18793 * acconfig.h, configure.in:
18794 Have configure build version string instead of relying on ANSI string
18795 concatentation.
18796
18797 1999-06-08 Jesse Thilo <jthilo@gnu.org>
18798
18799 * doc/bison.1:
18800 Dropped mention of `+' for long-named options.
18801
18802 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18803
18804 * src/files.c: Added <unistd.h> for unlink().
18805
18806 * src/Makefile.am, src/system.h:
18807 I18n fixes.
18808
18809 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18810
18811 * README: Added a FAQ list.
18812
18813 * configure.in, acconfig.h:
18814 I18n fixes.
18815
18816 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18817
18818 * doc/FAQ, doc/Makefile.am:
18819 Added a FAQ list.
18820
18821 1999-05-19 Jesse Thilo <jthilo@gnu.org>
18822
18823 * src/alloc.h, src/symtab.h, src/version.c:
18824 Protected inclusion of "config.h" with HAVE_CONFIG_H.
18825
18826 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18827
18828 * src/.cvsignore, src/Makefile.am:
18829 Reorganized: sources in `src', documentation in `doc'.
18830
18831 * src/lex.c (literalchar):
18832 fixed the code for escaping double quotes (thanks
18833 Jonathan Czisny.)
18834
18835 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18836
18837 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
18838 Adjusted paths to reflect directory reorganization.
18839
18840 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18841
18842 * doc/.cvsignore, doc/Makefile.am:
18843 Reorganized: sources in `src', documentation in `doc'.
18844
18845 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18846
18847 * configure.in:
18848 Updated AC_INIT file to reflect directory reorganization.
18849
18850 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
18851 Reorganized: sources in `src', documentation in `doc'.
18852
18853 1999-04-13 Jesse Thilo <jthilo@gnu.org>
18854
18855 * src/allocate.c:
18856 Don't declare calloc() and realloc() if not necessary.
18857
18858 1999-04-13 Jesse Thilo <jthilo@gnu.org>
18859
18860 * configure.in, acconfig.h, acinclude.m4:
18861 Don't declare calloc() and realloc() if not necessary.
18862
18863 1999-03-23 Jesse Thilo <jthilo@gnu.org>
18864
18865 * po/.cvsignore: Added i18n support.
18866
18867 1999-03-23 Jesse Thilo <jthilo@gnu.org>
18868
18869 * acconfig.h, configure.in, Makefile.am:
18870 Added i18n support.
18871
18872 1999-03-22 Jesse Thilo <jthilo@gnu.org>
18873
18874 * src/bison.s1: Fixed #line numbers.
18875
18876 1999-03-15 Jesse Thilo <jthilo@gnu.org>
18877
18878 * po/es.po, po/fr.po, po/nl.po, po/de.po:
18879 Added PO files from Translation Project.
18880
18881 1999-03-03 Jesse Thilo <jthilo@gnu.org>
18882
18883 * Makefile.am:
18884 Added support for non-ANSI compilers (ansi2knr).
18885
18886 1999-02-16 Jesse Thilo <jthilo@gnu.org>
18887
18888 * configure.in: Bumped version number to 1.27.
18889
18890 * Makefile.am:
18891 Added `bison.simple' to list of files removed by `make distclean'.
18892
18893 1999-02-12 Jesse Thilo <jthilo@gnu.org>
18894
18895 * src/files.c, src/files.h:
18896 Defined locations of parser files in config.h instead of Makefile.
18897
18898 1999-02-12 Jesse Thilo <jthilo@gnu.org>
18899
18900 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
18901 Defined locations of parser files in config.h instead of Makefile.
18902
18903 1999-02-09 Jesse Thilo <jthilo@gnu.org>
18904
18905 * Makefile.am:
18906 Removed inappropriate use of $< macro.
18907
18908 1999-02-05 Jesse Thilo <jthilo@gnu.org>
18909
18910 * po/Makefile.in.in, po/POTFILES.in:
18911 Add `po' directory skeleton.
18912
18913 1999-01-27 Jesse Thilo <jthilo@gnu.org>
18914
18915 * README: Document help-bison list.
18916
18917 * configure.in: Add check for mkstemp().
18918
18919 1999-01-20 Jesse Thilo <jthilo@gnu.org>
18920
18921 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
18922 Hush a few compiler warnings.
18923
18924 * src/files.c:
18925 Add tryclose(), which verifies that fclose was successful.
18926 Hush a couple of compiler warnings.
18927
18928 1999-01-20 Jesse Thilo <jthilo@gnu.org>
18929
18930 * Makefile.am, OChangeLog:
18931 ChangeLog is now automatically generated. Include the old version as
18932 OChangeLog.
18933
18934 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18935
18936 * src/gram.h, src/lalr.c, src/lex.c, src/lex.h, src/machine.h, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/state.h, src/symtab.c, src/symtab.h, src/types.h, src/vmsgetargs.c, src/warshall.c, src/allocate.c, src/alloc.h, src/bison.s1, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/files.h, src/getargs.c, src/gram.c, src/LR0.c:
18937 Update FSF address.
18938
18939 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18940
18941 * doc/bison.texinfo: Fix formatting glitch.
18942
18943 * doc/bison.texinfo: Update FSF address.
18944
18945 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18946
18947 * acconfig.h: Update FSF address.
18948
18949 1999-01-08 Jesse Thilo <jthilo@gnu.org>
18950
18951 * src/system.h:
18952 Don't define PACKAGE here, since config.h defines it.
18953
18954 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18955
18956 * src/reader.c: Update copyright date.
18957
18958 * src/main.c:
18959 Ditch sprintf to statically-sized buffers in fatal/warn functions in
18960 favor of output directly to stderr (avoids buffer overruns).
18961
18962 * src/reader.c: Some checks for premature EOF.
18963
18964 * src/allocate.c, src/alloc.h, src/closure.c, src/conflicts.c, src/derives.c, src/getargs.c, src/gram.c, src/lalr.c, src/lex.c, src/LR0.c, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reduce.c, src/symtab.c, src/symtab.h, src/warshall.c:
18965 Use prototypes if the compiler understands them.
18966
18967 * src/files.c: Honor TMPDIR on Unix hosts.
18968 Use prototypes if the compiler understands them.
18969
18970 * src/reader.c:
18971 Fix a couple of buffer overrun bugs.
18972 Use prototypes if the compiler understands them.
18973
18974 * src/system.h: Include unistd.h and ctype.h.
18975 Use #ifdef instead of #if for NLS symbols.
18976
18977 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18978
18979 * doc/bison.texinfo:
18980 Delete comment "consider using @set for edition number, etc..." since
18981 we now are doing so.
18982
18983 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18984
18985 * configure.in:
18986 Use prototypes if the compiler understands them.
18987
18988 * NEWS: Document 1.26 highlights.
18989
18990 * Makefile.am: Require Automake 1.3 or later.
18991
18992 * acconfig.h:
18993 Use prototypes if the compiler understands them.
18994
18995 1998-12-29 Jesse Thilo <jthilo@gnu.org>
18996
18997 * src/version.c:
18998 Use VERSION symbol from automake for version number.
18999
19000 1998-12-29 Jesse Thilo <jthilo@gnu.org>
19001
19002 * acconfig.h, configure.in, version.cin:
19003 Use VERSION symbol from automake for version number.
19004
19005 1998-11-28 Jesse Thilo <jthilo@gnu.org>
19006
19007 * Makefile.am:
19008 Distribute original version of simple parser (bison.s1), not built
19009 version (bison.simple).
19010
19011 1998-11-28 Jesse Thilo <jthilo@gnu.org>
19012
19013 * doc/bison.texinfo: Add info dir entry.
19014
19015 * doc/bison.texinfo:
19016 Let automake put version number into documentation.
19017
19018 1998-11-26 Jesse Thilo <jthilo@gnu.org>
19019
19020 * src/bison.cld, src/build.com, src/vmshlp.mar:
19021 Add non-RCS files from /gd/gnu/bison.
19022
19023 1998-11-26 Jesse Thilo <jthilo@gnu.org>
19024
19025 * doc/bison.1:
19026 Document the BISON_HAIRY and BISON_SIMPLE variables.
19027
19028 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19029
19030 * src/version.c: Build version.c automatically.
19031
19032 * src/reader.c:
19033 Fix token numbering (used to start at 258, not 257).
19034
19035 * src/system.h: Include config.h.
19036
19037 * src/getargs.c: Update bug report address.
19038
19039 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19040 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19041
19042 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19043
19044 * Makefile.am:
19045 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19046
19047 * configure.in, version.cin:
19048 Build version.c automatically.
19049
19050 * AUTHORS: Add AUTHORS file.
19051
19052 * README: Update bug report address.
19053
19054 * bison.simple:
19055 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19056
19057 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19058 Add automake stuff.
19059
19060 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19061
19062 * doc/bison.texinfo: Clean up some formatting.
19063
19064 1998-05-05 Richard Stallman <rms@gnu.org>
19065
19066 * doc/bison.texinfo:
19067 Explain better why to make a pure parser.
19068
19069 1998-01-05 Richard Stallman <rms@gnu.org>
19070
19071 * src/files.c (openfiles):
19072 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19073 find a temporary directory, if possible. Do not unlink files while
19074 they are open.
19075
19076 1997-08-25 Richard Stallman <rms@gnu.org>
19077
19078 * src/reader.c (stack_offset;):
19079 Change some warni to warns.
19080
19081 * src/lex.c (literalchar): Use warns, not warni.
19082
19083 1997-06-28 Richard Stallman <rms@gnu.org>
19084
19085 * src/bison.s1: Add a Bison version comment.
19086
19087 * src/main.c (fatal, warn, berror):
19088 Use program_name.
19089
19090 1997-06-28 Richard Stallman <rms@gnu.org>
19091
19092 * Makefile.in (bison_version): New variable.
19093 (dist): Use that variable.
19094 (bison.s1): Substitute the Bison version into bison.simple.
19095
19096 * bison.simple: Add a Bison version comment.
19097
19098 1997-06-18 Richard Stallman <rms@gnu.org>
19099
19100 * src/main.c (fatal, warn, berror):
19101 Make error messages standard.
19102 (toomany): Improve error message text.
19103
19104 * src/LR0.c, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/lalr.c, src/lex.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/symtab.c:
19105 new.h renamed to alloc.h.
19106
19107 1997-06-18 Richard Stallman <rms@gnu.org>
19108
19109 * Makefile.in: new.h renamed to alloc.h.
19110
19111 1997-05-24 Richard Stallman <rms@gnu.org>
19112
19113 * src/lex.c (literalchar):
19114 Fix the code for escaping \, " and '.
19115
19116 (lex): Avoid trouble when there are many chars
19117 to discard in a char literal with just several chars in it.
19118
19119 1997-05-17 Richard Stallman <rms@gnu.org>
19120
19121 * src/bison.s1:
19122 Use malloc, if using alloca is troublesome.
19123 (YYSTACK_USE_ALLOCA): New flag macro.
19124 Define it for some systems and compilers.
19125 (YYSTACK_ALLOC): New macro.
19126 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19127 If it was malloc'd, free it.
19128
19129 1997-05-17 Richard Stallman <rms@gnu.org>
19130
19131 * bison.simple:
19132 Use malloc, if using alloca is troublesome.
19133 (YYSTACK_USE_ALLOCA): New flag macro.
19134 Define it for some systems and compilers.
19135 (YYSTACK_ALLOC): New macro.
19136 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19137 If it was malloc'd, free it.
19138
19139 1997-04-23 Richard Stallman <rms@gnu.org>
19140
19141 * src/bison.s1:
19142 (alloca) [__hpux]: Always define as __builtin_alloca.
19143
19144 1997-04-23 Richard Stallman <rms@gnu.org>
19145
19146 * bison.simple:
19147 (alloca) [__hpux]: Always define as __builtin_alloca.
19148
19149 1997-04-22 Richard Stallman <rms@gnu.org>
19150
19151 * src/bison.s1:
19152 [__hpux]: Include alloca.h (right for HPUX 10)
19153 instead of declaring alloca (right for HPUX 9).
19154
19155 * src/bison.s1 (__yy_memcpy):
19156 Declare arg `count' as unsigned int.
19157 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19158
19159 1997-04-22 Richard Stallman <rms@gnu.org>
19160
19161 * bison.simple:
19162 [__hpux]: Include alloca.h (right for HPUX 10)
19163 instead of declaring alloca (right for HPUX 9).
19164
19165 * bison.simple (__yy_memcpy):
19166 Declare arg `count' as unsigned int.
19167 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19168
19169 1997-01-03 Richard Stallman <rms@gnu.org>
19170
19171 * src/allocate.c: [__STDC__ or _MSC_VER]:
19172 Declare calloc and realloc to return void *.
19173
19174 1997-01-02 Richard Stallman <rms@gnu.org>
19175
19176 * src/system.h:
19177 [_MSC_VER]: Include stdlib.h and process.h.
19178 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19179
19180 * src/main.c (main): Return FAILURE as a value.
19181 (printable_version): Declare arg as int, not char.
19182
19183 1997-01-02 Richard Stallman <rms@gnu.org>
19184
19185 * Makefile.in (dist):
19186 Explicitly check for symlinks, and copy them.
19187
19188 1996-12-19 Richard Stallman <rms@gnu.org>
19189
19190 * src/files.c:
19191 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19192
19193 1996-12-18 Paul Eggert <eggert@gnu.org>
19194
19195 * src/bison.s1 (yyparse):
19196 If __GNUC__ and YYPARSE_PARAM are both defined,
19197 declare yyparse to have a void * argument.
19198
19199 1996-12-18 Paul Eggert <eggert@gnu.org>
19200
19201 * bison.simple (yyparse):
19202 If __GNUC__ and YYPARSE_PARAM are both defined,
19203 declare yyparse to have a void * argument.
19204
19205 1996-12-17 Richard Stallman <rms@gnu.org>
19206
19207 * src/reduce.c (nbits): Add some casts.
19208
19209 1996-08-12 Richard Stallman <rms@gnu.org>
19210
19211 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19212
19213 1996-08-12 Richard Stallman <rms@gnu.org>
19214
19215 * bison.simple: Test _MSDOS as well as _MSDOS_.
19216
19217 1996-07-31 Richard Stallman <rms@gnu.org>
19218
19219 * src/bison.s1:
19220 [__sun && __i386]: Include alloca.h.
19221
19222 1996-07-31 Richard Stallman <rms@gnu.org>
19223
19224 * bison.simple:
19225 [__sun && __i386]: Include alloca.h.
19226
19227 1996-07-30 Richard Stallman <rms@gnu.org>
19228
19229 * src/bison.s1: Comment change.
19230
19231 * src/bison.s1: Test _MSDOS_, not MSDOS.
19232
19233 1996-07-30 Richard Stallman <rms@gnu.org>
19234
19235 * bison.simple: Comment change.
19236
19237 * bison.simple: Test _MSDOS_, not MSDOS.
19238
19239 1996-06-01 Richard Stallman <rms@gnu.org>
19240
19241 * src/reduce.c, src/reader.c, src/print.c, src/output.c, src/nullable.c, src/lex.c, src/lalr.c, src/getargs.c, src/derives.c, src/conflicts.c, src/closure.c, src/allocate.c:
19242 Insert `_' macro around many string constants.
19243
19244 * src/main.c:
19245 Insert `_' macro around many string constants.
19246
19247 (main): Call setlocale, bindtextdomain and textdomain.
19248
19249 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19250 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19251 [ENABLE_NLS]: Include libintl.h.
19252 [ENABLE_NLS] (gettext): Define.
19253 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19254 (N_, PACKAGE, LOCALEDIR): New macros.
19255
19256 1996-06-01 Richard Stallman <rms@gnu.org>
19257
19258 * POTFILES.in: New file.
19259
19260 * Makefile.in (allocate.o):
19261 Define target explicitly.
19262
19263 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19264 (LDFLAGS): Set to @LDFLAGS@.
19265 (configure): Run autoconf only if preceding `cd' succeeds.
19266 (bison.s1): Redirect output to temporary file then move the
19267 temporary to the target, rather than redirecting directly to bison.s1.
19268 (clean): Remove config.status and config.log.
19269 (distclean): Don't remove config.status here.
19270
19271 1996-05-12 Richard Stallman <rms@gnu.org>
19272
19273 * src/bison.s1:
19274 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19275
19276 1996-05-12 Richard Stallman <rms@gnu.org>
19277
19278 * bison.simple:
19279 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19280
19281 1996-05-11 Richard Stallman <rms@gnu.org>
19282
19283 * src/bison.s1 (__yy_memcpy):
19284 Really reorder the args, as was supposedly done on Feb 14 1995.
19285 (yyparse): Calls changed accordingly.
19286
19287 1996-05-11 Richard Stallman <rms@gnu.org>
19288
19289 * Makefile.in (dist): Don't use $(srcdir).
19290
19291 * bison.simple (__yy_memcpy):
19292 Really reorder the args, as was supposedly done on Feb 14 1995.
19293 (yyparse): Calls changed accordingly.
19294
19295 1996-01-27 Richard Stallman <rms@gnu.org>
19296
19297 * src/output.c (output_rule_data):
19298 Test YYERROR_VERBOSE in the conditional
19299 around the definition of ttyname.
19300
19301 1995-12-29 Richard Stallman <rms@gnu.org>
19302
19303 * src/bison.s1:
19304 Fix line numbers in #line commands.
19305
19306 1995-12-29 Richard Stallman <rms@gnu.org>
19307
19308 * bison.simple:
19309 Fix line numbers in #line commands.
19310
19311 1995-12-27 Richard Stallman <rms@gnu.org>
19312
19313 * src/bison.s1 (YYPARSE_PARAM_DECL):
19314 In C++, make it always null.
19315 (YYPARSE_PARAM_ARG): New macro.
19316 (yyparse): Use YYPARSE_PARAM_ARG.
19317
19318 1995-12-27 Richard Stallman <rms@gnu.org>
19319
19320 * bison.simple (YYPARSE_PARAM_DECL):
19321 In C++, make it always null.
19322 (YYPARSE_PARAM_ARG): New macro.
19323 (yyparse): Use YYPARSE_PARAM_ARG.
19324
19325 1995-11-29 Richard Stallman <rms@gnu.org>
19326
19327 * doc/bison.texinfo:
19328 Describe literal string tokens, %raw, %no_lines, %token_table.
19329
19330 1995-11-29 Daniel Hagerty <hag@gnu.org>
19331
19332 * doc/bison.texinfo: Fixed update date
19333
19334 1995-10-16 Richard Stallman <rms@gnu.org>
19335
19336 * src/version.c: Version 1.25.
19337
19338 1995-10-16 Richard Stallman <rms@gnu.org>
19339
19340 * NEWS: *** empty log message ***
19341
19342 1995-10-16 Richard Stallman <rms@gnu.org>
19343
19344 * doc/bison.1, doc/bison.rnh:
19345 Add new options.
19346
19347 1995-10-15 Richard Stallman <rms@gnu.org>
19348
19349 * src/vmsgetargs.c, src/getargs.c:
19350 Added -n, -k, and -raw switches.
19351 (noparserflag, toknumflag, rawtoknumflag): New variables.
19352
19353 * src/symtab.h (SALIAS):
19354 New #define for adding aliases to %token.
19355 (struct bucket): Added `alias' field.
19356
19357 * src/reduce.c (reduce_grammar):
19358 Revise error message.
19359 (print_notices): Remove final `.' from error message.
19360
19361 * src/reader.c (reader_output_yylsp):
19362 New function.
19363 (readgram): Use `#if 0' around code that accepted %command
19364 inside grammar rules: The documentation doesn't allow it,
19365 and it will fail since the %command processors scan for the next %.
19366 (parse_token_decl): Extended the %token
19367 declaration to allow a multi-character symbol as an alias.
19368 (parse_thong_decl): New function.
19369 (read_declarations): Added %thong declarations.
19370 (read_declarations): Handle NOOP to deal with allowing
19371 % declarations as another means to specify the flags.
19372 (readgram): Allow %prec prior to semantics embedded in a rule.
19373 (skip_to_char, read_declarations, copy_definition)
19374 (parse_token_decl, parse_start_decl, parse_type_decl)
19375 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
19376 (get_type_name, copy_guard, copy_action, readgram)
19377 (get_type, packsymbols): Revised most error messages.
19378 Changed `fatal' to `warnxxx' to avoid aborting for error.
19379 Revised and use multiple warnxxx functions to avoid using VARARGS1.
19380 (read_declarations): Improve the error message for
19381 an invalid character. Do not abort.
19382 (read_declarations, copy_guard, copy_action): Use
19383 printable_version to avoid unprintable characters in printed output.
19384 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
19385 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
19386 Allow the type of a non-terminal can be given
19387 more than once, as long as all specifications give the same type.
19388
19389 * src/output.c:
19390 (output_headers, output_trailers, output, output_gram)
19391 (output_rule_data): Implement noparserflag variable.
19392 Implement toknumflag variable.
19393 (output): Call reader_output_yylsp to output LTYPESTR.
19394
19395 * src/main.c (main):
19396 If reader sees an error, don't process the grammar.
19397 (fatals): Updated to not use VARARGS1.
19398 (printable_version, int_to_string, warn, warni, warns, warnss)
19399 (warnsss): New error reporting functions. Avoid abort for error.
19400
19401 * src/lex.h:
19402 Added THONG and NOOP for alias processing.
19403 Added SETOPT for the new code that allows setting options with %flags.
19404
19405 * src/lex.c:
19406 Include getopt.h. Add some extern decls.
19407 (safegetc): New function to deal with EOF gracefully.
19408 (literalchar); new function to deal with reading \ escapes.
19409 (lex): Use literalchar.
19410 (lex): Implemented "..." tokens.
19411 (literalchar, lex, parse_percent_token): Made tokenbuffer
19412 always contain the token. This includes growing the token
19413 buffer while reading an integer.
19414 (parse_percent_token): Replaced if-else statement with percent_table.
19415 (parse_percent_token): Added % declarations as another
19416 way to specify the flags -n, -l, and -r. Also added hooks for
19417 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
19418 major changes to files.c.
19419 (lex) Retain in the incoming stream a character following
19420 an incorrect '/'.
19421 (skip_white_space, lex): Revised most error messages
19422 and changed fatal to warn to avoid aborting.
19423 (percent_table): Added %thong declarations.
19424
19425 * src/gram.h: Comment changes.
19426
19427 * src/files.c (openfiles, open_extra_files, done):
19428 Add faction flag
19429 and actfile file. Handle noparserflag. Both for -n switch.
19430
19431 * src/conflicts.c (resolve_sr_conflict):
19432 Remove use of alloca.
19433
19434 1995-06-01 Jim Meyering <meyering@gnu.org>
19435
19436 * doc/bison.texinfo: *** empty log message ***
19437
19438 1995-05-06 Richard Stallman <rms@gnu.org>
19439
19440 * src/bison.s1: Comment change.
19441
19442 1995-05-06 Richard Stallman <rms@gnu.org>
19443
19444 * bison.simple: Comment change.
19445
19446 1995-05-03 Richard Stallman <rms@gnu.org>
19447
19448 * src/version.c: Version now 1.24.
19449
19450 * src/bison.s1: Change distribution terms.
19451
19452 * src/version.c: Version now 1.23.
19453
19454 1995-05-03 Richard Stallman <rms@gnu.org>
19455
19456 * doc/bison.texinfo:
19457 Rewrite "Conditions for Using Bison".
19458 Update version to 1.24.
19459
19460 1995-05-03 Richard Stallman <rms@gnu.org>
19461
19462 * bison.simple: Change distribution terms.
19463
19464 1995-02-23 Richard Stallman <rms@gnu.org>
19465
19466 * src/files.c: Test __VMS_POSIX as well as VMS.
19467
19468 1995-02-14 Jim Meyering <meyering@gnu.org>
19469
19470 * src/bison.s1 (__yy_memcpy):
19471 Renamed from __yy_bcopy to avoid
19472 confusion. Reverse FROM and TO arguments to be consistent with
19473 those of memcpy.
19474
19475 1995-02-14 Jim Meyering <meyering@gnu.org>
19476
19477 * bison.simple (__yy_memcpy):
19478 Renamed from __yy_bcopy to avoid
19479 confusion. Reverse FROM and TO arguments to be consistent with
19480 those of memcpy.
19481
19482 1994-11-10 David J. MacKenzie <djm@gnu.org>
19483
19484 * NEWS: reformat
19485
19486 * NEWS: New file.
19487
19488 * Makefile.in (DISTFILES): Include NEWS.
19489
19490 * Makefile.in (DISTFILES):
19491 Include install-sh, not install.sh.
19492
19493 * configure.in: Update to Autoconf v2 macro names.
19494
19495 1994-10-05 David J. MacKenzie <djm@gnu.org>
19496
19497 * Makefile.in: fix typo
19498
19499 * Makefile.in (prefix, exec_prefix):
19500 Let configure set them.
19501
19502 1994-09-28 David J. MacKenzie <djm@gnu.org>
19503
19504 * Makefile.in: Set datadir to $(prefix)/share.
19505
19506 1994-09-15 Richard Stallman <rms@gnu.org>
19507
19508 * src/bison.s1:
19509 Update copyright notice and GPL version.
19510
19511 1994-09-15 Richard Stallman <rms@gnu.org>
19512
19513 * bison.simple:
19514 Update copyright notice and GPL version.
19515
19516 1994-07-12 Richard Stallman <rms@gnu.org>
19517
19518 * src/reduce.c, src/reader.c:
19519 entered into RCS
19520
19521 1994-05-05 David J. MacKenzie <djm@gnu.org>
19522
19523 * Makefile.in: entered into RCS
19524
19525 1994-03-26 Richard Stallman <rms@gnu.org>
19526
19527 * src/bison.s1: entered into RCS
19528
19529 1994-03-26 Richard Stallman <rms@gnu.org>
19530
19531 * bison.simple: entered into RCS
19532
19533 1994-03-25 Richard Stallman <rms@gnu.org>
19534
19535 * src/main.c: entered into RCS
19536
19537 1994-03-24 Richard Stallman <rms@gnu.org>
19538
19539 * src/conflicts.c: entered into RCS
19540
19541 1994-01-02 Richard Stallman <rms@gnu.org>
19542
19543 * Makefile.in: *** empty log message ***
19544
19545 1993-11-21 Richard Stallman <rms@gnu.org>
19546
19547 * src/bison.s1: *** empty log message ***
19548
19549 1993-11-21 Richard Stallman <rms@gnu.org>
19550
19551 * doc/bison.texinfo: entered into RCS
19552
19553 * doc/bison.texinfo: *** empty log message ***
19554
19555 1993-11-21 Richard Stallman <rms@gnu.org>
19556
19557 * bison.simple: *** empty log message ***
19558
19559 1993-10-25 David J. MacKenzie <djm@gnu.org>
19560
19561 * doc/bison.texinfo: *** empty log message ***
19562
19563 1993-10-19 Richard Stallman <rms@gnu.org>
19564
19565 * src/bison.s1: *** empty log message ***
19566
19567 1993-10-19 Richard Stallman <rms@gnu.org>
19568
19569 * bison.simple: *** empty log message ***
19570
19571 1993-10-14 Richard Stallman <rms@gnu.org>
19572
19573 * src/bison.s1: *** empty log message ***
19574
19575 1993-10-14 Richard Stallman <rms@gnu.org>
19576
19577 * bison.simple: *** empty log message ***
19578
19579 1993-09-14 David J. MacKenzie <djm@gnu.org>
19580
19581 * doc/bison.texinfo: *** empty log message ***
19582
19583 1993-09-13 Noah Friedman <friedman@gnu.org>
19584
19585 * Makefile.in: *** empty log message ***
19586
19587 1993-09-10 Richard Stallman <rms@gnu.org>
19588
19589 * src/conflicts.c: *** empty log message ***
19590
19591 * src/system.h: entered into RCS
19592
19593 1993-09-10 Richard Stallman <rms@gnu.org>
19594
19595 * doc/bison.1: entered into RCS
19596
19597 1993-09-06 Noah Friedman <friedman@gnu.org>
19598
19599 * src/version.c: entered into RCS
19600
19601 1993-09-06 Noah Friedman <friedman@gnu.org>
19602
19603 * Makefile.in: *** empty log message ***
19604
19605 1993-07-30 David J. MacKenzie <djm@gnu.org>
19606
19607 * Makefile.in: *** empty log message ***
19608
19609 1993-07-24 Richard Stallman <rms@gnu.org>
19610
19611 * src/bison.s1: *** empty log message ***
19612
19613 1993-07-24 Richard Stallman <rms@gnu.org>
19614
19615 * bison.simple: *** empty log message ***
19616
19617 1993-07-08 David J. MacKenzie <djm@gnu.org>
19618
19619 * Makefile.in: *** empty log message ***
19620
19621 1993-07-04 Richard Stallman <rms@gnu.org>
19622
19623 * src/bison.s1: *** empty log message ***
19624
19625 1993-07-04 Richard Stallman <rms@gnu.org>
19626
19627 * bison.simple: *** empty log message ***
19628
19629 1993-06-26 David J. MacKenzie <djm@gnu.org>
19630
19631 * src/getargs.c: entered into RCS
19632
19633 1993-06-26 David J. MacKenzie <djm@gnu.org>
19634
19635 * doc/bison.texinfo: *** empty log message ***
19636
19637 * doc/bison.1: New file.
19638
19639 1993-06-25 Richard Stallman <rms@gnu.org>
19640
19641 * src/getargs.c: New file.
19642
19643 1993-06-16 Richard Stallman <rms@gnu.org>
19644
19645 * src/bison.s1: *** empty log message ***
19646
19647 1993-06-16 Richard Stallman <rms@gnu.org>
19648
19649 * bison.simple: *** empty log message ***
19650
19651 1993-06-03 Richard Stallman <rms@gnu.org>
19652
19653 * src/bison.s1: New file.
19654
19655 1993-06-03 Richard Stallman <rms@gnu.org>
19656
19657 * doc/bison.texinfo: *** empty log message ***
19658
19659 1993-06-03 Richard Stallman <rms@gnu.org>
19660
19661 * bison.simple: New file.
19662
19663 1993-05-19 Richard Stallman <rms@gnu.org>
19664
19665 * doc/bison.texinfo: New file.
19666
19667 1993-05-07 Noah Friedman <friedman@gnu.org>
19668
19669 * Makefile.in: *** empty log message ***
19670
19671 1993-04-28 Noah Friedman <friedman@gnu.org>
19672
19673 * src/reader.c: *** empty log message ***
19674
19675 1993-04-23 Noah Friedman <friedman@gnu.org>
19676
19677 * src/alloc.h: entered into RCS
19678
19679 1993-04-20 David J. MacKenzie <djm@gnu.org>
19680
19681 * src/version.c: *** empty log message ***
19682
19683 * src/files.c, src/allocate.c:
19684 entered into RCS
19685
19686 * src/reader.c: *** empty log message ***
19687
19688 * src/lex.c: entered into RCS
19689
19690 * src/conflicts.c: New file.
19691
19692 * src/symtab.c: entered into RCS
19693
19694 * src/alloc.h: New file.
19695
19696 * src/LR0.c: entered into RCS
19697
19698 1993-04-18 Noah Friedman <friedman@gnu.org>
19699
19700 * src/reader.c: New file.
19701
19702 * src/version.c: *** empty log message ***
19703
19704 1993-04-18 Noah Friedman <friedman@gnu.org>
19705
19706 * Makefile.in: *** empty log message ***
19707
19708 1993-04-17 Noah Friedman <friedman@gnu.org>
19709
19710 * Makefile.in: *** empty log message ***
19711
19712 1993-04-15 Richard Stallman <rms@gnu.org>
19713
19714 * src/main.c, src/files.c:
19715 New file.
19716
19717 1993-04-15 Noah Friedman <friedman@gnu.org>
19718
19719 * configure.in: entered into RCS
19720
19721 * configure.in: *** empty log message ***
19722
19723 * configure.in: New file.
19724
19725 1993-04-14 Richard Stallman <rms@gnu.org>
19726
19727 * Makefile.in: New file.
19728
19729 1993-04-13 Richard Stallman <rms@gnu.org>
19730
19731 * src/version.c: New file.
19732
19733 1993-03-25 Richard Stallman <rms@gnu.org>
19734
19735 * src/output.c: entered into RCS
19736
19737 1992-09-25 Richard Stallman <rms@gnu.org>
19738
19739 * configure.bat: entered into RCS
19740
19741 1992-06-22 Richard Stallman <rms@gnu.org>
19742
19743 * src/vmsgetargs.c: entered into RCS
19744
19745 1992-06-22 Richard Stallman <rms@gnu.org>
19746
19747 * doc/bison.rnh: entered into RCS
19748
19749 1992-04-20 David J. MacKenzie <djm@gnu.org>
19750
19751 * README: entered into RCS
19752
19753 1992-01-22 Richard Stallman <rms@gnu.org>
19754
19755 * src/machine.h: entered into RCS
19756
19757 1991-12-21 Richard Stallman <rms@gnu.org>
19758
19759 * src/lalr.c, src/closure.c:
19760 entered into RCS
19761
19762 1991-12-20 Richard Stallman <rms@gnu.org>
19763
19764 * src/state.h: entered into RCS
19765
19766 1991-12-18 Richard Stallman <rms@gnu.org>
19767
19768 * src/print.c, src/nullable.c, src/derives.c:
19769 entered into RCS
19770
19771 1991-11-03 David J. MacKenzie <djm@gnu.org>
19772
19773 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
19774 entered into RCS
19775
19776 1988-09-09 Richard Stallman <rms@gnu.org>
19777
19778 * src/bison.hairy: entered into RCS
19779
19780 1987-12-16 Richard Stallman <rms@gnu.org>
19781
19782 * REFERENCES: entered into RCS
19783
19784
19785 -----
19786
19787 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
19788 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
19789 Free Software Foundation, Inc.
19790
19791 Copying and distribution of this file, with or without
19792 modification, are permitted provided the copyright notice and this
19793 notice are preserved.
19794
19795 $Id$