]> git.saurik.com Git - bison.git/blob - ChangeLog
Minor code cleanup in parser table construction.
[bison.git] / ChangeLog
1 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Minor code cleanup in parser table construction.
4 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
5 (new_itemsets, save_reductions): Update for rename to nitemset.
6 * src/closure.c (nritemset): Rename to...
7 (nitemset): ... this since the "r" appears to meaningless and isn't
8 used in the comments.
9 (closure): Update for rename.
10 * src/closure.h (nritemset): Update extern to...
11 (nitemset): ... this.
12 * src/lalr.c (LA): Fix a typo in comments.
13 * src/print.c (print_core): Update for rename to nitemset.
14 * src/print_graph.c (print_graph): Likewise.
15 * src/state.h: Fix some typos in header comments.
16
17 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
18
19 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
20 still sticks to ASCII. Sorry!
21
22 * README-hacking: New file, taken mostly from coreutils, with changes
23 for Bison. Contains much of the contents of:
24 * README-cvs: Remove.
25 * bootstrap: Sync from gnulib.
26 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
27 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
28
29 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
30
31 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
32 Setzer.
33 (Java Differences): Fix some typos.
34 * THANKS: Add Sebastian Setzer.
35
36 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
37
38 * data/java.m4 (b4_single_class_if): Remove.
39 (b4_abstract_if): Look at "%define abstract".
40 (b4_lexer_if): New.
41 (b4_union_name): Rename...
42 (b4_yystype): ... to this. Map to "%define stype".
43 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
44 b4_maybe_throws): Fix quoting.
45 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
46 * data/lalr1.java (Lexer interface): Always define.
47 (Lexer interface within parser class): Remove.
48 (YYLexer class): New, used when "%code lexer" is present.
49 (constructor): When "%code lexer" is used, pass %lex-param
50 to the lexer constructor.
51 (yylex, yyparse): Remove %lex-param from method invocations
52 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
53
54 * doc/bison.texinfo (Java Bison Interface): Mention "%define
55 abstract". Rename "%define union_name" to "%define stype".
56 Rename method names according to previous patch.
57 (Java Scanner Interface): Describe "%code lexer" instead of
58 "%pure-parser" and "%define single_class".
59 (Java Differences): Mention "%code lexer".
60
61 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
62 Include scanner here, using macros from tests/local.at.
63 (AT_DATA_CALC_Y): Remove final argument.
64 (_AT_CHECK_JAVA_CALC): Likewise.
65 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
66 of %locations and %error-verbose.
67 (main): Test with and without %lex-param.
68 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
69 (AT_BISON_OPTION_POPDEFS): Pop it.
70
71 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
72
73 DJGPP spefic issue. Inhibit the use of disallowed characters for
74 file name genertion on Win98, WinXP, etc. These are |<>":?*\
75 and concern testsuite case 46.
76 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
77 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
78 * djgpp/config.bat: Inhibit the use of disallowed characters.
79
80 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
81
82 Miscellaneous %define and %code cleanup.
83 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
84 values are interpreted.
85 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
86 documentation a little more.
87 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
88 muscle_percent_define_insert, muscle_percent_code_grow): New
89 functions/macros.
90 * src/muscle_tab.h (muscle_percent_define_insert,
91 muscle_percent_code_grow): Prototype.
92 * src/parse-gram.y (prologue_declaration): Use
93 muscle_percent_define_insert and muscle_percent_code_grow when parsing
94 %define and %code directives.
95
96 Make it easy to share %define boolean variables between the front-end
97 and back-end. Though not used yet, this will be useful in the future.
98 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
99 Bison uses of names rather than just skeleton uses of names.
100 (b4_percent_define_get, b4_percent_define_ifdef): Rename
101 b4_percent_define_skeleton_variables(VARIABLE) to
102 b4_percent_define_bison_variables(VARIABLE).
103 (b4_percent_code_get, b4_percent_code_ifdef): Rename
104 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
105 b4_percent_code_bison_qualifiers(QUALIFIER).
106 (b4_check_user_names_wrap): Update for renames.
107 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
108 muscle_percent_define_default): New functions mimicking
109 b4_percent_define_flag_if and b4_percent_define_default.
110
111 For %define variables, report locations for invalid values and
112 redefinitions.
113 * data/bison.m4 (b4_percent_define_flag_if): Read
114 b4_percent_define_loc(VARIABLE) to report the location of an invalid
115 value for VARIABLE.
116 (b4_percent_define_default): Save a special location in
117 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
118 must later be reported as invalid.
119 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
120 functions.
121 (muscle_percent_define_insert): Record the location of VARIABLE in
122 muscle percent_define_loc(VARIABLE), and use it to report the previous
123 location for a redefinition.
124 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
125 (muscle_percent_define_default): Update like b4_percent_define_default.
126 (muscle_grow_user_name_list): Rename to...
127 (muscle_user_name_list_grow): ... this for consistency and use
128 muscle_location_grow.
129 * src/muscle_tab.h (muscle_location_grow): Prototype.
130 * tests/input.at (%define errors): Update expected output.
131 * tests/skeletons.at (%define boolean variables: invalid skeleton
132 defaults): New test case.
133
134 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
135
136 * src/print.c (lookahead_set, state_default_rule): Remove.
137 (print_reductions): Replace state_default_rule invocation with
138 equivalent use of yydefact, which was computed in token_actions in
139 tables.c.
140 (print_results): Don't allocate lookahead_set.
141
142 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
143
144 * data/lalr1.java: Prefix all private members with yy.
145
146 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
147
148 Use YYFPRINTF instead of fprintf where appropriate. Reported by
149 Sebastien Fricker at
150 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
151 * THANKS: Add Sebastien Fricker.
152 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
153 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
154 accept a variable number of arguments.
155
156 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
157
158 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
159
160 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
161
162 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
163 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
164 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
165
166 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
167
168 Undo my 2007-02-07 change, switching back to the c-strcase module
169 introduced in the 2007-02-03 change. Bruno Haible reported that
170 the 2007-02-07 change would be dangerous in Turkish if we add a
171 language whose name contains "i", since "i" is not lowercase "I"
172 in Turkish.
173 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
174 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
175 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
176 * m4/.cvsignore: Remove strcase.m4.
177 * src/getargs.c: Revert 2007-02-07 change, as follows.
178 Include c-strcase.h.
179 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
180
181 2007-02-11 Bruno Haible <bruno@clisp.org>
182
183 Enable the Java related testsuite tests when the only Java compiler
184 found is a gcj < 4.3. Discussed at
185 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
186 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
187
188 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
189
190 * data/Makefile.am: Update copyright date.
191 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
192 yypstate_new returns NULL.
193 (yypstate_new): Return NULL if malloc does.
194 * src/reader.c (packgram): Move translation of rule actions from the
195 beginning of packgram to...
196 (check_and_convert_grammar): ... here right before packgram is invoked
197 so it's easier to write more complete comments, and remove redundant
198 code.
199
200 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
201
202 As in semantic actions, make @$ in %initial-action, %destructor, and
203 %printer imply %locations.
204 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
205 scanning @$.
206 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
207 (@$ in %initial-action implies %locations,
208 @$ in %destructor implies %locations,
209 @$ in %printer implies %locations): ... these new test cases.
210
211 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
212
213 Undo most of the 2007-02-03 change, switching to the strcase module
214 now that gnulib strcase has been fixed.
215 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
216 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
217 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
218 * m4/.cvsignore: Add strcase.m4.
219 * src/getargs.c: Revert 2007-02-03 change, as follows.
220 Don't include c-strcase.h.
221 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
222 strcasecmp has "unspecified behavior" outside the POSIX locale,
223 but it works fine in practice if at least one argument is ASCII,
224 as is the case in Bison.
225
226 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
227
228 * tests/java.at: Skip tests if only one of javac/java is present.
229 Reported by Joel E. Denny.
230 * tests/atlocal.in: Adjust copyright years.
231
232 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
233
234 * data/lalr1.java (Stack): Work around old verifiers that disallow
235 access to the private fields of an inner class, from the outer class.
236 We can make Stack's fields public because user code doesn't have access
237 to the instance of Stack used by parse(). Reported by Paul Eggert.
238
239 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
240
241 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
242 the right spot for these files?
243 * bootstrap.conf (gnulib_modules): Add c-strcase.
244 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
245 c-strncasecmp.c.
246 * src/getargs.c: Include c-strcase.h.
247 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
248 to avoid unspecified behavior.
249
250 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
251
252 * doc/bison.texinfo (Decl Summary): Correct typo.
253
254 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
255
256 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
257 Complain if the value does not match empty, "true" or "false".
258 * data/c++.m4: Adjust default definitions of %define variables.
259 * data/java.m4: Adjust default definitions of %define variables.
260 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
261 to above behavior.
262 * tests/input.at (Boolean %define variables): Test new behavior.
263
264 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
265
266 * NEWS: Mention java.
267 * TODO: Remove things that are done.
268 * bootstrap.conf: Add javacomp-script and javaexec-script.
269 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
270
271 * data/Makefile.am: Add new files.
272 * data/java-skel.m4: New.
273 * data/java.m4: New.
274 * data/lalr1.java: New.
275
276 * doc/bison.texinfo: Put "A Complete C++ Example" under
277 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
278 under Other Languages.
279
280 * src/getargs.c (valid_languages): Add Java.
281 * src/getargs.h (struct bison_language): Update size of string fields.
282
283 * tests/Makefile.am: Add java.at.
284 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
285 * tests/java.at: New.
286 * tests/testsuite.at: Include it.
287
288 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
289
290 Clean up.
291 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
292 at_directive_argv arguments so these no longer have to be global
293 variables. Also, update the implementation for the following changes.
294 (fail_for_at_directive_too_many_args,
295 fail_for_at_directive_too_few_args): Add at_directive_name argument.
296 (at_directive_name): Remove as at_directive_argv[0] will be used for
297 this now.
298 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
299 for the directive name.
300 (at_directive_argc, at_directive_argv): Make these local within
301 skel_lex instead of global.
302 (INITIAL): Update directive start action for above changes.
303 (SC_AT_DIRECTIVE_ARG): Rename to...
304 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
305 (SC_AT_DIRECTIVE_SKIP_WS): Update.
306 (scan_skel): Move yylex_destroy to...
307 (skel_scanner_free): ... here.
308 * tests/skeletons.at (installed skeleton file name): Rename to...
309 (installed skeleton file names): ... this.
310
311 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
312
313 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
314 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
315 Summary" not "Directives".
316 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
317 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
318 since the former is now the more complete one.
319 (Prologue Alternatives): Likewise and do the same for %defines.
320 (Table of Symbols): Add summary of %code, add summary of %define, and
321 move full %code documentation to...
322 (Decl Summary): ... here for consistency with other entries in these
323 sections.
324 Move %define entry in order to keep this list alphabetized.
325 Reword %define entry a little to put less emphasis on the skeleton
326 concept, which most users shouldn't have to think about.
327
328 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
329
330 Adjust to recent gnulib changes.
331 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
332 Add string.h, string_.h, unistd_.h, wchar_.h.
333 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
334 * src/system.h: Don't include <stpcpy.h>; this is now done by
335 <string.h>.
336
337 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
338
339 Simplify implementation of unqualified %code, implement macros for
340 uniform treatment of boolean %define flags. Document %define.
341 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
342 b4_percent_code_ifdef): New.
343 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
344 * data/c++.m4: Define default value for global_tokens_and_yystype.
345 * data/glr.cc: Likewise.
346 * data/location.cc: Use b4_percent_define_flag_if.
347
348 * doc/bison.texinfo (Decl Summary): Document %define.
349
350 * src/parse-gram.y (Unqualified %code): Change muscle name to
351 b4_percent_code().
352 (content.opt): Default to empty.
353
354 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
355
356 Implement support for relative and absolute skeleton file names.
357 Discussed starting at
358 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
359 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
360 (Bison Options): Document in --skeleton entry.
361 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
362 full_skeleton can't necessarily hold all of pkgdatadir.
363 If the specified skeleton file name contains a `/', don't prepend
364 pkgdatadir.
365 * src/parse-gram.y (prologue_declaration): If the specified skeleton
366 file name contains a `/', prepend the grammar file directory.
367 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
368 * skeletons.at: New file.
369 (relative skeleton file names): New test case.
370 (installed skeleton file names): New test case.
371 * tests/testsuite.at: Include skeletons.at.
372
373 * bootstrap: Update copyright to 2007.
374
375 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
376
377 * bootstrap: Remove occurrences of .#bootmp from the files.
378
379 2007-01-17 Akim Demaille <akim@epita.fr>
380
381 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
382 nonterminals.
383 Use per-type %printer.
384
385 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
386
387 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
388 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
389 djgpp/config.site, src/files.c, src/files.h, src/main.c,
390 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
391 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
392 tests/glr-regression.at, tests/input.at, tests/local.at,
393 tests/output.at, tests/torture.at: Update copyright to 2007.
394
395 2007-01-16 Akim Demaille <akim@epita.fr>
396
397 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
398 error code.
399 (Calc++ Scanner): Exit with failure if we can't open the input
400 file.
401 Accept "-" standing for stdin.
402 (Calc++ Top Level): Print the result only if the parsing was
403 successful.
404
405 2007-01-16 Akim Demaille <akim@epita.fr>
406
407 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
408
409 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
410 and Joel E. Denny <jdenny@ces.clemson.edu>
411
412 Clean up %define and %code implementation in M4 some. Most
413 importantly, rename all related macros to be in the b4_percent_define
414 and b4_percent_code namespaces. Also, complete support for `.' in
415 %define variable names and %code qualifiers.
416 * data/bison.m4 (b4_check_user_names): Check for special
417 "SKELETON-NAMESPACE(name)" macros instead of using two nested
418 m4_foreach loops.
419 (b4_get_percent_define, b4_get_percent_code): Rename to...
420 (b4_percent_define_get, b4_percent_code_get): ... these.
421 Extend documentation with examples.
422 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
423 b4_percent_define_skeleton_variables and
424 b4_percent_code_skeleton_qualifiers.
425 Expect any value for the %define variable `foo' to be stored in the
426 macro named `b4_percent_define(foo)'; expect any %code blocks for the
427 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
428 expect any unqualified %code blocks to be stored in a macro named
429 `b4_percent_code_unqualified'.
430 Use m4_indir so that %define variable names and %code qualifiers can
431 contain `.', which is allowed by the grammar parser.
432 (b4_percent_define_default): New macro to set a default value for a
433 %define variable.
434 (m4_wrap): Update wrapped code, and fix some underquoting.
435 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
436 Expect grammar uses of %define variables and %code qualifiers to be
437 defined in b4_percent_define_user_variables and
438 b4_percent_code_user_qualifiers.
439 * data/c++.m4: Use b4_percent_define_default rather than
440 m4_define_default. Fix some underquoting. Skeleton usage of %define
441 variable define_location_comparison now implies skeleton usage of
442 %define variable filename_type.
443 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
444 data/push.c, data/yacc.c: Update macro names.
445 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
446 muscle names.
447
448 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
449
450 DJGPP specific issues.
451
452 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
453 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
454
455 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
456
457 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
458 run parsers in all tests so that Valgrind is invoked during
459 maintainer-check-valgrind.
460 (Duplicate representation of merged trees): Free all semantic values.
461 (Duplicated user destructor for lookahead): Likewise.
462
463 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
464
465 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
466 command-line prefix.
467 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
468 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
469 miss Valgrind messages.
470 (Exploding the Stack Size with Malloc): Likewise.
471
472 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
473
474 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
475 locals. Reported by Juan Manuel Guerrero at
476 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
477 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
478 Fix some indentation also.
479 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
480 explaining this issue.
481
482 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
483 and Joel E. Denny <jdenny@ces.clemson.edu>
484
485 Simplify union and prologue handling, and escape union and lex/parse
486 params with digraphs.
487 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
488 values to the empty string since these are no longer guaranteed
489 initialized by the front-end.
490 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
491 braces around b4_user_stype since this is no longer done by the
492 front-end.
493 * src/files.c, src/files.h (pre_prologue_obstack,
494 post_prologue_obstack): Remove.
495 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
496 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
497 with digraphs. This fixes lex params and parse params.
498 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
499 * src/output.c (prepare): Remove muscle insertion of the prologues.
500 (output): Remove freeing of pre_prologue_obstack and
501 post_prologue_obstack.
502 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
503 than prologue_augment for prologue parsing so you don't need prologue
504 obstacks.
505 (grammar_declaration): For %union RHS, use `braceless' instead of
506 "{...}" so that braces are already stripped and code is escaped with
507 digraphs.
508 * src/reader.c (prologue_augment): Remove.
509 (reader): Remove initialization of pre_prologue_obstack and
510 post_prologue_obstack.
511 * src/reader.h (prologue_augment): Remove.
512
513 * data/c.m4: Remove stray parenthesis.
514
515 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
516
517 Remove quotes from variables names in %define directives and from
518 qualifiers in %code directives, and restrict the characters that are
519 allowed in them to M4-friendly ones. For %define, continue to support
520 the quoted form as a deprecated feature. Discussed starting at
521 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
522 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
523 %code.
524 * doc/bison.texinfo (Prologue Alternatives): Update.
525 (Bison Declaration Summary): In %defines entry, update mention of
526 `%code requires' and `%code provides'.
527 (C++ Location Values): Update %define uses.
528 (Calc++ Parser Interface): Likewise.
529 (Calc++ Parser): Likewise, and update `%code requires' uses.
530 (Table of Symbols): Update %code documentation.
531 * src/parse-gram.y (prologue_declaration): For %define variables, use
532 `variable' instead of `STRING'.
533 (grammar_declaration): For %code qualifiers, use `ID' instead of
534 `STRING'.
535 (variable): New nonterminal that takes an `ID' or a `STRING'.
536 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
537 and %define uses.
538 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
539 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
540 (%define errors): Update %define uses.
541
542 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
543
544 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
545 instead of muscle_insert for %define values so that M4-special
546 characters are replaced with digraphs.
547 * tests/input.at (%define errors): Extend to check weird values.
548
549 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
550
551 Instead of having skeletons declare all valid %define variables and
552 %code qualifiers, provide macros that retrieve the associated values
553 and build these lists automatically. Thus Bison will now warn when a
554 variable or qualifier is not used by the skeleton in the current
555 invocation regardless of whether it might sometimes be used by that
556 skeleton in other invocations. Also, move all %define value macros to
557 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
558 form, which is replaced by %code.
559 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
560 (b4_check_user_names): ... this, and change the series of valid name
561 arguments to a single list argument for names used in the skeleton
562 similar to the existing list argument for names used in the grammar.
563 Warn instead of complaining.
564 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
565 values and %code code, to format %code code properly, and to build
566 lists of all %define variables and %code qualifiers used in the
567 skeleton: b4_skeleton_percent_define_variables and
568 b4_skeleton_percent_code_qualifiers.
569 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
570 Remove, and...
571 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
572 the skeleton names lists can finish building first. In place of
573 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
574 expect the lists b4_user_percent_define_variables and
575 b4_user_percent_code_qualifiers.
576 * data/c++.m4: Where setting default values for b4_parser_class_name,
577 b4_location_type, b4_filename_type, b4_namespace, and
578 b4_define_location_comparison, update their names to the
579 b4_percent_define_ namespace.
580 * data/glr.c: Don't use b4_check_percent_define_variables and
581 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
582 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
583 (b4_parser_class_name, b4_namespace): Define these using
584 b4_get_percent_define for parser_class_name and namespace.
585 * data/location.cc: Use b4_get_percent_define.
586 * data/push.c: Don't use b4_check_percent_define_variables and
587 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
588 * data/yacc.c: Likewise, and don't call m4_exit in
589 b4_use_push_for_pull_if or m4_wrap code will never execute.
590 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
591 Rename to...
592 (muscle_grow_user_name_list): ... this for consistency with the
593 terminology used in bison.m4.
594 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
595 %define variable names, and rename muscle used_percent_define_variables
596 to user_percent_define_variables.
597 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
598 user_percent_code_qualifiers.
599 (content): Remove.
600 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
601 {CODE} form is no longer accepted.
602 * tests/input.at (Reject bad %code qualifiers): Rename to...
603 (Reject unused %code qualifiers): ... this, and update test output.
604 (%define error): Update test output.
605
606 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
607
608 Check for unrecognized %define variables similar to checking for
609 unrecognized %code qualifiers. Check for redefined %define variables.
610 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
611 generalizes...
612 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
613 (b4_check_percent_define_variables): New, also wraps it.
614 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
615 variables using b4_check_percent_define_variables.
616 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
617 all those exercised in the test suite and all those listed in the
618 `Default values' section of c++.m4. Are there others?
619 * data/push.c, data/yacc.c: Declare no valid %define variables.
620 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
621 similar to muscle_find, but it works even when the muscle stores a
622 const value.
623 (muscle_grow_used_name_list): New function for constructing the used
624 name list muscles that b4_check_for_unrecognized_names requires.
625 * src/parse-gram.y (prologue_declaration): Warn if a variable is
626 %define'd more than once. Define the b4_used_percent_define_variables
627 muscle with muscle_grow_used_name_list.
628 (grammar_declaration): Abbreviate %code code with
629 muscle_grow_used_name_list.
630 * tests/input.at (%define errors): New.
631
632 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
633
634 Provide warn_at, complain_at, and fatal_at function callbacks to the
635 skeletons, and use this for %code qualifier complaints.
636 * data/bison.m4 (b4_error_at): New, invoked by...
637 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
638 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
639 @fatal_at(...@) directives.
640 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
641 qualifiers in b4_used_percent_code_qualifiers and to use
642 b4_complain_at.
643 * src/location.c, src/location.h (boundary_set_from_string): New global
644 function.
645 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
646 function.
647 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
648 to b4_used_percent_code_qualifiers.
649 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
650 function.
651 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
652 (lineno): Rename to...
653 (out_lineno): ... this so I don't misunderstand it again.
654 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
655 here; these newlines are in the input but not the output file.
656 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
657 (at_directive_perform): ... this new static function, and add handling
658 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
659 directives.
660 * tests/input.at (Reject bad %code qualifiers): Update test output with
661 locations and extend.
662
663 * tests/output.at (Output file name: [, Output file name: ]): Remove
664 bogus comment about these tests failing.
665
666 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
667
668 Clean up b4_check_percent_code_qualifiers a little.
669 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
670 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
671 documentation and add examples.
672 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
673 qualifiers here.
674
675 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
676
677 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
678 unreliable -- especially when they're hidden inside another macro.
679 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
680 data/c.m4: Remove m4_divert(-1).
681 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
682 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
683 m4_divert_push(0) and m4_divert_pop(0).
684 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
685 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
686 pushed and popped by m4sugar, should be first on the stack.
687
688 Provide warn, complain, and fatal function callbacks to the skeletons.
689 This provides more flexibility than m4_fatal, improves the error
690 message format, and captures messages for translation. Discussed
691 starting at
692 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
693 * data/bison.m4 (b4_error): New, invoked by...
694 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
695 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
696 directives. Because these M4 macros might be called when the current
697 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
698 the previous removal of uses of m4_divert, which caused trouble.
699 (b4_check_percent_code_qualifiers): Use b4_complain instead of
700 m4_fatal to report unrecognized %code qualifiers.
701 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
702 push parser requests.
703 * data/glr.c: Use b4_complain instead of m4_fatal to report
704 non-deterministic push parser requests.
705 Update @output usage to @output(...@) form.
706 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
707 report missing %defines. Update @output usage to @output(...@) form.
708 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
709 @output(...@) form.
710 * src/main.c (main): Invoke skel_scanner_free.
711 * src/scan-skel.h (skel_scanner_free): Prototype new function.
712 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
713 obstack_for_string from flex-scanner.h.
714 (YY_DECL): Use to declare skel_lex static.
715 (decode_at_digraphs): Remove; now handled in the new
716 SC_AT_DIRECTIVE_ARG start condition.
717 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
718 functions.
719 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
720 at_directive_argv): New static globals.
721 (INITIAL): Use fail_for_invalid_at.
722 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
723 recognize the start of a generalized `@directive(...@)' form and
724 start...
725 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
726 directive args (using the new obstack_for_string), to decode the
727 contained @ diagraphs, and to perform the directive. It recognizes
728 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
729 @output(...@).
730 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
731 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
732 `@,'.
733 (scan_skel): Initialize obstack_for_string on the first call.
734 (skel_scanner_free): New function to free obstack_for_string.
735 * tests/input.at (Reject bad %code qualifiers): Update test output.
736
737 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
738
739 Consolidate the 4 prologue alternative directives (%code, %requires,
740 %provides, and %code-top) into a single %code directive with an
741 optional qualifier field. Discussed at
742 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
743 * NEWS (2.3a+): Rewrite the existing entry for the prologue
744 alternatives.
745 * doc/bison.texinfo (Prologue Alternatives): Update.
746 (Decl Summary): Update to %code "requires" and %code "provides".
747 (Calc++ Parser): Update to %code "requires".
748 (Table of Symbols): Remove entries for %requires, %provides, and
749 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
750 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
751 are replaced by b4_percent_code_provides and b4_percent_code_requires,
752 which are skeleton-specific.
753 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
754 declare what %code qualifiers it supports and to complain if any other
755 qualifiers were used in the grammar.
756 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
757 and b4_user_code([b4_percent_code_provides]) in place of
758 b4_user_requires and b4_user_provides.
759 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
760 Add b4_user_code([b4_percent_code_top]) and
761 b4_user_code([b4_percent_code]).
762 Invoke b4_check_percent_code_qualifiers.
763 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
764 PERCENT_REQUIRES): Remove.
765 (grammar_declaration): Remove RHS's for %code-top, %provides, and
766 %requires. Rewrite the %code RHS as the unqualified form defining the
767 muscle b4_percent_code. Add another RHS for the qualified %code form,
768 which defines muscles of the form b4_percent_code_QUALIFIER and the
769 b4_used_percent_code_qualifiers muscle.
770 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
771 PERCENT_REQUIRES): Remove.
772 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
773 %code "requires" and %code "provides".
774 * tests/input.at (Reject bad %code qualifiers): New.
775
776 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
777
778 Use the new code_props interface for destructors and printers.
779 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
780 printer_location members, and change the type of the destructor and
781 printer members to code_props.
782 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
783 symbol_printer_get, semantic_type_destructor_set,
784 semantic_type_printer_set, default_tagged_destructor_set,
785 default_tagless_destructor_set, default_tagged_printer_set,
786 default_tagless_printer_set): Use code_props in arguments and return
787 types in place of char const * and location.
788 (symbol_destructor_location_get, symbol_printer_location_get): Remove
789 since the locations are now contained in the return of
790 symbol_destructor_get and symbol_printer_get.
791 * src/output.c (symbol_destructors_output, symbol_printers_output):
792 Replace with...
793 (symbol_code_props_output): ... this to eliminate duplicate code.
794 (output_skeleton): Update to use symbol_code_props_output.
795 * src/reader.c (symbol_should_be_used): Update use of
796 symbol_destructor_get.
797 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
798 Update uses of the various _destructor_set and _printer_set functions.
799 * src/symtab.c: (default_tagged_destructor_location,
800 default_tagless_destructor_location, default_tagged_printer_location,
801 default_tagless_printer_location): Remove since we...
802 (default_tagged_destructor, default_tagless_destructor,
803 default_tagged_printer, default_tagless_printer): ... change the type
804 of these to code_props.
805 (symbol_new, semantic_type_new, symbol_destructor_set,
806 semantic_type_destructor_set, symbol_destructor_get,
807 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
808 symbol_check_alias_consistency, default_tagged_destructor_set,
809 default_tagless_destructor_set, default_tagged_printer_set,
810 default_tagless_printer_set): Update.
811 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
812 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
813 code_props members.
814 (symbol_print): Use SYMBOL_CODE_PRINT.
815
816 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
817
818 Use the new code_props interface for rule actions.
819 * src/symlist.h (symbol_list): Replace action, action_location, and
820 used members with a code_props action_props member.
821 * src/reader.c (symbol_should_be_used, grammar_rule_check,
822 grammar_midrule_action, grammar_current_rule_merge_set,
823 grammar_current_rule_symbol_append, packgram): Update.
824 * src/scan-code.h (translate_rule_action): Remove, no longer used.
825 * src/scan-code.l (handle_action_dollar): Update.
826 (translate_rule_action): Remove, no longer used.
827 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
828
829 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
830
831 Use the new code_props interface in parse-gram.y.
832 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
833 Update all uses of translate_* functions to use the new code_props
834 interface and to use gram_scanner_last_string_free and
835 code_scanner_last_string_free where possible.
836 (grammar_declaration): symbol_list_destructor_set and
837 symbol_list_printer_set now perform the translation, so don't do it
838 here. Use gram_scanner_last_string_free where possible.
839 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
840 translate_code): Remove, no longer used.
841 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
842 symbol_list_printer_set): Perform code translation here rather than
843 depending on the caller to do so.
844
845 * src/symlist.h (struct symbol_list): Correct some documentation typos.
846 * src/scan-gram.h (gram_last_string): Remove declaration.
847 * src/scan-gram.l (last_string): Declare it static.
848
849 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
850
851 Encapsulate code properties and related functionality for the various
852 destructors, printers, and actions into a code_props structure and
853 interface. This patch merely implements code_props in scan-code.h and
854 scan-code.l. Future patches will rewrite other modules to use it.
855 Discussed starting at
856 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
857 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
858 consistently initialize const structs that have an empty location
859 field.
860 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
861 to ensure consistency.
862 * src/scan-code.h (code_props): New structure.
863 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
864 function, macro, and const global variable for initializing a
865 code_props with no code.
866 (code_props_plain_init, code_props_symbol_action_init,
867 code_props_rule_action_init, code_props_translate_code): The rest of
868 the new code_props functional interface. Among other things, the init
869 functions set the code_props kind field so that
870 code_props_translate_code will know whether to behave like
871 translate_symbol_action, translate_rule_action, or translate_code.
872 These old translate functions must remain until all other modules are
873 updated to use the new code_props interface.
874 (code_scanner_last_string_free): New function similar to
875 gram_scanner_last_string_free.
876 (code_scanner_free): Add documentation.
877 * src/scan-code.l: Implement the new interface.
878 (code_lex): Make it static, add a code_props* argument, and remove the
879 rule argument.
880 (last_string): New static global similar to the one in scan-gram.l.
881 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
882 instead of rule.
883 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
884 code_props since Bison may one day use this information for destructors
885 and printers.
886 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
887 (handle_action_dollar): Use symbol_list_n_get and set used flag
888 directly since symbol_list_n_used_set is removed.
889 (translate_action): Add a code_props* argument and remove the rule,
890 action, and location arguments. Pass the code_props* on to code_lex.
891 (translate_rule_action, translate_symbol_action, translate_code):
892 Rewrite as wrappers around the new code_props interface.
893 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
894 it would eventually need to break the encapsulation of code_props.
895
896 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
897
898 * etc/.cvsignore: New.
899
900 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
901
902 Add maintainer-push-check to run maintainer-check using push parsing in
903 place of pull parsing where available.
904 * Makefile.am (maintainer-push-check): New.
905 * data/bison.m4 (b4_use_push_for_pull_if): New.
906 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
907 appropriately based on their existing values.
908 (yypush_parse): Don't print push-parser-specific diagnostics if push
909 parsing is being used in place of pull parsing.
910 * data/yacc.c: If push parsing should replace pull parsing, redirect to
911 push.c.
912 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
913 variable, and insert b4_use_push_for_pull_flag into muscles.
914 * tests/Makefile.am (maintainer-push-check): New.
915
916 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
917
918 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
919 (whether successful or failed) so that yypush_parse can be invoked
920 again to start a new parse using the same yypstate.
921 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
922 check multiple yypull_parse invocations on the same yypstate. For pull
923 mode, extend to check multiple yyparse invocations.
924 (Exploding the Stack Size with Alloca): Extend to try with
925 %push-pull-parser.
926 (Exploding the Stack Size with Malloc): Likewise.
927
928 * tests/calc.at (Simple LALR Calculator): Don't specify
929 %skeleton "push.c" since %push-pull-parser implies that now.
930 * tests/headers.at (export YYLTYPE): Don't check for the push
931 declarations. Otherwise, this test case can't be used to see if push
932 mode can truly emulate pull mode.
933 * tests/input.at (Torturing the Scanner): Likewise.
934 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
935 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
936 AT_YACC_IF, which now includes the case of push mode since %skeleton
937 need not be used for push mode. This will be more intuitive once
938 push.c is renamed to yacc.c.
939
940 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
941
942 For push mode, convert yyparse from a macro to a function, invoke yylex
943 instead of passing a yylexp argument to yypull_parse, and don't
944 generate yypull_parse or yyparse unless %push-pull-parser is declared.
945 Discussed starting at
946 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
947 * data/bison.m4 (b4_pull_if): New.
948 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
949 * data/push.c: Improve M4 quoting a little.
950 (b4_generate_macro_args, b4_parenthesize): Remove.
951 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
952 any time a pull parser is requested.
953 Don't #define this as a wrapper around yypull_parse. Instead, when
954 both push and pull are requested, make it a function that does that
955 same thing.
956 (yypull_parse): If there's a b4_prefix, #define this to
957 b4_prefix[pull_parse] when both push and pull are requested.
958 Don't define this as a function unless both push and pull are
959 requested.
960 Remove the yylexp argument and hard-code yylex invocation instead.
961 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
962 %push-parser.
963 * src/getargs.c (pull_parser): New global initialized to true.
964 * getargs.h (pull_parser): extern it.
965 * src/output.c (prepare): Insert pull_flag muscle.
966 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
967 (prologue_declaration): Set both push_parser and pull_parser = true for
968 %push-pull-parser. Set push_parser = true and pull_parser = false for
969 %push-parser.
970 * src/scan-gram.l: Don't accept %push_parser as an alternative to
971 %push-parser since there's no backward-compatibility concern here.
972 Scan %push-pull-parser.
973 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
974 instead of %push-parser.
975 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
976 prototype it in the module that calls yyparse.
977 * tests/input.at (Torturing the Scanner): Likewise.
978 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
979
980 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
981
982 Update etc/bench.pl. Optimize push mode a little (the yyn change
983 deserves most of the credit).
984 * Makefile.am (SUBDIRS): Add etc subdirectory.
985 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
986 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
987 yytoken, yyval, and yyloc declarations to...
988 (yyparse or yypush_parse): ... here to improve performance. For
989 yypush_parse invocations after the first, be sure to assign yyn its old
990 value again.
991 (yypstate_new): Don't bother initializing the yyresult field since the
992 initial value isn't used.
993 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
994 remove the #define that, in push mode, set it to yyps->NAME.
995 * etc/Makefile.am: New.
996 * etc/bench.pl: Remove and build it instead from...
997 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
998 "tests/bison" from the build directory by default rather than just
999 invoking "bison" from $PATH.
1000 (calc_grammar): Update push parser code: don't declare yylval globally,
1001 don't define yyparse_wrapper, and don't #define yyparse.
1002 (bench_grammar): Update to check all working combinations of yacc.c,
1003 push.c, impure, pure, pull, and push.
1004
1005 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1006
1007 For push mode, add pull wrappers around yypush_parse.
1008 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
1009 (yypull_parse): New function wrapping yypush_parse.
1010 (yyparse): New #define wrapping yypull_parse.
1011 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
1012 is declared.
1013 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
1014 prototype yylex in the module that calls yyparse, and don't prototype
1015 yyparse there. Otherwise, the yyparse expansion won't compile.
1016 * tests/input.at (Torturing the Scanner): Likewise.
1017
1018 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1019
1020 Enable push parsers to operate in impure mode. Thus, %push-parser no
1021 longer implies %pure-parser. The point of this change is to move
1022 towards being able to test the push parser code by running the entire
1023 test suite as if %push-parser had been declared.
1024 * data/push.c (yypush_parse): For impure mode, remove the
1025 yypushed_char, yypushed_val, and yypushed_loc arguments.
1026 Instead, declare these as local variables initialized to the global
1027 yychar, yylval, and yylloc.
1028 For the first yypush_parse invocation only, restore the initial values
1029 of these global variables when it's time to read a token since they
1030 have been overwritten.
1031 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
1032 %push-parser.
1033 * tests/calc.at (Simple LALR(1) Calculator): Always declare
1034 %pure-parser along with %push-parser since this test case was designed
1035 for pure push parsers.
1036 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
1037 (AT_YACC_OR_PUSH_IF): New.
1038 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
1039 add a note that it's still wrong for some cases (as it has been for a
1040 while).
1041 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
1042 %push-parser no longer implies %pure-parser.
1043
1044 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1045
1046 Remove some unnecessary differences between the pull parser code and
1047 the push parser code. This patch enables yynerrs in push mode.
1048 * data/push.c: Reformat M4 a little.
1049 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
1050 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
1051 because push mode is on. Instead, if pure mode is on, move yynerrs
1052 to...
1053 (b4_declare_parser_state_variables): ... here.
1054 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
1055 to yyps->NAME so it can be used in yypush_parse.
1056 (yypush_parse): Don't omit uses of yynerrs in push mode.
1057
1058 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1059
1060 Fix bug such that the first pushed token's value and location are
1061 sometimes overwritten (sometimes by %initial-action) before being used.
1062 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
1063 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
1064 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
1065 more closely mimic the pull parser logic.
1066 Don't copy the pushed token to yychar, yylval, and yylloc until it's
1067 time to read a token, which is after any initialization of yylval and
1068 yylloc.
1069 (gottoken): Rename label to...
1070 (yyread_pushed_token): ... for clarity and to avoid infringing on the
1071 user namespace.
1072
1073 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1074
1075 Rearrange initialization of the parser state variables so that the
1076 skeleton doesn't have to have a copy for pull mode and another for push
1077 mode. This patch also fixes at least a bug such that yylloc was not
1078 initialized (with b4_location_initial_line and
1079 b4_location_initial_column) upon calling yypush_parse. However, that
1080 initialization now overwrites the first token's location;
1081 %initial-action assigning @$ already did the same thing, and both bugs
1082 will be fixed in a later patch.
1083 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
1084 (b4_declare_parser_state_variables): Remove initialization of yytoken,
1085 yyss, yyvs, yyls, and yystacksize.
1086 (yypstate_new): Remove initialization of some yypstate fields: yystate,
1087 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
1088 yylsp.
1089 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
1090 yyps->NAME so it can be used in yypush_parse.
1091 (yyparse or yypush_parse): For yypush_parse, don't print the
1092 "Starting parse" diagnostic for invocations after the first.
1093 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
1094 yypush_parse, only do it for the first invocation.
1095 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
1096 initialization to occur in yypush_parse but only on the first
1097 invocation.
1098
1099 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1100
1101 * data/push.c: Add CPP guards around push parser declarations in both
1102 the header and the code file.
1103 In the code file, move the push parser declarations to the same place
1104 they appear in the header file.
1105 Clean up the M4 some, especially the inconsistent underquoting in
1106 some b4_c_function_def and b4_c_function_decl uses.
1107
1108 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1109
1110 Encapsulate the push parser state variables into an M4 macro so the
1111 push skeleton doesn't have to list them again for pull mode's yyparse.
1112 For push mode, remove yypush_parse's local equivalents of these
1113 variables to eliminate unnecessary copying between the two sets at
1114 run-time. This patch also fixes at least a bug related to multiple
1115 %initial-action invocations in push mode.
1116 * data/push.c (b4_declare_parser_variables): Rename to...
1117 (b4_declare_scanner_communication_variables): ... this for clarity and
1118 update both uses.
1119 (b4_declare_yyparse_variables): Remove and move its contents to the one
1120 spot where it was invoked.
1121 (b4_declare_parser_state_variables): New macro containing the parser
1122 state variables required by push mode.
1123 (struct yypstate): Replace all fields but yynew with
1124 b4_declare_parser_state_variables.
1125 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
1126 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
1127 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
1128 (yyparse or yypush_parse): For yyparse in pull mode, replace local
1129 parser state variable declarations with
1130 b4_declare_parser_state_variables.
1131 Don't initialize parser state variables when calling yypush_parse since
1132 yypstate_new already does that.
1133 Invoke the user's initial action only upon the first yypush_parse
1134 invocation.
1135 Remove all code that copies between the local parser state variables
1136 and the yypstate.
1137
1138 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1139
1140 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
1141 prevent a name collision in a future patch where these names will
1142 sometimes be #define'd.
1143 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
1144 since it no longer has the same name as the existing argument.
1145 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
1146
1147 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
1148 and Joel E. Denny <jdenny@ces.clemson.edu>
1149
1150 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1151 that the argument is case-insensitive, and there's no `=' here.
1152 For the %skeleton entry, mention that %language is better.
1153 (Bison Options): Likewise for --language and --skeleton. Move the
1154 --skeleton entry so that the `Tuning the parser' section is sorted
1155 alphabetically on long options.
1156 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
1157 %language directive in detail here; cross-reference the %language
1158 documentation instead.
1159 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
1160 `%require "2.3b"' so that the example is always up-to-date.
1161 (Table of Symbols): Add entries for %language and %skeleton.
1162 * examples/extexi (normalize): Instead of replacing every %require
1163 argument with the current Bison version, just substitute for
1164 `@value{VERSION}'. This guarantees that we're testing what actually
1165 appears in the documentation.
1166 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
1167 rather than `@VERSION@'.
1168
1169 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1170
1171 * NEWS: Reword the %language news a bit, and put it earlier.
1172
1173 * src/getargs.c (skeleton_arg): Last arg is now location const *.
1174 Rewrite to simplify the logic.
1175 (language_argmatch): Likewise.
1176 (program_name): We now own this var.
1177 * src/getargs.h (struct bison_language): Use char[] rather than
1178 const char *.
1179
1180 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
1181 Java is supported.
1182 * src/complain.c (program_name): Remove decl; no longer needed.
1183 * src/main.c (program_name): Remove; now belongs to getargs.
1184
1185 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
1186
1187 * NEWS: Document %language.
1188
1189 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
1190
1191 * data/c-skel.m4, data/c++-skel.m4: New files.
1192 * data/glr.c: Complain on push parsers.
1193
1194 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
1195 over %skeleton.
1196 (Decl Summary): Document %language and %skeleton.
1197 (Command line): Document -L.
1198
1199 * examples/extexi: Rewrite %require directive.
1200 * examples/calc++/Makefile.am: Pass VERSION to extexi.
1201
1202 * src/files.c (compute_exts_from_gc): Look in language structure
1203 for .y extension.
1204 (compute_file_name_parts): Check whether .tab should be added.
1205 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
1206 (language, skeleton_arg, language_argmatch): New.
1207 (long_options): Add --language.
1208 (getargs): Use skeleton_arg, add -L/--language.
1209 * src/getargs.h: Include location.h.
1210 (struct bison_language, language, skeleton_arg, language_argmatch): New.
1211 * src/output.c (prepare): Pick default skeleton from struct language.
1212 Don't dispatch C skeletons here.
1213 * src/parse-gram.y (PERCENT_LANGUAGE): New.
1214 (prologue_declaration): Add "%language" rule, use skeleton_arg.
1215 * src/scan-gram.l ("%language"): New rule.
1216
1217 * tests/calc.at: Test %skeleton and %language.
1218 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
1219 (AT_GLR_IF): Look for %skeleton "glr.cc".
1220 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
1221 (AT_YACC_IF): Reject %language.
1222
1223 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1224
1225 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
1226 since it wasn't used; only the typedef name 'semantic_type' is needed.
1227 Also, omit trailing white space.
1228
1229 * bootstrap: Sync from coreutils.
1230 (gnulib_extra_files): Add build-aux/announce.gen.
1231 (slurp): Adjust .gitignore files like .cvsignore files.
1232 * build-aux/announce-gen: Remove from CVS, since bootstrap
1233 now creates this.
1234
1235 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
1236
1237 Make %push-parser imply %pure-parser. This fixes several bugs; see
1238 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
1239 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
1240 pure_parser = true.
1241 * data/push.c: Don't bother testing b4_push_if when deciding whether
1242 to expand b4_declare_parser_variables globally.
1243 (yypush_parse): Likewise in here.
1244
1245 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
1246 (yy_reduce_print): Reformat M4 for readability.
1247
1248 2006-12-15 Bob Rossi <bob@brasko.net>
1249 and Joel Denny <jdenny@ces.clemson.edu>
1250
1251 * data/push.c (yypstate): Add typedef, and update all uses of
1252 struct yypstate to just yypstate.
1253 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
1254
1255 2006-12-14 Bob Rossi <bob@brasko.net>
1256
1257 * data/push.c (yypush_parse): Declare prototype regardless of
1258 %locations option.
1259
1260 2006-12-14 Bob Rossi <bob@brasko.net>
1261
1262 * data/push.c (yyparse): Remove the prototype and the #define when in
1263 push-parser mode.
1264
1265 2006-12-13 Bob Rossi <bob@brasko.net>
1266
1267 * data/push.c (yypstate_init): Rename to...
1268 (yypstate_new): ... this and use b4_c_function_def.
1269 (yypstate_delete): New.
1270 (yypush_parse): Change parameters yynval and yynlloc to be const.
1271 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
1272 yypstate_delete functions.
1273
1274 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
1275
1276 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
1277 strange test case titles. Reported by Bob Rossi.
1278
1279 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
1280
1281 * TODO: Add pointer to Sylvain Schmitz's work on static detection
1282 of potential ambiguities in GLR grammers.
1283
1284 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
1285
1286 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
1287 `bison ', use m4_index instead of m4_substr since chopping up a string
1288 containing M4-special characters causes problems here.
1289
1290 Fix a couple of bugs related to special characters in user-specified
1291 file names, and make it easier for skeletons to compute output file
1292 names with the same file name prefix as Bison-computed output file
1293 names.
1294 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
1295 b4_parser_file_name and b4_spec_defines_file instead of
1296 @output_parser_name@ and @output_header_name@, which are now redundant.
1297 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
1298 b4_parser_file_name, b4_spec_defines_file, and the new
1299 @basename(FILENAME@) instead of @output_parser_name@ and
1300 @output_header_name@, which inappropriately escaped the file names as
1301 C string literals.
1302 * src/files.c (all_but_ext): Remove static qualifier.
1303 (compute_output_file_names): Move `free (all_but_ext)' to...
1304 (output_file_names_free): ... here since all_but_ext is needed later.
1305 * src/files.h (all_but_ext): Extern.
1306 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
1307 exactly what MUSCLE_INSERT_STRING used to do.
1308 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
1309 characters are escaped properly.
1310 * src/output.c (prepare): Define muscle file_name_all_but_ext as
1311 all_but_ext.
1312 For pkgdatadir muscle, maintain previous functionality by using
1313 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
1314 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
1315 digraphs would never be expanded. Hopefully no one has M4-special
1316 characters in his Bison installation path.
1317 * src/scan-skel.l: Don't parse @output_header_name@ and
1318 @output_parser_name@ anymore since they're now redundant.
1319 In @output, use decode_at_digraphs.
1320 Parse a new @basename command that invokes last_component.
1321 (decode_at_digraphs): New.
1322 (BASE_QPUTS): Remove unused.
1323 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
1324 (Output file name): New tests.
1325
1326 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
1327
1328 Warn about output files that are generated by the skeletons and that
1329 conflict with other output files.
1330 * data/glr.c: Don't generate the header file here when glr.cc does.
1331 * src/files.c (file_names, file_names_count): New static globals.
1332 (compute_output_file_names): Invoke output_file_name_check for files
1333 not generated by the skeletons and remove existing checks.
1334 (output_file_name_check): New function that warns about conflicting
1335 output file names.
1336 (output_file_names_free): Free file_names.
1337 * src/files.h (output_file_name_check): Declare.
1338 * src/scan-skel.l: Invoke output_file_name_check for files generated by
1339 the skeletons.
1340 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
1341 (Conflicting output files): New tests.
1342
1343 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1344
1345 * doc/bison.texinfo: Fix a couple of typos.
1346
1347 2006-12-08 Bob Rossi <bob@brasko.net>
1348
1349 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
1350 Rename to...
1351 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
1352 update all uses.
1353 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
1354 (yypush_parse): Rename yypvars argument to yyps and remove redundant
1355 local pv.
1356 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
1357 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
1358
1359 2006-12-07 Bob Rossi <bob@brasko.net>
1360 and Joel Denny <jdenny@ces.clemson.edu>
1361
1362 * data/push.c (yypvarsinit): Change return type from void* to struct
1363 yypvars*. No longer cast to void* on return.
1364 (struct yypvars): Remove yylen since it need not be remembered between
1365 yypushparse invocations.
1366 (yypushparse): Don't copy between yylen and pv->yylen.
1367
1368 2006-12-05 Bob Rossi <bob@brasko.net>
1369
1370 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
1371 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
1372 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
1373 (struct yypvars): Remove b4_declare_parser_variables.
1374 (yypvarsinit): Remove init code for removed variables.
1375 (global scope): Do not declare b4_declare_parser_variables if
1376 push or pure mode.
1377 (yypushparse): Add b4_declare_parser_variables.
1378 Init new local variables, and remove init code for removed
1379 yypvars variables.
1380 (yyparse): Delete.
1381 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
1382 and yyparse for other modes.
1383 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
1384 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
1385 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
1386 (AT_PURE_LEX_IF): True if pure or push parser.
1387
1388 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
1389
1390 Document Yacc prologue alternatives and default %destructor's and
1391 %printer's as experimental. Don't mention Java yet. Discussed at
1392 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
1393 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
1394 (2.3a): Annotate this entry to say the old forms of these features were
1395 also experimental.
1396 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
1397 Table of Symbols): Say they're experimental. Comment out any mention
1398 of Java (we'll want this back eventually).
1399
1400 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1401
1402 Support a file name argument to %defines. Deprecate `=' in
1403 %file-prefix, %name-prefix, and %output. Discussed at
1404 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
1405 * NEWS (2.3a+): Mention.
1406 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
1407 form of %defines, and remove `=' from entries for %file-prefix,
1408 %name-prefix, and %output.
1409 * src/parse-gram.y (prologue_declaration): Implement.
1410 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
1411 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
1412 all but one occurrence of %name-prefix.
1413 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
1414 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
1415 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
1416 occurrence of each of %file-prefix and %output. Add check for %defines
1417 with argument.
1418 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
1419 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
1420 Remove the `=' from %output.
1421
1422 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
1423
1424 Don't escape $ in test case titles since Autoconf 2.61 now does that
1425 correctly.
1426 * tests/actions.at (Default %printer and %destructor are not for error
1427 or $undefined): Here.
1428 (Default %printer and %destructor are not for $accept): Here.
1429 * tests/input.at (Invalid $n and @n): Here.
1430
1431 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
1432
1433 Rename <!> to <>. Discussed starting at
1434 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
1435 * NEWS (2.3a+): Update.
1436 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
1437 Update.
1438 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
1439 * src/scan-gram.l (INITIAL): Implement.
1440 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
1441 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
1442 comment.
1443 * tests/actions.at (Default tagless %printer and %destructor,
1444 Default tagged and per-type %printer and %destructor,
1445 Default %printer and %destructor are not for error or $undefined,
1446 Default %printer and %destructor are not for $accept,
1447 Default %printer and %destructor for mid-rule values): Update.
1448 * tests/input.at (Default %printer and %destructor redeclared,
1449 Unused values with default %destructor): Update.
1450
1451 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1452
1453 Don't let %prec take a nonterminal.
1454 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
1455 token.
1456 * tests/input.at (%prec takes a token): New test checking that %prec
1457 won't take a nonterminal.
1458
1459 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1460
1461 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
1462 it was double-quoted.
1463 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
1464 grammar is maintained with Bison's highest standards.
1465 * src/getargs.c: Fix some typos in Doxygen comments.
1466
1467 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1468
1469 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
1470 later. Reported by Paul Eggert in
1471 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
1472 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
1473 * src/scan-code.l (translate_action): Don't bother invoking
1474 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
1475 (code_scanner_free): Instead of invoking
1476 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
1477 which frees more.
1478 * src/scan-gram.l (gram_scanner_free): Likewise.
1479 * src/scan-skel.l (scan_skel): Likewise.
1480
1481 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
1482
1483 * src/files.c (tr): Change return type to void.
1484 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
1485 has been called previously for the same key.
1486 (muscle_find): Return storage instead of value so that
1487 --enable-gcc-warnings doesn't produce warnings that the return discards
1488 const. aver that the value and storage are the same since storage
1489 could potentially be NULL when value is not.
1490 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
1491 same as 0.
1492
1493 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1494
1495 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
1496 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
1497 us a slightly cleaner distribution, and also works.
1498 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
1499 gnulib changes.
1500
1501 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
1502 and Paul Eggert <eggert@cs.ucla.edu>
1503
1504 Don't let Bison leak memory except when it complains.
1505 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
1506 (spec_defines_file, dir_prefix): Now char *, not const char *,
1507 since they are freed.
1508 * src/files.c: Likewise.
1509 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
1510 Likewise.
1511 (tr): Now operates in-place. All uses changed.
1512 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
1513 values.
1514 (compute_file_name_parts, compute_output_file_names): Don't store
1515 read-only data in variables that will be freed.
1516 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
1517 src_extension, and header_extension.
1518 (output_file_names_free): New public function to free
1519 spec_verbose_file, spec_graph_file, spec_defines_file,
1520 parser_file_name, and dir_prefix.
1521 * src/getargs.c (getargs): Don't store read-only data in variables that
1522 will be freed.
1523 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
1524 (which previously existed but was unused), and quotearg_free.
1525 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
1526 * src/muscle_tab.c: Likewise.
1527 (muscle_entry): Make the value char const *,
1528 and add a new storage member that is char * and can be freed.
1529 (muscle_entry_free): New private function.
1530 (muscle_init): Use it instead of free.
1531 (muscle_insert, muscle_grow): Update and use new storage member.
1532 (muscle_code_grow): Free the string passed to muscle_grow
1533 since it's not needed anymore.
1534 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
1535 add a new `char *code' member.
1536 ("{...}"): Declare semantic type as code.
1537 * src/scan-code.h (translate_rule_action):
1538 (translate_symbol_action, translate_code, translate_action): Return
1539 `char const *' rather than `char *' since external code should not free
1540 these strings.
1541 * src/scan-code.l: Likewise.
1542 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
1543 which is "{...}" in the parser.
1544 * tests/Makefile.am (maintainer-check-valgrind): Set
1545 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
1546 Valgrind.
1547 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
1548 complain.
1549 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
1550 expecting a non-zero exit status sets --leak-check=summary and
1551 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
1552 this case, and we don't want to hear about it.
1553
1554 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1555
1556 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
1557 instead of from the template, to simplify configuration a bit.
1558 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
1559 and m4/wint_t.m4, as they are needed with the latest gnulib.
1560
1561 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1562
1563 Disable unset/unused mid-rule value warnings by default, and recognize
1564 --warnings=midrule-values to enable them. Discussed starting at
1565 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
1566 * NEWS (2.3a+): Mention.
1567 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
1568 warnings): Add entry for midrule-values subargument.
1569 * src/reader.c (symbol_should_be_used): Don't return true just because
1570 the value is a set/used mid-rule value unless
1571 --warnings=midrule-values was specified.
1572 * tests/input.at (Unused values, Unused values before symbol
1573 declarations): Run tests with and without --warnings=midrule-values.
1574
1575 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
1576 than LIST_FREE directly.
1577
1578 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1579
1580 Finish implementing --warnings=error, which should not be implied by
1581 --warnings=all (or by its synonyms -W and --warnings without
1582 subarguments).
1583 * src/complain.c (set_warning_issued): New function to report that
1584 warnings are being treated as errors and to record an error if so.
1585 Invoke...
1586 (warn_at, warn): ... here.
1587 * src/getargs.c (warnings_args, warnings_types): Reorder so that
1588 "error - warnings are errors" does not appear above "all - all of the
1589 above".
1590 (getargs): For -W and --warnings without subarguments, don't let
1591 FLAGS_ARGMATCH set warnings_error in warnings_flag.
1592 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
1593
1594 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1595
1596 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
1597 empty subargument list. For example: `bison --warnings= parser.y'.
1598
1599 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1600
1601 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
1602 the parser header file so that gcc doesn't warn.
1603
1604 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1605
1606 Split the default %destructor/%printer into two kinds: <*> and <!>.
1607 Discussed starting at
1608 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
1609 * NEWS (2.3a+): Mention.
1610 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
1611 previous change today related to mid-rules.
1612 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
1613 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
1614 (TYPE_TAG_ANY): Add as <*>.
1615 (TYPE_TAG_NONE): Add as <!>.
1616 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
1617 for <*> and <!>.
1618 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
1619 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
1620 * src/symlist.c (symbol_list_default_new): Split into tagged and
1621 tagless versions.
1622 (symbol_list_destructor_set, symbol_list_printer_set): Split
1623 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
1624 SYMLIST_DEFAULT_TAGLESS.
1625 * src/symlist.h: Update symbol_list_default*_new prototypes.
1626 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
1627 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
1628 * src/symtab.c (default_destructor, default_destructor_location,
1629 default_printer, default_printer_location): Split each into tagged and
1630 tagless versions.
1631 (symbol_destructor_get, symbol_destructor_location_get,
1632 symbol_printer_get, symbol_printer_location_get): Implement tagged
1633 default and tagless default cases.
1634 (default_destructor_set, default_printer_set): Split each into tagged
1635 and tagless versions.
1636 * src/symtab.h: Update prototypes.
1637 * tests/actions.at (Default %printer and %destructor): Rename to...
1638 (Default tagless %printer and %destructor): ... this, and extend.
1639 (Per-type %printer and %destructor): Rename to...
1640 (Default tagged and per-type %printer and %destructor): ... this, and
1641 extend.
1642 (Default %printer and %destructor for user-defined end token): Extend.
1643 (Default %printer and %destructor are not for error or $undefined):
1644 Update.
1645 (Default %printer and %destructor are not for $accept): Update.
1646 (Default %printer and %destructor for mid-rule values): Extend.
1647 * tests/input.at (Default %printer and %destructor redeclared): Extend.
1648 (Unused values with default %destructor): Extend.
1649
1650 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1651
1652 Don't apply the default %destructor/%printer to an unreferenced midrule
1653 value. Mentioned at
1654 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
1655 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
1656 like $@n instead of just @n so that the default %destructor/%printer
1657 logic doesn't see them as user-defined symbols.
1658 (symbol_is_dummy): Check for both forms of the name.
1659 * src/reader.c (packgram): Remove the `$' from each midrule symbol
1660 name for which the midrule value is referenced in any action.
1661 * tests/actions.at (Default %printer and %destructor for mid-rule
1662 values): New test.
1663 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
1664 for change to dummy symbol names.
1665
1666 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1667
1668 Warn about unset midrule $$ if the corresponding $n is used.
1669 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
1670 $n usage.
1671 (packgram): Before invoking grammar_rule_check on any rule, make sure
1672 all actions have already been scanned in order to set `used' flags.
1673 Otherwise, checking that a midrule's $$ is set will not always work
1674 properly because the midrule check must forward-reference the midrule's
1675 parent rule.
1676 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
1677 warning.
1678
1679 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1680
1681 More improvements to the documentation of the prologue alternatives:
1682 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
1683 Bison manual.
1684 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
1685 some text to clarify the relative importance of the new directives and
1686 to show how these directives may be viewed as code labels.
1687
1688 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
1689
1690 Similar to the recently removed %before-header, add %code-top as the
1691 alternative to the pre-prologue. Mentioned at
1692 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
1693 Also, let the prologue alternatives appear in the grammar section.
1694 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
1695 (prologue_declaration): Move the existing prologue alternatives to...
1696 (grammar_declaration): ... here and add %code-top.
1697 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
1698
1699 Clean up and extend documentation for the prologue alternatives.
1700 * NEWS (2.3a+): Describe prologue alternatives.
1701 * doc/bison.texinfo (Prologue): Move discussion of prologue
1702 alternatives to...
1703 (Prologue Alternatives): ... this new section, and extend it to discuss
1704 all 4 directives in detail.
1705 (Table of Symbols): Clean up discussion of prologue alternatives and
1706 add %code-top.
1707
1708 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1709
1710 DJGPP specific issues.
1711
1712 * djgpp/config.bat: config.hin has been moved to lib. Adjust
1713 config.bat accordingly.
1714 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
1715 * djgpp/config.site: Likewise.
1716
1717 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
1718
1719 Replace %*-header with %provides, %requires, %code. See discussion at
1720 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
1721
1722 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
1723 (b4_user_start_header): Remove.
1724 * data/glr.c: Use new macros instead of b4_*start_header
1725 and b4_*end_header.
1726 * data/glr.cc: Likewise.
1727 * data/lalr1.cc: Likewise.
1728 * data/push.c: Likewise.
1729 * data/yacc.c: Likewise.
1730
1731 * doc/bison.texinfo: Remove %before-header, rename
1732 %{start,end,after}-header to %requires, %provides, %code.
1733
1734 * src/parse-gram.y: Likewise (also rename token names accordingly).
1735 * src/scan-gram.l: Likewise.
1736 * tests/actions.at: Likewise.
1737
1738 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
1739
1740 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
1741 Problem reported by Joel E. Denny.
1742
1743 2006-10-14 Jim Meyering <jim@meyering.net>
1744
1745 (Sync from coreutils.)
1746 Work also when the working directory (with e.g. coreutils sources)
1747 is version controlled with git, rather than CVS.
1748 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
1749 rather than CVS.
1750 In messages and comments, say e.g., "checked-out sources",
1751 rather than "CVS sources".
1752 (version_controlled_file): New function. Work for git as well as
1753 for CVS. Don't use grep's -q option.
1754 (slurp): Call it here, in place of CVS-specific code.
1755
1756 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
1757
1758 Fix testsuite for ./configure --enable-gcc-warnings:
1759 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
1760 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
1761 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
1762 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
1763 * test/regression.at (Diagnostic that expects two alternatives):
1764 Likewise.
1765
1766 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1767
1768 * bootstrap.conf (gnulib_modules): Add config-h.
1769 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
1770 worry about HAVE_CONFIG_H.
1771 * lib/abitset.c: Likewise.
1772 * lib/bitset.c: Likewise.
1773 * lib/bitset_stats.c: Likewise.
1774 * lib/bitsetv-print.c: Likewise.
1775 * lib/bitsetv.c: Likewise.
1776 * lib/ebitset.c: Likewise.
1777 * lib/get-errno.c: Likewise.
1778 * lib/lbitset.c: Likewise.
1779 * lib/subpipe.c: Likewise.
1780 * lib/timevar.c: Likewise.
1781 * lib/vbitset.c: Likewise.
1782 * lib/bitset.c: Include "bitset.h" first, to test interface.
1783 * lib/bitset_stats.c: Include "bitset_stats.h" first.
1784 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
1785 * lib/bitsetv.c: Include "bitsetv.h" first.
1786 * lib/get-errno.c: Include "get-errno.h" first.
1787 * m4/.cvsignore: Add config-h.m4.
1788 * tests/actions.at (Default %printer and %destructor for ...):
1789 Adjust expected line numbers in output to reflect removal of #if
1790 HAVE_CONFIG_H lines.
1791 * tests/glr-regression.at (Missed %merge type warnings when ...):
1792 Likewise.
1793 * tests/regression.at (Braced code in declaration in rules section):
1794 Likewise.
1795 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
1796 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
1797 Include <config.h> unconditionally.
1798
1799 * bootstrap: Sync from coreutils, as follows:
1800
1801 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1802
1803 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
1804 variable was sometimes used without being initialized. This
1805 messed up the installation of the INSTALL file in some cases.
1806
1807 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1808
1809 * bootstrap (usage, main program, symlink_to_gnulib): Add option
1810 --copy. Inspired by a suggestion from Bruno Haible.
1811
1812 2006-10-03 Jim Meyering <jim@meyering.net>
1813
1814 * bootstrap: Undo last change to this file, since now gnulib-tool
1815 sticks with the automake default in generating dependencies.
1816
1817 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1818
1819 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
1820 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
1821
1822 * doc/bison.1: Add copyright notice.
1823
1824 * data/glr.c: Don't include <stdarg.h>; not used.
1825
1826 * NEWS: The -g and --graph options now output graphs in Graphviz
1827 DOT format, not VCG format.
1828 * doc/bison.1: Likewise.
1829 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
1830 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
1831 of this change in
1832 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
1833 * TODO: Remove Graphviz entry.
1834 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
1835 remove vcg.c, vcg.h, vcg_defaults.h.
1836 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
1837 * src/graphviz.c, src/graphviz.h: New files.
1838 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
1839 * src/files.h: Make comment more generic.
1840 * src/main.c (main): Likewise.
1841 * src/print_graph.h: Likewise.
1842 * src/getargs.c (usage): Make usage description more generic.
1843 * src/print_graph.c: Include graphviz.h rather than vcg.h.
1844 (static_graph, fgraph): Remove. All uses changed to pass
1845 arguments instead of sharing a static var.
1846 (print_core, print_actions, print_state, print_graph):
1847 Output graphviz format rather than VCG format.
1848 * tests/.cvsignore: Remove *.vcg; add *.dot.
1849 * tests/output.at: Expect *.dot files, not *.vcg files.
1850
1851 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
1852 accommodates the 2006-10-08 change.
1853
1854 2006-10-11 Bob Rossi <bob@brasko.net>
1855
1856 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
1857 (b4_yyssa, b4_yyerror_range): New macros.
1858 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
1859 (yypvarsinit): Remove init of removed fields.
1860 (yypushparse): Remove use of removed fields; use new macros instead.
1861
1862 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1863
1864 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
1865 in a push parser. Reindent slightly to match yacc.c better.
1866
1867 2006-10-11 Bob Rossi <bob@brasko.net>
1868
1869 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
1870 yymsg_alloc fields.
1871 (yypvarsinit, yypushparse): Remove init of removed fields.
1872 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
1873
1874 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1875
1876 * THANKS: Add Paolo Bonzini and Bob Rossi.
1877
1878 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
1879
1880 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
1881 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
1882 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
1883 b4_define_user_cde and uses): Remove.
1884 (b4_comment, b4_prefix, b4_sync_start): New.
1885 * data/bison.m4: New file, with most of the content removed from c.m4.
1886 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
1887 * src/output.c (output_skeleton): Pass bison.m4.
1888 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
1889 only if specified.
1890
1891 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
1892
1893 Fix test failure reported by Tom Lane in
1894 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
1895 and try to make such failures easier to catch in the future.
1896 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
1897 that's now the caller's responsibility.
1898 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
1899 Set yychar = YYEOF if it's negative.
1900 * tests/actions.at (yylex): Abort if asked to read past EOF.
1901 * tests/conflicts.at (yylex): Likewise.
1902 * tests/cxx-type.at (yylex): Likewise.
1903 * tests/glr-regression.at (yylex): Likewise.
1904 * tests/input.at (yylex): Likewise.
1905 * tests/regression.at (yylex): Likewise.
1906 * tests/torture.at (yylex): Likewise.
1907
1908 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
1909
1910 Fix problems with translating English-language diagnostics.
1911 * bootstrap: Fix bug introduced in recent bootstrap changes, with
1912 respect to bison-runtime pot generation. The YY_ stuff
1913 wasn't being captured.
1914 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
1915 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
1916 * runtime-po/POTFILES.in: Add data/push.c.
1917
1918 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
1919
1920 Merge bootstrap changes from coreutils.
1921
1922 2006-09-28 Jim Meyering <jim@meyering.net>
1923
1924 Automatically generated dependencies are important even
1925 when all of the sources in a directory come from gnulib.
1926 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
1927 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
1928
1929 2006-09-23 Jim Meyering <jim@meyering.net>
1930
1931 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
1932
1933 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1934
1935 * bootstrap: Add support for --force.
1936 (usage): New function. Describe usage less tersely.
1937 (CVS_only_file): New var.
1938
1939 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
1940
1941 * data/push.c (YYPUSH_MORE): Make it an enum instead.
1942 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
1943 Adjust white space and comments to match GNU style better.
1944
1945 2006-09-20 Bob Rossi <bob@brasko.net>
1946
1947 * data/push.c (yyresult_get): Remove function.
1948 (YYPUSH_MORE): Add #define.
1949 (yypushparse): Modify return value.
1950
1951 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1952
1953 * stamp-h.in: Remove; no longer needed.
1954 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
1955 Remove config.h, config.hin, intl (no longer created).
1956 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
1957 stamp-h1.
1958
1959 Sync bootstrap from coreutils, as follows:
1960
1961 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
1962
1963 * bootstrap (symlink_to_gnulib): New function.
1964 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
1965 to copies-of-gnulib.
1966 (cp_mark_as_generated, slurp, gnulib_files):
1967 Avoid making a copy if it's the same as the old version.
1968 (gnulib_files): Add support for this variable (used by Bison).
1969
1970 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1971
1972 * src/getargs.c (usage): Rework to use conventions similar to
1973 coreutils, to make translation a bit easier and the code a bit
1974 smaller. Problem reported by Tim Van Holder.
1975
1976 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
1977
1978 Use some of gnulib's new modules, taken from coreutils.
1979
1980 * bootstrap: Sync from coreutils, except add support for gnulib_files.
1981 * bootstrap.conf: New file.
1982 (gnulib_modules): Add configmake, inttypes, unistd.
1983 (XGETTEXT_OPTIONS): Add complain, complain_at,
1984 fatal, fatal_at, warn, warn_at, unexpected_end.
1985 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
1986 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
1987 (gl_EARLY): Add.
1988 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
1989 (gl_INIT): Add
1990 (GNULIB_AUTOCONF_SNIPPET): Remove.
1991 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
1992 the pickiest.
1993 * lib/.cvsignore: Add inttypes_.h.
1994 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
1995 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
1996 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
1997 no-longer-necessary initializations.
1998 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
1999 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
2000 use the unistd module.
2001 * src/system.h: Likewise.
2002 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
2003 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
2004 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
2005 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
2006 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
2007 * src/system.h: Include inttypes.h unconditionally, now that we
2008 use the inttypes module. Don't bother to include stdint.h, since
2009 inttypes.h now does that for us.
2010 (LOCALEDIR): Remove, now that we use the configmake module.
2011 * src/getargs.c: Include configmake.h.
2012 * src/main.c: Likewise.
2013 * src/output.c: Likewise.
2014 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
2015 not from $abs_top_builddir, since config.h moved.
2016
2017
2018 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
2019 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
2020
2021 * src/parse-gram.y (symbol_declaration): Don't put statements
2022 before declarations; it's not portable to C89.
2023 * src/scan-code.l (handle_action_at): Likewise.
2024
2025 * src/scan-code.l: Always initialize braces_level; the old code
2026 left it uninitialized and therefore had undefined behavior.
2027
2028 Don't attempt to redefine 'assert', since it runs afoul of
2029 systems where standard headers (mistakenly) include <assert.h>.
2030 Instead, define and use our own alternative, called 'aver'.
2031 * src/reader.c: Don't include assert.h, since we no longer
2032 use assert.
2033 * src/scan-code.l: Likewise.
2034 * src/system.h (assert): Remove, replacing with....
2035 (aver): New function, taking a bool arg. All uses changed.
2036 * src/tables.c (pack_vector): Ensure that aver arg is bool,
2037 not merely an integer.
2038
2039 2006-09-15 Bob Rossi <bob@brasko.net>
2040
2041 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
2042 * data/c.m4 (YYPUSH): New.
2043 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
2044 * src/getargs.c (push_parser): New var.
2045 * src/getargs.h (push_parser): New declaration.
2046 * src/output.c (prepare): Add macro insertion of `push_flag'.
2047 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
2048 (prologue_declaration): Parse %push-parser.
2049 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
2050 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
2051 list of removed lines from the traces observed.
2052 (AT_CHECK_CALC_LALR): Added push parser tests.
2053
2054 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
2055
2056 * NEWS: Version 2.3a.
2057 * configure.ac (AC_INIT): Likewise.
2058
2059 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
2060 "#define YYSTYPE int" that caused "make maintainer-check" to fail
2061 due to header ordering dependencies. I don't know why the #define
2062 was there.
2063
2064 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
2065 runtime cost when YYDEBUG is not defined, and so that some tests
2066 that used to fail now work. Problem and initial suggestion by
2067 Paolo Bonzini.
2068 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
2069 * data/glr.cc (b4_parser_class_name):
2070 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
2071 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
2072 (yydebug_) [YYDEBUG]: New member.
2073 (yycdebug_): Now defined only if YYDEBUG.
2074 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
2075 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
2076 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
2077 if YYYDEBUG.
2078 (debug_stream, set_debug_stream, debug_level, set_debug_level):
2079 Define only if YYDEBUG.
2080 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
2081 set_debug_level.
2082 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
2083 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
2084 AT_CHECK_CALC_GLR_CC that are working now.
2085
2086 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
2087
2088 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
2089 We don't need them in glr.cc, and glr.c defines them.
2090 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
2091 assumes that defining it to anything is the same as defining
2092 it to 1. Problem reported by Paolo Bonzini.
2093
2094 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2095
2096 * data/c.m4 (b4_null, b4_case): Define.
2097 * src/output.c (prepare_symbols): Use b4_null.
2098 (user_actions_output): Use b4_case.
2099
2100 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
2101
2102 * data/glr.c (b4_shared_declarations): Put start-header first,
2103 before any #includes that we generate, so that feature-test
2104 macros work. Problem reported by Michael Deutschmann in
2105 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
2106 * data/lalr1.cc: Likewise.
2107 * doc/bison.texinfo (Prologue): Document that feature-test macros
2108 should be defined before any Bison declarations.
2109 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
2110 that depend on location.hh after, not before, Bison decls, since
2111 we now include location.hh after the first user prologue.
2112
2113 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
2114 Sander Brandenburg in
2115 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
2116 Also, fix minor white space and comment issues.
2117 (Prologue): Mention that it's better to define feature-test macros
2118 before Bison declarations. Problem reported by Michael Deutschmann.
2119
2120 * README-cvs: Fix typo: "&" should be "&&". Problem reported
2121 by Jim Meyering.
2122 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
2123 This adjusts to recent gnulib changes.
2124
2125 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2126
2127 Finish implementation of per-type %destructor/%printer. Discussed
2128 starting at
2129 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
2130 and
2131 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
2132 * NEWS (2.3+): Add a description of this feature to the default
2133 %destructor/%printer description.
2134 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
2135 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2136 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
2137 list node contains a semantic type.
2138 * src/symtab.c, src/symtab.h: Extend with a table that associates
2139 semantic types with their %destructor's and %printer's.
2140 (semantic_type_from_uniqstr, semantic_type_get,
2141 semantic_type_destructor_set, semantic_type_printer_set): New functions
2142 composing the public interface of that table.
2143 (symbol_destructor_get, symbol_destructor_location_get,
2144 symbol_printer_get, symbol_printer_location_get): If there's no
2145 per-symbol %destructor/%printer, look up the per-type before trying
2146 the default.
2147 * tests/actions.at (Per-type %printer and %destructor): New test case.
2148 * tests/input.at (Default %printer and %destructor redeclared):
2149 Extend to check that multiple occurrences of %symbol-default in a
2150 single %destructor/%printer declaration is an error.
2151 (Per-type %printer and %destructor redeclared, Unused values with
2152 per-type %destructor): New test cases.
2153
2154 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2155
2156 Require default %destructor/%printer to be declared using
2157 %symbol-default instead of an empty symbol list, and start working on
2158 new per-type %destructor/%printer. Discussed at
2159 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
2160 * NEWS (2.3+): Add %symbol-default to example.
2161 * bison.texinfo (Freeing Discarded Symbols): Likewise.
2162 (Table of Symbols): Add entry for %symbol-default.
2163 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
2164 (generic_symlist, generic_symlist_item): New nonterminals for creating
2165 a list in which each item is a symbol, semantic type, or
2166 %symbol-default.
2167 (grammar_declaration): Use generic_symlist in %destructor and %printer
2168 declarations instead of symbols.1 or an empty list.
2169 (symbol_declaration, precedence_declaration, symbols.1): Update actions
2170 for changes to symbol_list.
2171 * src/reader.c: Update for changes to symbol_list.
2172 * src/scan-code.l: Likewise.
2173 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
2174 * src/symlist.c, src/symlist.h: Extend such that a list node may
2175 represent a semantic type or a %symbol-default in addition to just an
2176 ordinary symbol. Add switched functions for setting %destructor's and
2177 %printer's.
2178 * tests/actions.at, tests/input.at: Add %symbol-default to all default
2179 %destructor/%printer declarations.
2180
2181 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
2182
2183 Whether the default %destructor/%printer applies to a particular symbol
2184 isn't a question of whether the user *declares* that symbol (in %token,
2185 for example). It's a question of whether the user by any means
2186 *defines* the symbol at all (by simply using a char token, for
2187 example). $end is defined by Bison whereas any other token with token
2188 number 0 is defined by the user. The error token is always defined by
2189 Bison regardless of whether the user declares it with %token, but we
2190 may one day let the user define error as a nonterminal instead.
2191 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
2192 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
2193 the meaning of "user-defined".
2194 * tests/actions.at (Default %printer and %destructor for user-declared
2195 end token): Rename to...
2196 (Default %printer and %destructor for user-defined end token): ...
2197 this.
2198
2199 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
2200 computation of whether to apply the default, don't maintain a list of
2201 every Bison-defined symbol. Instead, just check for a first character
2202 of '$', which a user symbol cannot have, and check for the error token.
2203
2204 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
2205
2206 Don't apply the default %destructor or %printer to the error token,
2207 $undefined, or $accept. This change fits the general rule that the
2208 default %destructor and %printer are only for user-declared symbols,
2209 and it solves several difficulties that are described in the new test
2210 cases listed below.
2211 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
2212 * tests/actions.at (Default %printer and %destructor are not for error
2213 or $undefined, Default %printer and %destructor are not for $accept):
2214 New test cases.
2215
2216 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
2217
2218 Allow %start after the first rule.
2219 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
2220 when parsing the first rule.
2221 (check_and_convert_grammar): Search for it here after all grammar
2222 declarations have been parsed. Skip midrules, which have dummy LHS
2223 nonterminals.
2224 * src/symtab.c (symbol_is_dummy): New function.
2225 * src/symtab.h (symbol_is_dummy): Declare it.
2226 * tests/input.at (%start after first rule): New test.
2227
2228 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2229
2230 Redo some of the previous commit: add back the ability to use
2231 non-aliased/undeclared string literals since it might be useful to
2232 those declaring %token-table.
2233 * src/reader.c (check_and_convert_grammar): Undo changes in previous
2234 commit: don't worry about complaints from symbols_pack.
2235 * src/symtab.c (symbol_new, symbol_class_set,
2236 symbol_check_alias_consistency): Undo changes in previous commit: count
2237 each string literal as a new symbol and token, assign it a symbol
2238 number, and don't complain about non-aliased string literals.
2239 (symbols_pack): Since symbol_make_alias still does not decrement symbol
2240 and token counts but does still set aliased tokens to the same number,
2241 symbol_pack_processor now leaves empty slots in the symbols array.
2242 Remove those slots.
2243 * tests/regression.at (Undeclared string literal): Remove test case
2244 added in previous commit since non-aliased string literals are allowed
2245 again.
2246 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
2247 remove unnecessary string literal declarations.
2248 * tests/sets.at (Firsts): Likewise.
2249
2250 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2251
2252 Don't allow an undeclared string literal, but allow a string literal to
2253 be used before its declaration.
2254 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
2255 symbols_pack complained.
2256 * src/symtab.c (symbol_new): Don't count a string literal as a new
2257 symbol.
2258 (symbol_class_set): Don't count a string literal as a new token, and
2259 don't assign it a symbol number since symbol_make_alias does that.
2260 (symbol_make_alias): It's not necessary to decrement the symbol and
2261 token counts anymore. Don't assume that an alias declaration occurs
2262 before any uses of the identifier or string, and thus don't assert that
2263 one of them has the highest symbol number so far.
2264 (symbol_check_alias_consistency): Complain if there's a string literal
2265 that wasn't declared as an alias.
2266 (symbols_pack): Bail if symbol_check_alias_consistency failed since
2267 symbol_pack asserts that every token has been assigned a symbol number
2268 although undeclared string literals have not.
2269 * tests/regression.at (String alias declared after use, Undeclared
2270 string literal): New test cases.
2271 (Characters Escapes, Web2c Actions): Declare string literals as
2272 aliases.
2273 * tests/sets.at (Firsts): Likewise.
2274
2275 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
2276
2277 In the grammar scanner, STRING_FINISH unclosed constructs and return
2278 them to the parser in order to improve error messages.
2279 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
2280 SC_BRACED_CODE, SC_PROLOGUE): Implement.
2281 * tests/input.at (Unclosed constructs): New test case.
2282 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
2283 seen.
2284
2285 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
2286 unused global.
2287
2288 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
2289
2290 Handle string aliases for character tokens correctly.
2291 * src/symtab.c (symbol_user_token_number_set): If the token has an
2292 alias, check and set its alias's user token number instead of its own,
2293 which is set to indicate the alias. Previously, every occurrence of
2294 the character token in the grammar overwrote that alias indicator with
2295 the character code.
2296 * tests/input.at (String aliases for character tokens): New test.
2297
2298 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
2299
2300 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
2301
2302 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
2303
2304 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
2305 to prevent failures when building on older platforms.
2306 Check for autopoint failure.
2307 Set XGETTEXT_OPTIONS to values that check for C format strings,
2308 so that translators are warned about them (this also helps
2309 prevent core dumps).
2310
2311 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
2312 function, since it simplifies our code a bit.
2313
2314 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
2315 rather than -W, so we don't get bogus warnings about sign comparisons.
2316 Add -Wpointer-arith, since that warning is useful (it reports code
2317 that does not conform to C89 and that some compilers reject).
2318 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
2319 since it's no longer needed.
2320
2321 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
2322
2323 Clean up scanners a bit.
2324 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
2325 definitions so gcc won't warn when obstack_for_string is unused.
2326 * src/scan-code.l: config.h and system.h are already #include'd by
2327 scan-code-c.c, so get rid of them here.
2328 * src/scan-gram.l: Likewise.
2329 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
2330 definitions rather than duplicating the rest of it.
2331 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
2332
2333 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
2334
2335 Suppress signed/unsigned comparison warnings for yycheck.
2336 * data/c.m4 (b4_safest_int_type): New macro.
2337 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
2338 a signed int type, cast it to b4_safest_int_type first.
2339 * data/yacc.c: Likewise.
2340 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
2341 also overwritten.
2342
2343 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2344
2345 * doc/bison.texinfo: Fix some typos.
2346
2347 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
2348
2349 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
2350 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
2351
2352 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
2353 the latest gnulib does this a different way.
2354 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
2355 translation was patched, so stop omitting it.
2356
2357 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2358
2359 Enable declaration of default %printer/%destructor. Make the parser
2360 use these for all user-declared grammar symbols for which the user does
2361 not declare a specific %printer/%destructor. Thus, the parser uses it
2362 for token 0 if the user declares it but not if Bison generates it as
2363 $end. Discussed starting at
2364 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
2365 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
2366 and
2367 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
2368 * NEWS (2.3+): Mention.
2369 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
2370 declare a %destructor for a mid-rule's semantic value. It's just
2371 impossible to declare one specific to it.
2372 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
2373 code. Describe default %destructor form.
2374 * src/parse-gram.y (grammar_declaration): Parse default
2375 %printer/%destructor declarations.
2376 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
2377 and symbol_destructor_location_get rather than accessing the destructor
2378 and destructor_location members of struct symbol.
2379 (symbol_printers_output): Likewise but for %printer's.
2380 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
2381 again.
2382 * src/symtab.c (default_destructor, default_destructor_location,
2383 default_printer, default_printer_location): New static global
2384 variables to record the default %destructor and %printer.
2385 (symbol_destructor_get, symbol_destructor_location_get,
2386 symbol_printer_get, symbol_printer_location_get): New functions to
2387 compute the appropriate %destructor and %printer for a symbol.
2388 (default_destructor_set, default_printer_set): New functions to set the
2389 default %destructor and %printer.
2390 * src/symtab.h: Prototype all those new functions.
2391 * tests/actions.at (Default %printer and %destructor): New test to
2392 check that the right %printer and %destructor are called, that they're
2393 not called for $end, and that $$ and @$ work correctly.
2394 (Default %printer and %destructor for user-declared end token): New
2395 test to check that the default %printer and %destructor are called for
2396 a user-declared end token.
2397 * tests/input.at (Default %printer and %destructor redeclared, Unused
2398 values with default %destructor): New tests to check related grammar
2399 warnings and errors.
2400
2401 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2402
2403 Clean up handling of %destructor for the end token (token 0).
2404 Discussed starting at
2405 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
2406 and
2407 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
2408
2409 Make the skeletons consistent in how they pop the end token and invoke
2410 its %destructor.
2411 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
2412 state, which has token number 0, since this would invoke the
2413 %destructor for the end token.
2414 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
2415 until after shifting the end token, or else it won't be popped.
2416 * data/yacc.c (yyparse): Likewise.
2417
2418 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
2419 it's the end token. Upon termination, destroy an unshifted lookahead
2420 even when it's the end token.
2421 * data/lalr1.cc (yy::parser::parse): Likewise.
2422 * data/yacc.c (yyparse): Likewise.
2423
2424 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
2425 value warnings for the end token when the user gives the end token a
2426 %destructor.
2427
2428 * tests/actions.at (Printers and Destructors): Test all the above.
2429
2430 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
2431
2432 Update to latest gnulib and gettext versions.
2433 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
2434 Add fopen-safer.
2435 (gnulib_files): Add m4/warning.m4. Don't worry about files
2436 overwritten by autopoint.
2437 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
2438 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
2439 rejects them.
2440 Don't use autoreconf; instead, invoke autopoint etc. by hand,
2441 so that we can remove the intl files at a better time.
2442 (intl_files_to_remove): Remove aclocal.m4, since it gets
2443 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
2444 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
2445 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
2446 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
2447 Remove datarootdir hack; no longer needed.
2448 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
2449 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
2450 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
2451 strdup.h.
2452 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
2453 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
2454
2455 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
2456
2457 * bootstrap: Adjust to today's change to gnulib-tool by invoking
2458 it with --assume-autoconf='latest-stable'.
2459
2460 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
2461
2462 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
2463 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
2464 YYSTYPE' and `{'.
2465 * src/muscle_tab.h (muscle_grow): Replace the header comments with
2466 those from muscle_tab.c since the old ones are misleading.
2467
2468 2006-07-13 Akim Demaille <akim@epita.fr>
2469
2470 Support %define "KEY" {VALUE}.
2471 * src/scan-code.h, src/scan-code.l (translate_action)
2472 (translate_rule_action, translate_symbol_action, translate_code):
2473 Return char *, not const char *.
2474 * src/parse-gram.y (declaration): Rename as...
2475 (prologue_declaration): this.
2476 (string_content): Remove this nonterminal, use STRING.
2477 (braceless, content, content.opt): New nonterminal.
2478 Use them.
2479 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
2480 as value.
2481 * src/scan-gram.l (getargs.h): Don't include it.
2482
2483 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
2484
2485 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
2486 rather than a for-loop that declares a local bool variable. This
2487 should work around a compatibility problem with a Cray x1e C++
2488 compiler reported by Hung Nguyen in
2489 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
2490 The for-loop was introduced in the 2004-11-17 change but I don't
2491 know why it was needed.
2492
2493 2006-07-12 Akim Demaille <akim@epita.fr>
2494
2495 * data/c.m4: Comment changes.
2496
2497 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
2498
2499 * src/complain.c (error_message, ERROR_MESSAGE): New.
2500 To factor...
2501 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
2502 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
2503
2504 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2505
2506 * NEWS: Instead of %union, you can define and use your own union type
2507 YYSTYPE if your grammar contains at least one <type> tag.
2508 Your YYSTYPE need not be a macro; it can be a typedef.
2509 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
2510 (Union Decl, Decl Summary): Document this.
2511 * data/glr.c (YYSTYPE): Implement this.
2512 * data/glr.cc (YYSTYPE): Likewise.
2513 * data/lalr1.cc (YYSTYPE): Likewise.
2514 * data/yacc.c (YYSTYPE): Likewise.
2515 * src/output.c (prepare): Output tag_seen_flag.
2516 * src/parse-gram.y (declaration, grammar_declaration):
2517 Use 'union_seen' rather than 'typed' to determine whether
2518 %union has been seen, since grammars can now be typed without
2519 %union.
2520 (symbol_declaration, type.opt, symbol_def):
2521 Keep track of whether a tag has been seen.
2522 * src/reader.c (union_seen, tag_seen): New vars.
2523 (typed): remove.
2524 * src/reader.h (union_seen, tag_seen, typed): Likewise.
2525 * src/scan-code.l (untyped_var_seen): New variable.
2526 (handle_action_dollar): Adjust to above changes.
2527 (handle_action_dollar, handle_action_at):
2528 Improve overflow checking for outlandish numbers.
2529 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
2530 avoid new diagnostics generated by above changes.
2531 * tests/regression.at (YYSTYPE typedef): Add test to check
2532 for type tags without %union.
2533
2534 * src/symlist.c (symbol_list_length): Return int, not unsigned
2535 int, since callers expect int. This may need to get revisited
2536 once we have proper integer overflow checking.
2537
2538 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
2539 object is now static.
2540
2541 * src/getargs.c (flags_argmatch): Return void, not int,
2542 to pacify ./configure --enable-gcc-warnings.
2543
2544 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
2545 since last_string is already defined to FLEX_PREFIX (last_string).
2546
2547 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
2548
2549 Implement --warnings/-W.
2550 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
2551 replaced by...
2552 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
2553 Adjust callers.
2554 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
2555 (warnings_args, warnings_types): New.
2556 (getargs, short_options, long_options): Accept -W/--warnings.
2557 Sort the options by alphabetical order, upper case letter right
2558 before its lower case.
2559
2560 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2561
2562 Change %merge result type clash warnings to errors. Discussed at
2563 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
2564 * src/reader.c (record_merge_function_type): Use complain_at.
2565 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2566 declared later): Update test case results.
2567
2568 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
2569
2570 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
2571 to be in alphabetical order.
2572 (trace_args): Spelling fixes.
2573
2574 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2575
2576 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
2577 so they don't collide with user-defined macros.
2578 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
2579 this was never guaranteed, and now that we're using gnulib stdint,
2580 which defines int_fast16_t to long int, the problem is exposed.
2581
2582 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
2583
2584 * data/c.m4 (b4_basename): Simplify a bit, since we don't
2585 need the full POSIX semantics (and weren't implementing them
2586 anyway).
2587
2588 Adjust to Autoconf 2.60 and today's gnulib.
2589 * bootstrap (gnulib_modules): Add stdint.
2590 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
2591 no longer copies it.
2592 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
2593 since stdint needs the former and wcwidth (which is now required
2594 by mbswidth) needs the latter.
2595 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
2596 work around a compatibility glitch between gettext 0.14.6 and
2597 Autoconf 2.60.
2598 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
2599 Do not check for uintptr_t, since new stdint module does the right
2600 thing.
2601 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
2602 Add stdint.h, stdint_.h, wcwidth.h.
2603 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
2604 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
2605 stdint.m4, wchar_t.m4, wcwidth.m4.
2606 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
2607 usual order for ../lib/*.h files.
2608 (file_name_split): Use last_component, not base_name, to adjust
2609 to gnulib changes.
2610 * src/parse-gram.h: Include <strverscmp.h> in the usual order
2611 for ../lib/*.h files.
2612 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
2613 Define unconditionally, since we now assume the stdint module.
2614 * src/scan-skel.l: Include <dirname.h>.
2615 (BASE_QPUTS): Use last_component, not base_name.
2616 * src/system.h: Include <unlocked-io.h> in the usual order
2617 for ../lib/*.h files. Include <stdint.h> unconditionally,
2618 since we now use the stdint module.
2619 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
2620 HAVE_UINTPTR_T, since we now use the stdint module.
2621 (base_name): Remove decl, since files now include <dirname.h>
2622 to get the decl.
2623
2624 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
2625
2626 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
2627 New, default to 1.
2628 * data/yacc.c, data/glr.c, data/location.cc: Use them.
2629 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
2630 default.
2631 * tests/calc.at: Adjust.
2632
2633 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
2634
2635 * data/c.m4 (b4_basename): New.
2636 (b4_syncline): Also output the location of its invocation (from
2637 the skeleton).
2638 (b4_user_action, b4_define_user_action, b4_user_actions)
2639 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
2640 (b4_user_stype): New.
2641 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
2642
2643 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2644
2645 In the grammar file, the first column is 1 not 0 on the first line as
2646 on every other line.
2647 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
2648 * tests/input.at (Torturing the Scanner): Update output.
2649
2650 * src/scan-gram.l (scanner_cursor): Declare it static.
2651
2652 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2653
2654 In warnings, say "previous declaration" rather than "first
2655 declaration".
2656 * src/symtab.c (redeclaration): Do that here.
2657 * src/reader.c (record_merge_function_type): In the case of a result
2658 type clash, report the previous declaration rather than the very first
2659 one in the grammar file.
2660 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2661 declared later): Add a third declaration to check this behavior.
2662 * tests/input.at (Incompatible Aliases): Update output.
2663
2664 2006-06-27 Akim Demaille <akim@epita.fr>
2665
2666 * doc/Doxyfile.in: New.
2667 * doc/Makefile.am: Use it.
2668 * src/lalr.h, src/symtab.h: Initial doxygenation.
2669
2670 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2671
2672 Don't miss %merge result type warnings just because the LHS types are
2673 declared after the %merge. This continues the effort of the previous
2674 patch.
2675 * src/reader.c (get_merge_function): Don't set the merger type yet.
2676 (record_merge_function_type): New function for setting the merger type
2677 and checking for clashes.
2678 (grammar_current_rule_merge_set): Set the location of the %merge for
2679 the current rule.
2680 (packgram): Invoke record_merge_function_type for each rule now that
2681 all symbol type declarations have been parsed.
2682 * src/reader.h (merger_list.type_declaration_location): New member
2683 storing the location of the first %merge from which the type for this
2684 merging function was derived.
2685 * src/symlist.h (symbol_list.merger_declaration_location): New member
2686 storing the location of a rule's %merge, if any.
2687 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2688 declared later): New test to catch the error fixed by the above patch.
2689
2690 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2691
2692 Get action warnings (grammar_rule_check) right even when symbol
2693 declarations appear after the rules. Discussed at
2694 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
2695 and
2696 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
2697 Don't mistake the type of $$ in a midrule to be that of its parent
2698 rule's $$.
2699 * src/reader.c (grammar_current_rule_end): Don't invoke
2700 grammar_rule_check yet since not all symbol declarations may have been
2701 parsed yet.
2702 (grammar_midrule_action): Likewise.
2703 Don't record whether the midrule's $$ has been used yet since actions
2704 haven't been translated yet.
2705 Record the midrule's parent rule and its RHS index within the parent
2706 rule.
2707 (grammar_current_rule_action_append): Don't translate the action yet
2708 since not all symbol declarations may have been parsed yet and, thus,
2709 warnings about types for $$, $n, @$, and @n can't be reported yet.
2710 (packgram): Translate the action and invoke grammar_rule_check now that
2711 all symbol declarations have been parsed.
2712 * src/scan-code.l (handle_action_dollar): Now that this is invoked
2713 after parsing the entire grammar file, the symbol list here in the case
2714 of a midrule is actually the midrule's empty RHS, so reference its
2715 parent rule's RHS where necessary.
2716 On the other hand, now that you can already know it's a midrule, you
2717 aren't forced to think $$ has the same type as its parent rule's $$.
2718 (handle_action_at): In the case of a midrule, reference the parent rule
2719 where necessary.
2720 * src/symlist.c (symbol_list_new): Initialize new midrule-related
2721 members.
2722 (symbol_list_length): Now that this is invoked after all rules have
2723 been parsed, a NULL symbol (rather than a NULL symbol list node)
2724 terminates a rule. symbol_list_print already does this correctly.
2725 * src/symlist.h (symbol_list.midrule_parent_rule,
2726 symbol_list.midrule_parent_rhs_index): New members so that midrules can
2727 remember their relationships with their parents.
2728 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
2729 fixed by the above patch.
2730 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
2731 implementing...
2732 (Unused values): ... this old test case and...
2733 (Unused values before symbol declarations): ... this new test case.
2734 This one is the same as `Unused values' except that all symbol
2735 declarations appear after the rules in order to catch the rest of the
2736 errors fixed by the above patch.
2737
2738 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2739
2740 More cleanup.
2741 * src/reader.c (current_rule): Declare it static since it's no longer
2742 used outside this file.
2743 (grammar_current_rule_action_append): Remove redundant arguments from
2744 translate_rule_action invocation.
2745 * src/reader.h (current_rule): Remove this unused extern.
2746 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
2747 * src/scan-code.l (translate_rule_action): Likewise.
2748
2749 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
2750
2751 Clean up yesterday's patch.
2752 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
2753 to...
2754 * src/reader.c (grammar_current_rule_action_append): ... here for
2755 consistency with grammar_current_rule_symbol_append.
2756 * tests/regression.at (Braced code in declaration in rules section):
2757 Make yyerror and yylex static as usual.
2758
2759 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
2760
2761 Fix bug that mistakes braced code in a declaration in the rules section
2762 to be a rule action. Mentioned at
2763 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
2764 * src/scan-gram.l: Move midrule action detection from the start of the
2765 scanning of any braced code to...
2766 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
2767 action. For readability, use $2 and @2 rather than the equivalent
2768 global variables.
2769 * tests/regression.at (Braced code in declaration in rules section):
2770 New test to catch the error fixed by the above patch.
2771
2772 Work on code readability some.
2773 * src/scan-code.l (current_rule): Get rid of this misleading and
2774 redundant declaration: it's actually extern'ed in reader.h.
2775 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
2776 translate_action): Add a rule argument and use it instead of the global
2777 current_rule.
2778 (translate_rule_action): This already receives current_rule through an
2779 argument, so pass it on to translate_action instead of assigning
2780 current_rule to current_rule.
2781 (translate_symbol_action, translate_code): Pass rule = NULL to
2782 translate_action.
2783
2784 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
2785
2786 Rename %before-definitions to %start-header and %after-definitions to
2787 %end-header. Don't use these declarations to separate pre-prologue
2788 blocks from post-prologue blocks. Add new order-independent
2789 declarations %before-header and %after-header as alternatives to the
2790 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
2791 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
2792 * NEWS (2.3+): Update for these changes.
2793 * data/glr.c (b4_before_definitions): Update to...
2794 (b4_start_header): ... this.
2795 (b4_after_definitions): Update to...
2796 (b4_end_header): ... this.
2797 * data/glr.cc: Likewise.
2798 * data/lalr1.cc: Likewise.
2799 * data/yacc.c: Likewise.
2800 * doc/bison.texinfo (The prologue): Update names, and replace remaining
2801 prologue blocks with %*-header declarations.
2802 (Calc++ Parser): Likewise.
2803 (Bison Declaration Summary): Update names.
2804 (Table of Symbols): Update description.
2805 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
2806 (PERCENT_END_HEADER): ... this.
2807 (PERCENT_BEFORE_DEFINITIONS): Update to...
2808 (PERCENT_START_HEADER): ... this.
2809 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2810 (declaration): Update token names and m4 macro names.
2811 When parsing %end-header and %start-header, invoke translate_code
2812 before muscle_code_grow, and no longer set global booleans to remember
2813 whether these declarations have been seen.
2814 Parse new %after-header and %before-header.
2815 * src/reader.c (before_definitions, after_definitions): Remove.
2816 (prologue_augment): Accept a new bool argument to specify whether to
2817 augment the pre-prologue or post-prologue.
2818 * src/reader.h (before_definitions, after_definitions): Remove these
2819 extern's.
2820 (prologue_augment): Add new bool argument.
2821 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
2822 (PERCENT_END_HEADER): ... this.
2823 (PERCENT_BEFORE_DEFINITIONS): Update to...
2824 (PERCENT_START_HEADER): ... this.
2825 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2826 * tests/actions.at (Printers and Destructors): Update names.
2827
2828 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
2829
2830 Add comparison operators for C++ location classes. Discussed at
2831 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
2832 * data/c++.m4 (b4_define_location_comparison): New boolean %define
2833 declaration indicating whether filename_type has an operator==. If
2834 filename_type is `std::string', it defaults to `1', `0' otherwise.
2835 * data/location.cc: Iff b4_define_location_comparison is `1', add
2836 operator== and operator!= for class position and for class location.
2837
2838 Some minor fixes.
2839 * src/scan-action.l: Remove unused file.
2840 * src/symtab.c (symbol_printer_set): Use printer_location not
2841 destructor_location.
2842 * src/symtab.h (struct symbol): Replace incorrect source comment for
2843 printer members.
2844 * tests/input.at (Incompatible Aliases): Update output with correct
2845 printer location.
2846
2847 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
2848
2849 Don't put the pre-prologue in the header file. For the yacc.c code
2850 file and the glr.c header and code files, move the pre-prologue before
2851 the token definitions. Add new %before-definitions and
2852 %after-definitions to declare code that will go in both the header file
2853 and code file. Discussed at
2854 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
2855 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
2856 and
2857 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
2858 * NEWS (2.3+): Describe these changes.
2859 * data/glr.c (b4_pre_prologue): Move from within to before...
2860 (b4_shared_declarations): ... this.
2861 Add new b4_before_definitions before b4_token_enums.
2862 Add new b4_after_definitions at the end.
2863 * data/glr.cc (b4_pre_prologue): Replace with...
2864 (b4_before_definitions): ... this in the header file.
2865 (b4_after_definitions): New near the end of the header file.
2866 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
2867 code file right before including the header file.
2868 (b4_before_definitions): New in the previous position of
2869 b4_pre_prologue in the header file.
2870 (b4_after_definitions): New near the end of the header file.
2871 * data/yacc.c: Clean up some m4 quoting especially in the header file.
2872 (b4_token_enums_defines): In the code file, move to right before
2873 YYSTYPE for consistency with the header file.
2874 (b4_before_definitions): New right before b4_token_enums_defines in
2875 both the header and code file.
2876 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
2877 header and code file.
2878 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
2879 of prologues for %union dependencies.
2880 (Bison Declaration Summary): In %defines description, mention the
2881 effect of %before-definitions and %after-definitions on the header
2882 file.
2883 (Calc++ Parser): Forward declare driver in a %before-definitions rather
2884 than in the pre-prologue so that make check succeeds.
2885 (Table of Symbols): Add entries for %before-definitions and
2886 %after-definitions.
2887 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
2888 %before-definitions.
2889 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
2890 (declaration): Parse those declarations and append to
2891 b4_before_definitions and b4_after_definitions, respectively.
2892 * src/reader.c (before_definitions, after_definitions): New bools to
2893 track whether those declarations have been seen.
2894 (prologue_augment): Add to the post-prologue if %union,
2895 %before-definitions, or %after-definitions has been seen.
2896 * src/reader.h (before_definitions, after_definitions): New extern's.
2897 * src/scan-gram.l: Scan the new declarations.
2898 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
2899 prologue block in a %before-definitions or a %after-definitions based
2900 on whether the %union is declared.
2901 * tests/regression.at (Early token definitions with --yacc, Early token
2902 definitions without --yacc): Move tests for token definitions into the
2903 post-prologue since token names are no longer defined in the
2904 pre-prologue.
2905
2906 2006-06-20 Akim Demaille <akim@epita.fr>
2907
2908 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
2909 (symbol_get): Use it.
2910 * src/parse-gram.y: Use it.
2911
2912 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
2913
2914 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
2915 build succeeds when configured with --enable-gcc-warnings.
2916
2917 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
2918
2919 * src/parse-gram.y (char_name): New function.
2920 (CHAR, STRING, string_content): For %printer, properly escape.
2921 (ID): Prefer fputs to fprintf.
2922 (id): Reindent to be consistent with other rules.
2923 Properly quote char.
2924
2925 The Translation Project changed its way of publishing translations
2926 to maintainers. I haven't received any responses to my request
2927 for supporting the old way, or for documenting the new way. I
2928 have modified 'bootstrap' to use screen scraping
2929 (in this case, HTML scraping). This is unreliable and inelegant,
2930 but I don't see any better way. Yuck.
2931 * bootstrap (TP_URL, WGET_COMMAND): New vars.
2932 (get_translations): New function, which uses HTML scraping to
2933 deduce locations of latest translations.
2934 Use this function to grab both bison and bison-runtime .po files.
2935 Don't bother priming the pump for the runtime-po domain any more,
2936 as it's now translated better than bison is.
2937
2938 2006-06-19 Akim Demaille <akim@epita.fr>
2939
2940 * src/scan-gram.l: No longer "parse" things after `%union' until
2941 `{'. Rather, return a single "%union" token.
2942 No longer make symbols: return strings, and leave the conversion
2943 to symbols to the parser.
2944 (SC_PRE_CODE, token_type): Remove.
2945 * src/parse-gram.y (%union): New field `character'.
2946 Sort tokens.
2947 (CHAR): New token.
2948 (ID, ID_COLON): Now that the scanner no longer makes them
2949 identifiers, adjust all uses to invoke symbol_get.
2950 (id_colon): New, wraps the conversion from string to symbol.
2951 (%union): Accept a possible union_name.
2952 (symbol): Now can be a char.
2953 * data/c.m4 (b4_union_name): Leave a default value.
2954 * data/glr.c, data/yacc.c: Use it.
2955
2956 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
2957
2958 For associating token numbers with token names for "yacc.c", don't use
2959 #define statements unless `--yacc' is specified; always use enum
2960 yytokentype. Most important discussions start at:
2961 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
2962 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
2963 and
2964 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
2965 * NEWS (2.3+): Mention.
2966 * data/c.m4 (b4_yacc_if): New.
2967 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
2968 token #define's.
2969 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
2970 on token name definitions.
2971 * src/getargs.c (usage): Capitalize `Yacc' in English.
2972 * src/output.c (prepare): Define b4_yacc_flag.
2973 * tests/regression.at (Early token definitions): Test that tokens names
2974 are defined before the pre-prologue not just before the post-prologue.
2975 Remove this test case and copy to...
2976 (Early token definitions with --yacc): ... this to test #define's.
2977 (Early token definitions without --yacc): ... and this to test enums.
2978
2979 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
2980
2981 * NEWS: Reword the post-2.3 change to not be so optimistic about
2982 removing the old "look-ahead" spelling.
2983 Update previous look-ahead/lookahead change reports.
2984 * REFERENCES: look-ahead -> lookahead (since that's
2985 what he actually wrote).
2986 * doc/refcard.tex: look ahead -> lookahead,
2987 look-ahead -> lookahead
2988
2989 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
2990
2991 For consistency, use `lookahead' instead of `look-ahead' or
2992 `look_ahead'. Discussed starting at
2993 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
2994 and then at
2995 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
2996 * NEWS: For the next release, note the change to `--report'.
2997 * TODO, doc/bison.1: Update English.
2998 * doc/bison.texinfo: Update English.
2999 (Understanding Your Parser, Bison Options): Document as
3000 `--report=lookahead' rather than `--report=look-ahead'.
3001 * src/conflicts.c: Update English in comments.
3002 (lookahead_set): Rename from look_ahead_set.
3003 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
3004 (resolve_sr_conflict): Rename local look_ahead_tokens to
3005 lookahead_tokens, and update other uses.
3006 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
3007 count_rr_conflicts, conflicts_free): Update uses.
3008 * src/getargs.c (report_args): Move "lookahead" before alternate
3009 spellings.
3010 (report_types): Update uses.
3011 (usage): For `--report' usage description, state `lookahead' spelling
3012 rather than `look-ahead'.
3013 * src/getargs.h (report.report_lookahead_tokens): Rename from
3014 report_look_ahead_tokens.
3015 * src/lalr.c: Update English in comments.
3016 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
3017 (state_lookahead_tokens_count): Rename from
3018 state_look_ahead_tokens_count.
3019 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3020 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
3021 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3022 Update other uses.
3023 Update English in output.
3024 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
3025 * src/print.c: Update English in comments.
3026 (lookahead_set): Rename from look_ahead_set.
3027 (print_reduction): Rename argument lookahead_token from
3028 look_ahead_token.
3029 (print_core, state_default_rule, print_reductions, print_results):
3030 Update uses.
3031 * src/print_graph.c: Update English in comments.
3032 (print_core): Update uses.
3033 * src/state.c: Update English in comments.
3034 (reductions_new): Update uses.
3035 (state_rule_lookahead_tokens_print): Rename from
3036 state_rule_look_ahead_tokens_print, and update other uses.
3037 * src/state.h: Update English in comments.
3038 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
3039 (state_rule_lookahead_tokens_print): Rename from
3040 state_rule_look_ahead_tokens_print.
3041 * src/tables.c: Update English in comments.
3042 (conflict_row, action_row): Update uses.
3043 * tests/glr-regression.at
3044 (Incorrect lookahead during deterministic GLR,
3045 Incorrect lookahead during nondeterministic GLR): Rename
3046 print_look_ahead to print_lookahead.
3047 * tests/torture.at: Update English in comments.
3048 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
3049 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
3050 (Many lookahead tokens): Update uses.
3051 * data/glr.c: Update English in comments.
3052 * lalr1.cc: Likewise.
3053 * yacc.c: Likewise.
3054 * src/conflicts.h: Likewise.
3055 * src/lalr.h: Likewise.
3056 * src/main.c: Likewise.
3057 * src/output.c: Likewise.
3058 * src/parse-gram.c: Likewise.
3059 * src/tables.h: Likewise.
3060 * tests/calc.at: Likewise.
3061
3062 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
3063
3064 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
3065
3066 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
3067
3068 * TODO: Add request from Nelson H. F. Beebe to be able to install
3069 Bison without installing the yacc script.
3070
3071 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3072
3073 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
3074 and yytext if they're already #define'd.
3075 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
3076 * src/scan-code-c.c: ... here.
3077 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
3078 <config.h>.
3079
3080 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3081
3082 Get Bison to build again when configured with --enable-gcc-warnings.
3083 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
3084 missing #include's.
3085 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
3086 loc argument as it shadows a global.
3087 * src/scan-gram.l: Remove stray comma that prevents boundary_set
3088 invocation.
3089
3090 * src/.cvsignore: Add scan-code.c.
3091
3092 2006-06-07 Akim Demaille <akim@epita.fr>
3093
3094 * src/scan-gram.l: Move the "add a trailing ; to actions" code
3095 to...
3096 * src/scan-code.l: here.
3097 * tests/input.at (Torturing the Scanner): Fix another location
3098 error.
3099
3100 2006-06-07 Akim Demaille <akim@epita.fr>
3101
3102 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
3103
3104 2006-06-06 Akim Demaille <akim@epita.fr>
3105
3106 Extract the parsing of user actions from the grammar scanner.
3107 As a consequence, the relation between the grammar scanner and
3108 parser is much simpler. We can also split "composite tokens" back
3109 into simple tokens.
3110 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
3111 * src/scan-gram.l (add_column_width, adjust_location): Move to and
3112 rename as...
3113 * src/location.h, src/location.c (add_column_width)
3114 (location_compute): these.
3115 Fix the column count: the initial column is 0.
3116 (location_print): Be robust to ending column being 0.
3117 * src/location.h (boundary_set): New.
3118 * src/main.c: Adjust to scanner_free being renamed as
3119 gram_scanner_free.
3120 * src/output.c: Include scan-code.h.
3121 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
3122 Use boundary_set.
3123 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
3124 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
3125 which is now, again, a separate token.
3126 Adjust all dependencies.
3127 Whereever actions with $ and @ are used, use translate_code.
3128 (action): Remove this nonterminal which is now useless.
3129 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
3130 (grammar_current_rule_action_append): Use translate_code.
3131 (packgram): Bound check ruleno, itemno, and rule_length.
3132 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
3133 (last_string, last_braced_code_loc, max_left_semantic_context)
3134 (scanner_initialize, scanner_free, scanner_last_string_free)
3135 (gram_out, gram_lineno, YY_DECL_): Move to...
3136 * src/scan-gram.h: this new file.
3137 (YY_DECL): Rename as...
3138 (GRAM_DECL): this.
3139 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
3140 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3141 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3142 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3143 Move these declarations, and...
3144 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
3145 these to...
3146 * src/flex-scanner.h: this new file.
3147 * src/scan-gram.l (rule_length, rule_length_overflow)
3148 (increment_rule_length): Remove.
3149 (last_braced_code_loc): Rename as...
3150 (gram_last_braced_code_loc): this.
3151 Adjust to the changes of the parser.
3152 Move all the handling of $ and @ into...
3153 * src/scan-code.l: here.
3154 * src/scan-gram.l (handle_dollar, handle_at): Remove.
3155 (handle_action_dollar, handle_action_at): Move to...
3156 * src/scan-code.l: here.
3157 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
3158 scan-code.h, scan-code-c.c, scan-gram.h.
3159 (EXTRA_bison_SOURCES): Add scan-code.l.
3160 (BUILT_SOURCES): Add scan-code.c.
3161 (yacc): Be robust to white spaces.
3162
3163 * tests/conflicts.at, tests/input.at, tests/reduce.at,
3164 * tests/regression.at: Adjust the column numbers.
3165 * tests/regression.at: Adjust the error message.
3166
3167 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3168
3169 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3170 Use Akim's wording from
3171 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
3172
3173 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3174
3175 Between Bison releases, manually append `+' to the previous Bison
3176 release number, and use that as a signal to automatically print the
3177 ChangeLog's CVS Id keyword from --version. Discussed starting at
3178 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
3179 * ChangeLog: Add Id header.
3180 * configure.ac (AC_INIT): Append `+' to `2.3'.
3181 * src/.cvsignore: Add revision.c.
3182 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
3183 (BUILT_SOURCES): Add revision.c.
3184 (revision.c): New target rule. This file defines a new global variable
3185 named revision. It initializes it with either the Id from ChangeLog
3186 or, if VERSION doesn't contain `+', with the empty string.
3187 * src/getargs.c (version): Print the value of revision.
3188 * src/revision.h: Extern revision.
3189
3190 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
3191
3192 * NEWS: Version 2.3.
3193 * configure.ac (AC_INIT): Likewise.
3194
3195 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
3196
3197 * data/glr.c (YYRECOVERING): Define to be a function-like macro
3198 with no arguments, not as an object-like macro. This is for
3199 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
3200 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
3201 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
3202 Document this.
3203
3204 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
3205
3206 * src/getargs.c (usage): Back out yesterday's modification of the
3207 --help output so that we don't have to wait for translation before
3208 releasing 2.3.
3209
3210 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
3211
3212 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
3213 Problem reported by Akim Demaille.
3214
3215 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3216
3217 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3218
3219 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
3220
3221 * data/yacc.c (yy_reduce_print): Omit trailing white space in
3222 generated source code. Problem reported by Frans Englich in
3223 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
3224
3225 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
3226
3227 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
3228 shell, not within 'make', so that 'make' by an ordinary builder
3229 (using GNU make) does not worry about configuring gzip. This also
3230 works around a bug reported independently by Keith Thompson and by
3231 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
3232 stderr rather than stdout, messing up the build logs.
3233
3234 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3235
3236 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
3237 to make sure that YYID will never be unused. This fixes a 'make
3238 maintainer-check' failure caused by the recent changes to the 'Trivial
3239 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
3240 not used.
3241 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
3242
3243 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3244
3245 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
3246 state before an empty RHS is always resolved here. Only the location
3247 of that state is guaranteed to be resolved, and that's enough. This
3248 fixes the remaining bug reported by Derek M. Jones in
3249 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3250 * tests/glr-regression.at (Uninitialized location when reporting
3251 ambiguity): Test the above case.
3252 Also, the embedded comments in this test case claim it checks the case
3253 of an empty RHS that has inherited the initial location. However, the
3254 corresponding LHS was already resolved, so yyresolveLocations didn't
3255 actually have reason to modify it. Fix this by forcing
3256 nondeterministic operation at the beginning of the parse.
3257
3258 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
3259
3260 * data/c.m4 (b4_yy_symbol_print_generate):
3261 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
3262 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
3263 of the bugs reported today by Derek M Jones in
3264 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3265 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
3266 defined to be a type name without parens or brackets.
3267 (Location Type): Similarly for YYLTYPE.
3268 * tests/regression.at (Trivial grammars): Put in a test for this
3269 bug that will be caught by 'make maintainer-check' (though not,
3270 alas, by 'make check' unless your compiler is picky).
3271
3272 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
3273
3274 * NEWS: Version 2.2.
3275 * configure.ac (AC_INIT): Likewise.
3276
3277 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
3278
3279 * data/glr.c (yyreportTree): Make room in yystates for the state
3280 preceding the RHS. This fixes the segmentation fault reported by Derek
3281 M. Jones in
3282 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
3283 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
3284 to the user. Reported for yyreportTree by Derek M. Jones later in the
3285 same thread.
3286 * THANKS: Add Derek M. Jones.
3287 Update my email address.
3288 Fix typo in Steve Murphy's name.
3289
3290 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
3291
3292 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
3293 checking against YYLAST that caused the parser to miss a potential
3294 alternative in its diagnostic.
3295 Problem reported by Maria Jose Moron Fernandez in
3296 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
3297 * data/lalr1.cc (yysyntax_error_): Likewise.
3298 * data/yacc.c (yysyntax_error): Likewise.
3299 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
3300 tokens, in case we run into an older C compiler.
3301 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
3302 Use them to check for the off-by-one error fixed above.
3303
3304 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
3305 YYSIZE_T, not size_t.
3306 * tests/regression.at (Trivial grammars): New test, to catch
3307 the error fixed by the above patch.
3308
3309 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3310
3311 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
3312 scheme.
3313 Reported by Steve Murphy.
3314
3315 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3316
3317 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
3318 * data/glr.cc: b4_location_flag is now b4_locations_flag.
3319
3320 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3321
3322 Implement --trace=m4.
3323 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
3324 * src/output.c (output_skeleton): When set, pass -dV to m4.
3325
3326 Factor the handling of flags in m4.
3327 * src/output.c (prepare): Rename the muscle names debug, defines,
3328 error_verbose to debug_flag, defines_flag, error_verbose_flag.
3329 * data/c.m4: Adjust.
3330 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
3331 Use b4_define_flag_if to define other b4_FLAG_if macros.
3332 (b4_location_if): As a consequence, rename as...
3333 (b4_locations_if): this, for consistency.
3334 Adjust all the skeletons.
3335
3336 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3337
3338 * etc/bench.pm: Shorten bench names.
3339
3340 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3341
3342 * src/output.h, src/output.c (error_verbose): Move to...
3343 * src/getargs.h, src/getargs.c: here.
3344 Sort the flags.
3345 Adjust dependencies.
3346
3347 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
3348
3349 * data/c.m4 (b4_copyright): Put the special exception for Bison
3350 skeletons here, so we don't have to put it in each skeleton. All
3351 uses changed. Suggested by Akim Demaille. Also, wrap the
3352 copyright notice, in case it is longer than 80 columns. Replace
3353 comma by newline after title.
3354
3355 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
3356
3357 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
3358 incompatibility, not a bug. Mention that it wasn't fixed as of
3359 flex 2.5.33.
3360
3361 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
3362
3363 * examples/extexi: Enforce the precedence of concatenation over
3364 >>.
3365 Reported by Tommy Nordgren.
3366
3367 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
3368
3369 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
3370 with the member "token".
3371 Reported by Martin Nylin.
3372
3373 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
3374
3375 * data/glr.c: Switch to Bison 2.2 special-exception language in
3376 the copyright notice. Use more-regular format for titles and
3377 copyright notices.
3378 * data/glr.cc: Likewise.
3379 * data/location.cc: Likewise.
3380 * data/yacc.cc: Likewise.
3381 * doc/bison.texinfo (Conditions): Document this.
3382 * NEWS: likewise. Upgrade version to 2.2.
3383
3384 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
3385
3386 * data/glr.cc: Remove dead code.
3387
3388 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
3389
3390 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
3391 that variable and the line breaks the bootstrap. Problem reported
3392 by Juan M. Guerrero.
3393
3394 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
3395
3396 * doc/bison.texinfo (Multiple start-symbols): New.
3397
3398 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
3399
3400 * etc/README, etc/bench.pl: New.
3401
3402 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
3403
3404 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
3405 rule.
3406 Reported by Mickael Labau.
3407 * tests/input.at (Torturing the Scanner): Test it.
3408
3409 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
3410
3411 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
3412 Problem reported by Bob Rossi.
3413
3414 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
3415
3416 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
3417 and didn't really work.
3418 For the index, use @ifnotinfo, not @iftex.
3419 Minor cleanups of spacing and terminology.
3420
3421 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
3422
3423 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
3424 of AT_NAME_PREFIX when %name-prefix is not used.
3425
3426 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
3427
3428 Apply --prefix to C++ skeletons too: they change the namespace.
3429 The test suite already exercize these cases.
3430 * data/c++.m4 (b4_namespace): New.
3431 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
3432 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
3433 * data/yacc.c, data/glr.c: Remove a useless `[]'.
3434 * doc/bison.texinfo: Document it.
3435 (Option Cross Key): Use @multitable in all formats. It looks
3436 nicer, even in TeX outputs.
3437 (Rules): Use the same code whatever the output type is.
3438 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
3439 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
3440 * tests/calc.at: Use it, instead of hard coding `yy'.
3441
3442 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
3443
3444 * TODO: Remove dead items.
3445
3446 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
3447
3448 * doc/FAQ: Remove, merged into...
3449 * doc/bison.texinfo (FAQ): this.
3450 * doc/Makefile.am (EXTRA_DIST): Adjust.
3451
3452 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
3453
3454 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
3455 even if empty.
3456 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
3457 * doc/bison.texinfo (Calc++ Scanner): Use it.
3458
3459 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
3460
3461 Fix two nits reported by twlevo, plus one more that I discovered.
3462
3463 * src/assoc.h (assoc_to_string): Give a name to the arg, as
3464 this is the usual Bison style.
3465 * src/location.h (location_print): Likewise.
3466
3467 * src/reader.h (token_name): Likewise.
3468
3469 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
3470
3471 Fix some nits reported by twlevo.
3472 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
3473 and "POSIX". Use more-modern syntax for URLs. Mention C++
3474 and ask for Java. Don't hardwire OS version numbers. Add
3475 copyright notice.
3476 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
3477 * src/conflicts.c (solved_conflicts_obstack): Now static.
3478
3479 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3480
3481 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
3482 page. Say "you can use it" not "you may use it" as on the web page;
3483 we're describing capabilities not granting permission.
3484
3485 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
3486
3487 * data/glr.c (yyresolveLocations): Rename local variables to avoid
3488 shadowing warnings. Use usual patter for iterating through RHS.
3489 * tests/glr-regression.at
3490 (Uninitialized location when reporting ambiguity):
3491 Modify yylex so that it uses its argument, rather than trying
3492 to rely on ARGSUSED (which doesn't work for gcc with warnings).
3493 const char -> char const.
3494
3495 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
3496 Don't use tabs inside commands; it messes up 'ps'.
3497 Problem reported by twlevo.
3498
3499 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
3500
3501 * tests/glr-regression.at (Uninitialized location when reporting
3502 ambiguity): New test case.
3503 * data/glr.c (yyresolveLocations): New function, which uses
3504 YYLLOC_DEFAULT.
3505 (yyresolveValue): Invoke yyresolveLocations before reporting an
3506 ambiguity.
3507 * doc/bison.texinfo (Default Action for Locations): Note
3508 YYLLOC_DEFAULT's usage for ambiguity locations.
3509 (GLR Semantic Actions): Cross-reference those notes.
3510
3511 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
3512
3513 * tests/glr-regression.at (Leaked semantic values when reporting
3514 ambiguity): Remove unnecessary union and type declarations.
3515 (Leaked lookahead after nondeterministic parse syntax error): New test
3516 case.
3517 * data/glr.c (yyparse): Check for zero stacks remaining before
3518 attempting to shift the lookahead so that you don't lose it.
3519
3520 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3521
3522 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
3523 * tests/glr-regression.at (Leaked semantic values when reporting
3524 ambiguity): New test case.
3525 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
3526 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
3527 now unnecessary yystackp parameter.
3528 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
3529 destructors can be called.
3530
3531 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
3532 in existing testcases.
3533
3534 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3535
3536 Don't leak semantic values for parent RHS when a user action cuts the
3537 parser, and clean up related code a bit.
3538 * tests/glr-regression.at (Leaked merged semantic value if user action
3539 cuts parse): Rename to...
3540 (Leaked semantic values if user action cuts parse): ... this. Add check
3541 for leaked parent RHS values.
3542 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
3543 between an unresolved state (non-empty chain of semantic options) and
3544 an incomplete one (signaled by an empty chain).
3545 (yyresolveStates): Document the interface. Move all manipulation of a
3546 successfully or unsuccessfully resolved yyGLRState to...
3547 (yyresolveValue): ... here so that yyresolveValue always leaves a
3548 yyGLRState with consistent data and thus is easier to understand.
3549 Remove the yyvalp and yylocp parameters since they are always just
3550 taken from the yys parameter. When reporting a discarded merged value
3551 in debugging output, note that it is incompletely merged. Document the
3552 interface.
3553 (yyresolveAction): If resolving any of the RHS states fails, destroy
3554 them all rather than leaking them. Thus, as long as user actions are
3555 written to clean up the RHS correctly, yyresolveAction always cleans up
3556 the RHS of a semantic option. Document the interface.
3557
3558 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
3559
3560 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
3561 led to a segmentation fault in GNU Pascal. Problem reported
3562 by Waldek Hebisch.
3563
3564 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
3565
3566 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
3567 mid-rule action inside a nonterminal symbol in order to declare a
3568 destructor for its semantic value.
3569
3570 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
3571
3572 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
3573 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
3574 __cplusplus && ! defined _STDLIB_H && !
3575 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
3576 defined free))]: Include <stdlib.h> rather than rolling our own
3577 declarations of malloc and free, to avoid problems with
3578 incompatible declarations (using 'throw') C++'s stdlib.h. This
3579 should fix Debian bug 340012
3580 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
3581 reported by Guillaume Melquiond.
3582
3583 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3584
3585 * NEWS: Clarify symbols versus types in unused-value warnings.
3586
3587 * configure.ac (AC_INIT): Bump version number.
3588
3589 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3590
3591 * NEWS: Version 2.1a.
3592 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
3593 since C99 requires this.
3594
3595 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
3596
3597 * m4/c-working.m4: New file.
3598 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
3599
3600 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
3601
3602 * Makefile.maint: Merge from coreutils.
3603
3604 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
3605
3606 More portability fixes for problems summarized by Nelson H. F. Beebe.
3607
3608 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
3609 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
3610 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
3611 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
3612 messes up because C++ code is compiled in 32-bit mode but linked
3613 in 64-bit mode.
3614
3615 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
3616
3617 More portability fixes for problems summarized by Nelson H. F. Beebe.
3618
3619 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
3620 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
3621
3622 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
3623 nodist_PROGRAMS, since we don't need to actually compile the
3624 example if we're just doing a plain 'make'. This avoids bothering
3625 the installer unnecessarily about problems due to weird C++
3626 compilers.
3627
3628 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
3629
3630 More portability fixes for problems summarized by Nelson H. F. Beebe.
3631
3632 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
3633 than #include "...", and compile with -I'.'. The old method was
3634 not portable, according to Posix and the C standard, and it does
3635 not work with Sun C 5.7, where previous #line directives affect
3636 the working directory used in later #include "..." directives.
3637
3638 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3639
3640 Various DJGGP specific issues in /djgpp
3641
3642 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
3643
3644 More portability fixes for problems summarized by Nelson H. F. Beebe.
3645
3646 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
3647 '#include <map>' works and that you can apply ++ to iterators.
3648
3649 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
3650
3651 Work around portability problems summarized by Nelson H. F. Beebe in
3652 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
3653
3654 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3655 that '#include <string>' works.
3656
3657 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
3658 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
3659 "warning: sorry: semantics of inline function static data `const
3660 unsigned char translate_table[262]' are wrong (you'll wind up with
3661 multiple copies)".
3662
3663 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
3664 or, xor to not_, and_, or_, and xor_, respectively. This works
3665 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
3666 random system header somewhere that includes the equivalent of
3667 <iso646.h>.
3668
3669 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
3670 -E" works; it apparently doesn't work with PathScale EKO Compiler
3671 Suite Version 2.0.
3672
3673 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
3674
3675 During deterministic GLR operation, user actions should be able to
3676 influence the parse by changing yychar. To make this easier to fix and
3677 to make glr.c easier to evolve in general, don't maintain yytoken in
3678 parallel with yychar; just compute yytoken when needed.
3679 * tests/glr-regression.at (Incorrect lookahead during deterministic
3680 GLR): Check that setting yychar in a user action has the intended
3681 effect.
3682 * data/glr.c (yyGLRStack): Remove yytokenp member.
3683 (yyclearin): Don't set *yytokenp.
3684 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
3685 yychar rather than *yytokenp to determine the current lookahead.
3686 Compute yytoken locally when needed.
3687 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
3688 point to.
3689
3690 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
3691 after `--report' documentation.
3692
3693 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
3694
3695 * src/parse-gram.y (grammar_declaration): Location of printer
3696 symbol is @1, not list->location. Bug reported by twlevo.
3697 * tests/input.at (Incompatible Aliases): Adjust to above change.
3698
3699 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
3700
3701 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
3702 all the test at once. This makes the output easier to read in the
3703 normal case.
3704
3705 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
3706 got from <http://bro-ids.org/download.html>. The bug is that
3707 when two actions appeared in succession, the second one was
3708 scanned before the first one was added to the grammar rule
3709 as a midrule action. Bison then output the incorrect warning
3710 "parse.y:905.17-906.36: warning: unused value: $3".
3711 * src/parse-gram.y (BRACED_CODE, action): These are no longer
3712 associated with a value.
3713 (rhs): Don't invoke grammar_current_rule_action_append.
3714 (action): Invoke it here instead.
3715 * src/reader.c (grammar_midrule_action): Now extern.
3716 (grammar_current_rule_action_append): Don't invoke
3717 grammar_midrule_action; that is now the scanner's job.
3718 * src/reader.h (last_string, last_braced_code_loc):
3719 (grammar_midrule_action): New decls.
3720 * src/scan-gram.l (last_string): Now extern, sigh.
3721 (last_braced_code_loc): New extern variable.
3722 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
3723 rule already has an action.
3724 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
3725 * tests/input.at (AT_CHECK_UNUSED_VALUES):
3726 Add some tests to check that the above changes fixed the bug.
3727
3728 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
3729
3730 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
3731 All used changed. Check whether the symbol has a destructor,
3732 not whether it is typed.
3733 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
3734 that the values are still reported as unused. All line numbers
3735 adjusted.
3736
3737 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
3738
3739 Work around a bug in bro 0.8, which underparenthesizes its
3740 definition of YYLLOC_DEFAULT.
3741 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
3742 their arguments.
3743 * data/lalr1.cc: Likewise.
3744 * data/yacc.cc: Likewise.
3745
3746 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
3747
3748 Work around a bug in Pike 7.0, and give the Pike folks a
3749 better way to override the usual int widths.
3750 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
3751 user can override the types.
3752 (short): #undef, to work around a bug in Pike 7.0.
3753 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
3754 (union yyalloc.yyss): Use yytype_int16 rather than short.
3755 All uses changed.
3756 (yysigned_char): Remove.
3757 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
3758 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
3759 * tests/regression.at (Web2c Actions): Adjust to above changes.
3760
3761 * src/reader.c (check_and_convert_grammar): New function.
3762 (reader): Close the input file even if something went wrong during
3763 parsing. Minor file descriptor leak reported by twlevo.
3764
3765 * src/assoc.c (assoc_to_string): Use a default: abort (); case
3766 to pacify gcc -Wswitch-default.
3767 * src/scan-gram.l (adjust_location): Use a default: break; case
3768 to pacify gcc -Wswitch-default.
3769 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
3770 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3771 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3772 Move these decls to scan-skel.l, since they don't need to be
3773 visible elsewhere.
3774 * src/scan-skel.l: Accept the above decls.
3775 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
3776 is used.
3777
3778 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
3779
3780 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
3781 since we don't want to insist on a version number at the start
3782 of the changelog every time.
3783 * Makefile.maint: Sync from coreutils a bit better.
3784 (sc_trailing_blank): Renamed from sc_trailing_space.
3785 All uses changed.
3786 (sc_no_if_have_config_h, sc_require_config_h):
3787 (sc_prohibit_assert_without_use): New rules.
3788 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
3789 (sc_dd_max_sym_length): Fix leading spaces in rule.
3790 (sc_system_h_headers): Prefix with @.
3791 (sc_useless_cpp_parens, m4-check): Output line numbers.
3792 (changelog-check): Allow version only in head.
3793 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
3794 satisfy new Makefile.maint rule.
3795 * data/glr.c: Likewise.
3796 * data/glr.cc: Likewise.
3797 * data/lalr1.cc: Likewise.
3798 * data/yacc.c: Likewise.
3799 * lib/ebitsetv.c: Likewise.
3800 * lib/lbitset.c: Likewise.
3801 * lib/subpipe.c: Likewise.
3802 * lib/timevar.c: Likewise.
3803 * src/system.h: Likewise.
3804 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
3805 * djgpp/Makefile.maint: Add copyright notice.
3806 * djgpp/README.in: Likewise.
3807 * djgpp/config.bat: Likewise.
3808 * djgpp/config.site: Likewise.
3809 * djgpp/config_h.sed: Likewise.
3810 * djgpp/djunpack.bat: Likewise.
3811 * djgpp/config.sed: Fix copyright notice to match standard format.
3812 * djgpp/subpipe.h: Likewise.
3813 * lib/bitsetv-print.c: Likewise.
3814 * lib/bitsetv.c: Likewise.
3815 * lib/subpipe.h: Likewise.
3816 * lib/timevar.c: Likewise.
3817 * lib/timevar.h: Likewise.
3818 * djgpp/subpipe.c: Use standard recipe for config.h.
3819 * lib/abitset.c: Likewise.
3820 * lib/bitset.c: Likewise.
3821 * lib/bitset_stats.c: Likewise.
3822 * lib/bitsetv-print.c: Likewise.
3823 * lib/bitsetv.c: Likewise.
3824 * lib/ebitsetv.c: Likewise.
3825 * lib/get-errno.c: Likewise.
3826 * lib/lbitset.c: Likewise.
3827 * lib/subpipe.c: Likewise.
3828 * lib/timevar.c: Likewise.
3829 * lib/vbitset.c: Likewise.
3830 * tests/local.at: Likewise.
3831 * src/scan-gram.l: Don't include verify.h, since system.h does
3832 that for us.
3833 * .x-sc_require_config_h: New file.
3834 * .x-sc_unmarked_diagnostics: New file.
3835
3836 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
3837
3838 Be a bit more systematic about using 'abort'.
3839 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
3840 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
3841 Put 'default: abort ();' before some other case, to satisfy older
3842 pedantic compilers.
3843 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3844 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
3845 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
3846 * src/conflicts.c (resolve_sr_conflict): Likewise.
3847 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
3848 (get_decision_str, get_orientation_str, get_node_alignment_str):
3849 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
3850 (get_linestyle_str, get_arrowstyle_str): Likewise.
3851 * src/conflicts.c (resolve_sr_conflict):
3852 Use a default case rather than one for the one remaining enum
3853 value, to catch invalid enum values as well.
3854 * src/lalr.c (set_goto_map, map_goto):
3855 Prefer "assert (FOO);" to "if (!FOO) abort ();".
3856 * src/nullable.c (nullable_compute, token_definitions_output):
3857 Likewise.
3858 * src/reader.c (packgram, reader): Likewise.
3859 * src/state.c (transitions_to, state_new, state_reduction_find):
3860 Likewise.
3861 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
3862 (symbol_pack): Likewise.
3863 * src/tables.c (conflict_row, pack_vector): Likewise.
3864 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
3865 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
3866 * src/system.h: Don't include <assert.h>.
3867 (assert): New macro.
3868
3869 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
3870 (Destructor Decl, Parser Function, Pure Calling):
3871 Describe rules for braces inside C code more carefully.
3872
3873 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
3874
3875 Fix some porting glitches found by Nelson H. F. Beebe.
3876 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
3877 compilers that don't understand that abort () does not return.
3878 * src/state.c (transitions_to): Likewise.
3879 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3880 that '#include <cstdlib>' works.
3881 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
3882 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
3883 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
3884 for the benefit of some pre-C99 compilers.
3885
3886 * bootstrap: Undo changes to gnulib files that autoreconf made.
3887
3888 Minor fixups to get 'make maintainer-check' to work.
3889 * configure.ac: Don't use -Wnested-externs, as it's incompatible
3890 with the new verify.h implementation.
3891 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
3892 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
3893 * data/yacc.c (YYUSE): Likewise.
3894 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
3895 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
3896 * src/parse-gram.y (declaration): Don't pass a string constant
3897 to a function that expects char *, since GCC might complain
3898 about the constant value.
3899 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
3900 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
3901 before #defining them.
3902 * tests/glr-regression.at
3903 (Incorrectly initialized location for empty right-hand side in GLR):
3904 In yyerror, use the msg arg.
3905 (Corrupted semantic options if user action cuts parse):
3906 (Incorrect lookahead during deterministic GLR):
3907 (Incorrect lookahead during nondeterministic GLR):
3908 Don't name a local var 'index'; it shadows string.h's 'index'.
3909
3910 2006-01-19 Akim Demaille <akim@epita.fr>
3911
3912 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
3913 location, not just parts of it.
3914
3915 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
3916
3917 * NEWS: Document the fact that multiple %unions are now allowed.
3918 * doc/bison.texinfo (Union Decl): Likewise.
3919 * TODO: This feature is now implemented, so remove it from
3920 the wishlist.
3921
3922 * Makefile.maint: Merge with coreutils Makefile.maint.
3923 (CVS_LIST): Use build-aux version if available.
3924 (VERSION_REGEXP): New macro.
3925 (syntax-check-rules): Add sc_no_if_have_config_h,
3926 sc_prohibit_assert_without_use, sc_require_config_h,
3927 sc_useless_cpp_parens.
3928 (sc_obsolete_symbols): Check for O_NDELAY.
3929 (sc_dd_max_sym_length): Track coreutils.
3930 (sc_unmarked_diagnostics): Look in all files, not just *.c.
3931 (sc_useless_cpp_parens): New rule.
3932 (news-date-check): Look for version or today's date.
3933 (changelog-check): Don't require version number near head.
3934 (copyright-check): Use current year instead of hardwiring 2005.
3935 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
3936 (announcement): Add --gpg-key-ID.
3937
3938 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
3939 with "file system".
3940
3941 Avoid undefined behavior that addressed just before the start of an
3942 array. Problem reported by twlevo.
3943 * src/reader.c (packgram): Prepend a new sentinel before ritem.
3944 * src/lalr.c (build_relations): Rely on new sentinel.
3945 * src/gram.c (gram_free): Adjust to new sentinel.
3946
3947 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
3948
3949 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
3950 yylookaheadNeeds. All uses updated.
3951 (yysplitStack): Rename local yynewLookaheadStatuses to
3952 yynewLookaheadNeeds.
3953 * data/glr-regression.at (Incorrect lookahead during nondeterministic
3954 GLR): In comments, change `lookahead status' to `lookahead need'.
3955
3956 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3957
3958 * data/glr.c (yysplitStack): A little stylistic rewrite.
3959
3960 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3961
3962 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
3963
3964 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
3965
3966 * doc/bison.texinfo: Fix some typos.
3967 (GLR Semantic Actions): New subsection discussing special
3968 considerations because GLR semantic actions might be deferred.
3969 (Actions): Mention look-ahead usage of yylval.
3970 (Actions and Locations): Mention look-ahead usage of yylloc.
3971 (Special Features for Use in Actions): Add YYEOF entry and mention it
3972 in the yychar entry.
3973 In the yychar entry, remove mention of the local yychar case (pure
3974 parser) since this is irrelevant information when writing semantic
3975 actions and since it's already discussed in `Table of Symbols' where
3976 yychar is otherwise described as an external variable.
3977 In the yychar entry, don't call it the `current' look-ahead since it
3978 isn't when semantic actions are deferred.
3979 In the yychar and yyclearin entries, add note about deferred semantic
3980 actions.
3981 Add yylloc and yylval entries discussing look-ahead usage.
3982 (Look-Ahead Tokens): When discussing yychar, don't call it the
3983 `current' look-ahead, and do mention yylval and yylloc.
3984 (Error Recovery): Cross-reference `Action Features' when mentioning
3985 yyclearin.
3986 (Table of Symbols): In the yychar entry, don't call it the `current'
3987 look-ahead.
3988 In the yylloc and yylval entries, mention look-ahead usage.
3989
3990 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3991
3992 * tests/glr-regression.at: Update copyright year to 2006.
3993
3994 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3995
3996 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
3997 use during nondeterministic operation to track which stacks have
3998 actually needed the current lookahead.
3999 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
4000 Allocate, deallocate, resize, and otherwise shuffle space for
4001 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
4002 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
4003 appropriately during nondeterministic operation.
4004 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
4005 members to store the current lookahead to be used by the deferred
4006 user action.
4007 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
4008 from which the RHS is taken. Set the lookahead members of the new
4009 yySemanticOption according to the lookahead status for stack yyk.
4010 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
4011 yyaddDeferredAction.
4012 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
4013 members of yySemanticOption before invoking yyuserAction, and then set
4014 them back to their current values afterward.
4015 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
4016 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
4017 * tests/glr-regression.at: Remove `.' from the ends of recent test case
4018 titles for consistency.
4019 (Leaked merged semantic value if user action cuts parse): In order to
4020 suppress lint warnings, use arguments in merge function, and assign
4021 char value < 128 in main.
4022 (Incorrect lookahead during deterministic GLR): New test case.
4023 (Incorrect lookahead during nondeterministic GLR): New test case.
4024
4025 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4026
4027 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
4028 !yyvaluep as signal that no semantic value is available to print.
4029 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
4030 to print a semantic value.
4031
4032 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4033
4034 * tests/glr-regression.at: For consistency with my newer test cases,
4035 don't thank myself.
4036
4037 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4038
4039 * data/glr.c (yyresolveValue): When merging semantic options, if at
4040 least one user action succeeds but a later one cuts the parse, then
4041 destroy the semantic value before returning rather than leaking it.
4042 (yyresolveStates): If a user action cuts the parse and thus
4043 yyresolveValue fails, ignore the (unset) semantic value rather than
4044 corrupting the yyGLRState, and empty the semantic options list since
4045 the user actions should have called all necessary destructors.
4046 Simplify code with YYCHK.
4047 * tests/glr-regression.at (Corrupted semantic options if user action
4048 cuts parse): New test case.
4049 (Undesirable destructors if user action cuts parse): New test case.
4050 Before applying any of this patch, this test case never actually failed
4051 for me... but only because the corrupted semantic options usually
4052 masked this bug.
4053 (Leaked merged semantic value if user action cuts parse): New test
4054 case.
4055
4056 2006-01-05 Akim Demaille <akim@epita.fr>
4057
4058 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
4059
4060 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
4061
4062 * data/c.m4 (b4_c_modern): New macro, with a new provision for
4063 _MSC_VER. Problem reported by Cenzato Marco.
4064 (b4_c_function_def): Use it.
4065 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
4066 b4_c_modern.
4067 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
4068 than rolling our own.
4069
4070 2006-01-04 Akim Demaille <akim@epita.fr>
4071
4072 Also warn about non-used mid-rule values.
4073 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
4074 member.
4075 (symbol_list_new): Adjust.
4076 * src/reader.c (symbol_typed_p): New.
4077 (grammar_rule_check): Use it.
4078 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
4079 Check its rule.
4080 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
4081 Use it.
4082 * tests/actions.at (Exotic Dollars): Adjust.
4083
4084 2006-01-04 Akim Demaille <akim@epita.fr>
4085
4086 * src/reader.c (grammar_midrule_action): If $$ is set in a
4087 mid-rule, move the `used' bit to its lhs.
4088 * tests/input.at (Unused values): New.
4089 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
4090
4091 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
4092
4093 * doc/bison.texinfo (Bison Options): Say more accurately what
4094 --yacc does.
4095 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
4096 about declarations in the grammar when in Yacc mode, as POSIX does
4097 not require a diagnostic when the grammar uses extensions.
4098
4099 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
4100
4101 Warn about dubious constructions like "%token T T".
4102 Reported by twlevo.
4103 * src/symtab.h (struct symbol.declared): New member.
4104 * src/symtab.c (symbol_new): Initialize it to false.
4105 (symbol_class_set): New arg DECLARING, specifying whether
4106 this is a declaration that we want to warn about, if there
4107 is more than one of them. All uses changed.
4108
4109 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
4110 Allow multiple %union directives, whose contents concatenate.
4111 * src/parse-gram.y (grammar_declaration): Likewise.
4112 Use muscle_code_grow, so that we don't need stype_line any more.
4113 All uses changed.
4114
4115 * src/muscle_tab.c (muscle_grow): Fix comment.
4116
4117 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
4118 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
4119 Update copyright year to 2006.
4120
4121 2006-01-03 Akim Demaille <akim@epita.fr>
4122
4123 Have glr.cc pass (some of) the calc.at tests.
4124 * data/glr.cc (b4_parse_param_orig): New.
4125 (b4_parse_param): Improve its definition, and bound it more
4126 clearly in the skeleton.
4127 (b4_epilogue): Append, instead of prepending, in order to keep
4128 #line consistency.
4129 Simplify the generation of auxiliary functions: locations and
4130 purity are mandated.
4131 (b4_global_tokens_and_yystype): Honor it.
4132 * data/location.cc (c++.m4): Don't include it.
4133 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
4134 and AT_SKEL_CC_IF.
4135 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
4136 AT_LALR1_CC_IF.
4137 Be sure to initialize the first position's filename.
4138 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
4139 mandated anyway.
4140 (AT_CHECK_CALC_GLR_CC): New.
4141 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
4142
4143 2006-01-02 Akim Demaille <akim@epita.fr>
4144
4145 * src/output.c (output_skeleton): Don't hard wire the inclusion of
4146 c.m4.
4147 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
4148 * data/glr.cc: Do not include stack.hh.
4149
4150 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4151
4152 * data/glr.c: Reformat whitespace with tabs.
4153 (b4_lpure_formals): Remove this unused m4 macro.
4154 * tests/cxx-type.at: Reformat whitespace with tabs.
4155 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
4156 since it's a member. Rename type to isNterm for clarity.
4157
4158 2005-12-29 Akim <akim@sulaco.local>
4159
4160 Let glr.cc catch up with symbol_value_print.
4161 * data/glr.cc (b4_yysymprint_generate): Replace by...
4162 (b4_yy_symbol_print_generate): this.
4163 (yy_symbol_print, yy_symbol_value_print): Declare them.
4164
4165 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
4166
4167 * src/location.h (boundary): Note that a line or column equal
4168 to INT_MAX indicates an overflow.
4169 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
4170 (rule_length_overflow, increment_rule_length, add_column_width):
4171 New functions.
4172 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
4173 (<SC_BRACED_CODE>"}"):
4174 Use increment_rule_length rather than incrementing it by hand.
4175 (adjust_location, handle_syncline): Diagnose overflow.
4176 (handle_action_dollar, handle_action_at):
4177 Fix bug with monstrosities like $-2147483648.
4178 Remove now-unnecessary checks.
4179 (scan_integer): Verify assumptions and remove now-unnecessary checks.
4180 (convert_ucn_to_byte): Verify assumptions.
4181 (handle_syncline): New arg LOC. All callers changed.
4182 Don't store through a value derived from char const * pointer.
4183
4184 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
4185 GCC warnings.
4186
4187 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
4188
4189 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
4190 Remove unnecessary forward static decls.
4191
4192 2005-12-27 Akim Demaille <akim@epita.fr>
4193
4194 * src/reader.c (grammar_current_rule_check): Also check that $$
4195 is used.
4196 Take the rule to check as argument, hence rename as...
4197 (grammar_rule_check): this.
4198 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
4199 Rename as...
4200 (grammar_rule_begin, grammar_rule_end): these, for consistency.
4201 (grammar_midrule_action, grammar_symbol_append): Now static.
4202 * tests/torture.at (input): Don't rely on the default action
4203 being always performed.
4204 * tests/calc.at: "Set" $$ even when the action is "cut" with
4205 YYERROR or other.
4206 * tests/actions.at (Exotic Dollars): Instead of using unused
4207 values, check that the warning is issued.
4208
4209 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
4210
4211 * NEWS: Improve wording for unused-value warnings.
4212
4213 2005-12-22 Akim Demaille <akim@epita.fr>
4214
4215 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
4216 (b4_yysymprint_generate): Rename as...
4217 (b4_yy_symbol_print_generate): this.
4218 Generate yy_symbol_print instead of yysymprint.
4219 Generate also yy_symbol_value_print, and use it.
4220
4221 2005-12-22 Akim Demaille <akim@epita.fr>
4222
4223 * NEWS: Warn about unused values.
4224 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
4225 a `used' member.
4226 (symbol_list_n_get, symbol_list_n_used_set): New.
4227 (symbol_list_n_type_name_get): Use symbol_list_n_get.
4228 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
4229 * src/reader.c (grammar_current_rule_check): Check that values are
4230 used.
4231 * src/symtab.c (symbol_print): Accept 0.
4232 * tests/existing.at: Remove the type information.
4233 Empty the actions.
4234 Remove useless actions (beware of mid-rule actions: perl -000
4235 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
4236 * tests/actions.at (Exotic Dollars): Use unused values.
4237 * tests/calc.at: Likewise.
4238 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4239 Likewise.
4240
4241 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
4242 rule_useful_p.
4243
4244 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
4245
4246 Undo 2005-12-01 tentative license wording change. The wording is
4247 still being reviewed by the lawyers, and we don't want to wait for
4248 them before publishing a test release. For now, revert to the
4249 previous wording.
4250 * NEWS: Undo 2005-12-01 change.
4251 * data/glr.c: Revert to previous license wording.
4252 * data/glr.cc: Likewise.
4253 * data/lalr1.cc: Likewise.
4254 * data/location.cc: Likewise.
4255 * data/yacc.c: Likewise.
4256
4257 * NEWS: Reword %destructor vs YYABORT etc.
4258 * data/glr.c: Use American spacing, for consistency.
4259 * data/glr.cc: Likewise.
4260 * data/lalr1.cc: Likewise.
4261 * data/yacc.c: Likewise.
4262 * data/yacc.c: Reformat comments slightly.
4263 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
4264 for consistency. Fix some spelling errors and reword recently-included
4265 text slightly.
4266 * tests/cxx-type.at: Cast results of malloc, for C++.
4267
4268 2005-12-21 Joel E. Denny <address@hidden>
4269
4270 * tests/cxx-type.at: Construct a tree, count the parents of shared
4271 nodes, and free each node once and only once. Previously, the memory
4272 for semantic values was leaked instead.
4273
4274 2005-12-21 Joel E. Denny <address@hidden>
4275
4276 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
4277 (yylval, yylloc): If pure, #define to yystackp->yyval and
4278 yystackp->yyloc similar to yychar and yynerrs.
4279 (yyparse): If pure, remove local yylval and yylloc. Add local
4280 yystackp to accommodate pure definitions of yylval and yylloc.
4281 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
4282 yylvalp and yyllocp to &yylval and &yylloc.
4283 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
4284 namespace. Previously, nerrs and char were missing, but lval and lloc
4285 weren't necessary.
4286 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
4287 yylvalp and yyllocp parameters since, if pure, these are now always
4288 accessible through yystackp. If not pure, they are still accessible
4289 globally.
4290 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
4291 `if (YYID (N))' to pacify lint.
4292
4293 2005-12-21 Akim Demaille <akim@epita.fr>
4294
4295 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
4296 destroy the RHS symbols of a rule.
4297 * data/yacc.c (yylen): Initialize to 0.
4298 Keep its value to the number of items to possibly shift.
4299 In particular, a regular successful parse that ends on YYFINAL by
4300 a (internal) YYACCEPT must not have yylen != 0.
4301 (yyerrorlab, yyreturn): Pop the RHS.
4302 Reorder a bit to emphasize the `shifting' bits of code.
4303 (YYPOPSTACK): Now accept a number of items to pop.
4304 * data/lalr1.cc: Likewise.
4305 * data/glr.c: Formatting changes.
4306 Use goto instead of fall through.
4307 * doc/bison.texinfo (Destructor Decl): Complete.
4308
4309 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4310
4311 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4312 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
4313 * djgpp/config.bat: Replace every occurence of the file name
4314 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4315 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4316 * djgpp/config.sed: Replace every occurence of the file name
4317 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4318 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4319 * djgpp/djunpack.bat: DJGPP specific file.
4320 * djgpp/fnchange.lst: DJGPP specific file.
4321 * djgpp/README.in: Add new information about how to unpack the bison
4322 source on MSDOS and other systems which have 8.3 file name restrictions
4323 using djunpack.bat and fnchange.lst.
4324
4325 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
4326
4327 * bootstrap (build_cvs_prefix): Remove; unused.
4328 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
4329 when getting gnulib.
4330
4331 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
4332
4333 * data/glr.c: Reorder typedef declarations for structs to match order
4334 of struct declarations.
4335 Rename yystack everywhere to yystackp except in yyparse where it's not
4336 a pointer.
4337 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
4338 consistency.
4339 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
4340 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
4341 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
4342 lint.
4343
4344 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
4345
4346 * tests/sets.at (Accept): Fix typos in regular expression used to
4347 sed out the final state number.
4348
4349 Work around portability problem on Solaris 10: flex-generated
4350 files include <stdio.h> before <config.h>, which messes up
4351 because the latter defines __EXTENSIONS__. Address the problem
4352 by creating two new little files that include <config.h> first,
4353 then include the flex-generated files. Rewrite everyone else
4354 to include <config.h> first, as well.
4355 * lib/timevar.c: Always include "config.h".
4356 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
4357 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
4358 (EXTRA_bison_SOURCES): New macro.
4359 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
4360 * src/system.h: Don't include config.h.
4361 * src/LR0.c: Include <config.h> first.
4362 * src/assoc.c: Likewise.
4363 * src/closure.c: Likewise.
4364 * src/complain.c: Likewise.
4365 * src/conflicts.c: Likewise.
4366 * src/derives.c: Likewise.
4367 * src/files.c: Likewise.
4368 * src/getargs.c: Likewise.
4369 * src/gram.c: Likewise.
4370 * src/lalr.c: Likewise.
4371 * src/location.c: Likewise.
4372 * src/main.c: Likewise.
4373 * src/muscle_tab.c: Likewise.
4374 * src/nullable.c: Likewise.
4375 * src/output.c: Likewise.
4376 * src/parse-gram.y: Likewise.
4377 * src/print.c: Likewise.
4378 * src/print_graph.c: Likewise.
4379 * src/reader.c: Likewise.
4380 * src/reduce.c: Likewise.
4381 * src/relation.c: Likewise.
4382 * src/state.c: Likewise.
4383 * src/symlist.c: Likewise.
4384 * src/symtab.c: Likewise.
4385 * src/tables.c: Likewise.
4386 * src/uniqstr.c: Likewise.
4387 * src/vcg.c: Likewise.
4388
4389 * src/parse-gram.y: Fix minor problems uncovered by lint.
4390 (current_lhs, current_lhs_location): Now static.
4391 (current_assoc): Remove unused variable.
4392
4393 Cleanups so that Bison-generated parsers have less lint.
4394 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
4395 Prepend /*ARGSUSED*/, for lint's sake.
4396 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
4397 definition if 'lint' is defined.
4398 (YYID): New macro (or function, if lint).
4399 All uses of /*CONSTCOND*/0 replaced by YYID(0).
4400 * data/yacc.c: Likewise.
4401 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
4402 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
4403 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
4404 is C++ only.
4405 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
4406 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
4407 Use YYID(0) rather than 0, for lint.
4408 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
4409 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
4410
4411 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
4412
4413 * tests/glr-regression.at
4414 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4415 Close memory leak reported by twlevo.
4416
4417 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
4418
4419 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
4420 all stacks.
4421 (yyparse): Iterate another stack in order to call user destructors.
4422 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4423 New test case.
4424 (Duplicated user destructor for lookahead): This test now is expected
4425 to succeed.
4426
4427 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
4428
4429 * NEWS: Document the following change.
4430 * data/yacc.c: Say "parser skeleton" rather than "file", since
4431 it's no longer just a file.
4432 * data/glr.c: Grant a special exception for C GLR parsers, that
4433 reads like the already-existing exception for C LALR(1) parsers.
4434 * data/glr.cc: Likewise.
4435 * data/lalr1.cc: Likewise.
4436 * data/location.cc: Likewise.
4437 * data/yacc.c: Reword the "written by" statement to clarify that
4438 it was the parser skeleton, not the entire output file.
4439 * data/glr.c: Written by Paul Hilfinger.
4440 * data/glr.cc: Written by Akim Demaille.
4441 * data/lalr1.cc: Likewise.
4442
4443 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
4444
4445 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
4446 Fix typos in previous change that broke 'make check'.
4447 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
4448 supported in C.
4449 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
4450 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
4451 We can revert this once things settle down.
4452
4453 * src/conflicts.c (conflicts_print): Don't print file name twice
4454 when %expect fails because there were no conflicts.
4455 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
4456 change.
4457 * tests/conflicts.at (%expect not enough, %expect too much):
4458 (%expect with reduce conflicts): Adjust to new behavior.
4459
4460 2005-11-18 Akim Demaille <akim@epita.fr>
4461
4462 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
4463 errors.
4464 * NEWS: Document this.
4465 * doc/bison.texinfo (Expect Decl): Likewise.
4466
4467 2005-11-16 Akim Demaille <akim@epita.fr>
4468
4469 Generalize the display of semantic values and locations in traces.
4470 * data/glr.c (yy_reduce_print): Fix indices (again).
4471 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
4472 literal integers.
4473 * data/lalr1.cc (yyreduce_print): Rename as...
4474 (yy_reduce_print): this.
4475 Display values and locations.
4476 * data/yacc.c (yy_reduce_print): Likewise.
4477 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
4478 (yysymprint): Move higher to be visible from yy_reduce_print).
4479 (yyparse): Adjust.
4480 * tests/calc.at: Adjust the expected length of the traces.
4481
4482 2005-11-14 Akim Demaille <akim@epita.fr>
4483
4484 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
4485 from 1 to N, while values and location start at 0.
4486 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
4487
4488 2005-11-14 Akim Demaille <akim@epita.fr>
4489
4490 * data/glr.c (yy_reduce_print): Fix the $ number.
4491
4492 2005-11-14 Akim Demaille <akim@epita.fr>
4493
4494 "Use" parse parameters.
4495 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
4496 * data/glr.c, data/glr.cc: Use them.
4497 * data/glr.c (YYUSE): Have a C++ definition that supports
4498 non-pointer types.
4499
4500 2005-11-14 Akim Demaille <akim@epita.fr>
4501
4502 * data/glr.c (yyexpandGLRStack): Declare only if defined.
4503
4504 2005-11-14 Akim Demaille <akim@epita.fr>
4505
4506 * data/glr.cc: New.
4507 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
4508
4509 2005-11-12 Akim Demaille <akim@epita.fr>
4510
4511 Let position and location be PODs.
4512 * data/location.cc (position::initialize, location::initialize): New.
4513 (position::position, location::location): Define only if
4514 b4_location_constructors is defined.
4515 * data/lalr1.cc (b4_location_constructors): Define it for backward
4516 compatibility.
4517 * doc/bison.texinfo (Initial Action Decl): Use initialize.
4518
4519 2005-11-12 Akim Demaille <akim@epita.fr>
4520
4521 * data/lalr1.cc: Move the body of the ctor and dtor into the
4522 parser file (instead of the header).
4523 Wrap the implementations in a "namespace yy".
4524
4525 2005-11-12 Akim Demaille <akim@epita.fr>
4526
4527 Have glr.c include its header file when created.
4528 * data/glr.c (b4_shared_declarations): New.
4529 Output them verbatim in the parser if !%defines, otherwise
4530 output then in the header file, and include it instead.
4531
4532 2005-11-11 Akim Demaille <akim@epita.fr>
4533
4534 * data/glr.c: Comment changes.
4535
4536 2005-11-11 Akim Demaille <akim@epita.fr>
4537
4538 When yydebug, report semantic and location values for reductions.
4539 * data/glr.c (yy_reduce_print): Report the semantic values and the
4540 locations.
4541 (YY_REDUCE_PRINT): Adjust.
4542 (yyglrReduce): Use them.
4543 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
4544 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
4545 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
4546 traces.
4547
4548 2005-11-10 Akim Demaille <akim@epita.fr>
4549
4550 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
4551 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
4552 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
4553
4554 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
4555
4556 * m4/cxx.m4, examples/Makefile.am: Don't build
4557 examples/calc++ if no C++ compiler is available. (trivial change)
4558
4559 2005-11-09 Akim Demaille <akim@epita.fr>
4560
4561 * src/scan-skel.l: Use a couple of asserts.
4562
4563 2005-11-03 Akim Demaille <akim@epita.fr>
4564
4565 In some (weird) cases, the final state number is incorrect.
4566 Reported by Alexandre Duret-Lutz.
4567 * src/LR0.c (state_list_append): Remove the computation of
4568 final_state.
4569 (save_reductions): Do it here.
4570 (get_state): Alpha conversion.
4571 (generate_states): Use a for loop.
4572 * src/gram.h (item_number_is_rule_number)
4573 (item_number_is_symbol_number): New.
4574 * src/state.c: Use assert.
4575 * src/system.h: Include assert.h.
4576 * tests/sets.at (Accept): New.
4577
4578 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4579
4580 * data/glr.c (yyfill): Adjust comment.
4581 (yyresolveAction): Initialize default location properly
4582 for empty right-hand sides.
4583 (yydoAction): Ditto.
4584 Add comment explaining apparently dead code.
4585 * tests/glr-regression.at
4586 (Incorrectly initialized location for empty right-hand side in GLR):
4587 New test.
4588
4589 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
4590
4591 * bootstrap (cleanup_gnulib): New function. Use it to clean up
4592 gnulib when interrupted. This fixes some race conditions and
4593 works around some portability problems (one noted by Paul
4594 Hilfinger).
4595
4596 2005-10-22 Akim <akim@epita.fr>
4597
4598 * Makefile.cfg: Adjust to config -> build-aux.
4599 Reported by twledo.
4600
4601 2005-10-21 Akim Demaille <akim@epita.fr>
4602
4603 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
4604 the %parse-params.
4605 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
4606 * data/yacc.c (b4_Pure_if): Rename as...
4607 (b4_yacc_pure_if): this.
4608 (YY_SYMBOL_PRINT, yyparse): Adjust.
4609 * doc/bison.texinfo: Formatting changes.
4610
4611 2005-10-21 Akim Demaille <akim@epita.fr>
4612
4613 Finish the transition config -> build-aux.
4614 * configure.ac, Makefile.am: Use build-aux.
4615 * config/prev-version, config/announce-gen, config/Makefile.am:
4616 Move to...
4617 * build-aux/prev-version, build-aux/announce-gen,
4618 * build-aux/Makefile.am: here.
4619
4620 2005-10-14 Akim Demaille <akim@epita.fr>
4621
4622 * examples/calc++/test: Use set -x only when VERBOSE.
4623
4624 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
4625
4626 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
4627 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
4628
4629 2005-10-13 Akim Demaille <akim@epita.fr>
4630
4631 * src/scan-skel.l: Output the base name parts of the parser and
4632 header file names.
4633 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
4634 additional checks.
4635 Use this to exercise C++ outputs in subdirs.
4636 Reported by Oleg Smolsky.
4637
4638 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
4639
4640 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
4641 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
4642 Problem reported by John P. Hartmann.
4643 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
4644 already defined it.
4645
4646 2005-10-12 Akim Demaille <akim@epita.fr>
4647
4648 * src/parse-gram.y (version_check): Exit 63 to please missing
4649 (stands for "version mismatch).
4650 * tests/input.at, doc/bison.texinfo: Adjust.
4651
4652 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
4653
4654 Work around portability problems with Visual Age C compiler
4655 (xlc and xlC_r) reported by John P. Hartmann.
4656 * data/location.cc (initial_column, initial_line): Remove.
4657 All uses replaced by 0 and 1.
4658 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
4659 that xlc complains about.
4660 * src/scan-skel.l (skel_wrap): Likewise.
4661 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
4662 as __STDC__.
4663 * data/yacc.c (YYMODERN_C): New macro, which also looks at
4664 __STDC_VERSION__. Use it everywhere instead of looking at
4665 __STDC__ and __cplusplus.
4666
4667 2005-10-10 Akim Demaille <akim@epita.fr>
4668
4669 * examples/calc++/test: Be quiet unless VERBOSE.
4670
4671 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
4672
4673 * data/c.m4 (yydestruct, yysymprint):
4674 Use YYUSE instead of casting to void.
4675 * data/glr.c (YYUSE): New macro.
4676 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4677 Use it instead of rolling our own.
4678 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4679 (YYCHK1):
4680 Use /*CONSTCOND*/ to suppress lint warnings.
4681 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4682 (YY_STACK_PRINT): Use 'false' not '0'.
4683 (YYUSE): New macro.
4684 (yysymprint_, yydestruct_): Use it instead of rolling our own.
4685 * data/yacc.c (YYUSE): New macro.
4686 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
4687 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
4688 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
4689
4690
4691 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
4692 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
4693
4694 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
4695
4696 Undo the parts of the unlocked-I/O change that substituted
4697 putc or puts for printf. This might hurt performance a bit,
4698 but some people prefer the printf style.
4699 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
4700 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
4701 All uses replaced by YYFPRINTF and YYDPRINTF.
4702 * data/yacc.c: Likewise.
4703 * lib/bitset.c (bitset_print): Likewise.
4704 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
4705 putc and puts.
4706 * lib/lbitset.c (debug_lbitset): Likewise.
4707 * src/closure.c (print_firsts, print_fderives): Likewise.
4708 * src/gram.c (grammar_dump): Likewise.
4709 * src/lalr.c (look_ahead_tokens_print): Likewise.
4710 * src/output.c (escaped_output): Likewise.
4711 (user_actions_output): Break apart two printfs.
4712 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
4713 * src/reduce.c (reduce_print): Likewise.
4714 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4715 * src/system.h: Include unlocked-io.h rathe than stdio.h.
4716
4717 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4718 Use assignments rather than casts-to-void to suppress
4719 unused-variable warnings. This pacifies 'lint'.
4720 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
4721 unused-variable warnings.
4722
4723 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4724
4725 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4726
4727 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
4728
4729 Use unlocked I/O for a minor performance improvement on hosts like
4730 GNU/Linux and Solaris that support unlocked I/O. The basic idea
4731 is to use the gnlib unlocked-io module, and to prefer putc and
4732 puts to printf when either will work (since the latter doesn't
4733 come in an unlocked flavor).
4734 * bootstrap (gnulib_modules): Add unlocked-io.
4735 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
4736 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
4737 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
4738 and similarly for puts and putc and printf.
4739 * data/yacc.c: Likewise.
4740 * lib/bitset.c (bitset_print): Likewise.
4741 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
4742 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
4743 to printf.
4744 * lib/lbitset.c (debug_lbitset): Likewise.
4745 * src/closure.c (print_firsts, print_fderives): Likewise.
4746 * src/gram.c (grammar_dump): Likewise.
4747 * src/lalr.c (look_ahead_tokens_print): Likewise.
4748 * src/output.c (escaped_output): Likewise.
4749 (user_actions_output): Coalesce two printfs.
4750 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
4751 * src/reduce.c (reduce_print): Likewise.
4752 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4753 * src/system.h: Include unlocked-io.h rather than stdio.h.
4754
4755 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
4756 this confuses xgettext.
4757
4758 2005-10-02 Akim Demaille <akim@epita.fr>
4759
4760 * bootstrap (gnulib_modules): Add strverscmp.
4761 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
4762 * m4/.cvsignore: Add strverscmp.m4.
4763 * src/parse-gram.y (%require): New token, new rule.
4764 (version_check): New.
4765 * src/scan-gram.l (%require): Adjust.
4766 * tests/input.at (AT_REQUIRE): New.
4767 Use it.
4768 * doc/bison.texinfo (Require Decl): New.
4769 (Calc++ Parser): Use %require.
4770
4771 2005-10-02 Akim Demaille <akim@epita.fr>
4772
4773 * data/location.cc: New.
4774
4775 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
4776 Akim Demaille <akim@epita.fr>
4777
4778 Make sure -odir/foo.cc creates dir/location.hh etc.
4779 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
4780 (spec_file_prefix, spec_verbose_file, spec_graph_file)
4781 (spec_defines_file): Now const.
4782 (dir_prefix): New.
4783 (short_base_name): Remove.
4784 * src/files.c: Adjust.
4785 (dirname.h): Include.
4786 (base_name): Don't prototype it.
4787 (finput): Remove, duplicates gram_in.
4788 (full_base_name, short_base_name): Replace by...
4789 (all_but_ext, all_but_tab_ext): these.
4790 (compute_base_names): Rename as...
4791 (compute_file_name_parts): this.
4792 Update to compute the new variables, including dir_prefix.
4793 Adjust dependencies.
4794 * src/output.c (prepare): Output them.
4795 * src/reader.c: Adjust to use gram_in, not finput.
4796 * src/scan-skel.l (@dir_prefix@): New.
4797
4798 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4799
4800 * lib/subpipe.c: New function end_of_output_subpipe() added
4801 to allow support for non-posix systems. This is a no-op function
4802 for posix systems.
4803
4804 * lib/subpipe.h: New function end_of_output_subpipe() added
4805 to allow support for non-posix systems. This is a no-op function
4806 for posix systems.
4807
4808 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
4809 handle the lack of pipe/fork functionality on non-posix systems.
4810
4811 * djgpp/Makefile.maint: DJGPP specific file.
4812
4813 * djgpp/README.in: DJGPP specific file.
4814
4815 * djgpp/config.bat: DJGPP specific configuration file.
4816
4817 * djgpp/config.sed: DJGPP specific configuration file.
4818
4819 * djgpp/config.site: DJGPP specific configuration file.
4820
4821 * djgpp/config_h.sed: DJGPP specific configuration file.
4822
4823 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
4824
4825 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
4826
4827 2005-10-02 Akim Demaille <akim@epita.fr>
4828
4829 * data/location.cc: New, extract from...
4830 * data/lalr1.cc: here.
4831 (location.hh): Include it after the user prologue, in case the
4832 filename type is defined by the user.
4833 Forward declation location and position before the pre-prologue.
4834 (yyresult_): Rename as...
4835 (yyresult): this, it's a local variable, not an attribute.
4836 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
4837
4838 2005-10-01 Akim Demaille <akim@epita.fr>
4839
4840 * examples/extexi: Restore the #line generation.
4841
4842 2005-09-30 Akim Demaille <akim@epita.fr>,
4843 Alexandre Duret-Lutz <adl@gnu.org>
4844
4845 Move the token type and YYSTYPE in the parser class.
4846 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
4847 (parser::token): New, from the moved free definition of tokens.
4848 (parser::semantic_value): Now a full definition instead of an
4849 indirection to YYSTYPE.
4850 (b4_post_prologue): No longer included in the header file, but
4851 in the implementation file.
4852 * doc/bison.texi (C+ Language Interface): Update.
4853 * src/parse-gram.y: Support unary %define.
4854 * tests/actions.at: Define global_tokens_and_yystype for backward
4855 compatibility until we update the tests.
4856 * tests/calc.at: Idem.
4857 (first_line, first_column, last_line, last_column): Define for lalr1.cc
4858 to simplify the code.
4859
4860 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
4861
4862 Port to SunOS 4.1.4, which lacks strtoul and strerror.
4863 Ah, the good old days! Problem reported by Peter Klein.
4864 * bootstrap (gnulib_modules): Add strerror, strtoul.
4865 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
4866 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
4867
4868 2005-09-29 Akim Demaille <akim@epita.fr>
4869
4870 * data/c.m4 (b4_error_verbose_if): New.
4871 * data/lalr1.cc: Use it.
4872 (YYERROR_VERBOSE_IF): Remove.
4873 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
4874 parser members, replaced by...
4875 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
4876 local variables.
4877 (yysyntax_error_): Takes the state number as argument.
4878 (yyreduce_print_): Use the argument yyrule, not the former
4879 attribute yyn_.
4880
4881 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
4882
4883 * bootstrap (gnulib_modules): Add verify.
4884 * lib/.cvsignore: Add verify.h.
4885 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
4886 * src/system.h (verify): Remove.
4887 Include verify.h instead.
4888 * src/tables.c (tables_generate): Use new API for 'verify'.
4889
4890 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
4891
4892 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
4893 local variables whose names begin with 'yy'.
4894 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4895 Trivial changes from Joel E. Denny.
4896
4897 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
4898 it itself.
4899 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
4900 don't use alloca any more.
4901
4902 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
4903 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
4904 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
4905 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
4906 to match yacc.c, to test more hosts.
4907
4908 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
4909
4910 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
4911 doesn't affect behavior.
4912 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
4913 Solaris, AIX, MSC.
4914 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
4915 This works a bit better with glibc, if user code has already included
4916 stdlib.h.
4917 * doc/bison.texinfo (Bison Parser): Document that users can't
4918 arbitrarily use malloc and free for other purposes. Document
4919 that <alloca.h> and <malloc.h> might be included.
4920 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
4921 user must declare alloca.
4922
4923 * HACKING (release): Forwarn the Translation Project about
4924 stable releses.
4925
4926 2005-09-20 Akim Demaille <akim@epita.fr>
4927
4928 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
4929
4930 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
4931
4932 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
4933 (YYSTACK_ALLOC_MAXIMUM): Use it.
4934 (yysyntax_error): New function.
4935 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
4936 multiple syntax errors are reported, and alloca is being used.
4937 Instead, reallocate buffers twice as big each time, so that
4938 we waste at most half the allocated memory. Start with a small
4939 (128-byte) buffer that will suffice in most cases anyway.
4940 Use yysyntax_error to do most of the work.
4941
4942 * doc/bison.texinfo (Error Reporting, Table of Symbols):
4943 yynerrs is the number of errors reported, not the number of
4944 errors encountered.
4945
4946 * tests/glr-regression.at (Duplicated user destructor for lookahead):
4947 Mark it as expected to fail.
4948 Cast result of malloc; problem reported by twlevo@xs4all.nl.
4949 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
4950 Don't start user-code symbols with "yy", to avoid name space problems.
4951
4952 2005-09-19 Akim Demaille <akim@epita.fr>
4953
4954 Remove the traits, failed experiment.
4955 It never proved useful, and anyway because of the current
4956 definition, it was not possible to have several specialization of
4957 this traits, making it useless.
4958 * data/lalr1.cc (yy:traits): Remove.
4959 Inline its definitions in the parser class.
4960
4961 2005-09-19 Akim Demaille <akim@epita.fr>
4962
4963 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
4964 least Mac OSX with a /usr/local install of gettext.
4965
4966 2005-09-19 Akim Demaille <akim@epita.fr>
4967
4968 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
4969 and yytoken for similarity with the other skeletons.
4970
4971 2005-09-19 Akim Demaille <akim@epita.fr>
4972
4973 * NEWS, configure.ac: update version number to 2.1a.
4974
4975 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
4976
4977 * NEWS: Version 2.1.
4978
4979 * NEWS: Remove notice of yytname change, since it was never in an
4980 official release.
4981 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
4982 diagnostic.
4983 * src/output.c (prepare): Likewise.
4984 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
4985 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
4986 is not defined. This is an awful hack, but it's enough for now.
4987 All callers changed.
4988 * tests/glr-regression-at (make_value): Args are const pointers now,
4989 to avoid GCC warning.
4990 (Duplicated user destructor for lookahead): New test. Currently
4991 skipped. It fails on my host but I'm not sure it'll always fail.
4992
4993 2005-09-16 Akim Demaille <akim@epita.fr>
4994
4995 * src/symtab.h (struct symbol): Declare the printer and destructor
4996 as const, to avoid accidental calls to free.
4997 (symbol_destructor_set, symbol_printer_set): Adjust.
4998 * src/symtab.c: Adjust.
4999
5000 2005-09-16 Akim Demaille <akim@epita.fr>
5001
5002 * data/c.m4 (b4_token_enums): New.
5003 (b4_token_defines): Rename as...
5004 (b4_token_enums_defines): this.
5005 (b4_token_defines): New, output only the #defines.
5006 * data/yacc.c, data/glr.c: Adjust.
5007 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
5008 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
5009 as default values.
5010
5011 2005-09-16 Akim Demaille <akim@epita.fr>
5012
5013 * data/lalr1.cc (yylex_): Remove, inline its code.
5014 (yyreport_syntax_error_): Remove, replaced by...
5015 (yysyntax_error_): this which returns a string and leaves to the
5016 caller the call to the users' error function.
5017 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
5018 Move from members of the parser object...
5019 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
5020 to local variables of the parse function.
5021
5022 2005-09-16 Akim Demaille <akim@epita.fr>
5023
5024 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
5025 since it's in Bison's name space.
5026
5027 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
5028
5029 * data/glr.c (yyresolveValue): Add default case to pacify
5030 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
5031
5032 * NEWS: Document when yyparse started to return 2.
5033 * doc/bison.texinfo (Parser Function): Document when yyparse
5034 returns 2.
5035
5036 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
5037 (b4_filename_type): Renamed back from b4_file_name_type. All uses
5038 changed.
5039 (class position): file_name -> filename (reverting). All uses changed.
5040
5041 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
5042
5043 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
5044 do anything if $@ exists. This reverts part of the 2005-07-07
5045 patch.
5046
5047 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
5048
5049 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
5050 contains obsolete information and isn't worth distributing as a
5051 separate file anyway.
5052 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
5053 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
5054 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
5055 (yyparse): Abort if user code uses longjmp to throw an unexpected
5056 value.
5057
5058 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
5059
5060 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
5061 Suggested by twlevo@xs4all.nl.
5062
5063 * data/glr.c (YYCHK1): Do not assume YYE is in range.
5064 This avoids a diagnostic from gcc -Wswitch-enum.
5065 Problem reported by twlevo@xs4all.nl.
5066
5067 * doc/bison.texinfo: Don't use "filename", as per GNU coding
5068 standards. Use "file name" or "file" or "name", depending on
5069 the context.
5070 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
5071 not to hack/foo.tab.c.
5072 (Calc++ Top Level): 2nd arg of main is not const.
5073 * data/glr.c: b4_filename -> b4_file_name.
5074 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
5075 All uses changed.
5076 (class position): filename -> file_name. All uses changed.
5077 * data/yacc.c: b4_filename -> b4_file_name.
5078 * lib/bitset.h: filename -> file_name in local vars.
5079 * lib/bitset_stats.c: Likewise.
5080 * src/files.c: Likewise.
5081 * src/scan-skel.l ("@output ".*\n): Likewise.
5082 * src/files.c (file_name_split): Renamed from filename_split.
5083 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
5084
5085 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
5086
5087 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
5088 to accommodate latest gnulib.
5089
5090 * tests/glr-regression.at (Duplicate representation of merged trees):
5091 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
5092
5093 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
5094 needed.
5095
5096 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
5097
5098 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
5099 All uses changed. Invoke user destructor after an error during a
5100 split parse (trivial change from Joel E. Denny).
5101
5102 * tests/glr-regression.at
5103 (User destructor after an error during a split parse): New test case.
5104 Problem reported by Joel E. Denny in:
5105 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
5106
5107 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
5108
5109 * README-cvs: Give URLs for recommended tools.
5110 Mention Gzip version problem, and bootstrapping issues.
5111 Remove troubleshooting section, as it's somewhat obsolete.
5112
5113 * bootstrap (no_cache): New var, to accommodate different wget
5114 variants. Use it instead of '-C off'. Problem reported by
5115 twlevo@xs4all.nl.
5116
5117 * data/glr.c (yydestroyStackItem): New function.
5118 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
5119 debugging information. Problem reported by Joel E. Denny.
5120
5121 2005-08-25 Akim Demaille <akim@epita.fr>
5122
5123 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
5124
5125 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
5126
5127 * data/glr.c (yyrecoverSyntaxError, yyreturn):
5128 Don't invoke destructor on unresolved entries.
5129 * tests/glr-regression.at
5130 (User destructor for unresolved GLR semantic value): New test case.
5131 Problem reported by Joel E. Denny in:
5132 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
5133
5134 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
5135
5136 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
5137 Add strnlen.c.
5138 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
5139 lib-prefix.m4, po.m4.
5140
5141 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
5142 in yydestruct diagnostic, since it might not be an error.
5143 Problem reported by Joel Denny near end of
5144 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5145 * data/lalr1.cc (yyerturn): Likewise.
5146 * data/yacc.c (yyreturn): Likewise.
5147 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
5148
5149 * src/files.c: Remove obsolete FIXME comment.
5150
5151 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
5152 with the other templates, and to fix bogus run-on messages such
5153 as the one reported at the end of
5154 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5155 All callers changed to avoid the newline.
5156 (yyprocessOneStack): Output two lines rather than one, to accommodate
5157 the above change. This changes the debug output format slightly.
5158
5159 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
5160 reported by Joel E. Denny in
5161 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
5162 (trivial change).
5163 * tests/glr-regression.at (Duplicate representation of merged trees):
5164 New test, from Joel E. Denny in:
5165 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
5166 * THANKS: Add Joel E. Denny.
5167
5168 * configure.ac (AC_INIT): Bump to 2.0c.
5169
5170 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
5171
5172 * NEWS: Version 2.0b.
5173
5174 * Makefile.am (SUBDIRS): Put examples before tests, so that
5175 "make check" doesn't finish with "All 1 tests passed".
5176
5177 * tests/regression.at (Token definitions): Don't rely on
5178 AT_PARSER_CHECK for data that contains backslashes. It currently
5179 uses 'echo', and 'echo' isn't portable if its argument contains
5180 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
5181 that the byte '\0xff' is not printable in the C locale; it is,
5182 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
5183 not printable, so use '\0x81' to test.
5184
5185 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
5186 version of GCC, since the macro is used with non-GCC compilers.
5187
5188 Fix core dump reported by Pablo De Napoli in
5189 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
5190 * tests/regression.at (Invalid inputs with {}): New test.
5191 * src/parse-gram.y (token_name): Translate type before using
5192 it as an index.
5193
5194 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
5195 the user's name space. All uses changed to __attribute__
5196 ((__unused__)).
5197 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
5198 Add __attribute__ ((__noreturn__)).
5199
5200 * etc/clcommit: Remove. We weren't using it, and it failed
5201 "make maintainer-distcheck".
5202 * Makefile.maint: Merge from coreutils.
5203 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
5204 (syntax-check-rules): Change list of rules as described below.
5205 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
5206 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
5207 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
5208 (sc_trailing_space): New rules.
5209 (sc_xalloc_h_in_src): Remove.
5210 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
5211 (sc_space_tab, sc_error_exit_success, sc_changelog):
5212 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
5213 (makefile-check, po-check, author_mark_check):
5214 (makefile_path_separator_check, copyright-check):
5215 Use grep -n, to make it easier to find violations.
5216 Use CVS_LIST and CVS_LIST_EXCEPT.
5217 (header_regexp, h_re): Remove.
5218 (dd_c): New macro.
5219 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
5220 (my-distcheck): Use more-modern GCC flags.
5221 (signatures, %.asc): Remove.
5222 (rel-files, announcement): Remove signatures.
5223 Restore old updating code, even though we don't use it, so
5224 that we're the same as coreutils.
5225 (alpha, beta, major): Depend on news-date-check.
5226 Make the upload commands.
5227
5228 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
5229 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
5230 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
5231 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
5232 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
5233 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
5234 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
5235 * tests/sets.at: Likewise.
5236
5237 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
5238 we comment out the Autoconf version number.
5239 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
5240 it's error-prone and "make maintainer-distcheck" rejects it.
5241
5242 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
5243 Indent calls to "error" to pacify "make maintainer-distcheck",
5244 when the calls are not intended to be translated.
5245 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
5246
5247 * src/Makefile.am (DEFS): Use +=, to pacify
5248 "make maintainer-distcheck".
5249 (bison_SOURCES): Add scan-skel.h.
5250 (sc_tight_scope): New rule, from coreutils.
5251
5252 * src/files.c (src_extension, header_extension):
5253 Now static, not extern.
5254 * src/getargs.c (short_options): Likewise.
5255 * src/muscle_tab.c (muscle_table): Likewise.
5256 * src/parse-gram.y (current_class, current_type, current_prec):
5257 Likewise.
5258 * src/reader.c (grammar_end, previous_rule_end): Likewise.
5259 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
5260 * src/main.c (main): Cast bindtextdomain and textdomain calls to
5261 void, to avoid warning when NLS is disabled.
5262 * src/output.c: Include scan-skel.h.
5263 (scan_skel): Remove decl, since scan-skel.h does this.
5264 (output_skeleton):
5265 Indent calls to "error" to pacify "make maintainer-distcheck".
5266 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
5267 * src/reader.h (gram_end, gram_lineno): New decls to pacify
5268 "make maintainer-distcheck".
5269 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
5270 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
5271 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
5272 (skel_lex_destroy, scan_skel): Move these decls to...
5273 * src/scan-skel.h: New file.
5274 * src/uniqstr.c (uniqstr_assert):
5275 Indent calls to "error" to pacify "make maintainer-distcheck".
5276
5277 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
5278 not @VAR@.
5279
5280 * tests/torture.at: Revamp to avoid misuse of atoi that
5281 "make maintainer-distcheck" complained about.
5282
5283 * examples/extexi (message): Don't print a message more than once,
5284 and omit line-number decoration that makes Emacs compile think
5285 that informative messages are worth worrying about.
5286
5287 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
5288
5289 * configure.ac: Update version number.
5290
5291 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
5292 accidentally.
5293 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
5294 autogenerated by the maintainer.
5295 * examples/calc++/.cvsignore: Add *.yy.
5296
5297 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
5298 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5299 * lib/bitsetv.c (bitsetv_alloc): Likewise.
5300
5301 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
5302
5303 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
5304 from maintainer-distcheck about casting the argument of 'free'.
5305
5306 * NEWS: Mention recent yytname changes.
5307 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
5308
5309 * bootstrap: For translations that have not yet been upgraded to
5310 the new runtime-po domain, prime the pump by extracting the
5311 relevant strings from the obsolete translations. This code can be
5312 removed once the bison-runtime domain has been translated by each
5313 team.
5314
5315 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
5316 now that token names are already quoted.
5317
5318 Fix problem reported by Anthony Heading.
5319 * data/glr.c (YYTOKEN_TABLE): New macro.
5320 (yytname): Define if YYTOKEN_TABLE.
5321 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
5322 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
5323 (YYERROR_VERBOSE): Define the same way the other skeletons do.
5324 * src/output.c (prepare_symbols): Output token_table_flag.
5325
5326 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
5327
5328 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
5329 again if the first call fails.
5330
5331 * data/glr.c (yytnamerr): New function.
5332 (yyreportSyntaxError): Use it to dequote most string literals.
5333 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
5334 with other skeletons. All uses changed.
5335 (yytnameerr_): New function.
5336 (yyreport_syntax_error): Use it to dequote most string literals.
5337 * data/yacc.c (yytnamerr): New function.
5338 (yyerrlab): Use it to decode most string literals.
5339 * doc/bison.texinfo (Decl Summary, Calling Convention):
5340 Clarify quoting convention of yytname.
5341 * src/output.c (prepare_symbols): Quote all names. This undoes
5342 the 2005-04-17 change, which is now accomplished (mostly) via
5343 changes in the parsers as described above.
5344 * tests/regression.at (Token definitions, Web2c Actions):
5345 Undo most 2005-04-17 change here, too.
5346
5347 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
5348
5349 Fix more problems reported by twlevo@xs4all.nl.
5350 * tests/cxx-type.at: Don't pipe output of ./types through sed to
5351 remove trailing spaces. This loses the exit status of ./types,
5352 and isn't needed since ./types shouldn't be emitting trailing
5353 spaces.
5354 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
5355 as the stack isn't valid in that case.
5356
5357 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5358 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5359 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5360 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
5361 is used.
5362 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
5363 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5364 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5365 Likewise.
5366
5367 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
5368 overly-picky compilers that reject 'char *foo = "bar";'.
5369
5370 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
5371 to FILE * parameter, not to stderr. This fixes a typo introduced
5372 in the 2005-07-12 change.
5373
5374 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
5375 warnings from GCC 4.
5376
5377 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
5378 (yyglrShiftDefer, yysplitStack):
5379 Remove unused parameters b4_pure_formals. All uses changed.
5380 (yyglrShift): Remove unused parameters b4_user_formals.
5381 All uses changed.
5382 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
5383
5384 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
5385
5386 Destructor cleanups and regularization among the three skeletons.
5387 * NEWS: Document the behavior changes.
5388 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
5389 stack before failing, as the cleanup code will do it for us now.
5390 * data/lalr1.cc (yyerrlab): Likewise.
5391 * data/glr.c (yyparse): Pop everything off the stack before
5392 freeing it, so that destructors get called properly.
5393 * data/lalr1.cc (yyreturn): Likewise.
5394 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
5395 This is more consistent.
5396 * doc/bison.texinfo (Destructor Decl): Mention more reasons
5397 why destructors might be called. 1.875 -> 2.1.
5398 (Destructor Decl, Decl Summary, Table of Symbols):
5399 Some English-language cleanups for %destructor.
5400 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5401 Add output line for destructor of start symbol.
5402 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
5403 because of that same extra output line.
5404
5405 * NEWS: Document minor wording changes in diagnostics of
5406 Bison-generated parsers.
5407 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
5408 Remove unused formals. All uses changed.
5409 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
5410 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
5411 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
5412 Rename yyoverflowab to yyexhaustedlab.
5413 When memory exhaustion occurs during syntax-error reporting,
5414 report it separately rather than in a single diagnostic; this
5415 eases translation.
5416 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
5417 (Memory Exhausted): Renamed from Parser Stack Overflow.
5418 Revamp wording slightly to prefer "memory exhaustion".
5419 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
5420
5421 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
5422
5423 Add i18n support to the GLR skeleton. Partially fix the C++
5424 skeleton; a C++ expert needs to finish this. Remove debugging
5425 msgids; there's little point to having them translated, since they
5426 can be understood only by someone who can read the
5427 (English-language) source code.
5428
5429 Generate runtime-po/bison-runtime.pot automatically, so that we
5430 don't have to worry about garbage getting in that file. We'll
5431 make sure after the next official release that old msgids don't
5432 get lost. See
5433 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
5434
5435 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
5436 Now auto-generated.
5437 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
5438 Fix typos in explanations of the runtime file.
5439 * bootstrap: Change gettext keyword from YYI18N to YY_.
5440 Use standard Makefile.in.in in runtime-po, since we'll arrange
5441 for backward-compatible bison-runtime.po files in a different way.
5442 * data/glr.c (YY_): New macro, from yacc.c.
5443 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
5444 Translate messages intended for users.
5445 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
5446 the wording in the other skeletons. We don't know that the memory
5447 is virtual.
5448 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
5449 Use same method that yacc.c uses.
5450 Don't translate debugging messages.
5451 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
5452 it doesn't work (yet), and requires C++ expertise to fix.
5453 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
5454 Move defn to a more logical place, to be consistent with other
5455 skeletons.
5456 Don't translate debugging messages.
5457 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
5458 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
5459 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
5460 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
5461
5462 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
5463 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
5464 void, not int.
5465 * tests/glr-regression.at (Badly Collapsed GLR States):
5466 Likewise.
5467 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5468 yylex should return 0 at EOF rather than aborting.
5469
5470 Improve tests for stack overflow in GLR parser.
5471 Problem reported by twlevo@xs4all.nl.
5472 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
5473 All uses removed.
5474 (yyStackOverflow): Just longjmp, but with value 2 so that caller
5475 can handle the problem.
5476 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
5477 (yyparse): New local variable yyresult to record the result.
5478 Use result of setjmp to set it, rather than storing itinto
5479 struct.
5480 (yyDone): Remove label.
5481 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
5482 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
5483 if YYABORT is used).
5484 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
5485 yyparse status; put status > 1 into diagnostic.
5486 Check that status==2 works.
5487 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
5488 Use exit status 3 for failure to open (which shouldn't happen).
5489
5490 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
5491
5492 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
5493 1 on syntax error; just let yyparse do its thing.
5494 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
5495 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
5496 (Exploding the Stack Size with Alloca):
5497 (Exploding the Stack Size with Malloc):
5498 Expect exit status 2, not 1, since the parser is supposed to blow
5499 its stack. Problem reported by twlevo@xs4all.nl.
5500
5501 * data/glr.c (yyparse): Don't assume that the initial calls
5502 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
5503 Print a stack-overflow message and fail instead.
5504 Initialize the line-number information before creating the stack,
5505 so that the stack-overflow message can report line zero safely.
5506
5507 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
5508
5509 Fix problems reported by twlevo@xs4all.nl.
5510 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
5511 (yyuserMerge): Provide a default case if b4_mergers is empty.
5512 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
5513 * tests/glr-regression.at
5514 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5515 Add casts to pacify C++ compilers.
5516 * tests/glr-regression.at (Improper merging of GLR delayed action
5517 sets): Declare yylex before using it.
5518 * tests/Makefile.am (maintainer-check-g++): Fix a stray
5519 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
5520 test for valgrind; valgrind is independent of g++.
5521 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
5522 for compatibility with POSIX 1003.1-2001 (if running coreutils).
5523 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
5524 Use a destructor, so that we can expand the stack. Change
5525 YYSTYPE to char * so that we can free it. Cast result of malloc.
5526
5527 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5528
5529 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
5530 a valgrind failure. Problem reported by twlevo@xs4all.nl.
5531
5532 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
5533
5534 * PACKAGING: New file, suggested by Bruno Haible and taken from
5535 similar wording in gettext's PACKAGING file.
5536 * NEWS: Mention PACKAGING.
5537 * Makefile.am (EXTRA_DIST): Add PACKAGING.
5538
5539 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
5540
5541 * NEWS: Document recent i18n improvements.
5542 * bootstrap: Get runtime translations into runtime-po.
5543 Create runtime-po files automatically, if possible.
5544 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
5545 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
5546 does not infringe on the user's name space.
5547 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
5548 * doc/bison.texinfo (Internationalization): Revamp the English
5549 and Texinfo syntax a bit, to try to make it clearer.
5550 (Bison Options, Option Cross Key): Mention --print-localedir.
5551 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
5552 YYENABLE_NLS. Quote a bit more.
5553 * runtime-po/.cvsignore: New file.
5554 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
5555 * runtime-po/Rules-quot: Remove; now created by bootstrap.
5556 * runtime-po/quot.sed: Likewise.
5557 * runtime-po/boldquot.sed: Likewise.
5558 * runtime-po/en@quot.header: Likewise.
5559 * runtime-po/en@boldquot.header: Likewise.
5560 * runtime-po/insert-header.sin: Likewise.
5561 * runtime-po/remove-potcdate.sin: Likewise.
5562 * runtime-po/Makevars: Likewise.
5563 * runtime-po/LINGUAS: Likewise.
5564 * runtime-po/de.po: Likewise; we will rely on the translation project
5565 to maintain this, so "bootstrap" should get it.
5566 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
5567 its value.
5568 * src/main.c (main): Bind the bison-runtime domain, too.
5569
5570 2005-07-12 Bruno Haible <bruno@clisp.org>
5571
5572 * data/yacc.c: Include <libintl.h> when NLS is enabled.
5573 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
5574 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
5575 * runtime-po: New directory.
5576 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
5577 $(DOMAIN).pot-update rule, so that old messages are never dropped.
5578 * runtime-po/Rules-quot: New file, copied from po/.
5579 * runtime-po/quot.sed: Likewise.
5580 * runtime-po/boldquot.sed: Likewise.
5581 * runtime-po/en@quot.header: Likewise.
5582 * runtime-po/en@boldquot.header: Likewise.
5583 * runtime-po/insert-header.sin: Likewise.
5584 * runtime-po/remove-potcdate.sin: Likewise.
5585 * runtime-po/Makevars: New file.
5586 * runtime-po/POTFILES.in: New file.
5587 * runtime-po/LINGUAS: New file.
5588 * runtime-po/bison-runtime.pot: New file.
5589 * runtime-po/de.po: New file.
5590 * m4/bison.m4: New file.
5591 * Makefile.am (SUBDIRS): Add runtime-po.
5592 (aclocaldir, aclocal_DATA): New variables.
5593 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
5594 Define aclocaldir.
5595 * src/getargs.c (usage): Document --print-localedir option.
5596 (PRINT_LOCALEDIR_OPTION): New enum item.
5597 (long_options): Add --print-localedir option.
5598 (getargs): Handle --print-localedir option.
5599 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
5600 (Internationalization): New section.
5601
5602 2005-07-12 Akim Demaille <akim@epita.fr>
5603
5604 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
5605 for consistency with the rest of the code.
5606 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
5607 Add separators.
5608
5609 2005-07-12 Akim Demaille <akim@epita.fr>
5610
5611 * src/parse-gram.y: Use %printer instead of YYPRINT.
5612
5613 2005-07-12 Akim Demaille <akim@epita.fr>
5614
5615 * src/symtab.h, src/symtab.c (symbol_print): New.
5616 * src/symlist.h, src/symlist.c (symbol_list_print): New.
5617 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
5618
5619 2005-07-12 Akim Demaille <akim@epita.fr>
5620
5621 * data/glr.c (b4_syncline): Fix (swap) the definitions of
5622 b4_at_dollar and b4_dollar_dollar.
5623
5624 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
5625
5626 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
5627 and Pennello's paper.
5628
5629 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
5630
5631 * data/yacc.c (yyparse): Undo previous patch. Instead,
5632 set yylsp[0] and yyvsp[0] only if the initial action
5633 sets yylloc and yylval, respectively.
5634
5635 * data/yacc.c (yyparse): In the initial action, set
5636 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
5637 This avoids the use of undefined variables if the initial
5638 action does not set yylloc and/or yylval.
5639
5640 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5641
5642 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
5643 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
5644 Remove from CVS. These files are automatically generated.
5645 * examples/extexi: Clarify that this file is now part of Bison,
5646 not GNU M4, and that it works with any POSIX-compatible Awk.
5647 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
5648 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
5649 so that we also get calc++-parser.yy. Geneate it.
5650 Use $(AWK), not gawk, since any conforming Awk will do.
5651 Put comment before action, since older 'make' can't handle comment
5652 in action.
5653 $(BUILT_SOURCES): List all built sources, not just some of them.
5654 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
5655 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
5656 $($(calc_sources_generated)): Remove unnecessary test for existence
5657 of target. (This had a shell syntax error anyway; a stray "x".)
5658 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
5659 calc++-parser.yy.
5660 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
5661
5662 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
5663 implied by the other modules.
5664
5665 2005-07-06 Akim Demaille <akim@epita.fr>
5666
5667 Bind examples/calc++ to the package.
5668 * examples/calc++/Makefile: Remove, replaced by...
5669 * examples/calc++/Makefile.am: ... this new file.
5670 * examples/calc++/test: Remove input.
5671 * examples/calc++/compile: Remove.
5672 * examples/Makefile.am: New.
5673 * configure.ac, Makefile.am: Adjust.
5674 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
5675
5676 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
5677
5678 * data/glr.c (yyFail): Drastically simplify; since the format argument
5679 never had any % directives, we can simply pass it to yyerror.
5680 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
5681 be modified later, as that is the usual style in glr.c.
5682 Problems reported by Paul Hilfinger.
5683
5684 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
5685 and size overflow errors.
5686 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
5687 in case the user prolog sets feature-test macros like _GNU_SOURCE.
5688 (YYSIZEMAX): New macro.
5689 (yystpcpy): New function, taken from yacc.c.
5690 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
5691 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
5692 so that we don't have to maintain their signatures.
5693 (yyFail): Check for buffer overflow, by using vsnprintf rather
5694 than vsprintf. Allocate a bigger buffer if possible.
5695 Report an error if buffer allocation fails.
5696 (yyStackOverflow): New function.
5697 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
5698 the initialization was successful. It might fail if storage was
5699 exhausted.
5700 (yyexpandGLRStack): Add more checks for storage allocation failure.
5701 Use yyStackOverflow to report failures.
5702 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
5703 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
5704 Don't assume stack number fits in int.
5705 (yysplitStack): Check for storage allocation failure.
5706 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
5707 can print diagnostics on storage allocation failure. All callers
5708 changed.
5709 (yyresolveValue): Use yybool for boolean.
5710 (yyreportSyntaxError): Check for size-calculation overflow.
5711 This code is taken from yacc.c.
5712 (yyparse): Check for storage allocation errors when allocating
5713 the initial stack.
5714
5715 2005-07-05 Akim Demaille <akim@epita.fr>
5716
5717 Extract calc++ from the documentation.
5718 * doc/bison.texinfo (Calc++): Add the extraction marks.
5719 * examples/extexi: New, from the aborted GNU Programming 2E.
5720 Separate the different paragraph of a file with empty lines.
5721 * examples/Makefile: Use it to extract the whole calc++ example.
5722
5723 2005-06-24 Akim Demaille <akim@epita.fr>
5724
5725 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
5726 class typedefs.
5727
5728 2005-06-22 Akim Demaille <akim@epita.fr>
5729
5730 * doc/bison.texinfo (C++ Language Interface): First stab.
5731 (C++ Parsers): Remove.
5732
5733 2005-06-22 Akim Demaille <akim@epita.fr>
5734
5735 * data/lalr1.cc (yylex_): Honor %lex-param.
5736
5737 2005-06-22 Akim Demaille <akim@epita.fr>
5738
5739 Start a set of simple examples.
5740 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
5741 * examples/calc++/calc++-driver.hh,
5742 * examples/calc++/calc++-parser.yy,
5743 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
5744 * examples/calc++/compile, examples/calc++/test: New.
5745
5746 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
5747
5748 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
5749 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
5750 which stems from the 2005-05-27 patch.
5751
5752 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5753
5754 * data/glr.c: Modify treatment of unused parameters to permit use
5755 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
5756
5757 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
5758
5759 Fix infringement on user name space reported by Janos Zoltan Szabo.
5760 * data/yacc.c (yyparse): strlen -> yystrlen.
5761
5762 2005-05-30 Akim Demaille <akim@epita.fr>
5763
5764 * data/lalr1.cc (_): New.
5765 Translate the various messages.
5766
5767 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
5768
5769 Fix infringement on user name space reported by Bruno Haible.
5770 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
5771 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
5772 the user's name space.
5773 (alloca): Include <stdlib.h> to get it, if it's not built in.
5774 (YYMALLOC, YYFREE): Define only if needed.
5775 (malloc, free): Declare, but only if needed, as this infringes on
5776 the user name space.
5777
5778 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
5779
5780 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
5781 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
5782 with %d format.
5783 * lib/ebitset.c (min, max): Undef before defining.
5784 * lib/vbitset.c (min, max): Likewise.
5785 * lib/subpipe.c (create_subpipe): Save local variables in case
5786 vfork clobbers them.
5787
5788 2005-05-24 Bruno Haible <bruno@clisp.org>
5789
5790 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
5791 error message syntax used by gcc-4.0.
5792
5793 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
5794
5795 * README: Mention m4 1.4.3. Remove obsolete advice about
5796 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
5797
5798 * bootstrap: Remove workaround for problem I encountered with
5799 gettext 0.14.1; it seems to be fixed now.
5800
5801 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
5802
5803 * NEWS: Version 2.0a.
5804
5805 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
5806 the previous change.
5807
5808 Various maintainer cleanups.
5809 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
5810 conftest*, for benefit of CVS commands run at the same time as
5811 "configure". Add build-aux, since "bootstrap" now creates it and
5812 its subfiles.
5813 * Makefile.cfg (move_if_change): Remove.
5814 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
5815 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
5816 (po_repo, do-po-update, po-update, wget_files, get-targets):
5817 (config.guess-url_prefix, config.sub-url_prefix):
5818 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
5819 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
5820 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
5821 Remove.
5822 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
5823 this is now the recommended name.
5824 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
5825 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
5826 ylwrap. These files now go into build-aux.
5827 * config/move-if-change: Remove.
5828 * config/prev-version.txt: Bump from 1.75 to 2.0.
5829
5830 * bootstrap: Add stdio-safer, unistd-safer modules.
5831 Remove m4/glibc2.m4 (introduced by latest gnulib, but
5832 we don't need it).
5833 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
5834 fopen-safer.c, stdio-safer.h, unistd-safer.h.
5835 * lib/subpipe.c: Include "unistd-safer.h".
5836 (create_subpipe): Make sure all the newly-created
5837 file descriptors are > 2, so that diagnostics don't
5838 get sent down them (which might cause Bison to hang, in theory).
5839 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
5840 * src/files.c (xfopen): Use fopen_safer, not fopen.
5841
5842 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
5843 yesterday's yacc.c fix.
5844
5845 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
5846
5847 * data/glr.c, data/lalr1.cc: Update copyright date.
5848
5849 Fix a destructor bug reported by Wolfgang Spraul in
5850 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
5851 * data/yacc.c (yyabortlab): Don't call destructor, and
5852 don't set yychar to EMPTY.
5853 (yyoverflowlab): Don't call destructor.
5854 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
5855 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
5856 since we no longer output the message "discarding lookahead token
5857 end of input ()".
5858
5859 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5860
5861 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
5862 fix a small glitch in debugging output.
5863 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
5864 after YY_SYMBOL_PRINT where needed.
5865
5866 (struct yyGLRState): Add some comments.
5867 (struct yySemanticOption): Add some comments.
5868 (union yyGLRStackItem): Add comment.
5869
5870 (yymergeOptionSets): Correct this to properly perform the union,
5871 avoiding infinite reported by Michael Rosien.
5872 Update comment.
5873
5874 * tests/glr-regression.at: Add test for GLR merging error reported
5875 by M. Rosien.
5876
5877 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
5878
5879 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
5880 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
5881 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
5882 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
5883 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
5884 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
5885 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
5886 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
5887 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
5888 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
5889 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
5890 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
5891 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
5892 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
5893 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
5894 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
5895 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
5896 src/derives.h, src/files.c, src/files.h, src/getargs.c,
5897 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
5898 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
5899 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
5900 src/output.h, src/parse-gram.c, src/parse-gram.h,
5901 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
5902 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
5903 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
5904 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
5905 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
5906 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
5907 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
5908 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
5909 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
5910 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
5911 tests/reduce.at, tests/regression.at, tests/sets.at,
5912 tests/synclines.at, tests/testsuite.at, tests/torture.at:
5913 Update FSF postal mail address.
5914
5915 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
5916
5917 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
5918 Problem reported by Ralf Menzel.
5919
5920 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
5921
5922 * tests/actions.at: Test that stack overflow invokes destructors.
5923 From Marcus Holland-Moritz.
5924 * data/yacc.c (yyerrlab): Move the code that destroys the stack
5925 from here....
5926 (yyreturn): to here. That way, destructors are called properly
5927 even if the stack overflows, or the user calls YYACCEPT or
5928 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
5929 (yyoverflowlab): Destroy the lookahead.
5930
5931 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
5932
5933 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
5934
5935 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
5936
5937 * NEWS: Bison-generated C parsers no longer quote literal strings
5938 associated with tokens.
5939 * src/output.c (prepare_symbols): Don't escape strings,
5940 since users don't want to see C escapes.
5941 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
5942 in diagnostics.
5943 * tests/input.at (Torturing the Scanner): Likewise.
5944 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
5945
5946 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
5947
5948 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
5949 the data size is known to be too small and we can't increase it.
5950 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
5951
5952 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
5953
5954 * src/parse-gram.y: Include quotearg.h.
5955 (string_as_id): Quote $1 before using it as a key, since the
5956 lexer no longer quotes it for us.
5957 (string_content): Don't strip quotes, since lexer no longer
5958 quotes it for us.
5959 * src/scan-gram.l: Include quotearg.h.
5960 ("\""): Omit quote.
5961 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
5962 a key, since the rest of the lexer doesn't quote it.
5963 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
5964 * tests/regression.at (Token definitions): Check for backslashes
5965 in token strings.
5966
5967 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
5968 (YYSIZE_T): Define to unsigned long int when using an older compiler.
5969 (yyparse): Revamp code to generate long syntax error message, to
5970 make it easier to translate, and to avoid problems with arithmetic
5971 overflow. Change "virtual memory" to "memory" in diagnostic, since
5972 we don't know whether the memory is virtual.
5973
5974 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
5975
5976 * NEWS: Bison-generated C parsers now use the _ macro to
5977 translate strings.
5978 * data/yacc.c (_) [!defined _]: New macro.
5979 All English strings wrapped inside this macro.
5980 * doc/bison.texinfo (Bison Parser): Document _.
5981 * po/POTFILES.in: Include src/parse-gram.c, since it now
5982 includes translateable strings that parse-gram.y doesn't.
5983
5984 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
5985
5986 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
5987 reverting the 2004-10-11 change to this function.
5988 (symbol_check_alias_consistency): Don't call symbol_type_set
5989 if the type name is already correct.
5990 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
5991
5992 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
5993
5994 * tests/regression.at (Token definitions): Don't use a token named
5995 c, as that generates a "#define c ..." that runs afoul of buggy
5996 stdlib.h that uses the identifier c as a member of struct
5997 drand48_data. Problem reported by Horst Wente.
5998
5999 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
6000
6001 * bootstrap: Change translation URL from
6002 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
6003 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
6004 redirection glitches. Problem reported by twlevo@xs4all.nl.
6005
6006 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
6007
6008 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
6009 after operands; POSIX says this isn't portable for the c99 command.
6010
6011 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
6012
6013 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
6014 immediately if a data overrun has occurred; this may help us track
6015 down what may be a spurious failure on MacOS.
6016
6017 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
6018
6019 Respond to problems reported by twlevo@xs4all.nl.
6020
6021 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
6022
6023 * src/vcg.h: Comment fix.
6024 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
6025 (G_CMAX): Change to -1 instead of INT_MAX.
6026
6027 * data/yacc.c (yyparse): Omit spaces before #line.
6028
6029 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
6030
6031 * src/tables.c (state_number_to_vector_number): Put it inside an
6032 "#if 0", since it's not currently used. Problem reported by
6033 Roland McGrath.
6034
6035 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
6036
6037 * src/output.c (escaped_output): Renamed from
6038 escaped_file_name_output, since we now use it for symbol tags as
6039 well. All uses changed.
6040 (symbol_destructors_output, symbol_printers_output):
6041 Escape symbol tags too.
6042 Problem reported by Matyas Forstner in
6043 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
6044
6045 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
6046 not needed.
6047 * src/output.c (user_actions_output, token_definitions_output,
6048 symbol_destructors_output, symbol_printers_output): Likewise.
6049 * src/reader.c (prologue_augment): Likewise.
6050 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
6051
6052 * src/vcg.c (output_edge): Don't quote linestyle arg.
6053 Problem reported by twlevo@xs4all.nl.
6054
6055 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
6056
6057 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
6058 example, reported by Derek M Jones. Also, make the example even
6059 more outrageous, to better illustrate how bad the problem is.
6060
6061 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
6062
6063 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
6064 putsym. Typo reported by Sebastian Piping.
6065
6066 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
6067
6068 * doc/bison.texinfo (Language and Grammar): some -> same
6069 (Epilogue): int he -> in the
6070 Typos reported by Sebastian Piping via Justin Pence.
6071
6072 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
6073
6074 * tests/glr-regression.at (Improper handling of embedded actions
6075 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
6076 embedded actions and $-N in GLR parsers", work around an Autoconf bug
6077 with dollar signs in test names.
6078 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
6079 for a similar reason.
6080
6081 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
6082
6083 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
6084 wants to redefine G_VIEW.
6085
6086 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
6087
6088 * src/vcg.c (get_view_str): Remove case for normal_view.
6089 Problem reported by twlevo@xs4all.nl.
6090
6091 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
6092
6093 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
6094 Problem reported by twlevo@xs4all.nl.
6095
6096 * doc/bison.texinfo: Change @dircategory from "GNU programming
6097 tools" to "Software development". Requested by Richard Stallman
6098 via Karl Berry.
6099
6100 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
6101
6102 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
6103 Problem reported by twlevo@xs4all.nl.
6104
6105 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
6106
6107 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
6108 keyword; it's not needed with modern compilers, and it doesn't
6109 affect correctness with older compilers. Suggested by
6110 twlevo@xs4all.nl.
6111
6112 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
6113
6114 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
6115 gcc -Wswitch-default.
6116 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6117 * data/yacc.c (yyparse): Likewise.
6118
6119 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
6120
6121 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
6122 already. Let config.h define any nonstandard values.
6123
6124 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
6125
6126 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
6127 for the benefit of slower hosts. Problem reported by
6128 Nelson H. F. Beebe.
6129
6130 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
6131
6132 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
6133 being defined and not used.
6134 * data/lalr1.cc (yyparse): Likewise.
6135 Use "if (false)" rather than "if (0)".
6136
6137 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
6138
6139 * TODO: Mention that we should allow NUL bytes in tokens.
6140
6141 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
6142
6143 * src/scan-skel.l (<<EOF>>): Don't close standard output.
6144 Problem reported by Hans Aberg.
6145
6146 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
6147
6148 * src/getargs.c (version): Happy new year; update overall
6149 program copyright date from 2004 to 2005.
6150
6151 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
6152 Problem reported by Hans Aberg.
6153 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
6154 (Output file names.): Add a test for the case when standard output
6155 is closed.
6156
6157 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
6158
6159 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
6160 to fix an oversight in the Bison 2.0 manual.
6161
6162 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
6163
6164 * NEWS: Version 2.0. Reformat the existing news items since
6165 1.875, so that related items are grouped together.
6166 * configure.ac (AC_INIT): Bump version to 2.0.
6167 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
6168
6169 * tests/torture.at (Exploding the Stack Size with Alloca): Set
6170 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
6171 otherwise, we're not testing alloca. Unfortunately there's no
6172 simple way to consult HAVE_ALLOCA here.
6173
6174 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
6175 for yymsg, too.
6176
6177 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
6178 hand. This avoids a warning about comparing int to size_t when
6179 GCC warnings are enabled.
6180
6181 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
6182
6183 * NEWS: Bison-generated parsers no longer default to using the
6184 alloca function (when available) to extend the parser stack, due
6185 to widespread problems in unchecked stack-overflow detection.
6186 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
6187 responsibility to set it to a positive value. This lets the user
6188 specify a value that is not a preprocessor constant.
6189 * data/yacc.c (YYMAXDEPTH): Likewise.
6190 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
6191 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
6192 to be a compile-time constant. However, explain the constraints on it.
6193 Also, explain the constraints on YYINITDEPTH.
6194 (Table of Symbols): Explain that alloca is no longer the default.
6195 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
6196 to 1.
6197
6198 * doc/bison.texinfo (Location Default Action): Mention that n must
6199 be zero when k is zero. Suggested by Frank Heckenbach.
6200
6201 2004-12-22 Akim Demaille <akim@epita.fr>
6202
6203 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
6204 (parser::state_type, parser::semantic_type, parser::location_type):
6205 Private, not public.
6206 (parser::parse): Return ints, not bool.
6207 Returning a bool introduces a problem: 0 corresponds to false, and
6208 it seems weird to return false on success. Returning true changes
6209 the conventions for yyparse.
6210 Alternatively we could return void and send an exception.
6211 There is no clear consensus (yet?).
6212 (state_stack, semantic_stack, location_stack): Rename as...
6213 (state_stack_type, semantic_stack_type, location_stack_type): these.
6214 Private, not public.
6215 * tests/c++.at: New.
6216 * tests/testsuite.at, tests/Makefile.am: Adjust.
6217
6218 2004-12-21 Akim Demaille <akim@epita.fr>
6219
6220 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
6221
6222 2004-12-21 Akim Demaille <akim@epita.fr>
6223
6224 Don't impose std::string for filenames.
6225
6226 * data/lalr1.cc (b4_filename_type): New.
6227 (position::filename): Use it.
6228 (parser.hh): Move the inclusion of stack.hh and location.hh below
6229 the user code, so that needed headers for the filename type can be
6230 included first.
6231 Forward declare them before the user code.
6232 * tests/Makefile.am (check-local, installcheck-local): Pass
6233 TESTSUITEFLAGS to the TESTSUITE.
6234
6235 2004-12-20 Akim Demaille <akim@epita.fr>
6236
6237 Use more STL like names: my_class instead of MyClass.
6238
6239 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
6240 (SemanticStack, SemanticType, StateStack, StateType)
6241 (TokenNumberType, Stack, Slice, Traits, Parser::location)
6242 (Parser::value): Rename as...
6243 (location_stack, location_type, rhs_number_type, semantic_stack)
6244 (semantic_type, state_stack, state_type, token_number_type, stack)
6245 (slice, traits, parser::yylloc, parser::yylval): these.
6246
6247 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
6248
6249 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
6250
6251 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
6252 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6253
6254 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
6255
6256 Remove uses of 'short int' and 'unsigned short int'. This raises
6257 some arbitrary limits. It uses more memory but nowadays that's
6258 not much of an issue.
6259
6260 This change does not affect the generated parsers; that's a different
6261 task, as some users will want to conserve memory there.
6262
6263 Ideally we should use size_t to represent all object counts, and
6264 something like ptrdiff_t to represent signed differences of object
6265 counts; but that will require more code-cleanup than I have the
6266 time to do right now.
6267
6268 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
6269 Use size_t, not int or short int, to count objects.
6270 * src/closure.c (nritemset, closure): Likewise.
6271 * src/closure.h (nritemset, closure): Likewise.
6272 * src/nullable.c (nullable_compute): Likewise.
6273 * src/print.c (print_core): Likewise.
6274 * src/print_graph.c (print_core): Likewise.
6275 * src/state.c (state_compare, state_hash): Likewise.
6276 * src/state.h (struct state): Likewise.
6277 * src/tables.c (default_goto, goto_actions): Likewise.
6278
6279 * src/gram.h (rule_number, rule): Use int, not short int.
6280 * src/output.c (prepare_rules): Likewise.
6281 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
6282 errs, reductions): Likewise.
6283 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
6284 Likewise.
6285 * src/tables.c (vector_number, tally, action_number,
6286 ACTION_NUMBER_MINIMUM): Likewise.
6287 * src/output.c (muscle_insert_short_int_table): Remove.
6288
6289 2004-12-17 Akim Demaille <akim@epita.fr>
6290
6291 * data/lalr1.cc: Extensive Doxygenation.
6292 (error_): Rename as...
6293 (error): this, since it is visible to the user.
6294 Adjust callers.
6295 (Parser::message): Now an automatic variable from...
6296 (Parser::yyreport_syntax_error_): here.
6297 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
6298 Parser::error.
6299 * tests/input.at: Escape $.
6300
6301 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
6302
6303 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
6304 Parenthesize rhs to avoid obscure problems with mistakes like
6305 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
6306 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6307 b4_rhs_location): Likewise.
6308 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6309 b4_rhs_location): Likewise.
6310
6311 2004-12-16 Akim Demaille <akim@epita.fr>
6312
6313 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
6314 yacc.c: be sure to stay within yycheck_.
6315 * tests/actions.at: Re-enable C++ tests.
6316
6317 2004-12-16 Akim Demaille <akim@epita.fr>
6318
6319 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
6320 real.
6321
6322 2004-12-16 Akim Demaille <akim@epita.fr>
6323
6324 Use #define to handle the %name-prefix.
6325
6326 * data/glr.c, data/yacc.c: Comment changes.
6327 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
6328 so that one can refer to yylex in the parser file, and have it
6329 renamed, as is the case with other skeletons.
6330
6331 2004-12-16 Akim Demaille <akim@epita.fr>
6332
6333 Move lalr1.cc internals into yy*.
6334
6335 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
6336 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
6337 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
6338 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
6339 (empty_, final_, terror_, errcode_, ntokens_)
6340 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
6341 (looka_, ilooka_, error_range_, nerrs_):
6342 Rename as...
6343 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
6344 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
6345 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
6346 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
6347 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
6348 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
6349 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
6350 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
6351 these.
6352
6353 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
6354
6355 Fix some problems reported by twlevo at xs4all.
6356 * src/symtab.c (symbol_new): Report an error if the input grammar
6357 contains too many symbols. This is better than calling abort() later.
6358 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
6359 (struct node, struct graph):
6360 Rename member expand to stretch. All uses changed.
6361 (struct graph): Remove member layoutalgorithm. All uses removed.
6362 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
6363 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
6364 All uses changed.
6365 (N_STRETCH): Rename from N_EXPAND. All uses changed.
6366
6367 2004-12-15 Akim Demaille <akim@epita.fr>
6368
6369 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
6370 Add more Doxygen comments.
6371 (symprint_, stack_print_, reduce_print_, destruct_, pop)
6372 (report_syntax_error_, translate_): Rename as...
6373 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
6374 (yypop_, yyreport_syntax_error_, yytranslate_): this.
6375
6376 2004-12-15 Akim Demaille <akim@epita.fr>
6377
6378 * data/lalr1.cc (lex_): Rename as...
6379 (yylex_): this.
6380 Move the trace here.
6381 Take the %name-prefix into account.
6382 Reported by Alexandre Duret-Lutz.
6383
6384 2004-12-15 Akim Demaille <akim@epita.fr>
6385
6386 Simplify the C++ parser constructor.
6387
6388 * data/lalr1.cc (debug_): Rename as...
6389 (yydebug_): so that the parser's internals are always in the yy*
6390 pseudo namespace.
6391 Adjust uses.
6392 (b4_parse_param_decl): Remove the leading comma as it is now only
6393 called as unique argument list.
6394 (Parser::Parser): Remove the constructor accepting a location and
6395 an initial debugging level.
6396 Remove from the other ctor the argument for the debugging level.
6397 (debug_level_type, debug_level, set_debug_level): New.
6398
6399 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
6400 constructor calls.
6401
6402 2004-12-15 Akim Demaille <akim@epita.fr>
6403
6404 Remove b4_root related material: failure experiment
6405 (which goal was to allow to derive from a class).
6406
6407 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
6408 definitions and uses.
6409
6410 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
6411
6412 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
6413 not 2, since it's not portable to subtract 1 from the start of an
6414 array. The new item 0 is never set or used. All uses changed.
6415
6416 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
6417 the default definition of YYLLOC_DEFAULT. Problem reported
6418 by Frank Heckenbach.
6419
6420 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
6421
6422 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
6423 the normal case and one for the error case. Just use the
6424 first one uniformly. Problem reported by Frank Heckenbach.
6425 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
6426 use exactly the same macro in both places.
6427 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
6428 so that the normal-case YYRHSLOC works for the error case too.
6429 All uses changed.
6430 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
6431 (YYLLOC_DEFAULT): Use the same macro as glr.c.
6432 * doc/bison.texinfo (Location Default Action): Don't claim that
6433 we have an array of locations. Use the same macro for both glr
6434 and lalr parsers. Mention YYRHSLOC. Mention what happens when
6435 the index is 0.
6436
6437 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
6438
6439 * HACKING: Update email addresses to send announcements to.
6440
6441 * configure.ac (AC_INIT): Bump version to 1.875f.
6442
6443 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
6444
6445 * NEWS: Version 1.875e.
6446 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
6447
6448 * src/scan-skel.l: Include "complain.h", for "fatal".
6449
6450 * src/relation.h (relation_print, relation_digraph):
6451 Relation sizes are of type relation_node, not size_t (this is
6452 merely a doc fix, since the two types are equivalent).
6453 (relation_transpose): Relation sizes are of type relation_node,
6454 not int.
6455 * src/relation.c: Likewise.
6456 (top, infinity): Now of type relation_node, not int.
6457 (traverse, relation_transpose): Use relation_node, not int.
6458
6459 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
6460 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
6461 (yyparse): Remove unused local introduced in 2004-10-25 patch.
6462
6463 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
6464 specifying whether the test should be skipped. Use it tp
6465 specify that the [%defines %skeleton "lalr1.cc"] tests currently
6466 fail on some hosts, and should be skipped.
6467
6468 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
6469
6470 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
6471 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
6472 unless otherwise specified below.
6473
6474 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
6475 to allocate kernel_base, kernel_items, kernel_size, since
6476 they needn't be initialized to 0.
6477 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
6478 * src/closure.c (new_closure): Likewise, for itemset.
6479 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
6480 * src/lalr.c (set_goto_map): Likewise, for temp_map.
6481 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
6482 (build_relations): Likewise for edge, states1, includes.
6483 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
6484 * src/reader.c (packgram): Likewise, for ritem, rules.
6485 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
6486 * src/relation.c (relation_digraph): Likewise for VERTICES.
6487 (relation_transpose): Likewise for new_R, end_R.
6488 * src/symtab.c (symbols_token_translations_init): Likewise for
6489 token_translations.
6490 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
6491 (token_actions): Likewise for yydefact, actrow, conflrow,
6492 conflict_list.
6493 (save_column): Likewise for froms[symno], tos[symno].
6494 (goto_actions): Likewise for state_count.
6495 (pack_table): Likewise for base, pos, check.
6496 (tables_generate): Likewise for width.
6497
6498 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
6499 for initial core. Just have a separate core, so we needn't worry
6500 about whether kernel_size and kernel_base are initialized.
6501
6502 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
6503 kernel_size, kernel_items): Remove unnecessary initialization.
6504 * src/conflicts.c (conflicts): Likewise.
6505 * src/derives.c (derives): Likewise.
6506 * src/muscle_tablc (muscle_insert): Likewise.
6507 * src/relation.c (relation_digraph): Likewise.
6508 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
6509 conflrow, conflict_table, conflict_list, table, check):
6510 Likewise.
6511
6512 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
6513 This is because all callers pass unsigned int.
6514 * src/closure.h (new_closure): Likewise.
6515
6516 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
6517 (build_relations): Initialize includes[i] in all cases.
6518 * src/reader.c (packgram): Always initialize rules[ruleno].prec
6519 and rules[ruleno].precsym. Initialize members in order.
6520 * src/relation.c (relation_transpose): Always initialize new_R[i]
6521 and end_R[i].
6522 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
6523
6524 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
6525 conflict_list[0] was always 0, but now it isn't initialized.
6526
6527 * src/table.c (table_grow): When conflict_table grew, the grown
6528 area wasn't cleared. Fix this.
6529
6530 * lib/.cvsignore: Add strdup.c, strdup.h.
6531 * m4/.cvsignore: Add strdup.m4.
6532
6533 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
6534
6535 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
6536 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
6537 GOTO_NUMBER_MAXIMUM, since we occasionally compute
6538 ngotos + 1 without checking for overflow.
6539 (build_relations): Use END_NODE, not -1, to denote end of edges.
6540 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
6541 build_relations): Use goto_number, not int, for goto numbers.
6542 * src/tables.c (save_column, default_goto): Likewise.
6543
6544 2004-11-23 Akim Demaille <akim@epita.fr>
6545
6546 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
6547 of #defining from yystype.
6548 Don't typedef yystype, C++ does not need it.
6549 This lets it possible to forward declare it as union.
6550
6551 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
6552
6553 * bootstrap (gnulib_modules): Add extensions.
6554 Problem reported by Jim Meyering.
6555
6556 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
6557
6558 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
6559 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
6560 src/system.h, src/tables.c: XFREE -> free, to accommodate
6561 recent change to gnulib xalloc.h.
6562 Problem reported by Jim Meyering.
6563
6564 2004-11-17 Akim Demaille <akim@epita.fr>
6565
6566 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
6567
6568 2004-11-17 Akim Demaille <akim@epita.fr>,
6569 Alexandre Duret-Lutz <adl@gnu.org>
6570
6571 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
6572 changes.
6573 (YYCDEBUG): Adjust.
6574 Use it instead of cdebug_.
6575 (Parser::debug_stream, Parser::set_debug_stream): New.
6576 (Parser::symprint_): Define cdebug_ for temporary backward
6577 compatibility.
6578 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
6579 debug_stream ().
6580
6581 2004-11-17 Akim Demaille <akim@epita.fr>
6582
6583 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
6584 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
6585 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
6586 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
6587
6588 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
6589
6590 * data/glr.c (yyloc_default): Remove; not used.
6591 Problem reported by Frank Heckenbach.
6592
6593 2004-10-25 Akim Demaille <akim@epita.fr>
6594
6595 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
6596 Introduce another definition to address simple location arrays.
6597 (yyGLRStack): New member: yyerror_range.
6598 (yyrecoverSyntaxError, yyparse): Update it.
6599 (yyrecoverSyntaxError): Use it when shifting the error token to
6600 have an accurate range, equivalent to the one computed by both
6601 yacc.c and lalr1.cc.
6602 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
6603 that column numbers start at column 0, as per GNU Coding
6604 Standards, the others tests, and the doc.
6605 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
6606 Adjust to the above change (first column is 0).
6607 And adjust the location of the "<error>", now covering the whole
6608 line.
6609
6610 2004-10-22 Akim Demaille <akim@epita.fr>
6611 and Paul Eggert <eggert@cs.ucla.edu>
6612
6613 Remove some arbitrary limits on goto numbers and relations.
6614 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
6615 initial values, since they're never used.
6616 (set_goto_map): ngotos is now unsigned, so test for overflow
6617 by seeing whether it wraps around to zero.
6618 * src/lalr.h (goto_number): Now size_t, not short int.
6619 (GOTO_NUMBER_MAXIMUM): Remove.
6620 * src/relation.c (relation_print, traverse, relation_transpose):
6621 Check for END_NODE rather than looking at sign.
6622 * src/relation.h (END_NODE): New macro.
6623 (relation_node): Now size_t, not short int.
6624
6625 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
6626
6627 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
6628 keyword, not an identifier. Problem reported by Baron Schwartz in
6629 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
6630
6631 2004-10-11 Akim Demaille <akim@epita.fr>
6632
6633 * src/symtab.c (symbol_check_alias_consistency): Also check
6634 type names, destructors, and printers.
6635 Reported by Alexandre Duret-Lutz.
6636 Recode the handling of associativity and precedence in terms
6637 of symbol_precedence_set.
6638 Accept no redeclaration at all, not even equal to the previous
6639 value.
6640 (redeclaration): New.
6641 Use it to factor redeclaration complaints.
6642 (symbol_make_alias): Don't set the type of the alias, let
6643 symbol_check_alias_consistency do it as for other features.
6644 * src/symtab.h (symbol): Add new member prec_location, and
6645 type_location.
6646 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
6647 * tests/input.at (Incompatible Aliases): New.
6648
6649 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
6650
6651 .cvsignore fixes to accommodate gnulib changes,
6652 and the practice of naming build directories "_build".
6653 * .cvsignore: Add "_*". Sort.
6654 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
6655 * m4/.cvsignore: Add "*_gl.m4".
6656
6657 2004-10-06 Akim Demaille <akim@epita.fr>
6658
6659 * src/parse-gram.y (add_param): Fix the truncation of trailing
6660 spaces.
6661
6662 2004-10-05 Akim Demaille <akim@epita.fr>
6663
6664 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
6665 whether the reducion was empty or not. This leaves room to
6666 improve the use of YYLLOC_DEFAULT in such a case.
6667 lalr1.cc is still experimental, so changing this is acceptable.
6668 And finally, there are probably not many users who changed the
6669 handling of locations in GLR, so changing is admissible too.
6670
6671 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
6672 empty reduction, set @$ to an empty location ending the previously
6673 stacked symbol.
6674 Adjust uses to make sure the code is triggered on empty
6675 reductions.
6676 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
6677 expected output: empty reductions have empty locations.
6678
6679 2004-09-29 Akim Demaille <akim@epita.fr>
6680
6681 * data/lalr1.cc: Move towards a more standard C++ coding style
6682 for templates: Class < T > -> Class<T>.
6683
6684 2004-09-29 Akim Demaille <akim@epita.fr>
6685
6686 * data/lalr1.cc: Reinstall the former ctor, for sake of
6687 compatibility, but warn it will be removed.
6688 Move towards a more standard C++ coding style (i.e., type *var ->
6689 type* var).
6690
6691 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
6692
6693 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
6694 since it's less likely to work if NULs are involved in the future.
6695
6696 2004-09-27 Akim Demaille <akim@epita.fr>
6697
6698 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
6699
6700 2004-09-27 Akim Demaille <akim@epita.fr>
6701
6702 * data/lalr1.cc (b4_parse_param_decl_1): New.
6703 (b4_parse_param_decl): Use it to have different names between attribute
6704 and argument names.
6705 (b4_cc_constructor_call): Likewise.
6706
6707 2004-09-24 Akim Demaille <akim@epita.fr>
6708
6709 * src/parse-gram.y (add_param): Strip the leading and trailing
6710 blanks from a formal argument declaration.
6711 (YY_LOCATION_PRINT): New.
6712
6713 2004-09-24 Akim Demaille <akim@epita.fr>
6714
6715 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
6716 after the location.
6717
6718 2004-09-24 Akim Demaille <akim@epita.fr>
6719
6720 * doc/bison.texinfo (Table of Symbols): Sort.
6721
6722 2004-09-21 Akim Demaille <akim@epita.fr>
6723
6724 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
6725 the useless parentheses.
6726 Suggested by Paul Eggert.
6727
6728 2004-09-20 Akim Demaille <akim@epita.fr>
6729
6730 Let the initial-action act on the look-ahead, and use it for the
6731 "initial push" (corresponding to an hypothetical beginning-of-file).
6732 And let lalr1.cc honor %initial-action.
6733
6734 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
6735 example.
6736 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
6737 (Parser::Parser): Remove the ctor that used to initialize it.
6738 (Parser::parse): Like in the other skeletons, issue the "starting
6739 parse" message before any action.
6740 Honor %initial-action.
6741 Initialize the stacks with the lookahead.
6742 * data/yacc.c: Let $$ and @$ in %initial-action designate the
6743 look-ahead.
6744 Push them in the stacks.
6745 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
6746
6747 2004-09-20 Akim Demaille <akim@epita.fr>
6748
6749 * doc/bison.texinfo (Initial Action Decl): New.
6750
6751 2004-09-20 Akim Demaille <akim@epita.fr>
6752
6753 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
6754 clearer criterion to define it.
6755 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
6756 When reducing on an empty RHS, use the latest stacked location as
6757 location.
6758 yylloc is not always available.
6759 * data/glr.c: Likewise.
6760 Also, honor initial-actions.
6761
6762 2004-09-20 Akim Demaille <akim@epita.fr>
6763
6764 * data/yacc.c (YY_LOCATION_PRINT): New.
6765 Define when we know YYLTYPE's structure, i.e., when the default
6766 YYLLOC_DEFAULT is used.
6767 * data/c.m4 (b4_yysymprint_generate): Use it.
6768 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
6769 value of the result.
6770 (error_start_): Replace with...
6771 (error_range_): this location array.
6772 This allows to replace code relying on the implementation of
6773 locations by portable code.
6774 * data/yacc.c (yylerrsp): Replace with...
6775 (yyerror_range): this.
6776 Every time a token is popped, update yyerror_range[0], to have an
6777 accurate location for the error token.
6778 * data/glr.c (YY_LOCATION_PRINT): New.
6779 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
6780 deference a pointer.
6781 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
6782 report the location in %printers.
6783
6784 * src/scan-skel.l: Instead of abort, report error messages to ease
6785 understanding skeleton scanning failures.
6786
6787 2004-09-16 Akim Demaille <akim@epita.fr>
6788
6789 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
6790 (iterator, const_iterator): these, to be more in the C++ spirit.
6791 Also, return reverse iterators so that when displaying the stack
6792 we display its bottom first.
6793 (Parser::stack_print_, Parser::reduce_print_): Match the messages
6794 from yacc.c.
6795 We should probably use vector here though.
6796
6797 2004-09-16 Akim Demaille <akim@epita.fr>
6798
6799 Have more complete shift traces.
6800
6801 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
6802 to report Shifts instead of ad hoc YYDPRINTF invocations,
6803 including for the error token.
6804 * data/lalr1.cc (symprint_): Output the location.
6805 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
6806 output the location within the %printer.
6807 Activate GLR tests, at least to make sure they compile properly.
6808 They still don't pass though.
6809 * tests/calc.at: Adjust expect verbose output, since now "Entering
6810 state..." is on a different line than the "Shifting" message.
6811
6812 2004-09-08 Akim Demaille <akim@epita.fr>
6813
6814 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
6815 Bison directive from the Bison file to the invocation of this
6816 macro, so that these directives are passed to
6817 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
6818 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
6819 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
6820 the extra Bison directives instead of the whole series.
6821 Change the grammar so that there are recoverable errors, and
6822 unrecoverable errors. Now we can have the parser give up before
6823 consuming the whole input. As a result we now can observe that
6824 the lookahead is freed when needed.
6825 Change the parser source to parse argv[1] instead of a hard coded
6826 string.
6827 Simplify yylex, and give a value and location to EOF.
6828 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
6829 passed directives already coded in the file.
6830 Add some tests to check the location of "error".
6831 For some tests, the C++ parser is correct, and not yacc.c.
6832 For other tests, they provide different, but unsatisfying, values,
6833 so keep the C++ value so that at least one parser is "correct"
6834 according to the test suite.
6835 (Actions after errors): Remove, this is subsumed by the
6836 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
6837
6838 2004-09-06 Akim Demaille <akim@epita.fr>
6839
6840 * data/lalr1.cc: Adjust the indentation of the labels.
6841 (Parser::pop): New.
6842 Use it.
6843
6844 2004-09-06 Akim Demaille <akim@epita.fr>
6845
6846 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
6847 argument, an informative message.
6848 Call YY_SYMBOL_PRINT.
6849 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
6850 * data/lalr1.cc (destruct_): Likewise.
6851 In addition, no longer depend on b4_yysymprint_generate and
6852 b4_yydestruct_generate to generate these functions, do it "by
6853 hand".
6854
6855 2004-09-03 Akim Demaille <akim@epita.fr>
6856
6857 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
6858 invoked, yydestruct the lookahead.
6859 * tests/calc.at (Calculator $1): Update the expected lengths of
6860 traces: there is an added line for the discarded lookahead.
6861 * doc/bison.texinfo (Destructor Decl): Some rewording.
6862 Define "discarded" symbols.
6863
6864 2004-09-02 Akim Demaille <akim@epita.fr>
6865
6866 * data/lalr1.cc (translate_, destruct_): No reason to be static.
6867
6868 2004-09-02 Akim Demaille <akim@epita.fr>
6869
6870 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
6871 (YYDSYMPRINTF): Rename as...
6872 (YY_SYMBOL_PRINT): this.
6873 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
6874 two.
6875 Use it instead of direct symprint_ calls.
6876 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
6877 one.
6878
6879 2004-09-02 Akim Demaille <akim@epita.fr>
6880
6881 * data/lalr1.cc (b4_yysymprint_generate): New.
6882 (symprint_): New member function, defined when YYDEBUG.
6883 Use it consistently instead of token/nterm debugging output by
6884 hand.
6885 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
6886 %printer calls to use cdebug_ when using lalr1.cc.
6887
6888 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
6889
6890 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
6891 with #ifdef YYDEBUG.
6892
6893 2004-08-26 Akim Demaille <akim@epita.fr>
6894
6895 * doc/bison.texinfo (Implementing Loops): Rename as...
6896 (Implementing Gotos/Loops): this.
6897
6898 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
6899
6900 Adjust to latest gnulib.
6901 * bootstrap (gnulib_modules): Add xalloc-die.
6902 Set LC_ALL=C so that file names sort consistently.
6903 Prefer the gnulib copies of gettext.m4, glibc21.m4,
6904 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
6905 uintmax_t.m4, ulonglong.m4.
6906 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
6907 po.m4 since we are now using _gl.m4 instead.
6908
6909 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
6910
6911 * src/scan-action.l: Remove. Scanning of semantic actions is
6912 handled in scan-gram.l.
6913
6914 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
6915
6916 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
6917
6918 * src/location.h (struct): The file member is a uniqstr.
6919 (equal_boundaries): Use UNIQSTR_EQ for comparison.
6920
6921 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
6922
6923 Fix bug with non-%union parsers that have printers or destructors,
6924 which led to a Bison core dump. Reported by Peter Fales in
6925 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
6926
6927 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
6928 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
6929 not to our own type.
6930 * src/output.c (symbol_destructors_output, symbol_printers_output):
6931 Don't assume %union.
6932 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
6933 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
6934 UNION-FLAG. All callers changed.
6935 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
6936 Use type char, not unsigned int, when declaring an array of char;
6937 this lets us remove a cast.
6938 (Printers and Destructors): Add non-%union test cases.
6939
6940 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6941
6942 * doc/bison.texinfo: Minor editorial changes, mostly to the new
6943 GLR writeups. E.g., avoid frenchspacing and the future tense,
6944 change "lookahead" to "look-ahead", and change "wrt" to "with
6945 respect to".
6946
6947 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6948
6949 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
6950 New sections, split off from the GLR Parsers section. Put the new
6951 Simple GLR Parser near the start of the GLR section, for clarity.
6952 Rewrite connective text.
6953
6954 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
6955
6956 * doc/bison.texinfo (Simple GLR Parsers): New section.
6957
6958 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6959
6960 * NEWS, TODO, doc/bison.texinfo:
6961 Use "look-ahead" instead of "lookahead", to be consistent.
6962 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
6963 while we're fixing "look-ahead".
6964 * src/conflicts.c (shift_set): Renamed from shiftset.
6965 (look_ahead_set): Renamed from lookaheadset.
6966 * src/print.c: Likewise.
6967 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
6968 name for "lookahead".
6969 (report_types, usage): Likewise.
6970 * src/getargs.h (report_look_ahead_tokens): Renamed from
6971 report_lookaheads.
6972 * src/lalr.c (compute_look_ahead_tokens): Renamed from
6973 compute_lookaheads.
6974 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
6975 (look_ahead_tokens_print): Renamed from lookaheads_print.
6976 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
6977 state_rule_lookaheads_print.
6978 * src/state.h: Likewise.
6979 (reductions.look_ahead_tokens): Renamed from lookaheads.
6980 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
6981 AT_DATA_LOOKAHEADS_GRAMMAR.
6982
6983 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
6984
6985 * README: Update location of patched M4 distribution.
6986
6987 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
6988
6989 Don't assume the C++ compiler takes the same arguments as the C compiler
6990 (trivial change).
6991 * configure.ac (O0CXXFLAGS): New var.
6992 * tests/atlocal.in (CXXFLAGS): Use it.
6993
6994 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
6995
6996 Fix some "make check" problems with C++ reported by
6997 Albert Chin-A-Young for Tru64 C++ in this thread:
6998 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
6999
7000 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
7001 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7002 Output to a .cc file for C++, not to a .c file.
7003 * tests/calc.at (AT_CHECK_CALC): Likewise.
7004 * tests/regression.at (AT_CHECK_DANCER): Likewise.
7005 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
7006
7007 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
7008
7009 * tests/calc.at, tests/actions.at: Workaround for SGI
7010 C++ compiler. (trivial change)
7011
7012 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
7013
7014 Spent a few hours checking out which prerequisite versions the
7015 current sources actually require. I went all the way back to
7016 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
7017 a seemingly endless set of combinations of versions more recent
7018 than that. The bottom line is that the current sources require
7019 fairly recent versions of the build tools, and it'll be some work
7020 to change this.
7021 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
7022 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
7023 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
7024 Add comments explaining why those particular versions are
7025 currently needed.
7026
7027 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
7028 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
7029 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
7030
7031 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
7032 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
7033
7034 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
7035
7036 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
7037 0.11.5. Suggested by Bruno Haible.
7038 * bootstrap: Remove gettext version checking.
7039
7040 * doc/bison.texinfo (Decl Summary): Also mention that %union
7041 can depend on prerequisite types. Problem reported by Tim
7042 Van Holder.
7043
7044 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
7045
7046 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
7047 * README-alpha: Don't tell people not to package this.
7048
7049 * bootstrap: Don't assume $(...) works; use `...` instead.
7050 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
7051 gettext better.
7052
7053 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
7054 put into the -d output file, and mention what to do if YYSTYPE is
7055 defined as a macro.
7056
7057 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
7058
7059 Undo change made earlier today: it caused autopoint to not bring
7060 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
7061 autopoint's.
7062
7063 * bootstrap: Check that gettext version matches what's in
7064 configure.ac. Warn users to ignore robots.txt ERROR 404.
7065 * bootstrap: Undo today's earlier change (logged below).
7066 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
7067
7068 The gettext version checking is causing more trouble than it's
7069 curing; remove it. Problem reported by Paul Hilfinger.
7070
7071 * bootstrap: Issue a warning that one can expect a message
7072 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
7073 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
7074
7075 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
7076
7077 Ensure that the C++ compiler used for testing actually works on a
7078 simple test program; if not, skip the C++-related tests. Problem
7079 reported by Vin Shelton in:
7080 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
7081
7082 * m4/cxx.m4: New file.
7083 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
7084 * tests/atlocal.in (BISON_CXX_WORKS): Add.
7085 * tests/local.at (AT_COMPILE_CXX): Use it.
7086
7087 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7088
7089 * data/glr.c (yylloc): Output this macro even if locations are not
7090 being generated, as the GLR parser needs it even in that case.
7091 Problem reported by Troy A. Johnson
7092 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
7093
7094 * configure.ac (AC_INIT): Update to 1.875e.
7095
7096 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7097
7098 * NEWS: Version 1.875d.
7099 * configure.ac (AC_INIT): Likewise.
7100 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
7101
7102 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
7103 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
7104 lalr1.cc runs afoul of the first, and the last two are no longer
7105 supported by GCC 3.4.0.
7106 * README: Mention GNU m4 1.4 or later; mention m4 patches.
7107 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
7108
7109 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
7110
7111 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
7112 unsigned int, for compatibility with latest gnulib hash module.
7113 * src/state.c (state_hash, state_hasher): Likewise.
7114 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
7115 * src/uniqstr.c (hash_uniqstr): Likewise.
7116
7117 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
7118
7119 * NEWS: Unescaped newlines are no longer allowed in char & strings.
7120
7121 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
7122 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
7123 character and string literals.
7124 (unexpected_end): New function.
7125 (unexpected_eof): Use it.
7126 (unexpected_newline): New function.
7127 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
7128 actions.
7129
7130 * NEWS: Document %expect-rr.
7131
7132 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
7133 Fix typo by replacing $1 with $option.
7134 Remove more 'intl'-related files.
7135 Don't DEFUN AM_INTL_SUBDIR twice.
7136
7137 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
7138 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
7139 strtoul.c.
7140 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
7141 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
7142 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
7143 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
7144 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
7145 * src/.cvsignore: Add *.output.
7146
7147 * src/parse-gram.y: Put copyright notice inside %{ %} so it
7148 gets copied to the output file.
7149
7150 2004-04-28 Paul Eggert <eggert@twinsun.com>
7151
7152 Get files from the gnulib and po repositories, instead of relying
7153 on them being in our CVS. Upgrade to latest versions of gnulib
7154 and Automake.
7155
7156 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
7157 * bootstrap: Bootstrap from gnulib and po repositories.
7158 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
7159 * README-cvs: Document these changes. Remove version numbers from
7160 mentions of build tools, since they change so often. Mention Flex.
7161
7162 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
7163 (gl_USE_SYSTEM_EXTENSIONS): Add.
7164 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
7165 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
7166 does this for us.
7167 (AC_ISC_POSIX): Remove; we no longer support this
7168 ancient OS, as it gets in the way of latest Autoconf & gnulib.
7169 (AC_HEADER_STDC): Remove: we now assume C89 or better.
7170 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
7171 Do not check for C89 headers, except for locale.h which is used
7172 by the Yacc library and must port to K&R hosts.
7173 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
7174 Do not check for C89 functions, except for setlocale which is
7175 used by the Yacc library.
7176 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
7177 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
7178 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
7179 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
7180 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
7181 AM_GNU_GETTEXT): Remove; now done by:
7182 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
7183 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
7184 for us.
7185
7186 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
7187 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
7188 Define to empty, as gnulib.mk will do the rest for us.
7189 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
7190 for us.
7191 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
7192 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
7193
7194 * src/files.c: Include gnulib's xstrndup.h.
7195
7196 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
7197 (REALLOC): Use xnrealloc, for likewise.
7198 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
7199 (strnlen, memrchr): Remove decls; functions no longer used.
7200 Include <stpcpy.h>.
7201
7202 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
7203 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7204 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
7205 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
7206 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
7207 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
7208 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
7209 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
7210 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
7211 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
7212 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
7213 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7214 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
7215 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
7216 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
7217 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
7218 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
7219 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
7220 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
7221 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
7222 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
7223 Remove, as these files are now generated automatically
7224 by bootstrap or automake.
7225
7226 * po/ChangeLog: Remove: all but one entry was a duplicate
7227 of this file, and I moved that 2000-11-02 entry here.
7228
7229 * config/.cvsignore: Add Makefile, depcomp, install-sh.
7230 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
7231 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
7232 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
7233 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
7234 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
7235 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
7236 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
7237 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
7238 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
7239 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
7240 xstrndup.h.
7241 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
7242 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
7243 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
7244 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
7245 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
7246 * src/.cvsignore: Remove *_.c.
7247
7248
7249 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
7250 support it. (The latest stable gzip doesn't.)
7251
7252 2004-04-27 Paul Eggert <eggert@twinsun.com>
7253
7254 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
7255 case, as stos_ is now used by destructors due to the 2004-02-09
7256 change.
7257
7258 Remove more K&R C support.
7259 * lib/libiberty.y (PARAMS): Remove. All uses removed.
7260 * lib/subpipe.c (errno): Remove decl.
7261 Include <stdlib.h> unconditionally.
7262 (EXIT_FAILURE): Remove macro.
7263 * src/complain.c (vfprintf, strerror): Remove.
7264 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
7265 unconditionally.
7266 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
7267 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
7268 (strchr, strspn, memchr): Remove decls.
7269 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
7270 unconditionally. Do not declare perror.
7271 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
7272 unconditionally.
7273
7274 * src/complain.c (_): Remove useless defn, as system.h defines this.
7275
7276 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
7277 with latest obstack.h.
7278 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
7279 to procedure types, as obstack.h now does that for us.
7280 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
7281
7282 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
7283 so that this include file can stand alone.
7284 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
7285 does this now. Include subpipe.h first after config.h, to
7286 test whether it can stand alone.
7287
7288 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
7289 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
7290 unused declaration.
7291
7292 * tests/synclines.at (%union synch line): Put a dummy member in
7293 the union, because empty unions aren't allowed in C. Caught
7294 by GCC 3.4.0.
7295
7296 2004-04-13 Jim Meyering <jim@meyering.net>
7297
7298 * src/conflicts.c (conflicts_print): Correct format string typo:
7299 use `%%' to produce literal `%'. (trivial change)
7300
7301 2004-03-30 Paul Eggert <eggert@twinsun.com>
7302
7303 * src/getargs.c (version): Update copyright year to 2004.
7304
7305 * data/c.m4 (b4_int_type): Use 'short int' rather than
7306 'short', and similarly for 'long', 'unsigned', etc.
7307 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
7308 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
7309 yy_yypstack, yydumpstack): Likewise.
7310 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
7311 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
7312 Likewise.
7313 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
7314 yy_stack_print, yyparse): Likewise.
7315 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
7316 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
7317 * lib/bitset.c (bitset_print): Likewise.
7318 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
7319 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7320 * lib/bitsetv.c (bitsetv_dump): Likewise.
7321 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
7322 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
7323 Likewise.
7324 * src/LR0.c (allocate_itemsets): Likewise.
7325 * src/gram.h (rule_number, rule): Likewise.
7326 * src/lalr.h (goto_number): Likewise.
7327 * src/nullable.c (nullable_compute): Likewise.
7328 * src/output.c (prepare_rules): Likewise.
7329 * src/relation.c (relation_print, relation_digraph): Likewise.
7330 * src/relation.h (relation_node): Likewise.
7331 * src/state.h (state_number, transitions, errs, reductions,
7332 struct state): Likewise.
7333 * src/symtab.h (symbol_number, struct symbol): Likewise.
7334 * src/tables.c (vector_number, tally, action_number,
7335 default_goto, goto_actions): Likewise.
7336 * tests/existing.at (GNU Cim Grammar): Likewise.
7337 * tests/regression.at (Web2c Actions): Likewise.
7338
7339 * src/output.c (muscle_insert_short_int_table): Renamed from
7340 muscle_insert_short_table. All uses changed.
7341
7342 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7343
7344 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
7345 (declaration): Replace expected_conflicts with expected_sr_conflicts.
7346 Add %expect-rr rule.
7347
7348 * src/scan-gram.l: Recognize %expect-rr.
7349
7350 * src/conflicts.h (expected_sr_conflicts): Rename from
7351 expected_conflicts.
7352 (expected_rr_conflicts): Declare.
7353
7354 * src/conflicts.c (expected_sr_conflicts): Rename from
7355 expected_conflicts.
7356 (expected_rr_conflicts): Define.
7357 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
7358 for GLR parsers.
7359 Use expected_sr_conflicts in place of expected_conflicts.
7360 Warn if expected_rr_conflicts used in non-GLR parser.
7361
7362 * doc/bison.texinfo: Add documentation for %expect-rr.
7363
7364 2004-03-08 Paul Eggert <eggert@gnu.org>
7365
7366 Add support for hex token numbers. Suggested by Odd Arild Olsen in
7367 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
7368
7369 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
7370 in lalr1.cc.
7371 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
7372 * src/scan-gram.l (scan_integer): New function.
7373 ({int}): Use it.
7374 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
7375 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
7376 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
7377 Say "long int", not "long", for uniformity with GNU style.
7378
7379 2004-02-25 Paul Eggert <eggert@twinsun.com>
7380
7381 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
7382 compilers. This fixes a problem with Intel's C++ compiler being
7383 chatty, reported by Guido Trentalancia in
7384 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
7385
7386 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
7387
7388 Support %destructor and merge error locations in lalr1.cc.
7389
7390 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
7391 (Parser::stos_): Define unconditionally.
7392 (Parser::destruct_): New method. Generate its body with
7393 b4_yydestruct_generate.
7394 (Parser::error_start_): New attribute.
7395 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
7396 token which are discarded.
7397 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
7398 error_start_ when erroneous token are discarded.
7399 (Parser::parse) <yyerrlab1>: Compute the location of the error
7400 token so that it covers all the discarded tokens.
7401 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
7402 it can be called with `%skeleton "lalr1.cc"', and do that.
7403
7404 2004-02-02 Paul Eggert <eggert@twinsun.com>
7405
7406 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
7407 $(top_srcdir)/lib and ../lib. This fixes a bug reported
7408 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
7409 There's no need to mention top_builddir since Automake does that
7410 for us.
7411 (INCLUDES): Remove, as Automake says it's obsolescent.
7412 Contents migrated into AM_CPPFLAGS as described above.
7413 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
7414
7415 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7416
7417 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
7418 (yyreportSyntaxError): Handle case where lookahead token is
7419 YYEMPTY.
7420
7421 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7422
7423 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
7424 resulting parsers are compilable with C++.
7425
7426 2003-12-23 Paul Eggert <eggert@twinsun.com>
7427
7428 * config/depcomp, config/install-sh: Sync with Automake 1.8.
7429 * src/output.c (output_skeleton): Rename local var.
7430 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
7431 Bison tokens, as this runs afoul of the 2003-10-07 change that
7432 disallowed NUL bytes in character constants or string literals.
7433
7434 * tests/local.at: Require Autoconf 2.59's Autotest.
7435 * tests/testsuite.at: Don't include local.at, since we now assume
7436 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
7437 including it.
7438 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
7439 multiple inclusion warnings.
7440
7441 2003-12-02 Akim Demaille <akim@epita.fr>
7442
7443 * doc/bison.texinfo (How Can I Reset the Parser): More about start
7444 conditions.
7445 From Bruno Haible.
7446
7447 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
7448
7449 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
7450
7451 2003-10-07 Paul Eggert <eggert@twinsun.com>
7452
7453 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
7454 if testsuite doesn't exist.
7455
7456 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
7457 literals, unfortunately.
7458 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
7459 Complain about NUL bytes in character constants or string literals.
7460
7461 2003-10-05 Paul Eggert <eggert@twinsun.com>
7462
7463 * NEWS: Don't document %no-default-prec, as it's still
7464 too experimental.
7465 * doc/bison.texinfo: Document %no-default-prec only if
7466 the defaultprec flag is set. Normally it's not.
7467
7468 2003-10-04 Paul Eggert <eggert@twinsun.com>
7469
7470 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
7471 non-modifiable lvalue, instead of a modifiable one.
7472 * doc/bison.texinfo (Actions): Document that $$ can
7473 be assigned to. Do not claim that $$ and $N are
7474 array element references: user code should not rely on this.
7475
7476 2003-10-01 Paul Eggert <eggert@twinsun.com>
7477
7478 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
7479 (grammar_declaration): Use it.
7480 * src/scan-gram.l: New token %no-default-prec.
7481 * tests/conflicts.at: Revamp tests to use %no-default-prec.
7482 * NEWS, doc/bison.texinfo: Document the above.
7483
7484 2003-10-01 Akim Demaille <akim@epita.fr>
7485
7486 VCG no longer supports long_straight_phase.
7487
7488 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
7489 * src/print_graph.c (print_graph): Adjust.
7490
7491 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
7492 and Paul Eggert <eggert@twinsun.com>
7493
7494 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
7495 Table of Symbols): Document %default-prec.
7496 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
7497 (grammar_declaration): Set default_prec on %default-prec.
7498 * src/scan-gram.l (%default-prec): New token.
7499 * src/reader.h (default_prec): New flag.
7500 * src/reader.c: Likewise.
7501 (packgram): Handle it.
7502 * tests/conflicts.at (%default-prec without %prec,
7503 %default-prec with %prec, %default-prec 1): New tests.
7504
7505 2003-09-30 Paul Eggert <eggert@twinsun.com>
7506
7507 * tests/testsuite.at: Include local.at, not input.at, fixing
7508 a typo in the 2003-08-25 patch.
7509
7510 2003-08-27 Akim Demaille <akim@epita.fr>
7511
7512 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
7513 GCC warnings.
7514
7515 2003-08-26 Akim Demaille <akim@epita.fr>
7516
7517 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
7518 "<\#" to avoid magic from Gnus when posting parts of this script.
7519
7520 2003-08-26 Akim Demaille <akim@epita.fr>
7521
7522 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
7523 (Parser::parse): here.
7524 Adjust: nerrs and errstatus is now replaced by...
7525 (Parser::nerrs_, Parser::errstatus_): New.
7526
7527 2003-08-25 Akim Demaille <akim@epita.fr>
7528
7529 * config/announce-gen, Makefile.cfg: New.
7530 * Makefile.am: Adjust.
7531 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
7532 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
7533
7534 2003-08-25 Akim Demaille <akim@epita.fr>
7535
7536 When reducing initial empty rules, Bison parser read an initial
7537 location that is not defined. This results in garbage, and that
7538 affects Bison's own parser. Therefore we need (i) to extend Bison
7539 to support a means to initialize this location, and (ii) to use
7540 this CVS Bison to fix CVS Bison's parser.
7541
7542 * src/reader.h, reader.c (epilogue_augment): Remove, replace
7543 with...
7544 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
7545 * src/parse-gram.y: Adjust.
7546 (%initial-action): New.
7547 (%error-verbose): Since we require CVS Bison, there is no reason
7548 not to use it.
7549 * src/scan-gram.l: Adjust.
7550 * src/Makefile.am (YACC): New, to make sure we use our own parser.
7551 * data/yacc.c (yyparse): Use b4_initial_action.
7552
7553 2003-08-25 Akim Demaille <akim@epita.fr>
7554
7555 * doc/bison.texinfo: Don't promote stdout for error messages.
7556
7557 2003-08-25 Akim Demaille <akim@epita.fr>
7558
7559 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
7560 From Alexandre Duret-Lutz.
7561
7562 2003-08-25 Akim Demaille <akim@epita.fr>
7563
7564 Version 1.875c.
7565
7566 2003-08-25 Akim Demaille <akim@epita.fr>
7567
7568 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
7569 Use them.
7570
7571 2003-08-25 Akim Demaille <akim@epita.fr>
7572
7573 * data/lalr1.cc (Parser::reduce_print_): New.
7574 Use it.
7575
7576 2003-08-25 Akim Demaille <akim@epita.fr>
7577
7578 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
7579 error recovery loops. This patch is based on
7580 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
7581 Also, augment the similarity between lalr1.cc and yacc.c.
7582 Note: the locations of error recovery rules are not correct yet.
7583
7584 * data/lalr1.cc: Comment changes to augment the similarity between
7585 lalr1.cc and yacc.c.
7586 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
7587 (yyerrlab1): Remove, but where it used to be (now the bottom part of
7588 yyerrlab), when hitting EOF, pop the whole stack here instead of
7589 merely falling thru the default error handling mechanism.
7590 (yyerrorlab): New label, with the old contents of YYERROR,
7591 plus the following change: pop the stack of rhs corresponding
7592 to the production that invoked YYERROR. That is how Yacc
7593 behaves (required by POSIX).
7594 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
7595 fail.
7596
7597 2003-08-25 Akim Demaille <akim@epita.fr>
7598
7599 Tune local.at so that people can "autom4te -l autotest calc.at -o
7600 calc" for instance, to extract a sub test suite.
7601
7602 * tests/testsuite.at: Move the initialization, Autotest version
7603 requirement, and AT_TESTED invocation into...
7604 * tests/local.at: here.
7605 * tests/testsuite.at: Include it for compatibility with Autoconf
7606 2.57.
7607 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
7608 be ignore.
7609
7610 2003-08-04 Paul Eggert <eggert@twinsun.com>
7611
7612 Rework code slightly to avoid gcc -Wtraditional warnings.
7613 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
7614 The returned value is now stored in *YY0. All callers changed.
7615 * src/output.c (merge_output): Adjust to the above change.
7616
7617 2003-07-26 Paul Eggert <eggert@twinsun.com>
7618
7619 * data/glr.c (YYASSERT): New macro.
7620 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
7621 yyresolveStates, yyprocessOneStack):
7622 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
7623 Derived from a suggestion by Frank Heckenbach.
7624
7625 2003-07-25 Paul Eggert <eggert@twinsun.com>
7626
7627 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
7628 for portability to K&R C (after ansi2knr, presumably). See
7629 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
7630 by Frank Heckenbach, though I have omitted the structure-initialization
7631 part of his glr-knr.diff patch since I recall that the Portable
7632 C Compiler didn't require that change.
7633
7634 Let the user specify how to allocate and free memory.
7635 Derived from a suggestion by Frank Heckenbach in
7636 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
7637 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
7638 All uses of free, malloc, realloc changed to use these macros,
7639 and unnecessary casts removed.
7640 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
7641
7642 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
7643
7644 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
7645 use s.empty() rather than s == "" to test for empty string; see
7646 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
7647 (trivial change)
7648
7649 2003-06-25 Akim Demaille <akim@epita.fr>
7650
7651 * config/depcomp, config/install-sh: Update from masters.
7652
7653 2003-06-20 Paul Eggert <eggert@twinsun.com>
7654
7655 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
7656 and return properly parenthesized result.
7657 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
7658 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7659 Remove unnecessary parentheses from uses.
7660 * doc/bison.texinfo (Location Default Action): Describe the
7661 conventions for parentheses.
7662
7663 2003-06-19 Paul Eggert <eggert@twinsun.com>
7664
7665 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
7666 yyreportTree): Do not assume that size_t is the same width as int,
7667 when printing sizes. Print sizes using an unsigned format.
7668 Problem reported by Frank Heckenbach in
7669 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
7670
7671 Port to Forte Developer 7 C compiler.
7672 * data/glr.c (struct YYLTYPE): If locations are not being used,
7673 declare a single dummy member, as empty structs do not conform
7674 to the C standard.
7675 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
7676 the Forte Developer 7 C compiler complains that end-of-loop
7677 code is not reached.
7678
7679 2003-06-17 Paul Eggert <eggert@twinsun.com>
7680
7681 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
7682 avoid warnings from picky compilers about redefinition of PARAMS.
7683
7684 2003-06-17 Paul Eggert <eggert@twinsun.com>
7685
7686 Version 1.875b.
7687
7688 * NEWS: Document 1.875b.
7689
7690 * lib/bbitset.h: Do not include config.h; that's the includer's job.
7691 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
7692 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
7693 Don't use 'index' in comments, as it's a builtin fn on some hosts.
7694 * lib/bitset_stats.c: Include gettext.h unconditionally, as
7695 per recent gettext manual's suggestion.
7696 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
7697 Use prototypes, not old-style definitions.
7698 * lib/lbitset.c (lbitset_unused_clear): Likewise.
7699 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
7700 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
7701 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
7702 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
7703 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
7704 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
7705 vbitset_or_and_cmp, vbitset_copy): Likewise.
7706
7707 * lib/libiberty.h: Do not include config.h; that's the includer's job.
7708 Do not include <stdlib.h>.
7709 (PARAMS): Define unconditionally for C89.
7710 (ATTRIBUTE_NORETURN): Remove.
7711 (ATTRIBUTE_UNUSED): Define unconditionally.
7712
7713 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
7714 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
7715 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
7716 * lib/vbitset.c, lib/vbitset.h: New files.
7717 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
7718 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
7719 from libbitset.
7720
7721 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
7722 `How Can I Reset @code{yyparse}', since texinfo does not allow
7723 arbitrary @ in node names.
7724
7725 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
7726 shouldn't be needed according to the gettext 0.12.1 documentation
7727 but which seem to be needed anyway: codeset.m4 glibc21.m4
7728 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
7729 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
7730 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
7731
7732 * lib/.cvsignore: Add stdbool.h.
7733 * m4/.cvsignore: Add nls.m4, po.m4.
7734
7735 Upgrade to CVS gnulib.
7736 * stdbool_.h: File renamed from stdbool.h.in.
7737 * configure.ac (AM_STDBOOL_H): Invoke this instead of
7738 AC_HEADER_STDBOOL.
7739 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
7740 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
7741 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
7742 (MOSTLYCLEANFILES): New var.
7743 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
7744 (stdbool.h): New rule.
7745 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
7746 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
7747 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
7748 m4/quote.m4: Upgrade to today's gnulib.
7749
7750 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
7751 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
7752 the tests right now.
7753 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
7754 yyerror are declared before use; C99 requires this.
7755
7756 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7757
7758 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
7759 first.
7760 (yyrecoverSyntaxError): Correct the logic for setting and testing
7761 yyerrState.
7762 Correct comment on handling EOF.
7763 Allow states with only a default reduction, rather than failing
7764 (I can't quite reconstruct why these were not allowed before).
7765
7766 Fixes to avoid problem that $-N rules in GLR parsers can cause
7767 buffer overruns, corrupting state.
7768
7769 * src/output.c (prepare_rules): Output max_left_semantic_context
7770 definition.
7771 * src/reader.h (max_left_semantic_context): New variable declaration.
7772 * src/scan-gram.l (max_left_semantic_context): Define.
7773 (handle_action_dollar): Update max_left_semantic_context.
7774 * data/glr.c (YYMAXLEFT): New definition.
7775 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
7776 (yyresolveAction): Ditto.
7777
7778 Fixes to problems with location handling in GLR parsers reported by
7779 Frank Heckenbach (2003/06/05).
7780
7781 * data/glr.c (YYLTYPE): Make trivial if locations not used.
7782 (YYRHSLOC): Add parentheses, and define only if locations used.
7783 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
7784 locations not used.
7785 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
7786 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
7787
7788 * tests/cxx-type.at: Exercise location information; update tests
7789 to differentiate output with and without locations.
7790 Remove forward declarations of yylex and yyerror---caused errors
7791 because default YYLTYPE not yet defined.
7792 Change semantic actions to compute strings, rather than printing
7793 them directly (to test proper passing of semantics values). Change
7794 output to prefix notation and update test data and expected results.
7795 (yylex): Track locations.
7796 (stmtMerge): Return value rather than printing, and include arguments
7797 in value.
7798
7799 2003-06-03 Paul Eggert <eggert@twinsun.com>
7800
7801 Avoid warnings generated by GCC 2.95.4 when Bison is
7802 configured with --enable-gcc-warnings.
7803 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
7804 yy::]b4_parser_class_name[::translate_,
7805 yy::Stack::operator[] (unsigned),
7806 yy::Stack::operator[] (unsigned) const,
7807 yy::Slice::operator[] (unsigned),
7808 yy::Slice::operator[] (unsigned) const):
7809 Rename local vars to avoid warnings.
7810 * tests/glr-regression.at (Improper handling of embedded actions
7811 and $-N in GLR parsers): Remove unused local variable from yylex.
7812 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
7813 (void) as arg when not pure, since we now assume C89 when building
7814 Bison. Pacify GCC by using parameter.
7815
7816 2003-06-02 Paul Eggert <eggert@twinsun.com>
7817
7818 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
7819 yy::Location::lines, yy::Location::columns): Rename arguments
7820 to avoid shadowing; this removes a warning generated by GCC 3.3.
7821
7822 2003-06-01 Paul Eggert <eggert@twinsun.com>
7823
7824 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
7825 to g++, as GCC 3.3 complains if you do it.
7826 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
7827 everything that WARNING_CFLAGS has, except omit warnings
7828 not suitable for C++.
7829 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
7830 * tests/atlocal.in (CXXFLAGS): New var.
7831 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
7832
7833 Fix a GLR parser bug I reported in February; see
7834 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
7835 The problem was that GLR parsers did not conform to the C standard,
7836 because actions like { $1 = $2 + $3; } expanded to expressions
7837 that invoked YYFILL in separate subexpressions, and YYFILL assigned
7838 to a local variable. The C standard says that expressions
7839 like (var = f ()) + (var = f ()) have undefined behavior.
7840 Another problem was that GCC sometimes issues warnings that
7841 yyfill and its parameters are unused.
7842
7843 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
7844 as possibly unused.
7845 (yyfill): New function.
7846 (YYFILL): Use it.
7847 (yyuserAction): Change type of yynormal to bool, so that it matches
7848 the new yyfill signature. Mark it as possibly unused.
7849
7850
7851 Follow up on a bug I reported in February, where a Bison-generated
7852 parser can loop. Provide a test case and a fix for yacc.c. I
7853 don't have a fix for lalr1.cc or for glr.c, unfortunately.
7854 The original bug report is in:
7855 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
7856
7857 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
7858 macro's size was becoming unwieldy.
7859 (yyerrlab): Do not discard an empty lookahead symbol, as this
7860 might destroy garbage.
7861 (yyerrorlab): New label, with the old contents of YYERROR,
7862 plus the following change: pop the stack of rhs corresponding
7863 to the production that invoked YYERROR. That is how Yacc
7864 behaves, and POSIX requires this behavior.
7865 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
7866 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
7867 Define 'alarm' to do nothing if unistd.h is not available.
7868 Add a new rule "exp: '-' error;" to test the above change to
7869 data/yacc.c. Use 'alarm' to abort any test taking longer than
7870 10 seconds, as it's probably looping.
7871 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
7872 Also, the new yacc.c generates two fewer diagnostics for an
7873 existing test.
7874
7875 2003-05-24 Paul Eggert <eggert@twinsun.com>
7876
7877 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
7878 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
7879 This fixes a problem reported by John Bowman when the Compaq/HP
7880 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
7881 -ansi -Wall -gall).
7882 * data/yacc.c (union yyalloc): Likewise.
7883 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
7884
7885 Switch from 'int' to 'bool' where that makes sense.
7886
7887 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
7888 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
7889 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
7890 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
7891 Return or accept bool, not int. All callers changed.
7892 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
7893 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
7894 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
7895 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
7896 bitset_or_and_cmp_): Likewise.
7897 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
7898 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
7899 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
7900 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
7901 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
7902 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
7903 bitset_stats_or_and_cmp): Likewise.
7904 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
7905 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
7906 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
7907 ebitset_xor_cmp): Likewise.
7908 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
7909 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
7910 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
7911 lbitset_xor_cmp): Likewise.
7912 * lib/bbitset.h: Include <stdbool.h>.
7913 (struct bitset_vtable): The following members now return bool, not
7914 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
7915 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
7916 or_and_cmp).
7917 * src/conflicts.c (count_rr_conflicts): Likewise.
7918 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
7919 All uses changed.
7920 * lib/ebitset.c (ebitset_obstack_init): Likewise.
7921 * lib/lbitset.c (lbitset_obstack_init): Likewise.
7922 * src/getargs.c (debug_flag, defines_flag, locations_flag,
7923 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7924 graph_flag): Likewise.
7925 * src/getargs.h (debug_flag, defines_flag, locations_flag,
7926 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7927 graph_flag): Likewise.
7928 * src/output.c (error_verbose): Likewise.
7929 * src/output.h (error_verbose): Likewise.
7930 * src/reader.c (start_flag, typed): Likewise.
7931 * src/reader.h (typed): Likewise.
7932 * src/getargs.c (LOCATIONS_OPTION): New constant.
7933 (long_options, getargs): Use it.
7934 * src/lalr.c (build_relations): Use bool, not int.
7935 * src/nullable.c (nullable_compute): Likewise.
7936 * src/print.c (print_reductions): Likewise.
7937 * src/tables.c (action_row, pack_vector): Likewise.
7938 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
7939 * src/output.c (prepare): Use it.
7940 * src/output.c (token_definitions_output,
7941 symbol_destructors_output, symbol_destructors_output): Use string,
7942 not boolean integer, to keep track of whether to output separator.
7943 * src/print_graph.c (print_core): Likewise.
7944 * src/state.c (state_rule_lookaheads_print): Likewise.
7945
7946 * config/install-sh: Sync from automake 1.7.5.
7947
7948 2003-05-14 Paul Eggert <eggert@twinsun.com>
7949
7950 * src/parse-gram.y (rules_or_grammar_declaration): Require a
7951 semicolon after a grammar declaration, in the interest of possible
7952 future changes to the Bison input language.
7953 Do not allow a stray semicolon at the start of the grammar.
7954 (rhses.1): Allow one or more semicolons after any rule, including
7955 just before "|" as required by POSIX.
7956 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
7957 grammar.
7958
7959 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
7960
7961 %parse-param support for lalr1.cc.
7962
7963 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
7964 b4_cc_constructor_calls, b4_cc_constructor_call,
7965 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
7966 definitions.
7967 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
7968 parse-param arguments.
7969 (yy::b4_parser_class_name): Declare instance variables to
7970 hold parse-param arguments.
7971 * tests/calc.at: s/value/semantic_value/ because value clashes
7972 with a member of yy::b4_parser_class_name. Adjust C++ code
7973 to handle %parse-param. Enable %parse-param test in C++.
7974
7975 2003-05-12 Paul Eggert <eggert@twinsun.com>
7976
7977 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
7978 English a bit. Fix fclose typo. Change "const char" to "char
7979 const", and use ANSI C rather than K&R for "main". Suggest
7980 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
7981 and suggest yy_switch_to_buffer.
7982
7983 2003-05-05 Paul Eggert <eggert@twinsun.com>
7984
7985 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
7986 C89. This avoids a diagnostic on compilers that define __STDC__
7987 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
7988 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7989
7990 2003-05-03 Paul Eggert <eggert@twinsun.com>
7991
7992 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
7993 Do not overrun array bounds.
7994 This should fix a bug reported today by Olatunji Oluwabukunmi in
7995 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
7996
7997 2003-04-29 Akim Demaille <akim@epita.fr>
7998
7999 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
8000 * src/getargs.c, src/getargs.h: here, as bool, not int.
8001 (nondeterministic_parser): New.
8002 * src/parse-gram.y, src/scan-gram.l: Support
8003 %nondeterministic-parser.
8004 * src/output.c (prepare): Use nondeterministic_parser instead
8005 of glr_parser where appropriate.
8006 * src/tables.c (conflict_row, action_row, save_row)
8007 (token_actions, token_actions, pack_vector): Ditto.
8008
8009 2003-04-29 Akim Demaille <akim@epita.fr>
8010
8011 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
8012
8013 2003-04-29 Akim Demaille <akim@epita.fr>
8014
8015 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
8016 with %pure-parser and %locations to exercise the patch from Yakov
8017 Markovitch below.
8018
8019 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
8020
8021 * data/yacc.c: (b4_lex_param): Corrected for the case where
8022 %lex-param is provided and %pure-parser isn't.
8023
8024 2003-04-27 Paul Eggert <eggert@twinsun.com>
8025
8026 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
8027 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
8028 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
8029 if it is not defined.
8030 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
8031
8032 2003-04-26 Paul Eggert <eggert@twinsun.com>
8033
8034 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
8035 Declare to be of type suitable for the ninf value itself, not of
8036 type suitable for the corresponding table, since the latter might
8037 be unsigned but the ninf value might be negative. This fixes a
8038 bug reported by Alexandre Duret-Lutz in
8039 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
8040
8041 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
8042 invokes it. We shouldn't invoke it twice because it will attempt
8043 to put error.o in the archive twice. This fixes a glitch reported
8044 by Martin Mokrejs in
8045 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
8046
8047 2003-04-21 Paul Eggert <eggert@twinsun.com>
8048
8049 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
8050 to gnulib.
8051
8052 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
8053
8054 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
8055 Fix obvious typo that results in uncompilable GLR parsers
8056 when both %pure-parser and %locations are used. (trivial change)
8057
8058 2003-04-17 Paul Eggert <eggert@twinsun.com>
8059
8060 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
8061 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
8062 Do not insert the expected token via unput, as this runs afoul
8063 of a POSIX-compatibility bug in flex 2.5.31.
8064 All uses changed to BEGIN the parent state,
8065 since we no longer insert the expected token via unput.
8066 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
8067 that is no longer emitted after the above change.
8068
8069 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
8070 the first one. This change is from Paul Hilfinger, and it fixes
8071 regression reported by Werner Lemberg in
8072 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
8073
8074 (resolve_sr_conflict): Don't invoke state_errs_set
8075 unless one or more tokens have been explicitly made errors.
8076 Otherwise, the above change causes Bison to abort.
8077
8078 * tests/existing.at (GNU pic Grammar): New test case, taken from
8079 Lemberg's email.
8080
8081 2003-03-31 Akim Demaille <akim@epita.fr>
8082
8083 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
8084
8085 2003-03-31 Akim Demaille <akim@epita.fr>
8086
8087 * src/output.c (prepare_symbols): Avoid trailing spaces in the
8088 output.
8089
8090 2003-03-31 Akim Demaille <akim@epita.fr>
8091
8092 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
8093 From Paul Hilfinger.
8094
8095 2003-03-29 Akim Demaille <akim@epita.fr>
8096
8097 * m4/error.m4: Do not put under dynamic conditions some code which
8098 expansion is under static control.
8099
8100 2003-03-29 Akim Demaille <akim@epita.fr>
8101
8102 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
8103
8104 2003-03-29 Akim Demaille <akim@epita.fr>
8105
8106 * doc/bison.texinfo (Strings are Destroyed): New.
8107
8108 2003-03-13 Paul Eggert <eggert@twinsun.com>
8109
8110 * .cvsignore: Add configure.lineno.
8111 * src/.cvsignore: Add yacc.
8112 * tests/.cvsignore: Add testsuite.log.
8113 * doc/fdl.texi: Sync with latest FSF version.
8114
8115 2003-03-12 Paul Eggert <eggert@twinsun.com>
8116
8117 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
8118 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
8119 cursor, instead of leaving it undefined. This fixes a bug
8120 reported by Tim Van Holder in
8121 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
8122 * tests/input.at (Torturing the Scanner): Test the scanner on
8123 an empty input file, which was Tim Van Holder's test case.
8124
8125 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
8126 <sys/resource.h> can be included, include sys/time.h and
8127 sys/times.h first, if available. This works around the SunOS
8128 4.1.4 porting bug reported by Bruce Becker in
8129 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
8130
8131 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
8132 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
8133 AC_HEADER_SYS_WAIT.
8134
8135 Merge changes from gnulib. This was prompted because the CVS
8136 snapshot didn't build on Solaris 7 due to strnlen problems.
8137
8138 These changes need to be merged back into gnulib:
8139 * lib/hash.c: Include <stdbool.h> unconditionally.
8140 * m4/onceonly.m4 (m4_quote): New macro.
8141 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
8142 Quote AC_FOREACH variable-expansions properly.
8143 The 2003-01-03 obstack.h change also needs merging.
8144 {end of changes requiring merging}
8145
8146 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8147 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
8148 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
8149 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
8150 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
8151 New files, imported from gnulib.
8152 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
8153 above.
8154
8155 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
8156 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
8157 gnulib sources.
8158
8159 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
8160 Add.
8161 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
8162 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
8163 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
8164 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
8165 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
8166 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
8167 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
8168 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
8169 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
8170 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
8171 (jm_PREREQ_ARGMATCH): Remove.
8172 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
8173 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
8174
8175 * src/system.h: Include <stdbool.h> unconditionally.
8176
8177 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
8178 assuming at least C89 in the bitset code for some time now.
8179
8180 2003-03-03 Akim Demaille <akim@epita.fr>
8181
8182 * ro.po: New.
8183
8184 2003-03-02 Akim Demaille <akim@epita.fr>
8185
8186 * doc/bison.texinfo (Table of Symbols): Reactivate the
8187 documentation for %lex-param, and %parse-param.
8188
8189 2003-03-02 Akim Demaille <akim@epita.fr>
8190
8191 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
8192 generate verbose error messages.
8193 Use the number of tokens as an upper bound in yytname, as it
8194 cannot be a non terminal.
8195
8196 2003-03-02 Akim Demaille <akim@epita.fr>
8197
8198 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
8199 message.
8200
8201 2003-03-02 Akim Demaille <akim@epita.fr>
8202
8203 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
8204 Use them to exercise yycheck overrun.
8205 Based on Andrew Suffield's grammar.
8206
8207 2003-03-02 Akim Demaille <akim@epita.fr>
8208
8209 Create tests/local.at for Bison generic testing macros.
8210
8211 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
8212 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
8213 This new file.
8214 * tests/calc.at (AT_CHECK_CALC): Adjust.
8215 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
8216 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
8217 * tests/local.at: here.
8218 (AT_COMPILE_CXX): Tags the tests using it as c++.
8219 Ignore the test if CXX is not functional.
8220
8221 2003-03-01 Paul Eggert <eggert@twinsun.com>
8222
8223 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
8224 not loc->end, since loc->end might contain garbage and this leads
8225 to undefined behavior on some platforms.
8226 (id_loc, token_start): Use (IF_LINTed) initial values that do not
8227 depend on *loc, so that the reader doesn't give the the false
8228 impression that *loc is initialized.
8229 (<INITIAL>"%%"): Do not bother setting code_start, since its value
8230 does not survive the return.
8231
8232 2003-03-01 Akim Demaille <akim@epita.fr>
8233
8234 * src/scan-gram.l (code_start): Always initialize it when entering
8235 into yylex, as SC_EPILOGUE is activated *before* the corresponding
8236 yylex invocation. An alternative would be making it static, but
8237 then it starts with the second %%'s beginning, instead of its end.
8238
8239 2003-02-28 Paul Eggert <eggert@twinsun.com>
8240
8241 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
8242 around a UnixWare 7.1.1 porting bug reported by John Hughes in
8243 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
8244
8245 2003-02-26 Paul Eggert <eggert@twinsun.com>
8246
8247 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
8248 Remove Sequent/Pyramid discussion (nobody uses them any more).
8249 Merge VMS and MS-DOS discussion; these ports may well be dead
8250 but let's keep mentioning them for now. Put <> around email
8251 addresses. Add copyright notice.
8252
8253 2003-02-24 Paul Eggert <eggert@twinsun.com>
8254
8255 * data/glr.c (yy_reduce_print): yylineno -> yylno,
8256 to avoid collision with flex use of yylineno.
8257 Problem reported by Bruce Lilly in
8258 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
8259 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8260 * data/yacc.c (yy_reduce_print): Likewise.
8261
8262 * config/depcomp: Sync with Automake 1.7.3.
8263
8264 2003-02-21 Akim Demaille <akim@epita.fr>
8265
8266 * data/lalr1.cc: Use temporary variables instead of casts to
8267 change integer types.
8268 Suggested by Paul Eggert.
8269
8270 2003-02-21 Akim Demaille <akim@epita.fr>
8271
8272 * doc/bison.texinfo: Use "location" consistently to refer to @n,
8273 to avoid confusions with lalr1.cc's notion of Position.
8274 Suggested by Paul Eggert.
8275
8276 2003-02-20 Akim Demaille <akim@epita.fr>
8277
8278 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
8279 before initial_columns.
8280 (location.hh): Use consistent variable names when defining the
8281 operator<<.
8282 Use "last" so that we subtract from Positions, not from unsigned.
8283
8284 2003-02-20 Akim Demaille <akim@epita.fr>
8285
8286 * data/lalr1.cc (position.hh): New subfile, including the extended
8287 and Doxygen'ed documentation of class Position.
8288 (location.hh): Use it.
8289 Document a` la Doxygen.
8290 With the help of Benoit Perrot.
8291
8292 2003-02-20 Akim Demaille <akim@epita.fr>
8293
8294 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
8295 AT_YACC_IF.
8296 Redefine AT_YYERROR_SEES_LOC_IF using it.
8297 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
8298 not defined.
8299 Don't use the location in yy::Parser::error_ and
8300 yy::Parser::print_ when not %locations.
8301 Activate more lalr1.cc tests.
8302
8303 2003-02-19 Akim Demaille <akim@epita.fr>
8304
8305 * data/lalr1.cc: When displaying a line number, be sure to make it
8306 an int.
8307
8308 2003-02-19 Akim Demaille <akim@epita.fr>
8309
8310 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
8311 Remove, useless.
8312 (YYABORT, YYACCEPT, YYERROR): New.
8313 * tests/calc.at: Renable the lalr1.cc test.
8314
8315 2003-02-19 Akim Demaille <akim@epita.fr>
8316
8317 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
8318 error recovery, mixing with/without pops and discarding of the
8319 lookahead.
8320 Exercise YYERROR.
8321 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
8322
8323 2003-02-17 Paul Eggert <eggert@twinsun.com>
8324
8325 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
8326 * tests/testsuite.at (AT_COMPILE): Use them.
8327 This fixes the testsuite problem reported by Robert Lentz in
8328 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
8329
8330 2003-02-12 Paul Eggert <eggert@twinsun.com>
8331
8332 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
8333 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
8334 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
8335 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
8336 Check for malloc failure, for consistency with yacc.c.
8337 (yytname_size): Remove, for consistency with yacc.c.
8338
8339 The bug still remains in data/lalr1.cc, as I didn't have time
8340 to fix it there.
8341
8342 2003-02-06 Akim Demaille <akim@epita.fr>
8343
8344 * configure.ac (GXX): Rename as...
8345 (CXX): this, to keep the original Autoconf semantics.
8346 Require 2.57.
8347 * data/lalr1.cc: Fix b4_copyright invocations.
8348 If YYDEBUG is not defined, don't depend upon name_ being defined.
8349 (location.hh): Include string and iostream.
8350 (Position::filename): New member.
8351 (Position::Position ()): New.
8352 (operator<< (Position)): New.
8353 (operator- (Position, int)): New.
8354 (Location::first, Location::last): Rename as...
8355 (Location::begin, Location::end): these, to mock the conventional
8356 iterator names.
8357 (operator<< (Location)): New.
8358 * tests/atlocal.in (CXX): New.
8359 * tests/testsuite.at (AT_COMPILE_CXX): New.
8360 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
8361 locations in a more synthetic way.
8362 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
8363 lalr1.cc is used.
8364 Adjust the C locations to match those from Emacs: first column is
8365 column 0.
8366 Change all the expected results.
8367 Conform to the GCS: simplify the locations when applicable.
8368 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
8369 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
8370 these CPP macros with the m4 macros new defined by...
8371 (AT_CHECK_PUSHDEFS): this, i.e.:
8372 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
8373 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
8374 New macros.
8375 (AT_CHECK_POPDEFS): Undefine them.
8376 (AT_CHECK_CALC_LALR1_CC): New.
8377 Use it for the first lalr1.cc test.
8378
8379 2003-02-04 Akim Demaille <akim@epita.fr>
8380
8381 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
8382 Location as is defined.
8383
8384 2003-02-04 Akim Demaille <akim@epita.fr>
8385
8386 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
8387 name_ being defined.
8388
8389 2003-02-03 Paul Eggert <eggert@twinsun.com>
8390
8391 * src/gram.h (start_symbol): Remove unused decl.
8392
8393 Use more-consistent naming conventions for local vars.
8394
8395 * src/derives.c (derives_compute): Change type of local var from
8396 int to rule_number.
8397 * src/gram.c (grammar_rules_partial_print): Likewise.
8398 * src/print.c (print_core): Likewise.
8399 * src/reduce.c (reduce_grammar_tables): Likewise.
8400
8401 * src/gram.c (grammar_dump): Change name of item_number *
8402 local var from r to rp.
8403 * src/nullable.c (nullable_compute): Likewise.
8404
8405 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
8406
8407 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
8408 for symbol or symbol_number var.
8409 * src/reader.c (grammar_start_symbol_set): Likewise.
8410 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
8411 Likewise.
8412 * src/state.c (transitions_to): Likewise.
8413 * src/state.h: Likewise.
8414 * src/tables.c (symbol_number_to_vector_number): Likewise.
8415
8416 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
8417 char * var.
8418
8419 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
8420 var.
8421
8422 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
8423 var.
8424
8425 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
8426 Use str, not s, for char * var. Use ch, not c, for character var.
8427 Use size for size var.
8428
8429 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
8430 char * var.
8431 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
8432 uniqstr var.
8433 * src/uniqstr.h: Likewise.
8434
8435 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8436 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8437 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
8438 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
8439 param to have same name as that of enum, so that we don't use
8440 "s" to stand for a non-state.
8441
8442 2003-02-02 Akim Demaille <akim@epita.fr>
8443
8444 * src/scan-skel.l: Scan more than one inert character per yylex
8445 invocation.
8446
8447 2003-02-01 Paul Eggert <eggert@twinsun.com>
8448
8449 Version 1.875a.
8450
8451 * po/LINGUAS: Add ms.
8452
8453 2003-01-30 Akim Demaille <akim@epita.fr>
8454
8455 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
8456
8457 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8458
8459 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
8460 of $1.
8461
8462 Changes in response to error report by S. Eken: GLR mode does not
8463 handle negative $ indices or $ indices in embedded rules correctly.
8464 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
8465
8466 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
8467 (b4_rhs_location): Ditto.
8468 (yyfill): New function to copy from stack tree into array
8469 incrementally.
8470 (yyuserAction): Modify to allow incremental move of semantic values
8471 to rhs array when in GLR mode.
8472 Define YYFILL to use in user-defined actions to fill semantic array
8473 as needed.
8474 Remove dummy use of yystack, as there is now a guaranteed use.
8475 (yydoAction): Modify to allow incremental move of semantic values
8476 to rhs array when in GLR mode.
8477 (yyresolveAction): Ditto.
8478 (yyglrShiftDefer): Update comment.
8479 (yyresolveStates): Use X == NULL for pointers, not !X.
8480 (yyglrReduce): Ditto.
8481 (yydoAction): Ditto
8482
8483 * tests/glr-regr1.at: Rename to ...
8484 * tests/glr-regression.at: Add new regression test for the problems
8485 described above (adapted from S. Eken).
8486 Update copyright notice.
8487 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
8488 * tests/Makefile.am: Ditto.
8489
8490 2003-01-28 Paul Eggert <eggert@twinsun.com>
8491
8492 * data/lalr1.cc: Do not use @output_header_name@ unless
8493 b4_defines_flag is set. This fixes two bugs reported by
8494 Tim Van Holder in
8495 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
8496 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
8497
8498 2003-01-21 Paul Eggert <eggert@twinsun.com>
8499
8500 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
8501 we don't need to worry about yyerrlab1 being reported as an
8502 "unused label" by non-GCC C compilers. The downside is that if
8503 locations are used then a couple of statements are duplicated each
8504 time YYERROR is invoked, but the upside is that the warnings
8505 should vanish.
8506 (yyerrlab1): Move code to YERROR.
8507 (yyerrlab2): Remove. Change uses back to yyerrlab1.
8508 This reverts some of the 2002-12-27 change.
8509
8510 2003-01-17 Paul Eggert <eggert@twinsun.com>
8511
8512 * src/output.c (symbol_printers_output): Fix typo that led
8513 to core dump. Problem reported by Antonio Rus in
8514 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
8515
8516 2003-01-13 Akim Demaille <akim@epita.fr>,
8517 Quoc Peyrot <chojin@lrde.epita.fr>,
8518 Robert Anisko <anisko_r@lrde.epita.fr>
8519
8520 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
8521 when the stacks contain one element, as the loop would otherwise
8522 free the last state, and then use the top state (the one we just
8523 popped). This means that the initial elements will not be freed
8524 explicitly, as is the case in yacc.c; it is not a problem, as
8525 these elements have fake values.
8526
8527 2003-01-11 Paul Eggert <eggert@twinsun.com>
8528
8529 * NEWS: %expect-violations are now just warnings, reverting
8530 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
8531 bootstrapping problem reported by Matthias Klose; see
8532 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
8533 * src/conflicts.c (conflicts_print): Likewise.
8534 * tests/conflicts.at (%expect not enough, %expect too much,
8535 %expect with reduce conflicts): Likewise.
8536 * doc/bison.texinfo (Expect Decl): Document this. Also mention
8537 that the warning is enabled if the number of conflicts changes
8538 (not necessarily increases).
8539
8540 * src/getargs.c (version): Update copyright year.
8541
8542 2003-01-09 Akim Demaille <akim@epita.fr>
8543
8544 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
8545
8546 2003-01-08 Paul Eggert <eggert@twinsun.com>
8547
8548 * Makefile.maint (WGETFLAGS):
8549 New macro, containing "-C off" to disable proxy caches.
8550 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
8551 (rel-check): Use $(WGET) instead of wget.
8552
8553 2003-01-06 Paul Eggert <eggert@twinsun.com>
8554
8555 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
8556 the GLR paper of Scott, Johnstone and Hussain.
8557
8558 2003-01-04 Paul Eggert <eggert@twinsun.com>
8559
8560 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
8561 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
8562 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
8563 (EXTRA_LIBRARIES): New var, for liby.a.
8564 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
8565 (EXTRA_SCRIPTS): New var, for yacc.
8566
8567 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
8568 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
8569 Problem reported by Nelson H. F. Beebe.
8570
8571 2003-01-03 Paul Eggert <eggert@twinsun.com>
8572
8573 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
8574 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8575 when compiling Bison 1.875's `bitset bset = obstack_alloc
8576 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8577
8578 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
8579 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
8580 grow to a huge size with typical invocation.
8581
8582 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
8583 Use the pattern recommended by Autoconf 2.57, except also protect
8584 against double-definition.
8585 * src/system.h: Likewise.
8586 Portability issues reported by Nelson H. F. Beebe.
8587
8588 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
8589 All uses changed. Provide a definition in both C and C++.
8590 (yytrue, yyfalse): Define even if defined (__cplusplus).
8591
8592 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
8593 Reported by Nelson H. F. Beebe.
8594
8595 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
8596
8597 2003-01-02 Paul Eggert <eggert@twinsun.com>
8598
8599 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
8600 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
8601 Bug reported by Nelson H. F. Beebe.
8602
8603 2003-01-01 Paul Eggert <eggert@twinsun.com>
8604
8605 * Version 1.875.
8606
8607 2002-12-30 Paul Eggert <eggert@twinsun.com>
8608
8609 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
8610 Moved here from...
8611 (<INITIAL>","): Here. This causes stray "," to be treated
8612 more uniformly.
8613
8614 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
8615 last brace in braced code when not in Yacc mode, for compatibility
8616 with Bison 1.35. This resurrects the 2001-12-15 patch to
8617 src/reader.c.
8618
8619 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
8620 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
8621
8622 2002-12-28 Paul Eggert <eggert@twinsun.com>
8623
8624 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
8625 that of SYM's type. This fixes Debian bug 168069, reported by
8626 Thomas Olsson.
8627
8628 2002-12-28 Paul Eggert <eggert@twinsun.com>
8629
8630 Version 1.75f.
8631
8632 Switch back to the Yacc style of conflict reports, undoing some
8633 of the 2002-07-30 change.
8634 * doc/bison.texinfo (Understanding): Use Yacc style for
8635 conflict reports. Also, use new way of locating rules.
8636 * src/conflicts.c (conflict_report):
8637 Renamed from conflict_report_yacc, removing the old
8638 'conflict_report'. Translate the entire conflict report at once,
8639 so that we don't assume that "," has the same interpretation in
8640 all languages.
8641 (conflicts_output): Use Yacc-style conflict report for each state,
8642 instead of our more-complicated style.
8643 (conflicts_print): Use Yacc-style conflict report, except print
8644 the input file name when not emulating Yacc.
8645 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
8646 Conflicted Reduction, %expect not enough, %expect too much,
8647 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
8648 * tests/existing.at (GNU Cim Grammar): Likewise.
8649 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
8650
8651 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
8652 fatal): Don't invoke fflush; it's not needed and it might even be
8653 harmful for stdout, as stdout might not be open.
8654 * src/reduce.c (reduce_print): Likewise.
8655
8656 2002-12-27 Paul Eggert <eggert@twinsun.com>
8657
8658 Fix a bug where error locations were not being recorded correctly.
8659 This problem was originally reported by Paul Hilfinger in
8660 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
8661
8662 * data/yacc.c (yyparse): New local var yylerrsp, to record the
8663 top of the location stack's error locations.
8664 (yyerrlab): Set it. When discarding a token, push its location
8665 onto yylerrsp so that we don't lose track of the error's end.
8666 (yyerrlab1): Now is only the target of YYERROR, so that we can
8667 properly record the location of the action that failed. For GCC
8668 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
8669 GCC warning about yyerrlab1 being unused if YYERROR is unused.
8670 (yyerrlab2): New label, which yyerrlab now falls through to.
8671 Compute the error's location by applying YYLLOC_DEFAULT to
8672 the locations of all the symbols that went into the error.
8673 * doc/bison.texinfo (Location Default Action): Mention that
8674 YYLLOC_DEFAULT is also invoked for syntax errors.
8675 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8676 Error locations include the locations of all the tokens that were
8677 discarded, not just the last token.
8678
8679 2002-12-26 Paul Eggert <eggert@twinsun.com>
8680
8681 * src/files.c: Include quote.h.
8682 (compute_output_file_names): Warn if we detect conflicting
8683 outputs to the same file. This should catch the misunderstanding
8684 exemplified by Debian Bug 165349, reported by Bruce Stephens..
8685
8686 * src/conflicts.c (conflicts_print): If the user specifies
8687 "%expect N", report an error if there are any reduce/reduce
8688 conflicts. This is what the manual says should happen.
8689 This fixes Debian bug 130890, reported by Anthony DeRobertis.
8690 * tests/conflicts.at (%expect with reduce conflicts): New test.
8691
8692 Don't use m4_include on relative file names, as it doesn't work as
8693 desired if there happens to be a file with that name under ".".
8694
8695 * m4sugar/version.m4: Remove; it was included but it wasn't used.
8696 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
8697 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
8698 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
8699 * src/output.c (output_skeleton): Use full path names when
8700 specifying a file to include; don't rely on include path, as
8701 it's unreliable when the working file contains a file with
8702 that name.
8703
8704 2002-12-25 Paul Eggert <eggert@twinsun.com>
8705
8706 Remove obsolete references to bison.simple and bison.hairy.
8707 Problem mentioned by Aubin Mahe in
8708 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
8709 * data/glr.c: Comment fix.
8710 * doc/bison.1: Remove references. Also, mention "yacc".
8711
8712 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
8713 with -g option.
8714
8715 * src/parse-gram.y (declaration): Use enum "report_states" rather
8716 than its numeric value 1.
8717
8718 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
8719 opening a new one. This fixes Debian bug 165349, reported by
8720 Bruce Stephens.
8721
8722 2002-12-24 Paul Eggert <eggert@twinsun.com>
8723
8724 Version 1.75e.
8725
8726 * Makefile.maint (cvs-update): Don't assume that the shell
8727 supports $(...), as Solaris sh doesn't.
8728
8729 * src/parse-gram.y (lloc_default): Remove test for empty
8730 nonterminals at the end, since it didn't change the result.
8731
8732 2002-12-24 Paul Eggert <eggert@twinsun.com>
8733
8734 If the user does not define YYSTYPE as a macro, Bison now declares it
8735 using typedef instead of defining it as a macro. POSIX requires this.
8736 For consistency, YYLTYPE is also declared instead of defined.
8737
8738 %union directives can now have a tag before the `{', e.g., the
8739 directive `%union foo {...}' now generates the C code
8740 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
8741 The default union tag is `YYSTYPE', for compatibility with Solaris 9
8742 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
8743 instead of `yyltype'.
8744
8745 `yystype' and `yyltype' are now obsolescent macros instead of being
8746 typedefs or tags; they are no longer documented and will be
8747 withdrawn in a future release.
8748
8749 * data/glr.c (b4_location_type): Remove.
8750 (YYSTYPE): Renamed from yystype.
8751 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
8752 (struct YYLTYPE): Renamed from struct yyltype.
8753 (YYLTYPE): Renamed from yyltype.
8754 (yyltype, yystype): New (and obsolescent) macros,
8755 for backward compatibility.
8756 * data/yacc.c: Likewise.
8757
8758 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
8759 does not specify a union tag. This is for compatibility with
8760 Solaris 9 yacc.
8761
8762 * src/parse-gram.y (add_param): 2nd arg is now char * not char
8763 const *, since it is now modified by stripping surrounding { }.
8764 (current_braced_code): Remove.
8765 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
8766 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
8767 trailing " {...}". Now of type <chars>.
8768 (grammar_declaration): Adjust to bundled tokens.
8769 (code_content): Remove; stripping is now done by add_param.
8770 (print_token_value): Print contents of bundled tokens.
8771 (token_name): New function.
8772
8773 * src/reader.h (braced_code, current_braced_code): Remove.
8774 (token_name): New decl.
8775
8776 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
8777 token_type, not braced_code code_kind. All uses changed.
8778 (SC_PRE_CODE): New state, for scanning after a keyword that
8779 has (or usually has) an immediately-following braced code.
8780 (token_type): New local var, to keep track of which token type
8781 to return when scanning braced code.
8782 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
8783 <INITIAL>"%parse-param", <INITIAL>"%printer",
8784 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
8785 instead of returning a token type immediately.
8786 (<INITIAL>"{"): Set token type.
8787 (<SC_BRACED_CODE>"}"): Use it.
8788 (handle_action_dollar, handle_action_at): Now returns bool
8789 indicating success. Fail if ! current_rule; this prevents a core dump.
8790 (handle_symbol_code_dollar, handle_symbol_code_at):
8791 Remove; merge body into caller.
8792 (handle_dollar, handle_at): Complain in invalid contexts.
8793
8794 * NEWS, doc/bison.texinfo: Document the above.
8795 * NEWS: Fix years and program names in copyright notice.
8796
8797 2002-12-17 Paul Eggert <eggert@twinsun.com>
8798
8799 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
8800 Reporting, Table of Symbols): Omit mentions of %lex-param and
8801 %parse-param from the documentation for now.
8802
8803 2002-12-15 Paul Eggert <eggert@twinsun.com>
8804
8805 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
8806 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
8807 lookahead symbol, and which sets yychar in parser actions) and it
8808 disagreed with the Bison documentation. Bug
8809 reported by Andrew Walrond.
8810
8811 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
8812 as the caller now does that.
8813 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
8814 (YYEMPTY): Parenthesize right hand side, since others use it.
8815 (yyparse): Don't assume that our generated code is the only code
8816 that sets yychar.
8817
8818 2002-12-13 Paul Eggert <eggert@twinsun.com>
8819
8820 Version 1.75d.
8821
8822 POSIX requires a "yacc" command.
8823 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
8824 (MOSTLYCLEANFILES): Add yacc.
8825 (yacc): New rule.
8826 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
8827 as an alias for bison y.
8828
8829 * po/LINGUAS: Add da.
8830
8831 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
8832 problem with latest <getopt.h>.
8833 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
8834
8835 * doc/fdl.texi: Upgrade to 1.2.
8836 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
8837 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
8838 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
8839 gnulib.
8840 * config/install-sh: Sync with autotools.
8841
8842 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
8843 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8844 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
8845 locations are requested.
8846 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
8847 locations are requested.
8848
8849 2002-12-12 Paul Eggert <eggert@twinsun.com>
8850
8851 Remove unportable casts and storage allocation tricks.
8852 While we're at it, remove almost all casts, since they
8853 usually aren't needed and are a sign of trouble.
8854
8855 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
8856
8857 * src/derives.c (derives_compute): Do not subtract NTOKENS from
8858 the pointer DSET returned by malloc; this isn't portable.
8859 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
8860 Similarly for DERIVES.
8861 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
8862 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
8863 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
8864
8865 * src/derives.c (derives_compute): Do not bother invoking
8866 int_of_rule_number, since rule numbers are integers.
8867
8868 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
8869 rather than XMALLOC (char, N).
8870
8871 * src/files.c (filename_split): Rewrite to avoid cast.
8872
8873 * src/gram.h (symbol_number_as_item_number,
8874 item_number_as_symbol_number, rule_number_as_item_number,
8875 item_number_as_rule_number):
8876 Now inline functions rather than macros, to avoid casts.
8877 * src/state.h (state_number_as_int): Likewise.
8878 * src/tables.c (state_number_to_vector_number,
8879 symbol_number_to_vector_number): Likewise.
8880
8881 * src/gram.h (int_of_rule_number): Remove; no longer used.
8882
8883 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
8884 since the resulting storage is always stored into.
8885
8886 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
8887 where it's needed.
8888
8889 * src/muscle_tab.c (muscle_m4_output):
8890 Now inline. Return bool, not int.
8891 * src/state.c (state_compare): Likewise.
8892 * src/symtab.c (symbol_check_defined,
8893 symbol_check_alias_consistency, symbol_pack, symbol_translation,
8894 hash_compare_symbol, hash_symbol):
8895 Likewise.
8896 * src/uniqstr.c (uniqstr_print): Likewise.
8897 * src/muscle_tab.c (muscle_m4_output_processor):
8898 New function, to avoid casts.
8899 * src/state.c (state_comparator, stage_hasher): Likewise.
8900 * src/symtab.c (symbol_check_defined_processor,
8901 symbol_check_alias_consistency_processor, symbol_pack_processor,
8902 symbol_translation_processor, hash_symbol_comparator,
8903 hash_symbol_hasher): Likewise.
8904 * src/uniqstr.c (uniqstr_print_processor): Likewise.
8905 * src/muscle_tab.c (muscles_m4_output):
8906 Use new functions instead of casting old functions unportably.
8907 * src/state.c (state_hash_new): Likewise.
8908 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
8909 symbols_token_translations_init):
8910 Likewise.
8911 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
8912
8913 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
8914 var instead of casting to long, to avoid casts.
8915 (prepare_states): Use MALLOC rather than alloca, so that we don't
8916 have to worry about alloca.
8917 * src/state.c (state_hash_lookup): Likewise.
8918
8919 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
8920 local var instead of casting to unsigned char, to avoid casts.
8921
8922 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
8923 STATE_ALLOC): Remove.
8924 (transitions_new, errs_new, reductions_new, state_new): Use malloc
8925 rather than calloc, and use offsetof to avoid allocating slightly
8926 too much storage.
8927 (state_new): Initialize all members.
8928
8929 * src/state.c (state_hash): Use unsigned accumulator, not signed.
8930
8931 * src/symtab.c (symbol_free): Remove; unused.
8932 (symbol_get): Remove cast in lhs of assignment.
8933 (symbols_do): Now static. Accept generic arguments, not
8934 hashing-related ones.
8935
8936 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
8937 (symbol_processor): Remove.
8938 (symbols_do): Remove decl; now static.
8939
8940 * src/system.h (alloca): Remove; decl no longer needed.
8941 (<stddef.h>): Include, for offsetof.
8942 (<inttypes.>, <stdint.h>): Include if available.
8943 (uintptr_t): New type, if system lacks it.
8944 (CALLOC, MALLOC, REALLOC): New macros.
8945 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
8946 new macros.
8947
8948 * src/tables.c (table_size): Now int, to pacify GCC.
8949 (table_grow, table_ninf_remap): Use signed table size.
8950 (save_row): Don't bother initializing locals when not needed.
8951 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
8952 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
8953
8954 * src/vcg.h: Correct misspellings.
8955
8956 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
8957
8958
8959 * src/getargs.c (getargs): Don't assume EOF == -1.
8960
8961 2002-12-09 Paul Eggert <eggert@twinsun.com>
8962
8963 Change identifier spellings to avoid collisions with names
8964 that are reserved by POSIX.
8965
8966 Don't use names ending in _t, since POSIX reserves them.
8967 For consistency, remove _e and _s endings -- they're weren't
8968 needed to remove ambiguity. All uses changed.
8969 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
8970 turn was just renamed from struniq_t.
8971 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
8972 which in turn was just renamed from struniq_processor_t.
8973 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
8974 in turn was renamed from hash_compare_struniq_t.
8975 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
8976 (state_list): Renamed from state_list_t.
8977 * src/assoc.h (assoc): Renamed from assoc_t.
8978 * src/conflicts.c (enum conflict_resolution): Renamed from
8979 enum conflict_resolution_e.
8980 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
8981 (rule_list): Renamed from rule_list_t.
8982 * src/getargs.h (enum trace): Renamed from enum trace_e.
8983 (enum report): Renamed from enum report_e.
8984 * src/gram.h (item_number): Renamed from item_number_t.
8985 (rule_number): Renamed from rule_number_t.
8986 (struct rule_s): Remove the "rule_s" part; not used.
8987 (rule): Renamed from rule_t.
8988 (rule_filter): Renamed from rule_filter_t.
8989 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
8990 (goto_list): Renamed from goto_list_t.
8991 * src/lalr.h (goto_number): Renamed from goto_number_t.
8992 * src/location.h (location): Renamed from location_t.
8993 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
8994 and moved here from:
8995 * src/muscle_tab.h (muscle_entry_t): here.
8996 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
8997 (rule_list): Renamed from rule_list_t.
8998 * src/print_graph.c (static_graph): Renamed from graph.
8999 * src/reader.h (braced_code): Renamed from braced_code_t.
9000 Remove brace_code_e tag.
9001 * src/relation.h (relation_node): Renamed from relation_node_t.
9002 (relation_nodes): Renamed from relation_nodes_t.
9003 (relation): Renamed from relation_t.
9004 * src/state.h (state_number): Renamed from state_number_t.
9005 (struct state): Renamed from struct state_s.
9006 (state): Renamed from state_t.
9007 (transitions): Renamed from transitions_t. Unused (and
9008 misspelled) transtion_s tag removed.
9009 (errs): Renamed from errs_t. Unused errs_s tag removed.
9010 (reductions): Renamed from reductions_t. Unused tag
9011 reductions_s removed.
9012 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
9013 (struct symbol_list): Renamed from struct symbol_list_s.
9014 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
9015 (struct symbol): Renamed from struct symbol_s.
9016 (symbol): Renamed from symbol_t.
9017 * src/tables.c (vector_number): Renamed from vector_number_t.
9018 (action_number): Renamed from action_t.
9019 * src/tables.h (base_number): Renamed from base_t.
9020 * src/vcg.h (enum color): Renamed from enum color_e.
9021 (enum textmode): Renamed from enum textmode_e.
9022 (enum shape): Renamed from enum shape_e.
9023 (struct colorentry): Renamed from struct colorentry_s.
9024 (struct classname): Renamed from struct classname_s.
9025 (struct infoname): Renamed from struct infoname_s.
9026 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
9027 (enum decision): Renamed from enum decision_e.
9028 (enum orientation): Renamed from enum orientation_e.
9029 (enum alignment): Renamed from enum alignment_e.
9030 (enum arrow_mode): Renamed from enum arrow_mode_e.
9031 (enum crossing_type): Renamed from enum crossing_type_e.
9032 (enum view): Renamed from enum view_e.
9033 (struct node): Renamed from struct node_s.
9034 (node): Renamed from node_t.
9035 (enum linestyle): Renamed from enum linestyle_e.
9036 (enum arrowstyle): Renamed from enum arrowstyle_e.
9037 (struct edge): Renamed from struct edge.
9038 (edge): Renamed from edge_t.
9039 (struct graph): Renamed from struct graph_s.
9040 (graph): Renamed from graph_t.
9041 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
9042 Rename value_t -> value.
9043 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
9044 value_t_as_yystype -> value_as_yystype.
9045
9046 Don't include <errno.h> in the mainstream code, since it
9047 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
9048 * lib/get-errno.c, lib/get-errno.h: New files.
9049 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
9050 get-errno.c.
9051 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
9052 * src/output.c (output_skeleton): Likewise.
9053 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
9054 instead of errno.
9055 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
9056 Likewise.
9057 (handle_action_dollar, handle_action_at): Likewise.
9058 * src/system.h: Do not include <errno.h>.
9059 (TAB_EXT): Renamed from EXT_TAB.
9060 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
9061
9062 Avoid str[a-z]*, since <string.h> reserves that name space.
9063 Change all instances of "struniq" in names to "uniqstr", and
9064 likewise for "STRUNIQ" and "UNIQSTR".
9065 * src/uniqstr.c: Renamed from src/struniq.c.
9066 * src/uniqstr.h: Renamed from src/struniq.h.
9067 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
9068 * src/files.c (strsuffix): Remove; unused.
9069 (concat2): Renamed from stringappend. Now static.
9070 * src/files.h (strsuffix, stringappend): Remove; unused.
9071 * src/parse-gram.y (<chars>): Renamed from <string>.
9072 (<uniqstr>): Renamed from <struniq>.
9073 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
9074 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
9075 (struct graph_s.expand): Renamed from struct graph_s.stretch.
9076 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
9077 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
9078 (N_EXPAND): Renamed from N_STRETCH.
9079
9080 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
9081 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
9082 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
9083 Remove; unused.
9084 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
9085 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
9086 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
9087 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
9088 (BASE_MAXIMUM): Renamed from BASE_MAX.
9089 (BASE_MINIMUM): Renamed from BASE_MIN.
9090 (ACTION_MAX): Remove; unused.
9091 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
9092 Unnecessary casts removed from above defines.
9093
9094
9095 Fix misspelling in names.
9096 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
9097 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
9098 G_NODE_ALIGNEMENT.
9099
9100
9101 * lib/timevar.c (timevar_report): Renamed from time_report,
9102 for consistency with other names.
9103 * lib/timevar.h (timevar_report): New decl.
9104 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
9105
9106
9107 Sort include-file uses.
9108
9109 Reorder all include files under src to be in the order "system.h".
9110 then the ../lib include files in angle brackets (alphabetized),
9111 then the . include files in double-quotes (alphabetized). Fix
9112 dependency breakages encountered in this process, as follows:
9113 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
9114 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
9115 * src/state.h: Include "symtab.h".
9116
9117 2002-12-08 Paul Eggert <eggert@twinsun.com>
9118
9119 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
9120 since this causes problems when __file__ contains character
9121 sequences like "@" that are treated specially by src/scan-skel.l.
9122 Instead, just use the file's basename. This fixes the bug
9123 reported by Martin Mokrejs in
9124 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
9125
9126 2002-12-06 Paul Eggert <eggert@twinsun.com>
9127
9128 Add support for rules that do not have trailing semicolons, as
9129 POSIX requires. Improve the quality of locations in Bison
9130 diagnostics.
9131
9132 * src/location.c: Include <quotearg.h>.
9133 (empty_location): Now const.
9134 (location_print): New function. Follow the recommendation of the
9135 GNU Coding Standards for locations that span file boundaries.
9136 * src/location.h: Do not include <quotearg.h>; no longer needed.
9137 (boundary): New type.
9138 (location_t): Use it. This allows locations to span file boundaries.
9139 All member uses changed: file -> start.file or end.file (as needed),
9140 first_line -> start.line, first_column -> start.column,
9141 last_line -> end.line, last_column -> end.column.
9142 (equal_boundaries): New function.
9143 (LOCATION_RESET, LOCATION_STEP): Remove.
9144 (LOCATION_PRINT): Remove. All callers changed to use location_print.
9145 (empty_location): Now const.
9146 (location_print): New decl.
9147 * src/parse-gram.y (lloc_default): New function, which handles
9148 empty locations more accurately.
9149 (YYLLOC_DEFAULT): Use it.
9150 (%token COLON): Remove.
9151 (%token ID_COLON): New token.
9152 (rules): Use it.
9153 (declarations, rules): Remove trailing semicolon.
9154 (declaration, rules_or_grammar_declaration):
9155 Allow empty (";") declaration.
9156 (symbol_def): Remove empty actions; no longer needed.
9157 (rules_or_grammar_declaration): Remove trailing semicolon.
9158 (semi_colon.opt): Remove.
9159 * src/reader.h: Include location.h.
9160 (scanner_cursor): New decl.
9161 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
9162 rolling our own.
9163 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
9164 of *loc.
9165 (STEP): Remove. No longer needed, now that adjust_location does
9166 the work. All uses removed.
9167 (scanner_cursor): New var.
9168 (adjust_location): Renamed from extend_location. It now sets
9169 *loc and adjusts the scanner cursor. All uses changed.
9170 Don't bother testing for CR.
9171 (handle_syncline): Remove location arg; now updates scanner cursor.
9172 All callers changed.
9173 (unexpected_end_of_file): Now accepts start boundary of token or
9174 comment, not location. All callers changed. Update scanner cursor,
9175 not the location.
9176 (SC_AFTER_IDENTIFIER): New state.
9177 (context_state): Renamed from c_context. All uses changed.
9178 (id_loc, code_start, token_start): New local vars.
9179 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
9180 processing of Yacc white space and equivalents here.
9181 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
9182 instead of returning ID immediately, since we need to search for
9183 a subsequent colon.
9184 (<INITIAL>"'", "\""): Save token_start.
9185 (<INITIAL>"%{", "{", "%%"): Save code_start.
9186 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
9187 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
9188 BEGIN context_state at end, not INITIAL.
9189 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
9190 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
9191 Return correct token start.
9192 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
9193 the start of a character, string or multiline comment is found.
9194 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
9195 Reduction): Adjust reported locations to match the more-precise
9196 results now expected.
9197 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
9198 * tests/reduce.at (Useless Rules, Reduced Automaton,
9199 Underivable Rules): Likewise.
9200 * tests/regression.at (Invalid inputs): No longer `expecting ";"
9201 or "|"' now that so many other tokens are allowed by the new grammar.
9202
9203 * src/complain.h (current_file): Remove duplicate decl;
9204 current_file is now owned by files.h.
9205 * src/complain.c, src/scan-gram.l: Include files.h.
9206
9207 2002-12-06 Paul Eggert <eggert@twinsun.com>
9208
9209 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
9210 promotes to int; it might be unsigned int.
9211 * data/yacc.c (yy_reduce_print): Likewise.
9212
9213 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
9214 be #defined in the prologue, not in the Bison declarations.
9215 This fixes Debian Bug 102878, reported by Shaul Karl.
9216
9217 2002-12-02 Paul Eggert <eggert@twinsun.com>
9218
9219 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
9220 * lib/strtoul.c: New file, from gnulib.
9221 This fixes a porting bug reported by Peter Klein in
9222 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
9223
9224 2002-11-30 Paul Eggert <eggert@twinsun.com>
9225
9226 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
9227 and put only a forward declaration in the prologue. This is for
9228 consistency with the other scanner helper functions.
9229
9230 Type clashes now generate warnings, not errors, since it
9231 appears that POSIX may allow some grammars with type clashes.
9232 * src/reader.c (grammar_current_rule_check): Warn about
9233 type clashes instead of complaining.
9234 * tests/input.at (Type Clashes): Expect warnings, not complaints.
9235
9236 Add Yacc library, since POSIX requires it.
9237 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
9238 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
9239 * lib/main.c, lib/yyerror.c: New files.
9240
9241 gram_error can be static; it need not be extern.
9242 * src/reader.h (gram_error): Remove decl.
9243 * src/parse-gram.y (gram_error): Now static. Add static decl.
9244 (print_token_value): Omit parameter names from forward decl,
9245 for consistency.
9246
9247 2002-11-29 Paul Eggert <eggert@twinsun.com>
9248
9249 * doc/bison.texinfo: Emphasize that yylex and yyerror must
9250 be declared before being used. E.g., one should typically
9251 declare them in the prologue. Use GNU coding style in examples.
9252 Put "const" consistently after the type it modifies. Mention
9253 that C99 supports "inline". Mention that yyerror traditionally
9254 returns "int".
9255
9256 %parse-param and %lex-param now take just one argument, the
9257 declaration; the argument name is deduced from the declaration.
9258
9259 * doc/bison.texinfo (Parser Function, Pure Calling, Error
9260 Reporting, Table of Symbols): Document this.
9261 * src/parse-gram.y (add_param): New function.
9262 (COMMA): Remove.
9263 (declaration): Implement new rule for %parse-param and %lex-param.
9264 * src/scan-gram.l: "," now elicits a warning, rather than being
9265 a token; this is more compatible with byacc.
9266 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
9267
9268 2002-11-27 Paul Eggert <eggert@twinsun.com>
9269
9270 Rename identifiers to avoid real and potential collisions.
9271
9272 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
9273 to avoid collision with lex macro described by Bruce Lilly in
9274 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
9275 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9276 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
9277 * src/parse-gram.y (print_token_value): Renamed from yyprint.
9278 All uses changed.
9279 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
9280 The name "yycontrol" violates the name space rules, and this stuff
9281 wasn't being used anyway.
9282 (input): Remove action; this stuff wasn't being used.
9283 (gram_error): Rename local variable yylloc -> loc.
9284 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
9285 (YY_DECL): Don't use "yy" at start of local variables.
9286 All uses changed, e.g., yylloc -> loc.
9287 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
9288 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
9289 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
9290 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
9291
9292 * src/parse-gram.y (gram_error): loc is now const *.
9293 * src/reader.h (gram_error): Likewise.
9294
9295 2002-11-24 Paul Eggert <eggert@twinsun.com>
9296
9297 Version 1.75c.
9298
9299 * tests/actions.at (Actions after errors): Use an output format
9300 more similar to that of the Printers and Destructors test.
9301 Test the position of the ';' token too.
9302 (Printers and Destructors): Likewise.
9303 (Printers and Destructors: %glr-parser): Remove for now, to avoid
9304 unnecessarily alarming people when the test fails.
9305
9306 * data/yacc.c (yyerrlab1): Move this label down, so that the
9307 parser does not discard the lookahead token if the user code
9308 invokes YYERROR. This change is required for POSIX conformance.
9309
9310 * lib/error.c: Sync with gnulib.
9311
9312 2002-11-22 Paul Eggert <eggert@twinsun.com>
9313
9314 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
9315 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
9316 * lib/xmalloc.c: Likewise.
9317
9318 2002-11-20 Paul Eggert <eggert@twinsun.com>
9319
9320 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
9321
9322 2002-11-20 Paul Eggert <eggert@twinsun.com>
9323
9324 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
9325 should use `if (! x) abort ();' rather than `assert (x);', and
9326 anyway it's one less thing to worry about configuring.
9327
9328 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
9329 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
9330 and replace all instances of assert with abort.
9331 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9332 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
9333
9334 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
9335 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
9336 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
9337 hash_find_entry, hash_rehash, hash_insert): Likewise.
9338 * src/conflicts.c (resolve_sr_conflict): Likewise.
9339 * src/lalr.c (set_goto_map, map_goto): Likewise.
9340 * src/nullable.c (nullable_compute): Likewise.
9341 * src/output.c (prepare_rules, token_definitions_output): Likewise.
9342 * src/reader.c (packgram, reader): Likewise.
9343 * src/state.c (state_new, state_free, state_transitions_set,
9344 state_reduction_find): Likewise.
9345 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
9346 symbol_pack): Likewise.
9347 * src/tables.c (conflict_row, pack_vector): Likewise.
9348 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9349 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9350 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
9351 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
9352
9353 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
9354 (ARGMATCH_CONSTRAINT): New macro.
9355 (ARGMATCH_ASSERT): Use it.
9356
9357 * src/system.h (verify): New macro.
9358 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
9359 rather than assert.
9360 * src/tables.c (tables_generate): Likewise.
9361
9362 * src/struniq.c (struniq_assert): Now returns void, and aborts
9363 if the assertion is false.
9364 (struniq_assert_p): Remove.
9365 * src/struniq.h: Likewise.
9366
9367 2002-11-18 Paul Eggert <eggert@twinsun.com>
9368
9369 * data/glr.c (yygetLRActions): Replace `yyindex' with
9370 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
9371 This fixes the regression with Sun ONE Studio 7 cc that I reported in
9372 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
9373
9374 2002-11-18 Akim Demaille <akim@epita.fr>
9375
9376 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
9377 space.
9378 From Tim Van Holder.
9379
9380 2002-11-17 Paul Eggert <eggert@twinsun.com>
9381
9382 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
9383 to "SyntaxError" for consistency with my 2002-11-15 change.
9384
9385 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
9386 not define to {}, since this breaks the common use of `YYDPRINTF
9387 ((...));' if a single statement is desired (e.g. before `else').
9388 Work around GCC warnings by surrounding corresponding calls with
9389 {} if needed.
9390 (yyhasResolvedValue): Remove unused function.
9391 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
9392 loop body.
9393 (yyreportSyntaxError): Renamed from yyreportParseError.
9394 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
9395 All uses changed.
9396 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
9397 extern when possible. Remove unused initializations.
9398
9399 2002-11-16 Akim Demaille <akim@epita.fr>
9400
9401 Augment the similarity between GLR and LALR traces.
9402
9403 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
9404 (YY_REDUCE_PRINT): New.
9405 (yyparse): Use them.
9406 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
9407 YYDPRINT here.
9408 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
9409 state reached after the reduction/recovery, since...
9410 (yyparse, yyprocessOneStack): Report the state we are entering in.
9411
9412 2002-11-16 Akim Demaille <akim@epita.fr>
9413
9414 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
9415 Add support for --trace=skeleton.
9416 * src/scan-skel.l: %option debug.
9417 Scan strings of non-@ or \n instead of character by character.
9418 (scan_skel): Handle trace_skeleton.
9419 (QPUTS): New.
9420 (@output_parser_name@, @output_header_name@): ``Restore'' their
9421 support (used to be M4 macros).
9422 * data/yacc.c: Quote larger chunks, a la glr.c.
9423 * data/lalr1.cc: Likewise.
9424 The header guards are no longer available, so use some other
9425 string than `YYLSP_NEEDED'.
9426
9427 2002-11-16 Akim Demaille <akim@epita.fr>
9428
9429 Make the ``Printers and Destructors'' test more verbose, taking
9430 `yacc.c''s behavior as (possibly wrong) reference.
9431
9432 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
9433 instead of fprint on stdout.
9434 Set and report the last_line of the symbols.
9435 Consistently display values and locations.
9436
9437 2002-11-16 Paul Eggert <eggert@twinsun.com>
9438
9439 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
9440
9441 2002-11-15 Paul Eggert <eggert@twinsun.com>
9442
9443 * tests/actions.at (Actions after errors): New test case.
9444
9445 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
9446 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
9447 tests/action.at, tests/calc.at, tests/conflicts.at,
9448 tests/cxx-type.at, tests/regression.at:
9449 "parse error" -> "syntax error" for POSIX compatibility.
9450 "parsing stack overflow..." -> "parser stack overflow" so
9451 that code matches Bison documentation.
9452
9453 2002-11-15 Akim Demaille <akim@epita.fr>
9454
9455 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
9456 take two BRACED_CODE, not two string_content.
9457 Free the scanner's obstack when we are done.
9458 (code_content): New.
9459 * tests/calc.at: Adjust.
9460 * doc/bison.texinfo: Adjust.
9461 Also, make sure to include the `,' for these declarations.
9462
9463 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
9464
9465 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
9466 definition; avoids potential autoreconf problems.
9467
9468 2002-11-15 Akim Demaille <akim@epita.fr>
9469
9470 Always check the value returned by yyparse.
9471
9472 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
9473 returned by yyparse.
9474 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
9475 Adjust calls.
9476 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
9477 returned by yyparse.
9478
9479 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9480
9481 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
9482 on input.at test.
9483
9484 2002-11-14 Paul Eggert <eggert@twinsun.com>
9485
9486 * src/output.c (output_skeleton): Call xfopen instead of
9487 duplicating xfopen's body.
9488
9489 Fix bugs reported by Nelson H. F. Beebe in
9490 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
9491
9492 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
9493 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
9494 Group compiler. Instead, use "$CC -E bar.c". Include the .h
9495 file twice in the grammar, as an extra check.
9496
9497 * tests/input.at (Torturing the Scanner): Surround the
9498 backslash-newline tests with "#if 0", to make it less likely that
9499 we'll run into compiler bugs. Bring back solitary \ inside
9500 comment, but add a closing comment to work around HP C bug. Don't
9501 test backslash-newline in C character constant.
9502
9503 2002-11-14 Akim Demaille <akim@epita.fr>
9504
9505 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
9506 status of the compiler.
9507 Calling `exit 1' is no longer needed.
9508 Reported by Nelson H. F. Beebe.
9509
9510 2002-11-14 Akim Demaille <akim@epita.fr>
9511
9512 * tests/atlocal.in (CPPFLAGS): We have config.h.
9513 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
9514 New.
9515 * tests/actions.at, tests/calc.at, tests/conflicts.at,
9516 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
9517 * tests/regression.at, tests/torture.at: Use them for all the
9518 grammars that are to be compiled.
9519 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
9520 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
9521 * doc/bison.texinfo (GLR Parsers): Document `inline'.
9522
9523 2002-11-14 Akim Demaille <akim@epita.fr>
9524
9525 * doc/bison.texinfo: Various formatting changes (alignments in
9526 samples, additional @group/@end group, GCS in samples.
9527 Use @deffn instead of simple @table to define the directives,
9528 macros, variables etc.
9529
9530 2002-11-13 Paul Eggert <eggert@twinsun.com>
9531
9532 Fix some bugs reported by Albert Chin-A-Young in
9533 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
9534
9535 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
9536 -o c"; the HP C compiler chatters during compilation.
9537 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
9538 * tests/headers.at (export YYLTYPE): Likewise.
9539
9540 * tests/input.at (Torturing the Scanner): Remove lines containing
9541 solitary backslashes, as they tickle a bug in the HP C compiler.
9542
9543 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
9544 comments, since they're not portable. Use GNU coding style.
9545
9546 2002-11-13 Akim Demaille <akim@epita.fr>
9547
9548 * data/yacc.c: Leave bigger chunks of quoted text.
9549 (YYDSYMPRINTF): New.
9550 Use it to report symbol activities.
9551 * data/glr.c (YYDSYMPRINTF): New.
9552 Use it.
9553
9554 2002-11-12 Paul Eggert <eggert@twinsun.com>
9555
9556 Version 1.75b.
9557
9558 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
9559 (yyglrReduce): Return yyok, not 0.
9560 This should avoid the enumerated-type warnings reported
9561 by Nelson H. F. Beebe in
9562 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
9563
9564 * lib/bbitset.h (BITSET_INLINE): Remove.
9565 * lib/bitset.h [! BITSET_INLINE]: Remove.
9566 (bitset_set, bitset_reset, bitset_test): Rename local vars
9567 to avoid shadowing warnings by GCC.
9568
9569 * data/glr.c (inline): Remove #define. It's the user's
9570 responsibility to #define it away, just like 'const'.
9571 This fixes one of the bugs reported by Nelson H. F. Beebe in
9572 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
9573
9574 * Makefile.maint (po-check): Scan .l and .y files instead of the
9575 .c and the .h files that they generate. This fixes the bug
9576 reported by Tim Van Holder in:
9577 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
9578 Look for N_ as well as for _. Try to avoid matching #define for
9579 N_ and _.
9580 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
9581 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
9582 * src/scan-gram.l: Revamp regular expressions so that " and '
9583 do not confuse xgettext.
9584
9585 * src/struniq.h (struniq_new): Do not declare the return type
9586 to be 'const'; this violates the C standard.
9587 * src/struniq.c (struniq_new): Likewise.
9588
9589 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
9590
9591 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
9592 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
9593 linker.
9594
9595 2002-11-12 Akim Demaille <akim@epita.fr>
9596
9597 * Makefile.maint: Sync with Autoconf:
9598 (local_updates): New.
9599
9600 2002-11-12 Akim Demaille <akim@epita.fr>
9601
9602 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
9603
9604 2002-11-12 Akim Demaille <akim@epita.fr>
9605
9606 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
9607 locations.
9608
9609 2002-11-12 Akim Demaille <akim@epita.fr>
9610
9611 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
9612 not yyvalue.
9613
9614 2002-11-12 Akim Demaille <akim@epita.fr>
9615
9616 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
9617 Use it to test the GLR parser.
9618
9619 2002-11-12 Akim Demaille <akim@epita.fr>
9620
9621 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
9622 defines it.
9623 * data/glr.c (yystos): New.
9624 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
9625 (YYDSYMPRINT): New.
9626 (yyval): Don't define it, it is handled via M4.
9627 (yyrecoverParseError): Free verbosely the discarded symbols.
9628 * data/yacc.c (yysymprint): Remove, rather...
9629 (b4_yysymprint_generate): invoke.
9630 * data/c.m4 (b4_yysymprint_generate): New.
9631 Accept pointers as arguments, as opposed to the version from
9632 yacc.c.
9633 (b4_yydestruct_generate): Likewise.
9634 * tests/cations.at (Printers and Destructors): Use Bison directives
9635 instead of CPP macros.
9636 Don't rely on internal details.
9637
9638 2002-11-12 Akim Demaille <akim@epita.fr>
9639
9640 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
9641 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
9642 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
9643 it against YYEMPTY and so forth), work on yytoken (i.e., set
9644 it to YYEMPTY etc.).
9645 (yydestruct): Replace with a b4_yydestruct_generate invocation.
9646 (b4_symbol_actions): Remove.
9647 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
9648 for 0, end-of-input.
9649
9650 2002-11-12 Akim Demaille <akim@epita.fr>
9651
9652 * doc/bison.texinfo (Destructor Decl): New.
9653
9654 2002-11-12 Akim Demaille <akim@epita.fr>
9655
9656 * src/tables.c (tables_generate): Use free for pointers that
9657 cannot be NULL, not XFREE.
9658 (pack_vector): Use assert, not fatal, for bound violations.
9659 * src/state.c (state_new): Likewise.
9660 * src/reader.c (reader): Likewise.
9661 * src/lalr.c (set_goto_map): Likewise.
9662 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
9663 the file name.
9664
9665 2002-11-12 Akim Demaille <akim@epita.fr>
9666
9667 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
9668 Restore.
9669 * src/scan-gram.l (last_string): Is global to the file, not to
9670 yylex.
9671 * src/parse-gram.y (input): Don't append the epilogue here,
9672 (epilogue.opt): do it here, and free the scanner's obstack.
9673 * src/reader.c (epilogue_set): Rename as...
9674 (epilogue_augment): this.
9675 * data/c.m4 (b4_epilogue): Defaults to empty.
9676
9677 2002-11-12 Akim Demaille <akim@epita.fr>
9678
9679 * src/getargs.c (long_options): Remove duplicates.
9680 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
9681 Remove.
9682 * doc/bison.rnh: Remove.
9683 * doc/bison.texinfo (VMS Invocation): Remove.
9684
9685 2002-11-12 Akim Demaille <akim@epita.fr>
9686
9687 * src/struniq.h, src/struniq.c (struniq_t): Is const.
9688 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
9689
9690 Use struniq for symbols.
9691
9692 * src/symtab.h (symbol_t): The tag member is a struniq.
9693 (symbol_type_set): Adjust.
9694 * src/symtab.c (symbol_new): Takes a struniq.
9695 (symbol_free): Don't free the tag member.
9696 (hash_compare_symbol_t, hash_symbol_t): Rename as...
9697 (hash_compare_symbol, hash_symbol): these.
9698 Use the fact that tags as struniqs.
9699 (symbol_get): Use struniq_new.
9700 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
9701 Returns a strniq.
9702 * src/reader.h (merger_list, grammar_currentmerge_set): The name
9703 and type members are struniqs.
9704 * src/reader.c (get_merge_function)
9705 (grammar_current_rule_merge_set): Adjust.
9706 (TYPE, current_type): Are struniq.
9707
9708 Use struniq for file names.
9709
9710 * src/files.h, src/files.c (infile): Split into...
9711 (grammar_file, current_file): these.
9712 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
9713 * src/reduce.c (reduce_print): Likewise.
9714 * src/getargs.c (getargs): Likewise.
9715 * src/complain.h, src/complain.c: Likewise.
9716 * src/main.c (main): Call struniqs_new early enough to use it for
9717 file names.
9718 Don't free the input file name.
9719
9720 2002-11-12 Akim Demaille <akim@epita.fr>
9721
9722 * src/symtab.c (symbol_free): Remove dead deactivated code:
9723 type_name are properly removed.
9724 Don't use XFREE to free items that cannot be NULL.
9725 * src/struniq.h, src/struniq.c: New.
9726 * src/main.c (main): Initialize/free struniqs.
9727 * src/parse-gram.y (%union): Add astruniq member.
9728 (yyprint): Adjust.
9729 * src/scan-gram.l (<{tag}>): Return a struniq.
9730 Free the obstack bit that used to store it.
9731 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
9732
9733 2002-11-11 Paul Eggert <eggert@twinsun.com>
9734
9735 Revamp to fix many (but not all) of the C- and M4-related quoting
9736 problems. Among other things, this fixes the Bison bug reported
9737 by Jan Hubicka when processing the Bash grammar; see:
9738 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
9739
9740 Use new @ escapes consistently. Represent brackets with @{ and @}
9741 rather than @<:@ and @:>@, since this works a bit better with dumb
9742 editors like vi. Represent @ with @@, since @ is now consistently
9743 an escape. Use @oline@ and @ofile@ rather than __oline__ and
9744 __ofile__, to avoid unexpected expansions. Similarly, use @output
9745 rather than #output.
9746
9747 * data/c.m4 (b4_copyright): Omit file name from comment, since
9748 the file name could contain "*/".
9749 (b4_synclines_flag): Don't quote the 2nd argument; it should already
9750 be quoted. All uses changed.
9751
9752 * data/glr.c: Use new @ escapes consistently.
9753 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
9754 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
9755 Remove, since they couldn't handle arbitrary characters in file
9756 names.
9757 * data/lalr1.cc: Likewise.
9758 * data/yacc.c: Likewise.
9759
9760 * src/files.c (output_infix): Remove; all uses removed.
9761 * src/files.h: Likewise.
9762
9763 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
9764 mishandled funny characters in file names, and anyway it isn't
9765 needed any more.
9766 * data/yacc.c: Likewise.
9767 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
9768
9769 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
9770 * data/yacc.c: Likewise.
9771
9772 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
9773 strings now.
9774 (muscle_init): Quote filename as a C string.
9775 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
9776 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
9777 * src/output.c (escaped_file_name_output): New function.
9778 (prepare_symbols): Quote tokens for M4.
9779 (prepare): Don't insert output_infix, output_prefix,
9780 output_parser_name, output_header_name; this is now down by scan-skel.
9781 Insert skeleton as a C string.
9782
9783 * src/output.c (user_actions_output, symbol_destructors_output,
9784 symbol_printers_output): Quote filenames for C and M4.
9785 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9786
9787 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
9788 escapes other than \\ and \'; this simplifies the code.
9789 (<SC_STRING>): Likewise, for \\ and \".
9790 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
9791 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
9792 Use new escapes @{ and @} for [ and ].
9793
9794 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
9795 them with auto vars.
9796 Switch to new escape scheme, where @ is the escape character uniformly.
9797 Abort if a stray escape character is found. Avoid unbounded input
9798 buffer when parsing non-escaped text.
9799
9800 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
9801 __oline__, #output, $@, and @{ do not have unintended meanings.
9802
9803 2002-11-09 Paul Eggert <eggert@twinsun.com>
9804
9805 Fix the test failure due to GCC warnings described in
9806 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
9807 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
9808 evaluate to 0 if it's impossible for NINF to be in the respective
9809 table.
9810 (yygetLRActions, yyrecoverParseError): Use them.
9811
9812 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
9813 counted in the token inserted at end of file. Now takes
9814 location_t *, not location_t, so that the location can be
9815 adjusted. All uses changed.
9816
9817 * tests/regression.at (Invalid inputs): Adjust wording in
9818 diagnostic to match the new behavior.
9819
9820 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
9821 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
9822 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
9823 abort ();'. This reduces the runtime of the "Many lookaheads"
9824 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
9825 GCC 3.2.
9826
9827 2002-11-07 Paul Eggert <eggert@twinsun.com>
9828
9829 * src/parse-gram.y (CHARACTER): Remove unused token.
9830 All uses removed.
9831
9832 * src/scan-gram.l: Remove stack option. We no longer use the
9833 stack, since the stack was never deeper than 1; instead, use the
9834 new auto var c_context to record the stacked value.
9835
9836 Remove nounput option. At an unexpected end of file, we now unput
9837 the minimal input necessary to end cleanly; this simplifies the
9838 code.
9839
9840 Avoid unbounded token sizes where this is easy.
9841
9842 (unexpected_end_of_file): New function.
9843 Use it to systematize the error message on unexpected EOF.
9844 (last-string): Now auto, not static.
9845 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
9846 (scanner_last_string_free): Remove; not used.
9847 (percent_percent_count): Move decl to just before use.
9848 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
9849 not the (never otherwised-used) CHARACTER.
9850
9851 2002-11-07 Akim Demaille <akim@epita.fr>
9852
9853 Let yyerror always receive the msg as last argument, so that
9854 yyerror can be variadic.
9855
9856 * data/yacc.c (b4_yyerror_args): New.
9857 Use it when calling yyerror.
9858 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
9859 Use it when calling yyerror.
9860 * doc/bison.texinfo (Error Reporting): Adjust.
9861 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
9862 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
9863
9864 2002-11-06 Akim Demaille <akim@epita.fr>
9865
9866 #line should have quoted strings.
9867 Ideally, this should be done by m4_quotearg.
9868
9869 * src/scan-skel.l: Include quotearg.h.
9870 Quote __ofile__.
9871 * src/output.c (symbol_printers_output)
9872 (symbol_destructors_output): Quote the file name.
9873
9874 2002-11-06 Akim Demaille <akim@epita.fr>
9875
9876 * tests/regression.at (Invalid inputs): Adjust to the recent
9877 messages.
9878
9879 2002-11-06 Akim Demaille <akim@epita.fr>
9880
9881 Restore --no-lines.
9882 Reported by Jim Kent.
9883
9884 * data/c.m4 (b4_syncline): New.
9885 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
9886 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
9887 * src/output.c (user_actions_output): Likewise.
9888 (prepare): Define 'b4_synclines_flag'.
9889 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
9890
9891 2002-11-06 Akim Demaille <akim@epita.fr>
9892
9893 * src/main.c (main): Free `infile'.
9894 * src/scan-gram.l (handle_syncline): New.
9895 Recognize `#line'.
9896 * src/output.c (user_actions_output, symbol_destructors_output)
9897 (symbol_printers_output): Use the location's file name, not
9898 infile.
9899 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9900
9901 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9902
9903 * src/tables.c (matching_state): Don't allow states to match if
9904 either has GLR conflict entries.
9905
9906 2002-11-05 Paul Eggert <eggert@twinsun.com>
9907
9908 * src/scan-gram.l: Use more accurate diagnostics, e.g.
9909 "integer out of range" rather than "invalid value".
9910 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
9911 accordingly.
9912
9913 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
9914 Also, remove one static variable in the scanner.
9915
9916 * src/scan-gram.l (braces_level): Now auto, not static.
9917 Initialize to zero if the compiler is being picky.
9918 (INITIAL): Clear braces_level instead of incrementing it.
9919 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
9920 as POSIX 1003.1-2001 requires.
9921 * src/system.h (IF_LINT): New macro, taken from coreutils.
9922 * configure.ac: Define "lint" if --enable-gcc-warnings.
9923
9924 2002-11-05 Akim Demaille <akim@epita.fr>
9925
9926 * src/scan-gram.l: When it starts with `%', complain about the
9927 whole directive, not just that `invalid character: %'.
9928
9929 2002-11-04 Akim Demaille <akim@epita.fr>
9930
9931 * Makefile.maint: Update from Autoconf.
9932 (update, cvs-update, po-update, do-po-update): New.
9933
9934 2002-11-04 Akim Demaille <akim@epita.fr>
9935
9936 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
9937 and yyerror.
9938 Have yyerror `use' its arguments.
9939 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
9940 returns true when location & yacc & pure & parse-param.
9941 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
9942
9943 2002-11-04 Akim Demaille <akim@epita.fr>
9944
9945 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
9946 clashes.
9947 * src/scan-gram.l: Use [\'] instead of ['] to pacify
9948 font-lock-mode.
9949 Use complain_at.
9950 Use quote, not quote_n since LOCATION_PRINT no longer uses the
9951 slot 0.
9952
9953 2002-11-03 Paul Eggert <eggert@twinsun.com>
9954
9955 * src/reader.c (get_merge_function, grammar_current_rule_check):
9956 Use consistent diagnostics for reporting type name clashes.
9957 Quote the types with <>, for consistency with Yacc.
9958 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
9959
9960 2002-11-03 Akim Demaille <akim@epita.fr>
9961
9962 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
9963 New.
9964 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
9965 (b4_parse_param): Remove.
9966 Use b4_identification.
9967 Propagate b4_pure_args where needed to pass them to yyerror.
9968 * data/glr.m4 (b4_parse_param): Remove.
9969 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
9970 (b4_lpure_formals): New.
9971 Use b4_identification.
9972 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
9973 b4_user_formals and b4_user_args.
9974 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
9975 (yyreportAmbiguity): When using a pure parser, also need
9976 the location, and the parse-params.
9977 Adjust callers.
9978 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
9979 When using a pure parser, also need the parse-params.
9980 Adjust callers.
9981 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
9982 (%pure-parser + %parse-param) LALR and GLR parsers.
9983 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
9984 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
9985 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
9986 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
9987 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
9988 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
9989 * doc/bison.texinfo: Untabify the whole file.
9990 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
9991 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
9992 (Error Reporting): Adjust to these new directives.
9993 Document %error-verbose, deprecate YYERROR_VERBOSE.
9994
9995 2002-11-03 Akim Demaille <akim@epita.fr>
9996
9997 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
9998 AT_CHECK_CALC_GLR invocations to use % directives, instead of
9999 command line options.
10000 * tests/cxx-type.at: Formatting changes.
10001
10002 2002-11-03 Paul Eggert <eggert@twinsun.com>
10003
10004 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
10005 to count columns correctly, and to check for invalid inputs.
10006
10007 Use mbsnwidth to count columns correctly. Account for tabs, too.
10008 Include mbswidth.h.
10009 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
10010 (extend_location): New function.
10011 (YY_LINES): Remove.
10012
10013 Handle CRLF in C code rather than in Lex code.
10014 (YY_INPUT): New macro.
10015 (no_cr_read): New function.
10016
10017 Scan UCNs, even though we don't fully handle them yet.
10018 (convert_ucn_to_byte): New function.
10019
10020 Handle backslash-newline correctly in C code.
10021 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
10022 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
10023 all uses changed.
10024 (tag, splice): New EREs. Do not allow NUL or newline in tags.
10025 Use {splice} wherever C allows backslash-newline.
10026 YY_STEP after space, newline, vertical-tab.
10027 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
10028
10029 (letter, id): Don't assume ASCII; e.g., spell out a-z.
10030
10031 ({int}, handle_action_dollar, handle_action_at): Check for integer
10032 overflow.
10033
10034 (YY_STEP): Omit trailing semicolon, so that it's more like C.
10035
10036 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
10037 as well as \000. Check for UCHAR_MAX, not 255.
10038 Allow \x with an arbitrary positive number of digits, as in C.
10039 Check for overflow here.
10040 Allow \? and UCNs, for compatibility with C.
10041
10042 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
10043 with quote slot used by complain_at.
10044
10045 * tests/input.at: Add tests for backslash-newline, m4 quotes
10046 in symbols, long literals, and funny escapes in strings.
10047
10048 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
10049 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
10050 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
10051 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
10052 * m4/mbswidth.m4: New file, from GNU coreutils.
10053
10054 * doc/bison.texinfo (Grammar Outline): Document // comments.
10055 (Symbols): Document that trigraphs have no special meaning in Bison,
10056 nor is backslash-newline allowed.
10057 (Actions): Document that trigraphs have no special meaning.
10058
10059 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
10060 no longer used.
10061
10062 2002-11-02 Paul Eggert <eggert@twinsun.com>
10063
10064 * src/reader.c: Don't include quote.h; not needed.
10065 (get_merge_function): Reword warning to be consistent with
10066 type clash diagnostic in grammar_current_rule_check.
10067
10068 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
10069 bug in trigraph handling.
10070
10071 * src/output.c (prepare_symbols): When printing token names,
10072 escape "[" as "@<:@" and likewise for "]".
10073
10074 * src/system.h (errno): Remove declaration, as we are now
10075 assuming C89 or better, and C89 guarantees errno.
10076
10077 2002-10-30 Paul Eggert <eggert@twinsun.com>
10078
10079 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
10080 Check for close failures.
10081 * src/files.h (xfclose): Return void, not int, since it always
10082 returned zero.
10083 * src/files.c (xfclose): Likewise. Report I/O error if ferror
10084 indicates one.
10085 * src/output.c (output_skeleton): Use xfclose rather than fclose
10086 and ferror. xfclose now checks ferror.
10087
10088 * data/glr.c (YYLEFTMOST_STATE): Remove.
10089 (yyreportTree): Use a stack-based leftmost state. This avoids
10090 our continuing battles with bogus warnings about initializers.
10091
10092 2002-10-30 Akim Demaille <akim@epita.fr>
10093
10094 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
10095 #if.
10096
10097 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10098
10099 * tests/glr-regr1.at: New test for reported regressions.
10100 * tests/testsuite.at: Add glr-regr1.at test.
10101 * tests/Makefile.am: Add glr-regr1.at test.
10102
10103 2002-10-24 Paul Eggert <eggert@twinsun.com>
10104
10105 Version 1.75a.
10106
10107 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
10108 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
10109 we use malloc. Don't assume 'A' through 'Z' are contiguous.
10110 Don't assume strdup exists; POSIX says its an XSI extension.
10111 Check for buffer overflow on input.
10112
10113 2002-10-24 Akim Demaille <akim@epita.fr>
10114
10115 * src/output.c (output_skeleton): Don't disable M4sugar comments
10116 too soon: it results in comments being expanded.
10117 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
10118 first output.
10119
10120 2002-10-24 Akim Demaille <akim@epita.fr>
10121
10122 * data/yacc.c (m4_int_type): New.
10123 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
10124 char' as only yacc.c wants K&R portability.
10125 * data/glr.c (yysigned_char): Remove.
10126 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
10127 Reported by Quoc Peyrot.
10128
10129 2002-10-23 Paul Eggert <eggert@twinsun.com>
10130
10131 * src/main.c (main): With --trace=time, report times even if a
10132 non-fatal error occurs. Formerly, the times were reported in some
10133 such cases but not in others.
10134 * src/reader.c (reader): Just return if a complaint has been issued,
10135 instead of exiting, so that 'main' can report times.
10136
10137 2002-10-22 Akim Demaille <akim@epita.fr>
10138
10139 * src/system.h: Include sys/types.
10140 Reported by Bert Deknuydt.
10141
10142 2002-10-23 Paul Eggert <eggert@twinsun.com>
10143
10144 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
10145 Suggested by Art Haas.
10146
10147 2002-10-22 Paul Eggert <eggert@twinsun.com>
10148
10149 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
10150 decl; not needed any more.
10151 * src/main.c (main): Use return to exit, undoing yesterday's change.
10152 The last OS that we could find where this wouldn't work is
10153 SunOS 3.5, and that's too old to worry about now.
10154
10155 * data/glr.c (struct yyltype): Define members even when not
10156 doing locations. This is more consistent with yacc.c, and it
10157 works around the following bug reports:
10158 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
10159 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
10160
10161 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
10162 @acronym consistently. Standardize on "Yacc" instead of "YACC",
10163 "Algol" instead of "ALGOL". Give a bit more history about BNF.
10164
10165 2002-10-22 Akim Demaille <akim@epita.fr>
10166
10167 * data/README: New.
10168
10169 2002-10-21 Paul Eggert <eggert@twinsun.com>
10170
10171 Be consistent about 'bool'; the old code used an enum in one
10172 module and an int in another, and this violates the C standard.
10173 * m4/stdbool.m4: New file, from coreutils 4.5.3.
10174 * configure.ac (AC_HEADER_STDBOOL): Add.
10175 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
10176 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
10177 * src/symtab.c (hash_compare_symbol_t): Likewise.
10178 * src/system.h (bool, false, true): Use a definition consistent
10179 with ../lib/hash.c. All uses changed.
10180
10181 * src/complain.c (warning_issued): Renamed from warn_message_count,
10182 so that we needn't worry about integer overflow (!).
10183 Now of type bool. All uses changed.
10184 (complaint_issued): Renamed from complain_message_count; likewise.
10185
10186 * src/main.c (main): Use exit to exit with failure.
10187
10188 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
10189 rather than 1 and 0.
10190 * src/main.c (main): Likewise.
10191 * src/getargs.c (getargs): Likewise.
10192 * src/reader.c (reader): Likewise.
10193
10194 * src/getarg.c (getargs): Remove duplicate code for
10195 "Try `bison --help'".
10196
10197 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
10198 What was that "2" for?
10199
10200 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
10201 * src/getargs.c (usage): Likewise.
10202
10203 * src/getargs.c (getargs): When there are too few operands, report
10204 the last one. When there are too many, report the first extra
10205 one. This is how diffutils does it.
10206
10207 2002-10-20 Paul Eggert <eggert@twinsun.com>
10208
10209 Remove K&R vestiges.
10210 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
10211 * src/complain.c (VA_START): Remove. Assume prototypes.
10212 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
10213 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
10214 fatal): Assume prototypes.
10215 * src/complain.h: Assume prototypes.
10216 * src/system.h (PARAMS): Remove.
10217 Include <limits.h> unconditionally, since it's guaranteeed even
10218 for a freestanding C89 compiler.
10219 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
10220 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
10221
10222 2002-10-20 Akim Demaille <akim@epita.fr>
10223
10224 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
10225 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
10226 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
10227 (yyresolveStates, yyresolveAction, yyresolveStack)
10228 (yyprocessOneStack): Use them.
10229 (yy_reduce_print): New.
10230 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
10231
10232 2002-10-20 Akim Demaille <akim@epita.fr>
10233
10234 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
10235 arguments and output `void'.
10236 (b4_c_function): Rename as...
10237 (b4_c_function_def): this.
10238 (b4_c_function_decl, b4_c_ansi_function_def)
10239 (b4_c_ansi_function_decl): New.
10240 Change the interpretation of the arguments: before `int, foo', now
10241 `int foo, foo'.
10242 * data/yacc.c (yyparse): Prototype and define thanks to these.
10243 Adjust b4_c_function_def uses.
10244 * data/glr.c (yyparse): Likewise, but ANSI only.
10245
10246 2002-10-20 Akim Demaille <akim@epita.fr>
10247
10248 * src/output.c (prepare): Move the definition of `tokens_number',
10249 `nterms_number', `undef_token_number', `user_token_number_max'
10250 to...
10251 (prepare_tokens): Here.
10252 (prepare_tokens): Rename as...
10253 (prepare_symbols): this.
10254 (prepare): Move the definition of `rules_number' to...
10255 (prepare_rules): here.
10256 (prepare): Move the definition of `last', `final_state_number',
10257 `states_number' to...
10258 (prepare_states): here.
10259 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
10260
10261 2002-10-20 Akim Demaille <akim@epita.fr>
10262
10263 * src/tables.h, src/tables.c, src/output.c: Comment changes.
10264
10265 2002-10-20 Akim Demaille <akim@epita.fr>
10266
10267 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
10268 * data/c.m4: here.
10269
10270 2002-10-20 Akim Demaille <akim@epita.fr>
10271
10272 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
10273 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
10274 `pair'.
10275 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
10276 `name' to...
10277 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
10278 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
10279 These.
10280
10281 2002-10-19 Paul Eggert <eggert@twinsun.com>
10282
10283 Do not create a temporary file, as that involves security and
10284 cleanup headaches. Instead, use a pair of pipes.
10285 Derived from a suggestion by Florian Krohm.
10286 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
10287 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
10288 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
10289 (BISON_PREREQ_SUBPIPE): Add.
10290 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
10291 Add subpipe.h, subpipe.c.
10292 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
10293 * po/POTFILES.in: Add lib/subpipe.c.
10294 * src/output.c: Include "subpipe.h".
10295 (m4_invoke): Remove decl.
10296 (scan_skel): New decl.
10297 (output_skeleton): Use pipe rather than temporary file for m4 input.
10298 Check that m4sugar.m4 is readable, to avoid deadlock.
10299 Check for pipe I/O error.
10300 * src/scan-skel.l (readpipe): Remove decl.
10301 (scan_skel): New function, to be used in place of m4_invoke.
10302 Read from stream rather than file.
10303
10304 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
10305 float, as this generates a warning on Solaris 8 + GCC 3.2 with
10306 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
10307 this generates a more-accurate value anyway.
10308
10309 * lib/timevar.c (timervar_accumulate): Rename locals to
10310 avoid confusion with similarly-named more-global.
10311 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
10312
10313 * src/output.c (prepare): Use xstrdup to convert char const *
10314 to char *, to avoid GCC warning.
10315
10316 2002-10-19 Akim Demaille <akim@epita.fr>
10317
10318 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
10319 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
10320 Use them to have `calc.y' ready for %pure-parser.
10321 * data/yacc.c (YYLEX): Pass a yylex return type to
10322 b4_c_function_call.
10323
10324 2002-10-19 Akim Demaille <akim@epita.fr>
10325
10326 Prototype support of %lex-param and %parse-param.
10327
10328 * src/parse-gram.y: Add the definition of the %lex-param and
10329 %parse-param tokens, plus their rules.
10330 Drop the `_' version of %glr-parser.
10331 Add the "," token.
10332 * src/scan-gram.l (INITIAL): Scan them.
10333 * src/muscle_tab.c: Comment changes.
10334 (muscle_insert, muscle_find): Rename `pair' as `probe'.
10335 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
10336 (muscle_entry_s): The `value' member is no longer const.
10337 Adjust all dependencies.
10338 * src/muscle_tab.c (muscle_init): Adjust: use
10339 MUSCLE_INSERT_STRING.
10340 Initialize the obstack earlier.
10341 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
10342 (muscle_pair_list_grow): New.
10343 * data/c.m4 (b4_c_function_call, b4_c_args): New.
10344 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
10345 * tests/calc.at: Use %locations, not --locations.
10346 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
10347
10348 2002-10-19 Akim Demaille <akim@epita.fr>
10349
10350 * src/getargs.c (usage): Take status as argument and exit
10351 accordingly.
10352 Report the traditional `Try ... --help' message when status != 0.
10353 (usage, version): Don't take a FILE * as arg, it is pointless.
10354 (getargs): When there is an incorrect number of arguments, make it
10355 an error, and report it GNUlically thanks to `usage ()'.
10356
10357 2002-10-18 Paul Eggert <eggert@twinsun.com>
10358
10359 * data/glr.c (yyreportParseError): Don't assume that sprintf
10360 yields the length of the printed string, as this is not true
10361 on SunOS 4.1.4. Reported by Peter Klein.
10362
10363 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
10364 * tests/conflicts.at (%nonassoc and eof): Likewise.
10365 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
10366
10367 2002-10-17 Akim Demaille <akim@epita.fr>
10368
10369 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
10370 * src/getargs.c (trace_types, trace_args): Adjust.
10371 * src/reader.c (grammar_current_rule_prec_set)
10372 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
10373 Standardize error messages.
10374 And s/@prec/%prec/!
10375 (reader): Use trace_flag to enable scanner/parser debugging,
10376 instead of an adhoc scheme.
10377 * src/scan-gram.l: Remove trailing debugging code.
10378
10379 2002-10-16 Paul Eggert <eggert@twinsun.com>
10380
10381 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
10382 MUSCLE_TAB_H.
10383
10384 * NEWS: Officially drop support for building Bison with K&R C,
10385 since it didn't work anyway and it's not worth worrying about.
10386 * Makefile.maint (wget_files): Remove ansi2knr.c.
10387 (ansi2knr.c-url_prefix): Remove.
10388 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
10389 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10390 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10391
10392 2002-10-15 Paul Eggert <eggert@twinsun.com>
10393
10394 Stop using the "enum_" trick for K&R-style function definitions;
10395 it confused me, and I was the author! Instead, assume that people
10396 who want to use K&R C compilers (when using these modules in GCC,
10397 perhaps?) will run ansi2knr.
10398
10399 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
10400 All uses of "enum_" changed to "enum ".
10401 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10402 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10403
10404 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
10405 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
10406 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
10407 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
10408 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
10409 abitset_not, abitset_ones, abitset_or, abitset_or_and,
10410 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
10411 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
10412 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
10413 Use function prototypes; this removes the need for declaring
10414 static functions simply to provide their prototypes.
10415 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
10416 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
10417 bitset_count_, bitset_create, bitset_dump, bitset_first,
10418 bitset_free, bitset_init, bitset_last, bitset_next,
10419 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
10420 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
10421 bitset_print, bitset_release_memory, bitset_toggle_,
10422 bitset_type_choose, bitset_type_get, bitset_type_name_get,
10423 debug_bitset): Likewise.
10424 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
10425 * lib/bitset_stats.c (bitset_log_histogram_print,
10426 bitset_percent_histogram_print, bitset_stats_and,
10427 bitset_stats_and_cmp, bitset_stats_and_or,
10428 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
10429 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
10430 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
10431 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
10432 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
10433 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
10434 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
10435 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
10436 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
10437 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
10438 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
10439 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
10440 bitset_stats_zero): Likewise.
10441 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10442 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10443 bitsetv_dump, debug_bitsetv): Likewise.
10444 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
10445 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
10446 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
10447 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
10448 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
10449 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
10450 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
10451 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
10452 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
10453 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
10454 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
10455 Likewise.
10456 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
10457 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
10458 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
10459 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
10460 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
10461 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
10462 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
10463 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
10464 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
10465 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
10466 lbitset_xor_cmp, lbitset_zero): Likewise.
10467
10468 2002-10-14 Akim Demaille <akim@epita.fr>
10469
10470 Version 1.75.
10471
10472 2002-10-14 Akim Demaille <akim@epita.fr>
10473
10474 * tests/Makefile.am (maintainer-check-posix): New.
10475
10476 2002-10-14 Akim Demaille <akim@epita.fr>
10477
10478 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
10479 member.
10480
10481 2002-10-14 Akim Demaille <akim@epita.fr>
10482
10483 * src/tables.c (table_ninf_remap): base -> tab.
10484 Reported by Matt Rosing.
10485
10486 2002-10-14 Paul Eggert <eggert@twinsun.com>
10487
10488 * tests/action.at, tests/calc.at, tests/conflicts.at,
10489 tests/cxx-type.at, tests/headers.at, tests/input.at,
10490 tests/regression.at, tests/synclines.at, tests/torture.at:
10491 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
10492 so that the tests still work even if POSIXLY_CORRECT is set.
10493 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
10494
10495 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
10496 for portability to K&R hosts. Fix typo: signed char is guaranteed
10497 only to 127, not to 128.
10498 * data/glr.c (yysigned_char): New type.
10499 * data/yacc.c (yysigned_char): Likewise.
10500 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
10501
10502 2002-10-13 Paul Eggert <eggert@twinsun.com>
10503
10504 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
10505 true due to limited range of data type" warning from GCC.
10506
10507 * data/c.m4 (b4_token_defines): Protect against double-inclusion
10508 by wrapping enum yytokentype's definition inside #ifndef
10509 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
10510
10511 2002-10-13 Akim Demaille <akim@epita.fr>
10512
10513 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
10514 Un yy- yyrhs to avoid the name clash with the global YYRHS.
10515
10516 2002-10-13 Akim Demaille <akim@epita.fr>
10517
10518 * Makefile.maint: Update from Autoconf 2.54.
10519 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
10520
10521 2002-10-13 Akim Demaille <akim@epita.fr>
10522
10523 * src/print.c (print_state): Separate the list of solved conflicts
10524 from the other items.
10525 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
10526
10527 2002-10-13 Akim Demaille <akim@epita.fr>
10528
10529 Let nondeterministic skeletons be usable with deterministic
10530 tables.
10531
10532 With the patch, GAWK compiled by GCC without -O2 passes its test
10533 suite using a GLR parser driven by LALR tables. It fails with -O2
10534 because `struct stat' gives two different answers on my machine:
10535 88 (definition of an auto var) and later 96 (memset on this var).
10536 Hence the stack is badly corrumpted. The headers inclusion is to
10537 blame: if I move the awk.h inclusion before GLR's system header
10538 inclusion, the two struct stat have the same size.
10539
10540 * src/tables.c (pack_table): Always create conflict_table.
10541 (token_actions): Always create conflict_list.
10542 * data/glr.c (YYFLAG): Remove, unused.
10543
10544 2002-10-13 Akim Demaille <akim@epita.fr>
10545
10546 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
10547 (O0FLAGS): New.
10548 (VALGRIND, GXX): New.
10549 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
10550 * tests/bison.in: Run $PREBISON a pre-command.
10551 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
10552 (maintainer-check-g++): New.
10553 * Makefile.am (maintainer-check): New.
10554
10555 2002-10-13 Akim Demaille <akim@epita.fr>
10556
10557 * data/glr.c: Formatting changes.
10558 Tweak some trace messages to match yacc.c's.
10559
10560 2002-10-13 Akim Demaille <akim@epita.fr>
10561
10562 GLR parsers sometimes raise parse errors instead of performing the
10563 default reduction.
10564 Reported by Charles-Henry de Boysson.
10565
10566 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
10567 check the length of the traces when %glr.
10568 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
10569 GLR's traces.
10570 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
10571 Test GLR parsers.
10572 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
10573 (yyltype): Remove the yy prefix from the member names.
10574 (yytable): Complete its comment.
10575 (yygetLRActions): Map error action number from YYTABLE from
10576 YYTABLE_NINF to 0.
10577 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
10578 (which was a bug: it should have been YYTABEL_NINF, and yet it was
10579 not satisfying as we could compare an YYACTION computed from
10580 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
10581 only value for error actions.
10582 (yyreportParseError): In verbose parse error messages, don't issue
10583 `error' in the list of expected tokens.
10584 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
10585 next action to perform to match glr.c's decoding.
10586 (yytable): Complete its comment.
10587
10588 2002-10-13 Paul Eggert <eggert@twinsun.com>
10589
10590 Fix problem reported by Henrik Grubbstroem in
10591 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
10592 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
10593 because the Bison parser reads the second action before reducing
10594 the first one.
10595 * src/scan-gram.l (rule_length): New static var.
10596 Use it to keep track of the rule length in the scanner, since
10597 we can't expect the parser to be in lock-step sync with the scanner.
10598 (handle_action_dollar, handle_action_at): Use this var.
10599 * tests/actions.at (Exotic Dollars): Test for the problem.
10600
10601 2002-10-12 Paul Eggert <eggert@twinsun.com>
10602
10603 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
10604 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
10605 Include <sys/time.h> when checking for clock_t and struct tms.
10606 Use same include order as source.
10607 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
10608 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
10609
10610 * lib/timevar.c: Update copyright date and clarify comments.
10611 (get_time) [IN_GCC]: Keep the GCC version for reference.
10612
10613 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
10614 GCC version as of today, then merge Bison's changes.
10615 Change "GCC" to "Bison" in copyright notice. timevar.def's
10616 author is Akim, so change that too.
10617
10618 * src/reader.c (grammar_current_rule_check):
10619 Don't worry about the default action if $$ is untyped.
10620 Prevents bogus warnings reported by Jim Gifford in
10621 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
10622
10623 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
10624 * data/glr.c, data/lalr1.cc, data/yacc.c:
10625 Output token definitions before the first part of user declarations.
10626 Fixes compatibility problem reported by Jim Gifford for kbd in
10627 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
10628
10629 2002-10-11 Paul Eggert <eggert@twinsun.com>
10630
10631 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
10632 (yyparse): here. This undoes some of the 2002-07-25 change.
10633 Compatibility problem reported by Ralf S. Engelschall with
10634 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
10635
10636 2002-10-11 Akim Demaille <akim@epita.fr>
10637
10638 * tests/regression.at Characters Escapes): New.
10639 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
10640 characters.
10641 Reported by Jan Nieuwenhuizen.
10642
10643 2002-10-11 Akim Demaille <akim@epita.fr>
10644
10645 * po/id.po: New.
10646
10647 2002-10-10 Paul Eggert <eggert@twinsun.com>
10648
10649 Portability fixes for bitsets; this also avoids several GCC
10650 warnings.
10651
10652 * lib/abitset.c: Include <stddef.h>, for offsetof.
10653 * lib/lbitset.c: Likewise.
10654
10655 * lib/abitset.c (abitset_bytes): Return a size that is aligned
10656 properly for vectors of objects. Do not assume that adding a
10657 header size to a multiple of a word size yields a value that is
10658 properly aligned for the whole union.
10659 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10660
10661 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
10662 unique names for structures.
10663 * lib/ebitset.c (ebitset_bytes): Likewise.
10664 * lib/lbitset.c (lbitset_bytes): Likewise.
10665
10666 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
10667 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
10668 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
10669 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
10670 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
10671 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
10672 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
10673 to improve the type-checking that GCC can do.
10674 * lib/bitset.c (bitset_op4_cmp): Likewise.
10675 * lib/bitset_stats.c (bitset_stats_count,
10676 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
10677 bitset_stats_copy, bitset_stats_disjoint_p,
10678 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
10679 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
10680 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
10681 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
10682 bitset_stats_and_or_cmp, bitset_stats_andn_or,
10683 bitset_stats_andn_or_cmp, bitset_stats_or_and,
10684 bitset_stats_or_and_cmp): Likewise.
10685 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
10686 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
10687 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
10688 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
10689
10690 * lib/abitset.h: Include bitset.h, not bbitset.h.
10691 * lib/ebitset.h: Likewise.
10692 * lib/lbitset.h: Likewise.
10693
10694 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
10695 All instances of parameters of type enum bitset_opts are now of
10696 type enum_bitset_opts, to conform to the C Standard, and similarly
10697 for enum_bitset_type.
10698 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10699 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10700
10701 Do not use "struct bitset_struct" to mean different things in
10702 different modules. Not only is this confusing, it violates
10703 the C Standard, which requires that structure types in different
10704 modules must be compatible if one is to be passed to the other.
10705 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
10706 All instances of "struct bitset_struct *" replaced with "bitset".
10707 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
10708 (union bitset_union, struct abitset_struct, struct ebitset_struct,
10709 struct lbitset_struct, struct bitset_stats_struct): New types.
10710 All uses of struct bitset_struct changed to union bitset_union,
10711 etc.
10712 * lib/abitset.c (struct abitset_struct, abitset,
10713 struct bitset_struct): Remove.
10714 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
10715 struct bitset_struct): Remove.
10716 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
10717 bitset_struct): Remove.
10718 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
10719 Likewise.
10720
10721 Do not call a function of type T using a call that assumes the
10722 function is of a different type U. Standard C requires that a
10723 function must be called with a type that is compatible with its
10724 definition.
10725 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10726 New decls.
10727 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10728 New functions.
10729 * lib/ebitset.c (PFV): Remove.
10730 * lib/lbitset.c (PFV): Likewise.
10731 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
10732 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
10733 decls.
10734 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
10735 (ebitset_vtable): Use them.
10736 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
10737 lbitset_xor): New functions.
10738 (lbitset_vtable): Use them.
10739
10740 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
10741 Declare.
10742
10743 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
10744 GCC warning.
10745 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
10746 Use offsetof, for simplicity.
10747
10748 2002-10-06 Paul Eggert <eggert@twinsun.com>
10749
10750 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
10751 the same width as int. This reapplies a hunk of the 2002-08-12 patch
10752 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
10753 which was inadvertently undone by the 2002-09-30 patch.
10754 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
10755 the same width as int.
10756
10757 2002-10-04 Paul Eggert <eggert@twinsun.com>
10758
10759 Version 1.50.
10760
10761 * configure.ac (AC_INIT), NEWS: Increment version number.
10762
10763 * doc/bison.texinfo: Minor spelling, grammar, and white space
10764 fixes.
10765 (Symbols): Mention that any negative value returned from yylex
10766 signifies end-of-input. Warn about negative chars. Mention
10767 the portable Standard C character set.
10768
10769 The GNU coding standard says CFLAGS and YFLAGS are reserved
10770 for the installer to set.
10771 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
10772 * src/Makefile.am (AM_CFLAGS): Likewise.
10773 (AM_YFLAGS): Renamed from YFLAGS.
10774
10775 Fix some MAX and MIN problems.
10776 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
10777 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
10778 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
10779 * src/reader.c (reader): Use it.
10780
10781 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
10782 POSIX 1003.1-2001 has removed fgrep.
10783
10784 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
10785
10786 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
10787 interpreted as signed.
10788 * lib/ebitset.c (ebitset_list): Fix bug.
10789
10790 2002-10-01 Paul Eggert <eggert@twinsun.com>
10791
10792 More fixes for 64-bit hosts and large bitsets.
10793
10794 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
10795 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
10796 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
10797 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
10798 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
10799 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
10800 bitset_count_): Likewise.
10801 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
10802 bitset_first, bitset_last): Likewise.
10803 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
10804 bitset_stats_list_reverse, bitset_stats_size,
10805 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
10806 Likewise.
10807 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10808 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10809 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10810 bitsetv_reflexive_transitive_closure): Likewise.
10811 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
10812 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
10813 Likewise.
10814 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
10815 Likewise.
10816
10817 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
10818 Use size_t, not unsigned int, to count bytes.
10819 * lib/abitset.h (abitset_bytes): Likewise.
10820 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
10821 Likewise.
10822 * lib/bitset.h (bitset_bytes): Likewise.
10823 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
10824 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
10825 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10826 * lib/ebitset.c (ebitset_bytes): Likewise.
10827 * lib/ebitset.h (ebitset_bytes): Likewise.
10828 * lib/lbitset.c (lbitset_bytes): Likewise.
10829 * lib/lbitset.h (lbitset_bytes): Likewise.
10830
10831 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
10832 abitset_subset_p, abitset_disjoint_p, abitset_and,
10833 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
10834 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
10835 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
10836 abitset_or_and, abitset_or_and_cmp):
10837 Use bitset_windex instead of unsigned int.
10838 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10839 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
10840 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
10841 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
10842 Likewise.
10843 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
10844
10845 * lib/bitset.c (bitset_print):
10846 Use proper printf formats for widths of integer types.
10847 * lib/bitset_stats.c (bitset_percent_histogram_print,
10848 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
10849 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10850 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10851 * lib/lbitset.c (lbitset_bytes): Likewise.
10852
10853 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
10854 BITSET_SIZE_MAX): New macros.
10855 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
10856 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
10857 to BITSET_WINDEX_MAX.
10858
10859 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
10860 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
10861 since we now return the bitset_bindex type (not int).
10862
10863 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
10864 when computing sizes.
10865 * lib/ebitset.c (ebitset_elts_grow): Likewise.
10866
10867 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
10868 and avoid cast to unsigned.
10869
10870 2002-09-30 Akim Demaille <akim@epita.fr>
10871
10872 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10873 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
10874 Updates from Michael Hayes.
10875
10876 2002-09-30 Art Haas <ahaas@neosoft.com>
10877
10878 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
10879 invocations.
10880 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
10881 defined.
10882
10883 2002-09-27 Akim Demaille <akim@epita.fr>
10884
10885 Version 1.49c.
10886
10887 2002-09-27 Akim Demaille <akim@epita.fr>
10888
10889 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
10890 (Because of AC_LIBSOURCE).
10891
10892 2002-09-27 Akim Demaille <akim@epita.fr>
10893
10894 Playing with Autoscan.
10895
10896 * configure.ac: Remove the old LIBOBJ tweaks.
10897 (AC_REPLACE_FUNCS): Add strrchr and strtol.
10898 * lib/strrchr.c: New.
10899 * lib/strtol.c: New, from the Coreutils 4.5.1.
10900
10901 2002-09-27 Akim Demaille <akim@epita.fr>
10902
10903 Playing with Autoscan.
10904
10905 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
10906 * lib/Makefile.am (libbison_a_SOURCES): No longer include
10907 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
10908 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
10909 Coreutils 4.5.1.
10910
10911 2002-09-24 Akim Demaille <akim@epita.fr>
10912
10913 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
10914 (Frequently Asked Questions, Parser Stack Overflow): New.
10915
10916 2002-09-13 Akim Demaille <akim@epita.fr>
10917
10918 Playing with autoscan.
10919
10920 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
10921 * src/files.c (skeleton_find): Remove, unused.
10922 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
10923 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
10924
10925 2002-09-13 Akim Demaille <akim@epita.fr>
10926
10927 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
10928 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
10929
10930 2002-09-13 Akim Demaille <akim@epita.fr>
10931
10932 * configure.ac: Require 2.54.
10933 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
10934 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
10935 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
10936 Remove, provided by Autoconf macros.
10937
10938 2002-09-12 Akim Demaille <akim@epita.fr>
10939
10940 * m4/prereq.m4: Update, from Coreutils 4.5.1.
10941
10942 2002-09-12 Akim Demaille <akim@epita.fr>
10943
10944 * m4/prereq.m4: Update, from Fileutils 4.1.5.
10945 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
10946 Reported by Martin Mokrejs.
10947
10948 2002-09-10 Akim Demaille <akim@epita.fr>
10949
10950 * src/parse-gram.y: Associate a human readable string to each
10951 token type.
10952 * tests/regression.at (Invalid inputs): Adjust.
10953
10954 2002-09-10 Gary V. Vaughan <gary@gnu.org>
10955
10956 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
10957 with an Autoconf-2.5x style configure.ac.
10958
10959 2002-09-06 Paul Eggert <eggert@twinsun.com>
10960
10961 * doc/bison.texinfo (Conditions): Make explicit that the GPL
10962 exception applies only to yacc.c. This is a modification of a
10963 patch originally suggested by Akim Demaille.
10964
10965 2002-09-06 Akim Demaille <akim@epita.fr>
10966
10967 * data/c.m4 (b4_copyright): Move the GPL exception comment from
10968 here to...
10969 * data/yacc.c: here.
10970
10971 * data/lalr1.cc (struct yyltype): Don't define it, since we use
10972 LocationType.
10973 (b4_ltype): Default to yy::Location from location.hh.
10974
10975 2002-09-04 Jim Meyering <jim@meyering.net>
10976
10977 * data/yacc.c: Guard the declaration of yytoknum also with
10978 `#ifdef YYPRINT', so it is declared only when used.
10979
10980 2002-09-04 Akim Demaille <akim@epita.fr>
10981
10982 * configure.in: Rename as...
10983 * configure.ac: this.
10984 Bump to 1.49c.
10985
10986 2002-09-04 Akim Demaille <akim@epita.fr>
10987
10988 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
10989 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
10990 translate maintainer only messages.
10991
10992 2002-08-12 Paul Eggert <eggert@twinsun.com>
10993
10994 Version 1.49b.
10995
10996 * Makefile.am (SUBDIRS): Remove intl.
10997 (DISTCLEANFILES): Remove.
10998 * NEWS: Mention that GNU M4 is now required. Clarify what is
10999 meant by "larger grammars". Mention the pt_BR translation.
11000 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
11001 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
11002 Bump version from 0.11.2 to 0.11.5.
11003 (BISON_PREREQ_STAGE): Remove.
11004 (AM_GNU_GETTEXT): Use external gettext.
11005 (AC_OUTPUT): Remove intl/Makefile.
11006
11007 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
11008
11009 * data/glr.c: Include string.h, for strlen.
11010 (yyreportParseError): Use size_t for yysize.
11011 (yy_yypstack): No longer nested inside yypstates, as nested
11012 functions are not portable. Do not assume size_t is the
11013 same width as int.
11014 (yypstates): Do not assume that ptrdiff_t is the same width
11015 as int, and similarly for yyposn and YYINDEX.
11016
11017 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
11018
11019 * lib/Makefile.am (INCLUDES): Do not include from the intl
11020 directory, which has been removed.
11021 * src/Makefile.am (INCLUDES): Likewise.
11022
11023 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
11024 (bitsets_sources, additional_bitsets_sources, timevars_sources):
11025 New vars.
11026
11027 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
11028 * tests/Makefile.am (EXTRA_DIST): Likewise.
11029
11030 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
11031 Do not assume that bitset_windex is the same width as unsigned.
11032
11033 * lib/abitset.c (abitset_unused_clear): Do not assume that
11034 bitset_word is the same width as int.
11035 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
11036 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
11037 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
11038 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
11039 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
11040
11041 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
11042 portability to one's complement hosts!).
11043 * lib/ebitset.c (ebitset_op1): Likewise.
11044 * lib/lbitset.c (lbitset_op1): Likewise.
11045
11046 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
11047 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11048 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
11049 Sync with fileutils.
11050 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
11051 lib/gettext.h: Sync with diffutils.
11052
11053 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
11054 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
11055
11056 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
11057 PROTOTYPES to check for prototypes, and "defined __STDC__" to
11058 check for void *.
11059
11060 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
11061 size_t; the old version tried to do this but casted improperly.
11062 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
11063 (bitset_test): Now returns int, not unsigned long.
11064
11065 * lib/bitset_stats.c: Include "gettext.h".
11066 (_): New macro.
11067 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
11068 name locals "index", as it generates unnecessary warnings on some
11069 hosts that have an "index" function.
11070
11071 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
11072 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
11073 they need translation.
11074 * src/LR0.c (state_list_append, new_itemsets, get_state,
11075 append_states, generate_states): Likewise.
11076 * src/assoc.c (assoc_to_string): Likewise.
11077 * src/closure.c (print_closure, set_firsts, closure): Likewise.
11078 * src/gram.c (grammar_dump): Likewise.
11079 * src/injections.c (injections_compute): Likewise.
11080 * src/lalr.c (lookaheads_print): Likewise.
11081 * src/relation.c (relation_transpose): Likewise.
11082 * src/scan-gram.l: Likewise.
11083 * src/tables.c (table_grow, pack_vector): Likewise.
11084
11085 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
11086 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
11087 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
11088 * m4/mbstate_t.m4: Sync with fileutils.
11089 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
11090
11091 * po/LINGUAS: Add pt_BR.
11092 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
11093 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
11094 lib/timevar.c.
11095 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
11096 manual recommends.
11097 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
11098
11099 * src/complain.c (strerror_r): Remove decl; not needed.
11100 (strerror): Use same pattern as ../lib/error.c.
11101
11102 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
11103
11104 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
11105
11106 * src/main.c (main): Cast result of bindtextdomain and textdomain
11107 to void, to avoid a GCC warning when --disable-nls is in effect.
11108
11109 * src/scan-gram.l: Use strings rather than escapes when possible,
11110 to minimize the number of warnings from xgettext.
11111 (handle_action_dollar, handle_action_at): Don't use isdigit,
11112 as it mishandles negative chars and it may not work as expected
11113 outside the C locale.
11114
11115 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
11116 this is a GCC extension and is not portable to other compilers.
11117
11118 * src/system.h (alloca): Use same pattern as ../lib/error.c.
11119 Do not include <ctype.h>; no longer needed.
11120 Do not include <malloc.h>; no longer needed (and generates
11121 warnings on OpenBSD 3.0).
11122
11123 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
11124 it's not portable.
11125
11126 * tests/regression.at: Do not use 'cc -c input.c -o input';
11127 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
11128
11129 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
11130 exit status as failure, not just exit status 1. Sun C exits
11131 with status 2 sometimes.
11132
11133 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
11134 Use it for the two large tests.
11135
11136 2002-08-02 Akim Demaille <akim@epita.fr>
11137
11138 * src/conflicts.c (conflicts_output): Don't output rules never
11139 reduced here, since anyway that computation doesn't work.
11140 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
11141 (rule_useless_p, rule_never_reduced_p): New.
11142 (grammar_rules_partial_print): Use a filter instead of a range.
11143 Display the title only if needed.
11144 (grammar_rules_print): Adjust.
11145 (grammar_rules_never_reduced_report): New.
11146 * src/tables.c (action_row): Move the computation of rules never
11147 reduced to...
11148 (token_actions): here.
11149 * src/main.c (main): Make the parser before making the report, so
11150 that rules never reduced are computed.
11151 Call grammar_rules_never_reduced_report.
11152 * src/print.c (print_results): Report rules never reduced.
11153 * tests/conflicts.at, tests/reduce.at: Adjust.
11154
11155 2002-08-01 Akim Demaille <akim@epita.fr>
11156
11157 Instead of attaching lookaheads and duplicating the rules being
11158 reduced by a state, attach the lookaheads to the reductions.
11159
11160 * src/state.h (state_t): Remove the `lookaheads',
11161 `lookaheads_rule' member.
11162 (reductions_t): Add a `lookaheads' member.
11163 Use a regular array for the `rules'.
11164 * src/state.c (reductions_new): Initialize the lookaheads member
11165 to 0.
11166 (state_rule_lookaheads_print): Adjust.
11167 * src/state.h, src/state.c (state_reductions_find): New.
11168 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
11169 (count_rr_conflicts): Adjust.
11170 * src/lalr.c (LArule): Remove.
11171 (add_lookback_edge): Adjust.
11172 (state_lookaheads_count): New.
11173 (states_lookaheads_initialize): Merge into...
11174 (initialize_LA): this.
11175 (lalr_free): Adjust.
11176 * src/main.c (main): Don't free nullable and derives too early: it
11177 is used by --verbose.
11178 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
11179
11180 2002-08-01 Akim Demaille <akim@epita.fr>
11181
11182 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
11183 `rule_number_t**'.
11184 (set_derives, free_derives): Rename as...
11185 (derives_compute, derives_free): this.
11186 Adjust all dependencies.
11187 * src/nullable.c (set_nullable, free_nullable): Rename as...
11188 (nullable_compute, nullable_free): these.
11189 (rule_list_t): Store rule_t *, not rule_number_t.
11190 * src/state.c (state_rule_lookaheads_print): Directly compare rule
11191 pointers, instead of their numbers.
11192 * src/main.c (main): Call nullable_free, and derives_free earlier,
11193 as they were lo longer used.
11194
11195 2002-08-01 Akim Demaille <akim@epita.fr>
11196
11197 * lib/timevar.c (get_time): Include children time.
11198 * src/lalr.h (LA, LArule): Don't export them: used with the
11199 state_t.
11200 * src/lalr.c (LA, LArule): Static.
11201 * src/lalr.h, src/lalr.c (lalr_free): New.
11202 * src/main.c (main): Call it.
11203 * src/tables.c (pack_vector): Check whether loc is >= to the
11204 table_size, not >.
11205 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
11206 (tables_generate): do it, since that's also it which allocates
11207 them.
11208 Don't free LA and LArule, main does.
11209
11210 2002-07-31 Akim Demaille <akim@epita.fr>
11211
11212 Separate parser tables computation and output.
11213
11214 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
11215 (conflict_list, conflict_list_cnt, table, check, table_ninf)
11216 (yydefgoto, yydefact, high): Move to...
11217 * src/tables.h, src/tables.c: here.
11218 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11219 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11220 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
11221 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
11222 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
11223 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
11224 (action_row, save_row, token_actions, save_column, default_goto)
11225 (goto_actions, sort_actions, matching_state, pack_vector)
11226 (table_ninf_remap, pack_table, prepare_actions): Move to...
11227 * src/tables.c: here.
11228 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
11229 * src/output.c (token_actions, output_base, output_conflicts)
11230 (output_check): Merge into...
11231 (prepare_actions): this.
11232 (actions_output): Rename as...
11233 (user_actions_output): this.
11234 * src/main.c (main): Call tables_generate and tables_free.
11235
11236 2002-07-31 Akim Demaille <akim@epita.fr>
11237
11238 Steal GCC's --time-report support.
11239
11240 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
11241 stolen/adjusted from GCC.
11242 * m4/stage.m4: Remove time related checks.
11243 * m4/timevar.m4: New.
11244 * configure.in: Adjust.
11245 * src/system.h: Adjust to using timevar.h.
11246 * src/getargs.h, src/getargs.c: Support trace_time for
11247 --trace=time.
11248 * src/main.c (stage): Remove.
11249 (main): Replace `stage' invocations with timevar calls.
11250 * src/output.c: Insert pertinent timevar calls.
11251
11252 2002-07-31 Akim Demaille <akim@epita.fr>
11253
11254 Let --trace have arguments.
11255
11256 * src/getargs.h (enum trace_e): New.
11257 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
11258 (long_options, short_options): --trace/-T takes an optional
11259 argument.
11260 Change all the uses of trace_flag to reflect the new flags.
11261 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
11262
11263 Strengthen `stage' portability.
11264
11265 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
11266 * configure.in: Use it.
11267 Don't check for malloc.h and sys/times.h.
11268 * src/system.h: Include them when appropriate.
11269 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
11270 times and struct tms are available.
11271
11272 2002-07-30 Akim Demaille <akim@epita.fr>
11273
11274 In verbose parse error message, don't report `error' as an
11275 expected token.
11276 * tests/actions.at (Printers and Destructors): Adjust.
11277 * tests/calc.at (Calculator $1): Adjust.
11278 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
11279 error message, do not report the parser accepts the error token in
11280 that state.
11281
11282 2002-07-30 Akim Demaille <akim@epita.fr>
11283
11284 Normalize conflict related messages.
11285
11286 * src/complain.h, src/complain.c (warn, complain): New.
11287 * src/conflicts.c (conflicts_print): Use them.
11288 (conflict_report_yacc): New, extracted from...
11289 (conflicts_print): here.
11290 * tests/conflicts.at, tests/existing.at: Adjust.
11291
11292 2002-07-30 Akim Demaille <akim@epita.fr>
11293
11294 Report rules which are never reduced by the parser: those hidden
11295 by conflicts.
11296
11297 * src/LR0.c (save_reductions): Don't make the final state too
11298 different: save its reduction (accept) instead of having a state
11299 without any action (no shift or goto, no reduce).
11300 Note: the final state is now a ``regular'' state, i.e., the
11301 parsers now contain `reduce 0' as default reduction.
11302 Nevertheless, since they decide to `accept' when yystate =
11303 final_state, they still will not reduce rule 0.
11304 * src/print.c (print_actions, print_reduction): Adjust.
11305 * src/output.c (action_row): Track reduced rules.
11306 (token_actions): Report rules never reduced.
11307 * tests/conflicts.at, tests/regression.at: Adjust.
11308
11309 2002-07-30 Akim Demaille <akim@epita.fr>
11310
11311 `stage' was accidently included in a previous patch.
11312 Initiate its autoconfiscation.
11313
11314 * configure.in: Look for malloc.h and sys/times.h.
11315 * src/main.c (stage): Adjust.
11316 Report only when trace_flag.
11317
11318 2002-07-29 Akim Demaille <akim@epita.fr>
11319
11320 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
11321 state_number_t.
11322 (errs_t): symbol_t*, not symbol_number_t.
11323 (reductions_t): rule_t*, not rule_number_t.
11324 (FOR_EACH_SHIFT): New.
11325 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
11326 * src/print.c, src/print_graph.c: Adjust.
11327
11328 2002-07-29 Akim Demaille <akim@epita.fr>
11329
11330 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
11331
11332 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
11333 (endtoken, accept): these.
11334 * src/reader.c (reader): Set endtoken's default tag to "$end".
11335 Set undeftoken's tag to "$undefined" instead of "$undefined.".
11336 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
11337 Adjust.
11338
11339 2002-07-29 Akim Demaille <akim@epita.fr>
11340
11341 * src/reduce.c (reduce_grammar): When the language is empty,
11342 complain about the start symbol, not the axiom.
11343 Use its location.
11344 * tests/reduce.at (Empty Language): New.
11345
11346 2002-07-26 Akim Demaille <akim@epita.fr>
11347
11348 * src/reader.h, src/reader.c (gram_error): ... can't get
11349 yycontrol without making too strong assumptions on the parser
11350 itself.
11351 * src/output.c (prepare_tokens): Use the real 0th value of
11352 token_translations instead of `0'.
11353 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
11354 visible here.
11355 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
11356 for the time being: %locations ought to provide it to yyerror.
11357
11358 2002-07-25 Akim Demaille <akim@epita.fr>
11359
11360 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
11361 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
11362 * tests/regression.at (Web2c Actions): Adjust.
11363
11364 2002-07-25 Akim Demaille <akim@epita.fr>
11365
11366 Stop storing rules from 1 to nrules + 1.
11367
11368 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
11369 * src/nullable.c, src/output.c, src/print.c, src/reader.c
11370 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
11371 Iterate from 0 to nrules.
11372 Use rule_number_as_item_number and item_number_as_rule_number.
11373 Adjust to `derive' now containing possibly 0.
11374 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
11375 Handle the `- 1' part in rule numbers from/to item numbers.
11376 * src/conflicts.c (log_resolution): Fix the message which reversed
11377 shift and reduce.
11378 * src/output.c (action_row): Initialize default_rule to -1.
11379 (token_actions): Adjust.
11380 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
11381 expected output.
11382 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
11383
11384 2002-07-25 Akim Demaille <akim@epita.fr>
11385
11386 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
11387 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
11388 (b4_c_knr_arg_decl): New.
11389 * data/yacc.c: Use it to define yysymprint, yydestruct, and
11390 yyreport_parse_error.
11391
11392 2002-07-25 Akim Demaille <akim@epita.fr>
11393
11394 * data/yacc.c (yyreport_parse_error): New, extracted from...
11395 (yyparse): here.
11396 (yydestruct, yysymprint): Move above yyparse.
11397 Be K&R compliant.
11398
11399 2002-07-25 Akim Demaille <akim@epita.fr>
11400
11401 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
11402 replace...
11403 (b4_sint_type, b4_uint_type): these.
11404 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
11405 * tests/regression.at (Web2c Actions): Adjust.
11406
11407 2002-07-25 Akim Demaille <akim@epita.fr>
11408
11409 * src/gram.h (TIEM_NUMBER_MAX): New.
11410 (item_number_of_rule_number, rule_number_of_item_number): Rename
11411 as...
11412 (rule_number_as_item_number, item_number_as_rule_number): these.
11413 Adjust dependencies.
11414 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11415 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11416 (symbol_number_to_vector_number): New.
11417 (order): Of vector_number_t* type.
11418 (base_t, BASE_MAX, BASE_MIN): New.
11419 (froms, tos, width, pos, check): Of base_t type.
11420 (action_number_t, ACTION_MIN, ACTION_MAX): New.
11421 (actrow): Of action_number_t type.
11422 (conflrow): Of unsigned int type.
11423 (table_ninf, base_ninf): New.
11424 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
11425 (muscle_insert_int_table, muscle_insert_base_table)
11426 (muscle_insert_rule_number_table): New.
11427 (prepare_tokens): Output `toknum' as int_table.
11428 (action_row): Returns a rule_number_t.
11429 Use ACTION_MIN, not SHRT_MIN.
11430 (token_actions): yydefact is rule_number_t*.
11431 (table_ninf_remap): New.
11432 (pack_table): Use it for `base' and `table'.
11433 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
11434 replaced with...
11435 (YYPACT_NINF, YYTABLE_NINF): these.
11436 (yypact, yytable): Compute their types instead of hard-coded
11437 `short'.
11438 * tests/regression.at (Web2c Actions): Adjust.
11439
11440 2002-07-19 Akim Demaille <akim@epita.fr>
11441
11442 * src/scan-gram.l (id): Can start with an underscore.
11443
11444 2002-07-16 Akim Demaille <akim@epita.fr>
11445
11446 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
11447 Adjust all former `associativity' dependencies.
11448 * src/symtab.c (symbol_new): Default associativity is `undef', not
11449 `right'.
11450 (symbol_check_alias_consistence): Adjust.
11451
11452 2002-07-09 Akim Demaille <akim@epita.fr>
11453
11454 * doc/bison.texinfo: Properly set the ``header'' part.
11455 Use @dircategory ``GNU programming tools'' as per Texinfo's
11456 documentation.
11457 Use @copying.
11458
11459 2002-07-09 Akim Demaille <akim@epita.fr>
11460
11461 * lib/quotearg.h: Protect against multiple inclusions.
11462 * src/location.h (location_t): Add a `file' member.
11463 (LOCATION_RESET, LOCATION_PRINT): Adjust.
11464 * src/complain.c (warn_at, complain_at, fatal_at): Drop
11465 `error_one_per_line' support.
11466
11467 2002-07-09 Akim Demaille <akim@epita.fr>
11468
11469 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
11470 * src/reader.c (lineno): Remove.
11471 Adjust all dependencies.
11472 (get_merge_function): Take a location and use complain_at.
11473 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
11474 * tests/regression.at (Invalid inputs, Mixing %token styles):
11475 Adjust.
11476
11477 2002-07-09 Akim Demaille <akim@epita.fr>
11478
11479 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
11480 recovery rule, and forbid extensions when --yacc.
11481 (gram_error): Use complain_at.
11482 * src/reader.c (reader): Exit if there were parse errors.
11483
11484 2002-07-09 Akim Demaille <akim@epita.fr>
11485
11486 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
11487 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
11488 Reported by R Blake <blakers@mac.com>.
11489
11490 2002-07-09 Akim Demaille <akim@epita.fr>
11491
11492 * data/yacc.c: Output the copyright notive in the header.
11493
11494 2002-07-03 Akim Demaille <akim@epita.fr>
11495
11496 * src/output.c (froms, tos): Are state_number_t.
11497 (save_column): sp, sp1, and sp2 are state_number_t.
11498 (prepare): Rename `final' as `final_state_number', `nnts' as
11499 `nterms_number', `nrules' as `rules_number', `nstates' as
11500 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
11501 unused.
11502 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
11503 * data/lalr1.cc (nsym_): Remove, unused.
11504
11505 2002-07-03 Akim Demaille <akim@epita.fr>
11506
11507 * src/lalr.h, src/lalr.c (goto_number_t): New.
11508 * src/lalr.c (goto_list_t): New.
11509 Propagate them.
11510 * src/nullable.c (rule_list_t): New.
11511 Propagate.
11512 * src/types.h: Remove.
11513
11514 2002-07-03 Akim Demaille <akim@epita.fr>
11515
11516 * src/closure.c (print_fderives): Use rule_rhs_print.
11517 * src/derives.c (print_derives): Use rule_rhs_print.
11518 (rule_list_t): New, replaces `shorts'.
11519 (set_derives): Add comments.
11520 * tests/sets.at (Nullable, Firsts): Adjust.
11521
11522 2002-07-03 Akim Demaille <akim@epita.fr>
11523
11524 * src/output.c (prepare_actions): Free `tally' and `width'.
11525 (prepare_actions): Allocate and free `order'.
11526 * src/symtab.c (symbols_free): Free `symbols'.
11527 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
11528 * src/output.c (m4_invoke): Move to...
11529 * src/scan-skel.l: here.
11530 (<<EOF>>): Close yyout, and free its name.
11531
11532 2002-07-03 Akim Demaille <akim@epita.fr>
11533
11534 Fix some memory leaks, and fix a bug: state 0 was examined twice.
11535
11536 * src/LR0.c (new_state): Merge into...
11537 (state_list_append): this.
11538 (new_states): Merge into...
11539 (generate_states): here.
11540 (set_states): Don't ensure a proper `errs' state member here, do it...
11541 * src/conflicts.c (conflicts_solve): here.
11542 * src/state.h, src/state.c: Comment changes.
11543 (state_t): Rename member `shifts' as `transitions'.
11544 Adjust all dependencies.
11545 (errs_new): For consistency, also take the values as argument.
11546 (errs_dup): Remove.
11547 (state_errs_set): New.
11548 (state_reductions_set, state_transitions_set): Assert that no
11549 previous value was assigned.
11550 (state_free): New.
11551 (states_free): Use it.
11552 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
11553 temporary storage: use `errs' and `nerrs' as elsewhere.
11554 (set_conflicts): Allocate and free this `errs'.
11555
11556 2002-07-02 Akim Demaille <akim@epita.fr>
11557
11558 * lib/libiberty.h: New.
11559 * lib: Update the bitset implementation from upstream.
11560 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
11561 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
11562 * src/main.c: Adjust bitset stats calls.
11563
11564 2002-07-01 Paul Eggert <eggert@twinsun.com>
11565
11566 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
11567 char, so that negative chars don't collide with $.
11568
11569 2002-06-30 Akim Demaille <akim@epita.fr>
11570
11571 Have the GLR tests be `warning' checked, and fix the warnings.
11572
11573 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
11574 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
11575 (yyremoveDeletes): `yyi' and `yyj' are size_t.
11576 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
11577 (yyaddDeferredAction): static.
11578 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
11579 (yyreportParseError): yyprefix is const.
11580 yytokenp is used only when verbose.
11581 (yy__GNUC__): Replace with __GNUC__.
11582 (yypdumpstack): yyi is size_t.
11583 (yypreference): Un-yy local variables and arguments, to avoid
11584 clashes with `yyr1'. Anyway, we are not in the user name space.
11585 (yytname_size): be an int, as is compared with ints.
11586 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
11587 Use them.
11588 * tests/cxx-gram.at: Use quotation to protect $1.
11589 Use AT_COMPILE to enable warnings hunts.
11590 Prototype yylex and yyerror.
11591 `Use' argc.
11592 Include `string.h', not `strings.h'.
11593 Produce and prototype stmtMerge only when used.
11594 yylex takes a location.
11595
11596 2002-06-30 Akim Demaille <akim@epita.fr>
11597
11598 We spend a lot of time in quotearg, in particular when --verbose.
11599
11600 * src/symtab.c (symbol_get): Store a quoted version of the key.
11601 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
11602 Adjust all callers.
11603
11604 2002-06-30 Akim Demaille <akim@epita.fr>
11605
11606 * src/state.h (reductions_t): Rename member `nreds' as num.
11607 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
11608 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
11609
11610 2002-06-30 Akim Demaille <akim@epita.fr>
11611
11612 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
11613 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
11614 (shifts_to): Rename as...
11615 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
11616 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
11617 (TRANSITION_IS_DISABLED, transitions_to): these.
11618
11619 2002-06-30 Akim Demaille <akim@epita.fr>
11620
11621 * src/print.c (print_shifts, print_gotos): Merge into...
11622 (print_transitions): this.
11623 (print_transitions, print_errs, print_reductions): Align the
11624 lookaheads columns.
11625 (print_core, print_transitions, print_errs, print_state,
11626 print_grammar): Output empty lines separator before, not after.
11627 (state_default_rule_compute): Rename as...
11628 (state_default_rule): this.
11629 * tests/conflicts.at (Defaulted Conflicted Reduction),
11630 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
11631 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
11632
11633 2002-06-30 Akim Demaille <akim@epita.fr>
11634
11635 Display items as we display rules.
11636
11637 * src/gram.h, src/gram.c (rule_lhs_print): New.
11638 * src/gram.c (grammar_rules_partial_print): Use it.
11639 * src/print.c (print_core): Likewise.
11640 * tests/conflicts.at (Defaulted Conflicted Reduction),
11641 (Unresolved SR Conflicts): Adjust.
11642 (Unresolved SR Conflicts): Adjust and rename as...
11643 (Resolved SR Conflicts): this, as was meant.
11644 * tests/regression.at (Web2c Report): Adjust.
11645
11646 2002-06-30 Akim Demaille <akim@epita.fr>
11647
11648 * src/print.c (state_default_rule_compute): New, extracted from...
11649 (print_reductions): here.
11650 Pessimize, but clarify the code.
11651 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
11652
11653 2002-06-30 Akim Demaille <akim@epita.fr>
11654
11655 * src/output.c (action_row): Let default_rule be always a rule
11656 number.
11657
11658 2002-06-30 Akim Demaille <akim@epita.fr>
11659
11660 * src/closure.c (print_firsts, print_fderives, closure):
11661 Use BITSET_EXECUTE.
11662 * src/lalr.c (lookaheads_print): Likewise.
11663 * src/state.c (state_rule_lookaheads_print): Likewise.
11664 * src/print_graph.c (print_core): Likewise.
11665 * src/print.c (print_reductions): Likewise.
11666 * src/output.c (action_row): Likewise.
11667 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
11668
11669 2002-06-30 Akim Demaille <akim@epita.fr>
11670
11671 * src/print_graph.c: Use report_flag.
11672
11673 2002-06-30 Akim Demaille <akim@epita.fr>
11674
11675 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
11676 to...
11677 * src/relation.h, src/relation.c (traverse, relation_digraph)
11678 (relation_print, relation_transpose): New.
11679
11680 2002-06-30 Akim Demaille <akim@epita.fr>
11681
11682 * src/state.h, src/state.c (shifts_to): New.
11683 * src/lalr.c (build_relations): Use it.
11684
11685 2002-06-30 Akim Demaille <akim@epita.fr>
11686
11687 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
11688 (item_number_of_rule_number, rule_number_of_item_number): New.
11689 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
11690 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
11691 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
11692 Propagate their use.
11693 Much remains to be done, in particular wrt `shorts' from types.h.
11694
11695 2002-06-30 Akim Demaille <akim@epita.fr>
11696
11697 * src/symtab.c (symbol_new): Initialize the `printer' member.
11698
11699 2002-06-30 Akim Demaille <akim@epita.fr>
11700
11701 * src/LR0.c (save_reductions): Remove, replaced by...
11702 * src/state.h, src/state.c (state_reductions_set): New.
11703 (reductions, errs): Rename as...
11704 (reductions_t, errs_t): these.
11705 Adjust all dependencies.
11706
11707 2002-06-30 Akim Demaille <akim@epita.fr>
11708
11709 * src/LR0.c (state_list_t, state_list_append): New.
11710 (first_state, last_state): Now symbol_list_t.
11711 (this_state): Remove.
11712 (new_itemsets, append_states, save_reductions): Take a state_t as
11713 argument.
11714 (set_states, generate_states): Adjust.
11715 (save_shifts): Remove, replaced by...
11716 * src/state.h, src/state.c (state_shifts_set): New.
11717 (shifts): Rename as...
11718 (shifts_t): this.
11719 Adjust all dependencies.
11720 * src/state.h (state_t): Remove the `next' member.
11721
11722 2002-06-30 Akim Demaille <akim@epita.fr>
11723
11724 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
11725 escaped in slot 0.
11726
11727 2002-06-30 Akim Demaille <akim@epita.fr>
11728
11729 Use hash.h for the state hash table.
11730
11731 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
11732 (allocate_storage): Use state_hash_new.
11733 (free_storage): Use state_hash_free.
11734 (new_state, get_state): Adjust.
11735 * src/lalr.h, src/lalr.c (states): Move to...
11736 * src/states.h (state_t): Remove the `link' member, no longer
11737 used.
11738 * src/states.h, src/states.c: here.
11739 (state_hash_new, state_hash_free, state_hash_lookup)
11740 (state_hash_insert, states_free): New.
11741 * src/states.c (state_table, state_compare, state_hash): New.
11742 * src/output.c (output_actions): Do not free states now, since we
11743 still need to know the final_state number in `prepare', called
11744 afterwards. Do it...
11745 * src/main.c (main): here: call states_free after `output'.
11746
11747 2002-06-30 Akim Demaille <akim@epita.fr>
11748
11749 * src/state.h, src/state.c (state_new): New, extracted from...
11750 * src/LR0.c (new_state): here.
11751 * src/state.h (STATE_ALLOC): Move to...
11752 * src/state.c: here.
11753 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
11754 * src/state.h, src/state.c: here.
11755
11756 2002-06-30 Akim Demaille <akim@epita.fr>
11757
11758 * src/reader.c (gensym): Rename as...
11759 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
11760 (getsym): Rename as...
11761 (symbol_get): this.
11762
11763 2002-06-30 Akim Demaille <akim@epita.fr>
11764
11765 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
11766 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
11767 * src/output.c, src/print.c, src/print_graph.c: Propagate.
11768 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
11769
11770 2002-06-30 Akim Demaille <akim@epita.fr>
11771
11772 Make the test suite pass with warnings checked.
11773
11774 * tests/actions.at (Printers and Destructors): Improve.
11775 Avoid unsigned vs. signed issues.
11776 * tests/calc.at: Don't exercise the scanner here, do it...
11777 * tests/input.at (Torturing the Scanner): here.
11778
11779 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11780
11781 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
11782 reorganize first lines parallel to yacc.c.
11783
11784 2002-06-28 Akim Demaille <akim@epita.fr>
11785
11786 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
11787 (b4_token_enum, b4_token_defines): New, factored from...
11788 * data/lalr1.cc, data/yacc.c, glr.c: here.
11789
11790 2002-06-28 Akim Demaille <akim@epita.fr>
11791
11792 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
11793 unused variables.
11794 * src/output.c (merger_output): static.
11795
11796 2002-06-28 Akim Demaille <akim@epita.fr>
11797
11798 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
11799 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
11800 pacify GCC.
11801 * src/output.c (save_row): Initialize all the variables to pacify GCC.
11802
11803 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11804
11805 Accumulated changelog for new GLR parsing features.
11806
11807 * src/conflicts.c (count_total_conflicts): Change name to
11808 conflicts_total_count.
11809 * src/conflicts.h: Ditto.
11810 * src/output.c (token_actions): Use the new name.
11811 (output_conflicts): Change conflp => conflict_list_heads, and
11812 confl => conflict_list for better readability.
11813 * data/glr.c: Use the new names.
11814 * NEWS: Add self to GLR announcement.
11815
11816 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
11817
11818 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
11819 Akim Demaille.
11820
11821 * data/bison.glr: Change name to glr.c
11822 * data/glr.c: Renamed from bison.glr.
11823 * data/Makefile.am: Add glr.c
11824
11825 * src/getargs.c:
11826
11827 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
11828 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
11829
11830 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11831
11832 * data/bison.glr: Be sure to restore the
11833 current #line when returning to the skeleton contents after having
11834 exposed the input file's #line.
11835
11836 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11837
11838 * data/bison.glr: Bring up to date with changes to bison.simple.
11839
11840 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11841
11842 * data/bison.glr: Correct definitions that use b4_prefix.
11843 Various reformatting.
11844 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
11845 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
11846 yytokenp argument; now part of stack.
11847 (yychar): Define to behave as documented.
11848 (yyclearin): Ditto.
11849
11850 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11851
11852 * src/reader.h: Add declaration for free_merger_functions.
11853
11854 * src/reader.c (merge_functions): New variable.
11855 (get_merge_function): New function.
11856 (free_merger_functions): New function.
11857 (readgram): Check for %prec that is not followed by a symbol.
11858 Handle %dprec and %merge declarations.
11859 (packgram): Initialize dprec and merger fields in rules array.
11860
11861 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
11862 conflict_list_cnt, conflict_list_free): New variables.
11863 (table_grow): Also grow conflict_table.
11864 (prepare_rules): Output dprec and merger tables.
11865 (conflict_row): New function.
11866 (action_row): Output conflict lists for GLR parser. Don't use
11867 default reduction in conflicted states for GLR parser so that there
11868 are spaces for the conflict lists.
11869 (save_row): Also save conflict information.
11870 (token_actions): Allocate conflict list.
11871 (merger_output): New function.
11872 (pack_vector): Pack conflict table, too.
11873 (output_conflicts): New function to output yyconflp and yyconfl.
11874 (output_check): Allocate conflict_tos.
11875 (output_actions): Output conflict tables, also.
11876 (output_skeleton): Output b4_mergers definition.
11877 (prepare): Output b4_max_rhs_length definition.
11878 Use 'bison.glr' as default skeleton for GLR parsers.
11879
11880 * src/gram.c (glr_parser): New flag.
11881 (grammar_free): Call free_merger_functions.
11882
11883 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
11884 all pairs of conflicting reductions, rather than just all tokens
11885 causing conflicts. Needed to size conflict tables.
11886 (conflicts_output): Modify call to count_rr_conflicts for new
11887 interface.
11888 (conflicts_print): Ditto.
11889 (count_total_conflicts): New function.
11890
11891 * src/reader.h (merger_list): New type.
11892 (merge_functions): New variable.
11893
11894 * src/lex.h (tok_dprec, tok_merge): New token types.
11895
11896 * src/gram.h (rule_s): Add dprec and merger fields.
11897 (glr_parser): New flag.
11898
11899 * src/conflicts.h (count_total_conflicts): New function.
11900
11901 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
11902
11903 * doc/bison.texinfo (Generalized LR Parsing): New section.
11904 (GLR Parsers): New section.
11905 (Language and Grammar): Mention GLR parsing.
11906 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
11907 Correct typo ("tge" -> "the").
11908
11909 * data/bison.glr: New skeleton for GLR parsing.
11910
11911 * tests/cxx-gram.at: New tests for GLR parsing.
11912
11913 * tests/testsuite.at: Include cxx-gram.at.
11914
11915 * tests/Makefile.am: Add cxx-gram.at.
11916
11917 * src/parse-gram.y:
11918
11919 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
11920
11921 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
11922
11923 2002-06-27 Akim Demaille <akim@epita.fr>
11924
11925 * src/options.h, src/options.c: Remove.
11926 * src/getargs.c (short_options, long_options): New.
11927
11928 2002-06-27 Akim Demaille <akim@epita.fr>
11929
11930 * data/bison.simple, data/bison.c++: Rename as...
11931 * data/yacc.c, data/lalr1.cc: these.
11932 * doc/bison.texinfo (Environment Variables): Remove.
11933
11934 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
11935
11936 * src/getargs.c (report_argmatch): Initialize strtok().
11937
11938 2002-06-20 Akim Demaille <akim@epita.fr>
11939
11940 * data/bison.simple (b4_symbol_actions): New, replaces...
11941 (b4_symbol_destructor, b4_symbol_printer): these.
11942 (yysymprint): Be sure to call YYPRINT only for tokens, and using
11943 user token numbers.
11944
11945 2002-06-20 Akim Demaille <akim@epita.fr>
11946
11947 * data/bison.simple (yydestructor): Rename as...
11948 (yydestruct): this.
11949
11950 2002-06-20 Akim Demaille <akim@epita.fr>
11951
11952 * src/symtab.h, src/symtab.c (symbol_type_set)
11953 (symbol_destructor_set, symbol_precedence_set): The location is
11954 the last argument.
11955 Adjust all callers.
11956
11957 2002-06-20 Akim Demaille <akim@epita.fr>
11958
11959 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
11960 internals.
11961 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
11962 Takes a location.
11963 * src/symtab.h, src/symtab.c (symbol_class_set)
11964 (symbol_user_token_number_set): Likewise.
11965 Adjust all callers.
11966 Promote complain_at.
11967 * tests/input.at (Type Clashes): Adjust.
11968
11969 2002-06-20 Akim Demaille <akim@epita.fr>
11970
11971 * data/bison.simple (YYLEX): Fix the declaration when
11972 %pure-parser.
11973
11974 2002-06-20 Akim Demaille <akim@epita.fr>
11975
11976 * data/bison.simple (yysymprint): Don't print the token number,
11977 just its name.
11978 * tests/actions.at (Destructors): Rename as...
11979 (Printers and Destructors): this.
11980 Also exercise %printer.
11981
11982 2002-06-20 Akim Demaille <akim@epita.fr>
11983
11984 * data/bison.simple (YYDSYMPRINT): New.
11985 Use it to remove many of the #if YYDEBUG/if (yydebug).
11986
11987 2002-06-20 Akim Demaille <akim@epita.fr>
11988
11989 * src/symtab.h, src/symtab.c (symbol_t): printer and
11990 printer_location are new members.
11991 (symbol_printer_set): New.
11992 * src/parse-gram.y (PERCENT_PRINTER): New token.
11993 Handle its associated rule.
11994 * src/scan-gram.l: Adjust.
11995 (handle_destructor_at, handle_destructor_dollar): Rename as...
11996 (handle_symbol_code_at, handle_symbol_code_dollar): these.
11997 * src/output.c (symbol_printers_output): New.
11998 (output_skeleton): Call it.
11999 * data/bison.simple (yysymprint): New. Cannot be named yyprint
12000 since there are already many grammar files with a user `yyprint'.
12001 Replace the calls to YYPRINT to calls to yysymprint.
12002 * tests/calc.at: Adjust.
12003 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
12004 taking advantage of parser very internal details (stack size!).
12005
12006 2002-06-20 Akim Demaille <akim@epita.fr>
12007
12008 * src/scan-gram.l: Complete the scanner with the missing patterns
12009 to pacify Flex.
12010 Use `quote' and `symbol_tag_get' where appropriate.
12011
12012 2002-06-19 Akim Demaille <akim@epita.fr>
12013
12014 * tests/actions.at (Destructors): Augment to test locations.
12015 * data/bison.simple (yydestructor): Pass it the current location
12016 if locations are enabled.
12017 Prototype only when __STDC__ or C++.
12018 Change the argument names to move into the yy name space: there is
12019 user code here.
12020
12021 2002-06-19 Akim Demaille <akim@epita.fr>
12022
12023 * data/bison.simple (b4_pure_if): New.
12024 Use it instead of #ifdef YYPURE.
12025
12026 2002-06-19 Akim Demaille <akim@epita.fr>
12027
12028 * data/bison.simple (b4_location_if): New.
12029 Use it instead of #ifdef YYLSP_NEEDED.
12030
12031 2002-06-19 Akim Demaille <akim@epita.fr>
12032
12033 Prepare @$ in %destructor, but currently don't bind it in the
12034 skeleton, as %location use is not cleaned up yet.
12035
12036 * src/scan-gram.l (handle_dollar, handle_destructor_at)
12037 (handle_action_at): New.
12038 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
12039 a braced_code_t and a location as additional arguments.
12040 (handle_destructor_dollar): Instead of requiring `b4_eval', just
12041 unquote one when outputting `b4_dollar_dollar'.
12042 Adjust callers.
12043 * data/bison.simple (b4_eval): Remove.
12044 (b4_symbol_destructor): Adjust.
12045 * tests/input.at (Invalid @n): Adjust.
12046
12047 2002-06-19 Zack Weinberg <zack@codesourcery.com>
12048
12049 * doc/bison.texinfo: Document ability to have multiple
12050 prologue sections.
12051
12052 2002-06-18 Akim Demaille <akim@epita.fr>
12053
12054 * src/files.c (compute_base_names): When computing the output file
12055 names from the input file name, strip the directory part.
12056
12057 2002-06-18 Akim Demaille <akim@epita.fr>
12058
12059 * data/bison.simple.new: Comment changes.
12060 Reported by Andreas Schwab.
12061
12062 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
12063
12064 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
12065 there are no `label `yyoverflowlab' defined but not used' warnings
12066 when yyoverflow is defined.
12067
12068 2002-06-18 Akim Demaille <akim@epita.fr>
12069
12070 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
12071 new member.
12072 (symbol_destructor_set): Adjust.
12073 * src/output.c (symbol_destructors_output): Output the destructor
12074 locations.
12075 Output the symbol name.
12076 * data/bison.simple (b4_symbol_destructor): Adjust.
12077
12078 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
12079 and Akim Demaille <akim@epita.fr>
12080
12081 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
12082 what's left on the stack when the error recovery hits EOF.
12083 * tests/actions.at (Destructors): Complete to exercise this case.
12084
12085 2002-06-17 Akim Demaille <akim@epita.fr>
12086
12087 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
12088 arguments is really empty, not only equal to `[]'.
12089 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
12090 member.
12091 (symbol_destructor_set): New.
12092 * src/output.c (symbol_destructors_output): New.
12093 * src/reader.h (brace_code_t, current_braced_code): New.
12094 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
12095 (handle_dollar): Rename as...
12096 (handle_action_dollar): this.
12097 (handle_destructor_dollar): New.
12098 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
12099 (grammar_declaration): Use it.
12100 * data/bison.simple (yystos): Is always defined.
12101 (yydestructor): New.
12102 * tests/actions.at (Destructors): New.
12103 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
12104
12105 2002-06-17 Akim Demaille <akim@epita.fr>
12106
12107 * src/symlist.h, src/symlist.c (symbol_list_length): New.
12108 * src/scan-gram.l (handle_dollar, handle_at): Compute the
12109 rule_length only when needed.
12110 * src/output.c (actions_output, token_definitions_output): Output
12111 the full M4 block.
12112 * src/symtab.c: Don't access directly to the symbol tag, use
12113 symbol_tag_get.
12114 * src/parse-gram.y: Use symbol_list_free.
12115
12116 2002-06-17 Akim Demaille <akim@epita.fr>
12117
12118 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
12119 (symbol_list_prepend, get_type_name): Move to...
12120 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
12121 (symbol_list_prepend, symbol_list_n_type_name_get): here.
12122 Adjust all callers.
12123 (symbol_list_free): New.
12124 * src/scan-gram.l (handle_dollar): Takes a location.
12125 * tests/input.at (Invalid $n): Adjust.
12126
12127 2002-06-17 Akim Demaille <akim@epita.fr>
12128
12129 * src/reader.h, src/reader.c (symbol_list_new): Export it.
12130 (symbol_list_prepend): New.
12131 * src/parse-gram.y (%union): `list' is a new member.
12132 (symbols.1): New, replaces...
12133 (terms_to_prec.1, nterms_to_type.1): these.
12134 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
12135 Take a location as additional argument.
12136 Adjust all callers.
12137
12138 2002-06-15 Akim Demaille <akim@epita.fr>
12139
12140 * src/parse-gram.y: Move %token in the declaration section so that
12141 we don't depend upon CVS Bison.
12142
12143 2002-06-15 Akim Demaille <akim@epita.fr>
12144
12145 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
12146 * src/print.c (print_core): Use it.
12147
12148 2002-06-15 Akim Demaille <akim@epita.fr>
12149
12150 * src/conflicts.c (log_resolution): Accept the rule involved in
12151 the sr conflicts instead of the lookahead number that points to
12152 that rule.
12153 (flush_reduce): Accept the current lookahead vector as argument,
12154 instead of the index in LA.
12155 (resolve_sr_conflict): Accept the current number of lookahead
12156 bitset to consider for the STATE, instead of the index in LA.
12157 (set_conflicts): Adjust.
12158 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
12159
12160 2002-06-15 Akim Demaille <akim@epita.fr>
12161
12162 * src/state.h (state_t): Replace the `lookaheadsp' member, a
12163 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
12164 Adjust all dependencies.
12165 * src/lalr.c (initialize_lookaheads): Split into...
12166 (states_lookaheads_count, states_lookaheads_initialize): these.
12167 (lalr): Adjust.
12168
12169 2002-06-15 Akim Demaille <akim@epita.fr>
12170
12171 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
12172 out of...
12173 (grammar_rules_print): here.
12174 * src/reduce.c (reduce_output): Use it.
12175 * tests/reduce.at (Useless Rules, Reduced Automaton)
12176 (Underivable Rules): Adjust.
12177
12178 2002-06-15 Akim Demaille <akim@epita.fr>
12179
12180 Copy BYacc's nice way to report the grammar.
12181
12182 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
12183 New.
12184 Don't print the rules' location, it is confusing and useless.
12185 (rule_print): Use grammar_rhs_print.
12186 * src/print.c (print_grammar): Use grammar_rules_print.
12187
12188 2002-06-15 Akim Demaille <akim@epita.fr>
12189
12190 Complete and rationalize `useless thing' warnings.
12191
12192 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
12193 (symbol_tag_print): New.
12194 Use them everywhere in place of accessing directly the tag member.
12195 * src/gram.h, src/gram.c (rule_print): New.
12196 Use it where a rule used to be printed `by hand'.
12197 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
12198 (reduce_grammar_tables): Report the useless rules.
12199 (reduce_print): Useless things are a warning, not an error.
12200 Report it as such.
12201 * tests/reduce.at (Useless Nonterminals, Useless Rules):
12202 (Reduced Automaton, Underivable Rules): Adjust.
12203 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
12204 * tests/conflicts.at (Unresolved SR Conflicts)
12205 (Solved SR Conflicts): Adjust.
12206
12207 2002-06-15 Akim Demaille <akim@epita.fr>
12208
12209 Let symbols have a location.
12210
12211 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
12212 (getsym): Adjust.
12213 Adjust all callers.
12214 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
12215 Use location_t, not int.
12216 * src/symtab.c (symbol_check_defined): Take advantage of the
12217 location.
12218 * tests/regression.at (Invalid inputs): Adjust.
12219
12220 2002-06-15 Akim Demaille <akim@epita.fr>
12221
12222 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
12223 (input): Don't try to initialize yylloc here, do it in the
12224 scanner.
12225 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
12226 * src/gram.h (rule_t): Change line and action_line into location
12227 and action_location, of location_t type.
12228 Adjust all dependencies.
12229 * src/location.h, src/location.c (empty_location): New.
12230 * src/reader.h, src/reader.c (grammar_start_symbol_set)
12231 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
12232 (grammar_current_rule_symbol_append)
12233 (grammar_current_rule_action_append): Expect a location as argument.
12234 * src/reader.c (grammar_midrule_action): Adjust to attach an
12235 action's location as dummy symbol location.
12236 * src/symtab.h, src/symtab.c (startsymbol_location): New.
12237 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
12238 the line numbers.
12239
12240 2002-06-14 Akim Demaille <akim@epita.fr>
12241
12242 Grammar declarations may be found in the grammar section.
12243
12244 * src/parse-gram.y (rules_or_grammar_declaration): New.
12245 (declarations): Each declaration may end with a semicolon, not
12246 just...
12247 (grammar_declaration): `"%union"'.
12248 (grammar): Branch to rules_or_grammar_declaration.
12249
12250 2002-06-14 Akim Demaille <akim@epita.fr>
12251
12252 * src/main.c (main): Invoke scanner_free.
12253
12254 2002-06-14 Akim Demaille <akim@epita.fr>
12255
12256 * src/output.c (m4_invoke): Extracted from...
12257 (output_skeleton): here.
12258 Free tempfile.
12259
12260 2002-06-14 Akim Demaille <akim@epita.fr>
12261
12262 * src/parse-gram.y (directives, directive, gram)
12263 (grammar_directives, precedence_directives, precedence_directive):
12264 Rename as...
12265 (declarations, declaration, grammar, grammar_declaration)
12266 (precedence_declaration, precedence_declarator): these.
12267 (symbol_declaration): New.
12268
12269 2002-06-14 Akim Demaille <akim@epita.fr>
12270
12271 * src/files.c (action_obstack): Remove, unused.
12272 (output_obstack): Remove it, and all its dependencies, as it is no
12273 longer needed.
12274 * src/reader.c (epilogue_set): Build the epilogue in the
12275 muscle_obstack.
12276 * src/output.h, src/output.c (muscle_obstack): Move to...
12277 * src/muscle_tab.h, src/muscle_tab.h: here.
12278 (muscle_init): Initialize muscle_obstack.
12279 (muscle_free): New.
12280 * src/main.c (main): Call it.
12281
12282 2002-06-14 Akim Demaille <akim@epita.fr>
12283
12284 * src/location.h: New, extracted from...
12285 * src/reader.h: here.
12286 * src/Makefile.am (noinst_HEADERS): Merge into
12287 (bison_SOURCES): this.
12288 Add location.h.
12289 * src/parse-gram.y: Use location_t instead of Bison's.
12290 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
12291 Use location_t instead of ints.
12292
12293 2002-06-14 Akim Demaille <akim@epita.fr>
12294
12295 * data/bison.simple, data/bison.c++: Be sure to restore the
12296 current #line when returning to the skeleton contents after having
12297 exposed the input file's #line.
12298
12299 2002-06-12 Akim Demaille <akim@epita.fr>
12300
12301 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
12302 eager.
12303 * tests/actions.at (Exotic Dollars): New.
12304
12305 2002-06-12 Akim Demaille <akim@epita.fr>
12306
12307 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
12308 ['"/] too eagerly.
12309 * tests/input.at (Torturing the Scanner): New.
12310
12311 2002-06-11 Akim Demaille <akim@epita.fr>
12312
12313 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
12314 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
12315 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
12316 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
12317 * src/reader.c (reader): Use it.
12318
12319 2002-06-11 Akim Demaille <akim@epita.fr>
12320
12321 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
12322 Adjust all callers.
12323 (scanner_last_string_free): New.
12324
12325 2002-06-11 Akim Demaille <akim@epita.fr>
12326
12327 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
12328 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
12329 (last_string, YY_OBS_FREE): New.
12330 Use them when returning an ID.
12331
12332 2002-06-11 Akim Demaille <akim@epita.fr>
12333
12334 Have Bison grammars parsed by a Bison grammar.
12335
12336 * src/reader.c, src/reader.h (prologue_augment): New.
12337 * src/reader.c (copy_definition): Remove.
12338
12339 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
12340 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
12341 (grammar_current_rule_prec_set, grammar_current_rule_check)
12342 (grammar_current_rule_symbol_append)
12343 (grammar_current_rule_action_append): Export.
12344 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
12345 (symbol_list_action_append): Remove.
12346 Hook the routines from reader.
12347 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
12348 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
12349
12350 * src/reader.c (read_declarations): Remove, unused.
12351
12352 * src/parse-gram.y: Handle the epilogue.
12353 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
12354 (grammar_start_symbol_set): this.
12355 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
12356 * src/reader.c (readgram): Remove, unused.
12357 (reader): Adjust to insert eoftoken and axiom where appropriate.
12358
12359 * src/reader.c (copy_dollar): Replace with...
12360 * src/scan-gram.h (handle_dollar): this.
12361 * src/parse-gram.y: Remove `%thong'.
12362
12363 * src/reader.c (copy_at): Replace with...
12364 * src/scan-gram.h (handle_at): this.
12365
12366 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
12367 New.
12368
12369 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
12370 time being.
12371
12372 * src/reader.h, src/reader.c (grammar_rule_end): New.
12373
12374 * src/parse.y (current_type, current_class): New.
12375 Implement `%nterm', `%token' support.
12376 Merge `%term' into `%token'.
12377 (string_as_id): New.
12378 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
12379 type name.
12380
12381 * src/parse-gram.y: Be sure to handle properly the beginning of
12382 rules.
12383
12384 * src/parse-gram.y: Handle %type.
12385 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
12386
12387 * src/parse-gram.y: More directives support.
12388 * src/options.c: No longer handle source directives.
12389
12390 * src/parse-gram.y: Fix %output.
12391
12392 * src/parse-gram.y: Handle %union.
12393 Use the prologue locations.
12394 * src/reader.c (parse_union_decl): Remove.
12395
12396 * src/reader.h, src/reader.c (epilogue_set): New.
12397 * src/parse-gram.y: Use it.
12398
12399 * data/bison.simple, data/bison.c++: b4_stype is now either not
12400 defined, then default to int, or to the contents of %union,
12401 without `union' itself.
12402 Adjust.
12403 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
12404
12405 * src/output.c (actions_output): Don't output braces, as they are
12406 already handled by the scanner.
12407
12408 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
12409 characters to themselves.
12410
12411 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
12412 that the epilogue has a proper #line.
12413
12414 * src/parse-gram.y: Handle precedence/associativity.
12415
12416 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
12417 a terminal.
12418 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
12419 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
12420 at all to define terminals that cannot be emitted.
12421
12422 * src/scan-gram.l: Escape M4 characters.
12423
12424 * src/scan-gram.l: Working properly with escapes in user
12425 strings/characters.
12426
12427 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
12428 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
12429 grammar.
12430 Use more modest sizes, as for the time being the parser does not
12431 release memory, and therefore the process swallows a huge amount
12432 of memory.
12433
12434 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
12435 stricter %token grammar.
12436
12437 * src/symtab.h (associativity): Add `undef_assoc'.
12438 (symbol_precedence_set): Do nothing when passed an undef_assoc.
12439 * src/symtab.c (symbol_check_alias_consistence): Adjust.
12440
12441 * tests/regression.at (Invalid %directive): Remove, as it is now
12442 meaningless.
12443 (Invalid inputs): Adjust to the new error messages.
12444 (Token definitions): The new grammar doesn't allow too many
12445 eccentricities.
12446
12447 * src/lex.h, src/lex.c: Remove.
12448 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
12449 (copy_character, copy_string2, copy_string, copy_identifier)
12450 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
12451 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
12452 (parse_action): Remove.
12453 * po/POTFILES.in: Adjust.
12454
12455 2002-06-11 Akim Demaille <akim@epita.fr>
12456
12457 * src/reader.c (parse_action): Don't store directly into the
12458 rule's action member: return the action as a string.
12459 Don't require `rule_length' as an argument: compute it.
12460 (grammar_current_rule_symbol_append)
12461 (grammar_current_rule_action_append): New, eved out from
12462 (readgram): here.
12463 Remove `action_flag', `rulelength', unused now.
12464
12465 2002-06-11 Akim Demaille <akim@epita.fr>
12466
12467 * src/reader.c (grammar_current_rule_prec_set).
12468 (grammar_current_rule_check): New, eved out from...
12469 (readgram): here.
12470 Remove `xaction', `first_rhs': useless.
12471 * tests/input.at (Type clashes): New.
12472 * tests/existing.at (GNU Cim Grammar): Adjust.
12473
12474 2002-06-11 Akim Demaille <akim@epita.fr>
12475
12476 * src/reader.c (grammar_midrule_action): New, Eved out from
12477 (readgram): here.
12478
12479 2002-06-11 Akim Demaille <akim@epita.fr>
12480
12481 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
12482 New.
12483 (readgram): Use them as replacement of inlined code, crule and
12484 crule1.
12485
12486 2002-06-11 Akim Demaille <akim@epita.fr>
12487
12488 * src/reader.c (grammar_end, grammar_symbol_append): New.
12489 (readgram): Use them.
12490 Make the use of `p' as local as possible.
12491
12492 2002-06-10 Akim Demaille <akim@epita.fr>
12493
12494 GCJ's parser requires the tokens to be defined before the prologue.
12495
12496 * data/bison.simple: Output the token definition before the user's
12497 prologue.
12498 * tests/regression.at (Braces parsing, Duplicate string)
12499 (Mixing %token styles): Check the output from bison.
12500 (Early token definitions): New.
12501
12502 2002-06-10 Akim Demaille <akim@epita.fr>
12503
12504 * src/symtab.c (symbol_user_token_number_set): Don't complain when
12505 assigning twice the same user number to a token, so that we can
12506 use it in...
12507 * src/lex.c (lex): here.
12508 Also use `symbol_class_set' instead of hand written code.
12509 * src/reader.c (parse_assoc_decl): Likewise.
12510
12511 2002-06-10 Akim Demaille <akim@epita.fr>
12512
12513 * src/symtab.c, src/symtab.c (symbol_class_set)
12514 (symbol_user_token_number_set): New.
12515 * src/reader.c (parse_token_decl): Use them.
12516 Use a switch instead of ifs.
12517 Use a single argument.
12518
12519 2002-06-10 Akim Demaille <akim@epita.fr>
12520
12521 Remove `%thong' support as it is undocumented, unused, duplicates
12522 `%token's job, and creates useless e-mail traffic with people who
12523 want to know what it is, why it is undocumented, unused, and
12524 duplicates `%token's job.
12525
12526 * src/reader.c (parse_thong_decl): Remove.
12527 * src/options.c (option_table): Remove "thong".
12528 * src/lex.h (tok_thong): Remove.
12529
12530 2002-06-10 Akim Demaille <akim@epita.fr>
12531
12532 * src/symtab.c, src/symtab.c (symbol_type_set)
12533 (symbol_precedence_set): New.
12534 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
12535 (value_components_used): Remove, unused.
12536
12537 2002-06-09 Akim Demaille <akim@epita.fr>
12538
12539 Move symbols handling code out of the reader.
12540
12541 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
12542 (axiom): Move to...
12543 * src/symtab.h, src/symtab.c: here.
12544
12545 * src/gram.c (start_symbol): Remove: use startsymbol->number.
12546 * src/reader.c (startval): Rename as...
12547 * src/symtab.h, src/symtab.c (startsymbol): this.
12548 * src/reader.c: Adjust.
12549
12550 * src/reader.c (symbol_check_defined, symbol_make_alias)
12551 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12552 (token_translations_init)
12553 Move to...
12554 * src/symtab.c: here.
12555 * src/reader.c (packsymbols): Move to...
12556 * src/symtab.h, src/symtab.c (symbols_pack): here.
12557 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
12558 argument.
12559
12560 2002-06-03 Akim Demaille <akim@epita.fr>
12561
12562 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
12563 then statements.
12564
12565 2002-06-03 Akim Demaille <akim@epita.fr>
12566
12567 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
12568 structs with non literals.
12569 * src/scan-skel.l: never-interactive.
12570 * src/conflicts.c (enum conflict_resolution_e): No trailing
12571 comma.
12572 * src/getargs.c (usage): Split long literal strings.
12573 Reported by Hans Aberg.
12574
12575 2002-05-28 Akim Demaille <akim@epita.fr>
12576
12577 * data/bison.c++: Use C++ ostreams.
12578 (cdebug_): New member.
12579
12580 2002-05-28 Akim Demaille <akim@epita.fr>
12581
12582 * src/output.c (output_skeleton): Be sure to allocate enough room
12583 for `/' _and_ for `\0' in full_skeleton.
12584
12585 2002-05-28 Akim Demaille <akim@epita.fr>
12586
12587 * data/bison.c++: Catch up with bison.simple:
12588 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12589 and Paul Eggert <eggert@twinsun.com>: `error' handing.
12590 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
12591 and popping traces.
12592
12593 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12594
12595 * src/output.c (output_skeleton): Put an explicit path in front of
12596 the skeleton file name, rather than relying on the -I directory,
12597 to partially alleviate effects of having a skeleton file lying around
12598 in the current directory.
12599
12600 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12601
12602 * src/conflicts.c (log_resolution): Correct typo:
12603 obstack_printf should be obstack_fgrow1.
12604
12605 2002-05-26 Akim Demaille <akim@epita.fr>
12606
12607 * src/state.h (state_t): `solved_conflicts' is a new member.
12608 * src/LR0.c (new_state): Set it to 0.
12609 * src/conflicts.h, src/conflicts.c (print_conflicts)
12610 (free_conflicts, solve_conflicts): Rename as...
12611 (conflicts_print, conflicts_free, conflicts_solve): these.
12612 Adjust callers.
12613 * src/conflicts.c (enum conflict_resolution_e)
12614 (solved_conflicts_obstack): New, used by...
12615 (log_resolution): this.
12616 Adjust to attach the conflict resolution to each state.
12617 Complete the description with the precedence/associativity
12618 information.
12619 (resolve_sr_conflict): Adjust.
12620 * src/print.c (print_state): Output its solved_conflicts.
12621 * tests/conflicts.at (Unresolved SR Conflicts)
12622 (Solved SR Conflicts): Exercise --report=all.
12623
12624 2002-05-26 Akim Demaille <akim@epita.fr>
12625
12626 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12627 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12628 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
12629 (token_number_t, item_number_as_token_number)
12630 (token_number_as_item_number, muscle_insert_token_number_table):
12631 Rename as...
12632 (symbol_number_t, item_number_as_symbol_number)
12633 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
12634 these, since it is more appropriate.
12635
12636 2002-05-26 Akim Demaille <akim@epita.fr>
12637
12638 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
12639 `Error:' lines.
12640 * data/bison.simple (yystos) [YYDEBUG]: New.
12641 (yyparse) [YYDEBUG]: Display the symbols which are popped during
12642 error recovery.
12643 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
12644
12645 2002-05-25 Akim Demaille <akim@epita.fr>
12646
12647 * doc/bison.texinfo (Debugging): Split into...
12648 (Tracing): this new section, its former contents, and...
12649 (Understanding): this new section.
12650 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
12651 by...
12652 (report_flag): this.
12653 Adjust all dependencies.
12654 (report_args, report_types, report_argmatch): New.
12655 (usage, getargs): Report/support -r, --report.
12656 * src/options.h
12657 (struct option_table_struct): Rename as..,
12658 (struct option_table_s): this.
12659 Rename the `set_flag' member to `flag' to match with getopt_long's
12660 struct.
12661 * src/options.c (option_table): Split verbose into an entry for
12662 %verbose, and another for --verbose.
12663 Support --report/-r, so remove -r from the obsolete --raw.
12664 * src/print.c: Attach full item sets and lookaheads reports to
12665 report_flag instead of trace_flag.
12666 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
12667
12668 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12669 and Paul Eggert <eggert@twinsun.com>
12670
12671 * data/bison.simple (yyparse): Correct error handling to conform to
12672 POSIX and yacc. Specifically, after syntax error is discovered,
12673 do not reduce further before shifting the error token.
12674 Clean up the code a bit by removing the labels yyerrdefault,
12675 yyerrhandle, yyerrpop.
12676 * NEWS: Document the above.
12677
12678 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12679
12680 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
12681 type; it isn't always big enough, since it doesn't necessarily
12682 include non-terminals.
12683 (yytranslate): Expand definition of yy_token_number_type, so that
12684 the latter can be removed.
12685 (yy_token_number_type): Remove, only one use.
12686 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
12687 don't use TokenNumberType as element type.
12688
12689 * tests/regression.at: Modify expected output to agree with change
12690 to yyr1 and yytranslate.
12691
12692 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
12693
12694 * src/reader.c (parse_action): Use copy_character instead of
12695 obstack_1grow.
12696
12697 2002-05-13 Akim Demaille <akim@epita.fr>
12698
12699 * tests/regression.at (Token definitions): Prototype yylex and
12700 yyerror.
12701
12702 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12703
12704 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
12705 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
12706 32-bit arithmetic.
12707 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
12708
12709 2002-05-07 Akim Demaille <akim@epita.fr>
12710
12711 * tests/synclines.at: Be sure to prototype yylex and yyerror to
12712 avoid GCC warnings.
12713
12714 2002-05-07 Akim Demaille <akim@epita.fr>
12715
12716 Kill GCC warnings.
12717
12718 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
12719 over the RHS of each rule.
12720 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
12721 * src/state.h (state_t): Member `nitems' is unsigned short.
12722 * src/LR0.c (get_state): Adjust.
12723 * src/reader.c (packgram): Likewise.
12724 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
12725 `Type'.
12726 (muscle_insert_int_table): Remove, unused.
12727 (prepare_rules): Remove `max'.
12728
12729 2002-05-06 Akim Demaille <akim@epita.fr>
12730
12731 * src/closure.c (print_firsts): Display of the symbol tags.
12732 (bitmatrix_print): Move to...
12733 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
12734 here.
12735 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
12736
12737 2002-05-06 Akim Demaille <akim@epita.fr>
12738
12739 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
12740 hash_do_for_each.
12741
12742 2002-05-06 Akim Demaille <akim@epita.fr>
12743
12744 * src/LR0.c (new_state, get_state): Instead of using the global
12745 `kernel_size' and `kernel_base', have two new arguments:
12746 `core_size' and `core'.
12747 Adjust callers.
12748
12749 2002-05-06 Akim Demaille <akim@epita.fr>
12750
12751 * src/reader.c (packgram): No longer end `ritem' with a 0
12752 sentinel: it is not used.
12753
12754 2002-05-05 Akim Demaille <akim@epita.fr>
12755
12756 New experimental feature: display the lookaheads in the report and
12757 graph.
12758
12759 * src/print (print_core): When --trace-flag, display the rules
12760 lookaheads.
12761 * src/print_graph.c (print_core): Likewise.
12762 Swap the arguments.
12763 Adjust caller.
12764
12765 2002-05-05 Akim Demaille <akim@epita.fr>
12766
12767 * tests/torture.at (Many lookaheads): New test.
12768
12769 2002-05-05 Akim Demaille <akim@epita.fr>
12770
12771 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
12772 (GENERATE_MUSCLE_INSERT_TABLE): this.
12773 (output_int_table, output_unsigned_int_table, output_short_table)
12774 (output_token_number_table, output_item_number_table): Replace with...
12775 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
12776 (muscle_insert_short_table, muscle_insert_token_number_table)
12777 (muscle_insert_item_number_table): these.
12778 Adjust all callers.
12779 (prepare_tokens): Don't free `translations', since...
12780 * src/reader.h, src/reader.c (grammar_free): do it.
12781 Move to...
12782 * src/gram.h, src/gram.c (grammar_free): here.
12783 * data/bison.simple, data/bison.c++: b4_token_number_max is now
12784 b4_translate_max.
12785
12786 2002-05-05 Akim Demaille <akim@epita.fr>
12787
12788 * src/output.c (output_unsigned_int_table): New.
12789 (prepare_rules): `i' is unsigned.
12790 `prhs', `rline', `r2' are unsigned int.
12791 Rename muscle `rhs_number_max' as `rhs_max'.
12792 Output muscles `prhs_max', `rline_max', and `r2_max'.
12793 Free rline and r1.
12794 * data/bison.simple, data/bison.c++: Adjust to use these muscles
12795 to compute types instead of constant types.
12796 * tests/regression.at (Web2c Actions): Adjust.
12797
12798 2002-05-04 Akim Demaille <akim@epita.fr>
12799
12800 * src/symtab.h (SALIAS, SUNDEF): Rename as...
12801 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
12802 Adjust dependencies.
12803 * src/output.c (token_definitions_output): Be sure not to output a
12804 `#define 'a'' when fed with `%token 'a' "a"'.
12805 * tests/regression.at (Token definitions): New.
12806
12807 2002-05-03 Paul Eggert <eggert@twinsun.com>
12808
12809 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
12810 for K&R C.
12811
12812 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
12813
12814 * Makefile.am (SUBDIRS): Remove intl.
12815 (EXTRA_DIST): Add config/config.rpath.
12816
12817 2002-05-03 Akim Demaille <akim@epita.fr>
12818
12819 * data/bison.simple (m4_if): Don't output empty enums.
12820 And actually, output valid enum definitions :(.
12821
12822 2002-05-03 Akim Demaille <akim@epita.fr>
12823
12824 * configure.bat: Remove, completely obsolete.
12825 * Makefile.am (EXTRA_DIST): Adjust.
12826 Don't distribute config.rpath...
12827 * config/Makefile.am (EXTRA_DIST): Do it.
12828
12829 2002-05-03 Akim Demaille <akim@epita.fr>
12830
12831 * configure.in (GETTEXT_VERSION): New.
12832 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
12833
12834 2002-05-03 Akim Demaille <akim@epita.fr>
12835
12836 * data/bison.simple (b4_token_enum): New.
12837 (b4_token_defines): Use it to output tokens both as #define and
12838 enums.
12839 Suggested by Paul Eggert.
12840 * src/output.c (token_definitions_output): Don't output spurious
12841 white spaces.
12842
12843 2002-05-03 Akim Demaille <akim@epita.fr>
12844
12845 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12846
12847 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
12848
12849 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
12850 Update the stack class, give a try to deque as the default container.
12851
12852 2002-05-02 Akim Demaille <akim@epita.fr>
12853
12854 * data/bison.simple (yyparse): Do not implement @$ = @1.
12855 (YYLLOC_DEFAULT): Adjust to do it.
12856 * doc/bison.texinfo (Location Default Action): Fix.
12857
12858 2002-05-02 Akim Demaille <akim@epita.fr>
12859
12860 * src/reader.c (parse_braces): Merge into...
12861 (parse_action): this.
12862
12863 2002-05-02 Akim Demaille <akim@epita.fr>
12864
12865 * configure.in (ALL_LINGUAS): Remove.
12866 * po/LINGUAS, hr.po: New.
12867
12868 2002-05-02 Akim Demaille <akim@epita.fr>
12869
12870 Remove the so called hairy (semantic) parsers.
12871
12872 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
12873 * src/gram.h, src/gram.c (semantic_parser): Remove.
12874 (rule_t): Remove the guard and guard_line members.
12875 * src/lex.h (token_t): remove tok_guard.
12876 * src/options.c (option_table): Remove %guard and %semantic_parser
12877 support.
12878 * src/output.c, src/output.h (guards_output): Remove.
12879 (prepare): Adjust.
12880 (token_definitions_output): Don't output the `T'
12881 tokens (???).
12882 (output_skeleton): Don't output the guards.
12883 * src/files.c, src/files.c (attrsfile): Remove.
12884 * src/reader.c (symbol_list): Remove the guard and guard_line
12885 members.
12886 Adjust dependencies.
12887 (parse_guard): Remove.
12888 * data/bison.hairy: Remove.
12889 * doc/bison.texinfo (Environment Variables): Remove occurrences of
12890 BISON_HAIRY.
12891
12892 2002-05-02 Akim Demaille <akim@epita.fr>
12893
12894 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
12895 (parse_guard): Rename the formal argument `stack_offset' as
12896 `rule_length', which is more readable.
12897 Adjust callers.
12898 (copy_at, copy_dollar): Instead of outputting the hard coded
12899 values of $$, $n and so forth, output invocation to b4_lhs_value,
12900 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
12901 Note: this patch partially drops `semantic-parser' support: it
12902 always does `rule_length - n', where semantic parsers ought to
12903 always use `-n'.
12904 * data/bison.simple, data/bison.c++ (b4_lhs_value)
12905 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12906
12907 2002-05-02 Akim Demaille <akim@epita.fr>
12908
12909 * configure.in (AC_INIT): Bump to 1.49b.
12910 (AM_INIT_AUTOMAKE): Short invocation.
12911
12912 2002-05-02 Akim Demaille <akim@epita.fr>
12913
12914 Version 1.49a.
12915
12916 2002-05-01 Akim Demaille <akim@epita.fr>
12917
12918 * src/skeleton.h: Remove.
12919
12920 2002-05-01 Akim Demaille <akim@epita.fr>
12921
12922 * src/skeleton.h: Fix the #endif.
12923 Reported by Magnus Fromreide.
12924
12925 2002-04-26 Paul Eggert <eggert@twinsun.com>
12926
12927 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
12928 Define if we define YYSTYPE and YYLTYPE, respectively.
12929 (YYCOPY): Fix [] quoting problem in the non-GCC case.
12930
12931 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
12932
12933 * src/scan-skel.l: Postprocess quadrigraphs.
12934
12935 * src/reader.c (copy_character): New function, used to output
12936 single characters while replacing `[' and `]' with quadrigraphs, to
12937 avoid troubles with M4 quotes.
12938 (copy_comment): Output characters with copy_character.
12939 (read_additionnal_code): Likewise.
12940 (copy_string2): Likewise.
12941 (copy_definition): Likewise.
12942
12943 * tests/calc.at: Exercise M4 quoting.
12944
12945 2002-04-25 Akim Demaille <akim@epita.fr>
12946
12947 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
12948 between `!' and the command.
12949 Reported by Paul Eggert.
12950
12951 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
12952
12953 * tests/calc.at: Exercise prologue splitting.
12954
12955 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
12956 `b4_post_prologue' instead of `b4_prologue'.
12957
12958 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
12959 muscles.
12960 (output): Free pre_prologue_obstack and post_prologue_obstack.
12961 * src/files.h, src/files.c (attrs_obstack): Remove.
12962 (pre_prologue_obstack, post_prologue_obstack): New.
12963 * src/reader.c (copy_definition): Add a parameter to specify the
12964 obstack to fill, instead of using attrs_obstack unconditionally.
12965 (read_declarations): Pass pre_prologue_obstack to copy_definition if
12966 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
12967
12968 2002-04-23 Paul Eggert <eggert@twinsun.com>
12969
12970 * data/bison.simple: Remove unnecessary commentary and white
12971 space differences from 1_29-branch.
12972 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
12973
12974 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
12975 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
12976 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
12977 constructors or destructors.
12978
12979 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
12980
12981 2002-04-23 Akim Demaille <akim@epita.fr>
12982
12983 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
12984 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
12985 location with columns.
12986 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
12987 All reported by Paul Eggert.
12988
12989 2002-04-22 Akim Demaille <akim@epita.fr>
12990
12991 * src/reduce.c (dump_grammar): Move to...
12992 * src/gram.h, src/gram.c (grammar_dump): here.
12993 Be sure to separate long item numbers.
12994 Don't read the members of a rule's prec if its nil.
12995
12996 2002-04-22 Akim Demaille <akim@epita.fr>
12997
12998 * src/output.c (table_size, table_grow): New.
12999 (MAXTABLE): Remove, replace uses with table_size.
13000 (pack_vector): Instead of dying when the table is too big, grow it.
13001
13002 2002-04-22 Akim Demaille <akim@epita.fr>
13003
13004 * data/bison.simple (yyr1): Its type is that of a token number.
13005 * data/bison.c++ (r1_): Likewise.
13006 * tests/regression.at (Web2c Actions): Adjust.
13007
13008 2002-04-22 Akim Demaille <akim@epita.fr>
13009
13010 * src/reader.c (token_translations_init): 256 is now the default
13011 value for the error token, i.e., it will be assigned another
13012 number if the user assigned 256 to one of her tokens.
13013 (reader): Don't force 256 to error.
13014 * doc/bison.texinfo (Symbols): Adjust.
13015 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
13016 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
13017 etc. instead of 10, 20, 30 (which was used to `jump' over error
13018 (256) and undefined (2)).
13019
13020 2002-04-22 Akim Demaille <akim@epita.fr>
13021
13022 Propagate more token_number_t.
13023
13024 * src/gram.h (token_number_as_item_number)
13025 (item_number_as_token_number): New.
13026 * src/output.c (GENERATE_OUTPUT_TABLE): New.
13027 Use it to create output_item_number_table and
13028 output_token_number_table.
13029 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13030 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
13031 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
13032 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
13033
13034 2002-04-22 Akim Demaille <akim@epita.fr>
13035
13036 * src/output.h, src/output.c (get_lines_number): Remove.
13037
13038 2002-04-19 Akim Demaille <akim@epita.fr>
13039
13040 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
13041 as Lex/Flex'.
13042 (Debugging): More details about enabling the debugging features.
13043 (Table of Symbols): Describe $$, $n, @$, and @n.
13044 Suggested by Tim Josling.
13045
13046 2002-04-19 Akim Demaille <akim@epita.fr>
13047
13048 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
13049
13050 2002-04-10 Akim Demaille <akim@epita.fr>
13051
13052 * src/system.h: Rely on HAVE_LIMITS_H.
13053 Suggested by Paul Eggert.
13054
13055 2002-04-09 Akim Demaille <akim@epita.fr>
13056
13057 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
13058 full stderr, and strip it according to the bison options, instead
13059 of composing the error message from different bits.
13060 This makes it easier to check for several error messages.
13061 Adjust all the invocations.
13062 Add an invocation exercising the error token.
13063 Add an invocation demonstrating a stupid error message.
13064 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
13065 Adjust the tests.
13066 Error message are for stderr, not stdout.
13067
13068 2002-04-09 Akim Demaille <akim@epita.fr>
13069
13070 * src/gram.h, src/gram.c (error_token_number): Remove, use
13071 errtoken->number.
13072 * src/reader.c (reader): Don't specify the user token number (2)
13073 for $undefined, as it uselessly prevents using it.
13074 * src/gram.h (token_number_t): Move to...
13075 * src/symtab.h: here.
13076 (state_t.number): Is a token_number_t.
13077 * src/print.c, src/reader.c: Use undeftoken->number instead of
13078 hard coded 2.
13079 (Even though this 2 is not the same as above: the number of the
13080 undeftoken remains being 2, it is its user token number which
13081 might not be 2).
13082 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
13083 `user_token_number_max'.
13084 Output `undef_token_number'.
13085 * data/bison.simple, data/bison.c++: Use them.
13086 Be sure to map invalid yylex return values to
13087 `undef_token_number'. This saves us from gratuitous SEGV.
13088
13089 * tests/conflicts.at (Solved SR Conflicts)
13090 (Unresolved SR Conflicts): Adjust.
13091 * tests/regression.at (Web2c Actions): Adjust.
13092
13093 2002-04-08 Akim Demaille <akim@epita.fr>
13094
13095 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
13096 Adding #line.
13097 Remove the duplicate `typedefs'.
13098 (RhsNumberType): Fix the declaration and various other typos.
13099 Use __ofile__.
13100 * data/bison.simple: Use __ofile__.
13101 * src/scan-skel.l: Handle __ofile__.
13102
13103 2002-04-08 Akim Demaille <akim@epita.fr>
13104
13105 * src/gram.h (item_number_t): New, the type of item numbers in
13106 RITEM. Note that it must be able to code symbol numbers as
13107 positive number, and the negation of rule numbers as negative
13108 numbers.
13109 Adjust all dependencies (pretty many).
13110 * src/reduce.c (rule): Remove this `short *' pointer: use
13111 item_number_t.
13112 * src/system.h (MINSHORT, MAXSHORT): Remove.
13113 Include `limits.h'.
13114 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
13115 (shortcpy): Remove.
13116 (MAXTABLE): Move to...
13117 * src/output.c (MAXTABLE): here.
13118 (prepare_rules): Use output_int_table to output rhs.
13119 * data/bison.simple, data/bison.c++: Adjust.
13120 * tests/torture.at (Big triangle): Move the limit from 254 to
13121 500.
13122 * tests/regression.at (Web2c Actions): Ajust.
13123
13124 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
13125 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
13126 passes, but produces negative #line number, once fixed, GCC is
13127 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
13128 C), it passes.
13129 * src/state.h (state_h): Code input lines on ints, not shorts.
13130
13131 2002-04-08 Akim Demaille <akim@epita.fr>
13132
13133 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
13134 and then the grammar.
13135
13136 2002-04-08 Akim Demaille <akim@epita.fr>
13137
13138 * src/system.h: No longer using strndup.
13139
13140 2002-04-07 Akim Demaille <akim@epita.fr>
13141
13142 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
13143 * src/output.c (output_table_data): Return the longest number.
13144 (prepare_tokens): Output `token_number_max').
13145 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
13146 New.
13147 Use them to define yy_token_number_type/TokenNumberType.
13148 Use this type for yytranslate.
13149 * tests/torture.at (Big triangle): Push the limit from 124 to
13150 253.
13151 * tests/regression.at (Web2c Actions): Adjust.
13152
13153 2002-04-07 Akim Demaille <akim@epita.fr>
13154
13155 * tests/torture.at (Big triangle): New.
13156 (GNU AWK Grammar, GNU Cim Grammar): Move to...
13157 * tests/existing.at: here.
13158
13159 2002-04-07 Akim Demaille <akim@epita.fr>
13160
13161 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
13162 nritems.
13163 Adjust dependencies.
13164
13165 2002-04-07 Akim Demaille <akim@epita.fr>
13166
13167 * src/reader.c: Normalize increments to prefix form.
13168
13169 2002-04-07 Akim Demaille <akim@epita.fr>
13170
13171 * src/reader.c, symtab.c: Remove debugging code.
13172
13173 2002-04-07 Akim Demaille <akim@epita.fr>
13174
13175 Rename all the `bucket's as `symbol_t'.
13176
13177 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
13178 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
13179 * src/symtab.c, src/symtab.h (bucket): Rename as...
13180 (symbol_t): this.
13181 (symbol_list_new, bucket_check_defined, bucket_make_alias)
13182 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
13183 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13184 (buckets_new, buckets_free, buckets_do): Rename as...
13185 (symbol_list_new, symbol_check_defined, symbol_make_alias)
13186 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13187 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
13188 (symbols_new, symbols_free, symbols_do): these.
13189
13190 2002-04-07 Akim Demaille <akim@epita.fr>
13191
13192 Use lib/hash for the symbol table.
13193
13194 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
13195 EOF.
13196 * src/lex.c (lex): Set the `number' member of new terminals.
13197 * src/reader.c (bucket_check_defined, bucket_make_alias)
13198 (bucket_check_alias_consistence, bucket_translation): New.
13199 (reader, grammar_free, readgram, token_translations_init)
13200 (packsymbols): Adjust.
13201 (reader): Number the predefined tokens.
13202 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
13203 for predefined tokens.
13204 * src/symtab.h (bucket): Remove all the hash table related
13205 members.
13206 * src/symtab.c (symtab): Replace by...
13207 (bucket_table): this.
13208 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13209 (buckets_new, buckets_do): New.
13210
13211 2002-04-07 Akim Demaille <akim@epita.fr>
13212
13213 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
13214 (start_symbol, max_user_token_number, semantic_parser)
13215 (error_token_number): Initialize.
13216 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
13217 Initialize.
13218 (reader): Don't.
13219 (errtoken, eoftoken, undeftoken, axiom): Extern.
13220
13221 2002-04-07 Akim Demaille <akim@epita.fr>
13222
13223 * src/gram.h (rule_s): prec and precsym are now pointers
13224 to the bucket giving the priority/associativity.
13225 Member `associativity' removed: useless.
13226 * src/reduce.c, src/conflicts.c: Adjust.
13227
13228 2002-04-07 Akim Demaille <akim@epita.fr>
13229
13230 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
13231 Properly escape the symbols' TAG when outputting them.
13232
13233 2002-04-07 Akim Demaille <akim@epita.fr>
13234
13235 * src/lalr.h (LA): Is a bitsetv, not bitset*.
13236
13237 2002-04-07 Akim Demaille <akim@epita.fr>
13238
13239 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
13240 (LArule): this, which is an array to rule_t*.
13241 * src/print.c, src/conflicts.c: Adjust.
13242
13243 2002-04-07 Akim Demaille <akim@epita.fr>
13244
13245 * src/gram.h (rule_t): Rename `number' as `user_number'.
13246 `number' is a new member.
13247 Adjust dependencies.
13248 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
13249
13250 2002-04-07 Akim Demaille <akim@epita.fr>
13251
13252 As a result of the previous patch, it is no longer needed
13253 to reorder ritem itself.
13254
13255 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
13256
13257 2002-04-07 Akim Demaille <akim@epita.fr>
13258
13259 Be sure never to walk through RITEMS, but use only data related to
13260 the rules themselves. RITEMS should be banished.
13261
13262 * src/output.c (output_token_translations): Rename as...
13263 (prepare_tokens): this.
13264 In addition to `translate', prepare the muscles `tname' and
13265 `toknum', which were handled by...
13266 (output_rule_data): this.
13267 Remove, and move the remainder of its outputs into...
13268 (prepare_rules): this new routines, which also merges content from
13269 (output_gram): this.
13270 (prepare_rules): Be sure never to walk through RITEMS.
13271 (output_stos): Rename as...
13272 (prepare_stos): this.
13273 (output): Always invoke prepare_states, after all, just don't use it
13274 in the output if you don't need it.
13275
13276 2002-04-07 Akim Demaille <akim@epita.fr>
13277
13278 * src/LR0.c (new_state): Display `nstates' as the name of the
13279 newly created state.
13280 Adjust to initialize first_state and last_state if needed.
13281 Be sure to distinguish the initial from the final state.
13282 (new_states): Create the itemset of the initial state, and use
13283 new_state.
13284 * src/closure.c (closure): Now that the initial state has its
13285 items properly set, there is no need for a special case when
13286 creating `ruleset'.
13287
13288 As a result, now the rule 0, reducing to $axiom, is visible in the
13289 outputs. Adjust the test suite.
13290
13291 * tests/conflicts.at (Solved SR Conflicts)
13292 (Unresolved SR Conflicts): Adjust.
13293 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
13294 * tests/conflicts.at (S/R in initial): New.
13295
13296 2002-04-07 Akim Demaille <akim@epita.fr>
13297
13298 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
13299 the RHS of the rules.
13300 * src/output.c (output_gram): Likewise.
13301
13302 2002-04-07 Akim Demaille <akim@epita.fr>
13303
13304 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
13305 bucket.
13306 Adjust all dependencies.
13307 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
13308 `number' of the buckets too.
13309 * src/gram.h: Include `symtab.h'.
13310 (associativity): Move to...
13311 * src/symtab.h: here.
13312 No longer include `gram.h'.
13313
13314 2002-04-07 Akim Demaille <akim@epita.fr>
13315
13316 * src/gram.h, src/gram.c (rules_rhs_length): New.
13317 (ritem_longest_rhs): Use it.
13318 * src/gram.h (rule_t): `number' is a new member.
13319 * src/reader.c (packgram): Set it.
13320 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
13321 the end of `rules', and count them out of `nrules'.
13322 (reduce_output, dump_grammar): Adjust.
13323 * src/print.c (print_grammar): It is no longer needed to check for
13324 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
13325 * tests/reduce.at (Reduced Automaton): New test.
13326
13327 2002-04-07 Akim Demaille <akim@epita.fr>
13328
13329 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
13330 lacking `+ 1' to nrules, Bison reported as useless a token if it
13331 was used solely to set the precedence of the last rule...
13332
13333 2002-04-07 Akim Demaille <akim@epita.fr>
13334
13335 * data/bison.c++, data/bison.simple: Don't output the current file
13336 name in #line, to avoid useless diffs between two identical
13337 outputs under different names.
13338
13339 2002-04-07 Akim Demaille <akim@epita.fr>
13340
13341 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
13342 Normalize loops to using `< nrules + 1', not `<= nrules'.
13343
13344 2002-04-07 Akim Demaille <akim@epita.fr>
13345
13346 * TODO: Update.
13347
13348 2002-04-07 Akim Demaille <akim@epita.fr>
13349
13350 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
13351 bucket.value as bucket.number.
13352
13353 2002-04-07 Akim Demaille <akim@epita.fr>
13354
13355 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
13356 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13357 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
13358 RHS, instead of being an index in RITEMS.
13359
13360 2002-04-04 Paul Eggert <eggert@twinsun.com>
13361
13362 * doc/bison.texinfo: Update copyright date.
13363 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
13364 (Symbols): Warn about running Bison in one character set,
13365 but compiling and/or running in an incompatible one.
13366 Warn about character code 256, too.
13367
13368 2002-04-03 Paul Eggert <eggert@twinsun.com>
13369
13370 * src/bison.data (YYSTACK_ALLOC): Depend on whether
13371 YYERROR_VERBOSE is nonzero, not whether it is defined.
13372
13373 Merge changes from bison-1_29-branch.
13374
13375 2002-03-20 Paul Eggert <eggert@twinsun.com>
13376
13377 Merge fixes from Debian bison_1.34-1.diff.
13378
13379 * configure.in (AC_PREREQ): 2.53.
13380
13381 2002-03-20 Akim Demaille <akim@epita.fr>
13382
13383 * src/conflicts.c (log_resolution): Argument `resolution' is const.
13384
13385 2002-03-19 Paul Eggert <eggert@twinsun.com>
13386
13387 * src/bison.simple (YYCOPY): New macro.
13388 (YYSTACK_RELOCATE): Use it.
13389 Remove Type arg; no longer needed. All callers changed.
13390 (yymemcpy): Remove; no longer needed.
13391
13392 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
13393 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13394
13395 2002-03-19 Akim Demaille <akim@epita.fr>
13396
13397 Test and fix the #line outputs.
13398
13399 * tests/atlocal.at (GCC): New.
13400 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
13401 (Prologue synch line, %union synch line, Postprologue synch line)
13402 (Action synch line, Epilogue synch line): New tests.
13403 * src/reader.c (parse_union_decl): Define the muscle stype_line.
13404 * data/bison.simple, data/bison.c++: Use it.
13405
13406 2002-03-19 Akim Demaille <akim@epita.fr>
13407
13408 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
13409 (Solved SR Conflicts, %expect not enough, %expect right)
13410 (%expect too much): Move to...
13411 * tests/conflicts.at: this new file.
13412
13413 2002-03-19 Akim Demaille <akim@epita.fr>
13414
13415 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13416 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
13417 that we can move to enums for instance.
13418 * src/output.c (token_definitions_output): Output a list of
13419 `token-name, token-number' instead of the #define.
13420 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
13421
13422 2002-03-14 Akim Demaille <akim@epita.fr>
13423
13424 Use Gettext 0.11.1.
13425
13426 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
13427
13428 * data/bison.c++: Make the user able to add members to the generated
13429 parser by subclassing.
13430
13431 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
13432
13433 * src/reader.c (read_additionnal_code): `c' should be an integer, not
13434 a character.
13435 Reported by Nicolas Tisserand and Nicolas Burrus.
13436
13437 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
13438
13439 * src/reader.c: Warn about lacking semi-colons, do not complain.
13440
13441 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
13442
13443 * data/bison.c++: Remove a debug line.
13444
13445 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
13446
13447 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
13448 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
13449 provide a default implementation.
13450
13451 2002-03-04 Akim Demaille <akim@epita.fr>
13452
13453 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
13454 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
13455 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
13456 * tests/semantic.at (Parsing Guards): Similarly.
13457 * src/reader.at (readgram): Complain if the last rule is not ended
13458 with a semi-colon.
13459
13460 2002-03-04 Akim Demaille <akim@epita.fr>
13461
13462 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
13463 * src/closure.c: here.
13464 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
13465 RTC.
13466 * src/warshall.h, src/warshall.c: Remove.
13467 * tests/sets.at (Broken Closure): Adjust.
13468
13469 2002-03-04 Akim Demaille <akim@epita.fr>
13470
13471 * src/output.c (output_skeleton): tempdir is const.
13472 bytes_read is unused.
13473
13474 2002-03-04 Akim Demaille <akim@epita.fr>
13475
13476 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13477 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
13478 Update.
13479 From Michael Hayes.
13480
13481 2002-03-04 Akim Demaille <akim@epita.fr>
13482
13483 * src/closure.c (closure): `r' is unused.
13484
13485 2002-03-04 Akim Demaille <akim@epita.fr>
13486
13487 * tests/sets.at (Broken Closure): Add the ending `;'.
13488 * src/reader.at (readgram): Complain if a rule is not ended with a
13489 semi-colon.
13490
13491 2002-03-04 Akim Demaille <akim@epita.fr>
13492
13493 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
13494 (count_sr_conflicts): Use bitset_count.
13495 * src/reduce.c (inaccessable_symbols): Ditto.
13496 (bits_size): Remove.
13497 * src/warshall.h, src/warshall.c: Convert to bitsetv.
13498
13499 2002-03-04 Akim Demaille <akim@epita.fr>
13500
13501 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
13502 * src/reduce.c: Remove the `bitset_zero's following the
13503 `bitset_create's, as now it is performed by the latter.
13504
13505 2002-03-04 Akim Demaille <akim@epita.fr>
13506
13507 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
13508 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
13509 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
13510 latest sources from Michael.
13511
13512 2002-03-04 Akim Demaille <akim@epita.fr>
13513
13514 * src/output.c (output): Don't free the grammar.
13515 * src/reader.c (grammar_free): New.
13516 * src/main.c (main): Call it and don't free symtab here.
13517
13518 2002-03-04 Akim Demaille <akim@epita.fr>
13519
13520 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
13521 before returning.
13522 Reported by Benoit Perrot.
13523
13524 2002-03-04 Akim Demaille <akim@epita.fr>
13525
13526 Use bitset operations when possible, not loops over bits.
13527
13528 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
13529 bitset_or.
13530 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
13531 * src/reduce.c (useless_nonterminals): Formatting changes.
13532 * src/warshall.c (TC): Use bitset_or.
13533
13534 2002-03-04 Akim Demaille <akim@epita.fr>
13535
13536 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
13537 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
13538 Ditto.
13539
13540 2002-03-04 Akim Demaille <akim@epita.fr>
13541
13542 * src/lalr.c (F): Now a bitset*.
13543 Adjust all dependencies.
13544
13545 2002-03-04 Akim Demaille <akim@epita.fr>
13546
13547 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
13548 Adjust all dependencies.
13549
13550 2002-03-04 Akim Demaille <akim@epita.fr>
13551
13552 * src/L0.c, src/LR0.h (nstates): Be size_t.
13553 Adjust comparisons (signed vs unsigned).
13554 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
13555 bitset*.
13556 Adjust all dependencies.
13557
13558 2002-03-04 Akim Demaille <akim@epita.fr>
13559
13560 * src/closure.c (firsts): Now, also a bitset.
13561 Adjust all dependencies.
13562 (varsetsize): Remove, now unused.
13563 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
13564
13565 2002-03-04 Akim Demaille <akim@epita.fr>
13566
13567 * src/print.c: Convert to use bitset.h, not hand coded iterations
13568 over ints.
13569
13570 2002-03-04 Akim Demaille <akim@epita.fr>
13571
13572 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
13573
13574 2002-03-04 Akim Demaille <akim@epita.fr>
13575
13576 * src/closure.c (ruleset): Be a bitset.
13577 (rulesetsize): Remove.
13578
13579 2002-03-04 Akim Demaille <akim@epita.fr>
13580
13581 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13582 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
13583 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
13584 * src/closure.c (fderives): Be an array of bitsets.
13585
13586 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
13587
13588 * data/bison.c++: Merge the two generated headers. Insert a copyright
13589 notice in each output file.
13590
13591 2002-02-28 Akim Demaille <akim@epita.fr>
13592
13593 * data/bison.c++: Copy the prologue of bison.simple to fetch
13594 useful M4 definitions, such as b4_header_guard.
13595
13596 2002-02-25 Akim Demaille <akim@epita.fr>
13597
13598 * src/getargs.c (version): Give the name of the authors, and use a
13599 translator friendly scheme for the bgr
13600 copyright notice.
13601
13602 2002-02-25 Akim Demaille <akim@epita.fr>
13603
13604 * src/output.c (header_output): Remove, now handled completely via
13605 M4.
13606
13607 2002-02-25 Akim Demaille <akim@epita.fr>
13608
13609 * m4/m4.m4: New, from CVS Autoconf.
13610 * configure.in: Invoke it.
13611 * src/output.c (output_skeleton): Use its result instead of the
13612 hard coded name.
13613
13614 2002-02-25 Akim Demaille <akim@epita.fr>
13615
13616 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
13617 Fileutils 4.1.5.
13618 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
13619 * src/output.c (output_skeleton): Use mkstemp to create a real
13620 temporary file.
13621 Move the filling of `skeleton' and its muscle to...
13622 (prepare): here.
13623 (output): Move the definition of the prologue muscle to...
13624 (prepare): here.
13625 * src/system.h (DEFAULT_TMPDIR): New.
13626
13627 2002-02-14 Paul Eggert <eggert@twinsun.com>
13628
13629 Remove the support for C++ namespace cleanliness; it was
13630 causing more problems than it was curing, since it didn't work
13631 properly on some nonstandard C++ compilers. This can wait
13632 for a proper C++ parser.
13633
13634 * NEWS: Document this.
13635 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
13636 of C++, as it's treated like C now.
13637 * src/bison.simple (YYSTD): Remove.
13638 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
13639 Treat C++ just like Standard C instead of trying to support
13640 namespace cleanliness.
13641
13642 2002-02-14 Akim Demaille <akim@epita.fr>
13643
13644 * tests/regression.at (else): Adjust to Andreas' change.
13645
13646 2002-02-14 Akim Demaille <akim@epita.fr>
13647
13648 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
13649
13650 2002-02-13 Andreas Schwab <schwab@suse.de>
13651
13652 * src/output.c (output_rule_data): Don't output NULL, it might
13653 not be defined yet.
13654
13655 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
13656
13657 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
13658 (Copyright notice): Update.
13659
13660 2002-02-11 Akim Demaille <akim@epita.fr>
13661
13662 * tests/regression.at (%nonassoc and eof): Don't include
13663 nonportable headers.
13664
13665 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
13666
13667 * data/bison.c++: Correct error recovery. Make the user able to
13668 initialize the starting location.
13669
13670 2002-02-07 Akim Demaille <akim@epita.fr>
13671
13672 * tests/input.at: New.
13673
13674 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13675
13676 * data/bison.c++: Replace some direct m4 expansions by constants. Be
13677 more consistent when naming methods and variables. Put preprocessor
13678 directives around tables only needed for debugging.
13679
13680 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13681
13682 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
13683 C++ parsers.
13684 (yy::b4_name::parse): Use print_.
13685
13686 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13687
13688 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
13689
13690 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13691
13692 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
13693 C++ parsers.
13694 (yy::b4_name::parse): Build verbose error messages, and use error_.
13695
13696 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
13697
13698 * data/bison.c++: Fix m4 quoting in comments.
13699
13700 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
13701
13702 * data/bison.c++: Adjust the parser code. Fix some muscles that were
13703 not expanded by m4.
13704
13705 2002-02-05 Akim Demaille <akim@epita.fr>
13706
13707 * data/bison.c++: Adjust to the M4 back end.
13708 More is certainly needed.
13709
13710 2002-02-05 Akim Demaille <akim@epita.fr>
13711
13712 Give a try to M4 as a back end.
13713
13714 * lib/readpipe.c: New, from wdiff.
13715 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
13716 BISON_HAIRY.
13717 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
13718 specific values. Now it is m4 that performs the lookup.
13719 * src/parse-skel.y: Remove.
13720 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
13721 * src/output.c (actions_output, guards_output)
13722 (token_definitions_output): No longer keeps track of the output
13723 line number, hence remove the second argument.
13724 (guards_output): Check against the guard member of a rule, not the
13725 action member.
13726 Adjust callers.
13727 (output_skeleton): Don't look for the skeleton location, let m4 do
13728 that.
13729 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
13730 file will be used.
13731 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
13732 (prepare): Given that for the time being changesyntax is not
13733 usable in M4, rename the muscles using `-' to `_'.
13734 Define `defines_flag', `output_parser_name' and `output_header_name'.
13735 * src/output.h (actions_output, guards_output)
13736 (token_definitions_output): Adjust prototypes.
13737 * src/scan-skel.l: Instead of scanning the skeletons, it now
13738 processes the output of m4: `__oline__' and `#output'.
13739 * data/bison.simple: Adjust to be used by M4(sugar).
13740 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
13741 to date.
13742 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
13743 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
13744 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
13745 shamelessly stolen from CVS Autoconf.
13746
13747 2002-02-05 Akim Demaille <akim@epita.fr>
13748
13749 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
13750 * configure.in: Check for the declarations of free and malloc.
13751 * src/muscle_tab.c: Adjust.
13752
13753 2002-02-05 Akim Demaille <akim@epita.fr>
13754
13755 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
13756 which have no values.
13757
13758 2002-02-05 Akim Demaille <akim@epita.fr>
13759
13760 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
13761 * data/: here.
13762
13763 2002-01-29 Paul Eggert <eggert@twinsun.com>
13764
13765 * src/bison.simple (YYSIZE_T): Do not define merely because
13766 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
13767 On some platforms, <alloca.h> does not declare YYSTD (size_t).
13768
13769 2002-01-27 Akim Demaille <akim@epita.fr>
13770
13771 Fix `%nonassoc and eof'.
13772
13773 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
13774 which were not properly copied! Replace
13775 memcpy (res->errs, src->errs, src->nerrs);
13776 with
13777 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
13778 !!!
13779 * tests/regression.at (%nonassoc and eof): Adjust to newest
13780 Autotest: `.' is not in the PATH.
13781
13782 2002-01-27 Akim Demaille <akim@epita.fr>
13783
13784 * tests/sets.at (AT_EXTRACT_SETS): New.
13785 (Nullable): Use it.
13786 (Firsts): New.
13787
13788 2002-01-26 Akim Demaille <akim@epita.fr>
13789
13790 * tests/actions.at, tests/calc.at, tests/headers.at,
13791 * tests/torture.at: Adjust to the newest Autotest which no longer
13792 forces `.' in the PATH.
13793
13794 2002-01-25 Akim Demaille <akim@epita.fr>
13795
13796 * tests/regression.at (%nonassoc and eof): New.
13797 Suggested by Robert Anisko.
13798
13799 2002-01-24 Akim Demaille <akim@epita.fr>
13800
13801 Bison dumps core when trying to complain about broken input files.
13802 Reported by Cris van Pelt.
13803
13804 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
13805 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
13806 into...
13807 (Invalid inputs): Strengthen: exercise parse_percent_token.
13808
13809 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
13810
13811 * src/Makefile.am: Add bison.c++.
13812 * src/bison.c++: New skeleton.
13813
13814 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
13815
13816 * po/it.po: New.
13817
13818 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
13819
13820 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
13821
13822 2002-01-20 Marc Autret <marc@gnu.org>
13823
13824 * src/files.c (compute_output_file_names): Fix
13825
13826 2002-01-20 Marc Autret <marc@gnu.org>
13827
13828 * tests/output.at: New test.
13829 * src/files.c (compute_base_names): Don't map extensions when
13830 the YACC flag is set, use defaults.
13831 Reported by Evgeny Stambulchik.
13832
13833 2002-01-20 Marc Autret <marc@gnu.org>
13834
13835 * src/system.h: Need to define __attribute__ away for non-GCC
13836 compilers as well (i.e., the vendor C compiler).
13837 Suggested by Albert Chin-A-Young.
13838
13839 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
13840
13841 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
13842 canonical definition.
13843 * src/system.h: Use the canonical definition for PARAMS (avoids
13844 a conflict with the macro from lib/hash.h).
13845
13846 2002-01-11 Akim Demaille <akim@epita.fr>
13847
13848 * configure.in: Use AC_FUNC_STRNLEN.
13849 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
13850
13851 2002-01-09 Akim Demaille <akim@epita.fr>
13852
13853 * src/files.c, src/files.h (output_infix): New.
13854 (tab_extension): Remove.
13855 (compute_base_names): Compute the former, drop the latter.
13856 * src/output.c (prepare): Insert the muscles `output-infix', and
13857 `output-suffix'.
13858 * src/parse-skel.y (string, string.1): New.
13859 (section.header): Use it.
13860 (section.yacc): Remove.
13861 (prefix): Remove too.
13862 * src/scan-skel.l: Adjust.
13863 * src/bison.simple, src/bison.hairy: Adjust.
13864
13865 2002-01-09 Akim Demaille <akim@epita.fr>
13866
13867 * configure.in (WERROR_CFLAGS): Compute it.
13868 * src/Makefile.am (CFLAGS): Pass it.
13869 * tests/atlocal.in (CFLAGS): Idem.
13870 * src/files.c: Fix a few warnings.
13871 (get_extension_index): Remove, unused.
13872
13873 2002-01-08 Akim Demaille <akim@epita.fr>
13874
13875 * src/getargs.c (AS_FILE_NAME): New.
13876 (getargs): Use it to convert DOSish file names.
13877 * src/files.c (base_name): Rename as full_base_name to avoid
13878 clashes with `base_name ()'.
13879 (filename_split): New.
13880 (compute_base_names): N-th rewrite, using filename_split.
13881
13882 2002-01-08 Akim Demaille <akim@epita.fr>
13883
13884 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
13885 New, stolen from the Fileutils 4.1.
13886 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13887 * configure.in: Check for the presence of memrchr, and of its
13888 prototype.
13889
13890 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
13891
13892 * lib/hash.h (__P): Added definition for this macro.
13893 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
13894 BUILT_SOURCES, to ensure they are generated first.
13895 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
13896 %error-verbose to allow bootstrapping with bison 1.30x.
13897
13898 2002-01-06 Akim Demaille <akim@epita.fr>
13899
13900 * src/reader.c (parse_braces): Don't fetch the next char, the
13901 convention is to fetch on entry.
13902 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
13903 'switch' without a following semicolon.
13904 * tests/regression.at (braces parsing): New.
13905
13906 2002-01-06 Akim Demaille <akim@epita.fr>
13907
13908 Bison is dead wrong in its RR conflict reports.
13909
13910 * tests/torture.at (GNU Cim Grammar): New.
13911 * src/conflicts.c (count_rr_conflicts): Fix.
13912
13913 2002-01-06 Akim Demaille <akim@epita.fr>
13914
13915 Creating package.m4 from configure.ac causes too many problems.
13916
13917 * tests/Makefile.am (package.m4): Create it by hand,
13918 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
13919
13920 2002-01-06 Akim Demaille <akim@epita.fr>
13921
13922 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
13923 skeleton.h.
13924
13925 2002-01-04 Paul Eggert <eggert@twinsun.com>
13926
13927 * doc/bison.texinfo (Debugging):
13928 Remove YYSTDERR; it's no longer defined or used.
13929 Also, s/cstdio.h/cstdio/.
13930
13931 2002-01-03 Akim Demaille <akim@epita.fr>
13932
13933 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
13934
13935 2002-01-03 Akim Demaille <akim@epita.fr>
13936
13937 * src/parse-skel.y (process_skeleton): Don't bind the parser's
13938 tracing code to --trace, wait for a better --trace option, with
13939 args.
13940
13941 2002-01-03 Akim Demaille <akim@epita.fr>
13942
13943 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
13944 The ISO C++ standard is extremely clear about it: stderr is
13945 considered a macro, not a regular symbol (see table 94 `Header
13946 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
13947 Therefore std:: does not apply to it. It still does with fprintf.
13948 Also, s/cstdio.h/cstdio/.
13949
13950 2002-01-03 Akim Demaille <akim@epita.fr>
13951
13952 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
13953 for non system headers.
13954
13955 2002-01-02 Akim Demaille <akim@epita.fr>
13956
13957 Equip the skeleton chain with location tracking, runtime trace,
13958 pure parser and scanner.
13959
13960 * src/parse-skel.y: Request a pure parser, locations, and prefix
13961 renaming.
13962 (%union): Having several members with the same type does not help
13963 type mismatches, simplify.
13964 (YYPRINT, yyprint): New.
13965 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
13966 (skel_error): this.
13967 Handle locations.
13968 * src/scan-skel.l: Adjust to these changes.
13969 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
13970 (LOCATION_PRINT, skel_control_t): New.
13971
13972 2001-12-30 Akim Demaille <akim@epita.fr>
13973
13974 * src/parse-skel.y: Get rid of the shift/reduce conflict:
13975 replace `gb' with BLANKS.
13976 * src/scan-skel.l: Adjust.
13977
13978 2001-12-30 Akim Demaille <akim@epita.fr>
13979
13980 * src/system.h: We don't need nor want bcopy.
13981 Throw away MS-DOS crap: we don't need getpid.
13982 * configure.in: We don't need strndup. It was even causing
13983 problems: because Flex includes the headers *before* us,
13984 _GNU_SOURCE is not defined by config.h, and therefore strndup was
13985 not visible.
13986 * lib/xstrndup.c: New.
13987 * src/scan-skel.l: Use it.
13988 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
13989 * src/parse-skel.y: Use %directives instead of #defines.
13990
13991 2001-12-30 Akim Demaille <akim@epita.fr>
13992
13993 * src/skeleton.h: New.
13994 * src/output.c (output_parser, output_master_parser): Remove, dead
13995 code.
13996 * src/output.h (get_lines_number, actions_output, guards_output)
13997 (token_definitions_output): Prototype them.
13998 * src/parse-skel.y: Add the license notice.
13999 Include output.h and skeleton.h.
14000 (process_skeleton): Returns void, and takes a single parameter.
14001 * src/scan-skel.l: Add the license notice.
14002 Include skeleton.h.
14003 Don't use %option yylineno: it seems that then Flex imagines
14004 REJECT has been used, and therefore it won't reallocate its
14005 buffers (which makes no other sense to me than a bug). It results
14006 in warnings for `unused: yy_flex_realloc'.
14007
14008 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
14009
14010 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14011 (MUSCLE_INSERT_PREFIX): ...to there.
14012 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14013 (MUSCLE_INSERT_PREFIX): Move from here...
14014
14015 * src/bison.hairy: Add a section directive. Put braces around muscle
14016 names. This parser skeleton is still broken, but Bison should not
14017 choke on a bad muscle 'syntax'.
14018 * src/bison.simple: Add a section directive. Put braces around muscle
14019 names.
14020
14021 * src/files.h (strsuffix, stringappend): Add declarations.
14022 (tab_extension): Add declaration.
14023 (short_base_name): Add declaration.
14024
14025 * src/files.c (strsuffix, stringappend): No longer static. These
14026 functions are used in the skeleton parser.
14027 (tab_extension): New.
14028 (compute_base_names): Use the computations done in this function
14029 to guess if the generated parsers should have '.tab' in their
14030 names.
14031 (short_base_name): No longer static.
14032
14033 * src/output.c (output_skeleton): New.
14034 (output): Disable call to output_master_parser, and give a try to
14035 a new skeleton handling system.
14036 (guards_output, actions_output): No longer static.
14037 (token_definitions_output, get_lines_number): No longer static.
14038
14039 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
14040
14041 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
14042 parse-skel.y.
14043
14044 * src/parse-skel.y: New file.
14045 * src/scan-skel.l: New file.
14046
14047 2001-12-29 Akim Demaille <akim@epita.fr>
14048
14049 %name-prefix is broken.
14050
14051 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
14052 Adjust all dependencies.
14053 * tests/headers.at (export YYLTYPE): Strengthen this test: use
14054 %name-prefix.
14055
14056 Renaming yylval but not yylloc is not consistent. Now we do.
14057
14058 * src/bison.simple: Prefix yylloc if used.
14059 * doc/bison.texinfo (Decl Summary): Document that.
14060
14061 2001-12-29 Akim Demaille <akim@epita.fr>
14062
14063 * doc/bison.texinfo: Promote `%long-directive' over
14064 `%long_directive'.
14065 Remove all references to fixed-output-files, yacc is enough.
14066
14067 2001-12-29 Akim Demaille <akim@epita.fr>
14068
14069 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
14070 user prologue. These are defaults.
14071 * tests/actions.at (Mid-rule actions): Make sure the user can
14072 define YYDEBUG and YYERROR_VERBOSE.
14073
14074 2001-12-29 Akim Demaille <akim@epita.fr>
14075
14076 * src/output.c (header_output): Don't forget to export YYLTYPE and
14077 yylloc.
14078 * tests/headers.at (export YYLTYPE): New, make sure it does.
14079 * tests/regression.at (%union and --defines, Invalid CPP headers):
14080 Move to...
14081 * tests/headers.at: here.
14082
14083 2001-12-29 Akim Demaille <akim@epita.fr>
14084
14085 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
14086
14087 2001-12-29 Akim Demaille <akim@epita.fr>
14088
14089 * tests/actions.at (Mid-rule actions): Output on a single line
14090 instead of several.
14091
14092 2001-12-29 Akim Demaille <akim@epita.fr>
14093
14094 * doc/bison.texinfo: Formatting changes.
14095
14096 2001-12-29 Akim Demaille <akim@epita.fr>
14097
14098 Don't store the token defs in a muscle, just be ready to output it
14099 on command. Now possible via `symbols'. Fixes a memory leak.
14100
14101 * src/output.c (token_definitions_output): New.
14102 (output_parser, header_output): Use it.
14103 * src/reader.c (symbols_save): Remove.
14104
14105 2001-12-29 Akim Demaille <akim@epita.fr>
14106
14107 * src/bison.simple: Do not provide a default for YYSTYPE and
14108 YYLTYPE before the user's prologue. Otherwise it's hardly... a
14109 default.
14110
14111 2001-12-29 Akim Demaille <akim@epita.fr>
14112
14113 Mid-rule actions are simply... ignored!
14114
14115 * src/reader.c (readgram): Be sure to attach mid-rule actions to
14116 the empty-rule associated to the dummy symbol, not to the host
14117 rule.
14118 * tests/actions.at (Mid-rule actions): New.
14119
14120 2001-12-29 Akim Demaille <akim@epita.fr>
14121
14122 Memory leak.
14123
14124 * src/reader.c (reader): Free grammar.
14125
14126 2001-12-29 Akim Demaille <akim@epita.fr>
14127
14128 Memory leak.
14129
14130 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
14131 since it allocates it for each state, although only one is needed.
14132 (allocate_storage): Do it here.
14133
14134 2001-12-29 Akim Demaille <akim@epita.fr>
14135
14136 * src/options.h, src/options.c (create_long_option_table): Rename
14137 as...
14138 (long_option_table_new): this, with a clearer prototype.
14139 (percent_table): Remove, unused,
14140 * src/getargs.c (getargs): Adjust.
14141
14142 2001-12-29 Akim Demaille <akim@epita.fr>
14143
14144 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
14145 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
14146 as states.
14147
14148 2001-12-29 Akim Demaille <akim@epita.fr>
14149
14150 * src/lalr.c (build_relations): Rename `states' as `states1'.
14151 Sorry, I don't understand exactly what it is, no better name...
14152
14153 2001-12-29 Akim Demaille <akim@epita.fr>
14154
14155 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
14156 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
14157 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
14158 as rules.
14159
14160 2001-12-29 Akim Demaille <akim@epita.fr>
14161
14162 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
14163 ago.
14164
14165 2001-12-29 Akim Demaille <akim@epita.fr>
14166
14167 * src/reader.c, src/reader.h (user_toknums): Remove.
14168 Adjust all users to use symbols[i]->user_token_number.
14169
14170 2001-12-29 Akim Demaille <akim@epita.fr>
14171
14172 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
14173 Adjust all users to use symbols[i]->prec or ->assoc.
14174
14175 2001-12-29 Akim Demaille <akim@epita.fr>
14176
14177 * src/reader.c, src/reader.h (tags): Remove.
14178 Adjust all users to use symbols[i]->tag.
14179
14180 2001-12-29 Akim Demaille <akim@epita.fr>
14181
14182 * src/gram.h, src/gram.c (symbols): New, similar to state_table
14183 and rule_table.
14184 * src/reader.c (packsymbols): Fill this table.
14185 Drop sprec.
14186 * src/conflicts.c (resolve_sr_conflict): Adjust.
14187 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
14188 single table.
14189 Use symbols[i]->tag instead of tags[i].
14190
14191 2001-12-29 Akim Demaille <akim@epita.fr>
14192
14193 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
14194 In addition, put a comment in there, to replace...
14195 * tests/regression.at (%union and C comments): Remove.
14196
14197 2001-12-29 Akim Demaille <akim@epita.fr>
14198
14199 * tests/regression.at (Web2c Actions): Blindly move the actual
14200 output as expected output. The contents *seem* right to me, but I
14201 can't pretend reading perfectly parser tables... Nonetheless, all
14202 the other tests pass correctly, the table look OK, even though the
14203 presence of `$axiom' is to be noted: AFAICS it is useless (but
14204 harmless).
14205
14206 2001-12-29 Akim Demaille <akim@epita.fr>
14207
14208 * src/reader.c (readgram): Don't add the rule 0 if there were no
14209 rules read. In other words, add it _after_ having performed
14210 grammar sanity checks.
14211 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
14212
14213 2001-12-29 Akim Demaille <akim@epita.fr>
14214
14215 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
14216 visible, and some states have now a different number.
14217
14218 2001-12-29 Akim Demaille <akim@epita.fr>
14219
14220 * src/reader.c (readgram): Bind the initial rule's lineno to that
14221 of the first rule.
14222 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
14223 (Solved SR Conflicts): Adjust rule 0's line number.
14224
14225 2001-12-29 Akim Demaille <akim@epita.fr>
14226
14227 Fix the `GAWK Grammar' failure.
14228
14229 * src/LR0.c (final_state): Initialize to -1 so that we do compute
14230 the reductions of the first state which was mistakenly confused
14231 with the final state because precisely final_state was initialized
14232 to 0.
14233 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
14234 now noticed by Bison.
14235 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
14236 have a reduction on $default.
14237
14238 2001-12-29 Akim Demaille <akim@epita.fr>
14239
14240 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
14241 rule line numbers.
14242 * src/closure.c (print_closure): Likewise.
14243 * src/derives.c (print_derives): Likewise.
14244 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
14245 now.
14246
14247 2001-12-29 Akim Demaille <akim@epita.fr>
14248
14249 * src/lalr.c (lookaheads_print): New.
14250 (lalr): Call it when --trace-flag.
14251 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
14252 are dumped.
14253
14254 2001-12-29 Akim Demaille <akim@epita.fr>
14255
14256 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
14257 when walking through ritem, even via rule->rhs.
14258 * src/reduce.c (dump_grammar, useful_production, reduce_output)
14259 (useful_production, useless_nonterminals): Likewise.
14260 (reduce_grammar_tables): Likewise, plus update nritems.
14261 * src/nullable.c (set_nullable): Likewise.
14262 * src/lalr.c (build_relations): Likewise.
14263 * tests/sets.at (Nullable): Adjust.
14264 Fortunately, now, the $axiom is no longer nullable.
14265
14266 2001-12-29 Akim Demaille <akim@epita.fr>
14267
14268 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
14269 the 0-sentinel.
14270 * src/gram.c (ritem_longest_rhs): Likewise.
14271 * src/reduce.c (nonterminals_reduce): Likewise.
14272 * src/print_graph.c (print_graph): Likewise.
14273 * src/output.c (output_rule_data): Likewise.
14274 * src/nullable.c (set_nullable): Likewise.
14275
14276 2001-12-29 Akim Demaille <akim@epita.fr>
14277
14278 * src/output.c: Comment changes.
14279
14280 2001-12-27 Paul Eggert <eggert@twinsun.com>
14281
14282 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
14283 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
14284 Sparc, as they were causing more porting problems than the
14285 (minor) performance improvement was worth.
14286
14287 Also, catch up with 1.31's YYSTD.
14288
14289 2001-12-27 Akim Demaille <akim@epita.fr>
14290
14291 * src/output.c (output_gram): Rely on nritems, not the
14292 0-sentinel. See below.
14293 Use -1 as separator, not 0.
14294 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
14295 Rely on -1 as separator in yyrhs, instead of 0.
14296 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
14297 twice `Now at end of input', therefore there are two lines less to
14298 expect.
14299
14300 2001-12-27 Akim Demaille <akim@epita.fr>
14301
14302 * tests/regression.at (Unresolved SR Conflicts):
14303 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
14304 below.
14305
14306 2001-12-27 Akim Demaille <akim@epita.fr>
14307
14308 * src/LR0.c (new_state): Recognize the final state by the fact it
14309 is reached by eoftoken.
14310 (insert_start_shifting_state, insert_eof_shifting_state)
14311 (insert_accepting_state, augment_automaton): Remove, since now
14312 these states are automatically computed from the initial state.
14313 (generate_states): Adjust.
14314 * src/print.c: When reporting a rule number to the user, substract
14315 1, so that the axiom rule is rule 0, and the first user rule is 1.
14316 * src/reduce.c: Likewise.
14317 * src/print_graph.c (print_core): For the time being, just as for
14318 the report, depend upon --trace-flags to dump the full set of
14319 items.
14320 * src/reader.c (readgram): Once the grammar read, insert the rule
14321 0: `$axiom: START-SYMBOL $'.
14322 * tests/set.at: Adjust: rule 0 is now displayed, and since the
14323 number of the states has changed (the final state is no longer
14324 necessarily the last), catch up.
14325
14326 2001-12-27 Akim Demaille <akim@epita.fr>
14327
14328 Try to make the use of the eoftoken valid. Given that its value
14329 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
14330 is used instead of > 0 where appropriate, (ii), depend upon nritems
14331 instead of the 0-sentinel.
14332
14333 * src/gram.h, src/gram.c (nritems): New.
14334 Expected to be duplication of nitems, but for the time being...
14335 * src/reader.c (packgram): Assert nritems and nitems are equal.
14336 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
14337 * src/closure.c (print_closure, print_fderives): Likewise.
14338 * src/gram.c (ritem_print): Likewise.
14339 * src/print.c (print_core, print_grammar): Likewise.
14340 * src/print_graph.c: Likewise.
14341
14342 2001-12-27 Akim Demaille <akim@epita.fr>
14343
14344 * src/main.c (main): If there are complains after grammar
14345 reductions, then output the report anyway if requested, then die.
14346 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
14347 * src/reader.c (eoftoken): New.
14348 (parse_token_decl): If the token being defined has value `0', it
14349 is the eoftoken.
14350 (packsymbols): No longer hack `tags' to insert `$' by hand.
14351 Be sure to preserve the value of the eoftoken.
14352 (reader): Make sure eoftoken is defined.
14353 Initialize nsyms to 0: now eoftoken is created just like the others.
14354 * src/print.c (print_grammar): Don't special case the eof token.
14355 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
14356 lie anyway, albeit pleasant.
14357 * tests/calc.at: Exercise error messages with eoftoken.
14358 Change the grammar so that empty input is invalid.
14359 Adjust expectations.
14360 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
14361
14362 2001-12-27 Akim Demaille <akim@epita.fr>
14363
14364 * configure.in: Check the protos of strchr ans strspn.
14365 Replace strchr if needed.
14366 * src/system.h: Provide the protos of strchr, strspn and memchr if
14367 missing.
14368 * lib/strchr.c: New.
14369 * src/reader.c (symbols_save): Use strchr.
14370
14371 2001-12-27 Akim Demaille <akim@epita.fr>
14372
14373 * src/print.c, src/print_graph.c (escape): New.
14374 Use it to quote the TAGS outputs.
14375 * src/print_graph.c (print_state): Now errors are in red, and
14376 reductions in green.
14377 Prefer high to wide: output the state number on a line of its own.
14378
14379 2001-12-27 Akim Demaille <akim@epita.fr>
14380
14381 * src/state.h, src/state.c (reductions_new): New.
14382 * src/LR0.c (set_state_table): Let all the states have a
14383 `reductions', even if reduced to 0.
14384 (save_reductions): Adjust.
14385 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
14386 * src/print.c (print_reductions, print_actions): Adjust.
14387 * src/output.c (action_row): Adjust.
14388
14389 2001-12-27 Akim Demaille <akim@epita.fr>
14390
14391 * src/state.h, src/state.c (errs_new, errs_dup): New.
14392 * src/LR0.c (set_state_table): Let all the states have an errs,
14393 even if reduced to 0.
14394 * src/print.c (print_errs, print_reductions): Adjust.
14395 * src/output.c (output_actions, action_row): Adjust.
14396 * src/conflicts.c (resolve_sr_conflict): Adjust.
14397
14398 2001-12-27 Akim Demaille <akim@epita.fr>
14399
14400 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
14401
14402 2001-12-27 Akim Demaille <akim@epita.fr>
14403
14404 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
14405 * src/print.c: here.
14406 (lookaheadset, shiftset): New, used as additional storage by
14407 print_reductions.
14408 (print_results): Adjust.
14409 (print_shifts, print_gotos, print_errs): New, extracted from...
14410 (print_actions): here.
14411 * src/print_graph.c (print_actions): Remove dead code.
14412
14413 2001-12-27 Akim Demaille <akim@epita.fr>
14414
14415 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
14416 `$n' and `@n'.
14417
14418 2001-12-27 Akim Demaille <akim@epita.fr>
14419
14420 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
14421 (build_relations): Adjust.
14422
14423 2001-12-27 Akim Demaille <akim@epita.fr>
14424
14425 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
14426 duplication.
14427
14428 2001-12-27 Akim Demaille <akim@epita.fr>
14429
14430 * src/reader.c (packgram): Catch nitems overflows.
14431
14432 2001-12-27 Akim Demaille <akim@epita.fr>
14433
14434 * src/files.c, src/files.h (guard_obstack): Remove.
14435 * src/output.c (output): Adjust.
14436 * src/reader.c (parse_braces): New, factoring...
14437 (copy_action, copy_guard): these two which are renamed as...
14438 (parse_action, parse_guard): these.
14439 As a voluntary consequence, using braces around guards is now
14440 mandatory.
14441
14442 2001-12-27 Akim Demaille <akim@epita.fr>
14443
14444 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
14445 * src/reader.c (symbol_list): `guard' and `guard_line' are new
14446 members.
14447 (symbol_list_new): Adjust.
14448 (copy_action): action_line is the first line, not the last.
14449 (copy_guard): Just as for actions, store the `action' only, not
14450 the switch/case/break flesh.
14451 Don't parse the user action that might follow the guard, let...
14452 (readgram): do it, i.e., now, there can be an action after a
14453 guard.
14454 In other words the guard is just explicitly optional.
14455 (packgram): Adjust.
14456 * src/output.c (guards_output): New.
14457 (output_parser): Call it when needed.
14458 (output): Also free the guard and attrs obstacks.
14459 * src/files.c, src/files.h (obstack_save): Remove.
14460 (output_files): Remove.
14461 As a result, if one needs the former `.act' file, using an
14462 appropriate skeleton which requires actions and guards is now
14463 required.
14464 * src/main.c (main): Adjust.
14465 * tests/semantic.at: New.
14466 * tests/regression.at: Use `input.y' as input file name.
14467 Avoid 8+3 problems by requiring input.c when the test needs the
14468 parser.
14469
14470 2001-12-27 Akim Demaille <akim@epita.fr>
14471
14472 * src/reader.c (symbol_list_new): Be sure to initialize all the
14473 fields.
14474
14475 2001-12-27 Akim Demaille <akim@epita.fr>
14476
14477 All the hacks using a final pseudo state are now useless.
14478
14479 * src/LR0.c (set_state_table): state_table holds exactly nstates.
14480 * src/lalr.c (nLA): New.
14481 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
14482 instead of lookaheadsp from the pseudo state (nstate + 1).
14483
14484 2001-12-27 Akim Demaille <akim@epita.fr>
14485
14486 * src/output.c (action_row, token_actions): Use a state_t instead
14487 of a integer, and nlookaheads instead of the following state's
14488 lookaheadsp.
14489
14490 2001-12-27 Akim Demaille <akim@epita.fr>
14491
14492 * src/conflicts.c (log_resolution, flush_shift)
14493 (resolve_sr_conflict, set_conflicts, solve_conflicts)
14494 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
14495 (conflicts_print, print_reductions): Use a state_t instead of an
14496 integer when referring to a state.
14497 As much as possible, depend upon nlookaheads, instead of the
14498 `lookaheadsp' member of the following state (since lookaheads of
14499 successive states are successive, the difference between state n + 1
14500 and n served as the number of lookaheads for state n).
14501 * src/lalr.c (add_lookback_edge): Likewise.
14502 * src/print.c (print_core, print_actions, print_state)
14503 (print_results): Likewise.
14504 * src/print_graph.c (print_core, print_actions, print_state)
14505 (print_graph): Likewise.
14506 * src/conflicts.h: Adjust.
14507
14508 2001-12-27 Akim Demaille <akim@epita.fr>
14509
14510 * src/bison.hairy: Formatting/comment changes.
14511 ANSIfy.
14512 Remove `register' indications.
14513 Add plenty of `static'.
14514
14515 2001-12-27 Akim Demaille <akim@epita.fr>
14516
14517 * src/output.c (prepare): Drop the muscle `ntbase' which
14518 duplicates ntokens.
14519 * src/bison.simple: Formatting/comment changes.
14520 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
14521 is an undocumented synonym.
14522
14523 2001-12-22 Akim Demaille <akim@epita.fr>
14524
14525 * src/output.c (output_table_data): Change the prototype to use
14526 `int' for array ranges: some invocations do pass an int, not a
14527 short.
14528 Reported by Wayne Green.
14529
14530 2001-12-22 Akim Demaille <akim@epita.fr>
14531
14532 Some actions of web2c.y are improperly triggered.
14533 Reported by Mike Castle.
14534
14535 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
14536 * tests/regression.at (Web2c): Rename as...
14537 (Web2c Report): this.
14538 (Web2c Actions): New.
14539
14540 2001-12-22 Akim Demaille <akim@epita.fr>
14541
14542 Reductions in web2c.y are improperly reported.
14543 Reported by Mike Castle.
14544
14545 * src/conflicts.c (print_reductions): Fix.
14546 * tests/regression.at (Web2c): New.
14547
14548 2001-12-18 Akim Demaille <akim@epita.fr>
14549
14550 Some host fail on `assert (!"foo")', which expands to
14551 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
14552 Reported by Nelson Beebee.
14553
14554 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
14555 `#define it_succeeded 0' and `assert (it_succeeded)'.
14556
14557 2001-12-17 Marc Autret <autret_m@epita.fr>
14558
14559 * src/bison.simple: Don't hard code the skeleton line and filename.
14560 * src/output.c (output_parser): Rename 'line' as 'output_line'.
14561 New line counter 'skeleton_line' (skeleton-line muscle).
14562
14563 2001-12-17 Paul Eggert <eggert@twinsun.com>
14564
14565 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
14566 YYDEBUG must be defined to a nonzero value.
14567
14568 * src/bison.simple (yytname): Do not assume that the user defines
14569 YYDEBUG to a properly parenthesized expression.
14570
14571 2001-12-17 Akim Demaille <akim@epita.fr>
14572
14573 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
14574 nlookaheads is a new member.
14575 Adjust all users.
14576 * src/lalr.h (nlookaheads): Remove this orphan declaration.
14577 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
14578 state.
14579
14580 2001-12-17 Akim Demaille <akim@epita.fr>
14581
14582 * src/files.h, src/files.c (open_files, close_files): Remove.
14583 * src/main.c (main): Don't open/close files, nor invoke lex_free,
14584 let...
14585 * src/reader.c (reader): Do it.
14586
14587 2001-12-17 Akim Demaille <akim@epita.fr>
14588
14589 * src/conflicts.c (print_reductions): Formatting changes.
14590
14591 2001-12-17 Akim Demaille <akim@epita.fr>
14592
14593 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
14594 (flush_reduce): New.
14595 (resolve_sr_conflict): Adjust.
14596
14597 2001-12-17 Akim Demaille <akim@epita.fr>
14598
14599 * src/output.c (output_obstack): Be static and rename as...
14600 (format_obstack): this, to avoid any confusion with files.c's
14601 output_obstack.
14602 * src/reader.h (muscle_obstack): Move to...
14603 * src/output.h: here, since it's defined in output.c.
14604
14605 2001-12-17 Akim Demaille <akim@epita.fr>
14606
14607 * src/output.c (action_row, save_column, default_goto)
14608 (sort_actions, matching_state, pack_vector): Better variable
14609 locality.
14610
14611 2001-12-17 Akim Demaille <akim@epita.fr>
14612
14613 * src/output.c: Various formatting changes.
14614
14615 2001-12-17 Akim Demaille <akim@epita.fr>
14616
14617 * src/files.c (output_files): Free the output_obstack.
14618 * src/main.c (main): Call print and print_graph conditionally.
14619 * src/print.c (print): Work unconditionally.
14620 * src/print_graph.c (print_graph): Work unconditionally.
14621 * src/conflicts.c (log_resolution): Output only if verbose_flag.
14622
14623 2001-12-16 Marc Autret <autret_m@epita.fr>
14624
14625 * src/output.c (actions_output): Fix. When we use %no-lines,
14626 there is one less line per action.
14627
14628 2001-12-16 Marc Autret <autret_m@epita.fr>
14629
14630 * src/bison.simple: Remove a useless #line directive.
14631 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
14632 * src/output.c (get_lines_number): New.
14633 (output_parser): Adjust, now takes care about the lines of a
14634 output muscles.
14635 Fix line numbering.
14636 (actions_output): Computes the number of lines taken by actions.
14637 (output_master_parser): Insert new skeleton which is the name of
14638 the output parser file name.
14639
14640 2001-12-15 Marc Autret <autret_m@epita.fr>
14641
14642 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
14643
14644 2001-12-15 Marc Autret <autret_m@epita.fr>
14645
14646 * src/output.c (output_gram): Keep track of the hairy one.
14647
14648 2001-12-15 Akim Demaille <akim@epita.fr>
14649
14650 Make `make distcheck' work.
14651
14652 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
14653 system.h which uses libgettext.h.
14654
14655 2001-12-15 Akim Demaille <akim@epita.fr>
14656
14657 * src/nullable.c (set_nullable): Useless rules must be skipped,
14658 otherwise, since we range over their symbols, we might look at a
14659 nonterminal which no longer ``exists'', i.e., it is not counted in
14660 `nvars', hence we overflow our arrays.
14661
14662 2001-12-15 Akim Demaille <akim@epita.fr>
14663
14664 The header can also be produced directly, without any obstack!
14665 Yahoo!
14666
14667 * src/files.c, src/files.h (defines_obstack): Remove.
14668 (compute_header_macro): Global.
14669 (defines_obstack_save): Remove.
14670 * src/reader.c (parse_union_decl): No longer output to
14671 defines_obstack: its content can be found in the `stype' muscle
14672 anyway.
14673 (output_token_translations): Merge into...
14674 (symbols_output): this.
14675 Rename as...
14676 (symbols_save): this.
14677 (reader): Adjust.
14678 * src/output.c (header_output): New.
14679 (output): Call it.
14680
14681 2001-12-15 Akim Demaille <akim@epita.fr>
14682
14683 * src/reader.c (parse_union_decl): Instead of handling two obstack
14684 simultaneously, use one to define the `stype' muscle, and use the
14685 value of the latter to fill defines_obstack.
14686 (copy_comment): Remove.
14687 (copy_comment2): Work for a single obstack.
14688 Rename as...
14689 (copy_comment): this.
14690
14691 2001-12-15 Akim Demaille <akim@epita.fr>
14692
14693 * src/lex.c, src/lex.h (xgetc): No longer static.
14694 * src/reader.c (parse_union_decl): Revamp.
14695
14696 2001-12-15 Akim Demaille <akim@epita.fr>
14697
14698 Still making progress in separating Bison into (i) input, (ii)
14699 process, (iii) output: now we can directly output the parser file
14700 without using table_obstack at all.
14701
14702 * src/files.c, src/files.h (table_obstack): Bye bye.
14703 (parser_file_name): New.
14704 * src/files.c (compute_output_file_names): Compute it.
14705 * src/output.c (actions_output, output_parser)
14706 (output_master_parser): To a file instead of an obstack.
14707
14708 2001-12-15 Akim Demaille <akim@epita.fr>
14709
14710 Attach actions to rules, instead of pre-outputting them to
14711 actions_obstack.
14712
14713 * src/gram.h (rule_t): action and action_line are new members.
14714 * src/reader.c (symbol_list): Likewise.
14715 (copy_action): Save the actions within the rule.
14716 (packgram): Save them in rule_table.
14717 * src/output.c (actions_output): New.
14718 (output_parser): Use it on `%%actions'.
14719 (output_rule_data): Don't free rule_table.
14720 (output): Do it.
14721 (prepare): Don't save the `action' muscle.
14722 * src/bison.simple: s/%%action/%%actions/.
14723
14724 2001-12-15 Akim Demaille <akim@epita.fr>
14725
14726 * src/reader.c (copy_action): When --yacc, don't append a `;'
14727 to the user action: let it fail if lacking.
14728 Suggested by Arnold Robbins and Tom Tromey.
14729
14730 2001-12-14 Akim Demaille <akim@epita.fr>
14731
14732 * src/lex.c (literalchar): Simply return the char you decoded, non
14733 longer mess around with obstacks and int pointers.
14734 Adjust all callers.
14735
14736 2001-12-14 Akim Demaille <akim@epita.fr>
14737
14738 * src/lex.c (literalchar): Don't escape the special characters,
14739 just decode them, and keep them as char (before, eol was output as
14740 the 2 char string `\n' etc.).
14741 * src/output.c (output_rule_data): Use quotearg to output the
14742 token strings.
14743
14744 2001-12-13 Paul Eggert <eggert@twinsun.com>
14745
14746 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
14747 Do not infringe on the global user namespace when using C++.
14748 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
14749 All uses of `fprintf' and `stderr' changed.
14750
14751 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
14752
14753 2001-12-13 Akim Demaille <akim@epita.fr>
14754
14755 The computation of nullable is broken: it doesn't handle empty
14756 RHS's properly.
14757
14758 * tests/torture.at (GNU AWK Grammar): New.
14759 * tests/sets.at (Nullable): New.
14760 * src/nullable.c (set_nullable): Instead of blindly looping over
14761 `ritems', loop over the rules, and then over their rhs's.
14762
14763 Work around Autotest bugs.
14764
14765 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
14766 frame, because Autotest understand lines starting with a `+' as
14767 traces from the shell. Then, they are not processed properly.
14768 Admittedly an Autotest bug, but we don't have time to wait for
14769 Autotest to catch up.
14770 * tests/regression.at (Broken Closure): Adjust to the new table
14771 frames.
14772 Move to...
14773 * tests/sets.at: here.
14774
14775 2001-12-13 Akim Demaille <akim@epita.fr>
14776
14777 * src/closure.c (closure): Use nrules instead of playing tricks
14778 with BITS_PER_WORD.
14779
14780 2001-12-13 Akim Demaille <akim@epita.fr>
14781
14782 * src/print.c (print_actions): Output the handling of `$' as the
14783 traces do: shifting the token EOF. Before EOF was treated as a
14784 nonterminal.
14785 * tests/regression.at: Adjust some tests.
14786 * src/print_graph.c (print_core): Complete the set of items via
14787 closure. The next-to-final and final states are still unsatisfying,
14788 but that's to be addressed elsewhere.
14789 No longer output the rule numbers, but do output the state number.
14790 A single loop for the shifts + gotos is enough, but picked a
14791 distinct color for each.
14792 (print_graph): Initialize and finalize closure.
14793
14794 2001-12-13 Akim Demaille <akim@epita.fr>
14795
14796 * src/reader.c (readgram): Remove dead code, an strip useless
14797 braces.
14798 (get_type): Remove, unused.
14799
14800 2001-12-12 Akim Demaille <akim@epita.fr>
14801
14802 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
14803 on that of lib/error.c.
14804
14805 2001-12-12 Akim Demaille <akim@epita.fr>
14806
14807 Some hosts don't like `/' in includes.
14808
14809 * src/system.h: Include libgettext.h without qualifying the path.
14810 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
14811 $(top_srcdir).
14812
14813 2001-12-11 Marc Autret <autret_m@epita.fr>
14814
14815 * src/output.c (output_parser): Remove useless muscle.
14816
14817 2001-12-11 Marc Autret <autret_m@epita.fr>
14818
14819 * src/bison.simple: Remove #line just before %%epilogue. It
14820 is now handled in ...
14821 * src/reader.c (read_additionnal_code): Add the output of a
14822 #line for the epilogue.
14823
14824 2001-12-10 Marc Autret <autret_m@epita.fr>
14825
14826 * src/reader.c (copy_definition): Re-use CPP-outed code which
14827 replace precedent remove.
14828 * src/bison.simple: Remove #line before %%prologue because
14829 %%input-line is wrong at this time.
14830
14831 2001-12-10 Marc Autret <autret_m@epita.fr>
14832
14833 * src/reader.c (symbols_output): Clean up.
14834 * src/output.c (output_gram, output): Clean up.
14835
14836 2001-12-10 Akim Demaille <akim@epita.fr>
14837
14838 * src/lalr.c (initialize_lookaheads): New. Extracted from...
14839 * src/LR0.c (set_state_table): here.
14840 * src/lalr.c (lalr): Call it.
14841
14842 2001-12-10 Akim Demaille <akim@epita.fr>
14843
14844 * src/state.h (shifts): Remove the `number' member: shifts are
14845 attached to state, hence no longer need to be labelled with a
14846 state number.
14847
14848 2001-12-10 Akim Demaille <akim@epita.fr>
14849
14850 Now that states have a complete set of members, the linked list of
14851 shifts is useless: just fill directly the state's shifts member.
14852
14853 * src/state.h (shifts): Remove the `next' member.
14854 * src/LR0.c (first_state, last_state): Remove.
14855 Adjust the callers.
14856 (augment_automaton): Don't look for the shifts that must be added
14857 a shift on EOF: it is those of the state we looked for! But now,
14858 since shifts are attached, it is no longer needed to looking
14859 merely by its id: its number.
14860
14861 2001-12-10 Akim Demaille <akim@epita.fr>
14862
14863 * src/LR0.c (augment_automaton): Better variable locality.
14864 Remove an impossible branch: if there is a state corresponding to
14865 the start symbol being shifted, then there is shift for the start
14866 symbol from the initial state.
14867
14868 2001-12-10 Akim Demaille <akim@epita.fr>
14869
14870 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
14871 only when appropriate: when insert_start_shifting_state' is not
14872 invoked.
14873 * tests/regression.at (Rule Line Numbers): Adjust.
14874
14875 2001-12-10 Akim Demaille <akim@epita.fr>
14876
14877 * src/LR0.c (augment_automaton): Now that all states have shifts,
14878 merge the two cases addition shifts to the initial state.
14879
14880 2001-12-10 Akim Demaille <akim@epita.fr>
14881
14882 * src/lalr.c (set_state_table): Move to...
14883 * src/LR0.c: here.
14884 * src/lalr.c (lalr): Don't call it...
14885 * src/LR0.c (generate_states): do it.
14886 * src/LR0.h (first_state): Remove, only the table is used.
14887
14888 2001-12-10 Akim Demaille <akim@epita.fr>
14889
14890 * src/LR0.h (first_shift, first_reduction): Remove.
14891 * src/lalr.c: Don't use first_shift: find shifts through the
14892 states.
14893
14894 2001-12-10 Akim Demaille <akim@epita.fr>
14895
14896 * src/LR0.c: Attach shifts to states as soon as they are
14897 computed.
14898 * src/lalr.c (set_state_table): Instead of assigning shifts to
14899 state, just assert that the mapping was properly done.
14900
14901 2001-12-10 Akim Demaille <akim@epita.fr>
14902
14903 * src/LR0.c (insert_start_shift): Rename as...
14904 (insert_start_shifting_state): this.
14905 (insert_eof_shifting_state, insert_accepting_state): New.
14906 (augment_automaton): Adjust.
14907 Better locality of the variables.
14908 When looking if the start_symbol is shifted from the initial
14909 state, using `while (... symbol != start_symbol ...)' sounds
14910 better than `while (... symbol < start_symbol ...)': If fail
14911 to see how the order between symbols could be relevant!
14912
14913 2001-12-10 Akim Demaille <akim@epita.fr>
14914
14915 * src/getargs.h: Don't declare `spec_name_prefix' and
14916 `spec_file_prefix', declared by src/files.h.
14917 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
14918 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
14919 * src/output.c (prepare): Adjust.
14920 * src/reader.c (symbols_output): Likewise.
14921 * src/vmsgetargs.c: Vaguely adjust, but who cares?
14922
14923 2001-12-10 Akim Demaille <akim@epita.fr>
14924
14925 * src/muscle_tab.c (muscle_init): NULL is a better default than
14926 `"0"'.
14927
14928 2001-12-10 Akim Demaille <akim@epita.fr>
14929
14930 * src/reader.c (reader): Calling symbols_output once is enough.
14931
14932 2001-12-10 Akim Demaille <akim@epita.fr>
14933
14934 Now that states have a complete set of members, the linked list of
14935 reductions is useless: just fill directly the state's reductions
14936 member.
14937
14938 * src/state.h (struct reductions): Remove member `number' and
14939 `next'.
14940 * src/LR0.c (first_reduction, last_reduction): Remove.
14941 (save_reductions): Don't link the new reductions, store them in
14942 this_state.
14943 * src/lalr.c (set_state_table): No need to attach reductions to
14944 states, it's already done.
14945 * src/output.c (output_actions): No longer free the shifts, then
14946 the reductions, then the states: free all the states and their
14947 members.
14948
14949 2001-12-10 Akim Demaille <akim@epita.fr>
14950
14951 * src/options.c (OPTN, DRTV, BOTH): New.
14952 (option_table): Use them.
14953
14954 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
14955 the job of system.h.
14956 * src/options.c: Don't include stdio.h and xalloc.h for the same
14957 reasons.
14958
14959 2001-12-10 Akim Demaille <akim@epita.fr>
14960
14961 * src/output.c (output, prepare): Make sure the values of the
14962 muscles `action' and `prologue' are 0-terminated.
14963
14964 2001-12-10 Akim Demaille <akim@epita.fr>
14965
14966 Clean up GCC warnings.
14967
14968 * src/reader.c (copy_action): `buf' is not used.
14969 (parse_skel_decl): Be static.
14970 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
14971 * src/options.h (create_long_option_table): Have a real prototype.
14972 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
14973 (hash_delete_at): Return const void *.
14974 Adjust casts to preserve the const.
14975
14976 2001-12-10 Akim Demaille <akim@epita.fr>
14977
14978 * configure.in: Require 2.52g.
14979 M4 is not needed, but AUTOM4TE is.
14980 * m4/m4.m4: Remove.
14981 * tests/Makefile.am: Adjust.
14982
14983 2001-12-10 Akim Demaille <akim@epita.fr>
14984
14985 One structure for states is enough, even though theoretically
14986 there are LR(0) states and LALR(1) states.
14987
14988 * src/lalr.h (state_t): Remove.
14989 (state_table): Be state_t **, not state_t *.
14990 * src/state.h (core, CORE_ALLOC): Rename as...
14991 (state_t, STATE_ALLOC): this.
14992 Add the LALR(1) members: shifts, reductions, errs.
14993 * src/LR0.c (state_table): Rename as...
14994 (state_hash): this, to avoid name clashes with the global
14995 `state_table'.
14996 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
14997 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
14998
14999 2001-12-10 Akim Demaille <akim@epita.fr>
15000
15001 Bison dumps core on bash.y.
15002 Reported by Pascal Bart.
15003
15004 * src/warshall.c (bitmatrix_print): New.
15005 (TC): Use it.
15006 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
15007 j must be the outer loop.
15008 * tests/regression.at (Broken Closure): New.
15009
15010 2001-12-05 Akim Demaille <akim@epita.fr>
15011
15012 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
15013 its argument.
15014 Reported by Peter Hamorsky.
15015
15016 2001-12-05 Akim Demaille <akim@epita.fr>
15017
15018 * src/conflicts.c (err_table): Remove.
15019 (resolve_sr_conflict): Adjust.
15020 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
15021 Rename as...
15022 (state_t.reductions, state_t.shifts): this.
15023
15024 2001-12-05 Akim Demaille <akim@epita.fr>
15025
15026 * src/reduce.c (reduce_grammar_tables): No longer disable the
15027 removal of useless rules via CPP but via `if (0)', so that the
15028 compiler still check the code is valid.
15029 For instance, it should have noticed `rline' no longer exists: use
15030 the `line' member of rule_t.
15031 * src/gram.c (dummy, rline): Remove, unused.
15032
15033 2001-12-05 Akim Demaille <akim@epita.fr>
15034
15035 * src/output.c (pack_vector): Use assert, not berror.
15036 * src/main.c (berror): Remove, unused.
15037
15038 2001-12-05 Akim Demaille <akim@epita.fr>
15039
15040 New experimental feature: if --verbose --trace output all the
15041 items of a state, not only its kernel.
15042
15043 * src/print.c (print_core): If `trace_flag', then invoke closure
15044 before outputting the items of the state (print_core is no longer
15045 a correct name them).
15046 (print_results): Invoke new_closure/free_closure if needed.
15047
15048 2001-12-05 Akim Demaille <akim@epita.fr>
15049
15050 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
15051 * src/closure.c, src/closure.h (itemsetsize): Rename as...
15052 (nitemset): for consistency with the rest of the project.
15053
15054 2001-12-05 Akim Demaille <akim@epita.fr>
15055
15056 * src/closure.c (print_closure): Improve.
15057 (closure): Use it for printing input and output.
15058
15059 2001-12-05 Akim Demaille <akim@epita.fr>
15060
15061 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
15062 indexed by nonterminals.
15063
15064 2001-12-05 Akim Demaille <akim@epita.fr>
15065
15066 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
15067 what it was!).
15068 * src/warshall.h: Remove accidental duplication of the content.
15069
15070 2001-12-05 Akim Demaille <akim@epita.fr>
15071
15072 * src/closure.c (set_fderives): De-obfuscate.
15073
15074 2001-12-05 Akim Demaille <akim@epita.fr>
15075
15076 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
15077
15078 2001-12-05 Akim Demaille <akim@epita.fr>
15079
15080 * src/closure.c (set_firsts): De-obfuscate.
15081
15082 2001-12-05 Akim Demaille <akim@epita.fr>
15083
15084 * src/output.c (action_row): De-obfuscate
15085 using the good o' techniques: arrays not pointers, variable
15086 locality, BITISSET, RESETBIT etc.
15087
15088 2001-12-05 Akim Demaille <akim@epita.fr>
15089
15090 Pessimize the code to simplify it: from now on, all the states
15091 have a valid SHIFTS, which NSHIFTS is possibly 0.
15092
15093 * src/LR0.c (shifts_new): Be global and move to..
15094 * src/state.c, src/state.h: here.
15095 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
15096 * src/print_graph: Adjust.
15097
15098 2001-12-05 Akim Demaille <akim@epita.fr>
15099
15100 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
15101 * src/conflicts.c: Use it.
15102 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
15103 incorrectly ``simplified''.
15104
15105 2001-12-05 Akim Demaille <akim@epita.fr>
15106
15107 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
15108 using the good o' techniques: arrays not pointers, variable
15109 locality, BITISSET, RESETBIT etc.
15110
15111 2001-12-05 Akim Demaille <akim@epita.fr>
15112
15113 * src/state.h (SHIFT_SYMBOL): New.
15114 * src/conflicts.c: Use it to deobfuscate.
15115
15116 2001-12-05 Akim Demaille <akim@epita.fr>
15117
15118 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
15119 (print_reductions): De-obfuscate using the good o' techniques:
15120 arrays not pointers, variable locality, BITISSET.
15121
15122 2001-12-05 Akim Demaille <akim@epita.fr>
15123
15124 * src/conflicts.c (print_reductions): Arrays, not pointers.
15125 Use BITISSET.
15126
15127 2001-12-05 Akim Demaille <akim@epita.fr>
15128
15129 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15130
15131 2001-12-05 Akim Demaille <akim@epita.fr>
15132
15133 * src/conflicts.c (print_reductions): Improve variable locality.
15134
15135 2001-12-05 Akim Demaille <akim@epita.fr>
15136
15137 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15138
15139 2001-12-05 Akim Demaille <akim@epita.fr>
15140
15141 * src/conflicts.c (print_reductions): Improve variable locality.
15142
15143 2001-12-05 Akim Demaille <akim@epita.fr>
15144
15145 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
15146 * src/lalr.c: Use them.
15147
15148 2001-12-05 Akim Demaille <akim@epita.fr>
15149
15150 * src/LR0.c (augment_automaton): Formatting changes.
15151 Better variable locality.
15152
15153 2001-12-05 Akim Demaille <akim@epita.fr>
15154
15155 * src/lalr.c (matrix_print): New.
15156 (transpose): Use it.
15157 Use arrays instead of pointers.
15158
15159 2001-12-05 Akim Demaille <akim@epita.fr>
15160
15161 * src/lalr.c (maxrhs): Move to...
15162 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
15163 * src/lalr.c (build_relations): Adjust.
15164
15165 2001-12-05 Akim Demaille <akim@epita.fr>
15166
15167 * src/lalr.c (transpose): Free the memory allocated to the
15168 argument, as it is replaced by the results by the unique caller.
15169 (build_relations): Merely invoke transpose: it handles the memory
15170 deallocation.
15171 Improve variable locality.
15172 Avoid variables used as mere abbreviations.
15173 (compute_lookaheads): Use arrays instead of pointers.
15174
15175 2001-12-05 Akim Demaille <akim@epita.fr>
15176
15177 * src/lalr.c (initialize_F): Improve variable locality.
15178 Avoid variables used as mere abbreviations.
15179
15180 2001-12-05 Akim Demaille <akim@epita.fr>
15181
15182 * src/derives.c (print_derives): Display the ruleno.
15183 * src/lalr.c (initialize_F, transpose): Better variable locality
15184 to improve readability.
15185 Avoid variables used as mere abbreviations.
15186
15187 2001-12-05 Akim Demaille <akim@epita.fr>
15188
15189 * src/lalr.c (traverse): Use arrays instead of pointers.
15190
15191 2001-12-05 Akim Demaille <akim@epita.fr>
15192
15193 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
15194 the handling of squeue.
15195 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15196
15197 2001-12-05 Akim Demaille <akim@epita.fr>
15198
15199 Because useless nonterminals are now kept alive (instead of being
15200 `destroyed'), we now sometimes examine them, and store information
15201 related to them. Hence we need to know their number, and adjust
15202 memory allocations.
15203
15204 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
15205 static.
15206 * src/LR0.c (allocate_itemsets): The memory allocated to
15207 `symbol_count' was used for two different purpose: once to count
15208 the number of occurrences of each symbol, and later reassigned to
15209 `shift_symbol', containing the symbol that can be shifted from a
15210 given state.
15211 Deobfuscate, i.e., allocate, use and free `symbol_count' here
15212 only, and...
15213 (new_itemsets): Allocate `shift_symbol' here.
15214 (allocate_itemsets): symbol_count includes useless nonterminals.
15215 Make room for them.
15216 (free_storage): Use `free', not `XFREE', for pointers that cannot
15217 be null.
15218
15219 2001-12-05 Akim Demaille <akim@epita.fr>
15220
15221 * src/nullable.c (set_nullable): Deobfuscate the handling of
15222 ritem.
15223 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15224
15225 2001-12-05 Akim Demaille <akim@epita.fr>
15226
15227 * src/gram.c, src/gram.h (ritem_print): New.
15228 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
15229 (This useless function was defined only to work around VMS linkers
15230 that can't handle compilation units with variables only).
15231 * src/reduce.c (dump_grammar): Use it to trace the construction of
15232 ritem.
15233
15234 2001-12-04 Paul Eggert <eggert@twinsun.com>
15235
15236 * src/bison.simple (union yyalloc): Change member names
15237 to be the same as the stack names.
15238 (yyparse): yyptr is now union yyalloc *, not char *.
15239 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
15240 and may generate better code on some machines.
15241 (yystpcpy): Use prototype if __STDC__ is defined, not just
15242 if __cplusplus is defined.
15243
15244 2001-11-30 Akim Demaille <akim@epita.fr>
15245
15246 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
15247 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
15248 Gettext doesn't compile cleanly, and dies with -Werror.
15249 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
15250 Include WARNING_CFLAGS here.
15251 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
15252 before being defined.
15253
15254 2001-11-27 Paul Eggert <eggert@twinsun.com>
15255
15256 * lib/quotearg.h (quotearg_n, quotearg_n_style):
15257 First arg is int, not unsigned.
15258 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
15259 (SIZE_MAX, UINT_MAX): New macros.
15260 (quotearg_n_options): Abort if N is negative.
15261 Avoid overflow check on hosts where size_t is 64 bits and int
15262 is 32 bits, as overflow is impossible there.
15263 Fix off-by-one typo that caused unnecessary reallocation.
15264
15265 2001-11-29 Paul Eggert <eggert@twinsun.com>
15266
15267 Name space cleanup in generated parser.
15268
15269 * doc/bison.texinfo (Bison Parser): Discuss system headers
15270 and their effect on the user name space.
15271
15272 * src/bison.simple:
15273 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
15274 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
15275 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
15276
15277 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
15278 on user names when possible.
15279
15280 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
15281 Simplify test for whather <alloca.h> exists.
15282
15283 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
15284
15285 (<stdio.h>): Include if YYDEBUG.
15286
15287 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
15288 ! defined (yyoverflow) && ! defined (yymemcpy).
15289
15290 (yymemcpy, yyparse): Rename local variables as needed so that
15291 they all begin with 'yy'.
15292
15293 (yystrlen, yystpcpy): New functions.
15294
15295 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
15296 All uses changed.
15297
15298 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
15299 instead of relying on string.h functions. Use YYSTACK_ALLOC
15300 and YYSTACK_FREE instead of malloc and free.
15301
15302 2001-11-30 Akim Demaille <akim@epita.fr>
15303
15304 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
15305 before their first uses.
15306 (YYBISON, YYPURE): Move to the top of the output.
15307
15308 2001-11-30 Akim Demaille <akim@epita.fr>
15309
15310 * tests/reduce.at (Useless Nonterminals): Fix.
15311
15312 2001-11-30 Akim Demaille <akim@epita.fr>
15313
15314 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
15315 if body instead of `;' to pacify GCC's warnings.
15316
15317 2001-11-30 Akim Demaille <akim@epita.fr>
15318
15319 Instead of mapping the LHS of unused rules to -1, keep the LHS
15320 valid, but flag the rules as invalid.
15321
15322 * src/gram.h (rule_t): `useful' is a new member.
15323 * src/print.c (print_grammar): Adjust.
15324 * src/derives.c (set_derives): Likewise.
15325 * src/reader.c (packgram, reduce_output): Likewise.
15326 * src/reduce.c (reduce_grammar_tables): Likewise.
15327 * tests/reduce.at (Underivable Rules, Useless Rules): New.
15328
15329 2001-11-30 Akim Demaille <akim@epita.fr>
15330
15331 * src/reduce.c (reduce_output): Formatting changes.
15332 * src/print.c (print_results, print_grammar): Likewise.
15333 * tests/regression.at (Rule Line Numbers)
15334 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
15335
15336 2001-11-30 Akim Demaille <akim@epita.fr>
15337
15338 * src/reduce.c (nonterminals_reduce): Instead of throwing away
15339 useless nonterminals, move them at the end of the symbol arrays.
15340 (reduce_output): Adjust.
15341 * tests/reduce.at (Useless Nonterminals): Adjust.
15342
15343 2001-11-30 Akim Demaille <akim@epita.fr>
15344
15345 * src/reduce.c: Various comment/formatting changes.
15346 (nonterminals_reduce): New, extracted from...
15347 (reduce_grammar_tables): here.
15348 (reduce_grammar): Call nonterminals_reduce.
15349
15350 2001-11-29 Paul Eggert <eggert@twinsun.com>
15351
15352 * src/bison.simple (YYSTACK_REALLOC): Remove.
15353 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
15354 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
15355 New macros.
15356 (union yyalloc): New type.
15357 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
15358 an arbitrary restriction on hosts where size_t is wider than int.
15359
15360 (yyparse): Don't dump core if alloca or malloc fails; instead, report
15361 a parser stack overflow. Allocate just one block of memory for all
15362 three stacks, instead of allocating three blocks; this typically is
15363 faster and reduces fragmentation.
15364
15365 Do not limit the number of items in the stack to a value that fits
15366 in 'int', as this is an arbitrary limit on hosts with 64-bit
15367 size_t and 32-bit int.
15368
15369 2001-11-29 Marc Autret <autret_m@epita.fr>
15370
15371 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
15372 of defining YYERROR_VERBOSE.
15373 [AT_DATA]: $4 is now out of C declarations in the prologue.
15374
15375 2001-11-28 Marc Autret <autret_m@epita.fr>
15376
15377 * src/reader.c (parse_dquoted_param): New.
15378 (parse_skel_decl): Use it.
15379 * src/lex.h: Add its prototype.
15380 * src/lex.c (literalchar): Become not static.
15381
15382 2001-11-28 Marc Autret <autret_m@epita.fr>
15383
15384 * src/output.h: And put its extern declaration here.
15385 * src/output.c (error_verbose): Define here.
15386 (prepare): Echo name modification.
15387 * src/getargs.h: Clean its extern declaration.
15388 * src/getargs.c (error_verbose_flag): Remove.
15389 (getargs): Remove case 'e'.
15390 * src/options.c (option_table): 'error-verbose' is now seen as simple
15391 percent option.
15392 Include output.h.
15393
15394 * src/reader.c (read_declarations): Remove case tok_include.
15395 (parse_include_decl): Remove.
15396 * src/lex.h (token_t): Remove tok_include.
15397 * src/options.c (option_table): 'include' is now a simple command line
15398 option.
15399
15400 2001-11-28 Marc Autret <autret_m@epita.fr>
15401
15402 * src/bison.simple: Adjust muscle names.
15403 * src/muscle_tab.c (muscle_init): Also rename the muscles.
15404 * src/output.c (prepare): s/_/-/ for the muscles names.
15405 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
15406
15407 2001-11-28 Marc Autret <autret_m@epita.fr>
15408
15409 * src/bison.simple: Fix debug.
15410 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
15411
15412 2001-11-28 Akim Demaille <akim@epita.fr>
15413
15414 * src/LR0.c (shifts_new): New.
15415 (save_shifts, insert_start_shift, augment_automaton): Use it.
15416
15417 2001-11-28 Akim Demaille <akim@epita.fr>
15418
15419 * src/closure.c (closure): `b' and `ruleno' denote the same value:
15420 keep ruleno only.
15421
15422 2001-11-28 Akim Demaille <akim@epita.fr>
15423
15424 * src/closure.c (closure): Instead of looping over word in array
15425 then bits in words, loop over bits in array.
15426
15427 2001-11-28 Akim Demaille <akim@epita.fr>
15428
15429 * src/closure.c (closure): No longer optimize the special case
15430 where all the bits of `ruleset[r]' are set to 0, to make the code
15431 clearer.
15432
15433 2001-11-28 Akim Demaille <akim@epita.fr>
15434
15435 * src/closure.c (closure): `r' and `c' are new variables, used to
15436 de-obfuscate accesses to RULESET and CORE.
15437
15438 2001-11-28 Akim Demaille <akim@epita.fr>
15439
15440 * src/reduce.c (reduce_print): Use ngettext.
15441 (dump_grammar): Improve the trace accuracy.
15442
15443 2001-11-28 Akim Demaille <akim@epita.fr>
15444
15445 * src/reduce.c (dump_grammar): Don't translate trace messages.
15446
15447 2001-11-28 Akim Demaille <akim@epita.fr>
15448
15449 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
15450 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
15451 as all tags are free'ed afterwards.
15452 From Enrico Scholz.
15453
15454 2001-11-27 Paul Eggert <eggert@twinsun.com>
15455
15456 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
15457 use alloca when we didn't want to, and vice versa.
15458
15459 2001-11-27 Marc Autret <autret_m@epita.fr>
15460
15461 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
15462 initialization.
15463 * src/output.c (prepare): Remove its update.
15464
15465 2001-11-27 Marc Autret <autret_m@epita.fr>
15466
15467 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
15468 Use %error-verbose.
15469
15470 2001-11-27 Marc Autret <autret_m@epita.fr>
15471
15472 * src/bison.simple: Remove YYERROR_VERBOSE using.
15473 Use %%error_verbose.
15474 (yyparse): Likewise.
15475 * src/output.c (prepare): Give its final value.
15476 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
15477 * src/getargs.h: Add its extern declaration.
15478 * src/getargs.c (error_verbose_flag): New int.
15479 (getargs): Update to catch new case.
15480 * src/options.c (option_table): 'error-verbose' is a new option.
15481 (shortopts): Update.
15482
15483 2001-11-27 Akim Demaille <akim@epita.fr>
15484
15485 * src/system.h: Use intl/libgettext.h.
15486 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
15487
15488 2001-11-27 Akim Demaille <akim@epita.fr>
15489
15490 * tests/torture.at (Exploding the Stack Size with Malloc):
15491 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
15492
15493 2001-11-27 Akim Demaille <akim@epita.fr>
15494
15495 * src/files.c: Include error.h.
15496 Reported by Hans Aberg.
15497
15498 2001-11-26 Marc Autret <autret_m@epita.fr>
15499
15500 * src/reader.c (parse_include_decl): New, not yet implemented.
15501 (read_declarations): Add case tok_include.
15502 * src/getargs.h (include): Add its extern definition.
15503 * src/getargs.c (include): New const char *.
15504 (getargs): Add case '-I'.
15505 * src/options.c (option_table): Add include as command line and
15506 percent option.
15507 * src/lex.h (token_t): Add tok_include.
15508
15509 2001-11-26 Akim Demaille <akim@epita.fr>
15510
15511 * src/reader.c (readgram): Make sure rules for mid-rule actions
15512 have a lineno equal to that of their host rule.
15513 Reported by Hans Aberg.
15514 * tests/regression.at (Rule Line Numbers): New.
15515
15516 2001-11-26 Akim Demaille <akim@epita.fr>
15517
15518 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
15519 size_ts.
15520
15521 2001-11-26 Akim Demaille <akim@epita.fr>
15522
15523 * src/complain.c, src/complain.h (error): Remove, provided by
15524 lib/error.[ch].
15525
15526 2001-11-26 Akim Demaille <akim@epita.fr>
15527
15528 * src/reader.c (read_declarations): Don't abort on tok_illegal,
15529 issue an error message.
15530 * tests/regression.at (Invalid %directive): New.
15531 Reported by Hans Aberg.
15532
15533 2001-11-26 Akim Demaille <akim@epita.fr>
15534
15535 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
15536 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15537
15538 2001-11-26 Akim Demaille <akim@epita.fr>
15539
15540 * src/conflicts.c (conflicts_print): Don't complain at all when
15541 there are no reduce/reduce conflicts, and as many shift/reduce
15542 conflicts as expected.
15543 * tests/regression.at (%expect right): Adjust.
15544
15545 2001-11-23 Akim Demaille <akim@epita.fr>
15546
15547 * lib/alloca.c: Update, from fileutils.
15548
15549 2001-11-23 Akim Demaille <akim@epita.fr>
15550
15551 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
15552
15553 2001-11-23 Akim Demaille <akim@epita.fr>
15554
15555 * src/system.h: Include alloca.h.
15556 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
15557
15558 2001-11-23 Akim Demaille <akim@epita.fr>
15559
15560 * src/print_graph.c (print_actions): Remove `rule', unused.
15561 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
15562 pacify GCC's signed < unsigned warnings.
15563 * src/closure.c (itemsetsize): Likewise.
15564 * src/reader.c (symbol_list_new): Static.
15565
15566 2001-11-23 Akim Demaille <akim@epita.fr>
15567
15568 Attaching lineno to buckets is stupid, since only one copy of each
15569 symbol is kept, only the line of the first occurrence is kept too.
15570
15571 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
15572 * src/reader.c (rline_allocated): Remove, unused.
15573 (symbol_list): Have a `line' member.
15574 (symbol_list_new): New.
15575 (readgram): Use it.
15576 * src/print.c (print_grammar): Output the rule line numbers.
15577 * tests/regression.at (Solved SR Conflicts)
15578 (Unresolved SR Conflicts): Adjust.
15579 Reported by Hans Aberg.
15580
15581 2001-11-22 Marc Autret <autret_m@epita.fr>
15582
15583 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
15584
15585 2001-11-22 Marc Autret <autret_m@epita.fr>
15586
15587 * src/muscle_tab.c (muscle_init): Remove initialization of
15588 skeleton muscle.
15589 * src/output.c (output_master_parser): Do it here.
15590
15591 2001-11-20 Akim Demaille <akim@epita.fr>
15592
15593 * po/sv.po: New.
15594 * configure.in (ALL_LINGUAS): Adjust.
15595 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
15596 longer contains strings to translate.
15597
15598 2001-11-19 Akim Demaille <akim@epita.fr>
15599
15600 * src/conflicts.c (conflicts_print): Add a missing \n.
15601
15602 2001-11-19 Akim Demaille <akim@epita.fr>
15603
15604 * src/nullable.c (nullable_print): New.
15605 (set_nullable): Call it when tracing.
15606 Better locality of variables.
15607
15608 2001-11-19 Akim Demaille <akim@epita.fr>
15609
15610 * src/print.c (print_actions): Better locality of variables.
15611
15612 2001-11-19 Akim Demaille <akim@epita.fr>
15613
15614 * src/derives.c (print_derives): Fix and enrich.
15615 * src/closure.c (print_fderives): Likewise.
15616
15617 2001-11-19 Akim Demaille <akim@epita.fr>
15618
15619 * src/closure.c (itemsetend): Remove, replaced with...
15620 (itemsetsize): new.
15621
15622 2001-11-19 Akim Demaille <akim@epita.fr>
15623
15624 * src/LR0.c (kernel_end): Remove, replaced with...
15625 (kernel_size): new.
15626
15627 2001-11-19 Akim Demaille <akim@epita.fr>
15628
15629 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
15630 to clarify.
15631
15632 2001-11-19 Akim Demaille <akim@epita.fr>
15633
15634 * src/closure.c (closure): Use arrays instead of pointers to clarify.
15635
15636 2001-11-19 Akim Demaille <akim@epita.fr>
15637
15638 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
15639 trace messages.
15640 * src/LR0.c: Likewise.
15641 (allocate_itemsets): Use arrays instead of pointers to clarify.
15642
15643 2001-11-19 Akim Demaille <akim@epita.fr>
15644
15645 * src/getargs.c (statistics_flag): Replace with...
15646 (trace_flag): New.
15647 (longopts): Accept --trace instead of --statistics.
15648 * src/getargs.h, src/options.c: Adjust.
15649 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
15650 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
15651
15652 2001-11-19 Akim Demaille <akim@epita.fr>
15653
15654 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
15655 pointers to clarify the code.
15656 (save_reductions, save_shifts): Factor common parts of alternatives.
15657
15658 2001-11-19 Akim Demaille <akim@epita.fr>
15659
15660 * src/LR0.c (new_state, get_state): Complete TRACE code.
15661 * src/closure.c: Include `reader.h' to get `tags', needed by the
15662 trace code.
15663 Rename the conditional DEBUG as TRACE.
15664 Output consistently TRACEs to stderr, not stdout.
15665 * src/derives.c: Likewise.
15666 * src/reduce.c: (inaccessable_symbols): Using if is better style
15667 than goto.
15668 Use `#if TRACE' instead of `#if 0' for tracing code.
15669
15670 2001-11-19 Akim Demaille <akim@epita.fr>
15671
15672 * src/system.h (LIST_FREE, shortcpy): New.
15673 * src/LR0.c: Use them.
15674 * src/output.c (free_itemsets, free_reductions, free_shifts):
15675 Remove, replaced by LIST_FREE.
15676
15677 2001-11-19 Akim Demaille <akim@epita.fr>
15678
15679 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
15680 (REDUCTIONS_ALLOC): New.
15681 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
15682 allocation.
15683
15684 2001-11-19 Akim Demaille <akim@epita.fr>
15685
15686 * src/LR0.c (new_state): Complete trace code.
15687 * src/nullable.c (set_nullable): Don't translate traces.
15688
15689 2001-11-19 Akim Demaille <akim@epita.fr>
15690
15691 * src/print_graph.c (print_core): Better locality of variables.
15692 * src/print.c (print_core): Likewise.
15693
15694 2001-11-19 Akim Demaille <akim@epita.fr>
15695
15696 * src/vcg.c: You do the output, so you are responsible of the
15697 handling of VCG syntax, in particular: use quotearg.
15698 * src/print_graph.c: Don't.
15699 (print_actions): Don't output the actions as part of the nodes,
15700 since that's the job of the edges.
15701 (print_state): Don't output by hand: fill the node description,
15702 and ask for its output.
15703
15704 2001-11-19 Akim Demaille <akim@epita.fr>
15705
15706 * src/bison.simple (yyparse): When verbosely reporting an error,
15707 no longer put additional quotes around token names.
15708 * tests/calc.at: Adjust.
15709
15710 2001-11-19 Akim Demaille <akim@epita.fr>
15711
15712 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
15713 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
15714 * src/output.c: Adjust.
15715
15716 2001-11-19 Akim Demaille <akim@epita.fr>
15717
15718 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
15719 (rule_t): this.
15720 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
15721
15722 2001-11-19 Akim Demaille <akim@epita.fr>
15723
15724 * src/gram.h (rule_t): New.
15725 (rule_table): New.
15726 (rrhs, rlhs): Remove, part of state_t.
15727 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
15728 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15729 * src/reader.c, src/reduce.c: Adjust.
15730
15731 2001-11-19 Akim Demaille <akim@epita.fr>
15732
15733 * src/reader.c (symbols_output): New, extracted from...
15734 (packsymbols): Here.
15735 (reader): Call it.
15736
15737 2001-11-19 Akim Demaille <akim@epita.fr>
15738
15739 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
15740 (maxrhs): this new function.
15741
15742 2001-11-19 Akim Demaille <akim@epita.fr>
15743
15744 * src/lalr.c (F): New macro to access the variable F.
15745 Adjust.
15746
15747 2001-11-19 Akim Demaille <akim@epita.fr>
15748
15749 * src/lalr.h (LA): New macro to access the variable LA.
15750 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15751 * src/lalr.c: Adjust.
15752
15753 2001-11-19 Akim Demaille <akim@epita.fr>
15754
15755 * src/lalr.c (initialize_LA): Only initialize LA. Let...
15756 (set_state_table): handle the `lookaheads' members.
15757
15758 2001-11-19 Akim Demaille <akim@epita.fr>
15759
15760 * src/lalr.h (lookaheads): Removed array, whose contents is now
15761 a member of...
15762 (state_t): this structure.
15763 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15764 Adjust.
15765
15766 2001-11-19 Akim Demaille <akim@epita.fr>
15767
15768 * src/lalr.h (consistent): Removed array, whose contents is now
15769 a member of...
15770 (state_t): this structure.
15771 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15772 Adjust.
15773
15774 2001-11-19 Akim Demaille <akim@epita.fr>
15775
15776 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
15777 contents are now members of...
15778 (state_t): this structure.
15779 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15780 Adjust.
15781
15782 2001-11-19 Akim Demaille <akim@epita.fr>
15783
15784 * src/lalr.h (state_t): New.
15785 (state_table): Be a state_t * instead of a core **.
15786 (accessing_symbol): Remove, part of state_t.
15787 * src/lalr.c: Adjust.
15788 (set_accessing_symbol): Merge into...
15789 (set_state_table): this.
15790 * src/print_graph.c, src/conflicts.c: Adjust.
15791
15792 2001-11-14 Akim Demaille <akim@epita.fr>
15793
15794 * tests/calc.at, tests/output.at, tests/regression.at,
15795 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
15796 now the tests are run in private dirs, therefore AC_CLEANUP and
15797 family can be simplified to 0-ary.
15798 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
15799 use abs. path to find config.h.
15800 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
15801 stderr, there can be way too much random noise.
15802 Instead pass -Werror to GCC and rely on the exit status.
15803 Reported by Wolfram Wagner.
15804
15805 2001-11-14 Akim Demaille <akim@epita.fr>
15806
15807 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
15808 defined only if yyoverflow is defined, to avoid `warning: unused
15809 variable `yyvs1''.
15810 Reported by The Test Suite.
15811
15812 2001-11-14 Akim Demaille <akim@epita.fr>
15813
15814 * src/print.c: Include reduce.h.
15815 Reported by Hans Aberg.
15816
15817 2001-11-14 Akim Demaille <akim@epita.fr>
15818
15819 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
15820 Revert a previous patch: these are really const.
15821 * src/conflicts.c (conflict_report): Additional useless pair of
15822 braces to pacify GCC's warnings for `if () if () {} else {}'.
15823 * src/lex.c (parse_percent_token): Replace equal_offset with
15824 arg_offset.
15825 arg is const.
15826 Be sure to strdup `arg' when used, since there is no reason for
15827 token_buffer not to change.
15828
15829 2001-11-14 Akim Demaille <akim@epita.fr>
15830
15831 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
15832 definition.
15833 * src/main.c (main): Use them.
15834 Suggested by Hans Aberg.
15835
15836 2001-11-12 Akim Demaille <akim@epita.fr>
15837
15838 * src/system.h (ngettext): Now that we use ngettext, be sure to
15839 provide a default definition when NLS are not used.
15840
15841 2001-11-12 Akim Demaille <akim@epita.fr>
15842
15843 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
15844 Use @kbd to denote user input.
15845 (Language and Grammar): ANSIfy the example.
15846 Adjust its layout for info/notinfo.
15847 (Location Tracking Calc): Output error messages to stderr.
15848 Output locations in a more GNUtically correct way.
15849 Fix a couple of Englishos.
15850 Adjust @group/@end group pairs.
15851
15852 2001-11-12 Akim Demaille <akim@epita.fr>
15853
15854 %expect was not functioning at all.
15855
15856 * src/conflicts.c (expected_conflicts): Set to -1.
15857 (conflict_report): Use ngettext.
15858 (conflicts_print): Check %expect and make its violation an error.
15859 * doc/bison.texinfo (Expect Decl): Adjust.
15860 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
15861 * tests/regression.at (%expect not enough, %expect right)
15862 (%expect too much): New.
15863
15864 2001-11-12 Akim Demaille <akim@epita.fr>
15865
15866 * tests/regression.at (Conflicts): Rename as...
15867 (Unresolved SR Conflicts): this.
15868 (Solved SR Conflicts): New.
15869
15870 2001-11-12 Akim Demaille <akim@epita.fr>
15871
15872 * src/reduce.c (print_results): Rename as...
15873 (reduce_output): This.
15874 Output to OUT, passed as argument, instead of output_obstack.
15875 (dump_grammar): Likewise.
15876 (reduce_free): New.
15877 Also free V1.
15878 (reduce_grammar): No longer call reduce_output, since...
15879 * src/print.c (print_results): do it.
15880 * src/main.c (main): Call reduce_free;
15881
15882 2001-11-12 Akim Demaille <akim@epita.fr>
15883
15884 * src/conflicts.c (print_reductions): Accept OUT as argument.
15885 Output to it, not to output_obstack.
15886 * src/print.c (print_actions): Adjust.
15887
15888 2001-11-12 Akim Demaille <akim@epita.fr>
15889
15890 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
15891 the result instead of using...
15892 (src_total, rrc_total, src_count, rrc_count): Remove.
15893 (any_conflicts): Remove.
15894 (print_conflicts): Split into...
15895 (conflicts_print, conflicts_output): New.
15896 * src/conflicts.h: Adjust.
15897 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
15898 * src/print.c (print_grammar): Issue `\n' between two rules.
15899 * tests/regression.at (Conflicts): New.
15900 Reported by Tom Lane.
15901
15902 2001-11-12 Akim Demaille <akim@epita.fr>
15903
15904 * tests/regression.at (Invalid input): Remove, duplicate with
15905 ``Invalid input: 1''.
15906
15907 2001-11-12 Akim Demaille <akim@epita.fr>
15908
15909 * tests/torture.at (AT_DATA_STACK_TORTURE)
15910 (Exploding the Stack Size with Alloca)
15911 (Exploding the Stack Size with Malloc): New.
15912
15913 2001-11-12 Akim Demaille <akim@epita.fr>
15914
15915 * src/bison.simple (YYSTACK_REALLOC): New.
15916 (yyparse) [!yyoverflow]: Use it and free the old stack.
15917 Reported by Per Allansson.
15918
15919 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
15920
15921 * src/bison.simple: Define type yystype instead of YYSTYPE, and
15922 define CPP macro, which substitute YYSTYPE by yystype.
15923 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
15924 with yyltype/YYLTYPE. This allows inclusion of the generated
15925 header within the parser if the compiler, such as GGC, accepts
15926 multiple equivalent #defines.
15927 From Akim.
15928
15929 2001-11-05 Akim Demaille <akim@epita.fr>
15930
15931 * src/reader.c (symbols_output): New, extracted from...
15932 (packsymbols): here.
15933 (reader): Adjust.
15934
15935 2001-11-05 Akim Demaille <akim@epita.fr>
15936
15937 * src/lex.c (parse_percent_token): s/quotearg/quote/.
15938
15939 2001-11-05 Akim Demaille <akim@epita.fr>
15940
15941 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
15942 pattern.
15943
15944 2001-11-05 Akim Demaille <akim@epita.fr>
15945
15946 * src/options.h (struct option_table_struct): set_flags is void*.
15947 * src/options.c (longopts): Support `--output' and `%output'.
15948 (usage): Adjust.
15949 * src/lex.h (tok_setopt): Remove, replaced with...
15950 (tok_intopt, tok_stropt): these new guys.
15951 * src/lex.c (getopt.h): Not needed.
15952 (token_buffer, unlexed_token_buffer): Not const.
15953 (percent_table): Promote `-' over `_' in directive names.
15954 Active `%name-prefix', `file-prefix', and `output'.
15955 (parse_percent_token): Accept possible arguments to directives.
15956 Promote `-' over `_' in directive names.
15957
15958 2001-11-04 Akim Demaille <akim@epita.fr>
15959
15960 * doc/bison.texinfo (Decl Summary): Split the list into
15961 `directives for grammars' and `directives for bison'.
15962 Sort'em.
15963 Add description of `%name-prefix', `file-prefix', and `output'.
15964 Promote `-' over `_' in directive names.
15965 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
15966 Simplify the description of `--name-prefix'.
15967 Promote `-' over `_' in directive names.
15968 Promote `--output' over `--output-file'.
15969 Fix the description of `--defines'.
15970 * tests/output.at: Exercise %file-prefix and %output.
15971
15972 2001-11-02 Akim Demaille <akim@epita.fr>
15973
15974 * doc/refcard.tex: Update.
15975
15976 2001-11-02 Akim Demaille <akim@epita.fr>
15977
15978 * src/symtab.h (SUNDEF): New.
15979 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
15980 stand for `uninitialized', instead of 0.
15981 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
15982 * src/lex.c (lex): Adjust.
15983
15984 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
15985 Number it 0.
15986 Let yylex return it instead of a plain 0.
15987 Reported by Dick Streefland.
15988
15989 2001-11-02 Akim Demaille <akim@epita.fr>
15990
15991 * tests/regression.at (Mixing %token styles): New test.
15992
15993 2001-11-02 Akim Demaille <akim@epita.fr>
15994
15995 * src/reader.c (parse_thong_decl): Formatting changes.
15996 (token_translations_init): New, extracted from...
15997 (packsymbols): Here.
15998 Adjust.
15999
16000 2001-11-01 Akim Demaille <akim@epita.fr>
16001
16002 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
16003 Check that `9foo.y' produces correct cpp guards.
16004 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
16005 guards.
16006 Reported by Wwp.
16007
16008 2001-11-01 Akim Demaille <akim@epita.fr>
16009
16010 * tests/regression.at (Invalid input: 2): New.
16011 * src/lex.c (unlexed_token_buffer): New.
16012 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
16013 too.
16014 Reported by Wwp.
16015
16016 2001-11-01 Akim Demaille <akim@epita.fr>
16017
16018 * tests/calc.at: Catch up with 1.30.
16019 * configure.in: Bump to 1.49a.
16020 Adjust to newer Autotest.
16021
16022 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
16023
16024 * src/conflicts.c: Move global variables rrc_total and src_total ...
16025 (print_conflicts): here.
16026 * src/output.c (output): Free global variable user_toknums.
16027 * src/lex.c (token_obstack): Become static.
16028
16029 2001-10-18 Akim Demaille <akim@epita.fr>
16030
16031 * tests/atlocal.in (GCC): Add.
16032 * tests/calc.at: s/m4_match/m4_bmatch/.
16033 s/m4_patsubst/m4_bpatsubst/.
16034 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
16035 * configure.in: AC_SUBST(GCC).
16036
16037 2001-10-14 Marc Autret <autret_m@epita.fr>
16038
16039 * src/options.c (create_long_option_table): Fix.
16040
16041 2001-10-10 Akim Demaille <akim@epita.fr>
16042
16043 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
16044
16045 2001-10-04 Akim Demaille <akim@epita.fr>
16046
16047 * src/reader.c (parse_union_decl): Push the caracters in
16048 union_obstack, not attrs_obstack.
16049
16050 2001-10-04 Akim Demaille <akim@epita.fr>
16051
16052 Merge in the branch 1.29.
16053
16054 * src/reader.c (packsymbols): Use a temporary obstack for
16055 `%%tokendef', since output_stack is already used elsewhere.
16056
16057 2001-10-02 Akim Demaille <akim@epita.fr>
16058
16059 Bump 1.29d.
16060
16061 2001-10-02 Akim Demaille <akim@epita.fr>
16062
16063 Version 1.29c.
16064
16065 2001-10-02 Akim Demaille <akim@epita.fr>
16066
16067 * tests/regression.at (Invalid CPP headers): New.
16068 From Alexander Belopolsky.
16069 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
16070
16071 2001-10-02 Akim Demaille <akim@epita.fr>
16072
16073 * tests/regression.at (Invalid input): New.
16074 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
16075 Reported by Shura.
16076
16077 2001-10-02 Akim Demaille <akim@epita.fr>
16078
16079 * tests/calc.at: Now that --debug works, the tests must be adjusted.
16080
16081 2001-10-02 Akim Demaille <akim@epita.fr>
16082
16083 * src/output.c (output_parser): Assert `skeleton'.
16084 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
16085 systems.
16086 From Shura.
16087
16088 2001-10-01 Marc Autret <autret_m@epita.fr>
16089
16090 * src/lex.h: Echo modifications.
16091 * src/lex.c (unlex): Parameter is now token_t.
16092 From Hans Aberg.
16093
16094 2001-10-01 Marc Autret <autret_m@epita.fr>
16095
16096 * src/main.c: Include lex.h.
16097 From Hans Aberg.
16098
16099 2001-09-29 Akim Demaille <akim@epita.fr>
16100
16101 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
16102
16103 2001-09-28 Akim Demaille <akim@epita.fr>
16104
16105 * tests/testsuite.at: Update to newer Autotest.
16106 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
16107
16108 2001-09-27 Akim Demaille <akim@epita.fr>
16109
16110 Position independent wrapper.
16111
16112 * tests/bison: Remove.
16113 * tests/bison.in: New.
16114 * configure.in: Adjust.
16115
16116 2001-09-27 Paul Eggert <eggert@twinsun.com>
16117
16118 Port quotearg fixes from tar 1.13.24.
16119
16120 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
16121 tm to be declared.
16122 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
16123 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
16124
16125 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
16126 * m4/mbrtowc.m4: New file.
16127 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
16128 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
16129
16130 2001-09-27 Akim Demaille <akim@epita.fr>
16131
16132 Bump to 1.29c.
16133
16134 2001-09-27 Akim Demaille <akim@epita.fr>
16135
16136 Version 1.29b.
16137
16138 2001-09-25 Akim Demaille <akim@epita.fr>
16139
16140 * src/system.h: Include `xalloc.h'.
16141 Remove it from the C files.
16142 * src/files.c (output_files): Free the obstacks.
16143 * src/lex.c (init_lex): Rename as...
16144 (lex_init): this.
16145 (lex_free): New.
16146 * src/main.c (main): Use it.
16147
16148 2001-09-24 Marc Autret <autret_m@epita.fr>
16149
16150 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
16151 to output informations in fout (FILE*).
16152 (open_graph, close_graph): Likewise.
16153 (output_graph, output_edge, output_node): Likewise.
16154 * src/vcg.h: Update function prototypes.
16155 * src/print_graph.c (print_graph): Open output graph file.
16156 (print_actions): Adjust.
16157 * src/files.h: Remove extern declaration.
16158 * src/files.c: Remove graph_obstack declaration.
16159 (open_files): Remove graph_obstack initialization.
16160 (output_files): Remove graph_obstack saving.
16161
16162 2001-09-24 Marc Autret <autret_m@epita.fr>
16163
16164 * src/files.c (compute_output_file_names): Fix.
16165
16166 2001-09-24 Marc Autret <autret_m@epita.fr>,
16167 Akim Demaille <akim@epita.fr>
16168
16169 * src/reader.c (reader): Remove call to free_symtab ().
16170 * src/main.c (main): Call it here.
16171 Include symtab.h.
16172 * src/conflicts.c (initialize_conflicts): Rename as...
16173 (solve_conflicts): this.
16174 * src/print.c (print_core, print_actions, print_state)
16175 (print_grammar): Dump to a file instead a `output_obstack'.
16176 (print_results): Dump `output_obstack', and then proceed with the
16177 FILE *.
16178 * src/files.c (compute_output_file_names, close_files): New.
16179 (output_files): Adjust.
16180 * src/main.c (main): Adjust.
16181
16182 2001-09-23 Marc Autret <autret_m@epita.fr>
16183
16184 * src/files.c (compute_header_macro): Computes header macro name
16185 from spec_defines_file when given.
16186
16187 2001-09-23 Marc Autret <autret_m@epita.fr>
16188
16189 * src/files.c (output_files): Add default extensions.
16190
16191 2001-09-22 Akim Demaille <akim@epita.fr>
16192
16193 * src/conflicts.c (finalize_conflicts): Rename as...
16194 (free_conflicts): this.
16195
16196 2001-09-22 Akim Demaille <akim@epita.fr>
16197
16198 * src/gram.c (gram_free): Rename back as...
16199 (dummy): this.
16200 (output_token_translations): Free `token_translations'.
16201 * src/symtab.c (free_symtab): Free the tag field.
16202
16203 2001-09-22 Akim Demaille <akim@epita.fr>
16204
16205 Remove `translations' as it is always set to true.
16206
16207 * src/gram.h: Adjust.
16208 * src/reader.c (packsymbols, parse_token_decl): Adjust
16209 * src/print.c (print_grammar): Adjust.
16210 * src/output.c (output_token_translations): Adjust.
16211 * src/lex.c (lex): Adjust.
16212 * src/gram.c: Be sure the set pointers to NULL.
16213 (dummy): Rename as...
16214 (gram_free): this.
16215
16216 2001-09-22 Akim Demaille <akim@epita.fr>
16217
16218 * configure.in: Invoke AM_LIB_DMALLOC.
16219 * src/system.h: Use dmalloc.
16220 * src/LR0.c: Be sure to have pointers initialized to NULL.
16221 (allocate_itemsets): Allocate kernel_items only if needed.
16222
16223 2001-09-22 Akim Demaille <akim@epita.fr>
16224
16225 * configure.in: Bump to 1.29b.
16226 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
16227 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
16228 need xmalloc.c in calc.y.
16229 From Pascal Bart.
16230
16231 2001-09-21 Akim Demaille <akim@epita.fr>
16232
16233 Version 1.29a.
16234 * Makefile.maint, config/config.guess, config/config.sub,
16235 * config/missing: Update from masters.
16236 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
16237 upon package.m4.
16238 * configure.in (ALL_LINGUAS): Add `tr'.
16239
16240 2001-09-21 Akim Demaille <akim@epita.fr>
16241
16242 * tests/Makefile.am (package.m4): Move to...
16243 ($(srcdir)/$(TESTSUITE)): here.
16244
16245 2001-09-20 Akim Demaille <akim@epita.fr>
16246
16247 * src/complain.c: No longer try to be standalone: use system.h.
16248 Don't assume __STDC__ is defined to 1. Just test if it is defined.
16249 * src/complain.h: Likewise.
16250 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
16251 Remove the unused variable `n'.
16252 From Albert Chin-A-Young.
16253
16254 2001-09-18 Marc Autret <autret_m@epita.fr>
16255
16256 * doc/bison.1: Update.
16257 * doc/bison.texinfo (Bison Options): Update --defines and --graph
16258 descriptions.
16259 (Option Cross Key): Update.
16260 Add --graph.
16261
16262 2001-09-18 Marc Autret <autret_m@epita.fr>
16263
16264 * tests/regression.at: New test (comment in %union).
16265
16266 2001-09-18 Marc Autret <autret_m@epita.fr>
16267
16268 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
16269 do that.
16270 Reported by Keith Browne.
16271
16272 2001-09-18 Marc Autret <autret_m@epita.fr>
16273
16274 * tests/output.at: Add tests for --defines and --graph.
16275
16276 2001-09-18 Marc Autret <autret_m@epita.fr>
16277
16278 * tests/output.at: Removes tests of %{header,src}_extension features.
16279
16280 2001-09-18 Akim Demaille <akim@epita.fr>
16281
16282 * tests/Makefile.am (package.m4): New.
16283 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
16284 (_AT_CHECK_CALC_ERROR): Likewise.
16285 Factor the `, ' part of verbose error messages.
16286
16287 2001-09-18 Marc Autret <autret_m@epita.fr>
16288
16289 * src/getargs.c (longopts): Declare --defines and --graph as options
16290 with optional arguments.
16291 * src/files.h: Add extern declarations.
16292 * src/files.c (spec_graph_file, spec_defines_file): New.
16293 (output_files): Update.
16294 Remove CPP-outed code.
16295
16296 2001-09-18 Marc Autret <autret_m@epita.fr>
16297
16298 Turn off %{source,header}_extension feature.
16299
16300 * src/files.c (compute_exts_from_gf): Update.
16301 (compute_exts_from_src): Update.
16302 (output_files): CPP-out useless code.
16303 * src/files.h: Remove {header,source}_extension extern declarations.
16304 * src/reader.c (parse_dquoted_param): CPP-out.
16305 (parse_header_extension_decl): Remove.
16306 (parse_source_extension_decl): Remove.
16307 (read_declarations): Remove cases tok_{hdrext,srcext}.
16308 * src/lex.c (percent_table): Remove {header,source}_extension entries.
16309 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
16310
16311 2001-09-10 Akim Demaille <akim@epita.fr>
16312
16313 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
16314 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
16315 (AT_CHECK_OUTPUT): this.
16316 Merely check ls' exit status, its output is useless.
16317
16318 2001-09-10 Akim Demaille <akim@epita.fr>
16319
16320 * tests/calc.at: Use m4_match.
16321 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
16322
16323 2001-09-10 Marc Autret <autret_m@epita.fr>,
16324 Akim Demaille <akim@epita.fr>
16325
16326 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
16327 enum color_e.
16328 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
16329 to `normal'.
16330 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
16331 * src/lex.h: Adjust prototype.
16332 (token_t): Add `tok_undef'.
16333 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
16334 (parse_percent_token): Now returns token_t.
16335 Add default statement in switch.
16336 (lex): Separate `c' as an input variable, from the token_t result
16337 part.
16338 (unlexed): Is a token_t.
16339
16340 2001-09-10 Akim Demaille <akim@epita.fr>
16341
16342 * configure.in: Bump to 1.29a.
16343
16344 2001-09-07 Akim Demaille <akim@epita.fr>
16345
16346 Version 1.29.
16347
16348 2001-08-30 Akim Demaille <akim@epita.fr>
16349
16350 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
16351 * m4/atconfig.m4: Remove.
16352 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
16353 * tests/bison: New.
16354 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
16355 m4_if, m4_patsubst, and m4_regexp.
16356 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
16357 `input' file instead of echo.
16358
16359 2001-08-29 Akim Demaille <akim@epita.fr>
16360
16361 Bump to 1.28e.
16362
16363 2001-08-29 Akim Demaille <akim@epita.fr>
16364
16365 Version 1.28d.
16366
16367 2001-08-29 Paul Eggert <eggert@twinsun.com>
16368
16369 * src/bison.simple (yyparse): Don't take the address of an
16370 item before the start of an array, as that doesn't conform to
16371 the C Standard.
16372
16373 2001-08-29 Robert Anisko <anisko_r@epita.fr>
16374
16375 * doc/bison.texinfo (Location Tracking Calc): New node.
16376
16377 2001-08-29 Paul Eggert <eggert@twinsun.com>
16378
16379 * src/output.c (output): Do not define const, as this now
16380 causes more problems than it cures.
16381
16382 2001-08-29 Akim Demaille <akim@epita.fr>
16383
16384 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
16385 the nodes.
16386 Be sure to tag the `detailmenu'.
16387
16388 2001-08-29 Akim Demaille <akim@epita.fr>
16389
16390 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
16391 download in a tmp dir.
16392
16393 2001-08-28 Marc Autret <autret_m@epita.fr>
16394
16395 * config/depcomp: New file.
16396
16397 2001-08-28 Marc Autret <autret_m@epita.fr>
16398
16399 * doc/bison.1 (mandoc): Adjust.
16400 From Juan Manuel Guerrero.
16401
16402 2001-08-28 Marc Autret <autret_m@epita.fr>
16403
16404 * src/print_graph.c (print_state): Fix.
16405
16406 2001-08-27 Marc Autret <autret_m@epita.fr>
16407
16408 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
16409 char * members.
16410 Echo modifications to the functions prototypes.
16411 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
16412
16413 2001-08-27 Marc Autret <autret_m@epita.fr>
16414
16415 * src/vcg.c: Include `xalloc.h'.
16416 (add_colorentry): New.
16417 (add_classname): New.
16418 (add_infoname): New.
16419 * src/vcg.h: Add new prototypes.
16420
16421 2001-08-27 Akim Demaille <akim@epita.fr>
16422
16423 * Makefile.maint: Sync. again with CVS Autoconf.
16424
16425 2001-08-27 Akim Demaille <akim@epita.fr>
16426
16427 * Makefile.maint: Formatting changes.
16428 (po-update, cvs-update, update): New targets.
16429 (AMTAR): Remove.
16430
16431 2001-08-27 Akim Demaille <akim@epita.fr>
16432
16433 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16434 * Makefile.maint: Sync. with CVS Autoconf.
16435
16436 2001-08-27 Marc Autret <autret_m@epita.fr>
16437
16438 * src/vcg.h (struct infoname_s): New.
16439 (struct colorentry_s): New.
16440 (graph_s): New fields {vertical,horizontal}_order in structure.
16441 Add `infoname' field.
16442 Add `colorentry' field;
16443 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
16444 (G_HORIZONTAL_ORDER): New.
16445 (G_INFONAME): New.
16446 (G_COLORENTRY): New.
16447 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
16448 Add output of `infoname'.
16449 Add output of `colorentry'.
16450
16451 2001-08-27 Marc Autret <autret_m@epita.fr>
16452
16453 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
16454 This one shadowed a global parameter.
16455
16456 2001-08-24 Marc Autret <autret_m@epita.fr>
16457
16458 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
16459 instead of `unsigned'.
16460 (print_state): Do not call obstack_object_size () in obstack_grow ()
16461 to avoid macro variables shadowing.
16462
16463 2001-08-23 Marc Autret <autret_m@epita.fr>
16464
16465 * src/lex.c (percent_table): Typo: s/naem/name/.
16466 Add graph option.
16467 Normalize new options declarations.
16468
16469 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
16470
16471 * tests/suite.at: Exercise %header_extension and %source_extension.
16472
16473 2001-08-16 Marc Autret <autret_m@epita.fr>
16474
16475 * src/reader.c (parse_dquoted_param): New.
16476 (parse_header_extension_decl): Use it.
16477 (parse_source_extension_decl): Likewise.
16478
16479 2001-08-16 Marc Autret <autret_m@epita.fr>
16480
16481 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
16482 (get_xxxx_str): Use assert () instead of complain ().
16483 Remove return invokations in default cases.
16484 (get_decision_str): Modify default behaviour. Remove second argument.
16485 Echo modifications on calls.
16486 (output_graph): Fix.
16487
16488 2001-08-16 Marc Autret <autret_m@epita.fr>
16489
16490 * src/getargs.c (usage): Update with ``-g, --graph''.
16491
16492 2001-08-16 Marc Autret <autret_m@epita.fr>
16493
16494 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
16495 (Option Cross Key): Likewise.
16496 * doc/bison.1: Update.
16497
16498 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
16499
16500 * src/output.c (output_master_parser): Don't finish action_obstack.
16501 (output_parser): Don't care about the muscle action, here.
16502 (prepare): Copy the action_obstack in the action muscle.
16503 (output): Free action_obstack.
16504
16505 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
16506
16507 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
16508 will contain `%union' declaration.
16509 (parse_union_decl): Delete #line directive output.
16510 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
16511 informations about %union.
16512 (parse_union_decl): Copy the union_obstack in the muscle stype.
16513 * src/bison.simple: Add new #line directive.
16514 Add typdef %%stype YYSTYPE.
16515
16516 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
16517
16518 * src/bison.simple: Add new `#line' directive.
16519
16520 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
16521
16522 * src/bison.simple: New `#line' directive.
16523 * src/output.c (output_parser): Support new dynamic muscle input_line.
16524
16525 2001-09-22 Marc Autret <autret_m@epita.fr>
16526
16527 * src/output.c (output_master_parser): New.
16528 (output_parser): Be more re-entrant.
16529
16530 2001-09-21 Marc Autret <autret_m@epita.fr>
16531
16532 * src/reader.c (copy_definition, parse_union_decl): Update and use
16533 `linef' muscle.
16534 (copy_action): Likewise.
16535 Use obstack_1grow ().
16536 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
16537
16538 2001-09-21 Marc Autret <autret_m@epita.fr>
16539
16540 * src/options.c (option_table): Adjust.
16541 * src/lex.c (parse_percent_token): Fix.
16542
16543 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
16544
16545 * src/options.c (symtab.h): Include it, need by lex.h.
16546
16547 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
16548
16549 * src/lex.c (parse_percent_token): Change type of variable `tx', which
16550 is now an option_table_struct*.
16551 (option_strcmp): New function option_strcmp.
16552 (parse_percent_token): Call option_strcmp.
16553 * src/getargs.c (xalloc.h, options.h): Include it.
16554 (getargs): Call create_long_option_table.
16555 (getargs): Free longopts at the end of the function.
16556 (shortopts): Move in options.c.
16557 * src/options.c (create_long_option_table): New function. Convert
16558 information from option_table to option structure.
16559 * src/reader.c (options.h): Include it.
16560
16561 * src/Makefile.am: Adjust.
16562 * src/options.c (option_table): Create from longopts and percent_table.
16563 * src/getargs.c (longopts): Delete.
16564 * src/lex.c (struct percent_table_struct): Delete.
16565 (percent_table): Delete.
16566 (options.h): Include it.
16567 * src/options.c: Create.
16568 * src/options.h: Create.
16569 Declare enum opt_access_e.
16570 Define struct option_table_struct.
16571
16572 2001-09-20 Marc Autret <autret_m@epita.fr>
16573
16574 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
16575 sections of Bison.
16576
16577 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
16578
16579 * src/bison.simple: s/%%filename/%%skeleton.
16580 * src/muscle_tab.c (getargs.h): Include it.
16581 (muscle_init): Insert new muscle skeleton.
16582
16583 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
16584
16585 * src/output.c (output_parser): Delete unused variable actions_dumped.
16586
16587 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
16588
16589 * src/output.c (output): Delete call to reader_output_yylsp.
16590 * src/reader.c (reader): Likewise.
16591 * src/reader.h: Delete declaration of reader_output_yylsp.
16592
16593 2001-09-02 Marc Autret <autret_m@epita.fr>
16594
16595 * src/reader.c: Include muscle_tab.h.
16596 (parse_union_decl): Update.
16597 (parse_macro_decl): Rename parse_muscle_decl.
16598 Update to use renamed functions and variable.
16599 (read_declarations, copy_action, read_additionnal_code, : Updated
16600 with correct variables and functions names.
16601 (packsymbols, reader): Likewise.
16602
16603 * src/reader.h (muscle_obstack): Extern declaration update.
16604
16605 * src/output.c: Include muscle_tab.h
16606 In all functions using macro_insert, change by using muscle_insert ().
16607 (macro_obstack): Rename muscle_obstack.
16608 Echo modifications in the whole file.
16609 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
16610 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
16611 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
16612
16613 * src/muscle_tab.h: Update double inclusion macros.
16614 (macro_entry_s): Rename muscle_entry_s.
16615 Update prototypes.
16616
16617 * src/muscle_tab.c: Include muscle_tab.h.
16618 Rename macro_tabble to muscle_table.
16619 (mhash1, mhash2, mcmp): Use muscle_entry.
16620 (macro_init): Rename muscle_init. Update.
16621 (macro_insert): Rename muscle_insert. Update.
16622 (macro_find): Rename muscle_find. Update.
16623
16624 * src/main.c: Include muscle_tab.h.
16625 (main): Call muscle_init ().
16626 * src/Makefile.am (bison_SOURCES): Echo modifications.
16627
16628 2001-09-02 Marc Autret <autret_m@epita.fr>
16629
16630 Now the files macro_tab.[ch] are named muscle_tab.[ch].
16631
16632 * src/muscle_tab.c, src/muscle_tab.h: Add files.
16633
16634 2001-09-02 Marc Autret <autret_m@epita.fr>
16635
16636 * src/macrotab.c, src/macrotab.h: Remove.
16637
16638 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
16639
16640 * src/reader.c (copy_guard): Use muscle to specify the `#line'
16641 filename.
16642
16643 2001-09-01 Marc Autret <autret_m@epita.fr>
16644
16645 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
16646 to an explicit value to activate the feature. We do it here.
16647
16648 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16649
16650 * src/output.c (prepare): Delete the `filename' muscule insertion.
16651 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
16652 (parse_union_decl): Likewise.
16653 * src/macrotab.c (macro_init): Initialize filename by infile.
16654
16655 2001-08-31 Marc Autret <autret_m@epita.fr>
16656
16657 * src/bison.simple (YYLSP_NEEDED): New definition.
16658 * src/output.c (prepare): Add macro insertion of `locations_flag'
16659
16660 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16661
16662 * src/output.c (prepare): Delete insertion of previous muscles,
16663 and insert the `prefix' muscles.
16664 * src/macrotab.c (macro_init): Likewise.
16665 (macro_init): Initialization prefix directive by `yy'.
16666 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
16667 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
16668 yylval, yydebug, yyerror, yynerrs and yyparse.
16669 New directive `#define' to substitute yydebug, ... with option
16670 name_prefix.
16671
16672 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16673
16674 * src/main.c (main): Standardize.
16675 * src/output.c (output_table_data, output_parser): Likewise.
16676 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
16677
16678 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
16679
16680 * src/reader.c (read_additionnal_code): Rename %%user_code to
16681 %%epilogue.
16682 * src/output.c (output): Rename %%declarations to %%prologue.
16683 * src/bison.simple: Echo modifications.
16684
16685 2001-08-31 Marc Autret <autret_m@epita.fr>
16686
16687 * src/reader.c (readgram): CleanUp.
16688 (output_token_defines): Likewise.
16689 (packsymbols): Likewise.
16690 (reader): Likewise.
16691 * src/output.c (output): CPP-out useless code.
16692
16693 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16694
16695 * src/reader.c (reader): Delete obsolete call to function
16696 output_trailers and output_headers.
16697 * src/output.h: Remove obsolete functions prototypes of output_headers
16698 and output_trailers.
16699
16700 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
16701
16702 * src/main.c: Include macrotab.h.
16703 * src/macrotab.h (macro_entry_s): Constify fields.
16704 Adjust functions prototypes.
16705 * src/macrotab.c (macro_insert): Constify key and value.
16706 (macro_find): Constify key.
16707 (macro_insert): Include 'xalloc.h'
16708 (macro_insert): Use XMALLOC.
16709 (macro_find): Constify return value.
16710 * src/output.c (output_table_data): Rename table to table_data.
16711 (output_parser): Constify macro_key, macro_value.
16712
16713 2001-08-30 Marc Autret <autret_m@epita.fr>
16714
16715 * src/reader.c (parse_skel_decl): New.
16716 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
16717 * src/lex.h (token_t): New token `tok_skel'.
16718 * src/lex.c (percent_table): Add skeleton option entry.
16719 Standardize.
16720
16721 2001-08-29 Marc Autret <autret_m@epita.fr>
16722
16723 * src/bison.simple: Add %%user_code directive at the end.
16724 * src/reader.c (read_additionnal_code): New.
16725 (reader): Use it.
16726 * src/output.c (output_program): Remove.
16727 (output): Update.
16728
16729 2001-08-28 Marc Autret <autret_m@epita.fr>
16730
16731 * src/output.c (output_actions): Clean up.
16732 (output_gram): CPP-out useless code.
16733 * src/reader.c (reader): Clean up, CPP-out useless code.
16734
16735 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
16736
16737 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
16738 directive.
16739 * src/bison.simple: Add `%%definitions'.
16740
16741 2001-08-28 Marc Autret <autret_m@epita.fr>
16742
16743 * config/depcomp: New file.
16744
16745 2001-08-27 Paul Eggert <eggert@twinsun.com>
16746
16747 * src/bison.simple (yyparse): Don't take the address of an
16748 item before the start of an array, as that doesn't conform to
16749 the C Standard.
16750
16751 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
16752
16753 * src/output.c (output): Remove the initialization of the macro
16754 obstack. It was done too late here.
16755
16756 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
16757 completely wrong.
16758 (reader): Initialize the macro obstack here, since we need it to grow
16759 '%define' directives.
16760
16761 * src/reader.h: Declare the macro obstack as extern.
16762
16763 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
16764
16765 * src/output.c (output_parser): Fix. Store single '%' characters in
16766 the output obstack instead of throwing them away.
16767
16768 2001-08-27 Akim Demaille <akim@epita.fr>
16769
16770 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16771
16772 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16773
16774 * lib/Makefile.am: Adjust.
16775
16776 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16777
16778 * src/bison.simple: Update and add '%%' directives.
16779
16780 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16781
16782 * src/reader.c (reader): Remove calls to 'output_headers' and
16783 'output_trailers'. Remove some C output.
16784 (readgram): Disable a piece of code that was writing a default
16785 definition for 'YYSTYPE'.
16786 (reader_output_yylsp): Remove.
16787 (packsymbols): Output token defintions to a macro.
16788 (copy_definition): Disable C output.
16789
16790 * src/reader.c (parse_macro_decl): New function used to parse macro
16791 declarations.
16792 (copy_string2): Put the body of copy_string into this new function.
16793 Add a parameter to let the caller choose whether he wants to copy the
16794 string delimiters or not.
16795 (copy_string): Be a simple call to copy_string2 with the last argument
16796 bound to true.
16797 (read_declarations): Add case for macro definition.
16798 (copy_identifier): New.
16799 (parse_macro_decl): Read macro identifiers using copy_identifier
16800 rather than lex.
16801
16802 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16803
16804 * src/output.c (prepare): Add prefixed names.
16805 (output_parser): Output semantic actions.
16806 (output_parser): Fix bug on '%%line' directives.
16807
16808 * src/output.c (output_headers): Remove. The C code printed by this
16809 function should now be in the skeletons.
16810 (output_trailers): Remove.
16811 (output): Disable call to 'reader_output_yylsp'.
16812 (output_rule_data): Do not output tables to the table obstack.
16813
16814 * src/output.c: Remove some C dedicated output.
16815 Improve the use of macro and output obstacks.
16816 (output_defines): Remove.
16817
16818 * src/output.c (output_token_translations): Associate 'translate'
16819 table with a macro. No output to the table obstack.
16820 (output_gram): Same for 'rhs' and 'prhs'.
16821 (output_stos): Same for 'stos'.
16822 (output_rule_data): Same for 'r1' and 'r2'.
16823 (token_actions): Same for 'defact'.
16824 (goto_actions): Same for 'defgoto'.
16825 (output_base): Same for 'pact' and 'pgoto'.
16826 (output_table): Same for 'table'.
16827 (output_check): Same for 'check'.
16828
16829 * src/output.c (output_table_data): New function.
16830 (output_short_table): Remove.
16831 (output_short_or_char_table): Remove.
16832
16833 * src/output.c (output_parser): Replace most of the skeleton copy code
16834 with something new. Skeletons are now processed character by character
16835 rather than line by line, and Bison looks for '%%' macros. This is the
16836 first step in making Bison's output process (a lot) more flexible.
16837 (output_parser): Use the macro table.
16838
16839 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16840
16841 * src/main.c (main): Initialize the macro table.
16842
16843 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16844
16845 * src/lex.c (percent_table): Add tok_define.
16846 * src/lex.h: Add tok_define.
16847
16848 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16849
16850 * src/macrotab.c: New file.
16851 * src/macrotab.h: New file.
16852 * src/Makefile.am: Update.
16853
16854 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16855
16856 * lib/hash.c: New file.
16857 * lib/hash.h: New file.
16858 * lib/Makefile.am: Update.
16859
16860 2001-08-15 Akim Demaille <akim@epita.fr>
16861
16862 Version 1.28c.
16863
16864 2001-08-15 Marc Autret <autret_m@epita.fr>
16865
16866 * src/reader.c (readgram): Indent output macro YYSTYPE.
16867 (packsymbols): Likewise.
16868 (output_token_defines): Likewise.
16869 * src/files.c: Standardize.
16870 (compute_header_macro): New.
16871 (defines_obstack_save): New. Use compute_header_macro.
16872 (output_files): Update. Use defines_obstack_save.
16873
16874 2001-08-15 Akim Demaille <akim@epita.fr>
16875
16876 * doc/bison.texinfo (Table of Symbols): Document
16877 YYSTACK_USE_ALLOCA.
16878
16879 2001-08-15 Akim Demaille <akim@epita.fr>
16880
16881 * missing: Update from CVS Automake.
16882 * config/config.guess, config/config.sub, config/texinfo.tex:
16883 Update from gnu.org.
16884
16885 2001-08-15 Akim Demaille <akim@epita.fr>
16886
16887 * Makefile.maint: Sync with CVS Autoconf.
16888
16889 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
16890
16891 * doc/bison.texinfo: Include GNU Free Documentation License from
16892 `fdl.texi'.
16893 * doc/fdl.texi: Add to package.
16894
16895 2001-08-14 Marc Autret <autret_m@epita.fr>
16896
16897 Turn on %{source,header}_extension features.
16898
16899 * src/lex.c (percent_table): Un-CPP out header_extension and
16900 source_extension.
16901 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
16902 (compute_exts_from_src): Remove conditions. It restores priorities
16903 between options.
16904
16905 2001-08-14 Marc Autret <autret_m@epita.fr>
16906
16907 * src/files.c (compute_base_names): Add extensions computing when
16908 `--file-prefix' used.
16909 Standardize function calls.
16910
16911 2001-08-13 Marc Autret <autret_m@epita.fr>
16912
16913 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
16914 defining it (defined but null disables alloca).
16915
16916 2001-08-13 Marc Autret <autret_m@epita.fr>
16917
16918 * src/bison.simple (_yy_memcpy): CPP reformat.
16919
16920 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
16921
16922 * tests/atconfig.in (CPPFLAGS): Fix.
16923
16924 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
16925
16926 * doc/bison.texinfo: Include GNU General Public License from
16927 `gpl.texi'.
16928 * doc/gpl.texi: Add to package.
16929
16930 2001-08-10 Marc Autret <autret_m@epita.fr>
16931
16932 * src/print_graph.h: Fix.
16933 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
16934
16935 2001-08-10 Akim Demaille <akim@epita.fr>
16936
16937 * src/system.h: Provide default declarations for stpcpy, strndup,
16938 and strnlen.
16939
16940 2001-08-10 Robert Anisko <anisko_r@epita.fr>
16941
16942 * doc/bison.texinfo (Locations): Update @$ stuff.
16943
16944 2001-08-09 Robert Anisko <anisko_r@epita.fr>
16945
16946 * src/bison.simple (YYLLOC_DEFAULT): Update.
16947 (yyparse): Adjust.
16948
16949 2001-08-08 Marc Autret <autret_m@epita.fr>
16950
16951 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
16952 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
16953 Reported by Fabrice Bauzac.
16954
16955 2001-08-08 Marc Autret <autret_m@epita.fr>
16956
16957 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
16958 * src/vcg.c (output_node): Fix.
16959 * src/vcg.h: Cleanup.
16960 * src/print_graph.c: Add comments.
16961 (node_output_size): New global variable. Simplify the formatting of
16962 the VCG graph output.
16963 (print_actions): Unused code is now used. It notifies the final state
16964 and no action states in the VCG graph. It also give the reduce actions.
16965 The `shift and goto' edges are red and the `go to state' edges are
16966 blue.
16967 Get the current node name and node_obstack by argument.
16968 (node_obstack): New variable.
16969 (print_state): Manage node_obstack.
16970 (print_core): Use node_obstack given by argument.
16971 A node is not only computed here but in print_actions also.
16972 (print_graph): CPP out useless code instead of commenting it.
16973
16974 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
16975
16976 * tests/atconfig.in (CPPFLAGS): Fix.
16977
16978 2001-08-07 Akim Demaille <akim@epita.fr>
16979
16980 * src/print_graph.c (quote): New.
16981 (print_core): Use it.
16982
16983 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
16984
16985 * src/vcg.c (complain.h): Include it.
16986 Unepitaize `return' invocations.
16987 [NDEBUG] (main): Remove.
16988 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
16989 * src/files.c (open_files): Initialize graph_obstack.
16990 * src/print_graph.c (print_actions): CPP out useless code.
16991 (print_core): Don't output the last `\n' in labels.
16992 Use `quote'.
16993 * src/files.c (output_files): Output the VCG file.
16994 * src/main.c (main): Invoke print_graph ();
16995
16996 2001-08-06 Marc Autret <autret_m@epita.fr>
16997
16998 Automaton VCG graph output.
16999 Using option ``-g'' or long option ``--graph'', you can generate
17000 a gram_filename.vcg file containing a VCG description of the LALR (1)
17001 automaton of your grammar.
17002
17003 * src/main.c: Call to print_graph() function.
17004 * src/getargs.h: Update.
17005 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
17006 (graph_flag): New flag.
17007 (longopts): Update.
17008 (getargs): Add case `g'.
17009 * src/files.c (graph_obstack): New obstack struct.
17010 (open_files): Initialize new obstack.
17011 (output_files): Saves graph_obstack if required.
17012 * src/files.h (graph_obstack): New extern declaration.
17013 * src/Makefile.am: Add new source files.
17014
17015 2001-08-06 Marc Autret <autret_m@epita.fr>
17016
17017 * src/print_graph.c, src/print_graph.h (graph): New.
17018 * src/vcg.h: New file.
17019 * src/vcg.c: New file, VCG graph handling.
17020
17021 2001-08-06 Marc Autret <autret_m@epita.fr>
17022
17023 Add of %source_extension and %header_extension which specify
17024 the source or/and the header output file extension.
17025
17026 * src/files.c (compute_base_names): Remove initialisation of
17027 src_extension and header_extension.
17028 (compute_exts_from_gf): Update.
17029 (compute_exts_from_src): Update.
17030 (output_files): Update.
17031 * src/reader.c (parse_header_extension_decl): New.
17032 (parse_source_extension_decl): New.
17033 (read_declarations): New case statements for the new tokens.
17034 * src/lex.c (percent_table): Add entries for %source_extension
17035 and %header_extension.
17036 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
17037
17038 2001-08-06 Marc Autret <autret_m@epita.fr>
17039
17040 * configure.in: Bump to 1.28c.
17041 * doc/bison.texinfo: Texinfo thingies.
17042
17043 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
17044
17045 * tests/atconfig.in (CPPFLAGS): Add.
17046 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
17047
17048 2001-08-03 Akim Demaille <akim@epita.fr>
17049
17050 Version 1.28b.
17051
17052 2001-08-03 Akim Demaille <akim@epita.fr>
17053
17054 * tests/Makefile.am (check-local): Ship testsuite.
17055 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
17056 Include `string.h'.
17057
17058 2001-08-03 Akim Demaille <akim@epita.fr>
17059
17060 * configure.in: Try using -Wformat when compiling.
17061
17062 2001-08-03 Akim Demaille <akim@epita.fr>
17063
17064 * configure.in: Bump to 1.28b.
17065
17066 2001-08-03 Akim Demaille <akim@epita.fr>
17067
17068 * src/complain.c: Adjust strerror_r portability issues.
17069
17070 2001-08-03 Akim Demaille <akim@epita.fr>
17071
17072 Version 1.28a.
17073
17074 2001-08-03 Akim Demaille <akim@epita.fr>
17075
17076 * src/getargs.c, src/getarg.h (skeleton)): Constify.
17077 * src/lex.c (literalchar): Avoid name clashes on `buf'.
17078 * src/getargs.c: Include complain.h.
17079 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
17080 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
17081
17082 2001-08-03 Akim Demaille <akim@epita.fr>
17083
17084 * src/reader.c (readgram): Display hidden chars in error messages.
17085
17086 2001-08-03 Akim Demaille <akim@epita.fr>
17087
17088 Update to gettext 0.10.39.
17089
17090 2001-08-03 Akim Demaille <akim@epita.fr>
17091
17092 * lib/strspn.c: New.
17093
17094 2001-08-01 Marc Autret <autret_m@epita.fr>
17095
17096 * doc/bison.texinfo: Update.
17097 * doc/bison.1 (mandoc): Update.
17098 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
17099 * src/files.c: Support output files extensions computing.
17100 (src_extension): New static variable.
17101 (header_extension): New static variable.
17102 (tr): New function.
17103 (get_extension_index): New function, gets the index of an extension
17104 filename in a string.
17105 (compute_exts_from_gf): New function, computes extensions from the
17106 grammar file extension.
17107 (compute_exts_from_src): New functions, computes extensions from the
17108 C source file extension, file given by ``-o'' option.
17109 (compute_base_names): Update.
17110 (output_files): Update.
17111
17112 2001-08-01 Robert Anisko <anisko_r@epita.fr>
17113
17114 * doc/bison.texi: Document @$.
17115 (Locations): New section.
17116
17117 2001-07-18 Akim Demaille <akim@epita.fr>
17118
17119 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
17120 * config/prev-version.txt, config/move-if-change: New.
17121 * Makefile.am: Adjust.
17122
17123 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
17124
17125 * src/bison.simple (yyparse): Suppress warning `comparaison
17126 between signed and unsigned'.
17127
17128 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
17129
17130 * src/getargs.h (raw_flag): Remove.
17131 * src/getargs.c: Die on `-r'/`--raw'.
17132 * src/lex.c (parse_percent_token): Die on `%raw'.
17133 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
17134 * tests/calc.at: Suppress test with option `--raw'.
17135
17136 2001-07-14 Akim Demaille <akim@epita.fr>
17137
17138 * config/: New.
17139 * configure.in: Require Autoconf 2.50.
17140 Update to gettext 0.10.38.
17141
17142 2001-03-16 Akim Demaille <akim@epita.fr>
17143
17144 * doc/bison.texinfo: ANSIfy the examples.
17145
17146 2001-03-16 Akim Demaille <akim@epita.fr>
17147
17148 * getargs.c (skeleton): New variable.
17149 (longopts): --skeleton is a new option.
17150 (shortopts, getargs): -S is a new option.
17151 * getargs.h: Declare skeleton.
17152 * output.c (output_parser): Use it.
17153
17154 2001-03-16 Akim Demaille <akim@epita.fr>
17155
17156 * m4/strerror_r.m4: New.
17157 * m4/error.m4: Run AC_FUNC_STRERROR_R.
17158 * lib/error.h, lib/error.c: Update.
17159
17160 2001-03-16 Akim Demaille <akim@epita.fr>
17161
17162 * src/getargs.c (longopts): Clean up.
17163
17164 2001-02-21 Akim Demaille <akim@epita.fr>
17165
17166 * src/reader.c (gensym): `gensym_count' is your own.
17167 Use a static buf to create the symbol name, as token_buffer is no
17168 longer a buffer.
17169
17170 2001-02-08 Akim Demaille <akim@epita.fr>
17171
17172 * src/conflicts.c (conflict_report): Be sure not to append to res
17173 between two calls, which could happen if both first sprintf were
17174 skipped, but not the first cp += strlen.
17175
17176 2001-02-08 Akim Demaille <akim@epita.fr>
17177
17178 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
17179 New, from fileutils 4.0.37.
17180 * configure.in: Require Autoconf 2.49c. I took some time before
17181 making this decision. This is the only way out for portability
17182 issues in Bison, it would mean way too much duplicate effort to
17183 import in Bison features implemented in 2.49c since 2.13.
17184 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
17185
17186 2001-02-02 Akim Demaille <akim@epita.fr>
17187
17188 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
17189 * lib/xalloc.h, lib/xmalloc.c: Update.
17190
17191 2001-01-19 Akim Demaille <akim@epita.fr>
17192
17193 Get rid of the ad hoc handling of token_buffer in the scanner: use
17194 the obstacks.
17195
17196 * src/lex.c (token_obstack): New.
17197 (init_lex): Initialize it. No longer call...
17198 (grow_token_buffer): this. Remove it.
17199 Adjust all the places which used it to use the obstack.
17200
17201 2001-01-19 Akim Demaille <akim@epita.fr>
17202
17203 * src/lex.h: Rename all the tokens:
17204 s/\bENDFILE\b/tok_eof/g;
17205 s/\bIDENTIFIER\b/tok_identifier/g;
17206 etc.
17207 Let them be enums, not #define, to ease debugging.
17208 Adjust all the code.
17209
17210 2001-01-18 Akim Demaille <akim@epita.fr>
17211
17212 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
17213 * src/lex.c (maxtoken, grow_token_buffer): Static.
17214
17215 2001-01-18 Akim Demaille <akim@epita.fr>
17216
17217 Since we now use obstacks, more % directives can be enabled.
17218
17219 * src/lex.c (percent_table): Also accept `%yacc',
17220 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
17221 `%debug'.
17222 Handle the actions for `%semantic_parser' and `%pure_parser' here,
17223 instead of returning a token.
17224 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
17225 * src/reader.c (read_declarations): Adjust.
17226 * src/files.c (open_files): Don't call `compute_base_names', don't
17227 compute `attrsfile' since they depend upon data which might be
17228 *in* the input file now.
17229 (output_files): Do it here.
17230 * src/output.c (output_headers): Document the fact that this patch
17231 introduces a guaranteed SEGV for semantic parsers.
17232 * doc/bison.texinfo: Document them.
17233 * tests/suite.at: Exercise these %options.
17234
17235 2000-12-20 Akim Demaille <akim@epita.fr>
17236
17237 Also handle the output file (--verbose) with obstacks.
17238
17239 * files.c (foutput): Remove.
17240 (output_obstack): New.
17241 Adjust all dependencies.
17242 * src/conflicts.c: Return a string.
17243 * src/system.h (obstack_grow_string): Rename as...
17244 (obstack_sgrow): this. Be ready to work with non literals.
17245 (obstack_fgrow4): New.
17246
17247 2000-12-20 Akim Demaille <akim@epita.fr>
17248
17249 * src/files.c (open_files): Fix the computation of short_base_name
17250 in the case of `-o foo.tab.c'.
17251
17252 2000-12-20 Akim Demaille <akim@epita.fr>
17253
17254 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
17255 (copy_dollar): Now that everything uses obstacks, get rid of the
17256 FILE * parameters.
17257
17258 2000-12-20 Akim Demaille <akim@epita.fr>
17259
17260 * src/files.c (open_files): Actually the `.output' file is based
17261 on the short_base_name, not base_name.
17262 * tests/suite.at (Checking output file names): Adjust.
17263
17264 2000-12-20 Akim Demaille <akim@epita.fr>
17265
17266 * src/bison.s1: Remove, we now use directly...
17267 * src/bison.simple: this.
17268 * src/Makefile.am: Use pkgdata instead of data.
17269
17270 2000-12-20 Akim Demaille <akim@epita.fr>
17271
17272 * src/files.c (guard_obstack): New.
17273 (open_files): Initialize it.
17274 (output_files): Dump it...
17275 * src/files.h: Export it.
17276 * src/reader.c (copy_guard): Use it.
17277
17278 2000-12-19 Akim Demaille <akim@epita.fr>
17279
17280 * src/files.c (outfile, defsfile, actfile): Removed as global
17281 vars.
17282 (open_files): Don't compute them.
17283 (output_files): Adjust.
17284 (base_name, short_base_name): Be global.
17285 Adjust dependencies.
17286
17287 2000-12-19 Akim Demaille <akim@epita.fr>
17288
17289 * src/files.c (strsuffix): New.
17290 (stringappend): Be just like strcat but allocate.
17291 (base_names): Eve out from open_files.
17292 Try to simplify the rather hairy computation of base_name and
17293 short_base_name.
17294 (open_files): Use it.
17295 * tests/suite.at (Checking output file names): New test.
17296
17297 2000-12-19 Akim Demaille <akim@epita.fr>
17298
17299 * src/system.h (obstack_grow_literal_string): Rename as...
17300 (obstack_grow_string): this.
17301 * src/output.c (output_parser): Recognize `%% actions' instead of
17302 `$'.
17303 * src/bison.s1: s/$/%% actions/.
17304 * src/bison.hairy: Likewise.
17305
17306 2000-12-19 Akim Demaille <akim@epita.fr>
17307
17308 * src/output.c (output_parser): Compute the `#line' lines when
17309 there are.
17310 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
17311 Suggested by Hans Aberg.
17312
17313 2000-12-19 Akim Demaille <akim@epita.fr>
17314
17315 Let the handling of the skeleton files be local to the procedures
17316 that use it.
17317
17318 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
17319 longer static.
17320 (fparser, open_extra_files): Remove.
17321 (open_files, output_files): Don't take care of fparser.
17322 * src/files.h: Adjust.
17323 * src/output.c (output_parser): Open and close the file to the
17324 skeleton.
17325 * src/reader.c (read_declarations): When %semantic_parser, open
17326 fguard.
17327
17328 2000-12-19 Akim Demaille <akim@epita.fr>
17329
17330 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
17331 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
17332
17333 2000-12-19 Akim Demaille <akim@epita.fr>
17334
17335 * src/files.c (open_files): Yipee! We no longer need all the code
17336 looking for `/tmp' since we have no tmp file.
17337
17338 2000-12-19 Akim Demaille <akim@epita.fr>
17339
17340 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
17341 New macros.
17342 * src/files.c (open_files): Less dependency on MSDOS etc.
17343
17344 2000-12-14 Akim Demaille <akim@epita.fr>
17345
17346 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
17347 Provide a default definition.
17348 Use it when executing the default @ action.
17349 * src/reader.c (reader_output_yylsp): No longer include
17350 `timestamp' and `text' in the default YYLTYPE.
17351
17352 2000-12-12 Akim Demaille <akim@epita.fr>
17353
17354 * src/reader.c (copy_definition, parse_union_decl, copy_action)
17355 (copy_guard): Quote the file names.
17356 Reported by Laurent Mascherpa.
17357
17358 2000-12-12 Akim Demaille <akim@epita.fr>
17359
17360 * src/output.c (output_headers, output_program, output): Be sure
17361 to escape special characters when outputting filenames.
17362 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
17363 (output_headers): Don't depend on them, Use ACTSTR.
17364
17365 2000-11-17 Akim Demaille <akim@epita.fr>
17366
17367 * lib/obstack.h: Formatting changes.
17368 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
17369 prevents type checking.
17370 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
17371 cast the value to (void *): assigning a `foo *' to a `void *'
17372 variable is valid.
17373 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
17374 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
17375 append characters.
17376
17377 2000-11-17 Akim Demaille <akim@epita.fr>
17378
17379 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
17380 as...
17381 (suite.m4, regression.m4, calc.m4): these.
17382 * tests/atgeneral.m4: Update from CVS Autoconf.
17383
17384 2000-11-17 Akim Demaille <akim@epita.fr>
17385
17386 * tests/regression.m4 (%union and --defines): New test,
17387 demonstrating a current bug in the obstack implementation.
17388
17389 2000-11-17 Akim Demaille <akim@epita.fr>
17390
17391 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
17392 macros.
17393 Use them to declare the variables which are global or local to
17394 `yyparse'.
17395
17396 2000-11-17 Akim Demaille <akim@epita.fr>
17397
17398 * acconfig.h: Remove, no longer used.
17399
17400 2000-11-07 Akim Demaille <akim@epita.fr>
17401
17402 * src: s/Copyright (C)/Copyright/g.
17403
17404 2000-11-07 Akim Demaille <akim@epita.fr>
17405
17406 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
17407 defining.
17408 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
17409
17410 2000-11-07 Akim Demaille <akim@epita.fr>
17411
17412 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
17413 Merge in a single CPP if/else.
17414
17415 2000-11-07 Akim Demaille <akim@epita.fr>
17416
17417 * src/output.c (output): Remove useless variables.
17418 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
17419 argument `data' for consistency with the prototypes.
17420 Qualify it `const'.
17421 (obstack_copy, obstack_copy0): Rename the second argument as
17422 `address' for consistency. Qualify it `const'.
17423 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
17424 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
17425 `const' their input argument (`data' or `address').
17426 Adjust the corresponding macros to include `const' in casts.
17427
17428 2000-11-03 Akim Demaille <akim@epita.fr>
17429
17430 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
17431 s/PFILE1/BISON_HAIRY/.
17432 Adjust dependencies.
17433
17434 2000-11-03 Akim Demaille <akim@epita.fr>
17435
17436 For some reason, this was not applied.
17437
17438 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
17439 `unlink': it's no longer used.
17440
17441 2000-11-03 Akim Demaille <akim@epita.fr>
17442
17443 * src/files.c (skeleton_find): New function, eved out of...
17444 (open_files, open_extra_files): here.
17445
17446 2000-11-03 Akim Demaille <akim@epita.fr>
17447
17448 Don't use `atexit'.
17449
17450 * src/files.c (obstack_save): New function.
17451 (done): Rename as...
17452 (output_files): this.
17453 Use `obstack_save'.
17454 * src/main.c (main): Don't use `atexit' to register `done', since
17455 it no longer has to remove tmp files, just call `output_files'
17456 when there are no errors.
17457
17458 2000-11-02 Akim Demaille <akim@epita.fr>
17459
17460 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
17461 `unlink': it's no longer used.
17462 * src/files.h: Formatting changes.
17463
17464 2000-11-02 Akim Demaille <akim@epita.fr>
17465
17466 Remove the last uses of mktemp and unlink/delete.
17467
17468 * src/files.c (fdefines, ftable): Removed.
17469 (defines_ostack, table_obstack): New.
17470 Adjust dependencies of the former into uses of the latter.
17471 * src/output.c (output_short_or_char_table, output_short_table):
17472 Convert to using obstacks.
17473 * src/reader.c (copy_comment2): Accept one FILE * and two
17474 obstacks.
17475 (output_token_defines, reader_output_yylsp): Use obstacks.
17476 * src/system.h (obstack_fgrow3): New.
17477 * po/POTFILES.in: Adjust.
17478
17479 2000-11-01 Akim Demaille <akim@epita.fr>
17480
17481 Change each use of `fattrs' into a use of `attrs_obstack'.
17482
17483 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
17484 * src/files.c (fattrs): Remove.
17485 (attrs_obstack): New.
17486 Adjust all dependencies.
17487 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
17488
17489 2000-11-01 Akim Demaille <akim@epita.fr>
17490
17491 Introduce obstacks.
17492 Change each use of `faction' into a use of `action_obstack'.
17493
17494 * lib/obstack.h, lib/obstack.c: New files.
17495 * src/files.c (faction): Remove.
17496 (action_obstack): New.
17497 Adjust all dependencies.
17498
17499 2000-10-20 Akim Demaille <akim@epita.fr>
17500
17501 * lib/quote.h (PARAMS): New macro. Use it.
17502
17503 2000-10-16 Akim Demaille <akim@epita.fr>
17504
17505 * src/output.c (output_short_or_char_table): New function.
17506 (output_short_table, output_token_translations): Use it.
17507 (goto_actions): Use output_short_table.
17508
17509 2000-10-16 Akim Demaille <akim@epita.fr>
17510
17511 * src/symtab.c (bucket_new): New function.
17512 (getsym): Use it.
17513
17514 * src/output.c (output_short_table): New argument to display the
17515 comment associated with the table.
17516 Adjust dependencies.
17517 (output_gram): Use it.
17518 (output_rule_data): Nicer output layout for YYTNAME.
17519
17520 2000-10-16 Akim Demaille <akim@epita.fr>
17521
17522 * src/lex.c (read_typename): New function.
17523 (lex): Use it.
17524 * src/reader.c (copy_dollar): Likewise.
17525
17526 2000-10-16 Akim Demaille <akim@epita.fr>
17527
17528 * src/reader.c (copy_comment2): Expect the input stream to be on
17529 the `/' which is suspected to open a comment, instead of being
17530 called after `//' or `/*' was read.
17531 (copy_comment, copy_definition, parse_union_decl, copy_action)
17532 (copy_guard): Adjust.
17533
17534 2000-10-16 Akim Demaille <akim@epita.fr>
17535
17536 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
17537 `read_signed_integer'.
17538
17539 2000-10-16 Akim Demaille <akim@epita.fr>
17540
17541 * src/reader.c (copy_dollar): New function.
17542 (copy_guard, copy_action): Use it.
17543
17544 2000-10-16 Akim Demaille <akim@epita.fr>
17545
17546 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
17547 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
17548 New files, from Fileutils 4.0.27.
17549 * src/main.c (printable_version): Remove.
17550 * src/lex.c, src/reader.c: Use `quote'.
17551
17552 2000-10-04 Akim Demaille <akim@epita.fr>
17553
17554 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
17555
17556 2000-10-04 Akim Demaille <akim@epita.fr>
17557
17558 * doc/bison.texinfo: Various typos spotted by Neil Booth.
17559
17560 2000-10-04 Akim Demaille <akim@epita.fr>
17561
17562 When a literal string is used to define two different tokens,
17563 `bison -v' segfaults.
17564 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
17565
17566 * tests/regression.m4: New file.
17567 Include the core of the sample provided by Piotr Gackiewicz.
17568 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
17569 properly.
17570
17571 2000-10-04 Akim Demaille <akim@epita.fr>
17572
17573 * src/reader.c (parse_expect_decl): Keep `count' within the size
17574 of `buffer'.
17575 From Neil Booth.
17576
17577 2000-10-02 Paul Eggert <eggert@twinsun.com>
17578
17579 * bison.s1 (yyparse): Assign the default value
17580 unconditionally, to avoid a GCC warning and make the parser a
17581 tad smaller.
17582
17583 2000-10-02 Akim Demaille <akim@epita.fr>
17584
17585 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
17586 options.
17587
17588 2000-10-02 Akim Demaille <akim@epita.fr>
17589
17590 * src/derives.c, src/print.c, src/reduce.c: To ease the
17591 translation, move some `\n' out of the translated strings.
17592
17593 2000-10-02 Akim Demaille <akim@epita.fr>
17594
17595 The location tracking mechanism is precious for parse error
17596 messages. Nevertheless, it is enabled only when `@n' is used in
17597 the grammar, which is a different issue (you can use it in error
17598 message, but not in the grammar per se). Therefore, there should
17599 be another means to enable it.
17600
17601 * src/getargs.c (getargs): Support `--locations'.
17602 (usage): Report it.
17603 * src/getargs.h (locationsflag): Export it.
17604 * src/lex.c (percent_table): Support `%locations'.
17605 * src/reader.c (yylsp_needed): Remove this variable, now replaced
17606 with `locationsflag'.
17607 * doc/bison.texinfo: Document `--locations' and `%locations'.
17608 Sort the options.
17609 * tests/calc.m4: Test it.
17610
17611 For regularity of the names, replace each
17612 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
17613 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
17614 In addition replace each `flag' with `_flag'.
17615
17616 2000-10-02 Akim Demaille <akim@epita.fr>
17617
17618 Also test parse error messages, including with YYERROR_VERBOSE.
17619
17620 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
17621 associative).
17622 Use it to check the computations.
17623 Use it to check `nonassoc' is honored.
17624 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
17625 `--yyerror-verbose'.
17626 (_AT_CHECK_CALC): Adjust to this option.
17627 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
17628
17629 2000-10-02 Akim Demaille <akim@epita.fr>
17630
17631 Test also `--verbose', `--defines' and `--name-prefix'. Testing
17632 the latter demonstrates a flaw in the handling of non debugging
17633 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
17634 was used in order to simplify:
17635
17636 #if YYDEBUG
17637 if (yydebug)
17638 {
17639 ...
17640 }
17641 #endif
17642
17643 into
17644
17645 if (yydebug)
17646 {
17647 ...
17648 }
17649
17650 unfortunately this leads to a CPP conflict when
17651 `--name-prefix=foo' is used since it produces `#define yydebug
17652 foodebug'.
17653
17654 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
17655 (YYDPRINTF): New macro.
17656 Spread its use.
17657 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
17658 the bison options.
17659 Also test `--verbose', `--defines' and `--name-prefix'.
17660
17661 2000-10-02 Akim Demaille <akim@epita.fr>
17662
17663 Improve the readability of the produced parsers.
17664
17665 * src/bison.s1: Formatting changes.
17666 Improve the comment related to the `$' mark.
17667 (yydefault): Don't fall through to `yyresume': `goto' there.
17668 * src/output.c (output_parser): When the `$' is met, skip the end
17669 of its line.
17670 New variable, `number_of_dollar_signs', to check there's exactly
17671 one `$' in the parser skeleton.
17672
17673 2000-10-02 Akim Demaille <akim@epita.fr>
17674
17675 * lib/xstrdup.c: New file, from the fileutils.
17676 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
17677 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
17678 instead of strlen + xmalloc + strcpy.
17679 * src/symtab.c (copys): Remove, use xstrdup instead.
17680
17681 2000-10-02 Akim Demaille <akim@epita.fr>
17682
17683 * src/gram.h (associativity): New enum type which replaces the
17684 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
17685 `right_assoc', `left_assoc' and `non_assoc'.
17686 Adjust all dependencies.
17687 * src/reader.c: Formatting changes.
17688 (LTYPESTR): Don't define it, use it as a literal in
17689 `reader_output_yylsp'.
17690 * src/symtab.h (symbol_class): New enum type which replaces the
17691 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
17692 `sunknown', `stoken and `snterm'.
17693
17694 2000-10-02 Akim Demaille <akim@epita.fr>
17695
17696 * src/getargs.c (fixed_outfiles): Rename as...
17697 (yaccflag): for consistency and accuracy.
17698 Adjust dependencies.
17699
17700 2000-10-02 Akim Demaille <akim@epita.fr>
17701
17702 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
17703 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
17704 difficult and introduced a lot of core dump. It turns out that
17705 Bison used an implementation of `xmalloc' based on `calloc', and
17706 at various places it does depend upon the initialization to 0. I
17707 have not tried to isolate the pertinent places, and all the former
17708 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
17709 someone should address this issue.
17710
17711 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
17712 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
17713 files.
17714 Adjust dependencies.
17715 * src/warshall.h: New file.
17716 Propagate.
17717
17718 2000-10-02 Akim Demaille <akim@epita.fr>
17719
17720 Various anti-`extern in *.c' changes.
17721
17722 * src/system.h: Include `assert.h'.
17723
17724 2000-10-02 Akim Demaille <akim@epita.fr>
17725
17726 * src/state.h (nstates, final_state, first_state, first_shift)
17727 (first_reduction): Move their exportation from here...
17728 * src/LR0.h: to here.
17729 Adjust dependencies.
17730 * src/getargs.c (statisticsflag): New variable.
17731 Add support for `--statistics'.
17732 Adjust dependencies.
17733
17734 Remove a lot of now useless `extern' statements in most files.
17735
17736 2000-10-02 Akim Demaille <akim@epita.fr>
17737
17738 * src/LR0.h: New file.
17739 Propagate its use.
17740
17741 2000-10-02 Akim Demaille <akim@epita.fr>
17742
17743 * src/print.h: New file.
17744 Propagate its use.
17745 * src/print.c: Formatting and ordering changes.
17746 (verbose, terse): Replace with...
17747 (print_results): this new function.
17748 Adjust dependencies.
17749
17750 2000-10-02 Akim Demaille <akim@epita.fr>
17751
17752 * src/conflicts.c (conflict_report): New function.
17753 (conflict_log, verbose_conflict_log): Replace with...
17754 (print_conflicts): this function.
17755 Adjust dependencies.
17756 * src/conflicts.h: New file.
17757 Propagate its inclusion.
17758
17759 2000-10-02 Akim Demaille <akim@epita.fr>
17760
17761 * src/nullable.h: New file.
17762 Propagate its inclusion.
17763 * src/nullable.c: Formatting changes.
17764
17765 2000-10-02 Akim Demaille <akim@epita.fr>
17766
17767 * src/reduce.h: New file.
17768 Propagate its inclusion.
17769 * src/reduce.c: Topological sort and other formatting changes.
17770 (bool, TRUE, FALSE): Move their definition to...
17771 * src/system.h: here.
17772
17773 2000-10-02 Akim Demaille <akim@epita.fr>
17774
17775 * src/files.c: Formatting changes.
17776 (tryopen, tryclose, openfiles): Rename as...
17777 (xfopen, xfclose, open_files): this.
17778 (stringappend): static.
17779 * src/files.h: Complete the list of exported symbols.
17780 Propagate its use.
17781
17782 2000-10-02 Akim Demaille <akim@epita.fr>
17783
17784 * src/reader.h: New file.
17785 Propagate its use instead of tedious list of `extern' and
17786 prototypes.
17787 * src/reader.c: Formatting changes, topological sort,
17788 s/register//.
17789
17790 2000-10-02 Akim Demaille <akim@epita.fr>
17791
17792 * src/lex.h: Prototype `lex.c' exported functions.
17793 * src/reader.c: Adjust.
17794 * src/lex.c: Formatting changes.
17795 (safegetc): Rename as...
17796 (xgetc): this.
17797
17798 2000-10-02 Akim Demaille <akim@epita.fr>
17799
17800 * src/lalr.h: New file.
17801 Propagate its inclusion instead of prototypes and `extern'.
17802 * src/lalr.c: Formatting changes, topological sorting etc.
17803
17804 2000-10-02 Akim Demaille <akim@epita.fr>
17805
17806 * src/output.c (token_actions): Introduce a temporary array,
17807 YYDEFACT, that makes it possible for this function to use
17808 output_short_table.
17809
17810 2000-10-02 Akim Demaille <akim@epita.fr>
17811
17812 `user_toknums' is output as a `short[]' in `output.c', while it is
17813 defined as a `int[]' in `reader.c'. For consistency with the
17814 other output tables, `user_toknums' is now defined as a table of
17815 shorts.
17816
17817 * src/reader.c (user_toknums): Be a short table instead of an int
17818 table.
17819 Adjust dependencies.
17820
17821 Factor the short table outputs.
17822
17823 * src/output.c (output_short_table): New function.
17824 * src/output.c (output_gram, output_stos, output_rule_data)
17825 (output_base, output_table, output_check): Use it.
17826
17827 2000-10-02 Akim Demaille <akim@epita.fr>
17828
17829 * src/output.c (output): Topological sort of the functions, in
17830 order to get rid of the `static' prototypes.
17831 No longer use `register'.
17832 * src/output.h: New file.
17833 Propagate its inclusion in files explicitly prototyping functions
17834 from output.c.
17835
17836 2000-09-21 Akim Demaille <akim@epita.fr>
17837
17838 * src/atgeneral.m4: Update from Autoconf.
17839
17840 2000-09-21 Akim Demaille <akim@epita.fr>
17841
17842 * src/closure.h: New file.
17843 * src/closure.c: Formatting changes, topological sort over the
17844 functions, use of closure.h.
17845 (initialize_closure, finalize_closure): Rename as...
17846 (new_closure, free_closure): these. Adjust dependencies.
17847 * src/LR0.c: Formatting changes, topological sort, use of
17848 cloture.h.
17849 (initialize_states): Rename as...
17850 (new_states): this.
17851 * src/Makefile.am (noinst_HEADERS): Adjust.
17852
17853 2000-09-20 Akim Demaille <akim@epita.fr>
17854
17855 * src/acconfig.h: Don't protect config.h against multiple
17856 inclusion.
17857 Don't define PARAMS.
17858 * src/system.h: Define PARAMS.
17859 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
17860 purpose of config.h. system.h must not try to fix wrong
17861 definitions in config.h.
17862
17863 2000-09-20 Akim Demaille <akim@epita.fr>
17864
17865 * src/derives.h: New file.
17866 * src/main.c, src/derives.h: Use it.
17867 Formatting changes.
17868 * src/Makefile.am (noinst_HEADERS): Adjust.
17869
17870 2000-09-20 Akim Demaille <akim@epita.fr>
17871
17872 * tests/atgeneral.m4: Update from Autoconf.
17873 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
17874 (AT_CHECK_CALC): New macros.
17875 Use these macros to test bison with options `', `--raw',
17876 `--debug', `--yacc', `--yacc --debug'.
17877
17878 2000-09-19 Akim Demaille <akim@epita.fr>
17879
17880 * src/output.c: Formatting changes.
17881 * src/machine.h: Remove, leaving its contents in...
17882 * src/system.h: here.
17883 Include stdio.h.
17884 Adjust all dependencies on stdio.h and machine.h.
17885 * src/getargs.h: New file.
17886 Let all `extern' declarations about getargs.c be replaced with
17887 inclusion of `getargs.h'.
17888 * src/Makefile.am (noinst_HEADERS): Adjust.
17889
17890 * tests/calc.m4 (yyin): Be initialized in main, not on the global
17891 scope.
17892 (yyerror): Returns void, not int.
17893 * doc/bison.texinfo: Formatting changes.
17894
17895 2000-09-19 Akim Demaille <akim@epita.fr>
17896
17897 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
17898 portable.
17899
17900 2000-09-18 Akim Demaille <akim@epita.fr>
17901
17902 * configure.in: Append WARNING_CFLAGS to CFLAGS.
17903 * src/Makefile.am (INCLUDES): Don't.
17904 Be ready to fetch headers in lib/.
17905
17906 2000-09-18 Akim Demaille <akim@epita.fr>
17907
17908 * doc/bison.texinfo: Update the copyright.
17909 ANSIfy and GNUify the examples.
17910 Remove the old menu.
17911
17912 2000-09-18 Akim Demaille <akim@epita.fr>
17913
17914 First set of tests: use the `calc' example from the documentation.
17915
17916 * src/bison.s1 (yyparse): Condition the code using `yytname' which
17917 is defined only when YYDEBUG is.
17918 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
17919 * src/files.c (tryopen, tryclose): Formatting changes.
17920 Move to the top and be static.
17921 * src/reader.c (read_signed_integer): Likewise.
17922 * tests/calc.m4: New file.
17923 * Makefile.am, suite.m4: Adjust.
17924 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
17925
17926 2000-09-18 Akim Demaille <akim@epita.fr>
17927
17928 Add support for an Autotest test suite for Bison.
17929
17930 * m4/m4.m4, m4/atconfig.m4: New files.
17931 * m4/Makefile.am (EXTRA_DIST): Adjust.
17932 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
17933 files.
17934 * src/getargs.c: Display a more standard --version message.
17935 * src/reader.c (reader): Formatting changes.
17936 No longer depend upon VERSION_STRING.
17937 * configure.in: No longer use `dnl'.
17938 Set up the test suite and the new directory `tests/.
17939 (VERSION_STRING): Remove.
17940
17941 2000-04-14 Akim Demaille <akim@epita.fr>
17942
17943 * src/reader.c (copy_comment2): New function, same as former
17944 `copy_comment', but outputs into two FILE *.
17945 (copy_comment): Use it.
17946 (parse_union_decl): Use it.
17947 (get_type, parse_start_decl): Use the same `invalid' message.
17948 (parse_start_decl, parse_union_decl): Use the same `multiple'
17949 message.
17950 (parse_union_decl, copy_guard, copy_action): Use the same
17951 `unmatched' message.
17952 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
17953
17954 2000-03-31 Akim Demaille <akim@epita.fr>
17955
17956 * src/files.c (tryopen, tryclose): Move to the top.
17957 Be static.
17958
17959 2000-03-31 Akim Demaille <akim@epita.fr>
17960
17961 * src/main.c (main): Don't call `done', exit does it.
17962
17963 2000-03-31 Akim Demaille <akim@epita.fr>
17964
17965 * allocate.c: s/return (foo)/return foo/.
17966 * lalr.c: Likewise.
17967 * LR0.c: Likewise.
17968 * output.c: Likewise.
17969 * reader.c: Likewise.
17970 * symtab.c: Likewise.
17971 * vmsgetargs.c: Likewise.
17972
17973 2000-03-31 Akim Demaille <akim@epita.fr>
17974
17975 Clean up the error reporting functions.
17976
17977 * src/report.c: New file.
17978 * src/report.h: Likewise.
17979 * src/Makefile.am: Adjust.
17980 * m4/error.m4: New file.
17981 * m4/Makefile.am: Adjust.
17982 * configure.in (jm_PREREQ_ERROR): Call it.
17983 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
17984 Remove.
17985 (fatal, fatals): Remove. All callers use complain.c::fatal.
17986 (warn, warni, warns, warnss, warnss): Remove. All callers use
17987 complain.c::complain.
17988 (toomany): Remove, use fatal instead.
17989 * src/files.c (done): No argument, use complain_message_count.
17990 * src/main.c (main): Register `done' to `atexit'.
17991
17992 * src/getargs.c (usage): More `fputs', less `fprintf'.
17993
17994 2000-03-28 Akim Demaille <akim@epita.fr>
17995
17996 * lib/: New directory.
17997 * Makefile.am (SUBDIRS): Adjust.
17998 * configure.in: Adjust.
17999 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
18000 useless.
18001 * src/alloca.c: Moved to lib/.
18002 * src/getopt.c: Likewise.
18003 * src/getopt1.c: Likewise.
18004 * src/getopt.h: Likewise.
18005 * src/ansi2knr.c: Likewise.
18006 * src/ansi2knr.1: Likewise.
18007 * src/Makefile.am: Adjust.
18008 * lib/Makefile.am: New file.
18009
18010 2000-03-28 Akim Demaille <akim@epita.fr>
18011
18012 * src/getargs.c (usage): Refresh the help message.
18013
18014 2000-03-17 Akim Demaille <akim@epita.fr>
18015
18016 * src/getopt1.c: Updated from textutils 2.0e
18017 * src/getopt.c: Likewise.
18018 * src/getopt.h: Likewise.
18019
18020 2000-03-17 Akim Demaille <akim@epita.fr>
18021
18022 * src/Makefile.am (bison.simple): Fix the awk program: quote only
18023 the file name, not the whole `#line LINE FILE'.
18024
18025 2000-03-17 Akim Demaille <akim@epita.fr>
18026
18027 On syntax errors, report the token on which we choked.
18028
18029 * src/bison.s1 (yyparse): In the label yyerrlab, when
18030 YYERROR_VERBOSE, add yychar in msg.
18031
18032 2000-03-17 Akim Demaille <akim@epita.fr>
18033
18034 * src/reader.c (copy_at): New function.
18035 (copy_guard): Use it.
18036 (copy_action): Use it.
18037
18038 2000-03-17 Akim Demaille <akim@epita.fr>
18039
18040 Be kind to translators, save some useless translations.
18041
18042 * src/main.c (banner): New function.
18043 (fatal_banner): Use it.
18044 (warn_banner): Use it.
18045
18046 2000-03-17 Akim Demaille <akim@epita.fr>
18047
18048 * src/reader.c (copy_definition): Use copy_string and
18049 copy_comment. Removed now unused `match', `ended',
18050 `cplus_comment'.
18051 (copy_comment, copy_string): Moved, to be visible from
18052 copy_definition.
18053
18054 2000-03-17 Akim Demaille <akim@epita.fr>
18055
18056 * src/reader.c (copy_string): Declare `static inline'. No
18057 problems with inline, since it is checked by configure.
18058 (copy_comment): Likewise.
18059
18060 2000-03-17 Akim Demaille <akim@epita.fr>
18061
18062 * src/reader.c (packsymbols): Formatting changes.
18063
18064 2000-03-17 Akim Demaille <akim@epita.fr>
18065
18066 * src/reader.c (copy_comment): New function, factored out from:
18067 (copy_action): Use it. Removed now unused `match', `ended',
18068 `cplus_comment'.
18069 (copy_guard): Likewise.
18070
18071 2000-03-17 Akim Demaille <akim@epita.fr>
18072
18073 * src/reader.c (copy_string): New function, factored out from:
18074 (copy_action): Use it.
18075 (copy_guard): Likewise.
18076
18077 2000-03-17 Akim Demaille <akim@epita.fr>
18078
18079 Change the handling of @s so that they behave exactly like $s.
18080 There is now a pseudo variable @$ (readble and writable), location
18081 of the lhs of the rule (by default ranging from the location of
18082 the first symbol of the rhs, to the location of the last symbol,
18083 or, if the rhs is empty, YYLLOC).
18084
18085 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
18086 yyval.
18087 (yyparse): When providing a default semantic action, provide a
18088 default location action.
18089 (after the $): No longer change `*YYLSP', just stack YYLOC the
18090 same way you stack YYVAL.
18091 * src/reader.c (read_declarations): Use warns.
18092 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
18093 (copy_action, case '@'): Likewise.
18094 Use a standard error message, to save useless work from
18095 translators.
18096
18097 2000-03-17 Akim Demaille <akim@epita.fr>
18098
18099 * src/bison.s1: Formatting and cosmetics changes.
18100 * src/reader.c: Likewise.
18101 Update the Copyright notice.
18102
18103 2000-03-17 Akim Demaille <akim@epita.fr>
18104
18105 * src/bison.s1 (#line): All set to `#line' only, since the
18106 Makefile now handles them.
18107
18108 2000-03-16 Akim Demaille <akim@epita.fr>
18109
18110 * src/output.c (output_rule_data): Output the documentation of
18111 some of the tables.
18112 (Copyright notice): Update.
18113 Formatting changes.
18114
18115 2000-03-16 Akim Demaille <akim@epita.fr>
18116
18117 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
18118 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
18119 One `#if YYDEBUG' remains, since it uses variables which are
18120 defined only if `YYDEBUG != 0'.
18121
18122 2000-03-16 Akim Demaille <akim@epita.fr>
18123
18124 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
18125 and related variables so that the similarities are highlighted.
18126
18127 2000-03-16 Akim Demaille <akim@epita.fr>
18128
18129 * src/bison.s1: Properly indent CPP directives.
18130
18131 2000-03-16 Akim Demaille <akim@epita.fr>
18132
18133 * src/bison.s1: Properly indent the `alloca' CPP section.
18134
18135 2000-03-16 Akim Demaille <akim@epita.fr>
18136
18137 Do not hard code values of directories in `configure.in'.
18138 Update the `configure' tool chain.
18139
18140 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
18141 src/makefile.am.
18142 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
18143 (AC_OUTPUT): Add m4/Makefile.
18144 Bump to bison 1.28a, 1.29 has never been released.
18145 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
18146 handled via src/Makefile.am.
18147 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
18148 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
18149 autoheader.
18150 * Makefile.am (SUBDIRS): Add m4.
18151 (ACLOCAL_AM_FLAGS): New variable.
18152 (AUTOMAKE_OPTIONS): Add check-news.
18153 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
18154 the proper line number and file name.
18155 (DEFS): Propagate the location of bison library files and of the
18156 locale files.
18157 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
18158 builddir.
18159 * acinclude.m4: Remove, replaced by the directory m4.
18160 * m4/Makefile.am (EXTRA_DIST): New variable.
18161 * m4/gettext.m4: New file, from the fileutils.
18162 * m4/lcmessage.m4: Likewise
18163 * m4/progtest.m4: Likewise.
18164 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
18165
18166 2000-03-10 Akim Demaille <akim@epita.fr>
18167
18168 * src/closure.c:
18169 Formatting changes of various comments.
18170 Respect the GNU coding standards at various places.
18171 Don't use `_()' when no translation is needed.
18172
18173 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18174
18175 * src/files.c:
18176 OS/2 honors TMPDIR environment variable.
18177
18178 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18179
18180 * doc/bison.texinfo: Tweaked spelling and grammar.
18181 Updated ISBN.
18182 Removed reference to price of printed copy.
18183 Mention BISON_SIMPLE and BISON_HAIRY.
18184
18185 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18186
18187 * configure.in, NEWS:
18188 Bison 1.29 released.
18189
18190 1999-10-27 Jesse Thilo <jthilo@gnu.org>
18191
18192 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
18193 Added reference card.
18194
18195 1999-07-26 Jesse Thilo <jthilo@gnu.org>
18196
18197 * po/ru.po: Added Russian translation.
18198
18199 1999-07-26 Jesse Thilo <jthilo@gnu.org>
18200
18201 * configure.in: Added Russian translation.
18202
18203 1999-07-06 Jesse Thilo <jthilo@gnu.org>
18204
18205 * configure.in, NEWS, README:
18206 Released version 1.28.
18207
18208 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18209
18210 * src/system.h:
18211 Squashed redefinition warning on some systems.
18212
18213 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
18214 Have configure build version string instead of relying on ANSI string
18215 concatentation.
18216
18217 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18218
18219 * po/POTFILES.in: Got rid of version.c.
18220
18221 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18222
18223 * acconfig.h, configure.in:
18224 Have configure build version string instead of relying on ANSI string
18225 concatentation.
18226
18227 1999-06-08 Jesse Thilo <jthilo@gnu.org>
18228
18229 * doc/bison.1:
18230 Dropped mention of `+' for long-named options.
18231
18232 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18233
18234 * src/files.c: Added <unistd.h> for unlink().
18235
18236 * src/Makefile.am, src/system.h:
18237 I18n fixes.
18238
18239 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18240
18241 * README: Added a FAQ list.
18242
18243 * configure.in, acconfig.h:
18244 I18n fixes.
18245
18246 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18247
18248 * doc/FAQ, doc/Makefile.am:
18249 Added a FAQ list.
18250
18251 1999-05-19 Jesse Thilo <jthilo@gnu.org>
18252
18253 * src/alloc.h, src/symtab.h, src/version.c:
18254 Protected inclusion of "config.h" with HAVE_CONFIG_H.
18255
18256 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18257
18258 * src/.cvsignore, src/Makefile.am:
18259 Reorganized: sources in `src', documentation in `doc'.
18260
18261 * src/lex.c (literalchar):
18262 fixed the code for escaping double quotes (thanks
18263 Jonathan Czisny.)
18264
18265 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18266
18267 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
18268 Adjusted paths to reflect directory reorganization.
18269
18270 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18271
18272 * doc/.cvsignore, doc/Makefile.am:
18273 Reorganized: sources in `src', documentation in `doc'.
18274
18275 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18276
18277 * configure.in:
18278 Updated AC_INIT file to reflect directory reorganization.
18279
18280 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
18281 Reorganized: sources in `src', documentation in `doc'.
18282
18283 1999-04-13 Jesse Thilo <jthilo@gnu.org>
18284
18285 * src/allocate.c:
18286 Don't declare calloc() and realloc() if not necessary.
18287
18288 1999-04-13 Jesse Thilo <jthilo@gnu.org>
18289
18290 * configure.in, acconfig.h, acinclude.m4:
18291 Don't declare calloc() and realloc() if not necessary.
18292
18293 1999-03-23 Jesse Thilo <jthilo@gnu.org>
18294
18295 * po/.cvsignore: Added i18n support.
18296
18297 1999-03-23 Jesse Thilo <jthilo@gnu.org>
18298
18299 * acconfig.h, configure.in, Makefile.am:
18300 Added i18n support.
18301
18302 1999-03-22 Jesse Thilo <jthilo@gnu.org>
18303
18304 * src/bison.s1: Fixed #line numbers.
18305
18306 1999-03-15 Jesse Thilo <jthilo@gnu.org>
18307
18308 * po/es.po, po/fr.po, po/nl.po, po/de.po:
18309 Added PO files from Translation Project.
18310
18311 1999-03-03 Jesse Thilo <jthilo@gnu.org>
18312
18313 * Makefile.am:
18314 Added support for non-ANSI compilers (ansi2knr).
18315
18316 1999-02-16 Jesse Thilo <jthilo@gnu.org>
18317
18318 * configure.in: Bumped version number to 1.27.
18319
18320 * Makefile.am:
18321 Added `bison.simple' to list of files removed by `make distclean'.
18322
18323 1999-02-12 Jesse Thilo <jthilo@gnu.org>
18324
18325 * src/files.c, src/files.h:
18326 Defined locations of parser files in config.h instead of Makefile.
18327
18328 1999-02-12 Jesse Thilo <jthilo@gnu.org>
18329
18330 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
18331 Defined locations of parser files in config.h instead of Makefile.
18332
18333 1999-02-09 Jesse Thilo <jthilo@gnu.org>
18334
18335 * Makefile.am:
18336 Removed inappropriate use of $< macro.
18337
18338 1999-02-05 Jesse Thilo <jthilo@gnu.org>
18339
18340 * po/Makefile.in.in, po/POTFILES.in:
18341 Add `po' directory skeleton.
18342
18343 1999-01-27 Jesse Thilo <jthilo@gnu.org>
18344
18345 * README: Document help-bison list.
18346
18347 * configure.in: Add check for mkstemp().
18348
18349 1999-01-20 Jesse Thilo <jthilo@gnu.org>
18350
18351 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
18352 Hush a few compiler warnings.
18353
18354 * src/files.c:
18355 Add tryclose(), which verifies that fclose was successful.
18356 Hush a couple of compiler warnings.
18357
18358 1999-01-20 Jesse Thilo <jthilo@gnu.org>
18359
18360 * Makefile.am, OChangeLog:
18361 ChangeLog is now automatically generated. Include the old version as
18362 OChangeLog.
18363
18364 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18365
18366 * 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:
18367 Update FSF address.
18368
18369 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18370
18371 * doc/bison.texinfo: Fix formatting glitch.
18372
18373 * doc/bison.texinfo: Update FSF address.
18374
18375 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18376
18377 * acconfig.h: Update FSF address.
18378
18379 1999-01-08 Jesse Thilo <jthilo@gnu.org>
18380
18381 * src/system.h:
18382 Don't define PACKAGE here, since config.h defines it.
18383
18384 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18385
18386 * src/reader.c: Update copyright date.
18387
18388 * src/main.c:
18389 Ditch sprintf to statically-sized buffers in fatal/warn functions in
18390 favor of output directly to stderr (avoids buffer overruns).
18391
18392 * src/reader.c: Some checks for premature EOF.
18393
18394 * 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:
18395 Use prototypes if the compiler understands them.
18396
18397 * src/files.c: Honor TMPDIR on Unix hosts.
18398 Use prototypes if the compiler understands them.
18399
18400 * src/reader.c:
18401 Fix a couple of buffer overrun bugs.
18402 Use prototypes if the compiler understands them.
18403
18404 * src/system.h: Include unistd.h and ctype.h.
18405 Use #ifdef instead of #if for NLS symbols.
18406
18407 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18408
18409 * doc/bison.texinfo:
18410 Delete comment "consider using @set for edition number, etc..." since
18411 we now are doing so.
18412
18413 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18414
18415 * configure.in:
18416 Use prototypes if the compiler understands them.
18417
18418 * NEWS: Document 1.26 highlights.
18419
18420 * Makefile.am: Require Automake 1.3 or later.
18421
18422 * acconfig.h:
18423 Use prototypes if the compiler understands them.
18424
18425 1998-12-29 Jesse Thilo <jthilo@gnu.org>
18426
18427 * src/version.c:
18428 Use VERSION symbol from automake for version number.
18429
18430 1998-12-29 Jesse Thilo <jthilo@gnu.org>
18431
18432 * acconfig.h, configure.in, version.cin:
18433 Use VERSION symbol from automake for version number.
18434
18435 1998-11-28 Jesse Thilo <jthilo@gnu.org>
18436
18437 * Makefile.am:
18438 Distribute original version of simple parser (bison.s1), not built
18439 version (bison.simple).
18440
18441 1998-11-28 Jesse Thilo <jthilo@gnu.org>
18442
18443 * doc/bison.texinfo: Add info dir entry.
18444
18445 * doc/bison.texinfo:
18446 Let automake put version number into documentation.
18447
18448 1998-11-26 Jesse Thilo <jthilo@gnu.org>
18449
18450 * src/bison.cld, src/build.com, src/vmshlp.mar:
18451 Add non-RCS files from /gd/gnu/bison.
18452
18453 1998-11-26 Jesse Thilo <jthilo@gnu.org>
18454
18455 * doc/bison.1:
18456 Document the BISON_HAIRY and BISON_SIMPLE variables.
18457
18458 1998-11-25 Jesse Thilo <jthilo@gnu.org>
18459
18460 * src/version.c: Build version.c automatically.
18461
18462 * src/reader.c:
18463 Fix token numbering (used to start at 258, not 257).
18464
18465 * src/system.h: Include config.h.
18466
18467 * src/getargs.c: Update bug report address.
18468
18469 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
18470 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
18471
18472 1998-11-25 Jesse Thilo <jthilo@gnu.org>
18473
18474 * Makefile.am:
18475 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
18476
18477 * configure.in, version.cin:
18478 Build version.c automatically.
18479
18480 * AUTHORS: Add AUTHORS file.
18481
18482 * README: Update bug report address.
18483
18484 * bison.simple:
18485 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
18486
18487 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
18488 Add automake stuff.
18489
18490 1998-11-25 Jesse Thilo <jthilo@gnu.org>
18491
18492 * doc/bison.texinfo: Clean up some formatting.
18493
18494 1998-05-05 Richard Stallman <rms@gnu.org>
18495
18496 * doc/bison.texinfo:
18497 Explain better why to make a pure parser.
18498
18499 1998-01-05 Richard Stallman <rms@gnu.org>
18500
18501 * src/files.c (openfiles):
18502 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
18503 find a temporary directory, if possible. Do not unlink files while
18504 they are open.
18505
18506 1997-08-25 Richard Stallman <rms@gnu.org>
18507
18508 * src/reader.c (stack_offset;):
18509 Change some warni to warns.
18510
18511 * src/lex.c (literalchar): Use warns, not warni.
18512
18513 1997-06-28 Richard Stallman <rms@gnu.org>
18514
18515 * src/bison.s1: Add a Bison version comment.
18516
18517 * src/main.c (fatal, warn, berror):
18518 Use program_name.
18519
18520 1997-06-28 Richard Stallman <rms@gnu.org>
18521
18522 * Makefile.in (bison_version): New variable.
18523 (dist): Use that variable.
18524 (bison.s1): Substitute the Bison version into bison.simple.
18525
18526 * bison.simple: Add a Bison version comment.
18527
18528 1997-06-18 Richard Stallman <rms@gnu.org>
18529
18530 * src/main.c (fatal, warn, berror):
18531 Make error messages standard.
18532 (toomany): Improve error message text.
18533
18534 * 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:
18535 new.h renamed to alloc.h.
18536
18537 1997-06-18 Richard Stallman <rms@gnu.org>
18538
18539 * Makefile.in: new.h renamed to alloc.h.
18540
18541 1997-05-24 Richard Stallman <rms@gnu.org>
18542
18543 * src/lex.c (literalchar):
18544 Fix the code for escaping \, " and '.
18545
18546 (lex): Avoid trouble when there are many chars
18547 to discard in a char literal with just several chars in it.
18548
18549 1997-05-17 Richard Stallman <rms@gnu.org>
18550
18551 * src/bison.s1:
18552 Use malloc, if using alloca is troublesome.
18553 (YYSTACK_USE_ALLOCA): New flag macro.
18554 Define it for some systems and compilers.
18555 (YYSTACK_ALLOC): New macro.
18556 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18557 If it was malloc'd, free it.
18558
18559 1997-05-17 Richard Stallman <rms@gnu.org>
18560
18561 * bison.simple:
18562 Use malloc, if using alloca is troublesome.
18563 (YYSTACK_USE_ALLOCA): New flag macro.
18564 Define it for some systems and compilers.
18565 (YYSTACK_ALLOC): New macro.
18566 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18567 If it was malloc'd, free it.
18568
18569 1997-04-23 Richard Stallman <rms@gnu.org>
18570
18571 * src/bison.s1:
18572 (alloca) [__hpux]: Always define as __builtin_alloca.
18573
18574 1997-04-23 Richard Stallman <rms@gnu.org>
18575
18576 * bison.simple:
18577 (alloca) [__hpux]: Always define as __builtin_alloca.
18578
18579 1997-04-22 Richard Stallman <rms@gnu.org>
18580
18581 * src/bison.s1:
18582 [__hpux]: Include alloca.h (right for HPUX 10)
18583 instead of declaring alloca (right for HPUX 9).
18584
18585 * src/bison.s1 (__yy_memcpy):
18586 Declare arg `count' as unsigned int.
18587 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18588
18589 1997-04-22 Richard Stallman <rms@gnu.org>
18590
18591 * bison.simple:
18592 [__hpux]: Include alloca.h (right for HPUX 10)
18593 instead of declaring alloca (right for HPUX 9).
18594
18595 * bison.simple (__yy_memcpy):
18596 Declare arg `count' as unsigned int.
18597 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18598
18599 1997-01-03 Richard Stallman <rms@gnu.org>
18600
18601 * src/allocate.c: [__STDC__ or _MSC_VER]:
18602 Declare calloc and realloc to return void *.
18603
18604 1997-01-02 Richard Stallman <rms@gnu.org>
18605
18606 * src/system.h:
18607 [_MSC_VER]: Include stdlib.h and process.h.
18608 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
18609
18610 * src/main.c (main): Return FAILURE as a value.
18611 (printable_version): Declare arg as int, not char.
18612
18613 1997-01-02 Richard Stallman <rms@gnu.org>
18614
18615 * Makefile.in (dist):
18616 Explicitly check for symlinks, and copy them.
18617
18618 1996-12-19 Richard Stallman <rms@gnu.org>
18619
18620 * src/files.c:
18621 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
18622
18623 1996-12-18 Paul Eggert <eggert@gnu.org>
18624
18625 * src/bison.s1 (yyparse):
18626 If __GNUC__ and YYPARSE_PARAM are both defined,
18627 declare yyparse to have a void * argument.
18628
18629 1996-12-18 Paul Eggert <eggert@gnu.org>
18630
18631 * bison.simple (yyparse):
18632 If __GNUC__ and YYPARSE_PARAM are both defined,
18633 declare yyparse to have a void * argument.
18634
18635 1996-12-17 Richard Stallman <rms@gnu.org>
18636
18637 * src/reduce.c (nbits): Add some casts.
18638
18639 1996-08-12 Richard Stallman <rms@gnu.org>
18640
18641 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
18642
18643 1996-08-12 Richard Stallman <rms@gnu.org>
18644
18645 * bison.simple: Test _MSDOS as well as _MSDOS_.
18646
18647 1996-07-31 Richard Stallman <rms@gnu.org>
18648
18649 * src/bison.s1:
18650 [__sun && __i386]: Include alloca.h.
18651
18652 1996-07-31 Richard Stallman <rms@gnu.org>
18653
18654 * bison.simple:
18655 [__sun && __i386]: Include alloca.h.
18656
18657 1996-07-30 Richard Stallman <rms@gnu.org>
18658
18659 * src/bison.s1: Comment change.
18660
18661 * src/bison.s1: Test _MSDOS_, not MSDOS.
18662
18663 1996-07-30 Richard Stallman <rms@gnu.org>
18664
18665 * bison.simple: Comment change.
18666
18667 * bison.simple: Test _MSDOS_, not MSDOS.
18668
18669 1996-06-01 Richard Stallman <rms@gnu.org>
18670
18671 * 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:
18672 Insert `_' macro around many string constants.
18673
18674 * src/main.c:
18675 Insert `_' macro around many string constants.
18676
18677 (main): Call setlocale, bindtextdomain and textdomain.
18678
18679 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
18680 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
18681 [ENABLE_NLS]: Include libintl.h.
18682 [ENABLE_NLS] (gettext): Define.
18683 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
18684 (N_, PACKAGE, LOCALEDIR): New macros.
18685
18686 1996-06-01 Richard Stallman <rms@gnu.org>
18687
18688 * POTFILES.in: New file.
18689
18690 * Makefile.in (allocate.o):
18691 Define target explicitly.
18692
18693 * Makefile.in (CFLAGS): Set to @CFLAGS@.
18694 (LDFLAGS): Set to @LDFLAGS@.
18695 (configure): Run autoconf only if preceding `cd' succeeds.
18696 (bison.s1): Redirect output to temporary file then move the
18697 temporary to the target, rather than redirecting directly to bison.s1.
18698 (clean): Remove config.status and config.log.
18699 (distclean): Don't remove config.status here.
18700
18701 1996-05-12 Richard Stallman <rms@gnu.org>
18702
18703 * src/bison.s1:
18704 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18705
18706 1996-05-12 Richard Stallman <rms@gnu.org>
18707
18708 * bison.simple:
18709 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18710
18711 1996-05-11 Richard Stallman <rms@gnu.org>
18712
18713 * src/bison.s1 (__yy_memcpy):
18714 Really reorder the args, as was supposedly done on Feb 14 1995.
18715 (yyparse): Calls changed accordingly.
18716
18717 1996-05-11 Richard Stallman <rms@gnu.org>
18718
18719 * Makefile.in (dist): Don't use $(srcdir).
18720
18721 * bison.simple (__yy_memcpy):
18722 Really reorder the args, as was supposedly done on Feb 14 1995.
18723 (yyparse): Calls changed accordingly.
18724
18725 1996-01-27 Richard Stallman <rms@gnu.org>
18726
18727 * src/output.c (output_rule_data):
18728 Test YYERROR_VERBOSE in the conditional
18729 around the definition of ttyname.
18730
18731 1995-12-29 Richard Stallman <rms@gnu.org>
18732
18733 * src/bison.s1:
18734 Fix line numbers in #line commands.
18735
18736 1995-12-29 Richard Stallman <rms@gnu.org>
18737
18738 * bison.simple:
18739 Fix line numbers in #line commands.
18740
18741 1995-12-27 Richard Stallman <rms@gnu.org>
18742
18743 * src/bison.s1 (YYPARSE_PARAM_DECL):
18744 In C++, make it always null.
18745 (YYPARSE_PARAM_ARG): New macro.
18746 (yyparse): Use YYPARSE_PARAM_ARG.
18747
18748 1995-12-27 Richard Stallman <rms@gnu.org>
18749
18750 * bison.simple (YYPARSE_PARAM_DECL):
18751 In C++, make it always null.
18752 (YYPARSE_PARAM_ARG): New macro.
18753 (yyparse): Use YYPARSE_PARAM_ARG.
18754
18755 1995-11-29 Richard Stallman <rms@gnu.org>
18756
18757 * doc/bison.texinfo:
18758 Describe literal string tokens, %raw, %no_lines, %token_table.
18759
18760 1995-11-29 Daniel Hagerty <hag@gnu.org>
18761
18762 * doc/bison.texinfo: Fixed update date
18763
18764 1995-10-16 Richard Stallman <rms@gnu.org>
18765
18766 * src/version.c: Version 1.25.
18767
18768 1995-10-16 Richard Stallman <rms@gnu.org>
18769
18770 * NEWS: *** empty log message ***
18771
18772 1995-10-16 Richard Stallman <rms@gnu.org>
18773
18774 * doc/bison.1, doc/bison.rnh:
18775 Add new options.
18776
18777 1995-10-15 Richard Stallman <rms@gnu.org>
18778
18779 * src/vmsgetargs.c, src/getargs.c:
18780 Added -n, -k, and -raw switches.
18781 (noparserflag, toknumflag, rawtoknumflag): New variables.
18782
18783 * src/symtab.h (SALIAS):
18784 New #define for adding aliases to %token.
18785 (struct bucket): Added `alias' field.
18786
18787 * src/reduce.c (reduce_grammar):
18788 Revise error message.
18789 (print_notices): Remove final `.' from error message.
18790
18791 * src/reader.c (reader_output_yylsp):
18792 New function.
18793 (readgram): Use `#if 0' around code that accepted %command
18794 inside grammar rules: The documentation doesn't allow it,
18795 and it will fail since the %command processors scan for the next %.
18796 (parse_token_decl): Extended the %token
18797 declaration to allow a multi-character symbol as an alias.
18798 (parse_thong_decl): New function.
18799 (read_declarations): Added %thong declarations.
18800 (read_declarations): Handle NOOP to deal with allowing
18801 % declarations as another means to specify the flags.
18802 (readgram): Allow %prec prior to semantics embedded in a rule.
18803 (skip_to_char, read_declarations, copy_definition)
18804 (parse_token_decl, parse_start_decl, parse_type_decl)
18805 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
18806 (get_type_name, copy_guard, copy_action, readgram)
18807 (get_type, packsymbols): Revised most error messages.
18808 Changed `fatal' to `warnxxx' to avoid aborting for error.
18809 Revised and use multiple warnxxx functions to avoid using VARARGS1.
18810 (read_declarations): Improve the error message for
18811 an invalid character. Do not abort.
18812 (read_declarations, copy_guard, copy_action): Use
18813 printable_version to avoid unprintable characters in printed output.
18814 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
18815 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
18816 Allow the type of a non-terminal can be given
18817 more than once, as long as all specifications give the same type.
18818
18819 * src/output.c:
18820 (output_headers, output_trailers, output, output_gram)
18821 (output_rule_data): Implement noparserflag variable.
18822 Implement toknumflag variable.
18823 (output): Call reader_output_yylsp to output LTYPESTR.
18824
18825 * src/main.c (main):
18826 If reader sees an error, don't process the grammar.
18827 (fatals): Updated to not use VARARGS1.
18828 (printable_version, int_to_string, warn, warni, warns, warnss)
18829 (warnsss): New error reporting functions. Avoid abort for error.
18830
18831 * src/lex.h:
18832 Added THONG and NOOP for alias processing.
18833 Added SETOPT for the new code that allows setting options with %flags.
18834
18835 * src/lex.c:
18836 Include getopt.h. Add some extern decls.
18837 (safegetc): New function to deal with EOF gracefully.
18838 (literalchar); new function to deal with reading \ escapes.
18839 (lex): Use literalchar.
18840 (lex): Implemented "..." tokens.
18841 (literalchar, lex, parse_percent_token): Made tokenbuffer
18842 always contain the token. This includes growing the token
18843 buffer while reading an integer.
18844 (parse_percent_token): Replaced if-else statement with percent_table.
18845 (parse_percent_token): Added % declarations as another
18846 way to specify the flags -n, -l, and -r. Also added hooks for
18847 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
18848 major changes to files.c.
18849 (lex) Retain in the incoming stream a character following
18850 an incorrect '/'.
18851 (skip_white_space, lex): Revised most error messages
18852 and changed fatal to warn to avoid aborting.
18853 (percent_table): Added %thong declarations.
18854
18855 * src/gram.h: Comment changes.
18856
18857 * src/files.c (openfiles, open_extra_files, done):
18858 Add faction flag
18859 and actfile file. Handle noparserflag. Both for -n switch.
18860
18861 * src/conflicts.c (resolve_sr_conflict):
18862 Remove use of alloca.
18863
18864 1995-06-01 Jim Meyering <meyering@gnu.org>
18865
18866 * doc/bison.texinfo: *** empty log message ***
18867
18868 1995-05-06 Richard Stallman <rms@gnu.org>
18869
18870 * src/bison.s1: Comment change.
18871
18872 1995-05-06 Richard Stallman <rms@gnu.org>
18873
18874 * bison.simple: Comment change.
18875
18876 1995-05-03 Richard Stallman <rms@gnu.org>
18877
18878 * src/version.c: Version now 1.24.
18879
18880 * src/bison.s1: Change distribution terms.
18881
18882 * src/version.c: Version now 1.23.
18883
18884 1995-05-03 Richard Stallman <rms@gnu.org>
18885
18886 * doc/bison.texinfo:
18887 Rewrite "Conditions for Using Bison".
18888 Update version to 1.24.
18889
18890 1995-05-03 Richard Stallman <rms@gnu.org>
18891
18892 * bison.simple: Change distribution terms.
18893
18894 1995-02-23 Richard Stallman <rms@gnu.org>
18895
18896 * src/files.c: Test __VMS_POSIX as well as VMS.
18897
18898 1995-02-14 Jim Meyering <meyering@gnu.org>
18899
18900 * src/bison.s1 (__yy_memcpy):
18901 Renamed from __yy_bcopy to avoid
18902 confusion. Reverse FROM and TO arguments to be consistent with
18903 those of memcpy.
18904
18905 1995-02-14 Jim Meyering <meyering@gnu.org>
18906
18907 * bison.simple (__yy_memcpy):
18908 Renamed from __yy_bcopy to avoid
18909 confusion. Reverse FROM and TO arguments to be consistent with
18910 those of memcpy.
18911
18912 1994-11-10 David J. MacKenzie <djm@gnu.org>
18913
18914 * NEWS: reformat
18915
18916 * NEWS: New file.
18917
18918 * Makefile.in (DISTFILES): Include NEWS.
18919
18920 * Makefile.in (DISTFILES):
18921 Include install-sh, not install.sh.
18922
18923 * configure.in: Update to Autoconf v2 macro names.
18924
18925 1994-10-05 David J. MacKenzie <djm@gnu.org>
18926
18927 * Makefile.in: fix typo
18928
18929 * Makefile.in (prefix, exec_prefix):
18930 Let configure set them.
18931
18932 1994-09-28 David J. MacKenzie <djm@gnu.org>
18933
18934 * Makefile.in: Set datadir to $(prefix)/share.
18935
18936 1994-09-15 Richard Stallman <rms@gnu.org>
18937
18938 * src/bison.s1:
18939 Update copyright notice and GPL version.
18940
18941 1994-09-15 Richard Stallman <rms@gnu.org>
18942
18943 * bison.simple:
18944 Update copyright notice and GPL version.
18945
18946 1994-07-12 Richard Stallman <rms@gnu.org>
18947
18948 * src/reduce.c, src/reader.c:
18949 entered into RCS
18950
18951 1994-05-05 David J. MacKenzie <djm@gnu.org>
18952
18953 * Makefile.in: entered into RCS
18954
18955 1994-03-26 Richard Stallman <rms@gnu.org>
18956
18957 * src/bison.s1: entered into RCS
18958
18959 1994-03-26 Richard Stallman <rms@gnu.org>
18960
18961 * bison.simple: entered into RCS
18962
18963 1994-03-25 Richard Stallman <rms@gnu.org>
18964
18965 * src/main.c: entered into RCS
18966
18967 1994-03-24 Richard Stallman <rms@gnu.org>
18968
18969 * src/conflicts.c: entered into RCS
18970
18971 1994-01-02 Richard Stallman <rms@gnu.org>
18972
18973 * Makefile.in: *** empty log message ***
18974
18975 1993-11-21 Richard Stallman <rms@gnu.org>
18976
18977 * src/bison.s1: *** empty log message ***
18978
18979 1993-11-21 Richard Stallman <rms@gnu.org>
18980
18981 * doc/bison.texinfo: entered into RCS
18982
18983 * doc/bison.texinfo: *** empty log message ***
18984
18985 1993-11-21 Richard Stallman <rms@gnu.org>
18986
18987 * bison.simple: *** empty log message ***
18988
18989 1993-10-25 David J. MacKenzie <djm@gnu.org>
18990
18991 * doc/bison.texinfo: *** empty log message ***
18992
18993 1993-10-19 Richard Stallman <rms@gnu.org>
18994
18995 * src/bison.s1: *** empty log message ***
18996
18997 1993-10-19 Richard Stallman <rms@gnu.org>
18998
18999 * bison.simple: *** empty log message ***
19000
19001 1993-10-14 Richard Stallman <rms@gnu.org>
19002
19003 * src/bison.s1: *** empty log message ***
19004
19005 1993-10-14 Richard Stallman <rms@gnu.org>
19006
19007 * bison.simple: *** empty log message ***
19008
19009 1993-09-14 David J. MacKenzie <djm@gnu.org>
19010
19011 * doc/bison.texinfo: *** empty log message ***
19012
19013 1993-09-13 Noah Friedman <friedman@gnu.org>
19014
19015 * Makefile.in: *** empty log message ***
19016
19017 1993-09-10 Richard Stallman <rms@gnu.org>
19018
19019 * src/conflicts.c: *** empty log message ***
19020
19021 * src/system.h: entered into RCS
19022
19023 1993-09-10 Richard Stallman <rms@gnu.org>
19024
19025 * doc/bison.1: entered into RCS
19026
19027 1993-09-06 Noah Friedman <friedman@gnu.org>
19028
19029 * src/version.c: entered into RCS
19030
19031 1993-09-06 Noah Friedman <friedman@gnu.org>
19032
19033 * Makefile.in: *** empty log message ***
19034
19035 1993-07-30 David J. MacKenzie <djm@gnu.org>
19036
19037 * Makefile.in: *** empty log message ***
19038
19039 1993-07-24 Richard Stallman <rms@gnu.org>
19040
19041 * src/bison.s1: *** empty log message ***
19042
19043 1993-07-24 Richard Stallman <rms@gnu.org>
19044
19045 * bison.simple: *** empty log message ***
19046
19047 1993-07-08 David J. MacKenzie <djm@gnu.org>
19048
19049 * Makefile.in: *** empty log message ***
19050
19051 1993-07-04 Richard Stallman <rms@gnu.org>
19052
19053 * src/bison.s1: *** empty log message ***
19054
19055 1993-07-04 Richard Stallman <rms@gnu.org>
19056
19057 * bison.simple: *** empty log message ***
19058
19059 1993-06-26 David J. MacKenzie <djm@gnu.org>
19060
19061 * src/getargs.c: entered into RCS
19062
19063 1993-06-26 David J. MacKenzie <djm@gnu.org>
19064
19065 * doc/bison.texinfo: *** empty log message ***
19066
19067 * doc/bison.1: New file.
19068
19069 1993-06-25 Richard Stallman <rms@gnu.org>
19070
19071 * src/getargs.c: New file.
19072
19073 1993-06-16 Richard Stallman <rms@gnu.org>
19074
19075 * src/bison.s1: *** empty log message ***
19076
19077 1993-06-16 Richard Stallman <rms@gnu.org>
19078
19079 * bison.simple: *** empty log message ***
19080
19081 1993-06-03 Richard Stallman <rms@gnu.org>
19082
19083 * src/bison.s1: New file.
19084
19085 1993-06-03 Richard Stallman <rms@gnu.org>
19086
19087 * doc/bison.texinfo: *** empty log message ***
19088
19089 1993-06-03 Richard Stallman <rms@gnu.org>
19090
19091 * bison.simple: New file.
19092
19093 1993-05-19 Richard Stallman <rms@gnu.org>
19094
19095 * doc/bison.texinfo: New file.
19096
19097 1993-05-07 Noah Friedman <friedman@gnu.org>
19098
19099 * Makefile.in: *** empty log message ***
19100
19101 1993-04-28 Noah Friedman <friedman@gnu.org>
19102
19103 * src/reader.c: *** empty log message ***
19104
19105 1993-04-23 Noah Friedman <friedman@gnu.org>
19106
19107 * src/alloc.h: entered into RCS
19108
19109 1993-04-20 David J. MacKenzie <djm@gnu.org>
19110
19111 * src/version.c: *** empty log message ***
19112
19113 * src/files.c, src/allocate.c:
19114 entered into RCS
19115
19116 * src/reader.c: *** empty log message ***
19117
19118 * src/lex.c: entered into RCS
19119
19120 * src/conflicts.c: New file.
19121
19122 * src/symtab.c: entered into RCS
19123
19124 * src/alloc.h: New file.
19125
19126 * src/LR0.c: entered into RCS
19127
19128 1993-04-18 Noah Friedman <friedman@gnu.org>
19129
19130 * src/reader.c: New file.
19131
19132 * src/version.c: *** empty log message ***
19133
19134 1993-04-18 Noah Friedman <friedman@gnu.org>
19135
19136 * Makefile.in: *** empty log message ***
19137
19138 1993-04-17 Noah Friedman <friedman@gnu.org>
19139
19140 * Makefile.in: *** empty log message ***
19141
19142 1993-04-15 Richard Stallman <rms@gnu.org>
19143
19144 * src/main.c, src/files.c:
19145 New file.
19146
19147 1993-04-15 Noah Friedman <friedman@gnu.org>
19148
19149 * configure.in: entered into RCS
19150
19151 * configure.in: *** empty log message ***
19152
19153 * configure.in: New file.
19154
19155 1993-04-14 Richard Stallman <rms@gnu.org>
19156
19157 * Makefile.in: New file.
19158
19159 1993-04-13 Richard Stallman <rms@gnu.org>
19160
19161 * src/version.c: New file.
19162
19163 1993-03-25 Richard Stallman <rms@gnu.org>
19164
19165 * src/output.c: entered into RCS
19166
19167 1992-09-25 Richard Stallman <rms@gnu.org>
19168
19169 * configure.bat: entered into RCS
19170
19171 1992-06-22 Richard Stallman <rms@gnu.org>
19172
19173 * src/vmsgetargs.c: entered into RCS
19174
19175 1992-06-22 Richard Stallman <rms@gnu.org>
19176
19177 * doc/bison.rnh: entered into RCS
19178
19179 1992-04-20 David J. MacKenzie <djm@gnu.org>
19180
19181 * README: entered into RCS
19182
19183 1992-01-22 Richard Stallman <rms@gnu.org>
19184
19185 * src/machine.h: entered into RCS
19186
19187 1991-12-21 Richard Stallman <rms@gnu.org>
19188
19189 * src/lalr.c, src/closure.c:
19190 entered into RCS
19191
19192 1991-12-20 Richard Stallman <rms@gnu.org>
19193
19194 * src/state.h: entered into RCS
19195
19196 1991-12-18 Richard Stallman <rms@gnu.org>
19197
19198 * src/print.c, src/nullable.c, src/derives.c:
19199 entered into RCS
19200
19201 1991-11-03 David J. MacKenzie <djm@gnu.org>
19202
19203 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
19204 entered into RCS
19205
19206 1988-09-09 Richard Stallman <rms@gnu.org>
19207
19208 * src/bison.hairy: entered into RCS
19209
19210 1987-12-16 Richard Stallman <rms@gnu.org>
19211
19212 * REFERENCES: entered into RCS
19213
19214
19215 -----
19216
19217 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
19218 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
19219 Free Software Foundation, Inc.
19220
19221 Copying and distribution of this file, with or without
19222 modification, are permitted provided the copyright notice and this
19223 notice are preserved.
19224
19225 $Id$