]> git.saurik.com Git - bison.git/blame - ChangeLog
Don't let Bison leak memory except when it complains.
[bison.git] / ChangeLog
CommitLineData
eb095650
PE
12006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2 and Paul Eggert <eggert@cs.ucla.edu>
3
4 Don't let Bison leak memory except when it complains.
5 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6 (spec_defines_file, dir_prefix): Now char *, not const char *,
7 since they are freed.
8 * src/files.c: Likewise.
9 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
10 Likewise.
11 (tr): Now operates in-place. All uses changed.
12 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
13 values.
14 (compute_file_name_parts, compute_output_file_names): Don't store
15 read-only data in variables that will be freed.
16 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
17 src_extension, and header_extension.
18 (output_file_names_free): New public function to free
19 spec_verbose_file, spec_graph_file, spec_defines_file,
20 parser_file_name, and dir_prefix.
21 * src/getargs.c (getargs): Don't store read-only data in variables that
22 will be freed.
23 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
24 (which previously existed but was unused), and quotearg_free.
25 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
26 * src/muscle_tab.c: Likewise.
27 (muscle_entry): Make the value char const *,
28 and add a new storage member that is char * and can be freed.
29 (muscle_entry_free): New private function.
30 (muscle_init): Use it instead of free.
31 (muscle_insert, muscle_grow): Update and use new storage member.
32 (muscle_code_grow): Free the string passed to muscle_grow
33 since it's not needed anymore.
34 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
35 add a new `char *code' member.
36 ("{...}"): Declare semantic type as code.
37 * src/scan-code.h (translate_rule_action):
38 (translate_symbol_action, translate_code, translate_action): Return
39 `char const *' rather than `char *' since external code should not free
40 these strings.
41 * src/scan-code.l: Likewise.
42 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
43 which is "{...}" in the parser.
44 * tests/Makefile.am (maintainer-check-valgrind): Set
45 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
46 Valgrind.
47 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
48 complain.
49 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
50 expecting a non-zero exit status sets --leak-check=summary and
51 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
52 this case, and we don't want to hear about it.
53
ac564be4
PE
542006-11-08 Paul Eggert <eggert@cs.ucla.edu>
55
56 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
57 instead of from the template, to simplify configuration a bit.
58 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
59 and m4/wint_t.m4, as they are needed with the latest gnulib.
60
17bd8a73
JD
612006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
62
63 Disable unset/unused mid-rule value warnings by default, and recognize
64 --warnings=midrule-values to enable them. Discussed starting at
65 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
66 * NEWS (2.3a+): Mention.
67 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
68 warnings): Add entry for midrule-values subargument.
69 * src/reader.c (symbol_should_be_used): Don't return true just because
70 the value is a set/used mid-rule value unless
71 --warnings=midrule-values was specified.
72 * tests/input.at (Unused values, Unused values before symbol
73 declarations): Run tests with and without --warnings=midrule-values.
74
75 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
76 than LIST_FREE directly.
77
89eb3c76
JD
782006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
79
80 Finish implementing --warnings=error, which should not be implied by
81 --warnings=all (or by its synonyms -W and --warnings without
82 subarguments).
83 * src/complain.c (set_warning_issued): New function to report that
84 warnings are being treated as errors and to record an error if so.
85 Invoke...
86 (warn_at, warn): ... here.
87 * src/getargs.c (warnings_args, warnings_types): Reorder so that
88 "error - warnings are errors" does not appear above "all - all of the
89 above".
90 (getargs): For -W and --warnings without subarguments, don't let
91 FLAGS_ARGMATCH set warnings_error in warnings_flag.
92 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
93
ba7560e2
JD
942006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
95
96 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
97 empty subargument list. For example: `bison --warnings= parser.y'.
98
31283fc3
JD
992006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
100
101 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
102 the parser header file so that gcc doesn't warn.
103
12e35840
JD
1042006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
105
106 Split the default %destructor/%printer into two kinds: <*> and <!>.
107 Discussed starting at
108 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
109 * NEWS (2.3a+): Mention.
110 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
111 previous change today related to mid-rules.
112 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
113 * src/parser-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
114 (TYPE_TAG_ANY): Add as <*>.
115 (TYPE_TAG_NONE): Add as <!>.
116 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
117 for <*> and <!>.
118 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
119 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
120 * src/symlist.c (symbol_list_default_new): Split into tagged and
121 tagless versions.
122 (symbol_list_destructor_set, symbol_list_printer_set): Split
123 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
124 SYMLIST_DEFAULT_TAGLESS.
125 * src/symlist.h: Update symbol_list_default*_new prototypes.
126 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
127 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
128 * src/symtab.c (default_destructor, default_destructor_location,
129 default_printer, default_printer_location): Split each into tagged and
130 tagless versions.
131 (symbol_destructor_get, symbol_destructor_location_get,
132 symbol_printer_get, symbol_printer_location_get): Implement tagged
133 default and tagless default cases.
134 (default_destructor_set, default_printer_set): Split each into tagged
135 and tagless versions.
136 * src/symtab.h: Update prototypes.
137 * tests/actions.at (Default %printer and %destructor): Rename to...
138 (Default tagless %printer and %destructor): ... this, and extend.
139 (Per-type %printer and %destructor): Rename to...
140 (Default tagged and per-type %printer and %destructor): ... this, and
141 extend.
142 (Default %printer and %destructor for user-defined end token): Extend.
143 (Default %printer and %destructor are not for error or $undefined):
144 Update.
145 (Default %printer and %destructor are not for $accept): Update.
146 (Default %printer and %destructor for mid-rule values): Extend.
147 * tests/input.at (Default %printer and %destructor redeclared): Extend.
148 (Unused values with default %destructor): Extend.
149
f91b1629
JD
1502006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
151
152 Don't apply the default %destructor/%printer to an unreferenced midrule
153 value. Mentioned at
154 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
155 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
156 like $@n instead of just @n so that the default %destructor/%printer
157 logic doesn't see them as user-defined symbols.
158 (symbol_is_dummy): Check for both forms of the name.
159 * src/reader.c (packgram): Remove the `$' from each midrule symbol
160 name for which the midrule value is referenced in any action.
161 * tests/actions.at (Default %printer and %destructor for mid-rule
162 values): New test.
163 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
164 for change to dummy symbol names.
165
519d0004
JD
1662006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
167
168 Warn about unset midrule $$ if the corresponding $n is used.
169 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
170 $n usage.
171 (packgram): Before invoking grammar_rule_check on any rule, make sure
172 all actions have already been scanned in order to set `used' flags.
173 Otherwise, checking that a midrule's $$ is set will not always work
174 properly because the midrule check must forward-reference the midrule's
175 parent rule.
176 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
177 warning.
178
a501eca9
JD
1792006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
180
181 More improvements to the documentation of the prologue alternatives:
182 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
183 Bison manual.
184 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
185 some text to clarify the relative importance of the new directives and
186 to show how these directives may be viewed as code labels.
187
2cbe6b7f
JD
1882006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
189
190 Similar to the recently removed %before-header, add %code-top as the
191 alternative to the pre-prologue. Mentioned at
192 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
193 Also, let the prologue alternatives appear in the grammar section.
194 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
195 (prologue_declaration): Move the existing prologue alternatives to...
196 (grammar_declaration): ... here and add %code-top.
197 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
198
199 Clean up and extend documentation for the prologue alternatives.
200 * NEWS (2.3a+): Describe prologue alternatives.
201 * doc/bison.texinfo (Prologue): Move discussion of prologue
202 alternatives to...
203 (Prologue Alternatives): ... this new section, and extend it to discuss
204 all 4 directives in detail.
205 (Bison Symbols): Clean up discussion of prologue alternatives and add
206 %code-top.
207
e557d3ea
JMG
2082006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
209
210 DJGPP specific issues.
211
212 * djgpp/config.bat: config.hin has been moved to lib. Adjust
213 config.bat accordingly.
214 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
215 * djgpp/config.site: Likewise.
216
136a0f76
PB
2172006-10-16 Paolo Bonzini <bonzini@gnu.org>
218
27bd5d67
PB
219 Replace %*-header with %provides, %requires, %code. See discussion at
220 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
221
136a0f76
PB
222 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
223 (b4_user_start_header): Remove.
224 * data/glr.c: Use new macros instead of b4_*start_header
225 and b4_*end_header.
226 * data/glr.cc: Likewise.
227 * data/lalr1.cc: Likewise.
228 * data/push.c: Likewise.
229 * data/yacc.c: Likewise.
230
231 * doc/bison.texinfo: Remove %before-header, rename
232 %{start,end,after}-header to %requires, %provides, %code.
233
234 * src/parse-gram.y: Likewise (also rename token names accordingly).
235 * src/scan-gram.l: Likewise.
236 * tests/actions.at: Likewise.
237
10f429ef
PE
2382006-10-14 Paul Eggert <eggert@cs.ucla.edu>
239
240 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
241 Problem reported by Joel E. Denny.
242
2432006-10-14 Jim Meyering <jim@meyering.net>
244
245 (Sync from coreutils.)
246 Work also when the working directory (with e.g. coreutils sources)
247 is version controlled with git, rather than CVS.
248 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
249 rather than CVS.
250 In messages and comments, say e.g., "checked-out sources",
251 rather than "CVS sources".
252 (version_controlled_file): New function. Work for git as well as
253 for CVS. Don't use grep's -q option.
254 (slurp): Call it here, in place of CVS-specific code.
255
c4bd5bf7
JD
2562006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
257
258 Fix testsuite for ./configure --enable-gcc-warnings:
259 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
260 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
261 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
262 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
263 * test/regression.at (Diagnostic that expects two alternatives):
264 Likewise.
265
46356ea4
PE
2662006-10-12 Paul Eggert <eggert@cs.ucla.edu>
267
231ed89a
PE
268 * bootstrap.conf (gnulib_modules): Add config-h.
269 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
270 worry about HAVE_CONFIG_H.
271 * lib/abitset.c: Likewise.
272 * lib/bitset.c: Likewise.
273 * lib/bitset_stats.c: Likewise.
274 * lib/bitsetv-print.c: Likewise.
275 * lib/bitsetv.c: Likewise.
276 * lib/ebitset.c: Likewise.
277 * lib/get-errno.c: Likewise.
278 * lib/lbitset.c: Likewise.
279 * lib/subpipe.c: Likewise.
280 * lib/timevar.c: Likewise.
281 * lib/vbitset.c: Likewise.
282 * lib/bitset.c: Include "bitset.h" first, to test interface.
283 * lib/bitset_stats.c: Include "bitset_stats.h" first.
284 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
285 * lib/bitsetv.c: Include "bitsetv.h" first.
286 * lib/get-errno.c: Include "get-errno.h" first.
287 * m4/.cvsignore: Add config-h.m4.
288 * tests/actions.at (Default %printer and %destructor for ...):
289 Adjust expected line numbers in output to reflect removal of #if
290 HAVE_CONFIG_H lines.
291 * tests/glr-regression.at (Missed %merge type warnings when ...):
292 Likewise.
293 * tests/regression.at (Braced code in declaration in rules section):
294 Likewise.
295 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
296 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
297 Include <config.h> unconditionally.
298
46356ea4
PE
299 * bootstrap: Sync from coreutils, as follows:
300
301 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
302
303 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
304 variable was sometimes used without being initialized. This
305 messed up the installation of the INSTALL file in some cases.
306
307 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
308
309 * bootstrap (usage, main program, symlink_to_gnulib): Add option
310 --copy. Inspired by a suggestion from Bruno Haible.
311
312 2006-10-03 Jim Meyering <jim@meyering.net>
313
314 * bootstrap: Undo last change to this file, since now gnulib-tool
315 sticks with the automake default in generating dependencies.
316
dd4bf078
PE
3172006-10-12 Paul Eggert <eggert@cs.ucla.edu>
318
cf2a5f7c
PE
319 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
320 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
321
322 * doc/bison.1: Add copyright notice.
323
324 * data/glr.c: Don't include <stdarg.h>; not used.
325
35fe0834
PE
326 * NEWS: The -g and --graph options now output graphs in Graphviz
327 DOT format, not VCG format.
328 * doc/bison.1: Likewise.
329 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
330 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
331 of this change in
332 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
333 * TODO: Remove Graphviz entry.
334 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
335 remove vcg.c, vcg.h, vcg_defaults.h.
336 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
337 * src/graphviz.c, src/graphviz.h: New files.
338 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
339 * src/files.h: Make comment more generic.
340 * src/main.c (main): Likewise.
341 * src/print_graph.h: Likewise.
342 * src/getargs.c (usage): Make usage description more generic.
343 * src/print_graph.c: Include graphviz.h rather than vcg.h.
344 (static_graph, fgraph): Remove. All uses changed to pass
345 arguments instead of sharing a static var.
346 (print_core, print_actions, print_state, print_graph):
347 Output graphviz format rather than VCG format.
348 * tests/.cvsignore: Remove *.vcg; add *.dot.
349 * tests/output.at: Expect *.dot files, not *.vcg files.
350
dd4bf078
PE
351 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
352 accommodates the 2006-10-08 change.
353
efdd7421
PE
3542006-10-11 Bob Rossi <bob@brasko.net>
355
356 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
357 (b4_yyssa, b4_yyerror_range): New macros.
358 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
359 (yypvarsinit): Remove init of removed fields.
360 (yypushparse): Remove use of removed fields; use new macros instead.
361
96a1981a
PE
3622006-10-11 Paul Eggert <eggert@cs.ucla.edu>
363
364 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
365 in a push parser. Reindent slightly to match yacc.c better.
366
3672006-10-11 Bob Rossi <bob@brasko.net>
368
46356ea4
PE
369 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
370 yymsg_alloc fields.
371 (yypvarsinit, yypushparse): Remove init of removed fields.
372 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 373
c1630a8b
PE
3742006-10-09 Paul Eggert <eggert@cs.ucla.edu>
375
376 * THANKS: Add Paolo Bonzini and Bob Rossi.
377
90b9908d
PB
3782006-10-08 Paolo Bonzini <bonzini@gnu.org>
379
380 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
381 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
382 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
383 b4_define_user_cde and uses): Remove.
384 (b4_comment, b4_prefix, b4_sync_start): New.
385 * data/bison.m4: New file, with most of the content removed from c.m4.
386 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
387 * src/output.c (output_skeleton): Pass bison.m4.
388 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
389 only if specified.
390
cf806753
PE
3912006-10-05 Paul Eggert <eggert@cs.ucla.edu>
392
393 Fix test failure reported by Tom Lane in
394 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
395 and try to make such failures easier to catch in the future.
396 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
397 that's now the caller's responsibility.
398 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
399 Set yychar = YYEOF if it's negative.
400 * tests/actions.at (yylex): Abort if asked to read past EOF.
401 * tests/conflicts.at (yylex): Likewise.
402 * tests/cxx-type.at (yylex): Likewise.
403 * tests/glr-regression.at (yylex): Likewise.
404 * tests/input.at (yylex): Likewise.
405 * tests/regression.at (yylex): Likewise.
406 * tests/torture.at (yylex): Likewise.
407
0e2f006a
PE
4082006-10-01 Paul Eggert <eggert@cs.ucla.edu>
409
410 Fix problems with translating English-language diagnostics.
411 * bootstrap: Fix bug introduced in recent bootstrap changes, with
412 respect to bison-runtime pot generation. The YY_ stuff
413 wasn't being captured.
414 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
415 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
416 * runtime-po/POTFILES.in: Add data/push.c.
417
e3ddc1e3
PE
4182006-09-29 Paul Eggert <eggert@cs.ucla.edu>
419
420 Merge bootstrap changes from coreutils.
421
422 2006-09-28 Jim Meyering <jim@meyering.net>
423
424 Automatically generated dependencies are important even
425 when all of the sources in a directory come from gnulib.
426 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
427 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
428
429 2006-09-23 Jim Meyering <jim@meyering.net>
430
431 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
432
433 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
434
435 * bootstrap: Add support for --force.
436 (usage): New function. Describe usage less tersely.
437 (CVS_only_file): New var.
438
01e972b3
PE
4392006-09-21 Paul Eggert <eggert@cs.ucla.edu>
440
441 * data/push.c (YYPUSH_MORE): Make it an enum instead.
442 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
443 Adjust white space and comments to match GNU style better.
444
c63d3e90
PE
4452006-09-20 Bob Rossi <bob@brasko.net>
446
447 * data/push.c (yyresult_get): Remove function.
448 (YYPUSH_MORE): Add #define.
449 (yypushparse): Modify return value.
450
e70f46d1
PE
4512006-09-20 Paul Eggert <eggert@cs.ucla.edu>
452
453 * stamp-h.in: Remove; no longer needed.
454 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
455 Remove config.h, config.hin, intl (no longer created).
456 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
457 stamp-h1.
458
459 Sync bootstrap from coreutils, as follows:
460
461 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
462
463 * bootstrap (symlink_to_gnulib): New function.
464 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
465 to copies-of-gnulib.
466 (cp_mark_as_generated, slurp, gnulib_files):
467 Avoid making a copy if it's the same as the old version.
468 (gnulib_files): Add support for this variable (used by Bison).
469
a92be413
PE
4702006-09-20 Paul Eggert <eggert@cs.ucla.edu>
471
472 * src/getargs.c (usage): Rework to use conventions similar to
473 coreutils, to make translation a bit easier and the code a bit
474 smaller. Problem reported by Tim Van Holder.
475
4f82b42a
PE
4762006-09-15 Paul Eggert <eggert@cs.ucla.edu>
477
3b2942e6
PE
478 Use some of gnulib's new modules, taken from coreutils.
479
480 * bootstrap: Sync from coreutils, except add support for gnulib_files.
481 * bootstrap.conf: New file.
482 (gnulib_modules): Add configmake, inttypes, unistd.
483 (XGETTEXT_OPTIONS): Add complain, complain_at,
484 fatal, fatal_at, warn, warn_at, unexpected_end.
485 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
486 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
487 (gl_EARLY): Add.
488 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
489 (gl_INIT): Add
490 (GNULIB_AUTOCONF_SNIPPET): Remove.
491 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
492 the pickiest.
493 * lib/.cvsignore: Add inttypes_.h.
494 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
495 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
496 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
497 no-longer-necessary initializations.
498 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
499 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
500 use the unistd module.
501 * src/system.h: Likewise.
502 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
503 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
504 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
505 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
506 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
507 * src/system.h: Include inttypes.h unconditionally, now that we
508 use the inttypes module. Don't bother to include stdint.h, since
509 inttypes.h now does that for us.
510 (LOCALEDIR): Remove, now that we use the configmake module.
511 * src/getargs.c: Include configmake.h.
512 * src/main.c: Likewise.
513 * src/output.c: Likewise.
514 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
515 not from $abs_top_builddir, since config.h moved.
516
517
4f82b42a
PE
518 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
519 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
520
521 * src/parse-gram.y (symbol_declaration): Don't put statements
522 before declarations; it's not portable to C89.
523 * src/scan-code.l (handle_action_at): Likewise.
524
525 * src/scan-code.l: Always initialize braces_level; the old code
526 left it uninitialized and therefore had undefined behavior.
527
528 Don't attempt to redefine 'assert', since it runs afoul of
529 systems where standard headers (mistakenly) include <assert.h>.
530 Instead, define and use our own alternative, called 'aver'.
531 * src/reader.c: Don't include assert.h, since we no longer
532 use assert.
533 * src/scan-code.l: Likewise.
534 * src/system.h (assert): Remove, replacing with....
535 (aver): New function, taking a bool arg. All uses changed.
536 * src/tables.c (pack_vector): Ensure that aver arg is bool,
537 not merely an integer.
538
31c10e38
PE
5392006-09-15 Bob Rossi <bob@brasko.net>
540
541 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
542 * data/c.m4 (YYPUSH): New.
543 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
544 * src/getargs.c (push_parser): New var.
545 * src/getargs.h (push_parser): New declaration.
546 * src/output.c (prepare): Add macro insertion of `push_flag'.
547 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
548 (prologue_declaration): Parse %push-parser.
549 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
550 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
551 list of removed lines from the traces observed.
552 (AT_CHECK_CALC_LALR): Added push parser tests.
553
fa7b79c0
PE
5542006-09-13 Paul Eggert <eggert@cs.ucla.edu>
555
21fe08ca
PE
556 * NEWS: Version 2.3a.
557 * configure.ac (AC_INIT): Likewise.
558
e8ec4d9b
PE
559 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
560 "#define YYSTYPE int" that caused "make maintainer-check" to fail
561 due to header ordering dependencies. I don't know why the #define
562 was there.
563
fa7b79c0
PE
564 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
565 runtime cost when YYDEBUG is not defined, and so that some tests
566 that used to fail now work. Problem and initial suggestion by
567 Paolo Bonzini.
568 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
569 * data/glr.cc (b4_parser_class_name):
570 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
571 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
572 (yydebug_) [YYDEBUG]: New member.
573 (yycdebug_): Now defined only if YYDEBUG.
574 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
575 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
576 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
577 if YYYDEBUG.
578 (debug_stream, set_debug_stream, debug_level, set_debug_level):
579 Define only if YYDEBUG.
580 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
581 set_debug_level.
582 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
583 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
584 AT_CHECK_CALC_GLR_CC that are working now.
585
4ec13d60
PE
5862006-09-12 Paul Eggert <eggert@cs.ucla.edu>
587
588 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
589 We don't need them in glr.cc, and glr.c defines them.
590 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
591 assumes that defining it to anything is the same as defining
592 it to 1. Problem reported by Paolo Bonzini.
593
8e1687ae
PE
5942006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
595
596 * data/c.m4 (b4_null, b4_case): Define.
597 * src/output.c (prepare_symbols): Use b4_null.
598 (user_actions_output): Use b4_case.
599
3dc5e96b
PE
6002006-09-11 Paul Eggert <eggert@cs.ucla.edu>
601
aef3da86
PE
602 * data/glr.c (b4_shared_declarations): Put start-header first,
603 before any #includes that we generate, so that feature-test
604 macros work. Problem reported by Michael Deutschmann in
605 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
606 * data/lalr1.cc: Likewise.
607 * doc/bison.texinfo (Prologue): Document that feature-test macros
608 should be defined before any Bison declarations.
609 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
610 that depend on location.hh after, not before, Bison decls, since
611 we now include location.hh after the first user prologue.
612
3dc5e96b
PE
613 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
614 Sander Brandenburg in
615 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
616 Also, fix minor white space and comment issues.
aef3da86
PE
617 (Prologue): Mention that it's better to define feature-test macros
618 before Bison declarations. Problem reported by Michael Deutschmann.
619
620 * README-cvs: Fix typo: "&" should be "&&". Problem reported
621 by Jim Meyering.
622 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
623 This adjusts to recent gnulib changes.
3dc5e96b 624
b2a0b7ca
JD
6252006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
626
627 Finish implementation of per-type %destructor/%printer. Discussed
628 starting at
629 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
630 and
631 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
632 * NEWS (2.3+): Add a description of this feature to the default
633 %destructor/%printer description.
634 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
635 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
636 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
637 list node contains a semantic type.
638 * src/symtab.c, src/symtab.h: Extend with a table that associates
639 semantic types with their %destructor's and %printer's.
640 (semantic_type_from_uniqstr, semantic_type_get,
641 semantic_type_destructor_set, semantic_type_printer_set): New functions
642 composing the public interface of that table.
643 (symbol_destructor_get, symbol_destructor_location_get,
644 symbol_printer_get, symbol_printer_location_get): If there's no
645 per-symbol %destructor/%printer, look up the per-type before trying
646 the default.
647 * tests/actions.at (Per-type %printer and %destructor): New test case.
648 * tests/input.at (Default %printer and %destructor redeclared):
649 Extend to check that multiple occurrences of %symbol-default in a
650 single %destructor/%printer declaration is an error.
651 (Per-type %printer and %destructor redeclared, Unused values with
652 per-type %destructor): New test cases.
653
3be03b13
JD
6542006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
655
656 Require default %destructor/%printer to be declared using
657 %symbol-default instead of an empty symbol list, and start working on
658 new per-type %destructor/%printer. Discussed at
659 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
660 * NEWS (2.3+): Add %symbol-default to example.
661 * bison.texinfo (Freeing Discarded Symbols): Likewise.
662 (Bison Symbols): Add entry for %symbol-default.
663 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
664 (generic_symlist, generic_symlist_item): New nonterminals for creating
665 a list in which each item is a symbol, semantic type, or
666 %symbol-default.
667 (grammar_declaration): Use generic_symlist in %destructor and %printer
668 declarations instead of symbols.1 or an empty list.
669 (symbol_declaration, precedence_declaration, symbols.1): Update actions
670 for changes to symbol_list.
671 * src/reader.c: Update for changes to symbol_list.
672 * src/scan-code.l: Likewise.
673 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
674 * src/symlist.c, src/symlist.h: Extend such that a list node may
675 represent a semantic type or a %symbol-default in addition to just an
676 ordinary symbol. Add switched functions for setting %destructor's and
677 %printer's.
678 * tests/actions.at, tests/input.at: Add %symbol-default to all default
679 %destructor/%printer declarations.
680
3508ce36
JD
6812006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
682
683 Whether the default %destructor/%printer applies to a particular symbol
684 isn't a question of whether the user *declares* that symbol (in %token,
685 for example). It's a question of whether the user by any means
686 *defines* the symbol at all (by simply using a char token, for
687 example). $end is defined by Bison whereas any other token with token
688 number 0 is defined by the user. The error token is always defined by
689 Bison regardless of whether the user declares it with %token, but we
690 may one day let the user define error as a nonterminal instead.
691 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
692 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
693 the meaning of "user-defined".
694 * tests/actions.at (Default %printer and %destructor for user-declared
695 end token): Rename to...
696 (Default %printer and %destructor for user-defined end token): ...
697 this.
698
699 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
700 computation of whether to apply the default, don't maintain a list of
701 every Bison-defined symbol. Instead, just check for a first character
702 of '$', which a user symbol cannot have, and check for the error token.
703
9350499c
JD
7042006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
705
706 Don't apply the default %destructor or %printer to the error token,
707 $undefined, or $accept. This change fits the general rule that the
708 default %destructor and %printer are only for user-declared symbols,
709 and it solves several difficulties that are described in the new test
710 cases listed below.
711 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
712 * tests/actions.at (Default %printer and %destructor are not for error
713 or $undefined, Default %printer and %destructor are not for $accept):
714 New test cases.
715
4d7370cb
JD
7162006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
717
718 Allow %start after the first rule.
719 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
720 when parsing the first rule.
721 (check_and_convert_grammar): Search for it here after all grammar
722 declarations have been parsed. Skip midrules, which have dummy LHS
723 nonterminals.
724 * src/symtab.c (symbol_is_dummy): New function.
725 * src/symtab.h (symbol_is_dummy): Declare it.
726 * tests/input.at (%start after first rule): New test.
727
6d0ef4ec
JD
7282006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
729
730 Redo some of the previous commit: add back the ability to use
731 non-aliased/undeclared string literals since it might be useful to
732 those declaring %token-table.
733 * src/reader.c (check_and_convert_grammar): Undo changes in previous
734 commit: don't worry about complaints from symbols_pack.
735 * src/symtab.c (symbol_new, symbol_class_set,
736 symbol_check_alias_consistency): Undo changes in previous commit: count
737 each string literal as a new symbol and token, assign it a symbol
738 number, and don't complain about non-aliased string literals.
739 (symbols_pack): Since symbol_make_alias still does not decrement symbol
740 and token counts but does still set aliased tokens to the same number,
741 symbol_pack_processor now leaves empty slots in the symbols array.
742 Remove those slots.
743 * tests/regression.at (Undeclared string literal): Remove test case
744 added in previous commit since non-aliased string literals are allowed
745 again.
746 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
747 remove unnecessary string literal declarations.
748 * tests/sets.at (Firsts): Likewise.
749
965537bc
JD
7502006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
751
752 Don't allow an undeclared string literal, but allow a string literal to
753 be used before its declaration.
754 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
755 symbols_pack complained.
756 * src/symtab.c (symbol_new): Don't count a string literal as a new
757 symbol.
758 (symbol_class_set): Don't count a string literal as a new token, and
759 don't assign it a symbol number since symbol_make_alias does that.
760 (symbol_make_alias): It's not necessary to decrement the symbol and
761 token counts anymore. Don't assume that an alias declaration occurs
762 before any uses of the identifier or string, and thus don't assert that
763 one of them has the highest symbol number so far.
764 (symbol_check_alias_consistency): Complain if there's a string literal
765 that wasn't declared as an alias.
766 (symbols_pack): Bail if symbol_check_alias_consistency failed since
767 symbol_pack asserts that every token has been assigned a symbol number
768 although undeclared string literals have not.
769 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 770 string literal): New test cases.
965537bc
JD
771 (Characters Escapes, Web2c Actions): Declare string literals as
772 aliases.
773 * tests/sets.at (Firsts): Likewise.
774
47aee066
JD
7752006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
776
777 In the grammar scanner, STRING_FINISH unclosed constructs and return
778 them to the parser in order to improve error messages.
779 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
780 SC_BRACED_CODE, SC_PROLOGUE): Implement.
781 * tests/input.at (Unclosed constructs): New test case.
782 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
783 seen.
784
785 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
786 unused global.
787
1f6b3679
JD
7882006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
789
790 Handle string aliases for character tokens correctly.
791 * src/symtab.c (symbol_user_token_number_set): If the token has an
792 alias, check and set its alias's user token number instead of its own,
793 which is set to indicate the alias. Previously, every occurrence of
794 the character token in the grammar overwrote that alias indicator with
795 the character code.
796 * tests/input.at (String aliases for character tokens): New test.
797
219741d8
JD
7982006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
799
800 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
801
11daa4e7
PE
8022006-08-11 Paul Eggert <eggert@cs.ucla.edu>
803
804 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
805 to prevent failures when building on older platforms.
806 Check for autopoint failure.
807 Set XGETTEXT_OPTIONS to values that check for C format strings,
808 so that translators are warned about them (this also helps
809 prevent core dumps).
810
811 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
812 function, since it simplifies our code a bit.
813
814 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
815 rather than -W, so we don't get bogus warnings about sign comparisons.
816 Add -Wpointer-arith, since that warning is useful (it reports code
817 that does not conform to C89 and that some compilers reject).
818 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
819 since it's no longer needed.
820
f9bfc42a
JD
8212006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
822
823 Clean up scanners a bit.
824 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
825 definitions so gcc won't warn when obstack_for_string is unused.
826 * src/scan-code.l: config.h and system.h are already #include'd by
827 scan-code-c.c, so get rid of them here.
828 * src/scan-gram.l: Likewise.
829 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
830 definitions rather than duplicating the rest of it.
831 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
832
06e8700a
JD
8332006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
834
835 Suppress signed/unsigned comparison warnings for yycheck.
836 * data/c.m4 (b4_safest_int_type): New macro.
837 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
838 a signed int type, cast it to b4_safest_int_type first.
839 * data/yacc.c: Likewise.
840 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
841 also overwritten.
842
9c437126
PE
8432006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
844
845 * doc/bison.texinfo: Fix some typos.
846
284d8a13
PE
8472006-08-02 Paul Eggert <eggert@cs.ucla.edu>
848
849 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
850 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
851
852 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
853 the latest gnulib does this a different way.
854 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
855 translation was patched, so stop omitting it.
856
ec5479ce
JD
8572006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
858
859 Enable declaration of default %printer/%destructor. Make the parser
860 use these for all user-declared grammar symbols for which the user does
861 not declare a specific %printer/%destructor. Thus, the parser uses it
862 for token 0 if the user declares it but not if Bison generates it as
863 $end. Discussed starting at
864 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
865 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
866 and
867 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
868 * NEWS (2.3+): Mention.
869 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
870 declare a %destructor for a mid-rule's semantic value. It's just
871 impossible to declare one specific to it.
872 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
873 code. Describe default %destructor form.
874 * src/parse-gram.y (grammar_declaration): Parse default
875 %printer/%destructor declarations.
876 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
877 and symbol_destructor_location_get rather than accessing the destructor
878 and destructor_location members of struct symbol.
879 (symbol_printers_output): Likewise but for %printer's.
880 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
881 again.
882 * src/symtab.c (default_destructor, default_destructor_location,
883 default_printer, default_printer_location): New static global
884 variables to record the default %destructor and %printer.
885 (symbol_destructor_get, symbol_destructor_location_get,
886 symbol_printer_get, symbol_printer_location_get): New functions to
887 compute the appropriate %destructor and %printer for a symbol.
888 (default_destructor_set, default_printer_set): New functions to set the
889 default %destructor and %printer.
890 * src/symtab.h: Prototype all those new functions.
891 * tests/actions.at (Default %printer and %destructor): New test to
892 check that the right %printer and %destructor are called, that they're
893 not called for $end, and that $$ and @$ work correctly.
894 (Default %printer and %destructor for user-declared end token): New
895 test to check that the default %printer and %destructor are called for
896 a user-declared end token.
897 * tests/input.at (Default %printer and %destructor redeclared, Unused
898 values with default %destructor): New tests to check related grammar
899 warnings and errors.
900
868d2d96
JD
9012006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
902
903 Clean up handling of %destructor for the end token (token 0).
904 Discussed starting at
905 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
906 and
907 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
908
909 Make the skeletons consistent in how they pop the end token and invoke
910 its %destructor.
911 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
912 state, which has token number 0, since this would invoke the
913 %destructor for the end token.
914 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
915 until after shifting the end token, or else it won't be popped.
916 * data/yacc.c (yyparse): Likewise.
917
918 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
919 it's the end token. Upon termination, destroy an unshifted lookahead
920 even when it's the end token.
921 * data/lalr1.cc (yy::parser::parse): Likewise.
922 * data/yacc.c (yyparse): Likewise.
923
924 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
925 value warnings for the end token when the user gives the end token a
926 %destructor.
927
928 * tests/actions.at (Printers and Destructors): Test all the above.
929
62a9592d
PE
9302006-07-24 Paul Eggert <eggert@cs.ucla.edu>
931
932 Update to latest gnulib and gettext versions.
933 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
934 Add fopen-safer.
935 (gnulib_files): Add m4/warning.m4. Don't worry about files
936 overwritten by autopoint.
937 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
938 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
939 rejects them.
940 Don't use autoreconf; instead, invoke autopoint etc. by hand,
941 so that we can remove the intl files at a better time.
942 (intl_files_to_remove): Remove aclocal.m4, since it gets
943 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
944 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
945 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
946 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
947 Remove datarootdir hack; no longer needed.
948 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
949 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
950 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
951 strdup.h.
952 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
953 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
954
10d6970f
PE
9552006-07-20 Paul Eggert <eggert@cs.ucla.edu>
956
957 * bootstrap: Adjust to today's change to gnulib-tool by invoking
958 it with --assume-autoconf='latest-stable'.
959
50a33993
JD
9602006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
961
962 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
963 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
964 YYSTYPE' and `{'.
965 * src/muscle_tab.h (muscle_grow): Replace the header comments with
966 those from muscle_tab.c since the old ones are misleading.
967
2ce4ed68
AD
9682006-07-13 Akim Demaille <akim@epita.fr>
969
970 Support %define "KEY" {VALUE}.
971 * src/scan-code.h, src/scan-code.l (translate_action)
972 (translate_rule_action, translate_symbol_action, translate_code):
973 Return char *, not const char *.
974 * src/parse-gram.y (declaration): Rename as...
975 (prologue_declaration): this.
976 (string_content): Remove this nonterminal, use STRING.
977 (braceless, content, content.opt): New nonterminal.
978 Use them.
979 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
980 as value.
981 * src/scan-gram.l (getargs.h): Don't include it.
982
db7e5eb5
PE
9832006-07-12 Paul Eggert <eggert@cs.ucla.edu>
984
985 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
986 rather than a for-loop that declares a local bool variable. This
987 should work around a compatibility problem with a Cray x1e C++
988 compiler reported by Hung Nguyen in
989 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
990 The for-loop was introduced in the 2004-11-17 change but I don't
991 know why it was needed.
992
a5d80ba5
AD
9932006-07-12 Akim Demaille <akim@epita.fr>
994
995 * data/c.m4: Comment changes.
996
23eb2a69
AD
9972006-07-10 Akim Demaille <akim@lrde.epita.fr>
998
999 * src/complain.c (error_message, ERROR_MESSAGE): New.
1000 To factor...
1001 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1002 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1003
ddc8ede1
PE
10042006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1005
1006 * NEWS: Instead of %union, you can define and use your own union type
1007 YYSTYPE if your grammar contains at least one <type> tag.
1008 Your YYSTYPE need not be a macro; it can be a typedef.
1009 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1010 (Union Decl, Decl Summary): Document this.
1011 * data/glr.c (YYSTYPE): Implement this.
1012 * data/glr.cc (YYSTYPE): Likewise.
1013 * data/lalr1.cc (YYSTYPE): Likewise.
1014 * data/yacc.c (YYSTYPE): Likewise.
1015 * src/output.c (prepare): Output tag_seen_flag.
1016 * src/parse-gram.y (declaration, grammar_declaration):
1017 Use 'union_seen' rather than 'typed' to determine whether
1018 %union has been seen, since grammars can now be typed without
1019 %union.
1020 (symbol_declaration, type.opt, symbol_def):
1021 Keep track of whether a tag has been seen.
1022 * src/reader.c (union_seen, tag_seen): New vars.
1023 (typed): remove.
1024 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1025 * src/scan-code.l (untyped_var_seen): New variable.
1026 (handle_action_dollar): Adjust to above changes.
1027 (handle_action_dollar, handle_action_at):
1028 Improve overflow checking for outlandish numbers.
1029 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1030 avoid new diagnostics generated by above changes.
1031 * tests/regression.at (YYSTYPE typedef): Add test to check
1032 for type tags without %union.
1033
1034 * src/symlist.c (symbol_list_length): Return int, not unsigned
1035 int, since callers expect int. This may need to get revisited
1036 once we have proper integer overflow checking.
1037
1038 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1039 object is now static.
1040
1041 * src/getargs.c (flags_argmatch): Return void, not int,
1042 to pacify ./configure --enable-gcc-warnings.
1043
1044 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1045 since last_string is already defined to FLEX_PREFIX (last_string).
1046
7b42569e
AD
10472006-07-09 Akim Demaille <akim@lrde.epita.fr>
1048
1049 Implement --warnings/-W.
1050 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1051 replaced by...
1052 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1053 Adjust callers.
1054 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1055 (warnings_args, warnings_types): New.
1056 (getargs, short_options, long_options): Accept -W/--warnings.
1057 Sort the options by alphabetical order, upper case letter right
1058 before its lower case.
1059
3b452f4e
JD
10602006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1061
1062 Change %merge result type clash warnings to errors. Discussed at
1063 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1064 * src/reader.c (record_merge_function_type): Use complain_at.
1065 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1066 declared later): Update test case results.
1067
b8a41559
AD
10682006-07-09 Akim Demaille <akim@lrde.epita.fr>
1069
1070 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1071 to be in alphabetical order.
1072 (trace_args): Spelling fixes.
1073
cd9e1ba2
PE
10742006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1075
1076 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1077 so they don't collide with user-defined macros.
1078 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1079 this was never guaranteed, and now that we're using gnulib stdint,
1080 which defines int_fast16_t to long int, the problem is exposed.
1081
cb48f191
PE
10822006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1083
b8445a15
PE
1084 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1085 need the full POSIX semantics (and weren't implementing them
1086 anyway).
1087
cb48f191
PE
1088 Adjust to Autoconf 2.60 and today's gnulib.
1089 * bootstrap (gnulib_modules): Add stdint.
1090 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1091 no longer copies it.
1092 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1093 since stdint needs the former and wcwidth (which is now required
1094 by mbswidth) needs the latter.
1095 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1096 work around a compatibility glitch between gettext 0.14.6 and
1097 Autoconf 2.60.
1098 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1099 Do not check for uintptr_t, since new stdint module does the right
1100 thing.
1101 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1102 Add stdint.h, stdint_.h, wcwidth.h.
1103 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1104 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1105 stdint.m4, wchar_t.m4, wcwidth.m4.
1106 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1107 usual order for ../lib/*.h files.
1108 (file_name_split): Use last_component, not base_name, to adjust
1109 to gnulib changes.
1110 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1111 for ../lib/*.h files.
1112 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1113 Define unconditionally, since we now assume the stdint module.
1114 * src/scan-skel.l: Include <dirname.h>.
1115 (BASE_QPUTS): Use last_component, not base_name.
1116 * src/system.h: Include <unlocked-io.h> in the usual order
1117 for ../lib/*.h files. Include <stdint.h> unconditionally,
1118 since we now use the stdint module.
1119 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1120 HAVE_UINTPTR_T, since we now use the stdint module.
1121 (base_name): Remove decl, since files now include <dirname.h>
1122 to get the decl.
1123
cd48d21d
AD
11242006-07-08 Akim Demaille <akim@lrde.epita.fr>
1125
1126 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1127 New, default to 1.
1128 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1129 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1130 default.
1131 * tests/calc.at: Adjust.
1132
8ec0a172
AD
11332006-07-08 Akim Demaille <akim@lrde.epita.fr>
1134
b8445a15 1135 * data/c.m4 (b4_basename): New.
8ec0a172
AD
1136 (b4_syncline): Also output the location of its invocation (from
1137 the skeleton).
1138 (b4_user_action, b4_define_user_action, b4_user_actions)
1139 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1140 (b4_user_stype): New.
1141 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1142
4a678af8
JD
11432006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1144
1145 In the grammar file, the first column is 1 not 0 on the first line as
1146 on every other line.
1147 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1148 * tests/input.at (Torturing the Scanner): Update output.
1149
1150 * src/scan-gram.l (scanner_cursor): Declare it static.
1151
dd60572a
JD
11522006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1153
1154 In warnings, say "previous declaration" rather than "first
1155 declaration".
1156 * src/symtab.c (redeclaration): Do that here.
1157 * src/reader.c (record_merge_function_type): In the case of a result
1158 type clash, report the previous declaration rather than the very first
1159 one in the grammar file.
1160 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1161 declared later): Add a third declaration to check this behavior.
1162 * tests/input.at (Incompatible Aliases): Update output.
1163
2073e1b6
AD
11642006-06-27 Akim Demaille <akim@epita.fr>
1165
1166 * doc/Doxyfile.in: New.
1167 * doc/Makefile.am: Use it.
1168 * src/lalr.h, src/symtab.h: Initial doxygenation.
1169
8ee5b538
JD
11702006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1171
1172 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
1173 declared after the %merge. This continues the effort of the previous
1174 patch.
8ee5b538
JD
1175 * src/reader.c (get_merge_function): Don't set the merger type yet.
1176 (record_merge_function_type): New function for setting the merger type
1177 and checking for clashes.
1178 (grammar_current_rule_merge_set): Set the location of the %merge for
1179 the current rule.
1180 (packgram): Invoke record_merge_function_type for each rule now that
1181 all symbol type declarations have been parsed.
1182 * src/reader.h (merger_list.type_declaration_location): New member
1183 storing the location of the first %merge from which the type for this
1184 merging function was derived.
1185 * src/symlist.h (symbol_list.merger_declaration_location): New member
1186 storing the location of a rule's %merge, if any.
1187 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1188 declared later): New test to catch the error fixed by the above patch.
1189
ffa4ba3a
JD
11902006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1191
1192 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
1193 declarations appear after the rules. Discussed at
1194 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1195 and
1196 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1197 Don't mistake the type of $$ in a midrule to be that of its parent
1198 rule's $$.
ffa4ba3a
JD
1199 * src/reader.c (grammar_current_rule_end): Don't invoke
1200 grammar_rule_check yet since not all symbol declarations may have been
1201 parsed yet.
1202 (grammar_midrule_action): Likewise.
1203 Don't record whether the midrule's $$ has been used yet since actions
1204 haven't been translated yet.
1205 Record the midrule's parent rule and its RHS index within the parent
1206 rule.
1207 (grammar_current_rule_action_append): Don't translate the action yet
1208 since not all symbol declarations may have been parsed yet and, thus,
1209 warnings about types for $$, $n, @$, and @n can't be reported yet.
1210 (packgram): Translate the action and invoke grammar_rule_check now that
1211 all symbol declarations have been parsed.
1212 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1213 after parsing the entire grammar file, the symbol list here in the case
1214 of a midrule is actually the midrule's empty RHS, so reference its
1215 parent rule's RHS where necessary.
1216 On the other hand, now that you can already know it's a midrule, you
1217 aren't forced to think $$ has the same type as its parent rule's $$.
1218 (handle_action_at): In the case of a midrule, reference the parent rule
1219 where necessary.
1220 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1221 members.
1222 (symbol_list_length): Now that this is invoked after all rules have
1223 been parsed, a NULL symbol (rather than a NULL symbol list node)
1224 terminates a rule. symbol_list_print already does this correctly.
1225 * src/symlist.h (symbol_list.midrule_parent_rule,
1226 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1227 remember their relationships with their parents.
1228 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1229 fixed by the above patch.
1230 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1231 implementing...
1232 (Unused values): ... this old test case and...
1233 (Unused values before symbol declarations): ... this new test case.
1234 This one is the same as `Unused values' except that all symbol
1235 declarations appear after the rules in order to catch the rest of the
1236 errors fixed by the above patch.
1237
e256e17f
JD
12382006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1239
300a1930
JD
1240 More cleanup.
1241 * src/reader.c (current_rule): Declare it static since it's no longer
1242 used outside this file.
1243 (grammar_current_rule_action_append): Remove redundant arguments from
1244 translate_rule_action invocation.
1245 * src/reader.h (current_rule): Remove this unused extern.
1246 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1247 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 1248
381ecb06
JD
12492006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1250
1251 Clean up yesterday's patch.
1252 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1253 to...
1254 * src/reader.c (grammar_current_rule_action_append): ... here for
1255 consistency with grammar_current_rule_symbol_append.
1256 * tests/regression.at (Braced code in declaration in rules section):
1257 Make yyerror and yylex static as usual.
1258
4210cd0b
JD
12592006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1260
1261 Fix bug that mistakes braced code in a declaration in the rules section
1262 to be a rule action. Mentioned at
1263 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1264 * src/scan-gram.l: Move midrule action detection from the start of the
1265 scanning of any braced code to...
1266 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1267 action. For readability, use $2 and @2 rather than the equivalent
1268 global variables.
1269 * tests/regression.at (Braced code in declaration in rules section):
1270 New test to catch the error fixed by the above patch.
1271
1272 Work on code readability some.
1273 * src/scan-code.l (current_rule): Get rid of this misleading and
1274 redundant declaration: it's actually extern'ed in reader.h.
1275 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
1276 translate_action): Add a rule argument and use it instead of the global
1277 current_rule.
1278 (translate_rule_action): This already receives current_rule through an
1279 argument, so pass it on to translate_action instead of assigning
1280 current_rule to current_rule.
1281 (translate_symbol_action, translate_code): Pass rule = NULL to
1282 translate_action.
1283
34f98f46
JD
12842006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1285
1286 Rename %before-definitions to %start-header and %after-definitions to
1287 %end-header. Don't use these declarations to separate pre-prologue
1288 blocks from post-prologue blocks. Add new order-independent
1289 declarations %before-header and %after-header as alternatives to the
1290 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
1291 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
1292 * NEWS (2.3+): Update for these changes.
1293 * data/glr.c (b4_before_definitions): Update to...
1294 (b4_start_header): ... this.
1295 (b4_after_definitions): Update to...
1296 (b4_end_header): ... this.
1297 * data/glr.cc: Likewise.
1298 * data/lalr1.cc: Likewise.
1299 * data/yacc.c: Likewise.
1300 * doc/bison.texinfo (The prologue): Update names, and replace remaining
1301 prologue blocks with %*-header declarations.
1302 (Calc++ Parser): Likewise.
1303 (Bison Declaration Summary): Update names.
1304 (Bison Symbols): Update description.
1305 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
1306 (PERCENT_END_HEADER): ... this.
1307 (PERCENT_BEFORE_DEFINITIONS): Update to...
1308 (PERCENT_START_HEADER): ... this.
1309 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1310 (declaration): Update token names and m4 macro names.
1311 When parsing %end-header and %start-header, invoke translate_code
1312 before muscle_code_grow, and no longer set global booleans to remember
1313 whether these declarations have been seen.
1314 Parse new %after-header and %before-header.
1315 * src/reader.c (before_definitions, after_definitions): Remove.
1316 (prologue_augment): Accept a new bool argument to specify whether to
1317 augment the pre-prologue or post-prologue.
1318 * src/reader.h (before_definitions, after_definitions): Remove these
1319 extern's.
1320 (prologue_augment): Add new bool argument.
1321 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
1322 (PERCENT_END_HEADER): ... this.
1323 (PERCENT_BEFORE_DEFINITIONS): Update to...
1324 (PERCENT_START_HEADER): ... this.
1325 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1326 * tests/actions.at (Printers and Destructors): Update names.
1327
31b2b07e
JD
13282006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
1329
1330 Add comparison operators for C++ location classes. Discussed at
1331 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
1332 * data/c++.m4 (b4_define_location_comparison): New boolean %define
1333 declaration indicating whether filename_type has an operator==. If
1334 filename_type is `std::string', it defaults to `1', `0' otherwise.
1335 * data/location.cc: Iff b4_define_location_comparison is `1', add
1336 operator== and operator!= for class position and for class location.
1337
1338 Some minor fixes.
1339 * src/scan-action.l: Remove unused file.
1340 * src/symtab.c (symbol_printer_set): Use printer_location not
1341 destructor_location.
1342 * src/symtab.h (struct symbol): Replace incorrect source comment for
1343 printer members.
1344 * tests/input.at (Incompatible Aliases): Update output with correct
1345 printer location.
1346
9bc0dd67
JD
13472006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
1348
1349 Don't put the pre-prologue in the header file. For the yacc.c code
1350 file and the glr.c header and code files, move the pre-prologue before
1351 the token definitions. Add new %before-definitions and
1352 %after-definitions to declare code that will go in both the header file
1353 and code file. Discussed at
1354 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
1355 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
1356 and
1357 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
1358 * NEWS (2.3+): Describe these changes.
1359 * data/glr.c (b4_pre_prologue): Move from within to before...
1360 (b4_shared_declarations): ... this.
1361 Add new b4_before_definitions before b4_token_enums.
1362 Add new b4_after_definitions at the end.
1363 * data/glr.cc (b4_pre_prologue): Replace with...
1364 (b4_before_definitions): ... this in the header file.
1365 (b4_after_definitions): New near the end of the header file.
1366 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
1367 code file right before including the header file.
1368 (b4_before_definitions): New in the previous position of
1369 b4_pre_prologue in the header file.
1370 (b4_after_definitions): New near the end of the header file.
1371 * data/yacc.c: Clean up some m4 quoting especially in the header file.
1372 (b4_token_enums_defines): In the code file, move to right before
1373 YYSTYPE for consistency with the header file.
1374 (b4_before_definitions): New right before b4_token_enums_defines in
1375 both the header and code file.
1376 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
1377 header and code file.
1378 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
1379 of prologues for %union dependencies.
1380 (Bison Declaration Summary): In %defines description, mention the
1381 effect of %before-definitions and %after-definitions on the header
1382 file.
1383 (Calc++ Parser): Forward declare driver in a %before-definitions rather
1384 than in the pre-prologue so that make check succeeds.
1385 (Bison Symbols): Add entries for %before-definitions and
1386 %after-definitions.
1387 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
1388 %before-definitions.
1389 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
1390 (declaration): Parse those declarations and append to
1391 b4_before_definitions and b4_after_definitions, respectively.
1392 * src/reader.c (before_definitions, after_definitions): New bools to
1393 track whether those declarations have been seen.
1394 (prologue_augment): Add to the post-prologue if %union,
1395 %before-definitions, or %after-definitions has been seen.
1396 * src/reader.h (before_definitions, after_definitions): New extern's.
1397 * src/scan-gram.l: Scan the new declarations.
1398 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
1399 prologue block in a %before-definitions or a %after-definitions based
1400 on whether the %union is declared.
1401 * tests/regression.at (Early token definitions with --yacc, Early token
1402 definitions without --yacc): Move tests for token definitions into the
1403 post-prologue since token names are no longer defined in the
1404 pre-prologue.
1405
203b9274
AD
14062006-06-20 Akim Demaille <akim@epita.fr>
1407
1408 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
1409 (symbol_get): Use it.
1410 * src/parse-gram.y: Use it.
1411
a7ee59cf
JD
14122006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
1413
1414 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
1415 build succeeds when configured with --enable-gcc-warnings.
1416
5a2baae7
PE
14172006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1418
33ad1a9c
PE
1419 * src/parse-gram.y (char_name): New function.
1420 (CHAR, STRING, string_content): For %printer, properly escape.
1421 (ID): Prefer fputs to fprintf.
1422 (id): Reindent to be consistent with other rules.
1423 Properly quote char.
1424
5a2baae7
PE
1425 The Translation Project changed its way of publishing translations
1426 to maintainers. I haven't received any responses to my request
1427 for supporting the old way, or for documenting the new way. I
1428 have modified 'bootstrap' to use screen scraping
1429 (in this case, HTML scraping). This is unreliable and inelegant,
1430 but I don't see any better way. Yuck.
1431 * bootstrap (TP_URL, WGET_COMMAND): New vars.
1432 (get_translations): New function, which uses HTML scraping to
1433 deduce locations of latest translations.
1434 Use this function to grab both bison and bison-runtime .po files.
1435 Don't bother priming the pump for the runtime-po domain any more,
1436 as it's now translated better than bison is.
1437
58d7a1a1
AD
14382006-06-19 Akim Demaille <akim@epita.fr>
1439
1440 * src/scan-gram.l: No longer "parse" things after `%union' until
1441 `{'. Rather, return a single "%union" token.
1442 No longer make symbols: return strings, and leave the conversion
1443 to symbols to the parser.
1444 (SC_PRE_CODE, token_type): Remove.
1445 * src/parse-gram.y (%union): New field `character'.
1446 Sort tokens.
1447 (CHAR): New token.
1448 (ID, ID_COLON): Now that the scanner no longer makes them
1449 identifiers, adjust all uses to invoke symbol_get.
1450 (id_colon): New, wraps the conversion from string to symbol.
1451 (%union): Accept a possible union_name.
1452 (symbol): Now can be a char.
1453 * data/c.m4 (b4_union_name): Leave a default value.
1454 * data/glr.c, data/yacc.c: Use it.
1455
b931235e
JD
14562006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
1457
1458 For associating token numbers with token names for "yacc.c", don't use
1459 #define statements unless `--yacc' is specified; always use enum
1460 yytokentype. Most important discussions start at:
1461 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
1462 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
1463 and
1464 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
1465 * NEWS (2.3+): Mention.
1466 * data/c.m4 (b4_yacc_if): New.
1467 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
1468 token #define's.
1469 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
1470 on token name definitions.
1471 * src/getargs.c (usage): Capitalize `Yacc' in English.
1472 * src/output.c (prepare): Define b4_yacc_flag.
1473 * tests/regression.at (Early token definitions): Test that tokens names
1474 are defined before the pre-prologue not just before the post-prologue.
1475 Remove this test case and copy to...
1476 (Early token definitions with --yacc): ... this to test #define's.
1477 (Early token definitions without --yacc): ... and this to test enums.
1478
9e6e7ed2
PE
14792006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1480
1481 * NEWS: Reword the post-2.3 change to not be so optimistic about
1482 removing the old "look-ahead" spelling.
1483 Update previous look-ahead/lookahead change reports.
1484 * REFERENCES: look-ahead -> lookahead (since that's
1485 what he actually wrote).
1486 * doc/refcard.tex: look ahead -> lookahead,
1487 look-ahead -> lookahead
1488
742e4900
JD
14892006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
1490
1491 For consistency, use `lookahead' instead of `look-ahead' or
1492 `look_ahead'. Discussed starting at
1493 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
1494 and then at
1495 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
1496 * NEWS: For the next release, note the change to `--report'.
1497 * TODO, doc/bison.1: Update English.
1498 * doc/bison.texinfo: Update English.
1499 (Understanding Your Parser, Bison Options): Document as
1500 `--report=lookahead' rather than `--report=look-ahead'.
1501 * src/conflicts.c: Update English in comments.
1502 (lookahead_set): Rename from look_ahead_set.
1503 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
1504 (resolve_sr_conflict): Rename local look_ahead_tokens to
1505 lookahead_tokens, and update other uses.
1506 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
1507 count_rr_conflicts, conflicts_free): Update uses.
1508 * src/getargs.c (report_args): Move "lookahead" before alternate
1509 spellings.
1510 (report_types): Update uses.
1511 (usage): For `--report' usage description, state `lookahead' spelling
1512 rather than `look-ahead'.
1513 * src/getargs.h (report.report_lookahead_tokens): Rename from
1514 report_look_ahead_tokens.
1515 * src/lalr.c: Update English in comments.
1516 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
1517 (state_lookahead_tokens_count): Rename from
1518 state_look_ahead_tokens_count.
1519 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1520 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
1521 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1522 Update other uses.
1523 Update English in output.
1524 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
1525 * src/print.c: Update English in comments.
1526 (lookahead_set): Rename from look_ahead_set.
1527 (print_reduction): Rename argument lookahead_token from
1528 look_ahead_token.
1529 (print_core, state_default_rule, print_reductions, print_results):
1530 Update uses.
1531 * src/print_graph.c: Update English in comments.
1532 (print_core): Update uses.
1533 * src/state.c: Update English in comments.
1534 (reductions_new): Update uses.
1535 (state_rule_lookahead_tokens_print): Rename from
1536 state_rule_look_ahead_tokens_print, and update other uses.
1537 * src/state.h: Update English in comments.
1538 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
1539 (state_rule_lookahead_tokens_print): Rename from
1540 state_rule_look_ahead_tokens_print.
1541 * src/tables.c: Update English in comments.
1542 (conflict_row, action_row): Update uses.
1543 * tests/glr-regression.at
1544 (Incorrect lookahead during deterministic GLR,
1545 Incorrect lookahead during nondeterministic GLR): Rename
1546 print_look_ahead to print_lookahead.
1547 * tests/torture.at: Update English in comments.
1548 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
1549 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
1550 (Many lookahead tokens): Update uses.
1551 * data/glr.c: Update English in comments.
1552 * lalr1.cc: Likewise.
1553 * yacc.c: Likewise.
1554 * src/conflicts.h: Likewise.
1555 * src/lalr.h: Likewise.
1556 * src/main.c: Likewise.
1557 * src/output.c: Likewise.
1558 * src/parse-gram.c: Likewise.
1559 * src/tables.h: Likewise.
1560 * tests/calc.at: Likewise.
1561
3c40d0b5
JD
15622006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
1563
1564 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
1565
5d278082
PE
15662006-06-07 Paul Eggert <eggert@cs.ucla.edu>
1567
1568 * TODO: Add request from Nelson H. F. Beebe to be able to install
1569 Bison without installing the yacc script.
1570
9e668899
JD
15712006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1572
1573 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
1574 and yytext if they're already #define'd.
1575 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
1576 * src/scan-code-c.c: ... here.
1577 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
1578 <config.h>.
1579
0c8e079f
JD
15802006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1581
1582 Get Bison to build again when configured with --enable-gcc-warnings.
1583 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
1584 missing #include's.
1585 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
1586 loc argument as it shadows a global.
1587 * src/scan-gram.l: Remove stray comma that prevents boundary_set
1588 invocation.
1589
1590 * src/.cvsignore: Add scan-code.c.
1591
2346344a
AD
15922006-06-07 Akim Demaille <akim@epita.fr>
1593
1594 * src/scan-gram.l: Move the "add a trailing ; to actions" code
1595 to...
1596 * src/scan-code.l: here.
1597 * tests/input.at (Torturing the Scanner): Fix another location
1598 error.
1599
4862bdfd
AD
16002006-06-07 Akim Demaille <akim@epita.fr>
1601
1602 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
1603
e9071366
AD
16042006-06-06 Akim Demaille <akim@epita.fr>
1605
1606 Extract the parsing of user actions from the grammar scanner.
1607 As a consequence, the relation between the grammar scanner and
1608 parser is much simpler. We can also split "composite tokens" back
1609 into simple tokens.
1610 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
1611 * src/scan-gram.l (add_column_width, adjust_location): Move to and
1612 rename as...
1613 * src/location.h, src/location.c (add_column_width)
1614 (location_compute): these.
1615 Fix the column count: the initial column is 0.
1616 (location_print): Be robust to ending column being 0.
1617 * src/location.h (boundary_set): New.
1618 * src/main.c: Adjust to scanner_free being renamed as
1619 gram_scanner_free.
1620 * src/output.c: Include scan-code.h.
1621 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
1622 Use boundary_set.
1623 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
1624 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
1625 which is now, again, a separate token.
1626 Adjust all dependencies.
1627 Whereever actions with $ and @ are used, use translate_code.
1628 (action): Remove this nonterminal which is now useless.
1629 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
1630 (grammar_current_rule_action_append): Use translate_code.
1631 (packgram): Bound check ruleno, itemno, and rule_length.
1632 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
1633 (last_string, last_braced_code_loc, max_left_semantic_context)
1634 (scanner_initialize, scanner_free, scanner_last_string_free)
1635 (gram_out, gram_lineno, YY_DECL_): Move to...
1636 * src/scan-gram.h: this new file.
1637 (YY_DECL): Rename as...
1638 (GRAM_DECL): this.
1639 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
1640 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
1641 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
1642 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
1643 Move these declarations, and...
1644 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
1645 these to...
1646 * src/flex-scanner.h: this new file.
1647 * src/scan-gram.l (rule_length, rule_length_overflow)
1648 (increment_rule_length): Remove.
1649 (last_braced_code_loc): Rename as...
1650 (gram_last_braced_code_loc): this.
1651 Adjust to the changes of the parser.
1652 Move all the handling of $ and @ into...
1653 * src/scan-code.l: here.
1654 * src/scan-gram.l (handle_dollar, handle_at): Remove.
1655 (handle_action_dollar, handle_action_at): Move to...
1656 * src/scan-code.l: here.
1657 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
1658 scan-code.h, scan-code-c.c, scan-gram.h.
1659 (EXTRA_bison_SOURCES): Add scan-code.l.
1660 (BUILT_SOURCES): Add scan-code.c.
1661 (yacc): Be robust to white spaces.
1662
1663 * tests/conflicts.at, tests/input.at, tests/reduce.at,
1664 * tests/regression.at: Adjust the column numbers.
1665 * tests/regression.at: Adjust the error message.
7891a7c4 1666
184e42f0
JD
16672006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1668
1669 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1670 Use Akim's wording from
1671 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
1672
7891a7c4
JD
16732006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1674
1675 Between Bison releases, manually append `+' to the previous Bison
1676 release number, and use that as a signal to automatically print the
1677 ChangeLog's CVS Id keyword from --version. Discussed starting at
1678 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
1679 * ChangeLog: Add Id header.
1680 * configure.ac (AC_INIT): Append `+' to `2.3'.
1681 * src/.cvsignore: Add revision.c.
1682 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
1683 (BUILT_SOURCES): Add revision.c.
1684 (revision.c): New target rule. This file defines a new global variable
1685 named revision. It initializes it with either the Id from ChangeLog
1686 or, if VERSION doesn't contain `+', with the empty string.
1687 * src/getargs.c (version): Print the value of revision.
1688 * src/revision.h: Extern revision.
1689
4ad3ed84
PE
16902006-06-05 Paul Eggert <eggert@cs.ucla.edu>
1691
1692 * NEWS: Version 2.3.
1693 * configure.ac (AC_INIT): Likewise.
1694
02103984
PE
16952006-05-30 Paul Eggert <eggert@cs.ucla.edu>
1696
1697 * data/glr.c (YYRECOVERING): Define to be a function-like macro
1698 with no arguments, not as an object-like macro. This is for
1699 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
1700 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
1701 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
1702 Document this.
1703
2c08afa5
JD
17042006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
1705
1706 * src/getargs.c (usage): Back out yesterday's modification of the
1707 --help output so that we don't have to wait for translation before
1708 releasing 2.3.
1709
6077da58
PE
17102006-05-29 Paul Eggert <eggert@cs.ucla.edu>
1711
1712 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
1713 Problem reported by Akim Demaille.
1714
2a26b6c2
JD
17152006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1716
1717 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1718
aefef0d6
PE
17192006-05-26 Paul Eggert <eggert@cs.ucla.edu>
1720
1721 * data/yacc.c (yy_reduce_print): Omit trailing white space in
1722 generated source code. Problem reported by Frans Englich in
1723 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
1724
fcd8e201
PE
17252006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1726
1727 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
1728 shell, not within 'make', so that 'make' by an ordinary builder
1729 (using GNU make) does not worry about configuring gzip. This also
1730 works around a bug reported independently by Keith Thompson and by
1731 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
1732 stderr rather than stdout, messing up the build logs.
1733
7b5cdcbd
JD
17342006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1735
1736 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
1737 to make sure that YYID will never be unused. This fixes a 'make
1738 maintainer-check' failure caused by the recent changes to the 'Trivial
1739 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
1740 not used.
1741 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
1742
5ad0a449
JD
17432006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1744
1745 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
1746 state before an empty RHS is always resolved here. Only the location
1747 of that state is guaranteed to be resolved, and that's enough. This
1748 fixes the remaining bug reported by Derek M. Jones in
1749 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1750 * tests/glr-regression.at (Uninitialized location when reporting
1751 ambiguity): Test the above case.
1752 Also, the embedded comments in this test case claim it checks the case
1753 of an empty RHS that has inherited the initial location. However, the
1754 corresponding LHS was already resolved, so yyresolveLocations didn't
1755 actually have reason to modify it. Fix this by forcing
1756 nondeterministic operation at the beginning of the parse.
1757
50cce58e
PE
17582006-05-20 Paul Eggert <eggert@cs.ucla.edu>
1759
1760 * data/c.m4 (b4_yy_symbol_print_generate):
1761 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
1762 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
1763 of the bugs reported today by Derek M Jones in
1764 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1765 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
1766 defined to be a type name without parens or brackets.
1767 (Location Type): Similarly for YYLTYPE.
1768 * tests/regression.at (Trivial grammars): Put in a test for this
1769 bug that will be caught by 'make maintainer-check' (though not,
1770 alas, by 'make check' unless your compiler is picky).
1771
ab8d9dc5
PE
17722006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1773
0d2c8934 1774 * NEWS: Version 2.2.
ab8d9dc5
PE
1775 * configure.ac (AC_INIT): Likewise.
1776
9138c575
JD
17772006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
1778
1779 * data/glr.c (yyreportTree): Make room in yystates for the state
1780 preceding the RHS. This fixes the segmentation fault reported by Derek
1781 M. Jones in
1782 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
1783 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
1784 to the user. Reported for yyreportTree by Derek M. Jones later in the
1785 same thread.
1786 * THANKS: Add Derek M. Jones.
1787 Update my email address.
1788 Fix typo in Steve Murphy's name.
1789
276f48df
PE
17902006-05-14 Paul Eggert <eggert@cs.ucla.edu>
1791
d6645148
PE
1792 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
1793 checking against YYLAST that caused the parser to miss a potential
1794 alternative in its diagnostic.
1795 Problem reported by Maria Jose Moron Fernandez in
1796 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
1797 * data/lalr1.cc (yysyntax_error_): Likewise.
1798 * data/yacc.c (yysyntax_error): Likewise.
1799 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
1800 tokens, in case we run into an older C compiler.
1801 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
1802 Use them to check for the off-by-one error fixed above.
1803
276f48df
PE
1804 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
1805 YYSIZE_T, not size_t.
1806 * tests/regression.at (Trivial grammars): New test, to catch
1807 the error fixed by the above patch.
1808
cd8b5791
AD
18092006-05-14 Akim Demaille <akim@lrde.epita.fr>
1810
1811 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
1812 scheme.
1813 Reported by Steve Murphy.
1814
34376418
AD
18152006-05-14 Akim Demaille <akim@lrde.epita.fr>
1816
1817 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
1818 * data/glr.cc: b4_location_flag is now b4_locations_flag.
1819
327afc7c
AD
18202006-05-14 Akim Demaille <akim@lrde.epita.fr>
1821
1822 Implement --trace=m4.
1823 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
1824 * src/output.c (output_skeleton): When set, pass -dV to m4.
1825
1826 Factor the handling of flags in m4.
1827 * src/output.c (prepare): Rename the muscle names debug, defines,
1828 error_verbose to debug_flag, defines_flag, error_verbose_flag.
1829 * data/c.m4: Adjust.
1830 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
1831 Use b4_define_flag_if to define other b4_FLAG_if macros.
1832 (b4_location_if): As a consequence, rename as...
1833 (b4_locations_if): this, for consistency.
1834 Adjust all the skeletons.
1835
ba9ecd19
AD
18362006-05-14 Akim Demaille <akim@lrde.epita.fr>
1837
1838 * etc/bench.pm: Shorten bench names.
1839
4e83ea15
AD
18402006-05-14 Akim Demaille <akim@lrde.epita.fr>
1841
1842 * src/output.h, src/output.c (error_verbose): Move to...
1843 * src/getargs.h, src/getargs.c: here.
1844 Sort the flags.
1845 Adjust dependencies.
1846
6e93d810
PE
18472006-05-13 Paul Eggert <eggert@cs.ucla.edu>
1848
1849 * data/c.m4 (b4_copyright): Put the special exception for Bison
1850 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
1851 uses changed. Suggested by Akim Demaille. Also, wrap the
1852 copyright notice, in case it is longer than 80 columns. Replace
1853 comma by newline after title.
6e93d810 1854
eaea13f5
PE
18552006-05-11 Paul Eggert <eggert@cs.ucla.edu>
1856
1857 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
1858 incompatibility, not a bug. Mention that it wasn't fixed as of
1859 flex 2.5.33.
1860
3cf084ec
AD
18612006-05-11 Akim Demaille <akim@lrde.epita.fr>
1862
1863 * examples/extexi: Enforce the precedence of concatenation over
1864 >>.
0a9f1c7d 1865 Reported by Tommy Nordgren.
3cf084ec 1866
32c96bd7
AD
18672006-05-11 Akim Demaille <akim@lrde.epita.fr>
1868
1869 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
1870 with the member "token".
f94705b2 1871 Reported by Martin Nylin.
32c96bd7 1872
eaea13f5
PE
18732006-05-08 Paul Eggert <eggert@cs.ucla.edu>
1874
1875 * data/glr.c: Switch to Bison 2.2 special-exception language in
1876 the copyright notice. Use more-regular format for titles and
1877 copyright notices.
1878 * data/glr.cc: Likewise.
1879 * data/location.cc: Likewise.
1880 * data/yacc.cc: Likewise.
1881 * doc/bison.texinfo (Conditions): Document this.
1882 * NEWS: likewise. Upgrade version to 2.2.
1883
6e2d1146
AD
18842006-04-27 Akim Demaille <akim@lrde.epita.fr>
1885
1886 * data/glr.cc: Remove dead code.
1887
47671055
PE
18882006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1889
1890 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
1891 that variable and the line breaks the bootstrap. Problem reported
1892 by Juan M. Guerrero.
1893
ed2e6384
AD
18942006-04-24 Akim Demaille <akim@lrde.epita.fr>
1895
1896 * doc/bison.texinfo (Multiple start-symbols): New.
1897
3cedc2dc
AD
18982006-04-24 Akim Demaille <akim@lrde.epita.fr>
1899
1900 * etc/README, etc/bench.pl: New.
1901
b2ddc3f3
AD
19022006-04-03 Akim Demaille <akim@lrde.epita.fr>
1903
1904 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
1905 rule.
1906 Reported by Mickael Labau.
1907 * tests/input.at (Torturing the Scanner): Test it.
1908
91e3ac9a
PE
19092006-03-16 Paul Eggert <eggert@cs.ucla.edu>
1910
1911 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
1912 Problem reported by Bob Rossi.
1913
19142006-03-13 Paul Eggert <eggert@cs.ucla.edu>
1915
1916 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
1917 and didn't really work.
1918 For the index, use @ifnotinfo, not @iftex.
1919 Minor cleanups of spacing and terminology.
1920
5cf61e93
AD
19212006-03-12 Akim Demaille <akim@lrde.epita.fr>
1922
1923 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
1924 of AT_NAME_PREFIX when %name-prefix is not used.
1925
aa08666d
AD
19262006-03-12 Akim Demaille <akim@lrde.epita.fr>
1927
1928 Apply --prefix to C++ skeletons too: they change the namespace.
1929 The test suite already exercize these cases.
1930 * data/c++.m4 (b4_namespace): New.
1931 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
1932 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
1933 * data/yacc.c, data/glr.c: Remove a useless `[]'.
1934 * doc/bison.texinfo: Document it.
1935 (Option Cross Key): Use @multitable in all formats. It looks
1936 nicer, even in TeX outputs.
1937 (Rules): Use the same code whatever the output type is.
1938 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
1939 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
1940 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 1941
45567173
AD
19422006-03-10 Akim Demaille <akim@lrde.epita.fr>
1943
1944 * TODO: Remove dead items.
1945
e9d8f881 19462006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
1947
1948 * doc/FAQ: Remove, merged into...
1949 * doc/bison.texinfo (FAQ): this.
1950 * doc/Makefile.am (EXTRA_DIST): Adjust.
1951
c095d689
AD
19522006-03-10 Akim Demaille <akim@lrde.epita.fr>
1953
1954 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
1955 even if empty.
1956 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
1957 * doc/bison.texinfo (Calc++ Scanner): Use it.
1958
6e0f8287
PE
19592006-03-09 Paul Eggert <eggert@cs.ucla.edu>
1960
1961 Fix two nits reported by twlevo, plus one more that I discovered.
1962
1963 * src/assoc.h (assoc_to_string): Give a name to the arg, as
1964 this is the usual Bison style.
1965 * src/location.h (location_print): Likewise.
1966
1967 * src/reader.h (token_name): Likewise.
1968
d6b771c3
PE
19692006-03-08 Paul Eggert <eggert@cs.ucla.edu>
1970
1971 Fix some nits reported by twlevo.
1972 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
1973 and "POSIX". Use more-modern syntax for URLs. Mention C++
1974 and ask for Java. Don't hardwire OS version numbers. Add
1975 copyright notice.
1976 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
1977 * src/conflicts.c (solved_conflicts_obstack): Now static.
1978
1e137b71
JD
19792006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1980
1981 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
1982 page. Say "you can use it" not "you may use it" as on the web page;
1983 we're describing capabilities not granting permission.
1984
73f2e47e
PE
19852006-03-06 Paul Eggert <eggert@cs.ucla.edu>
1986
6d05403d
PE
1987 * data/glr.c (yyresolveLocations): Rename local variables to avoid
1988 shadowing warnings. Use usual patter for iterating through RHS.
1989 * tests/glr-regression.at
1990 (Uninitialized location when reporting ambiguity):
1991 Modify yylex so that it uses its argument, rather than trying
1992 to rely on ARGSUSED (which doesn't work for gcc with warnings).
1993 const char -> char const.
1994
73f2e47e
PE
1995 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
1996 Don't use tabs inside commands; it messes up 'ps'.
1997 Problem reported by twlevo.
1998
8710fc41
JD
19992006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2000
2001 * tests/glr-regression.at (Uninitialized location when reporting
2002 ambiguity): New test case.
2003 * data/glr.c (yyresolveLocations): New function, which uses
2004 YYLLOC_DEFAULT.
2005 (yyresolveValue): Invoke yyresolveLocations before reporting an
2006 ambiguity.
2007 * doc/bison.texinfo (Default Action for Locations): Note
2008 YYLLOC_DEFAULT's usage for ambiguity locations.
2009 (GLR Semantic Actions): Cross-reference those notes.
2010
ae952af2
JD
20112006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2012
2013 * tests/glr-regression.at (Leaked semantic values when reporting
2014 ambiguity): Remove unnecessary union and type declarations.
2015 (Leaked lookahead after nondeterministic parse syntax error): New test
2016 case.
2017 * data/glr.c (yyparse): Check for zero stacks remaining before
2018 attempting to shift the lookahead so that you don't lose it.
2019
35ee866a
JD
20202006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2021
2022 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2023 * tests/glr-regression.at (Leaked semantic values when reporting
2024 ambiguity): New test case.
2025 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2026 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2027 now unnecessary yystackp parameter.
2028 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2029 destructors can be called.
2030
2031 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2032 in existing testcases.
2033
520181ab
JD
20342006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2035
2036 Don't leak semantic values for parent RHS when a user action cuts the
2037 parser, and clean up related code a bit.
2038 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
2039 cuts parse): Rename to...
2040 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
2041 for leaked parent RHS values.
2042 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2043 between an unresolved state (non-empty chain of semantic options) and
2044 an incomplete one (signaled by an empty chain).
ae952af2 2045 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
2046 successfully or unsuccessfully resolved yyGLRState to...
2047 (yyresolveValue): ... here so that yyresolveValue always leaves a
2048 yyGLRState with consistent data and thus is easier to understand.
2049 Remove the yyvalp and yylocp parameters since they are always just
2050 taken from the yys parameter. When reporting a discarded merged value
2051 in debugging output, note that it is incompletely merged. Document the
2052 interface.
2053 (yyresolveAction): If resolving any of the RHS states fails, destroy
2054 them all rather than leaking them. Thus, as long as user actions are
2055 written to clean up the RHS correctly, yyresolveAction always cleans up
2056 the RHS of a semantic option. Document the interface.
2057
18d9185c
PE
20582006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2059
2060 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2061 led to a segmentation fault in GNU Pascal. Problem reported
2062 by Waldek Hebisch.
2063
841a7737
JD
20642006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2065
2066 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2067 mid-rule action inside a nonterminal symbol in order to declare a
2068 destructor for its semantic value.
2069
fc3f467f
PE
20702006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2071
2072 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2073 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2074 __cplusplus && ! defined _STDLIB_H && !
2075 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2076 defined free))]: Include <stdlib.h> rather than rolling our own
2077 declarations of malloc and free, to avoid problems with
2078 incompatible declarations (using 'throw') C++'s stdlib.h. This
2079 should fix Debian bug 340012
2080 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2081 reported by Guillaume Melquiond.
2082
a3af26dd
PE
20832006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2084
4d7bc38c
PE
2085 * NEWS: Clarify symbols versus types in unused-value warnings.
2086
a3af26dd
PE
2087 * configure.ac (AC_INIT): Bump version number.
2088
4e26c69e
PE
20892006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2090
2091 * NEWS: Version 2.1a.
2092 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2093 since C99 requires this.
2094
498e897c
PE
20952006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2096
2097 * m4/c-working.m4: New file.
2098 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2099
57bb17ca
PE
21002006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2101
2102 * Makefile.maint: Merge from coreutils.
2103
0be105dc
PE
21042006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2105
2106 More portability fixes for problems summarized by Nelson H. F. Beebe.
2107
2108 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2109 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2110 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2111 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2112 messes up because C++ code is compiled in 32-bit mode but linked
2113 in 64-bit mode.
2114
6fc0c024
PE
21152006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2116
2117 More portability fixes for problems summarized by Nelson H. F. Beebe.
2118
7870f699
PE
2119 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2120 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2121
6fc0c024
PE
2122 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2123 nodist_PROGRAMS, since we don't need to actually compile the
2124 example if we're just doing a plain 'make'. This avoids bothering
2125 the installer unnecessarily about problems due to weird C++
2126 compilers.
2127
fe6c2fde
PE
21282006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2129
2130 More portability fixes for problems summarized by Nelson H. F. Beebe.
2131
2132 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2133 than #include "...", and compile with -I'.'. The old method was
2134 not portable, according to Posix and the C standard, and it does
2135 not work with Sun C 5.7, where previous #line directives affect
2136 the working directory used in later #include "..." directives.
2137
927b425b
JMG
21382006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2139
2140 Various DJGGP specific issues in /djgpp
2141
d9735e9e
PE
21422006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2143
2144 More portability fixes for problems summarized by Nelson H. F. Beebe.
2145
2146 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2147 '#include <map>' works and that you can apply ++ to iterators.
2148
5a6755af
PE
21492006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2150
67a0dc4f
PE
2151 Work around portability problems summarized by Nelson H. F. Beebe in
2152 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2153
8c86f0ef
PE
2154 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2155 that '#include <string>' works.
2156
de35dd59
PE
2157 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2158 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2159 "warning: sorry: semantics of inline function static data `const
2160 unsigned char translate_table[262]' are wrong (you'll wind up with
2161 multiple copies)".
2162
67a0dc4f
PE
2163 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2164 or, xor to not_, and_, or_, and xor_, respectively. This works
2165 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2166 random system header somewhere that includes the equivalent of
2167 <iso646.h>.
2168
5a6755af
PE
2169 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2170 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 2171 Suite Version 2.0.
5a6755af 2172
3f001415
JD
21732006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2174
2175 During deterministic GLR operation, user actions should be able to
2176 influence the parse by changing yychar. To make this easier to fix and
2177 to make glr.c easier to evolve in general, don't maintain yytoken in
2178 parallel with yychar; just compute yytoken when needed.
2179 * tests/glr-regression.at (Incorrect lookahead during deterministic
2180 GLR): Check that setting yychar in a user action has the intended
2181 effect.
2182 * data/glr.c (yyGLRStack): Remove yytokenp member.
2183 (yyclearin): Don't set *yytokenp.
2184 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2185 yychar rather than *yytokenp to determine the current lookahead.
2186 Compute yytoken locally when needed.
2187 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2188 point to.
2189
2190 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2191 after `--report' documentation.
2192
e2a8c0f5
PE
21932006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2194
2195 * src/parse-gram.y (grammar_declaration): Location of printer
2196 symbol is @1, not list->location. Bug reported by twlevo.
2197 * tests/input.at (Incompatible Aliases): Adjust to above change.
2198
6b702268
PE
21992006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2200
27622431
PE
2201 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2202 all the test at once. This makes the output easier to read in the
2203 normal case.
2204
6b702268
PE
2205 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2206 got from <http://bro-ids.org/download.html>. The bug is that
2207 when two actions appeared in succession, the second one was
2208 scanned before the first one was added to the grammar rule
2209 as a midrule action. Bison then output the incorrect warning
2210 "parse.y:905.17-906.36: warning: unused value: $3".
2211 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2212 associated with a value.
2213 (rhs): Don't invoke grammar_current_rule_action_append.
2214 (action): Invoke it here instead.
2215 * src/reader.c (grammar_midrule_action): Now extern.
2216 (grammar_current_rule_action_append): Don't invoke
2217 grammar_midrule_action; that is now the scanner's job.
2218 * src/reader.h (last_string, last_braced_code_loc):
2219 (grammar_midrule_action): New decls.
2220 * src/scan-gram.l (last_string): Now extern, sigh.
2221 (last_braced_code_loc): New extern variable.
2222 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2223 rule already has an action.
2224 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2225 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2226 Add some tests to check that the above changes fixed the bug.
2227
d40ba6c2
PE
22282006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2229
2230 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2231 All used changed. Check whether the symbol has a destructor,
2232 not whether it is typed.
2233 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2234 that the values are still reported as unused. All line numbers
2235 adjusted.
2236
401aace6
PE
22372006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2238
2239 Work around a bug in bro 0.8, which underparenthesizes its
2240 definition of YYLLOC_DEFAULT.
2241 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2242 their arguments.
2243 * data/lalr1.cc: Likewise.
2244 * data/yacc.cc: Likewise.
2245
06f01bc4
PE
22462006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2247
401aace6
PE
2248 Work around a bug in Pike 7.0, and give the Pike folks a
2249 better way to override the usual int widths.
2250 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2251 user can override the types.
2252 (short): #undef, to work around a bug in Pike 7.0.
2253 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2254 (union yyalloc.yyss): Use yytype_int16 rather than short.
2255 All uses changed.
2256 (yysigned_char): Remove.
2257 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2258 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2259 * tests/regression.at (Web2c Actions): Adjust to above changes.
2260
2261 * src/reader.c (check_and_convert_grammar): New function.
2262 (reader): Close the input file even if something went wrong during
2263 parsing. Minor file descriptor leak reported by twlevo.
2264
06f01bc4
PE
2265 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2266 to pacify gcc -Wswitch-default.
2267 * src/scan-gram.l (adjust_location): Use a default: break; case
2268 to pacify gcc -Wswitch-default.
2269 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2270 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2271 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2272 Move these decls to scan-skel.l, since they don't need to be
2273 visible elsewhere.
2274 * src/scan-skel.l: Accept the above decls.
2275 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2276 is used.
2277
02650b7f
PE
22782006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2279
2280 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
2281 since we don't want to insist on a version number at the start
2282 of the changelog every time.
2283 * Makefile.maint: Sync from coreutils a bit better.
2284 (sc_trailing_blank): Renamed from sc_trailing_space.
2285 All uses changed.
2286 (sc_no_if_have_config_h, sc_require_config_h):
2287 (sc_prohibit_assert_without_use): New rules.
2288 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
2289 (sc_dd_max_sym_length): Fix leading spaces in rule.
2290 (sc_system_h_headers): Prefix with @.
2291 (sc_useless_cpp_parens, m4-check): Output line numbers.
2292 (changelog-check): Allow version only in head.
2293 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
2294 satisfy new Makefile.maint rule.
2295 * data/glr.c: Likewise.
2296 * data/glr.cc: Likewise.
2297 * data/lalr1.cc: Likewise.
2298 * data/yacc.c: Likewise.
2299 * lib/ebitsetv.c: Likewise.
2300 * lib/lbitset.c: Likewise.
2301 * lib/subpipe.c: Likewise.
2302 * lib/timevar.c: Likewise.
2303 * src/system.h: Likewise.
2304 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
2305 * djgpp/Makefile.maint: Add copyright notice.
2306 * djgpp/README.in: Likewise.
2307 * djgpp/config.bat: Likewise.
2308 * djgpp/config.site: Likewise.
2309 * djgpp/config_h.sed: Likewise.
2310 * djgpp/djunpack.bat: Likewise.
2311 * djgpp/config.sed: Fix copyright notice to match standard format.
2312 * djgpp/subpipe.h: Likewise.
2313 * lib/bitsetv-print.c: Likewise.
2314 * lib/bitsetv.c: Likewise.
2315 * lib/subpipe.h: Likewise.
2316 * lib/timevar.c: Likewise.
2317 * lib/timevar.h: Likewise.
2318 * djgpp/subpipe.c: Use standard recipe for config.h.
2319 * lib/abitset.c: Likewise.
2320 * lib/bitset.c: Likewise.
2321 * lib/bitset_stats.c: Likewise.
2322 * lib/bitsetv-print.c: Likewise.
2323 * lib/bitsetv.c: Likewise.
2324 * lib/ebitsetv.c: Likewise.
2325 * lib/get-errno.c: Likewise.
2326 * lib/lbitset.c: Likewise.
2327 * lib/subpipe.c: Likewise.
2328 * lib/timevar.c: Likewise.
2329 * lib/vbitset.c: Likewise.
2330 * tests/local.at: Likewise.
2331 * src/scan-gram.l: Don't include verify.h, since system.h does
2332 that for us.
2333 * .x-sc_require_config_h: New file.
2334 * .x-sc_unmarked_diagnostics: New file.
2335
287c78f6
PE
23362006-01-20 Paul Eggert <eggert@cs.ucla.edu>
2337
287c78f6
PE
2338 Be a bit more systematic about using 'abort'.
2339 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
2340 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
2341 Put 'default: abort ();' before some other case, to satisfy older
2342 pedantic compilers.
2343 * lib/bitset_stats.c (bitset_stats_init): Likewise.
2344 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
2345 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
2346 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
2347 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
2348 (get_decision_str, get_orientation_str, get_node_alignment_str):
2349 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
2350 (get_linestyle_str, get_arrowstyle_str): Likewise.
2351 * src/conflicts.c (resolve_sr_conflict):
2352 Use a default case rather than one for the one remaining enum
2353 value, to catch invalid enum values as well.
2354 * src/lalr.c (set_goto_map, map_goto):
2355 Prefer "assert (FOO);" to "if (!FOO) abort ();".
2356 * src/nullable.c (nullable_compute, token_definitions_output):
2357 Likewise.
2358 * src/reader.c (packgram, reader): Likewise.
2359 * src/state.c (transitions_to, state_new, state_reduction_find):
2360 Likewise.
2361 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
2362 (symbol_pack): Likewise.
2363 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
2364 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
2365 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
2366 * src/system.h: Don't include <assert.h>.
2367 (assert): New macro.
2368
2369 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
2370 (Destructor Decl, Parser Function, Pure Calling):
2371 Describe rules for braces inside C code more carefully.
287c78f6 2372
c66dfadd
PE
23732006-01-19 Paul Eggert <eggert@cs.ucla.edu>
2374
c21493b8
PE
2375 Fix some porting glitches found by Nelson H. F. Beebe.
2376 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
2377 compilers that don't understand that abort () does not return.
2378 * src/state.c (transitions_to): Likewise.
2379 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2380 that '#include <cstdlib>' works.
2381 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
2382 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
2383 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
2384 for the benefit of some pre-C99 compilers.
2385
b6e3facf
PE
2386 * bootstrap: Undo changes to gnulib files that autoreconf made.
2387
c66dfadd
PE
2388 Minor fixups to get 'make maintainer-check' to work.
2389 * configure.ac: Don't use -Wnested-externs, as it's incompatible
2390 with the new verify.h implementation.
2391 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
2392 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
2393 * data/yacc.c (YYUSE): Likewise.
2394 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
2395 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
2396 * src/parse-gram.y (declaration): Don't pass a string constant
2397 to a function that expects char *, since GCC might complain
2398 about the constant value.
2399 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
2400 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
2401 before #defining them.
2402 * tests/glr-regression.at
2403 (Incorrectly initialized location for empty right-hand side in GLR):
2404 In yyerror, use the msg arg.
2405 (Corrupted semantic options if user action cuts parse):
2406 (Incorrect lookahead during deterministic GLR):
2407 (Incorrect lookahead during nondeterministic GLR):
2408 Don't name a local var 'index'; it shadows string.h's 'index'.
2409
ed94ef2a
AD
24102006-01-19 Akim Demaille <akim@epita.fr>
2411
2412 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
2413 location, not just parts of it.
2414
e9ad4aec
PE
24152006-01-18 Paul Eggert <eggert@cs.ucla.edu>
2416
d6ca7905
PE
2417 * NEWS: Document the fact that multiple %unions are now allowed.
2418 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
2419 * TODO: This feature is now implemented, so remove it from
2420 the wishlist.
d6ca7905 2421
ef1b70e0
PE
2422 * Makefile.maint: Merge with coreutils Makefile.maint.
2423 (CVS_LIST): Use build-aux version if available.
2424 (VERSION_REGEXP): New macro.
2425 (syntax-check-rules): Add sc_no_if_have_config_h,
2426 sc_prohibit_assert_without_use, sc_require_config_h,
2427 sc_useless_cpp_parens.
2428 (sc_obsolete_symbols): Check for O_NDELAY.
2429 (sc_dd_max_sym_length): Track coreutils.
2430 (sc_unmarked_diagnostics): Look in all files, not just *.c.
2431 (sc_useless_cpp_parens): New rule.
2432 (news-date-check): Look for version or today's date.
2433 (changelog-check): Don't require version number near head.
2434 (copyright-check): Use current year instead of hardwiring 2005.
2435 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
2436 (announcement): Add --gpg-key-ID.
2437
2438 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
2439 with "file system".
2440
2073ce56 2441 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
2442 array. Problem reported by twlevo.
2443 * src/reader.c (packgram): Prepend a new sentinel before ritem.
2444 * src/lalr.c (build_relations): Rely on new sentinel.
2445 * src/gram.c (gram_free): Adjust to new sentinel.
2446
b7691f15
JD
24472006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
2448
2449 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
2450 yylookaheadNeeds. All uses updated.
2451 (yysplitStack): Rename local yynewLookaheadStatuses to
2452 yynewLookaheadNeeds.
2453 * data/glr-regression.at (Incorrect lookahead during nondeterministic
2454 GLR): In comments, change `lookahead status' to `lookahead need'.
2455
ddee1b06
PH
24562006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2457
2458 * data/glr.c (yysplitStack): A little stylistic rewrite.
2459
12f4614d
PH
24602006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2461
2462 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
2463
32c29292
JD
24642006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
2465
2466 * doc/bison.texinfo: Fix some typos.
2467 (GLR Semantic Actions): New subsection discussing special
2468 considerations because GLR semantic actions might be deferred.
2469 (Actions): Mention look-ahead usage of yylval.
2470 (Actions and Locations): Mention look-ahead usage of yylloc.
2471 (Special Features for Use in Actions): Add YYEOF entry and mention it
2472 in the yychar entry.
2473 In the yychar entry, remove mention of the local yychar case (pure
2474 parser) since this is irrelevant information when writing semantic
2475 actions and since it's already discussed in `Bison Symbols' where
2476 yychar is otherwise described as an external variable.
2477 In the yychar entry, don't call it the `current' look-ahead since it
2478 isn't when semantic actions are deferred.
2479 In the yychar and yyclearin entries, add note about deferred semantic
2480 actions.
2481 Add yylloc and yylval entries discussing look-ahead usage.
2482 (Look-Ahead Tokens): When discussing yychar, don't call it the
2483 `current' look-ahead, and do mention yylval and yylloc.
2484 (Error Recovery): Cross-reference `Action Features' when mentioning
2485 yyclearin.
2486 (Bison Symbols): In the yychar entry, don't call it the `current'
2487 look-ahead.
2488 In the yylloc and yylval entries, mention look-ahead usage.
2489
de366a2f 24902006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
2491
2492 * tests/glr-regression.at: Update copyright year to 2006.
2493
bf70fa87
JD
24942006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2495
2496 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
2497 use during nondeterministic operation to track which stacks have
2498 actually needed the current lookahead.
2499 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
2500 Allocate, deallocate, resize, and otherwise shuffle space for
2501 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
2502 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
2503 appropriately during nondeterministic operation.
2504 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
2505 members to store the current lookahead to be used by the deferred
2506 user action.
2507 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
2508 from which the RHS is taken. Set the lookahead members of the new
2509 yySemanticOption according to the lookahead status for stack yyk.
2510 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
2511 yyaddDeferredAction.
2512 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
2513 members of yySemanticOption before invoking yyuserAction, and then set
2514 them back to their current values afterward.
2515 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
2516 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
2517 * tests/glr-regression.at: Remove `.' from the ends of recent test case
2518 titles for consistency.
2519 (Leaked merged semantic value if user action cuts parse): In order to
2520 suppress lint warnings, use arguments in merge function, and assign
2521 char value < 128 in main.
2522 (Incorrect lookahead during deterministic GLR): New test case.
2523 (Incorrect lookahead during nondeterministic GLR): New test case.
2524
05449a2c
JD
25252006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2526
de366a2f 2527 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
2528 !yyvaluep as signal that no semantic value is available to print.
2529 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
2530 to print a semantic value.
2531
4158e0a1 25322006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 2533
4158e0a1
JD
2534 * tests/glr-regression.at: For consistency with my newer test cases,
2535 don't thank myself.
2536
d659304d
JD
25372006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2538
2539 * data/glr.c (yyresolveValue): When merging semantic options, if at
2540 least one user action succeeds but a later one cuts the parse, then
2541 destroy the semantic value before returning rather than leaking it.
2542 (yyresolveStates): If a user action cuts the parse and thus
2543 yyresolveValue fails, ignore the (unset) semantic value rather than
2544 corrupting the yyGLRState, and empty the semantic options list since
2545 the user actions should have called all necessary destructors.
2546 Simplify code with YYCHK.
2547 * tests/glr-regression.at (Corrupted semantic options if user action
2548 cuts parse): New test case.
2549 (Undesirable destructors if user action cuts parse): New test case.
2550 Before applying any of this patch, this test case never actually failed
2551 for me... but only because the corrupted semantic options usually
2552 masked this bug.
2553 (Leaked merged semantic value if user action cuts parse): New test
2554 case.
2555
6ec2c0f2
AD
25562006-01-05 Akim Demaille <akim@epita.fr>
2557
2558 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
2559
1b9c21fb
PE
25602006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2561
2562 * data/c.m4 (b4_c_modern): New macro, with a new provision for
2563 _MSC_VER. Problem reported by Cenzato Marco.
2564 (b4_c_function_def): Use it.
2565 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
2566 b4_c_modern.
2567 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
2568 than rolling our own.
2569
84866159
AD
25702006-01-04 Akim Demaille <akim@epita.fr>
2571
2572 Also warn about non-used mid-rule values.
2573 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
2574 member.
2575 (symbol_list_new): Adjust.
2576 * src/reader.c (symbol_typed_p): New.
2577 (grammar_rule_check): Use it.
2578 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
2579 Check its rule.
2580 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
2581 Use it.
2582 * tests/actions.at (Exotic Dollars): Adjust.
2583
378f4bd8
AD
25842006-01-04 Akim Demaille <akim@epita.fr>
2585
2586 * src/reader.c (grammar_midrule_action): If $$ is set in a
2587 mid-rule, move the `used' bit to its lhs.
2588 * tests/input.at (Unused values): New.
2589 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
2590
e2a21b6f
PE
25912006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2592
54662697
PE
2593 * doc/bison.texinfo (Bison Options): Say more accurately what
2594 --yacc does.
2595 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
2596 about declarations in the grammar when in Yacc mode, as POSIX does
2597 not require a diagnostic when the grammar uses extensions.
2598
2599 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
2600
073f9288
PE
2601 Warn about dubious constructions like "%token T T".
2602 Reported by twlevo.
2603 * src/symtab.h (struct symbol.declared): New member.
2604 * src/symtab.c (symbol_new): Initialize it to false.
2605 (symbol_class_set): New arg DECLARING, specifying whether
2606 this is a declaration that we want to warn about, if there
2607 is more than one of them. All uses changed.
2608
1221b78a
PE
2609 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
2610 Allow multiple %union directives, whose contents concatenate.
2611 * src/parse-gram.y (grammar_declaration): Likewise.
2612 Use muscle_code_grow, so that we don't need stype_line any more.
2613 All uses changed.
2614
2615 * src/muscle_tab.c (muscle_grow): Fix comment.
2616
e2a21b6f
PE
2617 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
2618 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
2619 Update copyright year to 2006.
2620
8f7e3cf9
AD
26212006-01-03 Akim Demaille <akim@epita.fr>
2622
2623 Have glr.cc pass (some of) the calc.at tests.
2624 * data/glr.cc (b4_parse_param_orig): New.
2625 (b4_parse_param): Improve its definition, and bound it more
2626 clearly in the skeleton.
2627 (b4_epilogue): Append, instead of prepending, in order to keep
2628 #line consistency.
2629 Simplify the generation of auxiliary functions: locations and
2630 purity are mandated.
2631 (b4_global_tokens_and_yystype): Honor it.
2632 * data/location.cc (c++.m4): Don't include it.
2633 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
2634 and AT_SKEL_CC_IF.
2635 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
2636 AT_LALR1_CC_IF.
2637 Be sure to initialize the first position's filename.
2638 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
2639 mandated anyway.
2640 (AT_CHECK_CALC_GLR_CC): New.
2641 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
2642
3953ed88
AD
26432006-01-02 Akim Demaille <akim@epita.fr>
2644
2645 * src/output.c (output_skeleton): Don't hard wire the inclusion of
2646 c.m4.
0a96ba81 2647 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
2648 * data/glr.cc: Do not include stack.hh.
2649
9ecafbbf
AD
26502006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2651
2652 * data/glr.c: Reformat whitespace with tabs.
2653 (b4_lpure_formals): Remove this unused m4 macro.
2654 * tests/cxx-type.at: Reformat whitespace with tabs.
2655 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
2656 since it's a member. Rename type to isNterm for clarity.
2657
c4d497a0
AD
26582005-12-29 Akim <akim@sulaco.local>
2659
2660 Let glr.cc catch up with symbol_value_print.
2661 * data/glr.cc (b4_yysymprint_generate): Replace by...
2662 (b4_yy_symbol_print_generate): this.
2663 (yy_symbol_print, yy_symbol_value_print): Declare them.
2664
4517da37
PE
26652005-12-28 Paul Eggert <eggert@cs.ucla.edu>
2666
2667 * src/location.h (boundary): Note that a line or column equal
2668 to INT_MAX indicates an overflow.
2669 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
2670 (rule_length_overflow, increment_rule_length, add_column_width):
2671 New functions.
2672 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
2673 (<SC_BRACED_CODE>"}"):
2674 Use increment_rule_length rather than incrementing it by hand.
2675 (adjust_location, handle_syncline): Diagnose overflow.
2676 (handle_action_dollar, handle_action_at):
2677 Fix bug with monstrosities like $-2147483648.
2678 Remove now-unnecessary checks.
2679 (scan_integer): Verify assumptions and remove now-unnecessary checks.
2680 (convert_ucn_to_byte): Verify assumptions.
2681 (handle_syncline): New arg LOC. All callers changed.
2682 Don't store through a value derived from char const * pointer.
2683
2684 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
2685 GCC warnings.
2686
e3233bf6
PE
26872005-12-27 Paul Eggert <eggert@cs.ucla.edu>
2688
2689 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
2690 Remove unnecessary forward static decls.
2691
8f3596a6
AD
26922005-12-27 Akim Demaille <akim@epita.fr>
2693
2694 * src/reader.c (grammar_current_rule_check): Also check that $$
2695 is used.
2696 Take the rule to check as argument, hence rename as...
2697 (grammar_rule_check): this.
2698 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
2699 Rename as...
2700 (grammar_rule_begin, grammar_rule_end): these, for consistency.
2701 (grammar_midrule_action, grammar_symbol_append): Now static.
2702 * tests/torture.at (input): Don't rely on the default action
2703 being always performed.
2704 * tests/calc.at: "Set" $$ even when the action is "cut" with
2705 YYERROR or other.
2706 * tests/actions.at (Exotic Dollars): Instead of using unused
2707 values, check that the warning is issued.
2708
721be13c
PE
27092005-12-22 Paul Eggert <eggert@cs.ucla.edu>
2710
2711 * NEWS: Improve wording for unused-value warnings.
2712
a0af42fc
AD
27132005-12-22 Akim Demaille <akim@epita.fr>
2714
2715 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
2716 (b4_yysymprint_generate): Rename as...
2717 (b4_yy_symbol_print_generate): this.
2718 Generate yy_symbol_print instead of yysymprint.
2719 Generate also yy_symbol_value_print, and use it.
2720
affac613
AD
27212005-12-22 Akim Demaille <akim@epita.fr>
2722
721be13c 2723 * NEWS: Warn about unused values.
affac613
AD
2724 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
2725 a `used' member.
2726 (symbol_list_n_get, symbol_list_n_used_set): New.
2727 (symbol_list_n_type_name_get): Use symbol_list_n_get.
2728 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
2729 * src/reader.c (grammar_current_rule_check): Check that values are
2730 used.
2731 * src/symtab.c (symbol_print): Accept 0.
2732 * tests/existing.at: Remove the type information.
2733 Empty the actions.
2734 Remove useless actions (beware of mid-rule actions: perl -000
2735 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
2736 * tests/actions.at (Exotic Dollars): Use unused values.
2737 * tests/calc.at: Likewise.
2738 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2739 Likewise.
2740
2741 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
2742 rule_useful_p.
2743
9d9b8b70
PE
27442005-12-21 Paul Eggert <eggert@cs.ucla.edu>
2745
8bb4c753
PE
2746 Undo 2005-12-01 tentative license wording change. The wording is
2747 still being reviewed by the lawyers, and we don't want to wait for
2748 them before publishing a test release. For now, revert to the
2749 previous wording.
2750 * NEWS: Undo 2005-12-01 change.
2751 * data/glr.c: Revert to previous license wording.
2752 * data/glr.cc: Likewise.
2753 * data/lalr1.cc: Likewise.
2754 * data/location.cc: Likewise.
2755 * data/yacc.c: Likewise.
2756
9d9b8b70
PE
2757 * NEWS: Reword %destructor vs YYABORT etc.
2758 * data/glr.c: Use American spacing, for consistency.
2759 * data/glr.cc: Likewise.
2760 * data/lalr1.cc: Likewise.
2761 * data/yacc.c: Likewise.
2762 * data/yacc.c: Reformat comments slightly.
2763 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
2764 for consistency. Fix some spelling errors and reword recently-included
2765 text slightly.
2766 * tests/cxx-type.at: Cast results of malloc, for C++.
2767
2c3b392a
AD
27682005-12-21 Joel E. Denny <address@hidden>
2769
2770 * tests/cxx-type.at: Construct a tree, count the parents of shared
2771 nodes, and free each node once and only once. Previously, the memory
2772 for semantic values was leaked instead.
2773
d6cff4dc
AD
27742005-12-21 Joel E. Denny <address@hidden>
2775
2776 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
2777 (yylval, yylloc): If pure, #define to yystackp->yyval and
2778 yystackp->yyloc similar to yychar and yynerrs.
2779 (yyparse): If pure, remove local yylval and yylloc. Add local
2780 yystackp to accommodate pure definitions of yylval and yylloc.
2781 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
2782 yylvalp and yyllocp to &yylval and &yylloc.
2783 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
2784 namespace. Previously, nerrs and char were missing, but lval and lloc
2785 weren't necessary.
2786 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
2787 yylvalp and yyllocp parameters since, if pure, these are now always
2788 accessible through yystackp. If not pure, they are still accessible
2789 globally.
2790 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
2791 `if (YYID (N))' to pacify lint.
2792
a85284cf
AD
27932005-12-21 Akim Demaille <akim@epita.fr>
2794
2795 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
2796 destroy the RHS symbols of a rule.
2797 * data/yacc.c (yylen): Initialize to 0.
2798 Keep its value to the number of items to possibly shift.
2799 In particular, a regular successful parse that ends on YYFINAL by
2800 a (internal) YYACCEPT must not have yylen != 0.
2801 (yyerrorlab, yyreturn): Pop the RHS.
2802 Reorder a bit to emphasize the `shifting' bits of code.
2803 (YYPOPSTACK): Now accept a number of items to pop.
2804 * data/lalr1.cc: Likewise.
2805 * data/glr.c: Formatting changes.
2806 Use goto instead of fall through.
2807 * doc/bison.texinfo (Destructor Decl): Complete.
2808
d508c281
JMG
28092005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2810
2811 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
2812 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
2813 * djgpp/config.bat: Replace every occurence of the file name
2814 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
2815 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
2816 * djgpp/config.sed: Replace every occurence of the file name
2817 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
2818 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
2819 * djgpp/djunpack.bat: DJGPP specific file.
2820 * djgpp/fnchange.lst: DJGPP specific file.
2821 * djgpp/README.in: Add new information about how to unpack the bison
2822 source on MSDOS and other systems which have 8.3 file name restrictions
2823 using djunpack.bat and fnchange.lst.
2824
3e7a2cd9
PE
28252005-12-12 Paul Eggert <eggert@cs.ucla.edu>
2826
2827 * bootstrap (build_cvs_prefix): Remove; unused.
2828 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
2829 when getting gnulib.
2830
28312005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
2832
2833 * data/glr.c: Reorder typedef declarations for structs to match order
2834 of struct declarations.
2835 Rename yystack everywhere to yystackp except in yyparse where it's not
2836 a pointer.
2837 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
2838 consistency.
2839 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
2840 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
2841 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
2842 lint.
2843
877519f8
PE
28442005-12-09 Paul Eggert <eggert@cs.ucla.edu>
2845
0eca5a39
PE
2846 * tests/sets.at (Accept): Fix typos in regular expression used to
2847 sed out the final state number.
2848
2cec9080
PE
2849 Work around portability problem on Solaris 10: flex-generated
2850 files include <stdio.h> before <config.h>, which messes up
2851 because the latter defines __EXTENSIONS__. Address the problem
2852 by creating two new little files that include <config.h> first,
2853 then include the flex-generated files. Rewrite everyone else
2854 to include <config.h> first, as well.
2855 * lib/timevar.c: Always include "config.h".
2856 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
2857 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
2858 (EXTRA_bison_SOURCES): New macro.
2859 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
2860 * src/system.h: Don't include config.h.
2861 * src/LR0.c: Include <config.h> first.
2862 * src/assoc.c: Likewise.
2863 * src/closure.c: Likewise.
2864 * src/complain.c: Likewise.
2865 * src/conflicts.c: Likewise.
2866 * src/derives.c: Likewise.
2867 * src/files.c: Likewise.
2868 * src/getargs.c: Likewise.
2869 * src/gram.c: Likewise.
2870 * src/lalr.c: Likewise.
2871 * src/location.c: Likewise.
2872 * src/main.c: Likewise.
2873 * src/muscle_tab.c: Likewise.
2874 * src/nullable.c: Likewise.
2875 * src/output.c: Likewise.
2876 * src/parse-gram.y: Likewise.
2877 * src/print.c: Likewise.
2878 * src/print_graph.c: Likewise.
2879 * src/reader.c: Likewise.
2880 * src/reduce.c: Likewise.
2881 * src/relation.c: Likewise.
2882 * src/state.c: Likewise.
2883 * src/symlist.c: Likewise.
2884 * src/symtab.c: Likewise.
2885 * src/tables.c: Likewise.
2886 * src/uniqstr.c: Likewise.
2887 * src/vcg.c: Likewise.
2888
877519f8
PE
2889 * src/parse-gram.y: Fix minor problems uncovered by lint.
2890 (current_lhs, current_lhs_location): Now static.
2891 (current_assoc): Remove unused variable.
2892
2893 Cleanups so that Bison-generated parsers have less lint.
2894 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
2895 Prepend /*ARGSUSED*/, for lint's sake.
2896 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
2897 definition if 'lint' is defined.
2898 (YYID): New macro (or function, if lint).
2899 All uses of /*CONSTCOND*/0 replaced by YYID(0).
2900 * data/yacc.c: Likewise.
2901 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
2902 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
2903 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
2904 is C++ only.
2905 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
2906 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
2907 Use YYID(0) rather than 0, for lint.
2908 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
2909 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
2910
f5228370
PE
29112005-12-07 Paul Eggert <eggert@cs.ucla.edu>
2912
2913 * tests/glr-regression.at
2914 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
2915 Close memory leak reported by twlevo.
2916
69ce078b
PE
29172005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
2918
6ff99711
PE
2919 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
2920 all stacks.
2921 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
2922 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2923 New test case.
2924 (Duplicated user destructor for lookahead): This test now is expected
2925 to succeed.
2926
af3412cd
PE
29272005-12-01 Paul Eggert <eggert@cs.ucla.edu>
2928
32b5b719 2929 * NEWS: Document the following change.
af3412cd
PE
2930 * data/yacc.c: Say "parser skeleton" rather than "file", since
2931 it's no longer just a file.
2932 * data/glr.c: Grant a special exception for C GLR parsers, that
2933 reads like the already-existing exception for C LALR(1) parsers.
2934 * data/glr.cc: Likewise.
2935 * data/lalr1.cc: Likewise.
2936 * data/location.cc: Likewise.
2937 * data/yacc.c: Reword the "written by" statement to clarify that
2938 it was the parser skeleton, not the entire output file.
2939 * data/glr.c: Written by Paul Hilfinger.
2940 * data/glr.cc: Written by Akim Demaille.
2941 * data/lalr1.cc: Likewise.
2942
035aa4a0
PE
29432005-11-18 Paul Eggert <eggert@cs.ucla.edu>
2944
d9963c85
PE
2945 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
2946 Fix typos in previous change that broke 'make check'.
2947 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
2948 supported in C.
2949 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
2950 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
2951 We can revert this once things settle down.
2952
035aa4a0
PE
2953 * src/conflicts.c (conflicts_print): Don't print file name twice
2954 when %expect fails because there were no conflicts.
2955 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
2956 change.
2957 * tests/conflicts.at (%expect not enough, %expect too much):
2958 (%expect with reduce conflicts): Adjust to new behavior.
2959
29602005-11-18 Akim Demaille <akim@epita.fr>
2961
2962 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
2963 errors.
2964 * NEWS: Document this.
2965 * doc/bison.texinfo (Expect Decl): Likewise.
2966
d1ff7a7c
AD
29672005-11-16 Akim Demaille <akim@epita.fr>
2968
2969 Generalize the display of semantic values and locations in traces.
2970 * data/glr.c (yy_reduce_print): Fix indices (again).
2971 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
2972 literal integers.
2973 * data/lalr1.cc (yyreduce_print): Rename as...
2974 (yy_reduce_print): this.
2975 Display values and locations.
2976 * data/yacc.c (yy_reduce_print): Likewise.
2977 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
2978 (yysymprint): Move higher to be visible from yy_reduce_print).
2979 (yyparse): Adjust.
2980 * tests/calc.at: Adjust the expected length of the traces.
2981
6de5398d
AD
29822005-11-14 Akim Demaille <akim@epita.fr>
2983
2984 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
2985 from 1 to N, while values and location start at 0.
2986 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
2987
a1373f55
AD
29882005-11-14 Akim Demaille <akim@epita.fr>
2989
2990 * data/glr.c (yy_reduce_print): Fix the $ number.
2991
613d8952
AD
29922005-11-14 Akim Demaille <akim@epita.fr>
2993
2994 "Use" parse parameters.
2995 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
2996 * data/glr.c, data/glr.cc: Use them.
2997 * data/glr.c (YYUSE): Have a C++ definition that supports
2998 non-pointer types.
2999
b2741627
AD
30002005-11-14 Akim Demaille <akim@epita.fr>
3001
3002 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3003
5059b5c8
AD
30042005-11-14 Akim Demaille <akim@epita.fr>
3005
42249483
AD
3006 * data/glr.cc: New.
3007 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 3008
4626a15d
AD
30092005-11-12 Akim Demaille <akim@epita.fr>
3010
3011 Let position and location be PODs.
3012 * data/location.cc (position::initialize, location::initialize): New.
3013 (position::position, location::location): Define only if
3014 b4_location_constructors is defined.
3015 * data/lalr1.cc (b4_location_constructors): Define it for backward
3016 compatibility.
3017 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3018
30192005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
3020
3021 * data/lalr1.cc: Move the body of the ctor and dtor into the
3022 parser file (instead of the header).
3023 Wrap the implementations in a "namespace yy".
3024
30252005-11-12 Akim Demaille <akim@epita.fr>
3026
3027 Have glr.c include its header file when created.
3028 * data/glr.c (b4_shared_declarations): New.
3029 Output them verbatim in the parser if !%defines, otherwise
3030 output then in the header file, and include it instead.
3031
1989d947
AD
30322005-11-11 Akim Demaille <akim@epita.fr>
3033
3034 * data/glr.c: Comment changes.
3035
30362005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
3037
3038 When yydebug, report semantic and location values for reductions.
3039 * data/glr.c (yy_reduce_print): Report the semantic values and the
3040 locations.
3041 (YY_REDUCE_PRINT): Adjust.
3042 (yyglrReduce): Use them.
3043 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3044 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3045 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3046 traces.
3047
02998094
AD
30482005-11-10 Akim Demaille <akim@epita.fr>
3049
3050 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3051 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3052 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3053
5210672f
PE
30542005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3055
3056 * m4/cxx.m4, examples/Makefile.am: Don't build
3057 examples/calc++ if no C++ compiler is available. (trivial change)
3058
a8991a1d
AD
30592005-11-09 Akim Demaille <akim@epita.fr>
3060
3061 * src/scan-skel.l: Use a couple of asserts.
3062
36b5e963
AD
30632005-11-03 Akim Demaille <akim@epita.fr>
3064
3065 In some (weird) cases, the final state number is incorrect.
3066 Reported by Alexandre Duret-Lutz.
3067 * src/LR0.c (state_list_append): Remove the computation of
3068 final_state.
3069 (save_reductions): Do it here.
3070 (get_state): Alpha conversion.
3071 (generate_states): Use a for loop.
3072 * src/gram.h (item_number_is_rule_number)
3073 (item_number_is_symbol_number): New.
3074 * src/state.c: Use assert.
3075 * src/system.h: Include assert.h.
3076 * tests/sets.at (Accept): New.
3077
44e7ead1
PH
30782005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3079
3080 * data/glr.c (yyfill): Adjust comment.
36b5e963 3081 (yyresolveAction): Initialize default location properly
44e7ead1
PH
3082 for empty right-hand sides.
3083 (yydoAction): Ditto.
3084 Add comment explaining apparently dead code.
36b5e963
AD
3085 * tests/glr-regression.at
3086 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 3087 New test.
36b5e963 3088
e10a80ee
PE
30892005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3090
3091 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3092 gnulib when interrupted. This fixes some race conditions and
3093 works around some portability problems (one noted by Paul
3094 Hilfinger).
3095
067b32ee
AD
30962005-10-22 Akim <akim@epita.fr>
3097
3098 * Makefile.cfg: Adjust to config -> build-aux.
3099 Reported by twledo.
3100
4b367315
AD
31012005-10-21 Akim Demaille <akim@epita.fr>
3102
3103 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3104 the %parse-params.
3105 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3106 * data/yacc.c (b4_Pure_if): Rename as...
3107 (b4_yacc_pure_if): this.
3108 (YY_SYMBOL_PRINT, yyparse): Adjust.
3109 * doc/bison.texinfo: Formatting changes.
3110
24cc23d9
AD
31112005-10-21 Akim Demaille <akim@epita.fr>
3112
3113 Finish the transition config -> build-aux.
3114 * configure.ac, Makefile.am: Use build-aux.
3115 * config/prev-version, config/announce-gen, config/Makefile.am:
3116 Move to...
3117 * build-aux/prev-version, build-aux/announce-gen,
3118 * build-aux/Makefile.am: here.
3119
d4476375
AD
31202005-10-14 Akim Demaille <akim@epita.fr>
3121
3122 * examples/calc++/test: Use set -x only when VERBOSE.
3123
302c0aee
PE
31242005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3125
3126 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3127 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3128
7625ec2c
AD
31292005-10-13 Akim Demaille <akim@epita.fr>
3130
3131 * src/scan-skel.l: Output the base name parts of the parser and
3132 header file names.
302c0aee 3133 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
3134 additional checks.
3135 Use this to exercise C++ outputs in subdirs.
3136 Reported by Oleg Smolsky.
3137
ba0fe3c7
PE
31382005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3139
3140 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3141 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3142 Problem reported by John P. Hartmann.
3143 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3144 already defined it.
3145
9b8a5ce0
AD
31462005-10-12 Akim Demaille <akim@epita.fr>
3147
3148 * src/parse-gram.y (version_check): Exit 63 to please missing
3149 (stands for "version mismatch).
3150 * tests/input.at, doc/bison.texinfo: Adjust.
3151
4f6e011e
PE
31522005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3153
3154 Work around portability problems with Visual Age C compiler
3155 (xlc and xlC_r) reported by John P. Hartmann.
3156 * data/location.cc (initial_column, initial_line): Remove.
3157 All uses replaced by 0 and 1.
3158 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3159 that xlc complains about.
3160 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 3161 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 3162 as __STDC__.
4d7aa45e
PE
3163 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3164 __STDC_VERSION__. Use it everywhere instead of looking at
3165 __STDC__ and __cplusplus.
4f6e011e 3166
a1b3bf8c
AD
31672005-10-10 Akim Demaille <akim@epita.fr>
3168
3169 * examples/calc++/test: Be quiet unless VERBOSE.
3170
412e44aa
PE
31712005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3172
2a4647a3
PE
3173 * data/c.m4 (yydestruct, yysymprint):
3174 Use YYUSE instead of casting to void.
3175 * data/glr.c (YYUSE): New macro.
3176 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3177 Use it instead of rolling our own.
3178 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3179 (YYCHK1):
3180 Use /*CONSTCOND*/ to suppress lint warnings.
3181 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3182 (YY_STACK_PRINT): Use 'false' not '0'.
3183 (YYUSE): New macro.
3184 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3185 * data/yacc.c (YYUSE): New macro.
3186 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3187 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3188 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3189
3190
412e44aa
PE
3191 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3192 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3193
88c6637f
PE
31942005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3195
2f4f028d
PE
3196 Undo the parts of the unlocked-I/O change that substituted
3197 putc or puts for printf. This might hurt performance a bit,
3198 but some people prefer the printf style.
3199 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3200 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3201 All uses replaced by YYFPRINTF and YYDPRINTF.
3202 * data/yacc.c: Likewise.
3203 * lib/bitset.c (bitset_print): Likewise.
3204 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3205 putc and puts.
3206 * lib/lbitset.c (debug_lbitset): Likewise.
3207 * src/closure.c (print_firsts, print_fderives): Likewise.
3208 * src/gram.c (grammar_dump): Likewise.
3209 * src/lalr.c (look_ahead_tokens_print): Likewise.
3210 * src/output.c (escaped_output): Likewise.
3211 (user_actions_output): Break apart two printfs.
3212 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3213 * src/reduce.c (reduce_print): Likewise.
3214 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3215 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3216
88c6637f
PE
3217 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3218 Use assignments rather than casts-to-void to suppress
3219 unused-variable warnings. This pacifies 'lint'.
3220 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3221 unused-variable warnings.
3222
fb32e373
JMG
32232005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3224
3225 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3226
edb8f44f
PE
32272005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3228
fb9c0b33
PE
3229 Use unlocked I/O for a minor performance improvement on hosts like
3230 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3231 is to use the gnlib unlocked-io module, and to prefer putc and
3232 puts to printf when either will work (since the latter doesn't
3233 come in an unlocked flavor).
3234 * bootstrap (gnulib_modules): Add unlocked-io.
3235 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3236 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3237 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3238 and similarly for puts and putc and printf.
3239 * data/yacc.c: Likewise.
3240 * lib/bitset.c (bitset_print): Likewise.
3241 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3242 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3243 to printf.
3244 * lib/lbitset.c (debug_lbitset): Likewise.
3245 * src/closure.c (print_firsts, print_fderives): Likewise.
3246 * src/gram.c (grammar_dump): Likewise.
3247 * src/lalr.c (look_ahead_tokens_print): Likewise.
3248 * src/output.c (escaped_output): Likewise.
3249 (user_actions_output): Coalesce two printfs.
2f4f028d 3250 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
3251 * src/reduce.c (reduce_print): Likewise.
3252 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 3253 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 3254
edb8f44f
PE
3255 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3256 this confuses xgettext.
3257
b50d2359
AD
32582005-10-02 Akim Demaille <akim@epita.fr>
3259
3260 * bootstrap (gnulib_modules): Add strverscmp.
3261 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3262 * m4/.cvsignore: Add strverscmp.m4.
3263 * src/parse-gram.y (%require): New token, new rule.
3264 (version_check): New.
3265 * src/scan-gram.l (%require): Adjust.
3266 * tests/input.at (AT_REQUIRE): New.
3267 Use it.
3268 * doc/bison.texinfo (Require Decl): New.
3269 (Calc++ Parser): Use %require.
3270
21667f64
AD
32712005-10-02 Akim Demaille <akim@epita.fr>
3272
3273 * data/location.cc: New.
3274
2b81e969
AD
32752005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3276 Akim Demaille <akim@epita.fr>
3277
3278 Make sure -odir/foo.cc creates dir/location.hh etc.
3279 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
3280 (spec_file_prefix, spec_verbose_file, spec_graph_file)
3281 (spec_defines_file): Now const.
3282 (dir_prefix): New.
3283 (short_base_name): Remove.
3284 * src/files.c: Adjust.
3285 (dirname.h): Include.
3286 (base_name): Don't prototype it.
3287 (finput): Remove, duplicates gram_in.
3288 (full_base_name, short_base_name): Replace by...
3289 (all_but_ext, all_but_tab_ext): these.
3290 (compute_base_names): Rename as...
3291 (compute_file_name_parts): this.
3292 Update to compute the new variables, including dir_prefix.
3293 Adjust dependencies.
3294 * src/output.c (prepare): Output them.
3295 * src/reader.c: Adjust to use gram_in, not finput.
3296 * src/scan-skel.l (@dir_prefix@): New.
3297
ad6a9b97
JMG
32982005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3299
3300 * lib/subpipe.c: New function end_of_output_subpipe() added
3301 to allow support for non-posix systems. This is a no-op function
3302 for posix systems.
3303
3304 * lib/subpipe.h: New function end_of_output_subpipe() added
3305 to allow support for non-posix systems. This is a no-op function
3306 for posix systems.
3307
3308 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3309 handle the lack of pipe/fork functionality on non-posix systems.
3310
3311 * djgpp/Makefile.maint: DJGPP specific file.
3312
3313 * djgpp/README.in: DJGPP specific file.
3314
3315 * djgpp/config.bat: DJGPP specific configuration file.
3316
3317 * djgpp/config.sed: DJGPP specific configuration file.
3318
3319 * djgpp/config.site: DJGPP specific configuration file.
3320
3321 * djgpp/config_h.sed: DJGPP specific configuration file.
3322
3323 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
3324
3325 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
3326
fc695704
AD
33272005-10-02 Akim Demaille <akim@epita.fr>
3328
3329 * data/location.cc: New, extract from...
3330 * data/lalr1.cc: here.
3331 (location.hh): Include it after the user prologue, in case the
3332 filename type is defined by the user.
3333 Forward declation location and position before the pre-prologue.
3334 (yyresult_): Rename as...
3335 (yyresult): this, it's a local variable, not an attribute.
3336 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
3337
33382005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
3339
3340 * examples/extexi: Restore the #line generation.
3341
fb9712a9
AD
33422005-09-30 Akim Demaille <akim@epita.fr>,
3343 Alexandre Duret-Lutz <adl@gnu.org>
3344
3345 Move the token type and YYSTYPE in the parser class.
3346 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
3347 (parser::token): New, from the moved free definition of tokens.
3348 (parser::semantic_value): Now a full definition instead of an
3349 indirection to YYSTYPE.
3350 (b4_post_prologue): No longer included in the header file, but
3351 in the implementation file.
3352 * doc/bison.texi (C+ Language Interface): Update.
3353 * src/parse-gram.y: Support unary %define.
3354 * tests/actions.at: Define global_tokens_and_yystype for backward
3355 compatibility until we update the tests.
3356 * tests/calc.at: Idem.
3357 (first_line, first_column, last_line, last_column): Define for lalr1.cc
3358 to simplify the code.
3359
55f0c7b1
PE
33602005-09-29 Paul Eggert <eggert@cs.ucla.edu>
3361
3362 Port to SunOS 4.1.4, which lacks strtoul and strerror.
3363 Ah, the good old days! Problem reported by Peter Klein.
3364 * bootstrap (gnulib_modules): Add strerror, strtoul.
3365 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
3366 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
3367
fb9712a9 33682005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
3369
3370 * data/c.m4 (b4_error_verbose_if): New.
3371 * data/lalr1.cc: Use it.
3372 (YYERROR_VERBOSE_IF): Remove.
3373 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
3374 parser members, replaced by...
3375 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
3376 local variables.
3377 (yysyntax_error_): Takes the state number as argument.
3378 (yyreduce_print_): Use the argument yyrule, not the former
3379 attribute yyn_.
3380
8a6f72f3
PE
33812005-09-26 Paul Eggert <eggert@cs.ucla.edu>
3382
3383 * bootstrap (gnulib_modules): Add verify.
3384 * lib/.cvsignore: Add verify.h.
3385 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
3386 * src/system.h (verify): Remove.
3387 Include verify.h instead.
3388 * src/tables.c (tables_generate): Use new API for 'verify'.
3389
0d50976f
PE
33902005-09-21 Paul Eggert <eggert@cs.ucla.edu>
3391
ebc3737e
PE
3392 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
3393 local variables whose names begin with 'yy'.
3394 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
3395 Trivial changes from Joel E. Denny.
3396
0d50976f
PE
3397 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
3398 it itself.
3399 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
3400 don't use alloca any more.
3401
3402 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
3403 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 3404 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
3405 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
3406 to match yacc.c, to test more hosts.
3407
a05b79df
PE
34082005-09-20 Paul Eggert <eggert@cs.ucla.edu>
3409
55289366
PE
3410 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
3411 doesn't affect behavior.
3412 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
3413 Solaris, AIX, MSC.
3414 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
3415 This works a bit better with glibc, if user code has already included
3416 stdlib.h.
3417 * doc/bison.texinfo (Bison Parser): Document that users can't
3418 arbitrarily use malloc and free for other purposes. Document
3419 that <alloca.h> and <malloc.h> might be included.
3420 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
3421 user must declare alloca.
3422
a05b79df
PE
3423 * HACKING (release): Forwarn the Translation Project about
3424 stable releses.
3425
3ab2ca22
AD
34262005-09-20 Akim Demaille <akim@epita.fr>
3427
3428 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
3429
a9739e7c
PE
34302005-09-19 Paul Eggert <eggert@cs.ucla.edu>
3431
a702593e
PE
3432 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
3433 (YYSTACK_ALLOC_MAXIMUM): Use it.
3434 (yysyntax_error): New function.
3435 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
3436 multiple syntax errors are reported, and alloca is being used.
3437 Instead, reallocate buffers twice as big each time, so that
3438 we waste at most half the allocated memory. Start with a small
3439 (128-byte) buffer that will suffice in most cases anyway.
3440 Use yysyntax_error to do most of the work.
3441
3442 * doc/bison.texinfo (Error Reporting, Table of Symbols):
3443 yynerrs is the number of errors reported, not the number of
3444 errors encountered.
3445
a9739e7c
PE
3446 * tests/glr-regression.at (Duplicated user destructor for lookahead):
3447 Mark it as expected to fail.
3448 Cast result of malloc; problem reported by twlevo@xs4all.nl.
3449 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
3450 Don't start user-code symbols with "yy", to avoid name space problems.
3451
f479c6c6
AD
34522005-09-19 Akim Demaille <akim@epita.fr>
3453
3454 Remove the traits, failed experiment.
3455 It never proved useful, and anyway because of the current
3456 definition, it was not possible to have several specialization of
3457 this traits, making it useless.
3458 * data/lalr1.cc (yy:traits): Remove.
3459 Inline its definitions in the parser class.
3460
e2586f82
AD
34612005-09-19 Akim Demaille <akim@epita.fr>
3462
3463 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
3464 least Mac OSX with a /usr/local install of gettext.
3465
2e8cf949
AD
34662005-09-19 Akim Demaille <akim@epita.fr>
3467
3468 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
3469 and yytoken for similarity with the other skeletons.
3470
c7fb0b90
AD
34712005-09-19 Akim Demaille <akim@epita.fr>
3472
4e26c69e 3473 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 3474
1bd0deda
PE
34752005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3476
3477 * NEWS: Version 2.1.
3478
3479 * NEWS: Remove notice of yytname change, since it was never in an
3480 official release.
3481 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
3482 diagnostic.
3483 * src/output.c (prepare): Likewise.
3484 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
3485 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
3486 is not defined. This is an awful hack, but it's enough for now.
3487 All callers changed.
3488 * tests/glr-regression-at (make_value): Args are const pointers now,
3489 to avoid GCC warning.
3490 (Duplicated user destructor for lookahead): New test. Currently
3491 skipped. It fails on my host but I'm not sure it'll always fail.
3492
34932005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
3494
3495 * src/symtab.h (struct symbol): Declare the printer and destructor
3496 as const, to avoid accidental calls to free.
3497 (symbol_destructor_set, symbol_printer_set): Adjust.
3498 * src/symtab.c: Adjust.
3499
1bd0deda 35002005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
3501
3502 * data/c.m4 (b4_token_enums): New.
3503 (b4_token_defines): Rename as...
3504 (b4_token_enums_defines): this.
3505 (b4_token_defines): New, output only the #defines.
3506 * data/yacc.c, data/glr.c: Adjust.
3507 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
3508 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
3509 as default values.
3510
dbcdae2d
AD
35112005-09-16 Akim Demaille <akim@epita.fr>
3512
3513 * data/lalr1.cc (yylex_): Remove, inline its code.
3514 (yyreport_syntax_error_): Remove, replaced by...
3515 (yysyntax_error_): this which returns a string and leaves to the
3516 caller the call to the users' error function.
3517 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
3518 Move from members of the parser object...
3519 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
3520 to local variables of the parse function.
3521
70d8f291
AD
35222005-09-16 Akim Demaille <akim@epita.fr>
3523
3524 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
3525 since it's in Bison's name space.
3526
b47dbebe
PE
35272005-09-15 Paul Eggert <eggert@cs.ucla.edu>
3528
ae199bf1
PE
3529 * data/glr.c (yyresolveValue): Add default case to pacify
3530 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
3531
b47dbebe
PE
3532 * NEWS: Document when yyparse started to return 2.
3533 * doc/bison.texinfo (Parser Function): Document when yyparse
3534 returns 2.
3535
3536 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
3537 (b4_filename_type): Renamed back from b4_file_name_type. All uses
3538 changed.
3539 (class position): file_name -> filename (reverting). All uses changed.
3540
35412005-09-14 Paul Eggert <eggert@cs.ucla.edu>
3542
3543 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
3544 do anything if $@ exists. This reverts part of the 2005-07-07
3545 patch.
3546
00292f66
PE
35472005-09-11 Paul Eggert <eggert@cs.ucla.edu>
3548
3549 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
3550 contains obsolete information and isn't worth distributing as a
3551 separate file anyway.
3552 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
3553 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
3554 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
3555 (yyparse): Abort if user code uses longjmp to throw an unexpected
3556 value.
3557
a420f962
PE
35582005-09-09 Paul Eggert <eggert@cs.ucla.edu>
3559
00292f66
PE
3560 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
3561 Suggested by twlevo@xs4all.nl.
3562
127287e9
PE
3563 * data/glr.c (YYCHK1): Do not assume YYE is in range.
3564 This avoids a diagnostic from gcc -Wswitch-enum.
3565 Problem reported by twlevo@xs4all.nl.
3566
a420f962
PE
3567 * doc/bison.texinfo: Don't use "filename", as per GNU coding
3568 standards. Use "file name" or "file" or "name", depending on
3569 the context.
3570 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
3571 not to hack/foo.tab.c.
3572 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
3573 * data/glr.c: b4_filename -> b4_file_name.
3574 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
3575 All uses changed.
3576 (class position): filename -> file_name. All uses changed.
3577 * data/yacc.c: b4_filename -> b4_file_name.
3578 * lib/bitset.h: filename -> file_name in local vars.
3579 * lib/bitset_stats.c: Likewise.
3580 * src/files.c: Likewise.
3581 * src/scan-skel.l ("@output ".*\n): Likewise.
3582 * src/files.c (file_name_split): Renamed from filename_split.
3583 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
3584
35852005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
3588 to accommodate latest gnulib.
3589
3590 * tests/glr-regression.at (Duplicate representation of merged trees):
3591 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
3592
3593 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
3594 needed.
3595
42a6501d
PE
35962005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3597
3598 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
3599 All uses changed. Invoke user destructor after an error during a
3600 split parse (trivial change from Joel E. Denny).
3601
3602 * tests/glr-regression.at
3603 (User destructor after an error during a split parse): New test case.
3604 Problem reported by Joel E. Denny in:
3605 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
3606
ef9a1faf
PE
36072005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3608
5b4aaf78
PE
3609 * README-cvs: Give URLs for recommended tools.
3610 Mention Gzip version problem, and bootstrapping issues.
3611 Remove troubleshooting section, as it's somewhat obsolete.
3612
b5240ba5
PE
3613 * bootstrap (no_cache): New var, to accommodate different wget
3614 variants. Use it instead of '-C off'. Problem reported by
3615 twlevo@xs4all.nl.
3616
ef9a1faf
PE
3617 * data/glr.c (yydestroyStackItem): New function.
3618 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
3619 debugging information. Problem reported by Joel E. Denny.
3620
e6efa9da
AD
36212005-08-25 Akim Demaille <akim@epita.fr>
3622
3623 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
3624
adc90f13
PE
36252005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3626
3627 * data/glr.c (yyrecoverSyntaxError, yyreturn):
3628 Don't invoke destructor on unresolved entries.
3629 * tests/glr-regression.at
3630 (User destructor for unresolved GLR semantic value): New test case.
3631 Problem reported by Joel E. Denny in:
3632 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
3633
f9315de5
PE
36342005-08-21 Paul Eggert <eggert@cs.ucla.edu>
3635
15d29c1f
PE
3636 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
3637 Add strnlen.c.
3638 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
3639 lib-prefix.m4, po.m4.
3640
dd5f2af2
PE
3641 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
3642 in yydestruct diagnostic, since it might not be an error.
3643 Problem reported by Joel Denny near end of
3644 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 3645 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
3646 * data/yacc.c (yyreturn): Likewise.
3647 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
3648
3649 * src/files.c: Remove obsolete FIXME comment.
3650
3651 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
3652 with the other templates, and to fix bogus run-on messages such
3653 as the one reported at the end of
3654 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3655 All callers changed to avoid the newline.
3656 (yyprocessOneStack): Output two lines rather than one, to accommodate
3657 the above change. This changes the debug output format slightly.
3658
f9315de5
PE
3659 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
3660 reported by Joel E. Denny in
3661 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
3662 (trivial change).
3663 * tests/glr-regression.at (Duplicate representation of merged trees):
3664 New test, from Joel E. Denny in:
3665 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
3666 * THANKS: Add Joel E. Denny.
3667
3668 * configure.ac (AC_INIT): Bump to 2.0c.
3669
04098407
PE
36702005-07-24 Paul Eggert <eggert@cs.ucla.edu>
3671
3672 * NEWS: Version 2.0b.
3673
ca5d2013
PE
3674 * Makefile.am (SUBDIRS): Put examples before tests, so that
3675 "make check" doesn't finish with "All 1 tests passed".
3676
3d54b576
PE
3677 * tests/regression.at (Token definitions): Don't rely on
3678 AT_PARSER_CHECK for data that contains backslashes. It currently
3679 uses 'echo', and 'echo' isn't portable if its argument contains
3680 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
3681 that the byte '\0xff' is not printable in the C locale; it is,
3682 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
3683 not printable, so use '\0x81' to test.
3684
d53ae497
PE
3685 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
3686 version of GCC, since the macro is used with non-GCC compilers.
3687
fc01665e
PE
3688 Fix core dump reported by Pablo De Napoli in
3689 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
3690 * tests/regression.at (Invalid inputs with {}): New test.
3691 * src/parse-gram.y (token_name): Translate type before using
3692 it as an index.
3693
04098407
PE
3694 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
3695 the user's name space. All uses changed to __attribute__
3696 ((__unused__)).
3697 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
3698 Add __attribute__ ((__noreturn__)).
3699
3700 * etc/clcommit: Remove. We weren't using it, and it failed
3701 "make maintainer-distcheck".
3702 * Makefile.maint: Merge from coreutils.
3703 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
3704 (syntax-check-rules): Change list of rules as described below.
3705 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
3706 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
3707 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
3708 (sc_trailing_space): New rules.
3709 (sc_xalloc_h_in_src): Remove.
3710 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
3711 (sc_space_tab, sc_error_exit_success, sc_changelog):
3712 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
3713 (makefile-check, po-check, author_mark_check):
3714 (makefile_path_separator_check, copyright-check):
3715 Use grep -n, to make it easier to find violations.
3716 Use CVS_LIST and CVS_LIST_EXCEPT.
3717 (header_regexp, h_re): Remove.
3718 (dd_c): New macro.
3719 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
3720 (my-distcheck): Use more-modern GCC flags.
3721 (signatures, %.asc): Remove.
3722 (rel-files, announcement): Remove signatures.
3723 Restore old updating code, even though we don't use it, so
3724 that we're the same as coreutils.
3725 (alpha, beta, major): Depend on news-date-check.
3726 Make the upload commands.
3727
3728 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
3729 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
3730 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
3731 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
3732 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
3733 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
3734 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
3735 * tests/sets.at: Likewise.
3736
3737 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
3738 we comment out the Autoconf version number.
3739 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
3740 it's error-prone and "make maintainer-distcheck" rejects it.
3741
3742 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
3743 Indent calls to "error" to pacify "make maintainer-distcheck",
3744 when the calls are not intended to be translated.
3745 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
3746
3747 * src/Makefile.am (DEFS): Use +=, to pacify
3748 "make maintainer-distcheck".
3749 (bison_SOURCES): Add scan-skel.h.
3750 (sc_tight_scope): New rule, from coreutils.
3751
3752 * src/files.c (src_extension, header_extension):
3753 Now static, not extern.
3754 * src/getargs.c (short_options): Likewise.
3755 * src/muscle_tab.c (muscle_table): Likewise.
3756 * src/parse-gram.y (current_class, current_type, current_prec):
3757 Likewise.
3758 * src/reader.c (grammar_end, previous_rule_end): Likewise.
3759 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
3760 * src/main.c (main): Cast bindtextdomain and textdomain calls to
3761 void, to avoid warning when NLS is disabled.
3762 * src/output.c: Include scan-skel.h.
3763 (scan_skel): Remove decl, since scan-skel.h does this.
3764 (output_skeleton):
3765 Indent calls to "error" to pacify "make maintainer-distcheck".
3766 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
3767 * src/reader.h (gram_end, gram_lineno): New decls to pacify
3768 "make maintainer-distcheck".
3769 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
3770 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
3771 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
3772 (skel_lex_destroy, scan_skel): Move these decls to...
3773 * src/scan-skel.h: New file.
3774 * src/uniqstr.c (uniqstr_assert):
3775 Indent calls to "error" to pacify "make maintainer-distcheck".
3776
3777 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
3778 not @VAR@.
3779
3780 * tests/torture.at: Revamp to avoid misuse of atoi that
3781 "make maintainer-distcheck" complained about.
3782
3783 * examples/extexi (message): Don't print a message more than once,
3784 and omit line-number decoration that makes Emacs compile think
3785 that informative messages are worth worrying about.
3786
37872005-07-22 Paul Eggert <eggert@cs.ucla.edu>
3788
3789 * configure.ac: Update version number.
3790
3791 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
3792 accidentally.
3793 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
3794 autogenerated by the maintainer.
3795 * examples/calc++/.cvsignore: Add *.yy.
3796
3797 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
3798 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3799 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3800
3801 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
3802
3803 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
3804 from maintainer-distcheck about casting the argument of 'free'.
3805
3806 * NEWS: Mention recent yytname changes.
3807 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
3808
3809 * bootstrap: For translations that have not yet been upgraded to
3810 the new runtime-po domain, prime the pump by extracting the
3811 relevant strings from the obsolete translations. This code can be
3812 removed once the bison-runtime domain has been translated by each
3813 team.
3814
3815 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
3816 now that token names are already quoted.
3817
3818 Fix problem reported by Anthony Heading.
3819 * data/glr.c (YYTOKEN_TABLE): New macro.
3820 (yytname): Define if YYTOKEN_TABLE.
3821 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
3822 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
3823 (YYERROR_VERBOSE): Define the same way the other skeletons do.
3824 * src/output.c (prepare_symbols): Output token_table_flag.
3825
0ffda363
PE
38262005-07-21 Paul Eggert <eggert@cs.ucla.edu>
3827
3828 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
3829 again if the first call fails.
3830
3831 * data/glr.c (yytnamerr): New function.
3832 (yyreportSyntaxError): Use it to dequote most string literals.
3833 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
3834 with other skeletons. All uses changed.
3835 (yytnameerr_): New function.
3836 (yyreport_syntax_error): Use it to dequote most string literals.
3837 * data/yacc.c (yytnamerr): New function.
3838 (yyerrlab): Use it to decode most string literals.
3839 * doc/bison.texinfo (Decl Summary, Calling Convention):
3840 Clarify quoting convention of yytname.
3841 * src/output.c (prepare_symbols): Quote all names. This undoes
3842 the 2005-04-17 change, which is now accomplished (mostly) via
3843 changes in the parsers as described above.
3844 * tests/regression.at (Token definitions, Web2c Actions):
3845 Undo most 2005-04-17 change here, too.
3846
38472005-07-20 Paul Eggert <eggert@cs.ucla.edu>
3848
3849 Fix more problems reported by twlevo@xs4all.nl.
3850 * tests/cxx-type.at: Don't pipe output of ./types through sed to
3851 remove trailing spaces. This loses the exit status of ./types,
3852 and isn't needed since ./types shouldn't be emitting trailing
3853 spaces.
3854 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
3855 as the stack isn't valid in that case.
3856
3857 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3858 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3859 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3860 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
3861 is used.
3862 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
3863 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3864 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3865 Likewise.
3866
3867 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
3868 overly-picky compilers that reject 'char *foo = "bar";'.
3869
3870 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
3871 to FILE * parameter, not to stderr. This fixes a typo introduced
3872 in the 2005-07-12 change.
3873
3874 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
3875 warnings from GCC 4.
3876
3877 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
3878 (yyglrShiftDefer, yysplitStack):
3879 Remove unused parameters b4_pure_formals. All uses changed.
3880 (yyglrShift): Remove unused parameters b4_user_formals.
3881 All uses changed.
3882 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
3883
6100a9aa
PE
38842005-07-18 Paul Eggert <eggert@cs.ucla.edu>
3885
258b75ca
PE
3886 Destructor cleanups and regularization among the three skeletons.
3887 * NEWS: Document the behavior changes.
3888 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
3889 stack before failing, as the cleanup code will do it for us now.
3890 * data/lalr1.cc (yyerrlab): Likewise.
3891 * data/glr.c (yyparse): Pop everything off the stack before
3892 freeing it, so that destructors get called properly.
3893 * data/lalr1.cc (yyreturn): Likewise.
3894 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
3895 This is more consistent.
3896 * doc/bison.texinfo (Destructor Decl): Mention more reasons
3897 why destructors might be called. 1.875 -> 2.1.
3898 (Destructor Decl, Decl Summary, Table of Symbols):
3899 Some English-language cleanups for %destructor.
3900 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
3901 Add output line for destructor of start symbol.
3902 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
3903 because of that same extra output line.
3904
1a059451
PE
3905 * NEWS: Document minor wording changes in diagnostics of
3906 Bison-generated parsers.
3907 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
3908 Remove unused formals. All uses changed.
3909 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
3910 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
3911 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
3912 Rename yyoverflowab to yyexhaustedlab.
3913 When memory exhaustion occurs during syntax-error reporting,
3914 report it separately rather than in a single diagnostic; this
3915 eases translation.
3916 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
3917 (Memory Exhausted): Renamed from Parser Stack Overflow.
3918 Revamp wording slightly to prefer "memory exhaustion".
3919 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
3920
97460c78
PE
3921 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
3922
30757c8c
PE
3923 Add i18n support to the GLR skeleton. Partially fix the C++
3924 skeleton; a C++ expert needs to finish this. Remove debugging
3925 msgids; there's little point to having them translated, since they
3926 can be understood only by someone who can read the
3927 (English-language) source code.
3928
3929 Generate runtime-po/bison-runtime.pot automatically, so that we
3930 don't have to worry about garbage getting in that file. We'll
3931 make sure after the next official release that old msgids don't
3932 get lost. See
3933 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
3934
3935 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
3936 Now auto-generated.
3937 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
3938 Fix typos in explanations of the runtime file.
3939 * bootstrap: Change gettext keyword from YYI18N to YY_.
3940 Use standard Makefile.in.in in runtime-po, since we'll arrange
3941 for backward-compatible bison-runtime.po files in a different way.
3942 * data/glr.c (YY_): New macro, from yacc.c.
3943 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
3944 Translate messages intended for users.
3945 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
3946 the wording in the other skeletons. We don't know that the memory
3947 is virtual.
3948 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
3949 Use same method that yacc.c uses.
3950 Don't translate debugging messages.
3951 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
3952 it doesn't work (yet), and requires C++ expertise to fix.
3953 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
3954 Move defn to a more logical place, to be consistent with other
3955 skeletons.
3956 Don't translate debugging messages.
3957 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
3958 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
3959 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
3960 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
3961
ac8c5689
PE
3962 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
3963 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
3964 void, not int.
3965 * tests/glr-regression.at (Badly Collapsed GLR States):
3966 Likewise.
3967 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3968 yylex should return 0 at EOF rather than aborting.
3969
6100a9aa
PE
3970 Improve tests for stack overflow in GLR parser.
3971 Problem reported by twlevo@xs4all.nl.
3972 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
3973 All uses removed.
3974 (yyStackOverflow): Just longjmp, but with value 2 so that caller
3975 can handle the problem.
3976 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
3977 (yyparse): New local variable yyresult to record the result.
3978 Use result of setjmp to set it, rather than storing itinto
3979 struct.
3980 (yyDone): Remove label.
3981 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
3982 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
3983 if YYABORT is used).
3984 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
3985 yyparse status; put status > 1 into diagnostic.
3986 Check that status==2 works.
3987 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
3988 Use exit status 3 for failure to open (which shouldn't happen).
3989
15f40952
PE
39902005-07-17 Paul Eggert <eggert@cs.ucla.edu>
3991
67fd79c4
PE
3992 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
3993 1 on syntax error; just let yyparse do its thing.
3994 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
3995 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
3996 (Exploding the Stack Size with Alloca):
3997 (Exploding the Stack Size with Malloc):
3998 Expect exit status 2, not 1, since the parser is supposed to blow
3999 its stack. Problem reported by twlevo@xs4all.nl.
4000
15f40952
PE
4001 * data/glr.c (yyparse): Don't assume that the initial calls
4002 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4003 Print a stack-overflow message and fail instead.
4004 Initialize the line-number information before creating the stack,
4005 so that the stack-overflow message can report line zero safely.
4006
f32c66b5
PE
40072005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4008
a22ff96f 4009 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
4010 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4011 (yyuserMerge): Provide a default case if b4_mergers is empty.
4012 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4013 * tests/glr-regression.at
4014 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 4015 Add casts to pacify C++ compilers.
1beb0b24
PE
4016 * tests/glr-regression.at (Improper merging of GLR delayed action
4017 sets): Declare yylex before using it.
f32c66b5 4018 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
4019 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4020 test for valgrind; valgrind is independent of g++.
4021 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4022 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4023 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4024 Use a destructor, so that we can expand the stack. Change
4025 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 4026
d741bd1b
PE
40272005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4028
4029 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4030 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4031
0410a6e0
PE
40322005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4033
4034 * PACKAGING: New file, suggested by Bruno Haible and taken from
4035 similar wording in gettext's PACKAGING file.
4036 * NEWS: Mention PACKAGING.
4037 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4038
f7ab6a50
PE
40392005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4040
baf785db 4041 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
4042 * bootstrap: Get runtime translations into runtime-po.
4043 Create runtime-po files automatically, if possible.
4044 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4045 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4046 does not infringe on the user's name space.
4047 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4048 * doc/bison.texinfo (Internationalization): Revamp the English
4049 and Texinfo syntax a bit, to try to make it clearer.
4050 (Bison Options, Option Cross Key): Mention --print-localedir.
4051 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4052 YYENABLE_NLS. Quote a bit more.
4053 * runtime-po/.cvsignore: New file.
4054 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4055 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4056 * runtime-po/quot.sed: Likewise.
4057 * runtime-po/boldquot.sed: Likewise.
4058 * runtime-po/en@quot.header: Likewise.
4059 * runtime-po/en@boldquot.header: Likewise.
4060 * runtime-po/insert-header.sin: Likewise.
4061 * runtime-po/remove-potcdate.sin: Likewise.
4062 * runtime-po/Makevars: Likewise.
4063 * runtime-po/LINGUAS: Likewise.
4064 * runtime-po/de.po: Likewise; we will rely on the translation project
4065 to maintain this, so "bootstrap" should get it.
0410a6e0 4066 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
4067 its value.
4068 * src/main.c (main): Bind the bison-runtime domain, too.
4069
40702005-07-12 Bruno Haible <bruno@clisp.org>
4071
4072 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4073 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4074 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4075 * runtime-po: New directory.
4076 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4077 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4078 * runtime-po/Rules-quot: New file, copied from po/.
4079 * runtime-po/quot.sed: Likewise.
4080 * runtime-po/boldquot.sed: Likewise.
4081 * runtime-po/en@quot.header: Likewise.
4082 * runtime-po/en@boldquot.header: Likewise.
4083 * runtime-po/insert-header.sin: Likewise.
4084 * runtime-po/remove-potcdate.sin: Likewise.
4085 * runtime-po/Makevars: New file.
4086 * runtime-po/POTFILES.in: New file.
4087 * runtime-po/LINGUAS: New file.
4088 * runtime-po/bison-runtime.pot: New file.
4089 * runtime-po/de.po: New file.
4090 * m4/bison.m4: New file.
4091 * Makefile.am (SUBDIRS): Add runtime-po.
4092 (aclocaldir, aclocal_DATA): New variables.
4093 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4094 Define aclocaldir.
4095 * src/getargs.c (usage): Document --print-localedir option.
4096 (PRINT_LOCALEDIR_OPTION): New enum item.
4097 (long_options): Add --print-localedir option.
4098 (getargs): Handle --print-localedir option.
4099 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4100 (Internationalization): New section.
4101
22dda0f0
AD
41022005-07-12 Akim Demaille <akim@epita.fr>
4103
4104 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4105 for consistency with the rest of the code.
4106 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4107 Add separators.
4108
82b248ad
AD
41092005-07-12 Akim Demaille <akim@epita.fr>
4110
4111 * src/parse-gram.y: Use %printer instead of YYPRINT.
4112
fa0e9314
AD
41132005-07-12 Akim Demaille <akim@epita.fr>
4114
867a3e00
AD
4115 * src/symtab.h, src/symtab.c (symbol_print): New.
4116 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4117 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4118
41192005-07-12 Akim Demaille <akim@epita.fr>
4120
4121 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
4122 b4_at_dollar and b4_dollar_dollar.
4123
e054b190
PE
41242005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4125
4126 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4127 and Pennello's paper.
4128
34160ec4
PE
41292005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4130
407d4a75
PE
4131 * data/yacc.c (yyparse): Undo previous patch. Instead,
4132 set yylsp[0] and yyvsp[0] only if the initial action
4133 sets yylloc and yylval, respectively.
4134
34160ec4
PE
4135 * data/yacc.c (yyparse): In the initial action, set
4136 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4137 This avoids the use of undefined variables if the initial
4138 action does not set yylloc and/or yylval.
4139
c3d5a4a7
PE
41402005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4141
b34d96c1
PE
4142 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4143 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4144 Remove from CVS. These files are automatically generated.
4145 * examples/extexi: Clarify that this file is now part of Bison,
4146 not GNU M4, and that it works with any POSIX-compatible Awk.
4147 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4148 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4149 so that we also get calc++-parser.yy. Geneate it.
4150 Use $(AWK), not gawk, since any conforming Awk will do.
4151 Put comment before action, since older 'make' can't handle comment
4152 in action.
4153 $(BUILT_SOURCES): List all built sources, not just some of them.
4154 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4155 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4156 $($(calc_sources_generated)): Remove unnecessary test for existence
4157 of target. (This had a shell syntax error anyway; a stray "x".)
4158 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4159 calc++-parser.yy.
4160 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4161
c3d5a4a7
PE
4162 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4163 implied by the other modules.
4164
828c373b
AD
41652005-07-06 Akim Demaille <akim@epita.fr>
4166
4167 Bind examples/calc++ to the package.
4168 * examples/calc++/Makefile: Remove, replaced by...
4169 * examples/calc++/Makefile.am: ... this new file.
4170 * examples/calc++/test: Remove input.
4171 * examples/calc++/compile: Remove.
4172 * examples/Makefile.am: New.
4173 * configure.ac, Makefile.am: Adjust.
4174 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4175
63cb01d6
PE
41762005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4177
fd2df2ed
PE
4178 * data/glr.c (yyFail): Drastically simplify; since the format argument
4179 never had any % directives, we can simply pass it to yyerror.
4180 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4181 be modified later, as that is the usual style in glr.c.
4182 Problems reported by Paul Hilfinger.
4183
63cb01d6
PE
4184 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4185 and size overflow errors.
4186 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4187 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4188 (YYSIZEMAX): New macro.
4189 (yystpcpy): New function, taken from yacc.c.
4190 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4191 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4192 so that we don't have to maintain their signatures.
4193 (yyFail): Check for buffer overflow, by using vsnprintf rather
4194 than vsprintf. Allocate a bigger buffer if possible.
4195 Report an error if buffer allocation fails.
4196 (yyStackOverflow): New function.
4197 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4198 the initialization was successful. It might fail if storage was
4199 exhausted.
4200 (yyexpandGLRStack): Add more checks for storage allocation failure.
4201 Use yyStackOverflow to report failures.
4202 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4203 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4204 Don't assume stack number fits in int.
4205 (yysplitStack): Check for storage allocation failure.
4206 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4207 can print diagnostics on storage allocation failure. All callers
4208 changed.
4209 (yyresolveValue): Use yybool for boolean.
4210 (yyreportSyntaxError): Check for size-calculation overflow.
4211 This code is taken from yacc.c.
4212 (yyparse): Check for storage allocation errors when allocating
4213 the initial stack.
4214
1c59e0a1
AD
42152005-07-05 Akim Demaille <akim@epita.fr>
4216
4217 Extract calc++ from the documentation.
4218 * doc/bison.texinfo (Calc++): Add the extraction marks.
4219 * examples/extexi: New, from the aborted GNU Programming 2E.
4220 Separate the different paragraph of a file with empty lines.
4221 * examples/Makefile: Use it to extract the whole calc++ example.
4222
8a0adb01
AD
42232005-06-24 Akim Demaille <akim@epita.fr>
4224
4225 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4226 class typedefs.
4227
12545799
AD
42282005-06-22 Akim Demaille <akim@epita.fr>
4229
4230 * doc/bison.texinfo (C++ Language Interface): First stab.
4231 (C++ Parsers): Remove.
4232
99be0235
AD
42332005-06-22 Akim Demaille <akim@epita.fr>
4234
4235 * data/lalr1.cc (yylex_): Honor %lex-param.
4236
0ffd4fd1
AD
42372005-06-22 Akim Demaille <akim@epita.fr>
4238
4239 Start a set of simple examples.
4240 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4241 * examples/calc++/calc++-driver.hh,
4242 * examples/calc++/calc++-parser.yy,
4243 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4244 * examples/calc++/compile, examples/calc++/test: New.
4245
0925ebb4
PE
42462005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4247
4248 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4249 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4250 which stems from the 2005-05-27 patch.
4251
43d3b664
PH
42522005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4253
4254 * data/glr.c: Modify treatment of unused parameters to permit use
4255 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4256
3062864d
PE
42572005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4258
4259 Fix infringement on user name space reported by Janos Zoltan Szabo.
4260 * data/yacc.c (yyparse): strlen -> yystrlen.
4261
989b5b8e
AD
42622005-05-30 Akim Demaille <akim@epita.fr>
4263
4264 * data/lalr1.cc (_): New.
4265 Translate the various messages.
4266
bedf57f5
PE
42672005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4268
4269 Fix infringement on user name space reported by Bruno Haible.
4270 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4271 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4272 the user's name space.
4273 (alloca): Include <stdlib.h> to get it, if it's not built in.
4274 (YYMALLOC, YYFREE): Define only if needed.
4275 (malloc, free): Declare, but only if needed, as this infringes on
4276 the user name space.
4277
4d1801f1
PE
42782005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4279
4280 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
4281 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
4282 with %d format.
4283 * lib/ebitset.c (min, max): Undef before defining.
4284 * lib/vbitset.c (min, max): Likewise.
4285 * lib/subpipe.c (create_subpipe): Save local variables in case
4286 vfork clobbers them.
4287
42882005-05-24 Bruno Haible <bruno@clisp.org>
4289
4290 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4291 error message syntax used by gcc-4.0.
4292
b94a9e1e
PE
42932005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4294
85ac3861
PE
4295 * README: Mention m4 1.4.3. Remove obsolete advice about
4296 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4297
b94a9e1e
PE
4298 * bootstrap: Remove workaround for problem I encountered with
4299 gettext 0.14.1; it seems to be fixed now.
4300
51c30d21
PE
43012005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4302
009ce67d
PE
4303 * NEWS: Version 2.0a.
4304
f2a97c62
PE
4305 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4306 the previous change.
4307
c8775f93
PE
4308 Various maintainer cleanups.
4309 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
4310 conftest*, for benefit of CVS commands run at the same time as
4311 "configure". Add build-aux, since "bootstrap" now creates it and
4312 its subfiles.
4313 * Makefile.cfg (move_if_change): Remove.
4314 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
4315 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
4316 (po_repo, do-po-update, po-update, wget_files, get-targets):
4317 (config.guess-url_prefix, config.sub-url_prefix):
4318 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
4319 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
4320 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
4321 Remove.
4322 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
4323 this is now the recommended name.
4324 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
4325 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
4326 ylwrap. These files now go into build-aux.
4327 * config/move-if-change: Remove.
4328 * config/prev-version.txt: Bump from 1.75 to 2.0.
4329
3ea5f0ec
PE
4330 * bootstrap: Add stdio-safer, unistd-safer modules.
4331 Remove m4/glibc2.m4 (introduced by latest gnulib, but
4332 we don't need it).
4333 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
4334 fopen-safer.c, stdio-safer.h, unistd-safer.h.
4335 * lib/subpipe.c: Include "unistd-safer.h".
4336 (create_subpipe): Make sure all the newly-created
4337 file descriptors are > 2, so that diagnostics don't
4338 get sent down them (which might cause Bison to hang, in theory).
4339 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
4340 * src/files.c (xfopen): Use fopen_safer, not fopen.
4341
51c30d21
PE
4342 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
4343 yesterday's yacc.c fix.
4344
cea1469d
PE
43452005-05-21 Paul Eggert <eggert@cs.ucla.edu>
4346
3ea5f0ec
PE
4347 * data/glr.c, data/lalr1.cc: Update copyright date.
4348
cea1469d
PE
4349 Fix a destructor bug reported by Wolfgang Spraul in
4350 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
4351 * data/yacc.c (yyabortlab): Don't call destructor, and
4352 don't set yychar to EMPTY.
4353 (yyoverflowlab): Don't call destructor.
4354 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
4355 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
4356 since we no longer output the message "discarding lookahead token
4357 end of input ()".
4358
5e6f62f2
PH
43592005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4360
4361 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
4362 fix a small glitch in debugging output.
4363 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
4364 after YY_SYMBOL_PRINT where needed.
4365
4366 (struct yyGLRState): Add some comments.
4367 (struct yySemanticOption): Add some comments.
4368 (union yyGLRStackItem): Add comment.
4369
4370 (yymergeOptionSets): Correct this to properly perform the union,
4371 avoiding infinite reported by Michael Rosien.
4372 Update comment.
4373
4374 * tests/glr-regression.at: Add test for GLR merging error reported
4375 by M. Rosien.
cea1469d 4376
0fb669f9
PE
43772005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4378
4379 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
4380 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
4381 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
4382 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
4383 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
4384 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
4385 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
4386 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
4387 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
4388 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
4389 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
4390 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
4391 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
4392 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
4393 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
4394 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
4395 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
4396 src/derives.h, src/files.c, src/files.h, src/getargs.c,
4397 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
4398 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
4399 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
4400 src/output.h, src/parse-gram.c, src/parse-gram.h,
4401 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
4402 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
4403 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
4404 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
4405 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
4406 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
4407 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
4408 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
4409 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
4410 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
4411 tests/reduce.at, tests/regression.at, tests/sets.at,
4412 tests/synclines.at, tests/testsuite.at, tests/torture.at:
4413 Update FSF postal mail address.
4414
51f4735e
PE
44152005-05-11 Paul Eggert <eggert@cs.ucla.edu>
4416
4417 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
4418 Problem reported by Ralf Menzel.
4419
80ce3401
PE
44202005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4421
4422 * tests/actions.at: Test that stack overflow invokes destructors.
4423 From Marcus Holland-Moritz.
4424 * data/yacc.c (yyerrlab): Move the code that destroys the stack
4425 from here....
4426 (yyreturn): to here. That way, destructors are called properly
4427 even if the stack overflows, or the user calls YYACCEPT or
4428 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
4429 (yyoverflowlab): Destroy the lookahead.
4430
44312005-04-24 Paul Eggert <eggert@cs.ucla.edu>
4432
4433 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
4434
72f000b0
PE
44352005-04-17 Paul Eggert <eggert@cs.ucla.edu>
4436
4437 * NEWS: Bison-generated C parsers no longer quote literal strings
4438 associated with tokens.
4439 * src/output.c (prepare_symbols): Don't escape strings,
4440 since users don't want to see C escapes.
4441 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
4442 in diagnostics.
c19683bb 4443 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
4444 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
4445
1094323f
PE
44462005-04-16 Paul Eggert <eggert@cs.ucla.edu>
4447
4448 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
4449 the data size is known to be too small and we can't increase it.
4450 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
4451
ca407bdf
PE
44522005-04-15 Paul Eggert <eggert@cs.ucla.edu>
4453
4454 * src/parse-gram.y: Include quotearg.h.
4455 (string_as_id): Quote $1 before using it as a key, since the
4456 lexer no longer quotes it for us.
4457 (string_content): Don't strip quotes, since lexer no longer
4458 quotes it for us.
4459 * src/scan-gram.l: Include quotearg.h.
4460 ("\""): Omit quote.
4461 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
4462 a key, since the rest of the lexer doesn't quote it.
4463 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
4464 * tests/regression.at (Token definitions): Check for backslashes
4465 in token strings.
4466
4467 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
4468 (YYSIZE_T): Define to unsigned long int when using an older compiler.
4469 (yyparse): Revamp code to generate long syntax error message, to
4470 make it easier to translate, and to avoid problems with arithmetic
4471 overflow. Change "virtual memory" to "memory" in diagnostic, since
4472 we don't know whether the memory is virtual.
4473
1ce59070
PE
44742005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4475
4476 * NEWS: Bison-generated C parsers now use the _ macro to
4477 translate strings.
4478 * data/yacc.c (_) [!defined _]: New macro.
4479 All English strings wrapped inside this macro.
4480 * doc/bison.texinfo (Bison Parser): Document _.
4481 * po/POTFILES.in: Include src/parse-gram.c, since it now
4482 includes translateable strings that parse-gram.y doesn't.
4483
a749a695
PE
44842005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4485
4486 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
4487 reverting the 2004-10-11 change to this function.
4488 (symbol_check_alias_consistency): Don't call symbol_type_set
4489 if the type name is already correct.
4490 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
4491
8fb1053b
PE
44922005-03-25 Paul Eggert <eggert@cs.ucla.edu>
4493
4494 * tests/regression.at (Token definitions): Don't use a token named
4495 c, as that generates a "#define c ..." that runs afoul of buggy
4496 stdlib.h that uses the identifier c as a member of struct
4497 drand48_data. Problem reported by Horst Wente.
4498
ff498c4a
PE
44992005-03-21 Paul Eggert <eggert@cs.ucla.edu>
4500
4501 * bootstrap: Change translation URL from
4502 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
4503 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
4504 redirection glitches. Problem reported by twlevo@xs4all.nl.
4505
65211d70
PE
45062005-03-20 Paul Eggert <eggert@cs.ucla.edu>
4507
4508 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
4509 after operands; POSIX says this isn't portable for the c99 command.
4510
9577fb1f
PE
45112005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4512
4513 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
4514 immediately if a data overrun has occurred; this may help us track
4515 down what may be a spurious failure on MacOS.
4516
78b178f7
PE
45172005-03-17 Paul Eggert <eggert@cs.ucla.edu>
4518
a2599d0f
PE
4519 Respond to problems reported by twlevo@xs4all.nl.
4520
4521 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
4522
78b178f7
PE
4523 * src/vcg.h: Comment fix.
4524 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
4525 (G_CMAX): Change to -1 instead of INT_MAX.
4526
4527 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 4528
7296e729
PE
45292005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4530
4531 * src/tables.c (state_number_to_vector_number): Put it inside an
4532 "#if 0", since it's not currently used. Problem reported by
4533 Roland McGrath.
4534
05ac60f3
PE
45352005-03-06 Paul Eggert <eggert@cs.ucla.edu>
4536
4537 * src/output.c (escaped_output): Renamed from
4538 escaped_file_name_output, since we now use it for symbol tags as
4539 well. All uses changed.
4540 (symbol_destructors_output, symbol_printers_output):
4541 Escape symbol tags too.
4542 Problem reported by Matyas Forstner in
4543 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
4544
4545 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
4546 not needed.
4547 * src/output.c (user_actions_output, token_definitions_output,
4548 symbol_destructors_output, symbol_printers_output): Likewise.
4549 * src/reader.c (prologue_augment): Likewise.
4550 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
4551
4552 * src/vcg.c (output_edge): Don't quote linestyle arg.
4553 Problem reported by twlevo@xs4all.nl.
4554
7eb453ac
PE
45552005-02-28 Paul Eggert <eggert@cs.ucla.edu>
4556
4557 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
4558 example, reported by Derek M Jones. Also, make the example even
4559 more outrageous, to better illustrate how bad the problem is.
4560
4c04c52a
PE
45612005-02-24 Paul Eggert <eggert@cs.ucla.edu>
4562
4563 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
4564 putsym. Typo reported by Sebastian Piping.
4565
a61e1620
PE
45662005-02-23 Paul Eggert <eggert@cs.ucla.edu>
4567
4568 * doc/bison.texinfo (Language and Grammar): some -> same
4569 (Epilogue): int he -> in the
4570 Typos reported by Sebastian Piping via Justin Pence.
4571
9ec93868
PE
45722005-02-07 Paul Eggert <eggert@cs.ucla.edu>
4573
4574 * tests/glr-regression.at (Improper handling of embedded actions
4575 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
4576 embedded actions and $-N in GLR parsers", work around an Autoconf bug
4577 with dollar signs in test names.
4578 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
4579 for a similar reason.
4580
73ce7e7e
PE
45812005-01-28 Paul Eggert <eggert@cs.ucla.edu>
4582
4583 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
4584 wants to redefine G_VIEW.
4585
2e72b98e
PE
45862005-01-27 Paul Eggert <eggert@cs.ucla.edu>
4587
4588 * src/vcg.c (get_view_str): Remove case for normal_view.
4589 Problem reported by twlevo@xs4all.nl.
4590
e0d634e5
PE
45912005-01-24 Paul Eggert <eggert@cs.ucla.edu>
4592
ccf830a4
PE
4593 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
4594 Problem reported by twlevo@xs4all.nl.
4595
e0d634e5
PE
4596 * doc/bison.texinfo: Change @dircategory from "GNU programming
4597 tools" to "Software development". Requested by Richard Stallman
4598 via Karl Berry.
4599
7bbc8cb0
PE
46002005-01-23 Paul Eggert <eggert@cs.ucla.edu>
4601
4602 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
4603 Problem reported by twlevo@xs4all.nl.
4604
08b770bc
PE
46052005-01-21 Paul Eggert <eggert@cs.ucla.edu>
4606
4607 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
4608 keyword; it's not needed with modern compilers, and it doesn't
4609 affect correctness with older compilers. Suggested by
4610 twlevo@xs4all.nl.
4611
95f22ad2
PE
46122005-01-17 Paul Eggert <eggert@cs.ucla.edu>
4613
4614 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
4615 gcc -Wswitch-default.
4616 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
4617 * data/yacc.c (yyparse): Likewise.
4618
d229d15c
PE
46192005-01-12 Paul Eggert <eggert@cs.ucla.edu>
4620
4621 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
4622 already. Let config.h define any nonstandard values.
4623
ecadd90f
PE
46242005-01-10 Paul Eggert <eggert@cs.ucla.edu>
4625
4626 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
4627 for the benefit of slower hosts. Problem reported by
4628 Nelson H. F. Beebe.
4629
213744b5
PE
46302005-01-07 Paul Eggert <eggert@cs.ucla.edu>
4631
4632 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
4633 being defined and not used.
4634 * data/lalr1.cc (yyparse): Likewise.
4635 Use "if (false)" rather than "if (0)".
4636
249d3236
PE
46372005-01-05 Paul Eggert <eggert@cs.ucla.edu>
4638
4639 * TODO: Mention that we should allow NUL bytes in tokens.
4640
987cc1fb
PE
46412005-01-02 Paul Eggert <eggert@cs.ucla.edu>
4642
4643 * src/scan-skel.l (<<EOF>>): Don't close standard output.
4644 Problem reported by Hans Aberg.
4645
08fe02d9
PE
46462005-01-01 Paul Eggert <eggert@cs.ucla.edu>
4647
4648 * src/getargs.c (version): Happy new year; update overall
4649 program copyright date from 2004 to 2005.
4650
4651 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
4652 Problem reported by Hans Aberg.
4653 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
4654 (Output file names.): Add a test for the case when standard output
4655 is closed.
4656
010c0266
PE
46572004-12-26 Paul Eggert <eggert@cs.ucla.edu>
4658
4659 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
4660 to fix an oversight in the Bison 2.0 manual.
4661
da12206a
PE
46622004-12-25 Paul Eggert <eggert@cs.ucla.edu>
4663
4664 * NEWS: Version 2.0. Reformat the existing news items since
4665 1.875, so that related items are grouped together.
3a4734aa 4666 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
4667 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
4668
c935d934
PE
4669 * tests/torture.at (Exploding the Stack Size with Alloca): Set
4670 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
4671 otherwise, we're not testing alloca. Unfortunately there's no
4672 simple way to consult HAVE_ALLOCA here.
4673
da12206a
PE
4674 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
4675 for yymsg, too.
4676
4677 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
4678 hand. This avoids a warning about comparing int to size_t when
4679 GCC warnings are enabled.
4680
0a2c5137
PE
46812004-12-22 Paul Eggert <eggert@cs.ucla.edu>
4682
d7e14fc0
PE
4683 * NEWS: Bison-generated parsers no longer default to using the
4684 alloca function (when available) to extend the parser stack, due
4685 to widespread problems in unchecked stack-overflow detection.
4686 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
4687 responsibility to set it to a positive value. This lets the user
4688 specify a value that is not a preprocessor constant.
4689 * data/yacc.c (YYMAXDEPTH): Likewise.
4690 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
4691 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
4692 to be a compile-time constant. However, explain the constraints on it.
4693 Also, explain the constraints on YYINITDEPTH.
4694 (Table of Symbols): Explain that alloca is no longer the default.
4695 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
4696 to 1.
4697
0a2c5137
PE
4698 * doc/bison.texinfo (Location Default Action): Mention that n must
4699 be zero when k is zero. Suggested by Frank Heckenbach.
4700
e019c247
AD
47012004-12-22 Akim Demaille <akim@epita.fr>
4702
4703 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
4704 (parser::state_type, parser::semantic_type, parser::location_type):
4705 Private, not public.
4706 (parser::parse): Return ints, not bool.
4707 Returning a bool introduces a problem: 0 corresponds to false, and
4708 it seems weird to return false on success. Returning true changes
4709 the conventions for yyparse.
4710 Alternatively we could return void and send an exception.
4711 There is no clear consensus (yet?).
4712 (state_stack, semantic_stack, location_stack): Rename as...
4713 (state_stack_type, semantic_stack_type, location_stack_type): these.
4714 Private, not public.
4715 * tests/c++.at: New.
4716 * tests/testsuite.at, tests/Makefile.am: Adjust.
4717
72731bb7
AD
47182004-12-21 Akim Demaille <akim@epita.fr>
4719
4720 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
4721
9a0d8bec
AD
47222004-12-21 Akim Demaille <akim@epita.fr>
4723
4724 Don't impose std::string for filenames.
4725
4726 * data/lalr1.cc (b4_filename_type): New.
4727 (position::filename): Use it.
4728 (parser.hh): Move the inclusion of stack.hh and location.hh below
4729 the user code, so that needed headers for the filename type can be
4730 included first.
72731bb7
AD
4731 Forward declare them before the user code.
4732 * tests/Makefile.am (check-local, installcheck-local): Pass
4733 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 4734
99880de5
AD
47352004-12-20 Akim Demaille <akim@epita.fr>
4736
4737 Use more STL like names: my_class instead of MyClass.
4738
4739 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
4740 (SemanticStack, SemanticType, StateStack, StateType)
4741 (TokenNumberType, Stack, Slice, Traits, Parser::location)
4742 (Parser::value): Rename as...
4743 (location_stack, location_type, rhs_number_type, semantic_stack)
4744 (semantic_type, state_stack, state_type, token_number_type, stack)
4745 (slice, traits, parser::yylloc, parser::yylval): these.
4746
4747 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
4748
9bec482e
PE
47492004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4750
4751 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
4752 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
4753
f6fbd3da
PE
47542004-12-17 Paul Eggert <eggert@cs.ucla.edu>
4755
4756 Remove uses of 'short int' and 'unsigned short int'. This raises
4757 some arbitrary limits. It uses more memory but nowadays that's
4758 not much of an issue.
4759
4760 This change does not affect the generated parsers; that's a different
4761 task, as some users will want to conserve memory there.
4762
4763 Ideally we should use size_t to represent all object counts, and
4764 something like ptrdiff_t to represent signed differences of object
4765 counts; but that will require more code-cleanup than I have the
4766 time to do right now.
4767
4768 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
4769 Use size_t, not int or short int, to count objects.
4770 * src/closure.c (nritemset, closure): Likewise.
4771 * src/closure.h (nritemset, closure): Likewise.
4772 * src/nullable.c (nullable_compute): Likewise.
4773 * src/print.c (print_core): Likewise.
4774 * src/print_graph.c (print_core): Likewise.
4775 * src/state.c (state_compare, state_hash): Likewise.
4776 * src/state.h (struct state): Likewise.
4777 * src/tables.c (default_goto, goto_actions): Likewise.
4778
4779 * src/gram.h (rule_number, rule): Use int, not short int.
4780 * src/output.c (prepare_rules): Likewise.
4781 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
4782 errs, reductions): Likewise.
4783 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
4784 Likewise.
4785 * src/tables.c (vector_number, tally, action_number,
4786 ACTION_NUMBER_MINIMUM): Likewise.
4787 * src/output.c (muscle_insert_short_int_table): Remove.
4788
efeed023
AD
47892004-12-17 Akim Demaille <akim@epita.fr>
4790
4791 * data/lalr1.cc: Extensive Doxygenation.
4792 (error_): Rename as...
4793 (error): this, since it is visible to the user.
4794 Adjust callers.
4795 (Parser::message): Now an automatic variable from...
4796 (Parser::yyreport_syntax_error_): here.
4797 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
4798 Parser::error.
4799 * tests/input.at: Escape $.
4800
bc82c5a5
PE
48012004-12-16 Paul Eggert <eggert@cs.ucla.edu>
4802
4803 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
4804 Parenthesize rhs to avoid obscure problems with mistakes like
4805 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
4806 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
4807 b4_rhs_location): Likewise.
4808 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
4809 b4_rhs_location): Likewise.
4810
fd19f271
AD
48112004-12-16 Akim Demaille <akim@epita.fr>
4812
4813 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
4814 yacc.c: be sure to stay within yycheck_.
4815 * tests/actions.at: Re-enable C++ tests.
4816
10454ea4
AD
48172004-12-16 Akim Demaille <akim@epita.fr>
4818
4819 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
4820 real.
4821
c5b95ccf
AD
48222004-12-16 Akim Demaille <akim@epita.fr>
4823
4824 Use #define to handle the %name-prefix.
4825
4826 * data/glr.c, data/yacc.c: Comment changes.
4827 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
4828 so that one can refer to yylex in the parser file, and have it
4829 renamed, as is the case with other skeletons.
4830
617a8f12
AD
48312004-12-16 Akim Demaille <akim@epita.fr>
4832
4833 Move lalr1.cc internals into yy*.
4834
4835 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
4836 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
4837 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
4838 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
4839 (empty_, final_, terror_, errcode_, ntokens_)
4840 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
4841 (looka_, ilooka_, error_range_, nerrs_):
4842 Rename as...
4843 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
4844 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
4845 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
4846 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
4847 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
4848 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
4849 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
4850 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
4851 these.
4852
1e547e6e
PE
48532004-12-15 Paul Eggert <eggert@cs.ucla.edu>
4854
4855 Fix some problems reported by twlevo at xs4all.
4856 * src/symtab.c (symbol_new): Report an error if the input grammar
4857 contains too many symbols. This is better than calling abort() later.
4858 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
4859 (struct node, struct graph):
4860 Rename member expand to stretch. All uses changed.
4861 (struct graph): Remove member layoutalgorithm. All uses removed.
4862 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
4863 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
4864 All uses changed.
4865 (N_STRETCH): Rename from N_EXPAND. All uses changed.
4866
735d6bd4
AD
48672004-12-15 Akim Demaille <akim@epita.fr>
4868
4869 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
4870 Add more Doxygen comments.
4871 (symprint_, stack_print_, reduce_print_, destruct_, pop)
4872 (report_syntax_error_, translate_): Rename as...
4873 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
4874 (yypop_, yyreport_syntax_error_, yytranslate_): this.
4875
2e1f5829
AD
48762004-12-15 Akim Demaille <akim@epita.fr>
4877
4878 * data/lalr1.cc (lex_): Rename as...
4879 (yylex_): this.
4880 Move the trace here.
4881 Take the %name-prefix into account.
4882 Reported by Alexandre Duret-Lutz.
4883
a3cb6248
AD
48842004-12-15 Akim Demaille <akim@epita.fr>
4885
4886 Simplify the C++ parser constructor.
4887
4888 * data/lalr1.cc (debug_): Rename as...
4889 (yydebug_): so that the parser's internals are always in the yy*
4890 pseudo namespace.
4891 Adjust uses.
4892 (b4_parse_param_decl): Remove the leading comma as it is now only
4893 called as unique argument list.
4894 (Parser::Parser): Remove the constructor accepting a location and
4895 an initial debugging level.
4896 Remove from the other ctor the argument for the debugging level.
4897 (debug_level_type, debug_level, set_debug_level): New.
4898
4899 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
4900 constructor calls.
4901
07fed891
AD
49022004-12-15 Akim Demaille <akim@epita.fr>
4903
4904 Remove b4_root related material: failure experiment
a3cb6248 4905 (which goal was to allow to derive from a class).
07fed891
AD
4906
4907 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
4908 definitions and uses.
4909
e603eaa5
PE
49102004-12-14 Paul Eggert <eggert@cs.ucla.edu>
4911
4912 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
4913 not 2, since it's not portable to subtract 1 from the start of an
4914 array. The new item 0 is never set or used. All uses changed.
4915
4916 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
4917 the default definition of YYLLOC_DEFAULT. Problem reported
4918 by Frank Heckenbach.
4919
fafb007d
PE
49202004-12-12 Paul Eggert <eggert@cs.ucla.edu>
4921
4922 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
4923 the normal case and one for the error case. Just use the
4924 first one uniformly. Problem reported by Frank Heckenbach.
4925 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
4926 use exactly the same macro in both places.
4927 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
4928 so that the normal-case YYRHSLOC works for the error case too.
4929 All uses changed.
4930 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
4931 (YYLLOC_DEFAULT): Use the same macro as glr.c.
4932 * doc/bison.texinfo (Location Default Action): Don't claim that
4933 we have an array of locations. Use the same macro for both glr
4934 and lalr parsers. Mention YYRHSLOC. Mention what happens when
4935 the index is 0.
4936
48814dcd
PE
49372004-12-10 Paul Eggert <eggert@cs.ucla.edu>
4938
a4e1a53b
PE
4939 * HACKING: Update email addresses to send announcements to.
4940
48814dcd
PE
4941 * configure.ac (AC_INIT): Bump version to 1.875f.
4942
337116ba
PE
49432004-12-10 Paul Eggert <eggert@cs.ucla.edu>
4944
4945 * NEWS: Version 1.875e.
4946 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
4947
4948 * src/scan-skel.l: Include "complain.h", for "fatal".
4949
4950 * src/relation.h (relation_print, relation_digraph):
4951 Relation sizes are of type relation_node, not size_t (this is
4952 merely a doc fix, since the two types are equivalent).
4953 (relation_transpose): Relation sizes are of type relation_node,
4954 not int.
4955 * src/relation.c: Likewise.
4956 (top, infinity): Now of type relation_node, not int.
4957 (traverse, relation_transpose): Use relation_node, not int.
4958
4959 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
4960 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
4961 (yyparse): Remove unused local introduced in 2004-10-25 patch.
4962
4963 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 4964 specifying whether the test should be skipped. Use it tp
337116ba 4965 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 4966 fail on some hosts, and should be skipped.
337116ba 4967
da2a7671
PE
49682004-12-08 Paul Eggert <eggert@cs.ucla.edu>
4969
4970 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
4971 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
4972 unless otherwise specified below.
4973
4974 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
4975 to allocate kernel_base, kernel_items, kernel_size, since
4976 they needn't be initialized to 0.
4977 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
4978 * src/closure.c (new_closure): Likewise, for itemset.
4979 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
4980 * src/lalr.c (set_goto_map): Likewise, for temp_map.
4981 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
4982 (build_relations): Likewise for edge, states1, includes.
4983 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
4984 * src/reader.c (packgram): Likewise, for ritem, rules.
4985 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
4986 * src/relation.c (relation_digraph): Likewise for VERTICES.
4987 (relation_transpose): Likewise for new_R, end_R.
4988 * src/symtab.c (symbols_token_translations_init): Likewise for
4989 token_translations.
4990 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
4991 (token_actions): Likewise for yydefact, actrow, conflrow,
4992 conflict_list.
4993 (save_column): Likewise for froms[symno], tos[symno].
4994 (goto_actions): Likewise for state_count.
4995 (pack_table): Likewise for base, pos, check.
4996 (tables_generate): Likewise for width.
4997
4998 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
4999 for initial core. Just have a separate core, so we needn't worry
5000 about whether kernel_size and kernel_base are initialized.
5001
5002 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5003 kernel_size, kernel_items): Remove unnecessary initialization.
5004 * src/conflicts.c (conflicts): Likewise.
5005 * src/derives.c (derives): Likewise.
5006 * src/muscle_tablc (muscle_insert): Likewise.
5007 * src/relation.c (relation_digraph): Likewise.
5008 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5009 conflrow, conflict_table, conflict_list, table, check):
5010 Likewise.
5011
5012 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5013 This is because all callers pass unsigned int.
5014 * src/closure.h (new_closure): Likewise.
5015
5016 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5017 (build_relations): Initialize includes[i] in all cases.
5018 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5019 and rules[ruleno].precsym. Initialize members in order.
5020 * src/relation.c (relation_transpose): Always initialize new_R[i]
5021 and end_R[i].
5022 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5023
5024 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5025 conflict_list[0] was always 0, but now it isn't initialized.
5026
5027 * src/table.c (table_grow): When conflict_table grew, the grown
5028 area wasn't cleared. Fix this.
5029
5030 * lib/.cvsignore: Add strdup.c, strdup.h.
5031 * m4/.cvsignore: Add strdup.m4.
5032
00baeeac
PE
50332004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5034
5035 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5036 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5037 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5038 ngotos + 1 without checking for overflow.
5039 (build_relations): Use END_NODE, not -1, to denote end of edges.
5040 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5041 build_relations): Use goto_number, not int, for goto numbers.
5042 * src/tables.c (save_column, default_goto): Likewise.
5043
be3d9d42
AD
50442004-11-23 Akim Demaille <akim@epita.fr>
5045
5046 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5047 of #defining from yystype.
5048 Don't typedef yystype, C++ does not need it.
5049 This lets it possible to forward declare it as union.
5050
78e526d5
PE
50512004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5052
5053 * bootstrap (gnulib_modules): Add extensions.
5054 Problem reported by Jim Meyering.
5055
afbb696d
PE
50562004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5057
5058 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5059 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5060 src/system.h, src/tables.c: XFREE -> free, to accommodate
5061 recent change to gnulib xalloc.h.
78e526d5 5062 Problem reported by Jim Meyering.
afbb696d 5063
c1f8f16a
AD
50642004-11-17 Akim Demaille <akim@epita.fr>
5065
5066 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5067
db7e5eb5 50682004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
5069 Alexandre Duret-Lutz <adl@gnu.org>
5070
5071 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5072 changes.
5073 (YYCDEBUG): Adjust.
5074 Use it instead of cdebug_.
5075 (Parser::debug_stream, Parser::set_debug_stream): New.
5076 (Parser::symprint_): Define cdebug_ for temporary backward
5077 compatibility.
5078 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5079 debug_stream ().
5080
68e11668
AD
50812004-11-17 Akim Demaille <akim@epita.fr>
5082
5083 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5084 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5085 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5086 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5087
97cbc73e
PE
50882004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5089
5090 * data/glr.c (yyloc_default): Remove; not used.
5091 Problem reported by Frank Heckenbach.
5092
e342c3be
AD
50932004-10-25 Akim Demaille <akim@epita.fr>
5094
5095 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5096 Introduce another definition to address simple location arrays.
5097 (yyGLRStack): New member: yyerror_range.
5098 (yyrecoverSyntaxError, yyparse): Update it.
5099 (yyrecoverSyntaxError): Use it when shifting the error token to
5100 have an accurate range, equivalent to the one computed by both
5101 yacc.c and lalr1.cc.
5102 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5103 that column numbers start at column 0, as per GNU Coding
5104 Standards, the others tests, and the doc.
5105 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5106 Adjust to the above change (first column is 0).
5107 And adjust the location of the "<error>", now covering the whole
5108 line.
5109
93602feb 51102004-10-22 Akim Demaille <akim@epita.fr>
04098407 5111 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
5112
5113 Remove some arbitrary limits on goto numbers and relations.
5114 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5115 initial values, since they're never used.
5116 (set_goto_map): ngotos is now unsigned, so test for overflow
5117 by seeing whether it wraps around to zero.
5118 * src/lalr.h (goto_number): Now size_t, not short int.
5119 (GOTO_NUMBER_MAXIMUM): Remove.
5120 * src/relation.c (relation_print, traverse, relation_transpose):
5121 Check for END_NODE rather than looking at sign.
5122 * src/relation.h (END_NODE): New macro.
5123 (relation_node): Now size_t, not short int.
5124
dba08b04
PE
51252004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5126
5127 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5128 keyword, not an identifier. Problem reported by Baron Schwartz in
5129 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5130
df09ef2e
AD
51312004-10-11 Akim Demaille <akim@epita.fr>
5132
5133 * src/symtab.c (symbol_check_alias_consistency): Also check
5134 type names, destructors, and printers.
5135 Reported by Alexandre Duret-Lutz.
5136 Recode the handling of associativity and precedence in terms
5137 of symbol_precedence_set.
5138 Accept no redeclaration at all, not even equal to the previous
5139 value.
5140 (redeclaration): New.
5141 Use it to factor redeclaration complaints.
5142 (symbol_make_alias): Don't set the type of the alias, let
5143 symbol_check_alias_consistency do it as for other features.
5144 * src/symtab.h (symbol): Add new member prec_location, and
5145 type_location.
5146 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5147 * tests/input.at (Incompatible Aliases): New.
5148
146bc99d
PE
51492004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5150
5151 .cvsignore fixes to accommodate gnulib changes,
5152 and the practice of naming build directories "_build".
5153 * .cvsignore: Add "_*". Sort.
5154 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5155 * m4/.cvsignore: Add "*_gl.m4".
5156
e503aa60
AD
51572004-10-06 Akim Demaille <akim@epita.fr>
5158
5159 * src/parse-gram.y (add_param): Fix the truncation of trailing
5160 spaces.
5161
b4a20338
AD
51622004-10-05 Akim Demaille <akim@epita.fr>
5163
5164 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5165 whether the reducion was empty or not. This leaves room to
5166 improve the use of YYLLOC_DEFAULT in such a case.
5167 lalr1.cc is still experimental, so changing this is acceptable.
5168 And finally, there are probably not many users who changed the
5169 handling of locations in GLR, so changing is admissible too.
5170
5171 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5172 empty reduction, set @$ to an empty location ending the previously
5173 stacked symbol.
5174 Adjust uses to make sure the code is triggered on empty
5175 reductions.
5176 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5177 expected output: empty reductions have empty locations.
5178
f85a5e6f
AD
51792004-09-29 Akim Demaille <akim@epita.fr>
5180
5181 * data/lalr1.cc: Move towards a more standard C++ coding style
5182 for templates: Class < T > -> Class<T>.
5183
b203fc2c
AD
51842004-09-29 Akim Demaille <akim@epita.fr>
5185
5186 * data/lalr1.cc: Reinstall the former ctor, for sake of
5187 compatibility, but warn it will be removed.
5188 Move towards a more standard C++ coding style (i.e., type *var ->
5189 type* var).
5190
5b7e1e73
PE
51912004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5192
3fee967f
PE
5193 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5194 since it's less likely to work if NULs are involved in the future.
5b7e1e73 5195
0dcca5c2
AD
51962004-09-27 Akim Demaille <akim@epita.fr>
5197
5198 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5199
6dde1c82
AD
52002004-09-27 Akim Demaille <akim@epita.fr>
5201
5202 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 5203 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
5204 and argument names.
5205 (b4_cc_constructor_call): Likewise.
5206
b233d555
AD
52072004-09-24 Akim Demaille <akim@epita.fr>
5208
5209 * src/parse-gram.y (add_param): Strip the leading and trailing
5210 blanks from a formal argument declaration.
5211 (YY_LOCATION_PRINT): New.
5212
619404e3
AD
52132004-09-24 Akim Demaille <akim@epita.fr>
5214
5215 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5216 after the location.
5217
dd8d9022
AD
52182004-09-24 Akim Demaille <akim@epita.fr>
5219
5220 * doc/bison.texinfo (Table of Symbols): Sort.
5221
0092f063
AD
52222004-09-21 Akim Demaille <akim@epita.fr>
5223
5224 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5225 the useless parentheses.
5226 Suggested by Paul Eggert.
5227
451364ed
AD
52282004-09-20 Akim Demaille <akim@epita.fr>
5229
5230 Let the initial-action act on the look-ahead, and use it for the
5231 "initial push" (corresponding to an hypothetical beginning-of-file).
5232 And let lalr1.cc honor %initial-action.
5233
5234 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5235 example.
5236 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5237 (Parser::Parser): Remove the ctor that used to initialize it.
5238 (Parser::parse): Like in the other skeletons, issue the "starting
5239 parse" message before any action.
5240 Honor %initial-action.
5241 Initialize the stacks with the lookahead.
5242 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5243 look-ahead.
5244 Push them in the stacks.
5245 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5246
18d192f0
AD
52472004-09-20 Akim Demaille <akim@epita.fr>
5248
5249 * doc/bison.texinfo (Initial Action Decl): New.
5250
b8458aa5
AD
52512004-09-20 Akim Demaille <akim@epita.fr>
5252
5253 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5254 clearer criterion to define it.
5255 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5256 When reducing on an empty RHS, use the latest stacked location as
5257 location.
5258 yylloc is not always available.
5259 * data/glr.c: Likewise.
5260 Also, honor initial-actions.
5261
3fc16193
AD
52622004-09-20 Akim Demaille <akim@epita.fr>
5263
5264 * data/yacc.c (YY_LOCATION_PRINT): New.
5265 Define when we know YYLTYPE's structure, i.e., when the default
5266 YYLLOC_DEFAULT is used.
5267 * data/c.m4 (b4_yysymprint_generate): Use it.
5268 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5269 value of the result.
5270 (error_start_): Replace with...
5271 (error_range_): this location array.
5272 This allows to replace code relying on the implementation of
5273 locations by portable code.
5274 * data/yacc.c (yylerrsp): Replace with...
5275 (yyerror_range): this.
5276 Every time a token is popped, update yyerror_range[0], to have an
5277 accurate location for the error token.
5278 * data/glr.c (YY_LOCATION_PRINT): New.
5279 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
5280 deference a pointer.
5281 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
5282 report the location in %printers.
5283
5284 * src/scan-skel.l: Instead of abort, report error messages to ease
5285 understanding skeleton scanning failures.
5286
ecfe33e7
AD
52872004-09-16 Akim Demaille <akim@epita.fr>
5288
5289 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
5290 (iterator, const_iterator): these, to be more in the C++ spirit.
5291 Also, return reverse iterators so that when displaying the stack
5292 we display its bottom first.
5293 (Parser::stack_print_, Parser::reduce_print_): Match the messages
5294 from yacc.c.
5295 We should probably use vector here though.
5296
1576d44d
AD
52972004-09-16 Akim Demaille <akim@epita.fr>
5298
5299 Have more complete shift traces.
5300
5301 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
5302 to report Shifts instead of ad hoc YYDPRINTF invocations,
5303 including for the error token.
5304 * data/lalr1.cc (symprint_): Output the location.
5305 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
5306 output the location within the %printer.
5307 Activate GLR tests, at least to make sure they compile properly.
5308 They still don't pass though.
5309 * tests/calc.at: Adjust expect verbose output, since now "Entering
5310 state..." is on a different line than the "Shifting" message.
5311
9c66f418
AD
53122004-09-08 Akim Demaille <akim@epita.fr>
5313
5314 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
5315 Bison directive from the Bison file to the invocation of this
5316 macro, so that these directives are passed to
5317 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
5318 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
5319 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
5320 the extra Bison directives instead of the whole series.
5321 Change the grammar so that there are recoverable errors, and
5322 unrecoverable errors. Now we can have the parser give up before
5323 consuming the whole input. As a result we now can observe that
5324 the lookahead is freed when needed.
5325 Change the parser source to parse argv[1] instead of a hard coded
5326 string.
5327 Simplify yylex, and give a value and location to EOF.
5328 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
5329 passed directives already coded in the file.
5330 Add some tests to check the location of "error".
5331 For some tests, the C++ parser is correct, and not yacc.c.
5332 For other tests, they provide different, but unsatisfying, values,
5333 so keep the C++ value so that at least one parser is "correct"
5334 according to the test suite.
5335 (Actions after errors): Remove, this is subsumed by the
5336 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
5337
52d5733f
AD
53382004-09-06 Akim Demaille <akim@epita.fr>
5339
5340 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 5341 (Parser::pop): New.
52d5733f
AD
5342 Use it.
5343
a0e68930
AD
53442004-09-06 Akim Demaille <akim@epita.fr>
5345
5346 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
5347 argument, an informative message.
5348 Call YY_SYMBOL_PRINT.
5349 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
5350 * data/lalr1.cc (destruct_): Likewise.
5351 In addition, no longer depend on b4_yysymprint_generate and
5352 b4_yydestruct_generate to generate these functions, do it "by
5353 hand".
5354
e757bb10
AD
53552004-09-03 Akim Demaille <akim@epita.fr>
5356
5357 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
5358 invoked, yydestruct the lookahead.
5359 * tests/calc.at (Calculator $1): Update the expected lengths of
5360 traces: there is an added line for the discarded lookahead.
5361 * doc/bison.texinfo (Destructor Decl): Some rewording.
5362 Define "discarded" symbols.
5363
0fe1f06d
AD
53642004-09-02 Akim Demaille <akim@epita.fr>
5365
5366 * data/lalr1.cc (translate_, destruct_): No reason to be static.
5367
284acc8b
AD
53682004-09-02 Akim Demaille <akim@epita.fr>
5369
5370 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
5371 (YYDSYMPRINTF): Rename as...
5372 (YY_SYMBOL_PRINT): this.
5373 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
5374 two.
5375 Use it instead of direct symprint_ calls.
5376 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
5377 one.
5378
a5eb1ed2
AD
53792004-09-02 Akim Demaille <akim@epita.fr>
5380
b7c72fe1
AD
5381 * data/lalr1.cc (b4_yysymprint_generate): New.
5382 (symprint_): New member function, defined when YYDEBUG.
5383 Use it consistently instead of token/nterm debugging output by
5384 hand.
a5eb1ed2
AD
5385 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
5386 %printer calls to use cdebug_ when using lalr1.cc.
5387
417141dd
AD
53882004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
5389
5390 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
5391 with #ifdef YYDEBUG.
5392
2fa09258
AD
53932004-08-26 Akim Demaille <akim@epita.fr>
5394
5395 * doc/bison.texinfo (Implementing Loops): Rename as...
5396 (Implementing Gotos/Loops): this.
5397
9378b508
PE
53982004-08-13 Paul Eggert <eggert@cs.ucla.edu>
5399
5400 Adjust to latest gnulib.
5401 * bootstrap (gnulib_modules): Add xalloc-die.
5402 Set LC_ALL=C so that file names sort consistently.
5403 Prefer the gnulib copies of gettext.m4, glibc21.m4,
5404 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
5405 uintmax_t.m4, ulonglong.m4.
5406 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
5407 po.m4 since we are now using _gl.m4 instead.
5408
87a8ad5c
PE
54092004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
5410
5411 * src/scan-action.l: Remove. Scanning of semantic actions is
5412 handled in scan-gram.l.
5413
dca81a78
PE
54142004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
5415
5416 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
5417
5418 * src/location.h (struct): The file member is a uniqstr.
5419 (equal_boundaries): Use UNIQSTR_EQ for comparison.
5420
c9cbf7c5
PE
54212004-07-22 Paul Eggert <eggert@cs.ucla.edu>
5422
5423 Fix bug with non-%union parsers that have printers or destructors,
5424 which led to a Bison core dump. Reported by Peter Fales in
5425 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 5426
c9cbf7c5
PE
5427 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
5428 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
5429 not to our own type.
5430 * src/output.c (symbol_destructors_output, symbol_printers_output):
5431 Don't assume %union.
5432 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
5433 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
5434 UNION-FLAG. All callers changed.
5435 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
5436 Use type char, not unsigned int, when declaring an array of char;
5437 this lets us remove a cast.
5438 (Printers and Destructors): Add non-%union test cases.
5439
fa7e68c3
PE
54402004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5441
5442 * doc/bison.texinfo: Minor editorial changes, mostly to the new
5443 GLR writeups. E.g., avoid frenchspacing and the future tense,
5444 change "lookahead" to "look-ahead", and change "wrt" to "with
5445 respect to".
2fa09258 5446
fa7e68c3
PE
54472004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5448
5449 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
5450 New sections, split off from the GLR Parsers section. Put the new
5451 Simple GLR Parser near the start of the GLR section, for clarity.
5452 Rewrite connective text.
5453
99a9344e
PE
54542004-06-21 Frank Heckenbach <frank@g-n-u.de>
5455
5456 * doc/bison.texinfo (Simple GLR Parsers): New section.
5457
8dd162d3
PE
54582004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5459
5460 * NEWS, TODO, doc/bison.texinfo:
5461 Use "look-ahead" instead of "lookahead", to be consistent.
5462 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
5463 while we're fixing "look-ahead".
5464 * src/conflicts.c (shift_set): Renamed from shiftset.
5465 (look_ahead_set): Renamed from lookaheadset.
5466 * src/print.c: Likewise.
5467 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
5468 name for "lookahead".
5469 (report_types, usage): Likewise.
5470 * src/getargs.h (report_look_ahead_tokens): Renamed from
5471 report_lookaheads.
5472 * src/lalr.c (compute_look_ahead_tokens): Renamed from
5473 compute_lookaheads.
5474 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
5475 (look_ahead_tokens_print): Renamed from lookaheads_print.
5476 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
5477 state_rule_lookaheads_print.
5478 * src/state.h: Likewise.
5479 (reductions.look_ahead_tokens): Renamed from lookaheads.
5480 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
5481 AT_DATA_LOOKAHEADS_GRAMMAR.
5482
57a90331
PE
54832004-06-03 Paul Eggert <eggert@cs.ucla.edu>
5484
5485 * README: Update location of patched M4 distribution.
5486
8ed3234a
PE
54872004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
5488
5489 Don't assume the C++ compiler takes the same arguments as the C compiler
5490 (trivial change).
5491 * configure.ac (O0CXXFLAGS): New var.
5492 * tests/atlocal.in (CXXFLAGS): Use it.
5493
07971983
PE
54942004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5495
5496 Fix some "make check" problems with C++ reported by
5497 Albert Chin-A-Young for Tru64 C++ in this thread:
5498 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
5499
5500 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
5501 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5502 Output to a .cc file for C++, not to a .c file.
5503 * tests/calc.at (AT_CHECK_CALC): Likewise.
5504 * tests/regression.at (AT_CHECK_DANCER): Likewise.
5505 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
5506
29058652
PE
55072004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
5508
5509 * tests/calc.at, tests/actions.at: Workaround for SGI
5510 C++ compiler. (trivial change)
5511
62cb8a99
PE
55122004-05-27 Paul Eggert <eggert@cs.ucla.edu>
5513
fd418816
PE
5514 Spent a few hours checking out which prerequisite versions the
5515 current sources actually require. I went all the way back to
5516 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
5517 a seemingly endless set of combinations of versions more recent
5518 than that. The bottom line is that the current sources require
5519 fairly recent versions of the build tools, and it'll be some work
5520 to change this.
5521 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
5522 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
5523 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
5524 Add comments explaining why those particular versions are
5525 currently needed.
2fa09258 5526
62cb8a99
PE
5527 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
5528 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 5529 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
5530
5531 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
5532 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
5533
caa52c10
PE
55342004-05-26 Paul Eggert <eggert@cs.ucla.edu>
5535
5536 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
5537 0.11.5. Suggested by Bruno Haible.
5538 * bootstrap: Remove gettext version checking.
5539
5540 * doc/bison.texinfo (Decl Summary): Also mention that %union
5541 can depend on prerequisite types. Problem reported by Tim
5542 Van Holder.
5543
4bfd5e4e
PE
55442004-05-25 Paul Eggert <eggert@cs.ucla.edu>
5545
2cef3017
PE
5546 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
5547 * README-alpha: Don't tell people not to package this.
5548
b9c85d5c
PE
5549 * bootstrap: Don't assume $(...) works; use `...` instead.
5550 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
5551 gettext better.
5552
4bfd5e4e
PE
5553 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
5554 put into the -d output file, and mention what to do if YYSTYPE is
5555 defined as a macro.
5556
6a36ff94
PE
55572004-05-24 Paul Eggert <eggert@cs.ucla.edu>
5558
6712933e
PE
5559 Undo change made earlier today: it caused autopoint to not bring
5560 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
5561 autopoint's.
5562
5563 * bootstrap: Check that gettext version matches what's in
5564 configure.ac. Warn users to ignore robots.txt ERROR 404.
5565 * bootstrap: Undo today's earlier change (logged below).
5566 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 5567
6a36ff94
PE
5568 The gettext version checking is causing more trouble than it's
5569 curing; remove it. Problem reported by Paul Hilfinger.
5570
5571 * bootstrap: Issue a warning that one can expect a message
5572 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
5573 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
5574
209ea708
PE
55752004-05-23 Paul Eggert <eggert@cs.ucla.edu>
5576
5577 Ensure that the C++ compiler used for testing actually works on a
5578 simple test program; if not, skip the C++-related tests. Problem
5579 reported by Vin Shelton in:
161a71f3 5580 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
5581
5582 * m4/cxx.m4: New file.
5583 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
5584 * tests/atlocal.in (BISON_CXX_WORKS): Add.
5585 * tests/local.at (AT_COMPILE_CXX): Use it.
5586
41ca2549
PE
55872004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5588
383e69dc
PE
5589 * data/glr.c (yylloc): Output this macro even if locations are not
5590 being generated, as the GLR parser needs it even in that case.
5591 Problem reported by Troy A. Johnson
5592 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
5593
41ca2549
PE
5594 * configure.ac (AC_INIT): Update to 1.875e.
5595
e476c87d
PE
55962004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5597
5598 * NEWS: Version 1.875d.
5599 * configure.ac (AC_INIT): Likewise.
5600 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
5601
5602 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
5603 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
5604 lalr1.cc runs afoul of the first, and the last two are no longer
5605 supported by GCC 3.4.0.
5606 * README: Mention GNU m4 1.4 or later; mention m4 patches.
5607 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
5608
233a88ad
PE
56092004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5610
5611 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
5612 unsigned int, for compatibility with latest gnulib hash module.
5613 * src/state.c (state_hash, state_hasher): Likewise.
5614 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
5615 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 5616
12ffdd28
PE
56172004-05-03 Paul Eggert <eggert@cs.ucla.edu>
5618
5619 * NEWS: Unescaped newlines are no longer allowed in char & strings.
5620
5621 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
5622 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
5623 character and string literals.
5624 (unexpected_end): New function.
5625 (unexpected_eof): Use it.
5626 (unexpected_newline): New function.
5627 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
5628 actions.
e476c87d 5629
12ffdd28
PE
5630 * NEWS: Document %expect-rr.
5631
5632 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
5633 Fix typo by replacing $1 with $option.
5634 Remove more 'intl'-related files.
9668e2be 5635 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
5636
5637 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
5638 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
5639 strtoul.c.
5640 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
5641 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
5642 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
5643 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
5644 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
5645 * src/.cvsignore: Add *.output.
5646
5647 * src/parse-gram.y: Put copyright notice inside %{ %} so it
5648 gets copied to the output file.
e476c87d 5649
1f65350a
PE
56502004-04-28 Paul Eggert <eggert@twinsun.com>
5651
5652 Get files from the gnulib and po repositories, instead of relying
5653 on them being in our CVS. Upgrade to latest versions of gnulib
5654 and Automake.
5655
5656 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
5657 * bootstrap: Bootstrap from gnulib and po repositories.
5658 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
5659 * README-cvs: Document these changes. Remove version numbers from
5660 mentions of build tools, since they change so often. Mention Flex.
5661
5662 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
5663 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
5664 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
5665 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 5666 does this for us.
12ffdd28
PE
5667 (AC_ISC_POSIX): Remove; we no longer support this
5668 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
5669 (AC_HEADER_STDC): Remove: we now assume C89 or better.
5670 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
5671 Do not check for C89 headers, except for locale.h which is used
5672 by the Yacc library and must port to K&R hosts.
5673 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
5674 Do not check for C89 functions, except for setlocale which is
5675 used by the Yacc library.
5676 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
5677 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
5678 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
5679 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
5680 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
5681 AM_GNU_GETTEXT): Remove; now done by:
5682 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
5683 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
5684 for us.
5685
5686 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
5687 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
5688 Define to empty, as gnulib.mk will do the rest for us.
5689 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
5690 for us.
5691 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
5692 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
5693
5694 * src/files.c: Include gnulib's xstrndup.h.
5695
5696 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
5697 (REALLOC): Use xnrealloc, for likewise.
5698 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
5699 (strnlen, memrchr): Remove decls; functions no longer used.
5700 Include <stpcpy.h>.
5701
5702 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
5703 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
5704 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
5705 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
5706 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
5707 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
5708 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
5709 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
5710 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
5711 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
5712 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
5713 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5714 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
5715 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
5716 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
5717 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
5718 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
5719 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
5720 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
5721 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
5722 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
5723 Remove, as these files are now generated automatically
5724 by bootstrap or automake.
5725
5726 * po/ChangeLog: Remove: all but one entry was a duplicate
5727 of this file, and I moved that 2000-11-02 entry here.
5728
5729 * config/.cvsignore: Add Makefile, depcomp, install-sh.
5730 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
5731 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
5732 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
5733 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
5734 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
5735 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
5736 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
5737 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
5738 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
5739 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
5740 xstrndup.h.
5741 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
5742 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
5743 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
5744 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
5745 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
5746 * src/.cvsignore: Remove *_.c.
5747
5748
5749 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
5750 support it. (The latest stable gzip doesn't.)
5751
57522004-04-27 Paul Eggert <eggert@twinsun.com>
5753
5754 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
5755 case, as stos_ is now used by destructors due to the 2004-02-09
5756 change.
5757
5758 Remove more K&R C support.
5759 * lib/libiberty.y (PARAMS): Remove. All uses removed.
5760 * lib/subpipe.c (errno): Remove decl.
5761 Include <stdlib.h> unconditionally.
5762 (EXIT_FAILURE): Remove macro.
5763 * src/complain.c (vfprintf, strerror): Remove.
5764 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
5765 unconditionally.
5766 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
5767 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
5768 (strchr, strspn, memchr): Remove decls.
5769 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
5770 unconditionally. Do not declare perror.
5771 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
5772 unconditionally.
5773
5774 * src/complain.c (_): Remove useless defn, as system.h defines this.
5775
5776 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
5777 with latest obstack.h.
5778 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
5779 to procedure types, as obstack.h now does that for us.
5780 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
5781
5782 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
5783 so that this include file can stand alone.
5784 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
5785 does this now. Include subpipe.h first after config.h, to
5786 test whether it can stand alone.
5787
5788 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
5789 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
5790 unused declaration.
5791
5792 * tests/synclines.at (%union synch line): Put a dummy member in
5793 the union, because empty unions aren't allowed in C. Caught
5794 by GCC 3.4.0.
5795
4f16766c
PE
57962004-04-13 Jim Meyering <jim@meyering.net>
5797
5798 * src/conflicts.c (conflicts_print): Correct format string typo:
5799 use `%%' to produce literal `%'. (trivial change)
5800
779e7ceb
PE
58012004-03-30 Paul Eggert <eggert@twinsun.com>
5802
5803 * src/getargs.c (version): Update copyright year to 2004.
5804
5805 * data/c.m4 (b4_int_type): Use 'short int' rather than
5806 'short', and similarly for 'long', 'unsigned', etc.
5807 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
5808 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
5809 yy_yypstack, yydumpstack): Likewise.
5810 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
5811 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
5812 Likewise.
5813 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
5814 yy_stack_print, yyparse): Likewise.
5815 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
5816 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
5817 * lib/bitset.c (bitset_print): Likewise.
5818 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
5819 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
5820 * lib/bitsetv.c (bitsetv_dump): Likewise.
5821 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
5822 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
5823 Likewise.
5824 * src/LR0.c (allocate_itemsets): Likewise.
5825 * src/gram.h (rule_number, rule): Likewise.
5826 * src/lalr.h (goto_number): Likewise.
5827 * src/nullable.c (nullable_compute): Likewise.
5828 * src/output.c (prepare_rules): Likewise.
5829 * src/relation.c (relation_print, relation_digraph): Likewise.
5830 * src/relation.h (relation_node): Likewise.
5831 * src/state.h (state_number, transitions, errs, reductions,
5832 struct state): Likewise.
5833 * src/symtab.h (symbol_number, struct symbol): Likewise.
5834 * src/tables.c (vector_number, tally, action_number,
5835 default_goto, goto_actions): Likewise.
5836 * tests/existing.at (GNU Cim Grammar): Likewise.
5837 * tests/regression.at (Web2c Actions): Likewise.
5838
5839 * src/output.c (muscle_insert_short_int_table): Renamed from
5840 muscle_insert_short_table. All uses changed.
5841
d6328241
PH
58422004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5843
5844 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
5845 (declaration): Replace expected_conflicts with expected_sr_conflicts.
5846 Add %expect-rr rule.
4f16766c 5847
d6328241
PH
5848 * src/scan-gram.l: Recognize %expect-rr.
5849
4f16766c 5850 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 5851 expected_conflicts.
4f16766c 5852 (expected_rr_conflicts): Declare.
d6328241
PH
5853
5854 * src/conflicts.c (expected_sr_conflicts): Rename from
5855 expected_conflicts.
5856 (expected_rr_conflicts): Define.
5857 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
5858 for GLR parsers.
5859 Use expected_sr_conflicts in place of expected_conflicts.
5860 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 5861
d6328241 5862 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 5863
1452af69
PE
58642004-03-08 Paul Eggert <eggert@gnu.org>
5865
5866 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 5867 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
5868
5869 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
5870 in lalr1.cc.
5871 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
5872 * src/scan-gram.l (scan_integer): New function.
5873 ({int}): Use it.
5874 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
5875 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
5876 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
5877 Say "long int", not "long", for uniformity with GNU style.
5878
006d217d
PE
58792004-02-25 Paul Eggert <eggert@twinsun.com>
5880
5881 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
5882 compilers. This fixes a problem with Intel's C++ compiler being
5883 chatty, reported by Guido Trentalancia in
161a71f3 5884 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 5885
c2729758
ADL
58862004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
5887
5888 Support %destructor and merge error locations in lalr1.cc.
5889
5890 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
5891 (Parser::stos_): Define unconditionally.
5892 (Parser::destruct_): New method. Generate its body with
5893 b4_yydestruct_generate.
5894 (Parser::error_start_): New attribute.
5895 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
5896 token which are discarded.
5897 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
5898 error_start_ when erroneous token are discarded.
5899 (Parser::parse) <yyerrlab1>: Compute the location of the error
5900 token so that it covers all the discarded tokens.
5901 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
5902 it can be called with `%skeleton "lalr1.cc"', and do that.
5903
dd0e0635
PE
59042004-02-02 Paul Eggert <eggert@twinsun.com>
5905
5906 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
5907 $(top_srcdir)/lib and ../lib. This fixes a bug reported
5908 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
5909 There's no need to mention top_builddir since Automake does that
5910 for us.
5911 (INCLUDES): Remove, as Automake says it's obsolescent.
5912 Contents migrated into AM_CPPFLAGS as described above.
5913 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
5914
59152004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5916
5917 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
5918 (yyreportSyntaxError): Handle case where lookahead token is
5919 YYEMPTY.
5920
be16239b
PH
59212004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5922
5923 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
5924 resulting parsers are compilable with C++.
5925
5fa90832
PE
59262003-12-23 Paul Eggert <eggert@twinsun.com>
5927
5928 * config/depcomp, config/install-sh: Sync with Automake 1.8.
5929 * src/output.c (output_skeleton): Rename local var.
5930 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
5931 Bison tokens, as this runs afoul of the 2003-10-07 change that
5932 disallowed NUL bytes in character constants or string literals.
5933
5934 * tests/local.at: Require Autoconf 2.59's Autotest.
5935 * tests/testsuite.at: Don't include local.at, since we now assume
5936 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
5937 including it.
5938 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
5939 multiple inclusion warnings.
dd0e0635 5940
b165c324
AD
59412003-12-02 Akim Demaille <akim@epita.fr>
5942
5943 * doc/bison.texinfo (How Can I Reset the Parser): More about start
5944 conditions.
5945 From Bruno Haible.
5946
26e06a21
ADL
59472003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
5948
5949 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
5950
92ac3705
PE
59512003-10-07 Paul Eggert <eggert@twinsun.com>
5952
6a5ecb38
PE
5953 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
5954 if testsuite doesn't exist.
5955
92ac3705
PE
5956 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
5957 literals, unfortunately.
5958 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
5959 Complain about NUL bytes in character constants or string literals.
5960
91d2c560
PE
59612003-10-05 Paul Eggert <eggert@twinsun.com>
5962
5963 * NEWS: Don't document %no-default-prec, as it's still
5964 too experimental.
5965 * doc/bison.texinfo: Document %no-default-prec only if
5966 the defaultprec flag is set. Normally it's not.
5967
0cc3da3a
PE
59682003-10-04 Paul Eggert <eggert@twinsun.com>
5969
5970 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
5971 non-modifiable lvalue, instead of a modifiable one.
5972 * doc/bison.texinfo (Actions): Document that $$ can
5973 be assigned to. Do not claim that $$ and $N are
5974 array element references: user code should not rely on this.
5975
22fccf95
PE
59762003-10-01 Paul Eggert <eggert@twinsun.com>
5977
5978 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
5979 (grammar_declaration): Use it.
5980 * src/scan-gram.l: New token %no-default-prec.
5981 * tests/conflicts.at: Revamp tests to use %no-default-prec.
5982 * NEWS, doc/bison.texinfo: Document the above.
5983
fc8f2965
AD
59842003-10-01 Akim Demaille <akim@epita.fr>
5985
5986 VCG no longer supports long_straight_phase.
5987
5988 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
5989 * src/print_graph.c (print_graph): Adjust.
5990
39a06c25
PE
59912003-09-30 Frank Heckenbach <frank@g-n-u.de>
5992 and Paul Eggert <eggert@twinsun.com>
5993
5994 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
5995 Table of Symbols): Document %default-prec.
5996 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
5997 (grammar_declaration): Set default_prec on %default-prec.
5998 * src/scan-gram.l (%default-prec): New token.
5999 * src/reader.h (default_prec): New flag.
6000 * src/reader.c: Likewise.
6001 (packgram): Handle it.
6002 * tests/conflicts.at (%default-prec without %prec,
6003 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 6004
39a06c25
PE
60052003-09-30 Paul Eggert <eggert@twinsun.com>
6006
6007 * tests/testsuite.at: Include local.at, not input.at, fixing
6008 a typo in the 2003-08-25 patch.
6009
62b6aef9
AD
60102003-08-27 Akim Demaille <akim@epita.fr>
6011
6012 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6013 GCC warnings.
6014
89e1cc61
AD
60152003-08-26 Akim Demaille <akim@epita.fr>
6016
6017 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6018 "<\#" to avoid magic from Gnus when posting parts of this script.
6019
a08460b0
AD
60202003-08-26 Akim Demaille <akim@epita.fr>
6021
6022 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6023 (Parser::parse): here.
6024 Adjust: nerrs and errstatus is now replaced by...
6025 (Parser::nerrs_, Parser::errstatus_): New.
6026
603f1cfd
AD
60272003-08-25 Akim Demaille <akim@epita.fr>
6028
6029 * config/announce-gen, Makefile.cfg: New.
6030 * Makefile.am: Adjust.
6031 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6032 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6033
cd3684cf
AD
60342003-08-25 Akim Demaille <akim@epita.fr>
6035
6036 When reducing initial empty rules, Bison parser read an initial
6037 location that is not defined. This results in garbage, and that
6038 affects Bison's own parser. Therefore we need (i) to extend Bison
6039 to support a means to initialize this location, and (ii) to use
6040 this CVS Bison to fix CVS Bison's parser.
6041
6042 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6043 with...
6044 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6045 * src/parse-gram.y: Adjust.
6046 (%initial-action): New.
6047 (%error-verbose): Since we require CVS Bison, there is no reason
6048 not to use it.
6049 * src/scan-gram.l: Adjust.
6050 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6051 * data/yacc.c (yyparse): Use b4_initial_action.
6052
4e03e201
AD
60532003-08-25 Akim Demaille <akim@epita.fr>
6054
6055 * doc/bison.texinfo: Don't promote stdout for error messages.
6056
8c182d05
AD
60572003-08-25 Akim Demaille <akim@epita.fr>
6058
6059 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6060 From Alexandre Duret-Lutz.
6061
6a60c4cf
PE
60622003-08-25 Akim Demaille <akim@epita.fr>
6063
6064 Version 1.875c.
6065
25f66e1a
AD
60662003-08-25 Akim Demaille <akim@epita.fr>
6067
6068 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6069 Use them.
6070
5348bfbe
AD
60712003-08-25 Akim Demaille <akim@epita.fr>
6072
6073 * data/lalr1.cc (Parser::reduce_print_): New.
6074 Use it.
6075
47301314
AD
60762003-08-25 Akim Demaille <akim@epita.fr>
6077
6078 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6079 error recovery loops. This patch is based on
161a71f3 6080 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
6081 Also, augment the similarity between lalr1.cc and yacc.c.
6082 Note: the locations of error recovery rules are not correct yet.
6083
6084 * data/lalr1.cc: Comment changes to augment the similarity between
6085 lalr1.cc and yacc.c.
6086 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6087 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6088 yyerrlab), when hitting EOF, pop the whole stack here instead of
6089 merely falling thru the default error handling mechanism.
6090 (yyerrorlab): New label, with the old contents of YYERROR,
6091 plus the following change: pop the stack of rhs corresponding
6092 to the production that invoked YYERROR. That is how Yacc
6093 behaves (required by POSIX).
6094 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6095 fail.
6096
1f7a61ff
AD
60972003-08-25 Akim Demaille <akim@epita.fr>
6098
6099 Tune local.at so that people can "autom4te -l autotest calc.at -o
6100 calc" for instance, to extract a sub test suite.
6101
6102 * tests/testsuite.at: Move the initialization, Autotest version
6103 requirement, and AT_TESTED invocation into...
6104 * tests/local.at: here.
6105 * tests/testsuite.at: Include it for compatibility with Autoconf
6106 2.57.
6107 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6108 be ignore.
6109
327b5b56
PE
61102003-08-04 Paul Eggert <eggert@twinsun.com>
6111
6112 Rework code slightly to avoid gcc -Wtraditional warnings.
6113 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6114 The returned value is now stored in *YY0. All callers changed.
6115 * src/output.c (merge_output): Adjust to the above change.
6116
0051e3ed
PE
61172003-07-26 Paul Eggert <eggert@twinsun.com>
6118
6119 * data/glr.c (YYASSERT): New macro.
6120 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6121 yyresolveStates, yyprocessOneStack):
6122 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6123 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 6124
137437c6
PE
61252003-07-25 Paul Eggert <eggert@twinsun.com>
6126
5b620e06
PE
6127 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6128 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 6129 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
6130 by Frank Heckenbach, though I have omitted the structure-initialization
6131 part of his glr-knr.diff patch since I recall that the Portable
6132 C Compiler didn't require that change.
6133
137437c6
PE
6134 Let the user specify how to allocate and free memory.
6135 Derived from a suggestion by Frank Heckenbach in
161a71f3 6136 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
6137 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6138 All uses of free, malloc, realloc changed to use these macros,
6139 and unnecessary casts removed.
6140 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6141
ddb85ca5
PE
61422003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6143
6144 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6145 use s.empty() rather than s == "" to test for empty string; see
161a71f3 6146 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
6147 (trivial change)
6148
39910e09
AD
61492003-06-25 Akim Demaille <akim@epita.fr>
6150
6151 * config/depcomp, config/install-sh: Update from masters.
6152
0ae99356
PE
61532003-06-20 Paul Eggert <eggert@twinsun.com>
6154
6155 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6156 and return properly parenthesized result.
6157 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6158 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6159 Remove unnecessary parentheses from uses.
6160 * doc/bison.texinfo (Location Default Action): Describe the
6161 conventions for parentheses.
6162
cd05d13c
PE
61632003-06-19 Paul Eggert <eggert@twinsun.com>
6164
81fd08ca
PE
6165 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6166 yyreportTree): Do not assume that size_t is the same width as int,
6167 when printing sizes. Print sizes using an unsigned format.
6168 Problem reported by Frank Heckenbach in
161a71f3 6169 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 6170
cd05d13c
PE
6171 Port to Forte Developer 7 C compiler.
6172 * data/glr.c (struct YYLTYPE): If locations are not being used,
6173 declare a single dummy member, as empty structs do not conform
6174 to the C standard.
6175 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6176 the Forte Developer 7 C compiler complains that end-of-loop
6177 code is not reached.
6178
4dcf140b
PE
61792003-06-17 Paul Eggert <eggert@twinsun.com>
6180
6181 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6182 avoid warnings from picky compilers about redefinition of PARAMS.
6183
8dd76bee
PE
61842003-06-17 Paul Eggert <eggert@twinsun.com>
6185
6186 Version 1.875b.
6187
6188 * NEWS: Document 1.875b.
6189
6190 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6191 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6192 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6193 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6194 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6195 per recent gettext manual's suggestion.
6196 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6197 Use prototypes, not old-style definitions.
6198 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6199 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6200 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6201 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6202 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6203 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6204 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6205 vbitset_or_and_cmp, vbitset_copy): Likewise.
6206
6207 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6208 Do not include <stdlib.h>.
6209 (PARAMS): Define unconditionally for C89.
6210 (ATTRIBUTE_NORETURN): Remove.
6211 (ATTRIBUTE_UNUSED): Define unconditionally.
6212
6213 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 6214 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
6215 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6216 * lib/vbitset.c, lib/vbitset.h: New files.
6217 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6218 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6219 from libbitset.
6220
6221 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6222 `How Can I Reset @code{yyparse}', since texinfo does not allow
6223 arbitrary @ in node names.
6224
6225 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6226 shouldn't be needed according to the gettext 0.12.1 documentation
6227 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 6228 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 6229 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 6230 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 6231
8dd76bee
PE
6232 * lib/.cvsignore: Add stdbool.h.
6233 * m4/.cvsignore: Add nls.m4, po.m4.
6234
6235 Upgrade to CVS gnulib.
6236 * stdbool_.h: File renamed from stdbool.h.in.
6237 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6238 AC_HEADER_STDBOOL.
6239 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6240 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6241 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6242 (MOSTLYCLEANFILES): New var.
6243 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6244 (stdbool.h): New rule.
6245 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6246 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6247 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6248 m4/quote.m4: Upgrade to today's gnulib.
6249
6250 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6251 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6252 the tests right now.
6253 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6254 yyerror are declared before use; C99 requires this.
6255
25005f6a
PH
62562003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6257
6258 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6259 first.
6260 (yyrecoverSyntaxError): Correct the logic for setting and testing
6261 yyerrState.
6262 Correct comment on handling EOF.
6263 Allow states with only a default reduction, rather than failing
8dd76bee 6264 (I can't quite reconstruct why these were not allowed before).
25005f6a 6265
137437c6 6266 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 6267 buffer overruns, corrupting state.
8dd76bee
PE
6268
6269 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
6270 definition.
6271 * src/reader.h (max_left_semantic_context): New variable declaration.
6272 * src/scan-gram.l (max_left_semantic_context): Define.
6273 (handle_action_dollar): Update max_left_semantic_context.
6274 * data/glr.c (YYMAXLEFT): New definition.
6275 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
6276 (yyresolveAction): Ditto.
6277
6278 Fixes to problems with location handling in GLR parsers reported by
6279 Frank Heckenbach (2003/06/05).
6280
6281 * data/glr.c (YYLTYPE): Make trivial if locations not used.
6282 (YYRHSLOC): Add parentheses, and define only if locations used.
6283 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
6284 locations not used.
6285 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6286 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 6287
25005f6a
PH
6288 * tests/cxx-type.at: Exercise location information; update tests
6289 to differentiate output with and without locations.
8dd76bee 6290 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
6291 because default YYLTYPE not yet defined.
6292 Change semantic actions to compute strings, rather than printing
6293 them directly (to test proper passing of semantics values). Change
6294 output to prefix notation and update test data and expected results.
6295 (yylex): Track locations.
6296 (stmtMerge): Return value rather than printing, and include arguments
6297 in value.
8dd76bee 6298
711f40b7
PE
62992003-06-03 Paul Eggert <eggert@twinsun.com>
6300
6301 Avoid warnings generated by GCC 2.95.4 when Bison is
6302 configured with --enable-gcc-warnings.
6303 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
6304 yy::]b4_parser_class_name[::translate_,
6305 yy::Stack::operator[] (unsigned),
6306 yy::Stack::operator[] (unsigned) const,
6307 yy::Slice::operator[] (unsigned),
6308 yy::Slice::operator[] (unsigned) const):
6309 Rename local vars to avoid warnings.
6310 * tests/glr-regression.at (Improper handling of embedded actions
6311 and $-N in GLR parsers): Remove unused local variable from yylex.
6312 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
6313 (void) as arg when not pure, since we now assume C89 when building
6314 Bison. Pacify GCC by using parameter.
6315
ac695f7d
PE
63162003-06-02 Paul Eggert <eggert@twinsun.com>
6317
6318 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
6319 yy::Location::lines, yy::Location::columns): Rename arguments
6320 to avoid shadowing; this removes a warning generated by GCC 3.3.
6321
26ec81e0
PE
63222003-06-01 Paul Eggert <eggert@twinsun.com>
6323
6324 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
6325 to g++, as GCC 3.3 complains if you do it.
6326 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
6327 everything that WARNING_CFLAGS has, except omit warnings
6328 not suitable for C++.
6329 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
6330 * tests/atlocal.in (CXXFLAGS): New var.
6331 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
6332
6333 Fix a GLR parser bug I reported in February; see
161a71f3 6334 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
6335 The problem was that GLR parsers did not conform to the C standard,
6336 because actions like { $1 = $2 + $3; } expanded to expressions
6337 that invoked YYFILL in separate subexpressions, and YYFILL assigned
6338 to a local variable. The C standard says that expressions
6339 like (var = f ()) + (var = f ()) have undefined behavior.
6340 Another problem was that GCC sometimes issues warnings that
6341 yyfill and its parameters are unused.
6342
6343 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
6344 as possibly unused.
6345 (yyfill): New function.
6346 (YYFILL): Use it.
6347 (yyuserAction): Change type of yynormal to bool, so that it matches
6348 the new yyfill signature. Mark it as possibly unused.
6349
6350
6351 Follow up on a bug I reported in February, where a Bison-generated
6352 parser can loop. Provide a test case and a fix for yacc.c. I
6353 don't have a fix for lalr1.cc or for glr.c, unfortunately.
6354 The original bug report is in:
161a71f3 6355 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
6356
6357 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
6358 macro's size was becoming unwieldy.
6359 (yyerrlab): Do not discard an empty lookahead symbol, as this
6360 might destroy garbage.
6361 (yyerrorlab): New label, with the old contents of YYERROR,
6362 plus the following change: pop the stack of rhs corresponding
6363 to the production that invoked YYERROR. That is how Yacc
6364 behaves, and POSIX requires this behavior.
6365 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
6366 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
6367 Define 'alarm' to do nothing if unistd.h is not available.
6368 Add a new rule "exp: '-' error;" to test the above change to
6369 data/yacc.c. Use 'alarm' to abort any test taking longer than
6370 10 seconds, as it's probably looping.
6371 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
6372 Also, the new yacc.c generates two fewer diagnostics for an
6373 existing test.
6374
d0829076
PE
63752003-05-24 Paul Eggert <eggert@twinsun.com>
6376
c6ae27df
PE
6377 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
6378 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
6379 This fixes a problem reported by John Bowman when the Compaq/HP
6380 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
6381 -ansi -Wall -gall).
6382 * data/yacc.c (union yyalloc): Likewise.
6383 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 6384
d0829076
PE
6385 Switch from 'int' to 'bool' where that makes sense.
6386
6387 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
6388 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
6389 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
6390 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
6391 Return or accept bool, not int. All callers changed.
6392 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
6393 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
6394 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
6395 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
6396 bitset_or_and_cmp_): Likewise.
6397 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
6398 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
6399 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
6400 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
6401 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
6402 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
6403 bitset_stats_or_and_cmp): Likewise.
6404 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
6405 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
6406 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
6407 ebitset_xor_cmp): Likewise.
6408 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
6409 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
6410 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
6411 lbitset_xor_cmp): Likewise.
6412 * lib/bbitset.h: Include <stdbool.h>.
6413 (struct bitset_vtable): The following members now return bool, not
6414 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
6415 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
6416 or_and_cmp).
6417 * src/conflicts.c (count_rr_conflicts): Likewise.
6418 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
6419 All uses changed.
6420 * lib/ebitset.c (ebitset_obstack_init): Likewise.
6421 * lib/lbitset.c (lbitset_obstack_init): Likewise.
6422 * src/getargs.c (debug_flag, defines_flag, locations_flag,
6423 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6424 graph_flag): Likewise.
6425 * src/getargs.h (debug_flag, defines_flag, locations_flag,
6426 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6427 graph_flag): Likewise.
6428 * src/output.c (error_verbose): Likewise.
6429 * src/output.h (error_verbose): Likewise.
6430 * src/reader.c (start_flag, typed): Likewise.
6431 * src/reader.h (typed): Likewise.
6432 * src/getargs.c (LOCATIONS_OPTION): New constant.
6433 (long_options, getargs): Use it.
6434 * src/lalr.c (build_relations): Use bool, not int.
6435 * src/nullable.c (nullable_compute): Likewise.
6436 * src/print.c (print_reductions): Likewise.
6437 * src/tables.c (action_row, pack_vector): Likewise.
6438 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
6439 * src/output.c (prepare): Use it.
6440 * src/output.c (token_definitions_output,
6441 symbol_destructors_output, symbol_destructors_output): Use string,
6442 not boolean integer, to keep track of whether to output separator.
6443 * src/print_graph.c (print_core): Likewise.
6444 * src/state.c (state_rule_lookaheads_print): Likewise.
6445
6446 * config/install-sh: Sync from automake 1.7.5.
6447
6b2584b7
PE
64482003-05-14 Paul Eggert <eggert@twinsun.com>
6449
6450 * src/parse-gram.y (rules_or_grammar_declaration): Require a
6451 semicolon after a grammar declaration, in the interest of possible
6452 future changes to the Bison input language.
6453 Do not allow a stray semicolon at the start of the grammar.
6454 (rhses.1): Allow one or more semicolons after any rule, including
6455 just before "|" as required by POSIX.
6456 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
6457 grammar.
6458
caf37a36
ADL
64592003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
6460
6461 %parse-param support for lalr1.cc.
6462
6463 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
6464 b4_cc_constructor_calls, b4_cc_constructor_call,
6465 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
6466 definitions.
6467 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
6468 parse-param arguments.
6469 (yy::b4_parser_class_name): Declare instance variables to
6470 hold parse-param arguments.
6471 * tests/calc.at: s/value/semantic_value/ because value clashes
6472 with a member of yy::b4_parser_class_name. Adjust C++ code
6473 to handle %parse-param. Enable %parse-param test in C++.
6474
3ab37077
PE
64752003-05-12 Paul Eggert <eggert@twinsun.com>
6476
6477 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
6478 English a bit. Fix fclose typo. Change "const char" to "char
6479 const", and use ANSI C rather than K&R for "main". Suggest
6480 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
6481 and suggest yy_switch_to_buffer.
6482
64832003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
6484
6485 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
6486 C89. This avoids a diagnostic on compilers that define __STDC__
6487 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 6488 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 6489
e743727f
PE
64902003-05-03 Paul Eggert <eggert@twinsun.com>
6491
6492 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
6493 Do not overrun array bounds.
6494 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 6495 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 6496
916708d5
AD
64972003-04-29 Akim Demaille <akim@epita.fr>
6498
6499 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
6500 * src/getargs.c, src/getargs.h: here, as bool, not int.
6501 (nondeterministic_parser): New.
6502 * src/parse-gram.y, src/scan-gram.l: Support
6503 %nondeterministic-parser.
6504 * src/output.c (prepare): Use nondeterministic_parser instead
6505 of glr_parser where appropriate.
6506 * src/tables.c (conflict_row, action_row, save_row)
6507 (token_actions, token_actions, pack_vector): Ditto.
6508
a06ea4aa
AD
65092003-04-29 Akim Demaille <akim@epita.fr>
6510
6511 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
6512
211074ca
AD
65132003-04-29 Akim Demaille <akim@epita.fr>
6514
6515 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
6516 with %pure-parser and %locations to exercise the patch from Yakov
6517 Markovitch below.
6518
6175ffe3
PE
65192003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
6520
6521 * data/yacc.c: (b4_lex_param): Corrected for the case where
6522 %lex-param is provided and %pure-parser isn't.
6523
b1e95857
PE
65242003-04-27 Paul Eggert <eggert@twinsun.com>
6525
6526 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 6527 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
6528 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
6529 if it is not defined.
6530 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
6531
acda9df6
PE
65322003-04-26 Paul Eggert <eggert@twinsun.com>
6533
3470c57b
PE
6534 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
6535 Declare to be of type suitable for the ninf value itself, not of
6536 type suitable for the corresponding table, since the latter might
6537 be unsigned but the ninf value might be negative. This fixes a
6538 bug reported by Alexandre Duret-Lutz in
161a71f3 6539 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 6540
acda9df6
PE
6541 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
6542 invokes it. We shouldn't invoke it twice because it will attempt
6543 to put error.o in the archive twice. This fixes a glitch reported
6544 by Martin Mokrejs in
161a71f3 6545 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 6546
b5250f26
PE
65472003-04-21 Paul Eggert <eggert@twinsun.com>
6548
6549 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
6550 to gnulib.
6551
089ac0f1
PE
65522003-04-21 Yakov Markovitch <Markovitch@iso.ru>
6553
6554 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
6555 Fix obvious typo that results in uncompilable GLR parsers
6556 when both %pure-parser and %locations are used. (trivial change)
6557
5ededac6
PE
65582003-04-17 Paul Eggert <eggert@twinsun.com>
6559
1b8f2fff
PE
6560 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
6561 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
6562 Do not insert the expected token via unput, as this runs afoul
6563 of a POSIX-compatibility bug in flex 2.5.31.
6564 All uses changed to BEGIN the parent state,
6565 since we no longer insert the expected token via unput.
6566 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
6567 that is no longer emitted after the above change.
6568
5ededac6
PE
6569 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
6570 the first one. This change is from Paul Hilfinger, and it fixes
6571 regression reported by Werner Lemberg in
161a71f3 6572 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
6573
6574 (resolve_sr_conflict): Don't invoke state_errs_set
6575 unless one or more tokens have been explicitly made errors.
6576 Otherwise, the above change causes Bison to abort.
6577
6578 * tests/existing.at (GNU pic Grammar): New test case, taken from
6579 Lemberg's email.
6580
b8be9132
AD
65812003-03-31 Akim Demaille <akim@epita.fr>
6582
6583 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
6584
d423d460
AD
65852003-03-31 Akim Demaille <akim@epita.fr>
6586
6587 * src/output.c (prepare_symbols): Avoid trailing spaces in the
6588 output.
6589
c7e441b4
AD
65902003-03-31 Akim Demaille <akim@epita.fr>
6591
6592 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
6593 From Paul Hilfinger.
6594
231897ad
AD
65952003-03-29 Akim Demaille <akim@epita.fr>
6596
6597 * m4/error.m4: Do not put under dynamic conditions some code which
6598 expansion is under static control.
6599
5b066063
AD
66002003-03-29 Akim Demaille <akim@epita.fr>
6601
6602 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
6603
22a74fec
AD
66042003-03-29 Akim Demaille <akim@epita.fr>
6605
6606 * doc/bison.texinfo (Strings are Destroyed): New.
6607
0eee27e7
PE
66082003-03-13 Paul Eggert <eggert@twinsun.com>
6609
6610 * .cvsignore: Add configure.lineno.
6611 * src/.cvsignore: Add yacc.
6612 * tests/.cvsignore: Add testsuite.log.
6613 * doc/fdl.texi: Sync with latest FSF version.
6614
f61aad93
PE
66152003-03-12 Paul Eggert <eggert@twinsun.com>
6616
537636c7
PE
6617 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
6618 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
6619 cursor, instead of leaving it undefined. This fixes a bug
6620 reported by Tim Van Holder in
161a71f3 6621 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
6622 * tests/input.at (Torturing the Scanner): Test the scanner on
6623 an empty input file, which was Tim Van Holder's test case.
6624
6625 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
6626 <sys/resource.h> can be included, include sys/time.h and
6627 sys/times.h first, if available. This works around the SunOS
6628 4.1.4 porting bug reported by Bruce Becker in
161a71f3 6629 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
6630
6631 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
6632 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
6633 AC_HEADER_SYS_WAIT.
6634
f61aad93
PE
6635 Merge changes from gnulib. This was prompted because the CVS
6636 snapshot didn't build on Solaris 7 due to strnlen problems.
6637
6638 These changes need to be merged back into gnulib:
6639 * lib/hash.c: Include <stdbool.h> unconditionally.
6640 * m4/onceonly.m4 (m4_quote): New macro.
6641 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
6642 Quote AC_FOREACH variable-expansions properly.
6643 The 2003-01-03 obstack.h change also needs merging.
6644 {end of changes requiring merging}
5b066063 6645
f61aad93
PE
6646 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6647 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
6648 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
6649 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
6650 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
6651 New files, imported from gnulib.
6652 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
6653 above.
6654
6655 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
6656 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
6657 gnulib sources.
6658
6659 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
6660 Add.
6661 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
6662 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
6663 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
6664 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
6665 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
6666 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
6667 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
6668 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
6669 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
6670 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
6671 (jm_PREREQ_ARGMATCH): Remove.
6672 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
6673 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
6674
6675 * src/system.h: Include <stdbool.h> unconditionally.
6676
6677 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
6678 assuming at least C89 in the bitset code for some time now.
6679
d2ffe116
AD
66802003-03-03 Akim Demaille <akim@epita.fr>
6681
6682 * ro.po: New.
6683
052826fd
AD
66842003-03-02 Akim Demaille <akim@epita.fr>
6685
6686 * doc/bison.texinfo (Table of Symbols): Reactivate the
6687 documentation for %lex-param, and %parse-param.
6688
c4749565
AD
66892003-03-02 Akim Demaille <akim@epita.fr>
6690
6691 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
6692 generate verbose error messages.
6693 Use the number of tokens as an upper bound in yytname, as it
6694 cannot be a non terminal.
6695
d5286af1
AD
66962003-03-02 Akim Demaille <akim@epita.fr>
6697
6698 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
6699 message.
6700
22e304a6
AD
67012003-03-02 Akim Demaille <akim@epita.fr>
6702
22e304a6
AD
6703 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
6704 Use them to exercise yycheck overrun.
6705 Based on Andrew Suffield's grammar.
6706
67a25fed
AD
67072003-03-02 Akim Demaille <akim@epita.fr>
6708
6709 Create tests/local.at for Bison generic testing macros.
6710
6711 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
6712 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
6713 This new file.
6714 * tests/calc.at (AT_CHECK_CALC): Adjust.
6715 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
6716 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
6717 * tests/local.at: here.
6718 (AT_COMPILE_CXX): Tags the tests using it as c++.
6719 Ignore the test if CXX is not functional.
6720
9c2b381f
PE
67212003-03-01 Paul Eggert <eggert@twinsun.com>
6722
6723 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
6724 not loc->end, since loc->end might contain garbage and this leads
6725 to undefined behavior on some platforms.
6726 (id_loc, token_start): Use (IF_LINTed) initial values that do not
6727 depend on *loc, so that the reader doesn't give the the false
6728 impression that *loc is initialized.
6729 (<INITIAL>"%%"): Do not bother setting code_start, since its value
6730 does not survive the return.
6731
0433ba88
AD
67322003-03-01 Akim Demaille <akim@epita.fr>
6733
6734 * src/scan-gram.l (code_start): Always initialize it when entering
6735 into yylex, as SC_EPILOGUE is activated *before* the corresponding
6736 yylex invocation. An alternative would be making it static, but
6737 then it starts with the second %%'s beginning, instead of its end.
6738
b305ea69
PE
67392003-02-28 Paul Eggert <eggert@twinsun.com>
6740
6741 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
6742 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 6743 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 6744
c3d25e01
PE
67452003-02-26 Paul Eggert <eggert@twinsun.com>
6746
6747 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
6748 Remove Sequent/Pyramid discussion (nobody uses them any more).
6749 Merge VMS and MS-DOS discussion; these ports may well be dead
6750 but let's keep mentioning them for now. Put <> around email
6751 addresses. Add copyright notice.
6752
c267ffbc
PE
67532003-02-24 Paul Eggert <eggert@twinsun.com>
6754
6755 * data/glr.c (yy_reduce_print): yylineno -> yylno,
6756 to avoid collision with flex use of yylineno.
6757 Problem reported by Bruce Lilly in
161a71f3 6758 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
6759 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6760 * data/yacc.c (yy_reduce_print): Likewise.
6761
6762 * config/depcomp: Sync with Automake 1.7.3.
6763
f939fc12
AD
67642003-02-21 Akim Demaille <akim@epita.fr>
6765
6766 * data/lalr1.cc: Use temporary variables instead of casts to
6767 change integer types.
6768 Suggested by Paul Eggert.
6769
95923bd6
AD
67702003-02-21 Akim Demaille <akim@epita.fr>
6771
6772 * doc/bison.texinfo: Use "location" consistently to refer to @n,
6773 to avoid confusions with lalr1.cc's notion of Position.
6774 Suggested by Paul Eggert.
6775
2cdc240e
AD
67762003-02-20 Akim Demaille <akim@epita.fr>
6777
6778 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
6779 before initial_columns.
6780 (location.hh): Use consistent variable names when defining the
6781 operator<<.
6782 Use "last" so that we subtract from Positions, not from unsigned.
6783
5d003116
AD
67842003-02-20 Akim Demaille <akim@epita.fr>
6785
6786 * data/lalr1.cc (position.hh): New subfile, including the extended
6787 and Doxygen'ed documentation of class Position.
6788 (location.hh): Use it.
6789 Document a` la Doxygen.
ba1ecc07 6790 With the help of Benoit Perrot.
5d003116 6791
d02b25f9
AD
67922003-02-20 Akim Demaille <akim@epita.fr>
6793
6794 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
6795 AT_YACC_IF.
6796 Redefine AT_YYERROR_SEES_LOC_IF using it.
6797 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
6798 not defined.
6799 Don't use the location in yy::Parser::error_ and
6800 yy::Parser::print_ when not %locations.
6801 Activate more lalr1.cc tests.
6802
0d1c3a04
AD
68032003-02-19 Akim Demaille <akim@epita.fr>
6804
6805 * data/lalr1.cc: When displaying a line number, be sure to make it
6806 an int.
6807
60a777aa
AD
68082003-02-19 Akim Demaille <akim@epita.fr>
6809
6810 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
6811 Remove, useless.
6812 (YYABORT, YYACCEPT, YYERROR): New.
6813 * tests/calc.at: Renable the lalr1.cc test.
6814
0b86fc41
AD
68152003-02-19 Akim Demaille <akim@epita.fr>
6816
6817 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
6818 error recovery, mixing with/without pops and discarding of the
6819 lookahead.
6820 Exercise YYERROR.
6821 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
6822
da99a5dc
PE
68232003-02-17 Paul Eggert <eggert@twinsun.com>
6824
6825 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
6826 * tests/testsuite.at (AT_COMPILE): Use them.
6827 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 6828 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 6829
93b8c255
PE
68302003-02-12 Paul Eggert <eggert@twinsun.com>
6831
6832 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
6833 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 6834 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
6835 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
6836 Check for malloc failure, for consistency with yacc.c.
6837 (yytname_size): Remove, for consistency with yacc.c.
6838
6839 The bug still remains in data/lalr1.cc, as I didn't have time
6840 to fix it there.
6841
7548fed2
AD
68422003-02-06 Akim Demaille <akim@epita.fr>
6843
6844 * configure.ac (GXX): Rename as...
6845 (CXX): this, to keep the original Autoconf semantics.
6846 Require 2.57.
6847 * data/lalr1.cc: Fix b4_copyright invocations.
6848 If YYDEBUG is not defined, don't depend upon name_ being defined.
6849 (location.hh): Include string and iostream.
6850 (Position::filename): New member.
6851 (Position::Position ()): New.
6852 (operator<< (Position)): New.
6853 (operator- (Position, int)): New.
6854 (Location::first, Location::last): Rename as...
6855 (Location::begin, Location::end): these, to mock the conventional
6856 iterator names.
6857 (operator<< (Location)): New.
6858 * tests/atlocal.in (CXX): New.
6859 * tests/testsuite.at (AT_COMPILE_CXX): New.
6860 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
6861 locations in a more synthetic way.
6862 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
6863 lalr1.cc is used.
6864 Adjust the C locations to match those from Emacs: first column is
6865 column 0.
6866 Change all the expected results.
6867 Conform to the GCS: simplify the locations when applicable.
6868 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
6869 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
6870 these CPP macros with the m4 macros new defined by...
6871 (AT_CHECK_PUSHDEFS): this, i.e.:
6872 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 6873 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
6874 New macros.
6875 (AT_CHECK_POPDEFS): Undefine them.
6876 (AT_CHECK_CALC_LALR1_CC): New.
6877 Use it for the first lalr1.cc test.
6878
43a176ef
AD
68792003-02-04 Akim Demaille <akim@epita.fr>
6880
6881 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
6882 Location as is defined.
6883
fc049e9c
AD
68842003-02-04 Akim Demaille <akim@epita.fr>
6885
6886 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
6887 name_ being defined.
6888
a737b216
PE
68892003-02-03 Paul Eggert <eggert@twinsun.com>
6890
6891 * src/gram.h (start_symbol): Remove unused decl.
6892
6893 Use more-consistent naming conventions for local vars.
6894
6895 * src/derives.c (derives_compute): Change type of local var from
6896 int to rule_number.
6897 * src/gram.c (grammar_rules_partial_print): Likewise.
6898 * src/print.c (print_core): Likewise.
6899 * src/reduce.c (reduce_grammar_tables): Likewise.
6900
6901 * src/gram.c (grammar_dump): Change name of item_number *
6902 local var from r to rp.
6903 * src/nullable.c (nullable_compute): Likewise.
6904
6905 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
6906
6907 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
6908 for symbol or symbol_number var.
6909 * src/reader.c (grammar_start_symbol_set): Likewise.
6910 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
6911 Likewise.
6912 * src/state.c (transitions_to): Likewise.
6913 * src/state.h: Likewise.
6914 * src/tables.c (symbol_number_to_vector_number): Likewise.
6915
6916 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
6917 char * var.
6918
6919 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
6920 var.
6921
6922 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
6923 var.
6924
6925 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
6926 Use str, not s, for char * var. Use ch, not c, for character var.
6927 Use size for size var.
6928
6929 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
6930 char * var.
6931 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
6932 uniqstr var.
6933 * src/uniqstr.h: Likewise.
6934
6935 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
6936 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
6937 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
6938 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
6939 param to have same name as that of enum, so that we don't use
6940 "s" to stand for a non-state.
6941
68e93ad5
AD
69422003-02-02 Akim Demaille <akim@epita.fr>
6943
6944 * src/scan-skel.l: Scan more than one inert character per yylex
6945 invocation.
6946
92898986
PE
69472003-02-01 Paul Eggert <eggert@twinsun.com>
6948
6949 Version 1.875a.
6950
1d9d5d71
PE
6951 * po/LINGUAS: Add ms.
6952
0435d061
AD
69532003-01-30 Akim Demaille <akim@epita.fr>
6954
6955 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
6956
6029a57f
PH
69572003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6958
6959 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
6960 of $1.
0435d061
AD
6961
6962 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 6963 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 6964 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 6965
6029a57f
PH
6966 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
6967 (b4_rhs_location): Ditto.
0435d061 6968 (yyfill): New function to copy from stack tree into array
6029a57f 6969 incrementally.
0435d061
AD
6970 (yyuserAction): Modify to allow incremental move of semantic values
6971 to rhs array when in GLR mode.
6972 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
6973 as needed.
6974 Remove dummy use of yystack, as there is now a guaranteed use.
6975 (yydoAction): Modify to allow incremental move of semantic values
6976 to rhs array when in GLR mode.
6977 (yyresolveAction): Ditto.
6978 (yyglrShiftDefer): Update comment.
0435d061 6979 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
6980 (yyglrReduce): Ditto.
6981 (yydoAction): Ditto
0435d061 6982
6029a57f
PH
6983 * tests/glr-regr1.at: Rename to ...
6984 * tests/glr-regression.at: Add new regression test for the problems
6985 described above (adapted from S. Eken).
6986 Update copyright notice.
6987 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
6988 * tests/Makefile.am: Ditto.
6989
6cee6297
PE
69902003-01-28 Paul Eggert <eggert@twinsun.com>
6991
6992 * data/lalr1.cc: Do not use @output_header_name@ unless
6993 b4_defines_flag is set. This fixes two bugs reported by
6994 Tim Van Holder in
161a71f3
PE
6995 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
6996 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 6997
b2a836b5
PE
69982003-01-21 Paul Eggert <eggert@twinsun.com>
6999
7000 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7001 we don't need to worry about yyerrlab1 being reported as an
7002 "unused label" by non-GCC C compilers. The downside is that if
7003 locations are used then a couple of statements are duplicated each
7004 time YYERROR is invoked, but the upside is that the warnings
7005 should vanish.
7006 (yyerrlab1): Move code to YERROR.
7007 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7008 This reverts some of the 2002-12-27 change.
7009
4196b931
PE
70102003-01-17 Paul Eggert <eggert@twinsun.com>
7011
7012 * src/output.c (symbol_printers_output): Fix typo that led
7013 to core dump. Problem reported by Antonio Rus in
161a71f3 7014 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 7015
3ae831b4
AD
70162003-01-13 Akim Demaille <akim@epita.fr>,
7017 Quoc Peyrot <chojin@lrde.epita.fr>,
7018 Robert Anisko <anisko_r@lrde.epita.fr>
7019
7020 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7021 when the stacks contain one element, as the loop would otherwise
7022 free the last state, and then use the top state (the one we just
7023 popped). This means that the initial elements will not be freed
7024 explicitly, as is the case in yacc.c; it is not a problem, as
7025 these elements have fake values.
7026
e3aa65c5
PE
70272003-01-11 Paul Eggert <eggert@twinsun.com>
7028
7029 * NEWS: %expect-violations are now just warnings, reverting
7030 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7031 bootstrapping problem reported by Matthias Klose; see
161a71f3 7032 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
7033 * src/conflicts.c (conflicts_print): Likewise.
7034 * tests/conflicts.at (%expect not enough, %expect too much,
7035 %expect with reduce conflicts): Likewise.
7036 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7037 that the warning is enabled if the number of conflicts changes
7038 (not necessarily increases).
7039
7040 * src/getargs.c (version): Update copyright year.
7041
f0057011
AD
70422003-01-09 Akim Demaille <akim@epita.fr>
7043
7044 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7045
1ee6d2a0
PE
70462003-01-08 Paul Eggert <eggert@twinsun.com>
7047
7048 * Makefile.maint (WGETFLAGS):
7049 New macro, containing "-C off" to disable proxy caches.
7050 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7051 (rel-check): Use $(WGET) instead of wget.
7052
d4fd77c4
PE
70532003-01-06 Paul Eggert <eggert@twinsun.com>
7054
7055 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7056 the GLR paper of Scott, Johnstone and Hussain.
7057
464c6927
PE
70582003-01-04 Paul Eggert <eggert@twinsun.com>
7059
d600ee67
PE
7060 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7061 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7062 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7063 (EXTRA_LIBRARIES): New var, for liby.a.
7064 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7065 (EXTRA_SCRIPTS): New var, for yacc.
7066
464c6927
PE
7067 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7068 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7069 Problem reported by Nelson H. F. Beebe.
7070
70712003-01-03 Paul Eggert <eggert@twinsun.com>
7072
7073 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7074 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7075 when compiling Bison 1.875's `bitset bset = obstack_alloc
7076 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7077
7078 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7079 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7080 grow to a huge size with typical invocation.
d600ee67 7081
464c6927
PE
7082 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7083 Use the pattern recommended by Autoconf 2.57, except also protect
7084 against double-definition.
7085 * src/system.h: Likewise.
7086 Portability issues reported by Nelson H. F. Beebe.
d600ee67 7087
464c6927
PE
7088 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7089 All uses changed. Provide a definition in both C and C++.
7090 (yytrue, yyfalse): Define even if defined (__cplusplus).
7091
7092 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7093 Reported by Nelson H. F. Beebe.
d600ee67 7094
464c6927
PE
7095 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7096
0f42c7d5
PE
70972003-01-02 Paul Eggert <eggert@twinsun.com>
7098
7099 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7100 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7101 Bug reported by Nelson H. F. Beebe.
7102
dc546b0f
PE
71032003-01-01 Paul Eggert <eggert@twinsun.com>
7104
7105 * Version 1.875.
7106
2c09b6a7
PE
71072002-12-30 Paul Eggert <eggert@twinsun.com>
7108
7109 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7110 Moved here from...
7111 (<INITIAL>","): Here. This causes stray "," to be treated
7112 more uniformly.
7113
dc546b0f 7114 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
7115 last brace in braced code when not in Yacc mode, for compatibility
7116 with Bison 1.35. This resurrects the 2001-12-15 patch to
7117 src/reader.c.
7118
7119 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7120 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7121
535c0f63
PE
71222002-12-28 Paul Eggert <eggert@twinsun.com>
7123
7124 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7125 that of SYM's type. This fixes Debian bug 168069, reported by
7126 Thomas Olsson.
d600ee67 7127
963fcc17
PE
71282002-12-28 Paul Eggert <eggert@twinsun.com>
7129
7130 Version 1.75f.
7131
7132 Switch back to the Yacc style of conflict reports, undoing some
7133 of the 2002-07-30 change.
7134 * doc/bison.texinfo (Understanding): Use Yacc style for
7135 conflict reports. Also, use new way of locating rules.
7136 * src/conflicts.c (conflict_report):
7137 Renamed from conflict_report_yacc, removing the old
7138 'conflict_report'. Translate the entire conflict report at once,
7139 so that we don't assume that "," has the same interpretation in
7140 all languages.
7141 (conflicts_output): Use Yacc-style conflict report for each state,
7142 instead of our more-complicated style.
7143 (conflicts_print): Use Yacc-style conflict report, except print
7144 the input file name when not emulating Yacc.
7145 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7146 Conflicted Reduction, %expect not enough, %expect too much,
7147 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7148 * tests/existing.at (GNU Cim Grammar): Likewise.
7149 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7150
7151 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7152 fatal): Don't invoke fflush; it's not needed and it might even be
7153 harmful for stdout, as stdout might not be open.
7154 * src/reduce.c (reduce_print): Likewise.
7155
b1efe548
PE
71562002-12-27 Paul Eggert <eggert@twinsun.com>
7157
7158 Fix a bug where error locations were not being recorded correctly.
7159 This problem was originally reported by Paul Hilfinger in
161a71f3 7160 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
7161
7162 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7163 top of the location stack's error locations.
7164 (yyerrlab): Set it. When discarding a token, push its location
7165 onto yylerrsp so that we don't lose track of the error's end.
7166 (yyerrlab1): Now is only the target of YYERROR, so that we can
7167 properly record the location of the action that failed. For GCC
7168 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7169 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7170 (yyerrlab2): New label, which yyerrlab now falls through to.
7171 Compute the error's location by applying YYLLOC_DEFAULT to
7172 the locations of all the symbols that went into the error.
7173 * doc/bison.texinfo (Location Default Action): Mention that
7174 YYLLOC_DEFAULT is also invoked for syntax errors.
7175 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7176 Error locations include the locations of all the tokens that were
7177 discarded, not just the last token.
d600ee67 7178
983c5c2c
PE
71792002-12-26 Paul Eggert <eggert@twinsun.com>
7180
b1efe548
PE
7181 * src/files.c: Include quote.h.
7182 (compute_output_file_names): Warn if we detect conflicting
7183 outputs to the same file. This should catch the misunderstanding
7184 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7185
7186 * src/conflicts.c (conflicts_print): If the user specifies
7187 "%expect N", report an error if there are any reduce/reduce
7188 conflicts. This is what the manual says should happen.
7189 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7190 * tests/conflicts.at (%expect with reduce conflicts): New test.
7191
983c5c2c
PE
7192 Don't use m4_include on relative file names, as it doesn't work as
7193 desired if there happens to be a file with that name under ".".
d600ee67 7194
983c5c2c
PE
7195 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7196 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7197 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7198 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7199 * src/output.c (output_skeleton): Use full path names when
7200 specifying a file to include; don't rely on include path, as
7201 it's unreliable when the working file contains a file with
7202 that name.
d600ee67 7203
983c5c2c
PE
72042002-12-25 Paul Eggert <eggert@twinsun.com>
7205
7206 Remove obsolete references to bison.simple and bison.hairy.
7207 Problem mentioned by Aubin Mahe in
161a71f3 7208 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
7209 * data/glr.c: Comment fix.
7210 * doc/bison.1: Remove references. Also, mention "yacc".
7211
7212 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7213 with -g option.
7214
7215 * src/parse-gram.y (declaration): Use enum "report_states" rather
7216 than its numeric value 1.
7217
7218 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7219 opening a new one. This fixes Debian bug 165349, reported by
7220 Bruce Stephens.
7221
23f2d9dc
PE
72222002-12-24 Paul Eggert <eggert@twinsun.com>
7223
7224 Version 1.75e.
7225
7226 * Makefile.maint (cvs-update): Don't assume that the shell
7227 supports $(...), as Solaris sh doesn't.
7228
7229 * src/parse-gram.y (lloc_default): Remove test for empty
7230 nonterminals at the end, since it didn't change the result.
7231
72322002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
7233
7234 If the user does not define YYSTYPE as a macro, Bison now declares it
7235 using typedef instead of defining it as a macro. POSIX requires this.
7236 For consistency, YYLTYPE is also declared instead of defined.
7237
7238 %union directives can now have a tag before the `{', e.g., the
7239 directive `%union foo {...}' now generates the C code
7240 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7241 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7242 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7243 instead of `yyltype'.
7244
7245 `yystype' and `yyltype' are now obsolescent macros instead of being
7246 typedefs or tags; they are no longer documented and will be
7247 withdrawn in a future release.
7248
7249 * data/glr.c (b4_location_type): Remove.
7250 (YYSTYPE): Renamed from yystype.
7251 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7252 (struct YYLTYPE): Renamed from struct yyltype.
7253 (YYLTYPE): Renamed from yyltype.
7254 (yyltype, yystype): New (and obsolescent) macros,
7255 for backward compatibility.
7256 * data/yacc.c: Likewise.
7257
7258 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7259 does not specify a union tag. This is for compatibility with
7260 Solaris 9 yacc.
7261
7262 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7263 const *, since it is now modified by stripping surrounding { }.
7264 (current_braced_code): Remove.
7265 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7266 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7267 trailing " {...}". Now of type <chars>.
7268 (grammar_declaration): Adjust to bundled tokens.
7269 (code_content): Remove; stripping is now done by add_param.
7270 (print_token_value): Print contents of bundled tokens.
7271 (token_name): New function.
7272
7273 * src/reader.h (braced_code, current_braced_code): Remove.
7274 (token_name): New decl.
7275
7276 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
7277 token_type, not braced_code code_kind. All uses changed.
7278 (SC_PRE_CODE): New state, for scanning after a keyword that
7279 has (or usually has) an immediately-following braced code.
7280 (token_type): New local var, to keep track of which token type
7281 to return when scanning braced code.
7282 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 7283 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
7284 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
7285 instead of returning a token type immediately.
7286 (<INITIAL>"{"): Set token type.
7287 (<SC_BRACED_CODE>"}"): Use it.
7288 (handle_action_dollar, handle_action_at): Now returns bool
7289 indicating success. Fail if ! current_rule; this prevents a core dump.
7290 (handle_symbol_code_dollar, handle_symbol_code_at):
7291 Remove; merge body into caller.
7292 (handle_dollar, handle_at): Complain in invalid contexts.
7293
7294 * NEWS, doc/bison.texinfo: Document the above.
7295 * NEWS: Fix years and program names in copyright notice.
7296
879ca4f8
PE
72972002-12-17 Paul Eggert <eggert@twinsun.com>
7298
7299 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
7300 Reporting, Table of Symbols): Omit mentions of %lex-param and
7301 %parse-param from the documentation for now.
7302
1c5fe69d
PE
73032002-12-15 Paul Eggert <eggert@twinsun.com>
7304
7305 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
7306 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
7307 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
7308 disagreed with the Bison documentation. Bug
7309 reported by Andrew Walrond.
d600ee67 7310
1c5fe69d
PE
7311 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
7312 as the caller now does that.
7313 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
7314 (YYEMPTY): Parenthesize right hand side, since others use it.
7315 (yyparse): Don't assume that our generated code is the only code
7316 that sets yychar.
7317
d1de5372
PE
73182002-12-13 Paul Eggert <eggert@twinsun.com>
7319
7320 Version 1.75d.
7321
7322 POSIX requires a "yacc" command.
7323 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
7324 (MOSTLYCLEANFILES): Add yacc.
7325 (yacc): New rule.
1c5fe69d 7326 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
7327 as an alias for bison y.
7328
7329 * po/LINGUAS: Add da.
d600ee67 7330
d1de5372
PE
7331 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
7332 problem with latest <getopt.h>.
7333 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
7334
7335 * doc/fdl.texi: Upgrade to 1.2.
7336 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
7337 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
7338 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
7339 gnulib.
7340 * config/install-sh: Sync with autotools.
7341
7342 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 7343 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
7344 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
7345 locations are requested.
7346 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
7347 locations are requested.
7348
d0f3fe23
PE
73492002-12-12 Paul Eggert <eggert@twinsun.com>
7350
7351 Remove unportable casts and storage allocation tricks.
7352 While we're at it, remove almost all casts, since they
7353 usually aren't needed and are a sign of trouble.
7354
7355 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
7356
7357 * src/derives.c (derives_compute): Do not subtract NTOKENS from
7358 the pointer DSET returned by malloc; this isn't portable.
7359 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
7360 Similarly for DERIVES.
7361 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
7362 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
7363 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
7364
7365 * src/derives.c (derives_compute): Do not bother invoking
7366 int_of_rule_number, since rule numbers are integers.
7367
7368 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
7369 rather than XMALLOC (char, N).
7370
7371 * src/files.c (filename_split): Rewrite to avoid cast.
7372
7373 * src/gram.h (symbol_number_as_item_number,
7374 item_number_as_symbol_number, rule_number_as_item_number,
7375 item_number_as_rule_number):
7376 Now inline functions rather than macros, to avoid casts.
7377 * src/state.h (state_number_as_int): Likewise.
7378 * src/tables.c (state_number_to_vector_number,
7379 symbol_number_to_vector_number): Likewise.
7380
7381 * src/gram.h (int_of_rule_number): Remove; no longer used.
7382
7383 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
7384 since the resulting storage is always stored into.
7385
7386 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
7387 where it's needed.
7388
7389 * src/muscle_tab.c (muscle_m4_output):
7390 Now inline. Return bool, not int.
7391 * src/state.c (state_compare): Likewise.
7392 * src/symtab.c (symbol_check_defined,
7393 symbol_check_alias_consistency, symbol_pack, symbol_translation,
7394 hash_compare_symbol, hash_symbol):
7395 Likewise.
7396 * src/uniqstr.c (uniqstr_print): Likewise.
7397 * src/muscle_tab.c (muscle_m4_output_processor):
7398 New function, to avoid casts.
7399 * src/state.c (state_comparator, stage_hasher): Likewise.
7400 * src/symtab.c (symbol_check_defined_processor,
7401 symbol_check_alias_consistency_processor, symbol_pack_processor,
7402 symbol_translation_processor, hash_symbol_comparator,
7403 hash_symbol_hasher): Likewise.
7404 * src/uniqstr.c (uniqstr_print_processor): Likewise.
7405 * src/muscle_tab.c (muscles_m4_output):
7406 Use new functions instead of casting old functions unportably.
7407 * src/state.c (state_hash_new): Likewise.
7408 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
7409 symbols_token_translations_init):
7410 Likewise.
7411 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
7412
7413 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
7414 var instead of casting to long, to avoid casts.
7415 (prepare_states): Use MALLOC rather than alloca, so that we don't
7416 have to worry about alloca.
7417 * src/state.c (state_hash_lookup): Likewise.
7418
7419 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
7420 local var instead of casting to unsigned char, to avoid casts.
7421
7422 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
7423 STATE_ALLOC): Remove.
7424 (transitions_new, errs_new, reductions_new, state_new): Use malloc
7425 rather than calloc, and use offsetof to avoid allocating slightly
7426 too much storage.
7427 (state_new): Initialize all members.
7428
7429 * src/state.c (state_hash): Use unsigned accumulator, not signed.
7430
7431 * src/symtab.c (symbol_free): Remove; unused.
7432 (symbol_get): Remove cast in lhs of assignment.
7433 (symbols_do): Now static. Accept generic arguments, not
7434 hashing-related ones.
7435
7436 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
7437 (symbol_processor): Remove.
7438 (symbols_do): Remove decl; now static.
7439
7440 * src/system.h (alloca): Remove; decl no longer needed.
7441 (<stddef.h>): Include, for offsetof.
7442 (<inttypes.>, <stdint.h>): Include if available.
7443 (uintptr_t): New type, if system lacks it.
7444 (CALLOC, MALLOC, REALLOC): New macros.
7445 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
7446 new macros.
7447
7448 * src/tables.c (table_size): Now int, to pacify GCC.
7449 (table_grow, table_ninf_remap): Use signed table size.
7450 (save_row): Don't bother initializing locals when not needed.
7451 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
7452 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
7453
7454 * src/vcg.h: Correct misspellings.
7455
7456 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
7457
7458
7459 * src/getargs.c (getargs): Don't assume EOF == -1.
7460
26b4a969
PE
74612002-12-09 Paul Eggert <eggert@twinsun.com>
7462
7463 Change identifier spellings to avoid collisions with names
7464 that are reserved by POSIX.
7465
7466 Don't use names ending in _t, since POSIX reserves them.
7467 For consistency, remove _e and _s endings -- they're weren't
7468 needed to remove ambiguity. All uses changed.
7469 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
7470 turn was just renamed from struniq_t.
7471 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
7472 which in turn was just renamed from struniq_processor_t.
7473 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
7474 in turn was renamed from hash_compare_struniq_t.
7475 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
7476 (state_list): Renamed from state_list_t.
7477 * src/assoc.h (assoc): Renamed from assoc_t.
7478 * src/conflicts.c (enum conflict_resolution): Renamed from
7479 enum conflict_resolution_e.
7480 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
7481 (rule_list): Renamed from rule_list_t.
7482 * src/getargs.h (enum trace): Renamed from enum trace_e.
7483 (enum report): Renamed from enum report_e.
7484 * src/gram.h (item_number): Renamed from item_number_t.
7485 (rule_number): Renamed from rule_number_t.
7486 (struct rule_s): Remove the "rule_s" part; not used.
7487 (rule): Renamed from rule_t.
7488 (rule_filter): Renamed from rule_filter_t.
7489 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
7490 (goto_list): Renamed from goto_list_t.
7491 * src/lalr.h (goto_number): Renamed from goto_number_t.
7492 * src/location.h (location): Renamed from location_t.
7493 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
7494 and moved here from:
7495 * src/muscle_tab.h (muscle_entry_t): here.
7496 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
7497 (rule_list): Renamed from rule_list_t.
7498 * src/print_graph.c (static_graph): Renamed from graph.
7499 * src/reader.h (braced_code): Renamed from braced_code_t.
7500 Remove brace_code_e tag.
7501 * src/relation.h (relation_node): Renamed from relation_node_t.
7502 (relation_nodes): Renamed from relation_nodes_t.
7503 (relation): Renamed from relation_t.
7504 * src/state.h (state_number): Renamed from state_number_t.
7505 (struct state): Renamed from struct state_s.
7506 (state): Renamed from state_t.
7507 (transitions): Renamed from transitions_t. Unused (and
7508 misspelled) transtion_s tag removed.
7509 (errs): Renamed from errs_t. Unused errs_s tag removed.
7510 (reductions): Renamed from reductions_t. Unused tag
7511 reductions_s removed.
7512 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
7513 (struct symbol_list): Renamed from struct symbol_list_s.
7514 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
7515 (struct symbol): Renamed from struct symbol_s.
7516 (symbol): Renamed from symbol_t.
7517 * src/tables.c (vector_number): Renamed from vector_number_t.
7518 (action_number): Renamed from action_t.
7519 * src/tables.h (base_number): Renamed from base_t.
7520 * src/vcg.h (enum color): Renamed from enum color_e.
7521 (enum textmode): Renamed from enum textmode_e.
7522 (enum shape): Renamed from enum shape_e.
7523 (struct colorentry): Renamed from struct colorentry_s.
7524 (struct classname): Renamed from struct classname_s.
7525 (struct infoname): Renamed from struct infoname_s.
7526 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
7527 (enum decision): Renamed from enum decision_e.
7528 (enum orientation): Renamed from enum orientation_e.
7529 (enum alignment): Renamed from enum alignment_e.
7530 (enum arrow_mode): Renamed from enum arrow_mode_e.
7531 (enum crossing_type): Renamed from enum crossing_type_e.
7532 (enum view): Renamed from enum view_e.
7533 (struct node): Renamed from struct node_s.
7534 (node): Renamed from node_t.
7535 (enum linestyle): Renamed from enum linestyle_e.
7536 (enum arrowstyle): Renamed from enum arrowstyle_e.
7537 (struct edge): Renamed from struct edge.
7538 (edge): Renamed from edge_t.
7539 (struct graph): Renamed from struct graph_s.
7540 (graph): Renamed from graph_t.
7541 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
7542 Rename value_t -> value.
7543 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
7544 value_t_as_yystype -> value_as_yystype.
7545
7546 Don't include <errno.h> in the mainstream code, since it
7547 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
7548 * lib/get-errno.c, lib/get-errno.h: New files.
7549 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
7550 get-errno.c.
7551 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
7552 * src/output.c (output_skeleton): Likewise.
7553 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
7554 instead of errno.
7555 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
7556 Likewise.
7557 (handle_action_dollar, handle_action_at): Likewise.
7558 * src/system.h: Do not include <errno.h>.
7559 (TAB_EXT): Renamed from EXT_TAB.
7560 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
7561
7562 Avoid str[a-z]*, since <string.h> reserves that name space.
7563 Change all instances of "struniq" in names to "uniqstr", and
7564 likewise for "STRUNIQ" and "UNIQSTR".
7565 * src/uniqstr.c: Renamed from src/struniq.c.
7566 * src/uniqstr.h: Renamed from src/struniq.h.
7567 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
7568 * src/files.c (strsuffix): Remove; unused.
7569 (concat2): Renamed from stringappend. Now static.
7570 * src/files.h (strsuffix, stringappend): Remove; unused.
7571 * src/parse-gram.y (<chars>): Renamed from <string>.
7572 (<uniqstr>): Renamed from <struniq>.
7573 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
7574 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
7575 (struct graph_s.expand): Renamed from struct graph_s.stretch.
7576 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
7577 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
7578 (N_EXPAND): Renamed from N_STRETCH.
7579
7580 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
7581 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
7582 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
7583 Remove; unused.
7584 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
7585 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
7586 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
7587 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
7588 (BASE_MAXIMUM): Renamed from BASE_MAX.
7589 (BASE_MINIMUM): Renamed from BASE_MIN.
7590 (ACTION_MAX): Remove; unused.
7591 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
7592 Unnecessary casts removed from above defines.
7593
7594
7595 Fix misspelling in names.
7596 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
7597 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
7598 G_NODE_ALIGNEMENT.
7599
7600
7601 * lib/timevar.c (timevar_report): Renamed from time_report,
7602 for consistency with other names.
7603 * lib/timevar.h (timevar_report): New decl.
7604 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
7605
7606
7607 Sort include-file uses.
7608
7609 Reorder all include files under src to be in the order "system.h".
7610 then the ../lib include files in angle brackets (alphabetized),
7611 then the . include files in double-quotes (alphabetized). Fix
7612 dependency breakages encountered in this process, as follows:
7613 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
7614 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
7615 * src/state.h: Include "symtab.h".
7616
996b1c7e
PE
76172002-12-08 Paul Eggert <eggert@twinsun.com>
7618
7619 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
7620 since this causes problems when __file__ contains character
7621 sequences like "@" that are treated specially by src/scan-skel.l.
7622 Instead, just use the file's basename. This fixes the bug
7623 reported by Martin Mokrejs in
161a71f3 7624 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 7625
e19c4e5d
PE
76262002-12-06 Paul Eggert <eggert@twinsun.com>
7627
7628 Add support for rules that do not have trailing semicolons, as
7629 POSIX requires. Improve the quality of locations in Bison
7630 diagnostics.
26b4a969 7631
e19c4e5d
PE
7632 * src/location.c: Include <quotearg.h>.
7633 (empty_location): Now const.
7634 (location_print): New function. Follow the recommendation of the
7635 GNU Coding Standards for locations that span file boundaries.
7636 * src/location.h: Do not include <quotearg.h>; no longer needed.
7637 (boundary): New type.
7638 (location_t): Use it. This allows locations to span file boundaries.
7639 All member uses changed: file -> start.file or end.file (as needed),
7640 first_line -> start.line, first_column -> start.column,
7641 last_line -> end.line, last_column -> end.column.
7642 (equal_boundaries): New function.
7643 (LOCATION_RESET, LOCATION_STEP): Remove.
7644 (LOCATION_PRINT): Remove. All callers changed to use location_print.
7645 (empty_location): Now const.
7646 (location_print): New decl.
7647 * src/parse-gram.y (lloc_default): New function, which handles
7648 empty locations more accurately.
7649 (YYLLOC_DEFAULT): Use it.
7650 (%token COLON): Remove.
7651 (%token ID_COLON): New token.
26b4a969 7652 (rules): Use it.
e19c4e5d
PE
7653 (declarations, rules): Remove trailing semicolon.
7654 (declaration, rules_or_grammar_declaration):
7655 Allow empty (";") declaration.
7656 (symbol_def): Remove empty actions; no longer needed.
7657 (rules_or_grammar_declaration): Remove trailing semicolon.
7658 (semi_colon.opt): Remove.
7659 * src/reader.h: Include location.h.
7660 (scanner_cursor): New decl.
7661 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
7662 rolling our own.
7663 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
7664 of *loc.
7665 (STEP): Remove. No longer needed, now that adjust_location does
7666 the work. All uses removed.
7667 (scanner_cursor): New var.
7668 (adjust_location): Renamed from extend_location. It now sets
7669 *loc and adjusts the scanner cursor. All uses changed.
7670 Don't bother testing for CR.
7671 (handle_syncline): Remove location arg; now updates scanner cursor.
7672 All callers changed.
7673 (unexpected_end_of_file): Now accepts start boundary of token or
7674 comment, not location. All callers changed. Update scanner cursor,
7675 not the location.
7676 (SC_AFTER_IDENTIFIER): New state.
7677 (context_state): Renamed from c_context. All uses changed.
7678 (id_loc, code_start, token_start): New local vars.
7679 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
7680 processing of Yacc white space and equivalents here.
7681 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
7682 instead of returning ID immediately, since we need to search for
7683 a subsequent colon.
7684 (<INITIAL>"'", "\""): Save token_start.
7685 (<INITIAL>"%{", "{", "%%"): Save code_start.
7686 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
7687 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
7688 BEGIN context_state at end, not INITIAL.
7689 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
7690 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
7691 Return correct token start.
7692 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
7693 the start of a character, string or multiline comment is found.
7694 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
7695 Reduction): Adjust reported locations to match the more-precise
7696 results now expected.
7697 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
7698 * tests/reduce.at (Useless Rules, Reduced Automaton,
7699 Underivable Rules): Likewise.
7700 * tests/regression.at (Invalid inputs): No longer `expecting ";"
7701 or "|"' now that so many other tokens are allowed by the new grammar.
7702
7703 * src/complain.h (current_file): Remove duplicate decl;
7704 current_file is now owned by files.h.
7705 * src/complain.c, src/scan-gram.l: Include files.h.
7706
77072002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 7708
e19c4e5d
PE
7709 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
7710 promotes to int; it might be unsigned int.
7711 * data/yacc.c (yy_reduce_print): Likewise.
7712
7713 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
7714 be #defined in the prologue, not in the Bison declarations.
7715 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 7716
b64755e3
PE
77172002-12-02 Paul Eggert <eggert@twinsun.com>
7718
7719 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
7720 * lib/strtoul.c: New file, from gnulib.
7721 This fixes a porting bug reported by Peter Klein in
161a71f3 7722 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 7723
6e746484
PE
77242002-11-30 Paul Eggert <eggert@twinsun.com>
7725
b64755e3
PE
7726 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
7727 and put only a forward declaration in the prologue. This is for
7728 consistency with the other scanner helper functions.
7729
6ba55592
PE
7730 Type clashes now generate warnings, not errors, since it
7731 appears that POSIX may allow some grammars with type clashes.
7732 * src/reader.c (grammar_current_rule_check): Warn about
7733 type clashes instead of complaining.
7734 * tests/input.at (Type Clashes): Expect warnings, not complaints.
7735
6e746484
PE
7736 Add Yacc library, since POSIX requires it.
7737 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
7738 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
7739 * lib/main.c, lib/yyerror.c: New files.
7740
7741 gram_error can be static; it need not be extern.
7742 * src/reader.h (gram_error): Remove decl.
7743 * src/parse-gram.y (gram_error): Now static. Add static decl.
7744 (print_token_value): Omit parameter names from forward decl,
7745 for consistency.
7746
88510f9c
PE
77472002-11-29 Paul Eggert <eggert@twinsun.com>
7748
6e746484
PE
7749 * doc/bison.texinfo: Emphasize that yylex and yyerror must
7750 be declared before being used. E.g., one should typically
7751 declare them in the prologue. Use GNU coding style in examples.
7752 Put "const" consistently after the type it modifies. Mention
7753 that C99 supports "inline". Mention that yyerror traditionally
7754 returns "int".
7755
88510f9c
PE
7756 %parse-param and %lex-param now take just one argument, the
7757 declaration; the argument name is deduced from the declaration.
7758
7759 * doc/bison.texinfo (Parser Function, Pure Calling, Error
7760 Reporting, Table of Symbols): Document this.
7761 * src/parse-gram.y (add_param): New function.
7762 (COMMA): Remove.
7763 (declaration): Implement new rule for %parse-param and %lex-param.
7764 * src/scan-gram.l: "," now elicits a warning, rather than being
7765 a token; this is more compatible with byacc.
7766 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
7767
bb92250c
PE
77682002-11-27 Paul Eggert <eggert@twinsun.com>
7769
7770 Rename identifiers to avoid real and potential collisions.
7771
7772 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
7773 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 7774 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
7775 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7776 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
7777 * src/parse-gram.y (print_token_value): Renamed from yyprint.
7778 All uses changed.
7779 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
7780 The name "yycontrol" violates the name space rules, and this stuff
7781 wasn't being used anyway.
7782 (input): Remove action; this stuff wasn't being used.
7783 (gram_error): Rename local variable yylloc -> loc.
7784 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
7785 (YY_DECL): Don't use "yy" at start of local variables.
7786 All uses changed, e.g., yylloc -> loc.
7787 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
7788 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
7789 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
7790 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
7791
7792 * src/parse-gram.y (gram_error): loc is now const *.
7793 * src/reader.h (gram_error): Likewise.
7794
3af4feb2
PE
77952002-11-24 Paul Eggert <eggert@twinsun.com>
7796
7797 Version 1.75c.
7798
7799 * tests/actions.at (Actions after errors): Use an output format
7800 more similar to that of the Printers and Destructors test.
7801 Test the position of the ';' token too.
7802 (Printers and Destructors): Likewise.
7803 (Printers and Destructors: %glr-parser): Remove for now, to avoid
7804 unnecessarily alarming people when the test fails.
7805
7806 * data/yacc.c (yyerrlab1): Move this label down, so that the
7807 parser does not discard the lookahead token if the user code
7808 invokes YYERROR. This change is required for POSIX conformance.
7809
7810 * lib/error.c: Sync with gnulib.
7811
78122002-11-22 Paul Eggert <eggert@twinsun.com>
7813
7814 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
7815 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
7816 * lib/xmalloc.c: Likewise.
26b4a969 7817
58004308
PE
78182002-11-20 Paul Eggert <eggert@twinsun.com>
7819
7820 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
7821
78222002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 7823
58004308
PE
7824 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
7825 should use `if (! x) abort ();' rather than `assert (x);', and
7826 anyway it's one less thing to worry about configuring.
7827
7828 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
7829 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
7830 and replace all instances of assert with abort.
7831 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7832 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
7833
7834 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
7835 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
7836 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
7837 hash_find_entry, hash_rehash, hash_insert): Likewise.
7838 * src/conflicts.c (resolve_sr_conflict): Likewise.
7839 * src/lalr.c (set_goto_map, map_goto): Likewise.
7840 * src/nullable.c (nullable_compute): Likewise.
7841 * src/output.c (prepare_rules, token_definitions_output): Likewise.
7842 * src/reader.c (packgram, reader): Likewise.
7843 * src/state.c (state_new, state_free, state_transitions_set,
7844 state_reduction_find): Likewise.
7845 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
7846 symbol_pack): Likewise.
7847 * src/tables.c (conflict_row, pack_vector): Likewise.
7848 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7849 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7850 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
7851 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
7852
7853 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
7854 (ARGMATCH_CONSTRAINT): New macro.
7855 (ARGMATCH_ASSERT): Use it.
7856
7857 * src/system.h (verify): New macro.
7858 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
7859 rather than assert.
7860 * src/tables.c (tables_generate): Likewise.
7861
7862 * src/struniq.c (struniq_assert): Now returns void, and aborts
7863 if the assertion is false.
7864 (struniq_assert_p): Remove.
7865 * src/struniq.h: Likewise.
7866
76ae8198
PE
78672002-11-18 Paul Eggert <eggert@twinsun.com>
7868
7869 * data/glr.c (yygetLRActions): Replace `yyindex' with
7870 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
7871 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 7872 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 7873
d3c4e709
AD
78742002-11-18 Akim Demaille <akim@epita.fr>
7875
7876 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
7877 space.
7878 From Tim Van Holder.
7879
8d8a7238
PE
78802002-11-17 Paul Eggert <eggert@twinsun.com>
7881
7882 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
7883 to "SyntaxError" for consistency with my 2002-11-15 change.
7884
7885 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
7886 not define to {}, since this breaks the common use of `YYDPRINTF
7887 ((...));' if a single statement is desired (e.g. before `else').
7888 Work around GCC warnings by surrounding corresponding calls with
7889 {} if needed.
7890 (yyhasResolvedValue): Remove unused function.
7891 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
7892 loop body.
7893 (yyreportSyntaxError): Renamed from yyreportParseError.
7894 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
7895 All uses changed.
7896 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
7897 extern when possible. Remove unused initializations.
7898
b0937b22
AD
78992002-11-16 Akim Demaille <akim@epita.fr>
7900
7901 Augment the similarity between GLR and LALR traces.
7902
7903 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
7904 (YY_REDUCE_PRINT): New.
7905 (yyparse): Use them.
7906 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
7907 YYDPRINT here.
7908 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
7909 state reached after the reduction/recovery, since...
7910 (yyparse, yyprocessOneStack): Report the state we are entering in.
7911
c5e3e510
AD
79122002-11-16 Akim Demaille <akim@epita.fr>
7913
7914 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
7915 Add support for --trace=skeleton.
7916 * src/scan-skel.l: %option debug.
7917 Scan strings of non-@ or \n instead of character by character.
7918 (scan_skel): Handle trace_skeleton.
7919 (QPUTS): New.
7920 (@output_parser_name@, @output_header_name@): ``Restore'' their
7921 support (used to be M4 macros).
7922 * data/yacc.c: Quote larger chunks, a la glr.c.
7923 * data/lalr1.cc: Likewise.
7924 The header guards are no longer available, so use some other
7925 string than `YYLSP_NEEDED'.
7926
4c6cc1db
AD
79272002-11-16 Akim Demaille <akim@epita.fr>
7928
7929 Make the ``Printers and Destructors'' test more verbose, taking
7930 `yacc.c''s behavior as (possibly wrong) reference.
7931
7932 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
7933 instead of fprint on stdout.
7934 Set and report the last_line of the symbols.
7935 Consistently display values and locations.
7936
6d9e8019
PE
79372002-11-16 Paul Eggert <eggert@twinsun.com>
7938
7939 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
7940
6e649e65
PE
79412002-11-15 Paul Eggert <eggert@twinsun.com>
7942
b25d88f6
PE
7943 * tests/actions.at (Actions after errors): New test case.
7944
6e649e65
PE
7945 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
7946 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
7947 tests/action.at, tests/calc.at, tests/conflicts.at,
7948 tests/cxx-type.at, tests/regression.at:
7949 "parse error" -> "syntax error" for POSIX compatibility.
7950 "parsing stack overflow..." -> "parser stack overflow" so
7951 that code matches Bison documentation.
7952
0f39aab9
AD
79532002-11-15 Akim Demaille <akim@epita.fr>
7954
7955 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
7956 take two BRACED_CODE, not two string_content.
7957 Free the scanner's obstack when we are done.
7958 (code_content): New.
7959 * tests/calc.at: Adjust.
7960 * doc/bison.texinfo: Adjust.
7961 Also, make sure to include the `,' for these declarations.
7962
761c1926
AD
79632002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
7964
7965 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
7966 definition; avoids potential autoreconf problems.
7967
b0f98b10
AD
79682002-11-15 Akim Demaille <akim@epita.fr>
7969
7970 Always check the value returned by yyparse.
7971
7972 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
7973 returned by yyparse.
7974 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
7975 Adjust calls.
7976 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
7977 returned by yyparse.
7978
970785f1
PH
79792002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7980
7981 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
7982 on input.at test.
7983
8fcc7db1
PE
79842002-11-14 Paul Eggert <eggert@twinsun.com>
7985
7ec1b48e
PE
7986 * src/output.c (output_skeleton): Call xfopen instead of
7987 duplicating xfopen's body.
7988
cfff7583 7989 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 7990 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 7991
8fcc7db1
PE
7992 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
7993 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
7994 Group compiler. Instead, use "$CC -E bar.c". Include the .h
7995 file twice in the grammar, as an extra check.
7996
7997 * tests/input.at (Torturing the Scanner): Surround the
7998 backslash-newline tests with "#if 0", to make it less likely that
7999 we'll run into compiler bugs. Bring back solitary \ inside
8000 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 8001 test backslash-newline in C character constant.
8fcc7db1 8002
4e8d992c
AD
80032002-11-14 Akim Demaille <akim@epita.fr>
8004
8005 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8006 status of the compiler.
f32b346d 8007 Calling `exit 1' is no longer needed.
4e8d992c
AD
8008 Reported by Nelson H. F. Beebe.
8009
9501dc6e
AD
80102002-11-14 Akim Demaille <akim@epita.fr>
8011
8012 * tests/atlocal.in (CPPFLAGS): We have config.h.
8013 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8014 New.
8015 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8016 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8017 * tests/regression.at, tests/torture.at: Use them for all the
8018 grammars that are to be compiled.
8019 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8020 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8021 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8022
18b519c0
AD
80232002-11-14 Akim Demaille <akim@epita.fr>
8024
8025 * doc/bison.texinfo: Various formatting changes (alignments in
8026 samples, additional @group/@end group, GCS in samples.
8027 Use @deffn instead of simple @table to define the directives,
8028 macros, variables etc.
8029
9a86cdb9
PE
80302002-11-13 Paul Eggert <eggert@twinsun.com>
8031
daa33def 8032 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 8033 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 8034
daa33def 8035 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 8036 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
8037 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8038 * tests/headers.at (export YYLTYPE): Likewise.
8039
8040 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 8041 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 8042
9a86cdb9
PE
8043 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8044 comments, since they're not portable. Use GNU coding style.
8045
9c1e26bd
AD
80462002-11-13 Akim Demaille <akim@epita.fr>
8047
8048 * data/yacc.c: Leave bigger chunks of quoted text.
8049 (YYDSYMPRINTF): New.
8050 Use it to report symbol activities.
8051 * data/glr.c (YYDSYMPRINTF): New.
8052 Use it.
8053
87f721cc
PE
80542002-11-12 Paul Eggert <eggert@twinsun.com>
8055
8056 Version 1.75b.
8057
8058 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8059 (yyglrReduce): Return yyok, not 0.
8060 This should avoid the enumerated-type warnings reported
464c6927 8061 by Nelson H. F. Beebe in
161a71f3 8062 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
8063
8064 * lib/bbitset.h (BITSET_INLINE): Remove.
8065 * lib/bitset.h [! BITSET_INLINE]: Remove.
8066 (bitset_set, bitset_reset, bitset_test): Rename local vars
8067 to avoid shadowing warnings by GCC.
8068
8069 * data/glr.c (inline): Remove #define. It's the user's
8070 responsibility to #define it away, just like 'const'.
464c6927 8071 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 8072 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 8073
87f721cc
PE
8074 * Makefile.maint (po-check): Scan .l and .y files instead of the
8075 .c and the .h files that they generate. This fixes the bug
8076 reported by Tim Van Holder in:
161a71f3 8077 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
8078 Look for N_ as well as for _. Try to avoid matching #define for
8079 N_ and _.
8080 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8081 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8082 * src/scan-gram.l: Revamp regular expressions so that " and '
8083 do not confuse xgettext.
8084
8085 * src/struniq.h (struniq_new): Do not declare the return type
8086 to be 'const'; this violates the C standard.
8087 * src/struniq.c (struniq_new): Likewise.
8088
be14ade5
AD
80892002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8090
8091 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8092 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8093 linker.
8094
05291fbc
AD
80952002-11-12 Akim Demaille <akim@epita.fr>
8096
8097 * Makefile.maint: Sync with Autoconf:
8098 (local_updates): New.
8099
1f5fd52e
AD
81002002-11-12 Akim Demaille <akim@epita.fr>
8101
8102 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8103
283f1e64
AD
81042002-11-12 Akim Demaille <akim@epita.fr>
8105
8106 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8107 locations.
8108
886b69d1
AD
81092002-11-12 Akim Demaille <akim@epita.fr>
8110
8111 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8112 not yyvalue.
8113
3df37415
AD
81142002-11-12 Akim Demaille <akim@epita.fr>
8115
8116 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8117 Use it to test the GLR parser.
8118
7bd6c77e
AD
81192002-11-12 Akim Demaille <akim@epita.fr>
8120
8121 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8122 defines it.
8123 * data/glr.c (yystos): New.
8124 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8125 (YYDSYMPRINT): New.
8126 (yyval): Don't define it, it is handled via M4.
8127 (yyrecoverParseError): Free verbosely the discarded symbols.
8128 * data/yacc.c (yysymprint): Remove, rather...
8129 (b4_yysymprint_generate): invoke.
8130 * data/c.m4 (b4_yysymprint_generate): New.
8131 Accept pointers as arguments, as opposed to the version from
8132 yacc.c.
8133 (b4_yydestruct_generate): Likewise.
8134 * tests/cations.at (Printers and Destructors): Use Bison directives
8135 instead of CPP macros.
8136 Don't rely on internal details.
8137
b0400cc6
AD
81382002-11-12 Akim Demaille <akim@epita.fr>
8139
8140 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8141 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8142 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8143 it against YYEMPTY and so forth), work on yytoken (i.e., set
8144 it to YYEMPTY etc.).
8145 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8146 (b4_symbol_actions): Remove.
8147 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8148 for 0, end-of-input.
8149
72f889cc
AD
81502002-11-12 Akim Demaille <akim@epita.fr>
8151
8152 * doc/bison.texinfo (Destructor Decl): New.
8153
b1ae9233
AD
81542002-11-12 Akim Demaille <akim@epita.fr>
8155
8156 * src/tables.c (tables_generate): Use free for pointers that
8157 cannot be NULL, not XFREE.
8158 (pack_vector): Use assert, not fatal, for bound violations.
8159 * src/state.c (state_new): Likewise.
8160 * src/reader.c (reader): Likewise.
8161 * src/lalr.c (set_goto_map): Likewise.
72f889cc 8162 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
8163 the file name.
8164
7ec2d4cd
AD
81652002-11-12 Akim Demaille <akim@epita.fr>
8166
8167 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8168 Restore.
8169 * src/scan-gram.l (last_string): Is global to the file, not to
8170 yylex.
8171 * src/parse-gram.y (input): Don't append the epilogue here,
8172 (epilogue.opt): do it here, and free the scanner's obstack.
8173 * src/reader.c (epilogue_set): Rename as...
8174 (epilogue_augment): this.
8175 * data/c.m4 (b4_epilogue): Defaults to empty.
8176
573a6cd3
AD
81772002-11-12 Akim Demaille <akim@epita.fr>
8178
8179 * src/getargs.c (long_options): Remove duplicates.
8180 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8181 Remove.
8182 * doc/bison.rnh: Remove.
8183 * doc/bison.texinfo (VMS Invocation): Remove.
8184
95612cfa
AD
81852002-11-12 Akim Demaille <akim@epita.fr>
8186
8187 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8188 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8189
8190 Use struniq for symbols.
8191
8192 * src/symtab.h (symbol_t): The tag member is a struniq.
8193 (symbol_type_set): Adjust.
8194 * src/symtab.c (symbol_new): Takes a struniq.
8195 (symbol_free): Don't free the tag member.
8196 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8197 (hash_compare_symbol, hash_symbol): these.
8198 Use the fact that tags as struniqs.
8199 (symbol_get): Use struniq_new.
8200 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8201 Returns a strniq.
8202 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8203 and type members are struniqs.
8204 * src/reader.c (get_merge_function)
8205 (grammar_current_rule_merge_set): Adjust.
8206 (TYPE, current_type): Are struniq.
8207
8208 Use struniq for file names.
8209
8210 * src/files.h, src/files.c (infile): Split into...
8211 (grammar_file, current_file): these.
8212 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8213 * src/reduce.c (reduce_print): Likewise.
8214 * src/getargs.c (getargs): Likewise.
8215 * src/complain.h, src/complain.c: Likewise.
8216 * src/main.c (main): Call struniqs_new early enough to use it for
8217 file names.
8218 Don't free the input file name.
8219
3e6656f9
AD
82202002-11-12 Akim Demaille <akim@epita.fr>
8221
8222 * src/symtab.c (symbol_free): Remove dead deactivated code:
8223 type_name are properly removed.
8224 Don't use XFREE to free items that cannot be NULL.
8225 * src/struniq.h, src/struniq.c: New.
8226 * src/main.c (main): Initialize/free struniqs.
8227 * src/parse-gram.y (%union): Add astruniq member.
8228 (yyprint): Adjust.
8229 * src/scan-gram.l (<{tag}>): Return a struniq.
8230 Free the obstack bit that used to store it.
8231 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8232
7672019c
PE
82332002-11-11 Paul Eggert <eggert@twinsun.com>
8234
8235 Revamp to fix many (but not all) of the C- and M4-related quoting
8236 problems. Among other things, this fixes the Bison bug reported
8237 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 8238 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
8239
8240 Use new @ escapes consistently. Represent brackets with @{ and @}
8241 rather than @<:@ and @:>@, since this works a bit better with dumb
8242 editors like vi. Represent @ with @@, since @ is now consistently
8243 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8244 __ofile__, to avoid unexpected expansions. Similarly, use @output
8245 rather than #output.
8246
8247 * data/c.m4 (b4_copyright): Omit file name from comment, since
8248 the file name could contain "*/".
8249 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8250 be quoted. All uses changed.
8251
8252 * data/glr.c: Use new @ escapes consistently.
8253 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8254 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8255 Remove, since they couldn't handle arbitrary characters in file
8256 names.
8257 * data/lalr1.cc: Likewise.
8258 * data/yacc.c: Likewise.
8259
8260 * src/files.c (output_infix): Remove; all uses removed.
8261 * src/files.h: Likewise.
8262
8263 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8264 mishandled funny characters in file names, and anyway it isn't
8265 needed any more.
8266 * data/yacc.c: Likewise.
8267 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8268
8269 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8270 * data/yacc.c: Likewise.
8271
8272 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8273 strings now.
8274 (muscle_init): Quote filename as a C string.
8275 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
8276 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
8277 * src/output.c (escaped_file_name_output): New function.
8278 (prepare_symbols): Quote tokens for M4.
8279 (prepare): Don't insert output_infix, output_prefix,
8280 output_parser_name, output_header_name; this is now down by scan-skel.
8281 Insert skeleton as a C string.
8282
8283 * src/output.c (user_actions_output, symbol_destructors_output,
8284 symbol_printers_output): Quote filenames for C and M4.
8285 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8286
8287 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
8288 escapes other than \\ and \'; this simplifies the code.
8289 (<SC_STRING>): Likewise, for \\ and \".
8290 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
8291 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
8292 Use new escapes @{ and @} for [ and ].
8293
8294 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
8295 them with auto vars.
8296 Switch to new escape scheme, where @ is the escape character uniformly.
8297 Abort if a stray escape character is found. Avoid unbounded input
8298 buffer when parsing non-escaped text.
8299
8300 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8301 __oline__, #output, $@, and @{ do not have unintended meanings.
8302
acea4f3b
PE
83032002-11-09 Paul Eggert <eggert@twinsun.com>
8304
8305 Fix the test failure due to GCC warnings described in
161a71f3 8306 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
8307 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
8308 evaluate to 0 if it's impossible for NINF to be in the respective
8309 table.
8310 (yygetLRActions, yyrecoverParseError): Use them.
8311
8312 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
8313 counted in the token inserted at end of file. Now takes
8314 location_t *, not location_t, so that the location can be
8315 adjusted. All uses changed.
8316
8317 * tests/regression.at (Invalid inputs): Adjust wording in
8318 diagnostic to match the new behavior.
8319
8320 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
8321 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
8322 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
8323 abort ();'. This reduces the runtime of the "Many lookaheads"
8324 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
8325 GCC 3.2.
8326
20ef1ad5
PE
83272002-11-07 Paul Eggert <eggert@twinsun.com>
8328
8329 * src/parse-gram.y (CHARACTER): Remove unused token.
8330 All uses removed.
8331
8332 * src/scan-gram.l: Remove stack option. We no longer use the
8333 stack, since the stack was never deeper than 1; instead, use the
8334 new auto var c_context to record the stacked value.
8335
8336 Remove nounput option. At an unexpected end of file, we now unput
8337 the minimal input necessary to end cleanly; this simplifies the
8338 code.
8339
8340 Avoid unbounded token sizes where this is easy.
8341
8342 (unexpected_end_of_file): New function.
8343 Use it to systematize the error message on unexpected EOF.
8344 (last-string): Now auto, not static.
8345 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
8346 (scanner_last_string_free): Remove; not used.
8347 (percent_percent_count): Move decl to just before use.
8348 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
8349 not the (never otherwised-used) CHARACTER.
8350
93724f13
AD
83512002-11-07 Akim Demaille <akim@epita.fr>
8352
8353 Let yyerror always receive the msg as last argument, so that
8354 yyerror can be variadic.
8355
8356 * data/yacc.c (b4_yyerror_args): New.
8357 Use it when calling yyerror.
8358 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
8359 Use it when calling yyerror.
8360 * doc/bison.texinfo (Error Reporting): Adjust.
8361 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
8362 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
8363
6e40b4eb
AD
83642002-11-06 Akim Demaille <akim@epita.fr>
8365
8366 #line should have quoted strings.
8367 Ideally, this should be done by m4_quotearg.
8368
8369 * src/scan-skel.l: Include quotearg.h.
8370 Quote __ofile__.
8371 * src/output.c (symbol_printers_output)
8372 (symbol_destructors_output): Quote the file name.
8373
2dfbfc12
AD
83742002-11-06 Akim Demaille <akim@epita.fr>
8375
8376 * tests/regression.at (Invalid inputs): Adjust to the recent
8377 messages.
8378
437c2d80
AD
83792002-11-06 Akim Demaille <akim@epita.fr>
8380
8381 Restore --no-lines.
8382 Reported by Jim Kent.
8383
8384 * data/c.m4 (b4_syncline): New.
8385 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
8386 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
8387 * src/output.c (user_actions_output): Likewise.
8388 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 8389 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 8390
900c5db5
AD
83912002-11-06 Akim Demaille <akim@epita.fr>
8392
8393 * src/main.c (main): Free `infile'.
8394 * src/scan-gram.l (handle_syncline): New.
8395 Recognize `#line'.
8396 * src/output.c (user_actions_output, symbol_destructors_output)
8397 (symbol_printers_output): Use the location's file name, not
8398 infile.
8399 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8400
e183b123 84012002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 8402
e183b123 8403 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 8404 either has GLR conflict entries.
e183b123 8405
193eb6b7
PE
84062002-11-05 Paul Eggert <eggert@twinsun.com>
8407
e183b123
PE
8408 * src/scan-gram.l: Use more accurate diagnostics, e.g.
8409 "integer out of range" rather than "invalid value".
8410 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
8411 accordingly.
8412
193eb6b7
PE
8413 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
8414 Also, remove one static variable in the scanner.
8415
8416 * src/scan-gram.l (braces_level): Now auto, not static.
8417 Initialize to zero if the compiler is being picky.
8418 (INITIAL): Clear braces_level instead of incrementing it.
8419 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
8420 as POSIX 1003.1-2001 requires.
8421 * src/system.h (IF_LINT): New macro, taken from coreutils.
8422 * configure.ac: Define "lint" if --enable-gcc-warnings.
8423
29c01725
AD
84242002-11-05 Akim Demaille <akim@epita.fr>
8425
8426 * src/scan-gram.l: When it starts with `%', complain about the
8427 whole directive, not just that `invalid character: %'.
8428
8aeac3ca
AD
84292002-11-04 Akim Demaille <akim@epita.fr>
8430
8431 * Makefile.maint: Update from Autoconf.
8432 (update, cvs-update, po-update, do-po-update): New.
8433
793a58bb
AD
84342002-11-04 Akim Demaille <akim@epita.fr>
8435
8436 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
8437 and yyerror.
8438 Have yyerror `use' its arguments.
8439 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
8440 returns true when location & yacc & pure & parse-param.
8441 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
8442
c4d720cd
AD
84432002-11-04 Akim Demaille <akim@epita.fr>
8444
8445 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
8446 clashes.
8447 * src/scan-gram.l: Use [\'] instead of ['] to pacify
8448 font-lock-mode.
8449 Use complain_at.
8450 Use quote, not quote_n since LOCATION_PRINT no longer uses the
8451 slot 0.
8452
613a0dc5
PE
84532002-11-03 Paul Eggert <eggert@twinsun.com>
8454
8455 * src/reader.c (get_merge_function, grammar_current_rule_check):
8456 Use consistent diagnostics for reporting type name clashes.
8457 Quote the types with <>, for consistency with Yacc.
8458 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
8459
2a8d363a
AD
84602002-11-03 Akim Demaille <akim@epita.fr>
8461
8462 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
8463 New.
8464 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
8465 (b4_parse_param): Remove.
8466 Use b4_identification.
8467 Propagate b4_pure_args where needed to pass them to yyerror.
8468 * data/glr.m4 (b4_parse_param): Remove.
8469 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
8470 (b4_lpure_formals): New.
8471 Use b4_identification.
8472 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
8473 b4_user_formals and b4_user_args.
8474 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
8475 (yyreportAmbiguity): When using a pure parser, also need
8476 the location, and the parse-params.
8477 Adjust callers.
8478 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
8479 When using a pure parser, also need the parse-params.
8480 Adjust callers.
8481 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
8482 (%pure-parser + %parse-param) LALR and GLR parsers.
8483 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
8484 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
8485 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
8486 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
8487 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
8488 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
8489 * doc/bison.texinfo: Untabify the whole file.
8490 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
8491 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
8492 (Error Reporting): Adjust to these new directives.
8493 Document %error-verbose, deprecate YYERROR_VERBOSE.
8494
9e32add8
AD
84952002-11-03 Akim Demaille <akim@epita.fr>
8496
8497 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
8498 AT_CHECK_CALC_GLR invocations to use % directives, instead of
8499 command line options.
8500 * tests/cxx-type.at: Formatting changes.
8501
b02d90a5
PE
85022002-11-03 Paul Eggert <eggert@twinsun.com>
8503
8504 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
8505 to count columns correctly, and to check for invalid inputs.
9e32add8 8506
b02d90a5
PE
8507 Use mbsnwidth to count columns correctly. Account for tabs, too.
8508 Include mbswidth.h.
8509 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
8510 (extend_location): New function.
8511 (YY_LINES): Remove.
8512
8513 Handle CRLF in C code rather than in Lex code.
8514 (YY_INPUT): New macro.
8515 (no_cr_read): New function.
8516
8517 Scan UCNs, even though we don't fully handle them yet.
8518 (convert_ucn_to_byte): New function.
8519
8520 Handle backslash-newline correctly in C code.
8521 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
8522 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
8523 all uses changed.
8524 (tag, splice): New EREs. Do not allow NUL or newline in tags.
8525 Use {splice} wherever C allows backslash-newline.
8526 YY_STEP after space, newline, vertical-tab.
8527 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 8528
b02d90a5
PE
8529 (letter, id): Don't assume ASCII; e.g., spell out a-z.
8530
8531 ({int}, handle_action_dollar, handle_action_at): Check for integer
8532 overflow.
9e32add8 8533
b02d90a5
PE
8534 (YY_STEP): Omit trailing semicolon, so that it's more like C.
8535
8536 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
8537 as well as \000. Check for UCHAR_MAX, not 255.
8538 Allow \x with an arbitrary positive number of digits, as in C.
8539 Check for overflow here.
8540 Allow \? and UCNs, for compatibility with C.
8541
8542 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
8543 with quote slot used by complain_at.
8544
8545 * tests/input.at: Add tests for backslash-newline, m4 quotes
8546 in symbols, long literals, and funny escapes in strings.
8547
8548 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
8549 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
8550 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
8551 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
8552 * m4/mbswidth.m4: New file, from GNU coreutils.
8553
8554 * doc/bison.texinfo (Grammar Outline): Document // comments.
8555 (Symbols): Document that trigraphs have no special meaning in Bison,
8556 nor is backslash-newline allowed.
8557 (Actions): Document that trigraphs have no special meaning.
8558
8559 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
8560 no longer used.
8561
85622002-11-02 Paul Eggert <eggert@twinsun.com>
8563
8564 * src/reader.c: Don't include quote.h; not needed.
8565 (get_merge_function): Reword warning to be consistent with
8566 type clash diagnostic in grammar_current_rule_check.
8567
8568 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
8569 bug in trigraph handling.
8570
8571 * src/output.c (prepare_symbols): When printing token names,
8572 escape "[" as "@<:@" and likewise for "]".
8573
8574 * src/system.h (errno): Remove declaration, as we are now
8575 assuming C89 or better, and C89 guarantees errno.
8576
762b212b
PE
85772002-10-30 Paul Eggert <eggert@twinsun.com>
8578
8579 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
8580 Check for close failures.
8581 * src/files.h (xfclose): Return void, not int, since it always
8582 returned zero.
8583 * src/files.c (xfclose): Likewise. Report I/O error if ferror
8584 indicates one.
8585 * src/output.c (output_skeleton): Use xfclose rather than fclose
8586 and ferror. xfclose now checks ferror.
8587
8588 * data/glr.c (YYLEFTMOST_STATE): Remove.
8589 (yyreportTree): Use a stack-based leftmost state. This avoids
8590 our continuing battles with bogus warnings about initializers.
8591
56100c60
AD
85922002-10-30 Akim Demaille <akim@epita.fr>
8593
8594 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
8595 #if.
8596
51b4a04c
PH
85972002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8598
8599 * tests/glr-regr1.at: New test for reported regressions.
8600 * tests/testsuite.at: Add glr-regr1.at test.
8601 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 8602
bf1ebda2
PE
86032002-10-24 Paul Eggert <eggert@twinsun.com>
8604
5c16c6b1
PE
8605 Version 1.75a.
8606
bf1ebda2
PE
8607 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
8608 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
8609 we use malloc. Don't assume 'A' through 'Z' are contiguous.
8610 Don't assume strdup exists; POSIX says its an XSI extension.
8611 Check for buffer overflow on input.
8612
b526ee61
AD
86132002-10-24 Akim Demaille <akim@epita.fr>
8614
8615 * src/output.c (output_skeleton): Don't disable M4sugar comments
8616 too soon: it results in comments being expanded.
8617 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
8618 first output.
8619
f1886bb2
AD
86202002-10-24 Akim Demaille <akim@epita.fr>
8621
8622 * data/yacc.c (m4_int_type): New.
8623 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
8624 char' as only yacc.c wants K&R portability.
8625 * data/glr.c (yysigned_char): Remove.
8626 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
8627 Reported by Quoc Peyrot.
8628
c5576256
PE
86292002-10-23 Paul Eggert <eggert@twinsun.com>
8630
8631 * src/main.c (main): With --trace=time, report times even if a
8632 non-fatal error occurs. Formerly, the times were reported in some
8633 such cases but not in others.
8634 * src/reader.c (reader): Just return if a complaint has been issued,
8635 instead of exiting, so that 'main' can report times.
8636
27b0ffea
AD
86372002-10-22 Akim Demaille <akim@epita.fr>
8638
8639 * src/system.h: Include sys/types.
8640 Reported by Bert Deknuydt.
8641
223a7883
PE
86422002-10-23 Paul Eggert <eggert@twinsun.com>
8643
8644 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
8645 Suggested by Art Haas.
8646
86472002-10-22 Paul Eggert <eggert@twinsun.com>
8648
8649 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
8650 decl; not needed any more.
8651 * src/main.c (main): Use return to exit, undoing yesterday's change.
8652 The last OS that we could find where this wouldn't work is
8653 SunOS 3.5, and that's too old to worry about now.
8654
8655 * data/glr.c (struct yyltype): Define members even when not
8656 doing locations. This is more consistent with yacc.c, and it
8657 works around the following bug reports:
161a71f3
PE
8658 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
8659 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 8660
223a7883
PE
8661 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
8662 @acronym consistently. Standardize on "Yacc" instead of "YACC",
8663 "Algol" instead of "ALGOL". Give a bit more history about BNF.
8664
8b76775a
AD
86652002-10-22 Akim Demaille <akim@epita.fr>
8666
8667 * data/README: New.
8668
6db10d14
PE
86692002-10-21 Paul Eggert <eggert@twinsun.com>
8670
8671 Be consistent about 'bool'; the old code used an enum in one
8672 module and an int in another, and this violates the C standard.
8673 * m4/stdbool.m4: New file, from coreutils 4.5.3.
8674 * configure.ac (AC_HEADER_STDBOOL): Add.
8675 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
8676 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
8677 * src/symtab.c (hash_compare_symbol_t): Likewise.
8678 * src/system.h (bool, false, true): Use a definition consistent
8679 with ../lib/hash.c. All uses changed.
8680
8681 * src/complain.c (warning_issued): Renamed from warn_message_count,
8682 so that we needn't worry about integer overflow (!).
8683 Now of type bool. All uses changed.
8684 (complaint_issued): Renamed from complain_message_count; likewise.
8685
8686 * src/main.c (main): Use exit to exit with failure.
27b0ffea 8687
6db10d14
PE
8688 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
8689 rather than 1 and 0.
8690 * src/main.c (main): Likewise.
8691 * src/getargs.c (getargs): Likewise.
8692 * src/reader.c (reader): Likewise.
8693
8694 * src/getarg.c (getargs): Remove duplicate code for
8695 "Try `bison --help'".
8696
8697 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
8698 What was that "2" for?
8699
8700 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
8701 * src/getargs.c (usage): Likewise.
8702
8703 * src/getargs.c (getargs): When there are too few operands, report
8704 the last one. When there are too many, report the first extra
8705 one. This is how diffutils does it.
8706
92a060fd
PE
87072002-10-20 Paul Eggert <eggert@twinsun.com>
8708
8709 Remove K&R vestiges.
8710 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
8711 * src/complain.c (VA_START): Remove. Assume prototypes.
8712 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
8713 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
8714 fatal): Assume prototypes.
8715 * src/complain.h: Assume prototypes.
8716 * src/system.h (PARAMS): Remove.
8717 Include <limits.h> unconditionally, since it's guaranteeed even
8718 for a freestanding C89 compiler.
8719 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
8720 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 8721
e7cb57c0
AD
87222002-10-20 Akim Demaille <akim@epita.fr>
8723
8724 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
8725 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
8726 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
8727 (yyresolveStates, yyresolveAction, yyresolveStack)
8728 (yyprocessOneStack): Use them.
8729 (yy_reduce_print): New.
8730 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
8731
0245f82d
AD
87322002-10-20 Akim Demaille <akim@epita.fr>
8733
8734 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
8735 arguments and output `void'.
8736 (b4_c_function): Rename as...
8737 (b4_c_function_def): this.
8738 (b4_c_function_decl, b4_c_ansi_function_def)
8739 (b4_c_ansi_function_decl): New.
8740 Change the interpretation of the arguments: before `int, foo', now
8741 `int foo, foo'.
8742 * data/yacc.c (yyparse): Prototype and define thanks to these.
8743 Adjust b4_c_function_def uses.
8744 * data/glr.c (yyparse): Likewise, but ANSI only.
8745
39912f52
AD
87462002-10-20 Akim Demaille <akim@epita.fr>
8747
8748 * src/output.c (prepare): Move the definition of `tokens_number',
8749 `nterms_number', `undef_token_number', `user_token_number_max'
8750 to...
8751 (prepare_tokens): Here.
8752 (prepare_tokens): Rename as...
8753 (prepare_symbols): this.
8754 (prepare): Move the definition of `rules_number' to...
8755 (prepare_rules): here.
8756 (prepare): Move the definition of `last', `final_state_number',
8757 `states_number' to...
8758 (prepare_states): here.
8759 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
8760
20c1e2ad
AD
87612002-10-20 Akim Demaille <akim@epita.fr>
8762
8763 * src/tables.h, src/tables.c, src/output.c: Comment changes.
8764
21964f43
AD
87652002-10-20 Akim Demaille <akim@epita.fr>
8766
8767 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
8768 * data/c.m4: here.
8769
66d30cd4
AD
87702002-10-20 Akim Demaille <akim@epita.fr>
8771
8772 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
8773 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
8774 `pair'.
8775 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
8776 `name' to...
8777 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
8778 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
8779 These.
8780
95f2c9fe
PE
87812002-10-19 Paul Eggert <eggert@twinsun.com>
8782
8783 Do not create a temporary file, as that involves security and
8784 cleanup headaches. Instead, use a pair of pipes.
8785 Derived from a suggestion by Florian Krohm.
8786 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
8787 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
8788 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
8789 (BISON_PREREQ_SUBPIPE): Add.
8790 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
8791 Add subpipe.h, subpipe.c.
8792 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
8793 * po/POTFILES.in: Add lib/subpipe.c.
8794 * src/output.c: Include "subpipe.h".
8795 (m4_invoke): Remove decl.
8796 (scan_skel): New decl.
8797 (output_skeleton): Use pipe rather than temporary file for m4 input.
8798 Check that m4sugar.m4 is readable, to avoid deadlock.
8799 Check for pipe I/O error.
8800 * src/scan-skel.l (readpipe): Remove decl.
8801 (scan_skel): New function, to be used in place of m4_invoke.
8802 Read from stream rather than file.
66d30cd4 8803
95f2c9fe
PE
8804 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
8805 float, as this generates a warning on Solaris 8 + GCC 3.2 with
8806 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
8807 this generates a more-accurate value anyway.
8808
8809 * lib/timevar.c (timervar_accumulate): Rename locals to
8810 avoid confusion with similarly-named more-global.
8811 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
8812
8813 * src/output.c (prepare): Use xstrdup to convert char const *
8814 to char *, to avoid GCC warning.
8815
c19988b7
AD
88162002-10-19 Akim Demaille <akim@epita.fr>
8817
8818 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
8819 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
8820 Use them to have `calc.y' ready for %pure-parser.
8821 * data/yacc.c (YYLEX): Pass a yylex return type to
8822 b4_c_function_call.
8823
ae7453f2
AD
88242002-10-19 Akim Demaille <akim@epita.fr>
8825
8826 Prototype support of %lex-param and %parse-param.
8827
8828 * src/parse-gram.y: Add the definition of the %lex-param and
8829 %parse-param tokens, plus their rules.
8830 Drop the `_' version of %glr-parser.
8831 Add the "," token.
8832 * src/scan-gram.l (INITIAL): Scan them.
8833 * src/muscle_tab.c: Comment changes.
8834 (muscle_insert, muscle_find): Rename `pair' as `probe'.
8835 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
8836 (muscle_entry_s): The `value' member is no longer const.
8837 Adjust all dependencies.
8838 * src/muscle_tab.c (muscle_init): Adjust: use
8839 MUSCLE_INSERT_STRING.
8840 Initialize the obstack earlier.
8841 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
8842 (muscle_pair_list_grow): New.
8843 * data/c.m4 (b4_c_function_call, b4_c_args): New.
8844 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
8845 * tests/calc.at: Use %locations, not --locations.
8846 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
8847
0e575721
AD
88482002-10-19 Akim Demaille <akim@epita.fr>
8849
8850 * src/getargs.c (usage): Take status as argument and exit
8851 accordingly.
8852 Report the traditional `Try ... --help' message when status != 0.
8853 (usage, version): Don't take a FILE * as arg, it is pointless.
8854 (getargs): When there is an incorrect number of arguments, make it
8855 an error, and report it GNUlically thanks to `usage ()'.
8856
724ce7f5
PE
88572002-10-18 Paul Eggert <eggert@twinsun.com>
8858
3a781eb2
PE
8859 * data/glr.c (yyreportParseError): Don't assume that sprintf
8860 yields the length of the printed string, as this is not true
8861 on SunOS 4.1.4. Reported by Peter Klein.
8862
724ce7f5
PE
8863 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
8864 * tests/conflicts.at (%nonassoc and eof): Likewise.
8865 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
8866
473d0a75
AD
88672002-10-17 Akim Demaille <akim@epita.fr>
8868
8869 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
8870 * src/getargs.c (trace_types, trace_args): Adjust.
8871 * src/reader.c (grammar_current_rule_prec_set)
8872 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
8873 Standardize error messages.
8874 And s/@prec/%prec/!
8875 (reader): Use trace_flag to enable scanner/parser debugging,
8876 instead of an adhoc scheme.
8877 * src/scan-gram.l: Remove trailing debugging code.
8878
e76d2469
PE
88792002-10-16 Paul Eggert <eggert@twinsun.com>
8880
93e2236a
PE
8881 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
8882 MUSCLE_TAB_H.
8883
e76d2469
PE
8884 * NEWS: Officially drop support for building Bison with K&R C,
8885 since it didn't work anyway and it's not worth worrying about.
8886 * Makefile.maint (wget_files): Remove ansi2knr.c.
8887 (ansi2knr.c-url_prefix): Remove.
8888 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
8889 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8890 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8891
5bd1c419
PE
88922002-10-15 Paul Eggert <eggert@twinsun.com>
8893
8894 Stop using the "enum_" trick for K&R-style function definitions;
8895 it confused me, and I was the author! Instead, assume that people
8896 who want to use K&R C compilers (when using these modules in GCC,
8897 perhaps?) will run ansi2knr.
8898
8899 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
8900 All uses of "enum_" changed to "enum ".
8901 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
8902 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 8903
5bd1c419
PE
8904 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
8905 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
8906 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
8907 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
8908 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
8909 abitset_not, abitset_ones, abitset_or, abitset_or_and,
8910 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
8911 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
8912 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
8913 Use function prototypes; this removes the need for declaring
8914 static functions simply to provide their prototypes.
8915 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
8916 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
8917 bitset_count_, bitset_create, bitset_dump, bitset_first,
8918 bitset_free, bitset_init, bitset_last, bitset_next,
8919 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
8920 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
8921 bitset_print, bitset_release_memory, bitset_toggle_,
8922 bitset_type_choose, bitset_type_get, bitset_type_name_get,
8923 debug_bitset): Likewise.
8924 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
8925 * lib/bitset_stats.c (bitset_log_histogram_print,
8926 bitset_percent_histogram_print, bitset_stats_and,
8927 bitset_stats_and_cmp, bitset_stats_and_or,
8928 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
8929 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
8930 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
8931 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
8932 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
8933 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
8934 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
8935 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
8936 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
8937 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
8938 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
8939 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
8940 bitset_stats_zero): Likewise.
8941 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
8942 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
8943 bitsetv_dump, debug_bitsetv): Likewise.
8944 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
8945 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
8946 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
8947 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
8948 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
8949 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
8950 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
8951 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
8952 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
8953 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
8954 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
8955 Likewise.
8956 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
8957 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
8958 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
8959 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
8960 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
8961 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
8962 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
8963 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
8964 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
8965 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
8966 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 8967
ae26e1f0
AD
89682002-10-14 Akim Demaille <akim@epita.fr>
8969
8970 Version 1.75.
8971
d43baf71
AD
89722002-10-14 Akim Demaille <akim@epita.fr>
8973
8974 * tests/Makefile.am (maintainer-check-posix): New.
8975
7ebc83e3
AD
89762002-10-14 Akim Demaille <akim@epita.fr>
8977
8978 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
8979 member.
8980
05846dae
AD
89812002-10-14 Akim Demaille <akim@epita.fr>
8982
8983 * src/tables.c (table_ninf_remap): base -> tab.
8984 Reported by Matt Rosing.
8985
1318e37d
PE
89862002-10-14 Paul Eggert <eggert@twinsun.com>
8987
447fbb17
PE
8988 * tests/action.at, tests/calc.at, tests/conflicts.at,
8989 tests/cxx-type.at, tests/headers.at, tests/input.at,
8990 tests/regression.at, tests/synclines.at, tests/torture.at:
8991 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
8992 so that the tests still work even if POSIXLY_CORRECT is set.
8993 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 8994
1318e37d
PE
8995 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
8996 for portability to K&R hosts. Fix typo: signed char is guaranteed
8997 only to 127, not to 128.
8998 * data/glr.c (yysigned_char): New type.
8999 * data/yacc.c (yysigned_char): Likewise.
9000 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9001
cc0f0794
PE
90022002-10-13 Paul Eggert <eggert@twinsun.com>
9003
5038f418
PE
9004 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9005 true due to limited range of data type" warning from GCC.
9006
cc0f0794
PE
9007 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9008 by wrapping enum yytokentype's definition inside #ifndef
9009 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9010
6fed0802
AD
90112002-10-13 Akim Demaille <akim@epita.fr>
9012
9013 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9014 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9015
32f0598d
AD
90162002-10-13 Akim Demaille <akim@epita.fr>
9017
9018 * Makefile.maint: Update from Autoconf 2.54.
9019 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9020
7ea9a33f
AD
90212002-10-13 Akim Demaille <akim@epita.fr>
9022
9023 * src/print.c (print_state): Separate the list of solved conflicts
9024 from the other items.
9025 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9026
ea99527d
AD
90272002-10-13 Akim Demaille <akim@epita.fr>
9028
9029 Let nondeterministic skeletons be usable with deterministic
9030 tables.
9031
9032 With the patch, GAWK compiled by GCC without -O2 passes its test
9033 suite using a GLR parser driven by LALR tables. It fails with -O2
9034 because `struct stat' gives two different answers on my machine:
9035 88 (definition of an auto var) and later 96 (memset on this var).
9036 Hence the stack is badly corrumpted. The headers inclusion is to
9037 blame: if I move the awk.h inclusion before GLR's system header
9038 inclusion, the two struct stat have the same size.
9039
9040 * src/tables.c (pack_table): Always create conflict_table.
9041 (token_actions): Always create conflict_list.
9042 * data/glr.c (YYFLAG): Remove, unused.
9043
f377f69f
AD
90442002-10-13 Akim Demaille <akim@epita.fr>
9045
9046 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9047 (O0FLAGS): New.
9048 (VALGRIND, GXX): New.
9049 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9050 * tests/bison.in: Run $PREBISON a pre-command.
9051 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9052 (maintainer-check-g++): New.
9053 * Makefile.am (maintainer-check): New.
9054
2a1fe6ed
AD
90552002-10-13 Akim Demaille <akim@epita.fr>
9056
9057 * data/glr.c: Formatting changes.
9058 Tweak some trace messages to match yacc.c's.
9059
f50adbbd
AD
90602002-10-13 Akim Demaille <akim@epita.fr>
9061
9062 GLR parsers sometimes raise parse errors instead of performing the
9063 default reduction.
9064 Reported by Charles-Henry de Boysson.
9065
9066 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 9067 check the length of the traces when %glr.
f50adbbd
AD
9068 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9069 GLR's traces.
9070 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9071 Test GLR parsers.
9072 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9073 (yyltype): Remove the yy prefix from the member names.
9074 (yytable): Complete its comment.
9075 (yygetLRActions): Map error action number from YYTABLE from
9076 YYTABLE_NINF to 0.
9077 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9078 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9079 not satisfying as we could compare an YYACTION computed from
9080 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9081 only value for error actions.
9082 (yyreportParseError): In verbose parse error messages, don't issue
9083 `error' in the list of expected tokens.
9084 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9085 next action to perform to match glr.c's decoding.
9086 (yytable): Complete its comment.
9087
bcbad5b9
PE
90882002-10-13 Paul Eggert <eggert@twinsun.com>
9089
9090 Fix problem reported by Henrik Grubbstroem in
161a71f3 9091 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
9092 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9093 because the Bison parser reads the second action before reducing
9094 the first one.
9095 * src/scan-gram.l (rule_length): New static var.
9096 Use it to keep track of the rule length in the scanner, since
9097 we can't expect the parser to be in lock-step sync with the scanner.
9098 (handle_action_dollar, handle_action_at): Use this var.
9099 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 9100
14904b89
PE
91012002-10-12 Paul Eggert <eggert@twinsun.com>
9102
1fe611e5
PE
9103 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9104 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9105 Include <sys/time.h> when checking for clock_t and struct tms.
9106 Use same include order as source.
9107 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 9108 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 9109
1fe611e5
PE
9110 * lib/timevar.c: Update copyright date and clarify comments.
9111 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 9112
1fe611e5
PE
9113 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9114 GCC version as of today, then merge Bison's changes.
9115 Change "GCC" to "Bison" in copyright notice. timevar.def's
9116 author is Akim, so change that too.
9117
98194095
PE
9118 * src/reader.c (grammar_current_rule_check):
9119 Don't worry about the default action if $$ is untyped.
9120 Prevents bogus warnings reported by Jim Gifford in
161a71f3 9121 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 9122
14904b89
PE
9123 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9124 * data/glr.c, data/lalr1.cc, data/yacc.c:
9125 Output token definitions before the first part of user declarations.
9126 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 9127 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 9128
ff6dca18
PE
91292002-10-11 Paul Eggert <eggert@twinsun.com>
9130
9131 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9132 (yyparse): here. This undoes some of the 2002-07-25 change.
9133 Compatibility problem reported by Ralf S. Engelschall with
9134 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9135
eb714592
AD
91362002-10-11 Akim Demaille <akim@epita.fr>
9137
9138 * tests/regression.at Characters Escapes): New.
9139 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9140 characters.
9141 Reported by Jan Nieuwenhuizen.
9142
b7195100
AD
91432002-10-11 Akim Demaille <akim@epita.fr>
9144
9145 * po/id.po: New.
9146
f28a0f2d
PE
91472002-10-10 Paul Eggert <eggert@twinsun.com>
9148
9149 Portability fixes for bitsets; this also avoids several GCC
9150 warnings.
9151
9152 * lib/abitset.c: Include <stddef.h>, for offsetof.
9153 * lib/lbitset.c: Likewise.
9154
9155 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9156 properly for vectors of objects. Do not assume that adding a
9157 header size to a multiple of a word size yields a value that is
9158 properly aligned for the whole union.
9159 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9160
9161 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9162 unique names for structures.
9163 * lib/ebitset.c (ebitset_bytes): Likewise.
9164 * lib/lbitset.c (lbitset_bytes): Likewise.
9165
9166 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9167 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9168 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9169 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9170 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9171 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9172 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9173 to improve the type-checking that GCC can do.
9174 * lib/bitset.c (bitset_op4_cmp): Likewise.
9175 * lib/bitset_stats.c (bitset_stats_count,
9176 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9177 bitset_stats_copy, bitset_stats_disjoint_p,
9178 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9179 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9180 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9181 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9182 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9183 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9184 bitset_stats_or_and_cmp): Likewise.
9185 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9186 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9187 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9188 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9189
9190 * lib/abitset.h: Include bitset.h, not bbitset.h.
9191 * lib/ebitset.h: Likewise.
9192 * lib/lbitset.h: Likewise.
9193
9194 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9195 All instances of parameters of type enum bitset_opts are now of
9196 type enum_bitset_opts, to conform to the C Standard, and similarly
9197 for enum_bitset_type.
9198 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9199 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9200
9201 Do not use "struct bitset_struct" to mean different things in
9202 different modules. Not only is this confusing, it violates
9203 the C Standard, which requires that structure types in different
9204 modules must be compatible if one is to be passed to the other.
9205 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9206 All instances of "struct bitset_struct *" replaced with "bitset".
9207 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9208 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9209 struct lbitset_struct, struct bitset_stats_struct): New types.
9210 All uses of struct bitset_struct changed to union bitset_union,
9211 etc.
ba0fe3c7 9212 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
9213 struct bitset_struct): Remove.
9214 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9215 struct bitset_struct): Remove.
9216 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9217 bitset_struct): Remove.
9218 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9219 Likewise.
9220
9221 Do not call a function of type T using a call that assumes the
9222 function is of a different type U. Standard C requires that a
9223 function must be called with a type that is compatible with its
9224 definition.
9225 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9226 New decls.
9227 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9228 New functions.
9229 * lib/ebitset.c (PFV): Remove.
9230 * lib/lbitset.c (PFV): Likewise.
9231 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9232 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9233 decls.
9234 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9235 (ebitset_vtable): Use them.
9236 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9237 lbitset_xor): New functions.
9238 (lbitset_vtable): Use them.
9239
9240 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9241 Declare.
9242
9243 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9244 GCC warning.
9245 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9246 Use offsetof, for simplicity.
9247
6fbe4984
PE
92482002-10-06 Paul Eggert <eggert@twinsun.com>
9249
9250 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9251 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 9252 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
9253 which was inadvertently undone by the 2002-09-30 patch.
9254 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9255 the same width as int.
9256
420f93c8
PE
92572002-10-04 Paul Eggert <eggert@twinsun.com>
9258
9259 Version 1.50.
9260
9261 * configure.ac (AC_INIT), NEWS: Increment version number.
9262
9263 * doc/bison.texinfo: Minor spelling, grammar, and white space
9264 fixes.
9265 (Symbols): Mention that any negative value returned from yylex
9266 signifies end-of-input. Warn about negative chars. Mention
9267 the portable Standard C character set.
9268
9269 The GNU coding standard says CFLAGS and YFLAGS are reserved
9270 for the installer to set.
9271 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9272 * src/Makefile.am (AM_CFLAGS): Likewise.
9273 (AM_YFLAGS): Renamed from YFLAGS.
9274
9275 Fix some MAX and MIN problems.
9276 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
9277 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
9278 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
9279 * src/reader.c (reader): Use it.
9280
9281 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9282 POSIX 1003.1-2001 has removed fgrep.
9283
92842002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9285
9286 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
9287 interpreted as signed.
9288 * lib/ebitset.c (ebitset_list): Fix bug.
9289
ff68026d
PE
92902002-10-01 Paul Eggert <eggert@twinsun.com>
9291
9292 More fixes for 64-bit hosts and large bitsets.
9293
9294 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
9295 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
9296 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
9297 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
9298 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
9299 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
9300 bitset_count_): Likewise.
9301 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
9302 bitset_first, bitset_last): Likewise.
9303 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
9304 bitset_stats_list_reverse, bitset_stats_size,
9305 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
9306 Likewise.
9307 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9308 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9309 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9310 bitsetv_reflexive_transitive_closure): Likewise.
9311 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
9312 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
9313 Likewise.
9314 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
9315 Likewise.
420f93c8 9316
ff68026d
PE
9317 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
9318 Use size_t, not unsigned int, to count bytes.
9319 * lib/abitset.h (abitset_bytes): Likewise.
9320 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
9321 Likewise.
9322 * lib/bitset.h (bitset_bytes): Likewise.
9323 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
9324 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
9325 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9326 * lib/ebitset.c (ebitset_bytes): Likewise.
9327 * lib/ebitset.h (ebitset_bytes): Likewise.
9328 * lib/lbitset.c (lbitset_bytes): Likewise.
9329 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 9330
ff68026d
PE
9331 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
9332 abitset_subset_p, abitset_disjoint_p, abitset_and,
9333 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
9334 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
9335 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
9336 abitset_or_and, abitset_or_and_cmp):
9337 Use bitset_windex instead of unsigned int.
9338 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9339 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
9340 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
9341 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
9342 Likewise.
9343 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 9344
ff68026d
PE
9345 * lib/bitset.c (bitset_print):
9346 Use proper printf formats for widths of integer types.
9347 * lib/bitset_stats.c (bitset_percent_histogram_print,
9348 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
9349 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9350 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9351 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 9352
ff68026d
PE
9353 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
9354 BITSET_SIZE_MAX): New macros.
9355 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
9356 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
9357 to BITSET_WINDEX_MAX.
9358
9359 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
9360 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
9361 since we now return the bitset_bindex type (not int).
9362
9363 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
9364 when computing sizes.
9365 * lib/ebitset.c (ebitset_elts_grow): Likewise.
9366
9367 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
9368 and avoid cast to unsigned.
9369
6aa452a6
AD
93702002-09-30 Akim Demaille <akim@epita.fr>
9371
9372 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9373 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
9374 Updates from Michael Hayes.
9375
927f7817
AD
93762002-09-30 Art Haas <ahaas@neosoft.com>
9377
9378 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
9379 invocations.
9380 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
9381 defined.
9382
9738f41e
AD
93832002-09-27 Akim Demaille <akim@epita.fr>
9384
9385 Version 1.49c.
9386
a5c75d7f
AD
93872002-09-27 Akim Demaille <akim@epita.fr>
9388
9389 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
9390 (Because of AC_LIBSOURCE).
9391
8280e179
AD
93922002-09-27 Akim Demaille <akim@epita.fr>
9393
9394 Playing with Autoscan.
9395
9396 * configure.ac: Remove the old LIBOBJ tweaks.
9397 (AC_REPLACE_FUNCS): Add strrchr and strtol.
9398 * lib/strrchr.c: New.
9399 * lib/strtol.c: New, from the Coreutils 4.5.1.
9400
ae64af35
AD
94012002-09-27 Akim Demaille <akim@epita.fr>
9402
9403 Playing with Autoscan.
9404
9405 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
9406 * lib/Makefile.am (libbison_a_SOURCES): No longer include
9407 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
9408 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
9409 Coreutils 4.5.1.
9410
d1a1114f
AD
94112002-09-24 Akim Demaille <akim@epita.fr>
9412
9413 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
9414 (Frequently Asked Questions, Parser Stack Overflow): New.
9415
b906441c
AD
94162002-09-13 Akim Demaille <akim@epita.fr>
9417
9418 Playing with autoscan.
9419
9420 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
9421 * src/files.c (skeleton_find): Remove, unused.
9422 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
9423 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
9424
bd701811
AD
94252002-09-13 Akim Demaille <akim@epita.fr>
9426
9427 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
9428 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
9429
e0a13e7b
AD
94302002-09-13 Akim Demaille <akim@epita.fr>
9431
9432 * configure.ac: Require 2.54.
9433 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
9434 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
9435 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
9436 Remove, provided by Autoconf macros.
9437
c97011bf
AD
94382002-09-12 Akim Demaille <akim@epita.fr>
9439
9440 * m4/prereq.m4: Update, from Coreutils 4.5.1.
9441
d862b1be
AD
94422002-09-12 Akim Demaille <akim@epita.fr>
9443
9444 * m4/prereq.m4: Update, from Fileutils 4.1.5.
9445 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
9446 Reported by Martin Mokrejs.
9447
3d38c03a
AD
94482002-09-10 Akim Demaille <akim@epita.fr>
9449
9450 * src/parse-gram.y: Associate a human readable string to each
9451 token type.
9452 * tests/regression.at (Invalid inputs): Adjust.
9453
b6347355
AD
94542002-09-10 Gary V. Vaughan <gary@gnu.org>
9455
9456 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
9457 with an Autoconf-2.5x style configure.ac.
9458
09ba4ab2
PE
94592002-09-06 Paul Eggert <eggert@twinsun.com>
9460
9461 * doc/bison.texinfo (Conditions): Make explicit that the GPL
9462 exception applies only to yacc.c. This is a modification of a
9463 patch originally suggested by Akim Demaille.
9464
21846f69
AD
94652002-09-06 Akim Demaille <akim@epita.fr>
9466
09ba4ab2
PE
9467 * data/c.m4 (b4_copyright): Move the GPL exception comment from
9468 here to...
9469 * data/yacc.c: here.
9470
21846f69
AD
9471 * data/lalr1.cc (struct yyltype): Don't define it, since we use
9472 LocationType.
9473 (b4_ltype): Default to yy::Location from location.hh.
9474
c0ad8bf3
AD
94752002-09-04 Jim Meyering <jim@meyering.net>
9476
9477 * data/yacc.c: Guard the declaration of yytoknum also with
9478 `#ifdef YYPRINT', so it is declared only when used.
9479
3a93251e
AD
94802002-09-04 Akim Demaille <akim@epita.fr>
9481
9482 * configure.in: Rename as...
9483 * configure.ac: this.
9484 Bump to 1.49c.
9485
427c0dda
AD
94862002-09-04 Akim Demaille <akim@epita.fr>
9487
9488 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
9489 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
9490 translate maintainer only messages.
9491
6a254321
PE
94922002-08-12 Paul Eggert <eggert@twinsun.com>
9493
645e30d1
PE
9494 Version 1.49b.
9495
6a254321
PE
9496 * Makefile.am (SUBDIRS): Remove intl.
9497 (DISTCLEANFILES): Remove.
9498 * NEWS: Mention that GNU M4 is now required. Clarify what is
9499 meant by "larger grammars". Mention the pt_BR translation.
9500 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
9501 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
9502 Bump version from 0.11.2 to 0.11.5.
9503 (BISON_PREREQ_STAGE): Remove.
9504 (AM_GNU_GETTEXT): Use external gettext.
9505 (AC_OUTPUT): Remove intl/Makefile.
9506
9507 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
9508
9509 * data/glr.c: Include string.h, for strlen.
9510 (yyreportParseError): Use size_t for yysize.
9511 (yy_yypstack): No longer nested inside yypstates, as nested
9512 functions are not portable. Do not assume size_t is the
9513 same width as int.
9514 (yypstates): Do not assume that ptrdiff_t is the same width
9515 as int, and similarly for yyposn and YYINDEX.
9516
9517 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
9518
9519 * lib/Makefile.am (INCLUDES): Do not include from the intl
9520 directory, which has been removed.
9521 * src/Makefile.am (INCLUDES): Likewise.
9522
9523 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
9524 (bitsets_sources, additional_bitsets_sources, timevars_sources):
9525 New vars.
9526
9527 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
9528 * tests/Makefile.am (EXTRA_DIST): Likewise.
9529
9530 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
9531 Do not assume that bitset_windex is the same width as unsigned.
9532
9533 * lib/abitset.c (abitset_unused_clear): Do not assume that
9534 bitset_word is the same width as int.
9535 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
9536 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
9537 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
9538 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
9539 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
9540
9541 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
9542 portability to one's complement hosts!).
9543 * lib/ebitset.c (ebitset_op1): Likewise.
9544 * lib/lbitset.c (lbitset_op1): Likewise.
9545
9546 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
9547 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9548 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
9549 Sync with fileutils.
9550 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9551 lib/gettext.h: Sync with diffutils.
9552
9553 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
9554 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
9555
9556 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
9557 PROTOTYPES to check for prototypes, and "defined __STDC__" to
9558 check for void *.
9559
9560 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
9561 size_t; the old version tried to do this but casted improperly.
9562 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
9563 (bitset_test): Now returns int, not unsigned long.
9564
9565 * lib/bitset_stats.c: Include "gettext.h".
9566 (_): New macro.
9567 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
9568 name locals "index", as it generates unnecessary warnings on some
9569 hosts that have an "index" function.
9570
9571 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
9572 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
9573 they need translation.
9574 * src/LR0.c (state_list_append, new_itemsets, get_state,
9575 append_states, generate_states): Likewise.
9576 * src/assoc.c (assoc_to_string): Likewise.
9577 * src/closure.c (print_closure, set_firsts, closure): Likewise.
9578 * src/gram.c (grammar_dump): Likewise.
9579 * src/injections.c (injections_compute): Likewise.
9580 * src/lalr.c (lookaheads_print): Likewise.
9581 * src/relation.c (relation_transpose): Likewise.
9582 * src/scan-gram.l: Likewise.
9583 * src/tables.c (table_grow, pack_vector): Likewise.
9584
9585 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
9586 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
9587 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
9588 * m4/mbstate_t.m4: Sync with fileutils.
9589 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
9590
9591 * po/LINGUAS: Add pt_BR.
9592 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
9593 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
9594 lib/timevar.c.
9595 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
9596 manual recommends.
9597 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
9598
9599 * src/complain.c (strerror_r): Remove decl; not needed.
9600 (strerror): Use same pattern as ../lib/error.c.
9601
9602 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
9603
9604 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
9605
9606 * src/main.c (main): Cast result of bindtextdomain and textdomain
9607 to void, to avoid a GCC warning when --disable-nls is in effect.
9608
9609 * src/scan-gram.l: Use strings rather than escapes when possible,
9610 to minimize the number of warnings from xgettext.
9611 (handle_action_dollar, handle_action_at): Don't use isdigit,
9612 as it mishandles negative chars and it may not work as expected
9613 outside the C locale.
9614
9615 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
9616 this is a GCC extension and is not portable to other compilers.
9617
9618 * src/system.h (alloca): Use same pattern as ../lib/error.c.
9619 Do not include <ctype.h>; no longer needed.
9620 Do not include <malloc.h>; no longer needed (and generates
9621 warnings on OpenBSD 3.0).
9622
9623 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
9624 it's not portable.
9625
9626 * tests/regression.at: Do not use 'cc -c input.c -o input';
9627 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
9628
9629 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
9630 exit status as failure, not just exit status 1. Sun C exits
9631 with status 2 sometimes.
9632
9633 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
9634 Use it for the two large tests.
9635
c8f002c7
AD
96362002-08-02 Akim Demaille <akim@epita.fr>
9637
9638 * src/conflicts.c (conflicts_output): Don't output rules never
9639 reduced here, since anyway that computation doesn't work.
9640 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
9641 (rule_useless_p, rule_never_reduced_p): New.
9642 (grammar_rules_partial_print): Use a filter instead of a range.
9643 Display the title only if needed.
9644 (grammar_rules_print): Adjust.
9645 (grammar_rules_never_reduced_report): New.
9646 * src/tables.c (action_row): Move the computation of rules never
9647 reduced to...
9648 (token_actions): here.
9649 * src/main.c (main): Make the parser before making the report, so
9650 that rules never reduced are computed.
9651 Call grammar_rules_never_reduced_report.
9652 * src/print.c (print_results): Report rules never reduced.
9653 * tests/conflicts.at, tests/reduce.at: Adjust.
9654
cd08e51e
AD
96552002-08-01 Akim Demaille <akim@epita.fr>
9656
9657 Instead of attaching lookaheads and duplicating the rules being
9658 reduced by a state, attach the lookaheads to the reductions.
9659
9660 * src/state.h (state_t): Remove the `lookaheads',
9661 `lookaheads_rule' member.
9662 (reductions_t): Add a `lookaheads' member.
9663 Use a regular array for the `rules'.
9664 * src/state.c (reductions_new): Initialize the lookaheads member
9665 to 0.
9666 (state_rule_lookaheads_print): Adjust.
9667 * src/state.h, src/state.c (state_reductions_find): New.
9668 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
9669 (count_rr_conflicts): Adjust.
9670 * src/lalr.c (LArule): Remove.
9671 (add_lookback_edge): Adjust.
9672 (state_lookaheads_count): New.
9673 (states_lookaheads_initialize): Merge into...
9674 (initialize_LA): this.
9675 (lalr_free): Adjust.
9676 * src/main.c (main): Don't free nullable and derives too early: it
9677 is used by --verbose.
9678 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
9679
bb0027a9
AD
96802002-08-01 Akim Demaille <akim@epita.fr>
9681
9682 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
9683 `rule_number_t**'.
9684 (set_derives, free_derives): Rename as...
9685 (derives_compute, derives_free): this.
9686 Adjust all dependencies.
9687 * src/nullable.c (set_nullable, free_nullable): Rename as...
9688 (nullable_compute, nullable_free): these.
9689 (rule_list_t): Store rule_t *, not rule_number_t.
9690 * src/state.c (state_rule_lookaheads_print): Directly compare rule
9691 pointers, instead of their numbers.
9692 * src/main.c (main): Call nullable_free, and derives_free earlier,
9693 as they were lo longer used.
9694
3325ddc4
AD
96952002-08-01 Akim Demaille <akim@epita.fr>
9696
9697 * lib/timevar.c (get_time): Include children time.
9698 * src/lalr.h (LA, LArule): Don't export them: used with the
9699 state_t.
9700 * src/lalr.c (LA, LArule): Static.
9701 * src/lalr.h, src/lalr.c (lalr_free): New.
9702 * src/main.c (main): Call it.
9703 * src/tables.c (pack_vector): Check whether loc is >= to the
9704 table_size, not >.
9705 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
9706 (tables_generate): do it, since that's also it which allocates
9707 them.
9708 Don't free LA and LArule, main does.
9709
c6f1a33c
AD
97102002-07-31 Akim Demaille <akim@epita.fr>
9711
9712 Separate parser tables computation and output.
9713
9714 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
9715 (conflict_list, conflict_list_cnt, table, check, table_ninf)
9716 (yydefgoto, yydefact, high): Move to...
9717 * src/tables.h, src/tables.c: here.
9718 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9719 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9720 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
9721 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
9722 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
9723 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
9724 (action_row, save_row, token_actions, save_column, default_goto)
9725 (goto_actions, sort_actions, matching_state, pack_vector)
9726 (table_ninf_remap, pack_table, prepare_actions): Move to...
9727 * src/tables.c: here.
9728 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
9729 * src/output.c (token_actions, output_base, output_conflicts)
9730 (output_check): Merge into...
9731 (prepare_actions): this.
9732 (actions_output): Rename as...
9733 (user_actions_output): this.
9734 * src/main.c (main): Call tables_generate and tables_free.
9735
1509d42f
AD
97362002-07-31 Akim Demaille <akim@epita.fr>
9737
9738 Steal GCC's --time-report support.
9739
9740 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
9741 stolen/adjusted from GCC.
9742 * m4/stage.m4: Remove time related checks.
9743 * m4/timevar.m4: New.
9744 * configure.in: Adjust.
9745 * src/system.h: Adjust to using timevar.h.
9746 * src/getargs.h, src/getargs.c: Support trace_time for
9747 --trace=time.
9748 * src/main.c (stage): Remove.
9749 (main): Replace `stage' invocations with timevar calls.
9750 * src/output.c: Insert pertinent timevar calls.
9751
273a74fa
AD
97522002-07-31 Akim Demaille <akim@epita.fr>
9753
9754 Let --trace have arguments.
9755
9756 * src/getargs.h (enum trace_e): New.
9757 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
9758 (long_options, short_options): --trace/-T takes an optional
9759 argument.
9760 Change all the uses of trace_flag to reflect the new flags.
9761 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
9762
9763 Strengthen `stage' portability.
9764
9765 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
9766 * configure.in: Use it.
9767 Don't check for malloc.h and sys/times.h.
9768 * src/system.h: Include them when appropriate.
9769 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
9770 times and struct tms are available.
9771
217598da
AD
97722002-07-30 Akim Demaille <akim@epita.fr>
9773
9774 In verbose parse error message, don't report `error' as an
9775 expected token.
9776 * tests/actions.at (Printers and Destructors): Adjust.
9777 * tests/calc.at (Calculator $1): Adjust.
9778 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
9779 error message, do not report the parser accepts the error token in
9780 that state.
9781
52489d44
AD
97822002-07-30 Akim Demaille <akim@epita.fr>
9783
9784 Normalize conflict related messages.
9785
9786 * src/complain.h, src/complain.c (warn, complain): New.
9787 * src/conflicts.c (conflicts_print): Use them.
9788 (conflict_report_yacc): New, extracted from...
9789 (conflicts_print): here.
9790 * tests/conflicts.at, tests/existing.at: Adjust.
9791
e8832397
AD
97922002-07-30 Akim Demaille <akim@epita.fr>
9793
9794 Report rules which are never reduced by the parser: those hidden
9795 by conflicts.
9796
9797 * src/LR0.c (save_reductions): Don't make the final state too
9798 different: save its reduction (accept) instead of having a state
9799 without any action (no shift or goto, no reduce).
9800 Note: the final state is now a ``regular'' state, i.e., the
9801 parsers now contain `reduce 0' as default reduction.
9802 Nevertheless, since they decide to `accept' when yystate =
9803 final_state, they still will not reduce rule 0.
9804 * src/print.c (print_actions, print_reduction): Adjust.
9805 * src/output.c (action_row): Track reduced rules.
9806 (token_actions): Report rules never reduced.
9807 * tests/conflicts.at, tests/regression.at: Adjust.
9808
caf23d24
AD
98092002-07-30 Akim Demaille <akim@epita.fr>
9810
9811 `stage' was accidently included in a previous patch.
9812 Initiate its autoconfiscation.
9813
9814 * configure.in: Look for malloc.h and sys/times.h.
9815 * src/main.c (stage): Adjust.
9816 Report only when trace_flag.
9817
640748ee
AD
98182002-07-29 Akim Demaille <akim@epita.fr>
9819
9820 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
9821 state_number_t.
9822 (errs_t): symbol_t*, not symbol_number_t.
9823 (reductions_t): rule_t*, not rule_number_t.
9824 (FOR_EACH_SHIFT): New.
9825 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
9826 * src/print.c, src/print_graph.c: Adjust.
9827
88bce5a2
AD
98282002-07-29 Akim Demaille <akim@epita.fr>
9829
9830 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
9831
9832 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
9833 (endtoken, accept): these.
9834 * src/reader.c (reader): Set endtoken's default tag to "$end".
9835 Set undeftoken's tag to "$undefined" instead of "$undefined.".
9836 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
9837 Adjust.
9838
1bfb97db
AD
98392002-07-29 Akim Demaille <akim@epita.fr>
9840
9841 * src/reduce.c (reduce_grammar): When the language is empty,
9842 complain about the start symbol, not the axiom.
9843 Use its location.
9844 * tests/reduce.at (Empty Language): New.
9845
fc5734fe
AD
98462002-07-26 Akim Demaille <akim@epita.fr>
9847
9848 * src/reader.h, src/reader.c (gram_error): ... can't get
9849 yycontrol without making too strong assumptions on the parser
9850 itself.
9851 * src/output.c (prepare_tokens): Use the real 0th value of
9852 token_translations instead of `0'.
9853 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
9854 visible here.
9855 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
9856 for the time being: %locations ought to provide it to yyerror.
9857
3650b4b8
AD
98582002-07-25 Akim Demaille <akim@epita.fr>
9859
9860 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
9861 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
9862 * tests/regression.at (Web2c Actions): Adjust.
9863
4b3d3a8e
AD
98642002-07-25 Akim Demaille <akim@epita.fr>
9865
9866 Stop storing rules from 1 to nrules + 1.
9867
9868 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
9869 * src/nullable.c, src/output.c, src/print.c, src/reader.c
9870 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
9871 Iterate from 0 to nrules.
9872 Use rule_number_as_item_number and item_number_as_rule_number.
9873 Adjust to `derive' now containing possibly 0.
9874 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
9875 Handle the `- 1' part in rule numbers from/to item numbers.
9876 * src/conflicts.c (log_resolution): Fix the message which reversed
9877 shift and reduce.
9878 * src/output.c (action_row): Initialize default_rule to -1.
9879 (token_actions): Adjust.
9880 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
9881 expected output.
9882 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
9883
4a2a22f4
AD
98842002-07-25 Akim Demaille <akim@epita.fr>
9885
9886 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
9887 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
9888 (b4_c_knr_arg_decl): New.
9889 * data/yacc.c: Use it to define yysymprint, yydestruct, and
9890 yyreport_parse_error.
9891
b8df3223
AD
98922002-07-25 Akim Demaille <akim@epita.fr>
9893
9894 * data/yacc.c (yyreport_parse_error): New, extracted from...
9895 (yyparse): here.
9896 (yydestruct, yysymprint): Move above yyparse.
9897 Be K&R compliant.
9898
a762e609
AD
98992002-07-25 Akim Demaille <akim@epita.fr>
9900
9901 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
9902 replace...
9903 (b4_sint_type, b4_uint_type): these.
9904 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
9905 * tests/regression.at (Web2c Actions): Adjust.
9906
12b0043a
AD
99072002-07-25 Akim Demaille <akim@epita.fr>
9908
9909 * src/gram.h (TIEM_NUMBER_MAX): New.
9910 (item_number_of_rule_number, rule_number_of_item_number): Rename
9911 as...
9912 (rule_number_as_item_number, item_number_as_rule_number): these.
9913 Adjust dependencies.
9914 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9915 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9916 (symbol_number_to_vector_number): New.
9917 (order): Of vector_number_t* type.
9918 (base_t, BASE_MAX, BASE_MIN): New.
9919 (froms, tos, width, pos, check): Of base_t type.
9920 (action_number_t, ACTION_MIN, ACTION_MAX): New.
9921 (actrow): Of action_number_t type.
9922 (conflrow): Of unsigned int type.
9923 (table_ninf, base_ninf): New.
9924 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
9925 (muscle_insert_int_table, muscle_insert_base_table)
9926 (muscle_insert_rule_number_table): New.
9927 (prepare_tokens): Output `toknum' as int_table.
9928 (action_row): Returns a rule_number_t.
9929 Use ACTION_MIN, not SHRT_MIN.
9930 (token_actions): yydefact is rule_number_t*.
9931 (table_ninf_remap): New.
9932 (pack_table): Use it for `base' and `table'.
9933 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
9934 replaced with...
9935 (YYPACT_NINF, YYTABLE_NINF): these.
9936 (yypact, yytable): Compute their types instead of hard-coded
9937 `short'.
9938 * tests/regression.at (Web2c Actions): Adjust.
9939
5dde258a
AD
99402002-07-19 Akim Demaille <akim@epita.fr>
9941
9942 * src/scan-gram.l (id): Can start with an underscore.
9943
a945ec39
AD
99442002-07-16 Akim Demaille <akim@epita.fr>
9945
9946 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
9947 Adjust all former `associativity' dependencies.
9948 * src/symtab.c (symbol_new): Default associativity is `undef', not
9949 `right'.
9950 (symbol_check_alias_consistence): Adjust.
9951
fae437e8
AD
99522002-07-09 Akim Demaille <akim@epita.fr>
9953
9954 * doc/bison.texinfo: Properly set the ``header'' part.
9955 Use @dircategory ``GNU programming tools'' as per Texinfo's
9956 documentation.
9957 Use @copying.
9958
1a715ef2
AD
99592002-07-09 Akim Demaille <akim@epita.fr>
9960
9961 * lib/quotearg.h: Protect against multiple inclusions.
9962 * src/location.h (location_t): Add a `file' member.
9963 (LOCATION_RESET, LOCATION_PRINT): Adjust.
9964 * src/complain.c (warn_at, complain_at, fatal_at): Drop
9965 `error_one_per_line' support.
9966
a5d50994
AD
99672002-07-09 Akim Demaille <akim@epita.fr>
9968
9969 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
9970 * src/reader.c (lineno): Remove.
9971 Adjust all dependencies.
9972 (get_merge_function): Take a location and use complain_at.
9973 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
9974 * tests/regression.at (Invalid inputs, Mixing %token styles):
9975 Adjust.
9976
b275314e
AD
99772002-07-09 Akim Demaille <akim@epita.fr>
9978
9979 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
9980 recovery rule, and forbid extensions when --yacc.
9981 (gram_error): Use complain_at.
9982 * src/reader.c (reader): Exit if there were parse errors.
9983
865b9df1
AD
99842002-07-09 Akim Demaille <akim@epita.fr>
9985
9986 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
9987 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
9988 Reported by R Blake <blakers@mac.com>.
9989
c76e14da
AD
99902002-07-09 Akim Demaille <akim@epita.fr>
9991
9992 * data/yacc.c: Output the copyright notive in the header.
9993
7db2ed2d
AD
99942002-07-03 Akim Demaille <akim@epita.fr>
9995
9996 * src/output.c (froms, tos): Are state_number_t.
9997 (save_column): sp, sp1, and sp2 are state_number_t.
9998 (prepare): Rename `final' as `final_state_number', `nnts' as
9999 `nterms_number', `nrules' as `rules_number', `nstates' as
10000 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10001 unused.
10002 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10003 * data/lalr1.cc (nsym_): Remove, unused.
10004
e68e0410
AD
100052002-07-03 Akim Demaille <akim@epita.fr>
10006
10007 * src/lalr.h, src/lalr.c (goto_number_t): New.
10008 * src/lalr.c (goto_list_t): New.
10009 Propagate them.
10010 * src/nullable.c (rule_list_t): New.
10011 Propagate.
10012 * src/types.h: Remove.
10013
e1a4f3a4
AD
100142002-07-03 Akim Demaille <akim@epita.fr>
10015
10016 * src/closure.c (print_fderives): Use rule_rhs_print.
10017 * src/derives.c (print_derives): Use rule_rhs_print.
10018 (rule_list_t): New, replaces `shorts'.
10019 (set_derives): Add comments.
10020 * tests/sets.at (Nullable, Firsts): Adjust.
10021
536545f3
AD
100222002-07-03 Akim Demaille <akim@epita.fr>
10023
10024 * src/output.c (prepare_actions): Free `tally' and `width'.
10025 (prepare_actions): Allocate and free `order'.
10026 * src/symtab.c (symbols_free): Free `symbols'.
10027 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10028 * src/output.c (m4_invoke): Move to...
10029 * src/scan-skel.l: here.
10030 (<<EOF>>): Close yyout, and free its name.
10031
8b752b00
AD
100322002-07-03 Akim Demaille <akim@epita.fr>
10033
10034 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10035
10036 * src/LR0.c (new_state): Merge into...
10037 (state_list_append): this.
10038 (new_states): Merge into...
10039 (generate_states): here.
10040 (set_states): Don't ensure a proper `errs' state member here, do it...
10041 * src/conflicts.c (conflicts_solve): here.
10042 * src/state.h, src/state.c: Comment changes.
10043 (state_t): Rename member `shifts' as `transitions'.
10044 Adjust all dependencies.
10045 (errs_new): For consistency, also take the values as argument.
10046 (errs_dup): Remove.
10047 (state_errs_set): New.
10048 (state_reductions_set, state_transitions_set): Assert that no
10049 previous value was assigned.
10050 (state_free): New.
10051 (states_free): Use it.
10052 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10053 temporary storage: use `errs' and `nerrs' as elsewhere.
10054 (set_conflicts): Allocate and free this `errs'.
10055
613f5e1a
AD
100562002-07-02 Akim Demaille <akim@epita.fr>
10057
10058 * lib/libiberty.h: New.
10059 * lib: Update the bitset implementation from upstream.
10060 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10061 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10062 * src/main.c: Adjust bitset stats calls.
10063
26e0cadc
PE
100642002-07-01 Paul Eggert <eggert@twinsun.com>
10065
10066 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10067 char, so that negative chars don't collide with $.
10068
1154cced
AD
100692002-06-30 Akim Demaille <akim@epita.fr>
10070
10071 Have the GLR tests be `warning' checked, and fix the warnings.
10072
10073 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10074 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10075 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10076 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10077 (yyaddDeferredAction): static.
10078 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10079 (yyreportParseError): yyprefix is const.
10080 yytokenp is used only when verbose.
10081 (yy__GNUC__): Replace with __GNUC__.
10082 (yypdumpstack): yyi is size_t.
10083 (yypreference): Un-yy local variables and arguments, to avoid
10084 clashes with `yyr1'. Anyway, we are not in the user name space.
10085 (yytname_size): be an int, as is compared with ints.
10086 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10087 Use them.
10088 * tests/cxx-gram.at: Use quotation to protect $1.
10089 Use AT_COMPILE to enable warnings hunts.
10090 Prototype yylex and yyerror.
10091 `Use' argc.
10092 Include `string.h', not `strings.h'.
10093 Produce and prototype stmtMerge only when used.
10094 yylex takes a location.
10095
97650f4e
AD
100962002-06-30 Akim Demaille <akim@epita.fr>
10097
10098 We spend a lot of time in quotearg, in particular when --verbose.
10099
10100 * src/symtab.c (symbol_get): Store a quoted version of the key.
10101 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10102 Adjust all callers.
10103
d2576365
AD
101042002-06-30 Akim Demaille <akim@epita.fr>
10105
10106 * src/state.h (reductions_t): Rename member `nreds' as num.
10107 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10108 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10109
ccaf65bc
AD
101102002-06-30 Akim Demaille <akim@epita.fr>
10111
10112 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10113 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10114 (shifts_to): Rename as...
10115 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10116 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10117 (TRANSITION_IS_DISABLED, transitions_to): these.
10118
87675353
AD
101192002-06-30 Akim Demaille <akim@epita.fr>
10120
10121 * src/print.c (print_shifts, print_gotos): Merge into...
10122 (print_transitions): this.
10123 (print_transitions, print_errs, print_reductions): Align the
10124 lookaheads columns.
10125 (print_core, print_transitions, print_errs, print_state,
10126 print_grammar): Output empty lines separator before, not after.
10127 (state_default_rule_compute): Rename as...
10128 (state_default_rule): this.
10129 * tests/conflicts.at (Defaulted Conflicted Reduction),
10130 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10131 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10132
ce4ccb4b
AD
101332002-06-30 Akim Demaille <akim@epita.fr>
10134
10135 Display items as we display rules.
10136
10137 * src/gram.h, src/gram.c (rule_lhs_print): New.
10138 * src/gram.c (grammar_rules_partial_print): Use it.
10139 * src/print.c (print_core): Likewise.
10140 * tests/conflicts.at (Defaulted Conflicted Reduction),
10141 (Unresolved SR Conflicts): Adjust.
10142 (Unresolved SR Conflicts): Adjust and rename as...
10143 (Resolved SR Conflicts): this, as was meant.
10144 * tests/regression.at (Web2c Report): Adjust.
10145
bc933ef1
AD
101462002-06-30 Akim Demaille <akim@epita.fr>
10147
10148 * src/print.c (state_default_rule_compute): New, extracted from...
10149 (print_reductions): here.
10150 Pessimize, but clarify the code.
10151 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10152
53d4308d
AD
101532002-06-30 Akim Demaille <akim@epita.fr>
10154
10155 * src/output.c (action_row): Let default_rule be always a rule
10156 number.
10157
574fb2d5
AD
101582002-06-30 Akim Demaille <akim@epita.fr>
10159
10160 * src/closure.c (print_firsts, print_fderives, closure):
10161 Use BITSET_EXECUTE.
10162 * src/lalr.c (lookaheads_print): Likewise.
10163 * src/state.c (state_rule_lookaheads_print): Likewise.
10164 * src/print_graph.c (print_core): Likewise.
10165 * src/print.c (print_reductions): Likewise.
10166 * src/output.c (action_row): Likewise.
10167 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10168
05811fd7
AD
101692002-06-30 Akim Demaille <akim@epita.fr>
10170
10171 * src/print_graph.c: Use report_flag.
10172
0e4d5753
AD
101732002-06-30 Akim Demaille <akim@epita.fr>
10174
10175 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10176 to...
10177 * src/relation.h, src/relation.c (traverse, relation_digraph)
10178 (relation_print, relation_transpose): New.
10179
24c7d800
AD
101802002-06-30 Akim Demaille <akim@epita.fr>
10181
10182 * src/state.h, src/state.c (shifts_to): New.
10183 * src/lalr.c (build_relations): Use it.
10184
9222837b
AD
101852002-06-30 Akim Demaille <akim@epita.fr>
10186
10187 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10188 (item_number_of_rule_number, rule_number_of_item_number): New.
10189 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10190 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10191 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10192 Propagate their use.
10193 Much remains to be done, in particular wrt `shorts' from types.h.
10194
260008e5
AD
101952002-06-30 Akim Demaille <akim@epita.fr>
10196
10197 * src/symtab.c (symbol_new): Initialize the `printer' member.
10198
8a731ca8
AD
101992002-06-30 Akim Demaille <akim@epita.fr>
10200
10201 * src/LR0.c (save_reductions): Remove, replaced by...
10202 * src/state.h, src/state.c (state_reductions_set): New.
10203 (reductions, errs): Rename as...
10204 (reductions_t, errs_t): these.
10205 Adjust all dependencies.
10206
32e1e0a4
AD
102072002-06-30 Akim Demaille <akim@epita.fr>
10208
10209 * src/LR0.c (state_list_t, state_list_append): New.
10210 (first_state, last_state): Now symbol_list_t.
10211 (this_state): Remove.
10212 (new_itemsets, append_states, save_reductions): Take a state_t as
10213 argument.
10214 (set_states, generate_states): Adjust.
10215 (save_shifts): Remove, replaced by...
10216 * src/state.h, src/state.c (state_shifts_set): New.
10217 (shifts): Rename as...
10218 (shifts_t): this.
10219 Adjust all dependencies.
10220 * src/state.h (state_t): Remove the `next' member.
10221
e5fb6710
AD
102222002-06-30 Akim Demaille <akim@epita.fr>
10223
10224 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10225 escaped in slot 0.
10226
c7ca99d4
AD
102272002-06-30 Akim Demaille <akim@epita.fr>
10228
10229 Use hash.h for the state hash table.
10230
10231 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10232 (allocate_storage): Use state_hash_new.
10233 (free_storage): Use state_hash_free.
10234 (new_state, get_state): Adjust.
10235 * src/lalr.h, src/lalr.c (states): Move to...
10236 * src/states.h (state_t): Remove the `link' member, no longer
10237 used.
10238 * src/states.h, src/states.c: here.
10239 (state_hash_new, state_hash_free, state_hash_lookup)
10240 (state_hash_insert, states_free): New.
10241 * src/states.c (state_table, state_compare, state_hash): New.
10242 * src/output.c (output_actions): Do not free states now, since we
10243 still need to know the final_state number in `prepare', called
10244 afterwards. Do it...
10245 * src/main.c (main): here: call states_free after `output'.
10246
df0e7316
AD
102472002-06-30 Akim Demaille <akim@epita.fr>
10248
10249 * src/state.h, src/state.c (state_new): New, extracted from...
10250 * src/LR0.c (new_state): here.
10251 * src/state.h (STATE_ALLOC): Move to...
10252 * src/state.c: here.
10253 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10254 * src/state.h, src/state.c: here.
10255
39f41916
AD
102562002-06-30 Akim Demaille <akim@epita.fr>
10257
10258 * src/reader.c (gensym): Rename as...
10259 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10260 (getsym): Rename as...
10261 (symbol_get): this.
10262
d57650a5
AD
102632002-06-30 Akim Demaille <akim@epita.fr>
10264
10265 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10266 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10267 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10268 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10269
5a08f1ce
AD
102702002-06-30 Akim Demaille <akim@epita.fr>
10271
10272 Make the test suite pass with warnings checked.
10273
10274 * tests/actions.at (Printers and Destructors): Improve.
10275 Avoid unsigned vs. signed issues.
10276 * tests/calc.at: Don't exercise the scanner here, do it...
10277 * tests/input.at (Torturing the Scanner): here.
10278
720623af
PH
102792002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10280
88e7e941 10281 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
10282 reorganize first lines parallel to yacc.c.
10283
fb8135fa
AD
102842002-06-28 Akim Demaille <akim@epita.fr>
10285
10286 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
10287 (b4_token_enum, b4_token_defines): New, factored from...
10288 * data/lalr1.cc, data/yacc.c, glr.c: here.
10289
41442480
AD
102902002-06-28 Akim Demaille <akim@epita.fr>
10291
10292 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10293 unused variables.
10294 * src/output.c (merger_output): static.
10295
e0e5bf84
AD
102962002-06-28 Akim Demaille <akim@epita.fr>
10297
ba0fe3c7 10298 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
10299 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10300 pacify GCC.
10301 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 10302
676385e2
PH
103032002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10304
10305 Accumulated changelog for new GLR parsing features.
10306
6a254321 10307 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
10308 conflicts_total_count.
10309 * src/conflicts.h: Ditto.
10310 * src/output.c (token_actions): Use the new name.
10311 (output_conflicts): Change conflp => conflict_list_heads, and
10312 confl => conflict_list for better readability.
10313 * data/glr.c: Use the new names.
10314 * NEWS: Add self to GLR announcement.
e0e5bf84 10315
676385e2
PH
10316 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
10317
10318 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
10319 Akim Demaille.
10320
10321 * data/bison.glr: Change name to glr.c
10322 * data/glr.c: Renamed from bison.glr.
10323 * data/Makefile.am: Add glr.c
e0e5bf84
AD
10324
10325 * src/getargs.c:
10326
676385e2 10327 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 10328 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 10329
676385e2
PH
10330 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10331
10332 * data/bison.glr: Be sure to restore the
10333 current #line when returning to the skeleton contents after having
10334 exposed the input file's #line.
10335
10336 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10337
10338 * data/bison.glr: Bring up to date with changes to bison.simple.
10339
10340 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10341
10342 * data/bison.glr: Correct definitions that use b4_prefix.
10343 Various reformatting.
10344 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
10345 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
10346 yytokenp argument; now part of stack.
10347 (yychar): Define to behave as documented.
10348 (yyclearin): Ditto.
e0e5bf84 10349
676385e2
PH
10350 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10351
10352 * src/reader.h: Add declaration for free_merger_functions.
10353
10354 * src/reader.c (merge_functions): New variable.
10355 (get_merge_function): New function.
10356 (free_merger_functions): New function.
10357 (readgram): Check for %prec that is not followed by a symbol.
10358 Handle %dprec and %merge declarations.
10359 (packgram): Initialize dprec and merger fields in rules array.
10360
10361 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
10362 conflict_list_cnt, conflict_list_free): New variables.
10363 (table_grow): Also grow conflict_table.
e0e5bf84 10364 (prepare_rules): Output dprec and merger tables.
676385e2 10365 (conflict_row): New function.
e0e5bf84 10366 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
10367 default reduction in conflicted states for GLR parser so that there
10368 are spaces for the conflict lists.
10369 (save_row): Also save conflict information.
10370 (token_actions): Allocate conflict list.
10371 (merger_output): New function.
10372 (pack_vector): Pack conflict table, too.
10373 (output_conflicts): New function to output yyconflp and yyconfl.
10374 (output_check): Allocate conflict_tos.
10375 (output_actions): Output conflict tables, also.
10376 (output_skeleton): Output b4_mergers definition.
10377 (prepare): Output b4_max_rhs_length definition.
10378 Use 'bison.glr' as default skeleton for GLR parsers.
10379
10380 * src/gram.c (glr_parser): New flag.
10381 (grammar_free): Call free_merger_functions.
10382
10383 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
10384 all pairs of conflicting reductions, rather than just all tokens
10385 causing conflicts. Needed to size conflict tables.
e0e5bf84 10386 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
10387 interface.
10388 (conflicts_print): Ditto.
10389 (count_total_conflicts): New function.
10390
10391 * src/reader.h (merger_list): New type.
10392 (merge_functions): New variable.
10393
10394 * src/lex.h (tok_dprec, tok_merge): New token types.
10395
10396 * src/gram.h (rule_s): Add dprec and merger fields.
10397 (glr_parser): New flag.
10398
10399 * src/conflicts.h (count_total_conflicts): New function.
10400
10401 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
10402
10403 * doc/bison.texinfo (Generalized LR Parsing): New section.
10404 (GLR Parsers): New section.
10405 (Language and Grammar): Mention GLR parsing.
10406 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
10407 Correct typo ("tge" -> "the").
10408
10409 * data/bison.glr: New skeleton for GLR parsing.
10410
10411 * tests/cxx-gram.at: New tests for GLR parsing.
10412
10413 * tests/testsuite.at: Include cxx-gram.at.
10414
10415 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 10416
676385e2
PH
10417 * src/parse-gram.y:
10418
10419 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
10420
10421 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 10422
b5480d74 104232002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
10424
10425 * src/options.h, src/options.c: Remove.
10426 * src/getargs.c (short_options, long_options): New.
10427
60491a94
AD
104282002-06-27 Akim Demaille <akim@epita.fr>
10429
10430 * data/bison.simple, data/bison.c++: Rename as...
10431 * data/yacc.c, data/lalr1.cc: these.
10432 * doc/bison.texinfo (Environment Variables): Remove.
10433
9be0c25b
AD
104342002-06-25 Raja R Harinath <harinath@cs.umn.edu>
10435
10436 * src/getargs.c (report_argmatch): Initialize strtok().
10437
1ae72863
AD
104382002-06-20 Akim Demaille <akim@epita.fr>
10439
10440 * data/bison.simple (b4_symbol_actions): New, replaces...
10441 (b4_symbol_destructor, b4_symbol_printer): these.
10442 (yysymprint): Be sure to call YYPRINT only for tokens, and using
10443 user token numbers.
10444
87542d29
AD
104452002-06-20 Akim Demaille <akim@epita.fr>
10446
10447 * data/bison.simple (yydestructor): Rename as...
10448 (yydestruct): this.
10449
1a31ed21
AD
104502002-06-20 Akim Demaille <akim@epita.fr>
10451
10452 * src/symtab.h, src/symtab.c (symbol_type_set)
10453 (symbol_destructor_set, symbol_precedence_set): The location is
10454 the last argument.
10455 Adjust all callers.
10456
e776192e
AD
104572002-06-20 Akim Demaille <akim@epita.fr>
10458
10459 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
10460 internals.
10461 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
10462 Takes a location.
10463 * src/symtab.h, src/symtab.c (symbol_class_set)
10464 (symbol_user_token_number_set): Likewise.
10465 Adjust all callers.
10466 Promote complain_at.
10467 * tests/input.at (Type Clashes): Adjust.
10468
5c1180b3
AD
104692002-06-20 Akim Demaille <akim@epita.fr>
10470
10471 * data/bison.simple (YYLEX): Fix the declaration when
10472 %pure-parser.
10473
e3170060
AD
104742002-06-20 Akim Demaille <akim@epita.fr>
10475
10476 * data/bison.simple (yysymprint): Don't print the token number,
10477 just its name.
10478 * tests/actions.at (Destructors): Rename as...
10479 (Printers and Destructors): this.
10480 Also exercise %printer.
10481
253862fd
AD
104822002-06-20 Akim Demaille <akim@epita.fr>
10483
10484 * data/bison.simple (YYDSYMPRINT): New.
10485 Use it to remove many of the #if YYDEBUG/if (yydebug).
10486
366eea36
AD
104872002-06-20 Akim Demaille <akim@epita.fr>
10488
10489 * src/symtab.h, src/symtab.c (symbol_t): printer and
10490 printer_location are new members.
10491 (symbol_printer_set): New.
10492 * src/parse-gram.y (PERCENT_PRINTER): New token.
10493 Handle its associated rule.
10494 * src/scan-gram.l: Adjust.
10495 (handle_destructor_at, handle_destructor_dollar): Rename as...
10496 (handle_symbol_code_at, handle_symbol_code_dollar): these.
10497 * src/output.c (symbol_printers_output): New.
10498 (output_skeleton): Call it.
10499 * data/bison.simple (yysymprint): New. Cannot be named yyprint
10500 since there are already many grammar files with a user `yyprint'.
10501 Replace the calls to YYPRINT to calls to yysymprint.
10502 * tests/calc.at: Adjust.
10503 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
10504 taking advantage of parser very internal details (stack size!).
10505
4f25ebb0
AD
105062002-06-20 Akim Demaille <akim@epita.fr>
10507
10508 * src/scan-gram.l: Complete the scanner with the missing patterns
10509 to pacify Flex.
10510 Use `quote' and `symbol_tag_get' where appropriate.
10511
93b68a0e
AD
105122002-06-19 Akim Demaille <akim@epita.fr>
10513
10514 * tests/actions.at (Destructors): Augment to test locations.
10515 * data/bison.simple (yydestructor): Pass it the current location
10516 if locations are enabled.
10517 Prototype only when __STDC__ or C++.
10518 Change the argument names to move into the yy name space: there is
10519 user code here.
10520
58612f1d
AD
105212002-06-19 Akim Demaille <akim@epita.fr>
10522
74310291
AD
10523 * data/bison.simple (b4_pure_if): New.
10524 Use it instead of #ifdef YYPURE.
10525
105262002-06-19 Akim Demaille <akim@epita.fr>
10527
10528 * data/bison.simple (b4_location_if): New.
58612f1d
AD
10529 Use it instead of #ifdef YYLSP_NEEDED.
10530
f25bfb75
AD
105312002-06-19 Akim Demaille <akim@epita.fr>
10532
10533 Prepare @$ in %destructor, but currently don't bind it in the
10534 skeleton, as %location use is not cleaned up yet.
10535
10536 * src/scan-gram.l (handle_dollar, handle_destructor_at)
10537 (handle_action_at): New.
10538 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
10539 a braced_code_t and a location as additional arguments.
10540 (handle_destructor_dollar): Instead of requiring `b4_eval', just
10541 unquote one when outputting `b4_dollar_dollar'.
10542 Adjust callers.
10543 * data/bison.simple (b4_eval): Remove.
10544 (b4_symbol_destructor): Adjust.
10545 * tests/input.at (Invalid @n): Adjust.
10546
c732d2c6
AD
105472002-06-19 Zack Weinberg <zack@codesourcery.com>
10548
10549 * doc/bison.texinfo: Document ability to have multiple
10550 prologue sections.
10551
8c165d89
AD
105522002-06-18 Akim Demaille <akim@epita.fr>
10553
10554 * src/files.c (compute_base_names): When computing the output file
10555 names from the input file name, strip the directory part.
10556
ca98bf57
AD
105572002-06-18 Akim Demaille <akim@epita.fr>
10558
10559 * data/bison.simple.new: Comment changes.
10560 Reported by Andreas Schwab.
10561
0bfb02ff
AD
105622002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
10563
10564 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
10565 there are no `label `yyoverflowlab' defined but not used' warnings
10566 when yyoverflow is defined.
10567
24c0aad7
AD
105682002-06-18 Akim Demaille <akim@epita.fr>
10569
10570 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
10571 new member.
10572 (symbol_destructor_set): Adjust.
10573 * src/output.c (symbol_destructors_output): Output the destructor
10574 locations.
10575 Output the symbol name.
10576 * data/bison.simple (b4_symbol_destructor): Adjust.
10577
5719c109
AD
105782002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
10579 and Akim Demaille <akim@epita.fr>
10580
10581 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
10582 what's left on the stack when the error recovery hits EOF.
10583 * tests/actions.at (Destructors): Complete to exercise this case.
10584
9280d3ef
AD
105852002-06-17 Akim Demaille <akim@epita.fr>
10586
10587 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
10588 arguments is really empty, not only equal to `[]'.
10589 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
10590 member.
10591 (symbol_destructor_set): New.
10592 * src/output.c (symbol_destructors_output): New.
10593 * src/reader.h (brace_code_t, current_braced_code): New.
10594 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
10595 (handle_dollar): Rename as...
10596 (handle_action_dollar): this.
10597 (handle_destructor_dollar): New.
10598 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
10599 (grammar_declaration): Use it.
10600 * data/bison.simple (yystos): Is always defined.
10601 (yydestructor): New.
10602 * tests/actions.at (Destructors): New.
10603 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
10604
dafdc66f
AD
106052002-06-17 Akim Demaille <akim@epita.fr>
10606
10607 * src/symlist.h, src/symlist.c (symbol_list_length): New.
10608 * src/scan-gram.l (handle_dollar, handle_at): Compute the
10609 rule_length only when needed.
10610 * src/output.c (actions_output, token_definitions_output): Output
10611 the full M4 block.
10612 * src/symtab.c: Don't access directly to the symbol tag, use
10613 symbol_tag_get.
10614 * src/parse-gram.y: Use symbol_list_free.
10615
56c47203
AD
106162002-06-17 Akim Demaille <akim@epita.fr>
10617
10618 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
10619 (symbol_list_prepend, get_type_name): Move to...
10620 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
10621 (symbol_list_prepend, symbol_list_n_type_name_get): here.
10622 Adjust all callers.
10623 (symbol_list_free): New.
10624 * src/scan-gram.l (handle_dollar): Takes a location.
10625 * tests/input.at (Invalid $n): Adjust.
10626
1e0bab92
AD
106272002-06-17 Akim Demaille <akim@epita.fr>
10628
10629 * src/reader.h, src/reader.c (symbol_list_new): Export it.
10630 (symbol_list_prepend): New.
10631 * src/parse-gram.y (%union): `list' is a new member.
10632 (symbols.1): New, replaces...
10633 (terms_to_prec.1, nterms_to_type.1): these.
10634 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
10635 Take a location as additional argument.
10636 Adjust all callers.
10637
04e60654
AD
106382002-06-15 Akim Demaille <akim@epita.fr>
10639
10640 * src/parse-gram.y: Move %token in the declaration section so that
10641 we don't depend upon CVS Bison.
10642
10e5b8bd
AD
106432002-06-15 Akim Demaille <akim@epita.fr>
10644
10645 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
10646 * src/print.c (print_core): Use it.
10647
9801d40c
AD
106482002-06-15 Akim Demaille <akim@epita.fr>
10649
10650 * src/conflicts.c (log_resolution): Accept the rule involved in
10651 the sr conflicts instead of the lookahead number that points to
10652 that rule.
10653 (flush_reduce): Accept the current lookahead vector as argument,
10654 instead of the index in LA.
10655 (resolve_sr_conflict): Accept the current number of lookahead
10656 bitset to consider for the STATE, instead of the index in LA.
10657 (set_conflicts): Adjust.
10658 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
10659
c0263492
AD
106602002-06-15 Akim Demaille <akim@epita.fr>
10661
10662 * src/state.h (state_t): Replace the `lookaheadsp' member, a
10663 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
10664 Adjust all dependencies.
10665 * src/lalr.c (initialize_lookaheads): Split into...
10666 (states_lookaheads_count, states_lookaheads_initialize): these.
10667 (lalr): Adjust.
10668
9757c359
AD
106692002-06-15 Akim Demaille <akim@epita.fr>
10670
10671 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
10672 out of...
10673 (grammar_rules_print): here.
10674 * src/reduce.c (reduce_output): Use it.
10675 * tests/reduce.at (Useless Rules, Reduced Automaton)
10676 (Underivable Rules): Adjust.
10677
6b98e4b5
AD
106782002-06-15 Akim Demaille <akim@epita.fr>
10679
10680 Copy BYacc's nice way to report the grammar.
10681
10682 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
10683 New.
10684 Don't print the rules' location, it is confusing and useless.
10685 (rule_print): Use grammar_rhs_print.
10686 * src/print.c (print_grammar): Use grammar_rules_print.
10687
6b98e4b5
AD
106882002-06-15 Akim Demaille <akim@epita.fr>
10689
10690 Complete and rationalize `useless thing' warnings.
10691
10692 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
10693 (symbol_tag_print): New.
10694 Use them everywhere in place of accessing directly the tag member.
10695 * src/gram.h, src/gram.c (rule_print): New.
10696 Use it where a rule used to be printed `by hand'.
10697 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
10698 (reduce_grammar_tables): Report the useless rules.
10699 (reduce_print): Useless things are a warning, not an error.
10700 Report it as such.
10701 * tests/reduce.at (Useless Nonterminals, Useless Rules):
10702 (Reduced Automaton, Underivable Rules): Adjust.
10703 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
10704 * tests/conflicts.at (Unresolved SR Conflicts)
10705 (Solved SR Conflicts): Adjust.
10706
ee000ba4
AD
107072002-06-15 Akim Demaille <akim@epita.fr>
10708
10709 Let symbols have a location.
10710
10711 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
10712 (getsym): Adjust.
10713 Adjust all callers.
10714 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
10715 Use location_t, not int.
10716 * src/symtab.c (symbol_check_defined): Take advantage of the
10717 location.
10718 * tests/regression.at (Invalid inputs): Adjust.
10719
8efe435c
AD
107202002-06-15 Akim Demaille <akim@epita.fr>
10721
10722 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
10723 (input): Don't try to initialize yylloc here, do it in the
10724 scanner.
10725 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
10726 * src/gram.h (rule_t): Change line and action_line into location
10727 and action_location, of location_t type.
10728 Adjust all dependencies.
10729 * src/location.h, src/location.c (empty_location): New.
10730 * src/reader.h, src/reader.c (grammar_start_symbol_set)
10731 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
10732 (grammar_current_rule_symbol_append)
10733 (grammar_current_rule_action_append): Expect a location as argument.
10734 * src/reader.c (grammar_midrule_action): Adjust to attach an
10735 action's location as dummy symbol location.
10736 * src/symtab.h, src/symtab.c (startsymbol_location): New.
10737 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
10738 the line numbers.
10739
1921f1d7
AD
107402002-06-14 Akim Demaille <akim@epita.fr>
10741
10742 Grammar declarations may be found in the grammar section.
10743
10744 * src/parse-gram.y (rules_or_grammar_declaration): New.
10745 (declarations): Each declaration may end with a semicolon, not
10746 just...
10747 (grammar_declaration): `"%union"'.
10748 (grammar): Branch to rules_or_grammar_declaration.
10749
4515534c
AD
107502002-06-14 Akim Demaille <akim@epita.fr>
10751
10752 * src/main.c (main): Invoke scanner_free.
10753
f958596b
AD
107542002-06-14 Akim Demaille <akim@epita.fr>
10755
10756 * src/output.c (m4_invoke): Extracted from...
10757 (output_skeleton): here.
10758 Free tempfile.
10759
2c569025
AD
107602002-06-14 Akim Demaille <akim@epita.fr>
10761
10762 * src/parse-gram.y (directives, directive, gram)
10763 (grammar_directives, precedence_directives, precedence_directive):
10764 Rename as...
10765 (declarations, declaration, grammar, grammar_declaration)
10766 (precedence_declaration, precedence_declarator): these.
10767 (symbol_declaration): New.
10768
592e8d4d
AD
107692002-06-14 Akim Demaille <akim@epita.fr>
10770
10771 * src/files.c (action_obstack): Remove, unused.
10772 (output_obstack): Remove it, and all its dependencies, as it is no
10773 longer needed.
10774 * src/reader.c (epilogue_set): Build the epilogue in the
10775 muscle_obstack.
10776 * src/output.h, src/output.c (muscle_obstack): Move to...
10777 * src/muscle_tab.h, src/muscle_tab.h: here.
10778 (muscle_init): Initialize muscle_obstack.
10779 (muscle_free): New.
10780 * src/main.c (main): Call it.
10781
0c15323d
AD
107822002-06-14 Akim Demaille <akim@epita.fr>
10783
10784 * src/location.h: New, extracted from...
10785 * src/reader.h: here.
10786 * src/Makefile.am (noinst_HEADERS): Merge into
10787 (bison_SOURCES): this.
10788 Add location.h.
10789 * src/parse-gram.y: Use location_t instead of Bison's.
10790 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
10791 Use location_t instead of ints.
10792
e96c9728
AD
107932002-06-14 Akim Demaille <akim@epita.fr>
10794
10795 * data/bison.simple, data/bison.c++: Be sure to restore the
10796 current #line when returning to the skeleton contents after having
10797 exposed the input file's #line.
10798
75d1fe16
AD
107992002-06-12 Akim Demaille <akim@epita.fr>
10800
10801 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
10802 eager.
10803 * tests/actions.at (Exotic Dollars): New.
10804
6c35d22c
AD
108052002-06-12 Akim Demaille <akim@epita.fr>
10806
10807 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
10808 ['"/] too eagerly.
10809 * tests/input.at (Torturing the Scanner): New.
10810
1d6412ad
AD
108112002-06-11 Akim Demaille <akim@epita.fr>
10812
10813 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
10814 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
10815 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
10816 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
10817 * src/reader.c (reader): Use it.
10818
4cdb01db
AD
108192002-06-11 Akim Demaille <akim@epita.fr>
10820
10821 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
10822 Adjust all callers.
10823 (scanner_last_string_free): New.
10824
44995b2e
AD
108252002-06-11 Akim Demaille <akim@epita.fr>
10826
10827 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
10828 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
10829 (last_string, YY_OBS_FREE): New.
10830 Use them when returning an ID.
10831
e9955c83
AD
108322002-06-11 Akim Demaille <akim@epita.fr>
10833
10834 Have Bison grammars parsed by a Bison grammar.
10835
10836 * src/reader.c, src/reader.h (prologue_augment): New.
10837 * src/reader.c (copy_definition): Remove.
10838
10839 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
10840 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
10841 (grammar_current_rule_prec_set, grammar_current_rule_check)
10842 (grammar_current_rule_symbol_append)
10843 (grammar_current_rule_action_append): Export.
10844 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
10845 (symbol_list_action_append): Remove.
10846 Hook the routines from reader.
10847 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
10848 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
10849
10850 * src/reader.c (read_declarations): Remove, unused.
10851
10852 * src/parse-gram.y: Handle the epilogue.
10853 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
10854 (grammar_start_symbol_set): this.
10855 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
10856 * src/reader.c (readgram): Remove, unused.
10857 (reader): Adjust to insert eoftoken and axiom where appropriate.
10858
10859 * src/reader.c (copy_dollar): Replace with...
10860 * src/scan-gram.h (handle_dollar): this.
10861 * src/parse-gram.y: Remove `%thong'.
10862
10863 * src/reader.c (copy_at): Replace with...
10864 * src/scan-gram.h (handle_at): this.
10865
10866 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
10867 New.
10868
10869 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
10870 time being.
10871
10872 * src/reader.h, src/reader.c (grammar_rule_end): New.
10873
10874 * src/parse.y (current_type, current_class): New.
10875 Implement `%nterm', `%token' support.
10876 Merge `%term' into `%token'.
10877 (string_as_id): New.
10878 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
10879 type name.
10880
10881 * src/parse-gram.y: Be sure to handle properly the beginning of
10882 rules.
10883
10884 * src/parse-gram.y: Handle %type.
10885 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
10886
10887 * src/parse-gram.y: More directives support.
10888 * src/options.c: No longer handle source directives.
10889
10890 * src/parse-gram.y: Fix %output.
10891
10892 * src/parse-gram.y: Handle %union.
10893 Use the prologue locations.
10894 * src/reader.c (parse_union_decl): Remove.
10895
10896 * src/reader.h, src/reader.c (epilogue_set): New.
10897 * src/parse-gram.y: Use it.
10898
10899 * data/bison.simple, data/bison.c++: b4_stype is now either not
10900 defined, then default to int, or to the contents of %union,
10901 without `union' itself.
10902 Adjust.
10903 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
10904
10905 * src/output.c (actions_output): Don't output braces, as they are
10906 already handled by the scanner.
10907
10908 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
10909 characters to themselves.
10910
10911 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
10912 that the epilogue has a proper #line.
10913
10914 * src/parse-gram.y: Handle precedence/associativity.
10915
10916 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
10917 a terminal.
10918 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
10919 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
10920 at all to define terminals that cannot be emitted.
10921
10922 * src/scan-gram.l: Escape M4 characters.
10923
10924 * src/scan-gram.l: Working properly with escapes in user
10925 strings/characters.
10926
10927 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
10928 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
10929 grammar.
10930 Use more modest sizes, as for the time being the parser does not
10931 release memory, and therefore the process swallows a huge amount
10932 of memory.
10933
10934 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
10935 stricter %token grammar.
10936
10937 * src/symtab.h (associativity): Add `undef_assoc'.
10938 (symbol_precedence_set): Do nothing when passed an undef_assoc.
10939 * src/symtab.c (symbol_check_alias_consistence): Adjust.
10940
10941 * tests/regression.at (Invalid %directive): Remove, as it is now
10942 meaningless.
10943 (Invalid inputs): Adjust to the new error messages.
10944 (Token definitions): The new grammar doesn't allow too many
10945 eccentricities.
10946
10947 * src/lex.h, src/lex.c: Remove.
10948 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
10949 (copy_character, copy_string2, copy_string, copy_identifier)
10950 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
10951 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
10952 (parse_action): Remove.
10953 * po/POTFILES.in: Adjust.
10954
2e047461
AD
109552002-06-11 Akim Demaille <akim@epita.fr>
10956
cd05d13c 10957 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
10958 rule's action member: return the action as a string.
10959 Don't require `rule_length' as an argument: compute it.
10960 (grammar_current_rule_symbol_append)
10961 (grammar_current_rule_action_append): New, eved out from
10962 (readgram): here.
10963 Remove `action_flag', `rulelength', unused now.
10964
9af3fbce
AD
109652002-06-11 Akim Demaille <akim@epita.fr>
10966
10967 * src/reader.c (grammar_current_rule_prec_set).
10968 (grammar_current_rule_check): New, eved out from...
10969 (readgram): here.
10970 Remove `xaction', `first_rhs': useless.
10971 * tests/input.at (Type clashes): New.
10972 * tests/existing.at (GNU Cim Grammar): Adjust.
10973
1485e106
AD
109742002-06-11 Akim Demaille <akim@epita.fr>
10975
10976 * src/reader.c (grammar_midrule_action): New, Eved out from
10977 (readgram): here.
10978
da4160c3
AD
109792002-06-11 Akim Demaille <akim@epita.fr>
10980
10981 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
10982 New.
10983 (readgram): Use them as replacement of inlined code, crule and
10984 crule1.
10985
f6d0f937
AD
109862002-06-11 Akim Demaille <akim@epita.fr>
10987
10988 * src/reader.c (grammar_end, grammar_symbol_append): New.
10989 (readgram): Use them.
10990 Make the use of `p' as local as possible.
10991
69078d4b
AD
109922002-06-10 Akim Demaille <akim@epita.fr>
10993
10994 GCJ's parser requires the tokens to be defined before the prologue.
10995
10996 * data/bison.simple: Output the token definition before the user's
10997 prologue.
10998 * tests/regression.at (Braces parsing, Duplicate string)
10999 (Mixing %token styles): Check the output from bison.
11000 (Early token definitions): New.
11001
5e424082
AD
110022002-06-10 Akim Demaille <akim@epita.fr>
11003
11004 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11005 assigning twice the same user number to a token, so that we can
11006 use it in...
11007 * src/lex.c (lex): here.
11008 Also use `symbol_class_set' instead of hand written code.
11009 * src/reader.c (parse_assoc_decl): Likewise.
11010
44536b35
AD
110112002-06-10 Akim Demaille <akim@epita.fr>
11012
11013 * src/symtab.c, src/symtab.c (symbol_class_set)
11014 (symbol_user_token_number_set): New.
11015 * src/reader.c (parse_token_decl): Use them.
11016 Use a switch instead of ifs.
11017 Use a single argument.
11018
8b9f2372
AD
110192002-06-10 Akim Demaille <akim@epita.fr>
11020
11021 Remove `%thong' support as it is undocumented, unused, duplicates
11022 `%token's job, and creates useless e-mail traffic with people who
11023 want to know what it is, why it is undocumented, unused, and
11024 duplicates `%token's job.
11025
11026 * src/reader.c (parse_thong_decl): Remove.
11027 * src/options.c (option_table): Remove "thong".
11028 * src/lex.h (tok_thong): Remove.
11029
3ae2b51f
AD
110302002-06-10 Akim Demaille <akim@epita.fr>
11031
11032 * src/symtab.c, src/symtab.c (symbol_type_set)
11033 (symbol_precedence_set): New.
11034 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11035 (value_components_used): Remove, unused.
11036
2f1afb73
AD
110372002-06-09 Akim Demaille <akim@epita.fr>
11038
11039 Move symbols handling code out of the reader.
11040
11041 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11042 (axiom): Move to...
11043 * src/symtab.h, src/symtab.c: here.
11044
11045 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11046 * src/reader.c (startval): Rename as...
11047 * src/symtab.h, src/symtab.c (startsymbol): this.
11048 * src/reader.c: Adjust.
11049
11050 * src/reader.c (symbol_check_defined, symbol_make_alias)
11051 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11052 (token_translations_init)
11053 Move to...
11054 * src/symtab.c: here.
11055 * src/reader.c (packsymbols): Move to...
11056 * src/symtab.h, src/symtab.c (symbols_pack): here.
11057 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11058 argument.
11059
e9bca3ad
AD
110602002-06-03 Akim Demaille <akim@epita.fr>
11061
11062 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11063 then statements.
11064
86eff183
AD
110652002-06-03 Akim Demaille <akim@epita.fr>
11066
11067 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11068 structs with non literals.
11069 * src/scan-skel.l: never-interactive.
11070 * src/conflicts.c (enum conflict_resolution_e): No trailing
11071 comma.
11072 * src/getargs.c (usage): Split long literal strings.
11073 Reported by Hans Aberg.
11074
717be197
AD
110752002-05-28 Akim Demaille <akim@epita.fr>
11076
11077 * data/bison.c++: Use C++ ostreams.
11078 (cdebug_): New member.
11079
670ddffd
AD
110802002-05-28 Akim Demaille <akim@epita.fr>
11081
11082 * src/output.c (output_skeleton): Be sure to allocate enough room
11083 for `/' _and_ for `\0' in full_skeleton.
11084
769b430f
AD
110852002-05-28 Akim Demaille <akim@epita.fr>
11086
11087 * data/bison.c++: Catch up with bison.simple:
11088 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11089 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11090 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11091 and popping traces.
11092
7067cb36
PH
110932002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11094
11095 * src/output.c (output_skeleton): Put an explicit path in front of
11096 the skeleton file name, rather than relying on the -I directory,
11097 to partially alleviate effects of having a skeleton file lying around
11098 in the current directory.
769b430f 11099
4a713ec2
PH
111002002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11101
769b430f 11102 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
11103 obstack_printf should be obstack_fgrow1.
11104
b408954b
AD
111052002-05-26 Akim Demaille <akim@epita.fr>
11106
11107 * src/state.h (state_t): `solved_conflicts' is a new member.
11108 * src/LR0.c (new_state): Set it to 0.
11109 * src/conflicts.h, src/conflicts.c (print_conflicts)
11110 (free_conflicts, solve_conflicts): Rename as...
11111 (conflicts_print, conflicts_free, conflicts_solve): these.
11112 Adjust callers.
11113 * src/conflicts.c (enum conflict_resolution_e)
11114 (solved_conflicts_obstack): New, used by...
11115 (log_resolution): this.
11116 Adjust to attach the conflict resolution to each state.
11117 Complete the description with the precedence/associativity
11118 information.
11119 (resolve_sr_conflict): Adjust.
11120 * src/print.c (print_state): Output its solved_conflicts.
11121 * tests/conflicts.at (Unresolved SR Conflicts)
11122 (Solved SR Conflicts): Exercise --report=all.
11123
a49aecd5
AD
111242002-05-26 Akim Demaille <akim@epita.fr>
11125
11126 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11127 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11128 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11129 (token_number_t, item_number_as_token_number)
11130 (token_number_as_item_number, muscle_insert_token_number_table):
11131 Rename as...
11132 (symbol_number_t, item_number_as_symbol_number)
11133 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11134 these, since it is more appropriate.
11135
5504898e
AD
111362002-05-26 Akim Demaille <akim@epita.fr>
11137
11138 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11139 `Error:' lines.
11140 * data/bison.simple (yystos) [YYDEBUG]: New.
11141 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11142 error recovery.
11143 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11144
ec3bc396
AD
111452002-05-25 Akim Demaille <akim@epita.fr>
11146
11147 * doc/bison.texinfo (Debugging): Split into...
11148 (Tracing): this new section, its former contents, and...
11149 (Understanding): this new section.
11150 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11151 by...
11152 (report_flag): this.
11153 Adjust all dependencies.
11154 (report_args, report_types, report_argmatch): New.
11155 (usage, getargs): Report/support -r, --report.
11156 * src/options.h
11157 (struct option_table_struct): Rename as..,
11158 (struct option_table_s): this.
11159 Rename the `set_flag' member to `flag' to match with getopt_long's
11160 struct.
11161 * src/options.c (option_table): Split verbose into an entry for
11162 %verbose, and another for --verbose.
11163 Support --report/-r, so remove -r from the obsolete --raw.
11164 * src/print.c: Attach full item sets and lookaheads reports to
11165 report_flag instead of trace_flag.
11166 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11167
78df8250
PE
111682002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11169 and Paul Eggert <eggert@twinsun.com>
769b430f 11170
78df8250
PE
11171 * data/bison.simple (yyparse): Correct error handling to conform to
11172 POSIX and yacc. Specifically, after syntax error is discovered,
11173 do not reduce further before shifting the error token.
11174 Clean up the code a bit by removing the labels yyerrdefault,
11175 yyerrhandle, yyerrpop.
11176 * NEWS: Document the above.
11177
c0c9ea05
PH
111782002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11179
11180 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11181 type; it isn't always big enough, since it doesn't necessarily
11182 include non-terminals.
769b430f 11183 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
11184 the latter can be removed.
11185 (yy_token_number_type): Remove, only one use.
11186 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11187 don't use TokenNumberType as element type.
769b430f 11188
c0c9ea05
PH
11189 * tests/regression.at: Modify expected output to agree with change
11190 to yyr1 and yytranslate.
769b430f 11191
6390a83f
FK
111922002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11193
11194 * src/reader.c (parse_action): Use copy_character instead of
11195 obstack_1grow.
11196
db7c8e9a
AD
111972002-05-13 Akim Demaille <akim@epita.fr>
11198
11199 * tests/regression.at (Token definitions): Prototype yylex and
11200 yyerror.
11201
fcc61800
PH
112022002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11203
158c687b 11204 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
11205 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11206 32-bit arithmetic.
11207 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11208
5683e9b2
AD
112092002-05-07 Akim Demaille <akim@epita.fr>
11210
11211 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11212 avoid GCC warnings.
11213
0c2d3f4c
AD
112142002-05-07 Akim Demaille <akim@epita.fr>
11215
11216 Kill GCC warnings.
11217
11218 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11219 over the RHS of each rule.
11220 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11221 * src/state.h (state_t): Member `nitems' is unsigned short.
11222 * src/LR0.c (get_state): Adjust.
11223 * src/reader.c (packgram): Likewise.
11224 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11225 `Type'.
11226 (muscle_insert_int_table): Remove, unused.
11227 (prepare_rules): Remove `max'.
11228
1565b720
AD
112292002-05-06 Akim Demaille <akim@epita.fr>
11230
11231 * src/closure.c (print_firsts): Display of the symbol tags.
11232 (bitmatrix_print): Move to...
11233 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11234 here.
11235 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11236
cfaee611
AD
112372002-05-06 Akim Demaille <akim@epita.fr>
11238
11239 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11240 hash_do_for_each.
11241
458be8e0
AD
112422002-05-06 Akim Demaille <akim@epita.fr>
11243
11244 * src/LR0.c (new_state, get_state): Instead of using the global
11245 `kernel_size' and `kernel_base', have two new arguments:
11246 `core_size' and `core'.
11247 Adjust callers.
11248
a900a624
AD
112492002-05-06 Akim Demaille <akim@epita.fr>
11250
11251 * src/reader.c (packgram): No longer end `ritem' with a 0
11252 sentinel: it is not used.
11253
d4e7d3a1
AD
112542002-05-05 Akim Demaille <akim@epita.fr>
11255
11256 New experimental feature: display the lookaheads in the report and
11257 graph.
11258
11259 * src/print (print_core): When --trace-flag, display the rules
11260 lookaheads.
11261 * src/print_graph.c (print_core): Likewise.
11262 Swap the arguments.
11263 Adjust caller.
11264
39ceb25b
AD
112652002-05-05 Akim Demaille <akim@epita.fr>
11266
11267 * tests/torture.at (Many lookaheads): New test.
11268
5372019f
AD
112692002-05-05 Akim Demaille <akim@epita.fr>
11270
11271 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11272 (GENERATE_MUSCLE_INSERT_TABLE): this.
11273 (output_int_table, output_unsigned_int_table, output_short_table)
11274 (output_token_number_table, output_item_number_table): Replace with...
11275 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
11276 (muscle_insert_short_table, muscle_insert_token_number_table)
11277 (muscle_insert_item_number_table): these.
11278 Adjust all callers.
11279 (prepare_tokens): Don't free `translations', since...
11280 * src/reader.h, src/reader.c (grammar_free): do it.
11281 Move to...
11282 * src/gram.h, src/gram.c (grammar_free): here.
11283 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11284 b4_translate_max.
11285
5df5f6d5
AD
112862002-05-05 Akim Demaille <akim@epita.fr>
11287
11288 * src/output.c (output_unsigned_int_table): New.
11289 (prepare_rules): `i' is unsigned.
11290 `prhs', `rline', `r2' are unsigned int.
11291 Rename muscle `rhs_number_max' as `rhs_max'.
11292 Output muscles `prhs_max', `rline_max', and `r2_max'.
11293 Free rline and r1.
11294 * data/bison.simple, data/bison.c++: Adjust to use these muscles
11295 to compute types instead of constant types.
11296 * tests/regression.at (Web2c Actions): Adjust.
11297
b87f8b21
AD
112982002-05-04 Akim Demaille <akim@epita.fr>
11299
11300 * src/symtab.h (SALIAS, SUNDEF): Rename as...
11301 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
11302 Adjust dependencies.
11303 * src/output.c (token_definitions_output): Be sure not to output a
11304 `#define 'a'' when fed with `%token 'a' "a"'.
11305 * tests/regression.at (Token definitions): New.
11306
8bb936e4
PE
113072002-05-03 Paul Eggert <eggert@twinsun.com>
11308
11309 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11310 for K&R C.
11311
113122002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11313
11314 * Makefile.am (SUBDIRS): Remove intl.
11315 (EXTRA_DIST): Add config/config.rpath.
11316
53c71a12
AD
113172002-05-03 Akim Demaille <akim@epita.fr>
11318
11319 * data/bison.simple (m4_if): Don't output empty enums.
11320 And actually, output valid enum definitions :(.
11321
289dd0cf
AD
113222002-05-03 Akim Demaille <akim@epita.fr>
11323
11324 * configure.bat: Remove, completely obsolete.
11325 * Makefile.am (EXTRA_DIST): Adjust.
11326 Don't distribute config.rpath...
11327 * config/Makefile.am (EXTRA_DIST): Do it.
11328
db85e524
AD
113292002-05-03 Akim Demaille <akim@epita.fr>
11330
11331 * configure.in (GETTEXT_VERSION): New.
11332 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
11333
83ccf991
AD
113342002-05-03 Akim Demaille <akim@epita.fr>
11335
11336 * data/bison.simple (b4_token_enum): New.
11337 (b4_token_defines): Use it to output tokens both as #define and
11338 enums.
11339 Suggested by Paul Eggert.
11340 * src/output.c (token_definitions_output): Don't output spurious
11341 white spaces.
11342
1f418995
AD
113432002-05-03 Akim Demaille <akim@epita.fr>
11344
11345 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11346
45119f04
RA
113472002-05-02 Robert Anisko <robert@lrde.epita.fr>
11348
11349 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
11350 Update the stack class, give a try to deque as the default container.
11351
b2d52318
AD
113522002-05-02 Akim Demaille <akim@epita.fr>
11353
11354 * data/bison.simple (yyparse): Do not implement @$ = @1.
11355 (YYLLOC_DEFAULT): Adjust to do it.
11356 * doc/bison.texinfo (Location Default Action): Fix.
11357
3a8b4109
AD
113582002-05-02 Akim Demaille <akim@epita.fr>
11359
11360 * src/reader.c (parse_braces): Merge into...
11361 (parse_action): this.
11362
84614e13
AD
113632002-05-02 Akim Demaille <akim@epita.fr>
11364
11365 * configure.in (ALL_LINGUAS): Remove.
11366 * po/LINGUAS, hr.po: New.
11367
fdbcd8e2
AD
113682002-05-02 Akim Demaille <akim@epita.fr>
11369
11370 Remove the so called hairy (semantic) parsers.
11371
11372 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
11373 * src/gram.h, src/gram.c (semantic_parser): Remove.
11374 (rule_t): Remove the guard and guard_line members.
11375 * src/lex.h (token_t): remove tok_guard.
11376 * src/options.c (option_table): Remove %guard and %semantic_parser
11377 support.
11378 * src/output.c, src/output.h (guards_output): Remove.
11379 (prepare): Adjust.
11380 (token_definitions_output): Don't output the `T'
11381 tokens (???).
11382 (output_skeleton): Don't output the guards.
11383 * src/files.c, src/files.c (attrsfile): Remove.
11384 * src/reader.c (symbol_list): Remove the guard and guard_line
11385 members.
11386 Adjust dependencies.
11387 (parse_guard): Remove.
11388 * data/bison.hairy: Remove.
11389 * doc/bison.texinfo (Environment Variables): Remove occurrences of
11390 BISON_HAIRY.
11391
82b6cb3f
AD
113922002-05-02 Akim Demaille <akim@epita.fr>
11393
11394 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
11395 (parse_guard): Rename the formal argument `stack_offset' as
11396 `rule_length', which is more readable.
11397 Adjust callers.
11398 (copy_at, copy_dollar): Instead of outputting the hard coded
11399 values of $$, $n and so forth, output invocation to b4_lhs_value,
11400 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
11401 Note: this patch partially drops `semantic-parser' support: it
11402 always does `rule_length - n', where semantic parsers ought to
11403 always use `-n'.
82b6cb3f
AD
11404 * data/bison.simple, data/bison.c++ (b4_lhs_value)
11405 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
11406
6cbfbcc5
AD
114072002-05-02 Akim Demaille <akim@epita.fr>
11408
11409 * configure.in (AC_INIT): Bump to 1.49b.
11410 (AM_INIT_AUTOMAKE): Short invocation.
11411
b8548114
AD
114122002-05-02 Akim Demaille <akim@epita.fr>
11413
11414 Version 1.49a.
11415
c20cd1fa
AD
114162002-05-01 Akim Demaille <akim@epita.fr>
11417
11418 * src/skeleton.h: Remove.
11419
8a9566d4
AD
114202002-05-01 Akim Demaille <akim@epita.fr>
11421
11422 * src/skeleton.h: Fix the #endif.
11423 Reported by Magnus Fromreide.
11424
8c6d399a
PE
114252002-04-26 Paul Eggert <eggert@twinsun.com>
11426
11427 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
11428 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 11429 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 11430
2b7ed18a
RA
114312002-04-25 Robert Anisko <robert@lrde.epita.fr>
11432
11433 * src/scan-skel.l: Postprocess quadrigraphs.
11434
11435 * src/reader.c (copy_character): New function, used to output
11436 single characters while replacing `[' and `]' with quadrigraphs, to
11437 avoid troubles with M4 quotes.
11438 (copy_comment): Output characters with copy_character.
11439 (read_additionnal_code): Likewise.
11440 (copy_string2): Likewise.
11441 (copy_definition): Likewise.
11442
11443 * tests/calc.at: Exercise M4 quoting.
11444
34a89c50
AD
114452002-04-25 Akim Demaille <akim@epita.fr>
11446
11447 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
11448 between `!' and the command.
11449 Reported by Paul Eggert.
11450
0dd1580a
RA
114512002-04-24 Robert Anisko <robert@lrde.epita.fr>
11452
11453 * tests/calc.at: Exercise prologue splitting.
11454
11455 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
11456 `b4_post_prologue' instead of `b4_prologue'.
11457
11458 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
11459 muscles.
11460 (output): Free pre_prologue_obstack and post_prologue_obstack.
11461 * src/files.h, src/files.c (attrs_obstack): Remove.
11462 (pre_prologue_obstack, post_prologue_obstack): New.
11463 * src/reader.c (copy_definition): Add a parameter to specify the
11464 obstack to fill, instead of using attrs_obstack unconditionally.
11465 (read_declarations): Pass pre_prologue_obstack to copy_definition if
11466 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
11467
83c1796f
PE
114682002-04-23 Paul Eggert <eggert@twinsun.com>
11469
11470 * data/bison.simple: Remove unnecessary commentary and white
11471 space differences from 1_29-branch.
11472 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
11473
11474 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
11475 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
11476 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
11477 constructors or destructors.
11478
11479 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
11480
1207eeac
AD
114812002-04-23 Akim Demaille <akim@epita.fr>
11482
11483 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
11484 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
11485 location with columns.
11486 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
11487 All reported by Paul Eggert.
11488
78ab8f67
AD
114892002-04-22 Akim Demaille <akim@epita.fr>
11490
11491 * src/reduce.c (dump_grammar): Move to...
11492 * src/gram.h, src/gram.c (grammar_dump): here.
11493 Be sure to separate long item numbers.
11494 Don't read the members of a rule's prec if its nil.
11495
133c20e2
AD
114962002-04-22 Akim Demaille <akim@epita.fr>
11497
11498 * src/output.c (table_size, table_grow): New.
11499 (MAXTABLE): Remove, replace uses with table_size.
11500 (pack_vector): Instead of dying when the table is too big, grow it.
11501
9515e8a7
AD
115022002-04-22 Akim Demaille <akim@epita.fr>
11503
11504 * data/bison.simple (yyr1): Its type is that of a token number.
11505 * data/bison.c++ (r1_): Likewise.
11506 * tests/regression.at (Web2c Actions): Adjust.
11507
23c5a174
AD
115082002-04-22 Akim Demaille <akim@epita.fr>
11509
11510 * src/reader.c (token_translations_init): 256 is now the default
11511 value for the error token, i.e., it will be assigned another
11512 number if the user assigned 256 to one of her tokens.
11513 (reader): Don't force 256 to error.
11514 * doc/bison.texinfo (Symbols): Adjust.
11515 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
11516 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
11517 etc. instead of 10, 20, 30 (which was used to `jump' over error
11518 (256) and undefined (2)).
11519
5fbb0954
AD
115202002-04-22 Akim Demaille <akim@epita.fr>
11521
11522 Propagate more token_number_t.
11523
11524 * src/gram.h (token_number_as_item_number)
11525 (item_number_as_token_number): New.
11526 * src/output.c (GENERATE_OUTPUT_TABLE): New.
11527 Use it to create output_item_number_table and
11528 output_token_number_table.
11529 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11530 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
11531 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
11532 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
11533
4f940944
AD
115342002-04-22 Akim Demaille <akim@epita.fr>
11535
11536 * src/output.h, src/output.c (get_lines_number): Remove.
11537
3ded9a63
AD
115382002-04-19 Akim Demaille <akim@epita.fr>
11539
11540 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
11541 as Lex/Flex'.
11542 (Debugging): More details about enabling the debugging features.
11543 (Table of Symbols): Describe $$, $n, @$, and @n.
11544 Suggested by Tim Josling.
11545
e0c471a9
AD
115462002-04-19 Akim Demaille <akim@epita.fr>
11547
11548 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
11549
fecc10cd
AD
115502002-04-10 Akim Demaille <akim@epita.fr>
11551
11552 * src/system.h: Rely on HAVE_LIMITS_H.
11553 Suggested by Paul Eggert.
11554
51dec47b
AD
115552002-04-09 Akim Demaille <akim@epita.fr>
11556
11557 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
11558 full stderr, and strip it according to the bison options, instead
11559 of composing the error message from different bits.
11560 This makes it easier to check for several error messages.
11561 Adjust all the invocations.
11562 Add an invocation exercising the error token.
11563 Add an invocation demonstrating a stupid error message.
11564 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
11565 Adjust the tests.
11566 Error message are for stderr, not stdout.
11567
007a50a4
AD
115682002-04-09 Akim Demaille <akim@epita.fr>
11569
11570 * src/gram.h, src/gram.c (error_token_number): Remove, use
11571 errtoken->number.
11572 * src/reader.c (reader): Don't specify the user token number (2)
11573 for $undefined, as it uselessly prevents using it.
11574 * src/gram.h (token_number_t): Move to...
11575 * src/symtab.h: here.
11576 (state_t.number): Is a token_number_t.
11577 * src/print.c, src/reader.c: Use undeftoken->number instead of
11578 hard coded 2.
11579 (Even though this 2 is not the same as above: the number of the
11580 undeftoken remains being 2, it is its user token number which
11581 might not be 2).
11582 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
11583 `user_token_number_max'.
11584 Output `undef_token_number'.
11585 * data/bison.simple, data/bison.c++: Use them.
11586 Be sure to map invalid yylex return values to
11587 `undef_token_number'. This saves us from gratuitous SEGV.
11588
11589 * tests/conflicts.at (Solved SR Conflicts)
11590 (Unresolved SR Conflicts): Adjust.
11591 * tests/regression.at (Web2c Actions): Adjust.
11592
06446ccf
AD
115932002-04-08 Akim Demaille <akim@epita.fr>
11594
11595 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
11596 Adding #line.
11597 Remove the duplicate `typedefs'.
11598 (RhsNumberType): Fix the declaration and various other typos.
11599 Use __ofile__.
11600 * data/bison.simple: Use __ofile__.
11601 * src/scan-skel.l: Handle __ofile__.
11602
62a3e4f0
AD
116032002-04-08 Akim Demaille <akim@epita.fr>
11604
11605 * src/gram.h (item_number_t): New, the type of item numbers in
11606 RITEM. Note that it must be able to code symbol numbers as
11607 positive number, and the negation of rule numbers as negative
11608 numbers.
11609 Adjust all dependencies (pretty many).
11610 * src/reduce.c (rule): Remove this `short *' pointer: use
11611 item_number_t.
11612 * src/system.h (MINSHORT, MAXSHORT): Remove.
11613 Include `limits.h'.
11614 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
11615 (shortcpy): Remove.
11616 (MAXTABLE): Move to...
11617 * src/output.c (MAXTABLE): here.
11618 (prepare_rules): Use output_int_table to output rhs.
11619 * data/bison.simple, data/bison.c++: Adjust.
11620 * tests/torture.at (Big triangle): Move the limit from 254 to
11621 500.
11622 * tests/regression.at (Web2c Actions): Ajust.
11623
11624 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
11625 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
11626 passes, but produces negative #line number, once fixed, GCC is
11627 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
11628 C), it passes.
11629 * src/state.h (state_h): Code input lines on ints, not shorts.
11630
bb88b0fc
AD
116312002-04-08 Akim Demaille <akim@epita.fr>
11632
11633 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
11634 and then the grammar.
11635
9a636f47
AD
116362002-04-08 Akim Demaille <akim@epita.fr>
11637
11638 * src/system.h: No longer using strndup.
11639
680e8701
AD
116402002-04-07 Akim Demaille <akim@epita.fr>
11641
11642 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
11643 * src/output.c (output_table_data): Return the longest number.
11644 (prepare_tokens): Output `token_number_max').
11645 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
11646 New.
11647 Use them to define yy_token_number_type/TokenNumberType.
11648 Use this type for yytranslate.
11649 * tests/torture.at (Big triangle): Push the limit from 124 to
11650 253.
11651 * tests/regression.at (Web2c Actions): Adjust.
11652
817e9f41
AD
116532002-04-07 Akim Demaille <akim@epita.fr>
11654
11655 * tests/torture.at (Big triangle): New.
11656 (GNU AWK Grammar, GNU Cim Grammar): Move to...
11657 * tests/existing.at: here.
11658
5123689b
AD
116592002-04-07 Akim Demaille <akim@epita.fr>
11660
11661 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
11662 nritems.
11663 Adjust dependencies.
11664
f3849179
AD
116652002-04-07 Akim Demaille <akim@epita.fr>
11666
11667 * src/reader.c: Normalize increments to prefix form.
11668
bd02036a
AD
116692002-04-07 Akim Demaille <akim@epita.fr>
11670
11671 * src/reader.c, symtab.c: Remove debugging code.
11672
db8837cb
AD
116732002-04-07 Akim Demaille <akim@epita.fr>
11674
11675 Rename all the `bucket's as `symbol_t'.
11676
11677 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
11678 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
11679 * src/symtab.c, src/symtab.h (bucket): Rename as...
11680 (symbol_t): this.
11681 (symbol_list_new, bucket_check_defined, bucket_make_alias)
11682 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
11683 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11684 (buckets_new, buckets_free, buckets_do): Rename as...
11685 (symbol_list_new, symbol_check_defined, symbol_make_alias)
11686 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11687 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
11688 (symbols_new, symbols_free, symbols_do): these.
11689
72a23c97
AD
116902002-04-07 Akim Demaille <akim@epita.fr>
11691
11692 Use lib/hash for the symbol table.
11693
11694 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
11695 EOF.
11696 * src/lex.c (lex): Set the `number' member of new terminals.
11697 * src/reader.c (bucket_check_defined, bucket_make_alias)
11698 (bucket_check_alias_consistence, bucket_translation): New.
11699 (reader, grammar_free, readgram, token_translations_init)
11700 (packsymbols): Adjust.
11701 (reader): Number the predefined tokens.
11702 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
11703 for predefined tokens.
11704 * src/symtab.h (bucket): Remove all the hash table related
11705 members.
11706 * src/symtab.c (symtab): Replace by...
11707 (bucket_table): this.
11708 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11709 (buckets_new, buckets_do): New.
11710
280a38c3
AD
117112002-04-07 Akim Demaille <akim@epita.fr>
11712
11713 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
11714 (start_symbol, max_user_token_number, semantic_parser)
11715 (error_token_number): Initialize.
11716 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
11717 Initialize.
11718 (reader): Don't.
11719 (errtoken, eoftoken, undeftoken, axiom): Extern.
11720
03b31c0c
AD
117212002-04-07 Akim Demaille <akim@epita.fr>
11722
11723 * src/gram.h (rule_s): prec and precsym are now pointers
11724 to the bucket giving the priority/associativity.
11725 Member `associativity' removed: useless.
11726 * src/reduce.c, src/conflicts.c: Adjust.
11727
8b3df748
AD
117282002-04-07 Akim Demaille <akim@epita.fr>
11729
11730 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
11731 Properly escape the symbols' TAG when outputting them.
11732
e601aa1d
AD
117332002-04-07 Akim Demaille <akim@epita.fr>
11734
11735 * src/lalr.h (LA): Is a bitsetv, not bitset*.
11736
b0299a2e
AD
117372002-04-07 Akim Demaille <akim@epita.fr>
11738
11739 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
11740 (LArule): this, which is an array to rule_t*.
11741 * src/print.c, src/conflicts.c: Adjust.
11742
d7e1f00c
AD
117432002-04-07 Akim Demaille <akim@epita.fr>
11744
11745 * src/gram.h (rule_t): Rename `number' as `user_number'.
11746 `number' is a new member.
11747 Adjust dependencies.
11748 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
11749
cc9305dd
AD
117502002-04-07 Akim Demaille <akim@epita.fr>
11751
11752 As a result of the previous patch, it is no longer needed
11753 to reorder ritem itself.
11754
11755 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
11756
b0940840
AD
117572002-04-07 Akim Demaille <akim@epita.fr>
11758
11759 Be sure never to walk through RITEMS, but use only data related to
11760 the rules themselves. RITEMS should be banished.
11761
11762 * src/output.c (output_token_translations): Rename as...
11763 (prepare_tokens): this.
11764 In addition to `translate', prepare the muscles `tname' and
11765 `toknum', which were handled by...
11766 (output_rule_data): this.
11767 Remove, and move the remainder of its outputs into...
11768 (prepare_rules): this new routines, which also merges content from
11769 (output_gram): this.
11770 (prepare_rules): Be sure never to walk through RITEMS.
11771 (output_stos): Rename as...
11772 (prepare_stos): this.
11773 (output): Always invoke prepare_states, after all, just don't use it
11774 in the output if you don't need it.
11775
643a5994
AD
117762002-04-07 Akim Demaille <akim@epita.fr>
11777
11778 * src/LR0.c (new_state): Display `nstates' as the name of the
11779 newly created state.
11780 Adjust to initialize first_state and last_state if needed.
11781 Be sure to distinguish the initial from the final state.
11782 (new_states): Create the itemset of the initial state, and use
11783 new_state.
11784 * src/closure.c (closure): Now that the initial state has its
11785 items properly set, there is no need for a special case when
11786 creating `ruleset'.
11787
11788 As a result, now the rule 0, reducing to $axiom, is visible in the
11789 outputs. Adjust the test suite.
11790
11791 * tests/conflicts.at (Solved SR Conflicts)
11792 (Unresolved SR Conflicts): Adjust.
11793 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
11794 * tests/conflicts.at (S/R in initial): New.
11795
b4c4ccc2
AD
117962002-04-07 Akim Demaille <akim@epita.fr>
11797
11798 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
11799 the RHS of the rules.
11800 * src/output.c (output_gram): Likewise.
11801
bba97eb2
AD
118022002-04-07 Akim Demaille <akim@epita.fr>
11803
11804 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
11805 bucket.
11806 Adjust all dependencies.
11807 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
11808 `number' of the buckets too.
11809 * src/gram.h: Include `symtab.h'.
11810 (associativity): Move to...
11811 * src/symtab.h: here.
11812 No longer include `gram.h'.
11813
c3b407f4
AD
118142002-04-07 Akim Demaille <akim@epita.fr>
11815
11816 * src/gram.h, src/gram.c (rules_rhs_length): New.
11817 (ritem_longest_rhs): Use it.
11818 * src/gram.h (rule_t): `number' is a new member.
11819 * src/reader.c (packgram): Set it.
11820 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
11821 the end of `rules', and count them out of `nrules'.
11822 (reduce_output, dump_grammar): Adjust.
11823 * src/print.c (print_grammar): It is no longer needed to check for
11824 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
11825 * tests/reduce.at (Reduced Automaton): New test.
11826
11652ab3
AD
118272002-04-07 Akim Demaille <akim@epita.fr>
11828
11829 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
11830 lacking `+ 1' to nrules, Bison reported as useless a token if it
11831 was used solely to set the precedence of the last rule...
11832
26b23c1a
AD
118332002-04-07 Akim Demaille <akim@epita.fr>
11834
11835 * data/bison.c++, data/bison.simple: Don't output the current file
11836 name in #line, to avoid useless diffs between two identical
11837 outputs under different names.
11838
18bcecb0
AD
118392002-04-07 Akim Demaille <akim@epita.fr>
11840
11841 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
11842 Normalize loops to using `< nrules + 1', not `<= nrules'.
11843
fa770c86
AD
118442002-04-07 Akim Demaille <akim@epita.fr>
11845
11846 * TODO: Update.
11847
d9b739c3
AD
118482002-04-07 Akim Demaille <akim@epita.fr>
11849
11850 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
11851 bucket.value as bucket.number.
11852
99013900
AD
118532002-04-07 Akim Demaille <akim@epita.fr>
11854
11855 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
11856 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11857 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
11858 RHS, instead of being an index in RITEMS.
11859
e966383b
PE
118602002-04-04 Paul Eggert <eggert@twinsun.com>
11861
11862 * doc/bison.texinfo: Update copyright date.
11863 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
11864 (Symbols): Warn about running Bison in one character set,
11865 but compiling and/or running in an incompatible one.
11866 Warn about character code 256, too.
11867
118682002-04-03 Paul Eggert <eggert@twinsun.com>
11869
11870 * src/bison.data (YYSTACK_ALLOC): Depend on whether
11871 YYERROR_VERBOSE is nonzero, not whether it is defined.
11872
11873 Merge changes from bison-1_29-branch.
c307773e 11874
8d6c48b9
PE
118752002-03-20 Paul Eggert <eggert@twinsun.com>
11876
11877 Merge fixes from Debian bison_1.34-1.diff.
11878
11879 * configure.in (AC_PREREQ): 2.53.
11880
e53c6322
AD
118812002-03-20 Akim Demaille <akim@epita.fr>
11882
11883 * src/conflicts.c (log_resolution): Argument `resolution' is const.
11884
9ffbeca7
PE
118852002-03-19 Paul Eggert <eggert@twinsun.com>
11886
21db0b2a
PE
11887 * src/bison.simple (YYCOPY): New macro.
11888 (YYSTACK_RELOCATE): Use it.
11889 Remove Type arg; no longer needed. All callers changed.
11890 (yymemcpy): Remove; no longer needed.
11891
9ffbeca7
PE
11892 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
11893 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11894
642cb8f8
AD
118952002-03-19 Akim Demaille <akim@epita.fr>
11896
11897 Test and fix the #line outputs.
11898
11899 * tests/atlocal.at (GCC): New.
11900 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 11901 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
11902 (Action synch line, Epilogue synch line): New tests.
11903 * src/reader.c (parse_union_decl): Define the muscle stype_line.
11904 * data/bison.simple, data/bison.c++: Use it.
11905
3c31a486
AD
119062002-03-19 Akim Demaille <akim@epita.fr>
11907
11908 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
11909 (Solved SR Conflicts, %expect not enough, %expect right)
11910 (%expect too much): Move to...
11911 * tests/conflicts.at: this new file.
11912
0d8bed56
AD
119132002-03-19 Akim Demaille <akim@epita.fr>
11914
11915 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11916 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
11917 that we can move to enums for instance.
11918 * src/output.c (token_definitions_output): Output a list of
11919 `token-name, token-number' instead of the #define.
11920 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
11921
9208d17f
AD
119222002-03-14 Akim Demaille <akim@epita.fr>
11923
11924 Use Gettext 0.11.1.
11925
af27eacb
RA
119262002-03-09 Robert Anisko <robert@lrde.epita.fr>
11927
11928 * data/bison.c++: Make the user able to add members to the generated
11929 parser by subclassing.
11930
9101a310
RA
119312002-03-05 Robert Anisko <robert@lrde.epita.fr>
11932
11933 * src/reader.c (read_additionnal_code): `c' should be an integer, not
11934 a character.
11935 Reported by Nicolas Tisserand and Nicolas Burrus.
11936
fff9bf0b
RA
119372002-03-04 Robert Anisko <robert@lrde.epita.fr>
11938
11939 * src/reader.c: Warn about lacking semi-colons, do not complain.
11940
64dba31e
RA
119412002-03-04 Robert Anisko <robert@lrde.epita.fr>
11942
11943 * data/bison.c++: Remove a debug line.
11944
374f5a14
RA
119452002-03-04 Robert Anisko <robert@lrde.epita.fr>
11946
11947 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
11948 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
11949 provide a default implementation.
11950
bfcf1f3a
AD
119512002-03-04 Akim Demaille <akim@epita.fr>
11952
11953 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
11954 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
11955 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
11956 * tests/semantic.at (Parsing Guards): Similarly.
11957 * src/reader.at (readgram): Complain if the last rule is not ended
11958 with a semi-colon.
11959
65ccf9fc
AD
119602002-03-04 Akim Demaille <akim@epita.fr>
11961
11962 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
11963 * src/closure.c: here.
11964 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
11965 RTC.
11966 * src/warshall.h, src/warshall.c: Remove.
11967 * tests/sets.at (Broken Closure): Adjust.
11968
d0039cbc
AD
119692002-03-04 Akim Demaille <akim@epita.fr>
11970
11971 * src/output.c (output_skeleton): tempdir is const.
11972 bytes_read is unused.
11973
345cea78
AD
119742002-03-04 Akim Demaille <akim@epita.fr>
11975
11976 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
11977 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
11978 Update.
11979 From Michael Hayes.
11980
564801f7
AD
119812002-03-04 Akim Demaille <akim@epita.fr>
11982
11983 * src/closure.c (closure): `r' is unused.
11984
e5352bc7
AD
119852002-03-04 Akim Demaille <akim@epita.fr>
11986
11987 * tests/sets.at (Broken Closure): Add the ending `;'.
11988 * src/reader.at (readgram): Complain if a rule is not ended with a
11989 semi-colon.
11990
914feea9
AD
119912002-03-04 Akim Demaille <akim@epita.fr>
11992
11993 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
11994 (count_sr_conflicts): Use bitset_count.
11995 * src/reduce.c (inaccessable_symbols): Ditto.
11996 (bits_size): Remove.
11997 * src/warshall.h, src/warshall.c: Convert to bitsetv.
11998
f0250de6
AD
119992002-03-04 Akim Demaille <akim@epita.fr>
12000
12001 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12002 * src/reduce.c: Remove the `bitset_zero's following the
12003 `bitset_create's, as now it is performed by the latter.
12004
ef017502
AD
120052002-03-04 Akim Demaille <akim@epita.fr>
12006
12007 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12008 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12009 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12010 latest sources from Michael.
12011
76514394
AD
120122002-03-04 Akim Demaille <akim@epita.fr>
12013
12014 * src/output.c (output): Don't free the grammar.
12015 * src/reader.c (grammar_free): New.
12016 * src/main.c (main): Call it and don't free symtab here.
12017
55024580
AD
120182002-03-04 Akim Demaille <akim@epita.fr>
12019
12020 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12021 before returning.
12022 Reported by Benoit Perrot.
12023
f9abaa2c
AD
120242002-03-04 Akim Demaille <akim@epita.fr>
12025
12026 Use bitset operations when possible, not loops over bits.
12027
12028 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12029 bitset_or.
12030 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12031 * src/reduce.c (useless_nonterminals): Formatting changes.
12032 * src/warshall.c (TC): Use bitset_or.
12033
0e721e75
AD
120342002-03-04 Akim Demaille <akim@epita.fr>
12035
12036 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12037 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12038 Ditto.
12039
0fb1ffb1
AD
120402002-03-04 Akim Demaille <akim@epita.fr>
12041
12042 * src/lalr.c (F): Now a bitset*.
12043 Adjust all dependencies.
12044
b86796bf
AD
120452002-03-04 Akim Demaille <akim@epita.fr>
12046
12047 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12048 Adjust all dependencies.
12049
602bbf31
AD
120502002-03-04 Akim Demaille <akim@epita.fr>
12051
12052 * src/L0.c, src/LR0.h (nstates): Be size_t.
12053 Adjust comparisons (signed vs unsigned).
12054 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12055 bitset*.
12056 Adjust all dependencies.
12057
d8a0245c
AD
120582002-03-04 Akim Demaille <akim@epita.fr>
12059
12060 * src/closure.c (firsts): Now, also a bitset.
12061 Adjust all dependencies.
12062 (varsetsize): Remove, now unused.
12063 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12064
34ba9743
AD
120652002-03-04 Akim Demaille <akim@epita.fr>
12066
12067 * src/print.c: Convert to use bitset.h, not hand coded iterations
12068 over ints.
12069
ed86e78c
AD
120702002-03-04 Akim Demaille <akim@epita.fr>
12071
12072 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12073
dfdb1797
AD
120742002-03-04 Akim Demaille <akim@epita.fr>
12075
12076 * src/closure.c (ruleset): Be a bitset.
12077 (rulesetsize): Remove.
12078
7086e707
AD
120792002-03-04 Akim Demaille <akim@epita.fr>
12080
12081 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12082 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12083 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12084 * src/closure.c (fderives): Be an array of bitsets.
12085
98254360
RA
120862002-02-28 Robert Anisko <robert@lrde.epita.fr>
12087
12088 * data/bison.c++: Merge the two generated headers. Insert a copyright
12089 notice in each output file.
12090
a75c057f
AD
120912002-02-28 Akim Demaille <akim@epita.fr>
12092
12093 * data/bison.c++: Copy the prologue of bison.simple to fetch
12094 useful M4 definitions, such as b4_header_guard.
12095
06b00abc
AD
120962002-02-25 Akim Demaille <akim@epita.fr>
12097
12098 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
12099 translator friendly scheme for the bgr
12100 copyright notice.
06b00abc 12101
70e7d534
AD
121022002-02-25 Akim Demaille <akim@epita.fr>
12103
12104 * src/output.c (header_output): Remove, now handled completely via
12105 M4.
12106
abe017f6
AD
121072002-02-25 Akim Demaille <akim@epita.fr>
12108
12109 * m4/m4.m4: New, from CVS Autoconf.
12110 * configure.in: Invoke it.
12111 * src/output.c (output_skeleton): Use its result instead of the
12112 hard coded name.
12113
381fb12e
AD
121142002-02-25 Akim Demaille <akim@epita.fr>
12115
12116 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12117 Fileutils 4.1.5.
12118 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12119 * src/output.c (output_skeleton): Use mkstemp to create a real
12120 temporary file.
12121 Move the filling of `skeleton' and its muscle to...
12122 (prepare): here.
12123 (output): Move the definition of the prologue muscle to...
12124 (prepare): here.
12125 * src/system.h (DEFAULT_TMPDIR): New.
12126
6f38107f
PE
121272002-02-14 Paul Eggert <eggert@twinsun.com>
12128
12129 Remove the support for C++ namespace cleanliness; it was
12130 causing more problems than it was curing, since it didn't work
12131 properly on some nonstandard C++ compilers. This can wait
12132 for a proper C++ parser.
12133
12134 * NEWS: Document this.
12135 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12136 of C++, as it's treated like C now.
12137 * src/bison.simple (YYSTD): Remove.
12138 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12139 Treat C++ just like Standard C instead of trying to support
12140 namespace cleanliness.
12141
80cce3da
AD
121422002-02-14 Akim Demaille <akim@epita.fr>
12143
12144 * tests/regression.at (else): Adjust to Andreas' change.
12145
842e8679
AD
121462002-02-14 Akim Demaille <akim@epita.fr>
12147
12148 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12149
4bda3f10
AD
121502002-02-13 Andreas Schwab <schwab@suse.de>
12151
12152 * src/output.c (output_rule_data): Don't output NULL, it might
12153 not be defined yet.
12154
4162fa07 121552002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 12156
4162fa07
RA
12157 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12158 (Copyright notice): Update.
b418ecd8 12159
bd16a5dc
AD
121602002-02-11 Akim Demaille <akim@epita.fr>
12161
12162 * tests/regression.at (%nonassoc and eof): Don't include
12163 nonportable headers.
12164
8d69a1a3
RA
121652002-02-08 Robert Anisko <robert@lrde.epita.fr>
12166
12167 * data/bison.c++: Correct error recovery. Make the user able to
12168 initialize the starting location.
12169
9b2d0677
AD
121702002-02-07 Akim Demaille <akim@epita.fr>
12171
12172 * tests/input.at: New.
12173
69e2658b
RA
121742002-02-07 Robert Anisko <robert@lrde.epita.fr>
12175
12176 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 12177 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
12178 directives around tables only needed for debugging.
12179
4aacc3a7
RA
121802002-02-07 Robert Anisko <robert@lrde.epita.fr>
12181
12182 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12183 C++ parsers.
12184 (yy::b4_name::parse): Use print_.
12185
762a801e
RA
121862002-02-07 Robert Anisko <robert@lrde.epita.fr>
12187
12188 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12189
4bb2bc3f
RA
121902002-02-07 Robert Anisko <robert@lrde.epita.fr>
12191
12192 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12193 C++ parsers.
12194 (yy::b4_name::parse): Build verbose error messages, and use error_.
12195
6b45a3ca
RA
121962002-02-06 Robert Anisko <robert@lrde.epita.fr>
12197
12198 * data/bison.c++: Fix m4 quoting in comments.
12199
50997c6e
RA
122002002-02-06 Robert Anisko <robert@lrde.epita.fr>
12201
12202 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12203 not expanded by m4.
12204
3f3eed27
AD
122052002-02-05 Akim Demaille <akim@epita.fr>
12206
12207 * data/bison.c++: Adjust to the M4 back end.
12208 More is certainly needed.
12209
be2a1a68
AD
122102002-02-05 Akim Demaille <akim@epita.fr>
12211
12212 Give a try to M4 as a back end.
12213
12214 * lib/readpipe.c: New, from wdiff.
12215 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12216 BISON_HAIRY.
12217 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12218 specific values. Now it is m4 that performs the lookup.
12219 * src/parse-skel.y: Remove.
12220 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12221 * src/output.c (actions_output, guards_output)
12222 (token_definitions_output): No longer keeps track of the output
12223 line number, hence remove the second argument.
12224 (guards_output): Check against the guard member of a rule, not the
12225 action member.
12226 Adjust callers.
12227 (output_skeleton): Don't look for the skeleton location, let m4 do
12228 that.
12229 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12230 file will be used.
12231 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12232 (prepare): Given that for the time being changesyntax is not
12233 usable in M4, rename the muscles using `-' to `_'.
12234 Define `defines_flag', `output_parser_name' and `output_header_name'.
12235 * src/output.h (actions_output, guards_output)
12236 (token_definitions_output): Adjust prototypes.
12237 * src/scan-skel.l: Instead of scanning the skeletons, it now
12238 processes the output of m4: `__oline__' and `#output'.
12239 * data/bison.simple: Adjust to be used by M4(sugar).
12240 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12241 to date.
12242 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12243 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12244 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12245 shamelessly stolen from CVS Autoconf.
12246
beda758b
AD
122472002-02-05 Akim Demaille <akim@epita.fr>
12248
12249 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12250 * configure.in: Check for the declarations of free and malloc.
12251 * src/muscle_tab.c: Adjust.
12252
5ece6d43
AD
122532002-02-05 Akim Demaille <akim@epita.fr>
12254
12255 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12256 which have no values.
12257
5bb18f9a
AD
122582002-02-05 Akim Demaille <akim@epita.fr>
12259
12260 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12261 * data/: here.
12262
894dd62e
PE
122632002-01-29 Paul Eggert <eggert@twinsun.com>
12264
12265 * src/bison.simple (YYSIZE_T): Do not define merely because
12266 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12267 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12268
82841af7
AD
122692002-01-27 Akim Demaille <akim@epita.fr>
12270
12271 Fix `%nonassoc and eof'.
12272
12273 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12274 which were not properly copied! Replace
12275 memcpy (res->errs, src->errs, src->nerrs);
12276 with
12277 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12278 !!!
12279 * tests/regression.at (%nonassoc and eof): Adjust to newest
12280 Autotest: `.' is not in the PATH.
12281
318b76e9
AD
122822002-01-27 Akim Demaille <akim@epita.fr>
12283
12284 * tests/sets.at (AT_EXTRACT_SETS): New.
12285 (Nullable): Use it.
12286 (Firsts): New.
12287
30d2f3d5
AD
122882002-01-26 Akim Demaille <akim@epita.fr>
12289
12290 * tests/actions.at, tests/calc.at, tests/headers.at,
12291 * tests/torture.at: Adjust to the newest Autotest which no longer
12292 forces `.' in the PATH.
12293
30f8c395
AD
122942002-01-25 Akim Demaille <akim@epita.fr>
12295
12296 * tests/regression.at (%nonassoc and eof): New.
12297 Suggested by Robert Anisko.
12298
29ae55f1
AD
122992002-01-24 Akim Demaille <akim@epita.fr>
12300
12301 Bison dumps core when trying to complain about broken input files.
12302 Reported by Cris van Pelt.
12303
12304 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12305 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12306 into...
12307 (Invalid inputs): Strengthen: exercise parse_percent_token.
12308
2b548aa6
RA
123092002-01-24 Robert Anisko <robert.anisko@epita.fr>
12310
12311 * src/Makefile.am: Add bison.c++.
12312 * src/bison.c++: New skeleton.
12313
bb0146c2
AD
123142002-01-21 Paolo Bonzini <bonzini@gnu.org>
12315
12316 * po/it.po: New.
12317
bec30531
AD
123182002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
12319
12320 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
12321
fc6edc45
MA
123222002-01-20 Marc Autret <marc@gnu.org>
12323
12324 * src/files.c (compute_output_file_names): Fix
12325
5e5d5415
MA
123262002-01-20 Marc Autret <marc@gnu.org>
12327
12328 * tests/output.at: New test.
12329 * src/files.c (compute_base_names): Don't map extensions when
12330 the YACC flag is set, use defaults.
12331 Reported by Evgeny Stambulchik.
12332
44ea3fbd
MA
123332002-01-20 Marc Autret <marc@gnu.org>
12334
ba0fe3c7
PE
12335 * src/system.h: Need to define __attribute__ away for non-GCC
12336 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
12337 Suggested by Albert Chin-A-Young.
12338
338963d1
TVH
123392002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
12340
12341 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
12342 canonical definition.
12343 * src/system.h: Use the canonical definition for PARAMS (avoids
12344 a conflict with the macro from lib/hash.h).
12345
c57b2479
AD
123462002-01-11 Akim Demaille <akim@epita.fr>
12347
12348 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 12349 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 12350
b85810ae
AD
123512002-01-09 Akim Demaille <akim@epita.fr>
12352
12353 * src/files.c, src/files.h (output_infix): New.
12354 (tab_extension): Remove.
12355 (compute_base_names): Compute the former, drop the latter.
12356 * src/output.c (prepare): Insert the muscles `output-infix', and
12357 `output-suffix'.
12358 * src/parse-skel.y (string, string.1): New.
12359 (section.header): Use it.
12360 (section.yacc): Remove.
12361 (prefix): Remove too.
12362 * src/scan-skel.l: Adjust.
12363 * src/bison.simple, src/bison.hairy: Adjust.
12364
cae60122
AD
123652002-01-09 Akim Demaille <akim@epita.fr>
12366
12367 * configure.in (WERROR_CFLAGS): Compute it.
12368 * src/Makefile.am (CFLAGS): Pass it.
12369 * tests/atlocal.in (CFLAGS): Idem.
12370 * src/files.c: Fix a few warnings.
12371 (get_extension_index): Remove, unused.
12372
ae404801
AD
123732002-01-08 Akim Demaille <akim@epita.fr>
12374
12375 * src/getargs.c (AS_FILE_NAME): New.
12376 (getargs): Use it to convert DOSish file names.
12377 * src/files.c (base_name): Rename as full_base_name to avoid
12378 clashes with `base_name ()'.
12379 (filename_split): New.
12380 (compute_base_names): N-th rewrite, using filename_split.
12381
22312b71
AD
123822002-01-08 Akim Demaille <akim@epita.fr>
12383
12384 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
12385 New, stolen from the Fileutils 4.1.
12386 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
12387 * configure.in: Check for the presence of memrchr, and of its
12388 prototype.
12389
a67cef01
TVH
123902002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
12391
12392 * lib/hash.h (__P): Added definition for this macro.
12393 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
12394 BUILT_SOURCES, to ensure they are generated first.
12395 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
12396 %error-verbose to allow bootstrapping with bison 1.30x.
12397
2b25d624
AD
123982002-01-06 Akim Demaille <akim@epita.fr>
12399
12400 * src/reader.c (parse_braces): Don't fetch the next char, the
12401 convention is to fetch on entry.
12402 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
12403 'switch' without a following semicolon.
12404 * tests/regression.at (braces parsing): New.
12405
3460813b
AD
124062002-01-06 Akim Demaille <akim@epita.fr>
12407
12408 Bison is dead wrong in its RR conflict reports.
12409
12410 * tests/torture.at (GNU Cim Grammar): New.
12411 * src/conflicts.c (count_rr_conflicts): Fix.
12412
73784c64
AD
124132002-01-06 Akim Demaille <akim@epita.fr>
12414
12415 Creating package.m4 from configure.ac causes too many problems.
12416
12417 * tests/Makefile.am (package.m4): Create it by hand,
12418 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
12419
25d81090
AD
124202002-01-06 Akim Demaille <akim@epita.fr>
12421
12422 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
12423 skeleton.h.
12424
a9b8959e
PE
124252002-01-04 Paul Eggert <eggert@twinsun.com>
12426
12427 * doc/bison.texinfo (Debugging):
12428 Remove YYSTDERR; it's no longer defined or used.
12429 Also, s/cstdio.h/cstdio/.
12430
25d81090
AD
124312002-01-03 Akim Demaille <akim@epita.fr>
12432
12433 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
12434
1109455c
AD
124352002-01-03 Akim Demaille <akim@epita.fr>
12436
12437 * src/parse-skel.y (process_skeleton): Don't bind the parser's
12438 tracing code to --trace, wait for a better --trace option, with
12439 args.
12440
7ea5e977
AD
124412002-01-03 Akim Demaille <akim@epita.fr>
12442
12443 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
12444 The ISO C++ standard is extremely clear about it: stderr is
12445 considered a macro, not a regular symbol (see table 94 `Header
12446 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
12447 Therefore std:: does not apply to it. It still does with fprintf.
12448 Also, s/cstdio.h/cstdio/.
12449
fab5b110
AD
124502002-01-03 Akim Demaille <akim@epita.fr>
12451
12452 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
12453 for non system headers.
12454
aed7fd9b
AD
124552002-01-02 Akim Demaille <akim@epita.fr>
12456
12457 Equip the skeleton chain with location tracking, runtime trace,
12458 pure parser and scanner.
12459
12460 * src/parse-skel.y: Request a pure parser, locations, and prefix
12461 renaming.
12462 (%union): Having several members with the same type does not help
12463 type mismatches, simplify.
12464 (YYPRINT, yyprint): New.
12465 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
12466 (skel_error): this.
12467 Handle locations.
12468 * src/scan-skel.l: Adjust to these changes.
12469 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
12470 (LOCATION_PRINT, skel_control_t): New.
12471
24fad99e
AD
124722001-12-30 Akim Demaille <akim@epita.fr>
12473
12474 * src/parse-skel.y: Get rid of the shift/reduce conflict:
12475 replace `gb' with BLANKS.
12476 * src/scan-skel.l: Adjust.
12477
a4b36db4
AD
124782001-12-30 Akim Demaille <akim@epita.fr>
12479
12480 * src/system.h: We don't need nor want bcopy.
12481 Throw away MS-DOS crap: we don't need getpid.
12482 * configure.in: We don't need strndup. It was even causing
12483 problems: because Flex includes the headers *before* us,
12484 _GNU_SOURCE is not defined by config.h, and therefore strndup was
12485 not visible.
12486 * lib/xstrndup.c: New.
12487 * src/scan-skel.l: Use it.
12488 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
12489 * src/parse-skel.y: Use %directives instead of #defines.
12490
1239777d
AD
124912001-12-30 Akim Demaille <akim@epita.fr>
12492
12493 * src/skeleton.h: New.
12494 * src/output.c (output_parser, output_master_parser): Remove, dead
12495 code.
12496 * src/output.h (get_lines_number, actions_output, guards_output)
12497 (token_definitions_output): Prototype them.
12498 * src/parse-skel.y: Add the license notice.
12499 Include output.h and skeleton.h.
12500 (process_skeleton): Returns void, and takes a single parameter.
12501 * src/scan-skel.l: Add the license notice.
12502 Include skeleton.h.
12503 Don't use %option yylineno: it seems that then Flex imagines
12504 REJECT has been used, and therefore it won't reallocate its
12505 buffers (which makes no other sense to me than a bug). It results
12506 in warnings for `unused: yy_flex_realloc'.
12507
9b3add5b
RA
125082001-12-30 Robert Anisko <robert.anisko@epita.fr>
12509
12510 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12511 (MUSCLE_INSERT_PREFIX): ...to there.
12512 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12513 (MUSCLE_INSERT_PREFIX): Move from here...
12514
12515 * src/bison.hairy: Add a section directive. Put braces around muscle
12516 names. This parser skeleton is still broken, but Bison should not
12517 choke on a bad muscle 'syntax'.
12518 * src/bison.simple: Add a section directive. Put braces around muscle
12519 names.
12520
12521 * src/files.h (strsuffix, stringappend): Add declarations.
12522 (tab_extension): Add declaration.
12523 (short_base_name): Add declaration.
12524
12525 * src/files.c (strsuffix, stringappend): No longer static. These
12526 functions are used in the skeleton parser.
12527 (tab_extension): New.
12528 (compute_base_names): Use the computations done in this function
fab5b110 12529 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
12530 names.
12531 (short_base_name): No longer static.
12532
12533 * src/output.c (output_skeleton): New.
12534 (output): Disable call to output_master_parser, and give a try to
12535 a new skeleton handling system.
12536 (guards_output, actions_output): No longer static.
12537 (token_definitions_output, get_lines_number): No longer static.
12538
12539 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
12540
fab5b110 12541 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
12542 parse-skel.y.
12543
12544 * src/parse-skel.y: New file.
12545 * src/scan-skel.l: New file.
12546
b5b61c61
AD
125472001-12-29 Akim Demaille <akim@epita.fr>
12548
12549 %name-prefix is broken.
12550
12551 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
12552 Adjust all dependencies.
12553 * tests/headers.at (export YYLTYPE): Strengthen this test: use
12554 %name-prefix.
12555
12556 Renaming yylval but not yylloc is not consistent. Now we do.
12557
12558 * src/bison.simple: Prefix yylloc if used.
12559 * doc/bison.texinfo (Decl Summary): Document that.
12560
8c9a50be
AD
125612001-12-29 Akim Demaille <akim@epita.fr>
12562
12563 * doc/bison.texinfo: Promote `%long-directive' over
12564 `%long_directive'.
12565 Remove all references to fixed-output-files, yacc is enough.
12566
d99361e6
AD
125672001-12-29 Akim Demaille <akim@epita.fr>
12568
12569 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
12570 user prologue. These are defaults.
12571 * tests/actions.at (Mid-rule actions): Make sure the user can
12572 define YYDEBUG and YYERROR_VERBOSE.
12573
b9cecb91
AD
125742001-12-29 Akim Demaille <akim@epita.fr>
12575
12576 * src/output.c (header_output): Don't forget to export YYLTYPE and
12577 yylloc.
12578 * tests/headers.at (export YYLTYPE): New, make sure it does.
12579 * tests/regression.at (%union and --defines, Invalid CPP headers):
12580 Move to...
12581 * tests/headers.at: here.
12582
aea13e97
AD
125832001-12-29 Akim Demaille <akim@epita.fr>
12584
12585 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
12586
931394cb
AD
125872001-12-29 Akim Demaille <akim@epita.fr>
12588
12589 * tests/actions.at (Mid-rule actions): Output on a single line
12590 instead of several.
12591
704a47c4
AD
125922001-12-29 Akim Demaille <akim@epita.fr>
12593
12594 * doc/bison.texinfo: Formatting changes.
12595
091e20bb
AD
125962001-12-29 Akim Demaille <akim@epita.fr>
12597
12598 Don't store the token defs in a muscle, just be ready to output it
12599 on command. Now possible via `symbols'. Fixes a memory leak.
12600
12601 * src/output.c (token_definitions_output): New.
12602 (output_parser, header_output): Use it.
12603 * src/reader.c (symbols_save): Remove.
12604
cce71710
AD
126052001-12-29 Akim Demaille <akim@epita.fr>
12606
12607 * src/bison.simple: Do not provide a default for YYSTYPE and
12608 YYLTYPE before the user's prologue. Otherwise it's hardly... a
12609 default.
12610
82c035a8
AD
126112001-12-29 Akim Demaille <akim@epita.fr>
12612
12613 Mid-rule actions are simply... ignored!
12614
12615 * src/reader.c (readgram): Be sure to attach mid-rule actions to
12616 the empty-rule associated to the dummy symbol, not to the host
12617 rule.
12618 * tests/actions.at (Mid-rule actions): New.
12619
8419d367
AD
126202001-12-29 Akim Demaille <akim@epita.fr>
12621
12622 Memory leak.
12623
12624 * src/reader.c (reader): Free grammar.
12625
375d5806
AD
126262001-12-29 Akim Demaille <akim@epita.fr>
12627
12628 Memory leak.
12629
12630 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
12631 since it allocates it for each state, although only one is needed.
12632 (allocate_storage): Do it here.
12633
f51cb8ff
AD
126342001-12-29 Akim Demaille <akim@epita.fr>
12635
12636 * src/options.h, src/options.c (create_long_option_table): Rename
12637 as...
12638 (long_option_table_new): this, with a clearer prototype.
12639 (percent_table): Remove, unused,
12640 * src/getargs.c (getargs): Adjust.
12641
29e88316
AD
126422001-12-29 Akim Demaille <akim@epita.fr>
12643
12644 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
12645 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
12646 as states.
12647
b9f71f19
AD
126482001-12-29 Akim Demaille <akim@epita.fr>
12649
12650 * src/lalr.c (build_relations): Rename `states' as `states1'.
12651 Sorry, I don't understand exactly what it is, no better name...
12652
1a2b5d37
AD
126532001-12-29 Akim Demaille <akim@epita.fr>
12654
12655 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
12656 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
12657 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
12658 as rules.
12659
1cca533e
AD
126602001-12-29 Akim Demaille <akim@epita.fr>
12661
12662 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
12663 ago.
12664
c03ae966
AD
126652001-12-29 Akim Demaille <akim@epita.fr>
12666
12667 * src/reader.c, src/reader.h (user_toknums): Remove.
12668 Adjust all users to use symbols[i]->user_token_number.
12669
5a670b1e
AD
126702001-12-29 Akim Demaille <akim@epita.fr>
12671
12672 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
12673 Adjust all users to use symbols[i]->prec or ->assoc.
12674
ad949da9
AD
126752001-12-29 Akim Demaille <akim@epita.fr>
12676
12677 * src/reader.c, src/reader.h (tags): Remove.
12678 Adjust all users to use symbols[i]->tag.
12679
0e78e603
AD
126802001-12-29 Akim Demaille <akim@epita.fr>
12681
12682 * src/gram.h, src/gram.c (symbols): New, similar to state_table
12683 and rule_table.
12684 * src/reader.c (packsymbols): Fill this table.
12685 Drop sprec.
12686 * src/conflicts.c (resolve_sr_conflict): Adjust.
12687 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
12688 single table.
12689 Use symbols[i]->tag instead of tags[i].
12690
213e640e
AD
126912001-12-29 Akim Demaille <akim@epita.fr>
12692
12693 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
12694 In addition, put a comment in there, to replace...
12695 * tests/regression.at (%union and C comments): Remove.
12696
e7b8bef1
AD
126972001-12-29 Akim Demaille <akim@epita.fr>
12698
12699 * tests/regression.at (Web2c Actions): Blindly move the actual
12700 output as expected output. The contents *seem* right to me, but I
12701 can't pretend reading perfectly parser tables... Nonetheless, all
12702 the other tests pass correctly, the table look OK, even though the
12703 presence of `$axiom' is to be noted: AFAICS it is useless (but
12704 harmless).
12705
b68e7744
AD
127062001-12-29 Akim Demaille <akim@epita.fr>
12707
12708 * src/reader.c (readgram): Don't add the rule 0 if there were no
12709 rules read. In other words, add it _after_ having performed
12710 grammar sanity checks.
12711 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
12712
78d5bae9
AD
127132001-12-29 Akim Demaille <akim@epita.fr>
12714
12715 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12716 visible, and some states have now a different number.
12717
ff442794
AD
127182001-12-29 Akim Demaille <akim@epita.fr>
12719
12720 * src/reader.c (readgram): Bind the initial rule's lineno to that
12721 of the first rule.
12722 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
12723 (Solved SR Conflicts): Adjust rule 0's line number.
12724
610ab194
AD
127252001-12-29 Akim Demaille <akim@epita.fr>
12726
12727 Fix the `GAWK Grammar' failure.
12728
12729 * src/LR0.c (final_state): Initialize to -1 so that we do compute
12730 the reductions of the first state which was mistakenly confused
12731 with the final state because precisely final_state was initialized
12732 to 0.
12733 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
12734 now noticed by Bison.
12735 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
12736 have a reduction on $default.
12737
29d29c8f
AD
127382001-12-29 Akim Demaille <akim@epita.fr>
12739
12740 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
12741 rule line numbers.
12742 * src/closure.c (print_closure): Likewise.
12743 * src/derives.c (print_derives): Likewise.
12744 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
12745 now.
12746
7c6b64d0
AD
127472001-12-29 Akim Demaille <akim@epita.fr>
12748
12749 * src/lalr.c (lookaheads_print): New.
12750 (lalr): Call it when --trace-flag.
12751 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
12752 are dumped.
12753
3d4daee3
AD
127542001-12-29 Akim Demaille <akim@epita.fr>
12755
12756 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
12757 when walking through ritem, even via rule->rhs.
12758 * src/reduce.c (dump_grammar, useful_production, reduce_output)
12759 (useful_production, useless_nonterminals): Likewise.
12760 (reduce_grammar_tables): Likewise, plus update nritems.
12761 * src/nullable.c (set_nullable): Likewise.
12762 * src/lalr.c (build_relations): Likewise.
12763 * tests/sets.at (Nullable): Adjust.
12764 Fortunately, now, the $axiom is no longer nullable.
12765
9e7f6bbd
AD
127662001-12-29 Akim Demaille <akim@epita.fr>
12767
12768 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
12769 the 0-sentinel.
12770 * src/gram.c (ritem_longest_rhs): Likewise.
12771 * src/reduce.c (nonterminals_reduce): Likewise.
12772 * src/print_graph.c (print_graph): Likewise.
12773 * src/output.c (output_rule_data): Likewise.
12774 * src/nullable.c (set_nullable): Likewise.
12775
255ef638
AD
127762001-12-29 Akim Demaille <akim@epita.fr>
12777
12778 * src/output.c: Comment changes.
12779
0d8a7363
AD
127802001-12-27 Paul Eggert <eggert@twinsun.com>
12781
12782 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
12783 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
12784 Sparc, as they were causing more porting problems than the
12785 (minor) performance improvement was worth.
12786
12787 Also, catch up with 1.31's YYSTD.
12788
3db472b9
AD
127892001-12-27 Akim Demaille <akim@epita.fr>
12790
12791 * src/output.c (output_gram): Rely on nritems, not the
12792 0-sentinel. See below.
12793 Use -1 as separator, not 0.
12794 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
12795 Rely on -1 as separator in yyrhs, instead of 0.
12796 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
12797 twice `Now at end of input', therefore there are two lines less to
12798 expect.
12799
b365aa05
AD
128002001-12-27 Akim Demaille <akim@epita.fr>
12801
12802 * tests/regression.at (Unresolved SR Conflicts):
12803 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
12804 below.
12805
30171f79
AD
128062001-12-27 Akim Demaille <akim@epita.fr>
12807
12808 * src/LR0.c (new_state): Recognize the final state by the fact it
12809 is reached by eoftoken.
12810 (insert_start_shifting_state, insert_eof_shifting_state)
12811 (insert_accepting_state, augment_automaton): Remove, since now
12812 these states are automatically computed from the initial state.
12813 (generate_states): Adjust.
12814 * src/print.c: When reporting a rule number to the user, substract
12815 1, so that the axiom rule is rule 0, and the first user rule is 1.
12816 * src/reduce.c: Likewise.
12817 * src/print_graph.c (print_core): For the time being, just as for
12818 the report, depend upon --trace-flags to dump the full set of
12819 items.
12820 * src/reader.c (readgram): Once the grammar read, insert the rule
12821 0: `$axiom: START-SYMBOL $'.
12822 * tests/set.at: Adjust: rule 0 is now displayed, and since the
12823 number of the states has changed (the final state is no longer
12824 necessarily the last), catch up.
12825
75142d45
AD
128262001-12-27 Akim Demaille <akim@epita.fr>
12827
12828 Try to make the use of the eoftoken valid. Given that its value
12829 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
12830 is used instead of > 0 where appropriate, (ii), depend upon nritems
12831 instead of the 0-sentinel.
12832
12833 * src/gram.h, src/gram.c (nritems): New.
12834 Expected to be duplication of nitems, but for the time being...
12835 * src/reader.c (packgram): Assert nritems and nitems are equal.
12836 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
12837 * src/closure.c (print_closure, print_fderives): Likewise.
12838 * src/gram.c (ritem_print): Likewise.
12839 * src/print.c (print_core, print_grammar): Likewise.
12840 * src/print_graph.c: Likewise.
12841
b7c49edf
AD
128422001-12-27 Akim Demaille <akim@epita.fr>
12843
12844 * src/main.c (main): If there are complains after grammar
12845 reductions, then output the report anyway if requested, then die.
12846 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
12847 * src/reader.c (eoftoken): New.
12848 (parse_token_decl): If the token being defined has value `0', it
12849 is the eoftoken.
12850 (packsymbols): No longer hack `tags' to insert `$' by hand.
12851 Be sure to preserve the value of the eoftoken.
12852 (reader): Make sure eoftoken is defined.
12853 Initialize nsyms to 0: now eoftoken is created just like the others.
12854 * src/print.c (print_grammar): Don't special case the eof token.
12855 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
12856 lie anyway, albeit pleasant.
12857 * tests/calc.at: Exercise error messages with eoftoken.
12858 Change the grammar so that empty input is invalid.
12859 Adjust expectations.
12860 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
12861
ec2da99f
AD
128622001-12-27 Akim Demaille <akim@epita.fr>
12863
12864 * configure.in: Check the protos of strchr ans strspn.
12865 Replace strchr if needed.
12866 * src/system.h: Provide the protos of strchr, strspn and memchr if
12867 missing.
12868 * lib/strchr.c: New.
12869 * src/reader.c (symbols_save): Use strchr.
12870
8adfa272
AD
128712001-12-27 Akim Demaille <akim@epita.fr>
12872
12873 * src/print.c, src/print_graph.c (escape): New.
12874 Use it to quote the TAGS outputs.
12875 * src/print_graph.c (print_state): Now errors are in red, and
12876 reductions in green.
12877 Prefer high to wide: output the state number on a line of its own.
12878
80dac38c
AD
128792001-12-27 Akim Demaille <akim@epita.fr>
12880
12881 * src/state.h, src/state.c (reductions_new): New.
12882 * src/LR0.c (set_state_table): Let all the states have a
12883 `reductions', even if reduced to 0.
12884 (save_reductions): Adjust.
12885 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
12886 * src/print.c (print_reductions, print_actions): Adjust.
12887 * src/output.c (action_row): Adjust.
12888
2cec70b9
AD
128892001-12-27 Akim Demaille <akim@epita.fr>
12890
12891 * src/state.h, src/state.c (errs_new, errs_dup): New.
12892 * src/LR0.c (set_state_table): Let all the states have an errs,
12893 even if reduced to 0.
12894 * src/print.c (print_errs, print_reductions): Adjust.
12895 * src/output.c (output_actions, action_row): Adjust.
12896 * src/conflicts.c (resolve_sr_conflict): Adjust.
12897
13ca549a
AD
128982001-12-27 Akim Demaille <akim@epita.fr>
12899
12900 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
12901
5092aba5
AD
129022001-12-27 Akim Demaille <akim@epita.fr>
12903
12904 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
12905 * src/print.c: here.
12906 (lookaheadset, shiftset): New, used as additional storage by
12907 print_reductions.
12908 (print_results): Adjust.
12909 (print_shifts, print_gotos, print_errs): New, extracted from...
12910 (print_actions): here.
12911 * src/print_graph.c (print_actions): Remove dead code.
12912
11e2beca
AD
129132001-12-27 Akim Demaille <akim@epita.fr>
12914
12915 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
12916 `$n' and `@n'.
12917
dac3c910
AD
129182001-12-27 Akim Demaille <akim@epita.fr>
12919
12920 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
12921 (build_relations): Adjust.
12922
d0b0fefa
AD
129232001-12-27 Akim Demaille <akim@epita.fr>
12924
12925 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
12926 duplication.
12927
adc8c848
AD
129282001-12-27 Akim Demaille <akim@epita.fr>
12929
12930 * src/reader.c (packgram): Catch nitems overflows.
12931
14d293ac
AD
129322001-12-27 Akim Demaille <akim@epita.fr>
12933
12934 * src/files.c, src/files.h (guard_obstack): Remove.
12935 * src/output.c (output): Adjust.
12936 * src/reader.c (parse_braces): New, factoring...
12937 (copy_action, copy_guard): these two which are renamed as...
12938 (parse_action, parse_guard): these.
12939 As a voluntary consequence, using braces around guards is now
12940 mandatory.
12941
f499b062
AD
129422001-12-27 Akim Demaille <akim@epita.fr>
12943
12944 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
12945 * src/reader.c (symbol_list): `guard' and `guard_line' are new
12946 members.
12947 (symbol_list_new): Adjust.
12948 (copy_action): action_line is the first line, not the last.
12949 (copy_guard): Just as for actions, store the `action' only, not
12950 the switch/case/break flesh.
12951 Don't parse the user action that might follow the guard, let...
12952 (readgram): do it, i.e., now, there can be an action after a
12953 guard.
12954 In other words the guard is just explicitly optional.
12955 (packgram): Adjust.
12956 * src/output.c (guards_output): New.
12957 (output_parser): Call it when needed.
12958 (output): Also free the guard and attrs obstacks.
12959 * src/files.c, src/files.h (obstack_save): Remove.
12960 (output_files): Remove.
12961 As a result, if one needs the former `.act' file, using an
12962 appropriate skeleton which requires actions and guards is now
12963 required.
12964 * src/main.c (main): Adjust.
12965 * tests/semantic.at: New.
12966 * tests/regression.at: Use `input.y' as input file name.
12967 Avoid 8+3 problems by requiring input.c when the test needs the
12968 parser.
12969
d945f5cd
AD
129702001-12-27 Akim Demaille <akim@epita.fr>
12971
12972 * src/reader.c (symbol_list_new): Be sure to initialize all the
12973 fields.
12974
d200e455
AD
129752001-12-27 Akim Demaille <akim@epita.fr>
12976
12977 All the hacks using a final pseudo state are now useless.
12978
12979 * src/LR0.c (set_state_table): state_table holds exactly nstates.
12980 * src/lalr.c (nLA): New.
12981 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
12982 instead of lookaheadsp from the pseudo state (nstate + 1).
12983
f9507c28
AD
129842001-12-27 Akim Demaille <akim@epita.fr>
12985
12986 * src/output.c (action_row, token_actions): Use a state_t instead
12987 of a integer, and nlookaheads instead of the following state's
12988 lookaheadsp.
12989
065fbd27
AD
129902001-12-27 Akim Demaille <akim@epita.fr>
12991
12992 * src/conflicts.c (log_resolution, flush_shift)
12993 (resolve_sr_conflict, set_conflicts, solve_conflicts)
12994 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
12995 (conflicts_print, print_reductions): Use a state_t instead of an
12996 integer when referring to a state.
12997 As much as possible, depend upon nlookaheads, instead of the
12998 `lookaheadsp' member of the following state (since lookaheads of
12999 successive states are successive, the difference between state n + 1
13000 and n served as the number of lookaheads for state n).
13001 * src/lalr.c (add_lookback_edge): Likewise.
13002 * src/print.c (print_core, print_actions, print_state)
13003 (print_results): Likewise.
13004 * src/print_graph.c (print_core, print_actions, print_state)
13005 (print_graph): Likewise.
13006 * src/conflicts.h: Adjust.
13007
1b177bd7
AD
130082001-12-27 Akim Demaille <akim@epita.fr>
13009
13010 * src/bison.hairy: Formatting/comment changes.
13011 ANSIfy.
13012 Remove `register' indications.
13013 Add plenty of `static'.
13014
7742ddeb
AD
130152001-12-27 Akim Demaille <akim@epita.fr>
13016
13017 * src/output.c (prepare): Drop the muscle `ntbase' which
13018 duplicates ntokens.
13019 * src/bison.simple: Formatting/comment changes.
13020 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13021 is an undocumented synonym.
13022
1fa14068
AD
130232001-12-22 Akim Demaille <akim@epita.fr>
13024
13025 * src/output.c (output_table_data): Change the prototype to use
13026 `int' for array ranges: some invocations do pass an int, not a
13027 short.
13028 Reported by Wayne Green.
13029
b9752825
AD
130302001-12-22 Akim Demaille <akim@epita.fr>
13031
13032 Some actions of web2c.y are improperly triggered.
13033 Reported by Mike Castle.
13034
13035 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13036 * tests/regression.at (Web2c): Rename as...
13037 (Web2c Report): this.
13038 (Web2c Actions): New.
13039
776209d6
AD
130402001-12-22 Akim Demaille <akim@epita.fr>
13041
13042 Reductions in web2c.y are improperly reported.
13043 Reported by Mike Castle.
13044
13045 * src/conflicts.c (print_reductions): Fix.
13046 * tests/regression.at (Web2c): New.
13047
275fc3ad
AD
130482001-12-18 Akim Demaille <akim@epita.fr>
13049
13050 Some host fail on `assert (!"foo")', which expands to
13051 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13052 Reported by Nelson Beebee.
13053
13054 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13055 `#define it_succeeded 0' and `assert (it_succeeded)'.
13056
897668ee
MA
130572001-12-17 Marc Autret <autret_m@epita.fr>
13058
13059 * src/bison.simple: Don't hard code the skeleton line and filename.
13060 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13061 New line counter 'skeleton_line' (skeleton-line muscle).
13062
ab3399e0
PE
130632001-12-17 Paul Eggert <eggert@twinsun.com>
13064
13065 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13066 YYDEBUG must be defined to a nonzero value.
13067
13068 * src/bison.simple (yytname): Do not assume that the user defines
13069 YYDEBUG to a properly parenthesized expression.
13070
3877f72b
AD
130712001-12-17 Akim Demaille <akim@epita.fr>
13072
13073 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13074 nlookaheads is a new member.
13075 Adjust all users.
13076 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13077 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13078 state.
776209d6 13079
331dbc1b
AD
130802001-12-17 Akim Demaille <akim@epita.fr>
13081
13082 * src/files.h, src/files.c (open_files, close_files): Remove.
13083 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13084 let...
13085 * src/reader.c (reader): Do it.
776209d6 13086
be750e4c
AD
130872001-12-17 Akim Demaille <akim@epita.fr>
13088
13089 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 13090
709ae8c6
AD
130912001-12-17 Akim Demaille <akim@epita.fr>
13092
13093 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13094 (flush_reduce): New.
13095 (resolve_sr_conflict): Adjust.
776209d6 13096
f87685c3
AD
130972001-12-17 Akim Demaille <akim@epita.fr>
13098
13099 * src/output.c (output_obstack): Be static and rename as...
13100 (format_obstack): this, to avoid any confusion with files.c's
13101 output_obstack.
13102 * src/reader.h (muscle_obstack): Move to...
13103 * src/output.h: here, since it's defined in output.c.
13104
837491d8
AD
131052001-12-17 Akim Demaille <akim@epita.fr>
13106
13107 * src/output.c (action_row, save_column, default_goto)
13108 (sort_actions, matching_state, pack_vector): Better variable
13109 locality.
13110
796d61fb
AD
131112001-12-17 Akim Demaille <akim@epita.fr>
13112
13113 * src/output.c: Various formatting changes.
776209d6 13114
64d15509
AD
131152001-12-17 Akim Demaille <akim@epita.fr>
13116
13117 * src/files.c (output_files): Free the output_obstack.
13118 * src/main.c (main): Call print and print_graph conditionally.
13119 * src/print.c (print): Work unconditionally.
13120 * src/print_graph.c (print_graph): Work unconditionally.
13121 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13122
fbc8ecb7
MA
131232001-12-16 Marc Autret <autret_m@epita.fr>
13124
13125 * src/output.c (actions_output): Fix. When we use %no-lines,
13126 there is one less line per action.
13127
f0440388
MA
131282001-12-16 Marc Autret <autret_m@epita.fr>
13129
13130 * src/bison.simple: Remove a useless #line directive.
13131 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13132 * src/output.c (get_lines_number): New.
776209d6 13133 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
13134 output muscles.
13135 Fix line numbering.
13136 (actions_output): Computes the number of lines taken by actions.
13137 (output_master_parser): Insert new skeleton which is the name of
13138 the output parser file name.
13139
a79986b8
MA
131402001-12-15 Marc Autret <autret_m@epita.fr>
13141
13142 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13143
4ec8e00f
MA
131442001-12-15 Marc Autret <autret_m@epita.fr>
13145
13146 * src/output.c (output_gram): Keep track of the hairy one.
13147
1a4648ff
AD
131482001-12-15 Akim Demaille <akim@epita.fr>
13149
13150 Make `make distcheck' work.
13151
13152 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13153 system.h which uses libgettext.h.
13154
9c2c67e6
AD
131552001-12-15 Akim Demaille <akim@epita.fr>
13156
13157 * src/nullable.c (set_nullable): Useless rules must be skipped,
13158 otherwise, since we range over their symbols, we might look at a
13159 nonterminal which no longer ``exists'', i.e., it is not counted in
13160 `nvars', hence we overflow our arrays.
13161
93ede233
AD
131622001-12-15 Akim Demaille <akim@epita.fr>
13163
13164 The header can also be produced directly, without any obstack!
13165 Yahoo!
13166
13167 * src/files.c, src/files.h (defines_obstack): Remove.
13168 (compute_header_macro): Global.
13169 (defines_obstack_save): Remove.
13170 * src/reader.c (parse_union_decl): No longer output to
13171 defines_obstack: its content can be found in the `stype' muscle
13172 anyway.
13173 (output_token_translations): Merge into...
13174 (symbols_output): this.
13175 Rename as...
13176 (symbols_save): this.
13177 (reader): Adjust.
13178 * src/output.c (header_output): New.
13179 (output): Call it.
13180
2666f928
AD
131812001-12-15 Akim Demaille <akim@epita.fr>
13182
13183 * src/reader.c (parse_union_decl): Instead of handling two obstack
13184 simultaneously, use one to define the `stype' muscle, and use the
13185 value of the latter to fill defines_obstack.
13186 (copy_comment): Remove.
13187 (copy_comment2): Work for a single obstack.
13188 Rename as...
13189 (copy_comment): this.
13190
428046f8
AD
131912001-12-15 Akim Demaille <akim@epita.fr>
13192
13193 * src/lex.c, src/lex.h (xgetc): No longer static.
13194 * src/reader.c (parse_union_decl): Revamp.
13195
ea52d706
AD
131962001-12-15 Akim Demaille <akim@epita.fr>
13197
13198 Still making progress in separating Bison into (i) input, (ii)
13199 process, (iii) output: now we can directly output the parser file
13200 without using table_obstack at all.
13201
13202 * src/files.c, src/files.h (table_obstack): Bye bye.
13203 (parser_file_name): New.
13204 * src/files.c (compute_output_file_names): Compute it.
13205 * src/output.c (actions_output, output_parser)
13206 (output_master_parser): To a file instead of an obstack.
13207
3f96f4dc
AD
132082001-12-15 Akim Demaille <akim@epita.fr>
13209
13210 Attach actions to rules, instead of pre-outputting them to
13211 actions_obstack.
13212
13213 * src/gram.h (rule_t): action and action_line are new members.
13214 * src/reader.c (symbol_list): Likewise.
13215 (copy_action): Save the actions within the rule.
13216 (packgram): Save them in rule_table.
13217 * src/output.c (actions_output): New.
13218 (output_parser): Use it on `%%actions'.
13219 (output_rule_data): Don't free rule_table.
13220 (output): Do it.
13221 (prepare): Don't save the `action' muscle.
13222 * src/bison.simple: s/%%action/%%actions/.
13223
51576fb3
AD
132242001-12-15 Akim Demaille <akim@epita.fr>
13225
13226 * src/reader.c (copy_action): When --yacc, don't append a `;'
13227 to the user action: let it fail if lacking.
dee049eb 13228 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 13229
2648a72d
AD
132302001-12-14 Akim Demaille <akim@epita.fr>
13231
13232 * src/lex.c (literalchar): Simply return the char you decoded, non
13233 longer mess around with obstacks and int pointers.
13234 Adjust all callers.
13235
92790e5b
AD
132362001-12-14 Akim Demaille <akim@epita.fr>
13237
13238 * src/lex.c (literalchar): Don't escape the special characters,
13239 just decode them, and keep them as char (before, eol was output as
13240 the 2 char string `\n' etc.).
13241 * src/output.c (output_rule_data): Use quotearg to output the
13242 token strings.
13243
927c1557
PE
132442001-12-13 Paul Eggert <eggert@twinsun.com>
13245
13246 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13247 Do not infringe on the global user namespace when using C++.
13248 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13249 All uses of `fprintf' and `stderr' changed.
13250
13251 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13252
ed8e1f68
AD
132532001-12-13 Akim Demaille <akim@epita.fr>
13254
13255 The computation of nullable is broken: it doesn't handle empty
13256 RHS's properly.
13257
13258 * tests/torture.at (GNU AWK Grammar): New.
13259 * tests/sets.at (Nullable): New.
13260 * src/nullable.c (set_nullable): Instead of blindly looping over
13261 `ritems', loop over the rules, and then over their rhs's.
13262
13263 Work around Autotest bugs.
13264
13265 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13266 frame, because Autotest understand lines starting with a `+' as
13267 traces from the shell. Then, they are not processed properly.
13268 Admittedly an Autotest bug, but we don't have time to wait for
13269 Autotest to catch up.
13270 * tests/regression.at (Broken Closure): Adjust to the new table
13271 frames.
13272 Move to...
13273 * tests/sets.at: here.
13274
cb581495
AD
132752001-12-13 Akim Demaille <akim@epita.fr>
13276
13277 * src/closure.c (closure): Use nrules instead of playing tricks
13278 with BITS_PER_WORD.
13279
2e729273
AD
132802001-12-13 Akim Demaille <akim@epita.fr>
13281
13282 * src/print.c (print_actions): Output the handling of `$' as the
13283 traces do: shifting the token EOF. Before EOF was treated as a
13284 nonterminal.
13285 * tests/regression.at: Adjust some tests.
13286 * src/print_graph.c (print_core): Complete the set of items via
13287 closure. The next-to-final and final states are still unsatisfying,
13288 but that's to be addressed elsewhere.
13289 No longer output the rule numbers, but do output the state number.
13290 A single loop for the shifts + gotos is enough, but picked a
13291 distinct color for each.
13292 (print_graph): Initialize and finalize closure.
13293
107f7dfb
AD
132942001-12-13 Akim Demaille <akim@epita.fr>
13295
13296 * src/reader.c (readgram): Remove dead code, an strip useless
13297 braces.
13298 (get_type): Remove, unused.
13299
9b53a24f
AD
133002001-12-12 Akim Demaille <akim@epita.fr>
13301
13302 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13303 on that of lib/error.c.
13304
dbfb6dcd
AD
133052001-12-12 Akim Demaille <akim@epita.fr>
13306
13307 Some hosts don't like `/' in includes.
13308
13309 * src/system.h: Include libgettext.h without qualifying the path.
13310 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13311 $(top_srcdir).
13312
c25fb648
MA
133132001-12-11 Marc Autret <autret_m@epita.fr>
13314
13315 * src/output.c (output_parser): Remove useless muscle.
13316
710ddc4f
MA
133172001-12-11 Marc Autret <autret_m@epita.fr>
13318
13319 * src/bison.simple: Remove #line just before %%epilogue. It
13320 is now handled in ...
13321 * src/reader.c (read_additionnal_code): Add the output of a
13322 #line for the epilogue.
13323
e83d80b8
MA
133242001-12-10 Marc Autret <autret_m@epita.fr>
13325
927c1557 13326 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
13327 replace precedent remove.
13328 * src/bison.simple: Remove #line before %%prologue because
13329 %%input-line is wrong at this time.
13330
971d5158
MA
133312001-12-10 Marc Autret <autret_m@epita.fr>
13332
13333 * src/reader.c (symbols_output): Clean up.
927c1557 13334 * src/output.c (output_gram, output): Clean up.
971d5158 13335
5edafffd
AD
133362001-12-10 Akim Demaille <akim@epita.fr>
13337
13338 * src/lalr.c (initialize_lookaheads): New. Extracted from...
13339 * src/LR0.c (set_state_table): here.
13340 * src/lalr.c (lalr): Call it.
13341
0279f8e9
AD
133422001-12-10 Akim Demaille <akim@epita.fr>
13343
13344 * src/state.h (shifts): Remove the `number' member: shifts are
13345 attached to state, hence no longer need to be labelled with a
13346 state number.
13347
190c4f5f
AD
133482001-12-10 Akim Demaille <akim@epita.fr>
13349
13350 Now that states have a complete set of members, the linked list of
13351 shifts is useless: just fill directly the state's shifts member.
13352
13353 * src/state.h (shifts): Remove the `next' member.
13354 * src/LR0.c (first_state, last_state): Remove.
13355 Adjust the callers.
13356 (augment_automaton): Don't look for the shifts that must be added
13357 a shift on EOF: it is those of the state we looked for! But now,
13358 since shifts are attached, it is no longer needed to looking
13359 merely by its id: its number.
13360
2a73b93d
AD
133612001-12-10 Akim Demaille <akim@epita.fr>
13362
13363 * src/LR0.c (augment_automaton): Better variable locality.
13364 Remove an impossible branch: if there is a state corresponding to
13365 the start symbol being shifted, then there is shift for the start
13366 symbol from the initial state.
13367
74392f6a
AD
133682001-12-10 Akim Demaille <akim@epita.fr>
13369
13370 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
13371 only when appropriate: when insert_start_shifting_state' is not
13372 invoked.
13373 * tests/regression.at (Rule Line Numbers): Adjust.
13374
37c82725
AD
133752001-12-10 Akim Demaille <akim@epita.fr>
13376
13377 * src/LR0.c (augment_automaton): Now that all states have shifts,
13378 merge the two cases addition shifts to the initial state.
13379
6a164e0c
AD
133802001-12-10 Akim Demaille <akim@epita.fr>
13381
13382 * src/lalr.c (set_state_table): Move to...
13383 * src/LR0.c: here.
13384 * src/lalr.c (lalr): Don't call it...
13385 * src/LR0.c (generate_states): do it.
13386 * src/LR0.h (first_state): Remove, only the table is used.
13387
7215de24
AD
133882001-12-10 Akim Demaille <akim@epita.fr>
13389
13390 * src/LR0.h (first_shift, first_reduction): Remove.
13391 * src/lalr.c: Don't use first_shift: find shifts through the
13392 states.
13393
80e25d4d
AD
133942001-12-10 Akim Demaille <akim@epita.fr>
13395
13396 * src/LR0.c: Attach shifts to states as soon as they are
13397 computed.
13398 * src/lalr.c (set_state_table): Instead of assigning shifts to
13399 state, just assert that the mapping was properly done.
13400
0ab3728b
AD
134012001-12-10 Akim Demaille <akim@epita.fr>
13402
13403 * src/LR0.c (insert_start_shift): Rename as...
13404 (insert_start_shifting_state): this.
13405 (insert_eof_shifting_state, insert_accepting_state): New.
13406 (augment_automaton): Adjust.
13407 Better locality of the variables.
13408 When looking if the start_symbol is shifted from the initial
13409 state, using `while (... symbol != start_symbol ...)' sounds
13410 better than `while (... symbol < start_symbol ...)': If fail
13411 to see how the order between symbols could be relevant!
13412
78af9bbc
AD
134132001-12-10 Akim Demaille <akim@epita.fr>
13414
13415 * src/getargs.h: Don't declare `spec_name_prefix' and
13416 `spec_file_prefix', declared by src/files.h.
13417 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
13418 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
13419 * src/output.c (prepare): Adjust.
13420 * src/reader.c (symbols_output): Likewise.
13421 * src/vmsgetargs.c: Vaguely adjust, but who cares?
13422
bdef2a41
AD
134232001-12-10 Akim Demaille <akim@epita.fr>
13424
13425 * src/muscle_tab.c (muscle_init): NULL is a better default than
13426 `"0"'.
13427
3735969c
AD
134282001-12-10 Akim Demaille <akim@epita.fr>
13429
13430 * src/reader.c (reader): Calling symbols_output once is enough.
13431
49701457
AD
134322001-12-10 Akim Demaille <akim@epita.fr>
13433
13434 Now that states have a complete set of members, the linked list of
13435 reductions is useless: just fill directly the state's reductions
13436 member.
13437
13438 * src/state.h (struct reductions): Remove member `number' and
13439 `next'.
13440 * src/LR0.c (first_reduction, last_reduction): Remove.
13441 (save_reductions): Don't link the new reductions, store them in
13442 this_state.
13443 * src/lalr.c (set_state_table): No need to attach reductions to
13444 states, it's already done.
13445 * src/output.c (output_actions): No longer free the shifts, then
13446 the reductions, then the states: free all the states and their
13447 members.
13448
0edad749
AD
134492001-12-10 Akim Demaille <akim@epita.fr>
13450
13451 * src/options.c (OPTN, DRTV, BOTH): New.
13452 (option_table): Use them.
13453
0edad749
AD
13454 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
13455 the job of system.h.
13456 * src/options.c: Don't include stdio.h and xalloc.h for the same
13457 reasons.
13458
5449dd0f
AD
134592001-12-10 Akim Demaille <akim@epita.fr>
13460
13461 * src/output.c (output, prepare): Make sure the values of the
13462 muscles `action' and `prologue' are 0-terminated.
13463
a870c567
AD
134642001-12-10 Akim Demaille <akim@epita.fr>
13465
13466 Clean up GCC warnings.
13467
13468 * src/reader.c (copy_action): `buf' is not used.
13469 (parse_skel_decl): Be static.
13470 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
13471 * src/options.h (create_long_option_table): Have a real prototype.
13472 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
13473 (hash_delete_at): Return const void *.
13474 Adjust casts to preserve the const.
13475
80df8768
AD
134762001-12-10 Akim Demaille <akim@epita.fr>
13477
13478 * configure.in: Require 2.52g.
13479 M4 is not needed, but AUTOM4TE is.
13480 * m4/m4.m4: Remove.
13481 * tests/Makefile.am: Adjust.
13482
f693ad14
AD
134832001-12-10 Akim Demaille <akim@epita.fr>
13484
13485 One structure for states is enough, even though theoretically
13486 there are LR(0) states and LALR(1) states.
13487
13488 * src/lalr.h (state_t): Remove.
13489 (state_table): Be state_t **, not state_t *.
13490 * src/state.h (core, CORE_ALLOC): Rename as...
13491 (state_t, STATE_ALLOC): this.
13492 Add the LALR(1) members: shifts, reductions, errs.
13493 * src/LR0.c (state_table): Rename as...
13494 (state_hash): this, to avoid name clashes with the global
13495 `state_table'.
13496 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
13497 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
13498
74ffbcb6
AD
134992001-12-10 Akim Demaille <akim@epita.fr>
13500
13501 Bison dumps core on bash.y.
13502 Reported by Pascal Bart.
13503
13504 * src/warshall.c (bitmatrix_print): New.
13505 (TC): Use it.
ba0fe3c7 13506 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
13507 j must be the outer loop.
13508 * tests/regression.at (Broken Closure): New.
13509
07708e19
AD
135102001-12-05 Akim Demaille <akim@epita.fr>
13511
13512 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
13513 its argument.
ba1ecc07 13514 Reported by Peter Hamorsky.
07708e19 13515
92b16366
AD
135162001-12-05 Akim Demaille <akim@epita.fr>
13517
13518 * src/conflicts.c (err_table): Remove.
13519 (resolve_sr_conflict): Adjust.
13520 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
13521 Rename as...
13522 (state_t.reductions, state_t.shifts): this.
13523
076ab033
AD
135242001-12-05 Akim Demaille <akim@epita.fr>
13525
13526 * src/reduce.c (reduce_grammar_tables): No longer disable the
13527 removal of useless rules via CPP but via `if (0)', so that the
13528 compiler still check the code is valid.
13529 For instance, it should have noticed `rline' no longer exists: use
13530 the `line' member of rule_t.
13531 * src/gram.c (dummy, rline): Remove, unused.
13532
3843c413
AD
135332001-12-05 Akim Demaille <akim@epita.fr>
13534
13535 * src/output.c (pack_vector): Use assert, not berror.
13536 * src/main.c (berror): Remove, unused.
13537
43168960
AD
135382001-12-05 Akim Demaille <akim@epita.fr>
13539
13540 New experimental feature: if --verbose --trace output all the
13541 items of a state, not only its kernel.
13542
13543 * src/print.c (print_core): If `trace_flag', then invoke closure
13544 before outputting the items of the state (print_core is no longer
13545 a correct name them).
13546 (print_results): Invoke new_closure/free_closure if needed.
13547
b2872512
AD
135482001-12-05 Akim Demaille <akim@epita.fr>
13549
13550 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
13551 * src/closure.c, src/closure.h (itemsetsize): Rename as...
13552 (nitemset): for consistency with the rest of the project.
13553
23cbcc6c
AD
135542001-12-05 Akim Demaille <akim@epita.fr>
13555
13556 * src/closure.c (print_closure): Improve.
13557 (closure): Use it for printing input and output.
13558
03ec521c
AD
135592001-12-05 Akim Demaille <akim@epita.fr>
13560
13561 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
13562 indexed by nonterminals.
13563
3a7456dd
AD
135642001-12-05 Akim Demaille <akim@epita.fr>
13565
13566 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
13567 what it was!).
13568 * src/warshall.h: Remove accidental duplication of the content.
13569
1cbcf2e7
AD
135702001-12-05 Akim Demaille <akim@epita.fr>
13571
13572 * src/closure.c (set_fderives): De-obfuscate.
13573
84182270
AD
135742001-12-05 Akim Demaille <akim@epita.fr>
13575
13576 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
13577
3f6f053c
AD
135782001-12-05 Akim Demaille <akim@epita.fr>
13579
13580 * src/closure.c (set_firsts): De-obfuscate.
13581
7a5350ba
AD
135822001-12-05 Akim Demaille <akim@epita.fr>
13583
13584 * src/output.c (action_row): De-obfuscate
13585 using the good o' techniques: arrays not pointers, variable
13586 locality, BITISSET, RESETBIT etc.
13587
d954473d
AD
135882001-12-05 Akim Demaille <akim@epita.fr>
13589
13590 Pessimize the code to simplify it: from now on, all the states
13591 have a valid SHIFTS, which NSHIFTS is possibly 0.
13592
13593 * src/LR0.c (shifts_new): Be global and move to..
13594 * src/state.c, src/state.h: here.
13595 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
13596 * src/print_graph: Adjust.
13597
9839bbe5
AD
135982001-12-05 Akim Demaille <akim@epita.fr>
13599
13600 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
13601 * src/conflicts.c: Use it.
13602 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
13603 incorrectly ``simplified''.
13604
9f136c07
AD
136052001-12-05 Akim Demaille <akim@epita.fr>
13606
13607 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
13608 using the good o' techniques: arrays not pointers, variable
13609 locality, BITISSET, RESETBIT etc.
13610
b608206e
AD
136112001-12-05 Akim Demaille <akim@epita.fr>
13612
13613 * src/state.h (SHIFT_SYMBOL): New.
13614 * src/conflicts.c: Use it to deobfuscate.
13615
52afa962
AD
136162001-12-05 Akim Demaille <akim@epita.fr>
13617
13618 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
13619 (print_reductions): De-obfuscate using the good o' techniques:
13620 arrays not pointers, variable locality, BITISSET.
13621
e74dc321
AD
136222001-12-05 Akim Demaille <akim@epita.fr>
13623
13624 * src/conflicts.c (print_reductions): Arrays, not pointers.
13625 Use BITISSET.
13626
768fca83
AD
136272001-12-05 Akim Demaille <akim@epita.fr>
13628
13629 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13630
a17e599f
AD
136312001-12-05 Akim Demaille <akim@epita.fr>
13632
13633 * src/conflicts.c (print_reductions): Improve variable locality.
13634
a04bc341
AD
136352001-12-05 Akim Demaille <akim@epita.fr>
13636
13637 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13638
c8ea038e
AD
136392001-12-05 Akim Demaille <akim@epita.fr>
13640
13641 * src/conflicts.c (print_reductions): Improve variable locality.
13642
aa2aab3c
AD
136432001-12-05 Akim Demaille <akim@epita.fr>
13644
13645 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
13646 * src/lalr.c: Use them.
13647
b178c8cc
AD
136482001-12-05 Akim Demaille <akim@epita.fr>
13649
13650 * src/LR0.c (augment_automaton): Formatting changes.
13651 Better variable locality.
13652
f67d13aa
AD
136532001-12-05 Akim Demaille <akim@epita.fr>
13654
13655 * src/lalr.c (matrix_print): New.
13656 (transpose): Use it.
13657 Use arrays instead of pointers.
13658
c2713865
AD
136592001-12-05 Akim Demaille <akim@epita.fr>
13660
13661 * src/lalr.c (maxrhs): Move to...
13662 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
13663 * src/lalr.c (build_relations): Adjust.
13664
9887c18a
AD
136652001-12-05 Akim Demaille <akim@epita.fr>
13666
13667 * src/lalr.c (transpose): Free the memory allocated to the
13668 argument, as it is replaced by the results by the unique caller.
13669 (build_relations): Merely invoke transpose: it handles the memory
13670 deallocation.
13671 Improve variable locality.
13672 Avoid variables used as mere abbreviations.
13673 (compute_lookaheads): Use arrays instead of pointers.
13674
4d4f699c
AD
136752001-12-05 Akim Demaille <akim@epita.fr>
13676
13677 * src/lalr.c (initialize_F): Improve variable locality.
13678 Avoid variables used as mere abbreviations.
13679
80a69750
AD
136802001-12-05 Akim Demaille <akim@epita.fr>
13681
13682 * src/derives.c (print_derives): Display the ruleno.
13683 * src/lalr.c (initialize_F, transpose): Better variable locality
13684 to improve readability.
13685 Avoid variables used as mere abbreviations.
13686
fe961097
AD
136872001-12-05 Akim Demaille <akim@epita.fr>
13688
13689 * src/lalr.c (traverse): Use arrays instead of pointers.
13690
e3e4e814
AD
136912001-12-05 Akim Demaille <akim@epita.fr>
13692
13693 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
13694 the handling of squeue.
13695 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13696
630e182b
AD
136972001-12-05 Akim Demaille <akim@epita.fr>
13698
13699 Because useless nonterminals are now kept alive (instead of being
13700 `destroyed'), we now sometimes examine them, and store information
13701 related to them. Hence we need to know their number, and adjust
13702 memory allocations.
13703
13704 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
13705 static.
13706 * src/LR0.c (allocate_itemsets): The memory allocated to
13707 `symbol_count' was used for two different purpose: once to count
13708 the number of occurrences of each symbol, and later reassigned to
13709 `shift_symbol', containing the symbol that can be shifted from a
13710 given state.
13711 Deobfuscate, i.e., allocate, use and free `symbol_count' here
13712 only, and...
13713 (new_itemsets): Allocate `shift_symbol' here.
13714 (allocate_itemsets): symbol_count includes useless nonterminals.
13715 Make room for them.
13716 (free_storage): Use `free', not `XFREE', for pointers that cannot
13717 be null.
13718
81b51460
AD
137192001-12-05 Akim Demaille <akim@epita.fr>
13720
13721 * src/nullable.c (set_nullable): Deobfuscate the handling of
13722 ritem.
13723 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13724
3067fbef
AD
137252001-12-05 Akim Demaille <akim@epita.fr>
13726
13727 * src/gram.c, src/gram.h (ritem_print): New.
13728 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
13729 (This useless function was defined only to work around VMS linkers
13730 that can't handle compilation units with variables only).
13731 * src/reduce.c (dump_grammar): Use it to trace the construction of
13732 ritem.
13733
c2bea5f9
PE
137342001-12-04 Paul Eggert <eggert@twinsun.com>
13735
7d27c823
PE
13736 * src/bison.simple (union yyalloc): Change member names
13737 to be the same as the stack names.
13738 (yyparse): yyptr is now union yyalloc *, not char *.
13739 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
13740 and may generate better code on some machines.
c2bea5f9
PE
13741 (yystpcpy): Use prototype if __STDC__ is defined, not just
13742 if __cplusplus is defined.
35687a9d 13743
2c8a9dfa
AD
137442001-11-30 Akim Demaille <akim@epita.fr>
13745
13746 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
13747 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
13748 Gettext doesn't compile cleanly, and dies with -Werror.
13749 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
13750 Include WARNING_CFLAGS here.
13751 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
13752 before being defined.
13753
f4e421e6
AD
137542001-11-27 Paul Eggert <eggert@twinsun.com>
13755
13756 * lib/quotearg.h (quotearg_n, quotearg_n_style):
13757 First arg is int, not unsigned.
13758 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
13759 (SIZE_MAX, UINT_MAX): New macros.
13760 (quotearg_n_options): Abort if N is negative.
13761 Avoid overflow check on hosts where size_t is 64 bits and int
13762 is 32 bits, as overflow is impossible there.
13763 Fix off-by-one typo that caused unnecessary reallocation.
13764
7093d0f5
AD
137652001-11-29 Paul Eggert <eggert@twinsun.com>
13766
13767 Name space cleanup in generated parser.
13768
13769 * doc/bison.texinfo (Bison Parser): Discuss system headers
13770 and their effect on the user name space.
13771
13772 * src/bison.simple:
13773 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
13774 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
13775 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
13776
13777 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
13778 on user names when possible.
13779
13780 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
13781 Simplify test for whather <alloca.h> exists.
13782
13783 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
13784
13785 (<stdio.h>): Include if YYDEBUG.
13786
13787 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
13788 ! defined (yyoverflow) && ! defined (yymemcpy).
13789
13790 (yymemcpy, yyparse): Rename local variables as needed so that
13791 they all begin with 'yy'.
13792
13793 (yystrlen, yystpcpy): New functions.
13794
13795 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
13796 All uses changed.
13797
13798 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
13799 instead of relying on string.h functions. Use YYSTACK_ALLOC
13800 and YYSTACK_FREE instead of malloc and free.
13801
fd51e5ff
AD
138022001-11-30 Akim Demaille <akim@epita.fr>
13803
13804 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
13805 before their first uses.
13806 (YYBISON, YYPURE): Move to the top of the output.
13807
7d13ff5f
AD
138082001-11-30 Akim Demaille <akim@epita.fr>
13809
13810 * tests/reduce.at (Useless Nonterminals): Fix.
13811
892a3995
AD
138122001-11-30 Akim Demaille <akim@epita.fr>
13813
13814 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
13815 if body instead of `;' to pacify GCC's warnings.
13816
68f1e3ed
AD
138172001-11-30 Akim Demaille <akim@epita.fr>
13818
13819 Instead of mapping the LHS of unused rules to -1, keep the LHS
13820 valid, but flag the rules as invalid.
13821
13822 * src/gram.h (rule_t): `useful' is a new member.
13823 * src/print.c (print_grammar): Adjust.
13824 * src/derives.c (set_derives): Likewise.
13825 * src/reader.c (packgram, reduce_output): Likewise.
13826 * src/reduce.c (reduce_grammar_tables): Likewise.
13827 * tests/reduce.at (Underivable Rules, Useless Rules): New.
13828
d2d1b42b
AD
138292001-11-30 Akim Demaille <akim@epita.fr>
13830
13831 * src/reduce.c (reduce_output): Formatting changes.
13832 * src/print.c (print_results, print_grammar): Likewise.
13833 * tests/regression.at (Rule Line Numbers)
13834 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
13835
760b53a8
AD
138362001-11-30 Akim Demaille <akim@epita.fr>
13837
13838 * src/reduce.c (nonterminals_reduce): Instead of throwing away
13839 useless nonterminals, move them at the end of the symbol arrays.
13840 (reduce_output): Adjust.
13841 * tests/reduce.at (Useless Nonterminals): Adjust.
13842
00238958
AD
138432001-11-30 Akim Demaille <akim@epita.fr>
13844
13845 * src/reduce.c: Various comment/formatting changes.
13846 (nonterminals_reduce): New, extracted from...
13847 (reduce_grammar_tables): here.
13848 (reduce_grammar): Call nonterminals_reduce.
13849
396452de
PE
138502001-11-29 Paul Eggert <eggert@twinsun.com>
13851
13852 * src/bison.simple (YYSTACK_REALLOC): Remove.
13853 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
13854 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
13855 New macros.
13856 (union yyalloc): New type.
13857 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
13858 an arbitrary restriction on hosts where size_t is wider than int.
13859
13860 (yyparse): Don't dump core if alloca or malloc fails; instead, report
13861 a parser stack overflow. Allocate just one block of memory for all
13862 three stacks, instead of allocating three blocks; this typically is
13863 faster and reduces fragmentation.
13864
13865 Do not limit the number of items in the stack to a value that fits
13866 in 'int', as this is an arbitrary limit on hosts with 64-bit
13867 size_t and 32-bit int.
13868
147e184c
MA
138692001-11-29 Marc Autret <autret_m@epita.fr>
13870
13871 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
13872 of defining YYERROR_VERBOSE.
13873 [AT_DATA]: $4 is now out of C declarations in the prologue.
13874
426cf563
MA
138752001-11-28 Marc Autret <autret_m@epita.fr>
13876
13877 * src/reader.c (parse_dquoted_param): New.
13878 (parse_skel_decl): Use it.
13879 * src/lex.h: Add its prototype.
13880 * src/lex.c (literalchar): Become not static.
13881
c7925b99
MA
138822001-11-28 Marc Autret <autret_m@epita.fr>
13883
13884 * src/output.h: And put its extern declaration here.
13885 * src/output.c (error_verbose): Define here.
13886 (prepare): Echo name modification.
13887 * src/getargs.h: Clean its extern declaration.
13888 * src/getargs.c (error_verbose_flag): Remove.
13889 (getargs): Remove case 'e'.
13890 * src/options.c (option_table): 'error-verbose' is now seen as simple
13891 percent option.
13892 Include output.h.
13893
13894 * src/reader.c (read_declarations): Remove case tok_include.
13895 (parse_include_decl): Remove.
13896 * src/lex.h (token_t): Remove tok_include.
13897 * src/options.c (option_table): 'include' is now a simple command line
13898 option.
13899
5b5d1929
MA
139002001-11-28 Marc Autret <autret_m@epita.fr>
13901
13902 * src/bison.simple: Adjust muscle names.
13903 * src/muscle_tab.c (muscle_init): Also rename the muscles.
13904 * src/output.c (prepare): s/_/-/ for the muscles names.
13905 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
13906
8850be4b
MA
139072001-11-28 Marc Autret <autret_m@epita.fr>
13908
13909 * src/bison.simple: Fix debug.
13910 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
13911
4a38e613
AD
139122001-11-28 Akim Demaille <akim@epita.fr>
13913
13914 * src/LR0.c (shifts_new): New.
13915 (save_shifts, insert_start_shift, augment_automaton): Use it.
13916
4b35e1c1
AD
139172001-11-28 Akim Demaille <akim@epita.fr>
13918
13919 * src/closure.c (closure): `b' and `ruleno' denote the same value:
13920 keep ruleno only.
13921
d2b04478
AD
139222001-11-28 Akim Demaille <akim@epita.fr>
13923
13924 * src/closure.c (closure): Instead of looping over word in array
13925 then bits in words, loop over bits in array.
13926
2c4c30aa
AD
139272001-11-28 Akim Demaille <akim@epita.fr>
13928
13929 * src/closure.c (closure): No longer optimize the special case
13930 where all the bits of `ruleset[r]' are set to 0, to make the code
13931 clearer.
13932
576890b7
AD
139332001-11-28 Akim Demaille <akim@epita.fr>
13934
13935 * src/closure.c (closure): `r' and `c' are new variables, used to
13936 de-obfuscate accesses to RULESET and CORE.
13937
cb487d7d
AD
139382001-11-28 Akim Demaille <akim@epita.fr>
13939
13940 * src/reduce.c (reduce_print): Use ngettext.
13941 (dump_grammar): Improve the trace accuracy.
13942
6013d43f
AD
139432001-11-28 Akim Demaille <akim@epita.fr>
13944
13945 * src/reduce.c (dump_grammar): Don't translate trace messages.
13946
cb4956ee
AD
139472001-11-28 Akim Demaille <akim@epita.fr>
13948
13949 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
13950 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
13951 as all tags are free'ed afterwards.
13952 From Enrico Scholz.
13953
648185ab
PE
139542001-11-27 Paul Eggert <eggert@twinsun.com>
13955
13956 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
13957 use alloca when we didn't want to, and vice versa.
13958
68254a03
MA
139592001-11-27 Marc Autret <autret_m@epita.fr>
13960
9113b58f
AD
13961 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
13962 initialization.
68254a03
MA
13963 * src/output.c (prepare): Remove its update.
13964
04d843a2
MA
139652001-11-27 Marc Autret <autret_m@epita.fr>
13966
13967 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
13968 Use %error-verbose.
13969
d2079671 139702001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
13971
13972 * src/bison.simple: Remove YYERROR_VERBOSE using.
13973 Use %%error_verbose.
13974 (yyparse): Likewise.
13975 * src/output.c (prepare): Give its final value.
13976 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
13977 * src/getargs.h: Add its extern declaration.
13978 * src/getargs.c (error_verbose_flag): New int.
13979 (getargs): Update to catch new case.
13980 * src/options.c (option_table): 'error-verbose' is a new option.
13981 (shortopts): Update.
13982
e0327bc8
AD
139832001-11-27 Akim Demaille <akim@epita.fr>
13984
13985 * src/system.h: Use intl/libgettext.h.
13986 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
13987
000f1a3c
AD
139882001-11-27 Akim Demaille <akim@epita.fr>
13989
13990 * tests/torture.at (Exploding the Stack Size with Malloc):
13991 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
13992
26cfe0be
AD
139932001-11-27 Akim Demaille <akim@epita.fr>
13994
13995 * src/files.c: Include error.h.
13996 Reported by Hans Aberg.
13997
f6bd5427
MA
139982001-11-26 Marc Autret <autret_m@epita.fr>
13999
d2079671 14000 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
14001 (read_declarations): Add case tok_include.
14002 * src/getargs.h (include): Add its extern definition.
14003 * src/getargs.c (include): New const char *.
14004 (getargs): Add case '-I'.
14005 * src/options.c (option_table): Add include as command line and
14006 percent option.
14007 * src/lex.h (token_t): Add tok_include.
14008
2ca209c1
AD
140092001-11-26 Akim Demaille <akim@epita.fr>
14010
14011 * src/reader.c (readgram): Make sure rules for mid-rule actions
14012 have a lineno equal to that of their host rule.
14013 Reported by Hans Aberg.
14014 * tests/regression.at (Rule Line Numbers): New.
14015
0e41b407
AD
140162001-11-26 Akim Demaille <akim@epita.fr>
14017
14018 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14019 size_ts.
14020
140212001-11-26 Akim Demaille <akim@epita.fr>
14022
14023 * src/complain.c, src/complain.h (error): Remove, provided by
14024 lib/error.[ch].
14025
e0c40012
AD
140262001-11-26 Akim Demaille <akim@epita.fr>
14027
14028 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14029 issue an error message.
14030 * tests/regression.at (Invalid %directive): New.
14031 Reported by Hans Aberg.
14032
5e147124
AD
140332001-11-26 Akim Demaille <akim@epita.fr>
14034
14035 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14036 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14037
a034c8b8
AD
140382001-11-26 Akim Demaille <akim@epita.fr>
14039
14040 * src/conflicts.c (conflicts_print): Don't complain at all when
14041 there are no reduce/reduce conflicts, and as many shift/reduce
14042 conflicts as expected.
14043 * tests/regression.at (%expect right): Adjust.
14044
c64a20f3
AD
140452001-11-23 Akim Demaille <akim@epita.fr>
14046
14047 * lib/alloca.c: Update, from fileutils.
14048
5b0d29bb
AD
140492001-11-23 Akim Demaille <akim@epita.fr>
14050
14051 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14052
722c4bfe
AD
140532001-11-23 Akim Demaille <akim@epita.fr>
14054
14055 * src/system.h: Include alloca.h.
14056 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14057
6255b435
AD
140582001-11-23 Akim Demaille <akim@epita.fr>
14059
14060 * src/print_graph.c (print_actions): Remove `rule', unused.
14061 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14062 pacify GCC's signed < unsigned warnings.
14063 * src/closure.c (itemsetsize): Likewise.
14064 * src/reader.c (symbol_list_new): Static.
14065
b29b2ed5
AD
140662001-11-23 Akim Demaille <akim@epita.fr>
14067
14068 Attaching lineno to buckets is stupid, since only one copy of each
14069 symbol is kept, only the line of the first occurrence is kept too.
14070
14071 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14072 * src/reader.c (rline_allocated): Remove, unused.
14073 (symbol_list): Have a `line' member.
14074 (symbol_list_new): New.
14075 (readgram): Use it.
14076 * src/print.c (print_grammar): Output the rule line numbers.
14077 * tests/regression.at (Solved SR Conflicts)
14078 (Unresolved SR Conflicts): Adjust.
14079 Reported by Hans Aberg.
14080
a81b1d4a
MA
140812001-11-22 Marc Autret <autret_m@epita.fr>
14082
14083 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14084
c1ecb3c1
MA
140852001-11-22 Marc Autret <autret_m@epita.fr>
14086
14087 * src/muscle_tab.c (muscle_init): Remove initialization of
14088 skeleton muscle.
14089 * src/output.c (output_master_parser): Do it here.
14090
fbe01355
AD
140912001-11-20 Akim Demaille <akim@epita.fr>
14092
14093 * po/sv.po: New.
14094 * configure.in (ALL_LINGUAS): Adjust.
14095 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14096 longer contains strings to translate.
14097
81e895c0
AD
140982001-11-19 Akim Demaille <akim@epita.fr>
14099
14100 * src/conflicts.c (conflicts_print): Add a missing \n.
14101
6bb1878b
AD
141022001-11-19 Akim Demaille <akim@epita.fr>
14103
14104 * src/nullable.c (nullable_print): New.
14105 (set_nullable): Call it when tracing.
14106 Better locality of variables.
14107
d9ec2d07
AD
141082001-11-19 Akim Demaille <akim@epita.fr>
14109
14110 * src/print.c (print_actions): Better locality of variables.
14111
720e5c1b
AD
141122001-11-19 Akim Demaille <akim@epita.fr>
14113
14114 * src/derives.c (print_derives): Fix and enrich.
14115 * src/closure.c (print_fderives): Likewise.
14116
fb908786
AD
141172001-11-19 Akim Demaille <akim@epita.fr>
14118
14119 * src/closure.c (itemsetend): Remove, replaced with...
14120 (itemsetsize): new.
14121
125ecb56
AD
141222001-11-19 Akim Demaille <akim@epita.fr>
14123
14124 * src/LR0.c (kernel_end): Remove, replaced with...
14125 (kernel_size): new.
14126
d8cf039f
AD
141272001-11-19 Akim Demaille <akim@epita.fr>
14128
14129 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14130 to clarify.
14131
7bec0760
AD
141322001-11-19 Akim Demaille <akim@epita.fr>
14133
14134 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14135
c87d4863
AD
141362001-11-19 Akim Demaille <akim@epita.fr>
14137
14138 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14139 trace messages.
14140 * src/LR0.c: Likewise.
14141 (allocate_itemsets): Use arrays instead of pointers to clarify.
14142
9bfe901c
AD
141432001-11-19 Akim Demaille <akim@epita.fr>
14144
14145 * src/getargs.c (statistics_flag): Replace with...
14146 (trace_flag): New.
14147 (longopts): Accept --trace instead of --statistics.
14148 * src/getargs.h, src/options.c: Adjust.
14149 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14150 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14151
97db7bd4
AD
141522001-11-19 Akim Demaille <akim@epita.fr>
14153
cc72668c 14154 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
14155 pointers to clarify the code.
14156 (save_reductions, save_shifts): Factor common parts of alternatives.
14157
2c5f66ed
AD
141582001-11-19 Akim Demaille <akim@epita.fr>
14159
14160 * src/LR0.c (new_state, get_state): Complete TRACE code.
14161 * src/closure.c: Include `reader.h' to get `tags', needed by the
14162 trace code.
14163 Rename the conditional DEBUG as TRACE.
14164 Output consistently TRACEs to stderr, not stdout.
14165 * src/derives.c: Likewise.
14166 * src/reduce.c: (inaccessable_symbols): Using if is better style
14167 than goto.
14168 Use `#if TRACE' instead of `#if 0' for tracing code.
14169
300f275f
AD
141702001-11-19 Akim Demaille <akim@epita.fr>
14171
14172 * src/system.h (LIST_FREE, shortcpy): New.
14173 * src/LR0.c: Use them.
14174 * src/output.c (free_itemsets, free_reductions, free_shifts):
14175 Remove, replaced by LIST_FREE.
14176
f59c437a
AD
141772001-11-19 Akim Demaille <akim@epita.fr>
14178
14179 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14180 (REDUCTIONS_ALLOC): New.
14181 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14182 allocation.
14183
6986fd9e
AD
141842001-11-19 Akim Demaille <akim@epita.fr>
14185
14186 * src/LR0.c (new_state): Complete trace code.
14187 * src/nullable.c (set_nullable): Don't translate traces.
14188
4bc30f78
AD
141892001-11-19 Akim Demaille <akim@epita.fr>
14190
14191 * src/print_graph.c (print_core): Better locality of variables.
14192 * src/print.c (print_core): Likewise.
14193
08a946e0
AD
141942001-11-19 Akim Demaille <akim@epita.fr>
14195
14196 * src/vcg.c: You do the output, so you are responsible of the
14197 handling of VCG syntax, in particular: use quotearg.
14198 * src/print_graph.c: Don't.
14199 (print_actions): Don't output the actions as part of the nodes,
14200 since that's the job of the edges.
14201 (print_state): Don't output by hand: fill the node description,
9bfe901c 14202 and ask for its output.
08a946e0 14203
f0473484
AD
142042001-11-19 Akim Demaille <akim@epita.fr>
14205
cc72668c
AD
14206 * src/bison.simple (yyparse): When verbosely reporting an error,
14207 no longer put additional quotes around token names.
f0473484
AD
14208 * tests/calc.at: Adjust.
14209
e41dc700
AD
142102001-11-19 Akim Demaille <akim@epita.fr>
14211
14212 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14213 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14214 * src/output.c: Adjust.
14215
652a871c
AD
142162001-11-19 Akim Demaille <akim@epita.fr>
14217
14218 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14219 (rule_t): this.
14220 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14221
b2ed6e58
AD
142222001-11-19 Akim Demaille <akim@epita.fr>
14223
14224 * src/gram.h (rule_t): New.
14225 (rule_table): New.
14226 (rrhs, rlhs): Remove, part of state_t.
14227 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14228 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14229 * src/reader.c, src/reduce.c: Adjust.
14230
edad7067
AD
142312001-11-19 Akim Demaille <akim@epita.fr>
14232
14233 * src/reader.c (symbols_output): New, extracted from...
14234 (packsymbols): Here.
14235 (reader): Call it.
14236
3feec034
AD
142372001-11-19 Akim Demaille <akim@epita.fr>
14238
14239 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14240 (maxrhs): this new function.
14241
ddcd5fdf
AD
142422001-11-19 Akim Demaille <akim@epita.fr>
14243
cc72668c 14244 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
14245 Adjust.
14246
bb527fc2
AD
142472001-11-19 Akim Demaille <akim@epita.fr>
14248
cc72668c 14249 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
14250 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14251 * src/lalr.c: Adjust.
14252
a845a697
AD
142532001-11-19 Akim Demaille <akim@epita.fr>
14254
14255 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14256 (set_state_table): handle the `lookaheads' members.
14257
f004bf6a
AD
142582001-11-19 Akim Demaille <akim@epita.fr>
14259
cc72668c
AD
14260 * src/lalr.h (lookaheads): Removed array, whose contents is now
14261 a member of...
f004bf6a
AD
14262 (state_t): this structure.
14263 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14264 Adjust.
14265
de326cc0
AD
142662001-11-19 Akim Demaille <akim@epita.fr>
14267
cc72668c
AD
14268 * src/lalr.h (consistent): Removed array, whose contents is now
14269 a member of...
de326cc0
AD
14270 (state_t): this structure.
14271 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14272 Adjust.
14273
90b4416b
AD
142742001-11-19 Akim Demaille <akim@epita.fr>
14275
cc72668c
AD
14276 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
14277 contents are now members of...
90b4416b
AD
14278 (state_t): this structure.
14279 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14280 Adjust.
14281
9703cc49
AD
142822001-11-19 Akim Demaille <akim@epita.fr>
14283
14284 * src/lalr.h (state_t): New.
14285 (state_table): Be a state_t * instead of a core **.
14286 (accessing_symbol): Remove, part of state_t.
14287 * src/lalr.c: Adjust.
14288 (set_accessing_symbol): Merge into...
14289 (set_state_table): this.
14290 * src/print_graph.c, src/conflicts.c: Adjust.
14291
d803322e
AD
142922001-11-14 Akim Demaille <akim@epita.fr>
14293
14294 * tests/calc.at, tests/output.at, tests/regression.at,
14295 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
14296 now the tests are run in private dirs, therefore AC_CLEANUP and
14297 family can be simplified to 0-ary.
14298 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
14299 use abs. path to find config.h.
14300 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
14301 stderr, there can be way too much random noise.
14302 Instead pass -Werror to GCC and rely on the exit status.
14303 Reported by Wolfram Wagner.
14304
3d76b07d
AD
143052001-11-14 Akim Demaille <akim@epita.fr>
14306
14307 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14308 defined only if yyoverflow is defined, to avoid `warning: unused
14309 variable `yyvs1''.
14310 Reported by The Test Suite.
14311
09b503c8
AD
143122001-11-14 Akim Demaille <akim@epita.fr>
14313
14314 * src/print.c: Include reduce.h.
14315 Reported by Hans Aberg.
14316
143172001-11-14 Akim Demaille <akim@epita.fr>
14318
14319 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
14320 Revert a previous patch: these are really const.
14321 * src/conflicts.c (conflict_report): Additional useless pair of
14322 braces to pacify GCC's warnings for `if () if () {} else {}'.
14323 * src/lex.c (parse_percent_token): Replace equal_offset with
14324 arg_offset.
14325 arg is const.
14326 Be sure to strdup `arg' when used, since there is no reason for
14327 token_buffer not to change.
14328
0f37a994
AD
143292001-11-14 Akim Demaille <akim@epita.fr>
14330
14331 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
14332 definition.
14333 * src/main.c (main): Use them.
14334 Suggested by Hans Aberg.
14335
d39d93b8
AD
143362001-11-12 Akim Demaille <akim@epita.fr>
14337
14338 * src/system.h (ngettext): Now that we use ngettext, be sure to
14339 provide a default definition when NLS are not used.
14340
9edcd895
AD
143412001-11-12 Akim Demaille <akim@epita.fr>
14342
14343 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
14344 Use @kbd to denote user input.
14345 (Language and Grammar): ANSIfy the example.
14346 Adjust its layout for info/notinfo.
14347 (Location Tracking Calc): Output error messages to stderr.
14348 Output locations in a more GNUtically correct way.
14349 Fix a couple of Englishos.
14350 Adjust @group/@end group pairs.
14351
7da99ede
AD
143522001-11-12 Akim Demaille <akim@epita.fr>
14353
e3aa65c5 14354 %expect was not functioning at all.
7da99ede
AD
14355
14356 * src/conflicts.c (expected_conflicts): Set to -1.
14357 (conflict_report): Use ngettext.
14358 (conflicts_print): Check %expect and make its violation an error.
14359 * doc/bison.texinfo (Expect Decl): Adjust.
14360 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
14361 * tests/regression.at (%expect not enough, %expect right)
14362 (%expect too much): New.
14363
ba9dda1a
AD
143642001-11-12 Akim Demaille <akim@epita.fr>
14365
14366 * tests/regression.at (Conflicts): Rename as...
14367 (Unresolved SR Conflicts): this.
14368 (Solved SR Conflicts): New.
14369
337c5bd1
AD
143702001-11-12 Akim Demaille <akim@epita.fr>
14371
14372 * src/reduce.c (print_results): Rename as...
14373 (reduce_output): This.
14374 Output to OUT, passed as argument, instead of output_obstack.
14375 (dump_grammar): Likewise.
14376 (reduce_free): New.
14377 Also free V1.
14378 (reduce_grammar): No longer call reduce_output, since...
14379 * src/print.c (print_results): do it.
14380 * src/main.c (main): Call reduce_free;
14381
c73a41af
AD
143822001-11-12 Akim Demaille <akim@epita.fr>
14383
14384 * src/conflicts.c (print_reductions): Accept OUT as argument.
14385 Output to it, not to output_obstack.
14386 * src/print.c (print_actions): Adjust.
14387
0df87bb6
AD
143882001-11-12 Akim Demaille <akim@epita.fr>
14389
14390 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
14391 the result instead of using...
14392 (src_total, rrc_total, src_count, rrc_count): Remove.
14393 (any_conflicts): Remove.
14394 (print_conflicts): Split into...
14395 (conflicts_print, conflicts_output): New.
14396 * src/conflicts.h: Adjust.
14397 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 14398 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
14399 * tests/regression.at (Conflicts): New.
14400 Reported by Tom Lane.
14401
e4d3d4de
AD
144022001-11-12 Akim Demaille <akim@epita.fr>
14403
14404 * tests/regression.at (Invalid input): Remove, duplicate with
14405 ``Invalid input: 1''.
14406
6d7d248e
AD
144072001-11-12 Akim Demaille <akim@epita.fr>
14408
14409 * tests/torture.at (AT_DATA_STACK_TORTURE)
14410 (Exploding the Stack Size with Alloca)
14411 (Exploding the Stack Size with Malloc): New.
14412
e9e4c321
AD
144132001-11-12 Akim Demaille <akim@epita.fr>
14414
14415 * src/bison.simple (YYSTACK_REALLOC): New.
14416 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 14417 Reported by Per Allansson.
e9e4c321 14418
5f7e0832
AD
144192001-11-12 Pascal Bart <pascal.bart@epita.fr>
14420
14421 * src/bison.simple: Define type yystype instead of YYSTYPE, and
14422 define CPP macro, which substitute YYSTYPE by yystype.
14423 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
14424 with yyltype/YYLTYPE. This allows inclusion of the generated
14425 header within the parser if the compiler, such as GGC, accepts
14426 multiple equivalent #defines.
14427 From Akim.
14428
e3f1699f
AD
144292001-11-05 Akim Demaille <akim@epita.fr>
14430
14431 * src/reader.c (symbols_output): New, extracted from...
14432 (packsymbols): here.
14433 (reader): Adjust.
14434
65be0866
AD
144352001-11-05 Akim Demaille <akim@epita.fr>
14436
14437 * src/lex.c (parse_percent_token): s/quotearg/quote/.
14438
e4d910bf
AD
144392001-11-05 Akim Demaille <akim@epita.fr>
14440
14441 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
14442 pattern.
14443
951366c1
AD
144442001-11-05 Akim Demaille <akim@epita.fr>
14445
14446 * src/options.h (struct option_table_struct): set_flags is void*.
14447 * src/options.c (longopts): Support `--output' and `%output'.
14448 (usage): Adjust.
14449 * src/lex.h (tok_setopt): Remove, replaced with...
14450 (tok_intopt, tok_stropt): these new guys.
14451 * src/lex.c (getopt.h): Not needed.
14452 (token_buffer, unlexed_token_buffer): Not const.
14453 (percent_table): Promote `-' over `_' in directive names.
14454 Active `%name-prefix', `file-prefix', and `output'.
14455 (parse_percent_token): Accept possible arguments to directives.
14456 Promote `-' over `_' in directive names.
14457
d8988b2f
AD
144582001-11-04 Akim Demaille <akim@epita.fr>
14459
14460 * doc/bison.texinfo (Decl Summary): Split the list into
14461 `directives for grammars' and `directives for bison'.
14462 Sort'em.
14463 Add description of `%name-prefix', `file-prefix', and `output'.
14464 Promote `-' over `_' in directive names.
14465 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
14466 Simplify the description of `--name-prefix'.
14467 Promote `-' over `_' in directive names.
14468 Promote `--output' over `--output-file'.
14469 Fix the description of `--defines'.
14470 * tests/output.at: Exercise %file-prefix and %output.
14471
6468d18e
AD
144722001-11-02 Akim Demaille <akim@epita.fr>
14473
14474 * doc/refcard.tex: Update.
14475
6b7e85b9
AD
144762001-11-02 Akim Demaille <akim@epita.fr>
14477
14478 * src/symtab.h (SUNDEF): New.
14479 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
14480 stand for `uninitialized', instead of 0.
14481 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
14482 * src/lex.c (lex): Adjust.
14483
14484 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
14485 Number it 0.
14486 Let yylex return it instead of a plain 0.
14487 Reported by Dick Streefland.
14488
cd5aafcf
AD
144892001-11-02 Akim Demaille <akim@epita.fr>
14490
14491 * tests/regression.at (Mixing %token styles): New test.
14492
037ca2f1
AD
144932001-11-02 Akim Demaille <akim@epita.fr>
14494
14495 * src/reader.c (parse_thong_decl): Formatting changes.
14496 (token_translations_init): New, extracted from...
14497 (packsymbols): Here.
14498 Adjust.
14499
270a173c
AD
145002001-11-01 Akim Demaille <akim@epita.fr>
14501
14502 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
14503 Check that `9foo.y' produces correct cpp guards.
14504 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
14505 guards.
14506 Reported by Wwp.
14507
561f9a30
AD
145082001-11-01 Akim Demaille <akim@epita.fr>
14509
14510 * tests/regression.at (Invalid input: 2): New.
14511 * src/lex.c (unlexed_token_buffer): New.
14512 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
14513 too.
14514 Reported by Wwp.
14515
f987e9d2
AD
145162001-11-01 Akim Demaille <akim@epita.fr>
14517
14518 * tests/calc.at: Catch up with 1.30.
14519 * configure.in: Bump to 1.49a.
14520 Adjust to newer Autotest.
14521
0846f581
PB
145222001-10-19 Pascal Bart <pascal.bart@epita.fr>
14523
14524 * src/conflicts.c: Move global variables rrc_total and src_total ...
14525 (print_conflicts): here.
14526 * src/output.c (output): Free global variable user_toknums.
14527 * src/lex.c (token_obstack): Become static.
14528
3c1a79b3
AD
145292001-10-18 Akim Demaille <akim@epita.fr>
14530
14531 * tests/atlocal.in (GCC): Add.
14532 * tests/calc.at: s/m4_match/m4_bmatch/.
14533 s/m4_patsubst/m4_bpatsubst/.
14534 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
14535 * configure.in: AC_SUBST(GCC).
14536
5d52e7d0
MA
145372001-10-14 Marc Autret <autret_m@epita.fr>
14538
14539 * src/options.c (create_long_option_table): Fix.
14540
631aa1d3
AD
145412001-10-10 Akim Demaille <akim@epita.fr>
14542
14543 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
14544
f6ec6d13
AD
145452001-10-04 Akim Demaille <akim@epita.fr>
14546
14547 * src/reader.c (parse_union_decl): Push the caracters in
14548 union_obstack, not attrs_obstack.
14549
342b8b6e
AD
145502001-10-04 Akim Demaille <akim@epita.fr>
14551
14552 Merge in the branch 1.29.
14553
14554 * src/reader.c (packsymbols): Use a temporary obstack for
14555 `%%tokendef', since output_stack is already used elsewhere.
14556
14557 2001-10-02 Akim Demaille <akim@epita.fr>
14558
14559 Bump 1.29d.
14560
14561 2001-10-02 Akim Demaille <akim@epita.fr>
14562
14563 Version 1.29c.
14564
14565 2001-10-02 Akim Demaille <akim@epita.fr>
14566
14567 * tests/regression.at (Invalid CPP headers): New.
14568 From Alexander Belopolsky.
14569 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
14570
14571 2001-10-02 Akim Demaille <akim@epita.fr>
14572
14573 * tests/regression.at (Invalid input): New.
14574 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
14575 Reported by Shura.
14576
14577 2001-10-02 Akim Demaille <akim@epita.fr>
14578
14579 * tests/calc.at: Now that --debug works, the tests must be adjusted.
14580
14581 2001-10-02 Akim Demaille <akim@epita.fr>
14582
14583 * src/output.c (output_parser): Assert `skeleton'.
14584 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
14585 systems.
14586 From Shura.
14587
14588 2001-10-01 Marc Autret <autret_m@epita.fr>
14589
14590 * src/lex.h: Echo modifications.
14591 * src/lex.c (unlex): Parameter is now token_t.
14592 From Hans Aberg.
14593
14594 2001-10-01 Marc Autret <autret_m@epita.fr>
14595
14596 * src/main.c: Include lex.h.
14597 From Hans Aberg.
14598
14599 2001-09-29 Akim Demaille <akim@epita.fr>
14600
14601 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
14602
14603 2001-09-28 Akim Demaille <akim@epita.fr>
14604
14605 * tests/testsuite.at: Update to newer Autotest.
14606 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
14607
14608 2001-09-27 Akim Demaille <akim@epita.fr>
14609
14610 Position independent wrapper.
14611
14612 * tests/bison: Remove.
14613 * tests/bison.in: New.
14614 * configure.in: Adjust.
14615
14616 2001-09-27 Paul Eggert <eggert@twinsun.com>
14617
14618 Port quotearg fixes from tar 1.13.24.
14619
14620 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
14621 tm to be declared.
14622 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
14623 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
14624
14625 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
14626 * m4/mbrtowc.m4: New file.
14627 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
14628 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
14629
14630 2001-09-27 Akim Demaille <akim@epita.fr>
14631
14632 Bump to 1.29c.
14633
14634 2001-09-27 Akim Demaille <akim@epita.fr>
14635
14636 Version 1.29b.
14637
14638 2001-09-25 Akim Demaille <akim@epita.fr>
14639
14640 * src/system.h: Include `xalloc.h'.
14641 Remove it from the C files.
14642 * src/files.c (output_files): Free the obstacks.
14643 * src/lex.c (init_lex): Rename as...
14644 (lex_init): this.
14645 (lex_free): New.
14646 * src/main.c (main): Use it.
14647
14648 2001-09-24 Marc Autret <autret_m@epita.fr>
14649
14650 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
14651 to output informations in fout (FILE*).
14652 (open_graph, close_graph): Likewise.
14653 (output_graph, output_edge, output_node): Likewise.
14654 * src/vcg.h: Update function prototypes.
14655 * src/print_graph.c (print_graph): Open output graph file.
14656 (print_actions): Adjust.
14657 * src/files.h: Remove extern declaration.
14658 * src/files.c: Remove graph_obstack declaration.
14659 (open_files): Remove graph_obstack initialization.
14660 (output_files): Remove graph_obstack saving.
14661
14662 2001-09-24 Marc Autret <autret_m@epita.fr>
14663
14664 * src/files.c (compute_output_file_names): Fix.
14665
14666 2001-09-24 Marc Autret <autret_m@epita.fr>,
14667 Akim Demaille <akim@epita.fr>
14668
14669 * src/reader.c (reader): Remove call to free_symtab ().
14670 * src/main.c (main): Call it here.
14671 Include symtab.h.
14672 * src/conflicts.c (initialize_conflicts): Rename as...
14673 (solve_conflicts): this.
14674 * src/print.c (print_core, print_actions, print_state)
14675 (print_grammar): Dump to a file instead a `output_obstack'.
14676 (print_results): Dump `output_obstack', and then proceed with the
14677 FILE *.
14678 * src/files.c (compute_output_file_names, close_files): New.
14679 (output_files): Adjust.
14680 * src/main.c (main): Adjust.
14681
14682 2001-09-23 Marc Autret <autret_m@epita.fr>
14683
14684 * src/files.c (compute_header_macro): Computes header macro name
14685 from spec_defines_file when given.
14686
14687 2001-09-23 Marc Autret <autret_m@epita.fr>
14688
14689 * src/files.c (output_files): Add default extensions.
14690
14691 2001-09-22 Akim Demaille <akim@epita.fr>
14692
14693 * src/conflicts.c (finalize_conflicts): Rename as...
14694 (free_conflicts): this.
14695
14696 2001-09-22 Akim Demaille <akim@epita.fr>
14697
14698 * src/gram.c (gram_free): Rename back as...
14699 (dummy): this.
14700 (output_token_translations): Free `token_translations'.
14701 * src/symtab.c (free_symtab): Free the tag field.
14702
14703 2001-09-22 Akim Demaille <akim@epita.fr>
14704
14705 Remove `translations' as it is always set to true.
14706
14707 * src/gram.h: Adjust.
14708 * src/reader.c (packsymbols, parse_token_decl): Adjust
14709 * src/print.c (print_grammar): Adjust.
14710 * src/output.c (output_token_translations): Adjust.
14711 * src/lex.c (lex): Adjust.
14712 * src/gram.c: Be sure the set pointers to NULL.
14713 (dummy): Rename as...
14714 (gram_free): this.
14715
14716 2001-09-22 Akim Demaille <akim@epita.fr>
14717
14718 * configure.in: Invoke AM_LIB_DMALLOC.
14719 * src/system.h: Use dmalloc.
14720 * src/LR0.c: Be sure to have pointers initialized to NULL.
14721 (allocate_itemsets): Allocate kernel_items only if needed.
14722
14723 2001-09-22 Akim Demaille <akim@epita.fr>
14724
14725 * configure.in: Bump to 1.29b.
14726 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
14727 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
14728 need xmalloc.c in calc.y.
14729 From Pascal Bart.
14730
14731 2001-09-21 Akim Demaille <akim@epita.fr>
14732
14733 Version 1.29a.
14734 * Makefile.maint, config/config.guess, config/config.sub,
14735 * config/missing: Update from masters.
14736 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
14737 upon package.m4.
14738 * configure.in (ALL_LINGUAS): Add `tr'.
14739
14740 2001-09-21 Akim Demaille <akim@epita.fr>
14741
14742 * tests/Makefile.am (package.m4): Move to...
14743 ($(srcdir)/$(TESTSUITE)): here.
14744
14745 2001-09-20 Akim Demaille <akim@epita.fr>
14746
14747 * src/complain.c: No longer try to be standalone: use system.h.
14748 Don't assume __STDC__ is defined to 1. Just test if it is defined.
14749 * src/complain.h: Likewise.
14750 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
14751 Remove the unused variable `n'.
14752 From Albert Chin-A-Young.
14753
14754 2001-09-18 Marc Autret <autret_m@epita.fr>
14755
14756 * doc/bison.1: Update.
14757 * doc/bison.texinfo (Bison Options): Update --defines and --graph
14758 descriptions.
14759 (Option Cross Key): Update.
14760 Add --graph.
14761
14762 2001-09-18 Marc Autret <autret_m@epita.fr>
14763
14764 * tests/regression.at: New test (comment in %union).
14765
14766 2001-09-18 Marc Autret <autret_m@epita.fr>
14767
14768 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
14769 do that.
14770 Reported by Keith Browne.
14771
14772 2001-09-18 Marc Autret <autret_m@epita.fr>
14773
14774 * tests/output.at: Add tests for --defines and --graph.
14775
14776 2001-09-18 Marc Autret <autret_m@epita.fr>
14777
14778 * tests/output.at: Removes tests of %{header,src}_extension features.
14779
14780 2001-09-18 Akim Demaille <akim@epita.fr>
14781
14782 * tests/Makefile.am (package.m4): New.
14783 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
14784 (_AT_CHECK_CALC_ERROR): Likewise.
14785 Factor the `, ' part of verbose error messages.
14786
14787 2001-09-18 Marc Autret <autret_m@epita.fr>
14788
14789 * src/getargs.c (longopts): Declare --defines and --graph as options
14790 with optional arguments.
14791 * src/files.h: Add extern declarations.
14792 * src/files.c (spec_graph_file, spec_defines_file): New.
14793 (output_files): Update.
14794 Remove CPP-outed code.
14795
14796 2001-09-18 Marc Autret <autret_m@epita.fr>
14797
14798 Turn off %{source,header}_extension feature.
14799
14800 * src/files.c (compute_exts_from_gf): Update.
14801 (compute_exts_from_src): Update.
14802 (output_files): CPP-out useless code.
14803 * src/files.h: Remove {header,source}_extension extern declarations.
14804 * src/reader.c (parse_dquoted_param): CPP-out.
14805 (parse_header_extension_decl): Remove.
14806 (parse_source_extension_decl): Remove.
14807 (read_declarations): Remove cases tok_{hdrext,srcext}.
14808 * src/lex.c (percent_table): Remove {header,source}_extension entries.
14809 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
14810
14811 2001-09-10 Akim Demaille <akim@epita.fr>
14812
14813 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
14814 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
14815 (AT_CHECK_OUTPUT): this.
14816 Merely check ls' exit status, its output is useless.
14817
14818 2001-09-10 Akim Demaille <akim@epita.fr>
14819
14820 * tests/calc.at: Use m4_match.
14821 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
14822
14823 2001-09-10 Marc Autret <autret_m@epita.fr>,
14824 Akim Demaille <akim@epita.fr>
14825
14826 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
14827 enum color_e.
14828 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
14829 to `normal'.
14830 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
14831 * src/lex.h: Adjust prototype.
14832 (token_t): Add `tok_undef'.
14833 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
14834 (parse_percent_token): Now returns token_t.
14835 Add default statement in switch.
14836 (lex): Separate `c' as an input variable, from the token_t result
14837 part.
14838 (unlexed): Is a token_t.
14839
14840 2001-09-10 Akim Demaille <akim@epita.fr>
14841
14842 * configure.in: Bump to 1.29a.
14843
14844 2001-09-07 Akim Demaille <akim@epita.fr>
14845
14846 Version 1.29.
14847
14848 2001-08-30 Akim Demaille <akim@epita.fr>
14849
14850 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
14851 * m4/atconfig.m4: Remove.
14852 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
14853 * tests/bison: New.
14854 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
14855 m4_if, m4_patsubst, and m4_regexp.
14856 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
14857 `input' file instead of echo.
14858
14859 2001-08-29 Akim Demaille <akim@epita.fr>
14860
14861 Bump to 1.28e.
14862
14863 2001-08-29 Akim Demaille <akim@epita.fr>
14864
14865 Version 1.28d.
14866
14867 2001-08-29 Paul Eggert <eggert@twinsun.com>
14868
14869 * src/bison.simple (yyparse): Don't take the address of an
14870 item before the start of an array, as that doesn't conform to
14871 the C Standard.
14872
14873 2001-08-29 Robert Anisko <anisko_r@epita.fr>
14874
14875 * doc/bison.texinfo (Location Tracking Calc): New node.
14876
14877 2001-08-29 Paul Eggert <eggert@twinsun.com>
14878
14879 * src/output.c (output): Do not define const, as this now
14880 causes more problems than it cures.
14881
14882 2001-08-29 Akim Demaille <akim@epita.fr>
14883
14884 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
14885 the nodes.
14886 Be sure to tag the `detailmenu'.
14887
14888 2001-08-29 Akim Demaille <akim@epita.fr>
14889
14890 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
14891 download in a tmp dir.
14892
14893 2001-08-28 Marc Autret <autret_m@epita.fr>
14894
14895 * config/depcomp: New file.
14896
14897 2001-08-28 Marc Autret <autret_m@epita.fr>
14898
14899 * doc/bison.1 (mandoc): Adjust.
14900 From Juan Manuel Guerrero.
14901
14902 2001-08-28 Marc Autret <autret_m@epita.fr>
14903
14904 * src/print_graph.c (print_state): Fix.
14905
14906 2001-08-27 Marc Autret <autret_m@epita.fr>
14907
14908 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
14909 char * members.
14910 Echo modifications to the functions prototypes.
14911 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
14912
14913 2001-08-27 Marc Autret <autret_m@epita.fr>
14914
14915 * src/vcg.c: Include `xalloc.h'.
14916 (add_colorentry): New.
14917 (add_classname): New.
14918 (add_infoname): New.
14919 * src/vcg.h: Add new prototypes.
14920
14921 2001-08-27 Akim Demaille <akim@epita.fr>
14922
14923 * Makefile.maint: Sync. again with CVS Autoconf.
14924
14925 2001-08-27 Akim Demaille <akim@epita.fr>
14926
14927 * Makefile.maint: Formatting changes.
14928 (po-update, cvs-update, update): New targets.
14929 (AMTAR): Remove.
14930
14931 2001-08-27 Akim Demaille <akim@epita.fr>
14932
14933 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
14934 * Makefile.maint: Sync. with CVS Autoconf.
14935
14936 2001-08-27 Marc Autret <autret_m@epita.fr>
14937
14938 * src/vcg.h (struct infoname_s): New.
14939 (struct colorentry_s): New.
14940 (graph_s): New fields {vertical,horizontal}_order in structure.
14941 Add `infoname' field.
14942 Add `colorentry' field;
14943 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
14944 (G_HORIZONTAL_ORDER): New.
14945 (G_INFONAME): New.
14946 (G_COLORENTRY): New.
14947 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
14948 Add output of `infoname'.
14949 Add output of `colorentry'.
14950
14951 2001-08-27 Marc Autret <autret_m@epita.fr>
14952
14953 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
14954 This one shadowed a global parameter.
14955
14956 2001-08-24 Marc Autret <autret_m@epita.fr>
14957
14958 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
14959 instead of `unsigned'.
14960 (print_state): Do not call obstack_object_size () in obstack_grow ()
14961 to avoid macro variables shadowing.
14962
14963 2001-08-23 Marc Autret <autret_m@epita.fr>
14964
14965 * src/lex.c (percent_table): Typo: s/naem/name/.
14966 Add graph option.
14967 Normalize new options declarations.
14968
14969 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
14970
14971 * tests/suite.at: Exercise %header_extension and %source_extension.
14972
14973 2001-08-16 Marc Autret <autret_m@epita.fr>
14974
14975 * src/reader.c (parse_dquoted_param): New.
14976 (parse_header_extension_decl): Use it.
14977 (parse_source_extension_decl): Likewise.
14978
14979 2001-08-16 Marc Autret <autret_m@epita.fr>
14980
14981 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
14982 (get_xxxx_str): Use assert () instead of complain ().
14983 Remove return invokations in default cases.
14984 (get_decision_str): Modify default behaviour. Remove second argument.
14985 Echo modifications on calls.
14986 (output_graph): Fix.
14987
14988 2001-08-16 Marc Autret <autret_m@epita.fr>
14989
14990 * src/getargs.c (usage): Update with ``-g, --graph''.
14991
14992 2001-08-16 Marc Autret <autret_m@epita.fr>
14993
14994 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
14995 (Option Cross Key): Likewise.
14996 * doc/bison.1: Update.
14997
1c8c2190
PB
149982001-09-25 Pascal Bart <pascal.bart@epita.fr>
14999
15000 * src/output.c (output_master_parser): Don't finish action_obstack.
15001 (output_parser): Don't care about the muscle action, here.
15002 (prepare): Copy the action_obstack in the action muscle.
15003 (output): Free action_obstack.
15004
180d45ba
PB
150052001-09-23 Pascal Bart <pascal.bart@epita.fr>
15006
15007 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15008 will contain `%union' declaration.
15009 (parse_union_decl): Delete #line directive output.
15010 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15011 informations about %union.
15012 (parse_union_decl): Copy the union_obstack in the muscle stype.
15013 * src/bison.simple: Add new #line directive.
15014 Add typdef %%stype YYSTYPE.
15015
c51d1a19
PB
150162001-09-23 Pascal Bart <pascal.bart@epita.fr>
15017
15018 * src/bison.simple: Add new `#line' directive.
15019
6f9344da
PB
150202001-09-22 Pascal Bart <pascal.bart@epita.fr>
15021
15022 * src/bison.simple: New `#line' directive.
15023 * src/output.c (output_parser): Support new dynamic muscle input_line.
15024
652def80
MA
150252001-09-22 Marc Autret <autret_m@epita.fr>
15026
15027 * src/output.c (output_master_parser): New.
15028 (output_parser): Be more re-entrant.
15029
25b222fa
MA
150302001-09-21 Marc Autret <autret_m@epita.fr>
15031
15032 * src/reader.c (copy_definition, parse_union_decl): Update and use
15033 `linef' muscle.
15034 (copy_action): Likewise.
15035 Use obstack_1grow ().
15036 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15037
6bc35ae5
MA
150382001-09-21 Marc Autret <autret_m@epita.fr>
15039
15040 * src/options.c (option_table): Adjust.
15041 * src/lex.c (parse_percent_token): Fix.
15042
c0629aa1
PB
150432001-09-20 Pascal Bart <pascal.bart@epita.fr>
15044
15045 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 15046
82b6d266
PB
150472001-09-20 Pascal Bart <pascal.bart@epita.fr>
15048
15049 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15050 is now an option_table_struct*.
15051 (option_strcmp): New function option_strcmp.
15052 (parse_percent_token): Call option_strcmp.
15053 * src/getargs.c (xalloc.h, options.h): Include it.
15054 (getargs): Call create_long_option_table.
15055 (getargs): Free longopts at the end of the function.
15056 (shortopts): Move in options.c.
15057 * src/options.c (create_long_option_table): New function. Convert
15058 information from option_table to option structure.
15059 * src/reader.c (options.h): Include it.
15060
15061 * src/Makefile.am: Adjust.
15062 * src/options.c (option_table): Create from longopts and percent_table.
15063 * src/getargs.c (longopts): Delete.
15064 * src/lex.c (struct percent_table_struct): Delete.
15065 (percent_table): Delete.
15066 (options.h): Include it.
15067 * src/options.c: Create.
15068 * src/options.h: Create.
15069 Declare enum opt_access_e.
15070 Define struct option_table_struct.
15071
75f5aaea
MA
150722001-09-20 Marc Autret <autret_m@epita.fr>
15073
15074 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15075 sections of Bison.
15076
f508cb0a
PB
150772001-09-19 Pascal Bart <pascal.bart@epita.fr>
15078
15079 * src/bison.simple: s/%%filename/%%skeleton.
15080 * src/muscle_tab.c (getargs.h): Include it.
15081 (muscle_init): Insert new muscle skeleton.
15082
13105fc1
PB
150832001-09-18 Pascal Bart <pascal.bart@epita.fr>
15084
15085 * src/output.c (output_parser): Delete unused variable actions_dumped.
15086
b0c4483e
PB
150872001-09-07 Pascal Bart <pascal.bart@epita.fr>
15088
15089 * src/output.c (output): Delete call to reader_output_yylsp.
15090 * src/reader.c (reader): Likewise.
ba0fe3c7 15091 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 15092
11d82f03
MA
150932001-09-02 Marc Autret <autret_m@epita.fr>
15094
15095 * src/reader.c: Include muscle_tab.h.
15096 (parse_union_decl): Update.
15097 (parse_macro_decl): Rename parse_muscle_decl.
15098 Update to use renamed functions and variable.
15099 (read_declarations, copy_action, read_additionnal_code, : Updated
15100 with correct variables and functions names.
15101 (packsymbols, reader): Likewise.
342b8b6e 15102
11d82f03 15103 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 15104
11d82f03
MA
15105 * src/output.c: Include muscle_tab.h
15106 In all functions using macro_insert, change by using muscle_insert ().
15107 (macro_obstack): Rename muscle_obstack.
15108 Echo modifications in the whole file.
15109 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15110 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15111 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15112
15113 * src/muscle_tab.h: Update double inclusion macros.
15114 (macro_entry_s): Rename muscle_entry_s.
15115 Update prototypes.
342b8b6e 15116
11d82f03
MA
15117 * src/muscle_tab.c: Include muscle_tab.h.
15118 Rename macro_tabble to muscle_table.
15119 (mhash1, mhash2, mcmp): Use muscle_entry.
15120 (macro_init): Rename muscle_init. Update.
15121 (macro_insert): Rename muscle_insert. Update.
15122 (macro_find): Rename muscle_find. Update.
15123
15124 * src/main.c: Include muscle_tab.h.
15125 (main): Call muscle_init ().
15126 * src/Makefile.am (bison_SOURCES): Echo modifications.
15127
93a37297
MA
151282001-09-02 Marc Autret <autret_m@epita.fr>
15129
f753cd62 15130 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 15131
f753cd62
MA
15132 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15133
151342001-09-02 Marc Autret <autret_m@epita.fr>
15135
15136 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 15137
682d48cd
PB
151382001-09-01 Pascal Bart <pascal.bart@epita.fr>
15139
342b8b6e 15140 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
15141 filename.
15142
087c8fda
MA
151432001-09-01 Marc Autret <autret_m@epita.fr>
15144
15145 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15146 to an explicit value to activate the feature. We do it here.
15147
dda680cb
PB
151482001-08-31 Pascal Bart <pascal.bart@epita.fr>
15149
15150 * src/output.c (prepare): Delete the `filename' muscule insertion.
15151 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15152 (parse_union_decl): Likewise.
15153 * src/macrotab.c (macro_init): Initialize filename by infile.
15154
9e644e64
MA
151552001-08-31 Marc Autret <autret_m@epita.fr>
15156
15157 * src/bison.simple (YYLSP_NEEDED): New definition.
15158 * src/output.c (prepare): Add macro insertion of `locations_flag'
15159
17da6427
PB
151602001-08-31 Pascal Bart <pascal.bart@epita.fr>
15161
15162 * src/output.c (prepare): Delete insertion of previous muscles,
15163 and insert the `prefix' muscles.
15164 * src/macrotab.c (macro_init): Likewise.
15165 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 15166 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
15167 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15168 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 15169 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
15170 name_prefix.
15171
e8cb70b9
PB
151722001-08-31 Pascal Bart <pascal.bart@epita.fr>
15173
15174 * src/main.c (main): Standardize.
15175 * src/output.c (output_table_data, output_parser): Likewise.
15176 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15177
63c2d5de
MA
151782001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15179
342b8b6e 15180 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
15181 %%epilogue.
15182 * src/output.c (output): Rename %%declarations to %%prologue.
15183 * src/bison.simple: Echo modifications.
342b8b6e 15184
d8cb5183
MA
151852001-08-31 Marc Autret <autret_m@epita.fr>
15186
15187 * src/reader.c (readgram): CleanUp.
15188 (output_token_defines): Likewise.
15189 (packsymbols): Likewise.
15190 (reader): Likewise.
15191 * src/output.c (output): CPP-out useless code.
15192
6c686258
PB
151932001-08-31 Pascal Bart <pascal.bart@epita.fr>
15194
342b8b6e 15195 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
15196 output_trailers and output_headers.
15197 * src/output.h: Remove obsolete functions prototypes of output_headers
15198 and output_trailers.
15199
8f451ef7
PB
152002001-08-30 Pascal Bart <pascal.bart@epita.fr>
15201
15202 * src/main.c: Include macrotab.h.
342b8b6e 15203 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
15204 Adjust functions prototypes.
15205 * src/macrotab.c (macro_insert): Constify key and value.
15206 (macro_find): Constify key.
15207 (macro_insert): Include 'xalloc.h'
15208 (macro_insert): Use XMALLOC.
15209 (macro_find): Constify return value.
15210 * src/output.c (output_table_data): Rename table to table_data.
15211 (output_parser): Constify macro_key, macro_value.
15212
997b6fd0 152132001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
15214
15215 * src/reader.c (parse_skel_decl): New.
342b8b6e 15216 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
15217 * src/lex.h (token_t): New token `tok_skel'.
15218 * src/lex.c (percent_table): Add skeleton option entry.
15219 Standardize.
15220
ff48177d
MA
152212001-08-29 Marc Autret <autret_m@epita.fr>
15222
15223 * src/bison.simple: Add %%user_code directive at the end.
15224 * src/reader.c (read_additionnal_code): New.
15225 (reader): Use it.
15226 * src/output.c (output_program): Remove.
15227 (output): Update.
15228
b33160bf
MA
152292001-08-28 Marc Autret <autret_m@epita.fr>
15230
15231 * src/output.c (output_actions): Clean up.
4e5caae2 15232 (output_gram): CPP-out useless code.
b33160bf
MA
15233 * src/reader.c (reader): Clean up, CPP-out useless code.
15234
d1a2daf7
PB
152352001-08-28 Pascal Bart <pascal.bart@epita.fr>
15236
342b8b6e 15237 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 15238 directive.
d1a2daf7
PB
15239 * src/bison.simple: Add `%%definitions'.
15240
2b763dfe
MA
152412001-08-28 Marc Autret <autret_m@epita.fr>
15242
15243 * config/depcomp: New file.
15244
f1a87ef6
PE
152452001-08-27 Paul Eggert <eggert@twinsun.com>
15246
15247 * src/bison.simple (yyparse): Don't take the address of an
15248 item before the start of an array, as that doesn't conform to
15249 the C Standard.
15250
82e236e2
RA
152512001-08-27 Robert Anisko <robert.anisko@epita.fr>
15252
f1a87ef6 15253 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
15254 obstack. It was done too late here.
15255
15256 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15257 completely wrong.
15258 (reader): Initialize the macro obstack here, since we need it to grow
15259 '%define' directives.
15260
15261 * src/reader.h: Declare the macro obstack as extern.
15262
b0cfa28a
RA
152632001-08-27 Robert Anisko <robert.anisko@epita.fr>
15264
15265 * src/output.c (output_parser): Fix. Store single '%' characters in
15266 the output obstack instead of throwing them away.
15267
6fc74234
AD
152682001-08-27 Akim Demaille <akim@epita.fr>
15269
15270 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15271
9c76d118
RA
152722001-08-25 Robert Anisko <robert.anisko@epita.fr>
15273
15274 * lib/Makefile.am: Adjust.
15275
a8289c62
RA
152762001-08-25 Robert Anisko <robert.anisko@epita.fr>
15277
15278 * src/bison.simple: Update and add '%%' directives.
15279
b6610515
RA
152802001-08-25 Robert Anisko <robert.anisko@epita.fr>
15281
15282 * src/reader.c (reader): Remove calls to 'output_headers' and
15283 'output_trailers'. Remove some C output.
15284 (readgram): Disable a piece of code that was writing a default
15285 definition for 'YYSTYPE'.
15286 (reader_output_yylsp): Remove.
15287 (packsymbols): Output token defintions to a macro.
15288 (copy_definition): Disable C output.
6fc74234 15289
b6610515
RA
15290 * src/reader.c (parse_macro_decl): New function used to parse macro
15291 declarations.
15292 (copy_string2): Put the body of copy_string into this new function.
15293 Add a parameter to let the caller choose whether he wants to copy the
15294 string delimiters or not.
15295 (copy_string): Be a simple call to copy_string2 with the last argument
15296 bound to true.
15297 (read_declarations): Add case for macro definition.
15298 (copy_identifier): New.
6fc74234 15299 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
15300 rather than lex.
15301
26f609ff
RA
153022001-08-25 Robert Anisko <robert.anisko@epita.fr>
15303
15304 * src/output.c (prepare): Add prefixed names.
15305 (output_parser): Output semantic actions.
15306 (output_parser): Fix bug on '%%line' directives.
6fc74234 15307
26f609ff
RA
15308 * src/output.c (output_headers): Remove. The C code printed by this
15309 function should now be in the skeletons.
15310 (output_trailers): Remove.
15311 (output): Disable call to 'reader_output_yylsp'.
15312 (output_rule_data): Do not output tables to the table obstack.
15313
15314 * src/output.c: Remove some C dedicated output.
15315 Improve the use of macro and output obstacks.
15316 (output_defines): Remove.
6fc74234 15317
26f609ff
RA
15318 * src/output.c (output_token_translations): Associate 'translate'
15319 table with a macro. No output to the table obstack.
15320 (output_gram): Same for 'rhs' and 'prhs'.
15321 (output_stos): Same for 'stos'.
15322 (output_rule_data): Same for 'r1' and 'r2'.
15323 (token_actions): Same for 'defact'.
15324 (goto_actions): Same for 'defgoto'.
15325 (output_base): Same for 'pact' and 'pgoto'.
15326 (output_table): Same for 'table'.
15327 (output_check): Same for 'check'.
6fc74234 15328
26f609ff
RA
15329 * src/output.c (output_table_data): New function.
15330 (output_short_table): Remove.
15331 (output_short_or_char_table): Remove.
6fc74234 15332
26f609ff
RA
15333 * src/output.c (output_parser): Replace most of the skeleton copy code
15334 with something new. Skeletons are now processed character by character
15335 rather than line by line, and Bison looks for '%%' macros. This is the
15336 first step in making Bison's output process (a lot) more flexible.
15337 (output_parser): Use the macro table.
15338
6f43b113
RA
153392001-08-25 Robert Anisko <robert.anisko@epita.fr>
15340
15341 * src/main.c (main): Initialize the macro table.
15342
dd3127cf
RA
153432001-08-25 Robert Anisko <robert.anisko@epita.fr>
15344
15345 * src/lex.c (percent_table): Add tok_define.
15346 * src/lex.h: Add tok_define.
15347
aa321494
RA
153482001-08-25 Robert Anisko <robert.anisko@epita.fr>
15349
15350 * src/macrotab.c: New file.
15351 * src/macrotab.h: New file.
15352 * src/Makefile.am: Update.
15353
68bd3b6b
RA
153542001-08-25 Robert Anisko <robert.anisko@epita.fr>
15355
15356 * lib/hash.c: New file.
15357 * lib/hash.h: New file.
15358 * lib/Makefile.am: Update.
15359
45f8dd1e
AD
153602001-08-15 Akim Demaille <akim@epita.fr>
15361
15362 Version 1.28c.
15363
40a64a7a 153642001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
15365
15366 * src/reader.c (readgram): Indent output macro YYSTYPE.
15367 (packsymbols): Likewise.
15368 (output_token_defines): Likewise.
15369 * src/files.c: Standardize.
15370 (compute_header_macro): New.
15371 (defines_obstack_save): New. Use compute_header_macro.
15372 (output_files): Update. Use defines_obstack_save.
15373
f9a8293a
AD
153742001-08-15 Akim Demaille <akim@epita.fr>
15375
15376 * doc/bison.texinfo (Table of Symbols): Document
15377 YYSTACK_USE_ALLOCA.
15378
150ca7a7
AD
153792001-08-15 Akim Demaille <akim@epita.fr>
15380
15381 * missing: Update from CVS Automake.
15382 * config/config.guess, config/config.sub, config/texinfo.tex:
15383 Update from gnu.org.
15384
69b5cec4
AD
153852001-08-15 Akim Demaille <akim@epita.fr>
15386
15387 * Makefile.maint: Sync with CVS Autoconf.
15388
f2b5126e
PB
153892001-08-14 Pascal Bart <pascal.bart@epita.fr>
15390
69b5cec4 15391 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
15392 `fdl.texi'.
15393 * doc/fdl.texi: Add to package.
15394
4ecbf796
MA
153952001-08-14 Marc Autret <autret_m@epita.fr>
15396
15397 Turn on %{source,header}_extension features.
15398
69b5cec4 15399 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
15400 source_extension.
15401 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 15402 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
15403 between options.
15404
95fb5662
MA
154052001-08-14 Marc Autret <autret_m@epita.fr>
15406
15407 * src/files.c (compute_base_names): Add extensions computing when
15408 `--file-prefix' used.
15409 Standardize function calls.
15410
78d09da9
MA
154112001-08-13 Marc Autret <autret_m@epita.fr>
15412
69b5cec4 15413 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
15414 defining it (defined but null disables alloca).
15415
5a009f2c
MA
154162001-08-13 Marc Autret <autret_m@epita.fr>
15417
15418 * src/bison.simple (_yy_memcpy): CPP reformat.
15419
1e41465a
PB
154202001-08-13 Pascal Bart <pascal.bart@epita.fr>
15421
15422 * tests/atconfig.in (CPPFLAGS): Fix.
15423
c67a198d
PB
154242001-08-10 Pascal Bart <pascal.bart@epita.fr>
15425
79282c6c 15426 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
15427 `gpl.texi'.
15428 * doc/gpl.texi: Add to package.
15429
09a6de7e
MA
154302001-08-10 Marc Autret <autret_m@epita.fr>
15431
15432 * src/print_graph.h: Fix.
15433 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
15434
b77b9ee0
AD
154352001-08-10 Akim Demaille <akim@epita.fr>
15436
15437 * src/system.h: Provide default declarations for stpcpy, strndup,
15438 and strnlen.
15439
3e259915
MA
154402001-08-10 Robert Anisko <anisko_r@epita.fr>
15441
15442 * doc/bison.texinfo (Locations): Update @$ stuff.
15443
ca96bc2d
MA
154442001-08-09 Robert Anisko <anisko_r@epita.fr>
15445
15446 * src/bison.simple (YYLLOC_DEFAULT): Update.
15447 (yyparse): Adjust.
15448
fdc6758b
MA
154492001-08-08 Marc Autret <autret_m@epita.fr>
15450
b77b9ee0 15451 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
15452 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
15453 Reported by Fabrice Bauzac.
957d4dbf 15454
600cad3b
MA
154552001-08-08 Marc Autret <autret_m@epita.fr>
15456
15457 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
15458 * src/vcg.c (output_node): Fix.
15459 * src/vcg.h: Cleanup.
15460 * src/print_graph.c: Add comments.
b77b9ee0 15461 (node_output_size): New global variable. Simplify the formatting of
600cad3b 15462 the VCG graph output.
b77b9ee0 15463 (print_actions): Unused code is now used. It notifies the final state
600cad3b 15464 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 15465 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
15466 blue.
15467 Get the current node name and node_obstack by argument.
15468 (node_obstack): New variable.
15469 (print_state): Manage node_obstack.
15470 (print_core): Use node_obstack given by argument.
15471 A node is not only computed here but in print_actions also.
15472 (print_graph): CPP out useless code instead of commenting it.
15473
976e528f
AD
154742001-08-07 Pascal Bart <pascal.bart@epita.fr>
15475
15476 * tests/atconfig.in (CPPFLAGS): Fix.
15477
20e8e5ca
AD
154782001-08-07 Akim Demaille <akim@epita.fr>
15479
15480 * src/print_graph.c (quote): New.
15481 (print_core): Use it.
15482
957d4dbf 154832001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 15484
3e3da797
AD
15485 * src/vcg.c (complain.h): Include it.
15486 Unepitaize `return' invocations.
c4b66126 15487 [NDEBUG] (main): Remove.
79282c6c 15488 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
15489 * src/files.c (open_files): Initialize graph_obstack.
15490 * src/print_graph.c (print_actions): CPP out useless code.
15491 (print_core): Don't output the last `\n' in labels.
15492 Use `quote'.
15493 * src/files.c (output_files): Output the VCG file.
15494 * src/main.c (main): Invoke print_graph ();
3e3da797 15495
957d4dbf 154962001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
15497
15498 Automaton VCG graph output.
15499 Using option ``-g'' or long option ``--graph'', you can generate
15500 a gram_filename.vcg file containing a VCG description of the LALR (1)
15501 automaton of your grammar.
15502
15503 * src/main.c: Call to print_graph() function.
15504 * src/getargs.h: Update.
15505 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
15506 (graph_flag): New flag.
15507 (longopts): Update.
15508 (getargs): Add case `g'.
15509 * src/files.c (graph_obstack): New obstack struct.
15510 (open_files): Initialize new obstack.
15511 (output_files): Saves graph_obstack if required.
15512 * src/files.h (graph_obstack): New extern declaration.
15513 * src/Makefile.am: Add new source files.
15514
927c1557 155152001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
15516
15517 * src/print_graph.c, src/print_graph.h (graph): New.
15518 * src/vcg.h: New file.
15519 * src/vcg.c: New file, VCG graph handling.
15520
7333d403
AD
155212001-08-06 Marc Autret <autret_m@epita.fr>
15522
15523 Add of %source_extension and %header_extension which specify
15524 the source or/and the header output file extension.
15525
15526 * src/files.c (compute_base_names): Remove initialisation of
15527 src_extension and header_extension.
15528 (compute_exts_from_gf): Update.
15529 (compute_exts_from_src): Update.
15530 (output_files): Update.
15531 * src/reader.c (parse_header_extension_decl): New.
15532 (parse_source_extension_decl): New.
15533 (read_declarations): New case statements for the new tokens.
15534 * src/lex.c (percent_table): Add entries for %source_extension
15535 and %header_extension.
15536 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
15537
84163231
AD
155382001-08-06 Marc Autret <autret_m@epita.fr>
15539
15540 * configure.in: Bump to 1.28c.
15541 * doc/bison.texinfo: Texinfo thingies.
15542
8303fc42
AD
155432001-08-04 Pascal Bart <pascal.bart@epita.fr>
15544
15545 * tests/atconfig.in (CPPFLAGS): Add.
15546 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
15547
70a84437
AD
155482001-08-03 Akim Demaille <akim@epita.fr>
15549
15550 Version 1.28b.
15551
2ce10144
AD
155522001-08-03 Akim Demaille <akim@epita.fr>
15553
15554 * tests/Makefile.am (check-local): Ship testsuite.
15555 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
15556 Include `string.h'.
15557
1e3e4bc1
AD
155582001-08-03 Akim Demaille <akim@epita.fr>
15559
15560 * configure.in: Try using -Wformat when compiling.
15561
42b45b7f
AD
155622001-08-03 Akim Demaille <akim@epita.fr>
15563
15564 * configure.in: Bump to 1.28b.
15565
8f13fe33
AD
155662001-08-03 Akim Demaille <akim@epita.fr>
15567
15568 * src/complain.c: Adjust strerror_r portability issues.
15569
b37ba92c
AD
155702001-08-03 Akim Demaille <akim@epita.fr>
15571
15572 Version 1.28a.
15573
b0ce6046
AD
155742001-08-03 Akim Demaille <akim@epita.fr>
15575
15576 * src/getargs.c, src/getarg.h (skeleton)): Constify.
15577 * src/lex.c (literalchar): Avoid name clashes on `buf'.
15578 * src/getargs.c: Include complain.h.
15579 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
15580 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
15581
d01c415b
AD
155822001-08-03 Akim Demaille <akim@epita.fr>
15583
15584 * src/reader.c (readgram): Display hidden chars in error messages.
15585
459dd1a6
AD
155862001-08-03 Akim Demaille <akim@epita.fr>
15587
15588 Update to gettext 0.10.39.
15589
53b74c0c
AD
155902001-08-03 Akim Demaille <akim@epita.fr>
15591
15592 * lib/strspn.c: New.
15593
234a3be3
AD
155942001-08-01 Marc Autret <autret_m@epita.fr>
15595
15596 * doc/bison.texinfo: Update.
15597 * doc/bison.1 (mandoc): Update.
15598 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
15599 * src/files.c: Support output files extensions computing.
15600 (src_extension): New static variable.
15601 (header_extension): New static variable.
15602 (tr): New function.
15603 (get_extension_index): New function, gets the index of an extension
15604 filename in a string.
15605 (compute_exts_from_gf): New function, computes extensions from the
15606 grammar file extension.
15607 (compute_exts_from_src): New functions, computes extensions from the
15608 C source file extension, file given by ``-o'' option.
15609 (compute_base_names): Update.
15610 (output_files): Update.
15611
847bf1f5
AD
156122001-08-01 Robert Anisko <anisko_r@epita.fr>
15613
d995fee7 15614 * doc/bison.texi: Document @$.
847bf1f5
AD
15615 (Locations): New section.
15616
d074a105
AD
156172001-07-18 Akim Demaille <akim@epita.fr>
15618
15619 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
15620 * config/prev-version.txt, config/move-if-change: New.
15621 * Makefile.am: Adjust.
15622
3419715d
AD
156232001-07-08 Pascal Bart <pascal.bart@epita.fr>
15624
15625 * src/bison.simple (yyparse): Suppress warning `comparaison
15626 between signed and unsigned'.
15627
62ab6972
AD
156282001-07-05 Pascal Bart <pascal.bart@epita.fr>
15629
15630 * src/getargs.h (raw_flag): Remove.
15631 * src/getargs.c: Die on `-r'/`--raw'.
15632 * src/lex.c (parse_percent_token): Die on `%raw'.
15633 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
15634 * tests/calc.at: Suppress test with option `--raw'.
15635
1e24cc5b
AD
156362001-07-14 Akim Demaille <akim@epita.fr>
15637
15638 * config/: New.
15639 * configure.in: Require Autoconf 2.50.
15640 Update to gettext 0.10.38.
15641
32dfccf8
AD
156422001-03-16 Akim Demaille <akim@epita.fr>
15643
15644 * doc/bison.texinfo: ANSIfy the examples.
15645
cd5bd6ac
AD
156462001-03-16 Akim Demaille <akim@epita.fr>
15647
15648 * getargs.c (skeleton): New variable.
15649 (longopts): --skeleton is a new option.
15650 (shortopts, getargs): -S is a new option.
15651 * getargs.h: Declare skeleton.
15652 * output.c (output_parser): Use it.
15653
5141b016
AD
156542001-03-16 Akim Demaille <akim@epita.fr>
15655
15656 * m4/strerror_r.m4: New.
15657 * m4/error.m4: Run AC_FUNC_STRERROR_R.
15658 * lib/error.h, lib/error.c: Update.
15659
447992b9
AD
156602001-03-16 Akim Demaille <akim@epita.fr>
15661
15662 * src/getargs.c (longopts): Clean up.
15663
274d42ce
AD
156642001-02-21 Akim Demaille <akim@epita.fr>
15665
15666 * src/reader.c (gensym): `gensym_count' is your own.
15667 Use a static buf to create the symbol name, as token_buffer is no
15668 longer a buffer.
15669
22c821f3
AD
156702001-02-08 Akim Demaille <akim@epita.fr>
15671
15672 * src/conflicts.c (conflict_report): Be sure not to append to res
15673 between two calls, which could happen if both first sprintf were
15674 skipped, but not the first cp += strlen.
15675
18569462
AD
156762001-02-08 Akim Demaille <akim@epita.fr>
15677
15678 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
15679 New, from fileutils 4.0.37.
15680 * configure.in: Require Autoconf 2.49c. I took some time before
15681 making this decision. This is the only way out for portability
15682 issues in Bison, it would mean way too much duplicate effort to
15683 import in Bison features implemented in 2.49c since 2.13.
15684 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
15685
0d8f3c8a
AD
156862001-02-02 Akim Demaille <akim@epita.fr>
15687
15688 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 15689 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 15690
f17bcd1f
AD
156912001-01-19 Akim Demaille <akim@epita.fr>
15692
15693 Get rid of the ad hoc handling of token_buffer in the scanner: use
15694 the obstacks.
15695
15696 * src/lex.c (token_obstack): New.
15697 (init_lex): Initialize it. No longer call...
15698 (grow_token_buffer): this. Remove it.
15699 Adjust all the places which used it to use the obstack.
15700
511e79b3
AD
157012001-01-19 Akim Demaille <akim@epita.fr>
15702
15703 * src/lex.h: Rename all the tokens:
15704 s/\bENDFILE\b/tok_eof/g;
15705 s/\bIDENTIFIER\b/tok_identifier/g;
15706 etc.
15707 Let them be enums, not #define, to ease debugging.
15708 Adjust all the code.
15709
0d6508ef
AD
157102001-01-18 Akim Demaille <akim@epita.fr>
15711
15712 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
15713 * src/lex.c (maxtoken, grow_token_buffer): Static.
15714
6deb4447
AD
157152001-01-18 Akim Demaille <akim@epita.fr>
15716
15717 Since we now use obstacks, more % directives can be enabled.
15718
15719 * src/lex.c (percent_table): Also accept `%yacc',
15720 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
15721 `%debug'.
15722 Handle the actions for `%semantic_parser' and `%pure_parser' here,
15723 instead of returning a token.
15724 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
15725 * src/reader.c (read_declarations): Adjust.
15726 * src/files.c (open_files): Don't call `compute_base_names', don't
15727 compute `attrsfile' since they depend upon data which might be
15728 *in* the input file now.
15729 (output_files): Do it here.
15730 * src/output.c (output_headers): Document the fact that this patch
15731 introduces a guaranteed SEGV for semantic parsers.
15732 * doc/bison.texinfo: Document them.
15733 * tests/suite.at: Exercise these %options.
15734
ff4423cc
AD
157352000-12-20 Akim Demaille <akim@epita.fr>
15736
15737 Also handle the output file (--verbose) with obstacks.
15738
15739 * files.c (foutput): Remove.
15740 (output_obstack): New.
15741 Adjust all dependencies.
15742 * src/conflicts.c: Return a string.
15743 * src/system.h (obstack_grow_string): Rename as...
15744 (obstack_sgrow): this. Be ready to work with non literals.
15745 (obstack_fgrow4): New.
15746
956dba3a
AD
157472000-12-20 Akim Demaille <akim@epita.fr>
15748
15749 * src/files.c (open_files): Fix the computation of short_base_name
15750 in the case of `-o foo.tab.c'.
15751
337bab46
AD
157522000-12-20 Akim Demaille <akim@epita.fr>
15753
15754 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
15755 (copy_dollar): Now that everything uses obstacks, get rid of the
15756 FILE * parameters.
15757
5d3214b8
AD
157582000-12-20 Akim Demaille <akim@epita.fr>
15759
15760 * src/files.c (open_files): Actually the `.output' file is based
15761 on the short_base_name, not base_name.
15762 * tests/suite.at (Checking output file names): Adjust.
15763
29092a57
AD
157642000-12-20 Akim Demaille <akim@epita.fr>
15765
15766 * src/bison.s1: Remove, we now use directly...
15767 * src/bison.simple: this.
15768 * src/Makefile.am: Use pkgdata instead of data.
15769
ea5607fd
AD
157702000-12-20 Akim Demaille <akim@epita.fr>
15771
15772 * src/files.c (guard_obstack): New.
15773 (open_files): Initialize it.
15774 (output_files): Dump it...
15775 * src/files.h: Export it.
15776 * src/reader.c (copy_guard): Use it.
15777
27110317
AD
157782000-12-19 Akim Demaille <akim@epita.fr>
15779
15780 * src/files.c (outfile, defsfile, actfile): Removed as global
15781 vars.
15782 (open_files): Don't compute them.
15783 (output_files): Adjust.
15784 (base_name, short_base_name): Be global.
15785 Adjust dependencies.
15786
19c50364
AD
157872000-12-19 Akim Demaille <akim@epita.fr>
15788
15789 * src/files.c (strsuffix): New.
15790 (stringappend): Be just like strcat but allocate.
15791 (base_names): Eve out from open_files.
15792 Try to simplify the rather hairy computation of base_name and
15793 short_base_name.
15794 (open_files): Use it.
15795 * tests/suite.at (Checking output file names): New test.
15796
573c1d9f
AD
157972000-12-19 Akim Demaille <akim@epita.fr>
15798
15799 * src/system.h (obstack_grow_literal_string): Rename as...
15800 (obstack_grow_string): this.
15801 * src/output.c (output_parser): Recognize `%% actions' instead of
15802 `$'.
15803 * src/bison.s1: s/$/%% actions/.
15804 * src/bison.hairy: Likewise.
15805
ef7ddedd
AD
158062000-12-19 Akim Demaille <akim@epita.fr>
15807
15808 * src/output.c (output_parser): Compute the `#line' lines when
15809 there are.
15810 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
15811 Suggested by Hans Aberg.
15812
ff61dabd
AD
158132000-12-19 Akim Demaille <akim@epita.fr>
15814
15815 Let the handling of the skeleton files be local to the procedures
15816 that use it.
15817
15818 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
15819 longer static.
15820 (fparser, open_extra_files): Remove.
15821 (open_files, output_files): Don't take care of fparser.
15822 * src/files.h: Adjust.
15823 * src/output.c (output_parser): Open and close the file to the
15824 skeleton.
15825 * src/reader.c (read_declarations): When %semantic_parser, open
15826 fguard.
15827
55b96341
AD
158282000-12-19 Akim Demaille <akim@epita.fr>
15829
15830 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
15831 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
15832
358c15b7
AD
158332000-12-19 Akim Demaille <akim@epita.fr>
15834
15835 * src/files.c (open_files): Yipee! We no longer need all the code
15836 looking for `/tmp' since we have no tmp file.
15837
7de3329e
AD
158382000-12-19 Akim Demaille <akim@epita.fr>
15839
15840 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
15841 New macros.
15842 * src/files.c (open_files): Less dependency on MSDOS etc.
15843
3abcd459
AD
158442000-12-14 Akim Demaille <akim@epita.fr>
15845
15846 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
15847 Provide a default definition.
15848 Use it when executing the default @ action.
15849 * src/reader.c (reader_output_yylsp): No longer include
15850 `timestamp' and `text' in the default YYLTYPE.
15851
2a91a95e
AD
158522000-12-12 Akim Demaille <akim@epita.fr>
15853
15854 * src/reader.c (copy_definition, parse_union_decl, copy_action)
15855 (copy_guard): Quote the file names.
15856 Reported by Laurent Mascherpa.
15857
14d3eb9b
AD
158582000-12-12 Akim Demaille <akim@epita.fr>
15859
15860 * src/output.c (output_headers, output_program, output): Be sure
15861 to escape special characters when outputting filenames.
15862 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
15863 (output_headers): Don't depend on them, Use ACTSTR.
15864
d7045ec6
AD
158652000-11-17 Akim Demaille <akim@epita.fr>
15866
15867 * lib/obstack.h: Formatting changes.
15868 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
15869 prevents type checking.
15870 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
15871 cast the value to (void *): assigning a `foo *' to a `void *'
15872 variable is valid.
15873 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
15874 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
15875 append characters.
15876
6fd54b73
AD
158772000-11-17 Akim Demaille <akim@epita.fr>
15878
15879 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
15880 as...
15881 (suite.m4, regression.m4, calc.m4): these.
15882 * tests/atgeneral.m4: Update from CVS Autoconf.
15883
4c50eae6
AD
158842000-11-17 Akim Demaille <akim@epita.fr>
15885
15886 * tests/regression.m4 (%union and --defines): New test,
15887 demonstrating a current bug in the obstack implementation.
15888
a35f64ea
AD
158892000-11-17 Akim Demaille <akim@epita.fr>
15890
15891 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
15892 macros.
15893 Use them to declare the variables which are global or local to
15894 `yyparse'.
15895
7de23534
AD
158962000-11-17 Akim Demaille <akim@epita.fr>
15897
15898 * acconfig.h: Remove, no longer used.
15899
aa7815f5
AD
159002000-11-07 Akim Demaille <akim@epita.fr>
15901
15902 * src: s/Copyright (C)/Copyright/g.
15903
5af1f549
AD
159042000-11-07 Akim Demaille <akim@epita.fr>
15905
15906 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
15907 defining.
15908 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
15909
553e2b22
AD
159102000-11-07 Akim Demaille <akim@epita.fr>
15911
15912 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
15913 Merge in a single CPP if/else.
15914
8a4f41d6
AD
159152000-11-07 Akim Demaille <akim@epita.fr>
15916
15917 * src/output.c (output): Remove useless variables.
15918 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
15919 argument `data' for consistency with the prototypes.
15920 Qualify it `const'.
15921 (obstack_copy, obstack_copy0): Rename the second argument as
15922 `address' for consistency. Qualify it `const'.
15923 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
15924 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
15925 `const' their input argument (`data' or `address').
15926 Adjust the corresponding macros to include `const' in casts.
15927
095a3fb5
AD
159282000-11-03 Akim Demaille <akim@epita.fr>
15929
15930 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
15931 s/PFILE1/BISON_HAIRY/.
15932 Adjust dependencies.
15933
d1cdce7c
AD
159342000-11-03 Akim Demaille <akim@epita.fr>
15935
090c5ebf 15936 For some reason, this was not applied.
d1cdce7c
AD
15937
15938 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
15939 `unlink': it's no longer used.
15940
9311529b
AD
159412000-11-03 Akim Demaille <akim@epita.fr>
15942
15943 * src/files.c (skeleton_find): New function, eved out of...
15944 (open_files, open_extra_files): here.
15945
d8880f69
AD
159462000-11-03 Akim Demaille <akim@epita.fr>
15947
15948 Don't use `atexit'.
15949
15950 * src/files.c (obstack_save): New function.
15951 (done): Rename as...
15952 (output_files): this.
15953 Use `obstack_save'.
15954 * src/main.c (main): Don't use `atexit' to register `done', since
15955 it no longer has to remove tmp files, just call `output_files'
15956 when there are no errors.
15957
0dbb648e
AD
159582000-11-02 Akim Demaille <akim@epita.fr>
15959
15960 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
15961 `unlink': it's no longer used.
15962 * src/files.h: Formatting changes.
15963
896fe5c1
AD
159642000-11-02 Akim Demaille <akim@epita.fr>
15965
15966 Remove the last uses of mktemp and unlink/delete.
15967
15968 * src/files.c (fdefines, ftable): Removed.
15969 (defines_ostack, table_obstack): New.
15970 Adjust dependencies of the former into uses of the latter.
15971 * src/output.c (output_short_or_char_table, output_short_table):
15972 Convert to using obstacks.
15973 * src/reader.c (copy_comment2): Accept one FILE * and two
15974 obstacks.
15975 (output_token_defines, reader_output_yylsp): Use obstacks.
15976 * src/system.h (obstack_fgrow3): New.
1f65350a 15977 * po/POTFILES.in: Adjust.
896fe5c1 15978
dd60faec
AD
159792000-11-01 Akim Demaille <akim@epita.fr>
15980
15981 Change each use of `fattrs' into a use of `attrs_obstack'.
15982
15983 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
15984 * src/files.c (fattrs): Remove.
15985 (attrs_obstack): New.
15986 Adjust all dependencies.
15987 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
15988
8c7ebe49
AD
159892000-11-01 Akim Demaille <akim@epita.fr>
15990
15991 Introduce obstacks.
15992 Change each use of `faction' into a use of `action_obstack'.
15993
15994 * lib/obstack.h, lib/obstack.c: New files.
15995 * src/files.c (faction): Remove.
15996 (action_obstack): New.
15997 Adjust all dependencies.
15998
77aee789
AD
159992000-10-20 Akim Demaille <akim@epita.fr>
16000
16001 * lib/quote.h (PARAMS): New macro. Use it.
16002
43591cec
AD
160032000-10-16 Akim Demaille <akim@epita.fr>
16004
16005 * src/output.c (output_short_or_char_table): New function.
16006 (output_short_table, output_token_translations): Use it.
16007 (goto_actions): Use output_short_table.
16008
1e9798d5
AD
160092000-10-16 Akim Demaille <akim@epita.fr>
16010
16011 * src/symtab.c (bucket_new): New function.
16012 (getsym): Use it.
16013
16014 * src/output.c (output_short_table): New argument to display the
16015 comment associated with the table.
16016 Adjust dependencies.
16017 (output_gram): Use it.
16018 (output_rule_data): Nicer output layout for YYTNAME.
16019
f282676b
AD
160202000-10-16 Akim Demaille <akim@epita.fr>
16021
16022 * src/lex.c (read_typename): New function.
16023 (lex): Use it.
16024 * src/reader.c (copy_dollar): Likewise.
16025
550a72a3
AD
160262000-10-16 Akim Demaille <akim@epita.fr>
16027
16028 * src/reader.c (copy_comment2): Expect the input stream to be on
16029 the `/' which is suspected to open a comment, instead of being
16030 called after `//' or `/*' was read.
16031 (copy_comment, copy_definition, parse_union_decl, copy_action)
16032 (copy_guard): Adjust.
16033
131e2fef
AD
160342000-10-16 Akim Demaille <akim@epita.fr>
16035
16036 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16037 `read_signed_integer'.
16038
79282c5a
AD
160392000-10-16 Akim Demaille <akim@epita.fr>
16040
16041 * src/reader.c (copy_dollar): New function.
16042 (copy_guard, copy_action): Use it.
16043
ff4a34be
AD
160442000-10-16 Akim Demaille <akim@epita.fr>
16045
16046 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16047 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16048 New files, from Fileutils 4.0.27.
16049 * src/main.c (printable_version): Remove.
16050 * src/lex.c, src/reader.c: Use `quote'.
16051
160522000-10-04 Akim Demaille <akim@epita.fr>
16053
16054 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16055
14ded682
AD
160562000-10-04 Akim Demaille <akim@epita.fr>
16057
16058 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16059
8e03724b
AD
160602000-10-04 Akim Demaille <akim@epita.fr>
16061
16062 When a literal string is used to define two different tokens,
16063 `bison -v' segfaults.
16064 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16065
16066 * tests/regression.m4: New file.
16067 Include the core of the sample provided by Piotr Gackiewicz.
16068 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16069 properly.
16070
a9e64249
AD
160712000-10-04 Akim Demaille <akim@epita.fr>
16072
16073 * src/reader.c (parse_expect_decl): Keep `count' within the size
16074 of `buffer'.
16075 From Neil Booth.
16076
da9abf43
AD
160772000-10-02 Paul Eggert <eggert@twinsun.com>
16078
16079 * bison.s1 (yyparse): Assign the default value
16080 unconditionally, to avoid a GCC warning and make the parser a
16081 tad smaller.
16082
c33638bb
AD
160832000-10-02 Akim Demaille <akim@epita.fr>
16084
16085 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16086 options.
16087
444c570a
AD
160882000-10-02 Akim Demaille <akim@epita.fr>
16089
16090 * src/derives.c, src/print.c, src/reduce.c: To ease the
16091 translation, move some `\n' out of the translated strings.
16092
89cab50d
AD
160932000-10-02 Akim Demaille <akim@epita.fr>
16094
16095 The location tracking mechanism is precious for parse error
16096 messages. Nevertheless, it is enabled only when `@n' is used in
16097 the grammar, which is a different issue (you can use it in error
16098 message, but not in the grammar per se). Therefore, there should
16099 be another means to enable it.
16100
16101 * src/getargs.c (getargs): Support `--locations'.
16102 (usage): Report it.
16103 * src/getargs.h (locationsflag): Export it.
16104 * src/lex.c (percent_table): Support `%locations'.
16105 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16106 with `locationsflag'.
16107 * doc/bison.texinfo: Document `--locations' and `%locations'.
16108 Sort the options.
16109 * tests/calc.m4: Test it.
16110
16111 For regularity of the names, replace each
16112 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16113 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16114 In addition replace each `flag' with `_flag'.
16115
d6c2cba0
AD
161162000-10-02 Akim Demaille <akim@epita.fr>
16117
16118 Also test parse error messages, including with YYERROR_VERBOSE.
16119
16120 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16121 associative).
16122 Use it to check the computations.
16123 Use it to check `nonassoc' is honored.
16124 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16125 `--yyerror-verbose'.
16126 (_AT_CHECK_CALC): Adjust to this option.
16127 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16128
5a35a6cb
AD
161292000-10-02 Akim Demaille <akim@epita.fr>
16130
16131 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16132 the latter demonstrates a flaw in the handling of non debugging
16133 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16134 was used in order to simplify:
16135
16136 #if YYDEBUG
16137 if (yydebug)
16138 {
16139 ...
16140 }
16141 #endif
16142
16143 into
16144
16145 if (yydebug)
16146 {
16147 ...
16148 }
16149
16150 unfortunately this leads to a CPP conflict when
16151 `--name-prefix=foo' is used since it produces `#define yydebug
16152 foodebug'.
16153
16154 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16155 (YYDPRINTF): New macro.
16156 Spread its use.
16157 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16158 the bison options.
16159 Also test `--verbose', `--defines' and `--name-prefix'.
16160
71da9eea
AD
161612000-10-02 Akim Demaille <akim@epita.fr>
16162
16163 Improve the readability of the produced parsers.
16164
16165 * src/bison.s1: Formatting changes.
16166 Improve the comment related to the `$' mark.
16167 (yydefault): Don't fall through to `yyresume': `goto' there.
16168 * src/output.c (output_parser): When the `$' is met, skip the end
16169 of its line.
16170 New variable, `number_of_dollar_signs', to check there's exactly
16171 one `$' in the parser skeleton.
16172
95e36146
AD
161732000-10-02 Akim Demaille <akim@epita.fr>
16174
16175 * lib/xstrdup.c: New file, from the fileutils.
16176 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16177 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16178 instead of strlen + xmalloc + strcpy.
16179 * src/symtab.c (copys): Remove, use xstrdup instead.
16180
d7020c20
AD
161812000-10-02 Akim Demaille <akim@epita.fr>
16182
16183 * src/gram.h (associativity): New enum type which replaces the
16184 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16185 `right_assoc', `left_assoc' and `non_assoc'.
16186 Adjust all dependencies.
16187 * src/reader.c: Formatting changes.
16188 (LTYPESTR): Don't define it, use it as a literal in
16189 `reader_output_yylsp'.
16190 * src/symtab.h (symbol_class): New enum type which replaces the
16191 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16192 `sunknown', `stoken and `snterm'.
16193
1916f98e
AD
161942000-10-02 Akim Demaille <akim@epita.fr>
16195
16196 * src/getargs.c (fixed_outfiles): Rename as...
16197 (yaccflag): for consistency and accuracy.
16198 Adjust dependencies.
16199
d7913476
AD
162002000-10-02 Akim Demaille <akim@epita.fr>
16201
16202 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16203 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16204 difficult and introduced a lot of core dump. It turns out that
16205 Bison used an implementation of `xmalloc' based on `calloc', and
16206 at various places it does depend upon the initialization to 0. I
16207 have not tried to isolate the pertinent places, and all the former
16208 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16209 someone should address this issue.
16210
16211 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16212 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16213 files.
16214 Adjust dependencies.
16215 * src/warshall.h: New file.
16216 Propagate.
16217
340ef489
AD
162182000-10-02 Akim Demaille <akim@epita.fr>
16219
16220 Various anti-`extern in *.c' changes.
16221
16222 * src/system.h: Include `assert.h'.
16223
b2ca4022
AD
162242000-10-02 Akim Demaille <akim@epita.fr>
16225
16226 * src/state.h (nstates, final_state, first_state, first_shift)
16227 (first_reduction): Move their exportation from here...
16228 * src/LR0.h: to here.
16229 Adjust dependencies.
16230 * src/getargs.c (statisticsflag): New variable.
16231 Add support for `--statistics'.
16232 Adjust dependencies.
16233
16234 Remove a lot of now useless `extern' statements in most files.
16235
403b315b
AD
162362000-10-02 Akim Demaille <akim@epita.fr>
16237
16238 * src/LR0.h: New file.
16239 Propagate its use.
16240
07a58c13
AD
162412000-10-02 Akim Demaille <akim@epita.fr>
16242
16243 * src/print.h: New file.
16244 Propagate its use.
16245 * src/print.c: Formatting and ordering changes.
16246 (verbose, terse): Replace with...
16247 (print_results): this new function.
16248 Adjust dependencies.
16249
0619caf0
AD
162502000-10-02 Akim Demaille <akim@epita.fr>
16251
16252 * src/conflicts.c (conflict_report): New function.
16253 (conflict_log, verbose_conflict_log): Replace with...
16254 (print_conflicts): this function.
16255 Adjust dependencies.
16256 * src/conflicts.h: New file.
16257 Propagate its inclusion.
16258
3519ec76
AD
162592000-10-02 Akim Demaille <akim@epita.fr>
16260
16261 * src/nullable.h: New file.
16262 Propagate its inclusion.
16263 * src/nullable.c: Formatting changes.
16264
015acc48
AD
162652000-10-02 Akim Demaille <akim@epita.fr>
16266
16267 * src/reduce.h: New file.
16268 Propagate its inclusion.
16269 * src/reduce.c: Topological sort and other formatting changes.
16270 (bool, TRUE, FALSE): Move their definition to...
16271 * src/system.h: here.
16272
8963a27b
AD
162732000-10-02 Akim Demaille <akim@epita.fr>
16274
16275 * src/files.c: Formatting changes.
16276 (tryopen, tryclose, openfiles): Rename as...
16277 (xfopen, xfclose, open_files): this.
16278 (stringappend): static.
16279 * src/files.h: Complete the list of exported symbols.
16280 Propagate its use.
16281
a70083a3
AD
162822000-10-02 Akim Demaille <akim@epita.fr>
16283
16284 * src/reader.h: New file.
16285 Propagate its use instead of tedious list of `extern' and
16286 prototypes.
16287 * src/reader.c: Formatting changes, topological sort,
16288 s/register//.
16289
abadc117
AD
162902000-10-02 Akim Demaille <akim@epita.fr>
16291
16292 * src/lex.h: Prototype `lex.c' exported functions.
16293 * src/reader.c: Adjust.
16294 * src/lex.c: Formatting changes.
16295 (safegetc): Rename as...
16296 (xgetc): this.
16297
720d742f
AD
162982000-10-02 Akim Demaille <akim@epita.fr>
16299
16300 * src/lalr.h: New file.
16301 Propagate its inclusion instead of prototypes and `extern'.
16302 * src/lalr.c: Formatting changes, topological sorting etc.
16303
f2acea59
AD
163042000-10-02 Akim Demaille <akim@epita.fr>
16305
16306 * src/output.c (token_actions): Introduce a temporary array,
16307 YYDEFACT, that makes it possible for this function to use
16308 output_short_table.
16309
d019d655
AD
163102000-10-02 Akim Demaille <akim@epita.fr>
16311
16312 `user_toknums' is output as a `short[]' in `output.c', while it is
16313 defined as a `int[]' in `reader.c'. For consistency with the
16314 other output tables, `user_toknums' is now defined as a table of
16315 shorts.
16316
16317 * src/reader.c (user_toknums): Be a short table instead of an int
16318 table.
16319 Adjust dependencies.
16320
16321 Factor the short table outputs.
16322
16323 * src/output.c (output_short_table): New function.
16324 * src/output.c (output_gram, output_stos, output_rule_data)
16325 (output_base, output_table, output_check): Use it.
16326
6c89f1c1
AD
163272000-10-02 Akim Demaille <akim@epita.fr>
16328
16329 * src/output.c (output): Topological sort of the functions, in
16330 order to get rid of the `static' prototypes.
16331 No longer use `register'.
16332 * src/output.h: New file.
16333 Propagate its inclusion in files explicitly prototyping functions
16334 from output.c.
16335
d9efd181
AD
163362000-09-21 Akim Demaille <akim@epita.fr>
16337
16338 * src/atgeneral.m4: Update from Autoconf.
16339
c29240e7 163402000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
16341
16342 * src/closure.h: New file.
16343 * src/closure.c: Formatting changes, topological sort over the
16344 functions, use of closure.h.
16345 (initialize_closure, finalize_closure): Rename as...
16346 (new_closure, free_closure): these. Adjust dependencies.
16347 * src/LR0.c: Formatting changes, topological sort, use of
16348 cloture.h.
16349 (initialize_states): Rename as...
16350 (new_states): this.
16351 * src/Makefile.am (noinst_HEADERS): Adjust.
16352
499daa50
AD
163532000-09-20 Akim Demaille <akim@epita.fr>
16354
16355 * src/acconfig.h: Don't protect config.h against multiple
16356 inclusion.
16357 Don't define PARAMS.
16358 * src/system.h: Define PARAMS.
16359 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
16360 purpose of config.h. system.h must not try to fix wrong
16361 definitions in config.h.
16362
cc84fd5d
AD
163632000-09-20 Akim Demaille <akim@epita.fr>
16364
16365 * src/derives.h: New file.
16366 * src/main.c, src/derives.h: Use it.
16367 Formatting changes.
16368 * src/Makefile.am (noinst_HEADERS): Adjust.
16369
db5b3a89
AD
163702000-09-20 Akim Demaille <akim@epita.fr>
16371
16372 * tests/atgeneral.m4: Update from Autoconf.
16373 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
16374 (AT_CHECK_CALC): New macros.
16375 Use these macros to test bison with options `', `--raw',
16376 `--debug', `--yacc', `--yacc --debug'.
16377
ceed8467
AD
163782000-09-19 Akim Demaille <akim@epita.fr>
16379
16380 * src/output.c: Formatting changes.
16381 * src/machine.h: Remove, leaving its contents in...
16382 * src/system.h: here.
16383 Include stdio.h.
16384 Adjust all dependencies on stdio.h and machine.h.
16385 * src/getargs.h: New file.
16386 Let all `extern' declarations about getargs.c be replaced with
16387 inclusion of `getargs.h'.
16388 * src/Makefile.am (noinst_HEADERS): Adjust.
16389
16390 * tests/calc.m4 (yyin): Be initialized in main, not on the global
16391 scope.
16392 (yyerror): Returns void, not int.
16393 * doc/bison.texinfo: Formatting changes.
16394
05a1d24b
AD
163952000-09-19 Akim Demaille <akim@epita.fr>
16396
16397 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
16398 portable.
16399
cbd25751
AD
164002000-09-18 Akim Demaille <akim@epita.fr>
16401
16402 * configure.in: Append WARNING_CFLAGS to CFLAGS.
16403 * src/Makefile.am (INCLUDES): Don't.
16404 Be ready to fetch headers in lib/.
16405
13863333
AD
164062000-09-18 Akim Demaille <akim@epita.fr>
16407
16408 * doc/bison.texinfo: Update the copyright.
16409 ANSIfy and GNUify the examples.
16410 Remove the old menu.
16411
0d533154
AD
164122000-09-18 Akim Demaille <akim@epita.fr>
16413
16414 First set of tests: use the `calc' example from the documentation.
16415
16416 * src/bison.s1 (yyparse): Condition the code using `yytname' which
16417 is defined only when YYDEBUG is.
16418 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
16419 * src/files.c (tryopen, tryclose): Formatting changes.
16420 Move to the top and be static.
16421 * src/reader.c (read_signed_integer): Likewise.
16422 * tests/calc.m4: New file.
16423 * Makefile.am, suite.m4: Adjust.
16424 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
16425
e79137ac
AD
164262000-09-18 Akim Demaille <akim@epita.fr>
16427
16428 Add support for an Autotest test suite for Bison.
16429
16430 * m4/m4.m4, m4/atconfig.m4: New files.
16431 * m4/Makefile.am (EXTRA_DIST): Adjust.
16432 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
16433 files.
16434 * src/getargs.c: Display a more standard --version message.
16435 * src/reader.c (reader): Formatting changes.
16436 No longer depend upon VERSION_STRING.
16437 * configure.in: No longer use `dnl'.
16438 Set up the test suite and the new directory `tests/.
16439 (VERSION_STRING): Remove.
16440
27821bff
AD
164412000-04-14 Akim Demaille <akim@epita.fr>
16442
16443 * src/reader.c (copy_comment2): New function, same as former
16444 `copy_comment', but outputs into two FILE *.
16445 (copy_comment): Use it.
16446 (parse_union_decl): Use it.
16447 (get_type, parse_start_decl): Use the same `invalid' message.
16448 (parse_start_decl, parse_union_decl): Use the same `multiple'
16449 message.
16450 (parse_union_decl, copy_guard, copy_action): Use the same
16451 `unmatched' message.
16452 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
16453
cfe5fbc0
AD
164542000-03-31 Akim Demaille <akim@epita.fr>
16455
16456 * src/files.c (tryopen, tryclose): Move to the top.
16457 Be static.
16458
cb7db13e
AD
164592000-03-31 Akim Demaille <akim@epita.fr>
16460
16461 * src/main.c (main): Don't call `done', exit does it.
16462
a0f6b076
AD
164632000-03-31 Akim Demaille <akim@epita.fr>
16464
36281465
AD
16465 * allocate.c: s/return (foo)/return foo/.
16466 * lalr.c: Likewise.
16467 * LR0.c: Likewise.
16468 * output.c: Likewise.
16469 * reader.c: Likewise.
16470 * symtab.c: Likewise.
16471 * vmsgetargs.c: Likewise.
16472
164732000-03-31 Akim Demaille <akim@epita.fr>
16474
16475 Clean up the error reporting functions.
a0f6b076
AD
16476
16477 * src/report.c: New file.
16478 * src/report.h: Likewise.
16479 * src/Makefile.am: Adjust.
16480 * m4/error.m4: New file.
16481 * m4/Makefile.am: Adjust.
16482 * configure.in (jm_PREREQ_ERROR): Call it.
16483 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
16484 Remove.
16485 (fatal, fatals): Remove. All callers use complain.c::fatal.
16486 (warn, warni, warns, warnss, warnss): Remove. All callers use
16487 complain.c::complain.
16488 (toomany): Remove, use fatal instead.
16489 * src/files.c (done): No argument, use complain_message_count.
16490 * src/main.c (main): Register `done' to `atexit'.
16491
16492 * src/getargs.c (usage): More `fputs', less `fprintf'.
16493
18539825
AD
164942000-03-28 Akim Demaille <akim@epita.fr>
16495
16496 * lib/: New directory.
16497 * Makefile.am (SUBDIRS): Adjust.
16498 * configure.in: Adjust.
16499 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
16500 useless.
16501 * src/alloca.c: Moved to lib/.
16502 * src/getopt.c: Likewise.
16503 * src/getopt1.c: Likewise.
16504 * src/getopt.h: Likewise.
16505 * src/ansi2knr.c: Likewise.
16506 * src/ansi2knr.1: Likewise.
16507 * src/Makefile.am: Adjust.
16508 * lib/Makefile.am: New file.
16509
9f306f2a
AD
165102000-03-28 Akim Demaille <akim@epita.fr>
16511
16512 * src/getargs.c (usage): Refresh the help message.
16513
0ba347b6
AD
165142000-03-17 Akim Demaille <akim@epita.fr>
16515
16516 * src/getopt1.c: Updated from textutils 2.0e
16517 * src/getopt.c: Likewise.
16518 * src/getopt.h: Likewise.
16519
dbe7f271
AD
165202000-03-17 Akim Demaille <akim@epita.fr>
16521
16522 * src/Makefile.am (bison.simple): Fix the awk program: quote only
16523 the file name, not the whole `#line LINE FILE'.
16524
75bbe78d
AD
165252000-03-17 Akim Demaille <akim@epita.fr>
16526
16527 On syntax errors, report the token on which we choked.
16528
aa5fd0ee
AD
16529 * src/bison.s1 (yyparse): In the label yyerrlab, when
16530 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 16531
7b306f52
AD
165322000-03-17 Akim Demaille <akim@epita.fr>
16533
aa5fd0ee 16534 * src/reader.c (copy_at): New function.
7b306f52
AD
16535 (copy_guard): Use it.
16536 (copy_action): Use it.
16537
e87b5700
AD
165382000-03-17 Akim Demaille <akim@epita.fr>
16539
16540 Be kind to translators, save some useless translations.
16541
aa5fd0ee 16542 * src/main.c (banner): New function.
e87b5700
AD
16543 (fatal_banner): Use it.
16544 (warn_banner): Use it.
16545
ae3c3164
AD
165462000-03-17 Akim Demaille <akim@epita.fr>
16547
aa5fd0ee
AD
16548 * src/reader.c (copy_definition): Use copy_string and
16549 copy_comment. Removed now unused `match', `ended',
16550 `cplus_comment'.
ae3c3164
AD
16551 (copy_comment, copy_string): Moved, to be visible from
16552 copy_definition.
16553
4dc58e7c
AD
165542000-03-17 Akim Demaille <akim@epita.fr>
16555
aa5fd0ee
AD
16556 * src/reader.c (copy_string): Declare `static inline'. No
16557 problems with inline, since it is checked by configure.
4dc58e7c
AD
16558 (copy_comment): Likewise.
16559
0a6384c4
AD
165602000-03-17 Akim Demaille <akim@epita.fr>
16561
aa5fd0ee 16562 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 16563
3cef001a
AD
165642000-03-17 Akim Demaille <akim@epita.fr>
16565
aa5fd0ee 16566 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
16567 (copy_action): Use it. Removed now unused `match', `ended',
16568 `cplus_comment'.
16569 (copy_guard): Likewise.
16570
ca36d2ef
AD
165712000-03-17 Akim Demaille <akim@epita.fr>
16572
aa5fd0ee 16573 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
16574 (copy_action): Use it.
16575 (copy_guard): Likewise.
16576
6666f98f
AD
165772000-03-17 Akim Demaille <akim@epita.fr>
16578
16579 Change the handling of @s so that they behave exactly like $s.
16580 There is now a pseudo variable @$ (readble and writable), location
16581 of the lhs of the rule (by default ranging from the location of
16582 the first symbol of the rhs, to the location of the last symbol,
16583 or, if the rhs is empty, YYLLOC).
16584
16585 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
16586 yyval.
16587 (yyparse): When providing a default semantic action, provide a
16588 default location action.
16589 (after the $): No longer change `*YYLSP', just stack YYLOC the
16590 same way you stack YYVAL.
16591 * src/reader.c (read_declarations): Use warns.
16592 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
16593 (copy_action, case '@'): Likewise.
16594 Use a standard error message, to save useless work from
16595 translators.
16596
41aca2e0
AD
165972000-03-17 Akim Demaille <akim@epita.fr>
16598
aa5fd0ee
AD
16599 * src/bison.s1: Formatting and cosmetics changes.
16600 * src/reader.c: Likewise.
41aca2e0
AD
16601 Update the Copyright notice.
16602
dc08c1d5
AD
166032000-03-17 Akim Demaille <akim@epita.fr>
16604
aa5fd0ee
AD
16605 * src/bison.s1 (#line): All set to `#line' only, since the
16606 Makefile now handles them.
dc08c1d5 16607
9ee3c97b
AD
166082000-03-16 Akim Demaille <akim@epita.fr>
16609
16610 * src/output.c (output_rule_data): Output the documentation of
16611 some of the tables.
16612 (Copyright notice): Update.
16613 Formatting changes.
16614
0de741ca
AD
166152000-03-16 Akim Demaille <akim@epita.fr>
16616
16617 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
16618 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
16619 One `#if YYDEBUG' remains, since it uses variables which are
16620 defined only if `YYDEBUG != 0'.
16621
bb10be54
AD
166222000-03-16 Akim Demaille <akim@epita.fr>
16623
16624 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
16625 and related variables so that the similarities are highlighted.
16626
b07b484a
AD
166272000-03-16 Akim Demaille <akim@epita.fr>
16628
16629 * src/bison.s1: Properly indent CPP directives.
16630
361f60b3
AD
166312000-03-16 Akim Demaille <akim@epita.fr>
16632
16633 * src/bison.s1: Properly indent the `alloca' CPP section.
16634
8c44d3ec
AD
166352000-03-16 Akim Demaille <akim@epita.fr>
16636
16637 Do not hard code values of directories in `configure.in'.
16638 Update the `configure' tool chain.
16639
16640 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
16641 src/makefile.am.
16642 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
16643 (AC_OUTPUT): Add m4/Makefile.
16644 Bump to bison 1.28a, 1.29 has never been released.
16645 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
16646 handled via src/Makefile.am.
16647 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
16648 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
16649 autoheader.
16650 * Makefile.am (SUBDIRS): Add m4.
16651 (ACLOCAL_AM_FLAGS): New variable.
16652 (AUTOMAKE_OPTIONS): Add check-news.
16653 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
16654 the proper line number and file name.
16655 (DEFS): Propagate the location of bison library files and of the
16656 locale files.
16657 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
16658 builddir.
16659 * acinclude.m4: Remove, replaced by the directory m4.
16660 * m4/Makefile.am (EXTRA_DIST): New variable.
16661 * m4/gettext.m4: New file, from the fileutils.
16662 * m4/lcmessage.m4: Likewise
16663 * m4/progtest.m4: Likewise.
16664 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
16665
f95997e7
AD
166662000-03-10 Akim Demaille <akim@epita.fr>
16667
16668 * src/closure.c:
16669 Formatting changes of various comments.
16670 Respect the GNU coding standards at various places.
16671 Don't use `_()' when no translation is needed.
16672
166731999-12-13 Jesse Thilo <jthilo@gnu.org>
16674
16675 * src/files.c:
16676 OS/2 honors TMPDIR environment variable.
16677
166781999-12-13 Jesse Thilo <jthilo@gnu.org>
16679
16680 * doc/bison.texinfo: Tweaked spelling and grammar.
16681 Updated ISBN.
16682 Removed reference to price of printed copy.
16683 Mention BISON_SIMPLE and BISON_HAIRY.
16684
166851999-12-13 Jesse Thilo <jthilo@gnu.org>
16686
16687 * configure.in, NEWS:
16688 Bison 1.29 released.
16689
166901999-10-27 Jesse Thilo <jthilo@gnu.org>
16691
16692 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
16693 Added reference card.
16694
166951999-07-26 Jesse Thilo <jthilo@gnu.org>
16696
16697 * po/ru.po: Added Russian translation.
16698
166991999-07-26 Jesse Thilo <jthilo@gnu.org>
16700
16701 * configure.in: Added Russian translation.
16702
167031999-07-06 Jesse Thilo <jthilo@gnu.org>
16704
16705 * configure.in, NEWS, README:
16706 Released version 1.28.
16707
167081999-06-14 Jesse Thilo <jthilo@gnu.org>
16709
16710 * src/system.h:
16711 Squashed redefinition warning on some systems.
16712
16713 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
16714 Have configure build version string instead of relying on ANSI string
16715 concatentation.
16716
167171999-06-14 Jesse Thilo <jthilo@gnu.org>
16718
16719 * po/POTFILES.in: Got rid of version.c.
16720
167211999-06-14 Jesse Thilo <jthilo@gnu.org>
16722
16723 * acconfig.h, configure.in:
16724 Have configure build version string instead of relying on ANSI string
16725 concatentation.
16726
167271999-06-08 Jesse Thilo <jthilo@gnu.org>
16728
16729 * doc/bison.1:
16730 Dropped mention of `+' for long-named options.
16731
167321999-05-30 Jesse Thilo <jthilo@gnu.org>
16733
16734 * src/files.c: Added <unistd.h> for unlink().
16735
16736 * src/Makefile.am, src/system.h:
16737 I18n fixes.
16738
167391999-05-30 Jesse Thilo <jthilo@gnu.org>
16740
16741 * README: Added a FAQ list.
16742
16743 * configure.in, acconfig.h:
16744 I18n fixes.
16745
167461999-05-30 Jesse Thilo <jthilo@gnu.org>
16747
16748 * doc/FAQ, doc/Makefile.am:
16749 Added a FAQ list.
16750
167511999-05-19 Jesse Thilo <jthilo@gnu.org>
16752
16753 * src/alloc.h, src/symtab.h, src/version.c:
16754 Protected inclusion of "config.h" with HAVE_CONFIG_H.
16755
167561999-04-18 Jesse Thilo <jthilo@gnu.org>
16757
16758 * src/.cvsignore, src/Makefile.am:
16759 Reorganized: sources in `src', documentation in `doc'.
16760
16761 * src/lex.c (literalchar):
16762 fixed the code for escaping double quotes (thanks
16763 Jonathan Czisny.)
16764
167651999-04-18 Jesse Thilo <jthilo@gnu.org>
16766
16767 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
16768 Adjusted paths to reflect directory reorganization.
16769
167701999-04-18 Jesse Thilo <jthilo@gnu.org>
16771
16772 * doc/.cvsignore, doc/Makefile.am:
16773 Reorganized: sources in `src', documentation in `doc'.
16774
167751999-04-18 Jesse Thilo <jthilo@gnu.org>
16776
16777 * configure.in:
16778 Updated AC_INIT file to reflect directory reorganization.
16779
16780 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
16781 Reorganized: sources in `src', documentation in `doc'.
16782
167831999-04-13 Jesse Thilo <jthilo@gnu.org>
16784
16785 * src/allocate.c:
16786 Don't declare calloc() and realloc() if not necessary.
16787
167881999-04-13 Jesse Thilo <jthilo@gnu.org>
16789
16790 * configure.in, acconfig.h, acinclude.m4:
16791 Don't declare calloc() and realloc() if not necessary.
16792
167931999-03-23 Jesse Thilo <jthilo@gnu.org>
16794
16795 * po/.cvsignore: Added i18n support.
16796
167971999-03-23 Jesse Thilo <jthilo@gnu.org>
16798
16799 * acconfig.h, configure.in, Makefile.am:
16800 Added i18n support.
16801
168021999-03-22 Jesse Thilo <jthilo@gnu.org>
16803
16804 * src/bison.s1: Fixed #line numbers.
16805
168061999-03-15 Jesse Thilo <jthilo@gnu.org>
16807
16808 * po/es.po, po/fr.po, po/nl.po, po/de.po:
16809 Added PO files from Translation Project.
16810
168111999-03-03 Jesse Thilo <jthilo@gnu.org>
16812
16813 * Makefile.am:
16814 Added support for non-ANSI compilers (ansi2knr).
16815
168161999-02-16 Jesse Thilo <jthilo@gnu.org>
16817
16818 * configure.in: Bumped version number to 1.27.
16819
16820 * Makefile.am:
16821 Added `bison.simple' to list of files removed by `make distclean'.
16822
168231999-02-12 Jesse Thilo <jthilo@gnu.org>
16824
16825 * src/files.c, src/files.h:
16826 Defined locations of parser files in config.h instead of Makefile.
16827
168281999-02-12 Jesse Thilo <jthilo@gnu.org>
16829
16830 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
16831 Defined locations of parser files in config.h instead of Makefile.
16832
168331999-02-09 Jesse Thilo <jthilo@gnu.org>
16834
16835 * Makefile.am:
16836 Removed inappropriate use of $< macro.
16837
168381999-02-05 Jesse Thilo <jthilo@gnu.org>
16839
16840 * po/Makefile.in.in, po/POTFILES.in:
16841 Add `po' directory skeleton.
16842
168431999-01-27 Jesse Thilo <jthilo@gnu.org>
16844
16845 * README: Document help-bison list.
16846
16847 * configure.in: Add check for mkstemp().
16848
168491999-01-20 Jesse Thilo <jthilo@gnu.org>
16850
16851 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
16852 Hush a few compiler warnings.
16853
16854 * src/files.c:
16855 Add tryclose(), which verifies that fclose was successful.
16856 Hush a couple of compiler warnings.
16857
168581999-01-20 Jesse Thilo <jthilo@gnu.org>
16859
16860 * Makefile.am, OChangeLog:
16861 ChangeLog is now automatically generated. Include the old version as
16862 OChangeLog.
16863
168641999-01-14 Jesse Thilo <jthilo@gnu.org>
16865
16866 * 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:
16867 Update FSF address.
16868
168691999-01-14 Jesse Thilo <jthilo@gnu.org>
16870
16871 * doc/bison.texinfo: Fix formatting glitch.
16872
16873 * doc/bison.texinfo: Update FSF address.
16874
168751999-01-14 Jesse Thilo <jthilo@gnu.org>
16876
16877 * acconfig.h: Update FSF address.
16878
168791999-01-08 Jesse Thilo <jthilo@gnu.org>
16880
16881 * src/system.h:
16882 Don't define PACKAGE here, since config.h defines it.
16883
168841998-12-30 Jesse Thilo <jthilo@gnu.org>
16885
16886 * src/reader.c: Update copyright date.
16887
16888 * src/main.c:
16889 Ditch sprintf to statically-sized buffers in fatal/warn functions in
16890 favor of output directly to stderr (avoids buffer overruns).
16891
16892 * src/reader.c: Some checks for premature EOF.
16893
16894 * 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:
16895 Use prototypes if the compiler understands them.
16896
16897 * src/files.c: Honor TMPDIR on Unix hosts.
16898 Use prototypes if the compiler understands them.
16899
16900 * src/reader.c:
16901 Fix a couple of buffer overrun bugs.
16902 Use prototypes if the compiler understands them.
16903
16904 * src/system.h: Include unistd.h and ctype.h.
16905 Use #ifdef instead of #if for NLS symbols.
16906
169071998-12-30 Jesse Thilo <jthilo@gnu.org>
16908
16909 * doc/bison.texinfo:
16910 Delete comment "consider using @set for edition number, etc..." since
16911 we now are doing so.
16912
169131998-12-30 Jesse Thilo <jthilo@gnu.org>
16914
16915 * configure.in:
16916 Use prototypes if the compiler understands them.
16917
16918 * NEWS: Document 1.26 highlights.
16919
16920 * Makefile.am: Require Automake 1.3 or later.
16921
16922 * acconfig.h:
16923 Use prototypes if the compiler understands them.
16924
169251998-12-29 Jesse Thilo <jthilo@gnu.org>
16926
16927 * src/version.c:
16928 Use VERSION symbol from automake for version number.
16929
169301998-12-29 Jesse Thilo <jthilo@gnu.org>
16931
16932 * acconfig.h, configure.in, version.cin:
16933 Use VERSION symbol from automake for version number.
16934
169351998-11-28 Jesse Thilo <jthilo@gnu.org>
16936
16937 * Makefile.am:
16938 Distribute original version of simple parser (bison.s1), not built
16939 version (bison.simple).
16940
169411998-11-28 Jesse Thilo <jthilo@gnu.org>
16942
16943 * doc/bison.texinfo: Add info dir entry.
16944
16945 * doc/bison.texinfo:
16946 Let automake put version number into documentation.
16947
169481998-11-26 Jesse Thilo <jthilo@gnu.org>
16949
16950 * src/bison.cld, src/build.com, src/vmshlp.mar:
16951 Add non-RCS files from /gd/gnu/bison.
16952
169531998-11-26 Jesse Thilo <jthilo@gnu.org>
16954
16955 * doc/bison.1:
16956 Document the BISON_HAIRY and BISON_SIMPLE variables.
16957
169581998-11-25 Jesse Thilo <jthilo@gnu.org>
16959
16960 * src/version.c: Build version.c automatically.
16961
16962 * src/reader.c:
16963 Fix token numbering (used to start at 258, not 257).
16964
16965 * src/system.h: Include config.h.
16966
16967 * src/getargs.c: Update bug report address.
16968
16969 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
16970 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
16971
169721998-11-25 Jesse Thilo <jthilo@gnu.org>
16973
16974 * Makefile.am:
16975 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
16976
16977 * configure.in, version.cin:
16978 Build version.c automatically.
16979
16980 * AUTHORS: Add AUTHORS file.
16981
16982 * README: Update bug report address.
16983
16984 * bison.simple:
16985 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
16986
16987 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
16988 Add automake stuff.
16989
169901998-11-25 Jesse Thilo <jthilo@gnu.org>
16991
16992 * doc/bison.texinfo: Clean up some formatting.
16993
169941998-05-05 Richard Stallman <rms@gnu.org>
16995
16996 * doc/bison.texinfo:
16997 Explain better why to make a pure parser.
16998
169991998-01-05 Richard Stallman <rms@gnu.org>
17000
17001 * src/files.c (openfiles):
17002 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17003 find a temporary directory, if possible. Do not unlink files while
17004 they are open.
17005
170061997-08-25 Richard Stallman <rms@gnu.org>
17007
17008 * src/reader.c (stack_offset;):
17009 Change some warni to warns.
17010
17011 * src/lex.c (literalchar): Use warns, not warni.
17012
170131997-06-28 Richard Stallman <rms@gnu.org>
17014
17015 * src/bison.s1: Add a Bison version comment.
17016
17017 * src/main.c (fatal, warn, berror):
17018 Use program_name.
17019
170201997-06-28 Richard Stallman <rms@gnu.org>
17021
17022 * Makefile.in (bison_version): New variable.
17023 (dist): Use that variable.
17024 (bison.s1): Substitute the Bison version into bison.simple.
17025
17026 * bison.simple: Add a Bison version comment.
17027
170281997-06-18 Richard Stallman <rms@gnu.org>
17029
17030 * src/main.c (fatal, warn, berror):
17031 Make error messages standard.
17032 (toomany): Improve error message text.
17033
17034 * 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:
17035 new.h renamed to alloc.h.
17036
170371997-06-18 Richard Stallman <rms@gnu.org>
17038
17039 * Makefile.in: new.h renamed to alloc.h.
17040
170411997-05-24 Richard Stallman <rms@gnu.org>
17042
17043 * src/lex.c (literalchar):
17044 Fix the code for escaping \, " and '.
17045
17046 (lex): Avoid trouble when there are many chars
17047 to discard in a char literal with just several chars in it.
17048
170491997-05-17 Richard Stallman <rms@gnu.org>
17050
17051 * src/bison.s1:
17052 Use malloc, if using alloca is troublesome.
17053 (YYSTACK_USE_ALLOCA): New flag macro.
17054 Define it for some systems and compilers.
17055 (YYSTACK_ALLOC): New macro.
17056 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17057 If it was malloc'd, free it.
17058
170591997-05-17 Richard Stallman <rms@gnu.org>
17060
17061 * bison.simple:
17062 Use malloc, if using alloca is troublesome.
17063 (YYSTACK_USE_ALLOCA): New flag macro.
17064 Define it for some systems and compilers.
17065 (YYSTACK_ALLOC): New macro.
17066 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17067 If it was malloc'd, free it.
17068
170691997-04-23 Richard Stallman <rms@gnu.org>
17070
17071 * src/bison.s1:
17072 (alloca) [__hpux]: Always define as __builtin_alloca.
17073
170741997-04-23 Richard Stallman <rms@gnu.org>
17075
17076 * bison.simple:
17077 (alloca) [__hpux]: Always define as __builtin_alloca.
17078
170791997-04-22 Richard Stallman <rms@gnu.org>
17080
17081 * src/bison.s1:
17082 [__hpux]: Include alloca.h (right for HPUX 10)
17083 instead of declaring alloca (right for HPUX 9).
17084
17085 * src/bison.s1 (__yy_memcpy):
17086 Declare arg `count' as unsigned int.
17087 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17088
170891997-04-22 Richard Stallman <rms@gnu.org>
17090
17091 * bison.simple:
17092 [__hpux]: Include alloca.h (right for HPUX 10)
17093 instead of declaring alloca (right for HPUX 9).
17094
17095 * bison.simple (__yy_memcpy):
17096 Declare arg `count' as unsigned int.
17097 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17098
170991997-01-03 Richard Stallman <rms@gnu.org>
17100
17101 * src/allocate.c: [__STDC__ or _MSC_VER]:
17102 Declare calloc and realloc to return void *.
17103
171041997-01-02 Richard Stallman <rms@gnu.org>
17105
17106 * src/system.h:
17107 [_MSC_VER]: Include stdlib.h and process.h.
17108 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17109
17110 * src/main.c (main): Return FAILURE as a value.
17111 (printable_version): Declare arg as int, not char.
17112
171131997-01-02 Richard Stallman <rms@gnu.org>
17114
17115 * Makefile.in (dist):
17116 Explicitly check for symlinks, and copy them.
17117
171181996-12-19 Richard Stallman <rms@gnu.org>
17119
17120 * src/files.c:
17121 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17122
171231996-12-18 Paul Eggert <eggert@gnu.org>
17124
17125 * src/bison.s1 (yyparse):
17126 If __GNUC__ and YYPARSE_PARAM are both defined,
17127 declare yyparse to have a void * argument.
17128
171291996-12-18 Paul Eggert <eggert@gnu.org>
17130
17131 * bison.simple (yyparse):
17132 If __GNUC__ and YYPARSE_PARAM are both defined,
17133 declare yyparse to have a void * argument.
17134
171351996-12-17 Richard Stallman <rms@gnu.org>
17136
17137 * src/reduce.c (nbits): Add some casts.
17138
171391996-08-12 Richard Stallman <rms@gnu.org>
17140
17141 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17142
171431996-08-12 Richard Stallman <rms@gnu.org>
17144
17145 * bison.simple: Test _MSDOS as well as _MSDOS_.
17146
171471996-07-31 Richard Stallman <rms@gnu.org>
17148
17149 * src/bison.s1:
17150 [__sun && __i386]: Include alloca.h.
17151
171521996-07-31 Richard Stallman <rms@gnu.org>
17153
17154 * bison.simple:
17155 [__sun && __i386]: Include alloca.h.
17156
171571996-07-30 Richard Stallman <rms@gnu.org>
17158
17159 * src/bison.s1: Comment change.
17160
17161 * src/bison.s1: Test _MSDOS_, not MSDOS.
17162
171631996-07-30 Richard Stallman <rms@gnu.org>
17164
17165 * bison.simple: Comment change.
17166
17167 * bison.simple: Test _MSDOS_, not MSDOS.
17168
171691996-06-01 Richard Stallman <rms@gnu.org>
17170
17171 * 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:
17172 Insert `_' macro around many string constants.
17173
17174 * src/main.c:
17175 Insert `_' macro around many string constants.
17176
17177 (main): Call setlocale, bindtextdomain and textdomain.
17178
17179 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17180 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17181 [ENABLE_NLS]: Include libintl.h.
17182 [ENABLE_NLS] (gettext): Define.
17183 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17184 (N_, PACKAGE, LOCALEDIR): New macros.
17185
171861996-06-01 Richard Stallman <rms@gnu.org>
17187
17188 * POTFILES.in: New file.
17189
17190 * Makefile.in (allocate.o):
17191 Define target explicitly.
17192
17193 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17194 (LDFLAGS): Set to @LDFLAGS@.
17195 (configure): Run autoconf only if preceding `cd' succeeds.
17196 (bison.s1): Redirect output to temporary file then move the
17197 temporary to the target, rather than redirecting directly to bison.s1.
17198 (clean): Remove config.status and config.log.
17199 (distclean): Don't remove config.status here.
17200
172011996-05-12 Richard Stallman <rms@gnu.org>
17202
17203 * src/bison.s1:
17204 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17205
172061996-05-12 Richard Stallman <rms@gnu.org>
17207
17208 * bison.simple:
17209 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17210
172111996-05-11 Richard Stallman <rms@gnu.org>
17212
17213 * src/bison.s1 (__yy_memcpy):
17214 Really reorder the args, as was supposedly done on Feb 14 1995.
17215 (yyparse): Calls changed accordingly.
17216
172171996-05-11 Richard Stallman <rms@gnu.org>
17218
17219 * Makefile.in (dist): Don't use $(srcdir).
17220
17221 * bison.simple (__yy_memcpy):
17222 Really reorder the args, as was supposedly done on Feb 14 1995.
17223 (yyparse): Calls changed accordingly.
17224
172251996-01-27 Richard Stallman <rms@gnu.org>
17226
17227 * src/output.c (output_rule_data):
17228 Test YYERROR_VERBOSE in the conditional
17229 around the definition of ttyname.
17230
172311995-12-29 Richard Stallman <rms@gnu.org>
17232
17233 * src/bison.s1:
17234 Fix line numbers in #line commands.
17235
172361995-12-29 Richard Stallman <rms@gnu.org>
17237
17238 * bison.simple:
17239 Fix line numbers in #line commands.
17240
172411995-12-27 Richard Stallman <rms@gnu.org>
17242
17243 * src/bison.s1 (YYPARSE_PARAM_DECL):
17244 In C++, make it always null.
17245 (YYPARSE_PARAM_ARG): New macro.
17246 (yyparse): Use YYPARSE_PARAM_ARG.
17247
172481995-12-27 Richard Stallman <rms@gnu.org>
17249
17250 * bison.simple (YYPARSE_PARAM_DECL):
17251 In C++, make it always null.
17252 (YYPARSE_PARAM_ARG): New macro.
17253 (yyparse): Use YYPARSE_PARAM_ARG.
17254
172551995-11-29 Richard Stallman <rms@gnu.org>
17256
17257 * doc/bison.texinfo:
17258 Describe literal string tokens, %raw, %no_lines, %token_table.
17259
172601995-11-29 Daniel Hagerty <hag@gnu.org>
17261
17262 * doc/bison.texinfo: Fixed update date
17263
172641995-10-16 Richard Stallman <rms@gnu.org>
17265
17266 * src/version.c: Version 1.25.
17267
172681995-10-16 Richard Stallman <rms@gnu.org>
17269
17270 * NEWS: *** empty log message ***
17271
172721995-10-16 Richard Stallman <rms@gnu.org>
17273
17274 * doc/bison.1, doc/bison.rnh:
17275 Add new options.
17276
172771995-10-15 Richard Stallman <rms@gnu.org>
17278
17279 * src/vmsgetargs.c, src/getargs.c:
17280 Added -n, -k, and -raw switches.
17281 (noparserflag, toknumflag, rawtoknumflag): New variables.
17282
17283 * src/symtab.h (SALIAS):
17284 New #define for adding aliases to %token.
17285 (struct bucket): Added `alias' field.
17286
17287 * src/reduce.c (reduce_grammar):
17288 Revise error message.
17289 (print_notices): Remove final `.' from error message.
17290
17291 * src/reader.c (reader_output_yylsp):
17292 New function.
17293 (readgram): Use `#if 0' around code that accepted %command
17294 inside grammar rules: The documentation doesn't allow it,
17295 and it will fail since the %command processors scan for the next %.
17296 (parse_token_decl): Extended the %token
17297 declaration to allow a multi-character symbol as an alias.
17298 (parse_thong_decl): New function.
17299 (read_declarations): Added %thong declarations.
17300 (read_declarations): Handle NOOP to deal with allowing
17301 % declarations as another means to specify the flags.
17302 (readgram): Allow %prec prior to semantics embedded in a rule.
17303 (skip_to_char, read_declarations, copy_definition)
17304 (parse_token_decl, parse_start_decl, parse_type_decl)
17305 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
17306 (get_type_name, copy_guard, copy_action, readgram)
17307 (get_type, packsymbols): Revised most error messages.
17308 Changed `fatal' to `warnxxx' to avoid aborting for error.
17309 Revised and use multiple warnxxx functions to avoid using VARARGS1.
17310 (read_declarations): Improve the error message for
17311 an invalid character. Do not abort.
17312 (read_declarations, copy_guard, copy_action): Use
17313 printable_version to avoid unprintable characters in printed output.
17314 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
17315 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
17316 Allow the type of a non-terminal can be given
17317 more than once, as long as all specifications give the same type.
17318
17319 * src/output.c:
17320 (output_headers, output_trailers, output, output_gram)
17321 (output_rule_data): Implement noparserflag variable.
17322 Implement toknumflag variable.
17323 (output): Call reader_output_yylsp to output LTYPESTR.
17324
17325 * src/main.c (main):
17326 If reader sees an error, don't process the grammar.
17327 (fatals): Updated to not use VARARGS1.
17328 (printable_version, int_to_string, warn, warni, warns, warnss)
17329 (warnsss): New error reporting functions. Avoid abort for error.
17330
17331 * src/lex.h:
17332 Added THONG and NOOP for alias processing.
17333 Added SETOPT for the new code that allows setting options with %flags.
17334
17335 * src/lex.c:
17336 Include getopt.h. Add some extern decls.
17337 (safegetc): New function to deal with EOF gracefully.
17338 (literalchar); new function to deal with reading \ escapes.
17339 (lex): Use literalchar.
17340 (lex): Implemented "..." tokens.
17341 (literalchar, lex, parse_percent_token): Made tokenbuffer
17342 always contain the token. This includes growing the token
17343 buffer while reading an integer.
17344 (parse_percent_token): Replaced if-else statement with percent_table.
17345 (parse_percent_token): Added % declarations as another
17346 way to specify the flags -n, -l, and -r. Also added hooks for
17347 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
17348 major changes to files.c.
17349 (lex) Retain in the incoming stream a character following
17350 an incorrect '/'.
17351 (skip_white_space, lex): Revised most error messages
17352 and changed fatal to warn to avoid aborting.
17353 (percent_table): Added %thong declarations.
17354
17355 * src/gram.h: Comment changes.
17356
17357 * src/files.c (openfiles, open_extra_files, done):
17358 Add faction flag
17359 and actfile file. Handle noparserflag. Both for -n switch.
17360
17361 * src/conflicts.c (resolve_sr_conflict):
17362 Remove use of alloca.
17363
173641995-06-01 Jim Meyering <meyering@gnu.org>
17365
17366 * doc/bison.texinfo: *** empty log message ***
17367
173681995-05-06 Richard Stallman <rms@gnu.org>
17369
17370 * src/bison.s1: Comment change.
17371
173721995-05-06 Richard Stallman <rms@gnu.org>
17373
17374 * bison.simple: Comment change.
17375
173761995-05-03 Richard Stallman <rms@gnu.org>
17377
17378 * src/version.c: Version now 1.24.
17379
17380 * src/bison.s1: Change distribution terms.
17381
17382 * src/version.c: Version now 1.23.
17383
173841995-05-03 Richard Stallman <rms@gnu.org>
17385
17386 * doc/bison.texinfo:
17387 Rewrite "Conditions for Using Bison".
17388 Update version to 1.24.
17389
173901995-05-03 Richard Stallman <rms@gnu.org>
17391
17392 * bison.simple: Change distribution terms.
17393
173941995-02-23 Richard Stallman <rms@gnu.org>
17395
17396 * src/files.c: Test __VMS_POSIX as well as VMS.
17397
173981995-02-14 Jim Meyering <meyering@gnu.org>
17399
17400 * src/bison.s1 (__yy_memcpy):
17401 Renamed from __yy_bcopy to avoid
17402 confusion. Reverse FROM and TO arguments to be consistent with
17403 those of memcpy.
17404
174051995-02-14 Jim Meyering <meyering@gnu.org>
17406
17407 * bison.simple (__yy_memcpy):
17408 Renamed from __yy_bcopy to avoid
17409 confusion. Reverse FROM and TO arguments to be consistent with
17410 those of memcpy.
17411
174121994-11-10 David J. MacKenzie <djm@gnu.org>
17413
17414 * NEWS: reformat
17415
17416 * NEWS: New file.
17417
17418 * Makefile.in (DISTFILES): Include NEWS.
17419
17420 * Makefile.in (DISTFILES):
17421 Include install-sh, not install.sh.
17422
17423 * configure.in: Update to Autoconf v2 macro names.
17424
174251994-10-05 David J. MacKenzie <djm@gnu.org>
17426
17427 * Makefile.in: fix typo
17428
17429 * Makefile.in (prefix, exec_prefix):
17430 Let configure set them.
17431
174321994-09-28 David J. MacKenzie <djm@gnu.org>
17433
17434 * Makefile.in: Set datadir to $(prefix)/share.
17435
174361994-09-15 Richard Stallman <rms@gnu.org>
17437
17438 * src/bison.s1:
17439 Update copyright notice and GPL version.
17440
174411994-09-15 Richard Stallman <rms@gnu.org>
17442
17443 * bison.simple:
17444 Update copyright notice and GPL version.
17445
174461994-07-12 Richard Stallman <rms@gnu.org>
17447
17448 * src/reduce.c, src/reader.c:
17449 entered into RCS
17450
174511994-05-05 David J. MacKenzie <djm@gnu.org>
17452
17453 * Makefile.in: entered into RCS
17454
174551994-03-26 Richard Stallman <rms@gnu.org>
17456
17457 * src/bison.s1: entered into RCS
17458
174591994-03-26 Richard Stallman <rms@gnu.org>
17460
17461 * bison.simple: entered into RCS
17462
174631994-03-25 Richard Stallman <rms@gnu.org>
17464
17465 * src/main.c: entered into RCS
17466
174671994-03-24 Richard Stallman <rms@gnu.org>
17468
17469 * src/conflicts.c: entered into RCS
17470
174711994-01-02 Richard Stallman <rms@gnu.org>
17472
17473 * Makefile.in: *** empty log message ***
17474
174751993-11-21 Richard Stallman <rms@gnu.org>
17476
17477 * src/bison.s1: *** empty log message ***
17478
174791993-11-21 Richard Stallman <rms@gnu.org>
17480
17481 * doc/bison.texinfo: entered into RCS
17482
17483 * doc/bison.texinfo: *** empty log message ***
17484
174851993-11-21 Richard Stallman <rms@gnu.org>
17486
17487 * bison.simple: *** empty log message ***
17488
174891993-10-25 David J. MacKenzie <djm@gnu.org>
17490
17491 * doc/bison.texinfo: *** empty log message ***
17492
174931993-10-19 Richard Stallman <rms@gnu.org>
17494
17495 * src/bison.s1: *** empty log message ***
17496
174971993-10-19 Richard Stallman <rms@gnu.org>
17498
17499 * bison.simple: *** empty log message ***
17500
175011993-10-14 Richard Stallman <rms@gnu.org>
17502
17503 * src/bison.s1: *** empty log message ***
17504
175051993-10-14 Richard Stallman <rms@gnu.org>
17506
17507 * bison.simple: *** empty log message ***
17508
175091993-09-14 David J. MacKenzie <djm@gnu.org>
17510
17511 * doc/bison.texinfo: *** empty log message ***
17512
175131993-09-13 Noah Friedman <friedman@gnu.org>
17514
17515 * Makefile.in: *** empty log message ***
17516
175171993-09-10 Richard Stallman <rms@gnu.org>
17518
17519 * src/conflicts.c: *** empty log message ***
17520
17521 * src/system.h: entered into RCS
17522
175231993-09-10 Richard Stallman <rms@gnu.org>
17524
17525 * doc/bison.1: entered into RCS
17526
175271993-09-06 Noah Friedman <friedman@gnu.org>
17528
17529 * src/version.c: entered into RCS
17530
175311993-09-06 Noah Friedman <friedman@gnu.org>
17532
17533 * Makefile.in: *** empty log message ***
17534
175351993-07-30 David J. MacKenzie <djm@gnu.org>
17536
17537 * Makefile.in: *** empty log message ***
17538
175391993-07-24 Richard Stallman <rms@gnu.org>
17540
17541 * src/bison.s1: *** empty log message ***
17542
175431993-07-24 Richard Stallman <rms@gnu.org>
17544
17545 * bison.simple: *** empty log message ***
17546
175471993-07-08 David J. MacKenzie <djm@gnu.org>
17548
17549 * Makefile.in: *** empty log message ***
17550
175511993-07-04 Richard Stallman <rms@gnu.org>
17552
17553 * src/bison.s1: *** empty log message ***
17554
175551993-07-04 Richard Stallman <rms@gnu.org>
17556
17557 * bison.simple: *** empty log message ***
17558
175591993-06-26 David J. MacKenzie <djm@gnu.org>
17560
17561 * src/getargs.c: entered into RCS
17562
175631993-06-26 David J. MacKenzie <djm@gnu.org>
17564
17565 * doc/bison.texinfo: *** empty log message ***
17566
17567 * doc/bison.1: New file.
17568
175691993-06-25 Richard Stallman <rms@gnu.org>
17570
17571 * src/getargs.c: New file.
17572
175731993-06-16 Richard Stallman <rms@gnu.org>
17574
17575 * src/bison.s1: *** empty log message ***
17576
175771993-06-16 Richard Stallman <rms@gnu.org>
17578
17579 * bison.simple: *** empty log message ***
17580
175811993-06-03 Richard Stallman <rms@gnu.org>
17582
17583 * src/bison.s1: New file.
17584
175851993-06-03 Richard Stallman <rms@gnu.org>
17586
17587 * doc/bison.texinfo: *** empty log message ***
17588
175891993-06-03 Richard Stallman <rms@gnu.org>
17590
17591 * bison.simple: New file.
17592
175931993-05-19 Richard Stallman <rms@gnu.org>
17594
17595 * doc/bison.texinfo: New file.
17596
175971993-05-07 Noah Friedman <friedman@gnu.org>
17598
17599 * Makefile.in: *** empty log message ***
17600
176011993-04-28 Noah Friedman <friedman@gnu.org>
17602
17603 * src/reader.c: *** empty log message ***
17604
176051993-04-23 Noah Friedman <friedman@gnu.org>
17606
17607 * src/alloc.h: entered into RCS
17608
176091993-04-20 David J. MacKenzie <djm@gnu.org>
17610
17611 * src/version.c: *** empty log message ***
17612
17613 * src/files.c, src/allocate.c:
17614 entered into RCS
17615
17616 * src/reader.c: *** empty log message ***
17617
17618 * src/lex.c: entered into RCS
17619
17620 * src/conflicts.c: New file.
17621
17622 * src/symtab.c: entered into RCS
17623
17624 * src/alloc.h: New file.
17625
17626 * src/LR0.c: entered into RCS
17627
176281993-04-18 Noah Friedman <friedman@gnu.org>
17629
17630 * src/reader.c: New file.
17631
17632 * src/version.c: *** empty log message ***
17633
176341993-04-18 Noah Friedman <friedman@gnu.org>
17635
17636 * Makefile.in: *** empty log message ***
17637
176381993-04-17 Noah Friedman <friedman@gnu.org>
17639
17640 * Makefile.in: *** empty log message ***
17641
176421993-04-15 Richard Stallman <rms@gnu.org>
17643
17644 * src/main.c, src/files.c:
17645 New file.
17646
176471993-04-15 Noah Friedman <friedman@gnu.org>
17648
17649 * configure.in: entered into RCS
17650
17651 * configure.in: *** empty log message ***
17652
17653 * configure.in: New file.
17654
176551993-04-14 Richard Stallman <rms@gnu.org>
17656
17657 * Makefile.in: New file.
17658
176591993-04-13 Richard Stallman <rms@gnu.org>
17660
17661 * src/version.c: New file.
17662
176631993-03-25 Richard Stallman <rms@gnu.org>
17664
17665 * src/output.c: entered into RCS
17666
176671992-09-25 Richard Stallman <rms@gnu.org>
17668
17669 * configure.bat: entered into RCS
17670
176711992-06-22 Richard Stallman <rms@gnu.org>
17672
17673 * src/vmsgetargs.c: entered into RCS
17674
176751992-06-22 Richard Stallman <rms@gnu.org>
17676
17677 * doc/bison.rnh: entered into RCS
17678
176791992-04-20 David J. MacKenzie <djm@gnu.org>
17680
17681 * README: entered into RCS
17682
176831992-01-22 Richard Stallman <rms@gnu.org>
17684
17685 * src/machine.h: entered into RCS
17686
176871991-12-21 Richard Stallman <rms@gnu.org>
17688
17689 * src/lalr.c, src/closure.c:
17690 entered into RCS
17691
176921991-12-20 Richard Stallman <rms@gnu.org>
17693
17694 * src/state.h: entered into RCS
17695
176961991-12-18 Richard Stallman <rms@gnu.org>
17697
17698 * src/print.c, src/nullable.c, src/derives.c:
17699 entered into RCS
17700
177011991-11-03 David J. MacKenzie <djm@gnu.org>
17702
17703 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
17704 entered into RCS
17705
177061988-09-09 Richard Stallman <rms@gnu.org>
17707
17708 * src/bison.hairy: entered into RCS
17709
177101987-12-16 Richard Stallman <rms@gnu.org>
17711
17712 * REFERENCES: entered into RCS
dc546b0f 17713
f294a2c2 17714
04098407 17715 -----
f294a2c2 17716
04098407 17717 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e2a21b6f
PE
17718 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
17719 Software Foundation, Inc.
f294a2c2 17720
04098407
PE
17721 Copying and distribution of this file, with or without
17722 modification, are permitted provided the copyright notice and this
17723 notice are preserved.
e9071366
AD
17724
17725$Id$