]> git.saurik.com Git - bison.git/blame - ChangeLog
Fail on parse error in calc++.
[bison.git] / ChangeLog
CommitLineData
414c76a4
AD
12008-11-03 Akim Demaille <demaille@gostai.com>
2
3 Fail on parse error in calc++.
4 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
5 status.
6 * examples/calc++/test ($me, $number, $exit, run): New.
7 Use them to propagate errors to the exit status.
8
8a5783fd
AD
92008-11-03 Akim Demaille <demaille@gostai.com>
10
11 Don't specify the skeleton twice in the example.
12 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
13 file does what is needed.
14
0cc5bead
AD
152008-11-03 Akim Demaille <demaille@gostai.com>
16
17 bench: Improve output.
18 * etc/bench.pl.in (bench_grammar): Tune the printf format.
19
5b421a4e
AD
202008-11-03 Akim Demaille <demaille@gostai.com>
21
22 bench: check impact of %debug on variants.
23 * etc/bench.pl.in (variant_grammar): Fix the computation of
24 $variant.
25 Generate a grammar file that can work with or without %debug.
26 Do use the @directive.
27 (bench_variant_parser): Check impact of %debug.
28 (@directives): Rename all the occurrences to...
29 (@directive): this, for consistency.
30
d11ee647
AD
312008-11-03 Akim Demaille <demaille@gostai.com>
32
33 bench: report the size too.
34 * etc/bench.pl.in ($iterations): Defaults to -3.
35 (&bench_grammar): Require hireswallclock.
36 Compute and display the size of the result.
37 More comments.
38
e1b74b92
AD
392008-11-03 Akim Demaille <demaille@gostai.com>
40
41 bench: More use of the verbosity level.
42 * etc/bench.pl.in ($verbose, &verbose): New.
43 Use them.
44 More POD documentation.
45
7e5f9c54
AD
462008-11-03 Akim Demaille <demaille@gostai.com>
47
48 bench.pl: a command line interface
49 * etc/bench.pl.in: More doc.
50 Some fixes in the documentation.
51 ($cflags, $iterations, &help, &getopt): New.
52 Use them.
53 (&variant_grammar): Let the number of stages be 10 times what is
54 specified.
55
7109a18d
AD
562008-11-03 Akim Demaille <demaille@gostai.com>
57
58 Bench the use of Boost.Variants.
59 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
60 New.
61 (&compile): Be ready to compile C++ parsers.
62 (&bench_push_parser): Move debug information to the outermost
63 level.
64 * THANKS: Add Michiel De Wilde.
65
922730fe
AD
662008-11-03 Akim Demaille <demaille@gostai.com>
67
68 bench.pl: Pass directives as a list instead of as a string.
69 * etc/bench.pl.in (&directives): New.
70 (&triangular_grammar, &calc_grammar): Use it to format the Bison
71 directives.
72 (&triangular_grammar): Do use the directives (were ignored).
73 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
74 directives.
75
7484f1d4
AD
762008-11-03 Akim Demaille <demaille@gostai.com>
77
78 Improve genericity of bench.pl.
79 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
80 argument.
81 (&bench_push_parser): New.
82 Call it.
83
15129f25
AD
842008-11-03 Akim Demaille <demaille@gostai.com>
85
86 Add documentation to bench.pl.
87 * etc/bench.pl.in: Comment changes.
88
0e0ed236
AD
892008-11-03 Akim Demaille <demaille@gostai.com>
90
91 Fuse the three stacks into a single one.
92 In order to make it easy to perform benchmarks to ensure that there are no
93 performance loss, lalr1.cc is forked into lalr1-fusion.cc. Eventually,
94 lalr1-fusion.cc will replace lalr1.cc.
95
96 Meanwhile, to make sure that lalr1-fusion.cc is correctly exercized by the
97 test suite, the user must install a symbolic link from lalr1.cc to it.
98
99 Instead of having three stacks (state, value, location), use a stack
100 of triples. This considerably simplifies the code (and it will be
101 easier not to require locations as currently does the C++ parser),
102 and also gives a 10% speedup according to etc/bench (probably mainly since
103 memory allocation is done once instead of three times).
104
105 Another motivation is to make it easier to destruct properly
106 semantic values: now that they are bound to their state (hence
107 symbol type) it will be easier to call the appropriate destructor.
108
109 These changes should probably benefit the C parser too.
110
111 * data/lalr1.cc: Copy as... * data/lalr1-fusion.cc: this new
112 file.
113 (b4_rhs_value, b4_rhs_location): New definitions overriding those
114 from c++.m4.
115 (state_stack_type, semantic_stack_type, location_stack_type)
116 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
117 (data_type, stack_type, yystack_): New.
118 (YYLLOC_DEFAULT, yypush_): Adjust.
119 (yyerror_range): Now based on data_type, not location_type.
120
7dedf26e
AD
1212008-11-03 Akim Demaille <demaille@gostai.com>
122
123 Push the state, value, and location at the same time.
124 This is needed to prepare a forthcoming patch that fuses the three
125 stacks into one.
126
127 * data/lalr1.cc (parser::yypush_): New.
128 (parser::yynewstate): Change the semantics: instead of arriving to
129 this label when value and location have been pushed, but yystate
130 is to be pushed on the state stack, now the three of them must
131 have been pushed before. yystate still must be the new state.
132 This allows to use yypush_ everywhere instead of individual
133 handling of the stacks.
134
c4585f1e
AD
1352008-11-03 Akim Demaille <demaille@gostai.com>
136
137 Prefer references to pointers.
138 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
139 definition to use references instead of pointers.
140 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
141 Take the value and location as references.
142 Adjust callers.
143
56017c17
AD
1442008-11-03 Akim Demaille <demaille@gostai.com>
145
146 stack::size instead of stack::height.
147 * data/lalr1.cc (stack::height): Rename as...
148 (stack::size): this.
149 Fix the output type.
150 Comment changes.
151
5ab8c47b
AD
1522008-11-03 Akim Demaille <demaille@gostai.com>
153
154 Use variants to support objects as semantic values.
155 This patch was inspired by work by Michiel De Wilde. But he used Boost
156 variants which (i) requires Boost on the user side, (ii) is slow, and
157 (iii) has useless overhead (the parser knows the type of the semantic value
158 there is no reason to duplicate this information as Boost.Variants do).
159
160 This implementation reserves a buffer large enough to store the largest
161 objects. yy::variant implements this buffer. It was implemented with
162 Quentin Hocquet.
163
164 * src/output.c (type_names_output): New.
165 (output_skeleton): Invoke it.
166 * data/c++.m4 (b4_variant_if): New.
167 (b4_symbol_value): If needed, provide a definition for variants.
168 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
169 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
170 (b4_char_sizeof, yy::variant): New.
171 (parser::parse): If variants are requested, define
172 parser::union_type, parser::variant, change the definition of
173 semantic_type, construct $$ before running the user action instead
174 of performing a default $$ = $1.
175 * examples/variant.yy: New.
176 Based on an example by Michiel De Wilde.
177
1fa5d8bb
AD
1782008-11-03 Akim Demaille <demaille@gostai.com>
179
180 Parameterize the extraction of semantic values.
181 To make future changes easier, no longer rely on ".TYPE" being the
182 way to get a semantic value.
183
184 * data/c.m4 (b4_symbol_value): New.
185 Use it.
186 * data/c++.m4, data/yacc.c: Use it.
187 * data/glr.c: Use b4_symbol_value.
188 (b4_rhs_data): New.
189 Use it.
190
91ba8a55
AD
1912008-11-03 Akim Demaille <demaille@gostai.com>
192
193 Prepare easier M4 changes.
194 * data/lalr1.cc: Use escaped [] instead of literals to prepare
195 future changes.
196
c9ba9e59
JD
1972008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
198
199 Initiate further development.
200 * NEWS: Create an empty section for new entries.
201 * gnulib: Update submodule to HEAD.
202
bfb40910
JD
2032008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
204
205 * NEWS: Version 2.4.
206
241fda7a
JD
2072008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
208
209 Prepare for next release.
210 * NEWS: Briefly mention changes since 2.3b.
211 * README: Say GNU m4 1.4.6, which we've been requiring in release
212 announcements already, not 1.4.3, which breaks the build.
213
ed4d67dc
JD
2142008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
215
216 Say %language is experimental.
217 We're thinking of extending it's effect on output file naming. See the
218 thread at
219 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
220 * NEWS: Say it's experimental.
221 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
222 recommend it over %skeleton for now.
223 (Bison Options): Likewise.
224 (C++ Bison Interface): Use %skeleton not %language.
225 (Calc++ Parser): Use %skeleton not %language.
226 * src/getargs.c (usage): Say it's experimental.
227
e254a580
DJ
2282008-11-01 Di-an Jan <dianj@freeshell.org>
229 Paolo Bonzini <bonzini@gnu.org>
230
231 Support all Java parser class modifiers.
232 * data/java.m4 (b4_percent_define_get3): New.
233 (b4_final_if, b4_strictfp_if): New.
234 * data/lalr1.java (final, strictfp, extends, implements): Support.
235 * doc/bison.texinfo (final, strictfp, extends, implements): Add
236 documentation.
237 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
238 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
239 (AT_CHECK_JAVA_GREP): New.
240 (Java parser class modifiers): New test.
241 (Java parser class extends and implements): New test.
242
243 Model exception propagation better with throws and lex_throws.
244 * data/java.m4 (b4_list2): New.
245 (throws): Change default.
246 * data/lalr1.java (yyaction): Add throws.
247 (parse): Add lex_throws in addition to throws.
248 * doc/bison.texinfo (throws, lex_throws): Add documentation.
249 * tests/java.at (Java throws specifications): New test.
250
251 Improve documentation for Java parsers.
252 * doc/bison.texinfo (Java Parsers): Add subsections.
253 Don't quote first argument of %define.
254 (Java Bison Interface): Document output files. Move documentation
255 of parser class and merge into Java Parser Interface. Document
256 features that error out. Document directives with no effect.
257 Move note about Javadoc higher.
258 (Java Semantic Values): Explicitly mention stype.
259 Document that generic types cannot be used.
260 (Java Location Values): Use @deftypeivar. Document constructors.
261 Correct return value for toString.
262 (Java Parser Interface): List undocumented constants/fields.
263 Move documentation of fields added by %parse-param closer to list
264 of members. Document that token names are added as fields.
265 Document constructors accurately. Remove error method.
266 (Java Scanner Interface): Move note on %pure-parser to Java Bison
267 Interface. Describe %code lexer and yylex accutately.
268 Remove documentation that does not match the code.
269 (Java Action Features): New.
270 (Java Differences): Add reference. Add item on semantic values.
271 Add note about @{ ... @}. Clarify %% epilogue placement.
272 (Java Declarations Summary): New.
273
274 Fix Java skeleton.
275 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
276 (b4_remove_comma): Quote test argument.
277 (b4_identification): Remove "bison" field.
278 * tests/java.at (Java parser class and package names): New test.
279 (Java %parse-param and %lex-param): New test.
280 (Java stype, position_class and location_class): New test.
281
f259e4e6
PB
2822008-10-31 Di-an Jan <dianj@freeshell.org>
283
284 * data/lalr1.jave: Update copyright years.
285 (YYParser): Correct name of "generated from" file in Javadoc:
286 use b4_file_name instead of @ofile@.
287 (Location constructor): Correct Javadoc parameter name.
288 (yylloc): Add missing opening m4 quote after b4_location_if.
289 This removes a stray [ in the Javadoc of Lexer.getStartPos.
290 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
291 (YYParser constructor): Correct Javadoc parameter name.
292
cae5057f
JD
2932008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
294
295 Always put auxiliary code files in the same dir as other output files.
296 * src/files.c (compute_file_name_parts): When the user specifies
297 --output but not --file-prefix, extract the directory prefix from the
298 file prefix not from the grammar file name. This affects the location
299 of files like location.hh generated by the C++ skeleton. The includes
300 in the other output files require this fix.
301 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
302 for expected output files.
303 (Output files): Add a test for the above.
304
4af432ba
JD
3052008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
306
307 * gnulib: Update submodule to HEAD.
308
e26d4e43
JD
3092008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
310
311 Update copyright year.
312 * src/files.c: Here.
313
c0ee9e21
DJ
3142008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
315
316 Don't overwrite the input file.
317 * src/files.c (output_file_name_check): Fatal error if using input file
318 for output.
319 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
320 argument.
321 (Conflicting output files): Add test.
322
482dc52f
AD
3232008-10-28 Akim Demaille <demaille@gostai.com>
324
325 Space changes.
326 * data/lalr1.cc: Formatting changes.
327
52cbbe84
AD
3282008-10-28 Akim Demaille <demaille@gostai.com>
329
330 Don't define debugging functions when !YYDEBUG.
331 * data/lalr1.cc (debug_stream, set_debug_stream)
332 (debug_level_type, debug_level, set_debug_level): Don't
333 declare them when YYDEBUG is not defined.
334 The implementation are already YYDEBUG-aware.
335
0925d5bf
AD
3362008-10-28 Akim Demaille <demaille@gostai.com>
337
338 Prefer "continue" for empty loop bodies.
339 * etc/bench.pl.in: Use "continue" instead of {}.
340
cf98343c
AD
3412008-10-28 Akim Demaille <demaille@gostai.com>
342
343 Space and comments changes.
344 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
345 * data/c.m4, data/lalr1.cc: Space changes.
346
9f467b7d
AD
3472008-10-28 Akim Demaille <demaille@gostai.com>
348
349 Make gnulib a submodule.
350 * gnulib: New.
351 * .gitmodules (gnulib): New.
352
0f0e1ace
JD
3532008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
354
355 Fix yyerror_range for user-defined location type in C++. Reported by
356 Georg Sauthoff at
357 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
358 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
359 * THANKS (Georg Sauthoff): Add.
360
548e2104
JD
3612008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
362
363 Update several administrative files mainly to facilitate releasing.
364 * HACKING (Administrivia): Make the git-merge-changelog notes more
365 helpful.
366 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
367 (Release Procedure): Update for git and add numerous details that were
368 previously missing.
369 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
370 * maint.mk (announcement): Don't list bison as a bootstrap tool so
371 that announcements don't claim we bootstrapped with whatever bison
372 happened to be in PATH. Add flex as a bootstrap tool.
373 * Makefile.maint: Remove, previously replaced by maint.mk.
374 * Makefile.cfg: Remove, and migrate settings to...
375 * cfg.mk: ... here for the sake of `make announcement'.
376 * bootstrap.conf (gnulib_modules): Add announce-gen.
377 * README: Say GNU Bison instead of just Bison. Suggested by Karl
378 Berry.
379
ddf17a6e
PB
3802008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
381
382 Small but important bugfixes for the Java skeleton.
383 * data/lalr1.java (yyerror): Change Location to b4_location_type.
384 (yy_symbol_print): Call toString on yyvaluep.
385
e1145ad8
AD
3862008-08-29 Akim Demaille <demaille@gostai.com>
387
388 Clarify UPDATED use.
389 * doc/bison.texinfo: It refers to the last edition of this file,
390 not to the release date of Bison.
391 Reported by Joel E. Denny.
392
0df72d78
AD
3932008-08-29 Akim Demaille <demaille@gostai.com>
394
395 * README: Update FAQ pointer.
396 Reported by Joel E. Denny.
397
9a90b6bb
EB
3982008-08-27 Eric Blake <ebb9@byu.net>
399
400 Resync m4sugar from autoconf.
401 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
402 (m4_init): Adjust to latest m4.git changes.
403 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
404 effects.
405 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
406 (_m4_list_cmp): Reduce side effects.
407
65015668
AD
4082008-08-27 Akim Demaille <demaille@gostai.com>
409
410 Check yyerrok in calc.at.
411 * tests/calc.at (calc.y): Use yyerrok on "( error )".
412 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
413 expected.
414
98e26a92
AD
4152008-08-27 Akim Demaille <demaille@gostai.com>
416
417 Support yyerrok in lalr1.cc.
418 YYBACKUP is still to import back into lalr1.cc.
419 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
420
86c0e784
JD
4212008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
422
423 For maintainer-check*, don't recompile for a $(VERSION) update.
424 * cfg.mk: New file.
425 (_is-dist-target): Override the one in GNUmakefile.
426 * Makefile.am (EXTRA_DIST): Add cfg.mk.
427
88511166
JD
4282008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
429
430 Update for recent change to gnulib.
431 * src/parse-gram.y: Don't include strverscmp.h. It comes from
432 string.h now.
433
6bbb2ed5
EB
4342008-08-15 Eric Blake <ebb9@byu.net>
435
d67c52e8
EB
436 Remaining m4sugar merge from autoconf.
437 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
438 * data/m4sugar/foreach.m4: New file, copied from autoconf.
439 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
440 * src/output.c (output_skeleton): Tell m4 how to find it.
441
6bbb2ed5
EB
442 Partial m4sugar merge from autoconf: m4_map.
443 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
444 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
445 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
446 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
447 for empty list.
448 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
449 Likewise.
450 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
451 declares it.
452
8dce3875
JD
4532008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
454
455 Keep .version and PACKAGE_VERSION in sync.
456 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
457 dependency, and add comments justifying this in more detail. Discussed
458 starting at
459 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
460
882a1fbf
EB
4612008-08-06 Eric Blake <ebb9@byu.net>
462
a3764451
EB
463 Partial m4sugar merge from autoconf: m4_shiftn.
464 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
465 (m4_shift2, m4_shift3): New macros.
466 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
467 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
468 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
469 * data/java.m4 (b4_remove_comma): Likewise.
470
882a1fbf
EB
471 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
472 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
473 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
474 (m4_init): Consolidate wrapped text into single m4_wrap.
475 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
476 in wrapped text.
477
a30e920d
EB
4782008-08-05 Eric Blake <ebb9@byu.net>
479
dfcc5959
EB
480 Partial m4sugar merge from autoconf: builtins, version.m4.
481 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
482 (m4_prepend): Remove, as it is unused and inherently quadratic,
483 whereas m4_append is linear in newer m4.
484 (m4_mkstemp): New builtin.
485 (m4_symbols): Make rename conditional.
486 (m4_version_prereq): Ensure fatal error if used in bison, which
487 intentionally lacks version.m4.
488
a30e920d
EB
489 Fix comments in m4sugar.
490 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
491
445b7470
JD
4922008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
493
494 Update for recent .gitignore fix in Gnulib.
495 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
496 anchored .gitignore entries.
497
a1e50014
JD
4982008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
499
500 Set gnu or gnits strictness.
501 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
502 development and gnits strictness for releases. Based on Eric Blake's
503 suggestion at
504 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
505
d43f77e7
PB
5062008-07-31 Paolo Bonzini <bonzini@gnu.org>
507
508 * NEWS: Clarify documentation of %language.
509
fee2ed87
PB
5102008-07-31 Paolo Bonzini <bonzini@gnu.org>
511
512 Support usage of git-merge-changelog.
513 * .gitattributes: New.
514 * HACKING: Document usage of git-merge-changelog.
515 * bootstrap: Install git-merge-changelog entries in .git/config
516 if appropriate.
517
78029cd5
JD
5182008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
519
520 Remove remaining dependence on CVS Id keyword.
521 * ChangeLog: For the sake of people still using CVS, don't use dollars
522 when mentioning Id.
523 * data/xslt/bison.xsl: Remove Id from header comments, where it was
524 unusual anyway.
525 * data/xslt/xml2dot.xsl: Likewise.
526 * data/xslt/xml2text.xsl: Likewise.
527 * data/xslt/xml2xhtml.xsl: Likewise.
528 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
529 * doc/Makefile.am (neutralize): Remove, no longer needed.
530 (.x.1): Don't use neutralize.
531 (edit): Don't substitute for ID.
532 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
533
c53d18b1
JD
5342008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
535
536 Fix dependence on computed configure variables.
537 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
538 $(top_srcdir)/configure.ac so that changes to computed variables, such
539 as PACKAGE_VERSION, are seen.
540 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
541
5523ac79
JD
5422008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
543
544 Update copyright dates for recent changes.
545 * Makefile.am: Here.
546 * src/Makefile.am: Here.
547 * src/reduce.c: Here.
548 * tests/reduce.at: Here.
549
8fa36911
JD
5502008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
551
552 Use git-version-gen for version names between releases.
553 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
554 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
555 * .prev-version: New.
556 * .version.in: Remove.
78029cd5 557 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
558 revision.
559 * GNUmakefile: Remove, now copied from Gnulib.
560 * Makefile.am: Add code suggested by comments in
561 build-aux/git-version-gen.
562 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
563 .prev-version, and .version.
564 * NEWS (2.3b+): Rename to...
565 (?.?): ... this because we're dropping the "+" version naming scheme,
566 but, in general, we still can't be sure of our next release name.
567 * bootstrap: Add a quick hack to remove from .gitignore the
568 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
569 entry. This should really be fixed in gnulib instead.
570 * bootstrap.conf (gnulib_modules): Add gnumakefile.
571 * configure.ac (AC_INIT): Set version name by invoking
572 build-aux/git-version-gen.
573 (AC_CONFIG_FILES): Remove .version, now generated by
574 build-aux/git-version-gen.
575 * maint.mk: New, copied from coreutils.
576 * doc/.cvsignore (bison.1): Add.
577 * doc/.gitignore (/bison.1): Add.
578 * doc/bison.1: Remove, generated.
579 * src/.cvsignore (revision.c): Remove.
580 * src/.gitignore (/revision.c): Remove.
581 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
582 (BUILT_SOURCES): Remove revision.c.
583 (revision.c): Remove.
584 * src/getargs.c (version): Don't print revision after the VERSION.
585 * src/revision.h: Remove.
586
bcf07cb7
JD
5872008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
588
589 Fix untranslatable composition of sentences. Reported by Goran
590 Uddeborg at
591 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
592 * THANKS (Goran Uddeborg): Add.
593 * src/reduce.c (reduce_print): Report the number of nonterminals and
594 rules useless in the grammar in separate sentences.
595 * tests/reduce.at (Useless Rules): Update output.
596 (Reduced Automaton): Likewise.
597 (Underivable Rules): Likewise.
598 (Empty Language): Likewise.
599
9aacab9a
JD
6002008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
601
602 Fix some .gitignore and .cvsignore problems.
603 * bootstrap (insert_sorted_if_absent): Replace all uses with...
604 (insert_vc_ignore): ... this new function, which prepends `/' to all
605 .gitignore entries before passing them to insert_sorted_if_absent.
606 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
607 .cvsignore files are maintained even though Bison developers run
608 bootstrap while using Git.
609 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
610 unneeded by Bison.
611 (gnulib): Add.
612 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
613 unneeded. Reported by Eric Blake.
614 * lib/.gitignore (/*~): Add.
615 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
616 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
617 Blake.
618 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
619
a9fc7990
JD
6202008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
621
622 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
623 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
624 * bootstrap.conf (gnulib_modules): Add unsetenv.
625 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
626 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
627 (/setenv.m4): Add.
628 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
629 the first argument because it may become position-dependent, and unset
630 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
631 Add comments explaining these issues in more detail.
632
0f1d6f10
JD
6332008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
634
635 Add .gitignore everywhere based on .cvsignore.
636 * .gitignore: New.
637 * build-aux/.gitignore: New.
638 * data/.gitignore: New.
639 * doc/.gitignore: New.
640 * etc/.gitignore: New.
641 * examples/.gitignore: New.
642 * examples/calc++/.gitignore: New.
643 * lib/.gitignore: New.
644 * m4/.gitignore: New.
645 * po/.gitignore: New.
646 * runtime-po/.gitignore: New.
647 * src/.gitignore: New.
648 * tests/.gitignore: New.
649
7bd1665a
JD
6502008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
651
652 * NEWS (2.3b+): New section, empty for now.
653 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
654
72c5b982
JD
6552008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
656
657 * NEWS (2.3b): Update release date since there has been a delay in
658 getting the announcements and tarballs out.
659
bd02cd5d
JD
6602008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
661
662 * NEWS: Version 2.3b.
663 * configure.ac (AC_INIT): Likewise.
664 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
665
9126263e
JD
6662008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
667
668 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
669 been doing it for years.
670 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
671 (Release Procedure): Add FIXME about make alpha being unmaintained.
672
fa6aa7b3
JD
6732008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
674
675 * data/yacc.c: Reformat m4 a little for readability.
676 * src/lalr.c (build_relations): Correct comment.
677
d30b312d
JMG
6782008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
679
680 DJGPP specific issue.
681 * djgpp/config.sed: Fixes required to run configure scripts generated
682 by autoconf 2.62.
683
138d4cd9
JD
6842008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
685
686 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
687 coordinator@translationproject.org.
688
8f7e2e1f
JD
6892008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
690
691 * THANKS: Add Eric Blake.
692
f55efa38
JD
6932008-04-23 Eric Blake <ebb9@byu.net>
694
695 Revert prior patch, by working around autoconf regression.
696 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
697 ("Output file name: ("): Uncomment test.
698 ("Output file name: )"): Likewise.
699 Based on an idea from Noah Misch.
700
096c9f9d
JD
7012008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
702
703 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
704 2.61. Reported by Juan Manuel Guerrero at
705 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
706 * tests/output.at ("Output file name: ("): Comment out test case for
707 now.
708 ("Output file name: )"): Likewise.
709
0f664b89
JD
7102008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
711
712 * GNUmakefile: Update git-version-gen invocation so make dist
713 succeeds.
714
1cfe6375
JD
7152008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
716
717 Update to the current gnulib CVS repository, and fix trigraph handling
718 in Bison.
719 * bootstrap: Update gnulib CVS repository URL.
720 (symlink_to_dir): Encapsulate the code that guarantees the destination
721 directory exists into...
722 (check_dst_dir): ... this new function, and...
723 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
724 fail when copying files into lib/uniwidth/.
725 * src/output.c (prepare_symbols): When writing yytname muscles, where
726 symbol names will be encoded in C-string literals, tell quotearg to
727 escape trigraphs. This used to be the default in gnulib.
728 * tests/regression.at (Token definitions): Because of the change in
729 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
730 escapes trigraphs in symbol names. Thus, yytname no longer has
731 trigraphs unnecessarily doubly escaped. Update test case output.
732 Extend test case to be sure Bison's own error messages will no longer
733 have trigraphs in symbol names unnecessarily escaped once.
734
74c52fc8
JD
7352008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
736
737 Fix make dist infinite loop reported by Juan Manuel Guerrero at
738 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
739 * .cvsignore: Add .version.
740 * .version.in: New.
741 * bootstrap.conf (gnulib_modules): Add git-version-gen.
742 * configure.ac (AC_CONFIG_FILES): Add .version.
743 * build-aux/.cvsignore: Add git-version-gen.
744
8e55b3aa
JD
7452008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
746
747 * NEWS (2.3a+): Mention that -g now takes an argument.
748 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
749 consistency. Update the -g and -x entries now that they take
750 arguments. Use brackets to indicate optional arguments.
751 * src/getargs.c (usage): Explain the relationship between arguments of
752 long and short options more completely. Document --defines and -d
753 separately since the former takes an argument but, for POSIX Yacc, the
754 latter does not.
755 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 756 (getargs): Sort cases.
8e55b3aa 757
59c5ac72
AD
7582008-02-28 Akim Demaille <demaille@gostai.com>
759
760 * doc/bison.texinfo: Fix a few typos.
761
118d4978
AD
7622008-02-28 Akim Demaille <akim@epita.fr>
763
764 * doc/bison.texinfo (Bison Options): Document -W.
765 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
766
7020f1e9
AD
7672008-02-28 Akim Demaille <akim@epita.fr>
768
769 * src/getargs.c (short_options): Split and sort for readability.
770 -g and -x take optional arguments, just like their long options.
771 * build-aux/cross-options.pl: Use /x to make the regexp easier to
772 understand.
773 Fix the handling of $opt which resulted in all the argument to be
774 considered as optional.
775
59da312b
JD
7762008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
777
778 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
779 say its interface is experimental.
780 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
781 Java.
782 (Bison Options): In the -L and --language entry, mention Java.
783 (Java Bison Interface): Say the interface is experimental.
784 * src/getargs.c (usage): Mention -L and --language.
785
786 * NEWS (2.3a+): Say the push parsing interface is experimental.
787 * doc/bison.texinfo (Push Decl): Likewise.
788 (Decl Summary): Likewise in the "%define api.push_pull" entry.
789 (Push Parser Function): Likewise.
790 (Pull Parser Function): Likewise.
791 (Parser Create Function): Likewise.
792 (Parser Delete Function): Likewise.
793 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
794 yypull_parse, and yypush_parse entries.
795
796 * NEWS (2.3a+): Mention XML support, and say the schema is
797 experimental.
798 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
799 * src/getargs.c (usage): Say the XML schema is experimental.
800
801 * NEWS (2.3a+): Say option instead of flag.
802
2bb3ebec
WP
8032008-02-21 Wojciech Polak <polak@gnu.org>
804
805 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
806 text.
807
333e670c
JD
8082008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
809
810 Fix impure push parser compile error reported by Bob Rossi at
811 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
812 * data/yacc.c: Clean up whitespace in the output a little.
813 (yypstate_allocated): Define for impure push parsers regardless of
814 whether the pull interface is also requested.
815 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
816 check impure push parsers without the pull interface.
817
818 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
819 yyerror takes arguments specified by %parse-param while yypstate_new
820 does not.
821 * doc/bison.texinfo (Parser Create Function): Document that
822 yypstate_new returns 0 for multiple impure parser instances.
823 * tests/push.at (Push Parsing: Multiple impure instances): Update
824 expected stderr output.
825
798096e1
JD
8262008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
827
828 * runtime-po/POTFILES.in (push.c): Remove.
829
9ca7f077
JD
8302008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
831
832 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
833 * data/push.c: Rename to...
834 * data/yacc.c: ... this, overwriting it.
835 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
836 `%push-pull-parser' -> `%define api.push_pull "both"'.
837 Remove old yacc.c tests, and update push.c tests to yacc.c.
838
42ee26bb
JD
8392008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
840
841 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
842 `"%code top" blocks' instead of `%code "top" blocks'.
843 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
844 Clean up whitespace in the output a little.
845
b1cc23c4
JD
8462008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
847
848 Fix documentation problems reported by Tim Josling at
849 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
850 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
851 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
852 integers. Explain the effect of literal string aliases on error
853 messages. Copy token 0 documentation from the C++ skeleton
854 documentation.
855
ab7f29f8
JD
8562008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
857
858 Accept a token number in a %left, %right, or %nonassoc for POSIX
859 conformance. Reported by Tim Josling at
860 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
861 * NEWS (2.3a+): Mention.
862 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
863 and code numbers are treated by precedence declarations.
864 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
865 of symbols.1.
866 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
867 of symbol.
868 (symbol.prec): New, just like symbol but allows INT.
869 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
870 longer holds.
871 * tests/regression.at (Token number in precedence declaration): New
872 test case.
873
a924ef36
JMG
8742008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
875
876 DJGPP specific issues.
877 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
878 be changed. Copyright timestamp adjusted.
879 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
880 be changed. Copyright timestamp adjusted.
881 * djgpp/config.site: Copyright timestamp adjusted.
882 * djgpp/config_h.sed: Copyright timestamp adjusted.
883 * djgpp/djunpack.bat: Copyright timestamp adjusted.
884 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
885 filename translation list.
886 * djgpp/subpipe.c (init_subpipe): Check the environment variables
887 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
888 files shall be created. Before trying to use the temp dir where the
889 environment variable points to check that the dir really exists. If
890 not default to the cwd as temp dir. Copyright timestamp adjusted.
891 * djgpp/subpipe.h: Copyright timestamp adjusted.
892 * djgpp/testsuite.sed: Copyright timestamp adjusted.
893
389c8cfd
PE
8942008-01-30 Paul Eggert <eggert@cs.ucla.edu>
895
896 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
897
5d1cfef4
PE
8982008-01-09 Paul Eggert <eggert@cs.ucla.edu>
899
900 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
901 Problem reported by Claudio Saavedra in
902 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
903
e2dcf996
WP
9042008-01-05 Wojciech Polak <polak@gnu.org>
905
906 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
907 document's title with the input grammar file name.
908
da730230
JD
9092007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
910
911 Automate regression testing of the XML/XSLT implementation. Discussed
912 starting at
913 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
914 * configure.ac (XSLTPROC): New substitution.
915 * Makefile.am (maintainer-xml-check): New phony target invoking...
916 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
917 invoking make maintainer-check with BISON_TEST_XML=1.
918 * tests/atlocal.in (XSLTPROC): New.
919 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
920 not to report reachable memory when Bison is expected to have a
921 non-zero exit status and (2) to compare XML/XSLT output with --graph
922 and --report=all output for every working grammar when
923 BISON_TEST_XML=1.
924 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
925 (AT_BISON_CHECK_XML): New.
926 (AT_QUELL_VALGRIND): New.
927 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
928 (AT_CHECK): ... don't redefine this since this was the old way to
929 quell Valgrind.
930 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
931 AT_BISON_CHECK invocations.
932 * tests/c++.at: Likewise.
933 * tests/calc.at: Likewise.
934 * tests/conflicts.at: Likewise.
935 * tests/cxx-type.at: Likewise.
936 * tests/existing.at: Likewise.
937 * tests/glr-regression.at: Likewise.
938 * tests/headers.at: Likewise.
939 * tests/input.at: Likewise.
940 * tests/java.at: Likewise.
941 * tests/output.at: Likewise.
942 * tests/push.at: Likewise.
943 * tests/reduce.at: Likewise.
944 * tests/regression.at: Likewise.
945 * tests/sets.at: Likewise.
946 * tests/skeletons.at: Likewise.
947 * tests/synclines.at: Likewise.
948 * tests/torture.at: Likewise.
949 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
950 tends to hang xsltproc.
951 (Big horizontal): Likewise.
952
408476bc
JD
9532007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
954
955 In XML output, remove redundant class attribute on symbol element.
956 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
957 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
958 look up a symbol to determine whether it's a nonterminal or terminal.
959 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
960 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
961
962 Add prec/assoc information to XML output.
963 * src/gram.c (grammar_rules_print_xml): For each rule that has a
964 %prec, add a percent_prec attribute.
965 * src/print-xml.c (print_grammar): For each terminal that has a
966 precedence or associativity, add a prec or assoc attribute.
967 (xml_indent): New.
968 (xml_puts): Use xml_indent.
969 (xml_printf): Use xml_indent.
970 * src/print-xml.h (xml_indent): Prototype.
971
972 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
973 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
974
d4a26c48
JD
9752007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
976
977 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
978 (bison:ruleByNumber): ... this for clarity.
979 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
980 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
981 (xsl:template match="reduction"): Update.
982 (xsl:template match="item"): Update.
983 (xsl:template match="reduction"): Update.
984
985 In the XML output, don't print the list of rules where symbols appear.
986 Compute it in XSLT instead. Discussed at
987 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
988 * data/xslt/bison.xsl (bison:ruleByLhs): New.
989 (bison:ruleByRhs): New.
990 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
991 bison:ruleByRhs.
992 (xsl:template match="terminal/rule"): Remove.
993 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
994 bison:ruleByRhs.
995 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
996 Remove.
997 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
998 bison:ruleByRhs and mode="number-link" for rule template.
999 (xsl:template match="terminal/rule"): Remove.
1000 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1001 bison:ruleByRhs and mode="number-link" for rule template.
1002 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1003 Rewrite as...
1004 (xsl:template match="rule" mode="number-link"): ... this.
1005 * src/print-xml.c (print_grammar): Don't print the list of rules.
1006
ef1b4273
JD
10072007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1008
1009 Don't let --report affect XML output; always print all information.
1010 Discussed at
1011 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
1012 * src/conflicts.c (log_resolution): Implement.
1013 * src/print-xml.c (print_core): Implement.
1014 (print_state): Implement.
1015 (print_xml): Implement.
1016
1017 * NEWS (2.3a+): Fix quotes.
1018 * src/parse-gram.y (prologue_declaration): For consistency with -v,
1019 don't let %verbose clear the list specified by --report.
1020
0f6cd9e3
AD
10212007-11-26 Akim Demaille <akim@epita.fr>
1022
1023 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
1024
d80fb37a
JD
10252007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
1026
1027 In the XML output, list useless and unused symbols and rules with the
1028 useful ones and add a "usefulness" attribute. Discussed starting at
1029 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
1030 * src/gram.c (grammar_rules_partial_print_xml): Remove.
1031 (grammar_rules_print_xml): Print all rules instead of just those
1032 useful in the grammar, and add a "usefulness" attribute.
1033 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
1034 * src/print-xml.c (print_rules_useless_in_parser): Remove.
1035 (print_grammar): Print all nonterminals instead of just useful ones,
1036 and add a "usefulness" attribute to nonterminals and terminals.
1037 (print_xml): Don't print a separate "reductions" or
1038 "rules-useless-in-parser" element.
1039 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
1040 (reduce_xml): Remove.
1041 (reduce_token_unused_in_grammar): New.
1042 (reduce_nonterminal_useless_in_grammar): New.
1043 * src/reduce.h (reduce_xml): Remove prototype.
1044 (reduce_token_unused_in_grammar): Add prototype.
1045 (reduce_nonterminal_useless_in_grammar): Add prototype.
1046 * data/xslt/xml2text.xsl: Update for XML changes.
1047 * data/xslt/xml2xhtml.xsl: Update for XML changes.
1048 * tests/reduce.at (Useless Terminals): Update output.
1049 (Useless Rules): Update output.
1050 (Reduced Automaton): Update output.
1051
1052 Say "Terminals unused in grammar" instead of "Unused terminals".
1053 * NEWS (2.3a+): Update.
1054 * doc/bison.texinfo (Understanding): Update example output.
1055 * src/reduce.c (reduce_output): Implement.
1056 * data/xslt/xml2text.xsl: Implement.
1057 * data/xslt/xml2xhtml.xsl: Implement.
1058
1bb2bd75
JD
10592007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1060
1061 Accept --report-file=FILE to override the default `.output' filename.
1062 * NEWS (2.3a+): Mention.
1063 * doc/bison.texinfo (Bison Options): Add an entry.
1064 * src/files.c (compute_output_file_names): Don't override
1065 spec_verbose_file if already set.
1066 * src/getargs.c (usage): Document --report-file.
1067 (REPORT_FILE_OPTION): New anonymous enum member.
1068 (long_options): Add entry for it.
1069 (getargs): Add case for it setting spec_verbose_file.
1070
1071 * build-aux/cross-options.pl: Don't record a short option just because
1072 there's an arg.
1073 * doc/.cvsignore: Add yacc.1.
1074
a005a9c4
AD
10752007-11-14 Akim Demaille <akim@epita.fr>
1076
1077 * doc/yacc.1.in: New.
1078 * configure.ac, doc/Makefile.am: Adjust.
1079 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
1080 config.h symbol.
1081 Use AC_SUBST for assignments too.
1082 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
1083
cff03fb2
JD
10842007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1085
1086 * src/gram.c: Remove comments that duplicate comments in gram.h.
1087
1088 When reporting useless rules and nonterminals, say "useless in grammar"
1089 instead of "useless", and say "useless in parser" instead of "never
1090 reduced". Discussed starting at
1091 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
1092 * NEWS (2.3a+): Mention this change.
1093 * data/xslt/xml2text.xsl: Update output text and expected input XML
1094 element names to match changes below.
1095 * data/xslt/xml2xhtml.xsl: Likewise.
1096 (xsl:template match="bison-xml-report"): Add missing entry in Table of
1097 Contents: "Rules useless in parser due to conflicts".
1098 * doc/bison.texinfo (Decl Summary): Reword a little.
1099 (Understanding): Update example output for changes below.
1100 * src/gram.c: (rule_useful_p): Rename to...
1101 (rule_useful_in_grammar_p): ... this.
1102 (rule_useless_p): Rename to...
1103 (rule_useless_in_grammar_p): ... this.
1104 (rule_never_reduced_p): Rename to...
1105 (rule_useless_in_parser_p): ... this.
1106 (grammar_rules_print): Update for renames.
1107 (grammar_rules_print_xml): Update for renames.
1108 (grammar_rules_never_reduced_report): Rename to...
1109 (grammar_rules_useless_report): ... this since it is used for either
1110 kind of useless rule.
1111 * src/gram.h: Reword comments and update function names in prototypes.
1112 * src/main.c (main): Say "rule useless in parser due to conflicts".
1113 * src/print-xml.c (print_rules_never_reduced): Rename to...
1114 (print_rules_useless_in_parser): ... this, and rename output XML
1115 element "rules-never-reduced" to "rules-useless-in-parser".
1116 (print_xml): Update for rename.
1117 * src/print.c (print_results): Say "Rules useless in parser due to
1118 conflicts".
1119 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
1120 (nonterminals_reduce): Say "nonterminal useless in grammar".
1121 (reduce_output): Say "Nonterminals useless in grammar".
1122 Say "Rules useless in grammar".
1123 (reduce_xml): Rename output XML element "useless" to
1124 "useless-in-grammar".
1125 (reduce_print): Don't report the count of grammatically useless rules
1126 as "rules never reduced" just because %yacc is specified.
1127 In the correct report of this count, say nonterminal(s) and rule(s)
1128 "useless in grammar".
1129 * tests/conflicts.at (S/R in initial): Update expected output.
1130 (Defaulted Conflicted Reduction): Likewise.
1131 (Unreachable States After Conflict Resolution): Likewise.
1132 * tests/existing.at (GNU pic Grammar): Likewise.
1133 * tests/reduce.at (Useless Nonterminals): Likewise.
1134 (Useless Rules): Likewise.
1135 (Reduced Automaton): Likewise.
1136 (Underivable Rules): Likewise.
1137 (Empty Language): Likewise.
1138
66f0441d
JD
11392007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
1140
1141 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
1142 here document and before the EOF so that BSD's implementation of Bourne
1143 shell doesn't parse the delimiter as part of the here document.
1144 * doc/.cvsignore: Add cross-options.texi.
1145 * src/getargs.c (usage): Add a blank line after the warning categories.
1146
d0ee4105
PB
11472007-11-08 Paolo Bonzini <bonzini@gnu.org>
1148
1149 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
1150
e8b1fb9b
AD
11512007-11-05 Akim Demaille <akim@epita.fr>
1152
1153 Remove Id: from bison.1.
1154 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
1155 (perl -0777 -pi -e 's/\.PP\nId): New.
1156 (.x.1): Use it to ignore the version control revision.
1157
2f7a96b5
AD
11582007-11-05 Akim Demaille <demaille@gostai.com>
1159
1160 * build-aux/Makefile.am: Ship cross-options.pl.
1161 * doc/Makefile.am: Always refer to cross-options.texi with
1162 $(srcdir).
1163 (MAINTAINERCLEANFILES): Add it.
1164
f4101aa6
AD
11652007-11-04 Akim Demaille <demaille@gostai.com>
1166
1167 Generate the long/short option cross-table.
1168 * build-aux/cross-options.pl: New.
1169 * doc/Makefile.am (cross-options.texi): New.
1170 * doc/bison.texinfo: Use it.
1171
727a1401
AD
11722007-11-04 Akim Demaille <demaille@gostai.com>
1173
1174 Generate bison.1 using help2man.
1175 * doc/common.x, doc/bison.x: New.
1176 * doc/Makefile.am (bison.1, .x.1): New.
1177 The code is taken from autoconf-2.61/man/Makefile.am.
1178 * configure.ac: Look for help2man.
1179
6aeb9c57
AD
11802007-11-04 Akim Demaille <demaille@gostai.com>
1181
1182 Complete --help.
1183 * src/getargs.c (usage): Document -W, make it clear that -d,
1184 -g and -x have optional arguments.
1185
d7be4085
AD
11862007-11-04 Akim Demaille <demaille@gostai.com>
1187
1188 Find sha1sum when named gsha1sum.
1189 * bootstrap (find_tool): New.
1190 ($SHA1SUM): New.
1191
d9df47b6
JD
11922007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1193
1194 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
1195 at
1196 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
1197 * NEWS (2.3a+): Mention.
1198 * data/bison.m4 (b4_pure_if): Don't define it here.
1199 * data/c.m4 (b4_identification): Depend on individual skeletons to
1200 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
1201 values of the %define variables api.pure or api.push_pull. Define
1202 YYPURE, YYPUSH, and YYPULL accordingly.
1203 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
1204 glr.cc has already defined b4_pure_flag.
1205 * data/push.c: Define b4_pure_if based on `%define api.pure'.
1206 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 1207 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
1208 * doc/bison.texinfo (Pure Decl): Update.
1209 (Push Decl): Update.
1210 (Decl Summary): Add api.pure to %define entry.
1211 In %pure-parser entry, say it's deprecated and reference %define.
1212 (Pure Calling): Update.
1213 (Error Reporting): Update.
1214 (C++ Scanner Interface): Update.
1215 (How Can I Reset the Parser): Update.
1216 (Table of Symbols): In %pure-parser entry, say it's deprecated and
1217 reference %define.
1218 * src/getargs.c (pure_parser): Remove global variable.
1219 * src/getargs.h (pure_parser): Remove extern.
1220 * src/output.c (prepare): Don't define pure_flag muscle.
1221 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
1222 wrapper around `%define api.pure'.
1223 * tests/calc.at (Simple LALR Calculator): Update.
1224 (Simple GLR Calculator): Update.
1225 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
1226 Update.
1227 (GLR: Resolve ambiguity, pure, locations): Update.
1228 (GLR: Merge conflicting parses, pure, no locations): Update.
1229 (GLR: Merge conflicting parses, pure, locations): Update.
1230 * tests/glr-regression.at (Uninitialized location when reporting
1231 ambiguity): Update
1232 * tests/input.at (Unused %define api.pure): New test case.
1233 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
1234 AT_PURE_IF and AT_PURE_AND_LOC_IF.
1235 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
1236
c373bf8b
JD
12372007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1238
1239 %define push_pull -> %define api.push_pull. Discussed starting at
1240 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
1241 * data/push.c: Expect the new name.
1242 * data/yacc.c: Likewise.
1243 * doc/bison.texinfo (Push Decl): Update.
1244 (Decl Summary): Update %define entry.
1245 (Push Parser Function): Update.
1246 (Pull Parser Function): Update.
1247 (Parser Create Function): Update.
1248 (Parser Delete Function): Update.
1249 * tests/calc.at (Simple LALR Calculator): Update.
1250 * tests/input.at (%define enum variables): Update.
1251 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
1252 (Push Parsing: Multiple impure instances): Update.
1253 (Push Parsing: Unsupported Skeletons): Update.
1254 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
1255 (Exploding the Stack Size with Malloc): Update.
1256
1257 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
1258 other entries some.
1259
32f19b6b
JD
12602007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
1261
1262 For the XML output's terminal element, rename @number to @token-number,
1263 and add @symbol-number. In the nonterminal element, rename @number to
1264 @symbol-number. Discussed starting at
1265 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
1266 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
1267 renames.
1268 (xsl:template match="nonterminal"): Likewise.
1269 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
1270 (xsl:template match="nonterminal"): Likewise.
1271 * src/print-xml.c (print_grammar): Implement.
1272
255a6b90
JD
12732007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1274
1275 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
1276 2007-10-11 change, the child elements here are items not rules.
408476bc 1277 (xsl:template match="item"): New.
255a6b90
JD
1278 (xsl:template match="rule"): Update for new reduced itemset.
1279 (xsl:template match="point"): Remove.
1280 (xsl:template match="empty"): For consistency with --graph, don't
1281 output "/* empty */".
1282 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
1283 line-wrap, don't pass a negative value as first-line-length since this
1284 won't work with the following changes.
1285 (xsl:template name="line-wrap"): Simplify slightly.
1286 (xsl:template name="ws-search"): Eliminate recursion.
1287 * src/print_graph.c (print_core): Don't print a reduction's lookahead
1288 set next to an item whose dot is not at the end of the RHS even if it
1289 happens to be associated with the same rule.
1290
88c78747
JD
12912007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
1292
31984206
JD
1293 Add %define lr.keep_unreachable_states.
1294 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
1295 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
1296 * src/main.c (main): Implement it.
1297 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1298 Extend to test it, and fix a typo.
1299
13002007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
1301
1302 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
1303 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
1304 the example .output text.
1305 * tests/regression.at (Extra lookahead sets in report): Improve wording
1306 of comments.
1307
b7a70162
WP
13082007-10-17 Wojciech Polak <polak@gnu.org>
1309
1310 * src/print-xml.c (print_grammar): Renamed
1311 <terminal> and <nonterminal> attributes:
1312 "type" to "number" and "symbol" to "name".
1313 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
1314 Use new attribute names.
1315 (xsl:template match="nonterminal"): Likewise.
1316 * data/xslt/xml2xhtml.xsl: Likewise.
1317
a0de5091
JD
13182007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
1319
1320 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
1321 (Option Cross Key): Likewise.
1322
1323 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
1324 next to an item whose dot is not at the end of the RHS even if it
1325 happens to be associated with the same rule.
1326 * src/print.c (print_core): Likewise.
1327 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
1328 (Resolved SR Conflicts): Update output.
1329 * tests/regression.at (Extra lookahead sets in report): New test case.
1330
4c20d18d
WP
13312007-10-11 Wojciech Polak <polak@gnu.org>
1332
1333 * src/print-xml.c (print_core): Remove item set
1334 redundancy.
1335 * data/xslt/bison.xsl (bison:ruleNumber): New key.
1336 Improve processing time. Suggested by Joel E. Denny.
1337 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
1338 Write xsl:param "required" attribute as comment.
1339 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
1340 (xsl:template match="rule"): Support new reduced itemset.
1341 (xsl:template match="point"): Remove.
1342 * data/xslt/xml2xhtml.xsl: Likewise.
1343
f506ad1c
JD
13442007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
1345
1346 * src/getargs.c (version): Update copyright year.
1347
21f1b063
JD
13482007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
1349
1350 Make xml2dot.xsl and --graph produce the same output.
1351 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
1352 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
1353 escaped later.
1354 (xsl:template name="output-node"): Use the new escape template instead
1355 of the string-replace template directly.
1356 (xsl:template name="output-edge"): Likewise.
1357 (xsl:template name="escape"): New, escapes backslashes and newlines in
1358 addition to quotation marks.
1359 * src/graphviz.c (start_graph, output_node, output_edge): Add
1360 whitespace to output for legibility.
1361
1362 Make xml2text.xsl and --report produce the same output, and remove the
1363 XML "conflicts" element since a conflict summary is easily extracted
1364 from the automaton.
1365 * data/xslt/bison.xsl: New.
1366 (xsl:template match="state" mode="bison:count-conflicts): New.
1367 * data/xslt/xml2text.xsl: Import bison.xsl.
1368 (xsl:template match="bison-xml-report"): Instead of styling the
1369 "conflicts" element, style the "automaton" element with mode
1370 "conflicts". Unlike the former, the latter lists S/R and R/R
1371 conflicts for a state on the same line.
1372 (xsl:template match="conflicts"): Remove.
1373 (xsl:template match="conflict"): Remove.
1374 (xsl:template match="terminal"): Line-wrap the list of rules in which
1375 the terminal is used.
1376 (xsl:template match="nonterminal"): Likewise for nonterminals.
1377 (xsl:template match="automaton" mode="conflicts"): New.
1378 (xsl:template match="state" mode="conflicts"): New.
1379 (xsl:template name="line-wrap"): New.
1380 (xsl:template name="ws-search"): New.
1381 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
1382 (xsl:template match="bison-xml-report"): Instead of styling the
1383 "conflicts" element, style the "automaton" element with mode
1384 "conflicts."
1385 (xsl:template match="conflicts"): Remove.
1386 (xsl:template match="conflict"): Remove.
1387 (xsl:template match="automaton" mode="conflicts"): New.
1388 (xsl:template match="state" mode="conflicts): New.
1389 * src/conflicts.c (conflicts_output_xml): Remove.
1390 * src/conflicts.h (conflicts_output_xml): Remove prototype.
1391 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
1392 * src/print.c (print_grammar): Consistently wrap at the 66th column so
1393 the corresponding XSLT is easier. Also, never wrap between a word and
1394 the comma that follows it.
1395
793fbca5
JD
13962007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
1397
1398 Improve C++ namespace support. Discussed starting at
1399 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
1400 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
1401 b4_namespace_close): New macros that interpret the %define variable
1402 "namespace" so its value can contain "::" to indicate nested
1403 namespaces.
1404 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
1405 the above macros.
1406 * data/lalr1.cc (b4_namespace): Likewise.
1407 * data/location.cc (b4_namespace): Likewise.
1408 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
1409 inside a new table in the general %define entry. Document `%define
1410 namespace' there as well. Point the %name-prefix entry to it since it
1411 explains it more completely in the case of C++.
1412 (C++ Bison Interface): Mention `%define namespace' instead of
1413 %name-prefix.
1414 (Table of Symbols): Remove the `%define push_pull' entry. The %define
1415 entry suffices.
1416 * tests/c++.at (Relative namespace references): New test case.
1417 (Absolute namespace references): New test case.
1418 (Syntactically invalid namespace references): New test case.
1419 * tests/input.at (C++ namespace reference errors): New test case.
1420
35b8730d
JD
14212007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
1422
1423 Add syncline support and location accessor to internal %define
1424 interfaces.
1425 * data/bison.m4 (b4_percent_define_get_loc): New.
1426 (b4_percent_define_get_syncline): New.
1427 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
1428 (b4_percent_define_default): Record defining location as line 1 rather
1429 than 0 for the sake of synchronizing #line's, and define
1430 b4_percent_define_syncline(VARIABLE).
1431 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
1432 * src/muscle_tab.c (muscle_syncline_grow): New.
1433 (muscle_code_grow): Use muscle_syncline_grow.
1434 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
1435 define b4_percent_define_syncline(VARIABLE).
1436 (muscle_percent_define_get_loc): New.
1437 (muscle_percent_define_get_syncline): New.
1438 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
1439 remove some unused variables.
1440 (muscle_percent_define_default): Record defining location as line 1
1441 rather than 0 for the sake of synchronizing #line's, and define
1442 b4_percent_define_syncline(VARIABLE).
1443 (muscle_percent_define_check_values): Use
1444 muscle_percent_define_get_loc.
1445 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
1446 (muscle_percent_define_get_syncline): Prototype.
1447 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1448 defaults): Update output for location change.
1449 (Complaining during macro argument expansion): Extend to test
1450 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
1451
7dc4a694
JD
14522007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
1453
1454 Fix some error-reporting macro bugs.
1455 * data/bison.m4 (b4_cat): New.
1456 (b4_error, b4_error_at): Use b4_cat to send error directives directly
1457 to stdout so they don't become arguments to other macros. Update
1458 comments and add examples.
1459 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
1460 add examples.
1461 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
1462 after printing the error directive so that M4 doesn't report subsequent
1463 problems that are induced by this problem.
1464 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
1465 instead of just in them. Recognize @\n in both places. Both expand to
1466 the empty string. Needed by b4_cat.
1467 * tests/skeletons.at (Complaining during macro argument expansion):
1468 New test case.
1469 (Fatal errors make M4 exit immediately): New test case.
1470
d4bd2295
JD
14712007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
1472
1473 Implement --print-datadir.
1474 * src/getargs.c (usage): Mention.
1475 (PRINT_DATADIR_OPTION): New anonymous enum member.
1476 (long_options): Add entry for it.
1477 (getargs): Add case for it calling compute_pkgdatadir.
1478 * src/output.c (output_skeleton): Encapsulate data directory
1479 computation from here...
1480 (prepare): ... and from here...
1481 (compute_pkgdatadir): ... into this new function.
1482 * src/output.h (compute_pkgdatadir): Prototype.
1483
34cdeddf
JD
14842007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
1485
1486 * src/print-xml.c (escape_bufs): New static global variable
1487 replacing...
1488 (xml_escape_n): ... the static local variable buf here.
1489 (print_xml): Free memory for escape_bufs.
1490 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
1491
d782395d
JD
14922007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
1493
1494 Replace `%push-parser' and `%push-pull-parser' with
1495 `%define push_pull "push"' and `%define push_pull "both"'.
1496 `%define push_pull "pull"' is the default.
1497 * doc/bison.texinfo (Push Decl, Push Parser Function,
1498 Pull Parser Function, Parser Create Function, Parser Delete Function):
1499 Update declarations.
1500 (Decl Summary, Table of Symbols): Replace %push-parser and
1501 %push-pull-parser entries with a %define push_pull entry.
1502 * data/bison.m4 (b4_percent_define_check_values): New macro.
1503 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
1504 definitions...
1505 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
1506 definitions...
1507 * data/push.c: ... to here and compute them from the value of the
1508 %define variable push_pull.
1509 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
1510 parsing requests here...
1511 * data/yacc.c: ... hack this to switch to push.c any time
1512 b4_use_push_pull_flag or the %define variable push_pull is set. This
1513 will go away when we mv push.c yacc.c.
1514 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
1515 push parsing is not supported since unused %define variables are
1516 reported anyway.
1517 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
1518 * src/muscle_tab.h (muscle_percent_define_check_values): Update
1519 comments for consistency with b4_percent_define_check_values.
1520 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
1521 muscles.
1522 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
1523 Remove.
1524 (prologue_declaration): Remove %push-parser and %push-pull-parser
1525 rules.
1526 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
1527 * tests/calc.at: Update declarations.
1528 * tests/input.at (%define enum variables): New test case.
1529 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
1530 declaration.
1531 (Push Parsing: Multiple impure instances): Update declaration.
1532 (Push Parsing: Unsupported Skeletons): New test case.
1533 * tests/torture.at (Exploding the Stack Size with Alloca): Update
1534 declaration.
1535 (Exploding the Stack Size with Malloc): Update declaration.
1536
3f999f78
WP
15372007-09-24 Wojciech Polak <polak@gnu.org>
1538
1539 Add XSLT transformations.
1540
1541 * data/xslt/xml2dot.xsl: Transform XML into DOT.
1542 * data/xslt/xml2text.xsl: Transform XML into plain text.
1543 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
1544 * data/Makefile.am (xsltdir): New variable.
1545 (dist_xslt_DATA): Add xslt/*.xsl files.
1546
a4f75309
PE
15472007-09-23 Paul Eggert <eggert@cs.ucla.edu>
1548
1549 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
1550 Problem reported by Wojciech Polak.
1551 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
1552 (xml_printf): Undo change I made on 21 September; that is,
1553 indent 2 spaces, not 1.
1554
ad5feac4
JD
15552007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
1556
1557 Pacify ./configure --enable-gcc-warnings.
1558 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
1559 `char const *' instead of `char *'.
1560 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
1561 local variable `sep'.
1562
41d7a5f2
PE
15632007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1564
1565 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
1566 elsewhere.
1567 * src/print-xml.c: Prefer "const" after types; that's more consistent.
1568 (xml_printf): Indent just 1 space for level.
1569 (e_char, xlate_char): Remove.
1570 (xml_escape_string): Rewrite to avoid undefined behavior (used
1571 storage that was freed from the stack).
1572 (xml_escape_n): Don't bother checking for subscript error.
1573
3f999f78
WP
15742007-09-21 Wojciech Polak <polak@gnu.org>
1575
1576 Add Bison XML Automaton Report.
41d7a5f2
PE
1577
1578 Add support for an -x option to generate an XML report.
1579 It is not documented yet.
1580 * src/print-xml.c: New file.
1581 * src/print-xml.h: Likewise.
1582 * lib/timevar.def (TV_XML): New var.
1583 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
1584 * src/conflicts.c: Include print-xml.h.
1585 (solved_conflicts_xml_obstack): New var.
1586 (log_resolution, conflicts_solve, conflicts_free):
1587 Add support for XML report.
1588 (conflicts_output_val): New function.
1589 * src/conflicts.h (conflicts_output_val): New decl.
1590 * src/files.c (spec_xml_file): New var.
1591 (compute_output_file_names, output_file_names_free): Add XML support.
1592 * src/files.h (spec_xml_file): New decl.
1593 * src/getargs.c (xml_flag): New var.
1594 (usage, short_options, long_options, getargs): Add XML support.
1595 * src/getargs.h (xml_flag): New decl.
1596 * src/gram.c: Include print-xml.h.
1597 (rule_lhs_print_xml, rule_rhs_print_xml):
1598 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
1599 New functions.
1600 * src/gram.h: Declare external ones.
1601 * src/main.c: Include print-xml.h.
1602 (main): Add XML support.
1603 * src/reduce.c: Include print-xml.h.
1604 (reduce_xml): New function.
1605 * src/reduce.h: Declare it.
1606 * src/state.c: Include print-xml.h.
1607 (state_new): Add XML support.
1608 (state_rule_lookahead_tokens_print_xml): New function.
1609 * src/state.h: Declare it.
1610 (struct state): New member solved_conflicts_xml.
1611 * src/symtab.c (symbol_class_get_string): New function.
1612 * src/symtab.h: Declare it.
1613
6d8e724d
PE
16142007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1615
1616 * GNUmakefile: Switch to coreutils's version.
1617 * bootstrap: Likewise.
1618 * Makefile.cfg: Adjust to new GNUmakefile.
1619 * README-hacking: Likewise.
1620
1621 Import from gnulib:
1622
1623 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
1624 Bruno Haible <bruno@clisp.org>
1625
1626 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
1627 and is a script that invokes bison. Tighten the code. Add comments.
1628
922bdd7f
JD
16292007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
1630
1631 Spell "boolean" as "Boolean". Reported by Akim Demaille.
1632 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
1633 * doc/bison.texinfo (Decl Summary): Fix.
1634 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
1635 * tests/input.at (Boolean %define variables): Update output.
1636 * tests/skeletons.at (%define boolean variables: invalid skeleton
1637 defaults): Rename to...
1638 (%define Boolean variables: invalid skeleton defaults): ... this and
1639 update output.
1640
1b17b01d
JD
16412007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
1642
1643 In impure push mode, don't allow more than one yypstate to be allocated
1644 since multiple impure parsers would corrupt yynerrs.
1645 * data/push.c (yypstate_allocated): New static global variable
1646 initialized to 0.
1647 (yypull_parse): If yypstate_new returns 0, don't report it as memory
1648 exhaustion if yypstate_allocated is 1, but still return 2.
1649 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
1650 already 1. Otherwise, set it to 1.
1651 (yypstate_delete): Set it to 0.
1652 * tests/push.at (Push Parsing: Multiple impure instances): New test
1653 case.
1654
9987d1b3
JD
16552007-08-17 Bob Rossi <bob@brasko.net>
1656
1657 * doc/bison.texinfo (Push Decl): Document the push parser.
1658 (Table of Symbols): Ditto.
1659 (Pure Decl): Ditto.
1660 (Decl Summary): Ditto.
1661 (Multiple Parsers, Push Parser Function, Pull Parser Function,
1662 Parser Create Function, Parser Delete Function):
1663 Add new push parser symbols.
1664 (Table of Symbols): Document push-parser, push-pull-parser,
1665 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
1666
f16b0819
PE
16672007-08-15 Paul Eggert <eggert@cs.ucla.edu>
1668
1669 Update to GPLv3.
1670 * doc/gpl-3.0.texi: New file.
1671 * doc/gpl.texi: Remove.
1672 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
1673 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
1674 * README-hacking, TODO, bootstrap, bootstrap.conf:
1675 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
1676 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
1677 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
1678 * data/lalr1.cc, data/lalr1.java, data/location.cc:
1679 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
1680 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
1681 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
1682 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
1683 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
1684 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
1685 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
1686 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
1687 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
1688 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
1689 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
1690 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
1691 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
1692 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
1693 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
1694 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
1695 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
1696 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
1697 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
1698 * src/complain.c, src/complain.h, src/conflicts.c:
1699 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
1700 * src/files.h, src/flex-scanner.h, src/getargs.c:
1701 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
1702 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
1703 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
1704 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
1705 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
1706 * src/print.c, src/print.h, src/print_graph.c:
1707 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
1708 * src/reduce.h, src/relation.c, src/relation.h:
1709 * src/revision.h, src/scan-code.h, src/scan-code.l:
1710 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
1711 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
1712 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
1713 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
1714 * tests/Makefile.am, tests/actions.at, tests/c++.at:
1715 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
1716 * tests/existing.at, tests/glr-regression.at:
1717 * tests/headers.at, tests/input.at, tests/java.at:
1718 * tests/local.at, tests/output.at, tests/push.at:
1719 * tests/reduce.at, tests/regression.at, tests/sets.at:
1720 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
1721 * tests/torture.at:
1722 Update to GPLv3.
1723
728c4be2
JD
17242007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1725
1726 Get rid of broken %no-parser, -n, and --no-parser implementation and
1727 documentation.
1728 * TODO: Don't mention them.
1729 * doc/bison.1: Likewise.
1730 * doc/bison.texinfo (Decl Summary): Likewise.
1731 (Bison Options): Likewise.
1732 (Option Cross Key): Likewise.
1733 * src/getargs.c (no_parser_flag): Remove global variable.
1734 (usage): Don't print description of -n and --no-parser.
1735 (long_options): Remove --no-parser entry here.
1736 (getargs): Remove -n case in the switch here.
1737 * src/getargs.h (no_parser_flag): Remove extern.
1738 * tests/regression.at (Web2c Actions): Remove comment that mentions
1739 --no-parser.
1740
5d31a216
JD
17412007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1742
1743 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
1744 name user variables starting with `yy'. Just pass NULL instead of a
1745 dummy local &yylval to yypush_parse.
1746 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
1747 starting with `yy'.
1748
a2ea208d
JD
17492007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
1750
1751 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
1752 true since it's then always used regardless of whether yyoverflow is
1753 defined. Reported by Christian Burger at
1754 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
1755 * THANKS: Add Christian Burger.
1756
91661ebb
JD
1757 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1758 node names: say "Decl Summary" not "Bison Declaration Summary".
1759
cbd50549
JD
17602007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
1761
1762 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
1763 determine whether this function has already complained about an invalid
1764 value for a %define boolean variable, don't check whether Bison has
1765 ever examined the value. As written, the check was a tautology.
1766 Instead, record and check for this complaint using a separate muscle.
1767
eb1b0740
JD
17682007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1769
1770 Fix push parsing memory leak reported by Brandon Lucia at
1771 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
1772 * THANKS: Add Brandon Lucia.
1773 * data/push.c (yypstate_delete): Free the stack if it was reallocated
1774 but the parse never completed and thus freed it.
1775 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
1776 * tests/testsuite.at: Include push.at.
1777 * test/push.at: New.
1778 (Push Parsing: Memory Leak for Early Deletion): New test case.
1779
9d774aff
JD
17802007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
1781
1782 Improve handling of multiple S/R conflicts in the same state and of S/R
1783 conflicts involving multiple reductions.
1784 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
1785 set for a state here or Bison will abort if it is reassigned on a
1786 later conflicted reduction in the same state.
1787 Similarly, don't finalize and assign the solved conflicts report here
1788 or it will be lost if it is reassigned on a later conflicted reduction
1789 in the same state.
1790 (set_conflicts): Instead, assign them both here after all S/R conflicts
1791 in the state have been fully examined.
1792 * src/print.c (shift_set): Rename to...
1793 (no_reduce_set): ... this.
1794 (print_reductions): Update for rename, and add %nonassoc error action
1795 tokens to no_reduce_set so that, when printing the first remaining
1796 reduction on an error action token, the reduction is enclosed in
1797 brackets.
1798 (print_results): Update for rename.
1799 * tests/conflicts.at (Solved conflicts report for multiple reductions
1800 in a state): New test case.
1801 (%nonassoc error actions for multiple reductions in a state): New test
1802 case.
1803
1804 * src/main.c (main): Don't depend on C99 features.
1805
10159d2a
JD
18062007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1807
1808 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
1809 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
1810 uniwidth.
10159d2a 1811
953b3935
JD
18122007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
1813
1814 * bootstrap (slurp): Create target directories that don't exist.
1815 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
1816
6ce2d93a
JD
18172007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1818
1819 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
1820 than item number.
1821 * closure.c (closure): Likewise.
1822 * state.h (reductions): Comment sorting of rules.
1823 (state): Comment sorting of items.
1824
ce3448d5
JD
18252007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
1826
1827 Fix C++ test cases after recent Gnulib changes. Discussed starting at
1828 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
1829 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
1830 definition in order to avoid Gnulib headers since we don't use config.h
1831 here.
1832 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
1833 rather than AT_DATA so that config.h is included.
1834
8a86eef0
JD
18352007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
1836
1837 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
1838 instead of fprintf. Guard these functions with #if YYDEBUG instead of
1839 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
1840 and so that YYFPRINTF is guaranteed to be defined here.
1841
b1a81613
JD
18422007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1843
1844 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
1845 with...
1846 (muscle_percent_define_check_values): ... this more helpful function.
1847 Again, it's not used yet, but it will be.
1848 * src/muscle_tab.h: Likewise.
1849
71b61d4d
JD
1850 Improve some comments in parser table construction.
1851 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
1852 (generate_states): Don't mention ruleset, which is internal to closure.
1853 * src/closure.c (closure): Explain sorting of core and itemset, which
1854 is required for this function to behave correctly.
1855 * src/closure.h (closure): Mention sorting.
1856
2a6b783d
JD
18572007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
1858
1859 * src/lalr.c (state_lookahead_tokens_count): For code readability,
1860 move the check for disabled transitions to an aver since conflict
1861 resolution hasn't happened yet.
1862
1863 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
1864 labels a state as inconsistent just because it has error transitions.
1865 The original form of this check appeared in revision 1.1 of lalr.c,
1866 which was committed on 1991-12-21. Now (at least), changing the
1867 consistency label on such a state appears to have no useful effect in
1868 any of the places it is examined, which I enumerate below. The key
1869 point to understanding each item in this enumeration is that a state
1870 with an error transition is labelled consistent in the first place only
1871 if it has no rules, so the check cannot matter for states that have
1872 rules. (1) Labelling a state as inconsistent will cause set_conflicts
1873 to try to identify its conflicts, and a state must have *rules* to have
1874 conflicts. (2) Labelling a state as inconsistent will affect how
1875 action_row sets the default *rule* for the state. (3) Labelling a
1876 state as inconsistent will cause build_relations to add lookback edges
1877 to *rules* in that state.
1878 * src/state.h (struct state): Word the comment for member consistent
1879 more carefully.
1880
14462c2b
JD
18812007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1882
1883 Don't depend on C99 features.
1884 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
1885 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
1886 * src/reader.c (check_and_convert_grammar): Fix for-loop.
1887 * src/state.c (state_mark_reachable_states): Fix for-loop.
1888 (state_remove_unreachable_states): Fix for-loop.
1889
1890 Don't widen struct state with member reachable just to temporarily
1891 record reachability. Instead, use a local bitset.
1892 * src/state.h (struct state): Remove member.
1893 * src/state.c (state_new): Don't initialize it.
1894 (state_mark_reachable_states): Rename to...
1895 (state_record_reachable_states): ... this, and use bitset.
1896 (state_remove_unreachable_states): Use bitset.
1897
5a43d418
JD
18982007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
1899
1900 * src/Makefile.am (yacc): Quote target action commands properly so
1901 that the yacc script isn't corrupt. Reported by Hans Aberg at
1902 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
1903
0c650a20
JD
1904 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
1905 the case of pure parsers. Reported by Frans Englich at
1906 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
1907 * THANKS: Add Frans Englich.
1908
61fee93e
JD
1909 * NEWS (2.3a+): In the %code entry, reference section `Bison
1910 Declaration Summary' from the manual now since the %code summary has
1911 moved there.
1912 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
1913 in the rules section must be terminated by semicolons.
1914
f124d423
JD
19152007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1916
1917 Extend the front-end API for %define variables to more completely
1918 mirror the back-end. This will be useful in the future.
1919 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
1920 Update comments to mention the new front-end counterparts of these
1921 macros.
1922 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
1923 for muscle_string_decode and muscle_location_decode.
1924 (muscle_string_decode): New static function.
1925 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
1926 (muscle_percent_define_get, muscle_percent_define_ifdef): New
1927 functions.
1928 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
1929 muscle_percent_define_get to mimic the b4_percent_define_flag_if
1930 implementation more closely.
1931 (muscle_percent_define_invalid_value): New function.
1932 * src/muscle_tab.h (muscle_percent_define_get,
1933 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
1934 Prototype.
1935
75ad86ee
JD
19362007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1937
1938 * NEWS (2.3a+): Mention yesterday's state-removal change.
1939 (2.3a): Remove the %language entry, which was added after 2.3a.
1940 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
1941 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
1942 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
1943 tests/existing.at: Update copyright date.
1944
5967f0cf
JD
19452007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1946
1947 If conflict resolution makes states unreachable, remove those states,
1948 report rules that are then unused, and don't report conflicts in those
1949 states.
1950 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
1951 New global function.
1952 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
1953 function.
1954 * src/main.c (main): After conflict resolution, remove the unreachable
1955 states and update all data structures that reference states by number.
1956 * src/state.c (state_new): Initialize each state's reachable member to
1957 false.
1958 (state_mark_reachable_states): New static function.
1959 (state_remove_unreachable_states): New global function.
1960 * src/state.h (struct state): Add member bool reachable.
1961 (state_remove_unreachable_states): Prototype.
1962 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1963 New test case.
1964 * tests/existing.at (GNU pic Grammar): Update test case output now that
1965 an unused rule is discovered.
1966
b09f4f48
JD
19672007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1968
1969 Minor code cleanup in parser table construction.
1970 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
1971 (new_itemsets, save_reductions): Update for rename to nitemset.
1972 * src/closure.c (nritemset): Rename to...
1973 (nitemset): ... this since the "r" appears to meaningless and isn't
1974 used in the comments.
1975 (closure): Update for rename.
1976 * src/closure.h (nritemset): Update extern to...
1977 (nitemset): ... this.
1978 * src/lalr.c (LA): Fix a typo in comments.
1979 * src/print.c (print_core): Update for rename to nitemset.
1980 * src/print_graph.c (print_graph): Likewise.
1981 * src/state.h: Fix some typos in header comments.
1982
bbb44d83
PE
19832007-04-04 Paul Eggert <eggert@cs.ucla.edu>
1984
9b33de72
PE
1985 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
1986 still sticks to ASCII. Sorry!
1987
bbb44d83
PE
1988 * README-hacking: New file, taken mostly from coreutils, with changes
1989 for Bison. Contains much of the contents of:
1990 * README-cvs: Remove.
1991 * bootstrap: Sync from gnulib.
1992 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
1993 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
1994
29553547
JD
19952007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
1996
1997 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
1998 Setzer.
1999 (Java Differences): Fix some typos.
2000 * THANKS: Add Sebastian Setzer.
2001
01b477c6
PB
20022007-03-07 Paolo Bonzini <bonzini@gnu.org>
2003
730739e4
AD
2004 * data/java.m4 (b4_single_class_if): Remove.
2005 (b4_abstract_if): Look at "%define abstract".
2006 (b4_lexer_if): New.
2007 (b4_union_name): Rename...
2008 (b4_yystype): ... to this. Map to "%define stype".
2009 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
2010 b4_maybe_throws): Fix quoting.
2011 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
2012 * data/lalr1.java (Lexer interface): Always define.
2013 (Lexer interface within parser class): Remove.
2014 (YYLexer class): New, used when "%code lexer" is present.
2015 (constructor): When "%code lexer" is used, pass %lex-param
2016 to the lexer constructor.
2017 (yylex, yyparse): Remove %lex-param from method invocations
2018 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
2019
2020 * doc/bison.texinfo (Java Bison Interface): Mention "%define
2021 abstract". Rename "%define union_name" to "%define stype".
2022 Rename method names according to previous patch.
2023 (Java Scanner Interface): Describe "%code lexer" instead of
2024 "%pure-parser" and "%define single_class".
2025 (Java Differences): Mention "%code lexer".
2026
2027 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
2028 Include scanner here, using macros from tests/local.at.
2029 (AT_DATA_CALC_Y): Remove final argument.
2030 (_AT_CHECK_JAVA_CALC): Likewise.
2031 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
2032 of %locations and %error-verbose.
2033 (main): Test with and without %lex-param.
2034 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
2035 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 2036
122bea3a
JMG
20372007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2038
2039 DJGPP spefic issue. Inhibit the use of disallowed characters for
2040 file name genertion on Win98, WinXP, etc. These are |<>":?*\
2041 and concern testsuite case 46.
2042 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
2043 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
2044 * djgpp/config.bat: Inhibit the use of disallowed characters.
2045
9611cfa2
JD
20462007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2047
2048 Miscellaneous %define and %code cleanup.
2049 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
2050 values are interpreted.
2051 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
2052 documentation a little more.
2053 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
2054 muscle_percent_define_insert, muscle_percent_code_grow): New
2055 functions/macros.
2056 * src/muscle_tab.h (muscle_percent_define_insert,
2057 muscle_percent_code_grow): Prototype.
2058 * src/parse-gram.y (prologue_declaration): Use
2059 muscle_percent_define_insert and muscle_percent_code_grow when parsing
2060 %define and %code directives.
2061
2062 Make it easy to share %define boolean variables between the front-end
2063 and back-end. Though not used yet, this will be useful in the future.
2064 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
2065 Bison uses of names rather than just skeleton uses of names.
2066 (b4_percent_define_get, b4_percent_define_ifdef): Rename
2067 b4_percent_define_skeleton_variables(VARIABLE) to
2068 b4_percent_define_bison_variables(VARIABLE).
2069 (b4_percent_code_get, b4_percent_code_ifdef): Rename
2070 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
2071 b4_percent_code_bison_qualifiers(QUALIFIER).
2072 (b4_check_user_names_wrap): Update for renames.
2073 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
2074 muscle_percent_define_default): New functions mimicking
2075 b4_percent_define_flag_if and b4_percent_define_default.
2076
2077 For %define variables, report locations for invalid values and
bbb44d83 2078 redefinitions.
9611cfa2
JD
2079 * data/bison.m4 (b4_percent_define_flag_if): Read
2080 b4_percent_define_loc(VARIABLE) to report the location of an invalid
2081 value for VARIABLE.
2082 (b4_percent_define_default): Save a special location in
2083 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
2084 must later be reported as invalid.
2085 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
2086 functions.
2087 (muscle_percent_define_insert): Record the location of VARIABLE in
2088 muscle percent_define_loc(VARIABLE), and use it to report the previous
2089 location for a redefinition.
2090 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
2091 (muscle_percent_define_default): Update like b4_percent_define_default.
2092 (muscle_grow_user_name_list): Rename to...
2093 (muscle_user_name_list_grow): ... this for consistency and use
2094 muscle_location_grow.
2095 * src/muscle_tab.h (muscle_location_grow): Prototype.
2096 * tests/input.at (%define errors): Update expected output.
2097 * tests/skeletons.at (%define boolean variables: invalid skeleton
2098 defaults): New test case.
2099
0bf92491
JD
21002007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
2101
2102 * src/print.c (lookahead_set, state_default_rule): Remove.
2103 (print_reductions): Replace state_default_rule invocation with
2104 equivalent use of yydefact, which was computed in token_actions in
2105 tables.c.
2106 (print_results): Don't allocate lookahead_set.
2107
d3b12988
PB
21082007-02-27 Paolo Bonzini <bonzini@gnu.org>
2109
2110 * data/lalr1.java: Prefix all private members with yy.
2111
f57a7536
JD
21122007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
2113
2114 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 2115 Sebastien Fricker at
f57a7536 2116 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 2117 * THANKS: Add Sebastien Fricker.
f57a7536
JD
2118 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
2119 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
2120 accept a variable number of arguments.
2121
6404a5bf
JD
21222007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2123
2124 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
2125
e4e09639
JMG
21262007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2127
2128 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
2129 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
2130 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
2131
d7e0a1a7
PE
21322007-02-11 Paul Eggert <eggert@cs.ucla.edu>
2133
2134 Undo my 2007-02-07 change, switching back to the c-strcase module
2135 introduced in the 2007-02-03 change. Bruno Haible reported that
2136 the 2007-02-07 change would be dangerous in Turkish if we add a
2137 language whose name contains "i", since "i" is not lowercase "I"
2138 in Turkish.
2139 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
2140 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
2141 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
2142 * m4/.cvsignore: Remove strcase.m4.
2143 * src/getargs.c: Revert 2007-02-07 change, as follows.
2144 Include c-strcase.h.
2145 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
2146
deee93a1
JD
21472007-02-11 Bruno Haible <bruno@clisp.org>
2148
2149 Enable the Java related testsuite tests when the only Java compiler
2150 found is a gcj < 4.3. Discussed at
2151 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
2152 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
2153
574add85
JD
21542007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
2155
2156 * data/Makefile.am: Update copyright date.
2157 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
2158 yypstate_new returns NULL.
2159 (yypstate_new): Return NULL if malloc does.
2160 * src/reader.c (packgram): Move translation of rule actions from the
2161 beginning of packgram to...
2162 (check_and_convert_grammar): ... here right before packgram is invoked
2163 so it's easier to write more complete comments, and remove redundant
2164 code.
2165
e785ccf7
JD
21662007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
2167
2168 As in semantic actions, make @$ in %initial-action, %destructor, and
2169 %printer imply %locations.
2170 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
2171 scanning @$.
2172 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
2173 (@$ in %initial-action implies %locations,
2174 @$ in %destructor implies %locations,
2175 @$ in %printer implies %locations): ... these new test cases.
2176
1cfe1ed7
PE
21772007-02-07 Paul Eggert <eggert@cs.ucla.edu>
2178
2179 Undo most of the 2007-02-03 change, switching to the strcase module
2180 now that gnulib strcase has been fixed.
2181 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
2182 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
2183 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
2184 * m4/.cvsignore: Add strcase.m4.
2185 * src/getargs.c: Revert 2007-02-03 change, as follows.
2186 Don't include c-strcase.h.
2187 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
2188 strcasecmp has "unspecified behavior" outside the POSIX locale,
2189 but it works fine in practice if at least one argument is ASCII,
2190 as is the case in Bison.
2191
0049ec86
PB
21922007-02-07 Paolo Bonzini <bonzini@gnu.org>
2193
2194 * tests/java.at: Skip tests if only one of javac/java is present.
2195 Reported by Joel E. Denny.
2196 * tests/atlocal.in: Adjust copyright years.
2197
21982007-02-05 Paolo Bonzini <bonzini@gnu.org>
2199
2200 * data/lalr1.java (Stack): Work around old verifiers that disallow
2201 access to the private fields of an inner class, from the outer class.
2202 We can make Stack's fields public because user code doesn't have access
2203 to the instance of Stack used by parse(). Reported by Paul Eggert.
2204
2c2b7220
PE
22052007-02-03 Paul Eggert <eggert@cs.ucla.edu>
2206
2207 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
2208 the right spot for these files?
2209 * bootstrap.conf (gnulib_modules): Add c-strcase.
2210 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
2211 c-strncasecmp.c.
2212 * src/getargs.c: Include c-strcase.h.
2213 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
2214 to avoid unspecified behavior.
2215
b2b81dae
JD
22162007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
2217
2218 * doc/bison.texinfo (Decl Summary): Correct typo.
2219
c1d19e10
PB
22202007-01-30 Paolo Bonzini <bonzini@gnu.org>
2221
2222 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
2223 Complain if the value does not match empty, "true" or "false".
2224 * data/c++.m4: Adjust default definitions of %define variables.
2225 * data/java.m4: Adjust default definitions of %define variables.
2226 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
2227 to above behavior.
2228 * tests/input.at (Boolean %define variables): Test new behavior.
2229
8405b70c
PB
22302007-01-29 Paolo Bonzini <bonzini@gnu.org>
2231
2232 * NEWS: Mention java.
2233 * TODO: Remove things that are done.
2234 * bootstrap.conf: Add javacomp-script and javaexec-script.
2235 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
2236
2237 * data/Makefile.am: Add new files.
2238 * data/java-skel.m4: New.
2239 * data/java.m4: New.
2240 * data/lalr1.java: New.
2241
2242 * doc/bison.texinfo: Put "A Complete C++ Example" under
2243 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
2244 under Other Languages.
2245
2246 * src/getargs.c (valid_languages): Add Java.
2247 * src/getargs.h (struct bison_language): Update size of string fields.
2248
2249 * tests/Makefile.am: Add java.at.
2250 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
2251 * tests/java.at: New.
2252 * tests/testsuite.at: Include it.
2253
3eb82471
JD
22542007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
2255
2256 Clean up.
2257 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
2258 at_directive_argv arguments so these no longer have to be global
2259 variables. Also, update the implementation for the following changes.
2260 (fail_for_at_directive_too_many_args,
2261 fail_for_at_directive_too_few_args): Add at_directive_name argument.
2262 (at_directive_name): Remove as at_directive_argv[0] will be used for
2263 this now.
2264 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
2265 for the directive name.
2266 (at_directive_argc, at_directive_argv): Make these local within
2267 skel_lex instead of global.
2268 (INITIAL): Update directive start action for above changes.
2269 (SC_AT_DIRECTIVE_ARG): Rename to...
2270 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
2271 (SC_AT_DIRECTIVE_SKIP_WS): Update.
2272 (scan_skel): Move yylex_destroy to...
2273 (skel_scanner_free): ... here.
2274 * tests/skeletons.at (installed skeleton file name): Rename to...
2275 (installed skeleton file names): ... this.
2276
148d66d8
JD
22772007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
2278
2279 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2280 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
2281 Summary" not "Directives".
2282 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
2283 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
2284 since the former is now the more complete one.
2285 (Prologue Alternatives): Likewise and do the same for %defines.
2286 (Table of Symbols): Add summary of %code, add summary of %define, and
2287 move full %code documentation to...
2288 (Decl Summary): ... here for consistency with other entries in these
2289 sections.
2290 Move %define entry in order to keep this list alphabetized.
2291 Reword %define entry a little to put less emphasis on the skeleton
2292 concept, which most users shouldn't have to think about.
2293
665f0c24
PE
22942007-01-26 Paul Eggert <eggert@cs.ucla.edu>
2295
2296 Adjust to recent gnulib changes.
2297 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
2298 Add string.h, string_.h, unistd_.h, wchar_.h.
2299 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
2300 * src/system.h: Don't include <stpcpy.h>; this is now done by
2301 <string.h>.
2302
592d0b1e
PB
23032007-01-23 Paolo Bonzini <bonzini@gnu.org>
2304
2305 Simplify implementation of unqualified %code, implement macros for
2306 uniform treatment of boolean %define flags. Document %define.
2307 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
2308 b4_percent_code_ifdef): New.
2309 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
2310 * data/c++.m4: Define default value for global_tokens_and_yystype.
2311 * data/glr.cc: Likewise.
2312 * data/location.cc: Use b4_percent_define_flag_if.
2313
148d66d8 2314 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
2315
2316 * src/parse-gram.y (Unqualified %code): Change muscle name to
2317 b4_percent_code().
2318 (content.opt): Default to empty.
2319
a7867f53
JD
23202007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
2321
2322 Implement support for relative and absolute skeleton file names.
2323 Discussed starting at
2324 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
2325 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
2326 (Bison Options): Document in --skeleton entry.
2327 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
2328 full_skeleton can't necessarily hold all of pkgdatadir.
2329 If the specified skeleton file name contains a `/', don't prepend
2330 pkgdatadir.
2331 * src/parse-gram.y (prologue_declaration): If the specified skeleton
2332 file name contains a `/', prepend the grammar file directory.
2333 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
2334 * skeletons.at: New file.
2335 (relative skeleton file names): New test case.
2336 (installed skeleton file names): New test case.
2337 * tests/testsuite.at: Include skeletons.at.
2338
2339 * bootstrap: Update copyright to 2007.
2340
830c9b18
PB
23412007-01-17 Paolo Bonzini <bonzini@gnu.org>
2342
2343 * bootstrap: Remove occurrences of .#bootmp from the files.
2344
a8c2e813
AD
23452007-01-17 Akim Demaille <akim@epita.fr>
2346
2347 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
2348 nonterminals.
2349 Use per-type %printer.
2350
279cabb6
JD
23512007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
2352
2353 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
2354 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2355 djgpp/config.site, src/files.c, src/files.h, src/main.c,
2356 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
2357 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
2358 tests/glr-regression.at, tests/input.at, tests/local.at,
2359 tests/output.at, tests/torture.at: Update copyright to 2007.
2360
bb32f4f2
AD
23612007-01-16 Akim Demaille <akim@epita.fr>
2362
2363 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
2364 error code.
2365 (Calc++ Scanner): Exit with failure if we can't open the input
2366 file.
2367 Accept "-" standing for stdin.
2368 (Calc++ Top Level): Print the result only if the parsing was
2369 successful.
2370
7cff04b5
AD
23712007-01-16 Akim Demaille <akim@epita.fr>
2372
2373 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
2374
a4e25e1d
JD
23752007-01-15 Paolo Bonzini <bonzini@gnu.org>
2376 and Joel E. Denny <jdenny@ces.clemson.edu>
2377
2378 Clean up %define and %code implementation in M4 some. Most
2379 importantly, rename all related macros to be in the b4_percent_define
2380 and b4_percent_code namespaces. Also, complete support for `.' in
2381 %define variable names and %code qualifiers.
2382 * data/bison.m4 (b4_check_user_names): Check for special
2383 "SKELETON-NAMESPACE(name)" macros instead of using two nested
2384 m4_foreach loops.
2385 (b4_get_percent_define, b4_get_percent_code): Rename to...
2386 (b4_percent_define_get, b4_percent_code_get): ... these.
2387 Extend documentation with examples.
2388 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
2389 b4_percent_define_skeleton_variables and
2390 b4_percent_code_skeleton_qualifiers.
2391 Expect any value for the %define variable `foo' to be stored in the
2392 macro named `b4_percent_define(foo)'; expect any %code blocks for the
2393 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
2394 expect any unqualified %code blocks to be stored in a macro named
2395 `b4_percent_code_unqualified'.
2396 Use m4_indir so that %define variable names and %code qualifiers can
2397 contain `.', which is allowed by the grammar parser.
2398 (b4_percent_define_default): New macro to set a default value for a
2399 %define variable.
2400 (m4_wrap): Update wrapped code, and fix some underquoting.
2401 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
2402 Expect grammar uses of %define variables and %code qualifiers to be
2403 defined in b4_percent_define_user_variables and
2404 b4_percent_code_user_qualifiers.
2405 * data/c++.m4: Use b4_percent_define_default rather than
2406 m4_define_default. Fix some underquoting. Skeleton usage of %define
2407 variable define_location_comparison now implies skeleton usage of
2408 %define variable filename_type.
2409 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2410 data/push.c, data/yacc.c: Update macro names.
2411 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
2412 muscle names.
2413
e37c665c
JMG
24142007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2415
2416 DJGPP specific issues.
2417
2418 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
2419 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
2420
7d2d521f
JD
24212007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2422
2423 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
2424 run parsers in all tests so that Valgrind is invoked during
2425 maintainer-check-valgrind.
2426 (Duplicate representation of merged trees): Free all semantic values.
2427 (Duplicated user destructor for lookahead): Likewise.
2428
e0ac9b4b
JD
24292007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2430
2431 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
2432 command-line prefix.
2433 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
2434 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
2435 miss Valgrind messages.
2436 (Exploding the Stack Size with Malloc): Likewise.
2437
78143faa
JD
24382007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2439
2440 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
2441 locals. Reported by Juan Manuel Guerrero at
2442 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
2443 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
2444 Fix some indentation also.
2445 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
2446 explaining this issue.
2447
7ecec4dd
JD
24482007-01-09 Paolo Bonzini <bonzini@gnu.org>
2449 and Joel E. Denny <jdenny@ces.clemson.edu>
2450
2451 Simplify union and prologue handling, and escape union and lex/parse
2452 params with digraphs.
2453 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
2454 values to the empty string since these are no longer guaranteed
2455 initialized by the front-end.
2456 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
2457 braces around b4_user_stype since this is no longer done by the
2458 front-end.
2459 * src/files.c, src/files.h (pre_prologue_obstack,
2460 post_prologue_obstack): Remove.
2461 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
2462 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
2463 with digraphs. This fixes lex params and parse params.
2464 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
2465 * src/output.c (prepare): Remove muscle insertion of the prologues.
2466 (output): Remove freeing of pre_prologue_obstack and
2467 post_prologue_obstack.
2468 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
2469 than prologue_augment for prologue parsing so you don't need prologue
2470 obstacks.
5c80250c
JD
2471 (grammar_declaration): For %union RHS, use `braceless' instead of
2472 "{...}" so that braces are already stripped and code is escaped with
2473 digraphs.
7ecec4dd
JD
2474 * src/reader.c (prologue_augment): Remove.
2475 (reader): Remove initialization of pre_prologue_obstack and
2476 post_prologue_obstack.
2477 * src/reader.h (prologue_augment): Remove.
2478
2479 * data/c.m4: Remove stray parenthesis.
2480
16dc6a9e
JD
24812007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2482
2483 Remove quotes from variables names in %define directives and from
2484 qualifiers in %code directives, and restrict the characters that are
2485 allowed in them to M4-friendly ones. For %define, continue to support
2486 the quoted form as a deprecated feature. Discussed starting at
2487 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
2488 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
2489 %code.
2490 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
2491 (Decl Summary): In %defines entry, update mention of `%code requires'
2492 and `%code provides'.
16dc6a9e
JD
2493 (C++ Location Values): Update %define uses.
2494 (Calc++ Parser Interface): Likewise.
2495 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 2496 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
2497 * src/parse-gram.y (prologue_declaration): For %define variables, use
2498 `variable' instead of `STRING'.
2499 (grammar_declaration): For %code qualifiers, use `ID' instead of
2500 `STRING'.
2501 (variable): New nonterminal that takes an `ID' or a `STRING'.
2502 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
2503 and %define uses.
2504 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
2505 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
2506 (%define errors): Update %define uses.
2507
e9813cd4
JD
25082007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2509
2510 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
2511 instead of muscle_insert for %define values so that M4-special
2512 characters are replaced with digraphs.
2513 * tests/input.at (%define errors): Extend to check weird values.
2514
6afc30cc
JD
25152007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2516
2517 Instead of having skeletons declare all valid %define variables and
2518 %code qualifiers, provide macros that retrieve the associated values
2519 and build these lists automatically. Thus Bison will now warn when a
2520 variable or qualifier is not used by the skeleton in the current
2521 invocation regardless of whether it might sometimes be used by that
2522 skeleton in other invocations. Also, move all %define value macros to
2523 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
2524 form, which is replaced by %code.
2525 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
2526 (b4_check_user_names): ... this, and change the series of valid name
2527 arguments to a single list argument for names used in the skeleton
2528 similar to the existing list argument for names used in the grammar.
2529 Warn instead of complaining.
2530 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
2531 values and %code code, to format %code code properly, and to build
2532 lists of all %define variables and %code qualifiers used in the
2533 skeleton: b4_skeleton_percent_define_variables and
2534 b4_skeleton_percent_code_qualifiers.
2535 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
2536 Remove, and...
2537 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
2538 the skeleton names lists can finish building first. In place of
2539 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
2540 expect the lists b4_user_percent_define_variables and
2541 b4_user_percent_code_qualifiers.
2542 * data/c++.m4: Where setting default values for b4_parser_class_name,
2543 b4_location_type, b4_filename_type, b4_namespace, and
2544 b4_define_location_comparison, update their names to the
2545 b4_percent_define_ namespace.
2546 * data/glr.c: Don't use b4_check_percent_define_variables and
2547 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2548 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
2549 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 2550 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
2551 * data/location.cc: Use b4_get_percent_define.
2552 * data/push.c: Don't use b4_check_percent_define_variables and
2553 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2554 * data/yacc.c: Likewise, and don't call m4_exit in
2555 b4_use_push_for_pull_if or m4_wrap code will never execute.
2556 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
2557 Rename to...
2558 (muscle_grow_user_name_list): ... this for consistency with the
2559 terminology used in bison.m4.
2560 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
2561 %define variable names, and rename muscle used_percent_define_variables
2562 to user_percent_define_variables.
2563 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
2564 user_percent_code_qualifiers.
2565 (content): Remove.
2566 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
2567 {CODE} form is no longer accepted.
2568 * tests/input.at (Reject bad %code qualifiers): Rename to...
2569 (Reject unused %code qualifiers): ... this, and update test output.
2570 (%define error): Update test output.
2571
7eb8a0bc
JD
25722007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
2573
2574 Check for unrecognized %define variables similar to checking for
2575 unrecognized %code qualifiers. Check for redefined %define variables.
2576 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
2577 generalizes...
2578 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
2579 (b4_check_percent_define_variables): New, also wraps it.
2580 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
2581 variables using b4_check_percent_define_variables.
2582 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
2583 all those exercised in the test suite and all those listed in the
2584 `Default values' section of c++.m4. Are there others?
2585 * data/push.c, data/yacc.c: Declare no valid %define variables.
2586 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
2587 similar to muscle_find, but it works even when the muscle stores a
2588 const value.
2589 (muscle_grow_used_name_list): New function for constructing the used
2590 name list muscles that b4_check_for_unrecognized_names requires.
2591 * src/parse-gram.y (prologue_declaration): Warn if a variable is
2592 %define'd more than once. Define the b4_used_percent_define_variables
2593 muscle with muscle_grow_used_name_list.
2594 (grammar_declaration): Abbreviate %code code with
2595 muscle_grow_used_name_list.
2596 * tests/input.at (%define errors): New.
2597
3fc65ead
JD
25982007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2599
2600 Provide warn_at, complain_at, and fatal_at function callbacks to the
2601 skeletons, and use this for %code qualifier complaints.
2602 * data/bison.m4 (b4_error_at): New, invoked by...
2603 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
2604 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
2605 @fatal_at(...@) directives.
2606 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
2607 qualifiers in b4_used_percent_code_qualifiers and to use
2608 b4_complain_at.
2609 * src/location.c, src/location.h (boundary_set_from_string): New global
2610 function.
2611 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
2612 function.
2613 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
2614 to b4_used_percent_code_qualifiers.
2615 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
2616 function.
2617 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
2618 (lineno): Rename to...
2619 (out_lineno): ... this so I don't misunderstand it again.
2620 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
2621 here; these newlines are in the input but not the output file.
2622 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
2623 (at_directive_perform): ... this new static function, and add handling
2624 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
2625 directives.
2626 * tests/input.at (Reject bad %code qualifiers): Update test output with
2627 locations and extend.
2628
2629 * tests/output.at (Output file name: [, Output file name: ]): Remove
2630 bogus comment about these tests failing.
2631
1c7b7e1d
JD
26322007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2633
2634 Clean up b4_check_percent_code_qualifiers a little.
2635 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
2636 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
2637 documentation and add examples.
2638 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
2639 qualifiers here.
2640
08af01c2
JD
26412007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2642
2643 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
2644 unreliable -- especially when they're hidden inside another macro.
2645 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
2646 data/c.m4: Remove m4_divert(-1).
2647 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2648 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
2649 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 2650 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
2651 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
2652 pushed and popped by m4sugar, should be first on the stack.
2653
2654 Provide warn, complain, and fatal function callbacks to the skeletons.
2655 This provides more flexibility than m4_fatal, improves the error
2656 message format, and captures messages for translation. Discussed
2657 starting at
2658 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
2659 * data/bison.m4 (b4_error): New, invoked by...
2660 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
2661 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
2662 directives. Because these M4 macros might be called when the current
2663 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
2664 the previous removal of uses of m4_divert, which caused trouble.
2665 (b4_check_percent_code_qualifiers): Use b4_complain instead of
2666 m4_fatal to report unrecognized %code qualifiers.
2667 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
2668 push parser requests.
2669 * data/glr.c: Use b4_complain instead of m4_fatal to report
2670 non-deterministic push parser requests.
2671 Update @output usage to @output(...@) form.
2672 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
2673 report missing %defines. Update @output usage to @output(...@) form.
2674 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
2675 @output(...@) form.
2676 * src/main.c (main): Invoke skel_scanner_free.
2677 * src/scan-skel.h (skel_scanner_free): Prototype new function.
2678 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
2679 obstack_for_string from flex-scanner.h.
2680 (YY_DECL): Use to declare skel_lex static.
2681 (decode_at_digraphs): Remove; now handled in the new
2682 SC_AT_DIRECTIVE_ARG start condition.
2683 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
2684 functions.
2685 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
2686 at_directive_argv): New static globals.
2687 (INITIAL): Use fail_for_invalid_at.
2688 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
2689 recognize the start of a generalized `@directive(...@)' form and
2690 start...
2691 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
2692 directive args (using the new obstack_for_string), to decode the
2693 contained @ diagraphs, and to perform the directive. It recognizes
2694 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
2695 @output(...@).
2696 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
2697 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
2698 `@,'.
2699 (scan_skel): Initialize obstack_for_string on the first call.
2700 (skel_scanner_free): New function to free obstack_for_string.
2701 * tests/input.at (Reject bad %code qualifiers): Update test output.
2702
8e0a5e9e
JD
27032007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2704
2705 Consolidate the 4 prologue alternative directives (%code, %requires,
2706 %provides, and %code-top) into a single %code directive with an
2707 optional qualifier field. Discussed at
2708 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
2709 * NEWS (2.3a+): Rewrite the existing entry for the prologue
2710 alternatives.
2711 * doc/bison.texinfo (Prologue Alternatives): Update.
2712 (Decl Summary): Update to %code "requires" and %code "provides".
2713 (Calc++ Parser): Update to %code "requires".
148d66d8 2714 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
2715 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
2716 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
2717 are replaced by b4_percent_code_provides and b4_percent_code_requires,
2718 which are skeleton-specific.
2719 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
2720 declare what %code qualifiers it supports and to complain if any other
2721 qualifiers were used in the grammar.
2722 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
2723 and b4_user_code([b4_percent_code_provides]) in place of
2724 b4_user_requires and b4_user_provides.
2725 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
2726 Add b4_user_code([b4_percent_code_top]) and
2727 b4_user_code([b4_percent_code]).
2728 Invoke b4_check_percent_code_qualifiers.
2729 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2730 PERCENT_REQUIRES): Remove.
2731 (grammar_declaration): Remove RHS's for %code-top, %provides, and
2732 %requires. Rewrite the %code RHS as the unqualified form defining the
2733 muscle b4_percent_code. Add another RHS for the qualified %code form,
2734 which defines muscles of the form b4_percent_code_QUALIFIER and the
2735 b4_used_percent_code_qualifiers muscle.
2736 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2737 PERCENT_REQUIRES): Remove.
2738 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
2739 %code "requires" and %code "provides".
2740 * tests/input.at (Reject bad %code qualifiers): New.
2741
95021767
JD
27422007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2743
2744 Use the new code_props interface for destructors and printers.
2745 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
2746 printer_location members, and change the type of the destructor and
2747 printer members to code_props.
2748 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
2749 symbol_printer_get, semantic_type_destructor_set,
2750 semantic_type_printer_set, default_tagged_destructor_set,
2751 default_tagless_destructor_set, default_tagged_printer_set,
2752 default_tagless_printer_set): Use code_props in arguments and return
2753 types in place of char const * and location.
2754 (symbol_destructor_location_get, symbol_printer_location_get): Remove
2755 since the locations are now contained in the return of
2756 symbol_destructor_get and symbol_printer_get.
2757 * src/output.c (symbol_destructors_output, symbol_printers_output):
2758 Replace with...
2759 (symbol_code_props_output): ... this to eliminate duplicate code.
2760 (output_skeleton): Update to use symbol_code_props_output.
2761 * src/reader.c (symbol_should_be_used): Update use of
2762 symbol_destructor_get.
2763 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2764 Update uses of the various _destructor_set and _printer_set functions.
2765 * src/symtab.c: (default_tagged_destructor_location,
2766 default_tagless_destructor_location, default_tagged_printer_location,
2767 default_tagless_printer_location): Remove since we...
2768 (default_tagged_destructor, default_tagless_destructor,
2769 default_tagged_printer, default_tagless_printer): ... change the type
2770 of these to code_props.
2771 (symbol_new, semantic_type_new, symbol_destructor_set,
2772 semantic_type_destructor_set, symbol_destructor_get,
2773 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
2774 symbol_check_alias_consistency, default_tagged_destructor_set,
2775 default_tagless_destructor_set, default_tagged_printer_set,
2776 default_tagless_printer_set): Update.
2777 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
2778 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
2779 code_props members.
2780 (symbol_print): Use SYMBOL_CODE_PRINT.
2781
f6857bbf
JD
27822007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2783
2784 Use the new code_props interface for rule actions.
2785 * src/symlist.h (symbol_list): Replace action, action_location, and
2786 used members with a code_props action_props member.
2787 * src/reader.c (symbol_should_be_used, grammar_rule_check,
2788 grammar_midrule_action, grammar_current_rule_merge_set,
2789 grammar_current_rule_symbol_append, packgram): Update.
2790 * src/scan-code.h (translate_rule_action): Remove, no longer used.
2791 * src/scan-code.l (handle_action_dollar): Update.
2792 (translate_rule_action): Remove, no longer used.
2793 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
2794
7c0c6181
JD
27952007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2796
2797 Use the new code_props interface in parse-gram.y.
2798 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
2799 Update all uses of translate_* functions to use the new code_props
2800 interface and to use gram_scanner_last_string_free and
2801 code_scanner_last_string_free where possible.
2802 (grammar_declaration): symbol_list_destructor_set and
2803 symbol_list_printer_set now perform the translation, so don't do it
2804 here. Use gram_scanner_last_string_free where possible.
2805 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
2806 translate_code): Remove, no longer used.
2807 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
2808 symbol_list_printer_set): Perform code translation here rather than
2809 depending on the caller to do so.
2810
2811 * src/symlist.h (struct symbol_list): Correct some documentation typos.
2812 * src/scan-gram.h (gram_last_string): Remove declaration.
2813 * src/scan-gram.l (last_string): Declare it static.
2814
28e52c0d
JD
28152007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2816
2817 Encapsulate code properties and related functionality for the various
2818 destructors, printers, and actions into a code_props structure and
2819 interface. This patch merely implements code_props in scan-code.h and
2820 scan-code.l. Future patches will rewrite other modules to use it.
2821 Discussed starting at
2822 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
2823 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
2824 consistently initialize const structs that have an empty location
2825 field.
2826 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
2827 to ensure consistency.
2828 * src/scan-code.h (code_props): New structure.
2829 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
2830 function, macro, and const global variable for initializing a
2831 code_props with no code.
2832 (code_props_plain_init, code_props_symbol_action_init,
2833 code_props_rule_action_init, code_props_translate_code): The rest of
2834 the new code_props functional interface. Among other things, the init
2835 functions set the code_props kind field so that
2836 code_props_translate_code will know whether to behave like
2837 translate_symbol_action, translate_rule_action, or translate_code.
2838 These old translate functions must remain until all other modules are
2839 updated to use the new code_props interface.
2840 (code_scanner_last_string_free): New function similar to
2841 gram_scanner_last_string_free.
2842 (code_scanner_free): Add documentation.
2843 * src/scan-code.l: Implement the new interface.
2844 (code_lex): Make it static, add a code_props* argument, and remove the
2845 rule argument.
2846 (last_string): New static global similar to the one in scan-gram.l.
2847 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
2848 instead of rule.
2849 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
2850 code_props since Bison may one day use this information for destructors
2851 and printers.
2852 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
2853 (handle_action_dollar): Use symbol_list_n_get and set used flag
2854 directly since symbol_list_n_used_set is removed.
2855 (translate_action): Add a code_props* argument and remove the rule,
2856 action, and location arguments. Pass the code_props* on to code_lex.
2857 (translate_rule_action, translate_symbol_action, translate_code):
2858 Rewrite as wrappers around the new code_props interface.
2859 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
2860 it would eventually need to break the encapsulation of code_props.
2861
96034983
JD
28622007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2863
2864 * etc/.cvsignore: New.
2865
945e396c
JD
28662007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2867
2868 Add maintainer-push-check to run maintainer-check using push parsing in
2869 place of pull parsing where available.
2870 * Makefile.am (maintainer-push-check): New.
2871 * data/bison.m4 (b4_use_push_for_pull_if): New.
2872 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
2873 appropriately based on their existing values.
2874 (yypush_parse): Don't print push-parser-specific diagnostics if push
2875 parsing is being used in place of pull parsing.
2876 * data/yacc.c: If push parsing should replace pull parsing, redirect to
2877 push.c.
2878 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
2879 variable, and insert b4_use_push_for_pull_flag into muscles.
2880 * tests/Makefile.am (maintainer-push-check): New.
2881
7d596384
JD
28822006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2883
2884 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
2885 (whether successful or failed) so that yypush_parse can be invoked
2886 again to start a new parse using the same yypstate.
2887 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
2888 check multiple yypull_parse invocations on the same yypstate. For pull
2889 mode, extend to check multiple yyparse invocations.
2890 (Exploding the Stack Size with Alloca): Extend to try with
2891 %push-pull-parser.
2892 (Exploding the Stack Size with Malloc): Likewise.
2893
2894 * tests/calc.at (Simple LALR Calculator): Don't specify
2895 %skeleton "push.c" since %push-pull-parser implies that now.
2896 * tests/headers.at (export YYLTYPE): Don't check for the push
2897 declarations. Otherwise, this test case can't be used to see if push
2898 mode can truly emulate pull mode.
2899 * tests/input.at (Torturing the Scanner): Likewise.
2900 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
2901 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
2902 AT_YACC_IF, which now includes the case of push mode since %skeleton
2903 need not be used for push mode. This will be more intuitive once
2904 push.c is renamed to yacc.c.
2905
7172e23e
JD
29062006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2907
2908 For push mode, convert yyparse from a macro to a function, invoke yylex
2909 instead of passing a yylexp argument to yypull_parse, and don't
2910 generate yypull_parse or yyparse unless %push-pull-parser is declared.
2911 Discussed starting at
2912 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
2913 * data/bison.m4 (b4_pull_if): New.
2914 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
2915 * data/push.c: Improve M4 quoting a little.
2916 (b4_generate_macro_args, b4_parenthesize): Remove.
2917 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
2918 any time a pull parser is requested.
2919 Don't #define this as a wrapper around yypull_parse. Instead, when
2920 both push and pull are requested, make it a function that does that
2921 same thing.
2922 (yypull_parse): If there's a b4_prefix, #define this to
2923 b4_prefix[pull_parse] when both push and pull are requested.
2924 Don't define this as a function unless both push and pull are
2925 requested.
2926 Remove the yylexp argument and hard-code yylex invocation instead.
2927 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
2928 %push-parser.
2929 * src/getargs.c (pull_parser): New global initialized to true.
2930 * getargs.h (pull_parser): extern it.
2931 * src/output.c (prepare): Insert pull_flag muscle.
2932 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
2933 (prologue_declaration): Set both push_parser and pull_parser = true for
2934 %push-pull-parser. Set push_parser = true and pull_parser = false for
2935 %push-parser.
2936 * src/scan-gram.l: Don't accept %push_parser as an alternative to
2937 %push-parser since there's no backward-compatibility concern here.
2938 Scan %push-pull-parser.
2939 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
2940 instead of %push-parser.
2941 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
2942 prototype it in the module that calls yyparse.
2943 * tests/input.at (Torturing the Scanner): Likewise.
2944 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
2945
2e7944cb
JD
29462006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
2947
2948 Update etc/bench.pl. Optimize push mode a little (the yyn change
2949 deserves most of the credit).
2950 * Makefile.am (SUBDIRS): Add etc subdirectory.
2951 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
2952 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
2953 yytoken, yyval, and yyloc declarations to...
2954 (yyparse or yypush_parse): ... here to improve performance. For
2955 yypush_parse invocations after the first, be sure to assign yyn its old
2956 value again.
2957 (yypstate_new): Don't bother initializing the yyresult field since the
2958 initial value isn't used.
2959 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
2960 remove the #define that, in push mode, set it to yyps->NAME.
2961 * etc/Makefile.am: New.
2962 * etc/bench.pl: Remove and build it instead from...
2963 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
2964 "tests/bison" from the build directory by default rather than just
2965 invoking "bison" from $PATH.
2966 (calc_grammar): Update push parser code: don't declare yylval globally,
2967 don't define yyparse_wrapper, and don't #define yyparse.
2968 (bench_grammar): Update to check all working combinations of yacc.c,
2969 push.c, impure, pure, pull, and push.
2970
c3d50342
JD
29712006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2972
2973 For push mode, add pull wrappers around yypush_parse.
2974 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
2975 (yypull_parse): New function wrapping yypush_parse.
2976 (yyparse): New #define wrapping yypull_parse.
2977 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
2978 is declared.
2979 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
2980 prototype yylex in the module that calls yyparse, and don't prototype
2981 yyparse there. Otherwise, the yyparse expansion won't compile.
2982 * tests/input.at (Torturing the Scanner): Likewise.
2983
94ebeba5
JD
29842006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2985
2986 Enable push parsers to operate in impure mode. Thus, %push-parser no
2987 longer implies %pure-parser. The point of this change is to move
2988 towards being able to test the push parser code by running the entire
2989 test suite as if %push-parser had been declared.
2990 * data/push.c (yypush_parse): For impure mode, remove the
2991 yypushed_char, yypushed_val, and yypushed_loc arguments.
2992 Instead, declare these as local variables initialized to the global
2993 yychar, yylval, and yylloc.
2994 For the first yypush_parse invocation only, restore the initial values
2995 of these global variables when it's time to read a token since they
2996 have been overwritten.
2997 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
2998 %push-parser.
2999 * tests/calc.at (Simple LALR(1) Calculator): Always declare
3000 %pure-parser along with %push-parser since this test case was designed
3001 for pure push parsers.
3002 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
3003 (AT_YACC_OR_PUSH_IF): New.
3004 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
3005 add a note that it's still wrong for some cases (as it has been for a
3006 while).
3007 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
3008 %push-parser no longer implies %pure-parser.
3009
a0633178
JD
30102006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3011
3012 Remove some unnecessary differences between the pull parser code and
3013 the push parser code. This patch enables yynerrs in push mode.
3014 * data/push.c: Reformat M4 a little.
3015 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
3016 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
3017 because push mode is on. Instead, if pure mode is on, move yynerrs
3018 to...
3019 (b4_declare_parser_state_variables): ... here.
3020 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
3021 to yyps->NAME so it can be used in yypush_parse.
3022 (yypush_parse): Don't omit uses of yynerrs in push mode.
3023
8646b6a3
JD
30242006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3025
3026 Fix bug such that the first pushed token's value and location are
3027 sometimes overwritten (sometimes by %initial-action) before being used.
3028 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
3029 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
3030 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
3031 more closely mimic the pull parser logic.
3032 Don't copy the pushed token to yychar, yylval, and yylloc until it's
3033 time to read a token, which is after any initialization of yylval and
3034 yylloc.
3035 (gottoken): Rename label to...
3036 (yyread_pushed_token): ... for clarity and to avoid infringing on the
3037 user namespace.
3038
9baf4d74
JD
30392006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3040
3041 Rearrange initialization of the parser state variables so that the
3042 skeleton doesn't have to have a copy for pull mode and another for push
3043 mode. This patch also fixes at least a bug such that yylloc was not
3044 initialized (with b4_location_initial_line and
3045 b4_location_initial_column) upon calling yypush_parse. However, that
3046 initialization now overwrites the first token's location;
3047 %initial-action assigning @$ already did the same thing, and both bugs
3048 will be fixed in a later patch.
3049 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
3050 (b4_declare_parser_state_variables): Remove initialization of yytoken,
3051 yyss, yyvs, yyls, and yystacksize.
3052 (yypstate_new): Remove initialization of some yypstate fields: yystate,
3053 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
3054 yylsp.
3055 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
3056 yyps->NAME so it can be used in yypush_parse.
3057 (yyparse or yypush_parse): For yypush_parse, don't print the
3058 "Starting parse" diagnostic for invocations after the first.
3059 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
3060 yypush_parse, only do it for the first invocation.
3061 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
3062 initialization to occur in yypush_parse but only on the first
3063 invocation.
3064
23522164
JD
30652006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3066
3067 * data/push.c: Add CPP guards around push parser declarations in both
3068 the header and the code file.
3069 In the code file, move the push parser declarations to the same place
3070 they appear in the header file.
3071 Clean up the M4 some, especially the inconsistent underquoting in
3072 some b4_c_function_def and b4_c_function_decl uses.
3073
bb010fe5
JD
30742006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3075
3076 Encapsulate the push parser state variables into an M4 macro so the
3077 push skeleton doesn't have to list them again for pull mode's yyparse.
3078 For push mode, remove yypush_parse's local equivalents of these
3079 variables to eliminate unnecessary copying between the two sets at
3080 run-time. This patch also fixes at least a bug related to multiple
3081 %initial-action invocations in push mode.
3082 * data/push.c (b4_declare_parser_variables): Rename to...
3083 (b4_declare_scanner_communication_variables): ... this for clarity and
3084 update both uses.
3085 (b4_declare_yyparse_variables): Remove and move its contents to the one
3086 spot where it was invoked.
3087 (b4_declare_parser_state_variables): New macro containing the parser
3088 state variables required by push mode.
3089 (struct yypstate): Replace all fields but yynew with
3090 b4_declare_parser_state_variables.
3091 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
3092 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
3093 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
3094 (yyparse or yypush_parse): For yyparse in pull mode, replace local
3095 parser state variable declarations with
3096 b4_declare_parser_state_variables.
3097 Don't initialize parser state variables when calling yypush_parse since
3098 yypstate_new already does that.
3099 Invoke the user's initial action only upon the first yypush_parse
3100 invocation.
3101 Remove all code that copies between the local parser state variables
3102 and the yypstate.
3103
2d212f8c
JD
31042006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3105
3106 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
3107 prevent a name collision in a future patch where these names will
3108 sometimes be #define'd.
3109 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
3110 since it no longer has the same name as the existing argument.
3111 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
3112
e6e704dc
JD
31132006-12-19 Paolo Bonzini <bonzini@gnu.org>
3114 and Joel E. Denny <jdenny@ces.clemson.edu>
3115
3116 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3117 that the argument is case-insensitive, and there's no `=' here.
3118 For the %skeleton entry, mention that %language is better.
3119 (Bison Options): Likewise for --language and --skeleton. Move the
3120 --skeleton entry so that the `Tuning the parser' section is sorted
3121 alphabetically on long options.
3122 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
3123 %language directive in detail here; cross-reference the %language
3124 documentation instead.
3125 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
3126 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 3127 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
3128 * examples/extexi (normalize): Instead of replacing every %require
3129 argument with the current Bison version, just substitute for
3130 `@value{VERSION}'. This guarantees that we're testing what actually
3131 appears in the documentation.
3132 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
3133 rather than `@VERSION@'.
3134
0e021770
PE
31352006-12-18 Paul Eggert <eggert@cs.ucla.edu>
3136
fd575f05
PE
3137 * NEWS: Reword the %language news a bit, and put it earlier.
3138
0e021770
PE
3139 * src/getargs.c (skeleton_arg): Last arg is now location const *.
3140 Rewrite to simplify the logic.
3141 (language_argmatch): Likewise.
fd575f05
PE
3142 (program_name): We now own this var.
3143 * src/getargs.h (struct bison_language): Use char[] rather than
3144 const char *.
0e021770
PE
3145
3146 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
3147 Java is supported.
3148 * src/complain.c (program_name): Remove decl; no longer needed.
3149 * src/main.c (program_name): Remove; now belongs to getargs.
3150
31512006-12-18 Paolo Bonzini <bonzini@gnu.org>
3152
3153 * NEWS: Document %language.
3154
3155 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
3156
3157 * data/c-skel.m4, data/c++-skel.m4: New files.
3158 * data/glr.c: Complain on push parsers.
3159
3160 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
3161 over %skeleton.
148d66d8 3162 (Decl Summary): Document %language and %skeleton.
0e021770
PE
3163 (Command line): Document -L.
3164
3165 * examples/extexi: Rewrite %require directive.
3166 * examples/calc++/Makefile.am: Pass VERSION to extexi.
3167
3168 * src/files.c (compute_exts_from_gc): Look in language structure
3169 for .y extension.
3170 (compute_file_name_parts): Check whether .tab should be added.
3171 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
3172 (language, skeleton_arg, language_argmatch): New.
3173 (long_options): Add --language.
3174 (getargs): Use skeleton_arg, add -L/--language.
3175 * src/getargs.h: Include location.h.
3176 (struct bison_language, language, skeleton_arg, language_argmatch): New.
3177 * src/output.c (prepare): Pick default skeleton from struct language.
3178 Don't dispatch C skeletons here.
3179 * src/parse-gram.y (PERCENT_LANGUAGE): New.
3180 (prologue_declaration): Add "%language" rule, use skeleton_arg.
3181 * src/scan-gram.l ("%language"): New rule.
3182
3183 * tests/calc.at: Test %skeleton and %language.
3184 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
3185 (AT_GLR_IF): Look for %skeleton "glr.cc".
3186 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
3187 (AT_YACC_IF): Reject %language.
3188
5691bf57
PE
31892006-12-18 Paul Eggert <eggert@cs.ucla.edu>
3190
db06f0ce
PE
3191 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
3192 since it wasn't used; only the typedef name 'semantic_type' is needed.
3193 Also, omit trailing white space.
3194
5691bf57
PE
3195 * bootstrap: Sync from coreutils.
3196 (gnulib_extra_files): Add build-aux/announce.gen.
3197 (slurp): Adjust .gitignore files like .cvsignore files.
3198 * build-aux/announce-gen: Remove from CVS, since bootstrap
3199 now creates this.
3200
791934e4
JD
32012006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
3202
3203 Make %push-parser imply %pure-parser. This fixes several bugs; see
3204 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
3205 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
3206 pure_parser = true.
3207 * data/push.c: Don't bother testing b4_push_if when deciding whether
3208 to expand b4_declare_parser_variables globally.
3209 (yypush_parse): Likewise in here.
3210
3211 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
3212 (yy_reduce_print): Reformat M4 for readability.
3213
ee5abb37
JD
32142006-12-15 Bob Rossi <bob@brasko.net>
3215 and Joel Denny <jdenny@ces.clemson.edu>
3216
3217 * data/push.c (yypstate): Add typedef, and update all uses of
3218 struct yypstate to just yypstate.
3219 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
3220
16ca01f9
JD
32212006-12-14 Bob Rossi <bob@brasko.net>
3222
3223 * data/push.c (yypush_parse): Declare prototype regardless of
3224 %locations option.
3225
ab8e7e1a
JD
32262006-12-14 Bob Rossi <bob@brasko.net>
3227
3228 * data/push.c (yyparse): Remove the prototype and the #define when in
3229 push-parser mode.
3230
9bf32be3
JD
32312006-12-13 Bob Rossi <bob@brasko.net>
3232
3233 * data/push.c (yypstate_init): Rename to...
3234 (yypstate_new): ... this and use b4_c_function_def.
3235 (yypstate_delete): New.
3236 (yypush_parse): Change parameters yynval and yynlloc to be const.
3237 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
3238 yypstate_delete functions.
3239
f02e2948
JD
32402006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
3241
3242 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
3243 strange test case titles. Reported by Bob Rossi.
3244
38eb7751
PE
32452006-12-13 Paul Eggert <eggert@cs.ucla.edu>
3246
3247 * TODO: Add pointer to Sylvain Schmitz's work on static detection
3248 of potential ambiguities in GLR grammers.
3249
bd9d212b
JD
32502006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
3251
3252 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
3253 `bison ', use m4_index instead of m4_substr since chopping up a string
3254 containing M4-special characters causes problems here.
3255
3256 Fix a couple of bugs related to special characters in user-specified
3257 file names, and make it easier for skeletons to compute output file
3258 names with the same file name prefix as Bison-computed output file
3259 names.
3260 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
3261 b4_parser_file_name and b4_spec_defines_file instead of
3262 @output_parser_name@ and @output_header_name@, which are now redundant.
3263 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
3264 b4_parser_file_name, b4_spec_defines_file, and the new
3265 @basename(FILENAME@) instead of @output_parser_name@ and
3266 @output_header_name@, which inappropriately escaped the file names as
3267 C string literals.
3268 * src/files.c (all_but_ext): Remove static qualifier.
3269 (compute_output_file_names): Move `free (all_but_ext)' to...
3270 (output_file_names_free): ... here since all_but_ext is needed later.
3271 * src/files.h (all_but_ext): Extern.
3272 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
3273 exactly what MUSCLE_INSERT_STRING used to do.
3274 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
3275 characters are escaped properly.
3276 * src/output.c (prepare): Define muscle file_name_all_but_ext as
3277 all_but_ext.
3278 For pkgdatadir muscle, maintain previous functionality by using
3279 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
3280 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
3281 digraphs would never be expanded. Hopefully no one has M4-special
3282 characters in his Bison installation path.
3283 * src/scan-skel.l: Don't parse @output_header_name@ and
3284 @output_parser_name@ anymore since they're now redundant.
3285 In @output, use decode_at_digraphs.
3286 Parse a new @basename command that invokes last_component.
3287 (decode_at_digraphs): New.
3288 (BASE_QPUTS): Remove unused.
3289 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
3290 (Output file name): New tests.
3291
3f7ca628
JD
32922006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
3293
3294 Warn about output files that are generated by the skeletons and that
3295 conflict with other output files.
3296 * data/glr.c: Don't generate the header file here when glr.cc does.
3297 * src/files.c (file_names, file_names_count): New static globals.
3298 (compute_output_file_names): Invoke output_file_name_check for files
3299 not generated by the skeletons and remove existing checks.
3300 (output_file_name_check): New function that warns about conflicting
3301 output file names.
3302 (output_file_names_free): Free file_names.
3303 * src/files.h (output_file_name_check): Declare.
3304 * src/scan-skel.l: Invoke output_file_name_check for files generated by
3305 the skeletons.
3306 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
3307 (Conflicting output files): New tests.
3308
178e123e
PE
33092006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3310
3311 * doc/bison.texinfo: Fix a couple of typos.
3312
33132006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
3314
3315 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
3316 Rename to...
3317 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
3318 update all uses.
3319 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
3320 (yypush_parse): Rename yypvars argument to yyps and remove redundant
3321 local pv.
3322 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
3323 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
3324
ea17f233
JD
33252006-12-07 Bob Rossi <bob@brasko.net>
3326 and Joel Denny <jdenny@ces.clemson.edu>
3327
3328 * data/push.c (yypvarsinit): Change return type from void* to struct
3329 yypvars*. No longer cast to void* on return.
3330 (struct yypvars): Remove yylen since it need not be remembered between
3331 yypushparse invocations.
3332 (yypushparse): Don't copy between yylen and pv->yylen.
3333
55a30bda
JD
33342006-12-05 Bob Rossi <bob@brasko.net>
3335
3336 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
3337 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
3338 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
3339 (struct yypvars): Remove b4_declare_parser_variables.
3340 (yypvarsinit): Remove init code for removed variables.
3341 (global scope): Do not declare b4_declare_parser_variables if
3342 push or pure mode.
3343 (yypushparse): Add b4_declare_parser_variables.
3344 Init new local variables, and remove init code for removed
3345 yypvars variables.
3346 (yyparse): Delete.
3347 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
3348 and yyparse for other modes.
3349 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
3350 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
3351 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
3352 (AT_PURE_LEX_IF): True if pure or push parser.
3353
85894313
JD
33542006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
3355
3356 Document Yacc prologue alternatives and default %destructor's and
3357 %printer's as experimental. Don't mention Java yet. Discussed at
3358 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
3359 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
3360 (2.3a): Annotate this entry to say the old forms of these features were
3361 also experimental.
3362 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 3363 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
3364 of Java (we'll want this back eventually).
3365
02975b9a
JD
33662006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3367
3368 Support a file name argument to %defines. Deprecate `=' in
3369 %file-prefix, %name-prefix, and %output. Discussed at
3370 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
3371 * NEWS (2.3a+): Mention.
148d66d8 3372 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
3373 form of %defines, and remove `=' from entries for %file-prefix,
3374 %name-prefix, and %output.
3375 * src/parse-gram.y (prologue_declaration): Implement.
3376 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
3377 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
3378 all but one occurrence of %name-prefix.
3379 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
3380 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
3381 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
3382 occurrence of each of %file-prefix and %output. Add check for %defines
3383 with argument.
3384 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
3385 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
3386 Remove the `=' from %output.
3387
287b314e
JD
33882006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
3389
3390 Don't escape $ in test case titles since Autoconf 2.61 now does that
3391 correctly.
3392 * tests/actions.at (Default %printer and %destructor are not for error
3393 or $undefined): Here.
3394 (Default %printer and %destructor are not for $accept): Here.
3395 * tests/input.at (Invalid $n and @n): Here.
3396
3ebecc24
JD
33972006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
3398
3399 Rename <!> to <>. Discussed starting at
3400 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
3401 * NEWS (2.3a+): Update.
148d66d8 3402 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
3403 Update.
3404 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
3405 * src/scan-gram.l (INITIAL): Implement.
3406 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
3407 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
3408 comment.
3409 * tests/actions.at (Default tagless %printer and %destructor,
3410 Default tagged and per-type %printer and %destructor,
3411 Default %printer and %destructor are not for error or $undefined,
3412 Default %printer and %destructor are not for $accept,
3413 Default %printer and %destructor for mid-rule values): Update.
3414 * tests/input.at (Default %printer and %destructor redeclared,
3415 Unused values with default %destructor): Update.
3416
26b8a438
JD
34172006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3418
3419 Don't let %prec take a nonterminal.
3420 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
3421 token.
3422 * tests/input.at (%prec takes a token): New test checking that %prec
3423 won't take a nonterminal.
3424
07c39ae9
JD
34252006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3426
405d53b7
JD
3427 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
3428 it was double-quoted.
07c39ae9
JD
3429 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
3430 grammar is maintained with Bison's highest standards.
3431 * src/getargs.c: Fix some typos in Doxygen comments.
3432
580b8926
JD
34332006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3434
3435 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
3436 later. Reported by Paul Eggert in
3437 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
3438 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
3439 * src/scan-code.l (translate_action): Don't bother invoking
3440 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
3441 (code_scanner_free): Instead of invoking
3442 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
3443 which frees more.
3444 * src/scan-gram.l (gram_scanner_free): Likewise.
3445 * src/scan-skel.l (scan_skel): Likewise.
3446
4502eadc
JD
34472006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3448
3449 * src/files.c (tr): Change return type to void.
3450 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
3451 has been called previously for the same key.
3452 (muscle_find): Return storage instead of value so that
3453 --enable-gcc-warnings doesn't produce warnings that the return discards
3454 const. aver that the value and storage are the same since storage
3455 could potentially be NULL when value is not.
3456 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
3457 same as 0.
3458
7746c8f6
PE
34592006-11-08 Paul Eggert <eggert@cs.ucla.edu>
3460
3461 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
3462 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
3463 us a slightly cleaner distribution, and also works.
3464 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
3465 gnulib changes.
3466
eb095650
PE
34672006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
3468 and Paul Eggert <eggert@cs.ucla.edu>
3469
3470 Don't let Bison leak memory except when it complains.
3471 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
3472 (spec_defines_file, dir_prefix): Now char *, not const char *,
3473 since they are freed.
3474 * src/files.c: Likewise.
3475 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
3476 Likewise.
3477 (tr): Now operates in-place. All uses changed.
3478 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
3479 values.
3480 (compute_file_name_parts, compute_output_file_names): Don't store
3481 read-only data in variables that will be freed.
3482 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
3483 src_extension, and header_extension.
3484 (output_file_names_free): New public function to free
3485 spec_verbose_file, spec_graph_file, spec_defines_file,
3486 parser_file_name, and dir_prefix.
3487 * src/getargs.c (getargs): Don't store read-only data in variables that
3488 will be freed.
3489 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
3490 (which previously existed but was unused), and quotearg_free.
3491 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
3492 * src/muscle_tab.c: Likewise.
3493 (muscle_entry): Make the value char const *,
3494 and add a new storage member that is char * and can be freed.
3495 (muscle_entry_free): New private function.
3496 (muscle_init): Use it instead of free.
3497 (muscle_insert, muscle_grow): Update and use new storage member.
3498 (muscle_code_grow): Free the string passed to muscle_grow
3499 since it's not needed anymore.
3500 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
3501 add a new `char *code' member.
3502 ("{...}"): Declare semantic type as code.
3503 * src/scan-code.h (translate_rule_action):
3504 (translate_symbol_action, translate_code, translate_action): Return
3505 `char const *' rather than `char *' since external code should not free
3506 these strings.
3507 * src/scan-code.l: Likewise.
3508 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
3509 which is "{...}" in the parser.
3510 * tests/Makefile.am (maintainer-check-valgrind): Set
3511 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
3512 Valgrind.
3513 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
3514 complain.
3515 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
3516 expecting a non-zero exit status sets --leak-check=summary and
3517 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
3518 this case, and we don't want to hear about it.
3519
ac564be4
PE
35202006-11-08 Paul Eggert <eggert@cs.ucla.edu>
3521
3522 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
3523 instead of from the template, to simplify configuration a bit.
3524 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
3525 and m4/wint_t.m4, as they are needed with the latest gnulib.
3526
17bd8a73
JD
35272006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3528
3529 Disable unset/unused mid-rule value warnings by default, and recognize
3530 --warnings=midrule-values to enable them. Discussed starting at
3531 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
3532 * NEWS (2.3a+): Mention.
3533 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
3534 warnings): Add entry for midrule-values subargument.
3535 * src/reader.c (symbol_should_be_used): Don't return true just because
3536 the value is a set/used mid-rule value unless
3537 --warnings=midrule-values was specified.
3538 * tests/input.at (Unused values, Unused values before symbol
3539 declarations): Run tests with and without --warnings=midrule-values.
3540
3541 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
3542 than LIST_FREE directly.
3543
89eb3c76
JD
35442006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3545
3546 Finish implementing --warnings=error, which should not be implied by
3547 --warnings=all (or by its synonyms -W and --warnings without
3548 subarguments).
3549 * src/complain.c (set_warning_issued): New function to report that
3550 warnings are being treated as errors and to record an error if so.
3551 Invoke...
3552 (warn_at, warn): ... here.
3553 * src/getargs.c (warnings_args, warnings_types): Reorder so that
3554 "error - warnings are errors" does not appear above "all - all of the
3555 above".
3556 (getargs): For -W and --warnings without subarguments, don't let
3557 FLAGS_ARGMATCH set warnings_error in warnings_flag.
3558 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
3559
ba7560e2
JD
35602006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3561
3562 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
3563 empty subargument list. For example: `bison --warnings= parser.y'.
3564
31283fc3
JD
35652006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3566
3567 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
3568 the parser header file so that gcc doesn't warn.
3569
12e35840
JD
35702006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3571
3572 Split the default %destructor/%printer into two kinds: <*> and <!>.
3573 Discussed starting at
3574 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
3575 * NEWS (2.3a+): Mention.
3576 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
3577 previous change today related to mid-rules.
148d66d8 3578 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 3579 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
3580 (TYPE_TAG_ANY): Add as <*>.
3581 (TYPE_TAG_NONE): Add as <!>.
3582 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
3583 for <*> and <!>.
3584 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
3585 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
3586 * src/symlist.c (symbol_list_default_new): Split into tagged and
3587 tagless versions.
3588 (symbol_list_destructor_set, symbol_list_printer_set): Split
3589 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
3590 SYMLIST_DEFAULT_TAGLESS.
3591 * src/symlist.h: Update symbol_list_default*_new prototypes.
3592 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
3593 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
3594 * src/symtab.c (default_destructor, default_destructor_location,
3595 default_printer, default_printer_location): Split each into tagged and
3596 tagless versions.
3597 (symbol_destructor_get, symbol_destructor_location_get,
3598 symbol_printer_get, symbol_printer_location_get): Implement tagged
3599 default and tagless default cases.
3600 (default_destructor_set, default_printer_set): Split each into tagged
3601 and tagless versions.
3602 * src/symtab.h: Update prototypes.
3603 * tests/actions.at (Default %printer and %destructor): Rename to...
3604 (Default tagless %printer and %destructor): ... this, and extend.
3605 (Per-type %printer and %destructor): Rename to...
3606 (Default tagged and per-type %printer and %destructor): ... this, and
3607 extend.
3608 (Default %printer and %destructor for user-defined end token): Extend.
3609 (Default %printer and %destructor are not for error or $undefined):
3610 Update.
3611 (Default %printer and %destructor are not for $accept): Update.
3612 (Default %printer and %destructor for mid-rule values): Extend.
3613 * tests/input.at (Default %printer and %destructor redeclared): Extend.
3614 (Unused values with default %destructor): Extend.
3615
f91b1629
JD
36162006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3617
3618 Don't apply the default %destructor/%printer to an unreferenced midrule
3619 value. Mentioned at
3620 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
3621 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
3622 like $@n instead of just @n so that the default %destructor/%printer
3623 logic doesn't see them as user-defined symbols.
3624 (symbol_is_dummy): Check for both forms of the name.
3625 * src/reader.c (packgram): Remove the `$' from each midrule symbol
3626 name for which the midrule value is referenced in any action.
3627 * tests/actions.at (Default %printer and %destructor for mid-rule
3628 values): New test.
3629 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
3630 for change to dummy symbol names.
3631
519d0004
JD
36322006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3633
3634 Warn about unset midrule $$ if the corresponding $n is used.
3635 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
3636 $n usage.
3637 (packgram): Before invoking grammar_rule_check on any rule, make sure
3638 all actions have already been scanned in order to set `used' flags.
3639 Otherwise, checking that a midrule's $$ is set will not always work
3640 properly because the midrule check must forward-reference the midrule's
3641 parent rule.
3642 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
3643 warning.
3644
a501eca9
JD
36452006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3646
3647 More improvements to the documentation of the prologue alternatives:
3648 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
3649 Bison manual.
3650 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
3651 some text to clarify the relative importance of the new directives and
3652 to show how these directives may be viewed as code labels.
3653
2cbe6b7f
JD
36542006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
3655
3656 Similar to the recently removed %before-header, add %code-top as the
3657 alternative to the pre-prologue. Mentioned at
3658 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
3659 Also, let the prologue alternatives appear in the grammar section.
3660 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
3661 (prologue_declaration): Move the existing prologue alternatives to...
3662 (grammar_declaration): ... here and add %code-top.
3663 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
3664
3665 Clean up and extend documentation for the prologue alternatives.
3666 * NEWS (2.3a+): Describe prologue alternatives.
3667 * doc/bison.texinfo (Prologue): Move discussion of prologue
3668 alternatives to...
3669 (Prologue Alternatives): ... this new section, and extend it to discuss
3670 all 4 directives in detail.
148d66d8
JD
3671 (Table of Symbols): Clean up discussion of prologue alternatives and
3672 add %code-top.
2cbe6b7f 3673
e557d3ea
JMG
36742006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3675
3676 DJGPP specific issues.
3677
3678 * djgpp/config.bat: config.hin has been moved to lib. Adjust
3679 config.bat accordingly.
3680 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
3681 * djgpp/config.site: Likewise.
3682
136a0f76
PB
36832006-10-16 Paolo Bonzini <bonzini@gnu.org>
3684
27bd5d67
PB
3685 Replace %*-header with %provides, %requires, %code. See discussion at
3686 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
3687
136a0f76
PB
3688 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
3689 (b4_user_start_header): Remove.
3690 * data/glr.c: Use new macros instead of b4_*start_header
3691 and b4_*end_header.
3692 * data/glr.cc: Likewise.
3693 * data/lalr1.cc: Likewise.
3694 * data/push.c: Likewise.
3695 * data/yacc.c: Likewise.
3696
3697 * doc/bison.texinfo: Remove %before-header, rename
3698 %{start,end,after}-header to %requires, %provides, %code.
3699
3700 * src/parse-gram.y: Likewise (also rename token names accordingly).
3701 * src/scan-gram.l: Likewise.
3702 * tests/actions.at: Likewise.
3703
10f429ef
PE
37042006-10-14 Paul Eggert <eggert@cs.ucla.edu>
3705
3706 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
3707 Problem reported by Joel E. Denny.
3708
37092006-10-14 Jim Meyering <jim@meyering.net>
3710
3711 (Sync from coreutils.)
3712 Work also when the working directory (with e.g. coreutils sources)
3713 is version controlled with git, rather than CVS.
3714 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
3715 rather than CVS.
3716 In messages and comments, say e.g., "checked-out sources",
3717 rather than "CVS sources".
3718 (version_controlled_file): New function. Work for git as well as
3719 for CVS. Don't use grep's -q option.
3720 (slurp): Call it here, in place of CVS-specific code.
3721
c4bd5bf7
JD
37222006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
3723
3724 Fix testsuite for ./configure --enable-gcc-warnings:
3725 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
3726 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
3727 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
3728 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
3729 * test/regression.at (Diagnostic that expects two alternatives):
3730 Likewise.
3731
46356ea4
PE
37322006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3733
231ed89a
PE
3734 * bootstrap.conf (gnulib_modules): Add config-h.
3735 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
3736 worry about HAVE_CONFIG_H.
3737 * lib/abitset.c: Likewise.
3738 * lib/bitset.c: Likewise.
3739 * lib/bitset_stats.c: Likewise.
3740 * lib/bitsetv-print.c: Likewise.
3741 * lib/bitsetv.c: Likewise.
3742 * lib/ebitset.c: Likewise.
3743 * lib/get-errno.c: Likewise.
3744 * lib/lbitset.c: Likewise.
3745 * lib/subpipe.c: Likewise.
3746 * lib/timevar.c: Likewise.
3747 * lib/vbitset.c: Likewise.
3748 * lib/bitset.c: Include "bitset.h" first, to test interface.
3749 * lib/bitset_stats.c: Include "bitset_stats.h" first.
3750 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
3751 * lib/bitsetv.c: Include "bitsetv.h" first.
3752 * lib/get-errno.c: Include "get-errno.h" first.
3753 * m4/.cvsignore: Add config-h.m4.
3754 * tests/actions.at (Default %printer and %destructor for ...):
3755 Adjust expected line numbers in output to reflect removal of #if
3756 HAVE_CONFIG_H lines.
3757 * tests/glr-regression.at (Missed %merge type warnings when ...):
3758 Likewise.
3759 * tests/regression.at (Braced code in declaration in rules section):
3760 Likewise.
3761 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
3762 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
3763 Include <config.h> unconditionally.
3764
46356ea4
PE
3765 * bootstrap: Sync from coreutils, as follows:
3766
3767 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3768
3769 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
3770 variable was sometimes used without being initialized. This
3771 messed up the installation of the INSTALL file in some cases.
3772
3773 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3774
3775 * bootstrap (usage, main program, symlink_to_gnulib): Add option
3776 --copy. Inspired by a suggestion from Bruno Haible.
3777
3778 2006-10-03 Jim Meyering <jim@meyering.net>
3779
3780 * bootstrap: Undo last change to this file, since now gnulib-tool
3781 sticks with the automake default in generating dependencies.
3782
dd4bf078
PE
37832006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3784
cf2a5f7c
PE
3785 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
3786 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
3787
3788 * doc/bison.1: Add copyright notice.
3789
3790 * data/glr.c: Don't include <stdarg.h>; not used.
3791
35fe0834
PE
3792 * NEWS: The -g and --graph options now output graphs in Graphviz
3793 DOT format, not VCG format.
3794 * doc/bison.1: Likewise.
3795 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
3796 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
3797 of this change in
3798 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
3799 * TODO: Remove Graphviz entry.
3800 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
3801 remove vcg.c, vcg.h, vcg_defaults.h.
3802 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
3803 * src/graphviz.c, src/graphviz.h: New files.
3804 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
3805 * src/files.h: Make comment more generic.
3806 * src/main.c (main): Likewise.
3807 * src/print_graph.h: Likewise.
3808 * src/getargs.c (usage): Make usage description more generic.
3809 * src/print_graph.c: Include graphviz.h rather than vcg.h.
3810 (static_graph, fgraph): Remove. All uses changed to pass
3811 arguments instead of sharing a static var.
3812 (print_core, print_actions, print_state, print_graph):
3813 Output graphviz format rather than VCG format.
3814 * tests/.cvsignore: Remove *.vcg; add *.dot.
3815 * tests/output.at: Expect *.dot files, not *.vcg files.
3816
dd4bf078
PE
3817 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
3818 accommodates the 2006-10-08 change.
3819
efdd7421
PE
38202006-10-11 Bob Rossi <bob@brasko.net>
3821
3822 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
3823 (b4_yyssa, b4_yyerror_range): New macros.
3824 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
3825 (yypvarsinit): Remove init of removed fields.
3826 (yypushparse): Remove use of removed fields; use new macros instead.
3827
96a1981a
PE
38282006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3829
3830 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
3831 in a push parser. Reindent slightly to match yacc.c better.
3832
38332006-10-11 Bob Rossi <bob@brasko.net>
3834
46356ea4
PE
3835 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
3836 yymsg_alloc fields.
3837 (yypvarsinit, yypushparse): Remove init of removed fields.
3838 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 3839
c1630a8b
PE
38402006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3841
3842 * THANKS: Add Paolo Bonzini and Bob Rossi.
3843
90b9908d
PB
38442006-10-08 Paolo Bonzini <bonzini@gnu.org>
3845
3846 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
3847 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
3848 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
3849 b4_define_user_cde and uses): Remove.
3850 (b4_comment, b4_prefix, b4_sync_start): New.
3851 * data/bison.m4: New file, with most of the content removed from c.m4.
3852 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
3853 * src/output.c (output_skeleton): Pass bison.m4.
3854 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
3855 only if specified.
3856
cf806753
PE
38572006-10-05 Paul Eggert <eggert@cs.ucla.edu>
3858
3859 Fix test failure reported by Tom Lane in
3860 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
3861 and try to make such failures easier to catch in the future.
3862 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
3863 that's now the caller's responsibility.
3864 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
3865 Set yychar = YYEOF if it's negative.
3866 * tests/actions.at (yylex): Abort if asked to read past EOF.
3867 * tests/conflicts.at (yylex): Likewise.
3868 * tests/cxx-type.at (yylex): Likewise.
3869 * tests/glr-regression.at (yylex): Likewise.
3870 * tests/input.at (yylex): Likewise.
3871 * tests/regression.at (yylex): Likewise.
3872 * tests/torture.at (yylex): Likewise.
3873
0e2f006a
PE
38742006-10-01 Paul Eggert <eggert@cs.ucla.edu>
3875
3876 Fix problems with translating English-language diagnostics.
3877 * bootstrap: Fix bug introduced in recent bootstrap changes, with
3878 respect to bison-runtime pot generation. The YY_ stuff
3879 wasn't being captured.
3880 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
3881 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
3882 * runtime-po/POTFILES.in: Add data/push.c.
3883
e3ddc1e3
PE
38842006-09-29 Paul Eggert <eggert@cs.ucla.edu>
3885
3886 Merge bootstrap changes from coreutils.
3887
3888 2006-09-28 Jim Meyering <jim@meyering.net>
3889
3890 Automatically generated dependencies are important even
3891 when all of the sources in a directory come from gnulib.
3892 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
3893 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
3894
3895 2006-09-23 Jim Meyering <jim@meyering.net>
3896
3897 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3898
3899 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3900
3901 * bootstrap: Add support for --force.
3902 (usage): New function. Describe usage less tersely.
3903 (CVS_only_file): New var.
3904
01e972b3
PE
39052006-09-21 Paul Eggert <eggert@cs.ucla.edu>
3906
3907 * data/push.c (YYPUSH_MORE): Make it an enum instead.
3908 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
3909 Adjust white space and comments to match GNU style better.
3910
c63d3e90
PE
39112006-09-20 Bob Rossi <bob@brasko.net>
3912
3913 * data/push.c (yyresult_get): Remove function.
3914 (YYPUSH_MORE): Add #define.
3915 (yypushparse): Modify return value.
3916
e70f46d1
PE
39172006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3918
3919 * stamp-h.in: Remove; no longer needed.
3920 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
3921 Remove config.h, config.hin, intl (no longer created).
3922 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
3923 stamp-h1.
3924
3925 Sync bootstrap from coreutils, as follows:
3926
3927 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
3928
3929 * bootstrap (symlink_to_gnulib): New function.
3930 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3931 to copies-of-gnulib.
3932 (cp_mark_as_generated, slurp, gnulib_files):
3933 Avoid making a copy if it's the same as the old version.
3934 (gnulib_files): Add support for this variable (used by Bison).
3935
a92be413
PE
39362006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3937
3938 * src/getargs.c (usage): Rework to use conventions similar to
3939 coreutils, to make translation a bit easier and the code a bit
3940 smaller. Problem reported by Tim Van Holder.
3941
4f82b42a
PE
39422006-09-15 Paul Eggert <eggert@cs.ucla.edu>
3943
3b2942e6
PE
3944 Use some of gnulib's new modules, taken from coreutils.
3945
3946 * bootstrap: Sync from coreutils, except add support for gnulib_files.
3947 * bootstrap.conf: New file.
3948 (gnulib_modules): Add configmake, inttypes, unistd.
3949 (XGETTEXT_OPTIONS): Add complain, complain_at,
3950 fatal, fatal_at, warn, warn_at, unexpected_end.
3951 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
3952 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
3953 (gl_EARLY): Add.
3954 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
3955 (gl_INIT): Add
3956 (GNULIB_AUTOCONF_SNIPPET): Remove.
3957 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
3958 the pickiest.
3959 * lib/.cvsignore: Add inttypes_.h.
3960 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
3961 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
3962 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
3963 no-longer-necessary initializations.
3964 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
3965 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
3966 use the unistd module.
3967 * src/system.h: Likewise.
3968 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
3969 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
3970 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
3971 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
3972 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
3973 * src/system.h: Include inttypes.h unconditionally, now that we
3974 use the inttypes module. Don't bother to include stdint.h, since
3975 inttypes.h now does that for us.
3976 (LOCALEDIR): Remove, now that we use the configmake module.
3977 * src/getargs.c: Include configmake.h.
3978 * src/main.c: Likewise.
3979 * src/output.c: Likewise.
3980 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
3981 not from $abs_top_builddir, since config.h moved.
3982
3983
4f82b42a
PE
3984 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
3985 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
3986
3987 * src/parse-gram.y (symbol_declaration): Don't put statements
3988 before declarations; it's not portable to C89.
3989 * src/scan-code.l (handle_action_at): Likewise.
3990
3991 * src/scan-code.l: Always initialize braces_level; the old code
3992 left it uninitialized and therefore had undefined behavior.
3993
3994 Don't attempt to redefine 'assert', since it runs afoul of
3995 systems where standard headers (mistakenly) include <assert.h>.
3996 Instead, define and use our own alternative, called 'aver'.
3997 * src/reader.c: Don't include assert.h, since we no longer
3998 use assert.
3999 * src/scan-code.l: Likewise.
4000 * src/system.h (assert): Remove, replacing with....
4001 (aver): New function, taking a bool arg. All uses changed.
4002 * src/tables.c (pack_vector): Ensure that aver arg is bool,
4003 not merely an integer.
4004
31c10e38
PE
40052006-09-15 Bob Rossi <bob@brasko.net>
4006
4007 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
4008 * data/c.m4 (YYPUSH): New.
4009 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
4010 * src/getargs.c (push_parser): New var.
4011 * src/getargs.h (push_parser): New declaration.
4012 * src/output.c (prepare): Add macro insertion of `push_flag'.
4013 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
4014 (prologue_declaration): Parse %push-parser.
4015 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
4016 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
4017 list of removed lines from the traces observed.
4018 (AT_CHECK_CALC_LALR): Added push parser tests.
4019
fa7b79c0
PE
40202006-09-13 Paul Eggert <eggert@cs.ucla.edu>
4021
21fe08ca
PE
4022 * NEWS: Version 2.3a.
4023 * configure.ac (AC_INIT): Likewise.
4024
e8ec4d9b
PE
4025 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
4026 "#define YYSTYPE int" that caused "make maintainer-check" to fail
4027 due to header ordering dependencies. I don't know why the #define
4028 was there.
4029
fa7b79c0
PE
4030 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
4031 runtime cost when YYDEBUG is not defined, and so that some tests
4032 that used to fail now work. Problem and initial suggestion by
4033 Paolo Bonzini.
4034 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
4035 * data/glr.cc (b4_parser_class_name):
4036 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
4037 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
4038 (yydebug_) [YYDEBUG]: New member.
4039 (yycdebug_): Now defined only if YYDEBUG.
4040 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
4041 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
4042 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
4043 if YYYDEBUG.
4044 (debug_stream, set_debug_stream, debug_level, set_debug_level):
4045 Define only if YYDEBUG.
4046 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
4047 set_debug_level.
4048 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
4049 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
4050 AT_CHECK_CALC_GLR_CC that are working now.
4051
4ec13d60
PE
40522006-09-12 Paul Eggert <eggert@cs.ucla.edu>
4053
4054 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
4055 We don't need them in glr.cc, and glr.c defines them.
4056 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
4057 assumes that defining it to anything is the same as defining
4058 it to 1. Problem reported by Paolo Bonzini.
4059
8e1687ae
PE
40602006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
4061
4062 * data/c.m4 (b4_null, b4_case): Define.
4063 * src/output.c (prepare_symbols): Use b4_null.
4064 (user_actions_output): Use b4_case.
4065
3dc5e96b
PE
40662006-09-11 Paul Eggert <eggert@cs.ucla.edu>
4067
aef3da86
PE
4068 * data/glr.c (b4_shared_declarations): Put start-header first,
4069 before any #includes that we generate, so that feature-test
4070 macros work. Problem reported by Michael Deutschmann in
4071 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
4072 * data/lalr1.cc: Likewise.
4073 * doc/bison.texinfo (Prologue): Document that feature-test macros
4074 should be defined before any Bison declarations.
4075 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
4076 that depend on location.hh after, not before, Bison decls, since
4077 we now include location.hh after the first user prologue.
4078
3dc5e96b
PE
4079 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
4080 Sander Brandenburg in
4081 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
4082 Also, fix minor white space and comment issues.
aef3da86
PE
4083 (Prologue): Mention that it's better to define feature-test macros
4084 before Bison declarations. Problem reported by Michael Deutschmann.
4085
4086 * README-cvs: Fix typo: "&" should be "&&". Problem reported
4087 by Jim Meyering.
4088 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
4089 This adjusts to recent gnulib changes.
3dc5e96b 4090
b2a0b7ca
JD
40912006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
4092
4093 Finish implementation of per-type %destructor/%printer. Discussed
4094 starting at
4095 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
4096 and
4097 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
4098 * NEWS (2.3+): Add a description of this feature to the default
4099 %destructor/%printer description.
4100 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
4101 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4102 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
4103 list node contains a semantic type.
4104 * src/symtab.c, src/symtab.h: Extend with a table that associates
4105 semantic types with their %destructor's and %printer's.
4106 (semantic_type_from_uniqstr, semantic_type_get,
4107 semantic_type_destructor_set, semantic_type_printer_set): New functions
4108 composing the public interface of that table.
4109 (symbol_destructor_get, symbol_destructor_location_get,
4110 symbol_printer_get, symbol_printer_location_get): If there's no
4111 per-symbol %destructor/%printer, look up the per-type before trying
4112 the default.
4113 * tests/actions.at (Per-type %printer and %destructor): New test case.
4114 * tests/input.at (Default %printer and %destructor redeclared):
4115 Extend to check that multiple occurrences of %symbol-default in a
4116 single %destructor/%printer declaration is an error.
4117 (Per-type %printer and %destructor redeclared, Unused values with
4118 per-type %destructor): New test cases.
4119
3be03b13
JD
41202006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
4121
4122 Require default %destructor/%printer to be declared using
4123 %symbol-default instead of an empty symbol list, and start working on
4124 new per-type %destructor/%printer. Discussed at
4125 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
4126 * NEWS (2.3+): Add %symbol-default to example.
4127 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 4128 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
4129 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
4130 (generic_symlist, generic_symlist_item): New nonterminals for creating
4131 a list in which each item is a symbol, semantic type, or
4132 %symbol-default.
4133 (grammar_declaration): Use generic_symlist in %destructor and %printer
4134 declarations instead of symbols.1 or an empty list.
4135 (symbol_declaration, precedence_declaration, symbols.1): Update actions
4136 for changes to symbol_list.
4137 * src/reader.c: Update for changes to symbol_list.
4138 * src/scan-code.l: Likewise.
4139 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
4140 * src/symlist.c, src/symlist.h: Extend such that a list node may
4141 represent a semantic type or a %symbol-default in addition to just an
4142 ordinary symbol. Add switched functions for setting %destructor's and
4143 %printer's.
4144 * tests/actions.at, tests/input.at: Add %symbol-default to all default
4145 %destructor/%printer declarations.
4146
3508ce36
JD
41472006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
4148
4149 Whether the default %destructor/%printer applies to a particular symbol
4150 isn't a question of whether the user *declares* that symbol (in %token,
4151 for example). It's a question of whether the user by any means
4152 *defines* the symbol at all (by simply using a char token, for
4153 example). $end is defined by Bison whereas any other token with token
4154 number 0 is defined by the user. The error token is always defined by
4155 Bison regardless of whether the user declares it with %token, but we
4156 may one day let the user define error as a nonterminal instead.
4157 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
4158 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
4159 the meaning of "user-defined".
4160 * tests/actions.at (Default %printer and %destructor for user-declared
4161 end token): Rename to...
4162 (Default %printer and %destructor for user-defined end token): ...
4163 this.
4164
4165 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
4166 computation of whether to apply the default, don't maintain a list of
4167 every Bison-defined symbol. Instead, just check for a first character
4168 of '$', which a user symbol cannot have, and check for the error token.
4169
9350499c
JD
41702006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
4171
4172 Don't apply the default %destructor or %printer to the error token,
4173 $undefined, or $accept. This change fits the general rule that the
4174 default %destructor and %printer are only for user-declared symbols,
4175 and it solves several difficulties that are described in the new test
4176 cases listed below.
4177 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
4178 * tests/actions.at (Default %printer and %destructor are not for error
4179 or $undefined, Default %printer and %destructor are not for $accept):
4180 New test cases.
4181
4d7370cb
JD
41822006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
4183
4184 Allow %start after the first rule.
4185 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
4186 when parsing the first rule.
4187 (check_and_convert_grammar): Search for it here after all grammar
4188 declarations have been parsed. Skip midrules, which have dummy LHS
4189 nonterminals.
4190 * src/symtab.c (symbol_is_dummy): New function.
4191 * src/symtab.h (symbol_is_dummy): Declare it.
4192 * tests/input.at (%start after first rule): New test.
4193
6d0ef4ec
JD
41942006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
4195
4196 Redo some of the previous commit: add back the ability to use
4197 non-aliased/undeclared string literals since it might be useful to
4198 those declaring %token-table.
4199 * src/reader.c (check_and_convert_grammar): Undo changes in previous
4200 commit: don't worry about complaints from symbols_pack.
4201 * src/symtab.c (symbol_new, symbol_class_set,
4202 symbol_check_alias_consistency): Undo changes in previous commit: count
4203 each string literal as a new symbol and token, assign it a symbol
4204 number, and don't complain about non-aliased string literals.
4205 (symbols_pack): Since symbol_make_alias still does not decrement symbol
4206 and token counts but does still set aliased tokens to the same number,
4207 symbol_pack_processor now leaves empty slots in the symbols array.
4208 Remove those slots.
4209 * tests/regression.at (Undeclared string literal): Remove test case
4210 added in previous commit since non-aliased string literals are allowed
4211 again.
4212 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
4213 remove unnecessary string literal declarations.
4214 * tests/sets.at (Firsts): Likewise.
4215
965537bc
JD
42162006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
4217
4218 Don't allow an undeclared string literal, but allow a string literal to
4219 be used before its declaration.
4220 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
4221 symbols_pack complained.
4222 * src/symtab.c (symbol_new): Don't count a string literal as a new
4223 symbol.
4224 (symbol_class_set): Don't count a string literal as a new token, and
4225 don't assign it a symbol number since symbol_make_alias does that.
4226 (symbol_make_alias): It's not necessary to decrement the symbol and
4227 token counts anymore. Don't assume that an alias declaration occurs
4228 before any uses of the identifier or string, and thus don't assert that
4229 one of them has the highest symbol number so far.
4230 (symbol_check_alias_consistency): Complain if there's a string literal
4231 that wasn't declared as an alias.
4232 (symbols_pack): Bail if symbol_check_alias_consistency failed since
4233 symbol_pack asserts that every token has been assigned a symbol number
4234 although undeclared string literals have not.
4235 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 4236 string literal): New test cases.
965537bc
JD
4237 (Characters Escapes, Web2c Actions): Declare string literals as
4238 aliases.
4239 * tests/sets.at (Firsts): Likewise.
4240
47aee066
JD
42412006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
4242
4243 In the grammar scanner, STRING_FINISH unclosed constructs and return
4244 them to the parser in order to improve error messages.
4245 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
4246 SC_BRACED_CODE, SC_PROLOGUE): Implement.
4247 * tests/input.at (Unclosed constructs): New test case.
4248 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
4249 seen.
4250
4251 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
4252 unused global.
4253
1f6b3679
JD
42542006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
4255
4256 Handle string aliases for character tokens correctly.
4257 * src/symtab.c (symbol_user_token_number_set): If the token has an
4258 alias, check and set its alias's user token number instead of its own,
4259 which is set to indicate the alias. Previously, every occurrence of
4260 the character token in the grammar overwrote that alias indicator with
4261 the character code.
4262 * tests/input.at (String aliases for character tokens): New test.
4263
219741d8
JD
42642006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
4265
4266 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
4267
11daa4e7
PE
42682006-08-11 Paul Eggert <eggert@cs.ucla.edu>
4269
4270 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
4271 to prevent failures when building on older platforms.
4272 Check for autopoint failure.
4273 Set XGETTEXT_OPTIONS to values that check for C format strings,
4274 so that translators are warned about them (this also helps
4275 prevent core dumps).
4276
4277 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
4278 function, since it simplifies our code a bit.
4279
4280 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
4281 rather than -W, so we don't get bogus warnings about sign comparisons.
4282 Add -Wpointer-arith, since that warning is useful (it reports code
4283 that does not conform to C89 and that some compilers reject).
4284 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
4285 since it's no longer needed.
4286
f9bfc42a
JD
42872006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
4288
4289 Clean up scanners a bit.
4290 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
4291 definitions so gcc won't warn when obstack_for_string is unused.
4292 * src/scan-code.l: config.h and system.h are already #include'd by
4293 scan-code-c.c, so get rid of them here.
4294 * src/scan-gram.l: Likewise.
4295 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
4296 definitions rather than duplicating the rest of it.
4297 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
4298
06e8700a
JD
42992006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
4300
4301 Suppress signed/unsigned comparison warnings for yycheck.
4302 * data/c.m4 (b4_safest_int_type): New macro.
4303 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
4304 a signed int type, cast it to b4_safest_int_type first.
4305 * data/yacc.c: Likewise.
4306 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
4307 also overwritten.
4308
9c437126
PE
43092006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
4310
4311 * doc/bison.texinfo: Fix some typos.
4312
284d8a13
PE
43132006-08-02 Paul Eggert <eggert@cs.ucla.edu>
4314
4315 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
4316 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
4317
4318 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
4319 the latest gnulib does this a different way.
4320 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
4321 translation was patched, so stop omitting it.
4322
ec5479ce
JD
43232006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
4324
4325 Enable declaration of default %printer/%destructor. Make the parser
4326 use these for all user-declared grammar symbols for which the user does
4327 not declare a specific %printer/%destructor. Thus, the parser uses it
4328 for token 0 if the user declares it but not if Bison generates it as
4329 $end. Discussed starting at
4330 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
4331 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
4332 and
4333 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
4334 * NEWS (2.3+): Mention.
4335 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
4336 declare a %destructor for a mid-rule's semantic value. It's just
4337 impossible to declare one specific to it.
4338 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
4339 code. Describe default %destructor form.
4340 * src/parse-gram.y (grammar_declaration): Parse default
4341 %printer/%destructor declarations.
4342 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
4343 and symbol_destructor_location_get rather than accessing the destructor
4344 and destructor_location members of struct symbol.
4345 (symbol_printers_output): Likewise but for %printer's.
4346 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
4347 again.
4348 * src/symtab.c (default_destructor, default_destructor_location,
4349 default_printer, default_printer_location): New static global
4350 variables to record the default %destructor and %printer.
4351 (symbol_destructor_get, symbol_destructor_location_get,
4352 symbol_printer_get, symbol_printer_location_get): New functions to
4353 compute the appropriate %destructor and %printer for a symbol.
4354 (default_destructor_set, default_printer_set): New functions to set the
4355 default %destructor and %printer.
4356 * src/symtab.h: Prototype all those new functions.
4357 * tests/actions.at (Default %printer and %destructor): New test to
4358 check that the right %printer and %destructor are called, that they're
4359 not called for $end, and that $$ and @$ work correctly.
4360 (Default %printer and %destructor for user-declared end token): New
4361 test to check that the default %printer and %destructor are called for
4362 a user-declared end token.
4363 * tests/input.at (Default %printer and %destructor redeclared, Unused
4364 values with default %destructor): New tests to check related grammar
4365 warnings and errors.
4366
868d2d96
JD
43672006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
4368
4369 Clean up handling of %destructor for the end token (token 0).
4370 Discussed starting at
4371 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
4372 and
4373 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
4374
4375 Make the skeletons consistent in how they pop the end token and invoke
4376 its %destructor.
4377 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
4378 state, which has token number 0, since this would invoke the
4379 %destructor for the end token.
4380 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
4381 until after shifting the end token, or else it won't be popped.
4382 * data/yacc.c (yyparse): Likewise.
4383
4384 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
4385 it's the end token. Upon termination, destroy an unshifted lookahead
4386 even when it's the end token.
4387 * data/lalr1.cc (yy::parser::parse): Likewise.
4388 * data/yacc.c (yyparse): Likewise.
4389
4390 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
4391 value warnings for the end token when the user gives the end token a
4392 %destructor.
4393
4394 * tests/actions.at (Printers and Destructors): Test all the above.
4395
62a9592d
PE
43962006-07-24 Paul Eggert <eggert@cs.ucla.edu>
4397
4398 Update to latest gnulib and gettext versions.
4399 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
4400 Add fopen-safer.
4401 (gnulib_files): Add m4/warning.m4. Don't worry about files
4402 overwritten by autopoint.
4403 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
4404 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
4405 rejects them.
4406 Don't use autoreconf; instead, invoke autopoint etc. by hand,
4407 so that we can remove the intl files at a better time.
4408 (intl_files_to_remove): Remove aclocal.m4, since it gets
4409 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
4410 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
4411 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
4412 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
4413 Remove datarootdir hack; no longer needed.
4414 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
4415 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
4416 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
4417 strdup.h.
4418 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
4419 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
4420
10d6970f
PE
44212006-07-20 Paul Eggert <eggert@cs.ucla.edu>
4422
4423 * bootstrap: Adjust to today's change to gnulib-tool by invoking
4424 it with --assume-autoconf='latest-stable'.
4425
50a33993
JD
44262006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
4427
4428 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
4429 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
4430 YYSTYPE' and `{'.
4431 * src/muscle_tab.h (muscle_grow): Replace the header comments with
4432 those from muscle_tab.c since the old ones are misleading.
4433
2ce4ed68
AD
44342006-07-13 Akim Demaille <akim@epita.fr>
4435
4436 Support %define "KEY" {VALUE}.
4437 * src/scan-code.h, src/scan-code.l (translate_action)
4438 (translate_rule_action, translate_symbol_action, translate_code):
4439 Return char *, not const char *.
4440 * src/parse-gram.y (declaration): Rename as...
4441 (prologue_declaration): this.
4442 (string_content): Remove this nonterminal, use STRING.
4443 (braceless, content, content.opt): New nonterminal.
4444 Use them.
4445 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
4446 as value.
4447 * src/scan-gram.l (getargs.h): Don't include it.
4448
db7e5eb5
PE
44492006-07-12 Paul Eggert <eggert@cs.ucla.edu>
4450
4451 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
4452 rather than a for-loop that declares a local bool variable. This
4453 should work around a compatibility problem with a Cray x1e C++
4454 compiler reported by Hung Nguyen in
4455 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
4456 The for-loop was introduced in the 2004-11-17 change but I don't
4457 know why it was needed.
4458
a5d80ba5
AD
44592006-07-12 Akim Demaille <akim@epita.fr>
4460
4461 * data/c.m4: Comment changes.
4462
23eb2a69
AD
44632006-07-10 Akim Demaille <akim@lrde.epita.fr>
4464
4465 * src/complain.c (error_message, ERROR_MESSAGE): New.
4466 To factor...
4467 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
4468 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
4469
ddc8ede1
PE
44702006-07-09 Paul Eggert <eggert@cs.ucla.edu>
4471
4472 * NEWS: Instead of %union, you can define and use your own union type
4473 YYSTYPE if your grammar contains at least one <type> tag.
4474 Your YYSTYPE need not be a macro; it can be a typedef.
4475 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
4476 (Union Decl, Decl Summary): Document this.
4477 * data/glr.c (YYSTYPE): Implement this.
4478 * data/glr.cc (YYSTYPE): Likewise.
4479 * data/lalr1.cc (YYSTYPE): Likewise.
4480 * data/yacc.c (YYSTYPE): Likewise.
4481 * src/output.c (prepare): Output tag_seen_flag.
4482 * src/parse-gram.y (declaration, grammar_declaration):
4483 Use 'union_seen' rather than 'typed' to determine whether
4484 %union has been seen, since grammars can now be typed without
4485 %union.
4486 (symbol_declaration, type.opt, symbol_def):
4487 Keep track of whether a tag has been seen.
4488 * src/reader.c (union_seen, tag_seen): New vars.
4489 (typed): remove.
4490 * src/reader.h (union_seen, tag_seen, typed): Likewise.
4491 * src/scan-code.l (untyped_var_seen): New variable.
4492 (handle_action_dollar): Adjust to above changes.
4493 (handle_action_dollar, handle_action_at):
4494 Improve overflow checking for outlandish numbers.
4495 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
4496 avoid new diagnostics generated by above changes.
4497 * tests/regression.at (YYSTYPE typedef): Add test to check
4498 for type tags without %union.
4499
4500 * src/symlist.c (symbol_list_length): Return int, not unsigned
4501 int, since callers expect int. This may need to get revisited
4502 once we have proper integer overflow checking.
4503
4504 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
4505 object is now static.
4506
4507 * src/getargs.c (flags_argmatch): Return void, not int,
4508 to pacify ./configure --enable-gcc-warnings.
4509
4510 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
4511 since last_string is already defined to FLEX_PREFIX (last_string).
4512
7b42569e
AD
45132006-07-09 Akim Demaille <akim@lrde.epita.fr>
4514
4515 Implement --warnings/-W.
4516 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
4517 replaced by...
4518 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
4519 Adjust callers.
4520 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
4521 (warnings_args, warnings_types): New.
4522 (getargs, short_options, long_options): Accept -W/--warnings.
4523 Sort the options by alphabetical order, upper case letter right
4524 before its lower case.
4525
3b452f4e
JD
45262006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4527
4528 Change %merge result type clash warnings to errors. Discussed at
4529 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
4530 * src/reader.c (record_merge_function_type): Use complain_at.
4531 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4532 declared later): Update test case results.
4533
b8a41559
AD
45342006-07-09 Akim Demaille <akim@lrde.epita.fr>
4535
4536 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
4537 to be in alphabetical order.
4538 (trace_args): Spelling fixes.
4539
cd9e1ba2
PE
45402006-07-09 Paul Eggert <eggert@cs.ucla.edu>
4541
4542 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
4543 so they don't collide with user-defined macros.
4544 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
4545 this was never guaranteed, and now that we're using gnulib stdint,
4546 which defines int_fast16_t to long int, the problem is exposed.
4547
cb48f191
PE
45482006-07-08 Paul Eggert <eggert@cs.ucla.edu>
4549
b8445a15
PE
4550 * data/c.m4 (b4_basename): Simplify a bit, since we don't
4551 need the full POSIX semantics (and weren't implementing them
4552 anyway).
4553
cb48f191
PE
4554 Adjust to Autoconf 2.60 and today's gnulib.
4555 * bootstrap (gnulib_modules): Add stdint.
4556 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
4557 no longer copies it.
4558 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
4559 since stdint needs the former and wcwidth (which is now required
4560 by mbswidth) needs the latter.
4561 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
4562 work around a compatibility glitch between gettext 0.14.6 and
4563 Autoconf 2.60.
4564 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
4565 Do not check for uintptr_t, since new stdint module does the right
4566 thing.
4567 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
4568 Add stdint.h, stdint_.h, wcwidth.h.
4569 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
4570 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
4571 stdint.m4, wchar_t.m4, wcwidth.m4.
4572 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
4573 usual order for ../lib/*.h files.
4574 (file_name_split): Use last_component, not base_name, to adjust
4575 to gnulib changes.
4576 * src/parse-gram.h: Include <strverscmp.h> in the usual order
4577 for ../lib/*.h files.
4578 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
4579 Define unconditionally, since we now assume the stdint module.
4580 * src/scan-skel.l: Include <dirname.h>.
4581 (BASE_QPUTS): Use last_component, not base_name.
4582 * src/system.h: Include <unlocked-io.h> in the usual order
4583 for ../lib/*.h files. Include <stdint.h> unconditionally,
4584 since we now use the stdint module.
4585 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
4586 HAVE_UINTPTR_T, since we now use the stdint module.
4587 (base_name): Remove decl, since files now include <dirname.h>
4588 to get the decl.
4589
cd48d21d
AD
45902006-07-08 Akim Demaille <akim@lrde.epita.fr>
4591
4592 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
4593 New, default to 1.
4594 * data/yacc.c, data/glr.c, data/location.cc: Use them.
4595 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
4596 default.
4597 * tests/calc.at: Adjust.
4598
8ec0a172
AD
45992006-07-08 Akim Demaille <akim@lrde.epita.fr>
4600
b8445a15 4601 * data/c.m4 (b4_basename): New.
8ec0a172
AD
4602 (b4_syncline): Also output the location of its invocation (from
4603 the skeleton).
4604 (b4_user_action, b4_define_user_action, b4_user_actions)
4605 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
4606 (b4_user_stype): New.
4607 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
4608
4a678af8
JD
46092006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4610
4611 In the grammar file, the first column is 1 not 0 on the first line as
4612 on every other line.
4613 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
4614 * tests/input.at (Torturing the Scanner): Update output.
4615
4616 * src/scan-gram.l (scanner_cursor): Declare it static.
4617
dd60572a
JD
46182006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4619
4620 In warnings, say "previous declaration" rather than "first
4621 declaration".
4622 * src/symtab.c (redeclaration): Do that here.
4623 * src/reader.c (record_merge_function_type): In the case of a result
4624 type clash, report the previous declaration rather than the very first
4625 one in the grammar file.
4626 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4627 declared later): Add a third declaration to check this behavior.
4628 * tests/input.at (Incompatible Aliases): Update output.
4629
2073e1b6
AD
46302006-06-27 Akim Demaille <akim@epita.fr>
4631
4632 * doc/Doxyfile.in: New.
4633 * doc/Makefile.am: Use it.
4634 * src/lalr.h, src/symtab.h: Initial doxygenation.
4635
8ee5b538
JD
46362006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4637
4638 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
4639 declared after the %merge. This continues the effort of the previous
4640 patch.
8ee5b538
JD
4641 * src/reader.c (get_merge_function): Don't set the merger type yet.
4642 (record_merge_function_type): New function for setting the merger type
4643 and checking for clashes.
4644 (grammar_current_rule_merge_set): Set the location of the %merge for
4645 the current rule.
4646 (packgram): Invoke record_merge_function_type for each rule now that
4647 all symbol type declarations have been parsed.
4648 * src/reader.h (merger_list.type_declaration_location): New member
4649 storing the location of the first %merge from which the type for this
4650 merging function was derived.
4651 * src/symlist.h (symbol_list.merger_declaration_location): New member
4652 storing the location of a rule's %merge, if any.
4653 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4654 declared later): New test to catch the error fixed by the above patch.
4655
ffa4ba3a
JD
46562006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4657
4658 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
4659 declarations appear after the rules. Discussed at
4660 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
4661 and
4662 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
4663 Don't mistake the type of $$ in a midrule to be that of its parent
4664 rule's $$.
ffa4ba3a
JD
4665 * src/reader.c (grammar_current_rule_end): Don't invoke
4666 grammar_rule_check yet since not all symbol declarations may have been
4667 parsed yet.
4668 (grammar_midrule_action): Likewise.
4669 Don't record whether the midrule's $$ has been used yet since actions
4670 haven't been translated yet.
4671 Record the midrule's parent rule and its RHS index within the parent
4672 rule.
4673 (grammar_current_rule_action_append): Don't translate the action yet
4674 since not all symbol declarations may have been parsed yet and, thus,
4675 warnings about types for $$, $n, @$, and @n can't be reported yet.
4676 (packgram): Translate the action and invoke grammar_rule_check now that
4677 all symbol declarations have been parsed.
4678 * src/scan-code.l (handle_action_dollar): Now that this is invoked
4679 after parsing the entire grammar file, the symbol list here in the case
4680 of a midrule is actually the midrule's empty RHS, so reference its
4681 parent rule's RHS where necessary.
4682 On the other hand, now that you can already know it's a midrule, you
4683 aren't forced to think $$ has the same type as its parent rule's $$.
4684 (handle_action_at): In the case of a midrule, reference the parent rule
4685 where necessary.
4686 * src/symlist.c (symbol_list_new): Initialize new midrule-related
4687 members.
4688 (symbol_list_length): Now that this is invoked after all rules have
4689 been parsed, a NULL symbol (rather than a NULL symbol list node)
4690 terminates a rule. symbol_list_print already does this correctly.
4691 * src/symlist.h (symbol_list.midrule_parent_rule,
4692 symbol_list.midrule_parent_rhs_index): New members so that midrules can
4693 remember their relationships with their parents.
4694 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
4695 fixed by the above patch.
4696 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
4697 implementing...
4698 (Unused values): ... this old test case and...
4699 (Unused values before symbol declarations): ... this new test case.
4700 This one is the same as `Unused values' except that all symbol
4701 declarations appear after the rules in order to catch the rest of the
4702 errors fixed by the above patch.
4703
e256e17f
JD
47042006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4705
300a1930
JD
4706 More cleanup.
4707 * src/reader.c (current_rule): Declare it static since it's no longer
4708 used outside this file.
4709 (grammar_current_rule_action_append): Remove redundant arguments from
4710 translate_rule_action invocation.
4711 * src/reader.h (current_rule): Remove this unused extern.
4712 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
4713 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 4714
381ecb06
JD
47152006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
4716
4717 Clean up yesterday's patch.
4718 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
4719 to...
4720 * src/reader.c (grammar_current_rule_action_append): ... here for
4721 consistency with grammar_current_rule_symbol_append.
4722 * tests/regression.at (Braced code in declaration in rules section):
4723 Make yyerror and yylex static as usual.
4724
4210cd0b
JD
47252006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
4726
4727 Fix bug that mistakes braced code in a declaration in the rules section
4728 to be a rule action. Mentioned at
4729 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
4730 * src/scan-gram.l: Move midrule action detection from the start of the
4731 scanning of any braced code to...
4732 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
4733 action. For readability, use $2 and @2 rather than the equivalent
4734 global variables.
4735 * tests/regression.at (Braced code in declaration in rules section):
4736 New test to catch the error fixed by the above patch.
4737
4738 Work on code readability some.
4739 * src/scan-code.l (current_rule): Get rid of this misleading and
4740 redundant declaration: it's actually extern'ed in reader.h.
4741 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
4742 translate_action): Add a rule argument and use it instead of the global
4743 current_rule.
4744 (translate_rule_action): This already receives current_rule through an
4745 argument, so pass it on to translate_action instead of assigning
4746 current_rule to current_rule.
4747 (translate_symbol_action, translate_code): Pass rule = NULL to
4748 translate_action.
4749
34f98f46
JD
47502006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
4751
4752 Rename %before-definitions to %start-header and %after-definitions to
4753 %end-header. Don't use these declarations to separate pre-prologue
4754 blocks from post-prologue blocks. Add new order-independent
4755 declarations %before-header and %after-header as alternatives to the
4756 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
4757 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
4758 * NEWS (2.3+): Update for these changes.
4759 * data/glr.c (b4_before_definitions): Update to...
4760 (b4_start_header): ... this.
4761 (b4_after_definitions): Update to...
4762 (b4_end_header): ... this.
4763 * data/glr.cc: Likewise.
4764 * data/lalr1.cc: Likewise.
4765 * data/yacc.c: Likewise.
4766 * doc/bison.texinfo (The prologue): Update names, and replace remaining
4767 prologue blocks with %*-header declarations.
4768 (Calc++ Parser): Likewise.
91661ebb 4769 (Decl Summary): Update names.
148d66d8 4770 (Table of Symbols): Update description.
34f98f46
JD
4771 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
4772 (PERCENT_END_HEADER): ... this.
4773 (PERCENT_BEFORE_DEFINITIONS): Update to...
4774 (PERCENT_START_HEADER): ... this.
4775 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4776 (declaration): Update token names and m4 macro names.
4777 When parsing %end-header and %start-header, invoke translate_code
4778 before muscle_code_grow, and no longer set global booleans to remember
4779 whether these declarations have been seen.
4780 Parse new %after-header and %before-header.
4781 * src/reader.c (before_definitions, after_definitions): Remove.
4782 (prologue_augment): Accept a new bool argument to specify whether to
4783 augment the pre-prologue or post-prologue.
4784 * src/reader.h (before_definitions, after_definitions): Remove these
4785 extern's.
4786 (prologue_augment): Add new bool argument.
4787 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
4788 (PERCENT_END_HEADER): ... this.
4789 (PERCENT_BEFORE_DEFINITIONS): Update to...
4790 (PERCENT_START_HEADER): ... this.
4791 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4792 * tests/actions.at (Printers and Destructors): Update names.
4793
31b2b07e
JD
47942006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
4795
4796 Add comparison operators for C++ location classes. Discussed at
4797 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
4798 * data/c++.m4 (b4_define_location_comparison): New boolean %define
4799 declaration indicating whether filename_type has an operator==. If
4800 filename_type is `std::string', it defaults to `1', `0' otherwise.
4801 * data/location.cc: Iff b4_define_location_comparison is `1', add
4802 operator== and operator!= for class position and for class location.
4803
4804 Some minor fixes.
4805 * src/scan-action.l: Remove unused file.
4806 * src/symtab.c (symbol_printer_set): Use printer_location not
4807 destructor_location.
4808 * src/symtab.h (struct symbol): Replace incorrect source comment for
4809 printer members.
4810 * tests/input.at (Incompatible Aliases): Update output with correct
4811 printer location.
4812
9bc0dd67
JD
48132006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
4814
4815 Don't put the pre-prologue in the header file. For the yacc.c code
4816 file and the glr.c header and code files, move the pre-prologue before
4817 the token definitions. Add new %before-definitions and
4818 %after-definitions to declare code that will go in both the header file
4819 and code file. Discussed at
4820 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
4821 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
4822 and
4823 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
4824 * NEWS (2.3+): Describe these changes.
4825 * data/glr.c (b4_pre_prologue): Move from within to before...
4826 (b4_shared_declarations): ... this.
4827 Add new b4_before_definitions before b4_token_enums.
4828 Add new b4_after_definitions at the end.
4829 * data/glr.cc (b4_pre_prologue): Replace with...
4830 (b4_before_definitions): ... this in the header file.
4831 (b4_after_definitions): New near the end of the header file.
4832 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
4833 code file right before including the header file.
4834 (b4_before_definitions): New in the previous position of
4835 b4_pre_prologue in the header file.
4836 (b4_after_definitions): New near the end of the header file.
4837 * data/yacc.c: Clean up some m4 quoting especially in the header file.
4838 (b4_token_enums_defines): In the code file, move to right before
4839 YYSTYPE for consistency with the header file.
4840 (b4_before_definitions): New right before b4_token_enums_defines in
4841 both the header and code file.
4842 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
4843 header and code file.
4844 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
4845 of prologues for %union dependencies.
91661ebb
JD
4846 (Decl Summary): In %defines description, mention the effect of
4847 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
4848 (Calc++ Parser): Forward declare driver in a %before-definitions rather
4849 than in the pre-prologue so that make check succeeds.
148d66d8 4850 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
4851 %after-definitions.
4852 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
4853 %before-definitions.
4854 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
4855 (declaration): Parse those declarations and append to
4856 b4_before_definitions and b4_after_definitions, respectively.
4857 * src/reader.c (before_definitions, after_definitions): New bools to
4858 track whether those declarations have been seen.
4859 (prologue_augment): Add to the post-prologue if %union,
4860 %before-definitions, or %after-definitions has been seen.
4861 * src/reader.h (before_definitions, after_definitions): New extern's.
4862 * src/scan-gram.l: Scan the new declarations.
4863 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
4864 prologue block in a %before-definitions or a %after-definitions based
4865 on whether the %union is declared.
4866 * tests/regression.at (Early token definitions with --yacc, Early token
4867 definitions without --yacc): Move tests for token definitions into the
4868 post-prologue since token names are no longer defined in the
4869 pre-prologue.
4870
203b9274
AD
48712006-06-20 Akim Demaille <akim@epita.fr>
4872
4873 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
4874 (symbol_get): Use it.
4875 * src/parse-gram.y: Use it.
4876
a7ee59cf
JD
48772006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
4878
4879 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
4880 build succeeds when configured with --enable-gcc-warnings.
4881
5a2baae7
PE
48822006-06-19 Paul Eggert <eggert@cs.ucla.edu>
4883
33ad1a9c
PE
4884 * src/parse-gram.y (char_name): New function.
4885 (CHAR, STRING, string_content): For %printer, properly escape.
4886 (ID): Prefer fputs to fprintf.
4887 (id): Reindent to be consistent with other rules.
4888 Properly quote char.
4889
5a2baae7
PE
4890 The Translation Project changed its way of publishing translations
4891 to maintainers. I haven't received any responses to my request
4892 for supporting the old way, or for documenting the new way. I
4893 have modified 'bootstrap' to use screen scraping
4894 (in this case, HTML scraping). This is unreliable and inelegant,
4895 but I don't see any better way. Yuck.
4896 * bootstrap (TP_URL, WGET_COMMAND): New vars.
4897 (get_translations): New function, which uses HTML scraping to
4898 deduce locations of latest translations.
4899 Use this function to grab both bison and bison-runtime .po files.
4900 Don't bother priming the pump for the runtime-po domain any more,
4901 as it's now translated better than bison is.
4902
58d7a1a1
AD
49032006-06-19 Akim Demaille <akim@epita.fr>
4904
4905 * src/scan-gram.l: No longer "parse" things after `%union' until
4906 `{'. Rather, return a single "%union" token.
4907 No longer make symbols: return strings, and leave the conversion
4908 to symbols to the parser.
4909 (SC_PRE_CODE, token_type): Remove.
4910 * src/parse-gram.y (%union): New field `character'.
4911 Sort tokens.
4912 (CHAR): New token.
4913 (ID, ID_COLON): Now that the scanner no longer makes them
4914 identifiers, adjust all uses to invoke symbol_get.
4915 (id_colon): New, wraps the conversion from string to symbol.
4916 (%union): Accept a possible union_name.
4917 (symbol): Now can be a char.
4918 * data/c.m4 (b4_union_name): Leave a default value.
4919 * data/glr.c, data/yacc.c: Use it.
4920
b931235e
JD
49212006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
4922
4923 For associating token numbers with token names for "yacc.c", don't use
4924 #define statements unless `--yacc' is specified; always use enum
4925 yytokentype. Most important discussions start at:
4926 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
4927 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
4928 and
4929 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
4930 * NEWS (2.3+): Mention.
4931 * data/c.m4 (b4_yacc_if): New.
4932 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
4933 token #define's.
4934 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
4935 on token name definitions.
4936 * src/getargs.c (usage): Capitalize `Yacc' in English.
4937 * src/output.c (prepare): Define b4_yacc_flag.
4938 * tests/regression.at (Early token definitions): Test that tokens names
4939 are defined before the pre-prologue not just before the post-prologue.
4940 Remove this test case and copy to...
4941 (Early token definitions with --yacc): ... this to test #define's.
4942 (Early token definitions without --yacc): ... and this to test enums.
4943
9e6e7ed2
PE
49442006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4945
4946 * NEWS: Reword the post-2.3 change to not be so optimistic about
4947 removing the old "look-ahead" spelling.
4948 Update previous look-ahead/lookahead change reports.
4949 * REFERENCES: look-ahead -> lookahead (since that's
4950 what he actually wrote).
4951 * doc/refcard.tex: look ahead -> lookahead,
4952 look-ahead -> lookahead
4953
742e4900
JD
49542006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
4955
4956 For consistency, use `lookahead' instead of `look-ahead' or
4957 `look_ahead'. Discussed starting at
4958 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
4959 and then at
4960 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
4961 * NEWS: For the next release, note the change to `--report'.
4962 * TODO, doc/bison.1: Update English.
4963 * doc/bison.texinfo: Update English.
4964 (Understanding Your Parser, Bison Options): Document as
4965 `--report=lookahead' rather than `--report=look-ahead'.
4966 * src/conflicts.c: Update English in comments.
4967 (lookahead_set): Rename from look_ahead_set.
4968 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
4969 (resolve_sr_conflict): Rename local look_ahead_tokens to
4970 lookahead_tokens, and update other uses.
4971 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
4972 count_rr_conflicts, conflicts_free): Update uses.
4973 * src/getargs.c (report_args): Move "lookahead" before alternate
4974 spellings.
4975 (report_types): Update uses.
4976 (usage): For `--report' usage description, state `lookahead' spelling
4977 rather than `look-ahead'.
4978 * src/getargs.h (report.report_lookahead_tokens): Rename from
4979 report_look_ahead_tokens.
4980 * src/lalr.c: Update English in comments.
4981 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
4982 (state_lookahead_tokens_count): Rename from
4983 state_look_ahead_tokens_count.
4984 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4985 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
4986 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4987 Update other uses.
4988 Update English in output.
4989 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
4990 * src/print.c: Update English in comments.
4991 (lookahead_set): Rename from look_ahead_set.
4992 (print_reduction): Rename argument lookahead_token from
4993 look_ahead_token.
4994 (print_core, state_default_rule, print_reductions, print_results):
4995 Update uses.
4996 * src/print_graph.c: Update English in comments.
4997 (print_core): Update uses.
4998 * src/state.c: Update English in comments.
4999 (reductions_new): Update uses.
5000 (state_rule_lookahead_tokens_print): Rename from
5001 state_rule_look_ahead_tokens_print, and update other uses.
5002 * src/state.h: Update English in comments.
5003 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
5004 (state_rule_lookahead_tokens_print): Rename from
5005 state_rule_look_ahead_tokens_print.
5006 * src/tables.c: Update English in comments.
5007 (conflict_row, action_row): Update uses.
5008 * tests/glr-regression.at
5009 (Incorrect lookahead during deterministic GLR,
5010 Incorrect lookahead during nondeterministic GLR): Rename
5011 print_look_ahead to print_lookahead.
5012 * tests/torture.at: Update English in comments.
5013 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
5014 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
5015 (Many lookahead tokens): Update uses.
5016 * data/glr.c: Update English in comments.
5017 * lalr1.cc: Likewise.
5018 * yacc.c: Likewise.
5019 * src/conflicts.h: Likewise.
5020 * src/lalr.h: Likewise.
5021 * src/main.c: Likewise.
5022 * src/output.c: Likewise.
5023 * src/parse-gram.c: Likewise.
5024 * src/tables.h: Likewise.
5025 * tests/calc.at: Likewise.
5026
3c40d0b5
JD
50272006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
5028
5029 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
5030
5d278082
PE
50312006-06-07 Paul Eggert <eggert@cs.ucla.edu>
5032
5033 * TODO: Add request from Nelson H. F. Beebe to be able to install
5034 Bison without installing the yacc script.
5035
9e668899
JD
50362006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
5037
5038 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
5039 and yytext if they're already #define'd.
5040 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
5041 * src/scan-code-c.c: ... here.
5042 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
5043 <config.h>.
5044
0c8e079f
JD
50452006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
5046
5047 Get Bison to build again when configured with --enable-gcc-warnings.
5048 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
5049 missing #include's.
5050 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
5051 loc argument as it shadows a global.
5052 * src/scan-gram.l: Remove stray comma that prevents boundary_set
5053 invocation.
5054
5055 * src/.cvsignore: Add scan-code.c.
5056
2346344a
AD
50572006-06-07 Akim Demaille <akim@epita.fr>
5058
5059 * src/scan-gram.l: Move the "add a trailing ; to actions" code
5060 to...
5061 * src/scan-code.l: here.
5062 * tests/input.at (Torturing the Scanner): Fix another location
5063 error.
5064
4862bdfd
AD
50652006-06-07 Akim Demaille <akim@epita.fr>
5066
5067 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
5068
e9071366
AD
50692006-06-06 Akim Demaille <akim@epita.fr>
5070
5071 Extract the parsing of user actions from the grammar scanner.
5072 As a consequence, the relation between the grammar scanner and
5073 parser is much simpler. We can also split "composite tokens" back
5074 into simple tokens.
5075 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
5076 * src/scan-gram.l (add_column_width, adjust_location): Move to and
5077 rename as...
5078 * src/location.h, src/location.c (add_column_width)
5079 (location_compute): these.
5080 Fix the column count: the initial column is 0.
5081 (location_print): Be robust to ending column being 0.
5082 * src/location.h (boundary_set): New.
5083 * src/main.c: Adjust to scanner_free being renamed as
5084 gram_scanner_free.
5085 * src/output.c: Include scan-code.h.
5086 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
5087 Use boundary_set.
5088 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
5089 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
5090 which is now, again, a separate token.
5091 Adjust all dependencies.
5092 Whereever actions with $ and @ are used, use translate_code.
5093 (action): Remove this nonterminal which is now useless.
5094 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
5095 (grammar_current_rule_action_append): Use translate_code.
5096 (packgram): Bound check ruleno, itemno, and rule_length.
5097 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
5098 (last_string, last_braced_code_loc, max_left_semantic_context)
5099 (scanner_initialize, scanner_free, scanner_last_string_free)
5100 (gram_out, gram_lineno, YY_DECL_): Move to...
5101 * src/scan-gram.h: this new file.
5102 (YY_DECL): Rename as...
5103 (GRAM_DECL): this.
5104 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
5105 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5106 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5107 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5108 Move these declarations, and...
5109 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
5110 these to...
5111 * src/flex-scanner.h: this new file.
5112 * src/scan-gram.l (rule_length, rule_length_overflow)
5113 (increment_rule_length): Remove.
5114 (last_braced_code_loc): Rename as...
5115 (gram_last_braced_code_loc): this.
5116 Adjust to the changes of the parser.
5117 Move all the handling of $ and @ into...
5118 * src/scan-code.l: here.
5119 * src/scan-gram.l (handle_dollar, handle_at): Remove.
5120 (handle_action_dollar, handle_action_at): Move to...
5121 * src/scan-code.l: here.
5122 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
5123 scan-code.h, scan-code-c.c, scan-gram.h.
5124 (EXTRA_bison_SOURCES): Add scan-code.l.
5125 (BUILT_SOURCES): Add scan-code.c.
5126 (yacc): Be robust to white spaces.
5127
5128 * tests/conflicts.at, tests/input.at, tests/reduce.at,
5129 * tests/regression.at: Adjust the column numbers.
5130 * tests/regression.at: Adjust the error message.
7891a7c4 5131
184e42f0
JD
51322006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
5133
5134 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
5135 Use Akim's wording from
5136 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
5137
7891a7c4
JD
51382006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
5139
5140 Between Bison releases, manually append `+' to the previous Bison
5141 release number, and use that as a signal to automatically print the
5142 ChangeLog's CVS Id keyword from --version. Discussed starting at
5143 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
5144 * ChangeLog: Add Id header.
5145 * configure.ac (AC_INIT): Append `+' to `2.3'.
5146 * src/.cvsignore: Add revision.c.
5147 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
5148 (BUILT_SOURCES): Add revision.c.
5149 (revision.c): New target rule. This file defines a new global variable
5150 named revision. It initializes it with either the Id from ChangeLog
5151 or, if VERSION doesn't contain `+', with the empty string.
5152 * src/getargs.c (version): Print the value of revision.
5153 * src/revision.h: Extern revision.
5154
4ad3ed84
PE
51552006-06-05 Paul Eggert <eggert@cs.ucla.edu>
5156
5157 * NEWS: Version 2.3.
5158 * configure.ac (AC_INIT): Likewise.
5159
02103984
PE
51602006-05-30 Paul Eggert <eggert@cs.ucla.edu>
5161
5162 * data/glr.c (YYRECOVERING): Define to be a function-like macro
5163 with no arguments, not as an object-like macro. This is for
5164 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
5165 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
5166 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
5167 Document this.
5168
2c08afa5
JD
51692006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
5170
5171 * src/getargs.c (usage): Back out yesterday's modification of the
5172 --help output so that we don't have to wait for translation before
5173 releasing 2.3.
5174
6077da58
PE
51752006-05-29 Paul Eggert <eggert@cs.ucla.edu>
5176
5177 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
5178 Problem reported by Akim Demaille.
5179
2a26b6c2
JD
51802006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5181
5182 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
5183
aefef0d6
PE
51842006-05-26 Paul Eggert <eggert@cs.ucla.edu>
5185
5186 * data/yacc.c (yy_reduce_print): Omit trailing white space in
5187 generated source code. Problem reported by Frans Englich in
5188 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
5189
fcd8e201
PE
51902006-05-22 Paul Eggert <eggert@cs.ucla.edu>
5191
5192 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
5193 shell, not within 'make', so that 'make' by an ordinary builder
5194 (using GNU make) does not worry about configuring gzip. This also
5195 works around a bug reported independently by Keith Thompson and by
5196 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
5197 stderr rather than stdout, messing up the build logs.
5198
7b5cdcbd
JD
51992006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
5200
5201 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
5202 to make sure that YYID will never be unused. This fixes a 'make
5203 maintainer-check' failure caused by the recent changes to the 'Trivial
5204 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
5205 not used.
5206 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
5207
5ad0a449
JD
52082006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
5209
5210 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
5211 state before an empty RHS is always resolved here. Only the location
5212 of that state is guaranteed to be resolved, and that's enough. This
5213 fixes the remaining bug reported by Derek M. Jones in
5214 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
5215 * tests/glr-regression.at (Uninitialized location when reporting
5216 ambiguity): Test the above case.
5217 Also, the embedded comments in this test case claim it checks the case
5218 of an empty RHS that has inherited the initial location. However, the
5219 corresponding LHS was already resolved, so yyresolveLocations didn't
5220 actually have reason to modify it. Fix this by forcing
5221 nondeterministic operation at the beginning of the parse.
5222
50cce58e
PE
52232006-05-20 Paul Eggert <eggert@cs.ucla.edu>
5224
5225 * data/c.m4 (b4_yy_symbol_print_generate):
5226 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
5227 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
5228 of the bugs reported today by Derek M Jones in
5229 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
5230 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
5231 defined to be a type name without parens or brackets.
5232 (Location Type): Similarly for YYLTYPE.
5233 * tests/regression.at (Trivial grammars): Put in a test for this
5234 bug that will be caught by 'make maintainer-check' (though not,
5235 alas, by 'make check' unless your compiler is picky).
5236
ab8d9dc5
PE
52372006-05-19 Paul Eggert <eggert@cs.ucla.edu>
5238
0d2c8934 5239 * NEWS: Version 2.2.
ab8d9dc5
PE
5240 * configure.ac (AC_INIT): Likewise.
5241
9138c575
JD
52422006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
5243
5244 * data/glr.c (yyreportTree): Make room in yystates for the state
5245 preceding the RHS. This fixes the segmentation fault reported by Derek
5246 M. Jones in
5247 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
5248 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
5249 to the user. Reported for yyreportTree by Derek M. Jones later in the
5250 same thread.
5251 * THANKS: Add Derek M. Jones.
5252 Update my email address.
5253 Fix typo in Steve Murphy's name.
5254
276f48df
PE
52552006-05-14 Paul Eggert <eggert@cs.ucla.edu>
5256
d6645148
PE
5257 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
5258 checking against YYLAST that caused the parser to miss a potential
5259 alternative in its diagnostic.
5260 Problem reported by Maria Jose Moron Fernandez in
5261 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
5262 * data/lalr1.cc (yysyntax_error_): Likewise.
5263 * data/yacc.c (yysyntax_error): Likewise.
5264 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
5265 tokens, in case we run into an older C compiler.
5266 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
5267 Use them to check for the off-by-one error fixed above.
5268
276f48df
PE
5269 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
5270 YYSIZE_T, not size_t.
5271 * tests/regression.at (Trivial grammars): New test, to catch
5272 the error fixed by the above patch.
5273
cd8b5791
AD
52742006-05-14 Akim Demaille <akim@lrde.epita.fr>
5275
5276 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
5277 scheme.
5278 Reported by Steve Murphy.
5279
34376418
AD
52802006-05-14 Akim Demaille <akim@lrde.epita.fr>
5281
5282 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
5283 * data/glr.cc: b4_location_flag is now b4_locations_flag.
5284
327afc7c
AD
52852006-05-14 Akim Demaille <akim@lrde.epita.fr>
5286
5287 Implement --trace=m4.
5288 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
5289 * src/output.c (output_skeleton): When set, pass -dV to m4.
5290
5291 Factor the handling of flags in m4.
5292 * src/output.c (prepare): Rename the muscle names debug, defines,
5293 error_verbose to debug_flag, defines_flag, error_verbose_flag.
5294 * data/c.m4: Adjust.
5295 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
5296 Use b4_define_flag_if to define other b4_FLAG_if macros.
5297 (b4_location_if): As a consequence, rename as...
5298 (b4_locations_if): this, for consistency.
5299 Adjust all the skeletons.
5300
ba9ecd19
AD
53012006-05-14 Akim Demaille <akim@lrde.epita.fr>
5302
5303 * etc/bench.pm: Shorten bench names.
5304
4e83ea15
AD
53052006-05-14 Akim Demaille <akim@lrde.epita.fr>
5306
5307 * src/output.h, src/output.c (error_verbose): Move to...
5308 * src/getargs.h, src/getargs.c: here.
5309 Sort the flags.
5310 Adjust dependencies.
5311
6e93d810
PE
53122006-05-13 Paul Eggert <eggert@cs.ucla.edu>
5313
5314 * data/c.m4 (b4_copyright): Put the special exception for Bison
5315 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
5316 uses changed. Suggested by Akim Demaille. Also, wrap the
5317 copyright notice, in case it is longer than 80 columns. Replace
5318 comma by newline after title.
6e93d810 5319
eaea13f5
PE
53202006-05-11 Paul Eggert <eggert@cs.ucla.edu>
5321
5322 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
5323 incompatibility, not a bug. Mention that it wasn't fixed as of
5324 flex 2.5.33.
5325
3cf084ec
AD
53262006-05-11 Akim Demaille <akim@lrde.epita.fr>
5327
5328 * examples/extexi: Enforce the precedence of concatenation over
5329 >>.
0a9f1c7d 5330 Reported by Tommy Nordgren.
3cf084ec 5331
32c96bd7
AD
53322006-05-11 Akim Demaille <akim@lrde.epita.fr>
5333
5334 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
5335 with the member "token".
f94705b2 5336 Reported by Martin Nylin.
32c96bd7 5337
eaea13f5
PE
53382006-05-08 Paul Eggert <eggert@cs.ucla.edu>
5339
5340 * data/glr.c: Switch to Bison 2.2 special-exception language in
5341 the copyright notice. Use more-regular format for titles and
5342 copyright notices.
5343 * data/glr.cc: Likewise.
5344 * data/location.cc: Likewise.
5345 * data/yacc.cc: Likewise.
5346 * doc/bison.texinfo (Conditions): Document this.
5347 * NEWS: likewise. Upgrade version to 2.2.
5348
6e2d1146
AD
53492006-04-27 Akim Demaille <akim@lrde.epita.fr>
5350
5351 * data/glr.cc: Remove dead code.
5352
47671055
PE
53532006-04-25 Paul Eggert <eggert@cs.ucla.edu>
5354
5355 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
5356 that variable and the line breaks the bootstrap. Problem reported
5357 by Juan M. Guerrero.
5358
ed2e6384
AD
53592006-04-24 Akim Demaille <akim@lrde.epita.fr>
5360
5361 * doc/bison.texinfo (Multiple start-symbols): New.
5362
3cedc2dc
AD
53632006-04-24 Akim Demaille <akim@lrde.epita.fr>
5364
5365 * etc/README, etc/bench.pl: New.
5366
b2ddc3f3
AD
53672006-04-03 Akim Demaille <akim@lrde.epita.fr>
5368
5369 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
5370 rule.
5371 Reported by Mickael Labau.
5372 * tests/input.at (Torturing the Scanner): Test it.
5373
91e3ac9a
PE
53742006-03-16 Paul Eggert <eggert@cs.ucla.edu>
5375
5376 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
5377 Problem reported by Bob Rossi.
5378
53792006-03-13 Paul Eggert <eggert@cs.ucla.edu>
5380
5381 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
5382 and didn't really work.
5383 For the index, use @ifnotinfo, not @iftex.
5384 Minor cleanups of spacing and terminology.
5385
5cf61e93
AD
53862006-03-12 Akim Demaille <akim@lrde.epita.fr>
5387
5388 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
5389 of AT_NAME_PREFIX when %name-prefix is not used.
5390
aa08666d
AD
53912006-03-12 Akim Demaille <akim@lrde.epita.fr>
5392
5393 Apply --prefix to C++ skeletons too: they change the namespace.
5394 The test suite already exercize these cases.
5395 * data/c++.m4 (b4_namespace): New.
5396 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
5397 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
5398 * data/yacc.c, data/glr.c: Remove a useless `[]'.
5399 * doc/bison.texinfo: Document it.
5400 (Option Cross Key): Use @multitable in all formats. It looks
5401 nicer, even in TeX outputs.
5402 (Rules): Use the same code whatever the output type is.
5403 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
5404 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
5405 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 5406
45567173
AD
54072006-03-10 Akim Demaille <akim@lrde.epita.fr>
5408
5409 * TODO: Remove dead items.
5410
e9d8f881 54112006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
5412
5413 * doc/FAQ: Remove, merged into...
5414 * doc/bison.texinfo (FAQ): this.
5415 * doc/Makefile.am (EXTRA_DIST): Adjust.
5416
c095d689
AD
54172006-03-10 Akim Demaille <akim@lrde.epita.fr>
5418
5419 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
5420 even if empty.
5421 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
5422 * doc/bison.texinfo (Calc++ Scanner): Use it.
5423
6e0f8287
PE
54242006-03-09 Paul Eggert <eggert@cs.ucla.edu>
5425
5426 Fix two nits reported by twlevo, plus one more that I discovered.
5427
5428 * src/assoc.h (assoc_to_string): Give a name to the arg, as
5429 this is the usual Bison style.
5430 * src/location.h (location_print): Likewise.
5431
5432 * src/reader.h (token_name): Likewise.
5433
d6b771c3
PE
54342006-03-08 Paul Eggert <eggert@cs.ucla.edu>
5435
5436 Fix some nits reported by twlevo.
5437 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
5438 and "POSIX". Use more-modern syntax for URLs. Mention C++
5439 and ask for Java. Don't hardwire OS version numbers. Add
5440 copyright notice.
5441 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
5442 * src/conflicts.c (solved_conflicts_obstack): Now static.
5443
1e137b71
JD
54442006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5445
5446 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
5447 page. Say "you can use it" not "you may use it" as on the web page;
5448 we're describing capabilities not granting permission.
5449
73f2e47e
PE
54502006-03-06 Paul Eggert <eggert@cs.ucla.edu>
5451
6d05403d
PE
5452 * data/glr.c (yyresolveLocations): Rename local variables to avoid
5453 shadowing warnings. Use usual patter for iterating through RHS.
5454 * tests/glr-regression.at
5455 (Uninitialized location when reporting ambiguity):
5456 Modify yylex so that it uses its argument, rather than trying
5457 to rely on ARGSUSED (which doesn't work for gcc with warnings).
5458 const char -> char const.
5459
73f2e47e
PE
5460 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
5461 Don't use tabs inside commands; it messes up 'ps'.
5462 Problem reported by twlevo.
5463
8710fc41
JD
54642006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
5465
5466 * tests/glr-regression.at (Uninitialized location when reporting
5467 ambiguity): New test case.
5468 * data/glr.c (yyresolveLocations): New function, which uses
5469 YYLLOC_DEFAULT.
5470 (yyresolveValue): Invoke yyresolveLocations before reporting an
5471 ambiguity.
5472 * doc/bison.texinfo (Default Action for Locations): Note
5473 YYLLOC_DEFAULT's usage for ambiguity locations.
5474 (GLR Semantic Actions): Cross-reference those notes.
5475
ae952af2
JD
54762006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
5477
5478 * tests/glr-regression.at (Leaked semantic values when reporting
5479 ambiguity): Remove unnecessary union and type declarations.
5480 (Leaked lookahead after nondeterministic parse syntax error): New test
5481 case.
5482 * data/glr.c (yyparse): Check for zero stacks remaining before
5483 attempting to shift the lookahead so that you don't lose it.
5484
35ee866a
JD
54852006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5486
5487 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
5488 * tests/glr-regression.at (Leaked semantic values when reporting
5489 ambiguity): New test case.
5490 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
5491 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
5492 now unnecessary yystackp parameter.
5493 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
5494 destructors can be called.
5495
5496 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
5497 in existing testcases.
5498
520181ab
JD
54992006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5500
5501 Don't leak semantic values for parent RHS when a user action cuts the
5502 parser, and clean up related code a bit.
5503 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
5504 cuts parse): Rename to...
5505 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
5506 for leaked parent RHS values.
5507 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
5508 between an unresolved state (non-empty chain of semantic options) and
5509 an incomplete one (signaled by an empty chain).
ae952af2 5510 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
5511 successfully or unsuccessfully resolved yyGLRState to...
5512 (yyresolveValue): ... here so that yyresolveValue always leaves a
5513 yyGLRState with consistent data and thus is easier to understand.
5514 Remove the yyvalp and yylocp parameters since they are always just
5515 taken from the yys parameter. When reporting a discarded merged value
5516 in debugging output, note that it is incompletely merged. Document the
5517 interface.
5518 (yyresolveAction): If resolving any of the RHS states fails, destroy
5519 them all rather than leaking them. Thus, as long as user actions are
5520 written to clean up the RHS correctly, yyresolveAction always cleans up
5521 the RHS of a semantic option. Document the interface.
5522
18d9185c
PE
55232006-02-27 Paul Eggert <eggert@cs.ucla.edu>
5524
5525 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
5526 led to a segmentation fault in GNU Pascal. Problem reported
5527 by Waldek Hebisch.
5528
841a7737
JD
55292006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
5530
5531 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
5532 mid-rule action inside a nonterminal symbol in order to declare a
5533 destructor for its semantic value.
5534
fc3f467f
PE
55352006-02-16 Paul Eggert <eggert@cs.ucla.edu>
5536
5537 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
5538 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
5539 __cplusplus && ! defined _STDLIB_H && !
5540 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
5541 defined free))]: Include <stdlib.h> rather than rolling our own
5542 declarations of malloc and free, to avoid problems with
5543 incompatible declarations (using 'throw') C++'s stdlib.h. This
5544 should fix Debian bug 340012
5545 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
5546 reported by Guillaume Melquiond.
5547
a3af26dd
PE
55482006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5549
4d7bc38c
PE
5550 * NEWS: Clarify symbols versus types in unused-value warnings.
5551
a3af26dd
PE
5552 * configure.ac (AC_INIT): Bump version number.
5553
4e26c69e
PE
55542006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5555
5556 * NEWS: Version 2.1a.
5557 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
5558 since C99 requires this.
5559
498e897c
PE
55602006-02-11 Paul Eggert <eggert@cs.ucla.edu>
5561
5562 * m4/c-working.m4: New file.
5563 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
5564
57bb17ca
PE
55652006-02-10 Paul Eggert <eggert@cs.ucla.edu>
5566
5567 * Makefile.maint: Merge from coreutils.
5568
0be105dc
PE
55692006-02-09 Paul Eggert <eggert@cs.ucla.edu>
5570
5571 More portability fixes for problems summarized by Nelson H. F. Beebe.
5572
5573 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
5574 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
5575 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
5576 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
5577 messes up because C++ code is compiled in 32-bit mode but linked
5578 in 64-bit mode.
5579
6fc0c024
PE
55802006-02-08 Paul Eggert <eggert@cs.ucla.edu>
5581
5582 More portability fixes for problems summarized by Nelson H. F. Beebe.
5583
7870f699
PE
5584 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
5585 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
5586
6fc0c024
PE
5587 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
5588 nodist_PROGRAMS, since we don't need to actually compile the
5589 example if we're just doing a plain 'make'. This avoids bothering
5590 the installer unnecessarily about problems due to weird C++
5591 compilers.
5592
fe6c2fde
PE
55932006-02-06 Paul Eggert <eggert@cs.ucla.edu>
5594
5595 More portability fixes for problems summarized by Nelson H. F. Beebe.
5596
5597 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
5598 than #include "...", and compile with -I'.'. The old method was
5599 not portable, according to Posix and the C standard, and it does
5600 not work with Sun C 5.7, where previous #line directives affect
5601 the working directory used in later #include "..." directives.
5602
927b425b
JMG
56032006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5604
5605 Various DJGGP specific issues in /djgpp
5606
d9735e9e
PE
56072006-02-02 Paul Eggert <eggert@cs.ucla.edu>
5608
5609 More portability fixes for problems summarized by Nelson H. F. Beebe.
5610
5611 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
5612 '#include <map>' works and that you can apply ++ to iterators.
5613
5a6755af
PE
56142006-02-01 Paul Eggert <eggert@cs.ucla.edu>
5615
67a0dc4f
PE
5616 Work around portability problems summarized by Nelson H. F. Beebe in
5617 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
5618
8c86f0ef
PE
5619 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5620 that '#include <string>' works.
5621
de35dd59
PE
5622 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
5623 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
5624 "warning: sorry: semantics of inline function static data `const
5625 unsigned char translate_table[262]' are wrong (you'll wind up with
5626 multiple copies)".
5627
67a0dc4f
PE
5628 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
5629 or, xor to not_, and_, or_, and xor_, respectively. This works
5630 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
5631 random system header somewhere that includes the equivalent of
5632 <iso646.h>.
5633
5a6755af
PE
5634 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
5635 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 5636 Suite Version 2.0.
5a6755af 5637
3f001415
JD
56382006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
5639
5640 During deterministic GLR operation, user actions should be able to
5641 influence the parse by changing yychar. To make this easier to fix and
5642 to make glr.c easier to evolve in general, don't maintain yytoken in
5643 parallel with yychar; just compute yytoken when needed.
5644 * tests/glr-regression.at (Incorrect lookahead during deterministic
5645 GLR): Check that setting yychar in a user action has the intended
5646 effect.
5647 * data/glr.c (yyGLRStack): Remove yytokenp member.
5648 (yyclearin): Don't set *yytokenp.
5649 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
5650 yychar rather than *yytokenp to determine the current lookahead.
5651 Compute yytoken locally when needed.
5652 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
5653 point to.
5654
5655 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
5656 after `--report' documentation.
5657
e2a8c0f5
PE
56582006-01-30 Paul Eggert <eggert@cs.ucla.edu>
5659
5660 * src/parse-gram.y (grammar_declaration): Location of printer
5661 symbol is @1, not list->location. Bug reported by twlevo.
5662 * tests/input.at (Incompatible Aliases): Adjust to above change.
5663
6b702268
PE
56642006-01-29 Paul Eggert <eggert@cs.ucla.edu>
5665
27622431
PE
5666 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
5667 all the test at once. This makes the output easier to read in the
5668 normal case.
5669
6b702268
PE
5670 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
5671 got from <http://bro-ids.org/download.html>. The bug is that
5672 when two actions appeared in succession, the second one was
5673 scanned before the first one was added to the grammar rule
5674 as a midrule action. Bison then output the incorrect warning
5675 "parse.y:905.17-906.36: warning: unused value: $3".
5676 * src/parse-gram.y (BRACED_CODE, action): These are no longer
5677 associated with a value.
5678 (rhs): Don't invoke grammar_current_rule_action_append.
5679 (action): Invoke it here instead.
5680 * src/reader.c (grammar_midrule_action): Now extern.
5681 (grammar_current_rule_action_append): Don't invoke
5682 grammar_midrule_action; that is now the scanner's job.
5683 * src/reader.h (last_string, last_braced_code_loc):
5684 (grammar_midrule_action): New decls.
5685 * src/scan-gram.l (last_string): Now extern, sigh.
5686 (last_braced_code_loc): New extern variable.
5687 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
5688 rule already has an action.
5689 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
5690 * tests/input.at (AT_CHECK_UNUSED_VALUES):
5691 Add some tests to check that the above changes fixed the bug.
5692
d40ba6c2
PE
56932006-01-27 Paul Eggert <eggert@cs.ucla.edu>
5694
5695 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
5696 All used changed. Check whether the symbol has a destructor,
5697 not whether it is typed.
5698 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
5699 that the values are still reported as unused. All line numbers
5700 adjusted.
5701
401aace6
PE
57022006-01-23 Paul Eggert <eggert@cs.ucla.edu>
5703
5704 Work around a bug in bro 0.8, which underparenthesizes its
5705 definition of YYLLOC_DEFAULT.
5706 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
5707 their arguments.
5708 * data/lalr1.cc: Likewise.
5709 * data/yacc.cc: Likewise.
5710
06f01bc4
PE
57112006-01-22 Paul Eggert <eggert@cs.ucla.edu>
5712
401aace6
PE
5713 Work around a bug in Pike 7.0, and give the Pike folks a
5714 better way to override the usual int widths.
5715 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
5716 user can override the types.
5717 (short): #undef, to work around a bug in Pike 7.0.
5718 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
5719 (union yyalloc.yyss): Use yytype_int16 rather than short.
5720 All uses changed.
5721 (yysigned_char): Remove.
5722 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
5723 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
5724 * tests/regression.at (Web2c Actions): Adjust to above changes.
5725
5726 * src/reader.c (check_and_convert_grammar): New function.
5727 (reader): Close the input file even if something went wrong during
5728 parsing. Minor file descriptor leak reported by twlevo.
5729
06f01bc4
PE
5730 * src/assoc.c (assoc_to_string): Use a default: abort (); case
5731 to pacify gcc -Wswitch-default.
5732 * src/scan-gram.l (adjust_location): Use a default: break; case
5733 to pacify gcc -Wswitch-default.
5734 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
5735 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5736 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5737 Move these decls to scan-skel.l, since they don't need to be
5738 visible elsewhere.
5739 * src/scan-skel.l: Accept the above decls.
5740 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
5741 is used.
5742
02650b7f
PE
57432006-01-21 Paul Eggert <eggert@cs.ucla.edu>
5744
5745 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
5746 since we don't want to insist on a version number at the start
5747 of the changelog every time.
5748 * Makefile.maint: Sync from coreutils a bit better.
5749 (sc_trailing_blank): Renamed from sc_trailing_space.
5750 All uses changed.
5751 (sc_no_if_have_config_h, sc_require_config_h):
5752 (sc_prohibit_assert_without_use): New rules.
5753 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
5754 (sc_dd_max_sym_length): Fix leading spaces in rule.
5755 (sc_system_h_headers): Prefix with @.
5756 (sc_useless_cpp_parens, m4-check): Output line numbers.
5757 (changelog-check): Allow version only in head.
5758 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
5759 satisfy new Makefile.maint rule.
5760 * data/glr.c: Likewise.
5761 * data/glr.cc: Likewise.
5762 * data/lalr1.cc: Likewise.
5763 * data/yacc.c: Likewise.
5764 * lib/ebitsetv.c: Likewise.
5765 * lib/lbitset.c: Likewise.
5766 * lib/subpipe.c: Likewise.
5767 * lib/timevar.c: Likewise.
5768 * src/system.h: Likewise.
5769 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
5770 * djgpp/Makefile.maint: Add copyright notice.
5771 * djgpp/README.in: Likewise.
5772 * djgpp/config.bat: Likewise.
5773 * djgpp/config.site: Likewise.
5774 * djgpp/config_h.sed: Likewise.
5775 * djgpp/djunpack.bat: Likewise.
5776 * djgpp/config.sed: Fix copyright notice to match standard format.
5777 * djgpp/subpipe.h: Likewise.
5778 * lib/bitsetv-print.c: Likewise.
5779 * lib/bitsetv.c: Likewise.
5780 * lib/subpipe.h: Likewise.
5781 * lib/timevar.c: Likewise.
5782 * lib/timevar.h: Likewise.
5783 * djgpp/subpipe.c: Use standard recipe for config.h.
5784 * lib/abitset.c: Likewise.
5785 * lib/bitset.c: Likewise.
5786 * lib/bitset_stats.c: Likewise.
5787 * lib/bitsetv-print.c: Likewise.
5788 * lib/bitsetv.c: Likewise.
5789 * lib/ebitsetv.c: Likewise.
5790 * lib/get-errno.c: Likewise.
5791 * lib/lbitset.c: Likewise.
5792 * lib/subpipe.c: Likewise.
5793 * lib/timevar.c: Likewise.
5794 * lib/vbitset.c: Likewise.
5795 * tests/local.at: Likewise.
5796 * src/scan-gram.l: Don't include verify.h, since system.h does
5797 that for us.
5798 * .x-sc_require_config_h: New file.
5799 * .x-sc_unmarked_diagnostics: New file.
5800
287c78f6
PE
58012006-01-20 Paul Eggert <eggert@cs.ucla.edu>
5802
287c78f6
PE
5803 Be a bit more systematic about using 'abort'.
5804 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
5805 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
5806 Put 'default: abort ();' before some other case, to satisfy older
5807 pedantic compilers.
5808 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5809 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
5810 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
5811 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
5812 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
5813 (get_decision_str, get_orientation_str, get_node_alignment_str):
5814 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
5815 (get_linestyle_str, get_arrowstyle_str): Likewise.
5816 * src/conflicts.c (resolve_sr_conflict):
5817 Use a default case rather than one for the one remaining enum
5818 value, to catch invalid enum values as well.
5819 * src/lalr.c (set_goto_map, map_goto):
5820 Prefer "assert (FOO);" to "if (!FOO) abort ();".
5821 * src/nullable.c (nullable_compute, token_definitions_output):
5822 Likewise.
5823 * src/reader.c (packgram, reader): Likewise.
5824 * src/state.c (transitions_to, state_new, state_reduction_find):
5825 Likewise.
5826 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
5827 (symbol_pack): Likewise.
5828 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
5829 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
5830 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
5831 * src/system.h: Don't include <assert.h>.
5832 (assert): New macro.
5833
5834 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
5835 (Destructor Decl, Parser Function, Pure Calling):
5836 Describe rules for braces inside C code more carefully.
287c78f6 5837
c66dfadd
PE
58382006-01-19 Paul Eggert <eggert@cs.ucla.edu>
5839
c21493b8
PE
5840 Fix some porting glitches found by Nelson H. F. Beebe.
5841 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
5842 compilers that don't understand that abort () does not return.
5843 * src/state.c (transitions_to): Likewise.
5844 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5845 that '#include <cstdlib>' works.
5846 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
5847 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
5848 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
5849 for the benefit of some pre-C99 compilers.
5850
b6e3facf
PE
5851 * bootstrap: Undo changes to gnulib files that autoreconf made.
5852
c66dfadd
PE
5853 Minor fixups to get 'make maintainer-check' to work.
5854 * configure.ac: Don't use -Wnested-externs, as it's incompatible
5855 with the new verify.h implementation.
5856 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
5857 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
5858 * data/yacc.c (YYUSE): Likewise.
5859 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
5860 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
5861 * src/parse-gram.y (declaration): Don't pass a string constant
5862 to a function that expects char *, since GCC might complain
5863 about the constant value.
5864 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
5865 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
5866 before #defining them.
5867 * tests/glr-regression.at
5868 (Incorrectly initialized location for empty right-hand side in GLR):
5869 In yyerror, use the msg arg.
5870 (Corrupted semantic options if user action cuts parse):
5871 (Incorrect lookahead during deterministic GLR):
5872 (Incorrect lookahead during nondeterministic GLR):
5873 Don't name a local var 'index'; it shadows string.h's 'index'.
5874
ed94ef2a
AD
58752006-01-19 Akim Demaille <akim@epita.fr>
5876
5877 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
5878 location, not just parts of it.
5879
e9ad4aec
PE
58802006-01-18 Paul Eggert <eggert@cs.ucla.edu>
5881
d6ca7905
PE
5882 * NEWS: Document the fact that multiple %unions are now allowed.
5883 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
5884 * TODO: This feature is now implemented, so remove it from
5885 the wishlist.
d6ca7905 5886
ef1b70e0
PE
5887 * Makefile.maint: Merge with coreutils Makefile.maint.
5888 (CVS_LIST): Use build-aux version if available.
5889 (VERSION_REGEXP): New macro.
5890 (syntax-check-rules): Add sc_no_if_have_config_h,
5891 sc_prohibit_assert_without_use, sc_require_config_h,
5892 sc_useless_cpp_parens.
5893 (sc_obsolete_symbols): Check for O_NDELAY.
5894 (sc_dd_max_sym_length): Track coreutils.
5895 (sc_unmarked_diagnostics): Look in all files, not just *.c.
5896 (sc_useless_cpp_parens): New rule.
5897 (news-date-check): Look for version or today's date.
5898 (changelog-check): Don't require version number near head.
5899 (copyright-check): Use current year instead of hardwiring 2005.
5900 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
5901 (announcement): Add --gpg-key-ID.
5902
5903 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
5904 with "file system".
5905
2073ce56 5906 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
5907 array. Problem reported by twlevo.
5908 * src/reader.c (packgram): Prepend a new sentinel before ritem.
5909 * src/lalr.c (build_relations): Rely on new sentinel.
5910 * src/gram.c (gram_free): Adjust to new sentinel.
5911
b7691f15
JD
59122006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
5913
5914 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
5915 yylookaheadNeeds. All uses updated.
5916 (yysplitStack): Rename local yynewLookaheadStatuses to
5917 yynewLookaheadNeeds.
5918 * data/glr-regression.at (Incorrect lookahead during nondeterministic
5919 GLR): In comments, change `lookahead status' to `lookahead need'.
5920
ddee1b06
PH
59212006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5922
5923 * data/glr.c (yysplitStack): A little stylistic rewrite.
5924
12f4614d
PH
59252006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5926
5927 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
5928
32c29292
JD
59292006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
5930
5931 * doc/bison.texinfo: Fix some typos.
5932 (GLR Semantic Actions): New subsection discussing special
5933 considerations because GLR semantic actions might be deferred.
5934 (Actions): Mention look-ahead usage of yylval.
5935 (Actions and Locations): Mention look-ahead usage of yylloc.
5936 (Special Features for Use in Actions): Add YYEOF entry and mention it
5937 in the yychar entry.
5938 In the yychar entry, remove mention of the local yychar case (pure
5939 parser) since this is irrelevant information when writing semantic
148d66d8 5940 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
5941 yychar is otherwise described as an external variable.
5942 In the yychar entry, don't call it the `current' look-ahead since it
5943 isn't when semantic actions are deferred.
5944 In the yychar and yyclearin entries, add note about deferred semantic
5945 actions.
5946 Add yylloc and yylval entries discussing look-ahead usage.
5947 (Look-Ahead Tokens): When discussing yychar, don't call it the
5948 `current' look-ahead, and do mention yylval and yylloc.
5949 (Error Recovery): Cross-reference `Action Features' when mentioning
5950 yyclearin.
148d66d8 5951 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
5952 look-ahead.
5953 In the yylloc and yylval entries, mention look-ahead usage.
5954
de366a2f 59552006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
5956
5957 * tests/glr-regression.at: Update copyright year to 2006.
5958
bf70fa87
JD
59592006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5960
5961 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
5962 use during nondeterministic operation to track which stacks have
5963 actually needed the current lookahead.
5964 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
5965 Allocate, deallocate, resize, and otherwise shuffle space for
5966 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
5967 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
5968 appropriately during nondeterministic operation.
5969 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
5970 members to store the current lookahead to be used by the deferred
5971 user action.
5972 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
5973 from which the RHS is taken. Set the lookahead members of the new
5974 yySemanticOption according to the lookahead status for stack yyk.
5975 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
5976 yyaddDeferredAction.
5977 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
5978 members of yySemanticOption before invoking yyuserAction, and then set
5979 them back to their current values afterward.
5980 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
5981 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
5982 * tests/glr-regression.at: Remove `.' from the ends of recent test case
5983 titles for consistency.
5984 (Leaked merged semantic value if user action cuts parse): In order to
5985 suppress lint warnings, use arguments in merge function, and assign
5986 char value < 128 in main.
5987 (Incorrect lookahead during deterministic GLR): New test case.
5988 (Incorrect lookahead during nondeterministic GLR): New test case.
5989
05449a2c
JD
59902006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5991
de366a2f 5992 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
5993 !yyvaluep as signal that no semantic value is available to print.
5994 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
5995 to print a semantic value.
5996
4158e0a1 59972006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 5998
4158e0a1
JD
5999 * tests/glr-regression.at: For consistency with my newer test cases,
6000 don't thank myself.
6001
d659304d
JD
60022006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6003
6004 * data/glr.c (yyresolveValue): When merging semantic options, if at
6005 least one user action succeeds but a later one cuts the parse, then
6006 destroy the semantic value before returning rather than leaking it.
6007 (yyresolveStates): If a user action cuts the parse and thus
6008 yyresolveValue fails, ignore the (unset) semantic value rather than
6009 corrupting the yyGLRState, and empty the semantic options list since
6010 the user actions should have called all necessary destructors.
6011 Simplify code with YYCHK.
6012 * tests/glr-regression.at (Corrupted semantic options if user action
6013 cuts parse): New test case.
6014 (Undesirable destructors if user action cuts parse): New test case.
6015 Before applying any of this patch, this test case never actually failed
6016 for me... but only because the corrupted semantic options usually
6017 masked this bug.
6018 (Leaked merged semantic value if user action cuts parse): New test
6019 case.
6020
6ec2c0f2
AD
60212006-01-05 Akim Demaille <akim@epita.fr>
6022
6023 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
6024
1b9c21fb
PE
60252006-01-04 Paul Eggert <eggert@cs.ucla.edu>
6026
6027 * data/c.m4 (b4_c_modern): New macro, with a new provision for
6028 _MSC_VER. Problem reported by Cenzato Marco.
6029 (b4_c_function_def): Use it.
6030 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
6031 b4_c_modern.
6032 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
6033 than rolling our own.
6034
84866159
AD
60352006-01-04 Akim Demaille <akim@epita.fr>
6036
6037 Also warn about non-used mid-rule values.
6038 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
6039 member.
6040 (symbol_list_new): Adjust.
6041 * src/reader.c (symbol_typed_p): New.
6042 (grammar_rule_check): Use it.
6043 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
6044 Check its rule.
6045 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
6046 Use it.
6047 * tests/actions.at (Exotic Dollars): Adjust.
6048
378f4bd8
AD
60492006-01-04 Akim Demaille <akim@epita.fr>
6050
6051 * src/reader.c (grammar_midrule_action): If $$ is set in a
6052 mid-rule, move the `used' bit to its lhs.
6053 * tests/input.at (Unused values): New.
6054 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
6055
e2a21b6f
PE
60562006-01-03 Paul Eggert <eggert@cs.ucla.edu>
6057
54662697
PE
6058 * doc/bison.texinfo (Bison Options): Say more accurately what
6059 --yacc does.
6060 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
6061 about declarations in the grammar when in Yacc mode, as POSIX does
6062 not require a diagnostic when the grammar uses extensions.
6063
6064 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
6065
073f9288
PE
6066 Warn about dubious constructions like "%token T T".
6067 Reported by twlevo.
6068 * src/symtab.h (struct symbol.declared): New member.
6069 * src/symtab.c (symbol_new): Initialize it to false.
6070 (symbol_class_set): New arg DECLARING, specifying whether
6071 this is a declaration that we want to warn about, if there
6072 is more than one of them. All uses changed.
6073
1221b78a
PE
6074 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
6075 Allow multiple %union directives, whose contents concatenate.
6076 * src/parse-gram.y (grammar_declaration): Likewise.
6077 Use muscle_code_grow, so that we don't need stype_line any more.
6078 All uses changed.
6079
6080 * src/muscle_tab.c (muscle_grow): Fix comment.
6081
e2a21b6f
PE
6082 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
6083 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
6084 Update copyright year to 2006.
6085
8f7e3cf9
AD
60862006-01-03 Akim Demaille <akim@epita.fr>
6087
6088 Have glr.cc pass (some of) the calc.at tests.
6089 * data/glr.cc (b4_parse_param_orig): New.
6090 (b4_parse_param): Improve its definition, and bound it more
6091 clearly in the skeleton.
6092 (b4_epilogue): Append, instead of prepending, in order to keep
6093 #line consistency.
6094 Simplify the generation of auxiliary functions: locations and
6095 purity are mandated.
6096 (b4_global_tokens_and_yystype): Honor it.
6097 * data/location.cc (c++.m4): Don't include it.
6098 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
6099 and AT_SKEL_CC_IF.
6100 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
6101 AT_LALR1_CC_IF.
6102 Be sure to initialize the first position's filename.
6103 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
6104 mandated anyway.
6105 (AT_CHECK_CALC_GLR_CC): New.
6106 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
6107
3953ed88
AD
61082006-01-02 Akim Demaille <akim@epita.fr>
6109
6110 * src/output.c (output_skeleton): Don't hard wire the inclusion of
6111 c.m4.
0a96ba81 6112 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
6113 * data/glr.cc: Do not include stack.hh.
6114
9ecafbbf
AD
61152006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6116
6117 * data/glr.c: Reformat whitespace with tabs.
6118 (b4_lpure_formals): Remove this unused m4 macro.
6119 * tests/cxx-type.at: Reformat whitespace with tabs.
6120 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
6121 since it's a member. Rename type to isNterm for clarity.
6122
c4d497a0
AD
61232005-12-29 Akim <akim@sulaco.local>
6124
6125 Let glr.cc catch up with symbol_value_print.
6126 * data/glr.cc (b4_yysymprint_generate): Replace by...
6127 (b4_yy_symbol_print_generate): this.
6128 (yy_symbol_print, yy_symbol_value_print): Declare them.
6129
4517da37
PE
61302005-12-28 Paul Eggert <eggert@cs.ucla.edu>
6131
6132 * src/location.h (boundary): Note that a line or column equal
6133 to INT_MAX indicates an overflow.
6134 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
6135 (rule_length_overflow, increment_rule_length, add_column_width):
6136 New functions.
6137 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
6138 (<SC_BRACED_CODE>"}"):
6139 Use increment_rule_length rather than incrementing it by hand.
6140 (adjust_location, handle_syncline): Diagnose overflow.
6141 (handle_action_dollar, handle_action_at):
6142 Fix bug with monstrosities like $-2147483648.
6143 Remove now-unnecessary checks.
6144 (scan_integer): Verify assumptions and remove now-unnecessary checks.
6145 (convert_ucn_to_byte): Verify assumptions.
6146 (handle_syncline): New arg LOC. All callers changed.
6147 Don't store through a value derived from char const * pointer.
6148
6149 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
6150 GCC warnings.
6151
e3233bf6
PE
61522005-12-27 Paul Eggert <eggert@cs.ucla.edu>
6153
6154 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
6155 Remove unnecessary forward static decls.
6156
8f3596a6
AD
61572005-12-27 Akim Demaille <akim@epita.fr>
6158
6159 * src/reader.c (grammar_current_rule_check): Also check that $$
6160 is used.
6161 Take the rule to check as argument, hence rename as...
6162 (grammar_rule_check): this.
6163 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
6164 Rename as...
6165 (grammar_rule_begin, grammar_rule_end): these, for consistency.
6166 (grammar_midrule_action, grammar_symbol_append): Now static.
6167 * tests/torture.at (input): Don't rely on the default action
6168 being always performed.
6169 * tests/calc.at: "Set" $$ even when the action is "cut" with
6170 YYERROR or other.
6171 * tests/actions.at (Exotic Dollars): Instead of using unused
6172 values, check that the warning is issued.
6173
721be13c
PE
61742005-12-22 Paul Eggert <eggert@cs.ucla.edu>
6175
6176 * NEWS: Improve wording for unused-value warnings.
6177
a0af42fc
AD
61782005-12-22 Akim Demaille <akim@epita.fr>
6179
6180 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
6181 (b4_yysymprint_generate): Rename as...
6182 (b4_yy_symbol_print_generate): this.
6183 Generate yy_symbol_print instead of yysymprint.
6184 Generate also yy_symbol_value_print, and use it.
6185
affac613
AD
61862005-12-22 Akim Demaille <akim@epita.fr>
6187
721be13c 6188 * NEWS: Warn about unused values.
affac613
AD
6189 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
6190 a `used' member.
6191 (symbol_list_n_get, symbol_list_n_used_set): New.
6192 (symbol_list_n_type_name_get): Use symbol_list_n_get.
6193 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
6194 * src/reader.c (grammar_current_rule_check): Check that values are
6195 used.
6196 * src/symtab.c (symbol_print): Accept 0.
6197 * tests/existing.at: Remove the type information.
6198 Empty the actions.
6199 Remove useless actions (beware of mid-rule actions: perl -000
6200 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
6201 * tests/actions.at (Exotic Dollars): Use unused values.
6202 * tests/calc.at: Likewise.
6203 * tests/glr-regression.at (No users destructors if stack 0 deleted):
6204 Likewise.
6205
6206 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
6207 rule_useful_p.
6208
9d9b8b70
PE
62092005-12-21 Paul Eggert <eggert@cs.ucla.edu>
6210
8bb4c753
PE
6211 Undo 2005-12-01 tentative license wording change. The wording is
6212 still being reviewed by the lawyers, and we don't want to wait for
6213 them before publishing a test release. For now, revert to the
6214 previous wording.
6215 * NEWS: Undo 2005-12-01 change.
6216 * data/glr.c: Revert to previous license wording.
6217 * data/glr.cc: Likewise.
6218 * data/lalr1.cc: Likewise.
6219 * data/location.cc: Likewise.
6220 * data/yacc.c: Likewise.
6221
9d9b8b70
PE
6222 * NEWS: Reword %destructor vs YYABORT etc.
6223 * data/glr.c: Use American spacing, for consistency.
6224 * data/glr.cc: Likewise.
6225 * data/lalr1.cc: Likewise.
6226 * data/yacc.c: Likewise.
6227 * data/yacc.c: Reformat comments slightly.
6228 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
6229 for consistency. Fix some spelling errors and reword recently-included
6230 text slightly.
6231 * tests/cxx-type.at: Cast results of malloc, for C++.
6232
2c3b392a
AD
62332005-12-21 Joel E. Denny <address@hidden>
6234
6235 * tests/cxx-type.at: Construct a tree, count the parents of shared
6236 nodes, and free each node once and only once. Previously, the memory
6237 for semantic values was leaked instead.
6238
d6cff4dc
AD
62392005-12-21 Joel E. Denny <address@hidden>
6240
6241 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
6242 (yylval, yylloc): If pure, #define to yystackp->yyval and
6243 yystackp->yyloc similar to yychar and yynerrs.
6244 (yyparse): If pure, remove local yylval and yylloc. Add local
6245 yystackp to accommodate pure definitions of yylval and yylloc.
6246 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
6247 yylvalp and yyllocp to &yylval and &yylloc.
6248 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
6249 namespace. Previously, nerrs and char were missing, but lval and lloc
6250 weren't necessary.
6251 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
6252 yylvalp and yyllocp parameters since, if pure, these are now always
6253 accessible through yystackp. If not pure, they are still accessible
6254 globally.
6255 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
6256 `if (YYID (N))' to pacify lint.
6257
a85284cf
AD
62582005-12-21 Akim Demaille <akim@epita.fr>
6259
6260 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
6261 destroy the RHS symbols of a rule.
6262 * data/yacc.c (yylen): Initialize to 0.
6263 Keep its value to the number of items to possibly shift.
6264 In particular, a regular successful parse that ends on YYFINAL by
6265 a (internal) YYACCEPT must not have yylen != 0.
6266 (yyerrorlab, yyreturn): Pop the RHS.
6267 Reorder a bit to emphasize the `shifting' bits of code.
6268 (YYPOPSTACK): Now accept a number of items to pop.
6269 * data/lalr1.cc: Likewise.
6270 * data/glr.c: Formatting changes.
6271 Use goto instead of fall through.
6272 * doc/bison.texinfo (Destructor Decl): Complete.
6273
d508c281
JMG
62742005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6275
6276 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6277 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
6278 * djgpp/config.bat: Replace every occurence of the file name
6279 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
6280 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
6281 * djgpp/config.sed: Replace every occurence of the file name
6282 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
6283 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
6284 * djgpp/djunpack.bat: DJGPP specific file.
6285 * djgpp/fnchange.lst: DJGPP specific file.
6286 * djgpp/README.in: Add new information about how to unpack the bison
6287 source on MSDOS and other systems which have 8.3 file name restrictions
6288 using djunpack.bat and fnchange.lst.
6289
3e7a2cd9
PE
62902005-12-12 Paul Eggert <eggert@cs.ucla.edu>
6291
6292 * bootstrap (build_cvs_prefix): Remove; unused.
6293 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
6294 when getting gnulib.
6295
62962005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
6297
6298 * data/glr.c: Reorder typedef declarations for structs to match order
6299 of struct declarations.
6300 Rename yystack everywhere to yystackp except in yyparse where it's not
6301 a pointer.
6302 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
6303 consistency.
6304 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
6305 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
6306 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
6307 lint.
6308
877519f8
PE
63092005-12-09 Paul Eggert <eggert@cs.ucla.edu>
6310
0eca5a39
PE
6311 * tests/sets.at (Accept): Fix typos in regular expression used to
6312 sed out the final state number.
6313
2cec9080
PE
6314 Work around portability problem on Solaris 10: flex-generated
6315 files include <stdio.h> before <config.h>, which messes up
6316 because the latter defines __EXTENSIONS__. Address the problem
6317 by creating two new little files that include <config.h> first,
6318 then include the flex-generated files. Rewrite everyone else
6319 to include <config.h> first, as well.
6320 * lib/timevar.c: Always include "config.h".
6321 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
6322 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
6323 (EXTRA_bison_SOURCES): New macro.
6324 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
6325 * src/system.h: Don't include config.h.
6326 * src/LR0.c: Include <config.h> first.
6327 * src/assoc.c: Likewise.
6328 * src/closure.c: Likewise.
6329 * src/complain.c: Likewise.
6330 * src/conflicts.c: Likewise.
6331 * src/derives.c: Likewise.
6332 * src/files.c: Likewise.
6333 * src/getargs.c: Likewise.
6334 * src/gram.c: Likewise.
6335 * src/lalr.c: Likewise.
6336 * src/location.c: Likewise.
6337 * src/main.c: Likewise.
6338 * src/muscle_tab.c: Likewise.
6339 * src/nullable.c: Likewise.
6340 * src/output.c: Likewise.
6341 * src/parse-gram.y: Likewise.
6342 * src/print.c: Likewise.
6343 * src/print_graph.c: Likewise.
6344 * src/reader.c: Likewise.
6345 * src/reduce.c: Likewise.
6346 * src/relation.c: Likewise.
6347 * src/state.c: Likewise.
6348 * src/symlist.c: Likewise.
6349 * src/symtab.c: Likewise.
6350 * src/tables.c: Likewise.
6351 * src/uniqstr.c: Likewise.
6352 * src/vcg.c: Likewise.
6353
877519f8
PE
6354 * src/parse-gram.y: Fix minor problems uncovered by lint.
6355 (current_lhs, current_lhs_location): Now static.
6356 (current_assoc): Remove unused variable.
6357
6358 Cleanups so that Bison-generated parsers have less lint.
6359 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
6360 Prepend /*ARGSUSED*/, for lint's sake.
6361 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
6362 definition if 'lint' is defined.
6363 (YYID): New macro (or function, if lint).
6364 All uses of /*CONSTCOND*/0 replaced by YYID(0).
6365 * data/yacc.c: Likewise.
6366 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
6367 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
6368 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
6369 is C++ only.
6370 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
6371 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
6372 Use YYID(0) rather than 0, for lint.
6373 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
6374 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
6375
f5228370
PE
63762005-12-07 Paul Eggert <eggert@cs.ucla.edu>
6377
6378 * tests/glr-regression.at
6379 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6380 Close memory leak reported by twlevo.
6381
69ce078b
PE
63822005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
6383
6ff99711
PE
6384 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
6385 all stacks.
6386 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
6387 * tests/glr-regression.at (No users destructors if stack 0 deleted):
6388 New test case.
6389 (Duplicated user destructor for lookahead): This test now is expected
6390 to succeed.
6391
af3412cd
PE
63922005-12-01 Paul Eggert <eggert@cs.ucla.edu>
6393
32b5b719 6394 * NEWS: Document the following change.
af3412cd
PE
6395 * data/yacc.c: Say "parser skeleton" rather than "file", since
6396 it's no longer just a file.
6397 * data/glr.c: Grant a special exception for C GLR parsers, that
6398 reads like the already-existing exception for C LALR(1) parsers.
6399 * data/glr.cc: Likewise.
6400 * data/lalr1.cc: Likewise.
6401 * data/location.cc: Likewise.
6402 * data/yacc.c: Reword the "written by" statement to clarify that
6403 it was the parser skeleton, not the entire output file.
6404 * data/glr.c: Written by Paul Hilfinger.
6405 * data/glr.cc: Written by Akim Demaille.
6406 * data/lalr1.cc: Likewise.
6407
035aa4a0
PE
64082005-11-18 Paul Eggert <eggert@cs.ucla.edu>
6409
d9963c85
PE
6410 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
6411 Fix typos in previous change that broke 'make check'.
6412 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
6413 supported in C.
6414 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
6415 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
6416 We can revert this once things settle down.
6417
035aa4a0
PE
6418 * src/conflicts.c (conflicts_print): Don't print file name twice
6419 when %expect fails because there were no conflicts.
6420 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
6421 change.
6422 * tests/conflicts.at (%expect not enough, %expect too much):
6423 (%expect with reduce conflicts): Adjust to new behavior.
6424
64252005-11-18 Akim Demaille <akim@epita.fr>
6426
6427 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
6428 errors.
6429 * NEWS: Document this.
6430 * doc/bison.texinfo (Expect Decl): Likewise.
6431
d1ff7a7c
AD
64322005-11-16 Akim Demaille <akim@epita.fr>
6433
6434 Generalize the display of semantic values and locations in traces.
6435 * data/glr.c (yy_reduce_print): Fix indices (again).
6436 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
6437 literal integers.
6438 * data/lalr1.cc (yyreduce_print): Rename as...
6439 (yy_reduce_print): this.
6440 Display values and locations.
6441 * data/yacc.c (yy_reduce_print): Likewise.
6442 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
6443 (yysymprint): Move higher to be visible from yy_reduce_print).
6444 (yyparse): Adjust.
6445 * tests/calc.at: Adjust the expected length of the traces.
6446
6de5398d
AD
64472005-11-14 Akim Demaille <akim@epita.fr>
6448
6449 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
6450 from 1 to N, while values and location start at 0.
6451 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
6452
a1373f55
AD
64532005-11-14 Akim Demaille <akim@epita.fr>
6454
6455 * data/glr.c (yy_reduce_print): Fix the $ number.
6456
613d8952
AD
64572005-11-14 Akim Demaille <akim@epita.fr>
6458
6459 "Use" parse parameters.
6460 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
6461 * data/glr.c, data/glr.cc: Use them.
6462 * data/glr.c (YYUSE): Have a C++ definition that supports
6463 non-pointer types.
6464
b2741627
AD
64652005-11-14 Akim Demaille <akim@epita.fr>
6466
6467 * data/glr.c (yyexpandGLRStack): Declare only if defined.
6468
5059b5c8
AD
64692005-11-14 Akim Demaille <akim@epita.fr>
6470
42249483
AD
6471 * data/glr.cc: New.
6472 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 6473
4626a15d
AD
64742005-11-12 Akim Demaille <akim@epita.fr>
6475
6476 Let position and location be PODs.
6477 * data/location.cc (position::initialize, location::initialize): New.
6478 (position::position, location::location): Define only if
6479 b4_location_constructors is defined.
6480 * data/lalr1.cc (b4_location_constructors): Define it for backward
6481 compatibility.
6482 * doc/bison.texinfo (Initial Action Decl): Use initialize.
6483
64842005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
6485
6486 * data/lalr1.cc: Move the body of the ctor and dtor into the
6487 parser file (instead of the header).
6488 Wrap the implementations in a "namespace yy".
6489
64902005-11-12 Akim Demaille <akim@epita.fr>
6491
6492 Have glr.c include its header file when created.
6493 * data/glr.c (b4_shared_declarations): New.
6494 Output them verbatim in the parser if !%defines, otherwise
6495 output then in the header file, and include it instead.
6496
1989d947
AD
64972005-11-11 Akim Demaille <akim@epita.fr>
6498
6499 * data/glr.c: Comment changes.
6500
65012005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
6502
6503 When yydebug, report semantic and location values for reductions.
6504 * data/glr.c (yy_reduce_print): Report the semantic values and the
6505 locations.
6506 (YY_REDUCE_PRINT): Adjust.
6507 (yyglrReduce): Use them.
6508 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
6509 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
6510 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
6511 traces.
6512
02998094
AD
65132005-11-10 Akim Demaille <akim@epita.fr>
6514
6515 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
6516 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
6517 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
6518
5210672f
PE
65192005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
6520
6521 * m4/cxx.m4, examples/Makefile.am: Don't build
6522 examples/calc++ if no C++ compiler is available. (trivial change)
6523
a8991a1d
AD
65242005-11-09 Akim Demaille <akim@epita.fr>
6525
6526 * src/scan-skel.l: Use a couple of asserts.
6527
36b5e963
AD
65282005-11-03 Akim Demaille <akim@epita.fr>
6529
6530 In some (weird) cases, the final state number is incorrect.
6531 Reported by Alexandre Duret-Lutz.
6532 * src/LR0.c (state_list_append): Remove the computation of
6533 final_state.
6534 (save_reductions): Do it here.
6535 (get_state): Alpha conversion.
6536 (generate_states): Use a for loop.
6537 * src/gram.h (item_number_is_rule_number)
6538 (item_number_is_symbol_number): New.
6539 * src/state.c: Use assert.
6540 * src/system.h: Include assert.h.
6541 * tests/sets.at (Accept): New.
6542
44e7ead1
PH
65432005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6544
6545 * data/glr.c (yyfill): Adjust comment.
36b5e963 6546 (yyresolveAction): Initialize default location properly
44e7ead1
PH
6547 for empty right-hand sides.
6548 (yydoAction): Ditto.
6549 Add comment explaining apparently dead code.
36b5e963
AD
6550 * tests/glr-regression.at
6551 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 6552 New test.
36b5e963 6553
e10a80ee
PE
65542005-10-30 Paul Eggert <eggert@cs.ucla.edu>
6555
6556 * bootstrap (cleanup_gnulib): New function. Use it to clean up
6557 gnulib when interrupted. This fixes some race conditions and
6558 works around some portability problems (one noted by Paul
6559 Hilfinger).
6560
067b32ee
AD
65612005-10-22 Akim <akim@epita.fr>
6562
6563 * Makefile.cfg: Adjust to config -> build-aux.
6564 Reported by twledo.
6565
4b367315
AD
65662005-10-21 Akim Demaille <akim@epita.fr>
6567
6568 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
6569 the %parse-params.
6570 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
6571 * data/yacc.c (b4_Pure_if): Rename as...
6572 (b4_yacc_pure_if): this.
6573 (YY_SYMBOL_PRINT, yyparse): Adjust.
6574 * doc/bison.texinfo: Formatting changes.
6575
24cc23d9
AD
65762005-10-21 Akim Demaille <akim@epita.fr>
6577
6578 Finish the transition config -> build-aux.
6579 * configure.ac, Makefile.am: Use build-aux.
6580 * config/prev-version, config/announce-gen, config/Makefile.am:
6581 Move to...
6582 * build-aux/prev-version, build-aux/announce-gen,
6583 * build-aux/Makefile.am: here.
6584
d4476375
AD
65852005-10-14 Akim Demaille <akim@epita.fr>
6586
6587 * examples/calc++/test: Use set -x only when VERBOSE.
6588
302c0aee
PE
65892005-10-13 Paul Eggert <eggert@cs.ucla.edu>
6590
6591 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
6592 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
6593
7625ec2c
AD
65942005-10-13 Akim Demaille <akim@epita.fr>
6595
6596 * src/scan-skel.l: Output the base name parts of the parser and
6597 header file names.
302c0aee 6598 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
6599 additional checks.
6600 Use this to exercise C++ outputs in subdirs.
6601 Reported by Oleg Smolsky.
6602
ba0fe3c7
PE
66032005-10-12 Paul Eggert <eggert@cs.ucla.edu>
6604
6605 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
6606 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
6607 Problem reported by John P. Hartmann.
6608 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
6609 already defined it.
6610
9b8a5ce0
AD
66112005-10-12 Akim Demaille <akim@epita.fr>
6612
6613 * src/parse-gram.y (version_check): Exit 63 to please missing
6614 (stands for "version mismatch).
6615 * tests/input.at, doc/bison.texinfo: Adjust.
6616
4f6e011e
PE
66172005-10-10 Paul Eggert <eggert@cs.ucla.edu>
6618
6619 Work around portability problems with Visual Age C compiler
6620 (xlc and xlC_r) reported by John P. Hartmann.
6621 * data/location.cc (initial_column, initial_line): Remove.
6622 All uses replaced by 0 and 1.
6623 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
6624 that xlc complains about.
6625 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 6626 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 6627 as __STDC__.
4d7aa45e
PE
6628 * data/yacc.c (YYMODERN_C): New macro, which also looks at
6629 __STDC_VERSION__. Use it everywhere instead of looking at
6630 __STDC__ and __cplusplus.
4f6e011e 6631
a1b3bf8c
AD
66322005-10-10 Akim Demaille <akim@epita.fr>
6633
6634 * examples/calc++/test: Be quiet unless VERBOSE.
6635
412e44aa
PE
66362005-10-05 Paul Eggert <eggert@cs.ucla.edu>
6637
2a4647a3
PE
6638 * data/c.m4 (yydestruct, yysymprint):
6639 Use YYUSE instead of casting to void.
6640 * data/glr.c (YYUSE): New macro.
6641 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6642 Use it instead of rolling our own.
6643 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6644 (YYCHK1):
6645 Use /*CONSTCOND*/ to suppress lint warnings.
6646 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6647 (YY_STACK_PRINT): Use 'false' not '0'.
6648 (YYUSE): New macro.
6649 (yysymprint_, yydestruct_): Use it instead of rolling our own.
6650 * data/yacc.c (YYUSE): New macro.
6651 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
6652 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
6653 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
6654
6655
412e44aa
PE
6656 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
6657 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
6658
88c6637f
PE
66592005-10-04 Paul Eggert <eggert@cs.ucla.edu>
6660
2f4f028d
PE
6661 Undo the parts of the unlocked-I/O change that substituted
6662 putc or puts for printf. This might hurt performance a bit,
6663 but some people prefer the printf style.
6664 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
6665 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
6666 All uses replaced by YYFPRINTF and YYDPRINTF.
6667 * data/yacc.c: Likewise.
6668 * lib/bitset.c (bitset_print): Likewise.
6669 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
6670 putc and puts.
6671 * lib/lbitset.c (debug_lbitset): Likewise.
6672 * src/closure.c (print_firsts, print_fderives): Likewise.
6673 * src/gram.c (grammar_dump): Likewise.
6674 * src/lalr.c (look_ahead_tokens_print): Likewise.
6675 * src/output.c (escaped_output): Likewise.
6676 (user_actions_output): Break apart two printfs.
6677 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
6678 * src/reduce.c (reduce_print): Likewise.
6679 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6680 * src/system.h: Include unlocked-io.h rathe than stdio.h.
6681
88c6637f
PE
6682 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6683 Use assignments rather than casts-to-void to suppress
6684 unused-variable warnings. This pacifies 'lint'.
6685 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
6686 unused-variable warnings.
6687
fb32e373
JMG
66882005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6689
6690 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6691
edb8f44f
PE
66922005-10-02 Paul Eggert <eggert@cs.ucla.edu>
6693
fb9c0b33
PE
6694 Use unlocked I/O for a minor performance improvement on hosts like
6695 GNU/Linux and Solaris that support unlocked I/O. The basic idea
6696 is to use the gnlib unlocked-io module, and to prefer putc and
6697 puts to printf when either will work (since the latter doesn't
6698 come in an unlocked flavor).
6699 * bootstrap (gnulib_modules): Add unlocked-io.
6700 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
6701 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
6702 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
6703 and similarly for puts and putc and printf.
6704 * data/yacc.c: Likewise.
6705 * lib/bitset.c (bitset_print): Likewise.
6706 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
6707 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
6708 to printf.
6709 * lib/lbitset.c (debug_lbitset): Likewise.
6710 * src/closure.c (print_firsts, print_fderives): Likewise.
6711 * src/gram.c (grammar_dump): Likewise.
6712 * src/lalr.c (look_ahead_tokens_print): Likewise.
6713 * src/output.c (escaped_output): Likewise.
6714 (user_actions_output): Coalesce two printfs.
2f4f028d 6715 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
6716 * src/reduce.c (reduce_print): Likewise.
6717 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 6718 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 6719
edb8f44f
PE
6720 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
6721 this confuses xgettext.
6722
b50d2359
AD
67232005-10-02 Akim Demaille <akim@epita.fr>
6724
6725 * bootstrap (gnulib_modules): Add strverscmp.
6726 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
6727 * m4/.cvsignore: Add strverscmp.m4.
6728 * src/parse-gram.y (%require): New token, new rule.
6729 (version_check): New.
6730 * src/scan-gram.l (%require): Adjust.
6731 * tests/input.at (AT_REQUIRE): New.
6732 Use it.
6733 * doc/bison.texinfo (Require Decl): New.
6734 (Calc++ Parser): Use %require.
6735
21667f64
AD
67362005-10-02 Akim Demaille <akim@epita.fr>
6737
6738 * data/location.cc: New.
6739
2b81e969
AD
67402005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
6741 Akim Demaille <akim@epita.fr>
6742
6743 Make sure -odir/foo.cc creates dir/location.hh etc.
6744 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
6745 (spec_file_prefix, spec_verbose_file, spec_graph_file)
6746 (spec_defines_file): Now const.
6747 (dir_prefix): New.
6748 (short_base_name): Remove.
6749 * src/files.c: Adjust.
6750 (dirname.h): Include.
6751 (base_name): Don't prototype it.
6752 (finput): Remove, duplicates gram_in.
6753 (full_base_name, short_base_name): Replace by...
6754 (all_but_ext, all_but_tab_ext): these.
6755 (compute_base_names): Rename as...
6756 (compute_file_name_parts): this.
6757 Update to compute the new variables, including dir_prefix.
6758 Adjust dependencies.
6759 * src/output.c (prepare): Output them.
6760 * src/reader.c: Adjust to use gram_in, not finput.
6761 * src/scan-skel.l (@dir_prefix@): New.
6762
ad6a9b97
JMG
67632005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6764
6765 * lib/subpipe.c: New function end_of_output_subpipe() added
6766 to allow support for non-posix systems. This is a no-op function
6767 for posix systems.
6768
6769 * lib/subpipe.h: New function end_of_output_subpipe() added
6770 to allow support for non-posix systems. This is a no-op function
6771 for posix systems.
6772
6773 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
6774 handle the lack of pipe/fork functionality on non-posix systems.
6775
6776 * djgpp/Makefile.maint: DJGPP specific file.
6777
6778 * djgpp/README.in: DJGPP specific file.
6779
6780 * djgpp/config.bat: DJGPP specific configuration file.
6781
6782 * djgpp/config.sed: DJGPP specific configuration file.
6783
6784 * djgpp/config.site: DJGPP specific configuration file.
6785
6786 * djgpp/config_h.sed: DJGPP specific configuration file.
6787
6788 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
6789
6790 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
6791
fc695704
AD
67922005-10-02 Akim Demaille <akim@epita.fr>
6793
6794 * data/location.cc: New, extract from...
6795 * data/lalr1.cc: here.
6796 (location.hh): Include it after the user prologue, in case the
6797 filename type is defined by the user.
6798 Forward declation location and position before the pre-prologue.
6799 (yyresult_): Rename as...
6800 (yyresult): this, it's a local variable, not an attribute.
6801 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
6802
68032005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
6804
6805 * examples/extexi: Restore the #line generation.
6806
fb9712a9
AD
68072005-09-30 Akim Demaille <akim@epita.fr>,
6808 Alexandre Duret-Lutz <adl@gnu.org>
6809
6810 Move the token type and YYSTYPE in the parser class.
6811 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
6812 (parser::token): New, from the moved free definition of tokens.
6813 (parser::semantic_value): Now a full definition instead of an
6814 indirection to YYSTYPE.
6815 (b4_post_prologue): No longer included in the header file, but
6816 in the implementation file.
6817 * doc/bison.texi (C+ Language Interface): Update.
6818 * src/parse-gram.y: Support unary %define.
6819 * tests/actions.at: Define global_tokens_and_yystype for backward
6820 compatibility until we update the tests.
6821 * tests/calc.at: Idem.
6822 (first_line, first_column, last_line, last_column): Define for lalr1.cc
6823 to simplify the code.
6824
55f0c7b1
PE
68252005-09-29 Paul Eggert <eggert@cs.ucla.edu>
6826
6827 Port to SunOS 4.1.4, which lacks strtoul and strerror.
6828 Ah, the good old days! Problem reported by Peter Klein.
6829 * bootstrap (gnulib_modules): Add strerror, strtoul.
6830 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
6831 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
6832
fb9712a9 68332005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
6834
6835 * data/c.m4 (b4_error_verbose_if): New.
6836 * data/lalr1.cc: Use it.
6837 (YYERROR_VERBOSE_IF): Remove.
6838 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
6839 parser members, replaced by...
6840 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
6841 local variables.
6842 (yysyntax_error_): Takes the state number as argument.
6843 (yyreduce_print_): Use the argument yyrule, not the former
6844 attribute yyn_.
6845
8a6f72f3
PE
68462005-09-26 Paul Eggert <eggert@cs.ucla.edu>
6847
6848 * bootstrap (gnulib_modules): Add verify.
6849 * lib/.cvsignore: Add verify.h.
6850 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
6851 * src/system.h (verify): Remove.
6852 Include verify.h instead.
6853 * src/tables.c (tables_generate): Use new API for 'verify'.
6854
0d50976f
PE
68552005-09-21 Paul Eggert <eggert@cs.ucla.edu>
6856
ebc3737e
PE
6857 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
6858 local variables whose names begin with 'yy'.
6859 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
6860 Trivial changes from Joel E. Denny.
6861
0d50976f
PE
6862 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
6863 it itself.
6864 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
6865 don't use alloca any more.
6866
6867 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
6868 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 6869 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
6870 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
6871 to match yacc.c, to test more hosts.
6872
a05b79df
PE
68732005-09-20 Paul Eggert <eggert@cs.ucla.edu>
6874
55289366
PE
6875 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
6876 doesn't affect behavior.
6877 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
6878 Solaris, AIX, MSC.
6879 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
6880 This works a bit better with glibc, if user code has already included
6881 stdlib.h.
6882 * doc/bison.texinfo (Bison Parser): Document that users can't
6883 arbitrarily use malloc and free for other purposes. Document
6884 that <alloca.h> and <malloc.h> might be included.
6885 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
6886 user must declare alloca.
6887
a05b79df
PE
6888 * HACKING (release): Forwarn the Translation Project about
6889 stable releses.
6890
3ab2ca22
AD
68912005-09-20 Akim Demaille <akim@epita.fr>
6892
6893 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
6894
a9739e7c
PE
68952005-09-19 Paul Eggert <eggert@cs.ucla.edu>
6896
a702593e
PE
6897 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
6898 (YYSTACK_ALLOC_MAXIMUM): Use it.
6899 (yysyntax_error): New function.
6900 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
6901 multiple syntax errors are reported, and alloca is being used.
6902 Instead, reallocate buffers twice as big each time, so that
6903 we waste at most half the allocated memory. Start with a small
6904 (128-byte) buffer that will suffice in most cases anyway.
6905 Use yysyntax_error to do most of the work.
6906
6907 * doc/bison.texinfo (Error Reporting, Table of Symbols):
6908 yynerrs is the number of errors reported, not the number of
6909 errors encountered.
6910
a9739e7c
PE
6911 * tests/glr-regression.at (Duplicated user destructor for lookahead):
6912 Mark it as expected to fail.
6913 Cast result of malloc; problem reported by twlevo@xs4all.nl.
6914 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
6915 Don't start user-code symbols with "yy", to avoid name space problems.
6916
f479c6c6
AD
69172005-09-19 Akim Demaille <akim@epita.fr>
6918
6919 Remove the traits, failed experiment.
6920 It never proved useful, and anyway because of the current
6921 definition, it was not possible to have several specialization of
6922 this traits, making it useless.
6923 * data/lalr1.cc (yy:traits): Remove.
6924 Inline its definitions in the parser class.
6925
e2586f82
AD
69262005-09-19 Akim Demaille <akim@epita.fr>
6927
6928 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
6929 least Mac OSX with a /usr/local install of gettext.
6930
2e8cf949
AD
69312005-09-19 Akim Demaille <akim@epita.fr>
6932
6933 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
6934 and yytoken for similarity with the other skeletons.
6935
c7fb0b90
AD
69362005-09-19 Akim Demaille <akim@epita.fr>
6937
4e26c69e 6938 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 6939
1bd0deda
PE
69402005-09-16 Paul Eggert <eggert@cs.ucla.edu>
6941
6942 * NEWS: Version 2.1.
6943
6944 * NEWS: Remove notice of yytname change, since it was never in an
6945 official release.
6946 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
6947 diagnostic.
6948 * src/output.c (prepare): Likewise.
6949 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
6950 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
6951 is not defined. This is an awful hack, but it's enough for now.
6952 All callers changed.
6953 * tests/glr-regression-at (make_value): Args are const pointers now,
6954 to avoid GCC warning.
6955 (Duplicated user destructor for lookahead): New test. Currently
6956 skipped. It fails on my host but I'm not sure it'll always fail.
6957
69582005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
6959
6960 * src/symtab.h (struct symbol): Declare the printer and destructor
6961 as const, to avoid accidental calls to free.
6962 (symbol_destructor_set, symbol_printer_set): Adjust.
6963 * src/symtab.c: Adjust.
6964
1bd0deda 69652005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
6966
6967 * data/c.m4 (b4_token_enums): New.
6968 (b4_token_defines): Rename as...
6969 (b4_token_enums_defines): this.
6970 (b4_token_defines): New, output only the #defines.
6971 * data/yacc.c, data/glr.c: Adjust.
6972 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
6973 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
6974 as default values.
6975
dbcdae2d
AD
69762005-09-16 Akim Demaille <akim@epita.fr>
6977
6978 * data/lalr1.cc (yylex_): Remove, inline its code.
6979 (yyreport_syntax_error_): Remove, replaced by...
6980 (yysyntax_error_): this which returns a string and leaves to the
6981 caller the call to the users' error function.
6982 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
6983 Move from members of the parser object...
6984 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
6985 to local variables of the parse function.
6986
70d8f291
AD
69872005-09-16 Akim Demaille <akim@epita.fr>
6988
6989 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
6990 since it's in Bison's name space.
6991
b47dbebe
PE
69922005-09-15 Paul Eggert <eggert@cs.ucla.edu>
6993
ae199bf1
PE
6994 * data/glr.c (yyresolveValue): Add default case to pacify
6995 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
6996
b47dbebe
PE
6997 * NEWS: Document when yyparse started to return 2.
6998 * doc/bison.texinfo (Parser Function): Document when yyparse
6999 returns 2.
7000
7001 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
7002 (b4_filename_type): Renamed back from b4_file_name_type. All uses
7003 changed.
7004 (class position): file_name -> filename (reverting). All uses changed.
7005
70062005-09-14 Paul Eggert <eggert@cs.ucla.edu>
7007
7008 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
7009 do anything if $@ exists. This reverts part of the 2005-07-07
7010 patch.
7011
00292f66
PE
70122005-09-11 Paul Eggert <eggert@cs.ucla.edu>
7013
7014 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
7015 contains obsolete information and isn't worth distributing as a
7016 separate file anyway.
7017 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
7018 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
7019 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
7020 (yyparse): Abort if user code uses longjmp to throw an unexpected
7021 value.
7022
a420f962
PE
70232005-09-09 Paul Eggert <eggert@cs.ucla.edu>
7024
00292f66
PE
7025 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
7026 Suggested by twlevo@xs4all.nl.
7027
127287e9
PE
7028 * data/glr.c (YYCHK1): Do not assume YYE is in range.
7029 This avoids a diagnostic from gcc -Wswitch-enum.
7030 Problem reported by twlevo@xs4all.nl.
7031
a420f962
PE
7032 * doc/bison.texinfo: Don't use "filename", as per GNU coding
7033 standards. Use "file name" or "file" or "name", depending on
7034 the context.
7035 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
7036 not to hack/foo.tab.c.
7037 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
7038 * data/glr.c: b4_filename -> b4_file_name.
7039 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
7040 All uses changed.
7041 (class position): filename -> file_name. All uses changed.
7042 * data/yacc.c: b4_filename -> b4_file_name.
7043 * lib/bitset.h: filename -> file_name in local vars.
7044 * lib/bitset_stats.c: Likewise.
7045 * src/files.c: Likewise.
7046 * src/scan-skel.l ("@output ".*\n): Likewise.
7047 * src/files.c (file_name_split): Renamed from filename_split.
7048 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
7049
70502005-09-08 Paul Eggert <eggert@cs.ucla.edu>
7051
7052 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
7053 to accommodate latest gnulib.
7054
7055 * tests/glr-regression.at (Duplicate representation of merged trees):
7056 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
7057
7058 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
7059 needed.
7060
42a6501d
PE
70612005-08-26 Paul Eggert <eggert@cs.ucla.edu>
7062
7063 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
7064 All uses changed. Invoke user destructor after an error during a
7065 split parse (trivial change from Joel E. Denny).
7066
7067 * tests/glr-regression.at
7068 (User destructor after an error during a split parse): New test case.
7069 Problem reported by Joel E. Denny in:
7070 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
7071
ef9a1faf
PE
70722005-08-25 Paul Eggert <eggert@cs.ucla.edu>
7073
5b4aaf78
PE
7074 * README-cvs: Give URLs for recommended tools.
7075 Mention Gzip version problem, and bootstrapping issues.
7076 Remove troubleshooting section, as it's somewhat obsolete.
7077
b5240ba5
PE
7078 * bootstrap (no_cache): New var, to accommodate different wget
7079 variants. Use it instead of '-C off'. Problem reported by
7080 twlevo@xs4all.nl.
7081
ef9a1faf
PE
7082 * data/glr.c (yydestroyStackItem): New function.
7083 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
7084 debugging information. Problem reported by Joel E. Denny.
7085
e6efa9da
AD
70862005-08-25 Akim Demaille <akim@epita.fr>
7087
7088 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
7089
adc90f13
PE
70902005-08-24 Paul Eggert <eggert@cs.ucla.edu>
7091
7092 * data/glr.c (yyrecoverSyntaxError, yyreturn):
7093 Don't invoke destructor on unresolved entries.
7094 * tests/glr-regression.at
7095 (User destructor for unresolved GLR semantic value): New test case.
7096 Problem reported by Joel E. Denny in:
7097 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
7098
f9315de5
PE
70992005-08-21 Paul Eggert <eggert@cs.ucla.edu>
7100
15d29c1f
PE
7101 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
7102 Add strnlen.c.
7103 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
7104 lib-prefix.m4, po.m4.
7105
dd5f2af2
PE
7106 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
7107 in yydestruct diagnostic, since it might not be an error.
7108 Problem reported by Joel Denny near end of
7109 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 7110 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
7111 * data/yacc.c (yyreturn): Likewise.
7112 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
7113
7114 * src/files.c: Remove obsolete FIXME comment.
7115
7116 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
7117 with the other templates, and to fix bogus run-on messages such
7118 as the one reported at the end of
7119 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
7120 All callers changed to avoid the newline.
7121 (yyprocessOneStack): Output two lines rather than one, to accommodate
7122 the above change. This changes the debug output format slightly.
7123
f9315de5
PE
7124 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
7125 reported by Joel E. Denny in
7126 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
7127 (trivial change).
7128 * tests/glr-regression.at (Duplicate representation of merged trees):
7129 New test, from Joel E. Denny in:
7130 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
7131 * THANKS: Add Joel E. Denny.
7132
7133 * configure.ac (AC_INIT): Bump to 2.0c.
7134
04098407
PE
71352005-07-24 Paul Eggert <eggert@cs.ucla.edu>
7136
7137 * NEWS: Version 2.0b.
7138
ca5d2013
PE
7139 * Makefile.am (SUBDIRS): Put examples before tests, so that
7140 "make check" doesn't finish with "All 1 tests passed".
7141
3d54b576
PE
7142 * tests/regression.at (Token definitions): Don't rely on
7143 AT_PARSER_CHECK for data that contains backslashes. It currently
7144 uses 'echo', and 'echo' isn't portable if its argument contains
7145 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
7146 that the byte '\0xff' is not printable in the C locale; it is,
7147 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
7148 not printable, so use '\0x81' to test.
7149
d53ae497
PE
7150 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
7151 version of GCC, since the macro is used with non-GCC compilers.
7152
fc01665e
PE
7153 Fix core dump reported by Pablo De Napoli in
7154 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
7155 * tests/regression.at (Invalid inputs with {}): New test.
7156 * src/parse-gram.y (token_name): Translate type before using
7157 it as an index.
7158
04098407
PE
7159 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
7160 the user's name space. All uses changed to __attribute__
7161 ((__unused__)).
7162 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
7163 Add __attribute__ ((__noreturn__)).
7164
7165 * etc/clcommit: Remove. We weren't using it, and it failed
7166 "make maintainer-distcheck".
7167 * Makefile.maint: Merge from coreutils.
7168 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
7169 (syntax-check-rules): Change list of rules as described below.
7170 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
7171 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
7172 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
7173 (sc_trailing_space): New rules.
7174 (sc_xalloc_h_in_src): Remove.
7175 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
7176 (sc_space_tab, sc_error_exit_success, sc_changelog):
7177 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
7178 (makefile-check, po-check, author_mark_check):
7179 (makefile_path_separator_check, copyright-check):
7180 Use grep -n, to make it easier to find violations.
7181 Use CVS_LIST and CVS_LIST_EXCEPT.
7182 (header_regexp, h_re): Remove.
7183 (dd_c): New macro.
7184 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
7185 (my-distcheck): Use more-modern GCC flags.
7186 (signatures, %.asc): Remove.
7187 (rel-files, announcement): Remove signatures.
7188 Restore old updating code, even though we don't use it, so
7189 that we're the same as coreutils.
7190 (alpha, beta, major): Depend on news-date-check.
7191 Make the upload commands.
7192
7193 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
7194 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
7195 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
7196 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
7197 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
7198 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
7199 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
7200 * tests/sets.at: Likewise.
7201
7202 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
7203 we comment out the Autoconf version number.
7204 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
7205 it's error-prone and "make maintainer-distcheck" rejects it.
7206
7207 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
7208 Indent calls to "error" to pacify "make maintainer-distcheck",
7209 when the calls are not intended to be translated.
7210 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
7211
7212 * src/Makefile.am (DEFS): Use +=, to pacify
7213 "make maintainer-distcheck".
7214 (bison_SOURCES): Add scan-skel.h.
7215 (sc_tight_scope): New rule, from coreutils.
7216
7217 * src/files.c (src_extension, header_extension):
7218 Now static, not extern.
7219 * src/getargs.c (short_options): Likewise.
7220 * src/muscle_tab.c (muscle_table): Likewise.
7221 * src/parse-gram.y (current_class, current_type, current_prec):
7222 Likewise.
7223 * src/reader.c (grammar_end, previous_rule_end): Likewise.
7224 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
7225 * src/main.c (main): Cast bindtextdomain and textdomain calls to
7226 void, to avoid warning when NLS is disabled.
7227 * src/output.c: Include scan-skel.h.
7228 (scan_skel): Remove decl, since scan-skel.h does this.
7229 (output_skeleton):
7230 Indent calls to "error" to pacify "make maintainer-distcheck".
7231 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
7232 * src/reader.h (gram_end, gram_lineno): New decls to pacify
7233 "make maintainer-distcheck".
7234 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
7235 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
7236 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
7237 (skel_lex_destroy, scan_skel): Move these decls to...
7238 * src/scan-skel.h: New file.
7239 * src/uniqstr.c (uniqstr_assert):
7240 Indent calls to "error" to pacify "make maintainer-distcheck".
7241
7242 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
7243 not @VAR@.
7244
7245 * tests/torture.at: Revamp to avoid misuse of atoi that
7246 "make maintainer-distcheck" complained about.
7247
7248 * examples/extexi (message): Don't print a message more than once,
7249 and omit line-number decoration that makes Emacs compile think
7250 that informative messages are worth worrying about.
7251
72522005-07-22 Paul Eggert <eggert@cs.ucla.edu>
7253
7254 * configure.ac: Update version number.
7255
7256 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
7257 accidentally.
7258 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
7259 autogenerated by the maintainer.
7260 * examples/calc++/.cvsignore: Add *.yy.
7261
7262 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
7263 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7264 * lib/bitsetv.c (bitsetv_alloc): Likewise.
7265
7266 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
7267
7268 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
7269 from maintainer-distcheck about casting the argument of 'free'.
7270
7271 * NEWS: Mention recent yytname changes.
7272 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
7273
7274 * bootstrap: For translations that have not yet been upgraded to
7275 the new runtime-po domain, prime the pump by extracting the
7276 relevant strings from the obsolete translations. This code can be
7277 removed once the bison-runtime domain has been translated by each
7278 team.
7279
7280 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
7281 now that token names are already quoted.
7282
7283 Fix problem reported by Anthony Heading.
7284 * data/glr.c (YYTOKEN_TABLE): New macro.
7285 (yytname): Define if YYTOKEN_TABLE.
7286 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
7287 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
7288 (YYERROR_VERBOSE): Define the same way the other skeletons do.
7289 * src/output.c (prepare_symbols): Output token_table_flag.
7290
0ffda363
PE
72912005-07-21 Paul Eggert <eggert@cs.ucla.edu>
7292
7293 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
7294 again if the first call fails.
7295
7296 * data/glr.c (yytnamerr): New function.
7297 (yyreportSyntaxError): Use it to dequote most string literals.
7298 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
7299 with other skeletons. All uses changed.
7300 (yytnameerr_): New function.
7301 (yyreport_syntax_error): Use it to dequote most string literals.
7302 * data/yacc.c (yytnamerr): New function.
7303 (yyerrlab): Use it to decode most string literals.
7304 * doc/bison.texinfo (Decl Summary, Calling Convention):
7305 Clarify quoting convention of yytname.
7306 * src/output.c (prepare_symbols): Quote all names. This undoes
7307 the 2005-04-17 change, which is now accomplished (mostly) via
7308 changes in the parsers as described above.
7309 * tests/regression.at (Token definitions, Web2c Actions):
7310 Undo most 2005-04-17 change here, too.
7311
73122005-07-20 Paul Eggert <eggert@cs.ucla.edu>
7313
7314 Fix more problems reported by twlevo@xs4all.nl.
7315 * tests/cxx-type.at: Don't pipe output of ./types through sed to
7316 remove trailing spaces. This loses the exit status of ./types,
7317 and isn't needed since ./types shouldn't be emitting trailing
7318 spaces.
7319 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
7320 as the stack isn't valid in that case.
7321
7322 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7323 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7324 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7325 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
7326 is used.
7327 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
7328 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7329 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7330 Likewise.
7331
7332 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
7333 overly-picky compilers that reject 'char *foo = "bar";'.
7334
7335 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
7336 to FILE * parameter, not to stderr. This fixes a typo introduced
7337 in the 2005-07-12 change.
7338
7339 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
7340 warnings from GCC 4.
7341
7342 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
7343 (yyglrShiftDefer, yysplitStack):
7344 Remove unused parameters b4_pure_formals. All uses changed.
7345 (yyglrShift): Remove unused parameters b4_user_formals.
7346 All uses changed.
7347 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
7348
6100a9aa
PE
73492005-07-18 Paul Eggert <eggert@cs.ucla.edu>
7350
258b75ca
PE
7351 Destructor cleanups and regularization among the three skeletons.
7352 * NEWS: Document the behavior changes.
7353 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
7354 stack before failing, as the cleanup code will do it for us now.
7355 * data/lalr1.cc (yyerrlab): Likewise.
7356 * data/glr.c (yyparse): Pop everything off the stack before
7357 freeing it, so that destructors get called properly.
7358 * data/lalr1.cc (yyreturn): Likewise.
7359 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
7360 This is more consistent.
7361 * doc/bison.texinfo (Destructor Decl): Mention more reasons
7362 why destructors might be called. 1.875 -> 2.1.
7363 (Destructor Decl, Decl Summary, Table of Symbols):
7364 Some English-language cleanups for %destructor.
7365 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7366 Add output line for destructor of start symbol.
7367 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
7368 because of that same extra output line.
7369
1a059451
PE
7370 * NEWS: Document minor wording changes in diagnostics of
7371 Bison-generated parsers.
7372 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
7373 Remove unused formals. All uses changed.
7374 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
7375 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
7376 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
7377 Rename yyoverflowab to yyexhaustedlab.
7378 When memory exhaustion occurs during syntax-error reporting,
7379 report it separately rather than in a single diagnostic; this
7380 eases translation.
7381 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
7382 (Memory Exhausted): Renamed from Parser Stack Overflow.
7383 Revamp wording slightly to prefer "memory exhaustion".
7384 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
7385
97460c78
PE
7386 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
7387
30757c8c
PE
7388 Add i18n support to the GLR skeleton. Partially fix the C++
7389 skeleton; a C++ expert needs to finish this. Remove debugging
7390 msgids; there's little point to having them translated, since they
7391 can be understood only by someone who can read the
7392 (English-language) source code.
7393
7394 Generate runtime-po/bison-runtime.pot automatically, so that we
7395 don't have to worry about garbage getting in that file. We'll
7396 make sure after the next official release that old msgids don't
7397 get lost. See
7398 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
7399
7400 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
7401 Now auto-generated.
7402 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
7403 Fix typos in explanations of the runtime file.
7404 * bootstrap: Change gettext keyword from YYI18N to YY_.
7405 Use standard Makefile.in.in in runtime-po, since we'll arrange
7406 for backward-compatible bison-runtime.po files in a different way.
7407 * data/glr.c (YY_): New macro, from yacc.c.
7408 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
7409 Translate messages intended for users.
7410 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
7411 the wording in the other skeletons. We don't know that the memory
7412 is virtual.
7413 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
7414 Use same method that yacc.c uses.
7415 Don't translate debugging messages.
7416 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
7417 it doesn't work (yet), and requires C++ expertise to fix.
7418 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
7419 Move defn to a more logical place, to be consistent with other
7420 skeletons.
7421 Don't translate debugging messages.
7422 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
7423 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
7424 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
7425 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
7426
ac8c5689
PE
7427 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
7428 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
7429 void, not int.
7430 * tests/glr-regression.at (Badly Collapsed GLR States):
7431 Likewise.
7432 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7433 yylex should return 0 at EOF rather than aborting.
7434
6100a9aa
PE
7435 Improve tests for stack overflow in GLR parser.
7436 Problem reported by twlevo@xs4all.nl.
7437 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
7438 All uses removed.
7439 (yyStackOverflow): Just longjmp, but with value 2 so that caller
7440 can handle the problem.
7441 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
7442 (yyparse): New local variable yyresult to record the result.
7443 Use result of setjmp to set it, rather than storing itinto
7444 struct.
7445 (yyDone): Remove label.
7446 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
7447 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
7448 if YYABORT is used).
7449 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
7450 yyparse status; put status > 1 into diagnostic.
7451 Check that status==2 works.
7452 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
7453 Use exit status 3 for failure to open (which shouldn't happen).
7454
15f40952
PE
74552005-07-17 Paul Eggert <eggert@cs.ucla.edu>
7456
67fd79c4
PE
7457 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
7458 1 on syntax error; just let yyparse do its thing.
7459 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
7460 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
7461 (Exploding the Stack Size with Alloca):
7462 (Exploding the Stack Size with Malloc):
7463 Expect exit status 2, not 1, since the parser is supposed to blow
7464 its stack. Problem reported by twlevo@xs4all.nl.
7465
15f40952
PE
7466 * data/glr.c (yyparse): Don't assume that the initial calls
7467 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
7468 Print a stack-overflow message and fail instead.
7469 Initialize the line-number information before creating the stack,
7470 so that the stack-overflow message can report line zero safely.
7471
f32c66b5
PE
74722005-07-14 Paul Eggert <eggert@cs.ucla.edu>
7473
a22ff96f 7474 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
7475 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
7476 (yyuserMerge): Provide a default case if b4_mergers is empty.
7477 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
7478 * tests/glr-regression.at
7479 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 7480 Add casts to pacify C++ compilers.
1beb0b24
PE
7481 * tests/glr-regression.at (Improper merging of GLR delayed action
7482 sets): Declare yylex before using it.
f32c66b5 7483 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
7484 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
7485 test for valgrind; valgrind is independent of g++.
7486 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
7487 for compatibility with POSIX 1003.1-2001 (if running coreutils).
7488 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
7489 Use a destructor, so that we can expand the stack. Change
7490 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 7491
d741bd1b
PE
74922005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7493
7494 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
7495 a valgrind failure. Problem reported by twlevo@xs4all.nl.
7496
0410a6e0
PE
74972005-07-13 Paul Eggert <eggert@cs.ucla.edu>
7498
7499 * PACKAGING: New file, suggested by Bruno Haible and taken from
7500 similar wording in gettext's PACKAGING file.
7501 * NEWS: Mention PACKAGING.
7502 * Makefile.am (EXTRA_DIST): Add PACKAGING.
7503
f7ab6a50
PE
75042005-07-12 Paul Eggert <eggert@cs.ucla.edu>
7505
baf785db 7506 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
7507 * bootstrap: Get runtime translations into runtime-po.
7508 Create runtime-po files automatically, if possible.
7509 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
7510 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
7511 does not infringe on the user's name space.
7512 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
7513 * doc/bison.texinfo (Internationalization): Revamp the English
7514 and Texinfo syntax a bit, to try to make it clearer.
7515 (Bison Options, Option Cross Key): Mention --print-localedir.
7516 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
7517 YYENABLE_NLS. Quote a bit more.
7518 * runtime-po/.cvsignore: New file.
7519 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
7520 * runtime-po/Rules-quot: Remove; now created by bootstrap.
7521 * runtime-po/quot.sed: Likewise.
7522 * runtime-po/boldquot.sed: Likewise.
7523 * runtime-po/en@quot.header: Likewise.
7524 * runtime-po/en@boldquot.header: Likewise.
7525 * runtime-po/insert-header.sin: Likewise.
7526 * runtime-po/remove-potcdate.sin: Likewise.
7527 * runtime-po/Makevars: Likewise.
7528 * runtime-po/LINGUAS: Likewise.
7529 * runtime-po/de.po: Likewise; we will rely on the translation project
7530 to maintain this, so "bootstrap" should get it.
0410a6e0 7531 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
7532 its value.
7533 * src/main.c (main): Bind the bison-runtime domain, too.
7534
75352005-07-12 Bruno Haible <bruno@clisp.org>
7536
7537 * data/yacc.c: Include <libintl.h> when NLS is enabled.
7538 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
7539 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
7540 * runtime-po: New directory.
7541 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
7542 $(DOMAIN).pot-update rule, so that old messages are never dropped.
7543 * runtime-po/Rules-quot: New file, copied from po/.
7544 * runtime-po/quot.sed: Likewise.
7545 * runtime-po/boldquot.sed: Likewise.
7546 * runtime-po/en@quot.header: Likewise.
7547 * runtime-po/en@boldquot.header: Likewise.
7548 * runtime-po/insert-header.sin: Likewise.
7549 * runtime-po/remove-potcdate.sin: Likewise.
7550 * runtime-po/Makevars: New file.
7551 * runtime-po/POTFILES.in: New file.
7552 * runtime-po/LINGUAS: New file.
7553 * runtime-po/bison-runtime.pot: New file.
7554 * runtime-po/de.po: New file.
7555 * m4/bison.m4: New file.
7556 * Makefile.am (SUBDIRS): Add runtime-po.
7557 (aclocaldir, aclocal_DATA): New variables.
7558 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
7559 Define aclocaldir.
7560 * src/getargs.c (usage): Document --print-localedir option.
7561 (PRINT_LOCALEDIR_OPTION): New enum item.
7562 (long_options): Add --print-localedir option.
7563 (getargs): Handle --print-localedir option.
7564 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
7565 (Internationalization): New section.
7566
22dda0f0
AD
75672005-07-12 Akim Demaille <akim@epita.fr>
7568
7569 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
7570 for consistency with the rest of the code.
7571 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
7572 Add separators.
7573
82b248ad
AD
75742005-07-12 Akim Demaille <akim@epita.fr>
7575
7576 * src/parse-gram.y: Use %printer instead of YYPRINT.
7577
fa0e9314
AD
75782005-07-12 Akim Demaille <akim@epita.fr>
7579
867a3e00
AD
7580 * src/symtab.h, src/symtab.c (symbol_print): New.
7581 * src/symlist.h, src/symlist.c (symbol_list_print): New.
7582 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
7583
75842005-07-12 Akim Demaille <akim@epita.fr>
7585
7586 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
7587 b4_at_dollar and b4_dollar_dollar.
7588
e054b190
PE
75892005-07-11 Paul Eggert <eggert@cs.ucla.edu>
7590
7591 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
7592 and Pennello's paper.
7593
34160ec4
PE
75942005-07-09 Paul Eggert <eggert@cs.ucla.edu>
7595
407d4a75
PE
7596 * data/yacc.c (yyparse): Undo previous patch. Instead,
7597 set yylsp[0] and yyvsp[0] only if the initial action
7598 sets yylloc and yylval, respectively.
7599
34160ec4
PE
7600 * data/yacc.c (yyparse): In the initial action, set
7601 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
7602 This avoids the use of undefined variables if the initial
7603 action does not set yylloc and/or yylval.
7604
c3d5a4a7
PE
76052005-07-07 Paul Eggert <eggert@cs.ucla.edu>
7606
b34d96c1
PE
7607 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
7608 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
7609 Remove from CVS. These files are automatically generated.
7610 * examples/extexi: Clarify that this file is now part of Bison,
7611 not GNU M4, and that it works with any POSIX-compatible Awk.
7612 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
7613 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
7614 so that we also get calc++-parser.yy. Geneate it.
7615 Use $(AWK), not gawk, since any conforming Awk will do.
7616 Put comment before action, since older 'make' can't handle comment
7617 in action.
7618 $(BUILT_SOURCES): List all built sources, not just some of them.
7619 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
7620 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
7621 $($(calc_sources_generated)): Remove unnecessary test for existence
7622 of target. (This had a shell syntax error anyway; a stray "x".)
7623 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
7624 calc++-parser.yy.
7625 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
7626
c3d5a4a7
PE
7627 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
7628 implied by the other modules.
7629
828c373b
AD
76302005-07-06 Akim Demaille <akim@epita.fr>
7631
7632 Bind examples/calc++ to the package.
7633 * examples/calc++/Makefile: Remove, replaced by...
7634 * examples/calc++/Makefile.am: ... this new file.
7635 * examples/calc++/test: Remove input.
7636 * examples/calc++/compile: Remove.
7637 * examples/Makefile.am: New.
7638 * configure.ac, Makefile.am: Adjust.
7639 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
7640
63cb01d6
PE
76412005-07-05 Paul Eggert <eggert@cs.ucla.edu>
7642
fd2df2ed
PE
7643 * data/glr.c (yyFail): Drastically simplify; since the format argument
7644 never had any % directives, we can simply pass it to yyerror.
7645 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
7646 be modified later, as that is the usual style in glr.c.
7647 Problems reported by Paul Hilfinger.
7648
63cb01d6
PE
7649 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
7650 and size overflow errors.
7651 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
7652 in case the user prolog sets feature-test macros like _GNU_SOURCE.
7653 (YYSIZEMAX): New macro.
7654 (yystpcpy): New function, taken from yacc.c.
7655 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
7656 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
7657 so that we don't have to maintain their signatures.
7658 (yyFail): Check for buffer overflow, by using vsnprintf rather
7659 than vsprintf. Allocate a bigger buffer if possible.
7660 Report an error if buffer allocation fails.
7661 (yyStackOverflow): New function.
7662 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
7663 the initialization was successful. It might fail if storage was
7664 exhausted.
7665 (yyexpandGLRStack): Add more checks for storage allocation failure.
7666 Use yyStackOverflow to report failures.
7667 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
7668 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
7669 Don't assume stack number fits in int.
7670 (yysplitStack): Check for storage allocation failure.
7671 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
7672 can print diagnostics on storage allocation failure. All callers
7673 changed.
7674 (yyresolveValue): Use yybool for boolean.
7675 (yyreportSyntaxError): Check for size-calculation overflow.
7676 This code is taken from yacc.c.
7677 (yyparse): Check for storage allocation errors when allocating
7678 the initial stack.
7679
1c59e0a1
AD
76802005-07-05 Akim Demaille <akim@epita.fr>
7681
7682 Extract calc++ from the documentation.
7683 * doc/bison.texinfo (Calc++): Add the extraction marks.
7684 * examples/extexi: New, from the aborted GNU Programming 2E.
7685 Separate the different paragraph of a file with empty lines.
7686 * examples/Makefile: Use it to extract the whole calc++ example.
7687
8a0adb01
AD
76882005-06-24 Akim Demaille <akim@epita.fr>
7689
7690 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
7691 class typedefs.
7692
12545799
AD
76932005-06-22 Akim Demaille <akim@epita.fr>
7694
7695 * doc/bison.texinfo (C++ Language Interface): First stab.
7696 (C++ Parsers): Remove.
7697
99be0235
AD
76982005-06-22 Akim Demaille <akim@epita.fr>
7699
7700 * data/lalr1.cc (yylex_): Honor %lex-param.
7701
0ffd4fd1
AD
77022005-06-22 Akim Demaille <akim@epita.fr>
7703
7704 Start a set of simple examples.
7705 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
7706 * examples/calc++/calc++-driver.hh,
7707 * examples/calc++/calc++-parser.yy,
7708 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
7709 * examples/calc++/compile, examples/calc++/test: New.
7710
0925ebb4
PE
77112005-06-09 Paul Eggert <eggert@cs.ucla.edu>
7712
7713 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
7714 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
7715 which stems from the 2005-05-27 patch.
7716
43d3b664
PH
77172005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7718
7719 * data/glr.c: Modify treatment of unused parameters to permit use
7720 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
7721
3062864d
PE
77222005-05-30 Paul Eggert <eggert@cs.ucla.edu>
7723
7724 Fix infringement on user name space reported by Janos Zoltan Szabo.
7725 * data/yacc.c (yyparse): strlen -> yystrlen.
7726
989b5b8e
AD
77272005-05-30 Akim Demaille <akim@epita.fr>
7728
7729 * data/lalr1.cc (_): New.
7730 Translate the various messages.
7731
bedf57f5
PE
77322005-05-27 Paul Eggert <eggert@cs.ucla.edu>
7733
7734 Fix infringement on user name space reported by Bruno Haible.
7735 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
7736 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
7737 the user's name space.
7738 (alloca): Include <stdlib.h> to get it, if it's not built in.
7739 (YYMALLOC, YYFREE): Define only if needed.
7740 (malloc, free): Declare, but only if needed, as this infringes on
7741 the user name space.
7742
4d1801f1
PE
77432005-05-25 Paul Eggert <eggert@cs.ucla.edu>
7744
7745 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
7746 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
7747 with %d format.
7748 * lib/ebitset.c (min, max): Undef before defining.
7749 * lib/vbitset.c (min, max): Likewise.
7750 * lib/subpipe.c (create_subpipe): Save local variables in case
7751 vfork clobbers them.
7752
77532005-05-24 Bruno Haible <bruno@clisp.org>
7754
7755 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
7756 error message syntax used by gcc-4.0.
7757
b94a9e1e
PE
77582005-05-23 Paul Eggert <eggert@cs.ucla.edu>
7759
85ac3861
PE
7760 * README: Mention m4 1.4.3. Remove obsolete advice about
7761 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
7762
b94a9e1e
PE
7763 * bootstrap: Remove workaround for problem I encountered with
7764 gettext 0.14.1; it seems to be fixed now.
7765
51c30d21
PE
77662005-05-22 Paul Eggert <eggert@cs.ucla.edu>
7767
009ce67d
PE
7768 * NEWS: Version 2.0a.
7769
f2a97c62
PE
7770 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
7771 the previous change.
7772
c8775f93
PE
7773 Various maintainer cleanups.
7774 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
7775 conftest*, for benefit of CVS commands run at the same time as
7776 "configure". Add build-aux, since "bootstrap" now creates it and
7777 its subfiles.
7778 * Makefile.cfg (move_if_change): Remove.
7779 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
7780 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
7781 (po_repo, do-po-update, po-update, wget_files, get-targets):
7782 (config.guess-url_prefix, config.sub-url_prefix):
7783 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
7784 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
7785 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
7786 Remove.
7787 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
7788 this is now the recommended name.
7789 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
7790 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
7791 ylwrap. These files now go into build-aux.
7792 * config/move-if-change: Remove.
7793 * config/prev-version.txt: Bump from 1.75 to 2.0.
7794
3ea5f0ec
PE
7795 * bootstrap: Add stdio-safer, unistd-safer modules.
7796 Remove m4/glibc2.m4 (introduced by latest gnulib, but
7797 we don't need it).
7798 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
7799 fopen-safer.c, stdio-safer.h, unistd-safer.h.
7800 * lib/subpipe.c: Include "unistd-safer.h".
7801 (create_subpipe): Make sure all the newly-created
7802 file descriptors are > 2, so that diagnostics don't
7803 get sent down them (which might cause Bison to hang, in theory).
7804 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
7805 * src/files.c (xfopen): Use fopen_safer, not fopen.
7806
51c30d21
PE
7807 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
7808 yesterday's yacc.c fix.
7809
cea1469d
PE
78102005-05-21 Paul Eggert <eggert@cs.ucla.edu>
7811
3ea5f0ec
PE
7812 * data/glr.c, data/lalr1.cc: Update copyright date.
7813
cea1469d
PE
7814 Fix a destructor bug reported by Wolfgang Spraul in
7815 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
7816 * data/yacc.c (yyabortlab): Don't call destructor, and
7817 don't set yychar to EMPTY.
7818 (yyoverflowlab): Don't call destructor.
7819 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
7820 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
7821 since we no longer output the message "discarding lookahead token
7822 end of input ()".
7823
5e6f62f2
PH
78242005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7825
7826 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
7827 fix a small glitch in debugging output.
7828 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
7829 after YY_SYMBOL_PRINT where needed.
7830
7831 (struct yyGLRState): Add some comments.
7832 (struct yySemanticOption): Add some comments.
7833 (union yyGLRStackItem): Add comment.
7834
7835 (yymergeOptionSets): Correct this to properly perform the union,
7836 avoiding infinite reported by Michael Rosien.
7837 Update comment.
7838
7839 * tests/glr-regression.at: Add test for GLR merging error reported
7840 by M. Rosien.
cea1469d 7841
0fb669f9
PE
78422005-05-13 Paul Eggert <eggert@cs.ucla.edu>
7843
7844 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
7845 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
7846 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
7847 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
7848 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
7849 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
7850 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
7851 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
7852 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
7853 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
7854 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
7855 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
7856 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
7857 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
7858 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
7859 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
7860 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
7861 src/derives.h, src/files.c, src/files.h, src/getargs.c,
7862 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
7863 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
7864 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
7865 src/output.h, src/parse-gram.c, src/parse-gram.h,
7866 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
7867 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
7868 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
7869 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
7870 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
7871 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
7872 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
7873 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
7874 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
7875 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
7876 tests/reduce.at, tests/regression.at, tests/sets.at,
7877 tests/synclines.at, tests/testsuite.at, tests/torture.at:
7878 Update FSF postal mail address.
7879
51f4735e
PE
78802005-05-11 Paul Eggert <eggert@cs.ucla.edu>
7881
7882 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
7883 Problem reported by Ralf Menzel.
7884
80ce3401
PE
78852005-05-01 Paul Eggert <eggert@cs.ucla.edu>
7886
7887 * tests/actions.at: Test that stack overflow invokes destructors.
7888 From Marcus Holland-Moritz.
7889 * data/yacc.c (yyerrlab): Move the code that destroys the stack
7890 from here....
7891 (yyreturn): to here. That way, destructors are called properly
7892 even if the stack overflows, or the user calls YYACCEPT or
7893 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
7894 (yyoverflowlab): Destroy the lookahead.
7895
78962005-04-24 Paul Eggert <eggert@cs.ucla.edu>
7897
7898 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
7899
72f000b0
PE
79002005-04-17 Paul Eggert <eggert@cs.ucla.edu>
7901
7902 * NEWS: Bison-generated C parsers no longer quote literal strings
7903 associated with tokens.
7904 * src/output.c (prepare_symbols): Don't escape strings,
7905 since users don't want to see C escapes.
7906 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
7907 in diagnostics.
c19683bb 7908 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
7909 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
7910
1094323f
PE
79112005-04-16 Paul Eggert <eggert@cs.ucla.edu>
7912
7913 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
7914 the data size is known to be too small and we can't increase it.
7915 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
7916
ca407bdf
PE
79172005-04-15 Paul Eggert <eggert@cs.ucla.edu>
7918
7919 * src/parse-gram.y: Include quotearg.h.
7920 (string_as_id): Quote $1 before using it as a key, since the
7921 lexer no longer quotes it for us.
7922 (string_content): Don't strip quotes, since lexer no longer
7923 quotes it for us.
7924 * src/scan-gram.l: Include quotearg.h.
7925 ("\""): Omit quote.
7926 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
7927 a key, since the rest of the lexer doesn't quote it.
7928 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
7929 * tests/regression.at (Token definitions): Check for backslashes
7930 in token strings.
7931
7932 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
7933 (YYSIZE_T): Define to unsigned long int when using an older compiler.
7934 (yyparse): Revamp code to generate long syntax error message, to
7935 make it easier to translate, and to avoid problems with arithmetic
7936 overflow. Change "virtual memory" to "memory" in diagnostic, since
7937 we don't know whether the memory is virtual.
7938
1ce59070
PE
79392005-04-13 Paul Eggert <eggert@cs.ucla.edu>
7940
7941 * NEWS: Bison-generated C parsers now use the _ macro to
7942 translate strings.
7943 * data/yacc.c (_) [!defined _]: New macro.
7944 All English strings wrapped inside this macro.
7945 * doc/bison.texinfo (Bison Parser): Document _.
7946 * po/POTFILES.in: Include src/parse-gram.c, since it now
7947 includes translateable strings that parse-gram.y doesn't.
7948
a749a695
PE
79492005-04-12 Paul Eggert <eggert@cs.ucla.edu>
7950
7951 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
7952 reverting the 2004-10-11 change to this function.
7953 (symbol_check_alias_consistency): Don't call symbol_type_set
7954 if the type name is already correct.
7955 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
7956
8fb1053b
PE
79572005-03-25 Paul Eggert <eggert@cs.ucla.edu>
7958
7959 * tests/regression.at (Token definitions): Don't use a token named
7960 c, as that generates a "#define c ..." that runs afoul of buggy
7961 stdlib.h that uses the identifier c as a member of struct
7962 drand48_data. Problem reported by Horst Wente.
7963
ff498c4a
PE
79642005-03-21 Paul Eggert <eggert@cs.ucla.edu>
7965
7966 * bootstrap: Change translation URL from
7967 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
7968 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
7969 redirection glitches. Problem reported by twlevo@xs4all.nl.
7970
65211d70
PE
79712005-03-20 Paul Eggert <eggert@cs.ucla.edu>
7972
7973 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
7974 after operands; POSIX says this isn't portable for the c99 command.
7975
9577fb1f
PE
79762005-03-18 Paul Eggert <eggert@cs.ucla.edu>
7977
7978 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
7979 immediately if a data overrun has occurred; this may help us track
7980 down what may be a spurious failure on MacOS.
7981
78b178f7
PE
79822005-03-17 Paul Eggert <eggert@cs.ucla.edu>
7983
a2599d0f
PE
7984 Respond to problems reported by twlevo@xs4all.nl.
7985
7986 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
7987
78b178f7
PE
7988 * src/vcg.h: Comment fix.
7989 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
7990 (G_CMAX): Change to -1 instead of INT_MAX.
7991
7992 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 7993
7296e729
PE
79942005-03-15 Paul Eggert <eggert@cs.ucla.edu>
7995
7996 * src/tables.c (state_number_to_vector_number): Put it inside an
7997 "#if 0", since it's not currently used. Problem reported by
7998 Roland McGrath.
7999
05ac60f3
PE
80002005-03-06 Paul Eggert <eggert@cs.ucla.edu>
8001
8002 * src/output.c (escaped_output): Renamed from
8003 escaped_file_name_output, since we now use it for symbol tags as
8004 well. All uses changed.
8005 (symbol_destructors_output, symbol_printers_output):
8006 Escape symbol tags too.
8007 Problem reported by Matyas Forstner in
8008 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
8009
8010 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
8011 not needed.
8012 * src/output.c (user_actions_output, token_definitions_output,
8013 symbol_destructors_output, symbol_printers_output): Likewise.
8014 * src/reader.c (prologue_augment): Likewise.
8015 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
8016
8017 * src/vcg.c (output_edge): Don't quote linestyle arg.
8018 Problem reported by twlevo@xs4all.nl.
8019
7eb453ac
PE
80202005-02-28 Paul Eggert <eggert@cs.ucla.edu>
8021
8022 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
8023 example, reported by Derek M Jones. Also, make the example even
8024 more outrageous, to better illustrate how bad the problem is.
8025
4c04c52a
PE
80262005-02-24 Paul Eggert <eggert@cs.ucla.edu>
8027
8028 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
8029 putsym. Typo reported by Sebastian Piping.
8030
a61e1620
PE
80312005-02-23 Paul Eggert <eggert@cs.ucla.edu>
8032
8033 * doc/bison.texinfo (Language and Grammar): some -> same
8034 (Epilogue): int he -> in the
8035 Typos reported by Sebastian Piping via Justin Pence.
8036
9ec93868
PE
80372005-02-07 Paul Eggert <eggert@cs.ucla.edu>
8038
8039 * tests/glr-regression.at (Improper handling of embedded actions
8040 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
8041 embedded actions and $-N in GLR parsers", work around an Autoconf bug
8042 with dollar signs in test names.
8043 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
8044 for a similar reason.
8045
73ce7e7e
PE
80462005-01-28 Paul Eggert <eggert@cs.ucla.edu>
8047
8048 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
8049 wants to redefine G_VIEW.
8050
2e72b98e
PE
80512005-01-27 Paul Eggert <eggert@cs.ucla.edu>
8052
8053 * src/vcg.c (get_view_str): Remove case for normal_view.
8054 Problem reported by twlevo@xs4all.nl.
8055
e0d634e5
PE
80562005-01-24 Paul Eggert <eggert@cs.ucla.edu>
8057
ccf830a4
PE
8058 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
8059 Problem reported by twlevo@xs4all.nl.
8060
e0d634e5
PE
8061 * doc/bison.texinfo: Change @dircategory from "GNU programming
8062 tools" to "Software development". Requested by Richard Stallman
8063 via Karl Berry.
8064
7bbc8cb0
PE
80652005-01-23 Paul Eggert <eggert@cs.ucla.edu>
8066
8067 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
8068 Problem reported by twlevo@xs4all.nl.
8069
08b770bc
PE
80702005-01-21 Paul Eggert <eggert@cs.ucla.edu>
8071
8072 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
8073 keyword; it's not needed with modern compilers, and it doesn't
8074 affect correctness with older compilers. Suggested by
8075 twlevo@xs4all.nl.
8076
95f22ad2
PE
80772005-01-17 Paul Eggert <eggert@cs.ucla.edu>
8078
8079 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
8080 gcc -Wswitch-default.
8081 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8082 * data/yacc.c (yyparse): Likewise.
8083
d229d15c
PE
80842005-01-12 Paul Eggert <eggert@cs.ucla.edu>
8085
8086 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
8087 already. Let config.h define any nonstandard values.
8088
ecadd90f
PE
80892005-01-10 Paul Eggert <eggert@cs.ucla.edu>
8090
8091 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
8092 for the benefit of slower hosts. Problem reported by
8093 Nelson H. F. Beebe.
8094
213744b5
PE
80952005-01-07 Paul Eggert <eggert@cs.ucla.edu>
8096
8097 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
8098 being defined and not used.
8099 * data/lalr1.cc (yyparse): Likewise.
8100 Use "if (false)" rather than "if (0)".
8101
249d3236
PE
81022005-01-05 Paul Eggert <eggert@cs.ucla.edu>
8103
8104 * TODO: Mention that we should allow NUL bytes in tokens.
8105
987cc1fb
PE
81062005-01-02 Paul Eggert <eggert@cs.ucla.edu>
8107
8108 * src/scan-skel.l (<<EOF>>): Don't close standard output.
8109 Problem reported by Hans Aberg.
8110
08fe02d9
PE
81112005-01-01 Paul Eggert <eggert@cs.ucla.edu>
8112
8113 * src/getargs.c (version): Happy new year; update overall
8114 program copyright date from 2004 to 2005.
8115
8116 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
8117 Problem reported by Hans Aberg.
8118 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
8119 (Output file names.): Add a test for the case when standard output
8120 is closed.
8121
010c0266
PE
81222004-12-26 Paul Eggert <eggert@cs.ucla.edu>
8123
8124 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
8125 to fix an oversight in the Bison 2.0 manual.
8126
da12206a
PE
81272004-12-25 Paul Eggert <eggert@cs.ucla.edu>
8128
8129 * NEWS: Version 2.0. Reformat the existing news items since
8130 1.875, so that related items are grouped together.
3a4734aa 8131 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
8132 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
8133
c935d934
PE
8134 * tests/torture.at (Exploding the Stack Size with Alloca): Set
8135 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
8136 otherwise, we're not testing alloca. Unfortunately there's no
8137 simple way to consult HAVE_ALLOCA here.
8138
da12206a
PE
8139 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
8140 for yymsg, too.
8141
8142 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
8143 hand. This avoids a warning about comparing int to size_t when
8144 GCC warnings are enabled.
8145
0a2c5137
PE
81462004-12-22 Paul Eggert <eggert@cs.ucla.edu>
8147
d7e14fc0
PE
8148 * NEWS: Bison-generated parsers no longer default to using the
8149 alloca function (when available) to extend the parser stack, due
8150 to widespread problems in unchecked stack-overflow detection.
8151 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
8152 responsibility to set it to a positive value. This lets the user
8153 specify a value that is not a preprocessor constant.
8154 * data/yacc.c (YYMAXDEPTH): Likewise.
8155 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
8156 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
8157 to be a compile-time constant. However, explain the constraints on it.
8158 Also, explain the constraints on YYINITDEPTH.
8159 (Table of Symbols): Explain that alloca is no longer the default.
8160 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
8161 to 1.
8162
0a2c5137
PE
8163 * doc/bison.texinfo (Location Default Action): Mention that n must
8164 be zero when k is zero. Suggested by Frank Heckenbach.
8165
e019c247
AD
81662004-12-22 Akim Demaille <akim@epita.fr>
8167
8168 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
8169 (parser::state_type, parser::semantic_type, parser::location_type):
8170 Private, not public.
8171 (parser::parse): Return ints, not bool.
8172 Returning a bool introduces a problem: 0 corresponds to false, and
8173 it seems weird to return false on success. Returning true changes
8174 the conventions for yyparse.
8175 Alternatively we could return void and send an exception.
8176 There is no clear consensus (yet?).
8177 (state_stack, semantic_stack, location_stack): Rename as...
8178 (state_stack_type, semantic_stack_type, location_stack_type): these.
8179 Private, not public.
8180 * tests/c++.at: New.
8181 * tests/testsuite.at, tests/Makefile.am: Adjust.
8182
72731bb7
AD
81832004-12-21 Akim Demaille <akim@epita.fr>
8184
8185 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
8186
9a0d8bec
AD
81872004-12-21 Akim Demaille <akim@epita.fr>
8188
8189 Don't impose std::string for filenames.
8190
8191 * data/lalr1.cc (b4_filename_type): New.
8192 (position::filename): Use it.
8193 (parser.hh): Move the inclusion of stack.hh and location.hh below
8194 the user code, so that needed headers for the filename type can be
8195 included first.
72731bb7
AD
8196 Forward declare them before the user code.
8197 * tests/Makefile.am (check-local, installcheck-local): Pass
8198 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 8199
99880de5
AD
82002004-12-20 Akim Demaille <akim@epita.fr>
8201
8202 Use more STL like names: my_class instead of MyClass.
8203
8204 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
8205 (SemanticStack, SemanticType, StateStack, StateType)
8206 (TokenNumberType, Stack, Slice, Traits, Parser::location)
8207 (Parser::value): Rename as...
8208 (location_stack, location_type, rhs_number_type, semantic_stack)
8209 (semantic_type, state_stack, state_type, token_number_type, stack)
8210 (slice, traits, parser::yylloc, parser::yylval): these.
8211
8212 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
8213
9bec482e
PE
82142004-12-19 Paul Eggert <eggert@cs.ucla.edu>
8215
8216 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
8217 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8218
f6fbd3da
PE
82192004-12-17 Paul Eggert <eggert@cs.ucla.edu>
8220
8221 Remove uses of 'short int' and 'unsigned short int'. This raises
8222 some arbitrary limits. It uses more memory but nowadays that's
8223 not much of an issue.
8224
8225 This change does not affect the generated parsers; that's a different
8226 task, as some users will want to conserve memory there.
8227
8228 Ideally we should use size_t to represent all object counts, and
8229 something like ptrdiff_t to represent signed differences of object
8230 counts; but that will require more code-cleanup than I have the
8231 time to do right now.
8232
8233 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
8234 Use size_t, not int or short int, to count objects.
8235 * src/closure.c (nritemset, closure): Likewise.
8236 * src/closure.h (nritemset, closure): Likewise.
8237 * src/nullable.c (nullable_compute): Likewise.
8238 * src/print.c (print_core): Likewise.
8239 * src/print_graph.c (print_core): Likewise.
8240 * src/state.c (state_compare, state_hash): Likewise.
8241 * src/state.h (struct state): Likewise.
8242 * src/tables.c (default_goto, goto_actions): Likewise.
8243
8244 * src/gram.h (rule_number, rule): Use int, not short int.
8245 * src/output.c (prepare_rules): Likewise.
8246 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
8247 errs, reductions): Likewise.
8248 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
8249 Likewise.
8250 * src/tables.c (vector_number, tally, action_number,
8251 ACTION_NUMBER_MINIMUM): Likewise.
8252 * src/output.c (muscle_insert_short_int_table): Remove.
8253
efeed023
AD
82542004-12-17 Akim Demaille <akim@epita.fr>
8255
8256 * data/lalr1.cc: Extensive Doxygenation.
8257 (error_): Rename as...
8258 (error): this, since it is visible to the user.
8259 Adjust callers.
8260 (Parser::message): Now an automatic variable from...
8261 (Parser::yyreport_syntax_error_): here.
8262 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
8263 Parser::error.
8264 * tests/input.at: Escape $.
8265
bc82c5a5
PE
82662004-12-16 Paul Eggert <eggert@cs.ucla.edu>
8267
8268 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
8269 Parenthesize rhs to avoid obscure problems with mistakes like
8270 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
8271 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
8272 b4_rhs_location): Likewise.
8273 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
8274 b4_rhs_location): Likewise.
8275
fd19f271
AD
82762004-12-16 Akim Demaille <akim@epita.fr>
8277
8278 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
8279 yacc.c: be sure to stay within yycheck_.
8280 * tests/actions.at: Re-enable C++ tests.
8281
10454ea4
AD
82822004-12-16 Akim Demaille <akim@epita.fr>
8283
8284 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
8285 real.
8286
c5b95ccf
AD
82872004-12-16 Akim Demaille <akim@epita.fr>
8288
8289 Use #define to handle the %name-prefix.
8290
8291 * data/glr.c, data/yacc.c: Comment changes.
8292 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
8293 so that one can refer to yylex in the parser file, and have it
8294 renamed, as is the case with other skeletons.
8295
617a8f12
AD
82962004-12-16 Akim Demaille <akim@epita.fr>
8297
8298 Move lalr1.cc internals into yy*.
8299
8300 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
8301 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
8302 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
8303 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
8304 (empty_, final_, terror_, errcode_, ntokens_)
8305 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
8306 (looka_, ilooka_, error_range_, nerrs_):
8307 Rename as...
8308 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
8309 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
8310 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
8311 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
8312 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
8313 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
8314 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
8315 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
8316 these.
8317
1e547e6e
PE
83182004-12-15 Paul Eggert <eggert@cs.ucla.edu>
8319
8320 Fix some problems reported by twlevo at xs4all.
8321 * src/symtab.c (symbol_new): Report an error if the input grammar
8322 contains too many symbols. This is better than calling abort() later.
8323 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
8324 (struct node, struct graph):
8325 Rename member expand to stretch. All uses changed.
8326 (struct graph): Remove member layoutalgorithm. All uses removed.
8327 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
8328 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
8329 All uses changed.
8330 (N_STRETCH): Rename from N_EXPAND. All uses changed.
8331
735d6bd4
AD
83322004-12-15 Akim Demaille <akim@epita.fr>
8333
8334 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
8335 Add more Doxygen comments.
8336 (symprint_, stack_print_, reduce_print_, destruct_, pop)
8337 (report_syntax_error_, translate_): Rename as...
8338 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
8339 (yypop_, yyreport_syntax_error_, yytranslate_): this.
8340
2e1f5829
AD
83412004-12-15 Akim Demaille <akim@epita.fr>
8342
8343 * data/lalr1.cc (lex_): Rename as...
8344 (yylex_): this.
8345 Move the trace here.
8346 Take the %name-prefix into account.
8347 Reported by Alexandre Duret-Lutz.
8348
a3cb6248
AD
83492004-12-15 Akim Demaille <akim@epita.fr>
8350
8351 Simplify the C++ parser constructor.
8352
8353 * data/lalr1.cc (debug_): Rename as...
8354 (yydebug_): so that the parser's internals are always in the yy*
8355 pseudo namespace.
8356 Adjust uses.
8357 (b4_parse_param_decl): Remove the leading comma as it is now only
8358 called as unique argument list.
8359 (Parser::Parser): Remove the constructor accepting a location and
8360 an initial debugging level.
8361 Remove from the other ctor the argument for the debugging level.
8362 (debug_level_type, debug_level, set_debug_level): New.
8363
8364 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
8365 constructor calls.
8366
07fed891
AD
83672004-12-15 Akim Demaille <akim@epita.fr>
8368
8369 Remove b4_root related material: failure experiment
a3cb6248 8370 (which goal was to allow to derive from a class).
07fed891
AD
8371
8372 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
8373 definitions and uses.
8374
e603eaa5
PE
83752004-12-14 Paul Eggert <eggert@cs.ucla.edu>
8376
8377 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
8378 not 2, since it's not portable to subtract 1 from the start of an
8379 array. The new item 0 is never set or used. All uses changed.
8380
8381 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
8382 the default definition of YYLLOC_DEFAULT. Problem reported
8383 by Frank Heckenbach.
8384
fafb007d
PE
83852004-12-12 Paul Eggert <eggert@cs.ucla.edu>
8386
8387 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
8388 the normal case and one for the error case. Just use the
8389 first one uniformly. Problem reported by Frank Heckenbach.
8390 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
8391 use exactly the same macro in both places.
8392 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
8393 so that the normal-case YYRHSLOC works for the error case too.
8394 All uses changed.
8395 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
8396 (YYLLOC_DEFAULT): Use the same macro as glr.c.
8397 * doc/bison.texinfo (Location Default Action): Don't claim that
8398 we have an array of locations. Use the same macro for both glr
8399 and lalr parsers. Mention YYRHSLOC. Mention what happens when
8400 the index is 0.
8401
48814dcd
PE
84022004-12-10 Paul Eggert <eggert@cs.ucla.edu>
8403
a4e1a53b
PE
8404 * HACKING: Update email addresses to send announcements to.
8405
48814dcd
PE
8406 * configure.ac (AC_INIT): Bump version to 1.875f.
8407
337116ba
PE
84082004-12-10 Paul Eggert <eggert@cs.ucla.edu>
8409
8410 * NEWS: Version 1.875e.
8411 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
8412
8413 * src/scan-skel.l: Include "complain.h", for "fatal".
8414
8415 * src/relation.h (relation_print, relation_digraph):
8416 Relation sizes are of type relation_node, not size_t (this is
8417 merely a doc fix, since the two types are equivalent).
8418 (relation_transpose): Relation sizes are of type relation_node,
8419 not int.
8420 * src/relation.c: Likewise.
8421 (top, infinity): Now of type relation_node, not int.
8422 (traverse, relation_transpose): Use relation_node, not int.
8423
8424 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
8425 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
8426 (yyparse): Remove unused local introduced in 2004-10-25 patch.
8427
8428 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 8429 specifying whether the test should be skipped. Use it tp
337116ba 8430 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 8431 fail on some hosts, and should be skipped.
337116ba 8432
da2a7671
PE
84332004-12-08 Paul Eggert <eggert@cs.ucla.edu>
8434
8435 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
8436 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
8437 unless otherwise specified below.
8438
8439 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
8440 to allocate kernel_base, kernel_items, kernel_size, since
8441 they needn't be initialized to 0.
8442 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
8443 * src/closure.c (new_closure): Likewise, for itemset.
8444 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
8445 * src/lalr.c (set_goto_map): Likewise, for temp_map.
8446 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
8447 (build_relations): Likewise for edge, states1, includes.
8448 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
8449 * src/reader.c (packgram): Likewise, for ritem, rules.
8450 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
8451 * src/relation.c (relation_digraph): Likewise for VERTICES.
8452 (relation_transpose): Likewise for new_R, end_R.
8453 * src/symtab.c (symbols_token_translations_init): Likewise for
8454 token_translations.
8455 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
8456 (token_actions): Likewise for yydefact, actrow, conflrow,
8457 conflict_list.
8458 (save_column): Likewise for froms[symno], tos[symno].
8459 (goto_actions): Likewise for state_count.
8460 (pack_table): Likewise for base, pos, check.
8461 (tables_generate): Likewise for width.
8462
8463 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
8464 for initial core. Just have a separate core, so we needn't worry
8465 about whether kernel_size and kernel_base are initialized.
8466
8467 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
8468 kernel_size, kernel_items): Remove unnecessary initialization.
8469 * src/conflicts.c (conflicts): Likewise.
8470 * src/derives.c (derives): Likewise.
8471 * src/muscle_tablc (muscle_insert): Likewise.
8472 * src/relation.c (relation_digraph): Likewise.
8473 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
8474 conflrow, conflict_table, conflict_list, table, check):
8475 Likewise.
8476
8477 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
8478 This is because all callers pass unsigned int.
8479 * src/closure.h (new_closure): Likewise.
8480
8481 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
8482 (build_relations): Initialize includes[i] in all cases.
8483 * src/reader.c (packgram): Always initialize rules[ruleno].prec
8484 and rules[ruleno].precsym. Initialize members in order.
8485 * src/relation.c (relation_transpose): Always initialize new_R[i]
8486 and end_R[i].
8487 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
8488
8489 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
8490 conflict_list[0] was always 0, but now it isn't initialized.
8491
8492 * src/table.c (table_grow): When conflict_table grew, the grown
8493 area wasn't cleared. Fix this.
8494
8495 * lib/.cvsignore: Add strdup.c, strdup.h.
8496 * m4/.cvsignore: Add strdup.m4.
8497
00baeeac
PE
84982004-12-07 Paul Eggert <eggert@cs.ucla.edu>
8499
8500 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
8501 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
8502 GOTO_NUMBER_MAXIMUM, since we occasionally compute
8503 ngotos + 1 without checking for overflow.
8504 (build_relations): Use END_NODE, not -1, to denote end of edges.
8505 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
8506 build_relations): Use goto_number, not int, for goto numbers.
8507 * src/tables.c (save_column, default_goto): Likewise.
8508
be3d9d42
AD
85092004-11-23 Akim Demaille <akim@epita.fr>
8510
8511 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
8512 of #defining from yystype.
8513 Don't typedef yystype, C++ does not need it.
8514 This lets it possible to forward declare it as union.
8515
78e526d5
PE
85162004-11-23 Paul Eggert <eggert@cs.ucla.edu>
8517
8518 * bootstrap (gnulib_modules): Add extensions.
8519 Problem reported by Jim Meyering.
8520
afbb696d
PE
85212004-11-22 Paul Eggert <eggert@cs.ucla.edu>
8522
8523 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
8524 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
8525 src/system.h, src/tables.c: XFREE -> free, to accommodate
8526 recent change to gnulib xalloc.h.
78e526d5 8527 Problem reported by Jim Meyering.
afbb696d 8528
c1f8f16a
AD
85292004-11-17 Akim Demaille <akim@epita.fr>
8530
8531 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
8532
db7e5eb5 85332004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
8534 Alexandre Duret-Lutz <adl@gnu.org>
8535
8536 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
8537 changes.
8538 (YYCDEBUG): Adjust.
8539 Use it instead of cdebug_.
8540 (Parser::debug_stream, Parser::set_debug_stream): New.
8541 (Parser::symprint_): Define cdebug_ for temporary backward
8542 compatibility.
8543 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
8544 debug_stream ().
8545
68e11668
AD
85462004-11-17 Akim Demaille <akim@epita.fr>
8547
8548 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
8549 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
8550 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
8551 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8552
97cbc73e
PE
85532004-10-27 Paul Eggert <eggert@cs.ucla.edu>
8554
8555 * data/glr.c (yyloc_default): Remove; not used.
8556 Problem reported by Frank Heckenbach.
8557
e342c3be
AD
85582004-10-25 Akim Demaille <akim@epita.fr>
8559
8560 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
8561 Introduce another definition to address simple location arrays.
8562 (yyGLRStack): New member: yyerror_range.
8563 (yyrecoverSyntaxError, yyparse): Update it.
8564 (yyrecoverSyntaxError): Use it when shifting the error token to
8565 have an accurate range, equivalent to the one computed by both
8566 yacc.c and lalr1.cc.
8567 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
8568 that column numbers start at column 0, as per GNU Coding
8569 Standards, the others tests, and the doc.
8570 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
8571 Adjust to the above change (first column is 0).
8572 And adjust the location of the "<error>", now covering the whole
8573 line.
8574
93602feb 85752004-10-22 Akim Demaille <akim@epita.fr>
04098407 8576 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
8577
8578 Remove some arbitrary limits on goto numbers and relations.
8579 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
8580 initial values, since they're never used.
8581 (set_goto_map): ngotos is now unsigned, so test for overflow
8582 by seeing whether it wraps around to zero.
8583 * src/lalr.h (goto_number): Now size_t, not short int.
8584 (GOTO_NUMBER_MAXIMUM): Remove.
8585 * src/relation.c (relation_print, traverse, relation_transpose):
8586 Check for END_NODE rather than looking at sign.
8587 * src/relation.h (END_NODE): New macro.
8588 (relation_node): Now size_t, not short int.
8589
dba08b04
PE
85902004-10-22 Paul Eggert <eggert@cs.ucla.edu>
8591
8592 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
8593 keyword, not an identifier. Problem reported by Baron Schwartz in
8594 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
8595
df09ef2e
AD
85962004-10-11 Akim Demaille <akim@epita.fr>
8597
8598 * src/symtab.c (symbol_check_alias_consistency): Also check
8599 type names, destructors, and printers.
8600 Reported by Alexandre Duret-Lutz.
8601 Recode the handling of associativity and precedence in terms
8602 of symbol_precedence_set.
8603 Accept no redeclaration at all, not even equal to the previous
8604 value.
8605 (redeclaration): New.
8606 Use it to factor redeclaration complaints.
8607 (symbol_make_alias): Don't set the type of the alias, let
8608 symbol_check_alias_consistency do it as for other features.
8609 * src/symtab.h (symbol): Add new member prec_location, and
8610 type_location.
8611 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
8612 * tests/input.at (Incompatible Aliases): New.
8613
146bc99d
PE
86142004-10-09 Paul Eggert <eggert@cs.ucla.edu>
8615
8616 .cvsignore fixes to accommodate gnulib changes,
8617 and the practice of naming build directories "_build".
8618 * .cvsignore: Add "_*". Sort.
8619 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
8620 * m4/.cvsignore: Add "*_gl.m4".
8621
e503aa60
AD
86222004-10-06 Akim Demaille <akim@epita.fr>
8623
8624 * src/parse-gram.y (add_param): Fix the truncation of trailing
8625 spaces.
8626
b4a20338
AD
86272004-10-05 Akim Demaille <akim@epita.fr>
8628
8629 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
8630 whether the reducion was empty or not. This leaves room to
8631 improve the use of YYLLOC_DEFAULT in such a case.
8632 lalr1.cc is still experimental, so changing this is acceptable.
8633 And finally, there are probably not many users who changed the
8634 handling of locations in GLR, so changing is admissible too.
8635
8636 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
8637 empty reduction, set @$ to an empty location ending the previously
8638 stacked symbol.
8639 Adjust uses to make sure the code is triggered on empty
8640 reductions.
8641 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
8642 expected output: empty reductions have empty locations.
8643
f85a5e6f
AD
86442004-09-29 Akim Demaille <akim@epita.fr>
8645
8646 * data/lalr1.cc: Move towards a more standard C++ coding style
8647 for templates: Class < T > -> Class<T>.
8648
b203fc2c
AD
86492004-09-29 Akim Demaille <akim@epita.fr>
8650
8651 * data/lalr1.cc: Reinstall the former ctor, for sake of
8652 compatibility, but warn it will be removed.
8653 Move towards a more standard C++ coding style (i.e., type *var ->
8654 type* var).
8655
5b7e1e73
PE
86562004-09-27 Paul Eggert <eggert@cs.ucla.edu>
8657
3fee967f
PE
8658 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
8659 since it's less likely to work if NULs are involved in the future.
5b7e1e73 8660
0dcca5c2
AD
86612004-09-27 Akim Demaille <akim@epita.fr>
8662
8663 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
8664
6dde1c82
AD
86652004-09-27 Akim Demaille <akim@epita.fr>
8666
8667 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 8668 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
8669 and argument names.
8670 (b4_cc_constructor_call): Likewise.
8671
b233d555
AD
86722004-09-24 Akim Demaille <akim@epita.fr>
8673
8674 * src/parse-gram.y (add_param): Strip the leading and trailing
8675 blanks from a formal argument declaration.
8676 (YY_LOCATION_PRINT): New.
8677
619404e3
AD
86782004-09-24 Akim Demaille <akim@epita.fr>
8679
8680 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
8681 after the location.
8682
dd8d9022
AD
86832004-09-24 Akim Demaille <akim@epita.fr>
8684
8685 * doc/bison.texinfo (Table of Symbols): Sort.
8686
0092f063
AD
86872004-09-21 Akim Demaille <akim@epita.fr>
8688
8689 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
8690 the useless parentheses.
8691 Suggested by Paul Eggert.
8692
451364ed
AD
86932004-09-20 Akim Demaille <akim@epita.fr>
8694
8695 Let the initial-action act on the look-ahead, and use it for the
8696 "initial push" (corresponding to an hypothetical beginning-of-file).
8697 And let lalr1.cc honor %initial-action.
8698
8699 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
8700 example.
8701 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
8702 (Parser::Parser): Remove the ctor that used to initialize it.
8703 (Parser::parse): Like in the other skeletons, issue the "starting
8704 parse" message before any action.
8705 Honor %initial-action.
8706 Initialize the stacks with the lookahead.
8707 * data/yacc.c: Let $$ and @$ in %initial-action designate the
8708 look-ahead.
8709 Push them in the stacks.
8710 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
8711
18d192f0
AD
87122004-09-20 Akim Demaille <akim@epita.fr>
8713
8714 * doc/bison.texinfo (Initial Action Decl): New.
8715
b8458aa5
AD
87162004-09-20 Akim Demaille <akim@epita.fr>
8717
8718 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
8719 clearer criterion to define it.
8720 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
8721 When reducing on an empty RHS, use the latest stacked location as
8722 location.
8723 yylloc is not always available.
8724 * data/glr.c: Likewise.
8725 Also, honor initial-actions.
8726
3fc16193
AD
87272004-09-20 Akim Demaille <akim@epita.fr>
8728
8729 * data/yacc.c (YY_LOCATION_PRINT): New.
8730 Define when we know YYLTYPE's structure, i.e., when the default
8731 YYLLOC_DEFAULT is used.
8732 * data/c.m4 (b4_yysymprint_generate): Use it.
8733 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
8734 value of the result.
8735 (error_start_): Replace with...
8736 (error_range_): this location array.
8737 This allows to replace code relying on the implementation of
8738 locations by portable code.
8739 * data/yacc.c (yylerrsp): Replace with...
8740 (yyerror_range): this.
8741 Every time a token is popped, update yyerror_range[0], to have an
8742 accurate location for the error token.
8743 * data/glr.c (YY_LOCATION_PRINT): New.
8744 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
8745 deference a pointer.
8746 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
8747 report the location in %printers.
8748
8749 * src/scan-skel.l: Instead of abort, report error messages to ease
8750 understanding skeleton scanning failures.
8751
ecfe33e7
AD
87522004-09-16 Akim Demaille <akim@epita.fr>
8753
8754 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
8755 (iterator, const_iterator): these, to be more in the C++ spirit.
8756 Also, return reverse iterators so that when displaying the stack
8757 we display its bottom first.
8758 (Parser::stack_print_, Parser::reduce_print_): Match the messages
8759 from yacc.c.
8760 We should probably use vector here though.
8761
1576d44d
AD
87622004-09-16 Akim Demaille <akim@epita.fr>
8763
8764 Have more complete shift traces.
8765
8766 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
8767 to report Shifts instead of ad hoc YYDPRINTF invocations,
8768 including for the error token.
8769 * data/lalr1.cc (symprint_): Output the location.
8770 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
8771 output the location within the %printer.
8772 Activate GLR tests, at least to make sure they compile properly.
8773 They still don't pass though.
8774 * tests/calc.at: Adjust expect verbose output, since now "Entering
8775 state..." is on a different line than the "Shifting" message.
8776
9c66f418
AD
87772004-09-08 Akim Demaille <akim@epita.fr>
8778
8779 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
8780 Bison directive from the Bison file to the invocation of this
8781 macro, so that these directives are passed to
8782 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
8783 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
8784 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
8785 the extra Bison directives instead of the whole series.
8786 Change the grammar so that there are recoverable errors, and
8787 unrecoverable errors. Now we can have the parser give up before
8788 consuming the whole input. As a result we now can observe that
8789 the lookahead is freed when needed.
8790 Change the parser source to parse argv[1] instead of a hard coded
8791 string.
8792 Simplify yylex, and give a value and location to EOF.
8793 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
8794 passed directives already coded in the file.
8795 Add some tests to check the location of "error".
8796 For some tests, the C++ parser is correct, and not yacc.c.
8797 For other tests, they provide different, but unsatisfying, values,
8798 so keep the C++ value so that at least one parser is "correct"
8799 according to the test suite.
8800 (Actions after errors): Remove, this is subsumed by the
8801 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
8802
52d5733f
AD
88032004-09-06 Akim Demaille <akim@epita.fr>
8804
8805 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 8806 (Parser::pop): New.
52d5733f
AD
8807 Use it.
8808
a0e68930
AD
88092004-09-06 Akim Demaille <akim@epita.fr>
8810
8811 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
8812 argument, an informative message.
8813 Call YY_SYMBOL_PRINT.
8814 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
8815 * data/lalr1.cc (destruct_): Likewise.
8816 In addition, no longer depend on b4_yysymprint_generate and
8817 b4_yydestruct_generate to generate these functions, do it "by
8818 hand".
8819
e757bb10
AD
88202004-09-03 Akim Demaille <akim@epita.fr>
8821
8822 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
8823 invoked, yydestruct the lookahead.
8824 * tests/calc.at (Calculator $1): Update the expected lengths of
8825 traces: there is an added line for the discarded lookahead.
8826 * doc/bison.texinfo (Destructor Decl): Some rewording.
8827 Define "discarded" symbols.
8828
0fe1f06d
AD
88292004-09-02 Akim Demaille <akim@epita.fr>
8830
8831 * data/lalr1.cc (translate_, destruct_): No reason to be static.
8832
284acc8b
AD
88332004-09-02 Akim Demaille <akim@epita.fr>
8834
8835 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
8836 (YYDSYMPRINTF): Rename as...
8837 (YY_SYMBOL_PRINT): this.
8838 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
8839 two.
8840 Use it instead of direct symprint_ calls.
8841 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
8842 one.
8843
a5eb1ed2
AD
88442004-09-02 Akim Demaille <akim@epita.fr>
8845
b7c72fe1
AD
8846 * data/lalr1.cc (b4_yysymprint_generate): New.
8847 (symprint_): New member function, defined when YYDEBUG.
8848 Use it consistently instead of token/nterm debugging output by
8849 hand.
a5eb1ed2
AD
8850 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
8851 %printer calls to use cdebug_ when using lalr1.cc.
8852
417141dd
AD
88532004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
8854
8855 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
8856 with #ifdef YYDEBUG.
8857
2fa09258
AD
88582004-08-26 Akim Demaille <akim@epita.fr>
8859
8860 * doc/bison.texinfo (Implementing Loops): Rename as...
8861 (Implementing Gotos/Loops): this.
8862
9378b508
PE
88632004-08-13 Paul Eggert <eggert@cs.ucla.edu>
8864
8865 Adjust to latest gnulib.
8866 * bootstrap (gnulib_modules): Add xalloc-die.
8867 Set LC_ALL=C so that file names sort consistently.
8868 Prefer the gnulib copies of gettext.m4, glibc21.m4,
8869 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
8870 uintmax_t.m4, ulonglong.m4.
8871 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
8872 po.m4 since we are now using _gl.m4 instead.
8873
87a8ad5c
PE
88742004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
8875
8876 * src/scan-action.l: Remove. Scanning of semantic actions is
8877 handled in scan-gram.l.
8878
dca81a78
PE
88792004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
8880
8881 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
8882
8883 * src/location.h (struct): The file member is a uniqstr.
8884 (equal_boundaries): Use UNIQSTR_EQ for comparison.
8885
c9cbf7c5
PE
88862004-07-22 Paul Eggert <eggert@cs.ucla.edu>
8887
8888 Fix bug with non-%union parsers that have printers or destructors,
8889 which led to a Bison core dump. Reported by Peter Fales in
8890 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 8891
c9cbf7c5
PE
8892 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
8893 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
8894 not to our own type.
8895 * src/output.c (symbol_destructors_output, symbol_printers_output):
8896 Don't assume %union.
8897 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
8898 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
8899 UNION-FLAG. All callers changed.
8900 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
8901 Use type char, not unsigned int, when declaring an array of char;
8902 this lets us remove a cast.
8903 (Printers and Destructors): Add non-%union test cases.
8904
fa7e68c3
PE
89052004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8906
8907 * doc/bison.texinfo: Minor editorial changes, mostly to the new
8908 GLR writeups. E.g., avoid frenchspacing and the future tense,
8909 change "lookahead" to "look-ahead", and change "wrt" to "with
8910 respect to".
2fa09258 8911
fa7e68c3
PE
89122004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8913
8914 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
8915 New sections, split off from the GLR Parsers section. Put the new
8916 Simple GLR Parser near the start of the GLR section, for clarity.
8917 Rewrite connective text.
8918
99a9344e
PE
89192004-06-21 Frank Heckenbach <frank@g-n-u.de>
8920
8921 * doc/bison.texinfo (Simple GLR Parsers): New section.
8922
8dd162d3
PE
89232004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8924
8925 * NEWS, TODO, doc/bison.texinfo:
8926 Use "look-ahead" instead of "lookahead", to be consistent.
8927 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
8928 while we're fixing "look-ahead".
8929 * src/conflicts.c (shift_set): Renamed from shiftset.
8930 (look_ahead_set): Renamed from lookaheadset.
8931 * src/print.c: Likewise.
8932 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
8933 name for "lookahead".
8934 (report_types, usage): Likewise.
8935 * src/getargs.h (report_look_ahead_tokens): Renamed from
8936 report_lookaheads.
8937 * src/lalr.c (compute_look_ahead_tokens): Renamed from
8938 compute_lookaheads.
8939 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
8940 (look_ahead_tokens_print): Renamed from lookaheads_print.
8941 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
8942 state_rule_lookaheads_print.
8943 * src/state.h: Likewise.
8944 (reductions.look_ahead_tokens): Renamed from lookaheads.
8945 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
8946 AT_DATA_LOOKAHEADS_GRAMMAR.
8947
57a90331
PE
89482004-06-03 Paul Eggert <eggert@cs.ucla.edu>
8949
8950 * README: Update location of patched M4 distribution.
8951
8ed3234a
PE
89522004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
8953
8954 Don't assume the C++ compiler takes the same arguments as the C compiler
8955 (trivial change).
8956 * configure.ac (O0CXXFLAGS): New var.
8957 * tests/atlocal.in (CXXFLAGS): Use it.
8958
07971983
PE
89592004-05-29 Paul Eggert <eggert@cs.ucla.edu>
8960
8961 Fix some "make check" problems with C++ reported by
8962 Albert Chin-A-Young for Tru64 C++ in this thread:
8963 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
8964
8965 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
8966 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8967 Output to a .cc file for C++, not to a .c file.
8968 * tests/calc.at (AT_CHECK_CALC): Likewise.
8969 * tests/regression.at (AT_CHECK_DANCER): Likewise.
8970 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
8971
29058652
PE
89722004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
8973
8974 * tests/calc.at, tests/actions.at: Workaround for SGI
8975 C++ compiler. (trivial change)
8976
62cb8a99
PE
89772004-05-27 Paul Eggert <eggert@cs.ucla.edu>
8978
fd418816
PE
8979 Spent a few hours checking out which prerequisite versions the
8980 current sources actually require. I went all the way back to
8981 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
8982 a seemingly endless set of combinations of versions more recent
8983 than that. The bottom line is that the current sources require
8984 fairly recent versions of the build tools, and it'll be some work
8985 to change this.
8986 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
8987 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
8988 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
8989 Add comments explaining why those particular versions are
8990 currently needed.
2fa09258 8991
62cb8a99
PE
8992 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
8993 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 8994 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
8995
8996 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
8997 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
8998
caa52c10
PE
89992004-05-26 Paul Eggert <eggert@cs.ucla.edu>
9000
9001 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
9002 0.11.5. Suggested by Bruno Haible.
9003 * bootstrap: Remove gettext version checking.
9004
9005 * doc/bison.texinfo (Decl Summary): Also mention that %union
9006 can depend on prerequisite types. Problem reported by Tim
9007 Van Holder.
9008
4bfd5e4e
PE
90092004-05-25 Paul Eggert <eggert@cs.ucla.edu>
9010
2cef3017
PE
9011 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
9012 * README-alpha: Don't tell people not to package this.
9013
b9c85d5c
PE
9014 * bootstrap: Don't assume $(...) works; use `...` instead.
9015 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
9016 gettext better.
9017
4bfd5e4e
PE
9018 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
9019 put into the -d output file, and mention what to do if YYSTYPE is
9020 defined as a macro.
9021
6a36ff94
PE
90222004-05-24 Paul Eggert <eggert@cs.ucla.edu>
9023
6712933e
PE
9024 Undo change made earlier today: it caused autopoint to not bring
9025 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
9026 autopoint's.
9027
9028 * bootstrap: Check that gettext version matches what's in
9029 configure.ac. Warn users to ignore robots.txt ERROR 404.
9030 * bootstrap: Undo today's earlier change (logged below).
9031 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 9032
6a36ff94
PE
9033 The gettext version checking is causing more trouble than it's
9034 curing; remove it. Problem reported by Paul Hilfinger.
9035
9036 * bootstrap: Issue a warning that one can expect a message
9037 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
9038 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
9039
209ea708
PE
90402004-05-23 Paul Eggert <eggert@cs.ucla.edu>
9041
9042 Ensure that the C++ compiler used for testing actually works on a
9043 simple test program; if not, skip the C++-related tests. Problem
9044 reported by Vin Shelton in:
161a71f3 9045 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
9046
9047 * m4/cxx.m4: New file.
9048 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
9049 * tests/atlocal.in (BISON_CXX_WORKS): Add.
9050 * tests/local.at (AT_COMPILE_CXX): Use it.
9051
41ca2549
PE
90522004-05-21 Paul Eggert <eggert@cs.ucla.edu>
9053
383e69dc
PE
9054 * data/glr.c (yylloc): Output this macro even if locations are not
9055 being generated, as the GLR parser needs it even in that case.
9056 Problem reported by Troy A. Johnson
9057 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
9058
41ca2549
PE
9059 * configure.ac (AC_INIT): Update to 1.875e.
9060
e476c87d
PE
90612004-05-21 Paul Eggert <eggert@cs.ucla.edu>
9062
9063 * NEWS: Version 1.875d.
9064 * configure.ac (AC_INIT): Likewise.
9065 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
9066
9067 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
9068 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
9069 lalr1.cc runs afoul of the first, and the last two are no longer
9070 supported by GCC 3.4.0.
9071 * README: Mention GNU m4 1.4 or later; mention m4 patches.
9072 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
9073
233a88ad
PE
90742004-05-06 Paul Eggert <eggert@cs.ucla.edu>
9075
9076 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
9077 unsigned int, for compatibility with latest gnulib hash module.
9078 * src/state.c (state_hash, state_hasher): Likewise.
9079 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
9080 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 9081
12ffdd28
PE
90822004-05-03 Paul Eggert <eggert@cs.ucla.edu>
9083
9084 * NEWS: Unescaped newlines are no longer allowed in char & strings.
9085
9086 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
9087 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
9088 character and string literals.
9089 (unexpected_end): New function.
9090 (unexpected_eof): Use it.
9091 (unexpected_newline): New function.
9092 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
9093 actions.
e476c87d 9094
12ffdd28
PE
9095 * NEWS: Document %expect-rr.
9096
9097 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
9098 Fix typo by replacing $1 with $option.
9099 Remove more 'intl'-related files.
9668e2be 9100 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
9101
9102 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
9103 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
9104 strtoul.c.
9105 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
9106 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
9107 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
9108 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
9109 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
9110 * src/.cvsignore: Add *.output.
9111
9112 * src/parse-gram.y: Put copyright notice inside %{ %} so it
9113 gets copied to the output file.
e476c87d 9114
1f65350a
PE
91152004-04-28 Paul Eggert <eggert@twinsun.com>
9116
9117 Get files from the gnulib and po repositories, instead of relying
9118 on them being in our CVS. Upgrade to latest versions of gnulib
9119 and Automake.
9120
9121 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
9122 * bootstrap: Bootstrap from gnulib and po repositories.
9123 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
9124 * README-cvs: Document these changes. Remove version numbers from
9125 mentions of build tools, since they change so often. Mention Flex.
9126
9127 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
9128 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
9129 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
9130 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 9131 does this for us.
12ffdd28
PE
9132 (AC_ISC_POSIX): Remove; we no longer support this
9133 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
9134 (AC_HEADER_STDC): Remove: we now assume C89 or better.
9135 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
9136 Do not check for C89 headers, except for locale.h which is used
9137 by the Yacc library and must port to K&R hosts.
9138 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
9139 Do not check for C89 functions, except for setlocale which is
9140 used by the Yacc library.
9141 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
9142 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
9143 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
9144 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
9145 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
9146 AM_GNU_GETTEXT): Remove; now done by:
9147 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
9148 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
9149 for us.
9150
9151 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
9152 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
9153 Define to empty, as gnulib.mk will do the rest for us.
9154 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
9155 for us.
9156 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
9157 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
9158
9159 * src/files.c: Include gnulib's xstrndup.h.
9160
9161 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
9162 (REALLOC): Use xnrealloc, for likewise.
9163 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
9164 (strnlen, memrchr): Remove decls; functions no longer used.
9165 Include <stpcpy.h>.
9166
9167 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
9168 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9169 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
9170 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
9171 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
9172 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
9173 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
9174 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
9175 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
9176 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
9177 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
9178 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9179 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
9180 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
9181 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
9182 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
9183 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
9184 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
9185 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
9186 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
9187 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
9188 Remove, as these files are now generated automatically
9189 by bootstrap or automake.
9190
9191 * po/ChangeLog: Remove: all but one entry was a duplicate
9192 of this file, and I moved that 2000-11-02 entry here.
9193
9194 * config/.cvsignore: Add Makefile, depcomp, install-sh.
9195 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
9196 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
9197 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
9198 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
9199 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
9200 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
9201 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
9202 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
9203 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
9204 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
9205 xstrndup.h.
9206 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
9207 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
9208 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
9209 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
9210 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
9211 * src/.cvsignore: Remove *_.c.
9212
9213
9214 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
9215 support it. (The latest stable gzip doesn't.)
9216
92172004-04-27 Paul Eggert <eggert@twinsun.com>
9218
9219 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
9220 case, as stos_ is now used by destructors due to the 2004-02-09
9221 change.
9222
9223 Remove more K&R C support.
9224 * lib/libiberty.y (PARAMS): Remove. All uses removed.
9225 * lib/subpipe.c (errno): Remove decl.
9226 Include <stdlib.h> unconditionally.
9227 (EXIT_FAILURE): Remove macro.
9228 * src/complain.c (vfprintf, strerror): Remove.
9229 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
9230 unconditionally.
9231 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
9232 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
9233 (strchr, strspn, memchr): Remove decls.
9234 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
9235 unconditionally. Do not declare perror.
9236 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
9237 unconditionally.
9238
9239 * src/complain.c (_): Remove useless defn, as system.h defines this.
9240
9241 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
9242 with latest obstack.h.
9243 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
9244 to procedure types, as obstack.h now does that for us.
9245 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
9246
9247 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
9248 so that this include file can stand alone.
9249 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
9250 does this now. Include subpipe.h first after config.h, to
9251 test whether it can stand alone.
9252
9253 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
9254 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
9255 unused declaration.
9256
9257 * tests/synclines.at (%union synch line): Put a dummy member in
9258 the union, because empty unions aren't allowed in C. Caught
9259 by GCC 3.4.0.
9260
4f16766c
PE
92612004-04-13 Jim Meyering <jim@meyering.net>
9262
9263 * src/conflicts.c (conflicts_print): Correct format string typo:
9264 use `%%' to produce literal `%'. (trivial change)
9265
779e7ceb
PE
92662004-03-30 Paul Eggert <eggert@twinsun.com>
9267
9268 * src/getargs.c (version): Update copyright year to 2004.
9269
9270 * data/c.m4 (b4_int_type): Use 'short int' rather than
9271 'short', and similarly for 'long', 'unsigned', etc.
9272 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
9273 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
9274 yy_yypstack, yydumpstack): Likewise.
9275 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
9276 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
9277 Likewise.
9278 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
9279 yy_stack_print, yyparse): Likewise.
9280 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
9281 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
9282 * lib/bitset.c (bitset_print): Likewise.
9283 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
9284 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9285 * lib/bitsetv.c (bitsetv_dump): Likewise.
9286 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
9287 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
9288 Likewise.
9289 * src/LR0.c (allocate_itemsets): Likewise.
9290 * src/gram.h (rule_number, rule): Likewise.
9291 * src/lalr.h (goto_number): Likewise.
9292 * src/nullable.c (nullable_compute): Likewise.
9293 * src/output.c (prepare_rules): Likewise.
9294 * src/relation.c (relation_print, relation_digraph): Likewise.
9295 * src/relation.h (relation_node): Likewise.
9296 * src/state.h (state_number, transitions, errs, reductions,
9297 struct state): Likewise.
9298 * src/symtab.h (symbol_number, struct symbol): Likewise.
9299 * src/tables.c (vector_number, tally, action_number,
9300 default_goto, goto_actions): Likewise.
9301 * tests/existing.at (GNU Cim Grammar): Likewise.
9302 * tests/regression.at (Web2c Actions): Likewise.
9303
9304 * src/output.c (muscle_insert_short_int_table): Renamed from
9305 muscle_insert_short_table. All uses changed.
9306
d6328241
PH
93072004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9308
9309 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
9310 (declaration): Replace expected_conflicts with expected_sr_conflicts.
9311 Add %expect-rr rule.
4f16766c 9312
d6328241
PH
9313 * src/scan-gram.l: Recognize %expect-rr.
9314
4f16766c 9315 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 9316 expected_conflicts.
4f16766c 9317 (expected_rr_conflicts): Declare.
d6328241
PH
9318
9319 * src/conflicts.c (expected_sr_conflicts): Rename from
9320 expected_conflicts.
9321 (expected_rr_conflicts): Define.
9322 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
9323 for GLR parsers.
9324 Use expected_sr_conflicts in place of expected_conflicts.
9325 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 9326
d6328241 9327 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 9328
1452af69
PE
93292004-03-08 Paul Eggert <eggert@gnu.org>
9330
9331 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 9332 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
9333
9334 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
9335 in lalr1.cc.
9336 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
9337 * src/scan-gram.l (scan_integer): New function.
9338 ({int}): Use it.
9339 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
9340 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
9341 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
9342 Say "long int", not "long", for uniformity with GNU style.
9343
006d217d
PE
93442004-02-25 Paul Eggert <eggert@twinsun.com>
9345
9346 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
9347 compilers. This fixes a problem with Intel's C++ compiler being
9348 chatty, reported by Guido Trentalancia in
161a71f3 9349 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 9350
c2729758
ADL
93512004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
9352
9353 Support %destructor and merge error locations in lalr1.cc.
9354
9355 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
9356 (Parser::stos_): Define unconditionally.
9357 (Parser::destruct_): New method. Generate its body with
9358 b4_yydestruct_generate.
9359 (Parser::error_start_): New attribute.
9360 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
9361 token which are discarded.
9362 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
9363 error_start_ when erroneous token are discarded.
9364 (Parser::parse) <yyerrlab1>: Compute the location of the error
9365 token so that it covers all the discarded tokens.
9366 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
9367 it can be called with `%skeleton "lalr1.cc"', and do that.
9368
dd0e0635
PE
93692004-02-02 Paul Eggert <eggert@twinsun.com>
9370
9371 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
9372 $(top_srcdir)/lib and ../lib. This fixes a bug reported
9373 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
9374 There's no need to mention top_builddir since Automake does that
9375 for us.
9376 (INCLUDES): Remove, as Automake says it's obsolescent.
9377 Contents migrated into AM_CPPFLAGS as described above.
9378 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
9379
93802004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9381
9382 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
9383 (yyreportSyntaxError): Handle case where lookahead token is
9384 YYEMPTY.
9385
be16239b
PH
93862004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9387
9388 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
9389 resulting parsers are compilable with C++.
9390
5fa90832
PE
93912003-12-23 Paul Eggert <eggert@twinsun.com>
9392
9393 * config/depcomp, config/install-sh: Sync with Automake 1.8.
9394 * src/output.c (output_skeleton): Rename local var.
9395 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
9396 Bison tokens, as this runs afoul of the 2003-10-07 change that
9397 disallowed NUL bytes in character constants or string literals.
9398
9399 * tests/local.at: Require Autoconf 2.59's Autotest.
9400 * tests/testsuite.at: Don't include local.at, since we now assume
9401 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
9402 including it.
9403 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
9404 multiple inclusion warnings.
dd0e0635 9405
b165c324
AD
94062003-12-02 Akim Demaille <akim@epita.fr>
9407
9408 * doc/bison.texinfo (How Can I Reset the Parser): More about start
9409 conditions.
9410 From Bruno Haible.
9411
26e06a21
ADL
94122003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
9413
9414 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
9415
92ac3705
PE
94162003-10-07 Paul Eggert <eggert@twinsun.com>
9417
6a5ecb38
PE
9418 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
9419 if testsuite doesn't exist.
9420
92ac3705
PE
9421 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
9422 literals, unfortunately.
9423 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
9424 Complain about NUL bytes in character constants or string literals.
9425
91d2c560
PE
94262003-10-05 Paul Eggert <eggert@twinsun.com>
9427
9428 * NEWS: Don't document %no-default-prec, as it's still
9429 too experimental.
9430 * doc/bison.texinfo: Document %no-default-prec only if
9431 the defaultprec flag is set. Normally it's not.
9432
0cc3da3a
PE
94332003-10-04 Paul Eggert <eggert@twinsun.com>
9434
9435 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
9436 non-modifiable lvalue, instead of a modifiable one.
9437 * doc/bison.texinfo (Actions): Document that $$ can
9438 be assigned to. Do not claim that $$ and $N are
9439 array element references: user code should not rely on this.
9440
22fccf95
PE
94412003-10-01 Paul Eggert <eggert@twinsun.com>
9442
9443 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
9444 (grammar_declaration): Use it.
9445 * src/scan-gram.l: New token %no-default-prec.
9446 * tests/conflicts.at: Revamp tests to use %no-default-prec.
9447 * NEWS, doc/bison.texinfo: Document the above.
9448
fc8f2965
AD
94492003-10-01 Akim Demaille <akim@epita.fr>
9450
9451 VCG no longer supports long_straight_phase.
9452
9453 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
9454 * src/print_graph.c (print_graph): Adjust.
9455
39a06c25
PE
94562003-09-30 Frank Heckenbach <frank@g-n-u.de>
9457 and Paul Eggert <eggert@twinsun.com>
9458
9459 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
9460 Table of Symbols): Document %default-prec.
9461 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
9462 (grammar_declaration): Set default_prec on %default-prec.
9463 * src/scan-gram.l (%default-prec): New token.
9464 * src/reader.h (default_prec): New flag.
9465 * src/reader.c: Likewise.
9466 (packgram): Handle it.
9467 * tests/conflicts.at (%default-prec without %prec,
9468 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 9469
39a06c25
PE
94702003-09-30 Paul Eggert <eggert@twinsun.com>
9471
9472 * tests/testsuite.at: Include local.at, not input.at, fixing
9473 a typo in the 2003-08-25 patch.
9474
62b6aef9
AD
94752003-08-27 Akim Demaille <akim@epita.fr>
9476
9477 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
9478 GCC warnings.
9479
89e1cc61
AD
94802003-08-26 Akim Demaille <akim@epita.fr>
9481
9482 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
9483 "<\#" to avoid magic from Gnus when posting parts of this script.
9484
a08460b0
AD
94852003-08-26 Akim Demaille <akim@epita.fr>
9486
9487 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
9488 (Parser::parse): here.
9489 Adjust: nerrs and errstatus is now replaced by...
9490 (Parser::nerrs_, Parser::errstatus_): New.
9491
603f1cfd
AD
94922003-08-25 Akim Demaille <akim@epita.fr>
9493
9494 * config/announce-gen, Makefile.cfg: New.
9495 * Makefile.am: Adjust.
9496 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
9497 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
9498
cd3684cf
AD
94992003-08-25 Akim Demaille <akim@epita.fr>
9500
9501 When reducing initial empty rules, Bison parser read an initial
9502 location that is not defined. This results in garbage, and that
9503 affects Bison's own parser. Therefore we need (i) to extend Bison
9504 to support a means to initialize this location, and (ii) to use
9505 this CVS Bison to fix CVS Bison's parser.
9506
9507 * src/reader.h, reader.c (epilogue_augment): Remove, replace
9508 with...
9509 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
9510 * src/parse-gram.y: Adjust.
9511 (%initial-action): New.
9512 (%error-verbose): Since we require CVS Bison, there is no reason
9513 not to use it.
9514 * src/scan-gram.l: Adjust.
9515 * src/Makefile.am (YACC): New, to make sure we use our own parser.
9516 * data/yacc.c (yyparse): Use b4_initial_action.
9517
4e03e201
AD
95182003-08-25 Akim Demaille <akim@epita.fr>
9519
9520 * doc/bison.texinfo: Don't promote stdout for error messages.
9521
8c182d05
AD
95222003-08-25 Akim Demaille <akim@epita.fr>
9523
9524 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
9525 From Alexandre Duret-Lutz.
9526
6a60c4cf
PE
95272003-08-25 Akim Demaille <akim@epita.fr>
9528
9529 Version 1.875c.
9530
25f66e1a
AD
95312003-08-25 Akim Demaille <akim@epita.fr>
9532
9533 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
9534 Use them.
9535
5348bfbe
AD
95362003-08-25 Akim Demaille <akim@epita.fr>
9537
9538 * data/lalr1.cc (Parser::reduce_print_): New.
9539 Use it.
9540
47301314
AD
95412003-08-25 Akim Demaille <akim@epita.fr>
9542
9543 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
9544 error recovery loops. This patch is based on
161a71f3 9545 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
9546 Also, augment the similarity between lalr1.cc and yacc.c.
9547 Note: the locations of error recovery rules are not correct yet.
9548
9549 * data/lalr1.cc: Comment changes to augment the similarity between
9550 lalr1.cc and yacc.c.
9551 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
9552 (yyerrlab1): Remove, but where it used to be (now the bottom part of
9553 yyerrlab), when hitting EOF, pop the whole stack here instead of
9554 merely falling thru the default error handling mechanism.
9555 (yyerrorlab): New label, with the old contents of YYERROR,
9556 plus the following change: pop the stack of rhs corresponding
9557 to the production that invoked YYERROR. That is how Yacc
9558 behaves (required by POSIX).
9559 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
9560 fail.
9561
1f7a61ff
AD
95622003-08-25 Akim Demaille <akim@epita.fr>
9563
9564 Tune local.at so that people can "autom4te -l autotest calc.at -o
9565 calc" for instance, to extract a sub test suite.
9566
9567 * tests/testsuite.at: Move the initialization, Autotest version
9568 requirement, and AT_TESTED invocation into...
9569 * tests/local.at: here.
9570 * tests/testsuite.at: Include it for compatibility with Autoconf
9571 2.57.
9572 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
9573 be ignore.
9574
327b5b56
PE
95752003-08-04 Paul Eggert <eggert@twinsun.com>
9576
9577 Rework code slightly to avoid gcc -Wtraditional warnings.
9578 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
9579 The returned value is now stored in *YY0. All callers changed.
9580 * src/output.c (merge_output): Adjust to the above change.
9581
0051e3ed
PE
95822003-07-26 Paul Eggert <eggert@twinsun.com>
9583
9584 * data/glr.c (YYASSERT): New macro.
9585 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
9586 yyresolveStates, yyprocessOneStack):
9587 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
9588 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 9589
137437c6
PE
95902003-07-25 Paul Eggert <eggert@twinsun.com>
9591
5b620e06
PE
9592 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
9593 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 9594 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
9595 by Frank Heckenbach, though I have omitted the structure-initialization
9596 part of his glr-knr.diff patch since I recall that the Portable
9597 C Compiler didn't require that change.
9598
137437c6
PE
9599 Let the user specify how to allocate and free memory.
9600 Derived from a suggestion by Frank Heckenbach in
161a71f3 9601 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
9602 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
9603 All uses of free, malloc, realloc changed to use these macros,
9604 and unnecessary casts removed.
9605 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
9606
ddb85ca5
PE
96072003-07-06 Matthias Mann <MatthiasMann@gmx.de>
9608
9609 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
9610 use s.empty() rather than s == "" to test for empty string; see
161a71f3 9611 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
9612 (trivial change)
9613
39910e09
AD
96142003-06-25 Akim Demaille <akim@epita.fr>
9615
9616 * config/depcomp, config/install-sh: Update from masters.
9617
0ae99356
PE
96182003-06-20 Paul Eggert <eggert@twinsun.com>
9619
9620 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
9621 and return properly parenthesized result.
9622 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
9623 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9624 Remove unnecessary parentheses from uses.
9625 * doc/bison.texinfo (Location Default Action): Describe the
9626 conventions for parentheses.
9627
cd05d13c
PE
96282003-06-19 Paul Eggert <eggert@twinsun.com>
9629
81fd08ca
PE
9630 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
9631 yyreportTree): Do not assume that size_t is the same width as int,
9632 when printing sizes. Print sizes using an unsigned format.
9633 Problem reported by Frank Heckenbach in
161a71f3 9634 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 9635
cd05d13c
PE
9636 Port to Forte Developer 7 C compiler.
9637 * data/glr.c (struct YYLTYPE): If locations are not being used,
9638 declare a single dummy member, as empty structs do not conform
9639 to the C standard.
9640 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
9641 the Forte Developer 7 C compiler complains that end-of-loop
9642 code is not reached.
9643
4dcf140b
PE
96442003-06-17 Paul Eggert <eggert@twinsun.com>
9645
9646 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
9647 avoid warnings from picky compilers about redefinition of PARAMS.
9648
8dd76bee
PE
96492003-06-17 Paul Eggert <eggert@twinsun.com>
9650
9651 Version 1.875b.
9652
9653 * NEWS: Document 1.875b.
9654
9655 * lib/bbitset.h: Do not include config.h; that's the includer's job.
9656 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
9657 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
9658 Don't use 'index' in comments, as it's a builtin fn on some hosts.
9659 * lib/bitset_stats.c: Include gettext.h unconditionally, as
9660 per recent gettext manual's suggestion.
9661 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
9662 Use prototypes, not old-style definitions.
9663 * lib/lbitset.c (lbitset_unused_clear): Likewise.
9664 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
9665 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
9666 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
9667 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
9668 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
9669 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
9670 vbitset_or_and_cmp, vbitset_copy): Likewise.
9671
9672 * lib/libiberty.h: Do not include config.h; that's the includer's job.
9673 Do not include <stdlib.h>.
9674 (PARAMS): Define unconditionally for C89.
9675 (ATTRIBUTE_NORETURN): Remove.
9676 (ATTRIBUTE_UNUSED): Define unconditionally.
9677
9678 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 9679 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
9680 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
9681 * lib/vbitset.c, lib/vbitset.h: New files.
9682 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9683 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
9684 from libbitset.
9685
9686 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
9687 `How Can I Reset @code{yyparse}', since texinfo does not allow
9688 arbitrary @ in node names.
9689
9690 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
9691 shouldn't be needed according to the gettext 0.12.1 documentation
9692 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 9693 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 9694 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 9695 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 9696
8dd76bee
PE
9697 * lib/.cvsignore: Add stdbool.h.
9698 * m4/.cvsignore: Add nls.m4, po.m4.
9699
9700 Upgrade to CVS gnulib.
9701 * stdbool_.h: File renamed from stdbool.h.in.
9702 * configure.ac (AM_STDBOOL_H): Invoke this instead of
9703 AC_HEADER_STDBOOL.
9704 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
9705 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
9706 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
9707 (MOSTLYCLEANFILES): New var.
9708 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
9709 (stdbool.h): New rule.
9710 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
9711 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
9712 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
9713 m4/quote.m4: Upgrade to today's gnulib.
9714
9715 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
9716 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
9717 the tests right now.
9718 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
9719 yyerror are declared before use; C99 requires this.
9720
25005f6a
PH
97212003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9722
9723 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
9724 first.
9725 (yyrecoverSyntaxError): Correct the logic for setting and testing
9726 yyerrState.
9727 Correct comment on handling EOF.
9728 Allow states with only a default reduction, rather than failing
8dd76bee 9729 (I can't quite reconstruct why these were not allowed before).
25005f6a 9730
137437c6 9731 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 9732 buffer overruns, corrupting state.
8dd76bee
PE
9733
9734 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
9735 definition.
9736 * src/reader.h (max_left_semantic_context): New variable declaration.
9737 * src/scan-gram.l (max_left_semantic_context): Define.
9738 (handle_action_dollar): Update max_left_semantic_context.
9739 * data/glr.c (YYMAXLEFT): New definition.
9740 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
9741 (yyresolveAction): Ditto.
9742
9743 Fixes to problems with location handling in GLR parsers reported by
9744 Frank Heckenbach (2003/06/05).
9745
9746 * data/glr.c (YYLTYPE): Make trivial if locations not used.
9747 (YYRHSLOC): Add parentheses, and define only if locations used.
9748 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
9749 locations not used.
9750 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
9751 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 9752
25005f6a
PH
9753 * tests/cxx-type.at: Exercise location information; update tests
9754 to differentiate output with and without locations.
8dd76bee 9755 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
9756 because default YYLTYPE not yet defined.
9757 Change semantic actions to compute strings, rather than printing
9758 them directly (to test proper passing of semantics values). Change
9759 output to prefix notation and update test data and expected results.
9760 (yylex): Track locations.
9761 (stmtMerge): Return value rather than printing, and include arguments
9762 in value.
8dd76bee 9763
711f40b7
PE
97642003-06-03 Paul Eggert <eggert@twinsun.com>
9765
9766 Avoid warnings generated by GCC 2.95.4 when Bison is
9767 configured with --enable-gcc-warnings.
9768 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
9769 yy::]b4_parser_class_name[::translate_,
9770 yy::Stack::operator[] (unsigned),
9771 yy::Stack::operator[] (unsigned) const,
9772 yy::Slice::operator[] (unsigned),
9773 yy::Slice::operator[] (unsigned) const):
9774 Rename local vars to avoid warnings.
9775 * tests/glr-regression.at (Improper handling of embedded actions
9776 and $-N in GLR parsers): Remove unused local variable from yylex.
9777 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
9778 (void) as arg when not pure, since we now assume C89 when building
9779 Bison. Pacify GCC by using parameter.
9780
ac695f7d
PE
97812003-06-02 Paul Eggert <eggert@twinsun.com>
9782
9783 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
9784 yy::Location::lines, yy::Location::columns): Rename arguments
9785 to avoid shadowing; this removes a warning generated by GCC 3.3.
9786
26ec81e0
PE
97872003-06-01 Paul Eggert <eggert@twinsun.com>
9788
9789 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
9790 to g++, as GCC 3.3 complains if you do it.
9791 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
9792 everything that WARNING_CFLAGS has, except omit warnings
9793 not suitable for C++.
9794 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
9795 * tests/atlocal.in (CXXFLAGS): New var.
9796 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
9797
9798 Fix a GLR parser bug I reported in February; see
161a71f3 9799 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
9800 The problem was that GLR parsers did not conform to the C standard,
9801 because actions like { $1 = $2 + $3; } expanded to expressions
9802 that invoked YYFILL in separate subexpressions, and YYFILL assigned
9803 to a local variable. The C standard says that expressions
9804 like (var = f ()) + (var = f ()) have undefined behavior.
9805 Another problem was that GCC sometimes issues warnings that
9806 yyfill and its parameters are unused.
9807
9808 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
9809 as possibly unused.
9810 (yyfill): New function.
9811 (YYFILL): Use it.
9812 (yyuserAction): Change type of yynormal to bool, so that it matches
9813 the new yyfill signature. Mark it as possibly unused.
9814
9815
9816 Follow up on a bug I reported in February, where a Bison-generated
9817 parser can loop. Provide a test case and a fix for yacc.c. I
9818 don't have a fix for lalr1.cc or for glr.c, unfortunately.
9819 The original bug report is in:
161a71f3 9820 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
9821
9822 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
9823 macro's size was becoming unwieldy.
9824 (yyerrlab): Do not discard an empty lookahead symbol, as this
9825 might destroy garbage.
9826 (yyerrorlab): New label, with the old contents of YYERROR,
9827 plus the following change: pop the stack of rhs corresponding
9828 to the production that invoked YYERROR. That is how Yacc
9829 behaves, and POSIX requires this behavior.
9830 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
9831 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
9832 Define 'alarm' to do nothing if unistd.h is not available.
9833 Add a new rule "exp: '-' error;" to test the above change to
9834 data/yacc.c. Use 'alarm' to abort any test taking longer than
9835 10 seconds, as it's probably looping.
9836 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
9837 Also, the new yacc.c generates two fewer diagnostics for an
9838 existing test.
9839
d0829076
PE
98402003-05-24 Paul Eggert <eggert@twinsun.com>
9841
c6ae27df
PE
9842 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
9843 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
9844 This fixes a problem reported by John Bowman when the Compaq/HP
9845 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
9846 -ansi -Wall -gall).
9847 * data/yacc.c (union yyalloc): Likewise.
9848 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 9849
d0829076
PE
9850 Switch from 'int' to 'bool' where that makes sense.
9851
9852 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
9853 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
9854 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
9855 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
9856 Return or accept bool, not int. All callers changed.
9857 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
9858 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
9859 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
9860 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
9861 bitset_or_and_cmp_): Likewise.
9862 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
9863 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
9864 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
9865 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
9866 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
9867 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
9868 bitset_stats_or_and_cmp): Likewise.
9869 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
9870 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
9871 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
9872 ebitset_xor_cmp): Likewise.
9873 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
9874 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
9875 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
9876 lbitset_xor_cmp): Likewise.
9877 * lib/bbitset.h: Include <stdbool.h>.
9878 (struct bitset_vtable): The following members now return bool, not
9879 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
9880 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
9881 or_and_cmp).
9882 * src/conflicts.c (count_rr_conflicts): Likewise.
9883 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
9884 All uses changed.
9885 * lib/ebitset.c (ebitset_obstack_init): Likewise.
9886 * lib/lbitset.c (lbitset_obstack_init): Likewise.
9887 * src/getargs.c (debug_flag, defines_flag, locations_flag,
9888 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9889 graph_flag): Likewise.
9890 * src/getargs.h (debug_flag, defines_flag, locations_flag,
9891 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9892 graph_flag): Likewise.
9893 * src/output.c (error_verbose): Likewise.
9894 * src/output.h (error_verbose): Likewise.
9895 * src/reader.c (start_flag, typed): Likewise.
9896 * src/reader.h (typed): Likewise.
9897 * src/getargs.c (LOCATIONS_OPTION): New constant.
9898 (long_options, getargs): Use it.
9899 * src/lalr.c (build_relations): Use bool, not int.
9900 * src/nullable.c (nullable_compute): Likewise.
9901 * src/print.c (print_reductions): Likewise.
9902 * src/tables.c (action_row, pack_vector): Likewise.
9903 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
9904 * src/output.c (prepare): Use it.
9905 * src/output.c (token_definitions_output,
9906 symbol_destructors_output, symbol_destructors_output): Use string,
9907 not boolean integer, to keep track of whether to output separator.
9908 * src/print_graph.c (print_core): Likewise.
9909 * src/state.c (state_rule_lookaheads_print): Likewise.
9910
9911 * config/install-sh: Sync from automake 1.7.5.
9912
6b2584b7
PE
99132003-05-14 Paul Eggert <eggert@twinsun.com>
9914
9915 * src/parse-gram.y (rules_or_grammar_declaration): Require a
9916 semicolon after a grammar declaration, in the interest of possible
9917 future changes to the Bison input language.
9918 Do not allow a stray semicolon at the start of the grammar.
9919 (rhses.1): Allow one or more semicolons after any rule, including
9920 just before "|" as required by POSIX.
9921 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
9922 grammar.
9923
caf37a36
ADL
99242003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
9925
9926 %parse-param support for lalr1.cc.
9927
9928 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
9929 b4_cc_constructor_calls, b4_cc_constructor_call,
9930 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
9931 definitions.
9932 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
9933 parse-param arguments.
9934 (yy::b4_parser_class_name): Declare instance variables to
9935 hold parse-param arguments.
9936 * tests/calc.at: s/value/semantic_value/ because value clashes
9937 with a member of yy::b4_parser_class_name. Adjust C++ code
9938 to handle %parse-param. Enable %parse-param test in C++.
9939
3ab37077
PE
99402003-05-12 Paul Eggert <eggert@twinsun.com>
9941
9942 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
9943 English a bit. Fix fclose typo. Change "const char" to "char
9944 const", and use ANSI C rather than K&R for "main". Suggest
9945 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
9946 and suggest yy_switch_to_buffer.
9947
99482003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
9949
9950 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
9951 C89. This avoids a diagnostic on compilers that define __STDC__
9952 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 9953 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 9954
e743727f
PE
99552003-05-03 Paul Eggert <eggert@twinsun.com>
9956
9957 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
9958 Do not overrun array bounds.
9959 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 9960 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 9961
916708d5
AD
99622003-04-29 Akim Demaille <akim@epita.fr>
9963
9964 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
9965 * src/getargs.c, src/getargs.h: here, as bool, not int.
9966 (nondeterministic_parser): New.
9967 * src/parse-gram.y, src/scan-gram.l: Support
9968 %nondeterministic-parser.
9969 * src/output.c (prepare): Use nondeterministic_parser instead
9970 of glr_parser where appropriate.
9971 * src/tables.c (conflict_row, action_row, save_row)
9972 (token_actions, token_actions, pack_vector): Ditto.
9973
a06ea4aa
AD
99742003-04-29 Akim Demaille <akim@epita.fr>
9975
9976 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
9977
211074ca
AD
99782003-04-29 Akim Demaille <akim@epita.fr>
9979
9980 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
9981 with %pure-parser and %locations to exercise the patch from Yakov
9982 Markovitch below.
9983
6175ffe3
PE
99842003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
9985
9986 * data/yacc.c: (b4_lex_param): Corrected for the case where
9987 %lex-param is provided and %pure-parser isn't.
9988
b1e95857
PE
99892003-04-27 Paul Eggert <eggert@twinsun.com>
9990
9991 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 9992 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
9993 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
9994 if it is not defined.
9995 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
9996
acda9df6
PE
99972003-04-26 Paul Eggert <eggert@twinsun.com>
9998
3470c57b
PE
9999 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
10000 Declare to be of type suitable for the ninf value itself, not of
10001 type suitable for the corresponding table, since the latter might
10002 be unsigned but the ninf value might be negative. This fixes a
10003 bug reported by Alexandre Duret-Lutz in
161a71f3 10004 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 10005
acda9df6
PE
10006 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
10007 invokes it. We shouldn't invoke it twice because it will attempt
10008 to put error.o in the archive twice. This fixes a glitch reported
10009 by Martin Mokrejs in
161a71f3 10010 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 10011
b5250f26
PE
100122003-04-21 Paul Eggert <eggert@twinsun.com>
10013
10014 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
10015 to gnulib.
10016
089ac0f1
PE
100172003-04-21 Yakov Markovitch <Markovitch@iso.ru>
10018
10019 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
10020 Fix obvious typo that results in uncompilable GLR parsers
10021 when both %pure-parser and %locations are used. (trivial change)
10022
5ededac6
PE
100232003-04-17 Paul Eggert <eggert@twinsun.com>
10024
1b8f2fff
PE
10025 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
10026 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
10027 Do not insert the expected token via unput, as this runs afoul
10028 of a POSIX-compatibility bug in flex 2.5.31.
10029 All uses changed to BEGIN the parent state,
10030 since we no longer insert the expected token via unput.
10031 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
10032 that is no longer emitted after the above change.
10033
5ededac6
PE
10034 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
10035 the first one. This change is from Paul Hilfinger, and it fixes
10036 regression reported by Werner Lemberg in
161a71f3 10037 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
10038
10039 (resolve_sr_conflict): Don't invoke state_errs_set
10040 unless one or more tokens have been explicitly made errors.
10041 Otherwise, the above change causes Bison to abort.
10042
10043 * tests/existing.at (GNU pic Grammar): New test case, taken from
10044 Lemberg's email.
10045
b8be9132
AD
100462003-03-31 Akim Demaille <akim@epita.fr>
10047
10048 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
10049
d423d460
AD
100502003-03-31 Akim Demaille <akim@epita.fr>
10051
10052 * src/output.c (prepare_symbols): Avoid trailing spaces in the
10053 output.
10054
c7e441b4
AD
100552003-03-31 Akim Demaille <akim@epita.fr>
10056
10057 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
10058 From Paul Hilfinger.
10059
231897ad
AD
100602003-03-29 Akim Demaille <akim@epita.fr>
10061
10062 * m4/error.m4: Do not put under dynamic conditions some code which
10063 expansion is under static control.
10064
5b066063
AD
100652003-03-29 Akim Demaille <akim@epita.fr>
10066
10067 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
10068
22a74fec
AD
100692003-03-29 Akim Demaille <akim@epita.fr>
10070
10071 * doc/bison.texinfo (Strings are Destroyed): New.
10072
0eee27e7
PE
100732003-03-13 Paul Eggert <eggert@twinsun.com>
10074
10075 * .cvsignore: Add configure.lineno.
10076 * src/.cvsignore: Add yacc.
10077 * tests/.cvsignore: Add testsuite.log.
10078 * doc/fdl.texi: Sync with latest FSF version.
10079
f61aad93
PE
100802003-03-12 Paul Eggert <eggert@twinsun.com>
10081
537636c7
PE
10082 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
10083 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
10084 cursor, instead of leaving it undefined. This fixes a bug
10085 reported by Tim Van Holder in
161a71f3 10086 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
10087 * tests/input.at (Torturing the Scanner): Test the scanner on
10088 an empty input file, which was Tim Van Holder's test case.
10089
10090 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
10091 <sys/resource.h> can be included, include sys/time.h and
10092 sys/times.h first, if available. This works around the SunOS
10093 4.1.4 porting bug reported by Bruce Becker in
161a71f3 10094 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
10095
10096 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
10097 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
10098 AC_HEADER_SYS_WAIT.
10099
f61aad93
PE
10100 Merge changes from gnulib. This was prompted because the CVS
10101 snapshot didn't build on Solaris 7 due to strnlen problems.
10102
10103 These changes need to be merged back into gnulib:
10104 * lib/hash.c: Include <stdbool.h> unconditionally.
10105 * m4/onceonly.m4 (m4_quote): New macro.
10106 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
10107 Quote AC_FOREACH variable-expansions properly.
10108 The 2003-01-03 obstack.h change also needs merging.
10109 {end of changes requiring merging}
5b066063 10110
f61aad93
PE
10111 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10112 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
10113 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
10114 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
10115 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
10116 New files, imported from gnulib.
10117 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
10118 above.
10119
10120 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
10121 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
10122 gnulib sources.
10123
10124 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
10125 Add.
10126 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
10127 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
10128 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
10129 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
10130 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
10131 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
10132 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
10133 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
10134 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
10135 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
10136 (jm_PREREQ_ARGMATCH): Remove.
10137 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
10138 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
10139
10140 * src/system.h: Include <stdbool.h> unconditionally.
10141
10142 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
10143 assuming at least C89 in the bitset code for some time now.
10144
d2ffe116
AD
101452003-03-03 Akim Demaille <akim@epita.fr>
10146
10147 * ro.po: New.
10148
052826fd
AD
101492003-03-02 Akim Demaille <akim@epita.fr>
10150
10151 * doc/bison.texinfo (Table of Symbols): Reactivate the
10152 documentation for %lex-param, and %parse-param.
10153
c4749565
AD
101542003-03-02 Akim Demaille <akim@epita.fr>
10155
10156 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
10157 generate verbose error messages.
10158 Use the number of tokens as an upper bound in yytname, as it
10159 cannot be a non terminal.
10160
d5286af1
AD
101612003-03-02 Akim Demaille <akim@epita.fr>
10162
10163 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
10164 message.
10165
22e304a6
AD
101662003-03-02 Akim Demaille <akim@epita.fr>
10167
22e304a6
AD
10168 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
10169 Use them to exercise yycheck overrun.
10170 Based on Andrew Suffield's grammar.
10171
67a25fed
AD
101722003-03-02 Akim Demaille <akim@epita.fr>
10173
10174 Create tests/local.at for Bison generic testing macros.
10175
10176 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
10177 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
10178 This new file.
10179 * tests/calc.at (AT_CHECK_CALC): Adjust.
10180 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
10181 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
10182 * tests/local.at: here.
10183 (AT_COMPILE_CXX): Tags the tests using it as c++.
10184 Ignore the test if CXX is not functional.
10185
9c2b381f
PE
101862003-03-01 Paul Eggert <eggert@twinsun.com>
10187
10188 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
10189 not loc->end, since loc->end might contain garbage and this leads
10190 to undefined behavior on some platforms.
10191 (id_loc, token_start): Use (IF_LINTed) initial values that do not
10192 depend on *loc, so that the reader doesn't give the the false
10193 impression that *loc is initialized.
10194 (<INITIAL>"%%"): Do not bother setting code_start, since its value
10195 does not survive the return.
10196
0433ba88
AD
101972003-03-01 Akim Demaille <akim@epita.fr>
10198
10199 * src/scan-gram.l (code_start): Always initialize it when entering
10200 into yylex, as SC_EPILOGUE is activated *before* the corresponding
10201 yylex invocation. An alternative would be making it static, but
10202 then it starts with the second %%'s beginning, instead of its end.
10203
b305ea69
PE
102042003-02-28 Paul Eggert <eggert@twinsun.com>
10205
10206 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
10207 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 10208 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 10209
c3d25e01
PE
102102003-02-26 Paul Eggert <eggert@twinsun.com>
10211
10212 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
10213 Remove Sequent/Pyramid discussion (nobody uses them any more).
10214 Merge VMS and MS-DOS discussion; these ports may well be dead
10215 but let's keep mentioning them for now. Put <> around email
10216 addresses. Add copyright notice.
10217
c267ffbc
PE
102182003-02-24 Paul Eggert <eggert@twinsun.com>
10219
10220 * data/glr.c (yy_reduce_print): yylineno -> yylno,
10221 to avoid collision with flex use of yylineno.
10222 Problem reported by Bruce Lilly in
161a71f3 10223 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
10224 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10225 * data/yacc.c (yy_reduce_print): Likewise.
10226
10227 * config/depcomp: Sync with Automake 1.7.3.
10228
f939fc12
AD
102292003-02-21 Akim Demaille <akim@epita.fr>
10230
10231 * data/lalr1.cc: Use temporary variables instead of casts to
10232 change integer types.
10233 Suggested by Paul Eggert.
10234
95923bd6
AD
102352003-02-21 Akim Demaille <akim@epita.fr>
10236
10237 * doc/bison.texinfo: Use "location" consistently to refer to @n,
10238 to avoid confusions with lalr1.cc's notion of Position.
10239 Suggested by Paul Eggert.
10240
2cdc240e
AD
102412003-02-20 Akim Demaille <akim@epita.fr>
10242
10243 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
10244 before initial_columns.
10245 (location.hh): Use consistent variable names when defining the
10246 operator<<.
10247 Use "last" so that we subtract from Positions, not from unsigned.
10248
5d003116
AD
102492003-02-20 Akim Demaille <akim@epita.fr>
10250
10251 * data/lalr1.cc (position.hh): New subfile, including the extended
10252 and Doxygen'ed documentation of class Position.
10253 (location.hh): Use it.
10254 Document a` la Doxygen.
ba1ecc07 10255 With the help of Benoit Perrot.
5d003116 10256
d02b25f9
AD
102572003-02-20 Akim Demaille <akim@epita.fr>
10258
10259 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
10260 AT_YACC_IF.
10261 Redefine AT_YYERROR_SEES_LOC_IF using it.
10262 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
10263 not defined.
10264 Don't use the location in yy::Parser::error_ and
10265 yy::Parser::print_ when not %locations.
10266 Activate more lalr1.cc tests.
10267
0d1c3a04
AD
102682003-02-19 Akim Demaille <akim@epita.fr>
10269
10270 * data/lalr1.cc: When displaying a line number, be sure to make it
10271 an int.
10272
60a777aa
AD
102732003-02-19 Akim Demaille <akim@epita.fr>
10274
10275 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
10276 Remove, useless.
10277 (YYABORT, YYACCEPT, YYERROR): New.
10278 * tests/calc.at: Renable the lalr1.cc test.
10279
0b86fc41
AD
102802003-02-19 Akim Demaille <akim@epita.fr>
10281
10282 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
10283 error recovery, mixing with/without pops and discarding of the
10284 lookahead.
10285 Exercise YYERROR.
10286 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
10287
da99a5dc
PE
102882003-02-17 Paul Eggert <eggert@twinsun.com>
10289
10290 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
10291 * tests/testsuite.at (AT_COMPILE): Use them.
10292 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 10293 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 10294
93b8c255
PE
102952003-02-12 Paul Eggert <eggert@twinsun.com>
10296
10297 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
10298 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 10299 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
10300 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
10301 Check for malloc failure, for consistency with yacc.c.
10302 (yytname_size): Remove, for consistency with yacc.c.
10303
10304 The bug still remains in data/lalr1.cc, as I didn't have time
10305 to fix it there.
10306
7548fed2
AD
103072003-02-06 Akim Demaille <akim@epita.fr>
10308
10309 * configure.ac (GXX): Rename as...
10310 (CXX): this, to keep the original Autoconf semantics.
10311 Require 2.57.
10312 * data/lalr1.cc: Fix b4_copyright invocations.
10313 If YYDEBUG is not defined, don't depend upon name_ being defined.
10314 (location.hh): Include string and iostream.
10315 (Position::filename): New member.
10316 (Position::Position ()): New.
10317 (operator<< (Position)): New.
10318 (operator- (Position, int)): New.
10319 (Location::first, Location::last): Rename as...
10320 (Location::begin, Location::end): these, to mock the conventional
10321 iterator names.
10322 (operator<< (Location)): New.
10323 * tests/atlocal.in (CXX): New.
10324 * tests/testsuite.at (AT_COMPILE_CXX): New.
10325 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
10326 locations in a more synthetic way.
10327 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
10328 lalr1.cc is used.
10329 Adjust the C locations to match those from Emacs: first column is
10330 column 0.
10331 Change all the expected results.
10332 Conform to the GCS: simplify the locations when applicable.
10333 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
10334 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
10335 these CPP macros with the m4 macros new defined by...
10336 (AT_CHECK_PUSHDEFS): this, i.e.:
10337 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 10338 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
10339 New macros.
10340 (AT_CHECK_POPDEFS): Undefine them.
10341 (AT_CHECK_CALC_LALR1_CC): New.
10342 Use it for the first lalr1.cc test.
10343
43a176ef
AD
103442003-02-04 Akim Demaille <akim@epita.fr>
10345
10346 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
10347 Location as is defined.
10348
fc049e9c
AD
103492003-02-04 Akim Demaille <akim@epita.fr>
10350
10351 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
10352 name_ being defined.
10353
a737b216
PE
103542003-02-03 Paul Eggert <eggert@twinsun.com>
10355
10356 * src/gram.h (start_symbol): Remove unused decl.
10357
10358 Use more-consistent naming conventions for local vars.
10359
10360 * src/derives.c (derives_compute): Change type of local var from
10361 int to rule_number.
10362 * src/gram.c (grammar_rules_partial_print): Likewise.
10363 * src/print.c (print_core): Likewise.
10364 * src/reduce.c (reduce_grammar_tables): Likewise.
10365
10366 * src/gram.c (grammar_dump): Change name of item_number *
10367 local var from r to rp.
10368 * src/nullable.c (nullable_compute): Likewise.
10369
10370 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
10371
10372 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
10373 for symbol or symbol_number var.
10374 * src/reader.c (grammar_start_symbol_set): Likewise.
10375 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
10376 Likewise.
10377 * src/state.c (transitions_to): Likewise.
10378 * src/state.h: Likewise.
10379 * src/tables.c (symbol_number_to_vector_number): Likewise.
10380
10381 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
10382 char * var.
10383
10384 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
10385 var.
10386
10387 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
10388 var.
10389
10390 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
10391 Use str, not s, for char * var. Use ch, not c, for character var.
10392 Use size for size var.
10393
10394 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
10395 char * var.
10396 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
10397 uniqstr var.
10398 * src/uniqstr.h: Likewise.
10399
10400 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10401 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10402 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
10403 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
10404 param to have same name as that of enum, so that we don't use
10405 "s" to stand for a non-state.
10406
68e93ad5
AD
104072003-02-02 Akim Demaille <akim@epita.fr>
10408
10409 * src/scan-skel.l: Scan more than one inert character per yylex
10410 invocation.
10411
92898986
PE
104122003-02-01 Paul Eggert <eggert@twinsun.com>
10413
10414 Version 1.875a.
10415
1d9d5d71
PE
10416 * po/LINGUAS: Add ms.
10417
0435d061
AD
104182003-01-30 Akim Demaille <akim@epita.fr>
10419
10420 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
10421
6029a57f
PH
104222003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10423
10424 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
10425 of $1.
0435d061
AD
10426
10427 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 10428 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 10429 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 10430
6029a57f
PH
10431 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
10432 (b4_rhs_location): Ditto.
0435d061 10433 (yyfill): New function to copy from stack tree into array
6029a57f 10434 incrementally.
0435d061
AD
10435 (yyuserAction): Modify to allow incremental move of semantic values
10436 to rhs array when in GLR mode.
10437 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
10438 as needed.
10439 Remove dummy use of yystack, as there is now a guaranteed use.
10440 (yydoAction): Modify to allow incremental move of semantic values
10441 to rhs array when in GLR mode.
10442 (yyresolveAction): Ditto.
10443 (yyglrShiftDefer): Update comment.
0435d061 10444 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
10445 (yyglrReduce): Ditto.
10446 (yydoAction): Ditto
0435d061 10447
6029a57f
PH
10448 * tests/glr-regr1.at: Rename to ...
10449 * tests/glr-regression.at: Add new regression test for the problems
10450 described above (adapted from S. Eken).
10451 Update copyright notice.
10452 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
10453 * tests/Makefile.am: Ditto.
10454
6cee6297
PE
104552003-01-28 Paul Eggert <eggert@twinsun.com>
10456
10457 * data/lalr1.cc: Do not use @output_header_name@ unless
10458 b4_defines_flag is set. This fixes two bugs reported by
10459 Tim Van Holder in
161a71f3
PE
10460 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
10461 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 10462
b2a836b5
PE
104632003-01-21 Paul Eggert <eggert@twinsun.com>
10464
10465 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
10466 we don't need to worry about yyerrlab1 being reported as an
10467 "unused label" by non-GCC C compilers. The downside is that if
10468 locations are used then a couple of statements are duplicated each
10469 time YYERROR is invoked, but the upside is that the warnings
10470 should vanish.
10471 (yyerrlab1): Move code to YERROR.
10472 (yyerrlab2): Remove. Change uses back to yyerrlab1.
10473 This reverts some of the 2002-12-27 change.
10474
4196b931
PE
104752003-01-17 Paul Eggert <eggert@twinsun.com>
10476
10477 * src/output.c (symbol_printers_output): Fix typo that led
10478 to core dump. Problem reported by Antonio Rus in
161a71f3 10479 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 10480
3ae831b4
AD
104812003-01-13 Akim Demaille <akim@epita.fr>,
10482 Quoc Peyrot <chojin@lrde.epita.fr>,
10483 Robert Anisko <anisko_r@lrde.epita.fr>
10484
10485 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
10486 when the stacks contain one element, as the loop would otherwise
10487 free the last state, and then use the top state (the one we just
10488 popped). This means that the initial elements will not be freed
10489 explicitly, as is the case in yacc.c; it is not a problem, as
10490 these elements have fake values.
10491
e3aa65c5
PE
104922003-01-11 Paul Eggert <eggert@twinsun.com>
10493
10494 * NEWS: %expect-violations are now just warnings, reverting
10495 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
10496 bootstrapping problem reported by Matthias Klose; see
161a71f3 10497 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
10498 * src/conflicts.c (conflicts_print): Likewise.
10499 * tests/conflicts.at (%expect not enough, %expect too much,
10500 %expect with reduce conflicts): Likewise.
10501 * doc/bison.texinfo (Expect Decl): Document this. Also mention
10502 that the warning is enabled if the number of conflicts changes
10503 (not necessarily increases).
10504
10505 * src/getargs.c (version): Update copyright year.
10506
f0057011
AD
105072003-01-09 Akim Demaille <akim@epita.fr>
10508
10509 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
10510
1ee6d2a0
PE
105112003-01-08 Paul Eggert <eggert@twinsun.com>
10512
10513 * Makefile.maint (WGETFLAGS):
10514 New macro, containing "-C off" to disable proxy caches.
10515 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
10516 (rel-check): Use $(WGET) instead of wget.
10517
d4fd77c4
PE
105182003-01-06 Paul Eggert <eggert@twinsun.com>
10519
10520 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
10521 the GLR paper of Scott, Johnstone and Hussain.
10522
464c6927
PE
105232003-01-04 Paul Eggert <eggert@twinsun.com>
10524
d600ee67
PE
10525 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
10526 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
10527 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
10528 (EXTRA_LIBRARIES): New var, for liby.a.
10529 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
10530 (EXTRA_SCRIPTS): New var, for yacc.
10531
464c6927
PE
10532 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
10533 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
10534 Problem reported by Nelson H. F. Beebe.
10535
105362003-01-03 Paul Eggert <eggert@twinsun.com>
10537
10538 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
10539 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
10540 when compiling Bison 1.875's `bitset bset = obstack_alloc
10541 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
10542
10543 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
10544 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
10545 grow to a huge size with typical invocation.
d600ee67 10546
464c6927
PE
10547 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
10548 Use the pattern recommended by Autoconf 2.57, except also protect
10549 against double-definition.
10550 * src/system.h: Likewise.
10551 Portability issues reported by Nelson H. F. Beebe.
d600ee67 10552
464c6927
PE
10553 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
10554 All uses changed. Provide a definition in both C and C++.
10555 (yytrue, yyfalse): Define even if defined (__cplusplus).
10556
10557 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
10558 Reported by Nelson H. F. Beebe.
d600ee67 10559
464c6927
PE
10560 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
10561
0f42c7d5
PE
105622003-01-02 Paul Eggert <eggert@twinsun.com>
10563
10564 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
10565 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
10566 Bug reported by Nelson H. F. Beebe.
10567
dc546b0f
PE
105682003-01-01 Paul Eggert <eggert@twinsun.com>
10569
10570 * Version 1.875.
10571
2c09b6a7
PE
105722002-12-30 Paul Eggert <eggert@twinsun.com>
10573
10574 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
10575 Moved here from...
10576 (<INITIAL>","): Here. This causes stray "," to be treated
10577 more uniformly.
10578
dc546b0f 10579 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
10580 last brace in braced code when not in Yacc mode, for compatibility
10581 with Bison 1.35. This resurrects the 2001-12-15 patch to
10582 src/reader.c.
10583
10584 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
10585 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
10586
535c0f63
PE
105872002-12-28 Paul Eggert <eggert@twinsun.com>
10588
10589 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
10590 that of SYM's type. This fixes Debian bug 168069, reported by
10591 Thomas Olsson.
d600ee67 10592
963fcc17
PE
105932002-12-28 Paul Eggert <eggert@twinsun.com>
10594
10595 Version 1.75f.
10596
10597 Switch back to the Yacc style of conflict reports, undoing some
10598 of the 2002-07-30 change.
10599 * doc/bison.texinfo (Understanding): Use Yacc style for
10600 conflict reports. Also, use new way of locating rules.
10601 * src/conflicts.c (conflict_report):
10602 Renamed from conflict_report_yacc, removing the old
10603 'conflict_report'. Translate the entire conflict report at once,
10604 so that we don't assume that "," has the same interpretation in
10605 all languages.
10606 (conflicts_output): Use Yacc-style conflict report for each state,
10607 instead of our more-complicated style.
10608 (conflicts_print): Use Yacc-style conflict report, except print
10609 the input file name when not emulating Yacc.
10610 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
10611 Conflicted Reduction, %expect not enough, %expect too much,
10612 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
10613 * tests/existing.at (GNU Cim Grammar): Likewise.
10614 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
10615
10616 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
10617 fatal): Don't invoke fflush; it's not needed and it might even be
10618 harmful for stdout, as stdout might not be open.
10619 * src/reduce.c (reduce_print): Likewise.
10620
b1efe548
PE
106212002-12-27 Paul Eggert <eggert@twinsun.com>
10622
10623 Fix a bug where error locations were not being recorded correctly.
10624 This problem was originally reported by Paul Hilfinger in
161a71f3 10625 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
10626
10627 * data/yacc.c (yyparse): New local var yylerrsp, to record the
10628 top of the location stack's error locations.
10629 (yyerrlab): Set it. When discarding a token, push its location
10630 onto yylerrsp so that we don't lose track of the error's end.
10631 (yyerrlab1): Now is only the target of YYERROR, so that we can
10632 properly record the location of the action that failed. For GCC
10633 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
10634 GCC warning about yyerrlab1 being unused if YYERROR is unused.
10635 (yyerrlab2): New label, which yyerrlab now falls through to.
10636 Compute the error's location by applying YYLLOC_DEFAULT to
10637 the locations of all the symbols that went into the error.
10638 * doc/bison.texinfo (Location Default Action): Mention that
10639 YYLLOC_DEFAULT is also invoked for syntax errors.
10640 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10641 Error locations include the locations of all the tokens that were
10642 discarded, not just the last token.
d600ee67 10643
983c5c2c
PE
106442002-12-26 Paul Eggert <eggert@twinsun.com>
10645
b1efe548
PE
10646 * src/files.c: Include quote.h.
10647 (compute_output_file_names): Warn if we detect conflicting
10648 outputs to the same file. This should catch the misunderstanding
10649 exemplified by Debian Bug 165349, reported by Bruce Stephens..
10650
10651 * src/conflicts.c (conflicts_print): If the user specifies
10652 "%expect N", report an error if there are any reduce/reduce
10653 conflicts. This is what the manual says should happen.
10654 This fixes Debian bug 130890, reported by Anthony DeRobertis.
10655 * tests/conflicts.at (%expect with reduce conflicts): New test.
10656
983c5c2c
PE
10657 Don't use m4_include on relative file names, as it doesn't work as
10658 desired if there happens to be a file with that name under ".".
d600ee67 10659
983c5c2c
PE
10660 * m4sugar/version.m4: Remove; it was included but it wasn't used.
10661 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
10662 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
10663 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
10664 * src/output.c (output_skeleton): Use full path names when
10665 specifying a file to include; don't rely on include path, as
10666 it's unreliable when the working file contains a file with
10667 that name.
d600ee67 10668
983c5c2c
PE
106692002-12-25 Paul Eggert <eggert@twinsun.com>
10670
10671 Remove obsolete references to bison.simple and bison.hairy.
10672 Problem mentioned by Aubin Mahe in
161a71f3 10673 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
10674 * data/glr.c: Comment fix.
10675 * doc/bison.1: Remove references. Also, mention "yacc".
10676
10677 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
10678 with -g option.
10679
10680 * src/parse-gram.y (declaration): Use enum "report_states" rather
10681 than its numeric value 1.
10682
10683 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
10684 opening a new one. This fixes Debian bug 165349, reported by
10685 Bruce Stephens.
10686
23f2d9dc
PE
106872002-12-24 Paul Eggert <eggert@twinsun.com>
10688
10689 Version 1.75e.
10690
10691 * Makefile.maint (cvs-update): Don't assume that the shell
10692 supports $(...), as Solaris sh doesn't.
10693
10694 * src/parse-gram.y (lloc_default): Remove test for empty
10695 nonterminals at the end, since it didn't change the result.
10696
106972002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
10698
10699 If the user does not define YYSTYPE as a macro, Bison now declares it
10700 using typedef instead of defining it as a macro. POSIX requires this.
10701 For consistency, YYLTYPE is also declared instead of defined.
10702
10703 %union directives can now have a tag before the `{', e.g., the
10704 directive `%union foo {...}' now generates the C code
10705 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
10706 The default union tag is `YYSTYPE', for compatibility with Solaris 9
10707 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
10708 instead of `yyltype'.
10709
10710 `yystype' and `yyltype' are now obsolescent macros instead of being
10711 typedefs or tags; they are no longer documented and will be
10712 withdrawn in a future release.
10713
10714 * data/glr.c (b4_location_type): Remove.
10715 (YYSTYPE): Renamed from yystype.
10716 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
10717 (struct YYLTYPE): Renamed from struct yyltype.
10718 (YYLTYPE): Renamed from yyltype.
10719 (yyltype, yystype): New (and obsolescent) macros,
10720 for backward compatibility.
10721 * data/yacc.c: Likewise.
10722
10723 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
10724 does not specify a union tag. This is for compatibility with
10725 Solaris 9 yacc.
10726
10727 * src/parse-gram.y (add_param): 2nd arg is now char * not char
10728 const *, since it is now modified by stripping surrounding { }.
10729 (current_braced_code): Remove.
10730 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
10731 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
10732 trailing " {...}". Now of type <chars>.
10733 (grammar_declaration): Adjust to bundled tokens.
10734 (code_content): Remove; stripping is now done by add_param.
10735 (print_token_value): Print contents of bundled tokens.
10736 (token_name): New function.
10737
10738 * src/reader.h (braced_code, current_braced_code): Remove.
10739 (token_name): New decl.
10740
10741 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
10742 token_type, not braced_code code_kind. All uses changed.
10743 (SC_PRE_CODE): New state, for scanning after a keyword that
10744 has (or usually has) an immediately-following braced code.
10745 (token_type): New local var, to keep track of which token type
10746 to return when scanning braced code.
10747 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 10748 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
10749 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
10750 instead of returning a token type immediately.
10751 (<INITIAL>"{"): Set token type.
10752 (<SC_BRACED_CODE>"}"): Use it.
10753 (handle_action_dollar, handle_action_at): Now returns bool
10754 indicating success. Fail if ! current_rule; this prevents a core dump.
10755 (handle_symbol_code_dollar, handle_symbol_code_at):
10756 Remove; merge body into caller.
10757 (handle_dollar, handle_at): Complain in invalid contexts.
10758
10759 * NEWS, doc/bison.texinfo: Document the above.
10760 * NEWS: Fix years and program names in copyright notice.
10761
879ca4f8
PE
107622002-12-17 Paul Eggert <eggert@twinsun.com>
10763
10764 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
10765 Reporting, Table of Symbols): Omit mentions of %lex-param and
10766 %parse-param from the documentation for now.
10767
1c5fe69d
PE
107682002-12-15 Paul Eggert <eggert@twinsun.com>
10769
10770 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
10771 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
10772 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
10773 disagreed with the Bison documentation. Bug
10774 reported by Andrew Walrond.
d600ee67 10775
1c5fe69d
PE
10776 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
10777 as the caller now does that.
10778 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
10779 (YYEMPTY): Parenthesize right hand side, since others use it.
10780 (yyparse): Don't assume that our generated code is the only code
10781 that sets yychar.
10782
d1de5372
PE
107832002-12-13 Paul Eggert <eggert@twinsun.com>
10784
10785 Version 1.75d.
10786
10787 POSIX requires a "yacc" command.
10788 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
10789 (MOSTLYCLEANFILES): Add yacc.
10790 (yacc): New rule.
1c5fe69d 10791 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
10792 as an alias for bison y.
10793
10794 * po/LINGUAS: Add da.
d600ee67 10795
d1de5372
PE
10796 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
10797 problem with latest <getopt.h>.
10798 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
10799
10800 * doc/fdl.texi: Upgrade to 1.2.
10801 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
10802 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
10803 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
10804 gnulib.
10805 * config/install-sh: Sync with autotools.
10806
10807 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 10808 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
10809 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
10810 locations are requested.
10811 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
10812 locations are requested.
10813
d0f3fe23
PE
108142002-12-12 Paul Eggert <eggert@twinsun.com>
10815
10816 Remove unportable casts and storage allocation tricks.
10817 While we're at it, remove almost all casts, since they
10818 usually aren't needed and are a sign of trouble.
10819
10820 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
10821
10822 * src/derives.c (derives_compute): Do not subtract NTOKENS from
10823 the pointer DSET returned by malloc; this isn't portable.
10824 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
10825 Similarly for DERIVES.
10826 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
10827 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
10828 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
10829
10830 * src/derives.c (derives_compute): Do not bother invoking
10831 int_of_rule_number, since rule numbers are integers.
10832
10833 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
10834 rather than XMALLOC (char, N).
10835
10836 * src/files.c (filename_split): Rewrite to avoid cast.
10837
10838 * src/gram.h (symbol_number_as_item_number,
10839 item_number_as_symbol_number, rule_number_as_item_number,
10840 item_number_as_rule_number):
10841 Now inline functions rather than macros, to avoid casts.
10842 * src/state.h (state_number_as_int): Likewise.
10843 * src/tables.c (state_number_to_vector_number,
10844 symbol_number_to_vector_number): Likewise.
10845
10846 * src/gram.h (int_of_rule_number): Remove; no longer used.
10847
10848 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
10849 since the resulting storage is always stored into.
10850
10851 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
10852 where it's needed.
10853
10854 * src/muscle_tab.c (muscle_m4_output):
10855 Now inline. Return bool, not int.
10856 * src/state.c (state_compare): Likewise.
10857 * src/symtab.c (symbol_check_defined,
10858 symbol_check_alias_consistency, symbol_pack, symbol_translation,
10859 hash_compare_symbol, hash_symbol):
10860 Likewise.
10861 * src/uniqstr.c (uniqstr_print): Likewise.
10862 * src/muscle_tab.c (muscle_m4_output_processor):
10863 New function, to avoid casts.
10864 * src/state.c (state_comparator, stage_hasher): Likewise.
10865 * src/symtab.c (symbol_check_defined_processor,
10866 symbol_check_alias_consistency_processor, symbol_pack_processor,
10867 symbol_translation_processor, hash_symbol_comparator,
10868 hash_symbol_hasher): Likewise.
10869 * src/uniqstr.c (uniqstr_print_processor): Likewise.
10870 * src/muscle_tab.c (muscles_m4_output):
10871 Use new functions instead of casting old functions unportably.
10872 * src/state.c (state_hash_new): Likewise.
10873 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
10874 symbols_token_translations_init):
10875 Likewise.
10876 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
10877
10878 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
10879 var instead of casting to long, to avoid casts.
10880 (prepare_states): Use MALLOC rather than alloca, so that we don't
10881 have to worry about alloca.
10882 * src/state.c (state_hash_lookup): Likewise.
10883
10884 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
10885 local var instead of casting to unsigned char, to avoid casts.
10886
10887 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
10888 STATE_ALLOC): Remove.
10889 (transitions_new, errs_new, reductions_new, state_new): Use malloc
10890 rather than calloc, and use offsetof to avoid allocating slightly
10891 too much storage.
10892 (state_new): Initialize all members.
10893
10894 * src/state.c (state_hash): Use unsigned accumulator, not signed.
10895
10896 * src/symtab.c (symbol_free): Remove; unused.
10897 (symbol_get): Remove cast in lhs of assignment.
10898 (symbols_do): Now static. Accept generic arguments, not
10899 hashing-related ones.
10900
10901 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
10902 (symbol_processor): Remove.
10903 (symbols_do): Remove decl; now static.
10904
10905 * src/system.h (alloca): Remove; decl no longer needed.
10906 (<stddef.h>): Include, for offsetof.
10907 (<inttypes.>, <stdint.h>): Include if available.
10908 (uintptr_t): New type, if system lacks it.
10909 (CALLOC, MALLOC, REALLOC): New macros.
10910 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
10911 new macros.
10912
10913 * src/tables.c (table_size): Now int, to pacify GCC.
10914 (table_grow, table_ninf_remap): Use signed table size.
10915 (save_row): Don't bother initializing locals when not needed.
10916 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
10917 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
10918
10919 * src/vcg.h: Correct misspellings.
10920
10921 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
10922
10923
10924 * src/getargs.c (getargs): Don't assume EOF == -1.
10925
26b4a969
PE
109262002-12-09 Paul Eggert <eggert@twinsun.com>
10927
10928 Change identifier spellings to avoid collisions with names
10929 that are reserved by POSIX.
10930
10931 Don't use names ending in _t, since POSIX reserves them.
10932 For consistency, remove _e and _s endings -- they're weren't
10933 needed to remove ambiguity. All uses changed.
10934 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
10935 turn was just renamed from struniq_t.
10936 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
10937 which in turn was just renamed from struniq_processor_t.
10938 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
10939 in turn was renamed from hash_compare_struniq_t.
10940 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
10941 (state_list): Renamed from state_list_t.
10942 * src/assoc.h (assoc): Renamed from assoc_t.
10943 * src/conflicts.c (enum conflict_resolution): Renamed from
10944 enum conflict_resolution_e.
10945 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
10946 (rule_list): Renamed from rule_list_t.
10947 * src/getargs.h (enum trace): Renamed from enum trace_e.
10948 (enum report): Renamed from enum report_e.
10949 * src/gram.h (item_number): Renamed from item_number_t.
10950 (rule_number): Renamed from rule_number_t.
10951 (struct rule_s): Remove the "rule_s" part; not used.
10952 (rule): Renamed from rule_t.
10953 (rule_filter): Renamed from rule_filter_t.
10954 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
10955 (goto_list): Renamed from goto_list_t.
10956 * src/lalr.h (goto_number): Renamed from goto_number_t.
10957 * src/location.h (location): Renamed from location_t.
10958 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
10959 and moved here from:
10960 * src/muscle_tab.h (muscle_entry_t): here.
10961 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
10962 (rule_list): Renamed from rule_list_t.
10963 * src/print_graph.c (static_graph): Renamed from graph.
10964 * src/reader.h (braced_code): Renamed from braced_code_t.
10965 Remove brace_code_e tag.
10966 * src/relation.h (relation_node): Renamed from relation_node_t.
10967 (relation_nodes): Renamed from relation_nodes_t.
10968 (relation): Renamed from relation_t.
10969 * src/state.h (state_number): Renamed from state_number_t.
10970 (struct state): Renamed from struct state_s.
10971 (state): Renamed from state_t.
10972 (transitions): Renamed from transitions_t. Unused (and
10973 misspelled) transtion_s tag removed.
10974 (errs): Renamed from errs_t. Unused errs_s tag removed.
10975 (reductions): Renamed from reductions_t. Unused tag
10976 reductions_s removed.
10977 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
10978 (struct symbol_list): Renamed from struct symbol_list_s.
10979 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
10980 (struct symbol): Renamed from struct symbol_s.
10981 (symbol): Renamed from symbol_t.
10982 * src/tables.c (vector_number): Renamed from vector_number_t.
10983 (action_number): Renamed from action_t.
10984 * src/tables.h (base_number): Renamed from base_t.
10985 * src/vcg.h (enum color): Renamed from enum color_e.
10986 (enum textmode): Renamed from enum textmode_e.
10987 (enum shape): Renamed from enum shape_e.
10988 (struct colorentry): Renamed from struct colorentry_s.
10989 (struct classname): Renamed from struct classname_s.
10990 (struct infoname): Renamed from struct infoname_s.
10991 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
10992 (enum decision): Renamed from enum decision_e.
10993 (enum orientation): Renamed from enum orientation_e.
10994 (enum alignment): Renamed from enum alignment_e.
10995 (enum arrow_mode): Renamed from enum arrow_mode_e.
10996 (enum crossing_type): Renamed from enum crossing_type_e.
10997 (enum view): Renamed from enum view_e.
10998 (struct node): Renamed from struct node_s.
10999 (node): Renamed from node_t.
11000 (enum linestyle): Renamed from enum linestyle_e.
11001 (enum arrowstyle): Renamed from enum arrowstyle_e.
11002 (struct edge): Renamed from struct edge.
11003 (edge): Renamed from edge_t.
11004 (struct graph): Renamed from struct graph_s.
11005 (graph): Renamed from graph_t.
11006 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
11007 Rename value_t -> value.
11008 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
11009 value_t_as_yystype -> value_as_yystype.
11010
11011 Don't include <errno.h> in the mainstream code, since it
11012 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
11013 * lib/get-errno.c, lib/get-errno.h: New files.
11014 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
11015 get-errno.c.
11016 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
11017 * src/output.c (output_skeleton): Likewise.
11018 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
11019 instead of errno.
11020 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
11021 Likewise.
11022 (handle_action_dollar, handle_action_at): Likewise.
11023 * src/system.h: Do not include <errno.h>.
11024 (TAB_EXT): Renamed from EXT_TAB.
11025 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
11026
11027 Avoid str[a-z]*, since <string.h> reserves that name space.
11028 Change all instances of "struniq" in names to "uniqstr", and
11029 likewise for "STRUNIQ" and "UNIQSTR".
11030 * src/uniqstr.c: Renamed from src/struniq.c.
11031 * src/uniqstr.h: Renamed from src/struniq.h.
11032 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
11033 * src/files.c (strsuffix): Remove; unused.
11034 (concat2): Renamed from stringappend. Now static.
11035 * src/files.h (strsuffix, stringappend): Remove; unused.
11036 * src/parse-gram.y (<chars>): Renamed from <string>.
11037 (<uniqstr>): Renamed from <struniq>.
11038 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
11039 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
11040 (struct graph_s.expand): Renamed from struct graph_s.stretch.
11041 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
11042 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
11043 (N_EXPAND): Renamed from N_STRETCH.
11044
11045 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
11046 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
11047 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
11048 Remove; unused.
11049 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
11050 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
11051 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
11052 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
11053 (BASE_MAXIMUM): Renamed from BASE_MAX.
11054 (BASE_MINIMUM): Renamed from BASE_MIN.
11055 (ACTION_MAX): Remove; unused.
11056 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
11057 Unnecessary casts removed from above defines.
11058
11059
11060 Fix misspelling in names.
11061 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
11062 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
11063 G_NODE_ALIGNEMENT.
11064
11065
11066 * lib/timevar.c (timevar_report): Renamed from time_report,
11067 for consistency with other names.
11068 * lib/timevar.h (timevar_report): New decl.
11069 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
11070
11071
11072 Sort include-file uses.
11073
11074 Reorder all include files under src to be in the order "system.h".
11075 then the ../lib include files in angle brackets (alphabetized),
11076 then the . include files in double-quotes (alphabetized). Fix
11077 dependency breakages encountered in this process, as follows:
11078 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
11079 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
11080 * src/state.h: Include "symtab.h".
11081
996b1c7e
PE
110822002-12-08 Paul Eggert <eggert@twinsun.com>
11083
11084 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
11085 since this causes problems when __file__ contains character
11086 sequences like "@" that are treated specially by src/scan-skel.l.
11087 Instead, just use the file's basename. This fixes the bug
11088 reported by Martin Mokrejs in
161a71f3 11089 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 11090
e19c4e5d
PE
110912002-12-06 Paul Eggert <eggert@twinsun.com>
11092
11093 Add support for rules that do not have trailing semicolons, as
11094 POSIX requires. Improve the quality of locations in Bison
11095 diagnostics.
26b4a969 11096
e19c4e5d
PE
11097 * src/location.c: Include <quotearg.h>.
11098 (empty_location): Now const.
11099 (location_print): New function. Follow the recommendation of the
11100 GNU Coding Standards for locations that span file boundaries.
11101 * src/location.h: Do not include <quotearg.h>; no longer needed.
11102 (boundary): New type.
11103 (location_t): Use it. This allows locations to span file boundaries.
11104 All member uses changed: file -> start.file or end.file (as needed),
11105 first_line -> start.line, first_column -> start.column,
11106 last_line -> end.line, last_column -> end.column.
11107 (equal_boundaries): New function.
11108 (LOCATION_RESET, LOCATION_STEP): Remove.
11109 (LOCATION_PRINT): Remove. All callers changed to use location_print.
11110 (empty_location): Now const.
11111 (location_print): New decl.
11112 * src/parse-gram.y (lloc_default): New function, which handles
11113 empty locations more accurately.
11114 (YYLLOC_DEFAULT): Use it.
11115 (%token COLON): Remove.
11116 (%token ID_COLON): New token.
26b4a969 11117 (rules): Use it.
e19c4e5d
PE
11118 (declarations, rules): Remove trailing semicolon.
11119 (declaration, rules_or_grammar_declaration):
11120 Allow empty (";") declaration.
11121 (symbol_def): Remove empty actions; no longer needed.
11122 (rules_or_grammar_declaration): Remove trailing semicolon.
11123 (semi_colon.opt): Remove.
11124 * src/reader.h: Include location.h.
11125 (scanner_cursor): New decl.
11126 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
11127 rolling our own.
11128 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
11129 of *loc.
11130 (STEP): Remove. No longer needed, now that adjust_location does
11131 the work. All uses removed.
11132 (scanner_cursor): New var.
11133 (adjust_location): Renamed from extend_location. It now sets
11134 *loc and adjusts the scanner cursor. All uses changed.
11135 Don't bother testing for CR.
11136 (handle_syncline): Remove location arg; now updates scanner cursor.
11137 All callers changed.
11138 (unexpected_end_of_file): Now accepts start boundary of token or
11139 comment, not location. All callers changed. Update scanner cursor,
11140 not the location.
11141 (SC_AFTER_IDENTIFIER): New state.
11142 (context_state): Renamed from c_context. All uses changed.
11143 (id_loc, code_start, token_start): New local vars.
11144 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
11145 processing of Yacc white space and equivalents here.
11146 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
11147 instead of returning ID immediately, since we need to search for
11148 a subsequent colon.
11149 (<INITIAL>"'", "\""): Save token_start.
11150 (<INITIAL>"%{", "{", "%%"): Save code_start.
11151 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
11152 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
11153 BEGIN context_state at end, not INITIAL.
11154 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
11155 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
11156 Return correct token start.
11157 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
11158 the start of a character, string or multiline comment is found.
11159 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
11160 Reduction): Adjust reported locations to match the more-precise
11161 results now expected.
11162 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
11163 * tests/reduce.at (Useless Rules, Reduced Automaton,
11164 Underivable Rules): Likewise.
11165 * tests/regression.at (Invalid inputs): No longer `expecting ";"
11166 or "|"' now that so many other tokens are allowed by the new grammar.
11167
11168 * src/complain.h (current_file): Remove duplicate decl;
11169 current_file is now owned by files.h.
11170 * src/complain.c, src/scan-gram.l: Include files.h.
11171
111722002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 11173
e19c4e5d
PE
11174 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
11175 promotes to int; it might be unsigned int.
11176 * data/yacc.c (yy_reduce_print): Likewise.
11177
11178 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
11179 be #defined in the prologue, not in the Bison declarations.
11180 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 11181
b64755e3
PE
111822002-12-02 Paul Eggert <eggert@twinsun.com>
11183
11184 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
11185 * lib/strtoul.c: New file, from gnulib.
11186 This fixes a porting bug reported by Peter Klein in
161a71f3 11187 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 11188
6e746484
PE
111892002-11-30 Paul Eggert <eggert@twinsun.com>
11190
b64755e3
PE
11191 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
11192 and put only a forward declaration in the prologue. This is for
11193 consistency with the other scanner helper functions.
11194
6ba55592
PE
11195 Type clashes now generate warnings, not errors, since it
11196 appears that POSIX may allow some grammars with type clashes.
11197 * src/reader.c (grammar_current_rule_check): Warn about
11198 type clashes instead of complaining.
11199 * tests/input.at (Type Clashes): Expect warnings, not complaints.
11200
6e746484
PE
11201 Add Yacc library, since POSIX requires it.
11202 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
11203 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
11204 * lib/main.c, lib/yyerror.c: New files.
11205
11206 gram_error can be static; it need not be extern.
11207 * src/reader.h (gram_error): Remove decl.
11208 * src/parse-gram.y (gram_error): Now static. Add static decl.
11209 (print_token_value): Omit parameter names from forward decl,
11210 for consistency.
11211
88510f9c
PE
112122002-11-29 Paul Eggert <eggert@twinsun.com>
11213
6e746484
PE
11214 * doc/bison.texinfo: Emphasize that yylex and yyerror must
11215 be declared before being used. E.g., one should typically
11216 declare them in the prologue. Use GNU coding style in examples.
11217 Put "const" consistently after the type it modifies. Mention
11218 that C99 supports "inline". Mention that yyerror traditionally
11219 returns "int".
11220
88510f9c
PE
11221 %parse-param and %lex-param now take just one argument, the
11222 declaration; the argument name is deduced from the declaration.
11223
11224 * doc/bison.texinfo (Parser Function, Pure Calling, Error
11225 Reporting, Table of Symbols): Document this.
11226 * src/parse-gram.y (add_param): New function.
11227 (COMMA): Remove.
11228 (declaration): Implement new rule for %parse-param and %lex-param.
11229 * src/scan-gram.l: "," now elicits a warning, rather than being
11230 a token; this is more compatible with byacc.
11231 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
11232
bb92250c
PE
112332002-11-27 Paul Eggert <eggert@twinsun.com>
11234
11235 Rename identifiers to avoid real and potential collisions.
11236
11237 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
11238 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 11239 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
11240 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11241 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
11242 * src/parse-gram.y (print_token_value): Renamed from yyprint.
11243 All uses changed.
11244 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
11245 The name "yycontrol" violates the name space rules, and this stuff
11246 wasn't being used anyway.
11247 (input): Remove action; this stuff wasn't being used.
11248 (gram_error): Rename local variable yylloc -> loc.
11249 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
11250 (YY_DECL): Don't use "yy" at start of local variables.
11251 All uses changed, e.g., yylloc -> loc.
11252 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
11253 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
11254 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
11255 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
11256
11257 * src/parse-gram.y (gram_error): loc is now const *.
11258 * src/reader.h (gram_error): Likewise.
11259
3af4feb2
PE
112602002-11-24 Paul Eggert <eggert@twinsun.com>
11261
11262 Version 1.75c.
11263
11264 * tests/actions.at (Actions after errors): Use an output format
11265 more similar to that of the Printers and Destructors test.
11266 Test the position of the ';' token too.
11267 (Printers and Destructors): Likewise.
11268 (Printers and Destructors: %glr-parser): Remove for now, to avoid
11269 unnecessarily alarming people when the test fails.
11270
11271 * data/yacc.c (yyerrlab1): Move this label down, so that the
11272 parser does not discard the lookahead token if the user code
11273 invokes YYERROR. This change is required for POSIX conformance.
11274
11275 * lib/error.c: Sync with gnulib.
11276
112772002-11-22 Paul Eggert <eggert@twinsun.com>
11278
11279 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
11280 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
11281 * lib/xmalloc.c: Likewise.
26b4a969 11282
58004308
PE
112832002-11-20 Paul Eggert <eggert@twinsun.com>
11284
11285 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
11286
112872002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 11288
58004308
PE
11289 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
11290 should use `if (! x) abort ();' rather than `assert (x);', and
11291 anyway it's one less thing to worry about configuring.
11292
11293 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
11294 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
11295 and replace all instances of assert with abort.
11296 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11297 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
11298
11299 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
11300 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
11301 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
11302 hash_find_entry, hash_rehash, hash_insert): Likewise.
11303 * src/conflicts.c (resolve_sr_conflict): Likewise.
11304 * src/lalr.c (set_goto_map, map_goto): Likewise.
11305 * src/nullable.c (nullable_compute): Likewise.
11306 * src/output.c (prepare_rules, token_definitions_output): Likewise.
11307 * src/reader.c (packgram, reader): Likewise.
11308 * src/state.c (state_new, state_free, state_transitions_set,
11309 state_reduction_find): Likewise.
11310 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
11311 symbol_pack): Likewise.
11312 * src/tables.c (conflict_row, pack_vector): Likewise.
11313 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11314 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11315 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
11316 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
11317
11318 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
11319 (ARGMATCH_CONSTRAINT): New macro.
11320 (ARGMATCH_ASSERT): Use it.
11321
11322 * src/system.h (verify): New macro.
11323 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
11324 rather than assert.
11325 * src/tables.c (tables_generate): Likewise.
11326
11327 * src/struniq.c (struniq_assert): Now returns void, and aborts
11328 if the assertion is false.
11329 (struniq_assert_p): Remove.
11330 * src/struniq.h: Likewise.
11331
76ae8198
PE
113322002-11-18 Paul Eggert <eggert@twinsun.com>
11333
11334 * data/glr.c (yygetLRActions): Replace `yyindex' with
11335 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
11336 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 11337 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 11338
d3c4e709
AD
113392002-11-18 Akim Demaille <akim@epita.fr>
11340
11341 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
11342 space.
11343 From Tim Van Holder.
11344
8d8a7238
PE
113452002-11-17 Paul Eggert <eggert@twinsun.com>
11346
11347 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
11348 to "SyntaxError" for consistency with my 2002-11-15 change.
11349
11350 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
11351 not define to {}, since this breaks the common use of `YYDPRINTF
11352 ((...));' if a single statement is desired (e.g. before `else').
11353 Work around GCC warnings by surrounding corresponding calls with
11354 {} if needed.
11355 (yyhasResolvedValue): Remove unused function.
11356 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
11357 loop body.
11358 (yyreportSyntaxError): Renamed from yyreportParseError.
11359 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
11360 All uses changed.
11361 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
11362 extern when possible. Remove unused initializations.
11363
b0937b22
AD
113642002-11-16 Akim Demaille <akim@epita.fr>
11365
11366 Augment the similarity between GLR and LALR traces.
11367
11368 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
11369 (YY_REDUCE_PRINT): New.
11370 (yyparse): Use them.
11371 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
11372 YYDPRINT here.
11373 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
11374 state reached after the reduction/recovery, since...
11375 (yyparse, yyprocessOneStack): Report the state we are entering in.
11376
c5e3e510
AD
113772002-11-16 Akim Demaille <akim@epita.fr>
11378
11379 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
11380 Add support for --trace=skeleton.
11381 * src/scan-skel.l: %option debug.
11382 Scan strings of non-@ or \n instead of character by character.
11383 (scan_skel): Handle trace_skeleton.
11384 (QPUTS): New.
11385 (@output_parser_name@, @output_header_name@): ``Restore'' their
11386 support (used to be M4 macros).
11387 * data/yacc.c: Quote larger chunks, a la glr.c.
11388 * data/lalr1.cc: Likewise.
11389 The header guards are no longer available, so use some other
11390 string than `YYLSP_NEEDED'.
11391
4c6cc1db
AD
113922002-11-16 Akim Demaille <akim@epita.fr>
11393
11394 Make the ``Printers and Destructors'' test more verbose, taking
11395 `yacc.c''s behavior as (possibly wrong) reference.
11396
11397 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
11398 instead of fprint on stdout.
11399 Set and report the last_line of the symbols.
11400 Consistently display values and locations.
11401
6d9e8019
PE
114022002-11-16 Paul Eggert <eggert@twinsun.com>
11403
11404 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
11405
6e649e65
PE
114062002-11-15 Paul Eggert <eggert@twinsun.com>
11407
b25d88f6
PE
11408 * tests/actions.at (Actions after errors): New test case.
11409
6e649e65
PE
11410 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
11411 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
11412 tests/action.at, tests/calc.at, tests/conflicts.at,
11413 tests/cxx-type.at, tests/regression.at:
11414 "parse error" -> "syntax error" for POSIX compatibility.
11415 "parsing stack overflow..." -> "parser stack overflow" so
11416 that code matches Bison documentation.
11417
0f39aab9
AD
114182002-11-15 Akim Demaille <akim@epita.fr>
11419
11420 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
11421 take two BRACED_CODE, not two string_content.
11422 Free the scanner's obstack when we are done.
11423 (code_content): New.
11424 * tests/calc.at: Adjust.
11425 * doc/bison.texinfo: Adjust.
11426 Also, make sure to include the `,' for these declarations.
11427
761c1926
AD
114282002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
11429
11430 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
11431 definition; avoids potential autoreconf problems.
11432
b0f98b10
AD
114332002-11-15 Akim Demaille <akim@epita.fr>
11434
11435 Always check the value returned by yyparse.
11436
11437 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
11438 returned by yyparse.
11439 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
11440 Adjust calls.
11441 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
11442 returned by yyparse.
11443
970785f1
PH
114442002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11445
11446 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
11447 on input.at test.
11448
8fcc7db1
PE
114492002-11-14 Paul Eggert <eggert@twinsun.com>
11450
7ec1b48e
PE
11451 * src/output.c (output_skeleton): Call xfopen instead of
11452 duplicating xfopen's body.
11453
cfff7583 11454 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 11455 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 11456
8fcc7db1
PE
11457 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
11458 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
11459 Group compiler. Instead, use "$CC -E bar.c". Include the .h
11460 file twice in the grammar, as an extra check.
11461
11462 * tests/input.at (Torturing the Scanner): Surround the
11463 backslash-newline tests with "#if 0", to make it less likely that
11464 we'll run into compiler bugs. Bring back solitary \ inside
11465 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 11466 test backslash-newline in C character constant.
8fcc7db1 11467
4e8d992c
AD
114682002-11-14 Akim Demaille <akim@epita.fr>
11469
11470 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
11471 status of the compiler.
f32b346d 11472 Calling `exit 1' is no longer needed.
4e8d992c
AD
11473 Reported by Nelson H. F. Beebe.
11474
9501dc6e
AD
114752002-11-14 Akim Demaille <akim@epita.fr>
11476
11477 * tests/atlocal.in (CPPFLAGS): We have config.h.
11478 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
11479 New.
11480 * tests/actions.at, tests/calc.at, tests/conflicts.at,
11481 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
11482 * tests/regression.at, tests/torture.at: Use them for all the
11483 grammars that are to be compiled.
11484 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
11485 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
11486 * doc/bison.texinfo (GLR Parsers): Document `inline'.
11487
18b519c0
AD
114882002-11-14 Akim Demaille <akim@epita.fr>
11489
11490 * doc/bison.texinfo: Various formatting changes (alignments in
11491 samples, additional @group/@end group, GCS in samples.
11492 Use @deffn instead of simple @table to define the directives,
11493 macros, variables etc.
11494
9a86cdb9
PE
114952002-11-13 Paul Eggert <eggert@twinsun.com>
11496
daa33def 11497 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 11498 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 11499
daa33def 11500 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 11501 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
11502 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
11503 * tests/headers.at (export YYLTYPE): Likewise.
11504
11505 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 11506 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 11507
9a86cdb9
PE
11508 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
11509 comments, since they're not portable. Use GNU coding style.
11510
9c1e26bd
AD
115112002-11-13 Akim Demaille <akim@epita.fr>
11512
11513 * data/yacc.c: Leave bigger chunks of quoted text.
11514 (YYDSYMPRINTF): New.
11515 Use it to report symbol activities.
11516 * data/glr.c (YYDSYMPRINTF): New.
11517 Use it.
11518
87f721cc
PE
115192002-11-12 Paul Eggert <eggert@twinsun.com>
11520
11521 Version 1.75b.
11522
11523 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
11524 (yyglrReduce): Return yyok, not 0.
11525 This should avoid the enumerated-type warnings reported
464c6927 11526 by Nelson H. F. Beebe in
161a71f3 11527 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
11528
11529 * lib/bbitset.h (BITSET_INLINE): Remove.
11530 * lib/bitset.h [! BITSET_INLINE]: Remove.
11531 (bitset_set, bitset_reset, bitset_test): Rename local vars
11532 to avoid shadowing warnings by GCC.
11533
11534 * data/glr.c (inline): Remove #define. It's the user's
11535 responsibility to #define it away, just like 'const'.
464c6927 11536 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 11537 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 11538
87f721cc
PE
11539 * Makefile.maint (po-check): Scan .l and .y files instead of the
11540 .c and the .h files that they generate. This fixes the bug
11541 reported by Tim Van Holder in:
161a71f3 11542 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
11543 Look for N_ as well as for _. Try to avoid matching #define for
11544 N_ and _.
11545 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
11546 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
11547 * src/scan-gram.l: Revamp regular expressions so that " and '
11548 do not confuse xgettext.
11549
11550 * src/struniq.h (struniq_new): Do not declare the return type
11551 to be 'const'; this violates the C standard.
11552 * src/struniq.c (struniq_new): Likewise.
11553
be14ade5
AD
115542002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
11555
11556 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
11557 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
11558 linker.
11559
05291fbc
AD
115602002-11-12 Akim Demaille <akim@epita.fr>
11561
11562 * Makefile.maint: Sync with Autoconf:
11563 (local_updates): New.
11564
1f5fd52e
AD
115652002-11-12 Akim Demaille <akim@epita.fr>
11566
11567 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
11568
283f1e64
AD
115692002-11-12 Akim Demaille <akim@epita.fr>
11570
11571 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
11572 locations.
11573
886b69d1
AD
115742002-11-12 Akim Demaille <akim@epita.fr>
11575
11576 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
11577 not yyvalue.
11578
3df37415
AD
115792002-11-12 Akim Demaille <akim@epita.fr>
11580
11581 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
11582 Use it to test the GLR parser.
11583
7bd6c77e
AD
115842002-11-12 Akim Demaille <akim@epita.fr>
11585
11586 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
11587 defines it.
11588 * data/glr.c (yystos): New.
11589 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
11590 (YYDSYMPRINT): New.
11591 (yyval): Don't define it, it is handled via M4.
11592 (yyrecoverParseError): Free verbosely the discarded symbols.
11593 * data/yacc.c (yysymprint): Remove, rather...
11594 (b4_yysymprint_generate): invoke.
11595 * data/c.m4 (b4_yysymprint_generate): New.
11596 Accept pointers as arguments, as opposed to the version from
11597 yacc.c.
11598 (b4_yydestruct_generate): Likewise.
11599 * tests/cations.at (Printers and Destructors): Use Bison directives
11600 instead of CPP macros.
11601 Don't rely on internal details.
11602
b0400cc6
AD
116032002-11-12 Akim Demaille <akim@epita.fr>
11604
11605 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
11606 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
11607 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
11608 it against YYEMPTY and so forth), work on yytoken (i.e., set
11609 it to YYEMPTY etc.).
11610 (yydestruct): Replace with a b4_yydestruct_generate invocation.
11611 (b4_symbol_actions): Remove.
11612 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
11613 for 0, end-of-input.
11614
72f889cc
AD
116152002-11-12 Akim Demaille <akim@epita.fr>
11616
11617 * doc/bison.texinfo (Destructor Decl): New.
11618
b1ae9233
AD
116192002-11-12 Akim Demaille <akim@epita.fr>
11620
11621 * src/tables.c (tables_generate): Use free for pointers that
11622 cannot be NULL, not XFREE.
11623 (pack_vector): Use assert, not fatal, for bound violations.
11624 * src/state.c (state_new): Likewise.
11625 * src/reader.c (reader): Likewise.
11626 * src/lalr.c (set_goto_map): Likewise.
72f889cc 11627 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
11628 the file name.
11629
7ec2d4cd
AD
116302002-11-12 Akim Demaille <akim@epita.fr>
11631
11632 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
11633 Restore.
11634 * src/scan-gram.l (last_string): Is global to the file, not to
11635 yylex.
11636 * src/parse-gram.y (input): Don't append the epilogue here,
11637 (epilogue.opt): do it here, and free the scanner's obstack.
11638 * src/reader.c (epilogue_set): Rename as...
11639 (epilogue_augment): this.
11640 * data/c.m4 (b4_epilogue): Defaults to empty.
11641
573a6cd3
AD
116422002-11-12 Akim Demaille <akim@epita.fr>
11643
11644 * src/getargs.c (long_options): Remove duplicates.
11645 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
11646 Remove.
11647 * doc/bison.rnh: Remove.
11648 * doc/bison.texinfo (VMS Invocation): Remove.
11649
95612cfa
AD
116502002-11-12 Akim Demaille <akim@epita.fr>
11651
11652 * src/struniq.h, src/struniq.c (struniq_t): Is const.
11653 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
11654
11655 Use struniq for symbols.
11656
11657 * src/symtab.h (symbol_t): The tag member is a struniq.
11658 (symbol_type_set): Adjust.
11659 * src/symtab.c (symbol_new): Takes a struniq.
11660 (symbol_free): Don't free the tag member.
11661 (hash_compare_symbol_t, hash_symbol_t): Rename as...
11662 (hash_compare_symbol, hash_symbol): these.
11663 Use the fact that tags as struniqs.
11664 (symbol_get): Use struniq_new.
11665 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
11666 Returns a strniq.
11667 * src/reader.h (merger_list, grammar_currentmerge_set): The name
11668 and type members are struniqs.
11669 * src/reader.c (get_merge_function)
11670 (grammar_current_rule_merge_set): Adjust.
11671 (TYPE, current_type): Are struniq.
11672
11673 Use struniq for file names.
11674
11675 * src/files.h, src/files.c (infile): Split into...
11676 (grammar_file, current_file): these.
11677 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
11678 * src/reduce.c (reduce_print): Likewise.
11679 * src/getargs.c (getargs): Likewise.
11680 * src/complain.h, src/complain.c: Likewise.
11681 * src/main.c (main): Call struniqs_new early enough to use it for
11682 file names.
11683 Don't free the input file name.
11684
3e6656f9
AD
116852002-11-12 Akim Demaille <akim@epita.fr>
11686
11687 * src/symtab.c (symbol_free): Remove dead deactivated code:
11688 type_name are properly removed.
11689 Don't use XFREE to free items that cannot be NULL.
11690 * src/struniq.h, src/struniq.c: New.
11691 * src/main.c (main): Initialize/free struniqs.
11692 * src/parse-gram.y (%union): Add astruniq member.
11693 (yyprint): Adjust.
11694 * src/scan-gram.l (<{tag}>): Return a struniq.
11695 Free the obstack bit that used to store it.
11696 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
11697
7672019c
PE
116982002-11-11 Paul Eggert <eggert@twinsun.com>
11699
11700 Revamp to fix many (but not all) of the C- and M4-related quoting
11701 problems. Among other things, this fixes the Bison bug reported
11702 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 11703 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
11704
11705 Use new @ escapes consistently. Represent brackets with @{ and @}
11706 rather than @<:@ and @:>@, since this works a bit better with dumb
11707 editors like vi. Represent @ with @@, since @ is now consistently
11708 an escape. Use @oline@ and @ofile@ rather than __oline__ and
11709 __ofile__, to avoid unexpected expansions. Similarly, use @output
11710 rather than #output.
11711
11712 * data/c.m4 (b4_copyright): Omit file name from comment, since
11713 the file name could contain "*/".
11714 (b4_synclines_flag): Don't quote the 2nd argument; it should already
11715 be quoted. All uses changed.
11716
11717 * data/glr.c: Use new @ escapes consistently.
11718 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
11719 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
11720 Remove, since they couldn't handle arbitrary characters in file
11721 names.
11722 * data/lalr1.cc: Likewise.
11723 * data/yacc.c: Likewise.
11724
11725 * src/files.c (output_infix): Remove; all uses removed.
11726 * src/files.h: Likewise.
11727
11728 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
11729 mishandled funny characters in file names, and anyway it isn't
11730 needed any more.
11731 * data/yacc.c: Likewise.
11732 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
11733
11734 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
11735 * data/yacc.c: Likewise.
11736
11737 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
11738 strings now.
11739 (muscle_init): Quote filename as a C string.
11740 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
11741 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
11742 * src/output.c (escaped_file_name_output): New function.
11743 (prepare_symbols): Quote tokens for M4.
11744 (prepare): Don't insert output_infix, output_prefix,
11745 output_parser_name, output_header_name; this is now down by scan-skel.
11746 Insert skeleton as a C string.
11747
11748 * src/output.c (user_actions_output, symbol_destructors_output,
11749 symbol_printers_output): Quote filenames for C and M4.
11750 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11751
11752 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
11753 escapes other than \\ and \'; this simplifies the code.
11754 (<SC_STRING>): Likewise, for \\ and \".
11755 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
11756 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
11757 Use new escapes @{ and @} for [ and ].
11758
11759 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
11760 them with auto vars.
11761 Switch to new escape scheme, where @ is the escape character uniformly.
11762 Abort if a stray escape character is found. Avoid unbounded input
11763 buffer when parsing non-escaped text.
11764
11765 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
11766 __oline__, #output, $@, and @{ do not have unintended meanings.
11767
acea4f3b
PE
117682002-11-09 Paul Eggert <eggert@twinsun.com>
11769
11770 Fix the test failure due to GCC warnings described in
161a71f3 11771 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
11772 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
11773 evaluate to 0 if it's impossible for NINF to be in the respective
11774 table.
11775 (yygetLRActions, yyrecoverParseError): Use them.
11776
11777 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
11778 counted in the token inserted at end of file. Now takes
11779 location_t *, not location_t, so that the location can be
11780 adjusted. All uses changed.
11781
11782 * tests/regression.at (Invalid inputs): Adjust wording in
11783 diagnostic to match the new behavior.
11784
11785 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
11786 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
11787 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
11788 abort ();'. This reduces the runtime of the "Many lookaheads"
11789 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
11790 GCC 3.2.
11791
20ef1ad5
PE
117922002-11-07 Paul Eggert <eggert@twinsun.com>
11793
11794 * src/parse-gram.y (CHARACTER): Remove unused token.
11795 All uses removed.
11796
11797 * src/scan-gram.l: Remove stack option. We no longer use the
11798 stack, since the stack was never deeper than 1; instead, use the
11799 new auto var c_context to record the stacked value.
11800
11801 Remove nounput option. At an unexpected end of file, we now unput
11802 the minimal input necessary to end cleanly; this simplifies the
11803 code.
11804
11805 Avoid unbounded token sizes where this is easy.
11806
11807 (unexpected_end_of_file): New function.
11808 Use it to systematize the error message on unexpected EOF.
11809 (last-string): Now auto, not static.
11810 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
11811 (scanner_last_string_free): Remove; not used.
11812 (percent_percent_count): Move decl to just before use.
11813 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
11814 not the (never otherwised-used) CHARACTER.
11815
93724f13
AD
118162002-11-07 Akim Demaille <akim@epita.fr>
11817
11818 Let yyerror always receive the msg as last argument, so that
11819 yyerror can be variadic.
11820
11821 * data/yacc.c (b4_yyerror_args): New.
11822 Use it when calling yyerror.
11823 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
11824 Use it when calling yyerror.
11825 * doc/bison.texinfo (Error Reporting): Adjust.
11826 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
11827 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
11828
6e40b4eb
AD
118292002-11-06 Akim Demaille <akim@epita.fr>
11830
11831 #line should have quoted strings.
11832 Ideally, this should be done by m4_quotearg.
11833
11834 * src/scan-skel.l: Include quotearg.h.
11835 Quote __ofile__.
11836 * src/output.c (symbol_printers_output)
11837 (symbol_destructors_output): Quote the file name.
11838
2dfbfc12
AD
118392002-11-06 Akim Demaille <akim@epita.fr>
11840
11841 * tests/regression.at (Invalid inputs): Adjust to the recent
11842 messages.
11843
437c2d80
AD
118442002-11-06 Akim Demaille <akim@epita.fr>
11845
11846 Restore --no-lines.
11847 Reported by Jim Kent.
11848
11849 * data/c.m4 (b4_syncline): New.
11850 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
11851 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
11852 * src/output.c (user_actions_output): Likewise.
11853 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 11854 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 11855
900c5db5
AD
118562002-11-06 Akim Demaille <akim@epita.fr>
11857
11858 * src/main.c (main): Free `infile'.
11859 * src/scan-gram.l (handle_syncline): New.
11860 Recognize `#line'.
11861 * src/output.c (user_actions_output, symbol_destructors_output)
11862 (symbol_printers_output): Use the location's file name, not
11863 infile.
11864 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11865
e183b123 118662002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 11867
e183b123 11868 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 11869 either has GLR conflict entries.
e183b123 11870
193eb6b7
PE
118712002-11-05 Paul Eggert <eggert@twinsun.com>
11872
e183b123
PE
11873 * src/scan-gram.l: Use more accurate diagnostics, e.g.
11874 "integer out of range" rather than "invalid value".
11875 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
11876 accordingly.
11877
193eb6b7
PE
11878 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
11879 Also, remove one static variable in the scanner.
11880
11881 * src/scan-gram.l (braces_level): Now auto, not static.
11882 Initialize to zero if the compiler is being picky.
11883 (INITIAL): Clear braces_level instead of incrementing it.
11884 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
11885 as POSIX 1003.1-2001 requires.
11886 * src/system.h (IF_LINT): New macro, taken from coreutils.
11887 * configure.ac: Define "lint" if --enable-gcc-warnings.
11888
29c01725
AD
118892002-11-05 Akim Demaille <akim@epita.fr>
11890
11891 * src/scan-gram.l: When it starts with `%', complain about the
11892 whole directive, not just that `invalid character: %'.
11893
8aeac3ca
AD
118942002-11-04 Akim Demaille <akim@epita.fr>
11895
11896 * Makefile.maint: Update from Autoconf.
11897 (update, cvs-update, po-update, do-po-update): New.
11898
793a58bb
AD
118992002-11-04 Akim Demaille <akim@epita.fr>
11900
11901 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
11902 and yyerror.
11903 Have yyerror `use' its arguments.
11904 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
11905 returns true when location & yacc & pure & parse-param.
11906 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
11907
c4d720cd
AD
119082002-11-04 Akim Demaille <akim@epita.fr>
11909
11910 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
11911 clashes.
11912 * src/scan-gram.l: Use [\'] instead of ['] to pacify
11913 font-lock-mode.
11914 Use complain_at.
11915 Use quote, not quote_n since LOCATION_PRINT no longer uses the
11916 slot 0.
11917
613a0dc5
PE
119182002-11-03 Paul Eggert <eggert@twinsun.com>
11919
11920 * src/reader.c (get_merge_function, grammar_current_rule_check):
11921 Use consistent diagnostics for reporting type name clashes.
11922 Quote the types with <>, for consistency with Yacc.
11923 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
11924
2a8d363a
AD
119252002-11-03 Akim Demaille <akim@epita.fr>
11926
11927 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
11928 New.
11929 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
11930 (b4_parse_param): Remove.
11931 Use b4_identification.
11932 Propagate b4_pure_args where needed to pass them to yyerror.
11933 * data/glr.m4 (b4_parse_param): Remove.
11934 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11935 (b4_lpure_formals): New.
11936 Use b4_identification.
11937 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
11938 b4_user_formals and b4_user_args.
11939 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
11940 (yyreportAmbiguity): When using a pure parser, also need
11941 the location, and the parse-params.
11942 Adjust callers.
11943 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
11944 When using a pure parser, also need the parse-params.
11945 Adjust callers.
11946 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
11947 (%pure-parser + %parse-param) LALR and GLR parsers.
11948 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
11949 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
11950 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
11951 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
11952 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
11953 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
11954 * doc/bison.texinfo: Untabify the whole file.
11955 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
11956 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
11957 (Error Reporting): Adjust to these new directives.
11958 Document %error-verbose, deprecate YYERROR_VERBOSE.
11959
9e32add8
AD
119602002-11-03 Akim Demaille <akim@epita.fr>
11961
11962 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
11963 AT_CHECK_CALC_GLR invocations to use % directives, instead of
11964 command line options.
11965 * tests/cxx-type.at: Formatting changes.
11966
b02d90a5
PE
119672002-11-03 Paul Eggert <eggert@twinsun.com>
11968
11969 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11970 to count columns correctly, and to check for invalid inputs.
9e32add8 11971
b02d90a5
PE
11972 Use mbsnwidth to count columns correctly. Account for tabs, too.
11973 Include mbswidth.h.
11974 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
11975 (extend_location): New function.
11976 (YY_LINES): Remove.
11977
11978 Handle CRLF in C code rather than in Lex code.
11979 (YY_INPUT): New macro.
11980 (no_cr_read): New function.
11981
11982 Scan UCNs, even though we don't fully handle them yet.
11983 (convert_ucn_to_byte): New function.
11984
11985 Handle backslash-newline correctly in C code.
11986 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
11987 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
11988 all uses changed.
11989 (tag, splice): New EREs. Do not allow NUL or newline in tags.
11990 Use {splice} wherever C allows backslash-newline.
11991 YY_STEP after space, newline, vertical-tab.
11992 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 11993
b02d90a5
PE
11994 (letter, id): Don't assume ASCII; e.g., spell out a-z.
11995
11996 ({int}, handle_action_dollar, handle_action_at): Check for integer
11997 overflow.
9e32add8 11998
b02d90a5
PE
11999 (YY_STEP): Omit trailing semicolon, so that it's more like C.
12000
12001 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
12002 as well as \000. Check for UCHAR_MAX, not 255.
12003 Allow \x with an arbitrary positive number of digits, as in C.
12004 Check for overflow here.
12005 Allow \? and UCNs, for compatibility with C.
12006
12007 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
12008 with quote slot used by complain_at.
12009
12010 * tests/input.at: Add tests for backslash-newline, m4 quotes
12011 in symbols, long literals, and funny escapes in strings.
12012
12013 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
12014 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
12015 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
12016 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
12017 * m4/mbswidth.m4: New file, from GNU coreutils.
12018
12019 * doc/bison.texinfo (Grammar Outline): Document // comments.
12020 (Symbols): Document that trigraphs have no special meaning in Bison,
12021 nor is backslash-newline allowed.
12022 (Actions): Document that trigraphs have no special meaning.
12023
12024 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
12025 no longer used.
12026
120272002-11-02 Paul Eggert <eggert@twinsun.com>
12028
12029 * src/reader.c: Don't include quote.h; not needed.
12030 (get_merge_function): Reword warning to be consistent with
12031 type clash diagnostic in grammar_current_rule_check.
12032
12033 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
12034 bug in trigraph handling.
12035
12036 * src/output.c (prepare_symbols): When printing token names,
12037 escape "[" as "@<:@" and likewise for "]".
12038
12039 * src/system.h (errno): Remove declaration, as we are now
12040 assuming C89 or better, and C89 guarantees errno.
12041
762b212b
PE
120422002-10-30 Paul Eggert <eggert@twinsun.com>
12043
12044 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
12045 Check for close failures.
12046 * src/files.h (xfclose): Return void, not int, since it always
12047 returned zero.
12048 * src/files.c (xfclose): Likewise. Report I/O error if ferror
12049 indicates one.
12050 * src/output.c (output_skeleton): Use xfclose rather than fclose
12051 and ferror. xfclose now checks ferror.
12052
12053 * data/glr.c (YYLEFTMOST_STATE): Remove.
12054 (yyreportTree): Use a stack-based leftmost state. This avoids
12055 our continuing battles with bogus warnings about initializers.
12056
56100c60
AD
120572002-10-30 Akim Demaille <akim@epita.fr>
12058
12059 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
12060 #if.
12061
51b4a04c
PH
120622002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12063
12064 * tests/glr-regr1.at: New test for reported regressions.
12065 * tests/testsuite.at: Add glr-regr1.at test.
12066 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 12067
bf1ebda2
PE
120682002-10-24 Paul Eggert <eggert@twinsun.com>
12069
5c16c6b1
PE
12070 Version 1.75a.
12071
bf1ebda2
PE
12072 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
12073 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
12074 we use malloc. Don't assume 'A' through 'Z' are contiguous.
12075 Don't assume strdup exists; POSIX says its an XSI extension.
12076 Check for buffer overflow on input.
12077
b526ee61
AD
120782002-10-24 Akim Demaille <akim@epita.fr>
12079
12080 * src/output.c (output_skeleton): Don't disable M4sugar comments
12081 too soon: it results in comments being expanded.
12082 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
12083 first output.
12084
f1886bb2
AD
120852002-10-24 Akim Demaille <akim@epita.fr>
12086
12087 * data/yacc.c (m4_int_type): New.
12088 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
12089 char' as only yacc.c wants K&R portability.
12090 * data/glr.c (yysigned_char): Remove.
12091 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
12092 Reported by Quoc Peyrot.
12093
c5576256
PE
120942002-10-23 Paul Eggert <eggert@twinsun.com>
12095
12096 * src/main.c (main): With --trace=time, report times even if a
12097 non-fatal error occurs. Formerly, the times were reported in some
12098 such cases but not in others.
12099 * src/reader.c (reader): Just return if a complaint has been issued,
12100 instead of exiting, so that 'main' can report times.
12101
27b0ffea
AD
121022002-10-22 Akim Demaille <akim@epita.fr>
12103
12104 * src/system.h: Include sys/types.
12105 Reported by Bert Deknuydt.
12106
223a7883
PE
121072002-10-23 Paul Eggert <eggert@twinsun.com>
12108
12109 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
12110 Suggested by Art Haas.
12111
121122002-10-22 Paul Eggert <eggert@twinsun.com>
12113
12114 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
12115 decl; not needed any more.
12116 * src/main.c (main): Use return to exit, undoing yesterday's change.
12117 The last OS that we could find where this wouldn't work is
12118 SunOS 3.5, and that's too old to worry about now.
12119
12120 * data/glr.c (struct yyltype): Define members even when not
12121 doing locations. This is more consistent with yacc.c, and it
12122 works around the following bug reports:
161a71f3
PE
12123 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
12124 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 12125
223a7883
PE
12126 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
12127 @acronym consistently. Standardize on "Yacc" instead of "YACC",
12128 "Algol" instead of "ALGOL". Give a bit more history about BNF.
12129
8b76775a
AD
121302002-10-22 Akim Demaille <akim@epita.fr>
12131
12132 * data/README: New.
12133
6db10d14
PE
121342002-10-21 Paul Eggert <eggert@twinsun.com>
12135
12136 Be consistent about 'bool'; the old code used an enum in one
12137 module and an int in another, and this violates the C standard.
12138 * m4/stdbool.m4: New file, from coreutils 4.5.3.
12139 * configure.ac (AC_HEADER_STDBOOL): Add.
12140 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
12141 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
12142 * src/symtab.c (hash_compare_symbol_t): Likewise.
12143 * src/system.h (bool, false, true): Use a definition consistent
12144 with ../lib/hash.c. All uses changed.
12145
12146 * src/complain.c (warning_issued): Renamed from warn_message_count,
12147 so that we needn't worry about integer overflow (!).
12148 Now of type bool. All uses changed.
12149 (complaint_issued): Renamed from complain_message_count; likewise.
12150
12151 * src/main.c (main): Use exit to exit with failure.
27b0ffea 12152
6db10d14
PE
12153 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
12154 rather than 1 and 0.
12155 * src/main.c (main): Likewise.
12156 * src/getargs.c (getargs): Likewise.
12157 * src/reader.c (reader): Likewise.
12158
12159 * src/getarg.c (getargs): Remove duplicate code for
12160 "Try `bison --help'".
12161
12162 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
12163 What was that "2" for?
12164
12165 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
12166 * src/getargs.c (usage): Likewise.
12167
12168 * src/getargs.c (getargs): When there are too few operands, report
12169 the last one. When there are too many, report the first extra
12170 one. This is how diffutils does it.
12171
92a060fd
PE
121722002-10-20 Paul Eggert <eggert@twinsun.com>
12173
12174 Remove K&R vestiges.
12175 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
12176 * src/complain.c (VA_START): Remove. Assume prototypes.
12177 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
12178 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
12179 fatal): Assume prototypes.
12180 * src/complain.h: Assume prototypes.
12181 * src/system.h (PARAMS): Remove.
12182 Include <limits.h> unconditionally, since it's guaranteeed even
12183 for a freestanding C89 compiler.
12184 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
12185 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 12186
e7cb57c0
AD
121872002-10-20 Akim Demaille <akim@epita.fr>
12188
12189 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
12190 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
12191 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
12192 (yyresolveStates, yyresolveAction, yyresolveStack)
12193 (yyprocessOneStack): Use them.
12194 (yy_reduce_print): New.
12195 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
12196
0245f82d
AD
121972002-10-20 Akim Demaille <akim@epita.fr>
12198
12199 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
12200 arguments and output `void'.
12201 (b4_c_function): Rename as...
12202 (b4_c_function_def): this.
12203 (b4_c_function_decl, b4_c_ansi_function_def)
12204 (b4_c_ansi_function_decl): New.
12205 Change the interpretation of the arguments: before `int, foo', now
12206 `int foo, foo'.
12207 * data/yacc.c (yyparse): Prototype and define thanks to these.
12208 Adjust b4_c_function_def uses.
12209 * data/glr.c (yyparse): Likewise, but ANSI only.
12210
39912f52
AD
122112002-10-20 Akim Demaille <akim@epita.fr>
12212
12213 * src/output.c (prepare): Move the definition of `tokens_number',
12214 `nterms_number', `undef_token_number', `user_token_number_max'
12215 to...
12216 (prepare_tokens): Here.
12217 (prepare_tokens): Rename as...
12218 (prepare_symbols): this.
12219 (prepare): Move the definition of `rules_number' to...
12220 (prepare_rules): here.
12221 (prepare): Move the definition of `last', `final_state_number',
12222 `states_number' to...
12223 (prepare_states): here.
12224 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
12225
20c1e2ad
AD
122262002-10-20 Akim Demaille <akim@epita.fr>
12227
12228 * src/tables.h, src/tables.c, src/output.c: Comment changes.
12229
21964f43
AD
122302002-10-20 Akim Demaille <akim@epita.fr>
12231
12232 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
12233 * data/c.m4: here.
12234
66d30cd4
AD
122352002-10-20 Akim Demaille <akim@epita.fr>
12236
12237 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
12238 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
12239 `pair'.
12240 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
12241 `name' to...
12242 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
12243 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
12244 These.
12245
95f2c9fe
PE
122462002-10-19 Paul Eggert <eggert@twinsun.com>
12247
12248 Do not create a temporary file, as that involves security and
12249 cleanup headaches. Instead, use a pair of pipes.
12250 Derived from a suggestion by Florian Krohm.
12251 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
12252 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
12253 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
12254 (BISON_PREREQ_SUBPIPE): Add.
12255 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
12256 Add subpipe.h, subpipe.c.
12257 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
12258 * po/POTFILES.in: Add lib/subpipe.c.
12259 * src/output.c: Include "subpipe.h".
12260 (m4_invoke): Remove decl.
12261 (scan_skel): New decl.
12262 (output_skeleton): Use pipe rather than temporary file for m4 input.
12263 Check that m4sugar.m4 is readable, to avoid deadlock.
12264 Check for pipe I/O error.
12265 * src/scan-skel.l (readpipe): Remove decl.
12266 (scan_skel): New function, to be used in place of m4_invoke.
12267 Read from stream rather than file.
66d30cd4 12268
95f2c9fe
PE
12269 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
12270 float, as this generates a warning on Solaris 8 + GCC 3.2 with
12271 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
12272 this generates a more-accurate value anyway.
12273
12274 * lib/timevar.c (timervar_accumulate): Rename locals to
12275 avoid confusion with similarly-named more-global.
12276 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
12277
12278 * src/output.c (prepare): Use xstrdup to convert char const *
12279 to char *, to avoid GCC warning.
12280
c19988b7
AD
122812002-10-19 Akim Demaille <akim@epita.fr>
12282
12283 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
12284 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
12285 Use them to have `calc.y' ready for %pure-parser.
12286 * data/yacc.c (YYLEX): Pass a yylex return type to
12287 b4_c_function_call.
12288
ae7453f2
AD
122892002-10-19 Akim Demaille <akim@epita.fr>
12290
12291 Prototype support of %lex-param and %parse-param.
12292
12293 * src/parse-gram.y: Add the definition of the %lex-param and
12294 %parse-param tokens, plus their rules.
12295 Drop the `_' version of %glr-parser.
12296 Add the "," token.
12297 * src/scan-gram.l (INITIAL): Scan them.
12298 * src/muscle_tab.c: Comment changes.
12299 (muscle_insert, muscle_find): Rename `pair' as `probe'.
12300 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
12301 (muscle_entry_s): The `value' member is no longer const.
12302 Adjust all dependencies.
12303 * src/muscle_tab.c (muscle_init): Adjust: use
12304 MUSCLE_INSERT_STRING.
12305 Initialize the obstack earlier.
12306 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
12307 (muscle_pair_list_grow): New.
12308 * data/c.m4 (b4_c_function_call, b4_c_args): New.
12309 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
12310 * tests/calc.at: Use %locations, not --locations.
12311 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
12312
0e575721
AD
123132002-10-19 Akim Demaille <akim@epita.fr>
12314
12315 * src/getargs.c (usage): Take status as argument and exit
12316 accordingly.
12317 Report the traditional `Try ... --help' message when status != 0.
12318 (usage, version): Don't take a FILE * as arg, it is pointless.
12319 (getargs): When there is an incorrect number of arguments, make it
12320 an error, and report it GNUlically thanks to `usage ()'.
12321
724ce7f5
PE
123222002-10-18 Paul Eggert <eggert@twinsun.com>
12323
3a781eb2
PE
12324 * data/glr.c (yyreportParseError): Don't assume that sprintf
12325 yields the length of the printed string, as this is not true
12326 on SunOS 4.1.4. Reported by Peter Klein.
12327
724ce7f5
PE
12328 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
12329 * tests/conflicts.at (%nonassoc and eof): Likewise.
12330 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
12331
473d0a75
AD
123322002-10-17 Akim Demaille <akim@epita.fr>
12333
12334 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
12335 * src/getargs.c (trace_types, trace_args): Adjust.
12336 * src/reader.c (grammar_current_rule_prec_set)
12337 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
12338 Standardize error messages.
12339 And s/@prec/%prec/!
12340 (reader): Use trace_flag to enable scanner/parser debugging,
12341 instead of an adhoc scheme.
12342 * src/scan-gram.l: Remove trailing debugging code.
12343
e76d2469
PE
123442002-10-16 Paul Eggert <eggert@twinsun.com>
12345
93e2236a
PE
12346 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
12347 MUSCLE_TAB_H.
12348
e76d2469
PE
12349 * NEWS: Officially drop support for building Bison with K&R C,
12350 since it didn't work anyway and it's not worth worrying about.
12351 * Makefile.maint (wget_files): Remove ansi2knr.c.
12352 (ansi2knr.c-url_prefix): Remove.
12353 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
12354 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12355 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12356
5bd1c419
PE
123572002-10-15 Paul Eggert <eggert@twinsun.com>
12358
12359 Stop using the "enum_" trick for K&R-style function definitions;
12360 it confused me, and I was the author! Instead, assume that people
12361 who want to use K&R C compilers (when using these modules in GCC,
12362 perhaps?) will run ansi2knr.
12363
12364 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
12365 All uses of "enum_" changed to "enum ".
12366 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12367 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 12368
5bd1c419
PE
12369 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
12370 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
12371 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
12372 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
12373 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
12374 abitset_not, abitset_ones, abitset_or, abitset_or_and,
12375 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
12376 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
12377 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
12378 Use function prototypes; this removes the need for declaring
12379 static functions simply to provide their prototypes.
12380 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
12381 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
12382 bitset_count_, bitset_create, bitset_dump, bitset_first,
12383 bitset_free, bitset_init, bitset_last, bitset_next,
12384 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
12385 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
12386 bitset_print, bitset_release_memory, bitset_toggle_,
12387 bitset_type_choose, bitset_type_get, bitset_type_name_get,
12388 debug_bitset): Likewise.
12389 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
12390 * lib/bitset_stats.c (bitset_log_histogram_print,
12391 bitset_percent_histogram_print, bitset_stats_and,
12392 bitset_stats_and_cmp, bitset_stats_and_or,
12393 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
12394 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
12395 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
12396 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
12397 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
12398 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
12399 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
12400 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
12401 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
12402 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
12403 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
12404 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
12405 bitset_stats_zero): Likewise.
12406 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12407 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12408 bitsetv_dump, debug_bitsetv): Likewise.
12409 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
12410 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
12411 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
12412 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
12413 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
12414 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
12415 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
12416 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
12417 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
12418 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
12419 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
12420 Likewise.
12421 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
12422 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
12423 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
12424 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
12425 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
12426 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
12427 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
12428 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
12429 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
12430 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
12431 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 12432
ae26e1f0
AD
124332002-10-14 Akim Demaille <akim@epita.fr>
12434
12435 Version 1.75.
12436
d43baf71
AD
124372002-10-14 Akim Demaille <akim@epita.fr>
12438
12439 * tests/Makefile.am (maintainer-check-posix): New.
12440
7ebc83e3
AD
124412002-10-14 Akim Demaille <akim@epita.fr>
12442
12443 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
12444 member.
12445
05846dae
AD
124462002-10-14 Akim Demaille <akim@epita.fr>
12447
12448 * src/tables.c (table_ninf_remap): base -> tab.
12449 Reported by Matt Rosing.
12450
1318e37d
PE
124512002-10-14 Paul Eggert <eggert@twinsun.com>
12452
447fbb17
PE
12453 * tests/action.at, tests/calc.at, tests/conflicts.at,
12454 tests/cxx-type.at, tests/headers.at, tests/input.at,
12455 tests/regression.at, tests/synclines.at, tests/torture.at:
12456 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
12457 so that the tests still work even if POSIXLY_CORRECT is set.
12458 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 12459
1318e37d
PE
12460 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
12461 for portability to K&R hosts. Fix typo: signed char is guaranteed
12462 only to 127, not to 128.
12463 * data/glr.c (yysigned_char): New type.
12464 * data/yacc.c (yysigned_char): Likewise.
12465 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
12466
cc0f0794
PE
124672002-10-13 Paul Eggert <eggert@twinsun.com>
12468
5038f418
PE
12469 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
12470 true due to limited range of data type" warning from GCC.
12471
cc0f0794
PE
12472 * data/c.m4 (b4_token_defines): Protect against double-inclusion
12473 by wrapping enum yytokentype's definition inside #ifndef
12474 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
12475
6fed0802
AD
124762002-10-13 Akim Demaille <akim@epita.fr>
12477
12478 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
12479 Un yy- yyrhs to avoid the name clash with the global YYRHS.
12480
32f0598d
AD
124812002-10-13 Akim Demaille <akim@epita.fr>
12482
12483 * Makefile.maint: Update from Autoconf 2.54.
12484 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
12485
7ea9a33f
AD
124862002-10-13 Akim Demaille <akim@epita.fr>
12487
12488 * src/print.c (print_state): Separate the list of solved conflicts
12489 from the other items.
12490 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
12491
ea99527d
AD
124922002-10-13 Akim Demaille <akim@epita.fr>
12493
12494 Let nondeterministic skeletons be usable with deterministic
12495 tables.
12496
12497 With the patch, GAWK compiled by GCC without -O2 passes its test
12498 suite using a GLR parser driven by LALR tables. It fails with -O2
12499 because `struct stat' gives two different answers on my machine:
12500 88 (definition of an auto var) and later 96 (memset on this var).
12501 Hence the stack is badly corrumpted. The headers inclusion is to
12502 blame: if I move the awk.h inclusion before GLR's system header
12503 inclusion, the two struct stat have the same size.
12504
12505 * src/tables.c (pack_table): Always create conflict_table.
12506 (token_actions): Always create conflict_list.
12507 * data/glr.c (YYFLAG): Remove, unused.
12508
f377f69f
AD
125092002-10-13 Akim Demaille <akim@epita.fr>
12510
12511 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
12512 (O0FLAGS): New.
12513 (VALGRIND, GXX): New.
12514 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
12515 * tests/bison.in: Run $PREBISON a pre-command.
12516 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
12517 (maintainer-check-g++): New.
12518 * Makefile.am (maintainer-check): New.
12519
2a1fe6ed
AD
125202002-10-13 Akim Demaille <akim@epita.fr>
12521
12522 * data/glr.c: Formatting changes.
12523 Tweak some trace messages to match yacc.c's.
12524
f50adbbd
AD
125252002-10-13 Akim Demaille <akim@epita.fr>
12526
12527 GLR parsers sometimes raise parse errors instead of performing the
12528 default reduction.
12529 Reported by Charles-Henry de Boysson.
12530
12531 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 12532 check the length of the traces when %glr.
f50adbbd
AD
12533 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
12534 GLR's traces.
12535 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
12536 Test GLR parsers.
12537 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
12538 (yyltype): Remove the yy prefix from the member names.
12539 (yytable): Complete its comment.
12540 (yygetLRActions): Map error action number from YYTABLE from
12541 YYTABLE_NINF to 0.
12542 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
12543 (which was a bug: it should have been YYTABEL_NINF, and yet it was
12544 not satisfying as we could compare an YYACTION computed from
12545 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
12546 only value for error actions.
12547 (yyreportParseError): In verbose parse error messages, don't issue
12548 `error' in the list of expected tokens.
12549 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
12550 next action to perform to match glr.c's decoding.
12551 (yytable): Complete its comment.
12552
bcbad5b9
PE
125532002-10-13 Paul Eggert <eggert@twinsun.com>
12554
12555 Fix problem reported by Henrik Grubbstroem in
161a71f3 12556 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
12557 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
12558 because the Bison parser reads the second action before reducing
12559 the first one.
12560 * src/scan-gram.l (rule_length): New static var.
12561 Use it to keep track of the rule length in the scanner, since
12562 we can't expect the parser to be in lock-step sync with the scanner.
12563 (handle_action_dollar, handle_action_at): Use this var.
12564 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 12565
14904b89
PE
125662002-10-12 Paul Eggert <eggert@twinsun.com>
12567
1fe611e5
PE
12568 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
12569 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
12570 Include <sys/time.h> when checking for clock_t and struct tms.
12571 Use same include order as source.
12572 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 12573 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 12574
1fe611e5
PE
12575 * lib/timevar.c: Update copyright date and clarify comments.
12576 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 12577
1fe611e5
PE
12578 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
12579 GCC version as of today, then merge Bison's changes.
12580 Change "GCC" to "Bison" in copyright notice. timevar.def's
12581 author is Akim, so change that too.
12582
98194095
PE
12583 * src/reader.c (grammar_current_rule_check):
12584 Don't worry about the default action if $$ is untyped.
12585 Prevents bogus warnings reported by Jim Gifford in
161a71f3 12586 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 12587
14904b89
PE
12588 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
12589 * data/glr.c, data/lalr1.cc, data/yacc.c:
12590 Output token definitions before the first part of user declarations.
12591 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 12592 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 12593
ff6dca18
PE
125942002-10-11 Paul Eggert <eggert@twinsun.com>
12595
12596 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
12597 (yyparse): here. This undoes some of the 2002-07-25 change.
12598 Compatibility problem reported by Ralf S. Engelschall with
12599 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
12600
eb714592
AD
126012002-10-11 Akim Demaille <akim@epita.fr>
12602
12603 * tests/regression.at Characters Escapes): New.
12604 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
12605 characters.
12606 Reported by Jan Nieuwenhuizen.
12607
b7195100
AD
126082002-10-11 Akim Demaille <akim@epita.fr>
12609
12610 * po/id.po: New.
12611
f28a0f2d
PE
126122002-10-10 Paul Eggert <eggert@twinsun.com>
12613
12614 Portability fixes for bitsets; this also avoids several GCC
12615 warnings.
12616
12617 * lib/abitset.c: Include <stddef.h>, for offsetof.
12618 * lib/lbitset.c: Likewise.
12619
12620 * lib/abitset.c (abitset_bytes): Return a size that is aligned
12621 properly for vectors of objects. Do not assume that adding a
12622 header size to a multiple of a word size yields a value that is
12623 properly aligned for the whole union.
12624 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12625
12626 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
12627 unique names for structures.
12628 * lib/ebitset.c (ebitset_bytes): Likewise.
12629 * lib/lbitset.c (lbitset_bytes): Likewise.
12630
12631 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
12632 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
12633 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
12634 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
12635 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
12636 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
12637 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
12638 to improve the type-checking that GCC can do.
12639 * lib/bitset.c (bitset_op4_cmp): Likewise.
12640 * lib/bitset_stats.c (bitset_stats_count,
12641 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
12642 bitset_stats_copy, bitset_stats_disjoint_p,
12643 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
12644 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
12645 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
12646 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
12647 bitset_stats_and_or_cmp, bitset_stats_andn_or,
12648 bitset_stats_andn_or_cmp, bitset_stats_or_and,
12649 bitset_stats_or_and_cmp): Likewise.
12650 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
12651 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
12652 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
12653 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
12654
12655 * lib/abitset.h: Include bitset.h, not bbitset.h.
12656 * lib/ebitset.h: Likewise.
12657 * lib/lbitset.h: Likewise.
12658
12659 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
12660 All instances of parameters of type enum bitset_opts are now of
12661 type enum_bitset_opts, to conform to the C Standard, and similarly
12662 for enum_bitset_type.
12663 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12664 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
12665
12666 Do not use "struct bitset_struct" to mean different things in
12667 different modules. Not only is this confusing, it violates
12668 the C Standard, which requires that structure types in different
12669 modules must be compatible if one is to be passed to the other.
12670 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
12671 All instances of "struct bitset_struct *" replaced with "bitset".
12672 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
12673 (union bitset_union, struct abitset_struct, struct ebitset_struct,
12674 struct lbitset_struct, struct bitset_stats_struct): New types.
12675 All uses of struct bitset_struct changed to union bitset_union,
12676 etc.
ba0fe3c7 12677 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
12678 struct bitset_struct): Remove.
12679 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
12680 struct bitset_struct): Remove.
12681 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
12682 bitset_struct): Remove.
12683 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
12684 Likewise.
12685
12686 Do not call a function of type T using a call that assumes the
12687 function is of a different type U. Standard C requires that a
12688 function must be called with a type that is compatible with its
12689 definition.
12690 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12691 New decls.
12692 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12693 New functions.
12694 * lib/ebitset.c (PFV): Remove.
12695 * lib/lbitset.c (PFV): Likewise.
12696 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
12697 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
12698 decls.
12699 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
12700 (ebitset_vtable): Use them.
12701 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
12702 lbitset_xor): New functions.
12703 (lbitset_vtable): Use them.
12704
12705 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
12706 Declare.
12707
12708 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
12709 GCC warning.
12710 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
12711 Use offsetof, for simplicity.
12712
6fbe4984
PE
127132002-10-06 Paul Eggert <eggert@twinsun.com>
12714
12715 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
12716 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 12717 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
12718 which was inadvertently undone by the 2002-09-30 patch.
12719 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
12720 the same width as int.
12721
420f93c8
PE
127222002-10-04 Paul Eggert <eggert@twinsun.com>
12723
12724 Version 1.50.
12725
12726 * configure.ac (AC_INIT), NEWS: Increment version number.
12727
12728 * doc/bison.texinfo: Minor spelling, grammar, and white space
12729 fixes.
12730 (Symbols): Mention that any negative value returned from yylex
12731 signifies end-of-input. Warn about negative chars. Mention
12732 the portable Standard C character set.
12733
12734 The GNU coding standard says CFLAGS and YFLAGS are reserved
12735 for the installer to set.
12736 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
12737 * src/Makefile.am (AM_CFLAGS): Likewise.
12738 (AM_YFLAGS): Renamed from YFLAGS.
12739
12740 Fix some MAX and MIN problems.
12741 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
12742 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
12743 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
12744 * src/reader.c (reader): Use it.
12745
12746 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
12747 POSIX 1003.1-2001 has removed fgrep.
12748
127492002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
12750
12751 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
12752 interpreted as signed.
12753 * lib/ebitset.c (ebitset_list): Fix bug.
12754
ff68026d
PE
127552002-10-01 Paul Eggert <eggert@twinsun.com>
12756
12757 More fixes for 64-bit hosts and large bitsets.
12758
12759 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
12760 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
12761 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
12762 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
12763 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
12764 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
12765 bitset_count_): Likewise.
12766 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
12767 bitset_first, bitset_last): Likewise.
12768 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
12769 bitset_stats_list_reverse, bitset_stats_size,
12770 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
12771 Likewise.
12772 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12773 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12774 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12775 bitsetv_reflexive_transitive_closure): Likewise.
12776 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
12777 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
12778 Likewise.
12779 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
12780 Likewise.
420f93c8 12781
ff68026d
PE
12782 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
12783 Use size_t, not unsigned int, to count bytes.
12784 * lib/abitset.h (abitset_bytes): Likewise.
12785 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
12786 Likewise.
12787 * lib/bitset.h (bitset_bytes): Likewise.
12788 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
12789 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
12790 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12791 * lib/ebitset.c (ebitset_bytes): Likewise.
12792 * lib/ebitset.h (ebitset_bytes): Likewise.
12793 * lib/lbitset.c (lbitset_bytes): Likewise.
12794 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 12795
ff68026d
PE
12796 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
12797 abitset_subset_p, abitset_disjoint_p, abitset_and,
12798 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
12799 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
12800 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
12801 abitset_or_and, abitset_or_and_cmp):
12802 Use bitset_windex instead of unsigned int.
12803 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12804 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
12805 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
12806 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
12807 Likewise.
12808 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 12809
ff68026d
PE
12810 * lib/bitset.c (bitset_print):
12811 Use proper printf formats for widths of integer types.
12812 * lib/bitset_stats.c (bitset_percent_histogram_print,
12813 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
12814 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12815 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12816 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 12817
ff68026d
PE
12818 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
12819 BITSET_SIZE_MAX): New macros.
12820 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
12821 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
12822 to BITSET_WINDEX_MAX.
12823
12824 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
12825 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
12826 since we now return the bitset_bindex type (not int).
12827
12828 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
12829 when computing sizes.
12830 * lib/ebitset.c (ebitset_elts_grow): Likewise.
12831
12832 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
12833 and avoid cast to unsigned.
12834
6aa452a6
AD
128352002-09-30 Akim Demaille <akim@epita.fr>
12836
12837 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12838 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
12839 Updates from Michael Hayes.
12840
927f7817
AD
128412002-09-30 Art Haas <ahaas@neosoft.com>
12842
12843 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
12844 invocations.
12845 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
12846 defined.
12847
9738f41e
AD
128482002-09-27 Akim Demaille <akim@epita.fr>
12849
12850 Version 1.49c.
12851
a5c75d7f
AD
128522002-09-27 Akim Demaille <akim@epita.fr>
12853
12854 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
12855 (Because of AC_LIBSOURCE).
12856
8280e179
AD
128572002-09-27 Akim Demaille <akim@epita.fr>
12858
12859 Playing with Autoscan.
12860
12861 * configure.ac: Remove the old LIBOBJ tweaks.
12862 (AC_REPLACE_FUNCS): Add strrchr and strtol.
12863 * lib/strrchr.c: New.
12864 * lib/strtol.c: New, from the Coreutils 4.5.1.
12865
ae64af35
AD
128662002-09-27 Akim Demaille <akim@epita.fr>
12867
12868 Playing with Autoscan.
12869
12870 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
12871 * lib/Makefile.am (libbison_a_SOURCES): No longer include
12872 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
12873 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
12874 Coreutils 4.5.1.
12875
d1a1114f
AD
128762002-09-24 Akim Demaille <akim@epita.fr>
12877
12878 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
12879 (Frequently Asked Questions, Parser Stack Overflow): New.
12880
b906441c
AD
128812002-09-13 Akim Demaille <akim@epita.fr>
12882
12883 Playing with autoscan.
12884
12885 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
12886 * src/files.c (skeleton_find): Remove, unused.
12887 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
12888 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
12889
bd701811
AD
128902002-09-13 Akim Demaille <akim@epita.fr>
12891
12892 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
12893 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
12894
e0a13e7b
AD
128952002-09-13 Akim Demaille <akim@epita.fr>
12896
12897 * configure.ac: Require 2.54.
12898 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
12899 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
12900 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
12901 Remove, provided by Autoconf macros.
12902
c97011bf
AD
129032002-09-12 Akim Demaille <akim@epita.fr>
12904
12905 * m4/prereq.m4: Update, from Coreutils 4.5.1.
12906
d862b1be
AD
129072002-09-12 Akim Demaille <akim@epita.fr>
12908
12909 * m4/prereq.m4: Update, from Fileutils 4.1.5.
12910 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
12911 Reported by Martin Mokrejs.
12912
3d38c03a
AD
129132002-09-10 Akim Demaille <akim@epita.fr>
12914
12915 * src/parse-gram.y: Associate a human readable string to each
12916 token type.
12917 * tests/regression.at (Invalid inputs): Adjust.
12918
b6347355
AD
129192002-09-10 Gary V. Vaughan <gary@gnu.org>
12920
12921 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
12922 with an Autoconf-2.5x style configure.ac.
12923
09ba4ab2
PE
129242002-09-06 Paul Eggert <eggert@twinsun.com>
12925
12926 * doc/bison.texinfo (Conditions): Make explicit that the GPL
12927 exception applies only to yacc.c. This is a modification of a
12928 patch originally suggested by Akim Demaille.
12929
21846f69
AD
129302002-09-06 Akim Demaille <akim@epita.fr>
12931
09ba4ab2
PE
12932 * data/c.m4 (b4_copyright): Move the GPL exception comment from
12933 here to...
12934 * data/yacc.c: here.
12935
21846f69
AD
12936 * data/lalr1.cc (struct yyltype): Don't define it, since we use
12937 LocationType.
12938 (b4_ltype): Default to yy::Location from location.hh.
12939
c0ad8bf3
AD
129402002-09-04 Jim Meyering <jim@meyering.net>
12941
12942 * data/yacc.c: Guard the declaration of yytoknum also with
12943 `#ifdef YYPRINT', so it is declared only when used.
12944
3a93251e
AD
129452002-09-04 Akim Demaille <akim@epita.fr>
12946
12947 * configure.in: Rename as...
12948 * configure.ac: this.
12949 Bump to 1.49c.
12950
427c0dda
AD
129512002-09-04 Akim Demaille <akim@epita.fr>
12952
12953 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
12954 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
12955 translate maintainer only messages.
12956
6a254321
PE
129572002-08-12 Paul Eggert <eggert@twinsun.com>
12958
645e30d1
PE
12959 Version 1.49b.
12960
6a254321
PE
12961 * Makefile.am (SUBDIRS): Remove intl.
12962 (DISTCLEANFILES): Remove.
12963 * NEWS: Mention that GNU M4 is now required. Clarify what is
12964 meant by "larger grammars". Mention the pt_BR translation.
12965 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
12966 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
12967 Bump version from 0.11.2 to 0.11.5.
12968 (BISON_PREREQ_STAGE): Remove.
12969 (AM_GNU_GETTEXT): Use external gettext.
12970 (AC_OUTPUT): Remove intl/Makefile.
12971
12972 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
12973
12974 * data/glr.c: Include string.h, for strlen.
12975 (yyreportParseError): Use size_t for yysize.
12976 (yy_yypstack): No longer nested inside yypstates, as nested
12977 functions are not portable. Do not assume size_t is the
12978 same width as int.
12979 (yypstates): Do not assume that ptrdiff_t is the same width
12980 as int, and similarly for yyposn and YYINDEX.
12981
12982 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
12983
12984 * lib/Makefile.am (INCLUDES): Do not include from the intl
12985 directory, which has been removed.
12986 * src/Makefile.am (INCLUDES): Likewise.
12987
12988 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
12989 (bitsets_sources, additional_bitsets_sources, timevars_sources):
12990 New vars.
12991
12992 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
12993 * tests/Makefile.am (EXTRA_DIST): Likewise.
12994
12995 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
12996 Do not assume that bitset_windex is the same width as unsigned.
12997
12998 * lib/abitset.c (abitset_unused_clear): Do not assume that
12999 bitset_word is the same width as int.
13000 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
13001 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
13002 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
13003 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
13004 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
13005
13006 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
13007 portability to one's complement hosts!).
13008 * lib/ebitset.c (ebitset_op1): Likewise.
13009 * lib/lbitset.c (lbitset_op1): Likewise.
13010
13011 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
13012 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13013 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
13014 Sync with fileutils.
13015 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
13016 lib/gettext.h: Sync with diffutils.
13017
13018 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
13019 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
13020
13021 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
13022 PROTOTYPES to check for prototypes, and "defined __STDC__" to
13023 check for void *.
13024
13025 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
13026 size_t; the old version tried to do this but casted improperly.
13027 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
13028 (bitset_test): Now returns int, not unsigned long.
13029
13030 * lib/bitset_stats.c: Include "gettext.h".
13031 (_): New macro.
13032 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
13033 name locals "index", as it generates unnecessary warnings on some
13034 hosts that have an "index" function.
13035
13036 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
13037 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
13038 they need translation.
13039 * src/LR0.c (state_list_append, new_itemsets, get_state,
13040 append_states, generate_states): Likewise.
13041 * src/assoc.c (assoc_to_string): Likewise.
13042 * src/closure.c (print_closure, set_firsts, closure): Likewise.
13043 * src/gram.c (grammar_dump): Likewise.
13044 * src/injections.c (injections_compute): Likewise.
13045 * src/lalr.c (lookaheads_print): Likewise.
13046 * src/relation.c (relation_transpose): Likewise.
13047 * src/scan-gram.l: Likewise.
13048 * src/tables.c (table_grow, pack_vector): Likewise.
13049
13050 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
13051 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
13052 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
13053 * m4/mbstate_t.m4: Sync with fileutils.
13054 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
13055
13056 * po/LINGUAS: Add pt_BR.
13057 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
13058 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
13059 lib/timevar.c.
13060 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
13061 manual recommends.
13062 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
13063
13064 * src/complain.c (strerror_r): Remove decl; not needed.
13065 (strerror): Use same pattern as ../lib/error.c.
13066
13067 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
13068
13069 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
13070
13071 * src/main.c (main): Cast result of bindtextdomain and textdomain
13072 to void, to avoid a GCC warning when --disable-nls is in effect.
13073
13074 * src/scan-gram.l: Use strings rather than escapes when possible,
13075 to minimize the number of warnings from xgettext.
13076 (handle_action_dollar, handle_action_at): Don't use isdigit,
13077 as it mishandles negative chars and it may not work as expected
13078 outside the C locale.
13079
13080 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
13081 this is a GCC extension and is not portable to other compilers.
13082
13083 * src/system.h (alloca): Use same pattern as ../lib/error.c.
13084 Do not include <ctype.h>; no longer needed.
13085 Do not include <malloc.h>; no longer needed (and generates
13086 warnings on OpenBSD 3.0).
13087
13088 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
13089 it's not portable.
13090
13091 * tests/regression.at: Do not use 'cc -c input.c -o input';
13092 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
13093
13094 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
13095 exit status as failure, not just exit status 1. Sun C exits
13096 with status 2 sometimes.
13097
13098 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
13099 Use it for the two large tests.
13100
c8f002c7
AD
131012002-08-02 Akim Demaille <akim@epita.fr>
13102
13103 * src/conflicts.c (conflicts_output): Don't output rules never
13104 reduced here, since anyway that computation doesn't work.
13105 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
13106 (rule_useless_p, rule_never_reduced_p): New.
13107 (grammar_rules_partial_print): Use a filter instead of a range.
13108 Display the title only if needed.
13109 (grammar_rules_print): Adjust.
13110 (grammar_rules_never_reduced_report): New.
13111 * src/tables.c (action_row): Move the computation of rules never
13112 reduced to...
13113 (token_actions): here.
13114 * src/main.c (main): Make the parser before making the report, so
13115 that rules never reduced are computed.
13116 Call grammar_rules_never_reduced_report.
13117 * src/print.c (print_results): Report rules never reduced.
13118 * tests/conflicts.at, tests/reduce.at: Adjust.
13119
cd08e51e
AD
131202002-08-01 Akim Demaille <akim@epita.fr>
13121
13122 Instead of attaching lookaheads and duplicating the rules being
13123 reduced by a state, attach the lookaheads to the reductions.
13124
13125 * src/state.h (state_t): Remove the `lookaheads',
13126 `lookaheads_rule' member.
13127 (reductions_t): Add a `lookaheads' member.
13128 Use a regular array for the `rules'.
13129 * src/state.c (reductions_new): Initialize the lookaheads member
13130 to 0.
13131 (state_rule_lookaheads_print): Adjust.
13132 * src/state.h, src/state.c (state_reductions_find): New.
13133 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
13134 (count_rr_conflicts): Adjust.
13135 * src/lalr.c (LArule): Remove.
13136 (add_lookback_edge): Adjust.
13137 (state_lookaheads_count): New.
13138 (states_lookaheads_initialize): Merge into...
13139 (initialize_LA): this.
13140 (lalr_free): Adjust.
13141 * src/main.c (main): Don't free nullable and derives too early: it
13142 is used by --verbose.
13143 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
13144
bb0027a9
AD
131452002-08-01 Akim Demaille <akim@epita.fr>
13146
13147 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
13148 `rule_number_t**'.
13149 (set_derives, free_derives): Rename as...
13150 (derives_compute, derives_free): this.
13151 Adjust all dependencies.
13152 * src/nullable.c (set_nullable, free_nullable): Rename as...
13153 (nullable_compute, nullable_free): these.
13154 (rule_list_t): Store rule_t *, not rule_number_t.
13155 * src/state.c (state_rule_lookaheads_print): Directly compare rule
13156 pointers, instead of their numbers.
13157 * src/main.c (main): Call nullable_free, and derives_free earlier,
13158 as they were lo longer used.
13159
3325ddc4
AD
131602002-08-01 Akim Demaille <akim@epita.fr>
13161
13162 * lib/timevar.c (get_time): Include children time.
13163 * src/lalr.h (LA, LArule): Don't export them: used with the
13164 state_t.
13165 * src/lalr.c (LA, LArule): Static.
13166 * src/lalr.h, src/lalr.c (lalr_free): New.
13167 * src/main.c (main): Call it.
13168 * src/tables.c (pack_vector): Check whether loc is >= to the
13169 table_size, not >.
13170 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
13171 (tables_generate): do it, since that's also it which allocates
13172 them.
13173 Don't free LA and LArule, main does.
13174
c6f1a33c
AD
131752002-07-31 Akim Demaille <akim@epita.fr>
13176
13177 Separate parser tables computation and output.
13178
13179 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
13180 (conflict_list, conflict_list_cnt, table, check, table_ninf)
13181 (yydefgoto, yydefact, high): Move to...
13182 * src/tables.h, src/tables.c: here.
13183 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
13184 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
13185 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
13186 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
13187 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
13188 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
13189 (action_row, save_row, token_actions, save_column, default_goto)
13190 (goto_actions, sort_actions, matching_state, pack_vector)
13191 (table_ninf_remap, pack_table, prepare_actions): Move to...
13192 * src/tables.c: here.
13193 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
13194 * src/output.c (token_actions, output_base, output_conflicts)
13195 (output_check): Merge into...
13196 (prepare_actions): this.
13197 (actions_output): Rename as...
13198 (user_actions_output): this.
13199 * src/main.c (main): Call tables_generate and tables_free.
13200
1509d42f
AD
132012002-07-31 Akim Demaille <akim@epita.fr>
13202
13203 Steal GCC's --time-report support.
13204
13205 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
13206 stolen/adjusted from GCC.
13207 * m4/stage.m4: Remove time related checks.
13208 * m4/timevar.m4: New.
13209 * configure.in: Adjust.
13210 * src/system.h: Adjust to using timevar.h.
13211 * src/getargs.h, src/getargs.c: Support trace_time for
13212 --trace=time.
13213 * src/main.c (stage): Remove.
13214 (main): Replace `stage' invocations with timevar calls.
13215 * src/output.c: Insert pertinent timevar calls.
13216
273a74fa
AD
132172002-07-31 Akim Demaille <akim@epita.fr>
13218
13219 Let --trace have arguments.
13220
13221 * src/getargs.h (enum trace_e): New.
13222 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
13223 (long_options, short_options): --trace/-T takes an optional
13224 argument.
13225 Change all the uses of trace_flag to reflect the new flags.
13226 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
13227
13228 Strengthen `stage' portability.
13229
13230 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
13231 * configure.in: Use it.
13232 Don't check for malloc.h and sys/times.h.
13233 * src/system.h: Include them when appropriate.
13234 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
13235 times and struct tms are available.
13236
217598da
AD
132372002-07-30 Akim Demaille <akim@epita.fr>
13238
13239 In verbose parse error message, don't report `error' as an
13240 expected token.
13241 * tests/actions.at (Printers and Destructors): Adjust.
13242 * tests/calc.at (Calculator $1): Adjust.
13243 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
13244 error message, do not report the parser accepts the error token in
13245 that state.
13246
52489d44
AD
132472002-07-30 Akim Demaille <akim@epita.fr>
13248
13249 Normalize conflict related messages.
13250
13251 * src/complain.h, src/complain.c (warn, complain): New.
13252 * src/conflicts.c (conflicts_print): Use them.
13253 (conflict_report_yacc): New, extracted from...
13254 (conflicts_print): here.
13255 * tests/conflicts.at, tests/existing.at: Adjust.
13256
e8832397
AD
132572002-07-30 Akim Demaille <akim@epita.fr>
13258
13259 Report rules which are never reduced by the parser: those hidden
13260 by conflicts.
13261
13262 * src/LR0.c (save_reductions): Don't make the final state too
13263 different: save its reduction (accept) instead of having a state
13264 without any action (no shift or goto, no reduce).
13265 Note: the final state is now a ``regular'' state, i.e., the
13266 parsers now contain `reduce 0' as default reduction.
13267 Nevertheless, since they decide to `accept' when yystate =
13268 final_state, they still will not reduce rule 0.
13269 * src/print.c (print_actions, print_reduction): Adjust.
13270 * src/output.c (action_row): Track reduced rules.
13271 (token_actions): Report rules never reduced.
13272 * tests/conflicts.at, tests/regression.at: Adjust.
13273
caf23d24
AD
132742002-07-30 Akim Demaille <akim@epita.fr>
13275
13276 `stage' was accidently included in a previous patch.
13277 Initiate its autoconfiscation.
13278
13279 * configure.in: Look for malloc.h and sys/times.h.
13280 * src/main.c (stage): Adjust.
13281 Report only when trace_flag.
13282
640748ee
AD
132832002-07-29 Akim Demaille <akim@epita.fr>
13284
13285 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
13286 state_number_t.
13287 (errs_t): symbol_t*, not symbol_number_t.
13288 (reductions_t): rule_t*, not rule_number_t.
13289 (FOR_EACH_SHIFT): New.
13290 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
13291 * src/print.c, src/print_graph.c: Adjust.
13292
88bce5a2
AD
132932002-07-29 Akim Demaille <akim@epita.fr>
13294
13295 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
13296
13297 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
13298 (endtoken, accept): these.
13299 * src/reader.c (reader): Set endtoken's default tag to "$end".
13300 Set undeftoken's tag to "$undefined" instead of "$undefined.".
13301 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
13302 Adjust.
13303
1bfb97db
AD
133042002-07-29 Akim Demaille <akim@epita.fr>
13305
13306 * src/reduce.c (reduce_grammar): When the language is empty,
13307 complain about the start symbol, not the axiom.
13308 Use its location.
13309 * tests/reduce.at (Empty Language): New.
13310
fc5734fe
AD
133112002-07-26 Akim Demaille <akim@epita.fr>
13312
13313 * src/reader.h, src/reader.c (gram_error): ... can't get
13314 yycontrol without making too strong assumptions on the parser
13315 itself.
13316 * src/output.c (prepare_tokens): Use the real 0th value of
13317 token_translations instead of `0'.
13318 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
13319 visible here.
13320 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
13321 for the time being: %locations ought to provide it to yyerror.
13322
3650b4b8
AD
133232002-07-25 Akim Demaille <akim@epita.fr>
13324
13325 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
13326 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
13327 * tests/regression.at (Web2c Actions): Adjust.
13328
4b3d3a8e
AD
133292002-07-25 Akim Demaille <akim@epita.fr>
13330
13331 Stop storing rules from 1 to nrules + 1.
13332
13333 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
13334 * src/nullable.c, src/output.c, src/print.c, src/reader.c
13335 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
13336 Iterate from 0 to nrules.
13337 Use rule_number_as_item_number and item_number_as_rule_number.
13338 Adjust to `derive' now containing possibly 0.
13339 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
13340 Handle the `- 1' part in rule numbers from/to item numbers.
13341 * src/conflicts.c (log_resolution): Fix the message which reversed
13342 shift and reduce.
13343 * src/output.c (action_row): Initialize default_rule to -1.
13344 (token_actions): Adjust.
13345 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
13346 expected output.
13347 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
13348
4a2a22f4
AD
133492002-07-25 Akim Demaille <akim@epita.fr>
13350
13351 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
13352 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
13353 (b4_c_knr_arg_decl): New.
13354 * data/yacc.c: Use it to define yysymprint, yydestruct, and
13355 yyreport_parse_error.
13356
b8df3223
AD
133572002-07-25 Akim Demaille <akim@epita.fr>
13358
13359 * data/yacc.c (yyreport_parse_error): New, extracted from...
13360 (yyparse): here.
13361 (yydestruct, yysymprint): Move above yyparse.
13362 Be K&R compliant.
13363
a762e609
AD
133642002-07-25 Akim Demaille <akim@epita.fr>
13365
13366 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
13367 replace...
13368 (b4_sint_type, b4_uint_type): these.
13369 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
13370 * tests/regression.at (Web2c Actions): Adjust.
13371
12b0043a
AD
133722002-07-25 Akim Demaille <akim@epita.fr>
13373
13374 * src/gram.h (TIEM_NUMBER_MAX): New.
13375 (item_number_of_rule_number, rule_number_of_item_number): Rename
13376 as...
13377 (rule_number_as_item_number, item_number_as_rule_number): these.
13378 Adjust dependencies.
13379 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
13380 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
13381 (symbol_number_to_vector_number): New.
13382 (order): Of vector_number_t* type.
13383 (base_t, BASE_MAX, BASE_MIN): New.
13384 (froms, tos, width, pos, check): Of base_t type.
13385 (action_number_t, ACTION_MIN, ACTION_MAX): New.
13386 (actrow): Of action_number_t type.
13387 (conflrow): Of unsigned int type.
13388 (table_ninf, base_ninf): New.
13389 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
13390 (muscle_insert_int_table, muscle_insert_base_table)
13391 (muscle_insert_rule_number_table): New.
13392 (prepare_tokens): Output `toknum' as int_table.
13393 (action_row): Returns a rule_number_t.
13394 Use ACTION_MIN, not SHRT_MIN.
13395 (token_actions): yydefact is rule_number_t*.
13396 (table_ninf_remap): New.
13397 (pack_table): Use it for `base' and `table'.
13398 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
13399 replaced with...
13400 (YYPACT_NINF, YYTABLE_NINF): these.
13401 (yypact, yytable): Compute their types instead of hard-coded
13402 `short'.
13403 * tests/regression.at (Web2c Actions): Adjust.
13404
5dde258a
AD
134052002-07-19 Akim Demaille <akim@epita.fr>
13406
13407 * src/scan-gram.l (id): Can start with an underscore.
13408
a945ec39
AD
134092002-07-16 Akim Demaille <akim@epita.fr>
13410
13411 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
13412 Adjust all former `associativity' dependencies.
13413 * src/symtab.c (symbol_new): Default associativity is `undef', not
13414 `right'.
13415 (symbol_check_alias_consistence): Adjust.
13416
fae437e8
AD
134172002-07-09 Akim Demaille <akim@epita.fr>
13418
13419 * doc/bison.texinfo: Properly set the ``header'' part.
13420 Use @dircategory ``GNU programming tools'' as per Texinfo's
13421 documentation.
13422 Use @copying.
13423
1a715ef2
AD
134242002-07-09 Akim Demaille <akim@epita.fr>
13425
13426 * lib/quotearg.h: Protect against multiple inclusions.
13427 * src/location.h (location_t): Add a `file' member.
13428 (LOCATION_RESET, LOCATION_PRINT): Adjust.
13429 * src/complain.c (warn_at, complain_at, fatal_at): Drop
13430 `error_one_per_line' support.
13431
a5d50994
AD
134322002-07-09 Akim Demaille <akim@epita.fr>
13433
13434 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
13435 * src/reader.c (lineno): Remove.
13436 Adjust all dependencies.
13437 (get_merge_function): Take a location and use complain_at.
13438 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
13439 * tests/regression.at (Invalid inputs, Mixing %token styles):
13440 Adjust.
13441
b275314e
AD
134422002-07-09 Akim Demaille <akim@epita.fr>
13443
13444 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
13445 recovery rule, and forbid extensions when --yacc.
13446 (gram_error): Use complain_at.
13447 * src/reader.c (reader): Exit if there were parse errors.
13448
865b9df1
AD
134492002-07-09 Akim Demaille <akim@epita.fr>
13450
13451 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
13452 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
13453 Reported by R Blake <blakers@mac.com>.
13454
c76e14da
AD
134552002-07-09 Akim Demaille <akim@epita.fr>
13456
13457 * data/yacc.c: Output the copyright notive in the header.
13458
7db2ed2d
AD
134592002-07-03 Akim Demaille <akim@epita.fr>
13460
13461 * src/output.c (froms, tos): Are state_number_t.
13462 (save_column): sp, sp1, and sp2 are state_number_t.
13463 (prepare): Rename `final' as `final_state_number', `nnts' as
13464 `nterms_number', `nrules' as `rules_number', `nstates' as
13465 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
13466 unused.
13467 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
13468 * data/lalr1.cc (nsym_): Remove, unused.
13469
e68e0410
AD
134702002-07-03 Akim Demaille <akim@epita.fr>
13471
13472 * src/lalr.h, src/lalr.c (goto_number_t): New.
13473 * src/lalr.c (goto_list_t): New.
13474 Propagate them.
13475 * src/nullable.c (rule_list_t): New.
13476 Propagate.
13477 * src/types.h: Remove.
13478
e1a4f3a4
AD
134792002-07-03 Akim Demaille <akim@epita.fr>
13480
13481 * src/closure.c (print_fderives): Use rule_rhs_print.
13482 * src/derives.c (print_derives): Use rule_rhs_print.
13483 (rule_list_t): New, replaces `shorts'.
13484 (set_derives): Add comments.
13485 * tests/sets.at (Nullable, Firsts): Adjust.
13486
536545f3
AD
134872002-07-03 Akim Demaille <akim@epita.fr>
13488
13489 * src/output.c (prepare_actions): Free `tally' and `width'.
13490 (prepare_actions): Allocate and free `order'.
13491 * src/symtab.c (symbols_free): Free `symbols'.
13492 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
13493 * src/output.c (m4_invoke): Move to...
13494 * src/scan-skel.l: here.
13495 (<<EOF>>): Close yyout, and free its name.
13496
8b752b00
AD
134972002-07-03 Akim Demaille <akim@epita.fr>
13498
13499 Fix some memory leaks, and fix a bug: state 0 was examined twice.
13500
13501 * src/LR0.c (new_state): Merge into...
13502 (state_list_append): this.
13503 (new_states): Merge into...
13504 (generate_states): here.
13505 (set_states): Don't ensure a proper `errs' state member here, do it...
13506 * src/conflicts.c (conflicts_solve): here.
13507 * src/state.h, src/state.c: Comment changes.
13508 (state_t): Rename member `shifts' as `transitions'.
13509 Adjust all dependencies.
13510 (errs_new): For consistency, also take the values as argument.
13511 (errs_dup): Remove.
13512 (state_errs_set): New.
13513 (state_reductions_set, state_transitions_set): Assert that no
13514 previous value was assigned.
13515 (state_free): New.
13516 (states_free): Use it.
13517 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
13518 temporary storage: use `errs' and `nerrs' as elsewhere.
13519 (set_conflicts): Allocate and free this `errs'.
13520
613f5e1a
AD
135212002-07-02 Akim Demaille <akim@epita.fr>
13522
13523 * lib/libiberty.h: New.
13524 * lib: Update the bitset implementation from upstream.
13525 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
13526 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
13527 * src/main.c: Adjust bitset stats calls.
13528
26e0cadc
PE
135292002-07-01 Paul Eggert <eggert@twinsun.com>
13530
13531 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
13532 char, so that negative chars don't collide with $.
13533
1154cced
AD
135342002-06-30 Akim Demaille <akim@epita.fr>
13535
13536 Have the GLR tests be `warning' checked, and fix the warnings.
13537
13538 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
13539 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
13540 (yyremoveDeletes): `yyi' and `yyj' are size_t.
13541 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
13542 (yyaddDeferredAction): static.
13543 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
13544 (yyreportParseError): yyprefix is const.
13545 yytokenp is used only when verbose.
13546 (yy__GNUC__): Replace with __GNUC__.
13547 (yypdumpstack): yyi is size_t.
13548 (yypreference): Un-yy local variables and arguments, to avoid
13549 clashes with `yyr1'. Anyway, we are not in the user name space.
13550 (yytname_size): be an int, as is compared with ints.
13551 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
13552 Use them.
13553 * tests/cxx-gram.at: Use quotation to protect $1.
13554 Use AT_COMPILE to enable warnings hunts.
13555 Prototype yylex and yyerror.
13556 `Use' argc.
13557 Include `string.h', not `strings.h'.
13558 Produce and prototype stmtMerge only when used.
13559 yylex takes a location.
13560
97650f4e
AD
135612002-06-30 Akim Demaille <akim@epita.fr>
13562
13563 We spend a lot of time in quotearg, in particular when --verbose.
13564
13565 * src/symtab.c (symbol_get): Store a quoted version of the key.
13566 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
13567 Adjust all callers.
13568
d2576365
AD
135692002-06-30 Akim Demaille <akim@epita.fr>
13570
13571 * src/state.h (reductions_t): Rename member `nreds' as num.
13572 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
13573 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
13574
ccaf65bc
AD
135752002-06-30 Akim Demaille <akim@epita.fr>
13576
13577 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
13578 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
13579 (shifts_to): Rename as...
13580 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
13581 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
13582 (TRANSITION_IS_DISABLED, transitions_to): these.
13583
87675353
AD
135842002-06-30 Akim Demaille <akim@epita.fr>
13585
13586 * src/print.c (print_shifts, print_gotos): Merge into...
13587 (print_transitions): this.
13588 (print_transitions, print_errs, print_reductions): Align the
13589 lookaheads columns.
13590 (print_core, print_transitions, print_errs, print_state,
13591 print_grammar): Output empty lines separator before, not after.
13592 (state_default_rule_compute): Rename as...
13593 (state_default_rule): this.
13594 * tests/conflicts.at (Defaulted Conflicted Reduction),
13595 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
13596 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
13597
ce4ccb4b
AD
135982002-06-30 Akim Demaille <akim@epita.fr>
13599
13600 Display items as we display rules.
13601
13602 * src/gram.h, src/gram.c (rule_lhs_print): New.
13603 * src/gram.c (grammar_rules_partial_print): Use it.
13604 * src/print.c (print_core): Likewise.
13605 * tests/conflicts.at (Defaulted Conflicted Reduction),
13606 (Unresolved SR Conflicts): Adjust.
13607 (Unresolved SR Conflicts): Adjust and rename as...
13608 (Resolved SR Conflicts): this, as was meant.
13609 * tests/regression.at (Web2c Report): Adjust.
13610
bc933ef1
AD
136112002-06-30 Akim Demaille <akim@epita.fr>
13612
13613 * src/print.c (state_default_rule_compute): New, extracted from...
13614 (print_reductions): here.
13615 Pessimize, but clarify the code.
13616 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
13617
53d4308d
AD
136182002-06-30 Akim Demaille <akim@epita.fr>
13619
13620 * src/output.c (action_row): Let default_rule be always a rule
13621 number.
13622
574fb2d5
AD
136232002-06-30 Akim Demaille <akim@epita.fr>
13624
13625 * src/closure.c (print_firsts, print_fderives, closure):
13626 Use BITSET_EXECUTE.
13627 * src/lalr.c (lookaheads_print): Likewise.
13628 * src/state.c (state_rule_lookaheads_print): Likewise.
13629 * src/print_graph.c (print_core): Likewise.
13630 * src/print.c (print_reductions): Likewise.
13631 * src/output.c (action_row): Likewise.
13632 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
13633
05811fd7
AD
136342002-06-30 Akim Demaille <akim@epita.fr>
13635
13636 * src/print_graph.c: Use report_flag.
13637
0e4d5753
AD
136382002-06-30 Akim Demaille <akim@epita.fr>
13639
13640 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
13641 to...
13642 * src/relation.h, src/relation.c (traverse, relation_digraph)
13643 (relation_print, relation_transpose): New.
13644
24c7d800
AD
136452002-06-30 Akim Demaille <akim@epita.fr>
13646
13647 * src/state.h, src/state.c (shifts_to): New.
13648 * src/lalr.c (build_relations): Use it.
13649
9222837b
AD
136502002-06-30 Akim Demaille <akim@epita.fr>
13651
13652 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
13653 (item_number_of_rule_number, rule_number_of_item_number): New.
13654 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
13655 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
13656 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
13657 Propagate their use.
13658 Much remains to be done, in particular wrt `shorts' from types.h.
13659
260008e5
AD
136602002-06-30 Akim Demaille <akim@epita.fr>
13661
13662 * src/symtab.c (symbol_new): Initialize the `printer' member.
13663
8a731ca8
AD
136642002-06-30 Akim Demaille <akim@epita.fr>
13665
13666 * src/LR0.c (save_reductions): Remove, replaced by...
13667 * src/state.h, src/state.c (state_reductions_set): New.
13668 (reductions, errs): Rename as...
13669 (reductions_t, errs_t): these.
13670 Adjust all dependencies.
13671
32e1e0a4
AD
136722002-06-30 Akim Demaille <akim@epita.fr>
13673
13674 * src/LR0.c (state_list_t, state_list_append): New.
13675 (first_state, last_state): Now symbol_list_t.
13676 (this_state): Remove.
13677 (new_itemsets, append_states, save_reductions): Take a state_t as
13678 argument.
13679 (set_states, generate_states): Adjust.
13680 (save_shifts): Remove, replaced by...
13681 * src/state.h, src/state.c (state_shifts_set): New.
13682 (shifts): Rename as...
13683 (shifts_t): this.
13684 Adjust all dependencies.
13685 * src/state.h (state_t): Remove the `next' member.
13686
e5fb6710
AD
136872002-06-30 Akim Demaille <akim@epita.fr>
13688
13689 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
13690 escaped in slot 0.
13691
c7ca99d4
AD
136922002-06-30 Akim Demaille <akim@epita.fr>
13693
13694 Use hash.h for the state hash table.
13695
13696 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
13697 (allocate_storage): Use state_hash_new.
13698 (free_storage): Use state_hash_free.
13699 (new_state, get_state): Adjust.
13700 * src/lalr.h, src/lalr.c (states): Move to...
13701 * src/states.h (state_t): Remove the `link' member, no longer
13702 used.
13703 * src/states.h, src/states.c: here.
13704 (state_hash_new, state_hash_free, state_hash_lookup)
13705 (state_hash_insert, states_free): New.
13706 * src/states.c (state_table, state_compare, state_hash): New.
13707 * src/output.c (output_actions): Do not free states now, since we
13708 still need to know the final_state number in `prepare', called
13709 afterwards. Do it...
13710 * src/main.c (main): here: call states_free after `output'.
13711
df0e7316
AD
137122002-06-30 Akim Demaille <akim@epita.fr>
13713
13714 * src/state.h, src/state.c (state_new): New, extracted from...
13715 * src/LR0.c (new_state): here.
13716 * src/state.h (STATE_ALLOC): Move to...
13717 * src/state.c: here.
13718 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
13719 * src/state.h, src/state.c: here.
13720
39f41916
AD
137212002-06-30 Akim Demaille <akim@epita.fr>
13722
13723 * src/reader.c (gensym): Rename as...
13724 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
13725 (getsym): Rename as...
13726 (symbol_get): this.
13727
d57650a5
AD
137282002-06-30 Akim Demaille <akim@epita.fr>
13729
13730 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
13731 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
13732 * src/output.c, src/print.c, src/print_graph.c: Propagate.
13733 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
13734
5a08f1ce
AD
137352002-06-30 Akim Demaille <akim@epita.fr>
13736
13737 Make the test suite pass with warnings checked.
13738
13739 * tests/actions.at (Printers and Destructors): Improve.
13740 Avoid unsigned vs. signed issues.
13741 * tests/calc.at: Don't exercise the scanner here, do it...
13742 * tests/input.at (Torturing the Scanner): here.
13743
720623af
PH
137442002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13745
88e7e941 13746 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
13747 reorganize first lines parallel to yacc.c.
13748
fb8135fa
AD
137492002-06-28 Akim Demaille <akim@epita.fr>
13750
13751 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
13752 (b4_token_enum, b4_token_defines): New, factored from...
13753 * data/lalr1.cc, data/yacc.c, glr.c: here.
13754
41442480
AD
137552002-06-28 Akim Demaille <akim@epita.fr>
13756
13757 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
13758 unused variables.
13759 * src/output.c (merger_output): static.
13760
e0e5bf84
AD
137612002-06-28 Akim Demaille <akim@epita.fr>
13762
ba0fe3c7 13763 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
13764 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
13765 pacify GCC.
13766 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 13767
676385e2
PH
137682002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13769
13770 Accumulated changelog for new GLR parsing features.
13771
6a254321 13772 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
13773 conflicts_total_count.
13774 * src/conflicts.h: Ditto.
13775 * src/output.c (token_actions): Use the new name.
13776 (output_conflicts): Change conflp => conflict_list_heads, and
13777 confl => conflict_list for better readability.
13778 * data/glr.c: Use the new names.
13779 * NEWS: Add self to GLR announcement.
e0e5bf84 13780
676385e2
PH
13781 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
13782
13783 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
13784 Akim Demaille.
13785
13786 * data/bison.glr: Change name to glr.c
13787 * data/glr.c: Renamed from bison.glr.
13788 * data/Makefile.am: Add glr.c
e0e5bf84
AD
13789
13790 * src/getargs.c:
13791
676385e2 13792 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 13793 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 13794
676385e2
PH
13795 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13796
13797 * data/bison.glr: Be sure to restore the
13798 current #line when returning to the skeleton contents after having
13799 exposed the input file's #line.
13800
13801 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13802
13803 * data/bison.glr: Bring up to date with changes to bison.simple.
13804
13805 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13806
13807 * data/bison.glr: Correct definitions that use b4_prefix.
13808 Various reformatting.
13809 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
13810 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
13811 yytokenp argument; now part of stack.
13812 (yychar): Define to behave as documented.
13813 (yyclearin): Ditto.
e0e5bf84 13814
676385e2
PH
13815 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13816
13817 * src/reader.h: Add declaration for free_merger_functions.
13818
13819 * src/reader.c (merge_functions): New variable.
13820 (get_merge_function): New function.
13821 (free_merger_functions): New function.
13822 (readgram): Check for %prec that is not followed by a symbol.
13823 Handle %dprec and %merge declarations.
13824 (packgram): Initialize dprec and merger fields in rules array.
13825
13826 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
13827 conflict_list_cnt, conflict_list_free): New variables.
13828 (table_grow): Also grow conflict_table.
e0e5bf84 13829 (prepare_rules): Output dprec and merger tables.
676385e2 13830 (conflict_row): New function.
e0e5bf84 13831 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
13832 default reduction in conflicted states for GLR parser so that there
13833 are spaces for the conflict lists.
13834 (save_row): Also save conflict information.
13835 (token_actions): Allocate conflict list.
13836 (merger_output): New function.
13837 (pack_vector): Pack conflict table, too.
13838 (output_conflicts): New function to output yyconflp and yyconfl.
13839 (output_check): Allocate conflict_tos.
13840 (output_actions): Output conflict tables, also.
13841 (output_skeleton): Output b4_mergers definition.
13842 (prepare): Output b4_max_rhs_length definition.
13843 Use 'bison.glr' as default skeleton for GLR parsers.
13844
13845 * src/gram.c (glr_parser): New flag.
13846 (grammar_free): Call free_merger_functions.
13847
13848 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
13849 all pairs of conflicting reductions, rather than just all tokens
13850 causing conflicts. Needed to size conflict tables.
e0e5bf84 13851 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
13852 interface.
13853 (conflicts_print): Ditto.
13854 (count_total_conflicts): New function.
13855
13856 * src/reader.h (merger_list): New type.
13857 (merge_functions): New variable.
13858
13859 * src/lex.h (tok_dprec, tok_merge): New token types.
13860
13861 * src/gram.h (rule_s): Add dprec and merger fields.
13862 (glr_parser): New flag.
13863
13864 * src/conflicts.h (count_total_conflicts): New function.
13865
13866 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
13867
13868 * doc/bison.texinfo (Generalized LR Parsing): New section.
13869 (GLR Parsers): New section.
13870 (Language and Grammar): Mention GLR parsing.
13871 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
13872 Correct typo ("tge" -> "the").
13873
13874 * data/bison.glr: New skeleton for GLR parsing.
13875
13876 * tests/cxx-gram.at: New tests for GLR parsing.
13877
13878 * tests/testsuite.at: Include cxx-gram.at.
13879
13880 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 13881
676385e2
PH
13882 * src/parse-gram.y:
13883
13884 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
13885
13886 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 13887
b5480d74 138882002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
13889
13890 * src/options.h, src/options.c: Remove.
13891 * src/getargs.c (short_options, long_options): New.
13892
60491a94
AD
138932002-06-27 Akim Demaille <akim@epita.fr>
13894
13895 * data/bison.simple, data/bison.c++: Rename as...
13896 * data/yacc.c, data/lalr1.cc: these.
13897 * doc/bison.texinfo (Environment Variables): Remove.
13898
9be0c25b
AD
138992002-06-25 Raja R Harinath <harinath@cs.umn.edu>
13900
13901 * src/getargs.c (report_argmatch): Initialize strtok().
13902
1ae72863
AD
139032002-06-20 Akim Demaille <akim@epita.fr>
13904
13905 * data/bison.simple (b4_symbol_actions): New, replaces...
13906 (b4_symbol_destructor, b4_symbol_printer): these.
13907 (yysymprint): Be sure to call YYPRINT only for tokens, and using
13908 user token numbers.
13909
87542d29
AD
139102002-06-20 Akim Demaille <akim@epita.fr>
13911
13912 * data/bison.simple (yydestructor): Rename as...
13913 (yydestruct): this.
13914
1a31ed21
AD
139152002-06-20 Akim Demaille <akim@epita.fr>
13916
13917 * src/symtab.h, src/symtab.c (symbol_type_set)
13918 (symbol_destructor_set, symbol_precedence_set): The location is
13919 the last argument.
13920 Adjust all callers.
13921
e776192e
AD
139222002-06-20 Akim Demaille <akim@epita.fr>
13923
13924 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
13925 internals.
13926 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13927 Takes a location.
13928 * src/symtab.h, src/symtab.c (symbol_class_set)
13929 (symbol_user_token_number_set): Likewise.
13930 Adjust all callers.
13931 Promote complain_at.
13932 * tests/input.at (Type Clashes): Adjust.
13933
5c1180b3
AD
139342002-06-20 Akim Demaille <akim@epita.fr>
13935
13936 * data/bison.simple (YYLEX): Fix the declaration when
13937 %pure-parser.
13938
e3170060
AD
139392002-06-20 Akim Demaille <akim@epita.fr>
13940
13941 * data/bison.simple (yysymprint): Don't print the token number,
13942 just its name.
13943 * tests/actions.at (Destructors): Rename as...
13944 (Printers and Destructors): this.
13945 Also exercise %printer.
13946
253862fd
AD
139472002-06-20 Akim Demaille <akim@epita.fr>
13948
13949 * data/bison.simple (YYDSYMPRINT): New.
13950 Use it to remove many of the #if YYDEBUG/if (yydebug).
13951
366eea36
AD
139522002-06-20 Akim Demaille <akim@epita.fr>
13953
13954 * src/symtab.h, src/symtab.c (symbol_t): printer and
13955 printer_location are new members.
13956 (symbol_printer_set): New.
13957 * src/parse-gram.y (PERCENT_PRINTER): New token.
13958 Handle its associated rule.
13959 * src/scan-gram.l: Adjust.
13960 (handle_destructor_at, handle_destructor_dollar): Rename as...
13961 (handle_symbol_code_at, handle_symbol_code_dollar): these.
13962 * src/output.c (symbol_printers_output): New.
13963 (output_skeleton): Call it.
13964 * data/bison.simple (yysymprint): New. Cannot be named yyprint
13965 since there are already many grammar files with a user `yyprint'.
13966 Replace the calls to YYPRINT to calls to yysymprint.
13967 * tests/calc.at: Adjust.
13968 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
13969 taking advantage of parser very internal details (stack size!).
13970
4f25ebb0
AD
139712002-06-20 Akim Demaille <akim@epita.fr>
13972
13973 * src/scan-gram.l: Complete the scanner with the missing patterns
13974 to pacify Flex.
13975 Use `quote' and `symbol_tag_get' where appropriate.
13976
93b68a0e
AD
139772002-06-19 Akim Demaille <akim@epita.fr>
13978
13979 * tests/actions.at (Destructors): Augment to test locations.
13980 * data/bison.simple (yydestructor): Pass it the current location
13981 if locations are enabled.
13982 Prototype only when __STDC__ or C++.
13983 Change the argument names to move into the yy name space: there is
13984 user code here.
13985
58612f1d
AD
139862002-06-19 Akim Demaille <akim@epita.fr>
13987
74310291
AD
13988 * data/bison.simple (b4_pure_if): New.
13989 Use it instead of #ifdef YYPURE.
13990
139912002-06-19 Akim Demaille <akim@epita.fr>
13992
13993 * data/bison.simple (b4_location_if): New.
58612f1d
AD
13994 Use it instead of #ifdef YYLSP_NEEDED.
13995
f25bfb75
AD
139962002-06-19 Akim Demaille <akim@epita.fr>
13997
13998 Prepare @$ in %destructor, but currently don't bind it in the
13999 skeleton, as %location use is not cleaned up yet.
14000
14001 * src/scan-gram.l (handle_dollar, handle_destructor_at)
14002 (handle_action_at): New.
14003 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
14004 a braced_code_t and a location as additional arguments.
14005 (handle_destructor_dollar): Instead of requiring `b4_eval', just
14006 unquote one when outputting `b4_dollar_dollar'.
14007 Adjust callers.
14008 * data/bison.simple (b4_eval): Remove.
14009 (b4_symbol_destructor): Adjust.
14010 * tests/input.at (Invalid @n): Adjust.
14011
c732d2c6
AD
140122002-06-19 Zack Weinberg <zack@codesourcery.com>
14013
14014 * doc/bison.texinfo: Document ability to have multiple
14015 prologue sections.
14016
8c165d89
AD
140172002-06-18 Akim Demaille <akim@epita.fr>
14018
14019 * src/files.c (compute_base_names): When computing the output file
14020 names from the input file name, strip the directory part.
14021
ca98bf57
AD
140222002-06-18 Akim Demaille <akim@epita.fr>
14023
14024 * data/bison.simple.new: Comment changes.
14025 Reported by Andreas Schwab.
14026
0bfb02ff
AD
140272002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
14028
14029 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
14030 there are no `label `yyoverflowlab' defined but not used' warnings
14031 when yyoverflow is defined.
14032
24c0aad7
AD
140332002-06-18 Akim Demaille <akim@epita.fr>
14034
14035 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
14036 new member.
14037 (symbol_destructor_set): Adjust.
14038 * src/output.c (symbol_destructors_output): Output the destructor
14039 locations.
14040 Output the symbol name.
14041 * data/bison.simple (b4_symbol_destructor): Adjust.
14042
5719c109
AD
140432002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
14044 and Akim Demaille <akim@epita.fr>
14045
14046 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
14047 what's left on the stack when the error recovery hits EOF.
14048 * tests/actions.at (Destructors): Complete to exercise this case.
14049
9280d3ef
AD
140502002-06-17 Akim Demaille <akim@epita.fr>
14051
14052 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
14053 arguments is really empty, not only equal to `[]'.
14054 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
14055 member.
14056 (symbol_destructor_set): New.
14057 * src/output.c (symbol_destructors_output): New.
14058 * src/reader.h (brace_code_t, current_braced_code): New.
14059 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
14060 (handle_dollar): Rename as...
14061 (handle_action_dollar): this.
14062 (handle_destructor_dollar): New.
14063 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
14064 (grammar_declaration): Use it.
14065 * data/bison.simple (yystos): Is always defined.
14066 (yydestructor): New.
14067 * tests/actions.at (Destructors): New.
14068 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
14069
dafdc66f
AD
140702002-06-17 Akim Demaille <akim@epita.fr>
14071
14072 * src/symlist.h, src/symlist.c (symbol_list_length): New.
14073 * src/scan-gram.l (handle_dollar, handle_at): Compute the
14074 rule_length only when needed.
14075 * src/output.c (actions_output, token_definitions_output): Output
14076 the full M4 block.
14077 * src/symtab.c: Don't access directly to the symbol tag, use
14078 symbol_tag_get.
14079 * src/parse-gram.y: Use symbol_list_free.
14080
56c47203
AD
140812002-06-17 Akim Demaille <akim@epita.fr>
14082
14083 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
14084 (symbol_list_prepend, get_type_name): Move to...
14085 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
14086 (symbol_list_prepend, symbol_list_n_type_name_get): here.
14087 Adjust all callers.
14088 (symbol_list_free): New.
14089 * src/scan-gram.l (handle_dollar): Takes a location.
14090 * tests/input.at (Invalid $n): Adjust.
14091
1e0bab92
AD
140922002-06-17 Akim Demaille <akim@epita.fr>
14093
14094 * src/reader.h, src/reader.c (symbol_list_new): Export it.
14095 (symbol_list_prepend): New.
14096 * src/parse-gram.y (%union): `list' is a new member.
14097 (symbols.1): New, replaces...
14098 (terms_to_prec.1, nterms_to_type.1): these.
14099 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
14100 Take a location as additional argument.
14101 Adjust all callers.
14102
04e60654
AD
141032002-06-15 Akim Demaille <akim@epita.fr>
14104
14105 * src/parse-gram.y: Move %token in the declaration section so that
14106 we don't depend upon CVS Bison.
14107
10e5b8bd
AD
141082002-06-15 Akim Demaille <akim@epita.fr>
14109
14110 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
14111 * src/print.c (print_core): Use it.
14112
9801d40c
AD
141132002-06-15 Akim Demaille <akim@epita.fr>
14114
14115 * src/conflicts.c (log_resolution): Accept the rule involved in
14116 the sr conflicts instead of the lookahead number that points to
14117 that rule.
14118 (flush_reduce): Accept the current lookahead vector as argument,
14119 instead of the index in LA.
14120 (resolve_sr_conflict): Accept the current number of lookahead
14121 bitset to consider for the STATE, instead of the index in LA.
14122 (set_conflicts): Adjust.
14123 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
14124
c0263492
AD
141252002-06-15 Akim Demaille <akim@epita.fr>
14126
14127 * src/state.h (state_t): Replace the `lookaheadsp' member, a
14128 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
14129 Adjust all dependencies.
14130 * src/lalr.c (initialize_lookaheads): Split into...
14131 (states_lookaheads_count, states_lookaheads_initialize): these.
14132 (lalr): Adjust.
14133
9757c359
AD
141342002-06-15 Akim Demaille <akim@epita.fr>
14135
14136 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
14137 out of...
14138 (grammar_rules_print): here.
14139 * src/reduce.c (reduce_output): Use it.
14140 * tests/reduce.at (Useless Rules, Reduced Automaton)
14141 (Underivable Rules): Adjust.
14142
6b98e4b5
AD
141432002-06-15 Akim Demaille <akim@epita.fr>
14144
14145 Copy BYacc's nice way to report the grammar.
14146
14147 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
14148 New.
14149 Don't print the rules' location, it is confusing and useless.
14150 (rule_print): Use grammar_rhs_print.
14151 * src/print.c (print_grammar): Use grammar_rules_print.
14152
6b98e4b5
AD
141532002-06-15 Akim Demaille <akim@epita.fr>
14154
14155 Complete and rationalize `useless thing' warnings.
14156
14157 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
14158 (symbol_tag_print): New.
14159 Use them everywhere in place of accessing directly the tag member.
14160 * src/gram.h, src/gram.c (rule_print): New.
14161 Use it where a rule used to be printed `by hand'.
14162 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
14163 (reduce_grammar_tables): Report the useless rules.
14164 (reduce_print): Useless things are a warning, not an error.
14165 Report it as such.
14166 * tests/reduce.at (Useless Nonterminals, Useless Rules):
14167 (Reduced Automaton, Underivable Rules): Adjust.
14168 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
14169 * tests/conflicts.at (Unresolved SR Conflicts)
14170 (Solved SR Conflicts): Adjust.
14171
ee000ba4
AD
141722002-06-15 Akim Demaille <akim@epita.fr>
14173
14174 Let symbols have a location.
14175
14176 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
14177 (getsym): Adjust.
14178 Adjust all callers.
14179 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
14180 Use location_t, not int.
14181 * src/symtab.c (symbol_check_defined): Take advantage of the
14182 location.
14183 * tests/regression.at (Invalid inputs): Adjust.
14184
8efe435c
AD
141852002-06-15 Akim Demaille <akim@epita.fr>
14186
14187 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
14188 (input): Don't try to initialize yylloc here, do it in the
14189 scanner.
14190 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
14191 * src/gram.h (rule_t): Change line and action_line into location
14192 and action_location, of location_t type.
14193 Adjust all dependencies.
14194 * src/location.h, src/location.c (empty_location): New.
14195 * src/reader.h, src/reader.c (grammar_start_symbol_set)
14196 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
14197 (grammar_current_rule_symbol_append)
14198 (grammar_current_rule_action_append): Expect a location as argument.
14199 * src/reader.c (grammar_midrule_action): Adjust to attach an
14200 action's location as dummy symbol location.
14201 * src/symtab.h, src/symtab.c (startsymbol_location): New.
14202 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
14203 the line numbers.
14204
1921f1d7
AD
142052002-06-14 Akim Demaille <akim@epita.fr>
14206
14207 Grammar declarations may be found in the grammar section.
14208
14209 * src/parse-gram.y (rules_or_grammar_declaration): New.
14210 (declarations): Each declaration may end with a semicolon, not
14211 just...
14212 (grammar_declaration): `"%union"'.
14213 (grammar): Branch to rules_or_grammar_declaration.
14214
4515534c
AD
142152002-06-14 Akim Demaille <akim@epita.fr>
14216
14217 * src/main.c (main): Invoke scanner_free.
14218
f958596b
AD
142192002-06-14 Akim Demaille <akim@epita.fr>
14220
14221 * src/output.c (m4_invoke): Extracted from...
14222 (output_skeleton): here.
14223 Free tempfile.
14224
2c569025
AD
142252002-06-14 Akim Demaille <akim@epita.fr>
14226
14227 * src/parse-gram.y (directives, directive, gram)
14228 (grammar_directives, precedence_directives, precedence_directive):
14229 Rename as...
14230 (declarations, declaration, grammar, grammar_declaration)
14231 (precedence_declaration, precedence_declarator): these.
14232 (symbol_declaration): New.
14233
592e8d4d
AD
142342002-06-14 Akim Demaille <akim@epita.fr>
14235
14236 * src/files.c (action_obstack): Remove, unused.
14237 (output_obstack): Remove it, and all its dependencies, as it is no
14238 longer needed.
14239 * src/reader.c (epilogue_set): Build the epilogue in the
14240 muscle_obstack.
14241 * src/output.h, src/output.c (muscle_obstack): Move to...
14242 * src/muscle_tab.h, src/muscle_tab.h: here.
14243 (muscle_init): Initialize muscle_obstack.
14244 (muscle_free): New.
14245 * src/main.c (main): Call it.
14246
0c15323d
AD
142472002-06-14 Akim Demaille <akim@epita.fr>
14248
14249 * src/location.h: New, extracted from...
14250 * src/reader.h: here.
14251 * src/Makefile.am (noinst_HEADERS): Merge into
14252 (bison_SOURCES): this.
14253 Add location.h.
14254 * src/parse-gram.y: Use location_t instead of Bison's.
14255 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
14256 Use location_t instead of ints.
14257
e96c9728
AD
142582002-06-14 Akim Demaille <akim@epita.fr>
14259
14260 * data/bison.simple, data/bison.c++: Be sure to restore the
14261 current #line when returning to the skeleton contents after having
14262 exposed the input file's #line.
14263
75d1fe16
AD
142642002-06-12 Akim Demaille <akim@epita.fr>
14265
14266 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
14267 eager.
14268 * tests/actions.at (Exotic Dollars): New.
14269
6c35d22c
AD
142702002-06-12 Akim Demaille <akim@epita.fr>
14271
14272 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
14273 ['"/] too eagerly.
14274 * tests/input.at (Torturing the Scanner): New.
14275
1d6412ad
AD
142762002-06-11 Akim Demaille <akim@epita.fr>
14277
14278 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
14279 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
14280 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
14281 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
14282 * src/reader.c (reader): Use it.
14283
4cdb01db
AD
142842002-06-11 Akim Demaille <akim@epita.fr>
14285
14286 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
14287 Adjust all callers.
14288 (scanner_last_string_free): New.
14289
44995b2e
AD
142902002-06-11 Akim Demaille <akim@epita.fr>
14291
14292 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
14293 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
14294 (last_string, YY_OBS_FREE): New.
14295 Use them when returning an ID.
14296
e9955c83
AD
142972002-06-11 Akim Demaille <akim@epita.fr>
14298
14299 Have Bison grammars parsed by a Bison grammar.
14300
14301 * src/reader.c, src/reader.h (prologue_augment): New.
14302 * src/reader.c (copy_definition): Remove.
14303
14304 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
14305 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
14306 (grammar_current_rule_prec_set, grammar_current_rule_check)
14307 (grammar_current_rule_symbol_append)
14308 (grammar_current_rule_action_append): Export.
14309 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
14310 (symbol_list_action_append): Remove.
14311 Hook the routines from reader.
14312 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
14313 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
14314
14315 * src/reader.c (read_declarations): Remove, unused.
14316
14317 * src/parse-gram.y: Handle the epilogue.
14318 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
14319 (grammar_start_symbol_set): this.
14320 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
14321 * src/reader.c (readgram): Remove, unused.
14322 (reader): Adjust to insert eoftoken and axiom where appropriate.
14323
14324 * src/reader.c (copy_dollar): Replace with...
14325 * src/scan-gram.h (handle_dollar): this.
14326 * src/parse-gram.y: Remove `%thong'.
14327
14328 * src/reader.c (copy_at): Replace with...
14329 * src/scan-gram.h (handle_at): this.
14330
14331 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
14332 New.
14333
14334 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
14335 time being.
14336
14337 * src/reader.h, src/reader.c (grammar_rule_end): New.
14338
14339 * src/parse.y (current_type, current_class): New.
14340 Implement `%nterm', `%token' support.
14341 Merge `%term' into `%token'.
14342 (string_as_id): New.
14343 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
14344 type name.
14345
14346 * src/parse-gram.y: Be sure to handle properly the beginning of
14347 rules.
14348
14349 * src/parse-gram.y: Handle %type.
14350 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
14351
14352 * src/parse-gram.y: More directives support.
14353 * src/options.c: No longer handle source directives.
14354
14355 * src/parse-gram.y: Fix %output.
14356
14357 * src/parse-gram.y: Handle %union.
14358 Use the prologue locations.
14359 * src/reader.c (parse_union_decl): Remove.
14360
14361 * src/reader.h, src/reader.c (epilogue_set): New.
14362 * src/parse-gram.y: Use it.
14363
14364 * data/bison.simple, data/bison.c++: b4_stype is now either not
14365 defined, then default to int, or to the contents of %union,
14366 without `union' itself.
14367 Adjust.
14368 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
14369
14370 * src/output.c (actions_output): Don't output braces, as they are
14371 already handled by the scanner.
14372
14373 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
14374 characters to themselves.
14375
14376 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
14377 that the epilogue has a proper #line.
14378
14379 * src/parse-gram.y: Handle precedence/associativity.
14380
14381 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
14382 a terminal.
14383 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
14384 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
14385 at all to define terminals that cannot be emitted.
14386
14387 * src/scan-gram.l: Escape M4 characters.
14388
14389 * src/scan-gram.l: Working properly with escapes in user
14390 strings/characters.
14391
14392 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
14393 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
14394 grammar.
14395 Use more modest sizes, as for the time being the parser does not
14396 release memory, and therefore the process swallows a huge amount
14397 of memory.
14398
14399 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
14400 stricter %token grammar.
14401
14402 * src/symtab.h (associativity): Add `undef_assoc'.
14403 (symbol_precedence_set): Do nothing when passed an undef_assoc.
14404 * src/symtab.c (symbol_check_alias_consistence): Adjust.
14405
14406 * tests/regression.at (Invalid %directive): Remove, as it is now
14407 meaningless.
14408 (Invalid inputs): Adjust to the new error messages.
14409 (Token definitions): The new grammar doesn't allow too many
14410 eccentricities.
14411
14412 * src/lex.h, src/lex.c: Remove.
14413 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
14414 (copy_character, copy_string2, copy_string, copy_identifier)
14415 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
14416 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
14417 (parse_action): Remove.
14418 * po/POTFILES.in: Adjust.
14419
2e047461
AD
144202002-06-11 Akim Demaille <akim@epita.fr>
14421
cd05d13c 14422 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
14423 rule's action member: return the action as a string.
14424 Don't require `rule_length' as an argument: compute it.
14425 (grammar_current_rule_symbol_append)
14426 (grammar_current_rule_action_append): New, eved out from
14427 (readgram): here.
14428 Remove `action_flag', `rulelength', unused now.
14429
9af3fbce
AD
144302002-06-11 Akim Demaille <akim@epita.fr>
14431
14432 * src/reader.c (grammar_current_rule_prec_set).
14433 (grammar_current_rule_check): New, eved out from...
14434 (readgram): here.
14435 Remove `xaction', `first_rhs': useless.
14436 * tests/input.at (Type clashes): New.
14437 * tests/existing.at (GNU Cim Grammar): Adjust.
14438
1485e106
AD
144392002-06-11 Akim Demaille <akim@epita.fr>
14440
14441 * src/reader.c (grammar_midrule_action): New, Eved out from
14442 (readgram): here.
14443
da4160c3
AD
144442002-06-11 Akim Demaille <akim@epita.fr>
14445
14446 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
14447 New.
14448 (readgram): Use them as replacement of inlined code, crule and
14449 crule1.
14450
f6d0f937
AD
144512002-06-11 Akim Demaille <akim@epita.fr>
14452
14453 * src/reader.c (grammar_end, grammar_symbol_append): New.
14454 (readgram): Use them.
14455 Make the use of `p' as local as possible.
14456
69078d4b
AD
144572002-06-10 Akim Demaille <akim@epita.fr>
14458
14459 GCJ's parser requires the tokens to be defined before the prologue.
14460
14461 * data/bison.simple: Output the token definition before the user's
14462 prologue.
14463 * tests/regression.at (Braces parsing, Duplicate string)
14464 (Mixing %token styles): Check the output from bison.
14465 (Early token definitions): New.
14466
5e424082
AD
144672002-06-10 Akim Demaille <akim@epita.fr>
14468
14469 * src/symtab.c (symbol_user_token_number_set): Don't complain when
14470 assigning twice the same user number to a token, so that we can
14471 use it in...
14472 * src/lex.c (lex): here.
14473 Also use `symbol_class_set' instead of hand written code.
14474 * src/reader.c (parse_assoc_decl): Likewise.
14475
44536b35
AD
144762002-06-10 Akim Demaille <akim@epita.fr>
14477
14478 * src/symtab.c, src/symtab.c (symbol_class_set)
14479 (symbol_user_token_number_set): New.
14480 * src/reader.c (parse_token_decl): Use them.
14481 Use a switch instead of ifs.
14482 Use a single argument.
14483
8b9f2372
AD
144842002-06-10 Akim Demaille <akim@epita.fr>
14485
14486 Remove `%thong' support as it is undocumented, unused, duplicates
14487 `%token's job, and creates useless e-mail traffic with people who
14488 want to know what it is, why it is undocumented, unused, and
14489 duplicates `%token's job.
14490
14491 * src/reader.c (parse_thong_decl): Remove.
14492 * src/options.c (option_table): Remove "thong".
14493 * src/lex.h (tok_thong): Remove.
14494
3ae2b51f
AD
144952002-06-10 Akim Demaille <akim@epita.fr>
14496
14497 * src/symtab.c, src/symtab.c (symbol_type_set)
14498 (symbol_precedence_set): New.
14499 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
14500 (value_components_used): Remove, unused.
14501
2f1afb73
AD
145022002-06-09 Akim Demaille <akim@epita.fr>
14503
14504 Move symbols handling code out of the reader.
14505
14506 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
14507 (axiom): Move to...
14508 * src/symtab.h, src/symtab.c: here.
14509
14510 * src/gram.c (start_symbol): Remove: use startsymbol->number.
14511 * src/reader.c (startval): Rename as...
14512 * src/symtab.h, src/symtab.c (startsymbol): this.
14513 * src/reader.c: Adjust.
14514
14515 * src/reader.c (symbol_check_defined, symbol_make_alias)
14516 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14517 (token_translations_init)
14518 Move to...
14519 * src/symtab.c: here.
14520 * src/reader.c (packsymbols): Move to...
14521 * src/symtab.h, src/symtab.c (symbols_pack): here.
14522 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
14523 argument.
14524
e9bca3ad
AD
145252002-06-03 Akim Demaille <akim@epita.fr>
14526
14527 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
14528 then statements.
14529
86eff183
AD
145302002-06-03 Akim Demaille <akim@epita.fr>
14531
14532 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
14533 structs with non literals.
14534 * src/scan-skel.l: never-interactive.
14535 * src/conflicts.c (enum conflict_resolution_e): No trailing
14536 comma.
14537 * src/getargs.c (usage): Split long literal strings.
14538 Reported by Hans Aberg.
14539
717be197
AD
145402002-05-28 Akim Demaille <akim@epita.fr>
14541
14542 * data/bison.c++: Use C++ ostreams.
14543 (cdebug_): New member.
14544
670ddffd
AD
145452002-05-28 Akim Demaille <akim@epita.fr>
14546
14547 * src/output.c (output_skeleton): Be sure to allocate enough room
14548 for `/' _and_ for `\0' in full_skeleton.
14549
769b430f
AD
145502002-05-28 Akim Demaille <akim@epita.fr>
14551
14552 * data/bison.c++: Catch up with bison.simple:
14553 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14554 and Paul Eggert <eggert@twinsun.com>: `error' handing.
14555 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
14556 and popping traces.
14557
7067cb36
PH
145582002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14559
14560 * src/output.c (output_skeleton): Put an explicit path in front of
14561 the skeleton file name, rather than relying on the -I directory,
14562 to partially alleviate effects of having a skeleton file lying around
14563 in the current directory.
769b430f 14564
4a713ec2
PH
145652002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14566
769b430f 14567 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
14568 obstack_printf should be obstack_fgrow1.
14569
b408954b
AD
145702002-05-26 Akim Demaille <akim@epita.fr>
14571
14572 * src/state.h (state_t): `solved_conflicts' is a new member.
14573 * src/LR0.c (new_state): Set it to 0.
14574 * src/conflicts.h, src/conflicts.c (print_conflicts)
14575 (free_conflicts, solve_conflicts): Rename as...
14576 (conflicts_print, conflicts_free, conflicts_solve): these.
14577 Adjust callers.
14578 * src/conflicts.c (enum conflict_resolution_e)
14579 (solved_conflicts_obstack): New, used by...
14580 (log_resolution): this.
14581 Adjust to attach the conflict resolution to each state.
14582 Complete the description with the precedence/associativity
14583 information.
14584 (resolve_sr_conflict): Adjust.
14585 * src/print.c (print_state): Output its solved_conflicts.
14586 * tests/conflicts.at (Unresolved SR Conflicts)
14587 (Solved SR Conflicts): Exercise --report=all.
14588
a49aecd5
AD
145892002-05-26 Akim Demaille <akim@epita.fr>
14590
14591 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14592 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14593 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
14594 (token_number_t, item_number_as_token_number)
14595 (token_number_as_item_number, muscle_insert_token_number_table):
14596 Rename as...
14597 (symbol_number_t, item_number_as_symbol_number)
14598 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
14599 these, since it is more appropriate.
14600
5504898e
AD
146012002-05-26 Akim Demaille <akim@epita.fr>
14602
14603 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
14604 `Error:' lines.
14605 * data/bison.simple (yystos) [YYDEBUG]: New.
14606 (yyparse) [YYDEBUG]: Display the symbols which are popped during
14607 error recovery.
14608 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
14609
ec3bc396
AD
146102002-05-25 Akim Demaille <akim@epita.fr>
14611
14612 * doc/bison.texinfo (Debugging): Split into...
14613 (Tracing): this new section, its former contents, and...
14614 (Understanding): this new section.
14615 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
14616 by...
14617 (report_flag): this.
14618 Adjust all dependencies.
14619 (report_args, report_types, report_argmatch): New.
14620 (usage, getargs): Report/support -r, --report.
14621 * src/options.h
14622 (struct option_table_struct): Rename as..,
14623 (struct option_table_s): this.
14624 Rename the `set_flag' member to `flag' to match with getopt_long's
14625 struct.
14626 * src/options.c (option_table): Split verbose into an entry for
14627 %verbose, and another for --verbose.
14628 Support --report/-r, so remove -r from the obsolete --raw.
14629 * src/print.c: Attach full item sets and lookaheads reports to
14630 report_flag instead of trace_flag.
14631 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
14632
78df8250
PE
146332002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14634 and Paul Eggert <eggert@twinsun.com>
769b430f 14635
78df8250
PE
14636 * data/bison.simple (yyparse): Correct error handling to conform to
14637 POSIX and yacc. Specifically, after syntax error is discovered,
14638 do not reduce further before shifting the error token.
14639 Clean up the code a bit by removing the labels yyerrdefault,
14640 yyerrhandle, yyerrpop.
14641 * NEWS: Document the above.
14642
c0c9ea05
PH
146432002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14644
14645 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
14646 type; it isn't always big enough, since it doesn't necessarily
14647 include non-terminals.
769b430f 14648 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
14649 the latter can be removed.
14650 (yy_token_number_type): Remove, only one use.
14651 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
14652 don't use TokenNumberType as element type.
769b430f 14653
c0c9ea05
PH
14654 * tests/regression.at: Modify expected output to agree with change
14655 to yyr1 and yytranslate.
769b430f 14656
6390a83f
FK
146572002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
14658
14659 * src/reader.c (parse_action): Use copy_character instead of
14660 obstack_1grow.
14661
db7c8e9a
AD
146622002-05-13 Akim Demaille <akim@epita.fr>
14663
14664 * tests/regression.at (Token definitions): Prototype yylex and
14665 yyerror.
14666
fcc61800
PH
146672002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14668
158c687b 14669 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
14670 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
14671 32-bit arithmetic.
14672 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
14673
5683e9b2
AD
146742002-05-07 Akim Demaille <akim@epita.fr>
14675
14676 * tests/synclines.at: Be sure to prototype yylex and yyerror to
14677 avoid GCC warnings.
14678
0c2d3f4c
AD
146792002-05-07 Akim Demaille <akim@epita.fr>
14680
14681 Kill GCC warnings.
14682
14683 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
14684 over the RHS of each rule.
14685 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
14686 * src/state.h (state_t): Member `nitems' is unsigned short.
14687 * src/LR0.c (get_state): Adjust.
14688 * src/reader.c (packgram): Likewise.
14689 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
14690 `Type'.
14691 (muscle_insert_int_table): Remove, unused.
14692 (prepare_rules): Remove `max'.
14693
1565b720
AD
146942002-05-06 Akim Demaille <akim@epita.fr>
14695
14696 * src/closure.c (print_firsts): Display of the symbol tags.
14697 (bitmatrix_print): Move to...
14698 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
14699 here.
14700 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
14701
cfaee611
AD
147022002-05-06 Akim Demaille <akim@epita.fr>
14703
14704 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
14705 hash_do_for_each.
14706
458be8e0
AD
147072002-05-06 Akim Demaille <akim@epita.fr>
14708
14709 * src/LR0.c (new_state, get_state): Instead of using the global
14710 `kernel_size' and `kernel_base', have two new arguments:
14711 `core_size' and `core'.
14712 Adjust callers.
14713
a900a624
AD
147142002-05-06 Akim Demaille <akim@epita.fr>
14715
14716 * src/reader.c (packgram): No longer end `ritem' with a 0
14717 sentinel: it is not used.
14718
d4e7d3a1
AD
147192002-05-05 Akim Demaille <akim@epita.fr>
14720
14721 New experimental feature: display the lookaheads in the report and
14722 graph.
14723
14724 * src/print (print_core): When --trace-flag, display the rules
14725 lookaheads.
14726 * src/print_graph.c (print_core): Likewise.
14727 Swap the arguments.
14728 Adjust caller.
14729
39ceb25b
AD
147302002-05-05 Akim Demaille <akim@epita.fr>
14731
14732 * tests/torture.at (Many lookaheads): New test.
14733
5372019f
AD
147342002-05-05 Akim Demaille <akim@epita.fr>
14735
14736 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
14737 (GENERATE_MUSCLE_INSERT_TABLE): this.
14738 (output_int_table, output_unsigned_int_table, output_short_table)
14739 (output_token_number_table, output_item_number_table): Replace with...
14740 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
14741 (muscle_insert_short_table, muscle_insert_token_number_table)
14742 (muscle_insert_item_number_table): these.
14743 Adjust all callers.
14744 (prepare_tokens): Don't free `translations', since...
14745 * src/reader.h, src/reader.c (grammar_free): do it.
14746 Move to...
14747 * src/gram.h, src/gram.c (grammar_free): here.
14748 * data/bison.simple, data/bison.c++: b4_token_number_max is now
14749 b4_translate_max.
14750
5df5f6d5
AD
147512002-05-05 Akim Demaille <akim@epita.fr>
14752
14753 * src/output.c (output_unsigned_int_table): New.
14754 (prepare_rules): `i' is unsigned.
14755 `prhs', `rline', `r2' are unsigned int.
14756 Rename muscle `rhs_number_max' as `rhs_max'.
14757 Output muscles `prhs_max', `rline_max', and `r2_max'.
14758 Free rline and r1.
14759 * data/bison.simple, data/bison.c++: Adjust to use these muscles
14760 to compute types instead of constant types.
14761 * tests/regression.at (Web2c Actions): Adjust.
14762
b87f8b21
AD
147632002-05-04 Akim Demaille <akim@epita.fr>
14764
14765 * src/symtab.h (SALIAS, SUNDEF): Rename as...
14766 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
14767 Adjust dependencies.
14768 * src/output.c (token_definitions_output): Be sure not to output a
14769 `#define 'a'' when fed with `%token 'a' "a"'.
14770 * tests/regression.at (Token definitions): New.
14771
8bb936e4
PE
147722002-05-03 Paul Eggert <eggert@twinsun.com>
14773
14774 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
14775 for K&R C.
14776
147772002-05-03 gettextize <bug-gnu-gettext@gnu.org>
14778
14779 * Makefile.am (SUBDIRS): Remove intl.
14780 (EXTRA_DIST): Add config/config.rpath.
14781
53c71a12
AD
147822002-05-03 Akim Demaille <akim@epita.fr>
14783
14784 * data/bison.simple (m4_if): Don't output empty enums.
14785 And actually, output valid enum definitions :(.
14786
289dd0cf
AD
147872002-05-03 Akim Demaille <akim@epita.fr>
14788
14789 * configure.bat: Remove, completely obsolete.
14790 * Makefile.am (EXTRA_DIST): Adjust.
14791 Don't distribute config.rpath...
14792 * config/Makefile.am (EXTRA_DIST): Do it.
14793
db85e524
AD
147942002-05-03 Akim Demaille <akim@epita.fr>
14795
14796 * configure.in (GETTEXT_VERSION): New.
14797 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
14798
83ccf991
AD
147992002-05-03 Akim Demaille <akim@epita.fr>
14800
14801 * data/bison.simple (b4_token_enum): New.
14802 (b4_token_defines): Use it to output tokens both as #define and
14803 enums.
14804 Suggested by Paul Eggert.
14805 * src/output.c (token_definitions_output): Don't output spurious
14806 white spaces.
14807
1f418995
AD
148082002-05-03 Akim Demaille <akim@epita.fr>
14809
14810 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14811
45119f04
RA
148122002-05-02 Robert Anisko <robert@lrde.epita.fr>
14813
14814 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
14815 Update the stack class, give a try to deque as the default container.
14816
b2d52318
AD
148172002-05-02 Akim Demaille <akim@epita.fr>
14818
14819 * data/bison.simple (yyparse): Do not implement @$ = @1.
14820 (YYLLOC_DEFAULT): Adjust to do it.
14821 * doc/bison.texinfo (Location Default Action): Fix.
14822
3a8b4109
AD
148232002-05-02 Akim Demaille <akim@epita.fr>
14824
14825 * src/reader.c (parse_braces): Merge into...
14826 (parse_action): this.
14827
84614e13
AD
148282002-05-02 Akim Demaille <akim@epita.fr>
14829
14830 * configure.in (ALL_LINGUAS): Remove.
14831 * po/LINGUAS, hr.po: New.
14832
fdbcd8e2
AD
148332002-05-02 Akim Demaille <akim@epita.fr>
14834
14835 Remove the so called hairy (semantic) parsers.
14836
14837 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
14838 * src/gram.h, src/gram.c (semantic_parser): Remove.
14839 (rule_t): Remove the guard and guard_line members.
14840 * src/lex.h (token_t): remove tok_guard.
14841 * src/options.c (option_table): Remove %guard and %semantic_parser
14842 support.
14843 * src/output.c, src/output.h (guards_output): Remove.
14844 (prepare): Adjust.
14845 (token_definitions_output): Don't output the `T'
14846 tokens (???).
14847 (output_skeleton): Don't output the guards.
14848 * src/files.c, src/files.c (attrsfile): Remove.
14849 * src/reader.c (symbol_list): Remove the guard and guard_line
14850 members.
14851 Adjust dependencies.
14852 (parse_guard): Remove.
14853 * data/bison.hairy: Remove.
14854 * doc/bison.texinfo (Environment Variables): Remove occurrences of
14855 BISON_HAIRY.
14856
82b6cb3f
AD
148572002-05-02 Akim Demaille <akim@epita.fr>
14858
14859 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
14860 (parse_guard): Rename the formal argument `stack_offset' as
14861 `rule_length', which is more readable.
14862 Adjust callers.
14863 (copy_at, copy_dollar): Instead of outputting the hard coded
14864 values of $$, $n and so forth, output invocation to b4_lhs_value,
14865 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
14866 Note: this patch partially drops `semantic-parser' support: it
14867 always does `rule_length - n', where semantic parsers ought to
14868 always use `-n'.
82b6cb3f
AD
14869 * data/bison.simple, data/bison.c++ (b4_lhs_value)
14870 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
14871
6cbfbcc5
AD
148722002-05-02 Akim Demaille <akim@epita.fr>
14873
14874 * configure.in (AC_INIT): Bump to 1.49b.
14875 (AM_INIT_AUTOMAKE): Short invocation.
14876
b8548114
AD
148772002-05-02 Akim Demaille <akim@epita.fr>
14878
14879 Version 1.49a.
14880
c20cd1fa
AD
148812002-05-01 Akim Demaille <akim@epita.fr>
14882
14883 * src/skeleton.h: Remove.
14884
8a9566d4
AD
148852002-05-01 Akim Demaille <akim@epita.fr>
14886
14887 * src/skeleton.h: Fix the #endif.
14888 Reported by Magnus Fromreide.
14889
8c6d399a
PE
148902002-04-26 Paul Eggert <eggert@twinsun.com>
14891
14892 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
14893 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 14894 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 14895
2b7ed18a
RA
148962002-04-25 Robert Anisko <robert@lrde.epita.fr>
14897
14898 * src/scan-skel.l: Postprocess quadrigraphs.
14899
14900 * src/reader.c (copy_character): New function, used to output
14901 single characters while replacing `[' and `]' with quadrigraphs, to
14902 avoid troubles with M4 quotes.
14903 (copy_comment): Output characters with copy_character.
14904 (read_additionnal_code): Likewise.
14905 (copy_string2): Likewise.
14906 (copy_definition): Likewise.
14907
14908 * tests/calc.at: Exercise M4 quoting.
14909
34a89c50
AD
149102002-04-25 Akim Demaille <akim@epita.fr>
14911
14912 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
14913 between `!' and the command.
14914 Reported by Paul Eggert.
14915
0dd1580a
RA
149162002-04-24 Robert Anisko <robert@lrde.epita.fr>
14917
14918 * tests/calc.at: Exercise prologue splitting.
14919
14920 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
14921 `b4_post_prologue' instead of `b4_prologue'.
14922
14923 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
14924 muscles.
14925 (output): Free pre_prologue_obstack and post_prologue_obstack.
14926 * src/files.h, src/files.c (attrs_obstack): Remove.
14927 (pre_prologue_obstack, post_prologue_obstack): New.
14928 * src/reader.c (copy_definition): Add a parameter to specify the
14929 obstack to fill, instead of using attrs_obstack unconditionally.
14930 (read_declarations): Pass pre_prologue_obstack to copy_definition if
14931 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
14932
83c1796f
PE
149332002-04-23 Paul Eggert <eggert@twinsun.com>
14934
14935 * data/bison.simple: Remove unnecessary commentary and white
14936 space differences from 1_29-branch.
14937 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
14938
14939 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
14940 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
14941 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
14942 constructors or destructors.
14943
14944 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
14945
1207eeac
AD
149462002-04-23 Akim Demaille <akim@epita.fr>
14947
14948 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
14949 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
14950 location with columns.
14951 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
14952 All reported by Paul Eggert.
14953
78ab8f67
AD
149542002-04-22 Akim Demaille <akim@epita.fr>
14955
14956 * src/reduce.c (dump_grammar): Move to...
14957 * src/gram.h, src/gram.c (grammar_dump): here.
14958 Be sure to separate long item numbers.
14959 Don't read the members of a rule's prec if its nil.
14960
133c20e2
AD
149612002-04-22 Akim Demaille <akim@epita.fr>
14962
14963 * src/output.c (table_size, table_grow): New.
14964 (MAXTABLE): Remove, replace uses with table_size.
14965 (pack_vector): Instead of dying when the table is too big, grow it.
14966
9515e8a7
AD
149672002-04-22 Akim Demaille <akim@epita.fr>
14968
14969 * data/bison.simple (yyr1): Its type is that of a token number.
14970 * data/bison.c++ (r1_): Likewise.
14971 * tests/regression.at (Web2c Actions): Adjust.
14972
23c5a174
AD
149732002-04-22 Akim Demaille <akim@epita.fr>
14974
14975 * src/reader.c (token_translations_init): 256 is now the default
14976 value for the error token, i.e., it will be assigned another
14977 number if the user assigned 256 to one of her tokens.
14978 (reader): Don't force 256 to error.
14979 * doc/bison.texinfo (Symbols): Adjust.
14980 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
14981 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
14982 etc. instead of 10, 20, 30 (which was used to `jump' over error
14983 (256) and undefined (2)).
14984
5fbb0954
AD
149852002-04-22 Akim Demaille <akim@epita.fr>
14986
14987 Propagate more token_number_t.
14988
14989 * src/gram.h (token_number_as_item_number)
14990 (item_number_as_token_number): New.
14991 * src/output.c (GENERATE_OUTPUT_TABLE): New.
14992 Use it to create output_item_number_table and
14993 output_token_number_table.
14994 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14995 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
14996 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
14997 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
14998
4f940944
AD
149992002-04-22 Akim Demaille <akim@epita.fr>
15000
15001 * src/output.h, src/output.c (get_lines_number): Remove.
15002
3ded9a63
AD
150032002-04-19 Akim Demaille <akim@epita.fr>
15004
15005 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
15006 as Lex/Flex'.
15007 (Debugging): More details about enabling the debugging features.
15008 (Table of Symbols): Describe $$, $n, @$, and @n.
15009 Suggested by Tim Josling.
15010
e0c471a9
AD
150112002-04-19 Akim Demaille <akim@epita.fr>
15012
15013 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
15014
fecc10cd
AD
150152002-04-10 Akim Demaille <akim@epita.fr>
15016
15017 * src/system.h: Rely on HAVE_LIMITS_H.
15018 Suggested by Paul Eggert.
15019
51dec47b
AD
150202002-04-09 Akim Demaille <akim@epita.fr>
15021
15022 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
15023 full stderr, and strip it according to the bison options, instead
15024 of composing the error message from different bits.
15025 This makes it easier to check for several error messages.
15026 Adjust all the invocations.
15027 Add an invocation exercising the error token.
15028 Add an invocation demonstrating a stupid error message.
15029 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
15030 Adjust the tests.
15031 Error message are for stderr, not stdout.
15032
007a50a4
AD
150332002-04-09 Akim Demaille <akim@epita.fr>
15034
15035 * src/gram.h, src/gram.c (error_token_number): Remove, use
15036 errtoken->number.
15037 * src/reader.c (reader): Don't specify the user token number (2)
15038 for $undefined, as it uselessly prevents using it.
15039 * src/gram.h (token_number_t): Move to...
15040 * src/symtab.h: here.
15041 (state_t.number): Is a token_number_t.
15042 * src/print.c, src/reader.c: Use undeftoken->number instead of
15043 hard coded 2.
15044 (Even though this 2 is not the same as above: the number of the
15045 undeftoken remains being 2, it is its user token number which
15046 might not be 2).
15047 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
15048 `user_token_number_max'.
15049 Output `undef_token_number'.
15050 * data/bison.simple, data/bison.c++: Use them.
15051 Be sure to map invalid yylex return values to
15052 `undef_token_number'. This saves us from gratuitous SEGV.
15053
15054 * tests/conflicts.at (Solved SR Conflicts)
15055 (Unresolved SR Conflicts): Adjust.
15056 * tests/regression.at (Web2c Actions): Adjust.
15057
06446ccf
AD
150582002-04-08 Akim Demaille <akim@epita.fr>
15059
15060 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
15061 Adding #line.
15062 Remove the duplicate `typedefs'.
15063 (RhsNumberType): Fix the declaration and various other typos.
15064 Use __ofile__.
15065 * data/bison.simple: Use __ofile__.
15066 * src/scan-skel.l: Handle __ofile__.
15067
62a3e4f0
AD
150682002-04-08 Akim Demaille <akim@epita.fr>
15069
15070 * src/gram.h (item_number_t): New, the type of item numbers in
15071 RITEM. Note that it must be able to code symbol numbers as
15072 positive number, and the negation of rule numbers as negative
15073 numbers.
15074 Adjust all dependencies (pretty many).
15075 * src/reduce.c (rule): Remove this `short *' pointer: use
15076 item_number_t.
15077 * src/system.h (MINSHORT, MAXSHORT): Remove.
15078 Include `limits.h'.
15079 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
15080 (shortcpy): Remove.
15081 (MAXTABLE): Move to...
15082 * src/output.c (MAXTABLE): here.
15083 (prepare_rules): Use output_int_table to output rhs.
15084 * data/bison.simple, data/bison.c++: Adjust.
15085 * tests/torture.at (Big triangle): Move the limit from 254 to
15086 500.
15087 * tests/regression.at (Web2c Actions): Ajust.
15088
15089 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
15090 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
15091 passes, but produces negative #line number, once fixed, GCC is
15092 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
15093 C), it passes.
15094 * src/state.h (state_h): Code input lines on ints, not shorts.
15095
bb88b0fc
AD
150962002-04-08 Akim Demaille <akim@epita.fr>
15097
15098 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
15099 and then the grammar.
15100
9a636f47
AD
151012002-04-08 Akim Demaille <akim@epita.fr>
15102
15103 * src/system.h: No longer using strndup.
15104
680e8701
AD
151052002-04-07 Akim Demaille <akim@epita.fr>
15106
15107 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
15108 * src/output.c (output_table_data): Return the longest number.
15109 (prepare_tokens): Output `token_number_max').
15110 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
15111 New.
15112 Use them to define yy_token_number_type/TokenNumberType.
15113 Use this type for yytranslate.
15114 * tests/torture.at (Big triangle): Push the limit from 124 to
15115 253.
15116 * tests/regression.at (Web2c Actions): Adjust.
15117
817e9f41
AD
151182002-04-07 Akim Demaille <akim@epita.fr>
15119
15120 * tests/torture.at (Big triangle): New.
15121 (GNU AWK Grammar, GNU Cim Grammar): Move to...
15122 * tests/existing.at: here.
15123
5123689b
AD
151242002-04-07 Akim Demaille <akim@epita.fr>
15125
15126 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
15127 nritems.
15128 Adjust dependencies.
15129
f3849179
AD
151302002-04-07 Akim Demaille <akim@epita.fr>
15131
15132 * src/reader.c: Normalize increments to prefix form.
15133
bd02036a
AD
151342002-04-07 Akim Demaille <akim@epita.fr>
15135
15136 * src/reader.c, symtab.c: Remove debugging code.
15137
db8837cb
AD
151382002-04-07 Akim Demaille <akim@epita.fr>
15139
15140 Rename all the `bucket's as `symbol_t'.
15141
15142 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
15143 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
15144 * src/symtab.c, src/symtab.h (bucket): Rename as...
15145 (symbol_t): this.
15146 (symbol_list_new, bucket_check_defined, bucket_make_alias)
15147 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
15148 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
15149 (buckets_new, buckets_free, buckets_do): Rename as...
15150 (symbol_list_new, symbol_check_defined, symbol_make_alias)
15151 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15152 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
15153 (symbols_new, symbols_free, symbols_do): these.
15154
72a23c97
AD
151552002-04-07 Akim Demaille <akim@epita.fr>
15156
15157 Use lib/hash for the symbol table.
15158
15159 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
15160 EOF.
15161 * src/lex.c (lex): Set the `number' member of new terminals.
15162 * src/reader.c (bucket_check_defined, bucket_make_alias)
15163 (bucket_check_alias_consistence, bucket_translation): New.
15164 (reader, grammar_free, readgram, token_translations_init)
15165 (packsymbols): Adjust.
15166 (reader): Number the predefined tokens.
15167 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
15168 for predefined tokens.
15169 * src/symtab.h (bucket): Remove all the hash table related
15170 members.
15171 * src/symtab.c (symtab): Replace by...
15172 (bucket_table): this.
15173 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
15174 (buckets_new, buckets_do): New.
15175
280a38c3
AD
151762002-04-07 Akim Demaille <akim@epita.fr>
15177
15178 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
15179 (start_symbol, max_user_token_number, semantic_parser)
15180 (error_token_number): Initialize.
15181 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
15182 Initialize.
15183 (reader): Don't.
15184 (errtoken, eoftoken, undeftoken, axiom): Extern.
15185
03b31c0c
AD
151862002-04-07 Akim Demaille <akim@epita.fr>
15187
15188 * src/gram.h (rule_s): prec and precsym are now pointers
15189 to the bucket giving the priority/associativity.
15190 Member `associativity' removed: useless.
15191 * src/reduce.c, src/conflicts.c: Adjust.
15192
8b3df748
AD
151932002-04-07 Akim Demaille <akim@epita.fr>
15194
15195 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
15196 Properly escape the symbols' TAG when outputting them.
15197
e601aa1d
AD
151982002-04-07 Akim Demaille <akim@epita.fr>
15199
15200 * src/lalr.h (LA): Is a bitsetv, not bitset*.
15201
b0299a2e
AD
152022002-04-07 Akim Demaille <akim@epita.fr>
15203
15204 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
15205 (LArule): this, which is an array to rule_t*.
15206 * src/print.c, src/conflicts.c: Adjust.
15207
d7e1f00c
AD
152082002-04-07 Akim Demaille <akim@epita.fr>
15209
15210 * src/gram.h (rule_t): Rename `number' as `user_number'.
15211 `number' is a new member.
15212 Adjust dependencies.
15213 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
15214
cc9305dd
AD
152152002-04-07 Akim Demaille <akim@epita.fr>
15216
15217 As a result of the previous patch, it is no longer needed
15218 to reorder ritem itself.
15219
15220 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
15221
b0940840
AD
152222002-04-07 Akim Demaille <akim@epita.fr>
15223
15224 Be sure never to walk through RITEMS, but use only data related to
15225 the rules themselves. RITEMS should be banished.
15226
15227 * src/output.c (output_token_translations): Rename as...
15228 (prepare_tokens): this.
15229 In addition to `translate', prepare the muscles `tname' and
15230 `toknum', which were handled by...
15231 (output_rule_data): this.
15232 Remove, and move the remainder of its outputs into...
15233 (prepare_rules): this new routines, which also merges content from
15234 (output_gram): this.
15235 (prepare_rules): Be sure never to walk through RITEMS.
15236 (output_stos): Rename as...
15237 (prepare_stos): this.
15238 (output): Always invoke prepare_states, after all, just don't use it
15239 in the output if you don't need it.
15240
643a5994
AD
152412002-04-07 Akim Demaille <akim@epita.fr>
15242
15243 * src/LR0.c (new_state): Display `nstates' as the name of the
15244 newly created state.
15245 Adjust to initialize first_state and last_state if needed.
15246 Be sure to distinguish the initial from the final state.
15247 (new_states): Create the itemset of the initial state, and use
15248 new_state.
15249 * src/closure.c (closure): Now that the initial state has its
15250 items properly set, there is no need for a special case when
15251 creating `ruleset'.
15252
15253 As a result, now the rule 0, reducing to $axiom, is visible in the
15254 outputs. Adjust the test suite.
15255
15256 * tests/conflicts.at (Solved SR Conflicts)
15257 (Unresolved SR Conflicts): Adjust.
15258 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
15259 * tests/conflicts.at (S/R in initial): New.
15260
b4c4ccc2
AD
152612002-04-07 Akim Demaille <akim@epita.fr>
15262
15263 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
15264 the RHS of the rules.
15265 * src/output.c (output_gram): Likewise.
15266
bba97eb2
AD
152672002-04-07 Akim Demaille <akim@epita.fr>
15268
15269 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
15270 bucket.
15271 Adjust all dependencies.
15272 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
15273 `number' of the buckets too.
15274 * src/gram.h: Include `symtab.h'.
15275 (associativity): Move to...
15276 * src/symtab.h: here.
15277 No longer include `gram.h'.
15278
c3b407f4
AD
152792002-04-07 Akim Demaille <akim@epita.fr>
15280
15281 * src/gram.h, src/gram.c (rules_rhs_length): New.
15282 (ritem_longest_rhs): Use it.
15283 * src/gram.h (rule_t): `number' is a new member.
15284 * src/reader.c (packgram): Set it.
15285 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
15286 the end of `rules', and count them out of `nrules'.
15287 (reduce_output, dump_grammar): Adjust.
15288 * src/print.c (print_grammar): It is no longer needed to check for
15289 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
15290 * tests/reduce.at (Reduced Automaton): New test.
15291
11652ab3
AD
152922002-04-07 Akim Demaille <akim@epita.fr>
15293
15294 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
15295 lacking `+ 1' to nrules, Bison reported as useless a token if it
15296 was used solely to set the precedence of the last rule...
15297
26b23c1a
AD
152982002-04-07 Akim Demaille <akim@epita.fr>
15299
15300 * data/bison.c++, data/bison.simple: Don't output the current file
15301 name in #line, to avoid useless diffs between two identical
15302 outputs under different names.
15303
18bcecb0
AD
153042002-04-07 Akim Demaille <akim@epita.fr>
15305
15306 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
15307 Normalize loops to using `< nrules + 1', not `<= nrules'.
15308
fa770c86
AD
153092002-04-07 Akim Demaille <akim@epita.fr>
15310
15311 * TODO: Update.
15312
d9b739c3
AD
153132002-04-07 Akim Demaille <akim@epita.fr>
15314
15315 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
15316 bucket.value as bucket.number.
15317
99013900
AD
153182002-04-07 Akim Demaille <akim@epita.fr>
15319
15320 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
15321 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15322 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
15323 RHS, instead of being an index in RITEMS.
15324
e966383b
PE
153252002-04-04 Paul Eggert <eggert@twinsun.com>
15326
15327 * doc/bison.texinfo: Update copyright date.
15328 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
15329 (Symbols): Warn about running Bison in one character set,
15330 but compiling and/or running in an incompatible one.
15331 Warn about character code 256, too.
15332
153332002-04-03 Paul Eggert <eggert@twinsun.com>
15334
15335 * src/bison.data (YYSTACK_ALLOC): Depend on whether
15336 YYERROR_VERBOSE is nonzero, not whether it is defined.
15337
15338 Merge changes from bison-1_29-branch.
c307773e 15339
8d6c48b9
PE
153402002-03-20 Paul Eggert <eggert@twinsun.com>
15341
15342 Merge fixes from Debian bison_1.34-1.diff.
15343
15344 * configure.in (AC_PREREQ): 2.53.
15345
e53c6322
AD
153462002-03-20 Akim Demaille <akim@epita.fr>
15347
15348 * src/conflicts.c (log_resolution): Argument `resolution' is const.
15349
9ffbeca7
PE
153502002-03-19 Paul Eggert <eggert@twinsun.com>
15351
21db0b2a
PE
15352 * src/bison.simple (YYCOPY): New macro.
15353 (YYSTACK_RELOCATE): Use it.
15354 Remove Type arg; no longer needed. All callers changed.
15355 (yymemcpy): Remove; no longer needed.
15356
9ffbeca7
PE
15357 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
15358 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15359
642cb8f8
AD
153602002-03-19 Akim Demaille <akim@epita.fr>
15361
15362 Test and fix the #line outputs.
15363
15364 * tests/atlocal.at (GCC): New.
15365 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 15366 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
15367 (Action synch line, Epilogue synch line): New tests.
15368 * src/reader.c (parse_union_decl): Define the muscle stype_line.
15369 * data/bison.simple, data/bison.c++: Use it.
15370
3c31a486
AD
153712002-03-19 Akim Demaille <akim@epita.fr>
15372
15373 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
15374 (Solved SR Conflicts, %expect not enough, %expect right)
15375 (%expect too much): Move to...
15376 * tests/conflicts.at: this new file.
15377
0d8bed56
AD
153782002-03-19 Akim Demaille <akim@epita.fr>
15379
15380 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15381 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
15382 that we can move to enums for instance.
15383 * src/output.c (token_definitions_output): Output a list of
15384 `token-name, token-number' instead of the #define.
15385 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
15386
9208d17f
AD
153872002-03-14 Akim Demaille <akim@epita.fr>
15388
15389 Use Gettext 0.11.1.
15390
af27eacb
RA
153912002-03-09 Robert Anisko <robert@lrde.epita.fr>
15392
15393 * data/bison.c++: Make the user able to add members to the generated
15394 parser by subclassing.
15395
9101a310
RA
153962002-03-05 Robert Anisko <robert@lrde.epita.fr>
15397
15398 * src/reader.c (read_additionnal_code): `c' should be an integer, not
15399 a character.
15400 Reported by Nicolas Tisserand and Nicolas Burrus.
15401
fff9bf0b
RA
154022002-03-04 Robert Anisko <robert@lrde.epita.fr>
15403
15404 * src/reader.c: Warn about lacking semi-colons, do not complain.
15405
64dba31e
RA
154062002-03-04 Robert Anisko <robert@lrde.epita.fr>
15407
15408 * data/bison.c++: Remove a debug line.
15409
374f5a14
RA
154102002-03-04 Robert Anisko <robert@lrde.epita.fr>
15411
15412 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
15413 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
15414 provide a default implementation.
15415
bfcf1f3a
AD
154162002-03-04 Akim Demaille <akim@epita.fr>
15417
15418 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
15419 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
15420 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
15421 * tests/semantic.at (Parsing Guards): Similarly.
15422 * src/reader.at (readgram): Complain if the last rule is not ended
15423 with a semi-colon.
15424
65ccf9fc
AD
154252002-03-04 Akim Demaille <akim@epita.fr>
15426
15427 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
15428 * src/closure.c: here.
15429 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
15430 RTC.
15431 * src/warshall.h, src/warshall.c: Remove.
15432 * tests/sets.at (Broken Closure): Adjust.
15433
d0039cbc
AD
154342002-03-04 Akim Demaille <akim@epita.fr>
15435
15436 * src/output.c (output_skeleton): tempdir is const.
15437 bytes_read is unused.
15438
345cea78
AD
154392002-03-04 Akim Demaille <akim@epita.fr>
15440
15441 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
15442 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
15443 Update.
15444 From Michael Hayes.
15445
564801f7
AD
154462002-03-04 Akim Demaille <akim@epita.fr>
15447
15448 * src/closure.c (closure): `r' is unused.
15449
e5352bc7
AD
154502002-03-04 Akim Demaille <akim@epita.fr>
15451
15452 * tests/sets.at (Broken Closure): Add the ending `;'.
15453 * src/reader.at (readgram): Complain if a rule is not ended with a
15454 semi-colon.
15455
914feea9
AD
154562002-03-04 Akim Demaille <akim@epita.fr>
15457
15458 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
15459 (count_sr_conflicts): Use bitset_count.
15460 * src/reduce.c (inaccessable_symbols): Ditto.
15461 (bits_size): Remove.
15462 * src/warshall.h, src/warshall.c: Convert to bitsetv.
15463
f0250de6
AD
154642002-03-04 Akim Demaille <akim@epita.fr>
15465
15466 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
15467 * src/reduce.c: Remove the `bitset_zero's following the
15468 `bitset_create's, as now it is performed by the latter.
15469
ef017502
AD
154702002-03-04 Akim Demaille <akim@epita.fr>
15471
15472 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
15473 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
15474 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
15475 latest sources from Michael.
15476
76514394
AD
154772002-03-04 Akim Demaille <akim@epita.fr>
15478
15479 * src/output.c (output): Don't free the grammar.
15480 * src/reader.c (grammar_free): New.
15481 * src/main.c (main): Call it and don't free symtab here.
15482
55024580
AD
154832002-03-04 Akim Demaille <akim@epita.fr>
15484
15485 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
15486 before returning.
15487 Reported by Benoit Perrot.
15488
f9abaa2c
AD
154892002-03-04 Akim Demaille <akim@epita.fr>
15490
15491 Use bitset operations when possible, not loops over bits.
15492
15493 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
15494 bitset_or.
15495 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
15496 * src/reduce.c (useless_nonterminals): Formatting changes.
15497 * src/warshall.c (TC): Use bitset_or.
15498
0e721e75
AD
154992002-03-04 Akim Demaille <akim@epita.fr>
15500
15501 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
15502 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
15503 Ditto.
15504
0fb1ffb1
AD
155052002-03-04 Akim Demaille <akim@epita.fr>
15506
15507 * src/lalr.c (F): Now a bitset*.
15508 Adjust all dependencies.
15509
b86796bf
AD
155102002-03-04 Akim Demaille <akim@epita.fr>
15511
15512 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
15513 Adjust all dependencies.
15514
602bbf31
AD
155152002-03-04 Akim Demaille <akim@epita.fr>
15516
15517 * src/L0.c, src/LR0.h (nstates): Be size_t.
15518 Adjust comparisons (signed vs unsigned).
15519 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
15520 bitset*.
15521 Adjust all dependencies.
15522
d8a0245c
AD
155232002-03-04 Akim Demaille <akim@epita.fr>
15524
15525 * src/closure.c (firsts): Now, also a bitset.
15526 Adjust all dependencies.
15527 (varsetsize): Remove, now unused.
15528 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
15529
34ba9743
AD
155302002-03-04 Akim Demaille <akim@epita.fr>
15531
15532 * src/print.c: Convert to use bitset.h, not hand coded iterations
15533 over ints.
15534
ed86e78c
AD
155352002-03-04 Akim Demaille <akim@epita.fr>
15536
15537 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
15538
dfdb1797
AD
155392002-03-04 Akim Demaille <akim@epita.fr>
15540
15541 * src/closure.c (ruleset): Be a bitset.
15542 (rulesetsize): Remove.
15543
7086e707
AD
155442002-03-04 Akim Demaille <akim@epita.fr>
15545
15546 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
15547 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
15548 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
15549 * src/closure.c (fderives): Be an array of bitsets.
15550
98254360
RA
155512002-02-28 Robert Anisko <robert@lrde.epita.fr>
15552
15553 * data/bison.c++: Merge the two generated headers. Insert a copyright
15554 notice in each output file.
15555
a75c057f
AD
155562002-02-28 Akim Demaille <akim@epita.fr>
15557
15558 * data/bison.c++: Copy the prologue of bison.simple to fetch
15559 useful M4 definitions, such as b4_header_guard.
15560
06b00abc
AD
155612002-02-25 Akim Demaille <akim@epita.fr>
15562
15563 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
15564 translator friendly scheme for the bgr
15565 copyright notice.
06b00abc 15566
70e7d534
AD
155672002-02-25 Akim Demaille <akim@epita.fr>
15568
15569 * src/output.c (header_output): Remove, now handled completely via
15570 M4.
15571
abe017f6
AD
155722002-02-25 Akim Demaille <akim@epita.fr>
15573
15574 * m4/m4.m4: New, from CVS Autoconf.
15575 * configure.in: Invoke it.
15576 * src/output.c (output_skeleton): Use its result instead of the
15577 hard coded name.
15578
381fb12e
AD
155792002-02-25 Akim Demaille <akim@epita.fr>
15580
15581 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
15582 Fileutils 4.1.5.
15583 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
15584 * src/output.c (output_skeleton): Use mkstemp to create a real
15585 temporary file.
15586 Move the filling of `skeleton' and its muscle to...
15587 (prepare): here.
15588 (output): Move the definition of the prologue muscle to...
15589 (prepare): here.
15590 * src/system.h (DEFAULT_TMPDIR): New.
15591
6f38107f
PE
155922002-02-14 Paul Eggert <eggert@twinsun.com>
15593
15594 Remove the support for C++ namespace cleanliness; it was
15595 causing more problems than it was curing, since it didn't work
15596 properly on some nonstandard C++ compilers. This can wait
15597 for a proper C++ parser.
15598
15599 * NEWS: Document this.
15600 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
15601 of C++, as it's treated like C now.
15602 * src/bison.simple (YYSTD): Remove.
15603 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
15604 Treat C++ just like Standard C instead of trying to support
15605 namespace cleanliness.
15606
80cce3da
AD
156072002-02-14 Akim Demaille <akim@epita.fr>
15608
15609 * tests/regression.at (else): Adjust to Andreas' change.
15610
842e8679
AD
156112002-02-14 Akim Demaille <akim@epita.fr>
15612
15613 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
15614
4bda3f10
AD
156152002-02-13 Andreas Schwab <schwab@suse.de>
15616
15617 * src/output.c (output_rule_data): Don't output NULL, it might
15618 not be defined yet.
15619
4162fa07 156202002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 15621
4162fa07
RA
15622 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
15623 (Copyright notice): Update.
b418ecd8 15624
bd16a5dc
AD
156252002-02-11 Akim Demaille <akim@epita.fr>
15626
15627 * tests/regression.at (%nonassoc and eof): Don't include
15628 nonportable headers.
15629
8d69a1a3
RA
156302002-02-08 Robert Anisko <robert@lrde.epita.fr>
15631
15632 * data/bison.c++: Correct error recovery. Make the user able to
15633 initialize the starting location.
15634
9b2d0677
AD
156352002-02-07 Akim Demaille <akim@epita.fr>
15636
15637 * tests/input.at: New.
15638
69e2658b
RA
156392002-02-07 Robert Anisko <robert@lrde.epita.fr>
15640
15641 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 15642 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
15643 directives around tables only needed for debugging.
15644
4aacc3a7
RA
156452002-02-07 Robert Anisko <robert@lrde.epita.fr>
15646
15647 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
15648 C++ parsers.
15649 (yy::b4_name::parse): Use print_.
15650
762a801e
RA
156512002-02-07 Robert Anisko <robert@lrde.epita.fr>
15652
15653 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
15654
4bb2bc3f
RA
156552002-02-07 Robert Anisko <robert@lrde.epita.fr>
15656
15657 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
15658 C++ parsers.
15659 (yy::b4_name::parse): Build verbose error messages, and use error_.
15660
6b45a3ca
RA
156612002-02-06 Robert Anisko <robert@lrde.epita.fr>
15662
15663 * data/bison.c++: Fix m4 quoting in comments.
15664
50997c6e
RA
156652002-02-06 Robert Anisko <robert@lrde.epita.fr>
15666
15667 * data/bison.c++: Adjust the parser code. Fix some muscles that were
15668 not expanded by m4.
15669
3f3eed27
AD
156702002-02-05 Akim Demaille <akim@epita.fr>
15671
15672 * data/bison.c++: Adjust to the M4 back end.
15673 More is certainly needed.
15674
be2a1a68
AD
156752002-02-05 Akim Demaille <akim@epita.fr>
15676
15677 Give a try to M4 as a back end.
15678
15679 * lib/readpipe.c: New, from wdiff.
15680 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
15681 BISON_HAIRY.
15682 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
15683 specific values. Now it is m4 that performs the lookup.
15684 * src/parse-skel.y: Remove.
15685 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
15686 * src/output.c (actions_output, guards_output)
15687 (token_definitions_output): No longer keeps track of the output
15688 line number, hence remove the second argument.
15689 (guards_output): Check against the guard member of a rule, not the
15690 action member.
15691 Adjust callers.
15692 (output_skeleton): Don't look for the skeleton location, let m4 do
15693 that.
15694 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
15695 file will be used.
15696 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
15697 (prepare): Given that for the time being changesyntax is not
15698 usable in M4, rename the muscles using `-' to `_'.
15699 Define `defines_flag', `output_parser_name' and `output_header_name'.
15700 * src/output.h (actions_output, guards_output)
15701 (token_definitions_output): Adjust prototypes.
15702 * src/scan-skel.l: Instead of scanning the skeletons, it now
15703 processes the output of m4: `__oline__' and `#output'.
15704 * data/bison.simple: Adjust to be used by M4(sugar).
15705 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
15706 to date.
15707 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
15708 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
15709 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
15710 shamelessly stolen from CVS Autoconf.
15711
beda758b
AD
157122002-02-05 Akim Demaille <akim@epita.fr>
15713
15714 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
15715 * configure.in: Check for the declarations of free and malloc.
15716 * src/muscle_tab.c: Adjust.
15717
5ece6d43
AD
157182002-02-05 Akim Demaille <akim@epita.fr>
15719
15720 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
15721 which have no values.
15722
5bb18f9a
AD
157232002-02-05 Akim Demaille <akim@epita.fr>
15724
15725 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
15726 * data/: here.
15727
894dd62e
PE
157282002-01-29 Paul Eggert <eggert@twinsun.com>
15729
15730 * src/bison.simple (YYSIZE_T): Do not define merely because
15731 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
15732 On some platforms, <alloca.h> does not declare YYSTD (size_t).
15733
82841af7
AD
157342002-01-27 Akim Demaille <akim@epita.fr>
15735
15736 Fix `%nonassoc and eof'.
15737
15738 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
15739 which were not properly copied! Replace
15740 memcpy (res->errs, src->errs, src->nerrs);
15741 with
15742 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
15743 !!!
15744 * tests/regression.at (%nonassoc and eof): Adjust to newest
15745 Autotest: `.' is not in the PATH.
15746
318b76e9
AD
157472002-01-27 Akim Demaille <akim@epita.fr>
15748
15749 * tests/sets.at (AT_EXTRACT_SETS): New.
15750 (Nullable): Use it.
15751 (Firsts): New.
15752
30d2f3d5
AD
157532002-01-26 Akim Demaille <akim@epita.fr>
15754
15755 * tests/actions.at, tests/calc.at, tests/headers.at,
15756 * tests/torture.at: Adjust to the newest Autotest which no longer
15757 forces `.' in the PATH.
15758
30f8c395
AD
157592002-01-25 Akim Demaille <akim@epita.fr>
15760
15761 * tests/regression.at (%nonassoc and eof): New.
15762 Suggested by Robert Anisko.
15763
29ae55f1
AD
157642002-01-24 Akim Demaille <akim@epita.fr>
15765
15766 Bison dumps core when trying to complain about broken input files.
15767 Reported by Cris van Pelt.
15768
15769 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
15770 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
15771 into...
15772 (Invalid inputs): Strengthen: exercise parse_percent_token.
15773
2b548aa6
RA
157742002-01-24 Robert Anisko <robert.anisko@epita.fr>
15775
15776 * src/Makefile.am: Add bison.c++.
15777 * src/bison.c++: New skeleton.
15778
bb0146c2
AD
157792002-01-21 Paolo Bonzini <bonzini@gnu.org>
15780
15781 * po/it.po: New.
15782
bec30531
AD
157832002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
15784
15785 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
15786
fc6edc45
MA
157872002-01-20 Marc Autret <marc@gnu.org>
15788
15789 * src/files.c (compute_output_file_names): Fix
15790
5e5d5415
MA
157912002-01-20 Marc Autret <marc@gnu.org>
15792
15793 * tests/output.at: New test.
15794 * src/files.c (compute_base_names): Don't map extensions when
15795 the YACC flag is set, use defaults.
15796 Reported by Evgeny Stambulchik.
15797
44ea3fbd
MA
157982002-01-20 Marc Autret <marc@gnu.org>
15799
ba0fe3c7
PE
15800 * src/system.h: Need to define __attribute__ away for non-GCC
15801 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
15802 Suggested by Albert Chin-A-Young.
15803
338963d1
TVH
158042002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
15805
15806 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
15807 canonical definition.
15808 * src/system.h: Use the canonical definition for PARAMS (avoids
15809 a conflict with the macro from lib/hash.h).
15810
c57b2479
AD
158112002-01-11 Akim Demaille <akim@epita.fr>
15812
15813 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 15814 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 15815
b85810ae
AD
158162002-01-09 Akim Demaille <akim@epita.fr>
15817
15818 * src/files.c, src/files.h (output_infix): New.
15819 (tab_extension): Remove.
15820 (compute_base_names): Compute the former, drop the latter.
15821 * src/output.c (prepare): Insert the muscles `output-infix', and
15822 `output-suffix'.
15823 * src/parse-skel.y (string, string.1): New.
15824 (section.header): Use it.
15825 (section.yacc): Remove.
15826 (prefix): Remove too.
15827 * src/scan-skel.l: Adjust.
15828 * src/bison.simple, src/bison.hairy: Adjust.
15829
cae60122
AD
158302002-01-09 Akim Demaille <akim@epita.fr>
15831
15832 * configure.in (WERROR_CFLAGS): Compute it.
15833 * src/Makefile.am (CFLAGS): Pass it.
15834 * tests/atlocal.in (CFLAGS): Idem.
15835 * src/files.c: Fix a few warnings.
15836 (get_extension_index): Remove, unused.
15837
ae404801
AD
158382002-01-08 Akim Demaille <akim@epita.fr>
15839
15840 * src/getargs.c (AS_FILE_NAME): New.
15841 (getargs): Use it to convert DOSish file names.
15842 * src/files.c (base_name): Rename as full_base_name to avoid
15843 clashes with `base_name ()'.
15844 (filename_split): New.
15845 (compute_base_names): N-th rewrite, using filename_split.
15846
22312b71
AD
158472002-01-08 Akim Demaille <akim@epita.fr>
15848
15849 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
15850 New, stolen from the Fileutils 4.1.
15851 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15852 * configure.in: Check for the presence of memrchr, and of its
15853 prototype.
15854
a67cef01
TVH
158552002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
15856
15857 * lib/hash.h (__P): Added definition for this macro.
15858 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
15859 BUILT_SOURCES, to ensure they are generated first.
15860 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
15861 %error-verbose to allow bootstrapping with bison 1.30x.
15862
2b25d624
AD
158632002-01-06 Akim Demaille <akim@epita.fr>
15864
15865 * src/reader.c (parse_braces): Don't fetch the next char, the
15866 convention is to fetch on entry.
15867 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
15868 'switch' without a following semicolon.
15869 * tests/regression.at (braces parsing): New.
15870
3460813b
AD
158712002-01-06 Akim Demaille <akim@epita.fr>
15872
15873 Bison is dead wrong in its RR conflict reports.
15874
15875 * tests/torture.at (GNU Cim Grammar): New.
15876 * src/conflicts.c (count_rr_conflicts): Fix.
15877
73784c64
AD
158782002-01-06 Akim Demaille <akim@epita.fr>
15879
15880 Creating package.m4 from configure.ac causes too many problems.
15881
15882 * tests/Makefile.am (package.m4): Create it by hand,
15883 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
15884
25d81090
AD
158852002-01-06 Akim Demaille <akim@epita.fr>
15886
15887 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
15888 skeleton.h.
15889
a9b8959e
PE
158902002-01-04 Paul Eggert <eggert@twinsun.com>
15891
15892 * doc/bison.texinfo (Debugging):
15893 Remove YYSTDERR; it's no longer defined or used.
15894 Also, s/cstdio.h/cstdio/.
15895
25d81090
AD
158962002-01-03 Akim Demaille <akim@epita.fr>
15897
15898 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
15899
1109455c
AD
159002002-01-03 Akim Demaille <akim@epita.fr>
15901
15902 * src/parse-skel.y (process_skeleton): Don't bind the parser's
15903 tracing code to --trace, wait for a better --trace option, with
15904 args.
15905
7ea5e977
AD
159062002-01-03 Akim Demaille <akim@epita.fr>
15907
15908 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
15909 The ISO C++ standard is extremely clear about it: stderr is
15910 considered a macro, not a regular symbol (see table 94 `Header
15911 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
15912 Therefore std:: does not apply to it. It still does with fprintf.
15913 Also, s/cstdio.h/cstdio/.
15914
fab5b110
AD
159152002-01-03 Akim Demaille <akim@epita.fr>
15916
15917 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
15918 for non system headers.
15919
aed7fd9b
AD
159202002-01-02 Akim Demaille <akim@epita.fr>
15921
15922 Equip the skeleton chain with location tracking, runtime trace,
15923 pure parser and scanner.
15924
15925 * src/parse-skel.y: Request a pure parser, locations, and prefix
15926 renaming.
15927 (%union): Having several members with the same type does not help
15928 type mismatches, simplify.
15929 (YYPRINT, yyprint): New.
15930 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
15931 (skel_error): this.
15932 Handle locations.
15933 * src/scan-skel.l: Adjust to these changes.
15934 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
15935 (LOCATION_PRINT, skel_control_t): New.
15936
24fad99e
AD
159372001-12-30 Akim Demaille <akim@epita.fr>
15938
15939 * src/parse-skel.y: Get rid of the shift/reduce conflict:
15940 replace `gb' with BLANKS.
15941 * src/scan-skel.l: Adjust.
15942
a4b36db4
AD
159432001-12-30 Akim Demaille <akim@epita.fr>
15944
15945 * src/system.h: We don't need nor want bcopy.
15946 Throw away MS-DOS crap: we don't need getpid.
15947 * configure.in: We don't need strndup. It was even causing
15948 problems: because Flex includes the headers *before* us,
15949 _GNU_SOURCE is not defined by config.h, and therefore strndup was
15950 not visible.
15951 * lib/xstrndup.c: New.
15952 * src/scan-skel.l: Use it.
15953 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
15954 * src/parse-skel.y: Use %directives instead of #defines.
15955
1239777d
AD
159562001-12-30 Akim Demaille <akim@epita.fr>
15957
15958 * src/skeleton.h: New.
15959 * src/output.c (output_parser, output_master_parser): Remove, dead
15960 code.
15961 * src/output.h (get_lines_number, actions_output, guards_output)
15962 (token_definitions_output): Prototype them.
15963 * src/parse-skel.y: Add the license notice.
15964 Include output.h and skeleton.h.
15965 (process_skeleton): Returns void, and takes a single parameter.
15966 * src/scan-skel.l: Add the license notice.
15967 Include skeleton.h.
15968 Don't use %option yylineno: it seems that then Flex imagines
15969 REJECT has been used, and therefore it won't reallocate its
15970 buffers (which makes no other sense to me than a bug). It results
15971 in warnings for `unused: yy_flex_realloc'.
15972
9b3add5b
RA
159732001-12-30 Robert Anisko <robert.anisko@epita.fr>
15974
15975 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15976 (MUSCLE_INSERT_PREFIX): ...to there.
15977 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15978 (MUSCLE_INSERT_PREFIX): Move from here...
15979
15980 * src/bison.hairy: Add a section directive. Put braces around muscle
15981 names. This parser skeleton is still broken, but Bison should not
15982 choke on a bad muscle 'syntax'.
15983 * src/bison.simple: Add a section directive. Put braces around muscle
15984 names.
15985
15986 * src/files.h (strsuffix, stringappend): Add declarations.
15987 (tab_extension): Add declaration.
15988 (short_base_name): Add declaration.
15989
15990 * src/files.c (strsuffix, stringappend): No longer static. These
15991 functions are used in the skeleton parser.
15992 (tab_extension): New.
15993 (compute_base_names): Use the computations done in this function
fab5b110 15994 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
15995 names.
15996 (short_base_name): No longer static.
15997
15998 * src/output.c (output_skeleton): New.
15999 (output): Disable call to output_master_parser, and give a try to
16000 a new skeleton handling system.
16001 (guards_output, actions_output): No longer static.
16002 (token_definitions_output, get_lines_number): No longer static.
16003
16004 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
16005
fab5b110 16006 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
16007 parse-skel.y.
16008
16009 * src/parse-skel.y: New file.
16010 * src/scan-skel.l: New file.
16011
b5b61c61
AD
160122001-12-29 Akim Demaille <akim@epita.fr>
16013
16014 %name-prefix is broken.
16015
16016 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
16017 Adjust all dependencies.
16018 * tests/headers.at (export YYLTYPE): Strengthen this test: use
16019 %name-prefix.
16020
16021 Renaming yylval but not yylloc is not consistent. Now we do.
16022
16023 * src/bison.simple: Prefix yylloc if used.
16024 * doc/bison.texinfo (Decl Summary): Document that.
16025
8c9a50be
AD
160262001-12-29 Akim Demaille <akim@epita.fr>
16027
16028 * doc/bison.texinfo: Promote `%long-directive' over
16029 `%long_directive'.
16030 Remove all references to fixed-output-files, yacc is enough.
16031
d99361e6
AD
160322001-12-29 Akim Demaille <akim@epita.fr>
16033
16034 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
16035 user prologue. These are defaults.
16036 * tests/actions.at (Mid-rule actions): Make sure the user can
16037 define YYDEBUG and YYERROR_VERBOSE.
16038
b9cecb91
AD
160392001-12-29 Akim Demaille <akim@epita.fr>
16040
16041 * src/output.c (header_output): Don't forget to export YYLTYPE and
16042 yylloc.
16043 * tests/headers.at (export YYLTYPE): New, make sure it does.
16044 * tests/regression.at (%union and --defines, Invalid CPP headers):
16045 Move to...
16046 * tests/headers.at: here.
16047
aea13e97
AD
160482001-12-29 Akim Demaille <akim@epita.fr>
16049
16050 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
16051
931394cb
AD
160522001-12-29 Akim Demaille <akim@epita.fr>
16053
16054 * tests/actions.at (Mid-rule actions): Output on a single line
16055 instead of several.
16056
704a47c4
AD
160572001-12-29 Akim Demaille <akim@epita.fr>
16058
16059 * doc/bison.texinfo: Formatting changes.
16060
091e20bb
AD
160612001-12-29 Akim Demaille <akim@epita.fr>
16062
16063 Don't store the token defs in a muscle, just be ready to output it
16064 on command. Now possible via `symbols'. Fixes a memory leak.
16065
16066 * src/output.c (token_definitions_output): New.
16067 (output_parser, header_output): Use it.
16068 * src/reader.c (symbols_save): Remove.
16069
cce71710
AD
160702001-12-29 Akim Demaille <akim@epita.fr>
16071
16072 * src/bison.simple: Do not provide a default for YYSTYPE and
16073 YYLTYPE before the user's prologue. Otherwise it's hardly... a
16074 default.
16075
82c035a8
AD
160762001-12-29 Akim Demaille <akim@epita.fr>
16077
16078 Mid-rule actions are simply... ignored!
16079
16080 * src/reader.c (readgram): Be sure to attach mid-rule actions to
16081 the empty-rule associated to the dummy symbol, not to the host
16082 rule.
16083 * tests/actions.at (Mid-rule actions): New.
16084
8419d367
AD
160852001-12-29 Akim Demaille <akim@epita.fr>
16086
16087 Memory leak.
16088
16089 * src/reader.c (reader): Free grammar.
16090
375d5806
AD
160912001-12-29 Akim Demaille <akim@epita.fr>
16092
16093 Memory leak.
16094
16095 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
16096 since it allocates it for each state, although only one is needed.
16097 (allocate_storage): Do it here.
16098
f51cb8ff
AD
160992001-12-29 Akim Demaille <akim@epita.fr>
16100
16101 * src/options.h, src/options.c (create_long_option_table): Rename
16102 as...
16103 (long_option_table_new): this, with a clearer prototype.
16104 (percent_table): Remove, unused,
16105 * src/getargs.c (getargs): Adjust.
16106
29e88316
AD
161072001-12-29 Akim Demaille <akim@epita.fr>
16108
16109 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
16110 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
16111 as states.
16112
b9f71f19
AD
161132001-12-29 Akim Demaille <akim@epita.fr>
16114
16115 * src/lalr.c (build_relations): Rename `states' as `states1'.
16116 Sorry, I don't understand exactly what it is, no better name...
16117
1a2b5d37
AD
161182001-12-29 Akim Demaille <akim@epita.fr>
16119
16120 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
16121 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
16122 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
16123 as rules.
16124
1cca533e
AD
161252001-12-29 Akim Demaille <akim@epita.fr>
16126
16127 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
16128 ago.
16129
c03ae966
AD
161302001-12-29 Akim Demaille <akim@epita.fr>
16131
16132 * src/reader.c, src/reader.h (user_toknums): Remove.
16133 Adjust all users to use symbols[i]->user_token_number.
16134
5a670b1e
AD
161352001-12-29 Akim Demaille <akim@epita.fr>
16136
16137 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
16138 Adjust all users to use symbols[i]->prec or ->assoc.
16139
ad949da9
AD
161402001-12-29 Akim Demaille <akim@epita.fr>
16141
16142 * src/reader.c, src/reader.h (tags): Remove.
16143 Adjust all users to use symbols[i]->tag.
16144
0e78e603
AD
161452001-12-29 Akim Demaille <akim@epita.fr>
16146
16147 * src/gram.h, src/gram.c (symbols): New, similar to state_table
16148 and rule_table.
16149 * src/reader.c (packsymbols): Fill this table.
16150 Drop sprec.
16151 * src/conflicts.c (resolve_sr_conflict): Adjust.
16152 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
16153 single table.
16154 Use symbols[i]->tag instead of tags[i].
16155
213e640e
AD
161562001-12-29 Akim Demaille <akim@epita.fr>
16157
16158 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
16159 In addition, put a comment in there, to replace...
16160 * tests/regression.at (%union and C comments): Remove.
16161
e7b8bef1
AD
161622001-12-29 Akim Demaille <akim@epita.fr>
16163
16164 * tests/regression.at (Web2c Actions): Blindly move the actual
16165 output as expected output. The contents *seem* right to me, but I
16166 can't pretend reading perfectly parser tables... Nonetheless, all
16167 the other tests pass correctly, the table look OK, even though the
16168 presence of `$axiom' is to be noted: AFAICS it is useless (but
16169 harmless).
16170
b68e7744
AD
161712001-12-29 Akim Demaille <akim@epita.fr>
16172
16173 * src/reader.c (readgram): Don't add the rule 0 if there were no
16174 rules read. In other words, add it _after_ having performed
16175 grammar sanity checks.
16176 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
16177
78d5bae9
AD
161782001-12-29 Akim Demaille <akim@epita.fr>
16179
16180 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
16181 visible, and some states have now a different number.
16182
ff442794
AD
161832001-12-29 Akim Demaille <akim@epita.fr>
16184
16185 * src/reader.c (readgram): Bind the initial rule's lineno to that
16186 of the first rule.
16187 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
16188 (Solved SR Conflicts): Adjust rule 0's line number.
16189
610ab194
AD
161902001-12-29 Akim Demaille <akim@epita.fr>
16191
16192 Fix the `GAWK Grammar' failure.
16193
16194 * src/LR0.c (final_state): Initialize to -1 so that we do compute
16195 the reductions of the first state which was mistakenly confused
16196 with the final state because precisely final_state was initialized
16197 to 0.
16198 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
16199 now noticed by Bison.
16200 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
16201 have a reduction on $default.
16202
29d29c8f
AD
162032001-12-29 Akim Demaille <akim@epita.fr>
16204
16205 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
16206 rule line numbers.
16207 * src/closure.c (print_closure): Likewise.
16208 * src/derives.c (print_derives): Likewise.
16209 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
16210 now.
16211
7c6b64d0
AD
162122001-12-29 Akim Demaille <akim@epita.fr>
16213
16214 * src/lalr.c (lookaheads_print): New.
16215 (lalr): Call it when --trace-flag.
16216 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
16217 are dumped.
16218
3d4daee3
AD
162192001-12-29 Akim Demaille <akim@epita.fr>
16220
16221 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
16222 when walking through ritem, even via rule->rhs.
16223 * src/reduce.c (dump_grammar, useful_production, reduce_output)
16224 (useful_production, useless_nonterminals): Likewise.
16225 (reduce_grammar_tables): Likewise, plus update nritems.
16226 * src/nullable.c (set_nullable): Likewise.
16227 * src/lalr.c (build_relations): Likewise.
16228 * tests/sets.at (Nullable): Adjust.
16229 Fortunately, now, the $axiom is no longer nullable.
16230
9e7f6bbd
AD
162312001-12-29 Akim Demaille <akim@epita.fr>
16232
16233 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
16234 the 0-sentinel.
16235 * src/gram.c (ritem_longest_rhs): Likewise.
16236 * src/reduce.c (nonterminals_reduce): Likewise.
16237 * src/print_graph.c (print_graph): Likewise.
16238 * src/output.c (output_rule_data): Likewise.
16239 * src/nullable.c (set_nullable): Likewise.
16240
255ef638
AD
162412001-12-29 Akim Demaille <akim@epita.fr>
16242
16243 * src/output.c: Comment changes.
16244
0d8a7363
AD
162452001-12-27 Paul Eggert <eggert@twinsun.com>
16246
16247 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
16248 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
16249 Sparc, as they were causing more porting problems than the
16250 (minor) performance improvement was worth.
16251
16252 Also, catch up with 1.31's YYSTD.
16253
3db472b9
AD
162542001-12-27 Akim Demaille <akim@epita.fr>
16255
16256 * src/output.c (output_gram): Rely on nritems, not the
16257 0-sentinel. See below.
16258 Use -1 as separator, not 0.
16259 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
16260 Rely on -1 as separator in yyrhs, instead of 0.
16261 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
16262 twice `Now at end of input', therefore there are two lines less to
16263 expect.
16264
b365aa05
AD
162652001-12-27 Akim Demaille <akim@epita.fr>
16266
16267 * tests/regression.at (Unresolved SR Conflicts):
16268 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
16269 below.
16270
30171f79
AD
162712001-12-27 Akim Demaille <akim@epita.fr>
16272
16273 * src/LR0.c (new_state): Recognize the final state by the fact it
16274 is reached by eoftoken.
16275 (insert_start_shifting_state, insert_eof_shifting_state)
16276 (insert_accepting_state, augment_automaton): Remove, since now
16277 these states are automatically computed from the initial state.
16278 (generate_states): Adjust.
16279 * src/print.c: When reporting a rule number to the user, substract
16280 1, so that the axiom rule is rule 0, and the first user rule is 1.
16281 * src/reduce.c: Likewise.
16282 * src/print_graph.c (print_core): For the time being, just as for
16283 the report, depend upon --trace-flags to dump the full set of
16284 items.
16285 * src/reader.c (readgram): Once the grammar read, insert the rule
16286 0: `$axiom: START-SYMBOL $'.
16287 * tests/set.at: Adjust: rule 0 is now displayed, and since the
16288 number of the states has changed (the final state is no longer
16289 necessarily the last), catch up.
16290
75142d45
AD
162912001-12-27 Akim Demaille <akim@epita.fr>
16292
16293 Try to make the use of the eoftoken valid. Given that its value
16294 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
16295 is used instead of > 0 where appropriate, (ii), depend upon nritems
16296 instead of the 0-sentinel.
16297
16298 * src/gram.h, src/gram.c (nritems): New.
16299 Expected to be duplication of nitems, but for the time being...
16300 * src/reader.c (packgram): Assert nritems and nitems are equal.
16301 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
16302 * src/closure.c (print_closure, print_fderives): Likewise.
16303 * src/gram.c (ritem_print): Likewise.
16304 * src/print.c (print_core, print_grammar): Likewise.
16305 * src/print_graph.c: Likewise.
16306
b7c49edf
AD
163072001-12-27 Akim Demaille <akim@epita.fr>
16308
16309 * src/main.c (main): If there are complains after grammar
16310 reductions, then output the report anyway if requested, then die.
16311 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
16312 * src/reader.c (eoftoken): New.
16313 (parse_token_decl): If the token being defined has value `0', it
16314 is the eoftoken.
16315 (packsymbols): No longer hack `tags' to insert `$' by hand.
16316 Be sure to preserve the value of the eoftoken.
16317 (reader): Make sure eoftoken is defined.
16318 Initialize nsyms to 0: now eoftoken is created just like the others.
16319 * src/print.c (print_grammar): Don't special case the eof token.
16320 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
16321 lie anyway, albeit pleasant.
16322 * tests/calc.at: Exercise error messages with eoftoken.
16323 Change the grammar so that empty input is invalid.
16324 Adjust expectations.
16325 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
16326
ec2da99f
AD
163272001-12-27 Akim Demaille <akim@epita.fr>
16328
16329 * configure.in: Check the protos of strchr ans strspn.
16330 Replace strchr if needed.
16331 * src/system.h: Provide the protos of strchr, strspn and memchr if
16332 missing.
16333 * lib/strchr.c: New.
16334 * src/reader.c (symbols_save): Use strchr.
16335
8adfa272
AD
163362001-12-27 Akim Demaille <akim@epita.fr>
16337
16338 * src/print.c, src/print_graph.c (escape): New.
16339 Use it to quote the TAGS outputs.
16340 * src/print_graph.c (print_state): Now errors are in red, and
16341 reductions in green.
16342 Prefer high to wide: output the state number on a line of its own.
16343
80dac38c
AD
163442001-12-27 Akim Demaille <akim@epita.fr>
16345
16346 * src/state.h, src/state.c (reductions_new): New.
16347 * src/LR0.c (set_state_table): Let all the states have a
16348 `reductions', even if reduced to 0.
16349 (save_reductions): Adjust.
16350 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
16351 * src/print.c (print_reductions, print_actions): Adjust.
16352 * src/output.c (action_row): Adjust.
16353
2cec70b9
AD
163542001-12-27 Akim Demaille <akim@epita.fr>
16355
16356 * src/state.h, src/state.c (errs_new, errs_dup): New.
16357 * src/LR0.c (set_state_table): Let all the states have an errs,
16358 even if reduced to 0.
16359 * src/print.c (print_errs, print_reductions): Adjust.
16360 * src/output.c (output_actions, action_row): Adjust.
16361 * src/conflicts.c (resolve_sr_conflict): Adjust.
16362
13ca549a
AD
163632001-12-27 Akim Demaille <akim@epita.fr>
16364
16365 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
16366
5092aba5
AD
163672001-12-27 Akim Demaille <akim@epita.fr>
16368
16369 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
16370 * src/print.c: here.
16371 (lookaheadset, shiftset): New, used as additional storage by
16372 print_reductions.
16373 (print_results): Adjust.
16374 (print_shifts, print_gotos, print_errs): New, extracted from...
16375 (print_actions): here.
16376 * src/print_graph.c (print_actions): Remove dead code.
16377
11e2beca
AD
163782001-12-27 Akim Demaille <akim@epita.fr>
16379
16380 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
16381 `$n' and `@n'.
16382
dac3c910
AD
163832001-12-27 Akim Demaille <akim@epita.fr>
16384
16385 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
16386 (build_relations): Adjust.
16387
d0b0fefa
AD
163882001-12-27 Akim Demaille <akim@epita.fr>
16389
16390 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
16391 duplication.
16392
adc8c848
AD
163932001-12-27 Akim Demaille <akim@epita.fr>
16394
16395 * src/reader.c (packgram): Catch nitems overflows.
16396
14d293ac
AD
163972001-12-27 Akim Demaille <akim@epita.fr>
16398
16399 * src/files.c, src/files.h (guard_obstack): Remove.
16400 * src/output.c (output): Adjust.
16401 * src/reader.c (parse_braces): New, factoring...
16402 (copy_action, copy_guard): these two which are renamed as...
16403 (parse_action, parse_guard): these.
16404 As a voluntary consequence, using braces around guards is now
16405 mandatory.
16406
f499b062
AD
164072001-12-27 Akim Demaille <akim@epita.fr>
16408
16409 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
16410 * src/reader.c (symbol_list): `guard' and `guard_line' are new
16411 members.
16412 (symbol_list_new): Adjust.
16413 (copy_action): action_line is the first line, not the last.
16414 (copy_guard): Just as for actions, store the `action' only, not
16415 the switch/case/break flesh.
16416 Don't parse the user action that might follow the guard, let...
16417 (readgram): do it, i.e., now, there can be an action after a
16418 guard.
16419 In other words the guard is just explicitly optional.
16420 (packgram): Adjust.
16421 * src/output.c (guards_output): New.
16422 (output_parser): Call it when needed.
16423 (output): Also free the guard and attrs obstacks.
16424 * src/files.c, src/files.h (obstack_save): Remove.
16425 (output_files): Remove.
16426 As a result, if one needs the former `.act' file, using an
16427 appropriate skeleton which requires actions and guards is now
16428 required.
16429 * src/main.c (main): Adjust.
16430 * tests/semantic.at: New.
16431 * tests/regression.at: Use `input.y' as input file name.
16432 Avoid 8+3 problems by requiring input.c when the test needs the
16433 parser.
16434
d945f5cd
AD
164352001-12-27 Akim Demaille <akim@epita.fr>
16436
16437 * src/reader.c (symbol_list_new): Be sure to initialize all the
16438 fields.
16439
d200e455
AD
164402001-12-27 Akim Demaille <akim@epita.fr>
16441
16442 All the hacks using a final pseudo state are now useless.
16443
16444 * src/LR0.c (set_state_table): state_table holds exactly nstates.
16445 * src/lalr.c (nLA): New.
16446 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
16447 instead of lookaheadsp from the pseudo state (nstate + 1).
16448
f9507c28
AD
164492001-12-27 Akim Demaille <akim@epita.fr>
16450
16451 * src/output.c (action_row, token_actions): Use a state_t instead
16452 of a integer, and nlookaheads instead of the following state's
16453 lookaheadsp.
16454
065fbd27
AD
164552001-12-27 Akim Demaille <akim@epita.fr>
16456
16457 * src/conflicts.c (log_resolution, flush_shift)
16458 (resolve_sr_conflict, set_conflicts, solve_conflicts)
16459 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
16460 (conflicts_print, print_reductions): Use a state_t instead of an
16461 integer when referring to a state.
16462 As much as possible, depend upon nlookaheads, instead of the
16463 `lookaheadsp' member of the following state (since lookaheads of
16464 successive states are successive, the difference between state n + 1
16465 and n served as the number of lookaheads for state n).
16466 * src/lalr.c (add_lookback_edge): Likewise.
16467 * src/print.c (print_core, print_actions, print_state)
16468 (print_results): Likewise.
16469 * src/print_graph.c (print_core, print_actions, print_state)
16470 (print_graph): Likewise.
16471 * src/conflicts.h: Adjust.
16472
1b177bd7
AD
164732001-12-27 Akim Demaille <akim@epita.fr>
16474
16475 * src/bison.hairy: Formatting/comment changes.
16476 ANSIfy.
16477 Remove `register' indications.
16478 Add plenty of `static'.
16479
7742ddeb
AD
164802001-12-27 Akim Demaille <akim@epita.fr>
16481
16482 * src/output.c (prepare): Drop the muscle `ntbase' which
16483 duplicates ntokens.
16484 * src/bison.simple: Formatting/comment changes.
16485 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
16486 is an undocumented synonym.
16487
1fa14068
AD
164882001-12-22 Akim Demaille <akim@epita.fr>
16489
16490 * src/output.c (output_table_data): Change the prototype to use
16491 `int' for array ranges: some invocations do pass an int, not a
16492 short.
16493 Reported by Wayne Green.
16494
b9752825
AD
164952001-12-22 Akim Demaille <akim@epita.fr>
16496
16497 Some actions of web2c.y are improperly triggered.
16498 Reported by Mike Castle.
16499
16500 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
16501 * tests/regression.at (Web2c): Rename as...
16502 (Web2c Report): this.
16503 (Web2c Actions): New.
16504
776209d6
AD
165052001-12-22 Akim Demaille <akim@epita.fr>
16506
16507 Reductions in web2c.y are improperly reported.
16508 Reported by Mike Castle.
16509
16510 * src/conflicts.c (print_reductions): Fix.
16511 * tests/regression.at (Web2c): New.
16512
275fc3ad
AD
165132001-12-18 Akim Demaille <akim@epita.fr>
16514
16515 Some host fail on `assert (!"foo")', which expands to
16516 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
16517 Reported by Nelson Beebee.
16518
16519 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
16520 `#define it_succeeded 0' and `assert (it_succeeded)'.
16521
897668ee
MA
165222001-12-17 Marc Autret <autret_m@epita.fr>
16523
16524 * src/bison.simple: Don't hard code the skeleton line and filename.
16525 * src/output.c (output_parser): Rename 'line' as 'output_line'.
16526 New line counter 'skeleton_line' (skeleton-line muscle).
16527
ab3399e0
PE
165282001-12-17 Paul Eggert <eggert@twinsun.com>
16529
16530 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
16531 YYDEBUG must be defined to a nonzero value.
16532
16533 * src/bison.simple (yytname): Do not assume that the user defines
16534 YYDEBUG to a properly parenthesized expression.
16535
3877f72b
AD
165362001-12-17 Akim Demaille <akim@epita.fr>
16537
16538 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
16539 nlookaheads is a new member.
16540 Adjust all users.
16541 * src/lalr.h (nlookaheads): Remove this orphan declaration.
16542 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
16543 state.
776209d6 16544
331dbc1b
AD
165452001-12-17 Akim Demaille <akim@epita.fr>
16546
16547 * src/files.h, src/files.c (open_files, close_files): Remove.
16548 * src/main.c (main): Don't open/close files, nor invoke lex_free,
16549 let...
16550 * src/reader.c (reader): Do it.
776209d6 16551
be750e4c
AD
165522001-12-17 Akim Demaille <akim@epita.fr>
16553
16554 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 16555
709ae8c6
AD
165562001-12-17 Akim Demaille <akim@epita.fr>
16557
16558 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
16559 (flush_reduce): New.
16560 (resolve_sr_conflict): Adjust.
776209d6 16561
f87685c3
AD
165622001-12-17 Akim Demaille <akim@epita.fr>
16563
16564 * src/output.c (output_obstack): Be static and rename as...
16565 (format_obstack): this, to avoid any confusion with files.c's
16566 output_obstack.
16567 * src/reader.h (muscle_obstack): Move to...
16568 * src/output.h: here, since it's defined in output.c.
16569
837491d8
AD
165702001-12-17 Akim Demaille <akim@epita.fr>
16571
16572 * src/output.c (action_row, save_column, default_goto)
16573 (sort_actions, matching_state, pack_vector): Better variable
16574 locality.
16575
796d61fb
AD
165762001-12-17 Akim Demaille <akim@epita.fr>
16577
16578 * src/output.c: Various formatting changes.
776209d6 16579
64d15509
AD
165802001-12-17 Akim Demaille <akim@epita.fr>
16581
16582 * src/files.c (output_files): Free the output_obstack.
16583 * src/main.c (main): Call print and print_graph conditionally.
16584 * src/print.c (print): Work unconditionally.
16585 * src/print_graph.c (print_graph): Work unconditionally.
16586 * src/conflicts.c (log_resolution): Output only if verbose_flag.
16587
fbc8ecb7
MA
165882001-12-16 Marc Autret <autret_m@epita.fr>
16589
16590 * src/output.c (actions_output): Fix. When we use %no-lines,
16591 there is one less line per action.
16592
f0440388
MA
165932001-12-16 Marc Autret <autret_m@epita.fr>
16594
16595 * src/bison.simple: Remove a useless #line directive.
16596 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
16597 * src/output.c (get_lines_number): New.
776209d6 16598 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
16599 output muscles.
16600 Fix line numbering.
16601 (actions_output): Computes the number of lines taken by actions.
16602 (output_master_parser): Insert new skeleton which is the name of
16603 the output parser file name.
16604
a79986b8
MA
166052001-12-15 Marc Autret <autret_m@epita.fr>
16606
16607 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
16608
4ec8e00f
MA
166092001-12-15 Marc Autret <autret_m@epita.fr>
16610
16611 * src/output.c (output_gram): Keep track of the hairy one.
16612
1a4648ff
AD
166132001-12-15 Akim Demaille <akim@epita.fr>
16614
16615 Make `make distcheck' work.
16616
16617 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
16618 system.h which uses libgettext.h.
16619
9c2c67e6
AD
166202001-12-15 Akim Demaille <akim@epita.fr>
16621
16622 * src/nullable.c (set_nullable): Useless rules must be skipped,
16623 otherwise, since we range over their symbols, we might look at a
16624 nonterminal which no longer ``exists'', i.e., it is not counted in
16625 `nvars', hence we overflow our arrays.
16626
93ede233
AD
166272001-12-15 Akim Demaille <akim@epita.fr>
16628
16629 The header can also be produced directly, without any obstack!
16630 Yahoo!
16631
16632 * src/files.c, src/files.h (defines_obstack): Remove.
16633 (compute_header_macro): Global.
16634 (defines_obstack_save): Remove.
16635 * src/reader.c (parse_union_decl): No longer output to
16636 defines_obstack: its content can be found in the `stype' muscle
16637 anyway.
16638 (output_token_translations): Merge into...
16639 (symbols_output): this.
16640 Rename as...
16641 (symbols_save): this.
16642 (reader): Adjust.
16643 * src/output.c (header_output): New.
16644 (output): Call it.
16645
2666f928
AD
166462001-12-15 Akim Demaille <akim@epita.fr>
16647
16648 * src/reader.c (parse_union_decl): Instead of handling two obstack
16649 simultaneously, use one to define the `stype' muscle, and use the
16650 value of the latter to fill defines_obstack.
16651 (copy_comment): Remove.
16652 (copy_comment2): Work for a single obstack.
16653 Rename as...
16654 (copy_comment): this.
16655
428046f8
AD
166562001-12-15 Akim Demaille <akim@epita.fr>
16657
16658 * src/lex.c, src/lex.h (xgetc): No longer static.
16659 * src/reader.c (parse_union_decl): Revamp.
16660
ea52d706
AD
166612001-12-15 Akim Demaille <akim@epita.fr>
16662
16663 Still making progress in separating Bison into (i) input, (ii)
16664 process, (iii) output: now we can directly output the parser file
16665 without using table_obstack at all.
16666
16667 * src/files.c, src/files.h (table_obstack): Bye bye.
16668 (parser_file_name): New.
16669 * src/files.c (compute_output_file_names): Compute it.
16670 * src/output.c (actions_output, output_parser)
16671 (output_master_parser): To a file instead of an obstack.
16672
3f96f4dc
AD
166732001-12-15 Akim Demaille <akim@epita.fr>
16674
16675 Attach actions to rules, instead of pre-outputting them to
16676 actions_obstack.
16677
16678 * src/gram.h (rule_t): action and action_line are new members.
16679 * src/reader.c (symbol_list): Likewise.
16680 (copy_action): Save the actions within the rule.
16681 (packgram): Save them in rule_table.
16682 * src/output.c (actions_output): New.
16683 (output_parser): Use it on `%%actions'.
16684 (output_rule_data): Don't free rule_table.
16685 (output): Do it.
16686 (prepare): Don't save the `action' muscle.
16687 * src/bison.simple: s/%%action/%%actions/.
16688
51576fb3
AD
166892001-12-15 Akim Demaille <akim@epita.fr>
16690
16691 * src/reader.c (copy_action): When --yacc, don't append a `;'
16692 to the user action: let it fail if lacking.
dee049eb 16693 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 16694
2648a72d
AD
166952001-12-14 Akim Demaille <akim@epita.fr>
16696
16697 * src/lex.c (literalchar): Simply return the char you decoded, non
16698 longer mess around with obstacks and int pointers.
16699 Adjust all callers.
16700
92790e5b
AD
167012001-12-14 Akim Demaille <akim@epita.fr>
16702
16703 * src/lex.c (literalchar): Don't escape the special characters,
16704 just decode them, and keep them as char (before, eol was output as
16705 the 2 char string `\n' etc.).
16706 * src/output.c (output_rule_data): Use quotearg to output the
16707 token strings.
16708
927c1557
PE
167092001-12-13 Paul Eggert <eggert@twinsun.com>
16710
16711 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
16712 Do not infringe on the global user namespace when using C++.
16713 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
16714 All uses of `fprintf' and `stderr' changed.
16715
16716 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
16717
ed8e1f68
AD
167182001-12-13 Akim Demaille <akim@epita.fr>
16719
16720 The computation of nullable is broken: it doesn't handle empty
16721 RHS's properly.
16722
16723 * tests/torture.at (GNU AWK Grammar): New.
16724 * tests/sets.at (Nullable): New.
16725 * src/nullable.c (set_nullable): Instead of blindly looping over
16726 `ritems', loop over the rules, and then over their rhs's.
16727
16728 Work around Autotest bugs.
16729
16730 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
16731 frame, because Autotest understand lines starting with a `+' as
16732 traces from the shell. Then, they are not processed properly.
16733 Admittedly an Autotest bug, but we don't have time to wait for
16734 Autotest to catch up.
16735 * tests/regression.at (Broken Closure): Adjust to the new table
16736 frames.
16737 Move to...
16738 * tests/sets.at: here.
16739
cb581495
AD
167402001-12-13 Akim Demaille <akim@epita.fr>
16741
16742 * src/closure.c (closure): Use nrules instead of playing tricks
16743 with BITS_PER_WORD.
16744
2e729273
AD
167452001-12-13 Akim Demaille <akim@epita.fr>
16746
16747 * src/print.c (print_actions): Output the handling of `$' as the
16748 traces do: shifting the token EOF. Before EOF was treated as a
16749 nonterminal.
16750 * tests/regression.at: Adjust some tests.
16751 * src/print_graph.c (print_core): Complete the set of items via
16752 closure. The next-to-final and final states are still unsatisfying,
16753 but that's to be addressed elsewhere.
16754 No longer output the rule numbers, but do output the state number.
16755 A single loop for the shifts + gotos is enough, but picked a
16756 distinct color for each.
16757 (print_graph): Initialize and finalize closure.
16758
107f7dfb
AD
167592001-12-13 Akim Demaille <akim@epita.fr>
16760
16761 * src/reader.c (readgram): Remove dead code, an strip useless
16762 braces.
16763 (get_type): Remove, unused.
16764
9b53a24f
AD
167652001-12-12 Akim Demaille <akim@epita.fr>
16766
16767 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
16768 on that of lib/error.c.
16769
dbfb6dcd
AD
167702001-12-12 Akim Demaille <akim@epita.fr>
16771
16772 Some hosts don't like `/' in includes.
16773
16774 * src/system.h: Include libgettext.h without qualifying the path.
16775 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
16776 $(top_srcdir).
16777
c25fb648
MA
167782001-12-11 Marc Autret <autret_m@epita.fr>
16779
16780 * src/output.c (output_parser): Remove useless muscle.
16781
710ddc4f
MA
167822001-12-11 Marc Autret <autret_m@epita.fr>
16783
16784 * src/bison.simple: Remove #line just before %%epilogue. It
16785 is now handled in ...
16786 * src/reader.c (read_additionnal_code): Add the output of a
16787 #line for the epilogue.
16788
e83d80b8
MA
167892001-12-10 Marc Autret <autret_m@epita.fr>
16790
927c1557 16791 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
16792 replace precedent remove.
16793 * src/bison.simple: Remove #line before %%prologue because
16794 %%input-line is wrong at this time.
16795
971d5158
MA
167962001-12-10 Marc Autret <autret_m@epita.fr>
16797
16798 * src/reader.c (symbols_output): Clean up.
927c1557 16799 * src/output.c (output_gram, output): Clean up.
971d5158 16800
5edafffd
AD
168012001-12-10 Akim Demaille <akim@epita.fr>
16802
16803 * src/lalr.c (initialize_lookaheads): New. Extracted from...
16804 * src/LR0.c (set_state_table): here.
16805 * src/lalr.c (lalr): Call it.
16806
0279f8e9
AD
168072001-12-10 Akim Demaille <akim@epita.fr>
16808
16809 * src/state.h (shifts): Remove the `number' member: shifts are
16810 attached to state, hence no longer need to be labelled with a
16811 state number.
16812
190c4f5f
AD
168132001-12-10 Akim Demaille <akim@epita.fr>
16814
16815 Now that states have a complete set of members, the linked list of
16816 shifts is useless: just fill directly the state's shifts member.
16817
16818 * src/state.h (shifts): Remove the `next' member.
16819 * src/LR0.c (first_state, last_state): Remove.
16820 Adjust the callers.
16821 (augment_automaton): Don't look for the shifts that must be added
16822 a shift on EOF: it is those of the state we looked for! But now,
16823 since shifts are attached, it is no longer needed to looking
16824 merely by its id: its number.
16825
2a73b93d
AD
168262001-12-10 Akim Demaille <akim@epita.fr>
16827
16828 * src/LR0.c (augment_automaton): Better variable locality.
16829 Remove an impossible branch: if there is a state corresponding to
16830 the start symbol being shifted, then there is shift for the start
16831 symbol from the initial state.
16832
74392f6a
AD
168332001-12-10 Akim Demaille <akim@epita.fr>
16834
16835 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
16836 only when appropriate: when insert_start_shifting_state' is not
16837 invoked.
16838 * tests/regression.at (Rule Line Numbers): Adjust.
16839
37c82725
AD
168402001-12-10 Akim Demaille <akim@epita.fr>
16841
16842 * src/LR0.c (augment_automaton): Now that all states have shifts,
16843 merge the two cases addition shifts to the initial state.
16844
6a164e0c
AD
168452001-12-10 Akim Demaille <akim@epita.fr>
16846
16847 * src/lalr.c (set_state_table): Move to...
16848 * src/LR0.c: here.
16849 * src/lalr.c (lalr): Don't call it...
16850 * src/LR0.c (generate_states): do it.
16851 * src/LR0.h (first_state): Remove, only the table is used.
16852
7215de24
AD
168532001-12-10 Akim Demaille <akim@epita.fr>
16854
16855 * src/LR0.h (first_shift, first_reduction): Remove.
16856 * src/lalr.c: Don't use first_shift: find shifts through the
16857 states.
16858
80e25d4d
AD
168592001-12-10 Akim Demaille <akim@epita.fr>
16860
16861 * src/LR0.c: Attach shifts to states as soon as they are
16862 computed.
16863 * src/lalr.c (set_state_table): Instead of assigning shifts to
16864 state, just assert that the mapping was properly done.
16865
0ab3728b
AD
168662001-12-10 Akim Demaille <akim@epita.fr>
16867
16868 * src/LR0.c (insert_start_shift): Rename as...
16869 (insert_start_shifting_state): this.
16870 (insert_eof_shifting_state, insert_accepting_state): New.
16871 (augment_automaton): Adjust.
16872 Better locality of the variables.
16873 When looking if the start_symbol is shifted from the initial
16874 state, using `while (... symbol != start_symbol ...)' sounds
16875 better than `while (... symbol < start_symbol ...)': If fail
16876 to see how the order between symbols could be relevant!
16877
78af9bbc
AD
168782001-12-10 Akim Demaille <akim@epita.fr>
16879
16880 * src/getargs.h: Don't declare `spec_name_prefix' and
16881 `spec_file_prefix', declared by src/files.h.
16882 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
16883 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
16884 * src/output.c (prepare): Adjust.
16885 * src/reader.c (symbols_output): Likewise.
16886 * src/vmsgetargs.c: Vaguely adjust, but who cares?
16887
bdef2a41
AD
168882001-12-10 Akim Demaille <akim@epita.fr>
16889
16890 * src/muscle_tab.c (muscle_init): NULL is a better default than
16891 `"0"'.
16892
3735969c
AD
168932001-12-10 Akim Demaille <akim@epita.fr>
16894
16895 * src/reader.c (reader): Calling symbols_output once is enough.
16896
49701457
AD
168972001-12-10 Akim Demaille <akim@epita.fr>
16898
16899 Now that states have a complete set of members, the linked list of
16900 reductions is useless: just fill directly the state's reductions
16901 member.
16902
16903 * src/state.h (struct reductions): Remove member `number' and
16904 `next'.
16905 * src/LR0.c (first_reduction, last_reduction): Remove.
16906 (save_reductions): Don't link the new reductions, store them in
16907 this_state.
16908 * src/lalr.c (set_state_table): No need to attach reductions to
16909 states, it's already done.
16910 * src/output.c (output_actions): No longer free the shifts, then
16911 the reductions, then the states: free all the states and their
16912 members.
16913
0edad749
AD
169142001-12-10 Akim Demaille <akim@epita.fr>
16915
16916 * src/options.c (OPTN, DRTV, BOTH): New.
16917 (option_table): Use them.
16918
0edad749
AD
16919 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
16920 the job of system.h.
16921 * src/options.c: Don't include stdio.h and xalloc.h for the same
16922 reasons.
16923
5449dd0f
AD
169242001-12-10 Akim Demaille <akim@epita.fr>
16925
16926 * src/output.c (output, prepare): Make sure the values of the
16927 muscles `action' and `prologue' are 0-terminated.
16928
a870c567
AD
169292001-12-10 Akim Demaille <akim@epita.fr>
16930
16931 Clean up GCC warnings.
16932
16933 * src/reader.c (copy_action): `buf' is not used.
16934 (parse_skel_decl): Be static.
16935 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
16936 * src/options.h (create_long_option_table): Have a real prototype.
16937 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
16938 (hash_delete_at): Return const void *.
16939 Adjust casts to preserve the const.
16940
80df8768
AD
169412001-12-10 Akim Demaille <akim@epita.fr>
16942
16943 * configure.in: Require 2.52g.
16944 M4 is not needed, but AUTOM4TE is.
16945 * m4/m4.m4: Remove.
16946 * tests/Makefile.am: Adjust.
16947
f693ad14
AD
169482001-12-10 Akim Demaille <akim@epita.fr>
16949
16950 One structure for states is enough, even though theoretically
16951 there are LR(0) states and LALR(1) states.
16952
16953 * src/lalr.h (state_t): Remove.
16954 (state_table): Be state_t **, not state_t *.
16955 * src/state.h (core, CORE_ALLOC): Rename as...
16956 (state_t, STATE_ALLOC): this.
16957 Add the LALR(1) members: shifts, reductions, errs.
16958 * src/LR0.c (state_table): Rename as...
16959 (state_hash): this, to avoid name clashes with the global
16960 `state_table'.
16961 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
16962 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
16963
74ffbcb6
AD
169642001-12-10 Akim Demaille <akim@epita.fr>
16965
16966 Bison dumps core on bash.y.
16967 Reported by Pascal Bart.
16968
16969 * src/warshall.c (bitmatrix_print): New.
16970 (TC): Use it.
ba0fe3c7 16971 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
16972 j must be the outer loop.
16973 * tests/regression.at (Broken Closure): New.
16974
07708e19
AD
169752001-12-05 Akim Demaille <akim@epita.fr>
16976
16977 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
16978 its argument.
ba1ecc07 16979 Reported by Peter Hamorsky.
07708e19 16980
92b16366
AD
169812001-12-05 Akim Demaille <akim@epita.fr>
16982
16983 * src/conflicts.c (err_table): Remove.
16984 (resolve_sr_conflict): Adjust.
16985 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
16986 Rename as...
16987 (state_t.reductions, state_t.shifts): this.
16988
076ab033
AD
169892001-12-05 Akim Demaille <akim@epita.fr>
16990
16991 * src/reduce.c (reduce_grammar_tables): No longer disable the
16992 removal of useless rules via CPP but via `if (0)', so that the
16993 compiler still check the code is valid.
16994 For instance, it should have noticed `rline' no longer exists: use
16995 the `line' member of rule_t.
16996 * src/gram.c (dummy, rline): Remove, unused.
16997
3843c413
AD
169982001-12-05 Akim Demaille <akim@epita.fr>
16999
17000 * src/output.c (pack_vector): Use assert, not berror.
17001 * src/main.c (berror): Remove, unused.
17002
43168960
AD
170032001-12-05 Akim Demaille <akim@epita.fr>
17004
17005 New experimental feature: if --verbose --trace output all the
17006 items of a state, not only its kernel.
17007
17008 * src/print.c (print_core): If `trace_flag', then invoke closure
17009 before outputting the items of the state (print_core is no longer
17010 a correct name them).
17011 (print_results): Invoke new_closure/free_closure if needed.
17012
b2872512
AD
170132001-12-05 Akim Demaille <akim@epita.fr>
17014
17015 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
17016 * src/closure.c, src/closure.h (itemsetsize): Rename as...
17017 (nitemset): for consistency with the rest of the project.
17018
23cbcc6c
AD
170192001-12-05 Akim Demaille <akim@epita.fr>
17020
17021 * src/closure.c (print_closure): Improve.
17022 (closure): Use it for printing input and output.
17023
03ec521c
AD
170242001-12-05 Akim Demaille <akim@epita.fr>
17025
17026 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
17027 indexed by nonterminals.
17028
3a7456dd
AD
170292001-12-05 Akim Demaille <akim@epita.fr>
17030
17031 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
17032 what it was!).
17033 * src/warshall.h: Remove accidental duplication of the content.
17034
1cbcf2e7
AD
170352001-12-05 Akim Demaille <akim@epita.fr>
17036
17037 * src/closure.c (set_fderives): De-obfuscate.
17038
84182270
AD
170392001-12-05 Akim Demaille <akim@epita.fr>
17040
17041 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
17042
3f6f053c
AD
170432001-12-05 Akim Demaille <akim@epita.fr>
17044
17045 * src/closure.c (set_firsts): De-obfuscate.
17046
7a5350ba
AD
170472001-12-05 Akim Demaille <akim@epita.fr>
17048
17049 * src/output.c (action_row): De-obfuscate
17050 using the good o' techniques: arrays not pointers, variable
17051 locality, BITISSET, RESETBIT etc.
17052
d954473d
AD
170532001-12-05 Akim Demaille <akim@epita.fr>
17054
17055 Pessimize the code to simplify it: from now on, all the states
17056 have a valid SHIFTS, which NSHIFTS is possibly 0.
17057
17058 * src/LR0.c (shifts_new): Be global and move to..
17059 * src/state.c, src/state.h: here.
17060 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
17061 * src/print_graph: Adjust.
17062
9839bbe5
AD
170632001-12-05 Akim Demaille <akim@epita.fr>
17064
17065 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
17066 * src/conflicts.c: Use it.
17067 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
17068 incorrectly ``simplified''.
17069
9f136c07
AD
170702001-12-05 Akim Demaille <akim@epita.fr>
17071
17072 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
17073 using the good o' techniques: arrays not pointers, variable
17074 locality, BITISSET, RESETBIT etc.
17075
b608206e
AD
170762001-12-05 Akim Demaille <akim@epita.fr>
17077
17078 * src/state.h (SHIFT_SYMBOL): New.
17079 * src/conflicts.c: Use it to deobfuscate.
17080
52afa962
AD
170812001-12-05 Akim Demaille <akim@epita.fr>
17082
17083 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
17084 (print_reductions): De-obfuscate using the good o' techniques:
17085 arrays not pointers, variable locality, BITISSET.
17086
e74dc321
AD
170872001-12-05 Akim Demaille <akim@epita.fr>
17088
17089 * src/conflicts.c (print_reductions): Arrays, not pointers.
17090 Use BITISSET.
17091
768fca83
AD
170922001-12-05 Akim Demaille <akim@epita.fr>
17093
17094 * src/conflicts.c (print_reductions): Pessimize, but clarify.
17095
a17e599f
AD
170962001-12-05 Akim Demaille <akim@epita.fr>
17097
17098 * src/conflicts.c (print_reductions): Improve variable locality.
17099
a04bc341
AD
171002001-12-05 Akim Demaille <akim@epita.fr>
17101
17102 * src/conflicts.c (print_reductions): Pessimize, but clarify.
17103
c8ea038e
AD
171042001-12-05 Akim Demaille <akim@epita.fr>
17105
17106 * src/conflicts.c (print_reductions): Improve variable locality.
17107
aa2aab3c
AD
171082001-12-05 Akim Demaille <akim@epita.fr>
17109
17110 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
17111 * src/lalr.c: Use them.
17112
b178c8cc
AD
171132001-12-05 Akim Demaille <akim@epita.fr>
17114
17115 * src/LR0.c (augment_automaton): Formatting changes.
17116 Better variable locality.
17117
f67d13aa
AD
171182001-12-05 Akim Demaille <akim@epita.fr>
17119
17120 * src/lalr.c (matrix_print): New.
17121 (transpose): Use it.
17122 Use arrays instead of pointers.
17123
c2713865
AD
171242001-12-05 Akim Demaille <akim@epita.fr>
17125
17126 * src/lalr.c (maxrhs): Move to...
17127 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
17128 * src/lalr.c (build_relations): Adjust.
17129
9887c18a
AD
171302001-12-05 Akim Demaille <akim@epita.fr>
17131
17132 * src/lalr.c (transpose): Free the memory allocated to the
17133 argument, as it is replaced by the results by the unique caller.
17134 (build_relations): Merely invoke transpose: it handles the memory
17135 deallocation.
17136 Improve variable locality.
17137 Avoid variables used as mere abbreviations.
17138 (compute_lookaheads): Use arrays instead of pointers.
17139
4d4f699c
AD
171402001-12-05 Akim Demaille <akim@epita.fr>
17141
17142 * src/lalr.c (initialize_F): Improve variable locality.
17143 Avoid variables used as mere abbreviations.
17144
80a69750
AD
171452001-12-05 Akim Demaille <akim@epita.fr>
17146
17147 * src/derives.c (print_derives): Display the ruleno.
17148 * src/lalr.c (initialize_F, transpose): Better variable locality
17149 to improve readability.
17150 Avoid variables used as mere abbreviations.
17151
fe961097
AD
171522001-12-05 Akim Demaille <akim@epita.fr>
17153
17154 * src/lalr.c (traverse): Use arrays instead of pointers.
17155
e3e4e814
AD
171562001-12-05 Akim Demaille <akim@epita.fr>
17157
17158 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
17159 the handling of squeue.
17160 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
17161
630e182b
AD
171622001-12-05 Akim Demaille <akim@epita.fr>
17163
17164 Because useless nonterminals are now kept alive (instead of being
17165 `destroyed'), we now sometimes examine them, and store information
17166 related to them. Hence we need to know their number, and adjust
17167 memory allocations.
17168
17169 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
17170 static.
17171 * src/LR0.c (allocate_itemsets): The memory allocated to
17172 `symbol_count' was used for two different purpose: once to count
17173 the number of occurrences of each symbol, and later reassigned to
17174 `shift_symbol', containing the symbol that can be shifted from a
17175 given state.
17176 Deobfuscate, i.e., allocate, use and free `symbol_count' here
17177 only, and...
17178 (new_itemsets): Allocate `shift_symbol' here.
17179 (allocate_itemsets): symbol_count includes useless nonterminals.
17180 Make room for them.
17181 (free_storage): Use `free', not `XFREE', for pointers that cannot
17182 be null.
17183
81b51460
AD
171842001-12-05 Akim Demaille <akim@epita.fr>
17185
17186 * src/nullable.c (set_nullable): Deobfuscate the handling of
17187 ritem.
17188 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
17189
3067fbef
AD
171902001-12-05 Akim Demaille <akim@epita.fr>
17191
17192 * src/gram.c, src/gram.h (ritem_print): New.
17193 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
17194 (This useless function was defined only to work around VMS linkers
17195 that can't handle compilation units with variables only).
17196 * src/reduce.c (dump_grammar): Use it to trace the construction of
17197 ritem.
17198
c2bea5f9
PE
171992001-12-04 Paul Eggert <eggert@twinsun.com>
17200
7d27c823
PE
17201 * src/bison.simple (union yyalloc): Change member names
17202 to be the same as the stack names.
17203 (yyparse): yyptr is now union yyalloc *, not char *.
17204 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
17205 and may generate better code on some machines.
c2bea5f9
PE
17206 (yystpcpy): Use prototype if __STDC__ is defined, not just
17207 if __cplusplus is defined.
35687a9d 17208
2c8a9dfa
AD
172092001-11-30 Akim Demaille <akim@epita.fr>
17210
17211 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
17212 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
17213 Gettext doesn't compile cleanly, and dies with -Werror.
17214 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
17215 Include WARNING_CFLAGS here.
17216 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
17217 before being defined.
17218
f4e421e6
AD
172192001-11-27 Paul Eggert <eggert@twinsun.com>
17220
17221 * lib/quotearg.h (quotearg_n, quotearg_n_style):
17222 First arg is int, not unsigned.
17223 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
17224 (SIZE_MAX, UINT_MAX): New macros.
17225 (quotearg_n_options): Abort if N is negative.
17226 Avoid overflow check on hosts where size_t is 64 bits and int
17227 is 32 bits, as overflow is impossible there.
17228 Fix off-by-one typo that caused unnecessary reallocation.
17229
7093d0f5
AD
172302001-11-29 Paul Eggert <eggert@twinsun.com>
17231
17232 Name space cleanup in generated parser.
17233
17234 * doc/bison.texinfo (Bison Parser): Discuss system headers
17235 and their effect on the user name space.
17236
17237 * src/bison.simple:
17238 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
17239 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
17240 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
17241
17242 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
17243 on user names when possible.
17244
17245 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
17246 Simplify test for whather <alloca.h> exists.
17247
17248 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
17249
17250 (<stdio.h>): Include if YYDEBUG.
17251
17252 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
17253 ! defined (yyoverflow) && ! defined (yymemcpy).
17254
17255 (yymemcpy, yyparse): Rename local variables as needed so that
17256 they all begin with 'yy'.
17257
17258 (yystrlen, yystpcpy): New functions.
17259
17260 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
17261 All uses changed.
17262
17263 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
17264 instead of relying on string.h functions. Use YYSTACK_ALLOC
17265 and YYSTACK_FREE instead of malloc and free.
17266
fd51e5ff
AD
172672001-11-30 Akim Demaille <akim@epita.fr>
17268
17269 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
17270 before their first uses.
17271 (YYBISON, YYPURE): Move to the top of the output.
17272
7d13ff5f
AD
172732001-11-30 Akim Demaille <akim@epita.fr>
17274
17275 * tests/reduce.at (Useless Nonterminals): Fix.
17276
892a3995
AD
172772001-11-30 Akim Demaille <akim@epita.fr>
17278
17279 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
17280 if body instead of `;' to pacify GCC's warnings.
17281
68f1e3ed
AD
172822001-11-30 Akim Demaille <akim@epita.fr>
17283
17284 Instead of mapping the LHS of unused rules to -1, keep the LHS
17285 valid, but flag the rules as invalid.
17286
17287 * src/gram.h (rule_t): `useful' is a new member.
17288 * src/print.c (print_grammar): Adjust.
17289 * src/derives.c (set_derives): Likewise.
17290 * src/reader.c (packgram, reduce_output): Likewise.
17291 * src/reduce.c (reduce_grammar_tables): Likewise.
17292 * tests/reduce.at (Underivable Rules, Useless Rules): New.
17293
d2d1b42b
AD
172942001-11-30 Akim Demaille <akim@epita.fr>
17295
17296 * src/reduce.c (reduce_output): Formatting changes.
17297 * src/print.c (print_results, print_grammar): Likewise.
17298 * tests/regression.at (Rule Line Numbers)
17299 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
17300
760b53a8
AD
173012001-11-30 Akim Demaille <akim@epita.fr>
17302
17303 * src/reduce.c (nonterminals_reduce): Instead of throwing away
17304 useless nonterminals, move them at the end of the symbol arrays.
17305 (reduce_output): Adjust.
17306 * tests/reduce.at (Useless Nonterminals): Adjust.
17307
00238958
AD
173082001-11-30 Akim Demaille <akim@epita.fr>
17309
17310 * src/reduce.c: Various comment/formatting changes.
17311 (nonterminals_reduce): New, extracted from...
17312 (reduce_grammar_tables): here.
17313 (reduce_grammar): Call nonterminals_reduce.
17314
396452de
PE
173152001-11-29 Paul Eggert <eggert@twinsun.com>
17316
17317 * src/bison.simple (YYSTACK_REALLOC): Remove.
17318 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
17319 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
17320 New macros.
17321 (union yyalloc): New type.
17322 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
17323 an arbitrary restriction on hosts where size_t is wider than int.
17324
17325 (yyparse): Don't dump core if alloca or malloc fails; instead, report
17326 a parser stack overflow. Allocate just one block of memory for all
17327 three stacks, instead of allocating three blocks; this typically is
17328 faster and reduces fragmentation.
17329
17330 Do not limit the number of items in the stack to a value that fits
17331 in 'int', as this is an arbitrary limit on hosts with 64-bit
17332 size_t and 32-bit int.
17333
147e184c
MA
173342001-11-29 Marc Autret <autret_m@epita.fr>
17335
17336 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
17337 of defining YYERROR_VERBOSE.
17338 [AT_DATA]: $4 is now out of C declarations in the prologue.
17339
426cf563
MA
173402001-11-28 Marc Autret <autret_m@epita.fr>
17341
17342 * src/reader.c (parse_dquoted_param): New.
17343 (parse_skel_decl): Use it.
17344 * src/lex.h: Add its prototype.
17345 * src/lex.c (literalchar): Become not static.
17346
c7925b99
MA
173472001-11-28 Marc Autret <autret_m@epita.fr>
17348
17349 * src/output.h: And put its extern declaration here.
17350 * src/output.c (error_verbose): Define here.
17351 (prepare): Echo name modification.
17352 * src/getargs.h: Clean its extern declaration.
17353 * src/getargs.c (error_verbose_flag): Remove.
17354 (getargs): Remove case 'e'.
17355 * src/options.c (option_table): 'error-verbose' is now seen as simple
17356 percent option.
17357 Include output.h.
17358
17359 * src/reader.c (read_declarations): Remove case tok_include.
17360 (parse_include_decl): Remove.
17361 * src/lex.h (token_t): Remove tok_include.
17362 * src/options.c (option_table): 'include' is now a simple command line
17363 option.
17364
5b5d1929
MA
173652001-11-28 Marc Autret <autret_m@epita.fr>
17366
17367 * src/bison.simple: Adjust muscle names.
17368 * src/muscle_tab.c (muscle_init): Also rename the muscles.
17369 * src/output.c (prepare): s/_/-/ for the muscles names.
17370 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
17371
8850be4b
MA
173722001-11-28 Marc Autret <autret_m@epita.fr>
17373
17374 * src/bison.simple: Fix debug.
17375 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
17376
4a38e613
AD
173772001-11-28 Akim Demaille <akim@epita.fr>
17378
17379 * src/LR0.c (shifts_new): New.
17380 (save_shifts, insert_start_shift, augment_automaton): Use it.
17381
4b35e1c1
AD
173822001-11-28 Akim Demaille <akim@epita.fr>
17383
17384 * src/closure.c (closure): `b' and `ruleno' denote the same value:
17385 keep ruleno only.
17386
d2b04478
AD
173872001-11-28 Akim Demaille <akim@epita.fr>
17388
17389 * src/closure.c (closure): Instead of looping over word in array
17390 then bits in words, loop over bits in array.
17391
2c4c30aa
AD
173922001-11-28 Akim Demaille <akim@epita.fr>
17393
17394 * src/closure.c (closure): No longer optimize the special case
17395 where all the bits of `ruleset[r]' are set to 0, to make the code
17396 clearer.
17397
576890b7
AD
173982001-11-28 Akim Demaille <akim@epita.fr>
17399
17400 * src/closure.c (closure): `r' and `c' are new variables, used to
17401 de-obfuscate accesses to RULESET and CORE.
17402
cb487d7d
AD
174032001-11-28 Akim Demaille <akim@epita.fr>
17404
17405 * src/reduce.c (reduce_print): Use ngettext.
17406 (dump_grammar): Improve the trace accuracy.
17407
6013d43f
AD
174082001-11-28 Akim Demaille <akim@epita.fr>
17409
17410 * src/reduce.c (dump_grammar): Don't translate trace messages.
17411
cb4956ee
AD
174122001-11-28 Akim Demaille <akim@epita.fr>
17413
17414 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
17415 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
17416 as all tags are free'ed afterwards.
17417 From Enrico Scholz.
17418
648185ab
PE
174192001-11-27 Paul Eggert <eggert@twinsun.com>
17420
17421 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
17422 use alloca when we didn't want to, and vice versa.
17423
68254a03
MA
174242001-11-27 Marc Autret <autret_m@epita.fr>
17425
9113b58f
AD
17426 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
17427 initialization.
68254a03
MA
17428 * src/output.c (prepare): Remove its update.
17429
04d843a2
MA
174302001-11-27 Marc Autret <autret_m@epita.fr>
17431
17432 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
17433 Use %error-verbose.
17434
d2079671 174352001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
17436
17437 * src/bison.simple: Remove YYERROR_VERBOSE using.
17438 Use %%error_verbose.
17439 (yyparse): Likewise.
17440 * src/output.c (prepare): Give its final value.
17441 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
17442 * src/getargs.h: Add its extern declaration.
17443 * src/getargs.c (error_verbose_flag): New int.
17444 (getargs): Update to catch new case.
17445 * src/options.c (option_table): 'error-verbose' is a new option.
17446 (shortopts): Update.
17447
e0327bc8
AD
174482001-11-27 Akim Demaille <akim@epita.fr>
17449
17450 * src/system.h: Use intl/libgettext.h.
17451 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
17452
000f1a3c
AD
174532001-11-27 Akim Demaille <akim@epita.fr>
17454
17455 * tests/torture.at (Exploding the Stack Size with Malloc):
17456 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
17457
26cfe0be
AD
174582001-11-27 Akim Demaille <akim@epita.fr>
17459
17460 * src/files.c: Include error.h.
17461 Reported by Hans Aberg.
17462
f6bd5427
MA
174632001-11-26 Marc Autret <autret_m@epita.fr>
17464
d2079671 17465 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
17466 (read_declarations): Add case tok_include.
17467 * src/getargs.h (include): Add its extern definition.
17468 * src/getargs.c (include): New const char *.
17469 (getargs): Add case '-I'.
17470 * src/options.c (option_table): Add include as command line and
17471 percent option.
17472 * src/lex.h (token_t): Add tok_include.
17473
2ca209c1
AD
174742001-11-26 Akim Demaille <akim@epita.fr>
17475
17476 * src/reader.c (readgram): Make sure rules for mid-rule actions
17477 have a lineno equal to that of their host rule.
17478 Reported by Hans Aberg.
17479 * tests/regression.at (Rule Line Numbers): New.
17480
0e41b407
AD
174812001-11-26 Akim Demaille <akim@epita.fr>
17482
17483 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
17484 size_ts.
17485
174862001-11-26 Akim Demaille <akim@epita.fr>
17487
17488 * src/complain.c, src/complain.h (error): Remove, provided by
17489 lib/error.[ch].
17490
e0c40012
AD
174912001-11-26 Akim Demaille <akim@epita.fr>
17492
17493 * src/reader.c (read_declarations): Don't abort on tok_illegal,
17494 issue an error message.
17495 * tests/regression.at (Invalid %directive): New.
17496 Reported by Hans Aberg.
17497
5e147124
AD
174982001-11-26 Akim Demaille <akim@epita.fr>
17499
17500 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
17501 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17502
a034c8b8
AD
175032001-11-26 Akim Demaille <akim@epita.fr>
17504
17505 * src/conflicts.c (conflicts_print): Don't complain at all when
17506 there are no reduce/reduce conflicts, and as many shift/reduce
17507 conflicts as expected.
17508 * tests/regression.at (%expect right): Adjust.
17509
c64a20f3
AD
175102001-11-23 Akim Demaille <akim@epita.fr>
17511
17512 * lib/alloca.c: Update, from fileutils.
17513
5b0d29bb
AD
175142001-11-23 Akim Demaille <akim@epita.fr>
17515
17516 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
17517
722c4bfe
AD
175182001-11-23 Akim Demaille <akim@epita.fr>
17519
17520 * src/system.h: Include alloca.h.
17521 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
17522
6255b435
AD
175232001-11-23 Akim Demaille <akim@epita.fr>
17524
17525 * src/print_graph.c (print_actions): Remove `rule', unused.
17526 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
17527 pacify GCC's signed < unsigned warnings.
17528 * src/closure.c (itemsetsize): Likewise.
17529 * src/reader.c (symbol_list_new): Static.
17530
b29b2ed5
AD
175312001-11-23 Akim Demaille <akim@epita.fr>
17532
17533 Attaching lineno to buckets is stupid, since only one copy of each
17534 symbol is kept, only the line of the first occurrence is kept too.
17535
17536 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
17537 * src/reader.c (rline_allocated): Remove, unused.
17538 (symbol_list): Have a `line' member.
17539 (symbol_list_new): New.
17540 (readgram): Use it.
17541 * src/print.c (print_grammar): Output the rule line numbers.
17542 * tests/regression.at (Solved SR Conflicts)
17543 (Unresolved SR Conflicts): Adjust.
17544 Reported by Hans Aberg.
17545
a81b1d4a
MA
175462001-11-22 Marc Autret <autret_m@epita.fr>
17547
17548 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
17549
c1ecb3c1
MA
175502001-11-22 Marc Autret <autret_m@epita.fr>
17551
17552 * src/muscle_tab.c (muscle_init): Remove initialization of
17553 skeleton muscle.
17554 * src/output.c (output_master_parser): Do it here.
17555
fbe01355
AD
175562001-11-20 Akim Demaille <akim@epita.fr>
17557
17558 * po/sv.po: New.
17559 * configure.in (ALL_LINGUAS): Adjust.
17560 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
17561 longer contains strings to translate.
17562
81e895c0
AD
175632001-11-19 Akim Demaille <akim@epita.fr>
17564
17565 * src/conflicts.c (conflicts_print): Add a missing \n.
17566
6bb1878b
AD
175672001-11-19 Akim Demaille <akim@epita.fr>
17568
17569 * src/nullable.c (nullable_print): New.
17570 (set_nullable): Call it when tracing.
17571 Better locality of variables.
17572
d9ec2d07
AD
175732001-11-19 Akim Demaille <akim@epita.fr>
17574
17575 * src/print.c (print_actions): Better locality of variables.
17576
720e5c1b
AD
175772001-11-19 Akim Demaille <akim@epita.fr>
17578
17579 * src/derives.c (print_derives): Fix and enrich.
17580 * src/closure.c (print_fderives): Likewise.
17581
fb908786
AD
175822001-11-19 Akim Demaille <akim@epita.fr>
17583
17584 * src/closure.c (itemsetend): Remove, replaced with...
17585 (itemsetsize): new.
17586
125ecb56
AD
175872001-11-19 Akim Demaille <akim@epita.fr>
17588
17589 * src/LR0.c (kernel_end): Remove, replaced with...
17590 (kernel_size): new.
17591
d8cf039f
AD
175922001-11-19 Akim Demaille <akim@epita.fr>
17593
17594 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
17595 to clarify.
17596
7bec0760
AD
175972001-11-19 Akim Demaille <akim@epita.fr>
17598
17599 * src/closure.c (closure): Use arrays instead of pointers to clarify.
17600
c87d4863
AD
176012001-11-19 Akim Demaille <akim@epita.fr>
17602
17603 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
17604 trace messages.
17605 * src/LR0.c: Likewise.
17606 (allocate_itemsets): Use arrays instead of pointers to clarify.
17607
9bfe901c
AD
176082001-11-19 Akim Demaille <akim@epita.fr>
17609
17610 * src/getargs.c (statistics_flag): Replace with...
17611 (trace_flag): New.
17612 (longopts): Accept --trace instead of --statistics.
17613 * src/getargs.h, src/options.c: Adjust.
17614 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
17615 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
17616
97db7bd4
AD
176172001-11-19 Akim Demaille <akim@epita.fr>
17618
cc72668c 17619 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
17620 pointers to clarify the code.
17621 (save_reductions, save_shifts): Factor common parts of alternatives.
17622
2c5f66ed
AD
176232001-11-19 Akim Demaille <akim@epita.fr>
17624
17625 * src/LR0.c (new_state, get_state): Complete TRACE code.
17626 * src/closure.c: Include `reader.h' to get `tags', needed by the
17627 trace code.
17628 Rename the conditional DEBUG as TRACE.
17629 Output consistently TRACEs to stderr, not stdout.
17630 * src/derives.c: Likewise.
17631 * src/reduce.c: (inaccessable_symbols): Using if is better style
17632 than goto.
17633 Use `#if TRACE' instead of `#if 0' for tracing code.
17634
300f275f
AD
176352001-11-19 Akim Demaille <akim@epita.fr>
17636
17637 * src/system.h (LIST_FREE, shortcpy): New.
17638 * src/LR0.c: Use them.
17639 * src/output.c (free_itemsets, free_reductions, free_shifts):
17640 Remove, replaced by LIST_FREE.
17641
f59c437a
AD
176422001-11-19 Akim Demaille <akim@epita.fr>
17643
17644 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
17645 (REDUCTIONS_ALLOC): New.
17646 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
17647 allocation.
17648
6986fd9e
AD
176492001-11-19 Akim Demaille <akim@epita.fr>
17650
17651 * src/LR0.c (new_state): Complete trace code.
17652 * src/nullable.c (set_nullable): Don't translate traces.
17653
4bc30f78
AD
176542001-11-19 Akim Demaille <akim@epita.fr>
17655
17656 * src/print_graph.c (print_core): Better locality of variables.
17657 * src/print.c (print_core): Likewise.
17658
08a946e0
AD
176592001-11-19 Akim Demaille <akim@epita.fr>
17660
17661 * src/vcg.c: You do the output, so you are responsible of the
17662 handling of VCG syntax, in particular: use quotearg.
17663 * src/print_graph.c: Don't.
17664 (print_actions): Don't output the actions as part of the nodes,
17665 since that's the job of the edges.
17666 (print_state): Don't output by hand: fill the node description,
9bfe901c 17667 and ask for its output.
08a946e0 17668
f0473484
AD
176692001-11-19 Akim Demaille <akim@epita.fr>
17670
cc72668c
AD
17671 * src/bison.simple (yyparse): When verbosely reporting an error,
17672 no longer put additional quotes around token names.
f0473484
AD
17673 * tests/calc.at: Adjust.
17674
e41dc700
AD
176752001-11-19 Akim Demaille <akim@epita.fr>
17676
17677 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
17678 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
17679 * src/output.c: Adjust.
17680
652a871c
AD
176812001-11-19 Akim Demaille <akim@epita.fr>
17682
17683 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
17684 (rule_t): this.
17685 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
17686
b2ed6e58
AD
176872001-11-19 Akim Demaille <akim@epita.fr>
17688
17689 * src/gram.h (rule_t): New.
17690 (rule_table): New.
17691 (rrhs, rlhs): Remove, part of state_t.
17692 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
17693 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17694 * src/reader.c, src/reduce.c: Adjust.
17695
edad7067
AD
176962001-11-19 Akim Demaille <akim@epita.fr>
17697
17698 * src/reader.c (symbols_output): New, extracted from...
17699 (packsymbols): Here.
17700 (reader): Call it.
17701
3feec034
AD
177022001-11-19 Akim Demaille <akim@epita.fr>
17703
17704 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
17705 (maxrhs): this new function.
17706
ddcd5fdf
AD
177072001-11-19 Akim Demaille <akim@epita.fr>
17708
cc72668c 17709 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
17710 Adjust.
17711
bb527fc2
AD
177122001-11-19 Akim Demaille <akim@epita.fr>
17713
cc72668c 17714 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
17715 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17716 * src/lalr.c: Adjust.
17717
a845a697
AD
177182001-11-19 Akim Demaille <akim@epita.fr>
17719
17720 * src/lalr.c (initialize_LA): Only initialize LA. Let...
17721 (set_state_table): handle the `lookaheads' members.
17722
f004bf6a
AD
177232001-11-19 Akim Demaille <akim@epita.fr>
17724
cc72668c
AD
17725 * src/lalr.h (lookaheads): Removed array, whose contents is now
17726 a member of...
f004bf6a
AD
17727 (state_t): this structure.
17728 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17729 Adjust.
17730
de326cc0
AD
177312001-11-19 Akim Demaille <akim@epita.fr>
17732
cc72668c
AD
17733 * src/lalr.h (consistent): Removed array, whose contents is now
17734 a member of...
de326cc0
AD
17735 (state_t): this structure.
17736 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17737 Adjust.
17738
90b4416b
AD
177392001-11-19 Akim Demaille <akim@epita.fr>
17740
cc72668c
AD
17741 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
17742 contents are now members of...
90b4416b
AD
17743 (state_t): this structure.
17744 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17745 Adjust.
17746
9703cc49
AD
177472001-11-19 Akim Demaille <akim@epita.fr>
17748
17749 * src/lalr.h (state_t): New.
17750 (state_table): Be a state_t * instead of a core **.
17751 (accessing_symbol): Remove, part of state_t.
17752 * src/lalr.c: Adjust.
17753 (set_accessing_symbol): Merge into...
17754 (set_state_table): this.
17755 * src/print_graph.c, src/conflicts.c: Adjust.
17756
d803322e
AD
177572001-11-14 Akim Demaille <akim@epita.fr>
17758
17759 * tests/calc.at, tests/output.at, tests/regression.at,
17760 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
17761 now the tests are run in private dirs, therefore AC_CLEANUP and
17762 family can be simplified to 0-ary.
17763 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
17764 use abs. path to find config.h.
17765 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
17766 stderr, there can be way too much random noise.
17767 Instead pass -Werror to GCC and rely on the exit status.
17768 Reported by Wolfram Wagner.
17769
3d76b07d
AD
177702001-11-14 Akim Demaille <akim@epita.fr>
17771
17772 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
17773 defined only if yyoverflow is defined, to avoid `warning: unused
17774 variable `yyvs1''.
17775 Reported by The Test Suite.
17776
09b503c8
AD
177772001-11-14 Akim Demaille <akim@epita.fr>
17778
17779 * src/print.c: Include reduce.h.
17780 Reported by Hans Aberg.
17781
177822001-11-14 Akim Demaille <akim@epita.fr>
17783
17784 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
17785 Revert a previous patch: these are really const.
17786 * src/conflicts.c (conflict_report): Additional useless pair of
17787 braces to pacify GCC's warnings for `if () if () {} else {}'.
17788 * src/lex.c (parse_percent_token): Replace equal_offset with
17789 arg_offset.
17790 arg is const.
17791 Be sure to strdup `arg' when used, since there is no reason for
17792 token_buffer not to change.
17793
0f37a994
AD
177942001-11-14 Akim Demaille <akim@epita.fr>
17795
17796 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
17797 definition.
17798 * src/main.c (main): Use them.
17799 Suggested by Hans Aberg.
17800
d39d93b8
AD
178012001-11-12 Akim Demaille <akim@epita.fr>
17802
17803 * src/system.h (ngettext): Now that we use ngettext, be sure to
17804 provide a default definition when NLS are not used.
17805
9edcd895
AD
178062001-11-12 Akim Demaille <akim@epita.fr>
17807
17808 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
17809 Use @kbd to denote user input.
17810 (Language and Grammar): ANSIfy the example.
17811 Adjust its layout for info/notinfo.
17812 (Location Tracking Calc): Output error messages to stderr.
17813 Output locations in a more GNUtically correct way.
17814 Fix a couple of Englishos.
17815 Adjust @group/@end group pairs.
17816
7da99ede
AD
178172001-11-12 Akim Demaille <akim@epita.fr>
17818
e3aa65c5 17819 %expect was not functioning at all.
7da99ede
AD
17820
17821 * src/conflicts.c (expected_conflicts): Set to -1.
17822 (conflict_report): Use ngettext.
17823 (conflicts_print): Check %expect and make its violation an error.
17824 * doc/bison.texinfo (Expect Decl): Adjust.
17825 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
17826 * tests/regression.at (%expect not enough, %expect right)
17827 (%expect too much): New.
17828
ba9dda1a
AD
178292001-11-12 Akim Demaille <akim@epita.fr>
17830
17831 * tests/regression.at (Conflicts): Rename as...
17832 (Unresolved SR Conflicts): this.
17833 (Solved SR Conflicts): New.
17834
337c5bd1
AD
178352001-11-12 Akim Demaille <akim@epita.fr>
17836
17837 * src/reduce.c (print_results): Rename as...
17838 (reduce_output): This.
17839 Output to OUT, passed as argument, instead of output_obstack.
17840 (dump_grammar): Likewise.
17841 (reduce_free): New.
17842 Also free V1.
17843 (reduce_grammar): No longer call reduce_output, since...
17844 * src/print.c (print_results): do it.
17845 * src/main.c (main): Call reduce_free;
17846
c73a41af
AD
178472001-11-12 Akim Demaille <akim@epita.fr>
17848
17849 * src/conflicts.c (print_reductions): Accept OUT as argument.
17850 Output to it, not to output_obstack.
17851 * src/print.c (print_actions): Adjust.
17852
0df87bb6
AD
178532001-11-12 Akim Demaille <akim@epita.fr>
17854
17855 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
17856 the result instead of using...
17857 (src_total, rrc_total, src_count, rrc_count): Remove.
17858 (any_conflicts): Remove.
17859 (print_conflicts): Split into...
17860 (conflicts_print, conflicts_output): New.
17861 * src/conflicts.h: Adjust.
17862 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 17863 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
17864 * tests/regression.at (Conflicts): New.
17865 Reported by Tom Lane.
17866
e4d3d4de
AD
178672001-11-12 Akim Demaille <akim@epita.fr>
17868
17869 * tests/regression.at (Invalid input): Remove, duplicate with
17870 ``Invalid input: 1''.
17871
6d7d248e
AD
178722001-11-12 Akim Demaille <akim@epita.fr>
17873
17874 * tests/torture.at (AT_DATA_STACK_TORTURE)
17875 (Exploding the Stack Size with Alloca)
17876 (Exploding the Stack Size with Malloc): New.
17877
e9e4c321
AD
178782001-11-12 Akim Demaille <akim@epita.fr>
17879
17880 * src/bison.simple (YYSTACK_REALLOC): New.
17881 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 17882 Reported by Per Allansson.
e9e4c321 17883
5f7e0832
AD
178842001-11-12 Pascal Bart <pascal.bart@epita.fr>
17885
17886 * src/bison.simple: Define type yystype instead of YYSTYPE, and
17887 define CPP macro, which substitute YYSTYPE by yystype.
17888 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
17889 with yyltype/YYLTYPE. This allows inclusion of the generated
17890 header within the parser if the compiler, such as GGC, accepts
17891 multiple equivalent #defines.
17892 From Akim.
17893
e3f1699f
AD
178942001-11-05 Akim Demaille <akim@epita.fr>
17895
17896 * src/reader.c (symbols_output): New, extracted from...
17897 (packsymbols): here.
17898 (reader): Adjust.
17899
65be0866
AD
179002001-11-05 Akim Demaille <akim@epita.fr>
17901
17902 * src/lex.c (parse_percent_token): s/quotearg/quote/.
17903
e4d910bf
AD
179042001-11-05 Akim Demaille <akim@epita.fr>
17905
17906 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
17907 pattern.
17908
951366c1
AD
179092001-11-05 Akim Demaille <akim@epita.fr>
17910
17911 * src/options.h (struct option_table_struct): set_flags is void*.
17912 * src/options.c (longopts): Support `--output' and `%output'.
17913 (usage): Adjust.
17914 * src/lex.h (tok_setopt): Remove, replaced with...
17915 (tok_intopt, tok_stropt): these new guys.
17916 * src/lex.c (getopt.h): Not needed.
17917 (token_buffer, unlexed_token_buffer): Not const.
17918 (percent_table): Promote `-' over `_' in directive names.
17919 Active `%name-prefix', `file-prefix', and `output'.
17920 (parse_percent_token): Accept possible arguments to directives.
17921 Promote `-' over `_' in directive names.
17922
d8988b2f
AD
179232001-11-04 Akim Demaille <akim@epita.fr>
17924
17925 * doc/bison.texinfo (Decl Summary): Split the list into
17926 `directives for grammars' and `directives for bison'.
17927 Sort'em.
17928 Add description of `%name-prefix', `file-prefix', and `output'.
17929 Promote `-' over `_' in directive names.
17930 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
17931 Simplify the description of `--name-prefix'.
17932 Promote `-' over `_' in directive names.
17933 Promote `--output' over `--output-file'.
17934 Fix the description of `--defines'.
17935 * tests/output.at: Exercise %file-prefix and %output.
17936
6468d18e
AD
179372001-11-02 Akim Demaille <akim@epita.fr>
17938
17939 * doc/refcard.tex: Update.
17940
6b7e85b9
AD
179412001-11-02 Akim Demaille <akim@epita.fr>
17942
17943 * src/symtab.h (SUNDEF): New.
17944 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
17945 stand for `uninitialized', instead of 0.
17946 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
17947 * src/lex.c (lex): Adjust.
17948
17949 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
17950 Number it 0.
17951 Let yylex return it instead of a plain 0.
17952 Reported by Dick Streefland.
17953
cd5aafcf
AD
179542001-11-02 Akim Demaille <akim@epita.fr>
17955
17956 * tests/regression.at (Mixing %token styles): New test.
17957
037ca2f1
AD
179582001-11-02 Akim Demaille <akim@epita.fr>
17959
17960 * src/reader.c (parse_thong_decl): Formatting changes.
17961 (token_translations_init): New, extracted from...
17962 (packsymbols): Here.
17963 Adjust.
17964
270a173c
AD
179652001-11-01 Akim Demaille <akim@epita.fr>
17966
17967 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
17968 Check that `9foo.y' produces correct cpp guards.
17969 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
17970 guards.
17971 Reported by Wwp.
17972
561f9a30
AD
179732001-11-01 Akim Demaille <akim@epita.fr>
17974
17975 * tests/regression.at (Invalid input: 2): New.
17976 * src/lex.c (unlexed_token_buffer): New.
17977 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
17978 too.
17979 Reported by Wwp.
17980
f987e9d2
AD
179812001-11-01 Akim Demaille <akim@epita.fr>
17982
17983 * tests/calc.at: Catch up with 1.30.
17984 * configure.in: Bump to 1.49a.
17985 Adjust to newer Autotest.
17986
0846f581
PB
179872001-10-19 Pascal Bart <pascal.bart@epita.fr>
17988
17989 * src/conflicts.c: Move global variables rrc_total and src_total ...
17990 (print_conflicts): here.
17991 * src/output.c (output): Free global variable user_toknums.
17992 * src/lex.c (token_obstack): Become static.
17993
3c1a79b3
AD
179942001-10-18 Akim Demaille <akim@epita.fr>
17995
17996 * tests/atlocal.in (GCC): Add.
17997 * tests/calc.at: s/m4_match/m4_bmatch/.
17998 s/m4_patsubst/m4_bpatsubst/.
17999 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
18000 * configure.in: AC_SUBST(GCC).
18001
5d52e7d0
MA
180022001-10-14 Marc Autret <autret_m@epita.fr>
18003
18004 * src/options.c (create_long_option_table): Fix.
18005
631aa1d3
AD
180062001-10-10 Akim Demaille <akim@epita.fr>
18007
18008 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
18009
f6ec6d13
AD
180102001-10-04 Akim Demaille <akim@epita.fr>
18011
18012 * src/reader.c (parse_union_decl): Push the caracters in
18013 union_obstack, not attrs_obstack.
18014
342b8b6e
AD
180152001-10-04 Akim Demaille <akim@epita.fr>
18016
18017 Merge in the branch 1.29.
18018
18019 * src/reader.c (packsymbols): Use a temporary obstack for
18020 `%%tokendef', since output_stack is already used elsewhere.
18021
18022 2001-10-02 Akim Demaille <akim@epita.fr>
18023
18024 Bump 1.29d.
18025
18026 2001-10-02 Akim Demaille <akim@epita.fr>
18027
18028 Version 1.29c.
18029
18030 2001-10-02 Akim Demaille <akim@epita.fr>
18031
18032 * tests/regression.at (Invalid CPP headers): New.
18033 From Alexander Belopolsky.
18034 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
18035
18036 2001-10-02 Akim Demaille <akim@epita.fr>
18037
18038 * tests/regression.at (Invalid input): New.
18039 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
18040 Reported by Shura.
18041
18042 2001-10-02 Akim Demaille <akim@epita.fr>
18043
18044 * tests/calc.at: Now that --debug works, the tests must be adjusted.
18045
18046 2001-10-02 Akim Demaille <akim@epita.fr>
18047
18048 * src/output.c (output_parser): Assert `skeleton'.
18049 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
18050 systems.
18051 From Shura.
18052
18053 2001-10-01 Marc Autret <autret_m@epita.fr>
18054
18055 * src/lex.h: Echo modifications.
18056 * src/lex.c (unlex): Parameter is now token_t.
18057 From Hans Aberg.
18058
18059 2001-10-01 Marc Autret <autret_m@epita.fr>
18060
18061 * src/main.c: Include lex.h.
18062 From Hans Aberg.
18063
18064 2001-09-29 Akim Demaille <akim@epita.fr>
18065
18066 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
18067
18068 2001-09-28 Akim Demaille <akim@epita.fr>
18069
18070 * tests/testsuite.at: Update to newer Autotest.
18071 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
18072
18073 2001-09-27 Akim Demaille <akim@epita.fr>
18074
18075 Position independent wrapper.
18076
18077 * tests/bison: Remove.
18078 * tests/bison.in: New.
18079 * configure.in: Adjust.
18080
18081 2001-09-27 Paul Eggert <eggert@twinsun.com>
18082
18083 Port quotearg fixes from tar 1.13.24.
18084
18085 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
18086 tm to be declared.
18087 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
18088 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
18089
18090 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
18091 * m4/mbrtowc.m4: New file.
18092 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
18093 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
18094
18095 2001-09-27 Akim Demaille <akim@epita.fr>
18096
18097 Bump to 1.29c.
18098
18099 2001-09-27 Akim Demaille <akim@epita.fr>
18100
18101 Version 1.29b.
18102
18103 2001-09-25 Akim Demaille <akim@epita.fr>
18104
18105 * src/system.h: Include `xalloc.h'.
18106 Remove it from the C files.
18107 * src/files.c (output_files): Free the obstacks.
18108 * src/lex.c (init_lex): Rename as...
18109 (lex_init): this.
18110 (lex_free): New.
18111 * src/main.c (main): Use it.
18112
18113 2001-09-24 Marc Autret <autret_m@epita.fr>
18114
18115 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
18116 to output informations in fout (FILE*).
18117 (open_graph, close_graph): Likewise.
18118 (output_graph, output_edge, output_node): Likewise.
18119 * src/vcg.h: Update function prototypes.
18120 * src/print_graph.c (print_graph): Open output graph file.
18121 (print_actions): Adjust.
18122 * src/files.h: Remove extern declaration.
18123 * src/files.c: Remove graph_obstack declaration.
18124 (open_files): Remove graph_obstack initialization.
18125 (output_files): Remove graph_obstack saving.
18126
18127 2001-09-24 Marc Autret <autret_m@epita.fr>
18128
18129 * src/files.c (compute_output_file_names): Fix.
18130
18131 2001-09-24 Marc Autret <autret_m@epita.fr>,
18132 Akim Demaille <akim@epita.fr>
18133
18134 * src/reader.c (reader): Remove call to free_symtab ().
18135 * src/main.c (main): Call it here.
18136 Include symtab.h.
18137 * src/conflicts.c (initialize_conflicts): Rename as...
18138 (solve_conflicts): this.
18139 * src/print.c (print_core, print_actions, print_state)
18140 (print_grammar): Dump to a file instead a `output_obstack'.
18141 (print_results): Dump `output_obstack', and then proceed with the
18142 FILE *.
18143 * src/files.c (compute_output_file_names, close_files): New.
18144 (output_files): Adjust.
18145 * src/main.c (main): Adjust.
18146
18147 2001-09-23 Marc Autret <autret_m@epita.fr>
18148
18149 * src/files.c (compute_header_macro): Computes header macro name
18150 from spec_defines_file when given.
18151
18152 2001-09-23 Marc Autret <autret_m@epita.fr>
18153
18154 * src/files.c (output_files): Add default extensions.
18155
18156 2001-09-22 Akim Demaille <akim@epita.fr>
18157
18158 * src/conflicts.c (finalize_conflicts): Rename as...
18159 (free_conflicts): this.
18160
18161 2001-09-22 Akim Demaille <akim@epita.fr>
18162
18163 * src/gram.c (gram_free): Rename back as...
18164 (dummy): this.
18165 (output_token_translations): Free `token_translations'.
18166 * src/symtab.c (free_symtab): Free the tag field.
18167
18168 2001-09-22 Akim Demaille <akim@epita.fr>
18169
18170 Remove `translations' as it is always set to true.
18171
18172 * src/gram.h: Adjust.
18173 * src/reader.c (packsymbols, parse_token_decl): Adjust
18174 * src/print.c (print_grammar): Adjust.
18175 * src/output.c (output_token_translations): Adjust.
18176 * src/lex.c (lex): Adjust.
18177 * src/gram.c: Be sure the set pointers to NULL.
18178 (dummy): Rename as...
18179 (gram_free): this.
18180
18181 2001-09-22 Akim Demaille <akim@epita.fr>
18182
18183 * configure.in: Invoke AM_LIB_DMALLOC.
18184 * src/system.h: Use dmalloc.
18185 * src/LR0.c: Be sure to have pointers initialized to NULL.
18186 (allocate_itemsets): Allocate kernel_items only if needed.
18187
18188 2001-09-22 Akim Demaille <akim@epita.fr>
18189
18190 * configure.in: Bump to 1.29b.
18191 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
18192 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
18193 need xmalloc.c in calc.y.
18194 From Pascal Bart.
18195
18196 2001-09-21 Akim Demaille <akim@epita.fr>
18197
18198 Version 1.29a.
18199 * Makefile.maint, config/config.guess, config/config.sub,
18200 * config/missing: Update from masters.
18201 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
18202 upon package.m4.
18203 * configure.in (ALL_LINGUAS): Add `tr'.
18204
18205 2001-09-21 Akim Demaille <akim@epita.fr>
18206
18207 * tests/Makefile.am (package.m4): Move to...
18208 ($(srcdir)/$(TESTSUITE)): here.
18209
18210 2001-09-20 Akim Demaille <akim@epita.fr>
18211
18212 * src/complain.c: No longer try to be standalone: use system.h.
18213 Don't assume __STDC__ is defined to 1. Just test if it is defined.
18214 * src/complain.h: Likewise.
18215 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
18216 Remove the unused variable `n'.
18217 From Albert Chin-A-Young.
18218
18219 2001-09-18 Marc Autret <autret_m@epita.fr>
18220
18221 * doc/bison.1: Update.
18222 * doc/bison.texinfo (Bison Options): Update --defines and --graph
18223 descriptions.
18224 (Option Cross Key): Update.
18225 Add --graph.
18226
18227 2001-09-18 Marc Autret <autret_m@epita.fr>
18228
18229 * tests/regression.at: New test (comment in %union).
18230
18231 2001-09-18 Marc Autret <autret_m@epita.fr>
18232
18233 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
18234 do that.
18235 Reported by Keith Browne.
18236
18237 2001-09-18 Marc Autret <autret_m@epita.fr>
18238
18239 * tests/output.at: Add tests for --defines and --graph.
18240
18241 2001-09-18 Marc Autret <autret_m@epita.fr>
18242
18243 * tests/output.at: Removes tests of %{header,src}_extension features.
18244
18245 2001-09-18 Akim Demaille <akim@epita.fr>
18246
18247 * tests/Makefile.am (package.m4): New.
18248 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
18249 (_AT_CHECK_CALC_ERROR): Likewise.
18250 Factor the `, ' part of verbose error messages.
18251
18252 2001-09-18 Marc Autret <autret_m@epita.fr>
18253
18254 * src/getargs.c (longopts): Declare --defines and --graph as options
18255 with optional arguments.
18256 * src/files.h: Add extern declarations.
18257 * src/files.c (spec_graph_file, spec_defines_file): New.
18258 (output_files): Update.
18259 Remove CPP-outed code.
18260
18261 2001-09-18 Marc Autret <autret_m@epita.fr>
18262
18263 Turn off %{source,header}_extension feature.
18264
18265 * src/files.c (compute_exts_from_gf): Update.
18266 (compute_exts_from_src): Update.
18267 (output_files): CPP-out useless code.
18268 * src/files.h: Remove {header,source}_extension extern declarations.
18269 * src/reader.c (parse_dquoted_param): CPP-out.
18270 (parse_header_extension_decl): Remove.
18271 (parse_source_extension_decl): Remove.
18272 (read_declarations): Remove cases tok_{hdrext,srcext}.
18273 * src/lex.c (percent_table): Remove {header,source}_extension entries.
18274 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
18275
18276 2001-09-10 Akim Demaille <akim@epita.fr>
18277
18278 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
18279 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
18280 (AT_CHECK_OUTPUT): this.
18281 Merely check ls' exit status, its output is useless.
18282
18283 2001-09-10 Akim Demaille <akim@epita.fr>
18284
18285 * tests/calc.at: Use m4_match.
18286 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
18287
18288 2001-09-10 Marc Autret <autret_m@epita.fr>,
18289 Akim Demaille <akim@epita.fr>
18290
18291 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
18292 enum color_e.
18293 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
18294 to `normal'.
18295 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
18296 * src/lex.h: Adjust prototype.
18297 (token_t): Add `tok_undef'.
18298 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
18299 (parse_percent_token): Now returns token_t.
18300 Add default statement in switch.
18301 (lex): Separate `c' as an input variable, from the token_t result
18302 part.
18303 (unlexed): Is a token_t.
18304
18305 2001-09-10 Akim Demaille <akim@epita.fr>
18306
18307 * configure.in: Bump to 1.29a.
18308
18309 2001-09-07 Akim Demaille <akim@epita.fr>
18310
18311 Version 1.29.
18312
18313 2001-08-30 Akim Demaille <akim@epita.fr>
18314
18315 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
18316 * m4/atconfig.m4: Remove.
18317 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
18318 * tests/bison: New.
18319 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
18320 m4_if, m4_patsubst, and m4_regexp.
18321 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
18322 `input' file instead of echo.
18323
18324 2001-08-29 Akim Demaille <akim@epita.fr>
18325
18326 Bump to 1.28e.
18327
18328 2001-08-29 Akim Demaille <akim@epita.fr>
18329
18330 Version 1.28d.
18331
18332 2001-08-29 Paul Eggert <eggert@twinsun.com>
18333
18334 * src/bison.simple (yyparse): Don't take the address of an
18335 item before the start of an array, as that doesn't conform to
18336 the C Standard.
18337
18338 2001-08-29 Robert Anisko <anisko_r@epita.fr>
18339
18340 * doc/bison.texinfo (Location Tracking Calc): New node.
18341
18342 2001-08-29 Paul Eggert <eggert@twinsun.com>
18343
18344 * src/output.c (output): Do not define const, as this now
18345 causes more problems than it cures.
18346
18347 2001-08-29 Akim Demaille <akim@epita.fr>
18348
18349 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
18350 the nodes.
18351 Be sure to tag the `detailmenu'.
18352
18353 2001-08-29 Akim Demaille <akim@epita.fr>
18354
18355 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
18356 download in a tmp dir.
18357
18358 2001-08-28 Marc Autret <autret_m@epita.fr>
18359
18360 * config/depcomp: New file.
18361
18362 2001-08-28 Marc Autret <autret_m@epita.fr>
18363
18364 * doc/bison.1 (mandoc): Adjust.
18365 From Juan Manuel Guerrero.
18366
18367 2001-08-28 Marc Autret <autret_m@epita.fr>
18368
18369 * src/print_graph.c (print_state): Fix.
18370
18371 2001-08-27 Marc Autret <autret_m@epita.fr>
18372
18373 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
18374 char * members.
18375 Echo modifications to the functions prototypes.
18376 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
18377
18378 2001-08-27 Marc Autret <autret_m@epita.fr>
18379
18380 * src/vcg.c: Include `xalloc.h'.
18381 (add_colorentry): New.
18382 (add_classname): New.
18383 (add_infoname): New.
18384 * src/vcg.h: Add new prototypes.
18385
18386 2001-08-27 Akim Demaille <akim@epita.fr>
18387
18388 * Makefile.maint: Sync. again with CVS Autoconf.
18389
18390 2001-08-27 Akim Demaille <akim@epita.fr>
18391
18392 * Makefile.maint: Formatting changes.
18393 (po-update, cvs-update, update): New targets.
18394 (AMTAR): Remove.
18395
18396 2001-08-27 Akim Demaille <akim@epita.fr>
18397
18398 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18399 * Makefile.maint: Sync. with CVS Autoconf.
18400
18401 2001-08-27 Marc Autret <autret_m@epita.fr>
18402
18403 * src/vcg.h (struct infoname_s): New.
18404 (struct colorentry_s): New.
18405 (graph_s): New fields {vertical,horizontal}_order in structure.
18406 Add `infoname' field.
18407 Add `colorentry' field;
18408 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
18409 (G_HORIZONTAL_ORDER): New.
18410 (G_INFONAME): New.
18411 (G_COLORENTRY): New.
18412 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
18413 Add output of `infoname'.
18414 Add output of `colorentry'.
18415
18416 2001-08-27 Marc Autret <autret_m@epita.fr>
18417
18418 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
18419 This one shadowed a global parameter.
18420
18421 2001-08-24 Marc Autret <autret_m@epita.fr>
18422
18423 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
18424 instead of `unsigned'.
18425 (print_state): Do not call obstack_object_size () in obstack_grow ()
18426 to avoid macro variables shadowing.
18427
18428 2001-08-23 Marc Autret <autret_m@epita.fr>
18429
18430 * src/lex.c (percent_table): Typo: s/naem/name/.
18431 Add graph option.
18432 Normalize new options declarations.
18433
18434 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
18435
18436 * tests/suite.at: Exercise %header_extension and %source_extension.
18437
18438 2001-08-16 Marc Autret <autret_m@epita.fr>
18439
18440 * src/reader.c (parse_dquoted_param): New.
18441 (parse_header_extension_decl): Use it.
18442 (parse_source_extension_decl): Likewise.
18443
18444 2001-08-16 Marc Autret <autret_m@epita.fr>
18445
18446 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
18447 (get_xxxx_str): Use assert () instead of complain ().
18448 Remove return invokations in default cases.
18449 (get_decision_str): Modify default behaviour. Remove second argument.
18450 Echo modifications on calls.
18451 (output_graph): Fix.
18452
18453 2001-08-16 Marc Autret <autret_m@epita.fr>
18454
18455 * src/getargs.c (usage): Update with ``-g, --graph''.
18456
18457 2001-08-16 Marc Autret <autret_m@epita.fr>
18458
18459 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
18460 (Option Cross Key): Likewise.
18461 * doc/bison.1: Update.
18462
1c8c2190
PB
184632001-09-25 Pascal Bart <pascal.bart@epita.fr>
18464
18465 * src/output.c (output_master_parser): Don't finish action_obstack.
18466 (output_parser): Don't care about the muscle action, here.
18467 (prepare): Copy the action_obstack in the action muscle.
18468 (output): Free action_obstack.
18469
180d45ba
PB
184702001-09-23 Pascal Bart <pascal.bart@epita.fr>
18471
18472 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
18473 will contain `%union' declaration.
18474 (parse_union_decl): Delete #line directive output.
18475 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
18476 informations about %union.
18477 (parse_union_decl): Copy the union_obstack in the muscle stype.
18478 * src/bison.simple: Add new #line directive.
18479 Add typdef %%stype YYSTYPE.
18480
c51d1a19
PB
184812001-09-23 Pascal Bart <pascal.bart@epita.fr>
18482
18483 * src/bison.simple: Add new `#line' directive.
18484
6f9344da
PB
184852001-09-22 Pascal Bart <pascal.bart@epita.fr>
18486
18487 * src/bison.simple: New `#line' directive.
18488 * src/output.c (output_parser): Support new dynamic muscle input_line.
18489
652def80
MA
184902001-09-22 Marc Autret <autret_m@epita.fr>
18491
18492 * src/output.c (output_master_parser): New.
18493 (output_parser): Be more re-entrant.
18494
25b222fa
MA
184952001-09-21 Marc Autret <autret_m@epita.fr>
18496
18497 * src/reader.c (copy_definition, parse_union_decl): Update and use
18498 `linef' muscle.
18499 (copy_action): Likewise.
18500 Use obstack_1grow ().
18501 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
18502
6bc35ae5
MA
185032001-09-21 Marc Autret <autret_m@epita.fr>
18504
18505 * src/options.c (option_table): Adjust.
18506 * src/lex.c (parse_percent_token): Fix.
18507
c0629aa1
PB
185082001-09-20 Pascal Bart <pascal.bart@epita.fr>
18509
18510 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 18511
82b6d266
PB
185122001-09-20 Pascal Bart <pascal.bart@epita.fr>
18513
18514 * src/lex.c (parse_percent_token): Change type of variable `tx', which
18515 is now an option_table_struct*.
18516 (option_strcmp): New function option_strcmp.
18517 (parse_percent_token): Call option_strcmp.
18518 * src/getargs.c (xalloc.h, options.h): Include it.
18519 (getargs): Call create_long_option_table.
18520 (getargs): Free longopts at the end of the function.
18521 (shortopts): Move in options.c.
18522 * src/options.c (create_long_option_table): New function. Convert
18523 information from option_table to option structure.
18524 * src/reader.c (options.h): Include it.
18525
18526 * src/Makefile.am: Adjust.
18527 * src/options.c (option_table): Create from longopts and percent_table.
18528 * src/getargs.c (longopts): Delete.
18529 * src/lex.c (struct percent_table_struct): Delete.
18530 (percent_table): Delete.
18531 (options.h): Include it.
18532 * src/options.c: Create.
18533 * src/options.h: Create.
18534 Declare enum opt_access_e.
18535 Define struct option_table_struct.
18536
75f5aaea
MA
185372001-09-20 Marc Autret <autret_m@epita.fr>
18538
18539 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
18540 sections of Bison.
18541
f508cb0a
PB
185422001-09-19 Pascal Bart <pascal.bart@epita.fr>
18543
18544 * src/bison.simple: s/%%filename/%%skeleton.
18545 * src/muscle_tab.c (getargs.h): Include it.
18546 (muscle_init): Insert new muscle skeleton.
18547
13105fc1
PB
185482001-09-18 Pascal Bart <pascal.bart@epita.fr>
18549
18550 * src/output.c (output_parser): Delete unused variable actions_dumped.
18551
b0c4483e
PB
185522001-09-07 Pascal Bart <pascal.bart@epita.fr>
18553
18554 * src/output.c (output): Delete call to reader_output_yylsp.
18555 * src/reader.c (reader): Likewise.
ba0fe3c7 18556 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 18557
11d82f03
MA
185582001-09-02 Marc Autret <autret_m@epita.fr>
18559
18560 * src/reader.c: Include muscle_tab.h.
18561 (parse_union_decl): Update.
18562 (parse_macro_decl): Rename parse_muscle_decl.
18563 Update to use renamed functions and variable.
18564 (read_declarations, copy_action, read_additionnal_code, : Updated
18565 with correct variables and functions names.
18566 (packsymbols, reader): Likewise.
342b8b6e 18567
11d82f03 18568 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 18569
11d82f03
MA
18570 * src/output.c: Include muscle_tab.h
18571 In all functions using macro_insert, change by using muscle_insert ().
18572 (macro_obstack): Rename muscle_obstack.
18573 Echo modifications in the whole file.
18574 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
18575 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
18576 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
18577
18578 * src/muscle_tab.h: Update double inclusion macros.
18579 (macro_entry_s): Rename muscle_entry_s.
18580 Update prototypes.
342b8b6e 18581
11d82f03
MA
18582 * src/muscle_tab.c: Include muscle_tab.h.
18583 Rename macro_tabble to muscle_table.
18584 (mhash1, mhash2, mcmp): Use muscle_entry.
18585 (macro_init): Rename muscle_init. Update.
18586 (macro_insert): Rename muscle_insert. Update.
18587 (macro_find): Rename muscle_find. Update.
18588
18589 * src/main.c: Include muscle_tab.h.
18590 (main): Call muscle_init ().
18591 * src/Makefile.am (bison_SOURCES): Echo modifications.
18592
93a37297
MA
185932001-09-02 Marc Autret <autret_m@epita.fr>
18594
f753cd62 18595 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 18596
f753cd62
MA
18597 * src/muscle_tab.c, src/muscle_tab.h: Add files.
18598
185992001-09-02 Marc Autret <autret_m@epita.fr>
18600
18601 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 18602
682d48cd
PB
186032001-09-01 Pascal Bart <pascal.bart@epita.fr>
18604
342b8b6e 18605 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
18606 filename.
18607
087c8fda
MA
186082001-09-01 Marc Autret <autret_m@epita.fr>
18609
18610 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
18611 to an explicit value to activate the feature. We do it here.
18612
dda680cb
PB
186132001-08-31 Pascal Bart <pascal.bart@epita.fr>
18614
18615 * src/output.c (prepare): Delete the `filename' muscule insertion.
18616 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
18617 (parse_union_decl): Likewise.
18618 * src/macrotab.c (macro_init): Initialize filename by infile.
18619
9e644e64
MA
186202001-08-31 Marc Autret <autret_m@epita.fr>
18621
18622 * src/bison.simple (YYLSP_NEEDED): New definition.
18623 * src/output.c (prepare): Add macro insertion of `locations_flag'
18624
17da6427
PB
186252001-08-31 Pascal Bart <pascal.bart@epita.fr>
18626
18627 * src/output.c (prepare): Delete insertion of previous muscles,
18628 and insert the `prefix' muscles.
18629 * src/macrotab.c (macro_init): Likewise.
18630 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 18631 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
18632 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
18633 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 18634 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
18635 name_prefix.
18636
e8cb70b9
PB
186372001-08-31 Pascal Bart <pascal.bart@epita.fr>
18638
18639 * src/main.c (main): Standardize.
18640 * src/output.c (output_table_data, output_parser): Likewise.
18641 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
18642
63c2d5de
MA
186432001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
18644
342b8b6e 18645 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
18646 %%epilogue.
18647 * src/output.c (output): Rename %%declarations to %%prologue.
18648 * src/bison.simple: Echo modifications.
342b8b6e 18649
d8cb5183
MA
186502001-08-31 Marc Autret <autret_m@epita.fr>
18651
18652 * src/reader.c (readgram): CleanUp.
18653 (output_token_defines): Likewise.
18654 (packsymbols): Likewise.
18655 (reader): Likewise.
18656 * src/output.c (output): CPP-out useless code.
18657
6c686258
PB
186582001-08-31 Pascal Bart <pascal.bart@epita.fr>
18659
342b8b6e 18660 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
18661 output_trailers and output_headers.
18662 * src/output.h: Remove obsolete functions prototypes of output_headers
18663 and output_trailers.
18664
8f451ef7
PB
186652001-08-30 Pascal Bart <pascal.bart@epita.fr>
18666
18667 * src/main.c: Include macrotab.h.
342b8b6e 18668 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
18669 Adjust functions prototypes.
18670 * src/macrotab.c (macro_insert): Constify key and value.
18671 (macro_find): Constify key.
18672 (macro_insert): Include 'xalloc.h'
18673 (macro_insert): Use XMALLOC.
18674 (macro_find): Constify return value.
18675 * src/output.c (output_table_data): Rename table to table_data.
18676 (output_parser): Constify macro_key, macro_value.
18677
997b6fd0 186782001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
18679
18680 * src/reader.c (parse_skel_decl): New.
342b8b6e 18681 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
18682 * src/lex.h (token_t): New token `tok_skel'.
18683 * src/lex.c (percent_table): Add skeleton option entry.
18684 Standardize.
18685
ff48177d
MA
186862001-08-29 Marc Autret <autret_m@epita.fr>
18687
18688 * src/bison.simple: Add %%user_code directive at the end.
18689 * src/reader.c (read_additionnal_code): New.
18690 (reader): Use it.
18691 * src/output.c (output_program): Remove.
18692 (output): Update.
18693
b33160bf
MA
186942001-08-28 Marc Autret <autret_m@epita.fr>
18695
18696 * src/output.c (output_actions): Clean up.
4e5caae2 18697 (output_gram): CPP-out useless code.
b33160bf
MA
18698 * src/reader.c (reader): Clean up, CPP-out useless code.
18699
d1a2daf7
PB
187002001-08-28 Pascal Bart <pascal.bart@epita.fr>
18701
342b8b6e 18702 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 18703 directive.
d1a2daf7
PB
18704 * src/bison.simple: Add `%%definitions'.
18705
2b763dfe
MA
187062001-08-28 Marc Autret <autret_m@epita.fr>
18707
18708 * config/depcomp: New file.
18709
f1a87ef6
PE
187102001-08-27 Paul Eggert <eggert@twinsun.com>
18711
18712 * src/bison.simple (yyparse): Don't take the address of an
18713 item before the start of an array, as that doesn't conform to
18714 the C Standard.
18715
82e236e2
RA
187162001-08-27 Robert Anisko <robert.anisko@epita.fr>
18717
f1a87ef6 18718 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
18719 obstack. It was done too late here.
18720
18721 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
18722 completely wrong.
18723 (reader): Initialize the macro obstack here, since we need it to grow
18724 '%define' directives.
18725
18726 * src/reader.h: Declare the macro obstack as extern.
18727
b0cfa28a
RA
187282001-08-27 Robert Anisko <robert.anisko@epita.fr>
18729
18730 * src/output.c (output_parser): Fix. Store single '%' characters in
18731 the output obstack instead of throwing them away.
18732
6fc74234
AD
187332001-08-27 Akim Demaille <akim@epita.fr>
18734
18735 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18736
9c76d118
RA
187372001-08-25 Robert Anisko <robert.anisko@epita.fr>
18738
18739 * lib/Makefile.am: Adjust.
18740
a8289c62
RA
187412001-08-25 Robert Anisko <robert.anisko@epita.fr>
18742
18743 * src/bison.simple: Update and add '%%' directives.
18744
b6610515
RA
187452001-08-25 Robert Anisko <robert.anisko@epita.fr>
18746
18747 * src/reader.c (reader): Remove calls to 'output_headers' and
18748 'output_trailers'. Remove some C output.
18749 (readgram): Disable a piece of code that was writing a default
18750 definition for 'YYSTYPE'.
18751 (reader_output_yylsp): Remove.
18752 (packsymbols): Output token defintions to a macro.
18753 (copy_definition): Disable C output.
6fc74234 18754
b6610515
RA
18755 * src/reader.c (parse_macro_decl): New function used to parse macro
18756 declarations.
18757 (copy_string2): Put the body of copy_string into this new function.
18758 Add a parameter to let the caller choose whether he wants to copy the
18759 string delimiters or not.
18760 (copy_string): Be a simple call to copy_string2 with the last argument
18761 bound to true.
18762 (read_declarations): Add case for macro definition.
18763 (copy_identifier): New.
6fc74234 18764 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
18765 rather than lex.
18766
26f609ff
RA
187672001-08-25 Robert Anisko <robert.anisko@epita.fr>
18768
18769 * src/output.c (prepare): Add prefixed names.
18770 (output_parser): Output semantic actions.
18771 (output_parser): Fix bug on '%%line' directives.
6fc74234 18772
26f609ff
RA
18773 * src/output.c (output_headers): Remove. The C code printed by this
18774 function should now be in the skeletons.
18775 (output_trailers): Remove.
18776 (output): Disable call to 'reader_output_yylsp'.
18777 (output_rule_data): Do not output tables to the table obstack.
18778
18779 * src/output.c: Remove some C dedicated output.
18780 Improve the use of macro and output obstacks.
18781 (output_defines): Remove.
6fc74234 18782
26f609ff
RA
18783 * src/output.c (output_token_translations): Associate 'translate'
18784 table with a macro. No output to the table obstack.
18785 (output_gram): Same for 'rhs' and 'prhs'.
18786 (output_stos): Same for 'stos'.
18787 (output_rule_data): Same for 'r1' and 'r2'.
18788 (token_actions): Same for 'defact'.
18789 (goto_actions): Same for 'defgoto'.
18790 (output_base): Same for 'pact' and 'pgoto'.
18791 (output_table): Same for 'table'.
18792 (output_check): Same for 'check'.
6fc74234 18793
26f609ff
RA
18794 * src/output.c (output_table_data): New function.
18795 (output_short_table): Remove.
18796 (output_short_or_char_table): Remove.
6fc74234 18797
26f609ff
RA
18798 * src/output.c (output_parser): Replace most of the skeleton copy code
18799 with something new. Skeletons are now processed character by character
18800 rather than line by line, and Bison looks for '%%' macros. This is the
18801 first step in making Bison's output process (a lot) more flexible.
18802 (output_parser): Use the macro table.
18803
6f43b113
RA
188042001-08-25 Robert Anisko <robert.anisko@epita.fr>
18805
18806 * src/main.c (main): Initialize the macro table.
18807
dd3127cf
RA
188082001-08-25 Robert Anisko <robert.anisko@epita.fr>
18809
18810 * src/lex.c (percent_table): Add tok_define.
18811 * src/lex.h: Add tok_define.
18812
aa321494
RA
188132001-08-25 Robert Anisko <robert.anisko@epita.fr>
18814
18815 * src/macrotab.c: New file.
18816 * src/macrotab.h: New file.
18817 * src/Makefile.am: Update.
18818
68bd3b6b
RA
188192001-08-25 Robert Anisko <robert.anisko@epita.fr>
18820
18821 * lib/hash.c: New file.
18822 * lib/hash.h: New file.
18823 * lib/Makefile.am: Update.
18824
45f8dd1e
AD
188252001-08-15 Akim Demaille <akim@epita.fr>
18826
18827 Version 1.28c.
18828
40a64a7a 188292001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
18830
18831 * src/reader.c (readgram): Indent output macro YYSTYPE.
18832 (packsymbols): Likewise.
18833 (output_token_defines): Likewise.
18834 * src/files.c: Standardize.
18835 (compute_header_macro): New.
18836 (defines_obstack_save): New. Use compute_header_macro.
18837 (output_files): Update. Use defines_obstack_save.
18838
f9a8293a
AD
188392001-08-15 Akim Demaille <akim@epita.fr>
18840
18841 * doc/bison.texinfo (Table of Symbols): Document
18842 YYSTACK_USE_ALLOCA.
18843
150ca7a7
AD
188442001-08-15 Akim Demaille <akim@epita.fr>
18845
18846 * missing: Update from CVS Automake.
18847 * config/config.guess, config/config.sub, config/texinfo.tex:
18848 Update from gnu.org.
18849
69b5cec4
AD
188502001-08-15 Akim Demaille <akim@epita.fr>
18851
18852 * Makefile.maint: Sync with CVS Autoconf.
18853
f2b5126e
PB
188542001-08-14 Pascal Bart <pascal.bart@epita.fr>
18855
69b5cec4 18856 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
18857 `fdl.texi'.
18858 * doc/fdl.texi: Add to package.
18859
4ecbf796
MA
188602001-08-14 Marc Autret <autret_m@epita.fr>
18861
18862 Turn on %{source,header}_extension features.
18863
69b5cec4 18864 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
18865 source_extension.
18866 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 18867 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
18868 between options.
18869
95fb5662
MA
188702001-08-14 Marc Autret <autret_m@epita.fr>
18871
18872 * src/files.c (compute_base_names): Add extensions computing when
18873 `--file-prefix' used.
18874 Standardize function calls.
18875
78d09da9
MA
188762001-08-13 Marc Autret <autret_m@epita.fr>
18877
69b5cec4 18878 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
18879 defining it (defined but null disables alloca).
18880
5a009f2c
MA
188812001-08-13 Marc Autret <autret_m@epita.fr>
18882
18883 * src/bison.simple (_yy_memcpy): CPP reformat.
18884
1e41465a
PB
188852001-08-13 Pascal Bart <pascal.bart@epita.fr>
18886
18887 * tests/atconfig.in (CPPFLAGS): Fix.
18888
c67a198d
PB
188892001-08-10 Pascal Bart <pascal.bart@epita.fr>
18890
79282c6c 18891 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
18892 `gpl.texi'.
18893 * doc/gpl.texi: Add to package.
18894
09a6de7e
MA
188952001-08-10 Marc Autret <autret_m@epita.fr>
18896
18897 * src/print_graph.h: Fix.
18898 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
18899
b77b9ee0
AD
189002001-08-10 Akim Demaille <akim@epita.fr>
18901
18902 * src/system.h: Provide default declarations for stpcpy, strndup,
18903 and strnlen.
18904
3e259915
MA
189052001-08-10 Robert Anisko <anisko_r@epita.fr>
18906
18907 * doc/bison.texinfo (Locations): Update @$ stuff.
18908
ca96bc2d
MA
189092001-08-09 Robert Anisko <anisko_r@epita.fr>
18910
18911 * src/bison.simple (YYLLOC_DEFAULT): Update.
18912 (yyparse): Adjust.
18913
fdc6758b
MA
189142001-08-08 Marc Autret <autret_m@epita.fr>
18915
b77b9ee0 18916 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
18917 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
18918 Reported by Fabrice Bauzac.
957d4dbf 18919
600cad3b
MA
189202001-08-08 Marc Autret <autret_m@epita.fr>
18921
18922 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
18923 * src/vcg.c (output_node): Fix.
18924 * src/vcg.h: Cleanup.
18925 * src/print_graph.c: Add comments.
b77b9ee0 18926 (node_output_size): New global variable. Simplify the formatting of
600cad3b 18927 the VCG graph output.
b77b9ee0 18928 (print_actions): Unused code is now used. It notifies the final state
600cad3b 18929 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 18930 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
18931 blue.
18932 Get the current node name and node_obstack by argument.
18933 (node_obstack): New variable.
18934 (print_state): Manage node_obstack.
18935 (print_core): Use node_obstack given by argument.
18936 A node is not only computed here but in print_actions also.
18937 (print_graph): CPP out useless code instead of commenting it.
18938
976e528f
AD
189392001-08-07 Pascal Bart <pascal.bart@epita.fr>
18940
18941 * tests/atconfig.in (CPPFLAGS): Fix.
18942
20e8e5ca
AD
189432001-08-07 Akim Demaille <akim@epita.fr>
18944
18945 * src/print_graph.c (quote): New.
18946 (print_core): Use it.
18947
957d4dbf 189482001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 18949
3e3da797
AD
18950 * src/vcg.c (complain.h): Include it.
18951 Unepitaize `return' invocations.
c4b66126 18952 [NDEBUG] (main): Remove.
79282c6c 18953 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
18954 * src/files.c (open_files): Initialize graph_obstack.
18955 * src/print_graph.c (print_actions): CPP out useless code.
18956 (print_core): Don't output the last `\n' in labels.
18957 Use `quote'.
18958 * src/files.c (output_files): Output the VCG file.
18959 * src/main.c (main): Invoke print_graph ();
3e3da797 18960
957d4dbf 189612001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
18962
18963 Automaton VCG graph output.
18964 Using option ``-g'' or long option ``--graph'', you can generate
18965 a gram_filename.vcg file containing a VCG description of the LALR (1)
18966 automaton of your grammar.
18967
18968 * src/main.c: Call to print_graph() function.
18969 * src/getargs.h: Update.
18970 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
18971 (graph_flag): New flag.
18972 (longopts): Update.
18973 (getargs): Add case `g'.
18974 * src/files.c (graph_obstack): New obstack struct.
18975 (open_files): Initialize new obstack.
18976 (output_files): Saves graph_obstack if required.
18977 * src/files.h (graph_obstack): New extern declaration.
18978 * src/Makefile.am: Add new source files.
18979
927c1557 189802001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
18981
18982 * src/print_graph.c, src/print_graph.h (graph): New.
18983 * src/vcg.h: New file.
18984 * src/vcg.c: New file, VCG graph handling.
18985
7333d403
AD
189862001-08-06 Marc Autret <autret_m@epita.fr>
18987
18988 Add of %source_extension and %header_extension which specify
18989 the source or/and the header output file extension.
18990
18991 * src/files.c (compute_base_names): Remove initialisation of
18992 src_extension and header_extension.
18993 (compute_exts_from_gf): Update.
18994 (compute_exts_from_src): Update.
18995 (output_files): Update.
18996 * src/reader.c (parse_header_extension_decl): New.
18997 (parse_source_extension_decl): New.
18998 (read_declarations): New case statements for the new tokens.
18999 * src/lex.c (percent_table): Add entries for %source_extension
19000 and %header_extension.
19001 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
19002
84163231
AD
190032001-08-06 Marc Autret <autret_m@epita.fr>
19004
19005 * configure.in: Bump to 1.28c.
19006 * doc/bison.texinfo: Texinfo thingies.
19007
8303fc42
AD
190082001-08-04 Pascal Bart <pascal.bart@epita.fr>
19009
19010 * tests/atconfig.in (CPPFLAGS): Add.
19011 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
19012
70a84437
AD
190132001-08-03 Akim Demaille <akim@epita.fr>
19014
19015 Version 1.28b.
19016
2ce10144
AD
190172001-08-03 Akim Demaille <akim@epita.fr>
19018
19019 * tests/Makefile.am (check-local): Ship testsuite.
19020 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
19021 Include `string.h'.
19022
1e3e4bc1
AD
190232001-08-03 Akim Demaille <akim@epita.fr>
19024
19025 * configure.in: Try using -Wformat when compiling.
19026
42b45b7f
AD
190272001-08-03 Akim Demaille <akim@epita.fr>
19028
19029 * configure.in: Bump to 1.28b.
19030
8f13fe33
AD
190312001-08-03 Akim Demaille <akim@epita.fr>
19032
19033 * src/complain.c: Adjust strerror_r portability issues.
19034
b37ba92c
AD
190352001-08-03 Akim Demaille <akim@epita.fr>
19036
19037 Version 1.28a.
19038
b0ce6046
AD
190392001-08-03 Akim Demaille <akim@epita.fr>
19040
19041 * src/getargs.c, src/getarg.h (skeleton)): Constify.
19042 * src/lex.c (literalchar): Avoid name clashes on `buf'.
19043 * src/getargs.c: Include complain.h.
19044 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
19045 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
19046
d01c415b
AD
190472001-08-03 Akim Demaille <akim@epita.fr>
19048
19049 * src/reader.c (readgram): Display hidden chars in error messages.
19050
459dd1a6
AD
190512001-08-03 Akim Demaille <akim@epita.fr>
19052
19053 Update to gettext 0.10.39.
19054
53b74c0c
AD
190552001-08-03 Akim Demaille <akim@epita.fr>
19056
19057 * lib/strspn.c: New.
19058
234a3be3
AD
190592001-08-01 Marc Autret <autret_m@epita.fr>
19060
19061 * doc/bison.texinfo: Update.
19062 * doc/bison.1 (mandoc): Update.
19063 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
19064 * src/files.c: Support output files extensions computing.
19065 (src_extension): New static variable.
19066 (header_extension): New static variable.
19067 (tr): New function.
19068 (get_extension_index): New function, gets the index of an extension
19069 filename in a string.
19070 (compute_exts_from_gf): New function, computes extensions from the
19071 grammar file extension.
19072 (compute_exts_from_src): New functions, computes extensions from the
19073 C source file extension, file given by ``-o'' option.
19074 (compute_base_names): Update.
19075 (output_files): Update.
19076
847bf1f5
AD
190772001-08-01 Robert Anisko <anisko_r@epita.fr>
19078
d995fee7 19079 * doc/bison.texi: Document @$.
847bf1f5
AD
19080 (Locations): New section.
19081
d074a105
AD
190822001-07-18 Akim Demaille <akim@epita.fr>
19083
19084 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
19085 * config/prev-version.txt, config/move-if-change: New.
19086 * Makefile.am: Adjust.
19087
3419715d
AD
190882001-07-08 Pascal Bart <pascal.bart@epita.fr>
19089
19090 * src/bison.simple (yyparse): Suppress warning `comparaison
19091 between signed and unsigned'.
19092
62ab6972
AD
190932001-07-05 Pascal Bart <pascal.bart@epita.fr>
19094
19095 * src/getargs.h (raw_flag): Remove.
19096 * src/getargs.c: Die on `-r'/`--raw'.
19097 * src/lex.c (parse_percent_token): Die on `%raw'.
19098 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
19099 * tests/calc.at: Suppress test with option `--raw'.
19100
1e24cc5b
AD
191012001-07-14 Akim Demaille <akim@epita.fr>
19102
19103 * config/: New.
19104 * configure.in: Require Autoconf 2.50.
19105 Update to gettext 0.10.38.
19106
32dfccf8
AD
191072001-03-16 Akim Demaille <akim@epita.fr>
19108
19109 * doc/bison.texinfo: ANSIfy the examples.
19110
cd5bd6ac
AD
191112001-03-16 Akim Demaille <akim@epita.fr>
19112
19113 * getargs.c (skeleton): New variable.
19114 (longopts): --skeleton is a new option.
19115 (shortopts, getargs): -S is a new option.
19116 * getargs.h: Declare skeleton.
19117 * output.c (output_parser): Use it.
19118
5141b016
AD
191192001-03-16 Akim Demaille <akim@epita.fr>
19120
19121 * m4/strerror_r.m4: New.
19122 * m4/error.m4: Run AC_FUNC_STRERROR_R.
19123 * lib/error.h, lib/error.c: Update.
19124
447992b9
AD
191252001-03-16 Akim Demaille <akim@epita.fr>
19126
19127 * src/getargs.c (longopts): Clean up.
19128
274d42ce
AD
191292001-02-21 Akim Demaille <akim@epita.fr>
19130
19131 * src/reader.c (gensym): `gensym_count' is your own.
19132 Use a static buf to create the symbol name, as token_buffer is no
19133 longer a buffer.
19134
22c821f3
AD
191352001-02-08 Akim Demaille <akim@epita.fr>
19136
19137 * src/conflicts.c (conflict_report): Be sure not to append to res
19138 between two calls, which could happen if both first sprintf were
19139 skipped, but not the first cp += strlen.
19140
18569462
AD
191412001-02-08 Akim Demaille <akim@epita.fr>
19142
19143 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
19144 New, from fileutils 4.0.37.
19145 * configure.in: Require Autoconf 2.49c. I took some time before
19146 making this decision. This is the only way out for portability
19147 issues in Bison, it would mean way too much duplicate effort to
19148 import in Bison features implemented in 2.49c since 2.13.
19149 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
19150
0d8f3c8a
AD
191512001-02-02 Akim Demaille <akim@epita.fr>
19152
19153 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 19154 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 19155
f17bcd1f
AD
191562001-01-19 Akim Demaille <akim@epita.fr>
19157
19158 Get rid of the ad hoc handling of token_buffer in the scanner: use
19159 the obstacks.
19160
19161 * src/lex.c (token_obstack): New.
19162 (init_lex): Initialize it. No longer call...
19163 (grow_token_buffer): this. Remove it.
19164 Adjust all the places which used it to use the obstack.
19165
511e79b3
AD
191662001-01-19 Akim Demaille <akim@epita.fr>
19167
19168 * src/lex.h: Rename all the tokens:
19169 s/\bENDFILE\b/tok_eof/g;
19170 s/\bIDENTIFIER\b/tok_identifier/g;
19171 etc.
19172 Let them be enums, not #define, to ease debugging.
19173 Adjust all the code.
19174
0d6508ef
AD
191752001-01-18 Akim Demaille <akim@epita.fr>
19176
19177 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
19178 * src/lex.c (maxtoken, grow_token_buffer): Static.
19179
6deb4447
AD
191802001-01-18 Akim Demaille <akim@epita.fr>
19181
19182 Since we now use obstacks, more % directives can be enabled.
19183
19184 * src/lex.c (percent_table): Also accept `%yacc',
19185 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
19186 `%debug'.
19187 Handle the actions for `%semantic_parser' and `%pure_parser' here,
19188 instead of returning a token.
19189 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
19190 * src/reader.c (read_declarations): Adjust.
19191 * src/files.c (open_files): Don't call `compute_base_names', don't
19192 compute `attrsfile' since they depend upon data which might be
19193 *in* the input file now.
19194 (output_files): Do it here.
19195 * src/output.c (output_headers): Document the fact that this patch
19196 introduces a guaranteed SEGV for semantic parsers.
19197 * doc/bison.texinfo: Document them.
19198 * tests/suite.at: Exercise these %options.
19199
ff4423cc
AD
192002000-12-20 Akim Demaille <akim@epita.fr>
19201
19202 Also handle the output file (--verbose) with obstacks.
19203
19204 * files.c (foutput): Remove.
19205 (output_obstack): New.
19206 Adjust all dependencies.
19207 * src/conflicts.c: Return a string.
19208 * src/system.h (obstack_grow_string): Rename as...
19209 (obstack_sgrow): this. Be ready to work with non literals.
19210 (obstack_fgrow4): New.
19211
956dba3a
AD
192122000-12-20 Akim Demaille <akim@epita.fr>
19213
19214 * src/files.c (open_files): Fix the computation of short_base_name
19215 in the case of `-o foo.tab.c'.
19216
337bab46
AD
192172000-12-20 Akim Demaille <akim@epita.fr>
19218
19219 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
19220 (copy_dollar): Now that everything uses obstacks, get rid of the
19221 FILE * parameters.
19222
5d3214b8
AD
192232000-12-20 Akim Demaille <akim@epita.fr>
19224
19225 * src/files.c (open_files): Actually the `.output' file is based
19226 on the short_base_name, not base_name.
19227 * tests/suite.at (Checking output file names): Adjust.
19228
29092a57
AD
192292000-12-20 Akim Demaille <akim@epita.fr>
19230
19231 * src/bison.s1: Remove, we now use directly...
19232 * src/bison.simple: this.
19233 * src/Makefile.am: Use pkgdata instead of data.
19234
ea5607fd
AD
192352000-12-20 Akim Demaille <akim@epita.fr>
19236
19237 * src/files.c (guard_obstack): New.
19238 (open_files): Initialize it.
19239 (output_files): Dump it...
19240 * src/files.h: Export it.
19241 * src/reader.c (copy_guard): Use it.
19242
27110317
AD
192432000-12-19 Akim Demaille <akim@epita.fr>
19244
19245 * src/files.c (outfile, defsfile, actfile): Removed as global
19246 vars.
19247 (open_files): Don't compute them.
19248 (output_files): Adjust.
19249 (base_name, short_base_name): Be global.
19250 Adjust dependencies.
19251
19c50364
AD
192522000-12-19 Akim Demaille <akim@epita.fr>
19253
19254 * src/files.c (strsuffix): New.
19255 (stringappend): Be just like strcat but allocate.
19256 (base_names): Eve out from open_files.
19257 Try to simplify the rather hairy computation of base_name and
19258 short_base_name.
19259 (open_files): Use it.
19260 * tests/suite.at (Checking output file names): New test.
19261
573c1d9f
AD
192622000-12-19 Akim Demaille <akim@epita.fr>
19263
19264 * src/system.h (obstack_grow_literal_string): Rename as...
19265 (obstack_grow_string): this.
19266 * src/output.c (output_parser): Recognize `%% actions' instead of
19267 `$'.
19268 * src/bison.s1: s/$/%% actions/.
19269 * src/bison.hairy: Likewise.
19270
ef7ddedd
AD
192712000-12-19 Akim Demaille <akim@epita.fr>
19272
19273 * src/output.c (output_parser): Compute the `#line' lines when
19274 there are.
19275 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
19276 Suggested by Hans Aberg.
19277
ff61dabd
AD
192782000-12-19 Akim Demaille <akim@epita.fr>
19279
19280 Let the handling of the skeleton files be local to the procedures
19281 that use it.
19282
19283 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
19284 longer static.
19285 (fparser, open_extra_files): Remove.
19286 (open_files, output_files): Don't take care of fparser.
19287 * src/files.h: Adjust.
19288 * src/output.c (output_parser): Open and close the file to the
19289 skeleton.
19290 * src/reader.c (read_declarations): When %semantic_parser, open
19291 fguard.
19292
55b96341
AD
192932000-12-19 Akim Demaille <akim@epita.fr>
19294
19295 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
19296 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
19297
358c15b7
AD
192982000-12-19 Akim Demaille <akim@epita.fr>
19299
19300 * src/files.c (open_files): Yipee! We no longer need all the code
19301 looking for `/tmp' since we have no tmp file.
19302
7de3329e
AD
193032000-12-19 Akim Demaille <akim@epita.fr>
19304
19305 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
19306 New macros.
19307 * src/files.c (open_files): Less dependency on MSDOS etc.
19308
3abcd459
AD
193092000-12-14 Akim Demaille <akim@epita.fr>
19310
19311 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
19312 Provide a default definition.
19313 Use it when executing the default @ action.
19314 * src/reader.c (reader_output_yylsp): No longer include
19315 `timestamp' and `text' in the default YYLTYPE.
19316
2a91a95e
AD
193172000-12-12 Akim Demaille <akim@epita.fr>
19318
19319 * src/reader.c (copy_definition, parse_union_decl, copy_action)
19320 (copy_guard): Quote the file names.
19321 Reported by Laurent Mascherpa.
19322
14d3eb9b
AD
193232000-12-12 Akim Demaille <akim@epita.fr>
19324
19325 * src/output.c (output_headers, output_program, output): Be sure
19326 to escape special characters when outputting filenames.
19327 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
19328 (output_headers): Don't depend on them, Use ACTSTR.
19329
d7045ec6
AD
193302000-11-17 Akim Demaille <akim@epita.fr>
19331
19332 * lib/obstack.h: Formatting changes.
19333 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
19334 prevents type checking.
19335 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
19336 cast the value to (void *): assigning a `foo *' to a `void *'
19337 variable is valid.
19338 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
19339 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
19340 append characters.
19341
6fd54b73
AD
193422000-11-17 Akim Demaille <akim@epita.fr>
19343
19344 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
19345 as...
19346 (suite.m4, regression.m4, calc.m4): these.
19347 * tests/atgeneral.m4: Update from CVS Autoconf.
19348
4c50eae6
AD
193492000-11-17 Akim Demaille <akim@epita.fr>
19350
19351 * tests/regression.m4 (%union and --defines): New test,
19352 demonstrating a current bug in the obstack implementation.
19353
a35f64ea
AD
193542000-11-17 Akim Demaille <akim@epita.fr>
19355
19356 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
19357 macros.
19358 Use them to declare the variables which are global or local to
19359 `yyparse'.
19360
7de23534
AD
193612000-11-17 Akim Demaille <akim@epita.fr>
19362
19363 * acconfig.h: Remove, no longer used.
19364
aa7815f5
AD
193652000-11-07 Akim Demaille <akim@epita.fr>
19366
19367 * src: s/Copyright (C)/Copyright/g.
19368
5af1f549
AD
193692000-11-07 Akim Demaille <akim@epita.fr>
19370
19371 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
19372 defining.
19373 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
19374
553e2b22
AD
193752000-11-07 Akim Demaille <akim@epita.fr>
19376
19377 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
19378 Merge in a single CPP if/else.
19379
8a4f41d6
AD
193802000-11-07 Akim Demaille <akim@epita.fr>
19381
19382 * src/output.c (output): Remove useless variables.
19383 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
19384 argument `data' for consistency with the prototypes.
19385 Qualify it `const'.
19386 (obstack_copy, obstack_copy0): Rename the second argument as
19387 `address' for consistency. Qualify it `const'.
19388 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
19389 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
19390 `const' their input argument (`data' or `address').
19391 Adjust the corresponding macros to include `const' in casts.
19392
095a3fb5
AD
193932000-11-03 Akim Demaille <akim@epita.fr>
19394
19395 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
19396 s/PFILE1/BISON_HAIRY/.
19397 Adjust dependencies.
19398
d1cdce7c
AD
193992000-11-03 Akim Demaille <akim@epita.fr>
19400
090c5ebf 19401 For some reason, this was not applied.
d1cdce7c
AD
19402
19403 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
19404 `unlink': it's no longer used.
19405
9311529b
AD
194062000-11-03 Akim Demaille <akim@epita.fr>
19407
19408 * src/files.c (skeleton_find): New function, eved out of...
19409 (open_files, open_extra_files): here.
19410
d8880f69
AD
194112000-11-03 Akim Demaille <akim@epita.fr>
19412
19413 Don't use `atexit'.
19414
19415 * src/files.c (obstack_save): New function.
19416 (done): Rename as...
19417 (output_files): this.
19418 Use `obstack_save'.
19419 * src/main.c (main): Don't use `atexit' to register `done', since
19420 it no longer has to remove tmp files, just call `output_files'
19421 when there are no errors.
19422
0dbb648e
AD
194232000-11-02 Akim Demaille <akim@epita.fr>
19424
19425 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
19426 `unlink': it's no longer used.
19427 * src/files.h: Formatting changes.
19428
896fe5c1
AD
194292000-11-02 Akim Demaille <akim@epita.fr>
19430
19431 Remove the last uses of mktemp and unlink/delete.
19432
19433 * src/files.c (fdefines, ftable): Removed.
19434 (defines_ostack, table_obstack): New.
19435 Adjust dependencies of the former into uses of the latter.
19436 * src/output.c (output_short_or_char_table, output_short_table):
19437 Convert to using obstacks.
19438 * src/reader.c (copy_comment2): Accept one FILE * and two
19439 obstacks.
19440 (output_token_defines, reader_output_yylsp): Use obstacks.
19441 * src/system.h (obstack_fgrow3): New.
1f65350a 19442 * po/POTFILES.in: Adjust.
896fe5c1 19443
dd60faec
AD
194442000-11-01 Akim Demaille <akim@epita.fr>
19445
19446 Change each use of `fattrs' into a use of `attrs_obstack'.
19447
19448 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
19449 * src/files.c (fattrs): Remove.
19450 (attrs_obstack): New.
19451 Adjust all dependencies.
19452 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
19453
8c7ebe49
AD
194542000-11-01 Akim Demaille <akim@epita.fr>
19455
19456 Introduce obstacks.
19457 Change each use of `faction' into a use of `action_obstack'.
19458
19459 * lib/obstack.h, lib/obstack.c: New files.
19460 * src/files.c (faction): Remove.
19461 (action_obstack): New.
19462 Adjust all dependencies.
19463
77aee789
AD
194642000-10-20 Akim Demaille <akim@epita.fr>
19465
19466 * lib/quote.h (PARAMS): New macro. Use it.
19467
43591cec
AD
194682000-10-16 Akim Demaille <akim@epita.fr>
19469
19470 * src/output.c (output_short_or_char_table): New function.
19471 (output_short_table, output_token_translations): Use it.
19472 (goto_actions): Use output_short_table.
19473
1e9798d5
AD
194742000-10-16 Akim Demaille <akim@epita.fr>
19475
19476 * src/symtab.c (bucket_new): New function.
19477 (getsym): Use it.
19478
19479 * src/output.c (output_short_table): New argument to display the
19480 comment associated with the table.
19481 Adjust dependencies.
19482 (output_gram): Use it.
19483 (output_rule_data): Nicer output layout for YYTNAME.
19484
f282676b
AD
194852000-10-16 Akim Demaille <akim@epita.fr>
19486
19487 * src/lex.c (read_typename): New function.
19488 (lex): Use it.
19489 * src/reader.c (copy_dollar): Likewise.
19490
550a72a3
AD
194912000-10-16 Akim Demaille <akim@epita.fr>
19492
19493 * src/reader.c (copy_comment2): Expect the input stream to be on
19494 the `/' which is suspected to open a comment, instead of being
19495 called after `//' or `/*' was read.
19496 (copy_comment, copy_definition, parse_union_decl, copy_action)
19497 (copy_guard): Adjust.
19498
131e2fef
AD
194992000-10-16 Akim Demaille <akim@epita.fr>
19500
19501 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
19502 `read_signed_integer'.
19503
79282c5a
AD
195042000-10-16 Akim Demaille <akim@epita.fr>
19505
19506 * src/reader.c (copy_dollar): New function.
19507 (copy_guard, copy_action): Use it.
19508
ff4a34be
AD
195092000-10-16 Akim Demaille <akim@epita.fr>
19510
19511 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
19512 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
19513 New files, from Fileutils 4.0.27.
19514 * src/main.c (printable_version): Remove.
19515 * src/lex.c, src/reader.c: Use `quote'.
19516
195172000-10-04 Akim Demaille <akim@epita.fr>
19518
19519 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
19520
14ded682
AD
195212000-10-04 Akim Demaille <akim@epita.fr>
19522
19523 * doc/bison.texinfo: Various typos spotted by Neil Booth.
19524
8e03724b
AD
195252000-10-04 Akim Demaille <akim@epita.fr>
19526
19527 When a literal string is used to define two different tokens,
19528 `bison -v' segfaults.
19529 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
19530
19531 * tests/regression.m4: New file.
19532 Include the core of the sample provided by Piotr Gackiewicz.
19533 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
19534 properly.
19535
a9e64249
AD
195362000-10-04 Akim Demaille <akim@epita.fr>
19537
19538 * src/reader.c (parse_expect_decl): Keep `count' within the size
19539 of `buffer'.
19540 From Neil Booth.
19541
da9abf43
AD
195422000-10-02 Paul Eggert <eggert@twinsun.com>
19543
19544 * bison.s1 (yyparse): Assign the default value
19545 unconditionally, to avoid a GCC warning and make the parser a
19546 tad smaller.
19547
c33638bb
AD
195482000-10-02 Akim Demaille <akim@epita.fr>
19549
19550 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
19551 options.
19552
444c570a
AD
195532000-10-02 Akim Demaille <akim@epita.fr>
19554
19555 * src/derives.c, src/print.c, src/reduce.c: To ease the
19556 translation, move some `\n' out of the translated strings.
19557
89cab50d
AD
195582000-10-02 Akim Demaille <akim@epita.fr>
19559
19560 The location tracking mechanism is precious for parse error
19561 messages. Nevertheless, it is enabled only when `@n' is used in
19562 the grammar, which is a different issue (you can use it in error
19563 message, but not in the grammar per se). Therefore, there should
19564 be another means to enable it.
19565
19566 * src/getargs.c (getargs): Support `--locations'.
19567 (usage): Report it.
19568 * src/getargs.h (locationsflag): Export it.
19569 * src/lex.c (percent_table): Support `%locations'.
19570 * src/reader.c (yylsp_needed): Remove this variable, now replaced
19571 with `locationsflag'.
19572 * doc/bison.texinfo: Document `--locations' and `%locations'.
19573 Sort the options.
19574 * tests/calc.m4: Test it.
19575
19576 For regularity of the names, replace each
19577 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
19578 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
19579 In addition replace each `flag' with `_flag'.
19580
d6c2cba0
AD
195812000-10-02 Akim Demaille <akim@epita.fr>
19582
19583 Also test parse error messages, including with YYERROR_VERBOSE.
19584
19585 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
19586 associative).
19587 Use it to check the computations.
19588 Use it to check `nonassoc' is honored.
19589 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
19590 `--yyerror-verbose'.
19591 (_AT_CHECK_CALC): Adjust to this option.
19592 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
19593
5a35a6cb
AD
195942000-10-02 Akim Demaille <akim@epita.fr>
19595
19596 Test also `--verbose', `--defines' and `--name-prefix'. Testing
19597 the latter demonstrates a flaw in the handling of non debugging
19598 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
19599 was used in order to simplify:
19600
19601 #if YYDEBUG
19602 if (yydebug)
19603 {
19604 ...
19605 }
19606 #endif
19607
19608 into
19609
19610 if (yydebug)
19611 {
19612 ...
19613 }
19614
19615 unfortunately this leads to a CPP conflict when
19616 `--name-prefix=foo' is used since it produces `#define yydebug
19617 foodebug'.
19618
19619 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
19620 (YYDPRINTF): New macro.
19621 Spread its use.
19622 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
19623 the bison options.
19624 Also test `--verbose', `--defines' and `--name-prefix'.
19625
71da9eea
AD
196262000-10-02 Akim Demaille <akim@epita.fr>
19627
19628 Improve the readability of the produced parsers.
19629
19630 * src/bison.s1: Formatting changes.
19631 Improve the comment related to the `$' mark.
19632 (yydefault): Don't fall through to `yyresume': `goto' there.
19633 * src/output.c (output_parser): When the `$' is met, skip the end
19634 of its line.
19635 New variable, `number_of_dollar_signs', to check there's exactly
19636 one `$' in the parser skeleton.
19637
95e36146
AD
196382000-10-02 Akim Demaille <akim@epita.fr>
19639
19640 * lib/xstrdup.c: New file, from the fileutils.
19641 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
19642 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
19643 instead of strlen + xmalloc + strcpy.
19644 * src/symtab.c (copys): Remove, use xstrdup instead.
19645
d7020c20
AD
196462000-10-02 Akim Demaille <akim@epita.fr>
19647
19648 * src/gram.h (associativity): New enum type which replaces the
19649 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
19650 `right_assoc', `left_assoc' and `non_assoc'.
19651 Adjust all dependencies.
19652 * src/reader.c: Formatting changes.
19653 (LTYPESTR): Don't define it, use it as a literal in
19654 `reader_output_yylsp'.
19655 * src/symtab.h (symbol_class): New enum type which replaces the
19656 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
19657 `sunknown', `stoken and `snterm'.
19658
1916f98e
AD
196592000-10-02 Akim Demaille <akim@epita.fr>
19660
19661 * src/getargs.c (fixed_outfiles): Rename as...
19662 (yaccflag): for consistency and accuracy.
19663 Adjust dependencies.
19664
d7913476
AD
196652000-10-02 Akim Demaille <akim@epita.fr>
19666
19667 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
19668 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
19669 difficult and introduced a lot of core dump. It turns out that
19670 Bison used an implementation of `xmalloc' based on `calloc', and
19671 at various places it does depend upon the initialization to 0. I
19672 have not tried to isolate the pertinent places, and all the former
19673 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
19674 someone should address this issue.
19675
19676 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
19677 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
19678 files.
19679 Adjust dependencies.
19680 * src/warshall.h: New file.
19681 Propagate.
19682
340ef489
AD
196832000-10-02 Akim Demaille <akim@epita.fr>
19684
19685 Various anti-`extern in *.c' changes.
19686
19687 * src/system.h: Include `assert.h'.
19688
b2ca4022
AD
196892000-10-02 Akim Demaille <akim@epita.fr>
19690
19691 * src/state.h (nstates, final_state, first_state, first_shift)
19692 (first_reduction): Move their exportation from here...
19693 * src/LR0.h: to here.
19694 Adjust dependencies.
19695 * src/getargs.c (statisticsflag): New variable.
19696 Add support for `--statistics'.
19697 Adjust dependencies.
19698
19699 Remove a lot of now useless `extern' statements in most files.
19700
403b315b
AD
197012000-10-02 Akim Demaille <akim@epita.fr>
19702
19703 * src/LR0.h: New file.
19704 Propagate its use.
19705
07a58c13
AD
197062000-10-02 Akim Demaille <akim@epita.fr>
19707
19708 * src/print.h: New file.
19709 Propagate its use.
19710 * src/print.c: Formatting and ordering changes.
19711 (verbose, terse): Replace with...
19712 (print_results): this new function.
19713 Adjust dependencies.
19714
0619caf0
AD
197152000-10-02 Akim Demaille <akim@epita.fr>
19716
19717 * src/conflicts.c (conflict_report): New function.
19718 (conflict_log, verbose_conflict_log): Replace with...
19719 (print_conflicts): this function.
19720 Adjust dependencies.
19721 * src/conflicts.h: New file.
19722 Propagate its inclusion.
19723
3519ec76
AD
197242000-10-02 Akim Demaille <akim@epita.fr>
19725
19726 * src/nullable.h: New file.
19727 Propagate its inclusion.
19728 * src/nullable.c: Formatting changes.
19729
015acc48
AD
197302000-10-02 Akim Demaille <akim@epita.fr>
19731
19732 * src/reduce.h: New file.
19733 Propagate its inclusion.
19734 * src/reduce.c: Topological sort and other formatting changes.
19735 (bool, TRUE, FALSE): Move their definition to...
19736 * src/system.h: here.
19737
8963a27b
AD
197382000-10-02 Akim Demaille <akim@epita.fr>
19739
19740 * src/files.c: Formatting changes.
19741 (tryopen, tryclose, openfiles): Rename as...
19742 (xfopen, xfclose, open_files): this.
19743 (stringappend): static.
19744 * src/files.h: Complete the list of exported symbols.
19745 Propagate its use.
19746
a70083a3
AD
197472000-10-02 Akim Demaille <akim@epita.fr>
19748
19749 * src/reader.h: New file.
19750 Propagate its use instead of tedious list of `extern' and
19751 prototypes.
19752 * src/reader.c: Formatting changes, topological sort,
19753 s/register//.
19754
abadc117
AD
197552000-10-02 Akim Demaille <akim@epita.fr>
19756
19757 * src/lex.h: Prototype `lex.c' exported functions.
19758 * src/reader.c: Adjust.
19759 * src/lex.c: Formatting changes.
19760 (safegetc): Rename as...
19761 (xgetc): this.
19762
720d742f
AD
197632000-10-02 Akim Demaille <akim@epita.fr>
19764
19765 * src/lalr.h: New file.
19766 Propagate its inclusion instead of prototypes and `extern'.
19767 * src/lalr.c: Formatting changes, topological sorting etc.
19768
f2acea59
AD
197692000-10-02 Akim Demaille <akim@epita.fr>
19770
19771 * src/output.c (token_actions): Introduce a temporary array,
19772 YYDEFACT, that makes it possible for this function to use
19773 output_short_table.
19774
d019d655
AD
197752000-10-02 Akim Demaille <akim@epita.fr>
19776
19777 `user_toknums' is output as a `short[]' in `output.c', while it is
19778 defined as a `int[]' in `reader.c'. For consistency with the
19779 other output tables, `user_toknums' is now defined as a table of
19780 shorts.
19781
19782 * src/reader.c (user_toknums): Be a short table instead of an int
19783 table.
19784 Adjust dependencies.
19785
19786 Factor the short table outputs.
19787
19788 * src/output.c (output_short_table): New function.
19789 * src/output.c (output_gram, output_stos, output_rule_data)
19790 (output_base, output_table, output_check): Use it.
19791
6c89f1c1
AD
197922000-10-02 Akim Demaille <akim@epita.fr>
19793
19794 * src/output.c (output): Topological sort of the functions, in
19795 order to get rid of the `static' prototypes.
19796 No longer use `register'.
19797 * src/output.h: New file.
19798 Propagate its inclusion in files explicitly prototyping functions
19799 from output.c.
19800
d9efd181
AD
198012000-09-21 Akim Demaille <akim@epita.fr>
19802
19803 * src/atgeneral.m4: Update from Autoconf.
19804
c29240e7 198052000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
19806
19807 * src/closure.h: New file.
19808 * src/closure.c: Formatting changes, topological sort over the
19809 functions, use of closure.h.
19810 (initialize_closure, finalize_closure): Rename as...
19811 (new_closure, free_closure): these. Adjust dependencies.
19812 * src/LR0.c: Formatting changes, topological sort, use of
19813 cloture.h.
19814 (initialize_states): Rename as...
19815 (new_states): this.
19816 * src/Makefile.am (noinst_HEADERS): Adjust.
19817
499daa50
AD
198182000-09-20 Akim Demaille <akim@epita.fr>
19819
19820 * src/acconfig.h: Don't protect config.h against multiple
19821 inclusion.
19822 Don't define PARAMS.
19823 * src/system.h: Define PARAMS.
19824 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
19825 purpose of config.h. system.h must not try to fix wrong
19826 definitions in config.h.
19827
cc84fd5d
AD
198282000-09-20 Akim Demaille <akim@epita.fr>
19829
19830 * src/derives.h: New file.
19831 * src/main.c, src/derives.h: Use it.
19832 Formatting changes.
19833 * src/Makefile.am (noinst_HEADERS): Adjust.
19834
db5b3a89
AD
198352000-09-20 Akim Demaille <akim@epita.fr>
19836
19837 * tests/atgeneral.m4: Update from Autoconf.
19838 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
19839 (AT_CHECK_CALC): New macros.
19840 Use these macros to test bison with options `', `--raw',
19841 `--debug', `--yacc', `--yacc --debug'.
19842
ceed8467
AD
198432000-09-19 Akim Demaille <akim@epita.fr>
19844
19845 * src/output.c: Formatting changes.
19846 * src/machine.h: Remove, leaving its contents in...
19847 * src/system.h: here.
19848 Include stdio.h.
19849 Adjust all dependencies on stdio.h and machine.h.
19850 * src/getargs.h: New file.
19851 Let all `extern' declarations about getargs.c be replaced with
19852 inclusion of `getargs.h'.
19853 * src/Makefile.am (noinst_HEADERS): Adjust.
19854
19855 * tests/calc.m4 (yyin): Be initialized in main, not on the global
19856 scope.
19857 (yyerror): Returns void, not int.
19858 * doc/bison.texinfo: Formatting changes.
19859
05a1d24b
AD
198602000-09-19 Akim Demaille <akim@epita.fr>
19861
19862 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
19863 portable.
19864
cbd25751
AD
198652000-09-18 Akim Demaille <akim@epita.fr>
19866
19867 * configure.in: Append WARNING_CFLAGS to CFLAGS.
19868 * src/Makefile.am (INCLUDES): Don't.
19869 Be ready to fetch headers in lib/.
19870
13863333
AD
198712000-09-18 Akim Demaille <akim@epita.fr>
19872
19873 * doc/bison.texinfo: Update the copyright.
19874 ANSIfy and GNUify the examples.
19875 Remove the old menu.
19876
0d533154
AD
198772000-09-18 Akim Demaille <akim@epita.fr>
19878
19879 First set of tests: use the `calc' example from the documentation.
19880
19881 * src/bison.s1 (yyparse): Condition the code using `yytname' which
19882 is defined only when YYDEBUG is.
19883 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
19884 * src/files.c (tryopen, tryclose): Formatting changes.
19885 Move to the top and be static.
19886 * src/reader.c (read_signed_integer): Likewise.
19887 * tests/calc.m4: New file.
19888 * Makefile.am, suite.m4: Adjust.
19889 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
19890
e79137ac
AD
198912000-09-18 Akim Demaille <akim@epita.fr>
19892
19893 Add support for an Autotest test suite for Bison.
19894
19895 * m4/m4.m4, m4/atconfig.m4: New files.
19896 * m4/Makefile.am (EXTRA_DIST): Adjust.
19897 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
19898 files.
19899 * src/getargs.c: Display a more standard --version message.
19900 * src/reader.c (reader): Formatting changes.
19901 No longer depend upon VERSION_STRING.
19902 * configure.in: No longer use `dnl'.
19903 Set up the test suite and the new directory `tests/.
19904 (VERSION_STRING): Remove.
19905
27821bff
AD
199062000-04-14 Akim Demaille <akim@epita.fr>
19907
19908 * src/reader.c (copy_comment2): New function, same as former
19909 `copy_comment', but outputs into two FILE *.
19910 (copy_comment): Use it.
19911 (parse_union_decl): Use it.
19912 (get_type, parse_start_decl): Use the same `invalid' message.
19913 (parse_start_decl, parse_union_decl): Use the same `multiple'
19914 message.
19915 (parse_union_decl, copy_guard, copy_action): Use the same
19916 `unmatched' message.
19917 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
19918
cfe5fbc0
AD
199192000-03-31 Akim Demaille <akim@epita.fr>
19920
19921 * src/files.c (tryopen, tryclose): Move to the top.
19922 Be static.
19923
cb7db13e
AD
199242000-03-31 Akim Demaille <akim@epita.fr>
19925
19926 * src/main.c (main): Don't call `done', exit does it.
19927
a0f6b076
AD
199282000-03-31 Akim Demaille <akim@epita.fr>
19929
36281465
AD
19930 * allocate.c: s/return (foo)/return foo/.
19931 * lalr.c: Likewise.
19932 * LR0.c: Likewise.
19933 * output.c: Likewise.
19934 * reader.c: Likewise.
19935 * symtab.c: Likewise.
19936 * vmsgetargs.c: Likewise.
19937
199382000-03-31 Akim Demaille <akim@epita.fr>
19939
19940 Clean up the error reporting functions.
a0f6b076
AD
19941
19942 * src/report.c: New file.
19943 * src/report.h: Likewise.
19944 * src/Makefile.am: Adjust.
19945 * m4/error.m4: New file.
19946 * m4/Makefile.am: Adjust.
19947 * configure.in (jm_PREREQ_ERROR): Call it.
19948 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
19949 Remove.
19950 (fatal, fatals): Remove. All callers use complain.c::fatal.
19951 (warn, warni, warns, warnss, warnss): Remove. All callers use
19952 complain.c::complain.
19953 (toomany): Remove, use fatal instead.
19954 * src/files.c (done): No argument, use complain_message_count.
19955 * src/main.c (main): Register `done' to `atexit'.
19956
19957 * src/getargs.c (usage): More `fputs', less `fprintf'.
19958
18539825
AD
199592000-03-28 Akim Demaille <akim@epita.fr>
19960
19961 * lib/: New directory.
19962 * Makefile.am (SUBDIRS): Adjust.
19963 * configure.in: Adjust.
19964 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
19965 useless.
19966 * src/alloca.c: Moved to lib/.
19967 * src/getopt.c: Likewise.
19968 * src/getopt1.c: Likewise.
19969 * src/getopt.h: Likewise.
19970 * src/ansi2knr.c: Likewise.
19971 * src/ansi2knr.1: Likewise.
19972 * src/Makefile.am: Adjust.
19973 * lib/Makefile.am: New file.
19974
9f306f2a
AD
199752000-03-28 Akim Demaille <akim@epita.fr>
19976
19977 * src/getargs.c (usage): Refresh the help message.
19978
0ba347b6
AD
199792000-03-17 Akim Demaille <akim@epita.fr>
19980
19981 * src/getopt1.c: Updated from textutils 2.0e
19982 * src/getopt.c: Likewise.
19983 * src/getopt.h: Likewise.
19984
dbe7f271
AD
199852000-03-17 Akim Demaille <akim@epita.fr>
19986
19987 * src/Makefile.am (bison.simple): Fix the awk program: quote only
19988 the file name, not the whole `#line LINE FILE'.
19989
75bbe78d
AD
199902000-03-17 Akim Demaille <akim@epita.fr>
19991
19992 On syntax errors, report the token on which we choked.
19993
aa5fd0ee
AD
19994 * src/bison.s1 (yyparse): In the label yyerrlab, when
19995 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 19996
7b306f52
AD
199972000-03-17 Akim Demaille <akim@epita.fr>
19998
aa5fd0ee 19999 * src/reader.c (copy_at): New function.
7b306f52
AD
20000 (copy_guard): Use it.
20001 (copy_action): Use it.
20002
e87b5700
AD
200032000-03-17 Akim Demaille <akim@epita.fr>
20004
20005 Be kind to translators, save some useless translations.
20006
aa5fd0ee 20007 * src/main.c (banner): New function.
e87b5700
AD
20008 (fatal_banner): Use it.
20009 (warn_banner): Use it.
20010
ae3c3164
AD
200112000-03-17 Akim Demaille <akim@epita.fr>
20012
aa5fd0ee
AD
20013 * src/reader.c (copy_definition): Use copy_string and
20014 copy_comment. Removed now unused `match', `ended',
20015 `cplus_comment'.
ae3c3164
AD
20016 (copy_comment, copy_string): Moved, to be visible from
20017 copy_definition.
20018
4dc58e7c
AD
200192000-03-17 Akim Demaille <akim@epita.fr>
20020
aa5fd0ee
AD
20021 * src/reader.c (copy_string): Declare `static inline'. No
20022 problems with inline, since it is checked by configure.
4dc58e7c
AD
20023 (copy_comment): Likewise.
20024
0a6384c4
AD
200252000-03-17 Akim Demaille <akim@epita.fr>
20026
aa5fd0ee 20027 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 20028
3cef001a
AD
200292000-03-17 Akim Demaille <akim@epita.fr>
20030
aa5fd0ee 20031 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
20032 (copy_action): Use it. Removed now unused `match', `ended',
20033 `cplus_comment'.
20034 (copy_guard): Likewise.
20035
ca36d2ef
AD
200362000-03-17 Akim Demaille <akim@epita.fr>
20037
aa5fd0ee 20038 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
20039 (copy_action): Use it.
20040 (copy_guard): Likewise.
20041
6666f98f
AD
200422000-03-17 Akim Demaille <akim@epita.fr>
20043
20044 Change the handling of @s so that they behave exactly like $s.
20045 There is now a pseudo variable @$ (readble and writable), location
20046 of the lhs of the rule (by default ranging from the location of
20047 the first symbol of the rhs, to the location of the last symbol,
20048 or, if the rhs is empty, YYLLOC).
20049
20050 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
20051 yyval.
20052 (yyparse): When providing a default semantic action, provide a
20053 default location action.
20054 (after the $): No longer change `*YYLSP', just stack YYLOC the
20055 same way you stack YYVAL.
20056 * src/reader.c (read_declarations): Use warns.
20057 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
20058 (copy_action, case '@'): Likewise.
20059 Use a standard error message, to save useless work from
20060 translators.
20061
41aca2e0
AD
200622000-03-17 Akim Demaille <akim@epita.fr>
20063
aa5fd0ee
AD
20064 * src/bison.s1: Formatting and cosmetics changes.
20065 * src/reader.c: Likewise.
41aca2e0
AD
20066 Update the Copyright notice.
20067
dc08c1d5
AD
200682000-03-17 Akim Demaille <akim@epita.fr>
20069
aa5fd0ee
AD
20070 * src/bison.s1 (#line): All set to `#line' only, since the
20071 Makefile now handles them.
dc08c1d5 20072
9ee3c97b
AD
200732000-03-16 Akim Demaille <akim@epita.fr>
20074
20075 * src/output.c (output_rule_data): Output the documentation of
20076 some of the tables.
20077 (Copyright notice): Update.
20078 Formatting changes.
20079
0de741ca
AD
200802000-03-16 Akim Demaille <akim@epita.fr>
20081
20082 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
20083 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
20084 One `#if YYDEBUG' remains, since it uses variables which are
20085 defined only if `YYDEBUG != 0'.
20086
bb10be54
AD
200872000-03-16 Akim Demaille <akim@epita.fr>
20088
20089 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
20090 and related variables so that the similarities are highlighted.
20091
b07b484a
AD
200922000-03-16 Akim Demaille <akim@epita.fr>
20093
20094 * src/bison.s1: Properly indent CPP directives.
20095
361f60b3
AD
200962000-03-16 Akim Demaille <akim@epita.fr>
20097
20098 * src/bison.s1: Properly indent the `alloca' CPP section.
20099
8c44d3ec
AD
201002000-03-16 Akim Demaille <akim@epita.fr>
20101
20102 Do not hard code values of directories in `configure.in'.
20103 Update the `configure' tool chain.
20104
20105 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
20106 src/makefile.am.
20107 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
20108 (AC_OUTPUT): Add m4/Makefile.
20109 Bump to bison 1.28a, 1.29 has never been released.
20110 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
20111 handled via src/Makefile.am.
20112 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
20113 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
20114 autoheader.
20115 * Makefile.am (SUBDIRS): Add m4.
20116 (ACLOCAL_AM_FLAGS): New variable.
20117 (AUTOMAKE_OPTIONS): Add check-news.
20118 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
20119 the proper line number and file name.
20120 (DEFS): Propagate the location of bison library files and of the
20121 locale files.
20122 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
20123 builddir.
20124 * acinclude.m4: Remove, replaced by the directory m4.
20125 * m4/Makefile.am (EXTRA_DIST): New variable.
20126 * m4/gettext.m4: New file, from the fileutils.
20127 * m4/lcmessage.m4: Likewise
20128 * m4/progtest.m4: Likewise.
20129 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
20130
f95997e7
AD
201312000-03-10 Akim Demaille <akim@epita.fr>
20132
20133 * src/closure.c:
20134 Formatting changes of various comments.
20135 Respect the GNU coding standards at various places.
20136 Don't use `_()' when no translation is needed.
20137
201381999-12-13 Jesse Thilo <jthilo@gnu.org>
20139
20140 * src/files.c:
20141 OS/2 honors TMPDIR environment variable.
20142
201431999-12-13 Jesse Thilo <jthilo@gnu.org>
20144
20145 * doc/bison.texinfo: Tweaked spelling and grammar.
20146 Updated ISBN.
20147 Removed reference to price of printed copy.
20148 Mention BISON_SIMPLE and BISON_HAIRY.
20149
201501999-12-13 Jesse Thilo <jthilo@gnu.org>
20151
20152 * configure.in, NEWS:
20153 Bison 1.29 released.
20154
201551999-10-27 Jesse Thilo <jthilo@gnu.org>
20156
20157 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
20158 Added reference card.
20159
201601999-07-26 Jesse Thilo <jthilo@gnu.org>
20161
20162 * po/ru.po: Added Russian translation.
20163
201641999-07-26 Jesse Thilo <jthilo@gnu.org>
20165
20166 * configure.in: Added Russian translation.
20167
201681999-07-06 Jesse Thilo <jthilo@gnu.org>
20169
20170 * configure.in, NEWS, README:
20171 Released version 1.28.
20172
201731999-06-14 Jesse Thilo <jthilo@gnu.org>
20174
20175 * src/system.h:
20176 Squashed redefinition warning on some systems.
20177
20178 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
20179 Have configure build version string instead of relying on ANSI string
20180 concatentation.
20181
201821999-06-14 Jesse Thilo <jthilo@gnu.org>
20183
20184 * po/POTFILES.in: Got rid of version.c.
20185
201861999-06-14 Jesse Thilo <jthilo@gnu.org>
20187
20188 * acconfig.h, configure.in:
20189 Have configure build version string instead of relying on ANSI string
20190 concatentation.
20191
201921999-06-08 Jesse Thilo <jthilo@gnu.org>
20193
20194 * doc/bison.1:
20195 Dropped mention of `+' for long-named options.
20196
201971999-05-30 Jesse Thilo <jthilo@gnu.org>
20198
20199 * src/files.c: Added <unistd.h> for unlink().
20200
20201 * src/Makefile.am, src/system.h:
20202 I18n fixes.
20203
202041999-05-30 Jesse Thilo <jthilo@gnu.org>
20205
20206 * README: Added a FAQ list.
20207
20208 * configure.in, acconfig.h:
20209 I18n fixes.
20210
202111999-05-30 Jesse Thilo <jthilo@gnu.org>
20212
20213 * doc/FAQ, doc/Makefile.am:
20214 Added a FAQ list.
20215
202161999-05-19 Jesse Thilo <jthilo@gnu.org>
20217
20218 * src/alloc.h, src/symtab.h, src/version.c:
20219 Protected inclusion of "config.h" with HAVE_CONFIG_H.
20220
202211999-04-18 Jesse Thilo <jthilo@gnu.org>
20222
20223 * src/.cvsignore, src/Makefile.am:
20224 Reorganized: sources in `src', documentation in `doc'.
20225
20226 * src/lex.c (literalchar):
20227 fixed the code for escaping double quotes (thanks
20228 Jonathan Czisny.)
20229
202301999-04-18 Jesse Thilo <jthilo@gnu.org>
20231
20232 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
20233 Adjusted paths to reflect directory reorganization.
20234
202351999-04-18 Jesse Thilo <jthilo@gnu.org>
20236
20237 * doc/.cvsignore, doc/Makefile.am:
20238 Reorganized: sources in `src', documentation in `doc'.
20239
202401999-04-18 Jesse Thilo <jthilo@gnu.org>
20241
20242 * configure.in:
20243 Updated AC_INIT file to reflect directory reorganization.
20244
20245 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
20246 Reorganized: sources in `src', documentation in `doc'.
20247
202481999-04-13 Jesse Thilo <jthilo@gnu.org>
20249
20250 * src/allocate.c:
20251 Don't declare calloc() and realloc() if not necessary.
20252
202531999-04-13 Jesse Thilo <jthilo@gnu.org>
20254
20255 * configure.in, acconfig.h, acinclude.m4:
20256 Don't declare calloc() and realloc() if not necessary.
20257
202581999-03-23 Jesse Thilo <jthilo@gnu.org>
20259
20260 * po/.cvsignore: Added i18n support.
20261
202621999-03-23 Jesse Thilo <jthilo@gnu.org>
20263
20264 * acconfig.h, configure.in, Makefile.am:
20265 Added i18n support.
20266
202671999-03-22 Jesse Thilo <jthilo@gnu.org>
20268
20269 * src/bison.s1: Fixed #line numbers.
20270
202711999-03-15 Jesse Thilo <jthilo@gnu.org>
20272
20273 * po/es.po, po/fr.po, po/nl.po, po/de.po:
20274 Added PO files from Translation Project.
20275
202761999-03-03 Jesse Thilo <jthilo@gnu.org>
20277
20278 * Makefile.am:
20279 Added support for non-ANSI compilers (ansi2knr).
20280
202811999-02-16 Jesse Thilo <jthilo@gnu.org>
20282
20283 * configure.in: Bumped version number to 1.27.
20284
20285 * Makefile.am:
20286 Added `bison.simple' to list of files removed by `make distclean'.
20287
202881999-02-12 Jesse Thilo <jthilo@gnu.org>
20289
20290 * src/files.c, src/files.h:
20291 Defined locations of parser files in config.h instead of Makefile.
20292
202931999-02-12 Jesse Thilo <jthilo@gnu.org>
20294
20295 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
20296 Defined locations of parser files in config.h instead of Makefile.
20297
202981999-02-09 Jesse Thilo <jthilo@gnu.org>
20299
20300 * Makefile.am:
20301 Removed inappropriate use of $< macro.
20302
203031999-02-05 Jesse Thilo <jthilo@gnu.org>
20304
20305 * po/Makefile.in.in, po/POTFILES.in:
20306 Add `po' directory skeleton.
20307
203081999-01-27 Jesse Thilo <jthilo@gnu.org>
20309
20310 * README: Document help-bison list.
20311
20312 * configure.in: Add check for mkstemp().
20313
203141999-01-20 Jesse Thilo <jthilo@gnu.org>
20315
20316 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
20317 Hush a few compiler warnings.
20318
20319 * src/files.c:
20320 Add tryclose(), which verifies that fclose was successful.
20321 Hush a couple of compiler warnings.
20322
203231999-01-20 Jesse Thilo <jthilo@gnu.org>
20324
20325 * Makefile.am, OChangeLog:
20326 ChangeLog is now automatically generated. Include the old version as
20327 OChangeLog.
20328
203291999-01-14 Jesse Thilo <jthilo@gnu.org>
20330
20331 * 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:
20332 Update FSF address.
20333
203341999-01-14 Jesse Thilo <jthilo@gnu.org>
20335
20336 * doc/bison.texinfo: Fix formatting glitch.
20337
20338 * doc/bison.texinfo: Update FSF address.
20339
203401999-01-14 Jesse Thilo <jthilo@gnu.org>
20341
20342 * acconfig.h: Update FSF address.
20343
203441999-01-08 Jesse Thilo <jthilo@gnu.org>
20345
20346 * src/system.h:
20347 Don't define PACKAGE here, since config.h defines it.
20348
203491998-12-30 Jesse Thilo <jthilo@gnu.org>
20350
20351 * src/reader.c: Update copyright date.
20352
20353 * src/main.c:
20354 Ditch sprintf to statically-sized buffers in fatal/warn functions in
20355 favor of output directly to stderr (avoids buffer overruns).
20356
20357 * src/reader.c: Some checks for premature EOF.
20358
20359 * 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:
20360 Use prototypes if the compiler understands them.
20361
20362 * src/files.c: Honor TMPDIR on Unix hosts.
20363 Use prototypes if the compiler understands them.
20364
20365 * src/reader.c:
20366 Fix a couple of buffer overrun bugs.
20367 Use prototypes if the compiler understands them.
20368
20369 * src/system.h: Include unistd.h and ctype.h.
20370 Use #ifdef instead of #if for NLS symbols.
20371
203721998-12-30 Jesse Thilo <jthilo@gnu.org>
20373
20374 * doc/bison.texinfo:
20375 Delete comment "consider using @set for edition number, etc..." since
20376 we now are doing so.
20377
203781998-12-30 Jesse Thilo <jthilo@gnu.org>
20379
20380 * configure.in:
20381 Use prototypes if the compiler understands them.
20382
20383 * NEWS: Document 1.26 highlights.
20384
20385 * Makefile.am: Require Automake 1.3 or later.
20386
20387 * acconfig.h:
20388 Use prototypes if the compiler understands them.
20389
203901998-12-29 Jesse Thilo <jthilo@gnu.org>
20391
20392 * src/version.c:
20393 Use VERSION symbol from automake for version number.
20394
203951998-12-29 Jesse Thilo <jthilo@gnu.org>
20396
20397 * acconfig.h, configure.in, version.cin:
20398 Use VERSION symbol from automake for version number.
20399
204001998-11-28 Jesse Thilo <jthilo@gnu.org>
20401
20402 * Makefile.am:
20403 Distribute original version of simple parser (bison.s1), not built
20404 version (bison.simple).
20405
204061998-11-28 Jesse Thilo <jthilo@gnu.org>
20407
20408 * doc/bison.texinfo: Add info dir entry.
20409
20410 * doc/bison.texinfo:
20411 Let automake put version number into documentation.
20412
204131998-11-26 Jesse Thilo <jthilo@gnu.org>
20414
20415 * src/bison.cld, src/build.com, src/vmshlp.mar:
20416 Add non-RCS files from /gd/gnu/bison.
20417
204181998-11-26 Jesse Thilo <jthilo@gnu.org>
20419
20420 * doc/bison.1:
20421 Document the BISON_HAIRY and BISON_SIMPLE variables.
20422
204231998-11-25 Jesse Thilo <jthilo@gnu.org>
20424
20425 * src/version.c: Build version.c automatically.
20426
20427 * src/reader.c:
20428 Fix token numbering (used to start at 258, not 257).
20429
20430 * src/system.h: Include config.h.
20431
20432 * src/getargs.c: Update bug report address.
20433
20434 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
20435 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
20436
204371998-11-25 Jesse Thilo <jthilo@gnu.org>
20438
20439 * Makefile.am:
20440 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
20441
20442 * configure.in, version.cin:
20443 Build version.c automatically.
20444
20445 * AUTHORS: Add AUTHORS file.
20446
20447 * README: Update bug report address.
20448
20449 * bison.simple:
20450 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
20451
20452 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
20453 Add automake stuff.
20454
204551998-11-25 Jesse Thilo <jthilo@gnu.org>
20456
20457 * doc/bison.texinfo: Clean up some formatting.
20458
204591998-05-05 Richard Stallman <rms@gnu.org>
20460
20461 * doc/bison.texinfo:
20462 Explain better why to make a pure parser.
20463
204641998-01-05 Richard Stallman <rms@gnu.org>
20465
20466 * src/files.c (openfiles):
20467 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
20468 find a temporary directory, if possible. Do not unlink files while
20469 they are open.
20470
204711997-08-25 Richard Stallman <rms@gnu.org>
20472
20473 * src/reader.c (stack_offset;):
20474 Change some warni to warns.
20475
20476 * src/lex.c (literalchar): Use warns, not warni.
20477
204781997-06-28 Richard Stallman <rms@gnu.org>
20479
20480 * src/bison.s1: Add a Bison version comment.
20481
20482 * src/main.c (fatal, warn, berror):
20483 Use program_name.
20484
204851997-06-28 Richard Stallman <rms@gnu.org>
20486
20487 * Makefile.in (bison_version): New variable.
20488 (dist): Use that variable.
20489 (bison.s1): Substitute the Bison version into bison.simple.
20490
20491 * bison.simple: Add a Bison version comment.
20492
204931997-06-18 Richard Stallman <rms@gnu.org>
20494
20495 * src/main.c (fatal, warn, berror):
20496 Make error messages standard.
20497 (toomany): Improve error message text.
20498
20499 * 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:
20500 new.h renamed to alloc.h.
20501
205021997-06-18 Richard Stallman <rms@gnu.org>
20503
20504 * Makefile.in: new.h renamed to alloc.h.
20505
205061997-05-24 Richard Stallman <rms@gnu.org>
20507
20508 * src/lex.c (literalchar):
20509 Fix the code for escaping \, " and '.
20510
20511 (lex): Avoid trouble when there are many chars
20512 to discard in a char literal with just several chars in it.
20513
205141997-05-17 Richard Stallman <rms@gnu.org>
20515
20516 * src/bison.s1:
20517 Use malloc, if using alloca is troublesome.
20518 (YYSTACK_USE_ALLOCA): New flag macro.
20519 Define it for some systems and compilers.
20520 (YYSTACK_ALLOC): New macro.
20521 (yyparse): Use YYSTACK_ALLOC to allocate stack.
20522 If it was malloc'd, free it.
20523
205241997-05-17 Richard Stallman <rms@gnu.org>
20525
20526 * bison.simple:
20527 Use malloc, if using alloca is troublesome.
20528 (YYSTACK_USE_ALLOCA): New flag macro.
20529 Define it for some systems and compilers.
20530 (YYSTACK_ALLOC): New macro.
20531 (yyparse): Use YYSTACK_ALLOC to allocate stack.
20532 If it was malloc'd, free it.
20533
205341997-04-23 Richard Stallman <rms@gnu.org>
20535
20536 * src/bison.s1:
20537 (alloca) [__hpux]: Always define as __builtin_alloca.
20538
205391997-04-23 Richard Stallman <rms@gnu.org>
20540
20541 * bison.simple:
20542 (alloca) [__hpux]: Always define as __builtin_alloca.
20543
205441997-04-22 Richard Stallman <rms@gnu.org>
20545
20546 * src/bison.s1:
20547 [__hpux]: Include alloca.h (right for HPUX 10)
20548 instead of declaring alloca (right for HPUX 9).
20549
20550 * src/bison.s1 (__yy_memcpy):
20551 Declare arg `count' as unsigned int.
20552 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20553
205541997-04-22 Richard Stallman <rms@gnu.org>
20555
20556 * bison.simple:
20557 [__hpux]: Include alloca.h (right for HPUX 10)
20558 instead of declaring alloca (right for HPUX 9).
20559
20560 * bison.simple (__yy_memcpy):
20561 Declare arg `count' as unsigned int.
20562 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20563
205641997-01-03 Richard Stallman <rms@gnu.org>
20565
20566 * src/allocate.c: [__STDC__ or _MSC_VER]:
20567 Declare calloc and realloc to return void *.
20568
205691997-01-02 Richard Stallman <rms@gnu.org>
20570
20571 * src/system.h:
20572 [_MSC_VER]: Include stdlib.h and process.h.
20573 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
20574
20575 * src/main.c (main): Return FAILURE as a value.
20576 (printable_version): Declare arg as int, not char.
20577
205781997-01-02 Richard Stallman <rms@gnu.org>
20579
20580 * Makefile.in (dist):
20581 Explicitly check for symlinks, and copy them.
20582
205831996-12-19 Richard Stallman <rms@gnu.org>
20584
20585 * src/files.c:
20586 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
20587
205881996-12-18 Paul Eggert <eggert@gnu.org>
20589
20590 * src/bison.s1 (yyparse):
20591 If __GNUC__ and YYPARSE_PARAM are both defined,
20592 declare yyparse to have a void * argument.
20593
205941996-12-18 Paul Eggert <eggert@gnu.org>
20595
20596 * bison.simple (yyparse):
20597 If __GNUC__ and YYPARSE_PARAM are both defined,
20598 declare yyparse to have a void * argument.
20599
206001996-12-17 Richard Stallman <rms@gnu.org>
20601
20602 * src/reduce.c (nbits): Add some casts.
20603
206041996-08-12 Richard Stallman <rms@gnu.org>
20605
20606 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
20607
206081996-08-12 Richard Stallman <rms@gnu.org>
20609
20610 * bison.simple: Test _MSDOS as well as _MSDOS_.
20611
206121996-07-31 Richard Stallman <rms@gnu.org>
20613
20614 * src/bison.s1:
20615 [__sun && __i386]: Include alloca.h.
20616
206171996-07-31 Richard Stallman <rms@gnu.org>
20618
20619 * bison.simple:
20620 [__sun && __i386]: Include alloca.h.
20621
206221996-07-30 Richard Stallman <rms@gnu.org>
20623
20624 * src/bison.s1: Comment change.
20625
20626 * src/bison.s1: Test _MSDOS_, not MSDOS.
20627
206281996-07-30 Richard Stallman <rms@gnu.org>
20629
20630 * bison.simple: Comment change.
20631
20632 * bison.simple: Test _MSDOS_, not MSDOS.
20633
206341996-06-01 Richard Stallman <rms@gnu.org>
20635
20636 * 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:
20637 Insert `_' macro around many string constants.
20638
20639 * src/main.c:
20640 Insert `_' macro around many string constants.
20641
20642 (main): Call setlocale, bindtextdomain and textdomain.
20643
20644 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
20645 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
20646 [ENABLE_NLS]: Include libintl.h.
20647 [ENABLE_NLS] (gettext): Define.
20648 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
20649 (N_, PACKAGE, LOCALEDIR): New macros.
20650
206511996-06-01 Richard Stallman <rms@gnu.org>
20652
20653 * POTFILES.in: New file.
20654
20655 * Makefile.in (allocate.o):
20656 Define target explicitly.
20657
20658 * Makefile.in (CFLAGS): Set to @CFLAGS@.
20659 (LDFLAGS): Set to @LDFLAGS@.
20660 (configure): Run autoconf only if preceding `cd' succeeds.
20661 (bison.s1): Redirect output to temporary file then move the
20662 temporary to the target, rather than redirecting directly to bison.s1.
20663 (clean): Remove config.status and config.log.
20664 (distclean): Don't remove config.status here.
20665
206661996-05-12 Richard Stallman <rms@gnu.org>
20667
20668 * src/bison.s1:
20669 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20670
206711996-05-12 Richard Stallman <rms@gnu.org>
20672
20673 * bison.simple:
20674 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20675
206761996-05-11 Richard Stallman <rms@gnu.org>
20677
20678 * src/bison.s1 (__yy_memcpy):
20679 Really reorder the args, as was supposedly done on Feb 14 1995.
20680 (yyparse): Calls changed accordingly.
20681
206821996-05-11 Richard Stallman <rms@gnu.org>
20683
20684 * Makefile.in (dist): Don't use $(srcdir).
20685
20686 * bison.simple (__yy_memcpy):
20687 Really reorder the args, as was supposedly done on Feb 14 1995.
20688 (yyparse): Calls changed accordingly.
20689
206901996-01-27 Richard Stallman <rms@gnu.org>
20691
20692 * src/output.c (output_rule_data):
20693 Test YYERROR_VERBOSE in the conditional
20694 around the definition of ttyname.
20695
206961995-12-29 Richard Stallman <rms@gnu.org>
20697
20698 * src/bison.s1:
20699 Fix line numbers in #line commands.
20700
207011995-12-29 Richard Stallman <rms@gnu.org>
20702
20703 * bison.simple:
20704 Fix line numbers in #line commands.
20705
207061995-12-27 Richard Stallman <rms@gnu.org>
20707
20708 * src/bison.s1 (YYPARSE_PARAM_DECL):
20709 In C++, make it always null.
20710 (YYPARSE_PARAM_ARG): New macro.
20711 (yyparse): Use YYPARSE_PARAM_ARG.
20712
207131995-12-27 Richard Stallman <rms@gnu.org>
20714
20715 * bison.simple (YYPARSE_PARAM_DECL):
20716 In C++, make it always null.
20717 (YYPARSE_PARAM_ARG): New macro.
20718 (yyparse): Use YYPARSE_PARAM_ARG.
20719
207201995-11-29 Richard Stallman <rms@gnu.org>
20721
20722 * doc/bison.texinfo:
20723 Describe literal string tokens, %raw, %no_lines, %token_table.
20724
207251995-11-29 Daniel Hagerty <hag@gnu.org>
20726
20727 * doc/bison.texinfo: Fixed update date
20728
207291995-10-16 Richard Stallman <rms@gnu.org>
20730
20731 * src/version.c: Version 1.25.
20732
207331995-10-16 Richard Stallman <rms@gnu.org>
20734
20735 * NEWS: *** empty log message ***
20736
207371995-10-16 Richard Stallman <rms@gnu.org>
20738
20739 * doc/bison.1, doc/bison.rnh:
20740 Add new options.
20741
207421995-10-15 Richard Stallman <rms@gnu.org>
20743
20744 * src/vmsgetargs.c, src/getargs.c:
20745 Added -n, -k, and -raw switches.
20746 (noparserflag, toknumflag, rawtoknumflag): New variables.
20747
20748 * src/symtab.h (SALIAS):
20749 New #define for adding aliases to %token.
20750 (struct bucket): Added `alias' field.
20751
20752 * src/reduce.c (reduce_grammar):
20753 Revise error message.
20754 (print_notices): Remove final `.' from error message.
20755
20756 * src/reader.c (reader_output_yylsp):
20757 New function.
20758 (readgram): Use `#if 0' around code that accepted %command
20759 inside grammar rules: The documentation doesn't allow it,
20760 and it will fail since the %command processors scan for the next %.
20761 (parse_token_decl): Extended the %token
20762 declaration to allow a multi-character symbol as an alias.
20763 (parse_thong_decl): New function.
20764 (read_declarations): Added %thong declarations.
20765 (read_declarations): Handle NOOP to deal with allowing
20766 % declarations as another means to specify the flags.
20767 (readgram): Allow %prec prior to semantics embedded in a rule.
20768 (skip_to_char, read_declarations, copy_definition)
20769 (parse_token_decl, parse_start_decl, parse_type_decl)
20770 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
20771 (get_type_name, copy_guard, copy_action, readgram)
20772 (get_type, packsymbols): Revised most error messages.
20773 Changed `fatal' to `warnxxx' to avoid aborting for error.
20774 Revised and use multiple warnxxx functions to avoid using VARARGS1.
20775 (read_declarations): Improve the error message for
20776 an invalid character. Do not abort.
20777 (read_declarations, copy_guard, copy_action): Use
20778 printable_version to avoid unprintable characters in printed output.
20779 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
20780 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
20781 Allow the type of a non-terminal can be given
20782 more than once, as long as all specifications give the same type.
20783
20784 * src/output.c:
20785 (output_headers, output_trailers, output, output_gram)
20786 (output_rule_data): Implement noparserflag variable.
20787 Implement toknumflag variable.
20788 (output): Call reader_output_yylsp to output LTYPESTR.
20789
20790 * src/main.c (main):
20791 If reader sees an error, don't process the grammar.
20792 (fatals): Updated to not use VARARGS1.
20793 (printable_version, int_to_string, warn, warni, warns, warnss)
20794 (warnsss): New error reporting functions. Avoid abort for error.
20795
20796 * src/lex.h:
20797 Added THONG and NOOP for alias processing.
20798 Added SETOPT for the new code that allows setting options with %flags.
20799
20800 * src/lex.c:
20801 Include getopt.h. Add some extern decls.
20802 (safegetc): New function to deal with EOF gracefully.
20803 (literalchar); new function to deal with reading \ escapes.
20804 (lex): Use literalchar.
20805 (lex): Implemented "..." tokens.
20806 (literalchar, lex, parse_percent_token): Made tokenbuffer
20807 always contain the token. This includes growing the token
20808 buffer while reading an integer.
20809 (parse_percent_token): Replaced if-else statement with percent_table.
20810 (parse_percent_token): Added % declarations as another
20811 way to specify the flags -n, -l, and -r. Also added hooks for
20812 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
20813 major changes to files.c.
20814 (lex) Retain in the incoming stream a character following
20815 an incorrect '/'.
20816 (skip_white_space, lex): Revised most error messages
20817 and changed fatal to warn to avoid aborting.
20818 (percent_table): Added %thong declarations.
20819
20820 * src/gram.h: Comment changes.
20821
20822 * src/files.c (openfiles, open_extra_files, done):
20823 Add faction flag
20824 and actfile file. Handle noparserflag. Both for -n switch.
20825
20826 * src/conflicts.c (resolve_sr_conflict):
20827 Remove use of alloca.
20828
208291995-06-01 Jim Meyering <meyering@gnu.org>
20830
20831 * doc/bison.texinfo: *** empty log message ***
20832
208331995-05-06 Richard Stallman <rms@gnu.org>
20834
20835 * src/bison.s1: Comment change.
20836
208371995-05-06 Richard Stallman <rms@gnu.org>
20838
20839 * bison.simple: Comment change.
20840
208411995-05-03 Richard Stallman <rms@gnu.org>
20842
20843 * src/version.c: Version now 1.24.
20844
20845 * src/bison.s1: Change distribution terms.
20846
20847 * src/version.c: Version now 1.23.
20848
208491995-05-03 Richard Stallman <rms@gnu.org>
20850
20851 * doc/bison.texinfo:
20852 Rewrite "Conditions for Using Bison".
20853 Update version to 1.24.
20854
208551995-05-03 Richard Stallman <rms@gnu.org>
20856
20857 * bison.simple: Change distribution terms.
20858
208591995-02-23 Richard Stallman <rms@gnu.org>
20860
20861 * src/files.c: Test __VMS_POSIX as well as VMS.
20862
208631995-02-14 Jim Meyering <meyering@gnu.org>
20864
20865 * src/bison.s1 (__yy_memcpy):
20866 Renamed from __yy_bcopy to avoid
20867 confusion. Reverse FROM and TO arguments to be consistent with
20868 those of memcpy.
20869
208701995-02-14 Jim Meyering <meyering@gnu.org>
20871
20872 * bison.simple (__yy_memcpy):
20873 Renamed from __yy_bcopy to avoid
20874 confusion. Reverse FROM and TO arguments to be consistent with
20875 those of memcpy.
20876
208771994-11-10 David J. MacKenzie <djm@gnu.org>
20878
20879 * NEWS: reformat
20880
20881 * NEWS: New file.
20882
20883 * Makefile.in (DISTFILES): Include NEWS.
20884
20885 * Makefile.in (DISTFILES):
20886 Include install-sh, not install.sh.
20887
20888 * configure.in: Update to Autoconf v2 macro names.
20889
208901994-10-05 David J. MacKenzie <djm@gnu.org>
20891
20892 * Makefile.in: fix typo
20893
20894 * Makefile.in (prefix, exec_prefix):
20895 Let configure set them.
20896
208971994-09-28 David J. MacKenzie <djm@gnu.org>
20898
20899 * Makefile.in: Set datadir to $(prefix)/share.
20900
209011994-09-15 Richard Stallman <rms@gnu.org>
20902
20903 * src/bison.s1:
20904 Update copyright notice and GPL version.
20905
209061994-09-15 Richard Stallman <rms@gnu.org>
20907
20908 * bison.simple:
20909 Update copyright notice and GPL version.
20910
209111994-07-12 Richard Stallman <rms@gnu.org>
20912
20913 * src/reduce.c, src/reader.c:
20914 entered into RCS
20915
209161994-05-05 David J. MacKenzie <djm@gnu.org>
20917
20918 * Makefile.in: entered into RCS
20919
209201994-03-26 Richard Stallman <rms@gnu.org>
20921
20922 * src/bison.s1: entered into RCS
20923
209241994-03-26 Richard Stallman <rms@gnu.org>
20925
20926 * bison.simple: entered into RCS
20927
209281994-03-25 Richard Stallman <rms@gnu.org>
20929
20930 * src/main.c: entered into RCS
20931
209321994-03-24 Richard Stallman <rms@gnu.org>
20933
20934 * src/conflicts.c: entered into RCS
20935
209361994-01-02 Richard Stallman <rms@gnu.org>
20937
20938 * Makefile.in: *** empty log message ***
20939
209401993-11-21 Richard Stallman <rms@gnu.org>
20941
20942 * src/bison.s1: *** empty log message ***
20943
209441993-11-21 Richard Stallman <rms@gnu.org>
20945
20946 * doc/bison.texinfo: entered into RCS
20947
20948 * doc/bison.texinfo: *** empty log message ***
20949
209501993-11-21 Richard Stallman <rms@gnu.org>
20951
20952 * bison.simple: *** empty log message ***
20953
209541993-10-25 David J. MacKenzie <djm@gnu.org>
20955
20956 * doc/bison.texinfo: *** empty log message ***
20957
209581993-10-19 Richard Stallman <rms@gnu.org>
20959
20960 * src/bison.s1: *** empty log message ***
20961
209621993-10-19 Richard Stallman <rms@gnu.org>
20963
20964 * bison.simple: *** empty log message ***
20965
209661993-10-14 Richard Stallman <rms@gnu.org>
20967
20968 * src/bison.s1: *** empty log message ***
20969
209701993-10-14 Richard Stallman <rms@gnu.org>
20971
20972 * bison.simple: *** empty log message ***
20973
209741993-09-14 David J. MacKenzie <djm@gnu.org>
20975
20976 * doc/bison.texinfo: *** empty log message ***
20977
209781993-09-13 Noah Friedman <friedman@gnu.org>
20979
20980 * Makefile.in: *** empty log message ***
20981
209821993-09-10 Richard Stallman <rms@gnu.org>
20983
20984 * src/conflicts.c: *** empty log message ***
20985
20986 * src/system.h: entered into RCS
20987
209881993-09-10 Richard Stallman <rms@gnu.org>
20989
20990 * doc/bison.1: entered into RCS
20991
209921993-09-06 Noah Friedman <friedman@gnu.org>
20993
20994 * src/version.c: entered into RCS
20995
209961993-09-06 Noah Friedman <friedman@gnu.org>
20997
20998 * Makefile.in: *** empty log message ***
20999
210001993-07-30 David J. MacKenzie <djm@gnu.org>
21001
21002 * Makefile.in: *** empty log message ***
21003
210041993-07-24 Richard Stallman <rms@gnu.org>
21005
21006 * src/bison.s1: *** empty log message ***
21007
210081993-07-24 Richard Stallman <rms@gnu.org>
21009
21010 * bison.simple: *** empty log message ***
21011
210121993-07-08 David J. MacKenzie <djm@gnu.org>
21013
21014 * Makefile.in: *** empty log message ***
21015
210161993-07-04 Richard Stallman <rms@gnu.org>
21017
21018 * src/bison.s1: *** empty log message ***
21019
210201993-07-04 Richard Stallman <rms@gnu.org>
21021
21022 * bison.simple: *** empty log message ***
21023
210241993-06-26 David J. MacKenzie <djm@gnu.org>
21025
21026 * src/getargs.c: entered into RCS
21027
210281993-06-26 David J. MacKenzie <djm@gnu.org>
21029
21030 * doc/bison.texinfo: *** empty log message ***
21031
21032 * doc/bison.1: New file.
21033
210341993-06-25 Richard Stallman <rms@gnu.org>
21035
21036 * src/getargs.c: New file.
21037
210381993-06-16 Richard Stallman <rms@gnu.org>
21039
21040 * src/bison.s1: *** empty log message ***
21041
210421993-06-16 Richard Stallman <rms@gnu.org>
21043
21044 * bison.simple: *** empty log message ***
21045
210461993-06-03 Richard Stallman <rms@gnu.org>
21047
21048 * src/bison.s1: New file.
21049
210501993-06-03 Richard Stallman <rms@gnu.org>
21051
21052 * doc/bison.texinfo: *** empty log message ***
21053
210541993-06-03 Richard Stallman <rms@gnu.org>
21055
21056 * bison.simple: New file.
21057
210581993-05-19 Richard Stallman <rms@gnu.org>
21059
21060 * doc/bison.texinfo: New file.
21061
210621993-05-07 Noah Friedman <friedman@gnu.org>
21063
21064 * Makefile.in: *** empty log message ***
21065
210661993-04-28 Noah Friedman <friedman@gnu.org>
21067
21068 * src/reader.c: *** empty log message ***
21069
210701993-04-23 Noah Friedman <friedman@gnu.org>
21071
21072 * src/alloc.h: entered into RCS
21073
210741993-04-20 David J. MacKenzie <djm@gnu.org>
21075
21076 * src/version.c: *** empty log message ***
21077
21078 * src/files.c, src/allocate.c:
21079 entered into RCS
21080
21081 * src/reader.c: *** empty log message ***
21082
21083 * src/lex.c: entered into RCS
21084
21085 * src/conflicts.c: New file.
21086
21087 * src/symtab.c: entered into RCS
21088
21089 * src/alloc.h: New file.
21090
21091 * src/LR0.c: entered into RCS
21092
210931993-04-18 Noah Friedman <friedman@gnu.org>
21094
21095 * src/reader.c: New file.
21096
21097 * src/version.c: *** empty log message ***
21098
210991993-04-18 Noah Friedman <friedman@gnu.org>
21100
21101 * Makefile.in: *** empty log message ***
21102
211031993-04-17 Noah Friedman <friedman@gnu.org>
21104
21105 * Makefile.in: *** empty log message ***
21106
211071993-04-15 Richard Stallman <rms@gnu.org>
21108
21109 * src/main.c, src/files.c:
21110 New file.
21111
211121993-04-15 Noah Friedman <friedman@gnu.org>
21113
21114 * configure.in: entered into RCS
21115
21116 * configure.in: *** empty log message ***
21117
21118 * configure.in: New file.
21119
211201993-04-14 Richard Stallman <rms@gnu.org>
21121
21122 * Makefile.in: New file.
21123
211241993-04-13 Richard Stallman <rms@gnu.org>
21125
21126 * src/version.c: New file.
21127
211281993-03-25 Richard Stallman <rms@gnu.org>
21129
21130 * src/output.c: entered into RCS
21131
211321992-09-25 Richard Stallman <rms@gnu.org>
21133
21134 * configure.bat: entered into RCS
21135
211361992-06-22 Richard Stallman <rms@gnu.org>
21137
21138 * src/vmsgetargs.c: entered into RCS
21139
211401992-06-22 Richard Stallman <rms@gnu.org>
21141
21142 * doc/bison.rnh: entered into RCS
21143
211441992-04-20 David J. MacKenzie <djm@gnu.org>
21145
21146 * README: entered into RCS
21147
211481992-01-22 Richard Stallman <rms@gnu.org>
21149
21150 * src/machine.h: entered into RCS
21151
211521991-12-21 Richard Stallman <rms@gnu.org>
21153
21154 * src/lalr.c, src/closure.c:
21155 entered into RCS
21156
211571991-12-20 Richard Stallman <rms@gnu.org>
21158
21159 * src/state.h: entered into RCS
21160
211611991-12-18 Richard Stallman <rms@gnu.org>
21162
21163 * src/print.c, src/nullable.c, src/derives.c:
21164 entered into RCS
21165
211661991-11-03 David J. MacKenzie <djm@gnu.org>
21167
21168 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
21169 entered into RCS
21170
211711988-09-09 Richard Stallman <rms@gnu.org>
21172
21173 * src/bison.hairy: entered into RCS
21174
211751987-12-16 Richard Stallman <rms@gnu.org>
21176
21177 * REFERENCES: entered into RCS
dc546b0f 21178
f294a2c2 21179
04098407 21180 -----
f294a2c2 21181
04098407 21182 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
9126263e 21183 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
95021767 21184 Free Software Foundation, Inc.
f294a2c2 21185
04098407
PE
21186 Copying and distribution of this file, with or without
21187 modification, are permitted provided the copyright notice and this
21188 notice are preserved.