]> git.saurik.com Git - bison.git/blob - ChangeLog
* README-hacking: New file, taken mostly from coreutils, with changes
[bison.git] / ChangeLog
1 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
2
3 * README-hacking: New file, taken mostly from coreutils, with changes
4 for Bison. Contains much of the contents of:
5 * README-cvs: Remove.
6 * bootstrap: Sync from gnulib.
7 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
8 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
9
10 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
11
12 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
13 Setzer.
14 (Java Differences): Fix some typos.
15 * THANKS: Add Sebastian Setzer.
16
17 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
18
19 * data/java.m4 (b4_single_class_if): Remove.
20 (b4_abstract_if): Look at "%define abstract".
21 (b4_lexer_if): New.
22 (b4_union_name): Rename...
23 (b4_yystype): ... to this. Map to "%define stype".
24 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
25 b4_maybe_throws): Fix quoting.
26 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
27 * data/lalr1.java (Lexer interface): Always define.
28 (Lexer interface within parser class): Remove.
29 (YYLexer class): New, used when "%code lexer" is present.
30 (constructor): When "%code lexer" is used, pass %lex-param
31 to the lexer constructor.
32 (yylex, yyparse): Remove %lex-param from method invocations
33 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
34
35 * doc/bison.texinfo (Java Bison Interface): Mention "%define
36 abstract". Rename "%define union_name" to "%define stype".
37 Rename method names according to previous patch.
38 (Java Scanner Interface): Describe "%code lexer" instead of
39 "%pure-parser" and "%define single_class".
40 (Java Differences): Mention "%code lexer".
41
42 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
43 Include scanner here, using macros from tests/local.at.
44 (AT_DATA_CALC_Y): Remove final argument.
45 (_AT_CHECK_JAVA_CALC): Likewise.
46 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
47 of %locations and %error-verbose.
48 (main): Test with and without %lex-param.
49 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
50 (AT_BISON_OPTION_POPDEFS): Pop it.
51
52 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
53
54 DJGPP spefic issue. Inhibit the use of disallowed characters for
55 file name genertion on Win98, WinXP, etc. These are |<>":?*\
56 and concern testsuite case 46.
57 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
58 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
59 * djgpp/config.bat: Inhibit the use of disallowed characters.
60
61 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
62
63 Miscellaneous %define and %code cleanup.
64 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
65 values are interpreted.
66 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
67 documentation a little more.
68 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
69 muscle_percent_define_insert, muscle_percent_code_grow): New
70 functions/macros.
71 * src/muscle_tab.h (muscle_percent_define_insert,
72 muscle_percent_code_grow): Prototype.
73 * src/parse-gram.y (prologue_declaration): Use
74 muscle_percent_define_insert and muscle_percent_code_grow when parsing
75 %define and %code directives.
76
77 Make it easy to share %define boolean variables between the front-end
78 and back-end. Though not used yet, this will be useful in the future.
79 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
80 Bison uses of names rather than just skeleton uses of names.
81 (b4_percent_define_get, b4_percent_define_ifdef): Rename
82 b4_percent_define_skeleton_variables(VARIABLE) to
83 b4_percent_define_bison_variables(VARIABLE).
84 (b4_percent_code_get, b4_percent_code_ifdef): Rename
85 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
86 b4_percent_code_bison_qualifiers(QUALIFIER).
87 (b4_check_user_names_wrap): Update for renames.
88 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
89 muscle_percent_define_default): New functions mimicking
90 b4_percent_define_flag_if and b4_percent_define_default.
91
92 For %define variables, report locations for invalid values and
93 redefinitions.
94 * data/bison.m4 (b4_percent_define_flag_if): Read
95 b4_percent_define_loc(VARIABLE) to report the location of an invalid
96 value for VARIABLE.
97 (b4_percent_define_default): Save a special location in
98 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
99 must later be reported as invalid.
100 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
101 functions.
102 (muscle_percent_define_insert): Record the location of VARIABLE in
103 muscle percent_define_loc(VARIABLE), and use it to report the previous
104 location for a redefinition.
105 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
106 (muscle_percent_define_default): Update like b4_percent_define_default.
107 (muscle_grow_user_name_list): Rename to...
108 (muscle_user_name_list_grow): ... this for consistency and use
109 muscle_location_grow.
110 * src/muscle_tab.h (muscle_location_grow): Prototype.
111 * tests/input.at (%define errors): Update expected output.
112 * tests/skeletons.at (%define boolean variables: invalid skeleton
113 defaults): New test case.
114
115 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
116
117 * src/print.c (lookahead_set, state_default_rule): Remove.
118 (print_reductions): Replace state_default_rule invocation with
119 equivalent use of yydefact, which was computed in token_actions in
120 tables.c.
121 (print_results): Don't allocate lookahead_set.
122
123 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
124
125 * data/lalr1.java: Prefix all private members with yy.
126
127 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
128
129 Use YYFPRINTF instead of fprintf where appropriate. Reported by
130 Sébastien Fricker at
131 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
132 * THANKS: Add Sébastien Fricker.
133 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
134 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
135 accept a variable number of arguments.
136
137 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
138
139 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
140
141 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
142
143 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
144 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
145 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
146
147 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
148
149 Undo my 2007-02-07 change, switching back to the c-strcase module
150 introduced in the 2007-02-03 change. Bruno Haible reported that
151 the 2007-02-07 change would be dangerous in Turkish if we add a
152 language whose name contains "i", since "i" is not lowercase "I"
153 in Turkish.
154 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
155 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
156 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
157 * m4/.cvsignore: Remove strcase.m4.
158 * src/getargs.c: Revert 2007-02-07 change, as follows.
159 Include c-strcase.h.
160 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
161
162 2007-02-11 Bruno Haible <bruno@clisp.org>
163
164 Enable the Java related testsuite tests when the only Java compiler
165 found is a gcj < 4.3. Discussed at
166 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
167 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
168
169 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
170
171 * data/Makefile.am: Update copyright date.
172 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
173 yypstate_new returns NULL.
174 (yypstate_new): Return NULL if malloc does.
175 * src/reader.c (packgram): Move translation of rule actions from the
176 beginning of packgram to...
177 (check_and_convert_grammar): ... here right before packgram is invoked
178 so it's easier to write more complete comments, and remove redundant
179 code.
180
181 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
182
183 As in semantic actions, make @$ in %initial-action, %destructor, and
184 %printer imply %locations.
185 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
186 scanning @$.
187 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
188 (@$ in %initial-action implies %locations,
189 @$ in %destructor implies %locations,
190 @$ in %printer implies %locations): ... these new test cases.
191
192 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
193
194 Undo most of the 2007-02-03 change, switching to the strcase module
195 now that gnulib strcase has been fixed.
196 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
197 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
198 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
199 * m4/.cvsignore: Add strcase.m4.
200 * src/getargs.c: Revert 2007-02-03 change, as follows.
201 Don't include c-strcase.h.
202 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
203 strcasecmp has "unspecified behavior" outside the POSIX locale,
204 but it works fine in practice if at least one argument is ASCII,
205 as is the case in Bison.
206
207 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
208
209 * tests/java.at: Skip tests if only one of javac/java is present.
210 Reported by Joel E. Denny.
211 * tests/atlocal.in: Adjust copyright years.
212
213 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
214
215 * data/lalr1.java (Stack): Work around old verifiers that disallow
216 access to the private fields of an inner class, from the outer class.
217 We can make Stack's fields public because user code doesn't have access
218 to the instance of Stack used by parse(). Reported by Paul Eggert.
219
220 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
221
222 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
223 the right spot for these files?
224 * bootstrap.conf (gnulib_modules): Add c-strcase.
225 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
226 c-strncasecmp.c.
227 * src/getargs.c: Include c-strcase.h.
228 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
229 to avoid unspecified behavior.
230
231 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
232
233 * doc/bison.texinfo (Decl Summary): Correct typo.
234
235 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
236
237 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
238 Complain if the value does not match empty, "true" or "false".
239 * data/c++.m4: Adjust default definitions of %define variables.
240 * data/java.m4: Adjust default definitions of %define variables.
241 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
242 to above behavior.
243 * tests/input.at (Boolean %define variables): Test new behavior.
244
245 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
246
247 * NEWS: Mention java.
248 * TODO: Remove things that are done.
249 * bootstrap.conf: Add javacomp-script and javaexec-script.
250 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
251
252 * data/Makefile.am: Add new files.
253 * data/java-skel.m4: New.
254 * data/java.m4: New.
255 * data/lalr1.java: New.
256
257 * doc/bison.texinfo: Put "A Complete C++ Example" under
258 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
259 under Other Languages.
260
261 * src/getargs.c (valid_languages): Add Java.
262 * src/getargs.h (struct bison_language): Update size of string fields.
263
264 * tests/Makefile.am: Add java.at.
265 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
266 * tests/java.at: New.
267 * tests/testsuite.at: Include it.
268
269 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
270
271 Clean up.
272 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
273 at_directive_argv arguments so these no longer have to be global
274 variables. Also, update the implementation for the following changes.
275 (fail_for_at_directive_too_many_args,
276 fail_for_at_directive_too_few_args): Add at_directive_name argument.
277 (at_directive_name): Remove as at_directive_argv[0] will be used for
278 this now.
279 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
280 for the directive name.
281 (at_directive_argc, at_directive_argv): Make these local within
282 skel_lex instead of global.
283 (INITIAL): Update directive start action for above changes.
284 (SC_AT_DIRECTIVE_ARG): Rename to...
285 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
286 (SC_AT_DIRECTIVE_SKIP_WS): Update.
287 (scan_skel): Move yylex_destroy to...
288 (skel_scanner_free): ... here.
289 * tests/skeletons.at (installed skeleton file name): Rename to...
290 (installed skeleton file names): ... this.
291
292 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
293
294 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
295 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
296 Summary" not "Directives".
297 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
298 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
299 since the former is now the more complete one.
300 (Prologue Alternatives): Likewise and do the same for %defines.
301 (Table of Symbols): Add summary of %code, add summary of %define, and
302 move full %code documentation to...
303 (Decl Summary): ... here for consistency with other entries in these
304 sections.
305 Move %define entry in order to keep this list alphabetized.
306 Reword %define entry a little to put less emphasis on the skeleton
307 concept, which most users shouldn't have to think about.
308
309 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
310
311 Adjust to recent gnulib changes.
312 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
313 Add string.h, string_.h, unistd_.h, wchar_.h.
314 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
315 * src/system.h: Don't include <stpcpy.h>; this is now done by
316 <string.h>.
317
318 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
319
320 Simplify implementation of unqualified %code, implement macros for
321 uniform treatment of boolean %define flags. Document %define.
322 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
323 b4_percent_code_ifdef): New.
324 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
325 * data/c++.m4: Define default value for global_tokens_and_yystype.
326 * data/glr.cc: Likewise.
327 * data/location.cc: Use b4_percent_define_flag_if.
328
329 * doc/bison.texinfo (Decl Summary): Document %define.
330
331 * src/parse-gram.y (Unqualified %code): Change muscle name to
332 b4_percent_code().
333 (content.opt): Default to empty.
334
335 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
336
337 Implement support for relative and absolute skeleton file names.
338 Discussed starting at
339 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
340 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
341 (Bison Options): Document in --skeleton entry.
342 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
343 full_skeleton can't necessarily hold all of pkgdatadir.
344 If the specified skeleton file name contains a `/', don't prepend
345 pkgdatadir.
346 * src/parse-gram.y (prologue_declaration): If the specified skeleton
347 file name contains a `/', prepend the grammar file directory.
348 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
349 * skeletons.at: New file.
350 (relative skeleton file names): New test case.
351 (installed skeleton file names): New test case.
352 * tests/testsuite.at: Include skeletons.at.
353
354 * bootstrap: Update copyright to 2007.
355
356 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
357
358 * bootstrap: Remove occurrences of .#bootmp from the files.
359
360 2007-01-17 Akim Demaille <akim@epita.fr>
361
362 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
363 nonterminals.
364 Use per-type %printer.
365
366 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
367
368 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
369 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
370 djgpp/config.site, src/files.c, src/files.h, src/main.c,
371 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
372 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
373 tests/glr-regression.at, tests/input.at, tests/local.at,
374 tests/output.at, tests/torture.at: Update copyright to 2007.
375
376 2007-01-16 Akim Demaille <akim@epita.fr>
377
378 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
379 error code.
380 (Calc++ Scanner): Exit with failure if we can't open the input
381 file.
382 Accept "-" standing for stdin.
383 (Calc++ Top Level): Print the result only if the parsing was
384 successful.
385
386 2007-01-16 Akim Demaille <akim@epita.fr>
387
388 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
389
390 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
391 and Joel E. Denny <jdenny@ces.clemson.edu>
392
393 Clean up %define and %code implementation in M4 some. Most
394 importantly, rename all related macros to be in the b4_percent_define
395 and b4_percent_code namespaces. Also, complete support for `.' in
396 %define variable names and %code qualifiers.
397 * data/bison.m4 (b4_check_user_names): Check for special
398 "SKELETON-NAMESPACE(name)" macros instead of using two nested
399 m4_foreach loops.
400 (b4_get_percent_define, b4_get_percent_code): Rename to...
401 (b4_percent_define_get, b4_percent_code_get): ... these.
402 Extend documentation with examples.
403 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
404 b4_percent_define_skeleton_variables and
405 b4_percent_code_skeleton_qualifiers.
406 Expect any value for the %define variable `foo' to be stored in the
407 macro named `b4_percent_define(foo)'; expect any %code blocks for the
408 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
409 expect any unqualified %code blocks to be stored in a macro named
410 `b4_percent_code_unqualified'.
411 Use m4_indir so that %define variable names and %code qualifiers can
412 contain `.', which is allowed by the grammar parser.
413 (b4_percent_define_default): New macro to set a default value for a
414 %define variable.
415 (m4_wrap): Update wrapped code, and fix some underquoting.
416 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
417 Expect grammar uses of %define variables and %code qualifiers to be
418 defined in b4_percent_define_user_variables and
419 b4_percent_code_user_qualifiers.
420 * data/c++.m4: Use b4_percent_define_default rather than
421 m4_define_default. Fix some underquoting. Skeleton usage of %define
422 variable define_location_comparison now implies skeleton usage of
423 %define variable filename_type.
424 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
425 data/push.c, data/yacc.c: Update macro names.
426 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
427 muscle names.
428
429 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
430
431 DJGPP specific issues.
432
433 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
434 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
435
436 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
437
438 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
439 run parsers in all tests so that Valgrind is invoked during
440 maintainer-check-valgrind.
441 (Duplicate representation of merged trees): Free all semantic values.
442 (Duplicated user destructor for lookahead): Likewise.
443
444 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
445
446 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
447 command-line prefix.
448 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
449 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
450 miss Valgrind messages.
451 (Exploding the Stack Size with Malloc): Likewise.
452
453 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
454
455 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
456 locals. Reported by Juan Manuel Guerrero at
457 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
458 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
459 Fix some indentation also.
460 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
461 explaining this issue.
462
463 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
464 and Joel E. Denny <jdenny@ces.clemson.edu>
465
466 Simplify union and prologue handling, and escape union and lex/parse
467 params with digraphs.
468 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
469 values to the empty string since these are no longer guaranteed
470 initialized by the front-end.
471 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
472 braces around b4_user_stype since this is no longer done by the
473 front-end.
474 * src/files.c, src/files.h (pre_prologue_obstack,
475 post_prologue_obstack): Remove.
476 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
477 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
478 with digraphs. This fixes lex params and parse params.
479 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
480 * src/output.c (prepare): Remove muscle insertion of the prologues.
481 (output): Remove freeing of pre_prologue_obstack and
482 post_prologue_obstack.
483 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
484 than prologue_augment for prologue parsing so you don't need prologue
485 obstacks.
486 (grammar_declaration): For %union RHS, use `braceless' instead of
487 "{...}" so that braces are already stripped and code is escaped with
488 digraphs.
489 * src/reader.c (prologue_augment): Remove.
490 (reader): Remove initialization of pre_prologue_obstack and
491 post_prologue_obstack.
492 * src/reader.h (prologue_augment): Remove.
493
494 * data/c.m4: Remove stray parenthesis.
495
496 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
497
498 Remove quotes from variables names in %define directives and from
499 qualifiers in %code directives, and restrict the characters that are
500 allowed in them to M4-friendly ones. For %define, continue to support
501 the quoted form as a deprecated feature. Discussed starting at
502 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
503 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
504 %code.
505 * doc/bison.texinfo (Prologue Alternatives): Update.
506 (Bison Declaration Summary): In %defines entry, update mention of
507 `%code requires' and `%code provides'.
508 (C++ Location Values): Update %define uses.
509 (Calc++ Parser Interface): Likewise.
510 (Calc++ Parser): Likewise, and update `%code requires' uses.
511 (Table of Symbols): Update %code documentation.
512 * src/parse-gram.y (prologue_declaration): For %define variables, use
513 `variable' instead of `STRING'.
514 (grammar_declaration): For %code qualifiers, use `ID' instead of
515 `STRING'.
516 (variable): New nonterminal that takes an `ID' or a `STRING'.
517 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
518 and %define uses.
519 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
520 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
521 (%define errors): Update %define uses.
522
523 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
524
525 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
526 instead of muscle_insert for %define values so that M4-special
527 characters are replaced with digraphs.
528 * tests/input.at (%define errors): Extend to check weird values.
529
530 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
531
532 Instead of having skeletons declare all valid %define variables and
533 %code qualifiers, provide macros that retrieve the associated values
534 and build these lists automatically. Thus Bison will now warn when a
535 variable or qualifier is not used by the skeleton in the current
536 invocation regardless of whether it might sometimes be used by that
537 skeleton in other invocations. Also, move all %define value macros to
538 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
539 form, which is replaced by %code.
540 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
541 (b4_check_user_names): ... this, and change the series of valid name
542 arguments to a single list argument for names used in the skeleton
543 similar to the existing list argument for names used in the grammar.
544 Warn instead of complaining.
545 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
546 values and %code code, to format %code code properly, and to build
547 lists of all %define variables and %code qualifiers used in the
548 skeleton: b4_skeleton_percent_define_variables and
549 b4_skeleton_percent_code_qualifiers.
550 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
551 Remove, and...
552 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
553 the skeleton names lists can finish building first. In place of
554 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
555 expect the lists b4_user_percent_define_variables and
556 b4_user_percent_code_qualifiers.
557 * data/c++.m4: Where setting default values for b4_parser_class_name,
558 b4_location_type, b4_filename_type, b4_namespace, and
559 b4_define_location_comparison, update their names to the
560 b4_percent_define_ namespace.
561 * data/glr.c: Don't use b4_check_percent_define_variables and
562 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
563 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
564 (b4_parser_class_name, b4_namespace): Define these using
565 b4_get_percent_define for parser_class_name and namespace.
566 * data/location.cc: Use b4_get_percent_define.
567 * data/push.c: Don't use b4_check_percent_define_variables and
568 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
569 * data/yacc.c: Likewise, and don't call m4_exit in
570 b4_use_push_for_pull_if or m4_wrap code will never execute.
571 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
572 Rename to...
573 (muscle_grow_user_name_list): ... this for consistency with the
574 terminology used in bison.m4.
575 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
576 %define variable names, and rename muscle used_percent_define_variables
577 to user_percent_define_variables.
578 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
579 user_percent_code_qualifiers.
580 (content): Remove.
581 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
582 {CODE} form is no longer accepted.
583 * tests/input.at (Reject bad %code qualifiers): Rename to...
584 (Reject unused %code qualifiers): ... this, and update test output.
585 (%define error): Update test output.
586
587 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
588
589 Check for unrecognized %define variables similar to checking for
590 unrecognized %code qualifiers. Check for redefined %define variables.
591 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
592 generalizes...
593 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
594 (b4_check_percent_define_variables): New, also wraps it.
595 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
596 variables using b4_check_percent_define_variables.
597 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
598 all those exercised in the test suite and all those listed in the
599 `Default values' section of c++.m4. Are there others?
600 * data/push.c, data/yacc.c: Declare no valid %define variables.
601 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
602 similar to muscle_find, but it works even when the muscle stores a
603 const value.
604 (muscle_grow_used_name_list): New function for constructing the used
605 name list muscles that b4_check_for_unrecognized_names requires.
606 * src/parse-gram.y (prologue_declaration): Warn if a variable is
607 %define'd more than once. Define the b4_used_percent_define_variables
608 muscle with muscle_grow_used_name_list.
609 (grammar_declaration): Abbreviate %code code with
610 muscle_grow_used_name_list.
611 * tests/input.at (%define errors): New.
612
613 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
614
615 Provide warn_at, complain_at, and fatal_at function callbacks to the
616 skeletons, and use this for %code qualifier complaints.
617 * data/bison.m4 (b4_error_at): New, invoked by...
618 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
619 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
620 @fatal_at(...@) directives.
621 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
622 qualifiers in b4_used_percent_code_qualifiers and to use
623 b4_complain_at.
624 * src/location.c, src/location.h (boundary_set_from_string): New global
625 function.
626 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
627 function.
628 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
629 to b4_used_percent_code_qualifiers.
630 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
631 function.
632 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
633 (lineno): Rename to...
634 (out_lineno): ... this so I don't misunderstand it again.
635 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
636 here; these newlines are in the input but not the output file.
637 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
638 (at_directive_perform): ... this new static function, and add handling
639 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
640 directives.
641 * tests/input.at (Reject bad %code qualifiers): Update test output with
642 locations and extend.
643
644 * tests/output.at (Output file name: [, Output file name: ]): Remove
645 bogus comment about these tests failing.
646
647 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
648
649 Clean up b4_check_percent_code_qualifiers a little.
650 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
651 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
652 documentation and add examples.
653 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
654 qualifiers here.
655
656 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
657
658 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
659 unreliable -- especially when they're hidden inside another macro.
660 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
661 data/c.m4: Remove m4_divert(-1).
662 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
663 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
664 m4_divert_push(0) and m4_divert_pop(0).
665 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
666 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
667 pushed and popped by m4sugar, should be first on the stack.
668
669 Provide warn, complain, and fatal function callbacks to the skeletons.
670 This provides more flexibility than m4_fatal, improves the error
671 message format, and captures messages for translation. Discussed
672 starting at
673 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
674 * data/bison.m4 (b4_error): New, invoked by...
675 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
676 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
677 directives. Because these M4 macros might be called when the current
678 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
679 the previous removal of uses of m4_divert, which caused trouble.
680 (b4_check_percent_code_qualifiers): Use b4_complain instead of
681 m4_fatal to report unrecognized %code qualifiers.
682 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
683 push parser requests.
684 * data/glr.c: Use b4_complain instead of m4_fatal to report
685 non-deterministic push parser requests.
686 Update @output usage to @output(...@) form.
687 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
688 report missing %defines. Update @output usage to @output(...@) form.
689 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
690 @output(...@) form.
691 * src/main.c (main): Invoke skel_scanner_free.
692 * src/scan-skel.h (skel_scanner_free): Prototype new function.
693 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
694 obstack_for_string from flex-scanner.h.
695 (YY_DECL): Use to declare skel_lex static.
696 (decode_at_digraphs): Remove; now handled in the new
697 SC_AT_DIRECTIVE_ARG start condition.
698 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
699 functions.
700 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
701 at_directive_argv): New static globals.
702 (INITIAL): Use fail_for_invalid_at.
703 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
704 recognize the start of a generalized `@directive(...@)' form and
705 start...
706 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
707 directive args (using the new obstack_for_string), to decode the
708 contained @ diagraphs, and to perform the directive. It recognizes
709 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
710 @output(...@).
711 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
712 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
713 `@,'.
714 (scan_skel): Initialize obstack_for_string on the first call.
715 (skel_scanner_free): New function to free obstack_for_string.
716 * tests/input.at (Reject bad %code qualifiers): Update test output.
717
718 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
719
720 Consolidate the 4 prologue alternative directives (%code, %requires,
721 %provides, and %code-top) into a single %code directive with an
722 optional qualifier field. Discussed at
723 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
724 * NEWS (2.3a+): Rewrite the existing entry for the prologue
725 alternatives.
726 * doc/bison.texinfo (Prologue Alternatives): Update.
727 (Decl Summary): Update to %code "requires" and %code "provides".
728 (Calc++ Parser): Update to %code "requires".
729 (Table of Symbols): Remove entries for %requires, %provides, and
730 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
731 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
732 are replaced by b4_percent_code_provides and b4_percent_code_requires,
733 which are skeleton-specific.
734 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
735 declare what %code qualifiers it supports and to complain if any other
736 qualifiers were used in the grammar.
737 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
738 and b4_user_code([b4_percent_code_provides]) in place of
739 b4_user_requires and b4_user_provides.
740 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
741 Add b4_user_code([b4_percent_code_top]) and
742 b4_user_code([b4_percent_code]).
743 Invoke b4_check_percent_code_qualifiers.
744 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
745 PERCENT_REQUIRES): Remove.
746 (grammar_declaration): Remove RHS's for %code-top, %provides, and
747 %requires. Rewrite the %code RHS as the unqualified form defining the
748 muscle b4_percent_code. Add another RHS for the qualified %code form,
749 which defines muscles of the form b4_percent_code_QUALIFIER and the
750 b4_used_percent_code_qualifiers muscle.
751 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
752 PERCENT_REQUIRES): Remove.
753 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
754 %code "requires" and %code "provides".
755 * tests/input.at (Reject bad %code qualifiers): New.
756
757 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
758
759 Use the new code_props interface for destructors and printers.
760 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
761 printer_location members, and change the type of the destructor and
762 printer members to code_props.
763 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
764 symbol_printer_get, semantic_type_destructor_set,
765 semantic_type_printer_set, default_tagged_destructor_set,
766 default_tagless_destructor_set, default_tagged_printer_set,
767 default_tagless_printer_set): Use code_props in arguments and return
768 types in place of char const * and location.
769 (symbol_destructor_location_get, symbol_printer_location_get): Remove
770 since the locations are now contained in the return of
771 symbol_destructor_get and symbol_printer_get.
772 * src/output.c (symbol_destructors_output, symbol_printers_output):
773 Replace with...
774 (symbol_code_props_output): ... this to eliminate duplicate code.
775 (output_skeleton): Update to use symbol_code_props_output.
776 * src/reader.c (symbol_should_be_used): Update use of
777 symbol_destructor_get.
778 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
779 Update uses of the various _destructor_set and _printer_set functions.
780 * src/symtab.c: (default_tagged_destructor_location,
781 default_tagless_destructor_location, default_tagged_printer_location,
782 default_tagless_printer_location): Remove since we...
783 (default_tagged_destructor, default_tagless_destructor,
784 default_tagged_printer, default_tagless_printer): ... change the type
785 of these to code_props.
786 (symbol_new, semantic_type_new, symbol_destructor_set,
787 semantic_type_destructor_set, symbol_destructor_get,
788 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
789 symbol_check_alias_consistency, default_tagged_destructor_set,
790 default_tagless_destructor_set, default_tagged_printer_set,
791 default_tagless_printer_set): Update.
792 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
793 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
794 code_props members.
795 (symbol_print): Use SYMBOL_CODE_PRINT.
796
797 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
798
799 Use the new code_props interface for rule actions.
800 * src/symlist.h (symbol_list): Replace action, action_location, and
801 used members with a code_props action_props member.
802 * src/reader.c (symbol_should_be_used, grammar_rule_check,
803 grammar_midrule_action, grammar_current_rule_merge_set,
804 grammar_current_rule_symbol_append, packgram): Update.
805 * src/scan-code.h (translate_rule_action): Remove, no longer used.
806 * src/scan-code.l (handle_action_dollar): Update.
807 (translate_rule_action): Remove, no longer used.
808 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
809
810 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
811
812 Use the new code_props interface in parse-gram.y.
813 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
814 Update all uses of translate_* functions to use the new code_props
815 interface and to use gram_scanner_last_string_free and
816 code_scanner_last_string_free where possible.
817 (grammar_declaration): symbol_list_destructor_set and
818 symbol_list_printer_set now perform the translation, so don't do it
819 here. Use gram_scanner_last_string_free where possible.
820 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
821 translate_code): Remove, no longer used.
822 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
823 symbol_list_printer_set): Perform code translation here rather than
824 depending on the caller to do so.
825
826 * src/symlist.h (struct symbol_list): Correct some documentation typos.
827 * src/scan-gram.h (gram_last_string): Remove declaration.
828 * src/scan-gram.l (last_string): Declare it static.
829
830 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
831
832 Encapsulate code properties and related functionality for the various
833 destructors, printers, and actions into a code_props structure and
834 interface. This patch merely implements code_props in scan-code.h and
835 scan-code.l. Future patches will rewrite other modules to use it.
836 Discussed starting at
837 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
838 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
839 consistently initialize const structs that have an empty location
840 field.
841 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
842 to ensure consistency.
843 * src/scan-code.h (code_props): New structure.
844 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
845 function, macro, and const global variable for initializing a
846 code_props with no code.
847 (code_props_plain_init, code_props_symbol_action_init,
848 code_props_rule_action_init, code_props_translate_code): The rest of
849 the new code_props functional interface. Among other things, the init
850 functions set the code_props kind field so that
851 code_props_translate_code will know whether to behave like
852 translate_symbol_action, translate_rule_action, or translate_code.
853 These old translate functions must remain until all other modules are
854 updated to use the new code_props interface.
855 (code_scanner_last_string_free): New function similar to
856 gram_scanner_last_string_free.
857 (code_scanner_free): Add documentation.
858 * src/scan-code.l: Implement the new interface.
859 (code_lex): Make it static, add a code_props* argument, and remove the
860 rule argument.
861 (last_string): New static global similar to the one in scan-gram.l.
862 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
863 instead of rule.
864 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
865 code_props since Bison may one day use this information for destructors
866 and printers.
867 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
868 (handle_action_dollar): Use symbol_list_n_get and set used flag
869 directly since symbol_list_n_used_set is removed.
870 (translate_action): Add a code_props* argument and remove the rule,
871 action, and location arguments. Pass the code_props* on to code_lex.
872 (translate_rule_action, translate_symbol_action, translate_code):
873 Rewrite as wrappers around the new code_props interface.
874 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
875 it would eventually need to break the encapsulation of code_props.
876
877 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
878
879 * etc/.cvsignore: New.
880
881 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
882
883 Add maintainer-push-check to run maintainer-check using push parsing in
884 place of pull parsing where available.
885 * Makefile.am (maintainer-push-check): New.
886 * data/bison.m4 (b4_use_push_for_pull_if): New.
887 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
888 appropriately based on their existing values.
889 (yypush_parse): Don't print push-parser-specific diagnostics if push
890 parsing is being used in place of pull parsing.
891 * data/yacc.c: If push parsing should replace pull parsing, redirect to
892 push.c.
893 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
894 variable, and insert b4_use_push_for_pull_flag into muscles.
895 * tests/Makefile.am (maintainer-push-check): New.
896
897 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
898
899 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
900 (whether successful or failed) so that yypush_parse can be invoked
901 again to start a new parse using the same yypstate.
902 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
903 check multiple yypull_parse invocations on the same yypstate. For pull
904 mode, extend to check multiple yyparse invocations.
905 (Exploding the Stack Size with Alloca): Extend to try with
906 %push-pull-parser.
907 (Exploding the Stack Size with Malloc): Likewise.
908
909 * tests/calc.at (Simple LALR Calculator): Don't specify
910 %skeleton "push.c" since %push-pull-parser implies that now.
911 * tests/headers.at (export YYLTYPE): Don't check for the push
912 declarations. Otherwise, this test case can't be used to see if push
913 mode can truly emulate pull mode.
914 * tests/input.at (Torturing the Scanner): Likewise.
915 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
916 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
917 AT_YACC_IF, which now includes the case of push mode since %skeleton
918 need not be used for push mode. This will be more intuitive once
919 push.c is renamed to yacc.c.
920
921 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
922
923 For push mode, convert yyparse from a macro to a function, invoke yylex
924 instead of passing a yylexp argument to yypull_parse, and don't
925 generate yypull_parse or yyparse unless %push-pull-parser is declared.
926 Discussed starting at
927 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
928 * data/bison.m4 (b4_pull_if): New.
929 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
930 * data/push.c: Improve M4 quoting a little.
931 (b4_generate_macro_args, b4_parenthesize): Remove.
932 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
933 any time a pull parser is requested.
934 Don't #define this as a wrapper around yypull_parse. Instead, when
935 both push and pull are requested, make it a function that does that
936 same thing.
937 (yypull_parse): If there's a b4_prefix, #define this to
938 b4_prefix[pull_parse] when both push and pull are requested.
939 Don't define this as a function unless both push and pull are
940 requested.
941 Remove the yylexp argument and hard-code yylex invocation instead.
942 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
943 %push-parser.
944 * src/getargs.c (pull_parser): New global initialized to true.
945 * getargs.h (pull_parser): extern it.
946 * src/output.c (prepare): Insert pull_flag muscle.
947 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
948 (prologue_declaration): Set both push_parser and pull_parser = true for
949 %push-pull-parser. Set push_parser = true and pull_parser = false for
950 %push-parser.
951 * src/scan-gram.l: Don't accept %push_parser as an alternative to
952 %push-parser since there's no backward-compatibility concern here.
953 Scan %push-pull-parser.
954 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
955 instead of %push-parser.
956 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
957 prototype it in the module that calls yyparse.
958 * tests/input.at (Torturing the Scanner): Likewise.
959 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
960
961 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
962
963 Update etc/bench.pl. Optimize push mode a little (the yyn change
964 deserves most of the credit).
965 * Makefile.am (SUBDIRS): Add etc subdirectory.
966 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
967 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
968 yytoken, yyval, and yyloc declarations to...
969 (yyparse or yypush_parse): ... here to improve performance. For
970 yypush_parse invocations after the first, be sure to assign yyn its old
971 value again.
972 (yypstate_new): Don't bother initializing the yyresult field since the
973 initial value isn't used.
974 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
975 remove the #define that, in push mode, set it to yyps->NAME.
976 * etc/Makefile.am: New.
977 * etc/bench.pl: Remove and build it instead from...
978 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
979 "tests/bison" from the build directory by default rather than just
980 invoking "bison" from $PATH.
981 (calc_grammar): Update push parser code: don't declare yylval globally,
982 don't define yyparse_wrapper, and don't #define yyparse.
983 (bench_grammar): Update to check all working combinations of yacc.c,
984 push.c, impure, pure, pull, and push.
985
986 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
987
988 For push mode, add pull wrappers around yypush_parse.
989 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
990 (yypull_parse): New function wrapping yypush_parse.
991 (yyparse): New #define wrapping yypull_parse.
992 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
993 is declared.
994 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
995 prototype yylex in the module that calls yyparse, and don't prototype
996 yyparse there. Otherwise, the yyparse expansion won't compile.
997 * tests/input.at (Torturing the Scanner): Likewise.
998
999 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1000
1001 Enable push parsers to operate in impure mode. Thus, %push-parser no
1002 longer implies %pure-parser. The point of this change is to move
1003 towards being able to test the push parser code by running the entire
1004 test suite as if %push-parser had been declared.
1005 * data/push.c (yypush_parse): For impure mode, remove the
1006 yypushed_char, yypushed_val, and yypushed_loc arguments.
1007 Instead, declare these as local variables initialized to the global
1008 yychar, yylval, and yylloc.
1009 For the first yypush_parse invocation only, restore the initial values
1010 of these global variables when it's time to read a token since they
1011 have been overwritten.
1012 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
1013 %push-parser.
1014 * tests/calc.at (Simple LALR(1) Calculator): Always declare
1015 %pure-parser along with %push-parser since this test case was designed
1016 for pure push parsers.
1017 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
1018 (AT_YACC_OR_PUSH_IF): New.
1019 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
1020 add a note that it's still wrong for some cases (as it has been for a
1021 while).
1022 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
1023 %push-parser no longer implies %pure-parser.
1024
1025 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1026
1027 Remove some unnecessary differences between the pull parser code and
1028 the push parser code. This patch enables yynerrs in push mode.
1029 * data/push.c: Reformat M4 a little.
1030 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
1031 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
1032 because push mode is on. Instead, if pure mode is on, move yynerrs
1033 to...
1034 (b4_declare_parser_state_variables): ... here.
1035 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
1036 to yyps->NAME so it can be used in yypush_parse.
1037 (yypush_parse): Don't omit uses of yynerrs in push mode.
1038
1039 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1040
1041 Fix bug such that the first pushed token's value and location are
1042 sometimes overwritten (sometimes by %initial-action) before being used.
1043 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
1044 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
1045 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
1046 more closely mimic the pull parser logic.
1047 Don't copy the pushed token to yychar, yylval, and yylloc until it's
1048 time to read a token, which is after any initialization of yylval and
1049 yylloc.
1050 (gottoken): Rename label to...
1051 (yyread_pushed_token): ... for clarity and to avoid infringing on the
1052 user namespace.
1053
1054 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1055
1056 Rearrange initialization of the parser state variables so that the
1057 skeleton doesn't have to have a copy for pull mode and another for push
1058 mode. This patch also fixes at least a bug such that yylloc was not
1059 initialized (with b4_location_initial_line and
1060 b4_location_initial_column) upon calling yypush_parse. However, that
1061 initialization now overwrites the first token's location;
1062 %initial-action assigning @$ already did the same thing, and both bugs
1063 will be fixed in a later patch.
1064 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
1065 (b4_declare_parser_state_variables): Remove initialization of yytoken,
1066 yyss, yyvs, yyls, and yystacksize.
1067 (yypstate_new): Remove initialization of some yypstate fields: yystate,
1068 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
1069 yylsp.
1070 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
1071 yyps->NAME so it can be used in yypush_parse.
1072 (yyparse or yypush_parse): For yypush_parse, don't print the
1073 "Starting parse" diagnostic for invocations after the first.
1074 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
1075 yypush_parse, only do it for the first invocation.
1076 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
1077 initialization to occur in yypush_parse but only on the first
1078 invocation.
1079
1080 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1081
1082 * data/push.c: Add CPP guards around push parser declarations in both
1083 the header and the code file.
1084 In the code file, move the push parser declarations to the same place
1085 they appear in the header file.
1086 Clean up the M4 some, especially the inconsistent underquoting in
1087 some b4_c_function_def and b4_c_function_decl uses.
1088
1089 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1090
1091 Encapsulate the push parser state variables into an M4 macro so the
1092 push skeleton doesn't have to list them again for pull mode's yyparse.
1093 For push mode, remove yypush_parse's local equivalents of these
1094 variables to eliminate unnecessary copying between the two sets at
1095 run-time. This patch also fixes at least a bug related to multiple
1096 %initial-action invocations in push mode.
1097 * data/push.c (b4_declare_parser_variables): Rename to...
1098 (b4_declare_scanner_communication_variables): ... this for clarity and
1099 update both uses.
1100 (b4_declare_yyparse_variables): Remove and move its contents to the one
1101 spot where it was invoked.
1102 (b4_declare_parser_state_variables): New macro containing the parser
1103 state variables required by push mode.
1104 (struct yypstate): Replace all fields but yynew with
1105 b4_declare_parser_state_variables.
1106 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
1107 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
1108 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
1109 (yyparse or yypush_parse): For yyparse in pull mode, replace local
1110 parser state variable declarations with
1111 b4_declare_parser_state_variables.
1112 Don't initialize parser state variables when calling yypush_parse since
1113 yypstate_new already does that.
1114 Invoke the user's initial action only upon the first yypush_parse
1115 invocation.
1116 Remove all code that copies between the local parser state variables
1117 and the yypstate.
1118
1119 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1120
1121 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
1122 prevent a name collision in a future patch where these names will
1123 sometimes be #define'd.
1124 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
1125 since it no longer has the same name as the existing argument.
1126 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
1127
1128 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
1129 and Joel E. Denny <jdenny@ces.clemson.edu>
1130
1131 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1132 that the argument is case-insensitive, and there's no `=' here.
1133 For the %skeleton entry, mention that %language is better.
1134 (Bison Options): Likewise for --language and --skeleton. Move the
1135 --skeleton entry so that the `Tuning the parser' section is sorted
1136 alphabetically on long options.
1137 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
1138 %language directive in detail here; cross-reference the %language
1139 documentation instead.
1140 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
1141 `%require "2.3b"' so that the example is always up-to-date.
1142 (Table of Symbols): Add entries for %language and %skeleton.
1143 * examples/extexi (normalize): Instead of replacing every %require
1144 argument with the current Bison version, just substitute for
1145 `@value{VERSION}'. This guarantees that we're testing what actually
1146 appears in the documentation.
1147 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
1148 rather than `@VERSION@'.
1149
1150 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1151
1152 * NEWS: Reword the %language news a bit, and put it earlier.
1153
1154 * src/getargs.c (skeleton_arg): Last arg is now location const *.
1155 Rewrite to simplify the logic.
1156 (language_argmatch): Likewise.
1157 (program_name): We now own this var.
1158 * src/getargs.h (struct bison_language): Use char[] rather than
1159 const char *.
1160
1161 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
1162 Java is supported.
1163 * src/complain.c (program_name): Remove decl; no longer needed.
1164 * src/main.c (program_name): Remove; now belongs to getargs.
1165
1166 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
1167
1168 * NEWS: Document %language.
1169
1170 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
1171
1172 * data/c-skel.m4, data/c++-skel.m4: New files.
1173 * data/glr.c: Complain on push parsers.
1174
1175 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
1176 over %skeleton.
1177 (Decl Summary): Document %language and %skeleton.
1178 (Command line): Document -L.
1179
1180 * examples/extexi: Rewrite %require directive.
1181 * examples/calc++/Makefile.am: Pass VERSION to extexi.
1182
1183 * src/files.c (compute_exts_from_gc): Look in language structure
1184 for .y extension.
1185 (compute_file_name_parts): Check whether .tab should be added.
1186 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
1187 (language, skeleton_arg, language_argmatch): New.
1188 (long_options): Add --language.
1189 (getargs): Use skeleton_arg, add -L/--language.
1190 * src/getargs.h: Include location.h.
1191 (struct bison_language, language, skeleton_arg, language_argmatch): New.
1192 * src/output.c (prepare): Pick default skeleton from struct language.
1193 Don't dispatch C skeletons here.
1194 * src/parse-gram.y (PERCENT_LANGUAGE): New.
1195 (prologue_declaration): Add "%language" rule, use skeleton_arg.
1196 * src/scan-gram.l ("%language"): New rule.
1197
1198 * tests/calc.at: Test %skeleton and %language.
1199 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
1200 (AT_GLR_IF): Look for %skeleton "glr.cc".
1201 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
1202 (AT_YACC_IF): Reject %language.
1203
1204 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1205
1206 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
1207 since it wasn't used; only the typedef name 'semantic_type' is needed.
1208 Also, omit trailing white space.
1209
1210 * bootstrap: Sync from coreutils.
1211 (gnulib_extra_files): Add build-aux/announce.gen.
1212 (slurp): Adjust .gitignore files like .cvsignore files.
1213 * build-aux/announce-gen: Remove from CVS, since bootstrap
1214 now creates this.
1215
1216 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
1217
1218 Make %push-parser imply %pure-parser. This fixes several bugs; see
1219 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
1220 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
1221 pure_parser = true.
1222 * data/push.c: Don't bother testing b4_push_if when deciding whether
1223 to expand b4_declare_parser_variables globally.
1224 (yypush_parse): Likewise in here.
1225
1226 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
1227 (yy_reduce_print): Reformat M4 for readability.
1228
1229 2006-12-15 Bob Rossi <bob@brasko.net>
1230 and Joel Denny <jdenny@ces.clemson.edu>
1231
1232 * data/push.c (yypstate): Add typedef, and update all uses of
1233 struct yypstate to just yypstate.
1234 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
1235
1236 2006-12-14 Bob Rossi <bob@brasko.net>
1237
1238 * data/push.c (yypush_parse): Declare prototype regardless of
1239 %locations option.
1240
1241 2006-12-14 Bob Rossi <bob@brasko.net>
1242
1243 * data/push.c (yyparse): Remove the prototype and the #define when in
1244 push-parser mode.
1245
1246 2006-12-13 Bob Rossi <bob@brasko.net>
1247
1248 * data/push.c (yypstate_init): Rename to...
1249 (yypstate_new): ... this and use b4_c_function_def.
1250 (yypstate_delete): New.
1251 (yypush_parse): Change parameters yynval and yynlloc to be const.
1252 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
1253 yypstate_delete functions.
1254
1255 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
1256
1257 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
1258 strange test case titles. Reported by Bob Rossi.
1259
1260 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
1261
1262 * TODO: Add pointer to Sylvain Schmitz's work on static detection
1263 of potential ambiguities in GLR grammers.
1264
1265 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
1266
1267 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
1268 `bison ', use m4_index instead of m4_substr since chopping up a string
1269 containing M4-special characters causes problems here.
1270
1271 Fix a couple of bugs related to special characters in user-specified
1272 file names, and make it easier for skeletons to compute output file
1273 names with the same file name prefix as Bison-computed output file
1274 names.
1275 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
1276 b4_parser_file_name and b4_spec_defines_file instead of
1277 @output_parser_name@ and @output_header_name@, which are now redundant.
1278 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
1279 b4_parser_file_name, b4_spec_defines_file, and the new
1280 @basename(FILENAME@) instead of @output_parser_name@ and
1281 @output_header_name@, which inappropriately escaped the file names as
1282 C string literals.
1283 * src/files.c (all_but_ext): Remove static qualifier.
1284 (compute_output_file_names): Move `free (all_but_ext)' to...
1285 (output_file_names_free): ... here since all_but_ext is needed later.
1286 * src/files.h (all_but_ext): Extern.
1287 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
1288 exactly what MUSCLE_INSERT_STRING used to do.
1289 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
1290 characters are escaped properly.
1291 * src/output.c (prepare): Define muscle file_name_all_but_ext as
1292 all_but_ext.
1293 For pkgdatadir muscle, maintain previous functionality by using
1294 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
1295 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
1296 digraphs would never be expanded. Hopefully no one has M4-special
1297 characters in his Bison installation path.
1298 * src/scan-skel.l: Don't parse @output_header_name@ and
1299 @output_parser_name@ anymore since they're now redundant.
1300 In @output, use decode_at_digraphs.
1301 Parse a new @basename command that invokes last_component.
1302 (decode_at_digraphs): New.
1303 (BASE_QPUTS): Remove unused.
1304 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
1305 (Output file name): New tests.
1306
1307 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
1308
1309 Warn about output files that are generated by the skeletons and that
1310 conflict with other output files.
1311 * data/glr.c: Don't generate the header file here when glr.cc does.
1312 * src/files.c (file_names, file_names_count): New static globals.
1313 (compute_output_file_names): Invoke output_file_name_check for files
1314 not generated by the skeletons and remove existing checks.
1315 (output_file_name_check): New function that warns about conflicting
1316 output file names.
1317 (output_file_names_free): Free file_names.
1318 * src/files.h (output_file_name_check): Declare.
1319 * src/scan-skel.l: Invoke output_file_name_check for files generated by
1320 the skeletons.
1321 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
1322 (Conflicting output files): New tests.
1323
1324 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1325
1326 * doc/bison.texinfo: Fix a couple of typos.
1327
1328 2006-12-08 Bob Rossi <bob@brasko.net>
1329
1330 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
1331 Rename to...
1332 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
1333 update all uses.
1334 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
1335 (yypush_parse): Rename yypvars argument to yyps and remove redundant
1336 local pv.
1337 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
1338 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
1339
1340 2006-12-07 Bob Rossi <bob@brasko.net>
1341 and Joel Denny <jdenny@ces.clemson.edu>
1342
1343 * data/push.c (yypvarsinit): Change return type from void* to struct
1344 yypvars*. No longer cast to void* on return.
1345 (struct yypvars): Remove yylen since it need not be remembered between
1346 yypushparse invocations.
1347 (yypushparse): Don't copy between yylen and pv->yylen.
1348
1349 2006-12-05 Bob Rossi <bob@brasko.net>
1350
1351 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
1352 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
1353 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
1354 (struct yypvars): Remove b4_declare_parser_variables.
1355 (yypvarsinit): Remove init code for removed variables.
1356 (global scope): Do not declare b4_declare_parser_variables if
1357 push or pure mode.
1358 (yypushparse): Add b4_declare_parser_variables.
1359 Init new local variables, and remove init code for removed
1360 yypvars variables.
1361 (yyparse): Delete.
1362 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
1363 and yyparse for other modes.
1364 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
1365 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
1366 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
1367 (AT_PURE_LEX_IF): True if pure or push parser.
1368
1369 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
1370
1371 Document Yacc prologue alternatives and default %destructor's and
1372 %printer's as experimental. Don't mention Java yet. Discussed at
1373 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
1374 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
1375 (2.3a): Annotate this entry to say the old forms of these features were
1376 also experimental.
1377 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
1378 Table of Symbols): Say they're experimental. Comment out any mention
1379 of Java (we'll want this back eventually).
1380
1381 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1382
1383 Support a file name argument to %defines. Deprecate `=' in
1384 %file-prefix, %name-prefix, and %output. Discussed at
1385 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
1386 * NEWS (2.3a+): Mention.
1387 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
1388 form of %defines, and remove `=' from entries for %file-prefix,
1389 %name-prefix, and %output.
1390 * src/parse-gram.y (prologue_declaration): Implement.
1391 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
1392 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
1393 all but one occurrence of %name-prefix.
1394 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
1395 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
1396 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
1397 occurrence of each of %file-prefix and %output. Add check for %defines
1398 with argument.
1399 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
1400 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
1401 Remove the `=' from %output.
1402
1403 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
1404
1405 Don't escape $ in test case titles since Autoconf 2.61 now does that
1406 correctly.
1407 * tests/actions.at (Default %printer and %destructor are not for error
1408 or $undefined): Here.
1409 (Default %printer and %destructor are not for $accept): Here.
1410 * tests/input.at (Invalid $n and @n): Here.
1411
1412 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
1413
1414 Rename <!> to <>. Discussed starting at
1415 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
1416 * NEWS (2.3a+): Update.
1417 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
1418 Update.
1419 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
1420 * src/scan-gram.l (INITIAL): Implement.
1421 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
1422 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
1423 comment.
1424 * tests/actions.at (Default tagless %printer and %destructor,
1425 Default tagged and per-type %printer and %destructor,
1426 Default %printer and %destructor are not for error or $undefined,
1427 Default %printer and %destructor are not for $accept,
1428 Default %printer and %destructor for mid-rule values): Update.
1429 * tests/input.at (Default %printer and %destructor redeclared,
1430 Unused values with default %destructor): Update.
1431
1432 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1433
1434 Don't let %prec take a nonterminal.
1435 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
1436 token.
1437 * tests/input.at (%prec takes a token): New test checking that %prec
1438 won't take a nonterminal.
1439
1440 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1441
1442 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
1443 it was double-quoted.
1444 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
1445 grammar is maintained with Bison's highest standards.
1446 * src/getargs.c: Fix some typos in Doxygen comments.
1447
1448 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1449
1450 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
1451 later. Reported by Paul Eggert in
1452 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
1453 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
1454 * src/scan-code.l (translate_action): Don't bother invoking
1455 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
1456 (code_scanner_free): Instead of invoking
1457 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
1458 which frees more.
1459 * src/scan-gram.l (gram_scanner_free): Likewise.
1460 * src/scan-skel.l (scan_skel): Likewise.
1461
1462 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
1463
1464 * src/files.c (tr): Change return type to void.
1465 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
1466 has been called previously for the same key.
1467 (muscle_find): Return storage instead of value so that
1468 --enable-gcc-warnings doesn't produce warnings that the return discards
1469 const. aver that the value and storage are the same since storage
1470 could potentially be NULL when value is not.
1471 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
1472 same as 0.
1473
1474 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1475
1476 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
1477 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
1478 us a slightly cleaner distribution, and also works.
1479 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
1480 gnulib changes.
1481
1482 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
1483 and Paul Eggert <eggert@cs.ucla.edu>
1484
1485 Don't let Bison leak memory except when it complains.
1486 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
1487 (spec_defines_file, dir_prefix): Now char *, not const char *,
1488 since they are freed.
1489 * src/files.c: Likewise.
1490 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
1491 Likewise.
1492 (tr): Now operates in-place. All uses changed.
1493 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
1494 values.
1495 (compute_file_name_parts, compute_output_file_names): Don't store
1496 read-only data in variables that will be freed.
1497 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
1498 src_extension, and header_extension.
1499 (output_file_names_free): New public function to free
1500 spec_verbose_file, spec_graph_file, spec_defines_file,
1501 parser_file_name, and dir_prefix.
1502 * src/getargs.c (getargs): Don't store read-only data in variables that
1503 will be freed.
1504 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
1505 (which previously existed but was unused), and quotearg_free.
1506 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
1507 * src/muscle_tab.c: Likewise.
1508 (muscle_entry): Make the value char const *,
1509 and add a new storage member that is char * and can be freed.
1510 (muscle_entry_free): New private function.
1511 (muscle_init): Use it instead of free.
1512 (muscle_insert, muscle_grow): Update and use new storage member.
1513 (muscle_code_grow): Free the string passed to muscle_grow
1514 since it's not needed anymore.
1515 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
1516 add a new `char *code' member.
1517 ("{...}"): Declare semantic type as code.
1518 * src/scan-code.h (translate_rule_action):
1519 (translate_symbol_action, translate_code, translate_action): Return
1520 `char const *' rather than `char *' since external code should not free
1521 these strings.
1522 * src/scan-code.l: Likewise.
1523 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
1524 which is "{...}" in the parser.
1525 * tests/Makefile.am (maintainer-check-valgrind): Set
1526 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
1527 Valgrind.
1528 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
1529 complain.
1530 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
1531 expecting a non-zero exit status sets --leak-check=summary and
1532 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
1533 this case, and we don't want to hear about it.
1534
1535 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1536
1537 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
1538 instead of from the template, to simplify configuration a bit.
1539 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
1540 and m4/wint_t.m4, as they are needed with the latest gnulib.
1541
1542 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1543
1544 Disable unset/unused mid-rule value warnings by default, and recognize
1545 --warnings=midrule-values to enable them. Discussed starting at
1546 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
1547 * NEWS (2.3a+): Mention.
1548 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
1549 warnings): Add entry for midrule-values subargument.
1550 * src/reader.c (symbol_should_be_used): Don't return true just because
1551 the value is a set/used mid-rule value unless
1552 --warnings=midrule-values was specified.
1553 * tests/input.at (Unused values, Unused values before symbol
1554 declarations): Run tests with and without --warnings=midrule-values.
1555
1556 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
1557 than LIST_FREE directly.
1558
1559 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1560
1561 Finish implementing --warnings=error, which should not be implied by
1562 --warnings=all (or by its synonyms -W and --warnings without
1563 subarguments).
1564 * src/complain.c (set_warning_issued): New function to report that
1565 warnings are being treated as errors and to record an error if so.
1566 Invoke...
1567 (warn_at, warn): ... here.
1568 * src/getargs.c (warnings_args, warnings_types): Reorder so that
1569 "error - warnings are errors" does not appear above "all - all of the
1570 above".
1571 (getargs): For -W and --warnings without subarguments, don't let
1572 FLAGS_ARGMATCH set warnings_error in warnings_flag.
1573 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
1574
1575 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1576
1577 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
1578 empty subargument list. For example: `bison --warnings= parser.y'.
1579
1580 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1581
1582 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
1583 the parser header file so that gcc doesn't warn.
1584
1585 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1586
1587 Split the default %destructor/%printer into two kinds: <*> and <!>.
1588 Discussed starting at
1589 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
1590 * NEWS (2.3a+): Mention.
1591 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
1592 previous change today related to mid-rules.
1593 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
1594 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
1595 (TYPE_TAG_ANY): Add as <*>.
1596 (TYPE_TAG_NONE): Add as <!>.
1597 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
1598 for <*> and <!>.
1599 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
1600 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
1601 * src/symlist.c (symbol_list_default_new): Split into tagged and
1602 tagless versions.
1603 (symbol_list_destructor_set, symbol_list_printer_set): Split
1604 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
1605 SYMLIST_DEFAULT_TAGLESS.
1606 * src/symlist.h: Update symbol_list_default*_new prototypes.
1607 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
1608 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
1609 * src/symtab.c (default_destructor, default_destructor_location,
1610 default_printer, default_printer_location): Split each into tagged and
1611 tagless versions.
1612 (symbol_destructor_get, symbol_destructor_location_get,
1613 symbol_printer_get, symbol_printer_location_get): Implement tagged
1614 default and tagless default cases.
1615 (default_destructor_set, default_printer_set): Split each into tagged
1616 and tagless versions.
1617 * src/symtab.h: Update prototypes.
1618 * tests/actions.at (Default %printer and %destructor): Rename to...
1619 (Default tagless %printer and %destructor): ... this, and extend.
1620 (Per-type %printer and %destructor): Rename to...
1621 (Default tagged and per-type %printer and %destructor): ... this, and
1622 extend.
1623 (Default %printer and %destructor for user-defined end token): Extend.
1624 (Default %printer and %destructor are not for error or $undefined):
1625 Update.
1626 (Default %printer and %destructor are not for $accept): Update.
1627 (Default %printer and %destructor for mid-rule values): Extend.
1628 * tests/input.at (Default %printer and %destructor redeclared): Extend.
1629 (Unused values with default %destructor): Extend.
1630
1631 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1632
1633 Don't apply the default %destructor/%printer to an unreferenced midrule
1634 value. Mentioned at
1635 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
1636 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
1637 like $@n instead of just @n so that the default %destructor/%printer
1638 logic doesn't see them as user-defined symbols.
1639 (symbol_is_dummy): Check for both forms of the name.
1640 * src/reader.c (packgram): Remove the `$' from each midrule symbol
1641 name for which the midrule value is referenced in any action.
1642 * tests/actions.at (Default %printer and %destructor for mid-rule
1643 values): New test.
1644 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
1645 for change to dummy symbol names.
1646
1647 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1648
1649 Warn about unset midrule $$ if the corresponding $n is used.
1650 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
1651 $n usage.
1652 (packgram): Before invoking grammar_rule_check on any rule, make sure
1653 all actions have already been scanned in order to set `used' flags.
1654 Otherwise, checking that a midrule's $$ is set will not always work
1655 properly because the midrule check must forward-reference the midrule's
1656 parent rule.
1657 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
1658 warning.
1659
1660 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1661
1662 More improvements to the documentation of the prologue alternatives:
1663 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
1664 Bison manual.
1665 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
1666 some text to clarify the relative importance of the new directives and
1667 to show how these directives may be viewed as code labels.
1668
1669 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
1670
1671 Similar to the recently removed %before-header, add %code-top as the
1672 alternative to the pre-prologue. Mentioned at
1673 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
1674 Also, let the prologue alternatives appear in the grammar section.
1675 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
1676 (prologue_declaration): Move the existing prologue alternatives to...
1677 (grammar_declaration): ... here and add %code-top.
1678 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
1679
1680 Clean up and extend documentation for the prologue alternatives.
1681 * NEWS (2.3a+): Describe prologue alternatives.
1682 * doc/bison.texinfo (Prologue): Move discussion of prologue
1683 alternatives to...
1684 (Prologue Alternatives): ... this new section, and extend it to discuss
1685 all 4 directives in detail.
1686 (Table of Symbols): Clean up discussion of prologue alternatives and
1687 add %code-top.
1688
1689 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1690
1691 DJGPP specific issues.
1692
1693 * djgpp/config.bat: config.hin has been moved to lib. Adjust
1694 config.bat accordingly.
1695 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
1696 * djgpp/config.site: Likewise.
1697
1698 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
1699
1700 Replace %*-header with %provides, %requires, %code. See discussion at
1701 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
1702
1703 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
1704 (b4_user_start_header): Remove.
1705 * data/glr.c: Use new macros instead of b4_*start_header
1706 and b4_*end_header.
1707 * data/glr.cc: Likewise.
1708 * data/lalr1.cc: Likewise.
1709 * data/push.c: Likewise.
1710 * data/yacc.c: Likewise.
1711
1712 * doc/bison.texinfo: Remove %before-header, rename
1713 %{start,end,after}-header to %requires, %provides, %code.
1714
1715 * src/parse-gram.y: Likewise (also rename token names accordingly).
1716 * src/scan-gram.l: Likewise.
1717 * tests/actions.at: Likewise.
1718
1719 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
1720
1721 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
1722 Problem reported by Joel E. Denny.
1723
1724 2006-10-14 Jim Meyering <jim@meyering.net>
1725
1726 (Sync from coreutils.)
1727 Work also when the working directory (with e.g. coreutils sources)
1728 is version controlled with git, rather than CVS.
1729 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
1730 rather than CVS.
1731 In messages and comments, say e.g., "checked-out sources",
1732 rather than "CVS sources".
1733 (version_controlled_file): New function. Work for git as well as
1734 for CVS. Don't use grep's -q option.
1735 (slurp): Call it here, in place of CVS-specific code.
1736
1737 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
1738
1739 Fix testsuite for ./configure --enable-gcc-warnings:
1740 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
1741 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
1742 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
1743 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
1744 * test/regression.at (Diagnostic that expects two alternatives):
1745 Likewise.
1746
1747 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1748
1749 * bootstrap.conf (gnulib_modules): Add config-h.
1750 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
1751 worry about HAVE_CONFIG_H.
1752 * lib/abitset.c: Likewise.
1753 * lib/bitset.c: Likewise.
1754 * lib/bitset_stats.c: Likewise.
1755 * lib/bitsetv-print.c: Likewise.
1756 * lib/bitsetv.c: Likewise.
1757 * lib/ebitset.c: Likewise.
1758 * lib/get-errno.c: Likewise.
1759 * lib/lbitset.c: Likewise.
1760 * lib/subpipe.c: Likewise.
1761 * lib/timevar.c: Likewise.
1762 * lib/vbitset.c: Likewise.
1763 * lib/bitset.c: Include "bitset.h" first, to test interface.
1764 * lib/bitset_stats.c: Include "bitset_stats.h" first.
1765 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
1766 * lib/bitsetv.c: Include "bitsetv.h" first.
1767 * lib/get-errno.c: Include "get-errno.h" first.
1768 * m4/.cvsignore: Add config-h.m4.
1769 * tests/actions.at (Default %printer and %destructor for ...):
1770 Adjust expected line numbers in output to reflect removal of #if
1771 HAVE_CONFIG_H lines.
1772 * tests/glr-regression.at (Missed %merge type warnings when ...):
1773 Likewise.
1774 * tests/regression.at (Braced code in declaration in rules section):
1775 Likewise.
1776 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
1777 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
1778 Include <config.h> unconditionally.
1779
1780 * bootstrap: Sync from coreutils, as follows:
1781
1782 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1783
1784 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
1785 variable was sometimes used without being initialized. This
1786 messed up the installation of the INSTALL file in some cases.
1787
1788 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1789
1790 * bootstrap (usage, main program, symlink_to_gnulib): Add option
1791 --copy. Inspired by a suggestion from Bruno Haible.
1792
1793 2006-10-03 Jim Meyering <jim@meyering.net>
1794
1795 * bootstrap: Undo last change to this file, since now gnulib-tool
1796 sticks with the automake default in generating dependencies.
1797
1798 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1799
1800 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
1801 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
1802
1803 * doc/bison.1: Add copyright notice.
1804
1805 * data/glr.c: Don't include <stdarg.h>; not used.
1806
1807 * NEWS: The -g and --graph options now output graphs in Graphviz
1808 DOT format, not VCG format.
1809 * doc/bison.1: Likewise.
1810 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
1811 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
1812 of this change in
1813 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
1814 * TODO: Remove Graphviz entry.
1815 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
1816 remove vcg.c, vcg.h, vcg_defaults.h.
1817 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
1818 * src/graphviz.c, src/graphviz.h: New files.
1819 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
1820 * src/files.h: Make comment more generic.
1821 * src/main.c (main): Likewise.
1822 * src/print_graph.h: Likewise.
1823 * src/getargs.c (usage): Make usage description more generic.
1824 * src/print_graph.c: Include graphviz.h rather than vcg.h.
1825 (static_graph, fgraph): Remove. All uses changed to pass
1826 arguments instead of sharing a static var.
1827 (print_core, print_actions, print_state, print_graph):
1828 Output graphviz format rather than VCG format.
1829 * tests/.cvsignore: Remove *.vcg; add *.dot.
1830 * tests/output.at: Expect *.dot files, not *.vcg files.
1831
1832 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
1833 accommodates the 2006-10-08 change.
1834
1835 2006-10-11 Bob Rossi <bob@brasko.net>
1836
1837 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
1838 (b4_yyssa, b4_yyerror_range): New macros.
1839 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
1840 (yypvarsinit): Remove init of removed fields.
1841 (yypushparse): Remove use of removed fields; use new macros instead.
1842
1843 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1844
1845 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
1846 in a push parser. Reindent slightly to match yacc.c better.
1847
1848 2006-10-11 Bob Rossi <bob@brasko.net>
1849
1850 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
1851 yymsg_alloc fields.
1852 (yypvarsinit, yypushparse): Remove init of removed fields.
1853 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
1854
1855 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1856
1857 * THANKS: Add Paolo Bonzini and Bob Rossi.
1858
1859 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
1860
1861 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
1862 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
1863 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
1864 b4_define_user_cde and uses): Remove.
1865 (b4_comment, b4_prefix, b4_sync_start): New.
1866 * data/bison.m4: New file, with most of the content removed from c.m4.
1867 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
1868 * src/output.c (output_skeleton): Pass bison.m4.
1869 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
1870 only if specified.
1871
1872 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
1873
1874 Fix test failure reported by Tom Lane in
1875 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
1876 and try to make such failures easier to catch in the future.
1877 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
1878 that's now the caller's responsibility.
1879 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
1880 Set yychar = YYEOF if it's negative.
1881 * tests/actions.at (yylex): Abort if asked to read past EOF.
1882 * tests/conflicts.at (yylex): Likewise.
1883 * tests/cxx-type.at (yylex): Likewise.
1884 * tests/glr-regression.at (yylex): Likewise.
1885 * tests/input.at (yylex): Likewise.
1886 * tests/regression.at (yylex): Likewise.
1887 * tests/torture.at (yylex): Likewise.
1888
1889 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
1890
1891 Fix problems with translating English-language diagnostics.
1892 * bootstrap: Fix bug introduced in recent bootstrap changes, with
1893 respect to bison-runtime pot generation. The YY_ stuff
1894 wasn't being captured.
1895 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
1896 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
1897 * runtime-po/POTFILES.in: Add data/push.c.
1898
1899 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
1900
1901 Merge bootstrap changes from coreutils.
1902
1903 2006-09-28 Jim Meyering <jim@meyering.net>
1904
1905 Automatically generated dependencies are important even
1906 when all of the sources in a directory come from gnulib.
1907 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
1908 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
1909
1910 2006-09-23 Jim Meyering <jim@meyering.net>
1911
1912 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
1913
1914 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1915
1916 * bootstrap: Add support for --force.
1917 (usage): New function. Describe usage less tersely.
1918 (CVS_only_file): New var.
1919
1920 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
1921
1922 * data/push.c (YYPUSH_MORE): Make it an enum instead.
1923 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
1924 Adjust white space and comments to match GNU style better.
1925
1926 2006-09-20 Bob Rossi <bob@brasko.net>
1927
1928 * data/push.c (yyresult_get): Remove function.
1929 (YYPUSH_MORE): Add #define.
1930 (yypushparse): Modify return value.
1931
1932 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1933
1934 * stamp-h.in: Remove; no longer needed.
1935 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
1936 Remove config.h, config.hin, intl (no longer created).
1937 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
1938 stamp-h1.
1939
1940 Sync bootstrap from coreutils, as follows:
1941
1942 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
1943
1944 * bootstrap (symlink_to_gnulib): New function.
1945 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
1946 to copies-of-gnulib.
1947 (cp_mark_as_generated, slurp, gnulib_files):
1948 Avoid making a copy if it's the same as the old version.
1949 (gnulib_files): Add support for this variable (used by Bison).
1950
1951 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1952
1953 * src/getargs.c (usage): Rework to use conventions similar to
1954 coreutils, to make translation a bit easier and the code a bit
1955 smaller. Problem reported by Tim Van Holder.
1956
1957 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
1958
1959 Use some of gnulib's new modules, taken from coreutils.
1960
1961 * bootstrap: Sync from coreutils, except add support for gnulib_files.
1962 * bootstrap.conf: New file.
1963 (gnulib_modules): Add configmake, inttypes, unistd.
1964 (XGETTEXT_OPTIONS): Add complain, complain_at,
1965 fatal, fatal_at, warn, warn_at, unexpected_end.
1966 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
1967 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
1968 (gl_EARLY): Add.
1969 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
1970 (gl_INIT): Add
1971 (GNULIB_AUTOCONF_SNIPPET): Remove.
1972 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
1973 the pickiest.
1974 * lib/.cvsignore: Add inttypes_.h.
1975 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
1976 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
1977 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
1978 no-longer-necessary initializations.
1979 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
1980 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
1981 use the unistd module.
1982 * src/system.h: Likewise.
1983 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
1984 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
1985 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
1986 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
1987 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
1988 * src/system.h: Include inttypes.h unconditionally, now that we
1989 use the inttypes module. Don't bother to include stdint.h, since
1990 inttypes.h now does that for us.
1991 (LOCALEDIR): Remove, now that we use the configmake module.
1992 * src/getargs.c: Include configmake.h.
1993 * src/main.c: Likewise.
1994 * src/output.c: Likewise.
1995 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
1996 not from $abs_top_builddir, since config.h moved.
1997
1998
1999 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
2000 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
2001
2002 * src/parse-gram.y (symbol_declaration): Don't put statements
2003 before declarations; it's not portable to C89.
2004 * src/scan-code.l (handle_action_at): Likewise.
2005
2006 * src/scan-code.l: Always initialize braces_level; the old code
2007 left it uninitialized and therefore had undefined behavior.
2008
2009 Don't attempt to redefine 'assert', since it runs afoul of
2010 systems where standard headers (mistakenly) include <assert.h>.
2011 Instead, define and use our own alternative, called 'aver'.
2012 * src/reader.c: Don't include assert.h, since we no longer
2013 use assert.
2014 * src/scan-code.l: Likewise.
2015 * src/system.h (assert): Remove, replacing with....
2016 (aver): New function, taking a bool arg. All uses changed.
2017 * src/tables.c (pack_vector): Ensure that aver arg is bool,
2018 not merely an integer.
2019
2020 2006-09-15 Bob Rossi <bob@brasko.net>
2021
2022 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
2023 * data/c.m4 (YYPUSH): New.
2024 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
2025 * src/getargs.c (push_parser): New var.
2026 * src/getargs.h (push_parser): New declaration.
2027 * src/output.c (prepare): Add macro insertion of `push_flag'.
2028 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
2029 (prologue_declaration): Parse %push-parser.
2030 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
2031 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
2032 list of removed lines from the traces observed.
2033 (AT_CHECK_CALC_LALR): Added push parser tests.
2034
2035 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
2036
2037 * NEWS: Version 2.3a.
2038 * configure.ac (AC_INIT): Likewise.
2039
2040 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
2041 "#define YYSTYPE int" that caused "make maintainer-check" to fail
2042 due to header ordering dependencies. I don't know why the #define
2043 was there.
2044
2045 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
2046 runtime cost when YYDEBUG is not defined, and so that some tests
2047 that used to fail now work. Problem and initial suggestion by
2048 Paolo Bonzini.
2049 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
2050 * data/glr.cc (b4_parser_class_name):
2051 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
2052 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
2053 (yydebug_) [YYDEBUG]: New member.
2054 (yycdebug_): Now defined only if YYDEBUG.
2055 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
2056 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
2057 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
2058 if YYYDEBUG.
2059 (debug_stream, set_debug_stream, debug_level, set_debug_level):
2060 Define only if YYDEBUG.
2061 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
2062 set_debug_level.
2063 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
2064 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
2065 AT_CHECK_CALC_GLR_CC that are working now.
2066
2067 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
2068
2069 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
2070 We don't need them in glr.cc, and glr.c defines them.
2071 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
2072 assumes that defining it to anything is the same as defining
2073 it to 1. Problem reported by Paolo Bonzini.
2074
2075 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2076
2077 * data/c.m4 (b4_null, b4_case): Define.
2078 * src/output.c (prepare_symbols): Use b4_null.
2079 (user_actions_output): Use b4_case.
2080
2081 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
2082
2083 * data/glr.c (b4_shared_declarations): Put start-header first,
2084 before any #includes that we generate, so that feature-test
2085 macros work. Problem reported by Michael Deutschmann in
2086 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
2087 * data/lalr1.cc: Likewise.
2088 * doc/bison.texinfo (Prologue): Document that feature-test macros
2089 should be defined before any Bison declarations.
2090 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
2091 that depend on location.hh after, not before, Bison decls, since
2092 we now include location.hh after the first user prologue.
2093
2094 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
2095 Sander Brandenburg in
2096 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
2097 Also, fix minor white space and comment issues.
2098 (Prologue): Mention that it's better to define feature-test macros
2099 before Bison declarations. Problem reported by Michael Deutschmann.
2100
2101 * README-cvs: Fix typo: "&" should be "&&". Problem reported
2102 by Jim Meyering.
2103 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
2104 This adjusts to recent gnulib changes.
2105
2106 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2107
2108 Finish implementation of per-type %destructor/%printer. Discussed
2109 starting at
2110 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
2111 and
2112 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
2113 * NEWS (2.3+): Add a description of this feature to the default
2114 %destructor/%printer description.
2115 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
2116 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2117 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
2118 list node contains a semantic type.
2119 * src/symtab.c, src/symtab.h: Extend with a table that associates
2120 semantic types with their %destructor's and %printer's.
2121 (semantic_type_from_uniqstr, semantic_type_get,
2122 semantic_type_destructor_set, semantic_type_printer_set): New functions
2123 composing the public interface of that table.
2124 (symbol_destructor_get, symbol_destructor_location_get,
2125 symbol_printer_get, symbol_printer_location_get): If there's no
2126 per-symbol %destructor/%printer, look up the per-type before trying
2127 the default.
2128 * tests/actions.at (Per-type %printer and %destructor): New test case.
2129 * tests/input.at (Default %printer and %destructor redeclared):
2130 Extend to check that multiple occurrences of %symbol-default in a
2131 single %destructor/%printer declaration is an error.
2132 (Per-type %printer and %destructor redeclared, Unused values with
2133 per-type %destructor): New test cases.
2134
2135 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2136
2137 Require default %destructor/%printer to be declared using
2138 %symbol-default instead of an empty symbol list, and start working on
2139 new per-type %destructor/%printer. Discussed at
2140 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
2141 * NEWS (2.3+): Add %symbol-default to example.
2142 * bison.texinfo (Freeing Discarded Symbols): Likewise.
2143 (Table of Symbols): Add entry for %symbol-default.
2144 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
2145 (generic_symlist, generic_symlist_item): New nonterminals for creating
2146 a list in which each item is a symbol, semantic type, or
2147 %symbol-default.
2148 (grammar_declaration): Use generic_symlist in %destructor and %printer
2149 declarations instead of symbols.1 or an empty list.
2150 (symbol_declaration, precedence_declaration, symbols.1): Update actions
2151 for changes to symbol_list.
2152 * src/reader.c: Update for changes to symbol_list.
2153 * src/scan-code.l: Likewise.
2154 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
2155 * src/symlist.c, src/symlist.h: Extend such that a list node may
2156 represent a semantic type or a %symbol-default in addition to just an
2157 ordinary symbol. Add switched functions for setting %destructor's and
2158 %printer's.
2159 * tests/actions.at, tests/input.at: Add %symbol-default to all default
2160 %destructor/%printer declarations.
2161
2162 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
2163
2164 Whether the default %destructor/%printer applies to a particular symbol
2165 isn't a question of whether the user *declares* that symbol (in %token,
2166 for example). It's a question of whether the user by any means
2167 *defines* the symbol at all (by simply using a char token, for
2168 example). $end is defined by Bison whereas any other token with token
2169 number 0 is defined by the user. The error token is always defined by
2170 Bison regardless of whether the user declares it with %token, but we
2171 may one day let the user define error as a nonterminal instead.
2172 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
2173 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
2174 the meaning of "user-defined".
2175 * tests/actions.at (Default %printer and %destructor for user-declared
2176 end token): Rename to...
2177 (Default %printer and %destructor for user-defined end token): ...
2178 this.
2179
2180 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
2181 computation of whether to apply the default, don't maintain a list of
2182 every Bison-defined symbol. Instead, just check for a first character
2183 of '$', which a user symbol cannot have, and check for the error token.
2184
2185 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
2186
2187 Don't apply the default %destructor or %printer to the error token,
2188 $undefined, or $accept. This change fits the general rule that the
2189 default %destructor and %printer are only for user-declared symbols,
2190 and it solves several difficulties that are described in the new test
2191 cases listed below.
2192 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
2193 * tests/actions.at (Default %printer and %destructor are not for error
2194 or $undefined, Default %printer and %destructor are not for $accept):
2195 New test cases.
2196
2197 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
2198
2199 Allow %start after the first rule.
2200 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
2201 when parsing the first rule.
2202 (check_and_convert_grammar): Search for it here after all grammar
2203 declarations have been parsed. Skip midrules, which have dummy LHS
2204 nonterminals.
2205 * src/symtab.c (symbol_is_dummy): New function.
2206 * src/symtab.h (symbol_is_dummy): Declare it.
2207 * tests/input.at (%start after first rule): New test.
2208
2209 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2210
2211 Redo some of the previous commit: add back the ability to use
2212 non-aliased/undeclared string literals since it might be useful to
2213 those declaring %token-table.
2214 * src/reader.c (check_and_convert_grammar): Undo changes in previous
2215 commit: don't worry about complaints from symbols_pack.
2216 * src/symtab.c (symbol_new, symbol_class_set,
2217 symbol_check_alias_consistency): Undo changes in previous commit: count
2218 each string literal as a new symbol and token, assign it a symbol
2219 number, and don't complain about non-aliased string literals.
2220 (symbols_pack): Since symbol_make_alias still does not decrement symbol
2221 and token counts but does still set aliased tokens to the same number,
2222 symbol_pack_processor now leaves empty slots in the symbols array.
2223 Remove those slots.
2224 * tests/regression.at (Undeclared string literal): Remove test case
2225 added in previous commit since non-aliased string literals are allowed
2226 again.
2227 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
2228 remove unnecessary string literal declarations.
2229 * tests/sets.at (Firsts): Likewise.
2230
2231 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2232
2233 Don't allow an undeclared string literal, but allow a string literal to
2234 be used before its declaration.
2235 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
2236 symbols_pack complained.
2237 * src/symtab.c (symbol_new): Don't count a string literal as a new
2238 symbol.
2239 (symbol_class_set): Don't count a string literal as a new token, and
2240 don't assign it a symbol number since symbol_make_alias does that.
2241 (symbol_make_alias): It's not necessary to decrement the symbol and
2242 token counts anymore. Don't assume that an alias declaration occurs
2243 before any uses of the identifier or string, and thus don't assert that
2244 one of them has the highest symbol number so far.
2245 (symbol_check_alias_consistency): Complain if there's a string literal
2246 that wasn't declared as an alias.
2247 (symbols_pack): Bail if symbol_check_alias_consistency failed since
2248 symbol_pack asserts that every token has been assigned a symbol number
2249 although undeclared string literals have not.
2250 * tests/regression.at (String alias declared after use, Undeclared
2251 string literal): New test cases.
2252 (Characters Escapes, Web2c Actions): Declare string literals as
2253 aliases.
2254 * tests/sets.at (Firsts): Likewise.
2255
2256 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
2257
2258 In the grammar scanner, STRING_FINISH unclosed constructs and return
2259 them to the parser in order to improve error messages.
2260 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
2261 SC_BRACED_CODE, SC_PROLOGUE): Implement.
2262 * tests/input.at (Unclosed constructs): New test case.
2263 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
2264 seen.
2265
2266 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
2267 unused global.
2268
2269 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
2270
2271 Handle string aliases for character tokens correctly.
2272 * src/symtab.c (symbol_user_token_number_set): If the token has an
2273 alias, check and set its alias's user token number instead of its own,
2274 which is set to indicate the alias. Previously, every occurrence of
2275 the character token in the grammar overwrote that alias indicator with
2276 the character code.
2277 * tests/input.at (String aliases for character tokens): New test.
2278
2279 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
2280
2281 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
2282
2283 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
2284
2285 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
2286 to prevent failures when building on older platforms.
2287 Check for autopoint failure.
2288 Set XGETTEXT_OPTIONS to values that check for C format strings,
2289 so that translators are warned about them (this also helps
2290 prevent core dumps).
2291
2292 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
2293 function, since it simplifies our code a bit.
2294
2295 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
2296 rather than -W, so we don't get bogus warnings about sign comparisons.
2297 Add -Wpointer-arith, since that warning is useful (it reports code
2298 that does not conform to C89 and that some compilers reject).
2299 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
2300 since it's no longer needed.
2301
2302 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
2303
2304 Clean up scanners a bit.
2305 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
2306 definitions so gcc won't warn when obstack_for_string is unused.
2307 * src/scan-code.l: config.h and system.h are already #include'd by
2308 scan-code-c.c, so get rid of them here.
2309 * src/scan-gram.l: Likewise.
2310 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
2311 definitions rather than duplicating the rest of it.
2312 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
2313
2314 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
2315
2316 Suppress signed/unsigned comparison warnings for yycheck.
2317 * data/c.m4 (b4_safest_int_type): New macro.
2318 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
2319 a signed int type, cast it to b4_safest_int_type first.
2320 * data/yacc.c: Likewise.
2321 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
2322 also overwritten.
2323
2324 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2325
2326 * doc/bison.texinfo: Fix some typos.
2327
2328 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
2329
2330 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
2331 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
2332
2333 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
2334 the latest gnulib does this a different way.
2335 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
2336 translation was patched, so stop omitting it.
2337
2338 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2339
2340 Enable declaration of default %printer/%destructor. Make the parser
2341 use these for all user-declared grammar symbols for which the user does
2342 not declare a specific %printer/%destructor. Thus, the parser uses it
2343 for token 0 if the user declares it but not if Bison generates it as
2344 $end. Discussed starting at
2345 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
2346 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
2347 and
2348 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
2349 * NEWS (2.3+): Mention.
2350 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
2351 declare a %destructor for a mid-rule's semantic value. It's just
2352 impossible to declare one specific to it.
2353 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
2354 code. Describe default %destructor form.
2355 * src/parse-gram.y (grammar_declaration): Parse default
2356 %printer/%destructor declarations.
2357 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
2358 and symbol_destructor_location_get rather than accessing the destructor
2359 and destructor_location members of struct symbol.
2360 (symbol_printers_output): Likewise but for %printer's.
2361 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
2362 again.
2363 * src/symtab.c (default_destructor, default_destructor_location,
2364 default_printer, default_printer_location): New static global
2365 variables to record the default %destructor and %printer.
2366 (symbol_destructor_get, symbol_destructor_location_get,
2367 symbol_printer_get, symbol_printer_location_get): New functions to
2368 compute the appropriate %destructor and %printer for a symbol.
2369 (default_destructor_set, default_printer_set): New functions to set the
2370 default %destructor and %printer.
2371 * src/symtab.h: Prototype all those new functions.
2372 * tests/actions.at (Default %printer and %destructor): New test to
2373 check that the right %printer and %destructor are called, that they're
2374 not called for $end, and that $$ and @$ work correctly.
2375 (Default %printer and %destructor for user-declared end token): New
2376 test to check that the default %printer and %destructor are called for
2377 a user-declared end token.
2378 * tests/input.at (Default %printer and %destructor redeclared, Unused
2379 values with default %destructor): New tests to check related grammar
2380 warnings and errors.
2381
2382 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2383
2384 Clean up handling of %destructor for the end token (token 0).
2385 Discussed starting at
2386 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
2387 and
2388 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
2389
2390 Make the skeletons consistent in how they pop the end token and invoke
2391 its %destructor.
2392 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
2393 state, which has token number 0, since this would invoke the
2394 %destructor for the end token.
2395 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
2396 until after shifting the end token, or else it won't be popped.
2397 * data/yacc.c (yyparse): Likewise.
2398
2399 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
2400 it's the end token. Upon termination, destroy an unshifted lookahead
2401 even when it's the end token.
2402 * data/lalr1.cc (yy::parser::parse): Likewise.
2403 * data/yacc.c (yyparse): Likewise.
2404
2405 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
2406 value warnings for the end token when the user gives the end token a
2407 %destructor.
2408
2409 * tests/actions.at (Printers and Destructors): Test all the above.
2410
2411 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
2412
2413 Update to latest gnulib and gettext versions.
2414 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
2415 Add fopen-safer.
2416 (gnulib_files): Add m4/warning.m4. Don't worry about files
2417 overwritten by autopoint.
2418 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
2419 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
2420 rejects them.
2421 Don't use autoreconf; instead, invoke autopoint etc. by hand,
2422 so that we can remove the intl files at a better time.
2423 (intl_files_to_remove): Remove aclocal.m4, since it gets
2424 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
2425 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
2426 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
2427 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
2428 Remove datarootdir hack; no longer needed.
2429 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
2430 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
2431 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
2432 strdup.h.
2433 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
2434 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
2435
2436 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
2437
2438 * bootstrap: Adjust to today's change to gnulib-tool by invoking
2439 it with --assume-autoconf='latest-stable'.
2440
2441 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
2442
2443 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
2444 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
2445 YYSTYPE' and `{'.
2446 * src/muscle_tab.h (muscle_grow): Replace the header comments with
2447 those from muscle_tab.c since the old ones are misleading.
2448
2449 2006-07-13 Akim Demaille <akim@epita.fr>
2450
2451 Support %define "KEY" {VALUE}.
2452 * src/scan-code.h, src/scan-code.l (translate_action)
2453 (translate_rule_action, translate_symbol_action, translate_code):
2454 Return char *, not const char *.
2455 * src/parse-gram.y (declaration): Rename as...
2456 (prologue_declaration): this.
2457 (string_content): Remove this nonterminal, use STRING.
2458 (braceless, content, content.opt): New nonterminal.
2459 Use them.
2460 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
2461 as value.
2462 * src/scan-gram.l (getargs.h): Don't include it.
2463
2464 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
2465
2466 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
2467 rather than a for-loop that declares a local bool variable. This
2468 should work around a compatibility problem with a Cray x1e C++
2469 compiler reported by Hung Nguyen in
2470 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
2471 The for-loop was introduced in the 2004-11-17 change but I don't
2472 know why it was needed.
2473
2474 2006-07-12 Akim Demaille <akim@epita.fr>
2475
2476 * data/c.m4: Comment changes.
2477
2478 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
2479
2480 * src/complain.c (error_message, ERROR_MESSAGE): New.
2481 To factor...
2482 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
2483 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
2484
2485 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2486
2487 * NEWS: Instead of %union, you can define and use your own union type
2488 YYSTYPE if your grammar contains at least one <type> tag.
2489 Your YYSTYPE need not be a macro; it can be a typedef.
2490 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
2491 (Union Decl, Decl Summary): Document this.
2492 * data/glr.c (YYSTYPE): Implement this.
2493 * data/glr.cc (YYSTYPE): Likewise.
2494 * data/lalr1.cc (YYSTYPE): Likewise.
2495 * data/yacc.c (YYSTYPE): Likewise.
2496 * src/output.c (prepare): Output tag_seen_flag.
2497 * src/parse-gram.y (declaration, grammar_declaration):
2498 Use 'union_seen' rather than 'typed' to determine whether
2499 %union has been seen, since grammars can now be typed without
2500 %union.
2501 (symbol_declaration, type.opt, symbol_def):
2502 Keep track of whether a tag has been seen.
2503 * src/reader.c (union_seen, tag_seen): New vars.
2504 (typed): remove.
2505 * src/reader.h (union_seen, tag_seen, typed): Likewise.
2506 * src/scan-code.l (untyped_var_seen): New variable.
2507 (handle_action_dollar): Adjust to above changes.
2508 (handle_action_dollar, handle_action_at):
2509 Improve overflow checking for outlandish numbers.
2510 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
2511 avoid new diagnostics generated by above changes.
2512 * tests/regression.at (YYSTYPE typedef): Add test to check
2513 for type tags without %union.
2514
2515 * src/symlist.c (symbol_list_length): Return int, not unsigned
2516 int, since callers expect int. This may need to get revisited
2517 once we have proper integer overflow checking.
2518
2519 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
2520 object is now static.
2521
2522 * src/getargs.c (flags_argmatch): Return void, not int,
2523 to pacify ./configure --enable-gcc-warnings.
2524
2525 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
2526 since last_string is already defined to FLEX_PREFIX (last_string).
2527
2528 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
2529
2530 Implement --warnings/-W.
2531 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
2532 replaced by...
2533 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
2534 Adjust callers.
2535 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
2536 (warnings_args, warnings_types): New.
2537 (getargs, short_options, long_options): Accept -W/--warnings.
2538 Sort the options by alphabetical order, upper case letter right
2539 before its lower case.
2540
2541 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2542
2543 Change %merge result type clash warnings to errors. Discussed at
2544 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
2545 * src/reader.c (record_merge_function_type): Use complain_at.
2546 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2547 declared later): Update test case results.
2548
2549 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
2550
2551 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
2552 to be in alphabetical order.
2553 (trace_args): Spelling fixes.
2554
2555 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2556
2557 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
2558 so they don't collide with user-defined macros.
2559 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
2560 this was never guaranteed, and now that we're using gnulib stdint,
2561 which defines int_fast16_t to long int, the problem is exposed.
2562
2563 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
2564
2565 * data/c.m4 (b4_basename): Simplify a bit, since we don't
2566 need the full POSIX semantics (and weren't implementing them
2567 anyway).
2568
2569 Adjust to Autoconf 2.60 and today's gnulib.
2570 * bootstrap (gnulib_modules): Add stdint.
2571 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
2572 no longer copies it.
2573 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
2574 since stdint needs the former and wcwidth (which is now required
2575 by mbswidth) needs the latter.
2576 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
2577 work around a compatibility glitch between gettext 0.14.6 and
2578 Autoconf 2.60.
2579 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
2580 Do not check for uintptr_t, since new stdint module does the right
2581 thing.
2582 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
2583 Add stdint.h, stdint_.h, wcwidth.h.
2584 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
2585 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
2586 stdint.m4, wchar_t.m4, wcwidth.m4.
2587 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
2588 usual order for ../lib/*.h files.
2589 (file_name_split): Use last_component, not base_name, to adjust
2590 to gnulib changes.
2591 * src/parse-gram.h: Include <strverscmp.h> in the usual order
2592 for ../lib/*.h files.
2593 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
2594 Define unconditionally, since we now assume the stdint module.
2595 * src/scan-skel.l: Include <dirname.h>.
2596 (BASE_QPUTS): Use last_component, not base_name.
2597 * src/system.h: Include <unlocked-io.h> in the usual order
2598 for ../lib/*.h files. Include <stdint.h> unconditionally,
2599 since we now use the stdint module.
2600 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
2601 HAVE_UINTPTR_T, since we now use the stdint module.
2602 (base_name): Remove decl, since files now include <dirname.h>
2603 to get the decl.
2604
2605 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
2606
2607 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
2608 New, default to 1.
2609 * data/yacc.c, data/glr.c, data/location.cc: Use them.
2610 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
2611 default.
2612 * tests/calc.at: Adjust.
2613
2614 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
2615
2616 * data/c.m4 (b4_basename): New.
2617 (b4_syncline): Also output the location of its invocation (from
2618 the skeleton).
2619 (b4_user_action, b4_define_user_action, b4_user_actions)
2620 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
2621 (b4_user_stype): New.
2622 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
2623
2624 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2625
2626 In the grammar file, the first column is 1 not 0 on the first line as
2627 on every other line.
2628 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
2629 * tests/input.at (Torturing the Scanner): Update output.
2630
2631 * src/scan-gram.l (scanner_cursor): Declare it static.
2632
2633 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2634
2635 In warnings, say "previous declaration" rather than "first
2636 declaration".
2637 * src/symtab.c (redeclaration): Do that here.
2638 * src/reader.c (record_merge_function_type): In the case of a result
2639 type clash, report the previous declaration rather than the very first
2640 one in the grammar file.
2641 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2642 declared later): Add a third declaration to check this behavior.
2643 * tests/input.at (Incompatible Aliases): Update output.
2644
2645 2006-06-27 Akim Demaille <akim@epita.fr>
2646
2647 * doc/Doxyfile.in: New.
2648 * doc/Makefile.am: Use it.
2649 * src/lalr.h, src/symtab.h: Initial doxygenation.
2650
2651 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2652
2653 Don't miss %merge result type warnings just because the LHS types are
2654 declared after the %merge. This continues the effort of the previous
2655 patch.
2656 * src/reader.c (get_merge_function): Don't set the merger type yet.
2657 (record_merge_function_type): New function for setting the merger type
2658 and checking for clashes.
2659 (grammar_current_rule_merge_set): Set the location of the %merge for
2660 the current rule.
2661 (packgram): Invoke record_merge_function_type for each rule now that
2662 all symbol type declarations have been parsed.
2663 * src/reader.h (merger_list.type_declaration_location): New member
2664 storing the location of the first %merge from which the type for this
2665 merging function was derived.
2666 * src/symlist.h (symbol_list.merger_declaration_location): New member
2667 storing the location of a rule's %merge, if any.
2668 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2669 declared later): New test to catch the error fixed by the above patch.
2670
2671 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2672
2673 Get action warnings (grammar_rule_check) right even when symbol
2674 declarations appear after the rules. Discussed at
2675 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
2676 and
2677 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
2678 Don't mistake the type of $$ in a midrule to be that of its parent
2679 rule's $$.
2680 * src/reader.c (grammar_current_rule_end): Don't invoke
2681 grammar_rule_check yet since not all symbol declarations may have been
2682 parsed yet.
2683 (grammar_midrule_action): Likewise.
2684 Don't record whether the midrule's $$ has been used yet since actions
2685 haven't been translated yet.
2686 Record the midrule's parent rule and its RHS index within the parent
2687 rule.
2688 (grammar_current_rule_action_append): Don't translate the action yet
2689 since not all symbol declarations may have been parsed yet and, thus,
2690 warnings about types for $$, $n, @$, and @n can't be reported yet.
2691 (packgram): Translate the action and invoke grammar_rule_check now that
2692 all symbol declarations have been parsed.
2693 * src/scan-code.l (handle_action_dollar): Now that this is invoked
2694 after parsing the entire grammar file, the symbol list here in the case
2695 of a midrule is actually the midrule's empty RHS, so reference its
2696 parent rule's RHS where necessary.
2697 On the other hand, now that you can already know it's a midrule, you
2698 aren't forced to think $$ has the same type as its parent rule's $$.
2699 (handle_action_at): In the case of a midrule, reference the parent rule
2700 where necessary.
2701 * src/symlist.c (symbol_list_new): Initialize new midrule-related
2702 members.
2703 (symbol_list_length): Now that this is invoked after all rules have
2704 been parsed, a NULL symbol (rather than a NULL symbol list node)
2705 terminates a rule. symbol_list_print already does this correctly.
2706 * src/symlist.h (symbol_list.midrule_parent_rule,
2707 symbol_list.midrule_parent_rhs_index): New members so that midrules can
2708 remember their relationships with their parents.
2709 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
2710 fixed by the above patch.
2711 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
2712 implementing...
2713 (Unused values): ... this old test case and...
2714 (Unused values before symbol declarations): ... this new test case.
2715 This one is the same as `Unused values' except that all symbol
2716 declarations appear after the rules in order to catch the rest of the
2717 errors fixed by the above patch.
2718
2719 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2720
2721 More cleanup.
2722 * src/reader.c (current_rule): Declare it static since it's no longer
2723 used outside this file.
2724 (grammar_current_rule_action_append): Remove redundant arguments from
2725 translate_rule_action invocation.
2726 * src/reader.h (current_rule): Remove this unused extern.
2727 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
2728 * src/scan-code.l (translate_rule_action): Likewise.
2729
2730 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
2731
2732 Clean up yesterday's patch.
2733 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
2734 to...
2735 * src/reader.c (grammar_current_rule_action_append): ... here for
2736 consistency with grammar_current_rule_symbol_append.
2737 * tests/regression.at (Braced code in declaration in rules section):
2738 Make yyerror and yylex static as usual.
2739
2740 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
2741
2742 Fix bug that mistakes braced code in a declaration in the rules section
2743 to be a rule action. Mentioned at
2744 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
2745 * src/scan-gram.l: Move midrule action detection from the start of the
2746 scanning of any braced code to...
2747 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
2748 action. For readability, use $2 and @2 rather than the equivalent
2749 global variables.
2750 * tests/regression.at (Braced code in declaration in rules section):
2751 New test to catch the error fixed by the above patch.
2752
2753 Work on code readability some.
2754 * src/scan-code.l (current_rule): Get rid of this misleading and
2755 redundant declaration: it's actually extern'ed in reader.h.
2756 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
2757 translate_action): Add a rule argument and use it instead of the global
2758 current_rule.
2759 (translate_rule_action): This already receives current_rule through an
2760 argument, so pass it on to translate_action instead of assigning
2761 current_rule to current_rule.
2762 (translate_symbol_action, translate_code): Pass rule = NULL to
2763 translate_action.
2764
2765 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
2766
2767 Rename %before-definitions to %start-header and %after-definitions to
2768 %end-header. Don't use these declarations to separate pre-prologue
2769 blocks from post-prologue blocks. Add new order-independent
2770 declarations %before-header and %after-header as alternatives to the
2771 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
2772 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
2773 * NEWS (2.3+): Update for these changes.
2774 * data/glr.c (b4_before_definitions): Update to...
2775 (b4_start_header): ... this.
2776 (b4_after_definitions): Update to...
2777 (b4_end_header): ... this.
2778 * data/glr.cc: Likewise.
2779 * data/lalr1.cc: Likewise.
2780 * data/yacc.c: Likewise.
2781 * doc/bison.texinfo (The prologue): Update names, and replace remaining
2782 prologue blocks with %*-header declarations.
2783 (Calc++ Parser): Likewise.
2784 (Bison Declaration Summary): Update names.
2785 (Table of Symbols): Update description.
2786 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
2787 (PERCENT_END_HEADER): ... this.
2788 (PERCENT_BEFORE_DEFINITIONS): Update to...
2789 (PERCENT_START_HEADER): ... this.
2790 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2791 (declaration): Update token names and m4 macro names.
2792 When parsing %end-header and %start-header, invoke translate_code
2793 before muscle_code_grow, and no longer set global booleans to remember
2794 whether these declarations have been seen.
2795 Parse new %after-header and %before-header.
2796 * src/reader.c (before_definitions, after_definitions): Remove.
2797 (prologue_augment): Accept a new bool argument to specify whether to
2798 augment the pre-prologue or post-prologue.
2799 * src/reader.h (before_definitions, after_definitions): Remove these
2800 extern's.
2801 (prologue_augment): Add new bool argument.
2802 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
2803 (PERCENT_END_HEADER): ... this.
2804 (PERCENT_BEFORE_DEFINITIONS): Update to...
2805 (PERCENT_START_HEADER): ... this.
2806 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2807 * tests/actions.at (Printers and Destructors): Update names.
2808
2809 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
2810
2811 Add comparison operators for C++ location classes. Discussed at
2812 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
2813 * data/c++.m4 (b4_define_location_comparison): New boolean %define
2814 declaration indicating whether filename_type has an operator==. If
2815 filename_type is `std::string', it defaults to `1', `0' otherwise.
2816 * data/location.cc: Iff b4_define_location_comparison is `1', add
2817 operator== and operator!= for class position and for class location.
2818
2819 Some minor fixes.
2820 * src/scan-action.l: Remove unused file.
2821 * src/symtab.c (symbol_printer_set): Use printer_location not
2822 destructor_location.
2823 * src/symtab.h (struct symbol): Replace incorrect source comment for
2824 printer members.
2825 * tests/input.at (Incompatible Aliases): Update output with correct
2826 printer location.
2827
2828 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
2829
2830 Don't put the pre-prologue in the header file. For the yacc.c code
2831 file and the glr.c header and code files, move the pre-prologue before
2832 the token definitions. Add new %before-definitions and
2833 %after-definitions to declare code that will go in both the header file
2834 and code file. Discussed at
2835 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
2836 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
2837 and
2838 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
2839 * NEWS (2.3+): Describe these changes.
2840 * data/glr.c (b4_pre_prologue): Move from within to before...
2841 (b4_shared_declarations): ... this.
2842 Add new b4_before_definitions before b4_token_enums.
2843 Add new b4_after_definitions at the end.
2844 * data/glr.cc (b4_pre_prologue): Replace with...
2845 (b4_before_definitions): ... this in the header file.
2846 (b4_after_definitions): New near the end of the header file.
2847 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
2848 code file right before including the header file.
2849 (b4_before_definitions): New in the previous position of
2850 b4_pre_prologue in the header file.
2851 (b4_after_definitions): New near the end of the header file.
2852 * data/yacc.c: Clean up some m4 quoting especially in the header file.
2853 (b4_token_enums_defines): In the code file, move to right before
2854 YYSTYPE for consistency with the header file.
2855 (b4_before_definitions): New right before b4_token_enums_defines in
2856 both the header and code file.
2857 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
2858 header and code file.
2859 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
2860 of prologues for %union dependencies.
2861 (Bison Declaration Summary): In %defines description, mention the
2862 effect of %before-definitions and %after-definitions on the header
2863 file.
2864 (Calc++ Parser): Forward declare driver in a %before-definitions rather
2865 than in the pre-prologue so that make check succeeds.
2866 (Table of Symbols): Add entries for %before-definitions and
2867 %after-definitions.
2868 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
2869 %before-definitions.
2870 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
2871 (declaration): Parse those declarations and append to
2872 b4_before_definitions and b4_after_definitions, respectively.
2873 * src/reader.c (before_definitions, after_definitions): New bools to
2874 track whether those declarations have been seen.
2875 (prologue_augment): Add to the post-prologue if %union,
2876 %before-definitions, or %after-definitions has been seen.
2877 * src/reader.h (before_definitions, after_definitions): New extern's.
2878 * src/scan-gram.l: Scan the new declarations.
2879 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
2880 prologue block in a %before-definitions or a %after-definitions based
2881 on whether the %union is declared.
2882 * tests/regression.at (Early token definitions with --yacc, Early token
2883 definitions without --yacc): Move tests for token definitions into the
2884 post-prologue since token names are no longer defined in the
2885 pre-prologue.
2886
2887 2006-06-20 Akim Demaille <akim@epita.fr>
2888
2889 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
2890 (symbol_get): Use it.
2891 * src/parse-gram.y: Use it.
2892
2893 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
2894
2895 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
2896 build succeeds when configured with --enable-gcc-warnings.
2897
2898 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
2899
2900 * src/parse-gram.y (char_name): New function.
2901 (CHAR, STRING, string_content): For %printer, properly escape.
2902 (ID): Prefer fputs to fprintf.
2903 (id): Reindent to be consistent with other rules.
2904 Properly quote char.
2905
2906 The Translation Project changed its way of publishing translations
2907 to maintainers. I haven't received any responses to my request
2908 for supporting the old way, or for documenting the new way. I
2909 have modified 'bootstrap' to use screen scraping
2910 (in this case, HTML scraping). This is unreliable and inelegant,
2911 but I don't see any better way. Yuck.
2912 * bootstrap (TP_URL, WGET_COMMAND): New vars.
2913 (get_translations): New function, which uses HTML scraping to
2914 deduce locations of latest translations.
2915 Use this function to grab both bison and bison-runtime .po files.
2916 Don't bother priming the pump for the runtime-po domain any more,
2917 as it's now translated better than bison is.
2918
2919 2006-06-19 Akim Demaille <akim@epita.fr>
2920
2921 * src/scan-gram.l: No longer "parse" things after `%union' until
2922 `{'. Rather, return a single "%union" token.
2923 No longer make symbols: return strings, and leave the conversion
2924 to symbols to the parser.
2925 (SC_PRE_CODE, token_type): Remove.
2926 * src/parse-gram.y (%union): New field `character'.
2927 Sort tokens.
2928 (CHAR): New token.
2929 (ID, ID_COLON): Now that the scanner no longer makes them
2930 identifiers, adjust all uses to invoke symbol_get.
2931 (id_colon): New, wraps the conversion from string to symbol.
2932 (%union): Accept a possible union_name.
2933 (symbol): Now can be a char.
2934 * data/c.m4 (b4_union_name): Leave a default value.
2935 * data/glr.c, data/yacc.c: Use it.
2936
2937 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
2938
2939 For associating token numbers with token names for "yacc.c", don't use
2940 #define statements unless `--yacc' is specified; always use enum
2941 yytokentype. Most important discussions start at:
2942 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
2943 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
2944 and
2945 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
2946 * NEWS (2.3+): Mention.
2947 * data/c.m4 (b4_yacc_if): New.
2948 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
2949 token #define's.
2950 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
2951 on token name definitions.
2952 * src/getargs.c (usage): Capitalize `Yacc' in English.
2953 * src/output.c (prepare): Define b4_yacc_flag.
2954 * tests/regression.at (Early token definitions): Test that tokens names
2955 are defined before the pre-prologue not just before the post-prologue.
2956 Remove this test case and copy to...
2957 (Early token definitions with --yacc): ... this to test #define's.
2958 (Early token definitions without --yacc): ... and this to test enums.
2959
2960 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
2961
2962 * NEWS: Reword the post-2.3 change to not be so optimistic about
2963 removing the old "look-ahead" spelling.
2964 Update previous look-ahead/lookahead change reports.
2965 * REFERENCES: look-ahead -> lookahead (since that's
2966 what he actually wrote).
2967 * doc/refcard.tex: look ahead -> lookahead,
2968 look-ahead -> lookahead
2969
2970 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
2971
2972 For consistency, use `lookahead' instead of `look-ahead' or
2973 `look_ahead'. Discussed starting at
2974 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
2975 and then at
2976 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
2977 * NEWS: For the next release, note the change to `--report'.
2978 * TODO, doc/bison.1: Update English.
2979 * doc/bison.texinfo: Update English.
2980 (Understanding Your Parser, Bison Options): Document as
2981 `--report=lookahead' rather than `--report=look-ahead'.
2982 * src/conflicts.c: Update English in comments.
2983 (lookahead_set): Rename from look_ahead_set.
2984 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
2985 (resolve_sr_conflict): Rename local look_ahead_tokens to
2986 lookahead_tokens, and update other uses.
2987 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
2988 count_rr_conflicts, conflicts_free): Update uses.
2989 * src/getargs.c (report_args): Move "lookahead" before alternate
2990 spellings.
2991 (report_types): Update uses.
2992 (usage): For `--report' usage description, state `lookahead' spelling
2993 rather than `look-ahead'.
2994 * src/getargs.h (report.report_lookahead_tokens): Rename from
2995 report_look_ahead_tokens.
2996 * src/lalr.c: Update English in comments.
2997 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
2998 (state_lookahead_tokens_count): Rename from
2999 state_look_ahead_tokens_count.
3000 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3001 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
3002 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3003 Update other uses.
3004 Update English in output.
3005 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
3006 * src/print.c: Update English in comments.
3007 (lookahead_set): Rename from look_ahead_set.
3008 (print_reduction): Rename argument lookahead_token from
3009 look_ahead_token.
3010 (print_core, state_default_rule, print_reductions, print_results):
3011 Update uses.
3012 * src/print_graph.c: Update English in comments.
3013 (print_core): Update uses.
3014 * src/state.c: Update English in comments.
3015 (reductions_new): Update uses.
3016 (state_rule_lookahead_tokens_print): Rename from
3017 state_rule_look_ahead_tokens_print, and update other uses.
3018 * src/state.h: Update English in comments.
3019 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
3020 (state_rule_lookahead_tokens_print): Rename from
3021 state_rule_look_ahead_tokens_print.
3022 * src/tables.c: Update English in comments.
3023 (conflict_row, action_row): Update uses.
3024 * tests/glr-regression.at
3025 (Incorrect lookahead during deterministic GLR,
3026 Incorrect lookahead during nondeterministic GLR): Rename
3027 print_look_ahead to print_lookahead.
3028 * tests/torture.at: Update English in comments.
3029 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
3030 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
3031 (Many lookahead tokens): Update uses.
3032 * data/glr.c: Update English in comments.
3033 * lalr1.cc: Likewise.
3034 * yacc.c: Likewise.
3035 * src/conflicts.h: Likewise.
3036 * src/lalr.h: Likewise.
3037 * src/main.c: Likewise.
3038 * src/output.c: Likewise.
3039 * src/parse-gram.c: Likewise.
3040 * src/tables.h: Likewise.
3041 * tests/calc.at: Likewise.
3042
3043 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
3044
3045 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
3046
3047 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
3048
3049 * TODO: Add request from Nelson H. F. Beebe to be able to install
3050 Bison without installing the yacc script.
3051
3052 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3053
3054 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
3055 and yytext if they're already #define'd.
3056 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
3057 * src/scan-code-c.c: ... here.
3058 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
3059 <config.h>.
3060
3061 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3062
3063 Get Bison to build again when configured with --enable-gcc-warnings.
3064 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
3065 missing #include's.
3066 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
3067 loc argument as it shadows a global.
3068 * src/scan-gram.l: Remove stray comma that prevents boundary_set
3069 invocation.
3070
3071 * src/.cvsignore: Add scan-code.c.
3072
3073 2006-06-07 Akim Demaille <akim@epita.fr>
3074
3075 * src/scan-gram.l: Move the "add a trailing ; to actions" code
3076 to...
3077 * src/scan-code.l: here.
3078 * tests/input.at (Torturing the Scanner): Fix another location
3079 error.
3080
3081 2006-06-07 Akim Demaille <akim@epita.fr>
3082
3083 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
3084
3085 2006-06-06 Akim Demaille <akim@epita.fr>
3086
3087 Extract the parsing of user actions from the grammar scanner.
3088 As a consequence, the relation between the grammar scanner and
3089 parser is much simpler. We can also split "composite tokens" back
3090 into simple tokens.
3091 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
3092 * src/scan-gram.l (add_column_width, adjust_location): Move to and
3093 rename as...
3094 * src/location.h, src/location.c (add_column_width)
3095 (location_compute): these.
3096 Fix the column count: the initial column is 0.
3097 (location_print): Be robust to ending column being 0.
3098 * src/location.h (boundary_set): New.
3099 * src/main.c: Adjust to scanner_free being renamed as
3100 gram_scanner_free.
3101 * src/output.c: Include scan-code.h.
3102 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
3103 Use boundary_set.
3104 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
3105 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
3106 which is now, again, a separate token.
3107 Adjust all dependencies.
3108 Whereever actions with $ and @ are used, use translate_code.
3109 (action): Remove this nonterminal which is now useless.
3110 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
3111 (grammar_current_rule_action_append): Use translate_code.
3112 (packgram): Bound check ruleno, itemno, and rule_length.
3113 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
3114 (last_string, last_braced_code_loc, max_left_semantic_context)
3115 (scanner_initialize, scanner_free, scanner_last_string_free)
3116 (gram_out, gram_lineno, YY_DECL_): Move to...
3117 * src/scan-gram.h: this new file.
3118 (YY_DECL): Rename as...
3119 (GRAM_DECL): this.
3120 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
3121 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3122 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3123 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3124 Move these declarations, and...
3125 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
3126 these to...
3127 * src/flex-scanner.h: this new file.
3128 * src/scan-gram.l (rule_length, rule_length_overflow)
3129 (increment_rule_length): Remove.
3130 (last_braced_code_loc): Rename as...
3131 (gram_last_braced_code_loc): this.
3132 Adjust to the changes of the parser.
3133 Move all the handling of $ and @ into...
3134 * src/scan-code.l: here.
3135 * src/scan-gram.l (handle_dollar, handle_at): Remove.
3136 (handle_action_dollar, handle_action_at): Move to...
3137 * src/scan-code.l: here.
3138 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
3139 scan-code.h, scan-code-c.c, scan-gram.h.
3140 (EXTRA_bison_SOURCES): Add scan-code.l.
3141 (BUILT_SOURCES): Add scan-code.c.
3142 (yacc): Be robust to white spaces.
3143
3144 * tests/conflicts.at, tests/input.at, tests/reduce.at,
3145 * tests/regression.at: Adjust the column numbers.
3146 * tests/regression.at: Adjust the error message.
3147
3148 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3149
3150 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3151 Use Akim's wording from
3152 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
3153
3154 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3155
3156 Between Bison releases, manually append `+' to the previous Bison
3157 release number, and use that as a signal to automatically print the
3158 ChangeLog's CVS Id keyword from --version. Discussed starting at
3159 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
3160 * ChangeLog: Add Id header.
3161 * configure.ac (AC_INIT): Append `+' to `2.3'.
3162 * src/.cvsignore: Add revision.c.
3163 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
3164 (BUILT_SOURCES): Add revision.c.
3165 (revision.c): New target rule. This file defines a new global variable
3166 named revision. It initializes it with either the Id from ChangeLog
3167 or, if VERSION doesn't contain `+', with the empty string.
3168 * src/getargs.c (version): Print the value of revision.
3169 * src/revision.h: Extern revision.
3170
3171 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
3172
3173 * NEWS: Version 2.3.
3174 * configure.ac (AC_INIT): Likewise.
3175
3176 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
3177
3178 * data/glr.c (YYRECOVERING): Define to be a function-like macro
3179 with no arguments, not as an object-like macro. This is for
3180 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
3181 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
3182 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
3183 Document this.
3184
3185 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
3186
3187 * src/getargs.c (usage): Back out yesterday's modification of the
3188 --help output so that we don't have to wait for translation before
3189 releasing 2.3.
3190
3191 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
3192
3193 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
3194 Problem reported by Akim Demaille.
3195
3196 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3197
3198 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3199
3200 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
3201
3202 * data/yacc.c (yy_reduce_print): Omit trailing white space in
3203 generated source code. Problem reported by Frans Englich in
3204 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
3205
3206 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
3207
3208 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
3209 shell, not within 'make', so that 'make' by an ordinary builder
3210 (using GNU make) does not worry about configuring gzip. This also
3211 works around a bug reported independently by Keith Thompson and by
3212 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
3213 stderr rather than stdout, messing up the build logs.
3214
3215 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3216
3217 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
3218 to make sure that YYID will never be unused. This fixes a 'make
3219 maintainer-check' failure caused by the recent changes to the 'Trivial
3220 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
3221 not used.
3222 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
3223
3224 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3225
3226 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
3227 state before an empty RHS is always resolved here. Only the location
3228 of that state is guaranteed to be resolved, and that's enough. This
3229 fixes the remaining bug reported by Derek M. Jones in
3230 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3231 * tests/glr-regression.at (Uninitialized location when reporting
3232 ambiguity): Test the above case.
3233 Also, the embedded comments in this test case claim it checks the case
3234 of an empty RHS that has inherited the initial location. However, the
3235 corresponding LHS was already resolved, so yyresolveLocations didn't
3236 actually have reason to modify it. Fix this by forcing
3237 nondeterministic operation at the beginning of the parse.
3238
3239 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
3240
3241 * data/c.m4 (b4_yy_symbol_print_generate):
3242 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
3243 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
3244 of the bugs reported today by Derek M Jones in
3245 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3246 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
3247 defined to be a type name without parens or brackets.
3248 (Location Type): Similarly for YYLTYPE.
3249 * tests/regression.at (Trivial grammars): Put in a test for this
3250 bug that will be caught by 'make maintainer-check' (though not,
3251 alas, by 'make check' unless your compiler is picky).
3252
3253 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
3254
3255 * NEWS: Version 2.2.
3256 * configure.ac (AC_INIT): Likewise.
3257
3258 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
3259
3260 * data/glr.c (yyreportTree): Make room in yystates for the state
3261 preceding the RHS. This fixes the segmentation fault reported by Derek
3262 M. Jones in
3263 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
3264 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
3265 to the user. Reported for yyreportTree by Derek M. Jones later in the
3266 same thread.
3267 * THANKS: Add Derek M. Jones.
3268 Update my email address.
3269 Fix typo in Steve Murphy's name.
3270
3271 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
3272
3273 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
3274 checking against YYLAST that caused the parser to miss a potential
3275 alternative in its diagnostic.
3276 Problem reported by Maria Jose Moron Fernandez in
3277 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
3278 * data/lalr1.cc (yysyntax_error_): Likewise.
3279 * data/yacc.c (yysyntax_error): Likewise.
3280 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
3281 tokens, in case we run into an older C compiler.
3282 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
3283 Use them to check for the off-by-one error fixed above.
3284
3285 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
3286 YYSIZE_T, not size_t.
3287 * tests/regression.at (Trivial grammars): New test, to catch
3288 the error fixed by the above patch.
3289
3290 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3291
3292 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
3293 scheme.
3294 Reported by Steve Murphy.
3295
3296 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3297
3298 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
3299 * data/glr.cc: b4_location_flag is now b4_locations_flag.
3300
3301 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3302
3303 Implement --trace=m4.
3304 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
3305 * src/output.c (output_skeleton): When set, pass -dV to m4.
3306
3307 Factor the handling of flags in m4.
3308 * src/output.c (prepare): Rename the muscle names debug, defines,
3309 error_verbose to debug_flag, defines_flag, error_verbose_flag.
3310 * data/c.m4: Adjust.
3311 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
3312 Use b4_define_flag_if to define other b4_FLAG_if macros.
3313 (b4_location_if): As a consequence, rename as...
3314 (b4_locations_if): this, for consistency.
3315 Adjust all the skeletons.
3316
3317 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3318
3319 * etc/bench.pm: Shorten bench names.
3320
3321 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3322
3323 * src/output.h, src/output.c (error_verbose): Move to...
3324 * src/getargs.h, src/getargs.c: here.
3325 Sort the flags.
3326 Adjust dependencies.
3327
3328 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
3329
3330 * data/c.m4 (b4_copyright): Put the special exception for Bison
3331 skeletons here, so we don't have to put it in each skeleton. All
3332 uses changed. Suggested by Akim Demaille. Also, wrap the
3333 copyright notice, in case it is longer than 80 columns. Replace
3334 comma by newline after title.
3335
3336 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
3337
3338 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
3339 incompatibility, not a bug. Mention that it wasn't fixed as of
3340 flex 2.5.33.
3341
3342 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
3343
3344 * examples/extexi: Enforce the precedence of concatenation over
3345 >>.
3346 Reported by Tommy Nordgren.
3347
3348 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
3349
3350 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
3351 with the member "token".
3352 Reported by Martin Nylin.
3353
3354 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
3355
3356 * data/glr.c: Switch to Bison 2.2 special-exception language in
3357 the copyright notice. Use more-regular format for titles and
3358 copyright notices.
3359 * data/glr.cc: Likewise.
3360 * data/location.cc: Likewise.
3361 * data/yacc.cc: Likewise.
3362 * doc/bison.texinfo (Conditions): Document this.
3363 * NEWS: likewise. Upgrade version to 2.2.
3364
3365 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
3366
3367 * data/glr.cc: Remove dead code.
3368
3369 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
3370
3371 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
3372 that variable and the line breaks the bootstrap. Problem reported
3373 by Juan M. Guerrero.
3374
3375 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
3376
3377 * doc/bison.texinfo (Multiple start-symbols): New.
3378
3379 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
3380
3381 * etc/README, etc/bench.pl: New.
3382
3383 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
3384
3385 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
3386 rule.
3387 Reported by Mickael Labau.
3388 * tests/input.at (Torturing the Scanner): Test it.
3389
3390 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
3391
3392 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
3393 Problem reported by Bob Rossi.
3394
3395 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
3396
3397 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
3398 and didn't really work.
3399 For the index, use @ifnotinfo, not @iftex.
3400 Minor cleanups of spacing and terminology.
3401
3402 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
3403
3404 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
3405 of AT_NAME_PREFIX when %name-prefix is not used.
3406
3407 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
3408
3409 Apply --prefix to C++ skeletons too: they change the namespace.
3410 The test suite already exercize these cases.
3411 * data/c++.m4 (b4_namespace): New.
3412 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
3413 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
3414 * data/yacc.c, data/glr.c: Remove a useless `[]'.
3415 * doc/bison.texinfo: Document it.
3416 (Option Cross Key): Use @multitable in all formats. It looks
3417 nicer, even in TeX outputs.
3418 (Rules): Use the same code whatever the output type is.
3419 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
3420 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
3421 * tests/calc.at: Use it, instead of hard coding `yy'.
3422
3423 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
3424
3425 * TODO: Remove dead items.
3426
3427 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
3428
3429 * doc/FAQ: Remove, merged into...
3430 * doc/bison.texinfo (FAQ): this.
3431 * doc/Makefile.am (EXTRA_DIST): Adjust.
3432
3433 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
3434
3435 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
3436 even if empty.
3437 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
3438 * doc/bison.texinfo (Calc++ Scanner): Use it.
3439
3440 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
3441
3442 Fix two nits reported by twlevo, plus one more that I discovered.
3443
3444 * src/assoc.h (assoc_to_string): Give a name to the arg, as
3445 this is the usual Bison style.
3446 * src/location.h (location_print): Likewise.
3447
3448 * src/reader.h (token_name): Likewise.
3449
3450 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
3451
3452 Fix some nits reported by twlevo.
3453 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
3454 and "POSIX". Use more-modern syntax for URLs. Mention C++
3455 and ask for Java. Don't hardwire OS version numbers. Add
3456 copyright notice.
3457 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
3458 * src/conflicts.c (solved_conflicts_obstack): Now static.
3459
3460 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3461
3462 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
3463 page. Say "you can use it" not "you may use it" as on the web page;
3464 we're describing capabilities not granting permission.
3465
3466 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
3467
3468 * data/glr.c (yyresolveLocations): Rename local variables to avoid
3469 shadowing warnings. Use usual patter for iterating through RHS.
3470 * tests/glr-regression.at
3471 (Uninitialized location when reporting ambiguity):
3472 Modify yylex so that it uses its argument, rather than trying
3473 to rely on ARGSUSED (which doesn't work for gcc with warnings).
3474 const char -> char const.
3475
3476 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
3477 Don't use tabs inside commands; it messes up 'ps'.
3478 Problem reported by twlevo.
3479
3480 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
3481
3482 * tests/glr-regression.at (Uninitialized location when reporting
3483 ambiguity): New test case.
3484 * data/glr.c (yyresolveLocations): New function, which uses
3485 YYLLOC_DEFAULT.
3486 (yyresolveValue): Invoke yyresolveLocations before reporting an
3487 ambiguity.
3488 * doc/bison.texinfo (Default Action for Locations): Note
3489 YYLLOC_DEFAULT's usage for ambiguity locations.
3490 (GLR Semantic Actions): Cross-reference those notes.
3491
3492 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
3493
3494 * tests/glr-regression.at (Leaked semantic values when reporting
3495 ambiguity): Remove unnecessary union and type declarations.
3496 (Leaked lookahead after nondeterministic parse syntax error): New test
3497 case.
3498 * data/glr.c (yyparse): Check for zero stacks remaining before
3499 attempting to shift the lookahead so that you don't lose it.
3500
3501 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3502
3503 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
3504 * tests/glr-regression.at (Leaked semantic values when reporting
3505 ambiguity): New test case.
3506 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
3507 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
3508 now unnecessary yystackp parameter.
3509 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
3510 destructors can be called.
3511
3512 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
3513 in existing testcases.
3514
3515 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3516
3517 Don't leak semantic values for parent RHS when a user action cuts the
3518 parser, and clean up related code a bit.
3519 * tests/glr-regression.at (Leaked merged semantic value if user action
3520 cuts parse): Rename to...
3521 (Leaked semantic values if user action cuts parse): ... this. Add check
3522 for leaked parent RHS values.
3523 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
3524 between an unresolved state (non-empty chain of semantic options) and
3525 an incomplete one (signaled by an empty chain).
3526 (yyresolveStates): Document the interface. Move all manipulation of a
3527 successfully or unsuccessfully resolved yyGLRState to...
3528 (yyresolveValue): ... here so that yyresolveValue always leaves a
3529 yyGLRState with consistent data and thus is easier to understand.
3530 Remove the yyvalp and yylocp parameters since they are always just
3531 taken from the yys parameter. When reporting a discarded merged value
3532 in debugging output, note that it is incompletely merged. Document the
3533 interface.
3534 (yyresolveAction): If resolving any of the RHS states fails, destroy
3535 them all rather than leaking them. Thus, as long as user actions are
3536 written to clean up the RHS correctly, yyresolveAction always cleans up
3537 the RHS of a semantic option. Document the interface.
3538
3539 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
3540
3541 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
3542 led to a segmentation fault in GNU Pascal. Problem reported
3543 by Waldek Hebisch.
3544
3545 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
3546
3547 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
3548 mid-rule action inside a nonterminal symbol in order to declare a
3549 destructor for its semantic value.
3550
3551 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
3552
3553 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
3554 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
3555 __cplusplus && ! defined _STDLIB_H && !
3556 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
3557 defined free))]: Include <stdlib.h> rather than rolling our own
3558 declarations of malloc and free, to avoid problems with
3559 incompatible declarations (using 'throw') C++'s stdlib.h. This
3560 should fix Debian bug 340012
3561 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
3562 reported by Guillaume Melquiond.
3563
3564 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3565
3566 * NEWS: Clarify symbols versus types in unused-value warnings.
3567
3568 * configure.ac (AC_INIT): Bump version number.
3569
3570 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3571
3572 * NEWS: Version 2.1a.
3573 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
3574 since C99 requires this.
3575
3576 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
3577
3578 * m4/c-working.m4: New file.
3579 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
3580
3581 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
3582
3583 * Makefile.maint: Merge from coreutils.
3584
3585 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 More portability fixes for problems summarized by Nelson H. F. Beebe.
3588
3589 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
3590 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
3591 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
3592 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
3593 messes up because C++ code is compiled in 32-bit mode but linked
3594 in 64-bit mode.
3595
3596 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
3597
3598 More portability fixes for problems summarized by Nelson H. F. Beebe.
3599
3600 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
3601 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
3602
3603 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
3604 nodist_PROGRAMS, since we don't need to actually compile the
3605 example if we're just doing a plain 'make'. This avoids bothering
3606 the installer unnecessarily about problems due to weird C++
3607 compilers.
3608
3609 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
3610
3611 More portability fixes for problems summarized by Nelson H. F. Beebe.
3612
3613 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
3614 than #include "...", and compile with -I'.'. The old method was
3615 not portable, according to Posix and the C standard, and it does
3616 not work with Sun C 5.7, where previous #line directives affect
3617 the working directory used in later #include "..." directives.
3618
3619 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3620
3621 Various DJGGP specific issues in /djgpp
3622
3623 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
3624
3625 More portability fixes for problems summarized by Nelson H. F. Beebe.
3626
3627 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
3628 '#include <map>' works and that you can apply ++ to iterators.
3629
3630 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
3631
3632 Work around portability problems summarized by Nelson H. F. Beebe in
3633 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
3634
3635 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3636 that '#include <string>' works.
3637
3638 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
3639 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
3640 "warning: sorry: semantics of inline function static data `const
3641 unsigned char translate_table[262]' are wrong (you'll wind up with
3642 multiple copies)".
3643
3644 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
3645 or, xor to not_, and_, or_, and xor_, respectively. This works
3646 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
3647 random system header somewhere that includes the equivalent of
3648 <iso646.h>.
3649
3650 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
3651 -E" works; it apparently doesn't work with PathScale EKO Compiler
3652 Suite Version 2.0.
3653
3654 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
3655
3656 During deterministic GLR operation, user actions should be able to
3657 influence the parse by changing yychar. To make this easier to fix and
3658 to make glr.c easier to evolve in general, don't maintain yytoken in
3659 parallel with yychar; just compute yytoken when needed.
3660 * tests/glr-regression.at (Incorrect lookahead during deterministic
3661 GLR): Check that setting yychar in a user action has the intended
3662 effect.
3663 * data/glr.c (yyGLRStack): Remove yytokenp member.
3664 (yyclearin): Don't set *yytokenp.
3665 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
3666 yychar rather than *yytokenp to determine the current lookahead.
3667 Compute yytoken locally when needed.
3668 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
3669 point to.
3670
3671 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
3672 after `--report' documentation.
3673
3674 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
3675
3676 * src/parse-gram.y (grammar_declaration): Location of printer
3677 symbol is @1, not list->location. Bug reported by twlevo.
3678 * tests/input.at (Incompatible Aliases): Adjust to above change.
3679
3680 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
3681
3682 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
3683 all the test at once. This makes the output easier to read in the
3684 normal case.
3685
3686 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
3687 got from <http://bro-ids.org/download.html>. The bug is that
3688 when two actions appeared in succession, the second one was
3689 scanned before the first one was added to the grammar rule
3690 as a midrule action. Bison then output the incorrect warning
3691 "parse.y:905.17-906.36: warning: unused value: $3".
3692 * src/parse-gram.y (BRACED_CODE, action): These are no longer
3693 associated with a value.
3694 (rhs): Don't invoke grammar_current_rule_action_append.
3695 (action): Invoke it here instead.
3696 * src/reader.c (grammar_midrule_action): Now extern.
3697 (grammar_current_rule_action_append): Don't invoke
3698 grammar_midrule_action; that is now the scanner's job.
3699 * src/reader.h (last_string, last_braced_code_loc):
3700 (grammar_midrule_action): New decls.
3701 * src/scan-gram.l (last_string): Now extern, sigh.
3702 (last_braced_code_loc): New extern variable.
3703 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
3704 rule already has an action.
3705 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
3706 * tests/input.at (AT_CHECK_UNUSED_VALUES):
3707 Add some tests to check that the above changes fixed the bug.
3708
3709 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
3710
3711 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
3712 All used changed. Check whether the symbol has a destructor,
3713 not whether it is typed.
3714 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
3715 that the values are still reported as unused. All line numbers
3716 adjusted.
3717
3718 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
3719
3720 Work around a bug in bro 0.8, which underparenthesizes its
3721 definition of YYLLOC_DEFAULT.
3722 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
3723 their arguments.
3724 * data/lalr1.cc: Likewise.
3725 * data/yacc.cc: Likewise.
3726
3727 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
3728
3729 Work around a bug in Pike 7.0, and give the Pike folks a
3730 better way to override the usual int widths.
3731 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
3732 user can override the types.
3733 (short): #undef, to work around a bug in Pike 7.0.
3734 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
3735 (union yyalloc.yyss): Use yytype_int16 rather than short.
3736 All uses changed.
3737 (yysigned_char): Remove.
3738 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
3739 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
3740 * tests/regression.at (Web2c Actions): Adjust to above changes.
3741
3742 * src/reader.c (check_and_convert_grammar): New function.
3743 (reader): Close the input file even if something went wrong during
3744 parsing. Minor file descriptor leak reported by twlevo.
3745
3746 * src/assoc.c (assoc_to_string): Use a default: abort (); case
3747 to pacify gcc -Wswitch-default.
3748 * src/scan-gram.l (adjust_location): Use a default: break; case
3749 to pacify gcc -Wswitch-default.
3750 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
3751 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3752 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3753 Move these decls to scan-skel.l, since they don't need to be
3754 visible elsewhere.
3755 * src/scan-skel.l: Accept the above decls.
3756 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
3757 is used.
3758
3759 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
3760
3761 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
3762 since we don't want to insist on a version number at the start
3763 of the changelog every time.
3764 * Makefile.maint: Sync from coreutils a bit better.
3765 (sc_trailing_blank): Renamed from sc_trailing_space.
3766 All uses changed.
3767 (sc_no_if_have_config_h, sc_require_config_h):
3768 (sc_prohibit_assert_without_use): New rules.
3769 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
3770 (sc_dd_max_sym_length): Fix leading spaces in rule.
3771 (sc_system_h_headers): Prefix with @.
3772 (sc_useless_cpp_parens, m4-check): Output line numbers.
3773 (changelog-check): Allow version only in head.
3774 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
3775 satisfy new Makefile.maint rule.
3776 * data/glr.c: Likewise.
3777 * data/glr.cc: Likewise.
3778 * data/lalr1.cc: Likewise.
3779 * data/yacc.c: Likewise.
3780 * lib/ebitsetv.c: Likewise.
3781 * lib/lbitset.c: Likewise.
3782 * lib/subpipe.c: Likewise.
3783 * lib/timevar.c: Likewise.
3784 * src/system.h: Likewise.
3785 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
3786 * djgpp/Makefile.maint: Add copyright notice.
3787 * djgpp/README.in: Likewise.
3788 * djgpp/config.bat: Likewise.
3789 * djgpp/config.site: Likewise.
3790 * djgpp/config_h.sed: Likewise.
3791 * djgpp/djunpack.bat: Likewise.
3792 * djgpp/config.sed: Fix copyright notice to match standard format.
3793 * djgpp/subpipe.h: Likewise.
3794 * lib/bitsetv-print.c: Likewise.
3795 * lib/bitsetv.c: Likewise.
3796 * lib/subpipe.h: Likewise.
3797 * lib/timevar.c: Likewise.
3798 * lib/timevar.h: Likewise.
3799 * djgpp/subpipe.c: Use standard recipe for config.h.
3800 * lib/abitset.c: Likewise.
3801 * lib/bitset.c: Likewise.
3802 * lib/bitset_stats.c: Likewise.
3803 * lib/bitsetv-print.c: Likewise.
3804 * lib/bitsetv.c: Likewise.
3805 * lib/ebitsetv.c: Likewise.
3806 * lib/get-errno.c: Likewise.
3807 * lib/lbitset.c: Likewise.
3808 * lib/subpipe.c: Likewise.
3809 * lib/timevar.c: Likewise.
3810 * lib/vbitset.c: Likewise.
3811 * tests/local.at: Likewise.
3812 * src/scan-gram.l: Don't include verify.h, since system.h does
3813 that for us.
3814 * .x-sc_require_config_h: New file.
3815 * .x-sc_unmarked_diagnostics: New file.
3816
3817 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
3818
3819 Be a bit more systematic about using 'abort'.
3820 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
3821 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
3822 Put 'default: abort ();' before some other case, to satisfy older
3823 pedantic compilers.
3824 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3825 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
3826 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
3827 * src/conflicts.c (resolve_sr_conflict): Likewise.
3828 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
3829 (get_decision_str, get_orientation_str, get_node_alignment_str):
3830 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
3831 (get_linestyle_str, get_arrowstyle_str): Likewise.
3832 * src/conflicts.c (resolve_sr_conflict):
3833 Use a default case rather than one for the one remaining enum
3834 value, to catch invalid enum values as well.
3835 * src/lalr.c (set_goto_map, map_goto):
3836 Prefer "assert (FOO);" to "if (!FOO) abort ();".
3837 * src/nullable.c (nullable_compute, token_definitions_output):
3838 Likewise.
3839 * src/reader.c (packgram, reader): Likewise.
3840 * src/state.c (transitions_to, state_new, state_reduction_find):
3841 Likewise.
3842 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
3843 (symbol_pack): Likewise.
3844 * src/tables.c (conflict_row, pack_vector): Likewise.
3845 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
3846 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
3847 * src/system.h: Don't include <assert.h>.
3848 (assert): New macro.
3849
3850 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
3851 (Destructor Decl, Parser Function, Pure Calling):
3852 Describe rules for braces inside C code more carefully.
3853
3854 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
3855
3856 Fix some porting glitches found by Nelson H. F. Beebe.
3857 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
3858 compilers that don't understand that abort () does not return.
3859 * src/state.c (transitions_to): Likewise.
3860 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3861 that '#include <cstdlib>' works.
3862 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
3863 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
3864 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
3865 for the benefit of some pre-C99 compilers.
3866
3867 * bootstrap: Undo changes to gnulib files that autoreconf made.
3868
3869 Minor fixups to get 'make maintainer-check' to work.
3870 * configure.ac: Don't use -Wnested-externs, as it's incompatible
3871 with the new verify.h implementation.
3872 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
3873 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
3874 * data/yacc.c (YYUSE): Likewise.
3875 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
3876 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
3877 * src/parse-gram.y (declaration): Don't pass a string constant
3878 to a function that expects char *, since GCC might complain
3879 about the constant value.
3880 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
3881 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
3882 before #defining them.
3883 * tests/glr-regression.at
3884 (Incorrectly initialized location for empty right-hand side in GLR):
3885 In yyerror, use the msg arg.
3886 (Corrupted semantic options if user action cuts parse):
3887 (Incorrect lookahead during deterministic GLR):
3888 (Incorrect lookahead during nondeterministic GLR):
3889 Don't name a local var 'index'; it shadows string.h's 'index'.
3890
3891 2006-01-19 Akim Demaille <akim@epita.fr>
3892
3893 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
3894 location, not just parts of it.
3895
3896 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
3897
3898 * NEWS: Document the fact that multiple %unions are now allowed.
3899 * doc/bison.texinfo (Union Decl): Likewise.
3900 * TODO: This feature is now implemented, so remove it from
3901 the wishlist.
3902
3903 * Makefile.maint: Merge with coreutils Makefile.maint.
3904 (CVS_LIST): Use build-aux version if available.
3905 (VERSION_REGEXP): New macro.
3906 (syntax-check-rules): Add sc_no_if_have_config_h,
3907 sc_prohibit_assert_without_use, sc_require_config_h,
3908 sc_useless_cpp_parens.
3909 (sc_obsolete_symbols): Check for O_NDELAY.
3910 (sc_dd_max_sym_length): Track coreutils.
3911 (sc_unmarked_diagnostics): Look in all files, not just *.c.
3912 (sc_useless_cpp_parens): New rule.
3913 (news-date-check): Look for version or today's date.
3914 (changelog-check): Don't require version number near head.
3915 (copyright-check): Use current year instead of hardwiring 2005.
3916 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
3917 (announcement): Add --gpg-key-ID.
3918
3919 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
3920 with "file system".
3921
3922 Avoid undefined behavior that addressed just before the start of an
3923 array. Problem reported by twlevo.
3924 * src/reader.c (packgram): Prepend a new sentinel before ritem.
3925 * src/lalr.c (build_relations): Rely on new sentinel.
3926 * src/gram.c (gram_free): Adjust to new sentinel.
3927
3928 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
3929
3930 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
3931 yylookaheadNeeds. All uses updated.
3932 (yysplitStack): Rename local yynewLookaheadStatuses to
3933 yynewLookaheadNeeds.
3934 * data/glr-regression.at (Incorrect lookahead during nondeterministic
3935 GLR): In comments, change `lookahead status' to `lookahead need'.
3936
3937 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3938
3939 * data/glr.c (yysplitStack): A little stylistic rewrite.
3940
3941 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3942
3943 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
3944
3945 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
3946
3947 * doc/bison.texinfo: Fix some typos.
3948 (GLR Semantic Actions): New subsection discussing special
3949 considerations because GLR semantic actions might be deferred.
3950 (Actions): Mention look-ahead usage of yylval.
3951 (Actions and Locations): Mention look-ahead usage of yylloc.
3952 (Special Features for Use in Actions): Add YYEOF entry and mention it
3953 in the yychar entry.
3954 In the yychar entry, remove mention of the local yychar case (pure
3955 parser) since this is irrelevant information when writing semantic
3956 actions and since it's already discussed in `Table of Symbols' where
3957 yychar is otherwise described as an external variable.
3958 In the yychar entry, don't call it the `current' look-ahead since it
3959 isn't when semantic actions are deferred.
3960 In the yychar and yyclearin entries, add note about deferred semantic
3961 actions.
3962 Add yylloc and yylval entries discussing look-ahead usage.
3963 (Look-Ahead Tokens): When discussing yychar, don't call it the
3964 `current' look-ahead, and do mention yylval and yylloc.
3965 (Error Recovery): Cross-reference `Action Features' when mentioning
3966 yyclearin.
3967 (Table of Symbols): In the yychar entry, don't call it the `current'
3968 look-ahead.
3969 In the yylloc and yylval entries, mention look-ahead usage.
3970
3971 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3972
3973 * tests/glr-regression.at: Update copyright year to 2006.
3974
3975 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3976
3977 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
3978 use during nondeterministic operation to track which stacks have
3979 actually needed the current lookahead.
3980 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
3981 Allocate, deallocate, resize, and otherwise shuffle space for
3982 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
3983 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
3984 appropriately during nondeterministic operation.
3985 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
3986 members to store the current lookahead to be used by the deferred
3987 user action.
3988 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
3989 from which the RHS is taken. Set the lookahead members of the new
3990 yySemanticOption according to the lookahead status for stack yyk.
3991 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
3992 yyaddDeferredAction.
3993 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
3994 members of yySemanticOption before invoking yyuserAction, and then set
3995 them back to their current values afterward.
3996 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
3997 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
3998 * tests/glr-regression.at: Remove `.' from the ends of recent test case
3999 titles for consistency.
4000 (Leaked merged semantic value if user action cuts parse): In order to
4001 suppress lint warnings, use arguments in merge function, and assign
4002 char value < 128 in main.
4003 (Incorrect lookahead during deterministic GLR): New test case.
4004 (Incorrect lookahead during nondeterministic GLR): New test case.
4005
4006 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4007
4008 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
4009 !yyvaluep as signal that no semantic value is available to print.
4010 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
4011 to print a semantic value.
4012
4013 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4014
4015 * tests/glr-regression.at: For consistency with my newer test cases,
4016 don't thank myself.
4017
4018 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4019
4020 * data/glr.c (yyresolveValue): When merging semantic options, if at
4021 least one user action succeeds but a later one cuts the parse, then
4022 destroy the semantic value before returning rather than leaking it.
4023 (yyresolveStates): If a user action cuts the parse and thus
4024 yyresolveValue fails, ignore the (unset) semantic value rather than
4025 corrupting the yyGLRState, and empty the semantic options list since
4026 the user actions should have called all necessary destructors.
4027 Simplify code with YYCHK.
4028 * tests/glr-regression.at (Corrupted semantic options if user action
4029 cuts parse): New test case.
4030 (Undesirable destructors if user action cuts parse): New test case.
4031 Before applying any of this patch, this test case never actually failed
4032 for me... but only because the corrupted semantic options usually
4033 masked this bug.
4034 (Leaked merged semantic value if user action cuts parse): New test
4035 case.
4036
4037 2006-01-05 Akim Demaille <akim@epita.fr>
4038
4039 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
4040
4041 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
4042
4043 * data/c.m4 (b4_c_modern): New macro, with a new provision for
4044 _MSC_VER. Problem reported by Cenzato Marco.
4045 (b4_c_function_def): Use it.
4046 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
4047 b4_c_modern.
4048 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
4049 than rolling our own.
4050
4051 2006-01-04 Akim Demaille <akim@epita.fr>
4052
4053 Also warn about non-used mid-rule values.
4054 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
4055 member.
4056 (symbol_list_new): Adjust.
4057 * src/reader.c (symbol_typed_p): New.
4058 (grammar_rule_check): Use it.
4059 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
4060 Check its rule.
4061 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
4062 Use it.
4063 * tests/actions.at (Exotic Dollars): Adjust.
4064
4065 2006-01-04 Akim Demaille <akim@epita.fr>
4066
4067 * src/reader.c (grammar_midrule_action): If $$ is set in a
4068 mid-rule, move the `used' bit to its lhs.
4069 * tests/input.at (Unused values): New.
4070 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
4071
4072 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
4073
4074 * doc/bison.texinfo (Bison Options): Say more accurately what
4075 --yacc does.
4076 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
4077 about declarations in the grammar when in Yacc mode, as POSIX does
4078 not require a diagnostic when the grammar uses extensions.
4079
4080 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
4081
4082 Warn about dubious constructions like "%token T T".
4083 Reported by twlevo.
4084 * src/symtab.h (struct symbol.declared): New member.
4085 * src/symtab.c (symbol_new): Initialize it to false.
4086 (symbol_class_set): New arg DECLARING, specifying whether
4087 this is a declaration that we want to warn about, if there
4088 is more than one of them. All uses changed.
4089
4090 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
4091 Allow multiple %union directives, whose contents concatenate.
4092 * src/parse-gram.y (grammar_declaration): Likewise.
4093 Use muscle_code_grow, so that we don't need stype_line any more.
4094 All uses changed.
4095
4096 * src/muscle_tab.c (muscle_grow): Fix comment.
4097
4098 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
4099 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
4100 Update copyright year to 2006.
4101
4102 2006-01-03 Akim Demaille <akim@epita.fr>
4103
4104 Have glr.cc pass (some of) the calc.at tests.
4105 * data/glr.cc (b4_parse_param_orig): New.
4106 (b4_parse_param): Improve its definition, and bound it more
4107 clearly in the skeleton.
4108 (b4_epilogue): Append, instead of prepending, in order to keep
4109 #line consistency.
4110 Simplify the generation of auxiliary functions: locations and
4111 purity are mandated.
4112 (b4_global_tokens_and_yystype): Honor it.
4113 * data/location.cc (c++.m4): Don't include it.
4114 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
4115 and AT_SKEL_CC_IF.
4116 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
4117 AT_LALR1_CC_IF.
4118 Be sure to initialize the first position's filename.
4119 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
4120 mandated anyway.
4121 (AT_CHECK_CALC_GLR_CC): New.
4122 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
4123
4124 2006-01-02 Akim Demaille <akim@epita.fr>
4125
4126 * src/output.c (output_skeleton): Don't hard wire the inclusion of
4127 c.m4.
4128 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
4129 * data/glr.cc: Do not include stack.hh.
4130
4131 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4132
4133 * data/glr.c: Reformat whitespace with tabs.
4134 (b4_lpure_formals): Remove this unused m4 macro.
4135 * tests/cxx-type.at: Reformat whitespace with tabs.
4136 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
4137 since it's a member. Rename type to isNterm for clarity.
4138
4139 2005-12-29 Akim <akim@sulaco.local>
4140
4141 Let glr.cc catch up with symbol_value_print.
4142 * data/glr.cc (b4_yysymprint_generate): Replace by...
4143 (b4_yy_symbol_print_generate): this.
4144 (yy_symbol_print, yy_symbol_value_print): Declare them.
4145
4146 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
4147
4148 * src/location.h (boundary): Note that a line or column equal
4149 to INT_MAX indicates an overflow.
4150 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
4151 (rule_length_overflow, increment_rule_length, add_column_width):
4152 New functions.
4153 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
4154 (<SC_BRACED_CODE>"}"):
4155 Use increment_rule_length rather than incrementing it by hand.
4156 (adjust_location, handle_syncline): Diagnose overflow.
4157 (handle_action_dollar, handle_action_at):
4158 Fix bug with monstrosities like $-2147483648.
4159 Remove now-unnecessary checks.
4160 (scan_integer): Verify assumptions and remove now-unnecessary checks.
4161 (convert_ucn_to_byte): Verify assumptions.
4162 (handle_syncline): New arg LOC. All callers changed.
4163 Don't store through a value derived from char const * pointer.
4164
4165 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
4166 GCC warnings.
4167
4168 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
4169
4170 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
4171 Remove unnecessary forward static decls.
4172
4173 2005-12-27 Akim Demaille <akim@epita.fr>
4174
4175 * src/reader.c (grammar_current_rule_check): Also check that $$
4176 is used.
4177 Take the rule to check as argument, hence rename as...
4178 (grammar_rule_check): this.
4179 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
4180 Rename as...
4181 (grammar_rule_begin, grammar_rule_end): these, for consistency.
4182 (grammar_midrule_action, grammar_symbol_append): Now static.
4183 * tests/torture.at (input): Don't rely on the default action
4184 being always performed.
4185 * tests/calc.at: "Set" $$ even when the action is "cut" with
4186 YYERROR or other.
4187 * tests/actions.at (Exotic Dollars): Instead of using unused
4188 values, check that the warning is issued.
4189
4190 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
4191
4192 * NEWS: Improve wording for unused-value warnings.
4193
4194 2005-12-22 Akim Demaille <akim@epita.fr>
4195
4196 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
4197 (b4_yysymprint_generate): Rename as...
4198 (b4_yy_symbol_print_generate): this.
4199 Generate yy_symbol_print instead of yysymprint.
4200 Generate also yy_symbol_value_print, and use it.
4201
4202 2005-12-22 Akim Demaille <akim@epita.fr>
4203
4204 * NEWS: Warn about unused values.
4205 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
4206 a `used' member.
4207 (symbol_list_n_get, symbol_list_n_used_set): New.
4208 (symbol_list_n_type_name_get): Use symbol_list_n_get.
4209 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
4210 * src/reader.c (grammar_current_rule_check): Check that values are
4211 used.
4212 * src/symtab.c (symbol_print): Accept 0.
4213 * tests/existing.at: Remove the type information.
4214 Empty the actions.
4215 Remove useless actions (beware of mid-rule actions: perl -000
4216 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
4217 * tests/actions.at (Exotic Dollars): Use unused values.
4218 * tests/calc.at: Likewise.
4219 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4220 Likewise.
4221
4222 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
4223 rule_useful_p.
4224
4225 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
4226
4227 Undo 2005-12-01 tentative license wording change. The wording is
4228 still being reviewed by the lawyers, and we don't want to wait for
4229 them before publishing a test release. For now, revert to the
4230 previous wording.
4231 * NEWS: Undo 2005-12-01 change.
4232 * data/glr.c: Revert to previous license wording.
4233 * data/glr.cc: Likewise.
4234 * data/lalr1.cc: Likewise.
4235 * data/location.cc: Likewise.
4236 * data/yacc.c: Likewise.
4237
4238 * NEWS: Reword %destructor vs YYABORT etc.
4239 * data/glr.c: Use American spacing, for consistency.
4240 * data/glr.cc: Likewise.
4241 * data/lalr1.cc: Likewise.
4242 * data/yacc.c: Likewise.
4243 * data/yacc.c: Reformat comments slightly.
4244 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
4245 for consistency. Fix some spelling errors and reword recently-included
4246 text slightly.
4247 * tests/cxx-type.at: Cast results of malloc, for C++.
4248
4249 2005-12-21 Joel E. Denny <address@hidden>
4250
4251 * tests/cxx-type.at: Construct a tree, count the parents of shared
4252 nodes, and free each node once and only once. Previously, the memory
4253 for semantic values was leaked instead.
4254
4255 2005-12-21 Joel E. Denny <address@hidden>
4256
4257 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
4258 (yylval, yylloc): If pure, #define to yystackp->yyval and
4259 yystackp->yyloc similar to yychar and yynerrs.
4260 (yyparse): If pure, remove local yylval and yylloc. Add local
4261 yystackp to accommodate pure definitions of yylval and yylloc.
4262 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
4263 yylvalp and yyllocp to &yylval and &yylloc.
4264 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
4265 namespace. Previously, nerrs and char were missing, but lval and lloc
4266 weren't necessary.
4267 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
4268 yylvalp and yyllocp parameters since, if pure, these are now always
4269 accessible through yystackp. If not pure, they are still accessible
4270 globally.
4271 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
4272 `if (YYID (N))' to pacify lint.
4273
4274 2005-12-21 Akim Demaille <akim@epita.fr>
4275
4276 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
4277 destroy the RHS symbols of a rule.
4278 * data/yacc.c (yylen): Initialize to 0.
4279 Keep its value to the number of items to possibly shift.
4280 In particular, a regular successful parse that ends on YYFINAL by
4281 a (internal) YYACCEPT must not have yylen != 0.
4282 (yyerrorlab, yyreturn): Pop the RHS.
4283 Reorder a bit to emphasize the `shifting' bits of code.
4284 (YYPOPSTACK): Now accept a number of items to pop.
4285 * data/lalr1.cc: Likewise.
4286 * data/glr.c: Formatting changes.
4287 Use goto instead of fall through.
4288 * doc/bison.texinfo (Destructor Decl): Complete.
4289
4290 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4291
4292 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4293 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
4294 * djgpp/config.bat: Replace every occurence of the file name
4295 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4296 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4297 * djgpp/config.sed: Replace every occurence of the file name
4298 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4299 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4300 * djgpp/djunpack.bat: DJGPP specific file.
4301 * djgpp/fnchange.lst: DJGPP specific file.
4302 * djgpp/README.in: Add new information about how to unpack the bison
4303 source on MSDOS and other systems which have 8.3 file name restrictions
4304 using djunpack.bat and fnchange.lst.
4305
4306 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
4307
4308 * bootstrap (build_cvs_prefix): Remove; unused.
4309 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
4310 when getting gnulib.
4311
4312 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
4313
4314 * data/glr.c: Reorder typedef declarations for structs to match order
4315 of struct declarations.
4316 Rename yystack everywhere to yystackp except in yyparse where it's not
4317 a pointer.
4318 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
4319 consistency.
4320 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
4321 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
4322 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
4323 lint.
4324
4325 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
4326
4327 * tests/sets.at (Accept): Fix typos in regular expression used to
4328 sed out the final state number.
4329
4330 Work around portability problem on Solaris 10: flex-generated
4331 files include <stdio.h> before <config.h>, which messes up
4332 because the latter defines __EXTENSIONS__. Address the problem
4333 by creating two new little files that include <config.h> first,
4334 then include the flex-generated files. Rewrite everyone else
4335 to include <config.h> first, as well.
4336 * lib/timevar.c: Always include "config.h".
4337 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
4338 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
4339 (EXTRA_bison_SOURCES): New macro.
4340 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
4341 * src/system.h: Don't include config.h.
4342 * src/LR0.c: Include <config.h> first.
4343 * src/assoc.c: Likewise.
4344 * src/closure.c: Likewise.
4345 * src/complain.c: Likewise.
4346 * src/conflicts.c: Likewise.
4347 * src/derives.c: Likewise.
4348 * src/files.c: Likewise.
4349 * src/getargs.c: Likewise.
4350 * src/gram.c: Likewise.
4351 * src/lalr.c: Likewise.
4352 * src/location.c: Likewise.
4353 * src/main.c: Likewise.
4354 * src/muscle_tab.c: Likewise.
4355 * src/nullable.c: Likewise.
4356 * src/output.c: Likewise.
4357 * src/parse-gram.y: Likewise.
4358 * src/print.c: Likewise.
4359 * src/print_graph.c: Likewise.
4360 * src/reader.c: Likewise.
4361 * src/reduce.c: Likewise.
4362 * src/relation.c: Likewise.
4363 * src/state.c: Likewise.
4364 * src/symlist.c: Likewise.
4365 * src/symtab.c: Likewise.
4366 * src/tables.c: Likewise.
4367 * src/uniqstr.c: Likewise.
4368 * src/vcg.c: Likewise.
4369
4370 * src/parse-gram.y: Fix minor problems uncovered by lint.
4371 (current_lhs, current_lhs_location): Now static.
4372 (current_assoc): Remove unused variable.
4373
4374 Cleanups so that Bison-generated parsers have less lint.
4375 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
4376 Prepend /*ARGSUSED*/, for lint's sake.
4377 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
4378 definition if 'lint' is defined.
4379 (YYID): New macro (or function, if lint).
4380 All uses of /*CONSTCOND*/0 replaced by YYID(0).
4381 * data/yacc.c: Likewise.
4382 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
4383 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
4384 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
4385 is C++ only.
4386 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
4387 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
4388 Use YYID(0) rather than 0, for lint.
4389 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
4390 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
4391
4392 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
4393
4394 * tests/glr-regression.at
4395 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4396 Close memory leak reported by twlevo.
4397
4398 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
4399
4400 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
4401 all stacks.
4402 (yyparse): Iterate another stack in order to call user destructors.
4403 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4404 New test case.
4405 (Duplicated user destructor for lookahead): This test now is expected
4406 to succeed.
4407
4408 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
4409
4410 * NEWS: Document the following change.
4411 * data/yacc.c: Say "parser skeleton" rather than "file", since
4412 it's no longer just a file.
4413 * data/glr.c: Grant a special exception for C GLR parsers, that
4414 reads like the already-existing exception for C LALR(1) parsers.
4415 * data/glr.cc: Likewise.
4416 * data/lalr1.cc: Likewise.
4417 * data/location.cc: Likewise.
4418 * data/yacc.c: Reword the "written by" statement to clarify that
4419 it was the parser skeleton, not the entire output file.
4420 * data/glr.c: Written by Paul Hilfinger.
4421 * data/glr.cc: Written by Akim Demaille.
4422 * data/lalr1.cc: Likewise.
4423
4424 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
4425
4426 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
4427 Fix typos in previous change that broke 'make check'.
4428 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
4429 supported in C.
4430 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
4431 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
4432 We can revert this once things settle down.
4433
4434 * src/conflicts.c (conflicts_print): Don't print file name twice
4435 when %expect fails because there were no conflicts.
4436 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
4437 change.
4438 * tests/conflicts.at (%expect not enough, %expect too much):
4439 (%expect with reduce conflicts): Adjust to new behavior.
4440
4441 2005-11-18 Akim Demaille <akim@epita.fr>
4442
4443 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
4444 errors.
4445 * NEWS: Document this.
4446 * doc/bison.texinfo (Expect Decl): Likewise.
4447
4448 2005-11-16 Akim Demaille <akim@epita.fr>
4449
4450 Generalize the display of semantic values and locations in traces.
4451 * data/glr.c (yy_reduce_print): Fix indices (again).
4452 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
4453 literal integers.
4454 * data/lalr1.cc (yyreduce_print): Rename as...
4455 (yy_reduce_print): this.
4456 Display values and locations.
4457 * data/yacc.c (yy_reduce_print): Likewise.
4458 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
4459 (yysymprint): Move higher to be visible from yy_reduce_print).
4460 (yyparse): Adjust.
4461 * tests/calc.at: Adjust the expected length of the traces.
4462
4463 2005-11-14 Akim Demaille <akim@epita.fr>
4464
4465 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
4466 from 1 to N, while values and location start at 0.
4467 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
4468
4469 2005-11-14 Akim Demaille <akim@epita.fr>
4470
4471 * data/glr.c (yy_reduce_print): Fix the $ number.
4472
4473 2005-11-14 Akim Demaille <akim@epita.fr>
4474
4475 "Use" parse parameters.
4476 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
4477 * data/glr.c, data/glr.cc: Use them.
4478 * data/glr.c (YYUSE): Have a C++ definition that supports
4479 non-pointer types.
4480
4481 2005-11-14 Akim Demaille <akim@epita.fr>
4482
4483 * data/glr.c (yyexpandGLRStack): Declare only if defined.
4484
4485 2005-11-14 Akim Demaille <akim@epita.fr>
4486
4487 * data/glr.cc: New.
4488 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
4489
4490 2005-11-12 Akim Demaille <akim@epita.fr>
4491
4492 Let position and location be PODs.
4493 * data/location.cc (position::initialize, location::initialize): New.
4494 (position::position, location::location): Define only if
4495 b4_location_constructors is defined.
4496 * data/lalr1.cc (b4_location_constructors): Define it for backward
4497 compatibility.
4498 * doc/bison.texinfo (Initial Action Decl): Use initialize.
4499
4500 2005-11-12 Akim Demaille <akim@epita.fr>
4501
4502 * data/lalr1.cc: Move the body of the ctor and dtor into the
4503 parser file (instead of the header).
4504 Wrap the implementations in a "namespace yy".
4505
4506 2005-11-12 Akim Demaille <akim@epita.fr>
4507
4508 Have glr.c include its header file when created.
4509 * data/glr.c (b4_shared_declarations): New.
4510 Output them verbatim in the parser if !%defines, otherwise
4511 output then in the header file, and include it instead.
4512
4513 2005-11-11 Akim Demaille <akim@epita.fr>
4514
4515 * data/glr.c: Comment changes.
4516
4517 2005-11-11 Akim Demaille <akim@epita.fr>
4518
4519 When yydebug, report semantic and location values for reductions.
4520 * data/glr.c (yy_reduce_print): Report the semantic values and the
4521 locations.
4522 (YY_REDUCE_PRINT): Adjust.
4523 (yyglrReduce): Use them.
4524 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
4525 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
4526 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
4527 traces.
4528
4529 2005-11-10 Akim Demaille <akim@epita.fr>
4530
4531 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
4532 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
4533 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
4534
4535 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
4536
4537 * m4/cxx.m4, examples/Makefile.am: Don't build
4538 examples/calc++ if no C++ compiler is available. (trivial change)
4539
4540 2005-11-09 Akim Demaille <akim@epita.fr>
4541
4542 * src/scan-skel.l: Use a couple of asserts.
4543
4544 2005-11-03 Akim Demaille <akim@epita.fr>
4545
4546 In some (weird) cases, the final state number is incorrect.
4547 Reported by Alexandre Duret-Lutz.
4548 * src/LR0.c (state_list_append): Remove the computation of
4549 final_state.
4550 (save_reductions): Do it here.
4551 (get_state): Alpha conversion.
4552 (generate_states): Use a for loop.
4553 * src/gram.h (item_number_is_rule_number)
4554 (item_number_is_symbol_number): New.
4555 * src/state.c: Use assert.
4556 * src/system.h: Include assert.h.
4557 * tests/sets.at (Accept): New.
4558
4559 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4560
4561 * data/glr.c (yyfill): Adjust comment.
4562 (yyresolveAction): Initialize default location properly
4563 for empty right-hand sides.
4564 (yydoAction): Ditto.
4565 Add comment explaining apparently dead code.
4566 * tests/glr-regression.at
4567 (Incorrectly initialized location for empty right-hand side in GLR):
4568 New test.
4569
4570 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
4571
4572 * bootstrap (cleanup_gnulib): New function. Use it to clean up
4573 gnulib when interrupted. This fixes some race conditions and
4574 works around some portability problems (one noted by Paul
4575 Hilfinger).
4576
4577 2005-10-22 Akim <akim@epita.fr>
4578
4579 * Makefile.cfg: Adjust to config -> build-aux.
4580 Reported by twledo.
4581
4582 2005-10-21 Akim Demaille <akim@epita.fr>
4583
4584 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
4585 the %parse-params.
4586 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
4587 * data/yacc.c (b4_Pure_if): Rename as...
4588 (b4_yacc_pure_if): this.
4589 (YY_SYMBOL_PRINT, yyparse): Adjust.
4590 * doc/bison.texinfo: Formatting changes.
4591
4592 2005-10-21 Akim Demaille <akim@epita.fr>
4593
4594 Finish the transition config -> build-aux.
4595 * configure.ac, Makefile.am: Use build-aux.
4596 * config/prev-version, config/announce-gen, config/Makefile.am:
4597 Move to...
4598 * build-aux/prev-version, build-aux/announce-gen,
4599 * build-aux/Makefile.am: here.
4600
4601 2005-10-14 Akim Demaille <akim@epita.fr>
4602
4603 * examples/calc++/test: Use set -x only when VERBOSE.
4604
4605 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
4606
4607 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
4608 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
4609
4610 2005-10-13 Akim Demaille <akim@epita.fr>
4611
4612 * src/scan-skel.l: Output the base name parts of the parser and
4613 header file names.
4614 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
4615 additional checks.
4616 Use this to exercise C++ outputs in subdirs.
4617 Reported by Oleg Smolsky.
4618
4619 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
4620
4621 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
4622 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
4623 Problem reported by John P. Hartmann.
4624 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
4625 already defined it.
4626
4627 2005-10-12 Akim Demaille <akim@epita.fr>
4628
4629 * src/parse-gram.y (version_check): Exit 63 to please missing
4630 (stands for "version mismatch).
4631 * tests/input.at, doc/bison.texinfo: Adjust.
4632
4633 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
4634
4635 Work around portability problems with Visual Age C compiler
4636 (xlc and xlC_r) reported by John P. Hartmann.
4637 * data/location.cc (initial_column, initial_line): Remove.
4638 All uses replaced by 0 and 1.
4639 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
4640 that xlc complains about.
4641 * src/scan-skel.l (skel_wrap): Likewise.
4642 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
4643 as __STDC__.
4644 * data/yacc.c (YYMODERN_C): New macro, which also looks at
4645 __STDC_VERSION__. Use it everywhere instead of looking at
4646 __STDC__ and __cplusplus.
4647
4648 2005-10-10 Akim Demaille <akim@epita.fr>
4649
4650 * examples/calc++/test: Be quiet unless VERBOSE.
4651
4652 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
4653
4654 * data/c.m4 (yydestruct, yysymprint):
4655 Use YYUSE instead of casting to void.
4656 * data/glr.c (YYUSE): New macro.
4657 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4658 Use it instead of rolling our own.
4659 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4660 (YYCHK1):
4661 Use /*CONSTCOND*/ to suppress lint warnings.
4662 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4663 (YY_STACK_PRINT): Use 'false' not '0'.
4664 (YYUSE): New macro.
4665 (yysymprint_, yydestruct_): Use it instead of rolling our own.
4666 * data/yacc.c (YYUSE): New macro.
4667 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
4668 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
4669 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
4670
4671
4672 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
4673 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
4674
4675 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
4676
4677 Undo the parts of the unlocked-I/O change that substituted
4678 putc or puts for printf. This might hurt performance a bit,
4679 but some people prefer the printf style.
4680 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
4681 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
4682 All uses replaced by YYFPRINTF and YYDPRINTF.
4683 * data/yacc.c: Likewise.
4684 * lib/bitset.c (bitset_print): Likewise.
4685 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
4686 putc and puts.
4687 * lib/lbitset.c (debug_lbitset): Likewise.
4688 * src/closure.c (print_firsts, print_fderives): Likewise.
4689 * src/gram.c (grammar_dump): Likewise.
4690 * src/lalr.c (look_ahead_tokens_print): Likewise.
4691 * src/output.c (escaped_output): Likewise.
4692 (user_actions_output): Break apart two printfs.
4693 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
4694 * src/reduce.c (reduce_print): Likewise.
4695 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4696 * src/system.h: Include unlocked-io.h rathe than stdio.h.
4697
4698 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4699 Use assignments rather than casts-to-void to suppress
4700 unused-variable warnings. This pacifies 'lint'.
4701 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
4702 unused-variable warnings.
4703
4704 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4705
4706 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4707
4708 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
4709
4710 Use unlocked I/O for a minor performance improvement on hosts like
4711 GNU/Linux and Solaris that support unlocked I/O. The basic idea
4712 is to use the gnlib unlocked-io module, and to prefer putc and
4713 puts to printf when either will work (since the latter doesn't
4714 come in an unlocked flavor).
4715 * bootstrap (gnulib_modules): Add unlocked-io.
4716 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
4717 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
4718 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
4719 and similarly for puts and putc and printf.
4720 * data/yacc.c: Likewise.
4721 * lib/bitset.c (bitset_print): Likewise.
4722 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
4723 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
4724 to printf.
4725 * lib/lbitset.c (debug_lbitset): Likewise.
4726 * src/closure.c (print_firsts, print_fderives): Likewise.
4727 * src/gram.c (grammar_dump): Likewise.
4728 * src/lalr.c (look_ahead_tokens_print): Likewise.
4729 * src/output.c (escaped_output): Likewise.
4730 (user_actions_output): Coalesce two printfs.
4731 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
4732 * src/reduce.c (reduce_print): Likewise.
4733 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4734 * src/system.h: Include unlocked-io.h rather than stdio.h.
4735
4736 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
4737 this confuses xgettext.
4738
4739 2005-10-02 Akim Demaille <akim@epita.fr>
4740
4741 * bootstrap (gnulib_modules): Add strverscmp.
4742 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
4743 * m4/.cvsignore: Add strverscmp.m4.
4744 * src/parse-gram.y (%require): New token, new rule.
4745 (version_check): New.
4746 * src/scan-gram.l (%require): Adjust.
4747 * tests/input.at (AT_REQUIRE): New.
4748 Use it.
4749 * doc/bison.texinfo (Require Decl): New.
4750 (Calc++ Parser): Use %require.
4751
4752 2005-10-02 Akim Demaille <akim@epita.fr>
4753
4754 * data/location.cc: New.
4755
4756 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
4757 Akim Demaille <akim@epita.fr>
4758
4759 Make sure -odir/foo.cc creates dir/location.hh etc.
4760 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
4761 (spec_file_prefix, spec_verbose_file, spec_graph_file)
4762 (spec_defines_file): Now const.
4763 (dir_prefix): New.
4764 (short_base_name): Remove.
4765 * src/files.c: Adjust.
4766 (dirname.h): Include.
4767 (base_name): Don't prototype it.
4768 (finput): Remove, duplicates gram_in.
4769 (full_base_name, short_base_name): Replace by...
4770 (all_but_ext, all_but_tab_ext): these.
4771 (compute_base_names): Rename as...
4772 (compute_file_name_parts): this.
4773 Update to compute the new variables, including dir_prefix.
4774 Adjust dependencies.
4775 * src/output.c (prepare): Output them.
4776 * src/reader.c: Adjust to use gram_in, not finput.
4777 * src/scan-skel.l (@dir_prefix@): New.
4778
4779 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4780
4781 * lib/subpipe.c: New function end_of_output_subpipe() added
4782 to allow support for non-posix systems. This is a no-op function
4783 for posix systems.
4784
4785 * lib/subpipe.h: New function end_of_output_subpipe() added
4786 to allow support for non-posix systems. This is a no-op function
4787 for posix systems.
4788
4789 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
4790 handle the lack of pipe/fork functionality on non-posix systems.
4791
4792 * djgpp/Makefile.maint: DJGPP specific file.
4793
4794 * djgpp/README.in: DJGPP specific file.
4795
4796 * djgpp/config.bat: DJGPP specific configuration file.
4797
4798 * djgpp/config.sed: DJGPP specific configuration file.
4799
4800 * djgpp/config.site: DJGPP specific configuration file.
4801
4802 * djgpp/config_h.sed: DJGPP specific configuration file.
4803
4804 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
4805
4806 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
4807
4808 2005-10-02 Akim Demaille <akim@epita.fr>
4809
4810 * data/location.cc: New, extract from...
4811 * data/lalr1.cc: here.
4812 (location.hh): Include it after the user prologue, in case the
4813 filename type is defined by the user.
4814 Forward declation location and position before the pre-prologue.
4815 (yyresult_): Rename as...
4816 (yyresult): this, it's a local variable, not an attribute.
4817 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
4818
4819 2005-10-01 Akim Demaille <akim@epita.fr>
4820
4821 * examples/extexi: Restore the #line generation.
4822
4823 2005-09-30 Akim Demaille <akim@epita.fr>,
4824 Alexandre Duret-Lutz <adl@gnu.org>
4825
4826 Move the token type and YYSTYPE in the parser class.
4827 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
4828 (parser::token): New, from the moved free definition of tokens.
4829 (parser::semantic_value): Now a full definition instead of an
4830 indirection to YYSTYPE.
4831 (b4_post_prologue): No longer included in the header file, but
4832 in the implementation file.
4833 * doc/bison.texi (C+ Language Interface): Update.
4834 * src/parse-gram.y: Support unary %define.
4835 * tests/actions.at: Define global_tokens_and_yystype for backward
4836 compatibility until we update the tests.
4837 * tests/calc.at: Idem.
4838 (first_line, first_column, last_line, last_column): Define for lalr1.cc
4839 to simplify the code.
4840
4841 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
4842
4843 Port to SunOS 4.1.4, which lacks strtoul and strerror.
4844 Ah, the good old days! Problem reported by Peter Klein.
4845 * bootstrap (gnulib_modules): Add strerror, strtoul.
4846 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
4847 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
4848
4849 2005-09-29 Akim Demaille <akim@epita.fr>
4850
4851 * data/c.m4 (b4_error_verbose_if): New.
4852 * data/lalr1.cc: Use it.
4853 (YYERROR_VERBOSE_IF): Remove.
4854 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
4855 parser members, replaced by...
4856 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
4857 local variables.
4858 (yysyntax_error_): Takes the state number as argument.
4859 (yyreduce_print_): Use the argument yyrule, not the former
4860 attribute yyn_.
4861
4862 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
4863
4864 * bootstrap (gnulib_modules): Add verify.
4865 * lib/.cvsignore: Add verify.h.
4866 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
4867 * src/system.h (verify): Remove.
4868 Include verify.h instead.
4869 * src/tables.c (tables_generate): Use new API for 'verify'.
4870
4871 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
4872
4873 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
4874 local variables whose names begin with 'yy'.
4875 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4876 Trivial changes from Joel E. Denny.
4877
4878 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
4879 it itself.
4880 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
4881 don't use alloca any more.
4882
4883 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
4884 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
4885 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
4886 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
4887 to match yacc.c, to test more hosts.
4888
4889 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
4890
4891 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
4892 doesn't affect behavior.
4893 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
4894 Solaris, AIX, MSC.
4895 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
4896 This works a bit better with glibc, if user code has already included
4897 stdlib.h.
4898 * doc/bison.texinfo (Bison Parser): Document that users can't
4899 arbitrarily use malloc and free for other purposes. Document
4900 that <alloca.h> and <malloc.h> might be included.
4901 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
4902 user must declare alloca.
4903
4904 * HACKING (release): Forwarn the Translation Project about
4905 stable releses.
4906
4907 2005-09-20 Akim Demaille <akim@epita.fr>
4908
4909 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
4910
4911 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
4912
4913 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
4914 (YYSTACK_ALLOC_MAXIMUM): Use it.
4915 (yysyntax_error): New function.
4916 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
4917 multiple syntax errors are reported, and alloca is being used.
4918 Instead, reallocate buffers twice as big each time, so that
4919 we waste at most half the allocated memory. Start with a small
4920 (128-byte) buffer that will suffice in most cases anyway.
4921 Use yysyntax_error to do most of the work.
4922
4923 * doc/bison.texinfo (Error Reporting, Table of Symbols):
4924 yynerrs is the number of errors reported, not the number of
4925 errors encountered.
4926
4927 * tests/glr-regression.at (Duplicated user destructor for lookahead):
4928 Mark it as expected to fail.
4929 Cast result of malloc; problem reported by twlevo@xs4all.nl.
4930 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
4931 Don't start user-code symbols with "yy", to avoid name space problems.
4932
4933 2005-09-19 Akim Demaille <akim@epita.fr>
4934
4935 Remove the traits, failed experiment.
4936 It never proved useful, and anyway because of the current
4937 definition, it was not possible to have several specialization of
4938 this traits, making it useless.
4939 * data/lalr1.cc (yy:traits): Remove.
4940 Inline its definitions in the parser class.
4941
4942 2005-09-19 Akim Demaille <akim@epita.fr>
4943
4944 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
4945 least Mac OSX with a /usr/local install of gettext.
4946
4947 2005-09-19 Akim Demaille <akim@epita.fr>
4948
4949 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
4950 and yytoken for similarity with the other skeletons.
4951
4952 2005-09-19 Akim Demaille <akim@epita.fr>
4953
4954 * NEWS, configure.ac: update version number to 2.1a.
4955
4956 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
4957
4958 * NEWS: Version 2.1.
4959
4960 * NEWS: Remove notice of yytname change, since it was never in an
4961 official release.
4962 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
4963 diagnostic.
4964 * src/output.c (prepare): Likewise.
4965 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
4966 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
4967 is not defined. This is an awful hack, but it's enough for now.
4968 All callers changed.
4969 * tests/glr-regression-at (make_value): Args are const pointers now,
4970 to avoid GCC warning.
4971 (Duplicated user destructor for lookahead): New test. Currently
4972 skipped. It fails on my host but I'm not sure it'll always fail.
4973
4974 2005-09-16 Akim Demaille <akim@epita.fr>
4975
4976 * src/symtab.h (struct symbol): Declare the printer and destructor
4977 as const, to avoid accidental calls to free.
4978 (symbol_destructor_set, symbol_printer_set): Adjust.
4979 * src/symtab.c: Adjust.
4980
4981 2005-09-16 Akim Demaille <akim@epita.fr>
4982
4983 * data/c.m4 (b4_token_enums): New.
4984 (b4_token_defines): Rename as...
4985 (b4_token_enums_defines): this.
4986 (b4_token_defines): New, output only the #defines.
4987 * data/yacc.c, data/glr.c: Adjust.
4988 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
4989 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
4990 as default values.
4991
4992 2005-09-16 Akim Demaille <akim@epita.fr>
4993
4994 * data/lalr1.cc (yylex_): Remove, inline its code.
4995 (yyreport_syntax_error_): Remove, replaced by...
4996 (yysyntax_error_): this which returns a string and leaves to the
4997 caller the call to the users' error function.
4998 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
4999 Move from members of the parser object...
5000 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
5001 to local variables of the parse function.
5002
5003 2005-09-16 Akim Demaille <akim@epita.fr>
5004
5005 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
5006 since it's in Bison's name space.
5007
5008 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
5009
5010 * data/glr.c (yyresolveValue): Add default case to pacify
5011 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
5012
5013 * NEWS: Document when yyparse started to return 2.
5014 * doc/bison.texinfo (Parser Function): Document when yyparse
5015 returns 2.
5016
5017 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
5018 (b4_filename_type): Renamed back from b4_file_name_type. All uses
5019 changed.
5020 (class position): file_name -> filename (reverting). All uses changed.
5021
5022 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
5023
5024 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
5025 do anything if $@ exists. This reverts part of the 2005-07-07
5026 patch.
5027
5028 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
5029
5030 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
5031 contains obsolete information and isn't worth distributing as a
5032 separate file anyway.
5033 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
5034 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
5035 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
5036 (yyparse): Abort if user code uses longjmp to throw an unexpected
5037 value.
5038
5039 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
5040
5041 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
5042 Suggested by twlevo@xs4all.nl.
5043
5044 * data/glr.c (YYCHK1): Do not assume YYE is in range.
5045 This avoids a diagnostic from gcc -Wswitch-enum.
5046 Problem reported by twlevo@xs4all.nl.
5047
5048 * doc/bison.texinfo: Don't use "filename", as per GNU coding
5049 standards. Use "file name" or "file" or "name", depending on
5050 the context.
5051 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
5052 not to hack/foo.tab.c.
5053 (Calc++ Top Level): 2nd arg of main is not const.
5054 * data/glr.c: b4_filename -> b4_file_name.
5055 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
5056 All uses changed.
5057 (class position): filename -> file_name. All uses changed.
5058 * data/yacc.c: b4_filename -> b4_file_name.
5059 * lib/bitset.h: filename -> file_name in local vars.
5060 * lib/bitset_stats.c: Likewise.
5061 * src/files.c: Likewise.
5062 * src/scan-skel.l ("@output ".*\n): Likewise.
5063 * src/files.c (file_name_split): Renamed from filename_split.
5064 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
5065
5066 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
5067
5068 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
5069 to accommodate latest gnulib.
5070
5071 * tests/glr-regression.at (Duplicate representation of merged trees):
5072 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
5073
5074 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
5075 needed.
5076
5077 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
5078
5079 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
5080 All uses changed. Invoke user destructor after an error during a
5081 split parse (trivial change from Joel E. Denny).
5082
5083 * tests/glr-regression.at
5084 (User destructor after an error during a split parse): New test case.
5085 Problem reported by Joel E. Denny in:
5086 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
5087
5088 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
5089
5090 * README-cvs: Give URLs for recommended tools.
5091 Mention Gzip version problem, and bootstrapping issues.
5092 Remove troubleshooting section, as it's somewhat obsolete.
5093
5094 * bootstrap (no_cache): New var, to accommodate different wget
5095 variants. Use it instead of '-C off'. Problem reported by
5096 twlevo@xs4all.nl.
5097
5098 * data/glr.c (yydestroyStackItem): New function.
5099 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
5100 debugging information. Problem reported by Joel E. Denny.
5101
5102 2005-08-25 Akim Demaille <akim@epita.fr>
5103
5104 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
5105
5106 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
5107
5108 * data/glr.c (yyrecoverSyntaxError, yyreturn):
5109 Don't invoke destructor on unresolved entries.
5110 * tests/glr-regression.at
5111 (User destructor for unresolved GLR semantic value): New test case.
5112 Problem reported by Joel E. Denny in:
5113 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
5114
5115 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
5116
5117 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
5118 Add strnlen.c.
5119 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
5120 lib-prefix.m4, po.m4.
5121
5122 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
5123 in yydestruct diagnostic, since it might not be an error.
5124 Problem reported by Joel Denny near end of
5125 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5126 * data/lalr1.cc (yyerturn): Likewise.
5127 * data/yacc.c (yyreturn): Likewise.
5128 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
5129
5130 * src/files.c: Remove obsolete FIXME comment.
5131
5132 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
5133 with the other templates, and to fix bogus run-on messages such
5134 as the one reported at the end of
5135 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5136 All callers changed to avoid the newline.
5137 (yyprocessOneStack): Output two lines rather than one, to accommodate
5138 the above change. This changes the debug output format slightly.
5139
5140 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
5141 reported by Joel E. Denny in
5142 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
5143 (trivial change).
5144 * tests/glr-regression.at (Duplicate representation of merged trees):
5145 New test, from Joel E. Denny in:
5146 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
5147 * THANKS: Add Joel E. Denny.
5148
5149 * configure.ac (AC_INIT): Bump to 2.0c.
5150
5151 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
5152
5153 * NEWS: Version 2.0b.
5154
5155 * Makefile.am (SUBDIRS): Put examples before tests, so that
5156 "make check" doesn't finish with "All 1 tests passed".
5157
5158 * tests/regression.at (Token definitions): Don't rely on
5159 AT_PARSER_CHECK for data that contains backslashes. It currently
5160 uses 'echo', and 'echo' isn't portable if its argument contains
5161 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
5162 that the byte '\0xff' is not printable in the C locale; it is,
5163 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
5164 not printable, so use '\0x81' to test.
5165
5166 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
5167 version of GCC, since the macro is used with non-GCC compilers.
5168
5169 Fix core dump reported by Pablo De Napoli in
5170 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
5171 * tests/regression.at (Invalid inputs with {}): New test.
5172 * src/parse-gram.y (token_name): Translate type before using
5173 it as an index.
5174
5175 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
5176 the user's name space. All uses changed to __attribute__
5177 ((__unused__)).
5178 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
5179 Add __attribute__ ((__noreturn__)).
5180
5181 * etc/clcommit: Remove. We weren't using it, and it failed
5182 "make maintainer-distcheck".
5183 * Makefile.maint: Merge from coreutils.
5184 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
5185 (syntax-check-rules): Change list of rules as described below.
5186 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
5187 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
5188 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
5189 (sc_trailing_space): New rules.
5190 (sc_xalloc_h_in_src): Remove.
5191 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
5192 (sc_space_tab, sc_error_exit_success, sc_changelog):
5193 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
5194 (makefile-check, po-check, author_mark_check):
5195 (makefile_path_separator_check, copyright-check):
5196 Use grep -n, to make it easier to find violations.
5197 Use CVS_LIST and CVS_LIST_EXCEPT.
5198 (header_regexp, h_re): Remove.
5199 (dd_c): New macro.
5200 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
5201 (my-distcheck): Use more-modern GCC flags.
5202 (signatures, %.asc): Remove.
5203 (rel-files, announcement): Remove signatures.
5204 Restore old updating code, even though we don't use it, so
5205 that we're the same as coreutils.
5206 (alpha, beta, major): Depend on news-date-check.
5207 Make the upload commands.
5208
5209 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
5210 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
5211 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
5212 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
5213 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
5214 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
5215 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
5216 * tests/sets.at: Likewise.
5217
5218 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
5219 we comment out the Autoconf version number.
5220 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
5221 it's error-prone and "make maintainer-distcheck" rejects it.
5222
5223 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
5224 Indent calls to "error" to pacify "make maintainer-distcheck",
5225 when the calls are not intended to be translated.
5226 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
5227
5228 * src/Makefile.am (DEFS): Use +=, to pacify
5229 "make maintainer-distcheck".
5230 (bison_SOURCES): Add scan-skel.h.
5231 (sc_tight_scope): New rule, from coreutils.
5232
5233 * src/files.c (src_extension, header_extension):
5234 Now static, not extern.
5235 * src/getargs.c (short_options): Likewise.
5236 * src/muscle_tab.c (muscle_table): Likewise.
5237 * src/parse-gram.y (current_class, current_type, current_prec):
5238 Likewise.
5239 * src/reader.c (grammar_end, previous_rule_end): Likewise.
5240 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
5241 * src/main.c (main): Cast bindtextdomain and textdomain calls to
5242 void, to avoid warning when NLS is disabled.
5243 * src/output.c: Include scan-skel.h.
5244 (scan_skel): Remove decl, since scan-skel.h does this.
5245 (output_skeleton):
5246 Indent calls to "error" to pacify "make maintainer-distcheck".
5247 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
5248 * src/reader.h (gram_end, gram_lineno): New decls to pacify
5249 "make maintainer-distcheck".
5250 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
5251 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
5252 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
5253 (skel_lex_destroy, scan_skel): Move these decls to...
5254 * src/scan-skel.h: New file.
5255 * src/uniqstr.c (uniqstr_assert):
5256 Indent calls to "error" to pacify "make maintainer-distcheck".
5257
5258 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
5259 not @VAR@.
5260
5261 * tests/torture.at: Revamp to avoid misuse of atoi that
5262 "make maintainer-distcheck" complained about.
5263
5264 * examples/extexi (message): Don't print a message more than once,
5265 and omit line-number decoration that makes Emacs compile think
5266 that informative messages are worth worrying about.
5267
5268 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
5269
5270 * configure.ac: Update version number.
5271
5272 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
5273 accidentally.
5274 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
5275 autogenerated by the maintainer.
5276 * examples/calc++/.cvsignore: Add *.yy.
5277
5278 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
5279 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5280 * lib/bitsetv.c (bitsetv_alloc): Likewise.
5281
5282 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
5283
5284 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
5285 from maintainer-distcheck about casting the argument of 'free'.
5286
5287 * NEWS: Mention recent yytname changes.
5288 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
5289
5290 * bootstrap: For translations that have not yet been upgraded to
5291 the new runtime-po domain, prime the pump by extracting the
5292 relevant strings from the obsolete translations. This code can be
5293 removed once the bison-runtime domain has been translated by each
5294 team.
5295
5296 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
5297 now that token names are already quoted.
5298
5299 Fix problem reported by Anthony Heading.
5300 * data/glr.c (YYTOKEN_TABLE): New macro.
5301 (yytname): Define if YYTOKEN_TABLE.
5302 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
5303 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
5304 (YYERROR_VERBOSE): Define the same way the other skeletons do.
5305 * src/output.c (prepare_symbols): Output token_table_flag.
5306
5307 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
5308
5309 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
5310 again if the first call fails.
5311
5312 * data/glr.c (yytnamerr): New function.
5313 (yyreportSyntaxError): Use it to dequote most string literals.
5314 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
5315 with other skeletons. All uses changed.
5316 (yytnameerr_): New function.
5317 (yyreport_syntax_error): Use it to dequote most string literals.
5318 * data/yacc.c (yytnamerr): New function.
5319 (yyerrlab): Use it to decode most string literals.
5320 * doc/bison.texinfo (Decl Summary, Calling Convention):
5321 Clarify quoting convention of yytname.
5322 * src/output.c (prepare_symbols): Quote all names. This undoes
5323 the 2005-04-17 change, which is now accomplished (mostly) via
5324 changes in the parsers as described above.
5325 * tests/regression.at (Token definitions, Web2c Actions):
5326 Undo most 2005-04-17 change here, too.
5327
5328 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
5329
5330 Fix more problems reported by twlevo@xs4all.nl.
5331 * tests/cxx-type.at: Don't pipe output of ./types through sed to
5332 remove trailing spaces. This loses the exit status of ./types,
5333 and isn't needed since ./types shouldn't be emitting trailing
5334 spaces.
5335 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
5336 as the stack isn't valid in that case.
5337
5338 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5339 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5340 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5341 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
5342 is used.
5343 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
5344 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5345 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5346 Likewise.
5347
5348 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
5349 overly-picky compilers that reject 'char *foo = "bar";'.
5350
5351 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
5352 to FILE * parameter, not to stderr. This fixes a typo introduced
5353 in the 2005-07-12 change.
5354
5355 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
5356 warnings from GCC 4.
5357
5358 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
5359 (yyglrShiftDefer, yysplitStack):
5360 Remove unused parameters b4_pure_formals. All uses changed.
5361 (yyglrShift): Remove unused parameters b4_user_formals.
5362 All uses changed.
5363 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
5364
5365 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
5366
5367 Destructor cleanups and regularization among the three skeletons.
5368 * NEWS: Document the behavior changes.
5369 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
5370 stack before failing, as the cleanup code will do it for us now.
5371 * data/lalr1.cc (yyerrlab): Likewise.
5372 * data/glr.c (yyparse): Pop everything off the stack before
5373 freeing it, so that destructors get called properly.
5374 * data/lalr1.cc (yyreturn): Likewise.
5375 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
5376 This is more consistent.
5377 * doc/bison.texinfo (Destructor Decl): Mention more reasons
5378 why destructors might be called. 1.875 -> 2.1.
5379 (Destructor Decl, Decl Summary, Table of Symbols):
5380 Some English-language cleanups for %destructor.
5381 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5382 Add output line for destructor of start symbol.
5383 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
5384 because of that same extra output line.
5385
5386 * NEWS: Document minor wording changes in diagnostics of
5387 Bison-generated parsers.
5388 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
5389 Remove unused formals. All uses changed.
5390 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
5391 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
5392 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
5393 Rename yyoverflowab to yyexhaustedlab.
5394 When memory exhaustion occurs during syntax-error reporting,
5395 report it separately rather than in a single diagnostic; this
5396 eases translation.
5397 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
5398 (Memory Exhausted): Renamed from Parser Stack Overflow.
5399 Revamp wording slightly to prefer "memory exhaustion".
5400 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
5401
5402 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
5403
5404 Add i18n support to the GLR skeleton. Partially fix the C++
5405 skeleton; a C++ expert needs to finish this. Remove debugging
5406 msgids; there's little point to having them translated, since they
5407 can be understood only by someone who can read the
5408 (English-language) source code.
5409
5410 Generate runtime-po/bison-runtime.pot automatically, so that we
5411 don't have to worry about garbage getting in that file. We'll
5412 make sure after the next official release that old msgids don't
5413 get lost. See
5414 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
5415
5416 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
5417 Now auto-generated.
5418 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
5419 Fix typos in explanations of the runtime file.
5420 * bootstrap: Change gettext keyword from YYI18N to YY_.
5421 Use standard Makefile.in.in in runtime-po, since we'll arrange
5422 for backward-compatible bison-runtime.po files in a different way.
5423 * data/glr.c (YY_): New macro, from yacc.c.
5424 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
5425 Translate messages intended for users.
5426 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
5427 the wording in the other skeletons. We don't know that the memory
5428 is virtual.
5429 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
5430 Use same method that yacc.c uses.
5431 Don't translate debugging messages.
5432 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
5433 it doesn't work (yet), and requires C++ expertise to fix.
5434 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
5435 Move defn to a more logical place, to be consistent with other
5436 skeletons.
5437 Don't translate debugging messages.
5438 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
5439 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
5440 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
5441 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
5442
5443 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
5444 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
5445 void, not int.
5446 * tests/glr-regression.at (Badly Collapsed GLR States):
5447 Likewise.
5448 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5449 yylex should return 0 at EOF rather than aborting.
5450
5451 Improve tests for stack overflow in GLR parser.
5452 Problem reported by twlevo@xs4all.nl.
5453 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
5454 All uses removed.
5455 (yyStackOverflow): Just longjmp, but with value 2 so that caller
5456 can handle the problem.
5457 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
5458 (yyparse): New local variable yyresult to record the result.
5459 Use result of setjmp to set it, rather than storing itinto
5460 struct.
5461 (yyDone): Remove label.
5462 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
5463 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
5464 if YYABORT is used).
5465 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
5466 yyparse status; put status > 1 into diagnostic.
5467 Check that status==2 works.
5468 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
5469 Use exit status 3 for failure to open (which shouldn't happen).
5470
5471 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
5472
5473 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
5474 1 on syntax error; just let yyparse do its thing.
5475 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
5476 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
5477 (Exploding the Stack Size with Alloca):
5478 (Exploding the Stack Size with Malloc):
5479 Expect exit status 2, not 1, since the parser is supposed to blow
5480 its stack. Problem reported by twlevo@xs4all.nl.
5481
5482 * data/glr.c (yyparse): Don't assume that the initial calls
5483 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
5484 Print a stack-overflow message and fail instead.
5485 Initialize the line-number information before creating the stack,
5486 so that the stack-overflow message can report line zero safely.
5487
5488 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
5489
5490 Fix problems reported by twlevo@xs4all.nl.
5491 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
5492 (yyuserMerge): Provide a default case if b4_mergers is empty.
5493 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
5494 * tests/glr-regression.at
5495 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5496 Add casts to pacify C++ compilers.
5497 * tests/glr-regression.at (Improper merging of GLR delayed action
5498 sets): Declare yylex before using it.
5499 * tests/Makefile.am (maintainer-check-g++): Fix a stray
5500 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
5501 test for valgrind; valgrind is independent of g++.
5502 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
5503 for compatibility with POSIX 1003.1-2001 (if running coreutils).
5504 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
5505 Use a destructor, so that we can expand the stack. Change
5506 YYSTYPE to char * so that we can free it. Cast result of malloc.
5507
5508 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5509
5510 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
5511 a valgrind failure. Problem reported by twlevo@xs4all.nl.
5512
5513 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
5514
5515 * PACKAGING: New file, suggested by Bruno Haible and taken from
5516 similar wording in gettext's PACKAGING file.
5517 * NEWS: Mention PACKAGING.
5518 * Makefile.am (EXTRA_DIST): Add PACKAGING.
5519
5520 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
5521
5522 * NEWS: Document recent i18n improvements.
5523 * bootstrap: Get runtime translations into runtime-po.
5524 Create runtime-po files automatically, if possible.
5525 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
5526 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
5527 does not infringe on the user's name space.
5528 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
5529 * doc/bison.texinfo (Internationalization): Revamp the English
5530 and Texinfo syntax a bit, to try to make it clearer.
5531 (Bison Options, Option Cross Key): Mention --print-localedir.
5532 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
5533 YYENABLE_NLS. Quote a bit more.
5534 * runtime-po/.cvsignore: New file.
5535 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
5536 * runtime-po/Rules-quot: Remove; now created by bootstrap.
5537 * runtime-po/quot.sed: Likewise.
5538 * runtime-po/boldquot.sed: Likewise.
5539 * runtime-po/en@quot.header: Likewise.
5540 * runtime-po/en@boldquot.header: Likewise.
5541 * runtime-po/insert-header.sin: Likewise.
5542 * runtime-po/remove-potcdate.sin: Likewise.
5543 * runtime-po/Makevars: Likewise.
5544 * runtime-po/LINGUAS: Likewise.
5545 * runtime-po/de.po: Likewise; we will rely on the translation project
5546 to maintain this, so "bootstrap" should get it.
5547 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
5548 its value.
5549 * src/main.c (main): Bind the bison-runtime domain, too.
5550
5551 2005-07-12 Bruno Haible <bruno@clisp.org>
5552
5553 * data/yacc.c: Include <libintl.h> when NLS is enabled.
5554 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
5555 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
5556 * runtime-po: New directory.
5557 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
5558 $(DOMAIN).pot-update rule, so that old messages are never dropped.
5559 * runtime-po/Rules-quot: New file, copied from po/.
5560 * runtime-po/quot.sed: Likewise.
5561 * runtime-po/boldquot.sed: Likewise.
5562 * runtime-po/en@quot.header: Likewise.
5563 * runtime-po/en@boldquot.header: Likewise.
5564 * runtime-po/insert-header.sin: Likewise.
5565 * runtime-po/remove-potcdate.sin: Likewise.
5566 * runtime-po/Makevars: New file.
5567 * runtime-po/POTFILES.in: New file.
5568 * runtime-po/LINGUAS: New file.
5569 * runtime-po/bison-runtime.pot: New file.
5570 * runtime-po/de.po: New file.
5571 * m4/bison.m4: New file.
5572 * Makefile.am (SUBDIRS): Add runtime-po.
5573 (aclocaldir, aclocal_DATA): New variables.
5574 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
5575 Define aclocaldir.
5576 * src/getargs.c (usage): Document --print-localedir option.
5577 (PRINT_LOCALEDIR_OPTION): New enum item.
5578 (long_options): Add --print-localedir option.
5579 (getargs): Handle --print-localedir option.
5580 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
5581 (Internationalization): New section.
5582
5583 2005-07-12 Akim Demaille <akim@epita.fr>
5584
5585 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
5586 for consistency with the rest of the code.
5587 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
5588 Add separators.
5589
5590 2005-07-12 Akim Demaille <akim@epita.fr>
5591
5592 * src/parse-gram.y: Use %printer instead of YYPRINT.
5593
5594 2005-07-12 Akim Demaille <akim@epita.fr>
5595
5596 * src/symtab.h, src/symtab.c (symbol_print): New.
5597 * src/symlist.h, src/symlist.c (symbol_list_print): New.
5598 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
5599
5600 2005-07-12 Akim Demaille <akim@epita.fr>
5601
5602 * data/glr.c (b4_syncline): Fix (swap) the definitions of
5603 b4_at_dollar and b4_dollar_dollar.
5604
5605 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
5606
5607 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
5608 and Pennello's paper.
5609
5610 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
5611
5612 * data/yacc.c (yyparse): Undo previous patch. Instead,
5613 set yylsp[0] and yyvsp[0] only if the initial action
5614 sets yylloc and yylval, respectively.
5615
5616 * data/yacc.c (yyparse): In the initial action, set
5617 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
5618 This avoids the use of undefined variables if the initial
5619 action does not set yylloc and/or yylval.
5620
5621 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5622
5623 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
5624 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
5625 Remove from CVS. These files are automatically generated.
5626 * examples/extexi: Clarify that this file is now part of Bison,
5627 not GNU M4, and that it works with any POSIX-compatible Awk.
5628 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
5629 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
5630 so that we also get calc++-parser.yy. Geneate it.
5631 Use $(AWK), not gawk, since any conforming Awk will do.
5632 Put comment before action, since older 'make' can't handle comment
5633 in action.
5634 $(BUILT_SOURCES): List all built sources, not just some of them.
5635 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
5636 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
5637 $($(calc_sources_generated)): Remove unnecessary test for existence
5638 of target. (This had a shell syntax error anyway; a stray "x".)
5639 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
5640 calc++-parser.yy.
5641 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
5642
5643 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
5644 implied by the other modules.
5645
5646 2005-07-06 Akim Demaille <akim@epita.fr>
5647
5648 Bind examples/calc++ to the package.
5649 * examples/calc++/Makefile: Remove, replaced by...
5650 * examples/calc++/Makefile.am: ... this new file.
5651 * examples/calc++/test: Remove input.
5652 * examples/calc++/compile: Remove.
5653 * examples/Makefile.am: New.
5654 * configure.ac, Makefile.am: Adjust.
5655 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
5656
5657 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
5658
5659 * data/glr.c (yyFail): Drastically simplify; since the format argument
5660 never had any % directives, we can simply pass it to yyerror.
5661 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
5662 be modified later, as that is the usual style in glr.c.
5663 Problems reported by Paul Hilfinger.
5664
5665 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
5666 and size overflow errors.
5667 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
5668 in case the user prolog sets feature-test macros like _GNU_SOURCE.
5669 (YYSIZEMAX): New macro.
5670 (yystpcpy): New function, taken from yacc.c.
5671 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
5672 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
5673 so that we don't have to maintain their signatures.
5674 (yyFail): Check for buffer overflow, by using vsnprintf rather
5675 than vsprintf. Allocate a bigger buffer if possible.
5676 Report an error if buffer allocation fails.
5677 (yyStackOverflow): New function.
5678 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
5679 the initialization was successful. It might fail if storage was
5680 exhausted.
5681 (yyexpandGLRStack): Add more checks for storage allocation failure.
5682 Use yyStackOverflow to report failures.
5683 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
5684 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
5685 Don't assume stack number fits in int.
5686 (yysplitStack): Check for storage allocation failure.
5687 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
5688 can print diagnostics on storage allocation failure. All callers
5689 changed.
5690 (yyresolveValue): Use yybool for boolean.
5691 (yyreportSyntaxError): Check for size-calculation overflow.
5692 This code is taken from yacc.c.
5693 (yyparse): Check for storage allocation errors when allocating
5694 the initial stack.
5695
5696 2005-07-05 Akim Demaille <akim@epita.fr>
5697
5698 Extract calc++ from the documentation.
5699 * doc/bison.texinfo (Calc++): Add the extraction marks.
5700 * examples/extexi: New, from the aborted GNU Programming 2E.
5701 Separate the different paragraph of a file with empty lines.
5702 * examples/Makefile: Use it to extract the whole calc++ example.
5703
5704 2005-06-24 Akim Demaille <akim@epita.fr>
5705
5706 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
5707 class typedefs.
5708
5709 2005-06-22 Akim Demaille <akim@epita.fr>
5710
5711 * doc/bison.texinfo (C++ Language Interface): First stab.
5712 (C++ Parsers): Remove.
5713
5714 2005-06-22 Akim Demaille <akim@epita.fr>
5715
5716 * data/lalr1.cc (yylex_): Honor %lex-param.
5717
5718 2005-06-22 Akim Demaille <akim@epita.fr>
5719
5720 Start a set of simple examples.
5721 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
5722 * examples/calc++/calc++-driver.hh,
5723 * examples/calc++/calc++-parser.yy,
5724 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
5725 * examples/calc++/compile, examples/calc++/test: New.
5726
5727 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
5728
5729 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
5730 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
5731 which stems from the 2005-05-27 patch.
5732
5733 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5734
5735 * data/glr.c: Modify treatment of unused parameters to permit use
5736 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
5737
5738 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
5739
5740 Fix infringement on user name space reported by Janos Zoltan Szabo.
5741 * data/yacc.c (yyparse): strlen -> yystrlen.
5742
5743 2005-05-30 Akim Demaille <akim@epita.fr>
5744
5745 * data/lalr1.cc (_): New.
5746 Translate the various messages.
5747
5748 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
5749
5750 Fix infringement on user name space reported by Bruno Haible.
5751 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
5752 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
5753 the user's name space.
5754 (alloca): Include <stdlib.h> to get it, if it's not built in.
5755 (YYMALLOC, YYFREE): Define only if needed.
5756 (malloc, free): Declare, but only if needed, as this infringes on
5757 the user name space.
5758
5759 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
5760
5761 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
5762 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
5763 with %d format.
5764 * lib/ebitset.c (min, max): Undef before defining.
5765 * lib/vbitset.c (min, max): Likewise.
5766 * lib/subpipe.c (create_subpipe): Save local variables in case
5767 vfork clobbers them.
5768
5769 2005-05-24 Bruno Haible <bruno@clisp.org>
5770
5771 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
5772 error message syntax used by gcc-4.0.
5773
5774 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
5775
5776 * README: Mention m4 1.4.3. Remove obsolete advice about
5777 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
5778
5779 * bootstrap: Remove workaround for problem I encountered with
5780 gettext 0.14.1; it seems to be fixed now.
5781
5782 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
5783
5784 * NEWS: Version 2.0a.
5785
5786 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
5787 the previous change.
5788
5789 Various maintainer cleanups.
5790 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
5791 conftest*, for benefit of CVS commands run at the same time as
5792 "configure". Add build-aux, since "bootstrap" now creates it and
5793 its subfiles.
5794 * Makefile.cfg (move_if_change): Remove.
5795 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
5796 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
5797 (po_repo, do-po-update, po-update, wget_files, get-targets):
5798 (config.guess-url_prefix, config.sub-url_prefix):
5799 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
5800 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
5801 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
5802 Remove.
5803 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
5804 this is now the recommended name.
5805 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
5806 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
5807 ylwrap. These files now go into build-aux.
5808 * config/move-if-change: Remove.
5809 * config/prev-version.txt: Bump from 1.75 to 2.0.
5810
5811 * bootstrap: Add stdio-safer, unistd-safer modules.
5812 Remove m4/glibc2.m4 (introduced by latest gnulib, but
5813 we don't need it).
5814 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
5815 fopen-safer.c, stdio-safer.h, unistd-safer.h.
5816 * lib/subpipe.c: Include "unistd-safer.h".
5817 (create_subpipe): Make sure all the newly-created
5818 file descriptors are > 2, so that diagnostics don't
5819 get sent down them (which might cause Bison to hang, in theory).
5820 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
5821 * src/files.c (xfopen): Use fopen_safer, not fopen.
5822
5823 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
5824 yesterday's yacc.c fix.
5825
5826 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
5827
5828 * data/glr.c, data/lalr1.cc: Update copyright date.
5829
5830 Fix a destructor bug reported by Wolfgang Spraul in
5831 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
5832 * data/yacc.c (yyabortlab): Don't call destructor, and
5833 don't set yychar to EMPTY.
5834 (yyoverflowlab): Don't call destructor.
5835 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
5836 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
5837 since we no longer output the message "discarding lookahead token
5838 end of input ()".
5839
5840 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5841
5842 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
5843 fix a small glitch in debugging output.
5844 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
5845 after YY_SYMBOL_PRINT where needed.
5846
5847 (struct yyGLRState): Add some comments.
5848 (struct yySemanticOption): Add some comments.
5849 (union yyGLRStackItem): Add comment.
5850
5851 (yymergeOptionSets): Correct this to properly perform the union,
5852 avoiding infinite reported by Michael Rosien.
5853 Update comment.
5854
5855 * tests/glr-regression.at: Add test for GLR merging error reported
5856 by M. Rosien.
5857
5858 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
5859
5860 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
5861 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
5862 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
5863 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
5864 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
5865 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
5866 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
5867 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
5868 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
5869 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
5870 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
5871 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
5872 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
5873 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
5874 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
5875 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
5876 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
5877 src/derives.h, src/files.c, src/files.h, src/getargs.c,
5878 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
5879 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
5880 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
5881 src/output.h, src/parse-gram.c, src/parse-gram.h,
5882 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
5883 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
5884 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
5885 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
5886 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
5887 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
5888 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
5889 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
5890 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
5891 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
5892 tests/reduce.at, tests/regression.at, tests/sets.at,
5893 tests/synclines.at, tests/testsuite.at, tests/torture.at:
5894 Update FSF postal mail address.
5895
5896 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
5897
5898 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
5899 Problem reported by Ralf Menzel.
5900
5901 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
5902
5903 * tests/actions.at: Test that stack overflow invokes destructors.
5904 From Marcus Holland-Moritz.
5905 * data/yacc.c (yyerrlab): Move the code that destroys the stack
5906 from here....
5907 (yyreturn): to here. That way, destructors are called properly
5908 even if the stack overflows, or the user calls YYACCEPT or
5909 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
5910 (yyoverflowlab): Destroy the lookahead.
5911
5912 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
5913
5914 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
5915
5916 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
5917
5918 * NEWS: Bison-generated C parsers no longer quote literal strings
5919 associated with tokens.
5920 * src/output.c (prepare_symbols): Don't escape strings,
5921 since users don't want to see C escapes.
5922 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
5923 in diagnostics.
5924 * tests/input.at (Torturing the Scanner): Likewise.
5925 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
5926
5927 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
5928
5929 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
5930 the data size is known to be too small and we can't increase it.
5931 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
5932
5933 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
5934
5935 * src/parse-gram.y: Include quotearg.h.
5936 (string_as_id): Quote $1 before using it as a key, since the
5937 lexer no longer quotes it for us.
5938 (string_content): Don't strip quotes, since lexer no longer
5939 quotes it for us.
5940 * src/scan-gram.l: Include quotearg.h.
5941 ("\""): Omit quote.
5942 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
5943 a key, since the rest of the lexer doesn't quote it.
5944 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
5945 * tests/regression.at (Token definitions): Check for backslashes
5946 in token strings.
5947
5948 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
5949 (YYSIZE_T): Define to unsigned long int when using an older compiler.
5950 (yyparse): Revamp code to generate long syntax error message, to
5951 make it easier to translate, and to avoid problems with arithmetic
5952 overflow. Change "virtual memory" to "memory" in diagnostic, since
5953 we don't know whether the memory is virtual.
5954
5955 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
5956
5957 * NEWS: Bison-generated C parsers now use the _ macro to
5958 translate strings.
5959 * data/yacc.c (_) [!defined _]: New macro.
5960 All English strings wrapped inside this macro.
5961 * doc/bison.texinfo (Bison Parser): Document _.
5962 * po/POTFILES.in: Include src/parse-gram.c, since it now
5963 includes translateable strings that parse-gram.y doesn't.
5964
5965 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
5966
5967 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
5968 reverting the 2004-10-11 change to this function.
5969 (symbol_check_alias_consistency): Don't call symbol_type_set
5970 if the type name is already correct.
5971 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
5972
5973 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
5974
5975 * tests/regression.at (Token definitions): Don't use a token named
5976 c, as that generates a "#define c ..." that runs afoul of buggy
5977 stdlib.h that uses the identifier c as a member of struct
5978 drand48_data. Problem reported by Horst Wente.
5979
5980 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
5981
5982 * bootstrap: Change translation URL from
5983 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
5984 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
5985 redirection glitches. Problem reported by twlevo@xs4all.nl.
5986
5987 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
5988
5989 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
5990 after operands; POSIX says this isn't portable for the c99 command.
5991
5992 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
5993
5994 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
5995 immediately if a data overrun has occurred; this may help us track
5996 down what may be a spurious failure on MacOS.
5997
5998 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
5999
6000 Respond to problems reported by twlevo@xs4all.nl.
6001
6002 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
6003
6004 * src/vcg.h: Comment fix.
6005 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
6006 (G_CMAX): Change to -1 instead of INT_MAX.
6007
6008 * data/yacc.c (yyparse): Omit spaces before #line.
6009
6010 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
6011
6012 * src/tables.c (state_number_to_vector_number): Put it inside an
6013 "#if 0", since it's not currently used. Problem reported by
6014 Roland McGrath.
6015
6016 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
6017
6018 * src/output.c (escaped_output): Renamed from
6019 escaped_file_name_output, since we now use it for symbol tags as
6020 well. All uses changed.
6021 (symbol_destructors_output, symbol_printers_output):
6022 Escape symbol tags too.
6023 Problem reported by Matyas Forstner in
6024 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
6025
6026 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
6027 not needed.
6028 * src/output.c (user_actions_output, token_definitions_output,
6029 symbol_destructors_output, symbol_printers_output): Likewise.
6030 * src/reader.c (prologue_augment): Likewise.
6031 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
6032
6033 * src/vcg.c (output_edge): Don't quote linestyle arg.
6034 Problem reported by twlevo@xs4all.nl.
6035
6036 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
6037
6038 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
6039 example, reported by Derek M Jones. Also, make the example even
6040 more outrageous, to better illustrate how bad the problem is.
6041
6042 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
6043
6044 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
6045 putsym. Typo reported by Sebastian Piping.
6046
6047 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
6048
6049 * doc/bison.texinfo (Language and Grammar): some -> same
6050 (Epilogue): int he -> in the
6051 Typos reported by Sebastian Piping via Justin Pence.
6052
6053 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
6054
6055 * tests/glr-regression.at (Improper handling of embedded actions
6056 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
6057 embedded actions and $-N in GLR parsers", work around an Autoconf bug
6058 with dollar signs in test names.
6059 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
6060 for a similar reason.
6061
6062 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
6063
6064 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
6065 wants to redefine G_VIEW.
6066
6067 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
6068
6069 * src/vcg.c (get_view_str): Remove case for normal_view.
6070 Problem reported by twlevo@xs4all.nl.
6071
6072 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
6073
6074 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
6075 Problem reported by twlevo@xs4all.nl.
6076
6077 * doc/bison.texinfo: Change @dircategory from "GNU programming
6078 tools" to "Software development". Requested by Richard Stallman
6079 via Karl Berry.
6080
6081 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
6082
6083 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
6084 Problem reported by twlevo@xs4all.nl.
6085
6086 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
6087
6088 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
6089 keyword; it's not needed with modern compilers, and it doesn't
6090 affect correctness with older compilers. Suggested by
6091 twlevo@xs4all.nl.
6092
6093 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
6094
6095 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
6096 gcc -Wswitch-default.
6097 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6098 * data/yacc.c (yyparse): Likewise.
6099
6100 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
6101
6102 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
6103 already. Let config.h define any nonstandard values.
6104
6105 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
6106
6107 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
6108 for the benefit of slower hosts. Problem reported by
6109 Nelson H. F. Beebe.
6110
6111 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
6112
6113 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
6114 being defined and not used.
6115 * data/lalr1.cc (yyparse): Likewise.
6116 Use "if (false)" rather than "if (0)".
6117
6118 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
6119
6120 * TODO: Mention that we should allow NUL bytes in tokens.
6121
6122 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
6123
6124 * src/scan-skel.l (<<EOF>>): Don't close standard output.
6125 Problem reported by Hans Aberg.
6126
6127 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
6128
6129 * src/getargs.c (version): Happy new year; update overall
6130 program copyright date from 2004 to 2005.
6131
6132 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
6133 Problem reported by Hans Aberg.
6134 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
6135 (Output file names.): Add a test for the case when standard output
6136 is closed.
6137
6138 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
6139
6140 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
6141 to fix an oversight in the Bison 2.0 manual.
6142
6143 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
6144
6145 * NEWS: Version 2.0. Reformat the existing news items since
6146 1.875, so that related items are grouped together.
6147 * configure.ac (AC_INIT): Bump version to 2.0.
6148 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
6149
6150 * tests/torture.at (Exploding the Stack Size with Alloca): Set
6151 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
6152 otherwise, we're not testing alloca. Unfortunately there's no
6153 simple way to consult HAVE_ALLOCA here.
6154
6155 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
6156 for yymsg, too.
6157
6158 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
6159 hand. This avoids a warning about comparing int to size_t when
6160 GCC warnings are enabled.
6161
6162 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
6163
6164 * NEWS: Bison-generated parsers no longer default to using the
6165 alloca function (when available) to extend the parser stack, due
6166 to widespread problems in unchecked stack-overflow detection.
6167 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
6168 responsibility to set it to a positive value. This lets the user
6169 specify a value that is not a preprocessor constant.
6170 * data/yacc.c (YYMAXDEPTH): Likewise.
6171 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
6172 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
6173 to be a compile-time constant. However, explain the constraints on it.
6174 Also, explain the constraints on YYINITDEPTH.
6175 (Table of Symbols): Explain that alloca is no longer the default.
6176 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
6177 to 1.
6178
6179 * doc/bison.texinfo (Location Default Action): Mention that n must
6180 be zero when k is zero. Suggested by Frank Heckenbach.
6181
6182 2004-12-22 Akim Demaille <akim@epita.fr>
6183
6184 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
6185 (parser::state_type, parser::semantic_type, parser::location_type):
6186 Private, not public.
6187 (parser::parse): Return ints, not bool.
6188 Returning a bool introduces a problem: 0 corresponds to false, and
6189 it seems weird to return false on success. Returning true changes
6190 the conventions for yyparse.
6191 Alternatively we could return void and send an exception.
6192 There is no clear consensus (yet?).
6193 (state_stack, semantic_stack, location_stack): Rename as...
6194 (state_stack_type, semantic_stack_type, location_stack_type): these.
6195 Private, not public.
6196 * tests/c++.at: New.
6197 * tests/testsuite.at, tests/Makefile.am: Adjust.
6198
6199 2004-12-21 Akim Demaille <akim@epita.fr>
6200
6201 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
6202
6203 2004-12-21 Akim Demaille <akim@epita.fr>
6204
6205 Don't impose std::string for filenames.
6206
6207 * data/lalr1.cc (b4_filename_type): New.
6208 (position::filename): Use it.
6209 (parser.hh): Move the inclusion of stack.hh and location.hh below
6210 the user code, so that needed headers for the filename type can be
6211 included first.
6212 Forward declare them before the user code.
6213 * tests/Makefile.am (check-local, installcheck-local): Pass
6214 TESTSUITEFLAGS to the TESTSUITE.
6215
6216 2004-12-20 Akim Demaille <akim@epita.fr>
6217
6218 Use more STL like names: my_class instead of MyClass.
6219
6220 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
6221 (SemanticStack, SemanticType, StateStack, StateType)
6222 (TokenNumberType, Stack, Slice, Traits, Parser::location)
6223 (Parser::value): Rename as...
6224 (location_stack, location_type, rhs_number_type, semantic_stack)
6225 (semantic_type, state_stack, state_type, token_number_type, stack)
6226 (slice, traits, parser::yylloc, parser::yylval): these.
6227
6228 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
6229
6230 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
6231
6232 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
6233 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6234
6235 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
6236
6237 Remove uses of 'short int' and 'unsigned short int'. This raises
6238 some arbitrary limits. It uses more memory but nowadays that's
6239 not much of an issue.
6240
6241 This change does not affect the generated parsers; that's a different
6242 task, as some users will want to conserve memory there.
6243
6244 Ideally we should use size_t to represent all object counts, and
6245 something like ptrdiff_t to represent signed differences of object
6246 counts; but that will require more code-cleanup than I have the
6247 time to do right now.
6248
6249 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
6250 Use size_t, not int or short int, to count objects.
6251 * src/closure.c (nritemset, closure): Likewise.
6252 * src/closure.h (nritemset, closure): Likewise.
6253 * src/nullable.c (nullable_compute): Likewise.
6254 * src/print.c (print_core): Likewise.
6255 * src/print_graph.c (print_core): Likewise.
6256 * src/state.c (state_compare, state_hash): Likewise.
6257 * src/state.h (struct state): Likewise.
6258 * src/tables.c (default_goto, goto_actions): Likewise.
6259
6260 * src/gram.h (rule_number, rule): Use int, not short int.
6261 * src/output.c (prepare_rules): Likewise.
6262 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
6263 errs, reductions): Likewise.
6264 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
6265 Likewise.
6266 * src/tables.c (vector_number, tally, action_number,
6267 ACTION_NUMBER_MINIMUM): Likewise.
6268 * src/output.c (muscle_insert_short_int_table): Remove.
6269
6270 2004-12-17 Akim Demaille <akim@epita.fr>
6271
6272 * data/lalr1.cc: Extensive Doxygenation.
6273 (error_): Rename as...
6274 (error): this, since it is visible to the user.
6275 Adjust callers.
6276 (Parser::message): Now an automatic variable from...
6277 (Parser::yyreport_syntax_error_): here.
6278 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
6279 Parser::error.
6280 * tests/input.at: Escape $.
6281
6282 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
6283
6284 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
6285 Parenthesize rhs to avoid obscure problems with mistakes like
6286 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
6287 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6288 b4_rhs_location): Likewise.
6289 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6290 b4_rhs_location): Likewise.
6291
6292 2004-12-16 Akim Demaille <akim@epita.fr>
6293
6294 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
6295 yacc.c: be sure to stay within yycheck_.
6296 * tests/actions.at: Re-enable C++ tests.
6297
6298 2004-12-16 Akim Demaille <akim@epita.fr>
6299
6300 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
6301 real.
6302
6303 2004-12-16 Akim Demaille <akim@epita.fr>
6304
6305 Use #define to handle the %name-prefix.
6306
6307 * data/glr.c, data/yacc.c: Comment changes.
6308 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
6309 so that one can refer to yylex in the parser file, and have it
6310 renamed, as is the case with other skeletons.
6311
6312 2004-12-16 Akim Demaille <akim@epita.fr>
6313
6314 Move lalr1.cc internals into yy*.
6315
6316 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
6317 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
6318 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
6319 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
6320 (empty_, final_, terror_, errcode_, ntokens_)
6321 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
6322 (looka_, ilooka_, error_range_, nerrs_):
6323 Rename as...
6324 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
6325 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
6326 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
6327 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
6328 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
6329 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
6330 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
6331 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
6332 these.
6333
6334 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
6335
6336 Fix some problems reported by twlevo at xs4all.
6337 * src/symtab.c (symbol_new): Report an error if the input grammar
6338 contains too many symbols. This is better than calling abort() later.
6339 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
6340 (struct node, struct graph):
6341 Rename member expand to stretch. All uses changed.
6342 (struct graph): Remove member layoutalgorithm. All uses removed.
6343 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
6344 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
6345 All uses changed.
6346 (N_STRETCH): Rename from N_EXPAND. All uses changed.
6347
6348 2004-12-15 Akim Demaille <akim@epita.fr>
6349
6350 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
6351 Add more Doxygen comments.
6352 (symprint_, stack_print_, reduce_print_, destruct_, pop)
6353 (report_syntax_error_, translate_): Rename as...
6354 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
6355 (yypop_, yyreport_syntax_error_, yytranslate_): this.
6356
6357 2004-12-15 Akim Demaille <akim@epita.fr>
6358
6359 * data/lalr1.cc (lex_): Rename as...
6360 (yylex_): this.
6361 Move the trace here.
6362 Take the %name-prefix into account.
6363 Reported by Alexandre Duret-Lutz.
6364
6365 2004-12-15 Akim Demaille <akim@epita.fr>
6366
6367 Simplify the C++ parser constructor.
6368
6369 * data/lalr1.cc (debug_): Rename as...
6370 (yydebug_): so that the parser's internals are always in the yy*
6371 pseudo namespace.
6372 Adjust uses.
6373 (b4_parse_param_decl): Remove the leading comma as it is now only
6374 called as unique argument list.
6375 (Parser::Parser): Remove the constructor accepting a location and
6376 an initial debugging level.
6377 Remove from the other ctor the argument for the debugging level.
6378 (debug_level_type, debug_level, set_debug_level): New.
6379
6380 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
6381 constructor calls.
6382
6383 2004-12-15 Akim Demaille <akim@epita.fr>
6384
6385 Remove b4_root related material: failure experiment
6386 (which goal was to allow to derive from a class).
6387
6388 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
6389 definitions and uses.
6390
6391 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
6392
6393 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
6394 not 2, since it's not portable to subtract 1 from the start of an
6395 array. The new item 0 is never set or used. All uses changed.
6396
6397 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
6398 the default definition of YYLLOC_DEFAULT. Problem reported
6399 by Frank Heckenbach.
6400
6401 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
6402
6403 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
6404 the normal case and one for the error case. Just use the
6405 first one uniformly. Problem reported by Frank Heckenbach.
6406 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
6407 use exactly the same macro in both places.
6408 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
6409 so that the normal-case YYRHSLOC works for the error case too.
6410 All uses changed.
6411 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
6412 (YYLLOC_DEFAULT): Use the same macro as glr.c.
6413 * doc/bison.texinfo (Location Default Action): Don't claim that
6414 we have an array of locations. Use the same macro for both glr
6415 and lalr parsers. Mention YYRHSLOC. Mention what happens when
6416 the index is 0.
6417
6418 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
6419
6420 * HACKING: Update email addresses to send announcements to.
6421
6422 * configure.ac (AC_INIT): Bump version to 1.875f.
6423
6424 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
6425
6426 * NEWS: Version 1.875e.
6427 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
6428
6429 * src/scan-skel.l: Include "complain.h", for "fatal".
6430
6431 * src/relation.h (relation_print, relation_digraph):
6432 Relation sizes are of type relation_node, not size_t (this is
6433 merely a doc fix, since the two types are equivalent).
6434 (relation_transpose): Relation sizes are of type relation_node,
6435 not int.
6436 * src/relation.c: Likewise.
6437 (top, infinity): Now of type relation_node, not int.
6438 (traverse, relation_transpose): Use relation_node, not int.
6439
6440 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
6441 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
6442 (yyparse): Remove unused local introduced in 2004-10-25 patch.
6443
6444 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
6445 specifying whether the test should be skipped. Use it tp
6446 specify that the [%defines %skeleton "lalr1.cc"] tests currently
6447 fail on some hosts, and should be skipped.
6448
6449 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
6450
6451 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
6452 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
6453 unless otherwise specified below.
6454
6455 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
6456 to allocate kernel_base, kernel_items, kernel_size, since
6457 they needn't be initialized to 0.
6458 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
6459 * src/closure.c (new_closure): Likewise, for itemset.
6460 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
6461 * src/lalr.c (set_goto_map): Likewise, for temp_map.
6462 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
6463 (build_relations): Likewise for edge, states1, includes.
6464 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
6465 * src/reader.c (packgram): Likewise, for ritem, rules.
6466 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
6467 * src/relation.c (relation_digraph): Likewise for VERTICES.
6468 (relation_transpose): Likewise for new_R, end_R.
6469 * src/symtab.c (symbols_token_translations_init): Likewise for
6470 token_translations.
6471 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
6472 (token_actions): Likewise for yydefact, actrow, conflrow,
6473 conflict_list.
6474 (save_column): Likewise for froms[symno], tos[symno].
6475 (goto_actions): Likewise for state_count.
6476 (pack_table): Likewise for base, pos, check.
6477 (tables_generate): Likewise for width.
6478
6479 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
6480 for initial core. Just have a separate core, so we needn't worry
6481 about whether kernel_size and kernel_base are initialized.
6482
6483 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
6484 kernel_size, kernel_items): Remove unnecessary initialization.
6485 * src/conflicts.c (conflicts): Likewise.
6486 * src/derives.c (derives): Likewise.
6487 * src/muscle_tablc (muscle_insert): Likewise.
6488 * src/relation.c (relation_digraph): Likewise.
6489 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
6490 conflrow, conflict_table, conflict_list, table, check):
6491 Likewise.
6492
6493 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
6494 This is because all callers pass unsigned int.
6495 * src/closure.h (new_closure): Likewise.
6496
6497 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
6498 (build_relations): Initialize includes[i] in all cases.
6499 * src/reader.c (packgram): Always initialize rules[ruleno].prec
6500 and rules[ruleno].precsym. Initialize members in order.
6501 * src/relation.c (relation_transpose): Always initialize new_R[i]
6502 and end_R[i].
6503 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
6504
6505 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
6506 conflict_list[0] was always 0, but now it isn't initialized.
6507
6508 * src/table.c (table_grow): When conflict_table grew, the grown
6509 area wasn't cleared. Fix this.
6510
6511 * lib/.cvsignore: Add strdup.c, strdup.h.
6512 * m4/.cvsignore: Add strdup.m4.
6513
6514 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
6515
6516 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
6517 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
6518 GOTO_NUMBER_MAXIMUM, since we occasionally compute
6519 ngotos + 1 without checking for overflow.
6520 (build_relations): Use END_NODE, not -1, to denote end of edges.
6521 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
6522 build_relations): Use goto_number, not int, for goto numbers.
6523 * src/tables.c (save_column, default_goto): Likewise.
6524
6525 2004-11-23 Akim Demaille <akim@epita.fr>
6526
6527 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
6528 of #defining from yystype.
6529 Don't typedef yystype, C++ does not need it.
6530 This lets it possible to forward declare it as union.
6531
6532 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
6533
6534 * bootstrap (gnulib_modules): Add extensions.
6535 Problem reported by Jim Meyering.
6536
6537 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
6538
6539 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
6540 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
6541 src/system.h, src/tables.c: XFREE -> free, to accommodate
6542 recent change to gnulib xalloc.h.
6543 Problem reported by Jim Meyering.
6544
6545 2004-11-17 Akim Demaille <akim@epita.fr>
6546
6547 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
6548
6549 2004-11-17 Akim Demaille <akim@epita.fr>,
6550 Alexandre Duret-Lutz <adl@gnu.org>
6551
6552 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
6553 changes.
6554 (YYCDEBUG): Adjust.
6555 Use it instead of cdebug_.
6556 (Parser::debug_stream, Parser::set_debug_stream): New.
6557 (Parser::symprint_): Define cdebug_ for temporary backward
6558 compatibility.
6559 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
6560 debug_stream ().
6561
6562 2004-11-17 Akim Demaille <akim@epita.fr>
6563
6564 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
6565 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
6566 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
6567 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
6568
6569 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
6570
6571 * data/glr.c (yyloc_default): Remove; not used.
6572 Problem reported by Frank Heckenbach.
6573
6574 2004-10-25 Akim Demaille <akim@epita.fr>
6575
6576 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
6577 Introduce another definition to address simple location arrays.
6578 (yyGLRStack): New member: yyerror_range.
6579 (yyrecoverSyntaxError, yyparse): Update it.
6580 (yyrecoverSyntaxError): Use it when shifting the error token to
6581 have an accurate range, equivalent to the one computed by both
6582 yacc.c and lalr1.cc.
6583 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
6584 that column numbers start at column 0, as per GNU Coding
6585 Standards, the others tests, and the doc.
6586 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
6587 Adjust to the above change (first column is 0).
6588 And adjust the location of the "<error>", now covering the whole
6589 line.
6590
6591 2004-10-22 Akim Demaille <akim@epita.fr>
6592 and Paul Eggert <eggert@cs.ucla.edu>
6593
6594 Remove some arbitrary limits on goto numbers and relations.
6595 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
6596 initial values, since they're never used.
6597 (set_goto_map): ngotos is now unsigned, so test for overflow
6598 by seeing whether it wraps around to zero.
6599 * src/lalr.h (goto_number): Now size_t, not short int.
6600 (GOTO_NUMBER_MAXIMUM): Remove.
6601 * src/relation.c (relation_print, traverse, relation_transpose):
6602 Check for END_NODE rather than looking at sign.
6603 * src/relation.h (END_NODE): New macro.
6604 (relation_node): Now size_t, not short int.
6605
6606 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
6607
6608 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
6609 keyword, not an identifier. Problem reported by Baron Schwartz in
6610 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
6611
6612 2004-10-11 Akim Demaille <akim@epita.fr>
6613
6614 * src/symtab.c (symbol_check_alias_consistency): Also check
6615 type names, destructors, and printers.
6616 Reported by Alexandre Duret-Lutz.
6617 Recode the handling of associativity and precedence in terms
6618 of symbol_precedence_set.
6619 Accept no redeclaration at all, not even equal to the previous
6620 value.
6621 (redeclaration): New.
6622 Use it to factor redeclaration complaints.
6623 (symbol_make_alias): Don't set the type of the alias, let
6624 symbol_check_alias_consistency do it as for other features.
6625 * src/symtab.h (symbol): Add new member prec_location, and
6626 type_location.
6627 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
6628 * tests/input.at (Incompatible Aliases): New.
6629
6630 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
6631
6632 .cvsignore fixes to accommodate gnulib changes,
6633 and the practice of naming build directories "_build".
6634 * .cvsignore: Add "_*". Sort.
6635 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
6636 * m4/.cvsignore: Add "*_gl.m4".
6637
6638 2004-10-06 Akim Demaille <akim@epita.fr>
6639
6640 * src/parse-gram.y (add_param): Fix the truncation of trailing
6641 spaces.
6642
6643 2004-10-05 Akim Demaille <akim@epita.fr>
6644
6645 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
6646 whether the reducion was empty or not. This leaves room to
6647 improve the use of YYLLOC_DEFAULT in such a case.
6648 lalr1.cc is still experimental, so changing this is acceptable.
6649 And finally, there are probably not many users who changed the
6650 handling of locations in GLR, so changing is admissible too.
6651
6652 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
6653 empty reduction, set @$ to an empty location ending the previously
6654 stacked symbol.
6655 Adjust uses to make sure the code is triggered on empty
6656 reductions.
6657 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
6658 expected output: empty reductions have empty locations.
6659
6660 2004-09-29 Akim Demaille <akim@epita.fr>
6661
6662 * data/lalr1.cc: Move towards a more standard C++ coding style
6663 for templates: Class < T > -> Class<T>.
6664
6665 2004-09-29 Akim Demaille <akim@epita.fr>
6666
6667 * data/lalr1.cc: Reinstall the former ctor, for sake of
6668 compatibility, but warn it will be removed.
6669 Move towards a more standard C++ coding style (i.e., type *var ->
6670 type* var).
6671
6672 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
6673
6674 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
6675 since it's less likely to work if NULs are involved in the future.
6676
6677 2004-09-27 Akim Demaille <akim@epita.fr>
6678
6679 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
6680
6681 2004-09-27 Akim Demaille <akim@epita.fr>
6682
6683 * data/lalr1.cc (b4_parse_param_decl_1): New.
6684 (b4_parse_param_decl): Use it to have different names between attribute
6685 and argument names.
6686 (b4_cc_constructor_call): Likewise.
6687
6688 2004-09-24 Akim Demaille <akim@epita.fr>
6689
6690 * src/parse-gram.y (add_param): Strip the leading and trailing
6691 blanks from a formal argument declaration.
6692 (YY_LOCATION_PRINT): New.
6693
6694 2004-09-24 Akim Demaille <akim@epita.fr>
6695
6696 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
6697 after the location.
6698
6699 2004-09-24 Akim Demaille <akim@epita.fr>
6700
6701 * doc/bison.texinfo (Table of Symbols): Sort.
6702
6703 2004-09-21 Akim Demaille <akim@epita.fr>
6704
6705 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
6706 the useless parentheses.
6707 Suggested by Paul Eggert.
6708
6709 2004-09-20 Akim Demaille <akim@epita.fr>
6710
6711 Let the initial-action act on the look-ahead, and use it for the
6712 "initial push" (corresponding to an hypothetical beginning-of-file).
6713 And let lalr1.cc honor %initial-action.
6714
6715 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
6716 example.
6717 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
6718 (Parser::Parser): Remove the ctor that used to initialize it.
6719 (Parser::parse): Like in the other skeletons, issue the "starting
6720 parse" message before any action.
6721 Honor %initial-action.
6722 Initialize the stacks with the lookahead.
6723 * data/yacc.c: Let $$ and @$ in %initial-action designate the
6724 look-ahead.
6725 Push them in the stacks.
6726 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
6727
6728 2004-09-20 Akim Demaille <akim@epita.fr>
6729
6730 * doc/bison.texinfo (Initial Action Decl): New.
6731
6732 2004-09-20 Akim Demaille <akim@epita.fr>
6733
6734 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
6735 clearer criterion to define it.
6736 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
6737 When reducing on an empty RHS, use the latest stacked location as
6738 location.
6739 yylloc is not always available.
6740 * data/glr.c: Likewise.
6741 Also, honor initial-actions.
6742
6743 2004-09-20 Akim Demaille <akim@epita.fr>
6744
6745 * data/yacc.c (YY_LOCATION_PRINT): New.
6746 Define when we know YYLTYPE's structure, i.e., when the default
6747 YYLLOC_DEFAULT is used.
6748 * data/c.m4 (b4_yysymprint_generate): Use it.
6749 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
6750 value of the result.
6751 (error_start_): Replace with...
6752 (error_range_): this location array.
6753 This allows to replace code relying on the implementation of
6754 locations by portable code.
6755 * data/yacc.c (yylerrsp): Replace with...
6756 (yyerror_range): this.
6757 Every time a token is popped, update yyerror_range[0], to have an
6758 accurate location for the error token.
6759 * data/glr.c (YY_LOCATION_PRINT): New.
6760 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
6761 deference a pointer.
6762 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
6763 report the location in %printers.
6764
6765 * src/scan-skel.l: Instead of abort, report error messages to ease
6766 understanding skeleton scanning failures.
6767
6768 2004-09-16 Akim Demaille <akim@epita.fr>
6769
6770 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
6771 (iterator, const_iterator): these, to be more in the C++ spirit.
6772 Also, return reverse iterators so that when displaying the stack
6773 we display its bottom first.
6774 (Parser::stack_print_, Parser::reduce_print_): Match the messages
6775 from yacc.c.
6776 We should probably use vector here though.
6777
6778 2004-09-16 Akim Demaille <akim@epita.fr>
6779
6780 Have more complete shift traces.
6781
6782 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
6783 to report Shifts instead of ad hoc YYDPRINTF invocations,
6784 including for the error token.
6785 * data/lalr1.cc (symprint_): Output the location.
6786 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
6787 output the location within the %printer.
6788 Activate GLR tests, at least to make sure they compile properly.
6789 They still don't pass though.
6790 * tests/calc.at: Adjust expect verbose output, since now "Entering
6791 state..." is on a different line than the "Shifting" message.
6792
6793 2004-09-08 Akim Demaille <akim@epita.fr>
6794
6795 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
6796 Bison directive from the Bison file to the invocation of this
6797 macro, so that these directives are passed to
6798 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
6799 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
6800 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
6801 the extra Bison directives instead of the whole series.
6802 Change the grammar so that there are recoverable errors, and
6803 unrecoverable errors. Now we can have the parser give up before
6804 consuming the whole input. As a result we now can observe that
6805 the lookahead is freed when needed.
6806 Change the parser source to parse argv[1] instead of a hard coded
6807 string.
6808 Simplify yylex, and give a value and location to EOF.
6809 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
6810 passed directives already coded in the file.
6811 Add some tests to check the location of "error".
6812 For some tests, the C++ parser is correct, and not yacc.c.
6813 For other tests, they provide different, but unsatisfying, values,
6814 so keep the C++ value so that at least one parser is "correct"
6815 according to the test suite.
6816 (Actions after errors): Remove, this is subsumed by the
6817 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
6818
6819 2004-09-06 Akim Demaille <akim@epita.fr>
6820
6821 * data/lalr1.cc: Adjust the indentation of the labels.
6822 (Parser::pop): New.
6823 Use it.
6824
6825 2004-09-06 Akim Demaille <akim@epita.fr>
6826
6827 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
6828 argument, an informative message.
6829 Call YY_SYMBOL_PRINT.
6830 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
6831 * data/lalr1.cc (destruct_): Likewise.
6832 In addition, no longer depend on b4_yysymprint_generate and
6833 b4_yydestruct_generate to generate these functions, do it "by
6834 hand".
6835
6836 2004-09-03 Akim Demaille <akim@epita.fr>
6837
6838 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
6839 invoked, yydestruct the lookahead.
6840 * tests/calc.at (Calculator $1): Update the expected lengths of
6841 traces: there is an added line for the discarded lookahead.
6842 * doc/bison.texinfo (Destructor Decl): Some rewording.
6843 Define "discarded" symbols.
6844
6845 2004-09-02 Akim Demaille <akim@epita.fr>
6846
6847 * data/lalr1.cc (translate_, destruct_): No reason to be static.
6848
6849 2004-09-02 Akim Demaille <akim@epita.fr>
6850
6851 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
6852 (YYDSYMPRINTF): Rename as...
6853 (YY_SYMBOL_PRINT): this.
6854 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
6855 two.
6856 Use it instead of direct symprint_ calls.
6857 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
6858 one.
6859
6860 2004-09-02 Akim Demaille <akim@epita.fr>
6861
6862 * data/lalr1.cc (b4_yysymprint_generate): New.
6863 (symprint_): New member function, defined when YYDEBUG.
6864 Use it consistently instead of token/nterm debugging output by
6865 hand.
6866 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
6867 %printer calls to use cdebug_ when using lalr1.cc.
6868
6869 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
6870
6871 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
6872 with #ifdef YYDEBUG.
6873
6874 2004-08-26 Akim Demaille <akim@epita.fr>
6875
6876 * doc/bison.texinfo (Implementing Loops): Rename as...
6877 (Implementing Gotos/Loops): this.
6878
6879 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
6880
6881 Adjust to latest gnulib.
6882 * bootstrap (gnulib_modules): Add xalloc-die.
6883 Set LC_ALL=C so that file names sort consistently.
6884 Prefer the gnulib copies of gettext.m4, glibc21.m4,
6885 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
6886 uintmax_t.m4, ulonglong.m4.
6887 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
6888 po.m4 since we are now using _gl.m4 instead.
6889
6890 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
6891
6892 * src/scan-action.l: Remove. Scanning of semantic actions is
6893 handled in scan-gram.l.
6894
6895 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
6896
6897 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
6898
6899 * src/location.h (struct): The file member is a uniqstr.
6900 (equal_boundaries): Use UNIQSTR_EQ for comparison.
6901
6902 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
6903
6904 Fix bug with non-%union parsers that have printers or destructors,
6905 which led to a Bison core dump. Reported by Peter Fales in
6906 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
6907
6908 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
6909 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
6910 not to our own type.
6911 * src/output.c (symbol_destructors_output, symbol_printers_output):
6912 Don't assume %union.
6913 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
6914 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
6915 UNION-FLAG. All callers changed.
6916 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
6917 Use type char, not unsigned int, when declaring an array of char;
6918 this lets us remove a cast.
6919 (Printers and Destructors): Add non-%union test cases.
6920
6921 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6922
6923 * doc/bison.texinfo: Minor editorial changes, mostly to the new
6924 GLR writeups. E.g., avoid frenchspacing and the future tense,
6925 change "lookahead" to "look-ahead", and change "wrt" to "with
6926 respect to".
6927
6928 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6929
6930 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
6931 New sections, split off from the GLR Parsers section. Put the new
6932 Simple GLR Parser near the start of the GLR section, for clarity.
6933 Rewrite connective text.
6934
6935 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
6936
6937 * doc/bison.texinfo (Simple GLR Parsers): New section.
6938
6939 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6940
6941 * NEWS, TODO, doc/bison.texinfo:
6942 Use "look-ahead" instead of "lookahead", to be consistent.
6943 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
6944 while we're fixing "look-ahead".
6945 * src/conflicts.c (shift_set): Renamed from shiftset.
6946 (look_ahead_set): Renamed from lookaheadset.
6947 * src/print.c: Likewise.
6948 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
6949 name for "lookahead".
6950 (report_types, usage): Likewise.
6951 * src/getargs.h (report_look_ahead_tokens): Renamed from
6952 report_lookaheads.
6953 * src/lalr.c (compute_look_ahead_tokens): Renamed from
6954 compute_lookaheads.
6955 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
6956 (look_ahead_tokens_print): Renamed from lookaheads_print.
6957 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
6958 state_rule_lookaheads_print.
6959 * src/state.h: Likewise.
6960 (reductions.look_ahead_tokens): Renamed from lookaheads.
6961 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
6962 AT_DATA_LOOKAHEADS_GRAMMAR.
6963
6964 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
6965
6966 * README: Update location of patched M4 distribution.
6967
6968 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
6969
6970 Don't assume the C++ compiler takes the same arguments as the C compiler
6971 (trivial change).
6972 * configure.ac (O0CXXFLAGS): New var.
6973 * tests/atlocal.in (CXXFLAGS): Use it.
6974
6975 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
6976
6977 Fix some "make check" problems with C++ reported by
6978 Albert Chin-A-Young for Tru64 C++ in this thread:
6979 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
6980
6981 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
6982 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6983 Output to a .cc file for C++, not to a .c file.
6984 * tests/calc.at (AT_CHECK_CALC): Likewise.
6985 * tests/regression.at (AT_CHECK_DANCER): Likewise.
6986 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
6987
6988 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
6989
6990 * tests/calc.at, tests/actions.at: Workaround for SGI
6991 C++ compiler. (trivial change)
6992
6993 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
6994
6995 Spent a few hours checking out which prerequisite versions the
6996 current sources actually require. I went all the way back to
6997 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
6998 a seemingly endless set of combinations of versions more recent
6999 than that. The bottom line is that the current sources require
7000 fairly recent versions of the build tools, and it'll be some work
7001 to change this.
7002 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
7003 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
7004 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
7005 Add comments explaining why those particular versions are
7006 currently needed.
7007
7008 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
7009 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
7010 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
7011
7012 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
7013 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
7014
7015 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
7016
7017 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
7018 0.11.5. Suggested by Bruno Haible.
7019 * bootstrap: Remove gettext version checking.
7020
7021 * doc/bison.texinfo (Decl Summary): Also mention that %union
7022 can depend on prerequisite types. Problem reported by Tim
7023 Van Holder.
7024
7025 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
7026
7027 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
7028 * README-alpha: Don't tell people not to package this.
7029
7030 * bootstrap: Don't assume $(...) works; use `...` instead.
7031 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
7032 gettext better.
7033
7034 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
7035 put into the -d output file, and mention what to do if YYSTYPE is
7036 defined as a macro.
7037
7038 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
7039
7040 Undo change made earlier today: it caused autopoint to not bring
7041 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
7042 autopoint's.
7043
7044 * bootstrap: Check that gettext version matches what's in
7045 configure.ac. Warn users to ignore robots.txt ERROR 404.
7046 * bootstrap: Undo today's earlier change (logged below).
7047 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
7048
7049 The gettext version checking is causing more trouble than it's
7050 curing; remove it. Problem reported by Paul Hilfinger.
7051
7052 * bootstrap: Issue a warning that one can expect a message
7053 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
7054 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
7055
7056 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
7057
7058 Ensure that the C++ compiler used for testing actually works on a
7059 simple test program; if not, skip the C++-related tests. Problem
7060 reported by Vin Shelton in:
7061 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
7062
7063 * m4/cxx.m4: New file.
7064 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
7065 * tests/atlocal.in (BISON_CXX_WORKS): Add.
7066 * tests/local.at (AT_COMPILE_CXX): Use it.
7067
7068 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7069
7070 * data/glr.c (yylloc): Output this macro even if locations are not
7071 being generated, as the GLR parser needs it even in that case.
7072 Problem reported by Troy A. Johnson
7073 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
7074
7075 * configure.ac (AC_INIT): Update to 1.875e.
7076
7077 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7078
7079 * NEWS: Version 1.875d.
7080 * configure.ac (AC_INIT): Likewise.
7081 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
7082
7083 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
7084 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
7085 lalr1.cc runs afoul of the first, and the last two are no longer
7086 supported by GCC 3.4.0.
7087 * README: Mention GNU m4 1.4 or later; mention m4 patches.
7088 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
7089
7090 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
7091
7092 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
7093 unsigned int, for compatibility with latest gnulib hash module.
7094 * src/state.c (state_hash, state_hasher): Likewise.
7095 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
7096 * src/uniqstr.c (hash_uniqstr): Likewise.
7097
7098 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
7099
7100 * NEWS: Unescaped newlines are no longer allowed in char & strings.
7101
7102 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
7103 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
7104 character and string literals.
7105 (unexpected_end): New function.
7106 (unexpected_eof): Use it.
7107 (unexpected_newline): New function.
7108 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
7109 actions.
7110
7111 * NEWS: Document %expect-rr.
7112
7113 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
7114 Fix typo by replacing $1 with $option.
7115 Remove more 'intl'-related files.
7116 Don't DEFUN AM_INTL_SUBDIR twice.
7117
7118 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
7119 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
7120 strtoul.c.
7121 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
7122 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
7123 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
7124 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
7125 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
7126 * src/.cvsignore: Add *.output.
7127
7128 * src/parse-gram.y: Put copyright notice inside %{ %} so it
7129 gets copied to the output file.
7130
7131 2004-04-28 Paul Eggert <eggert@twinsun.com>
7132
7133 Get files from the gnulib and po repositories, instead of relying
7134 on them being in our CVS. Upgrade to latest versions of gnulib
7135 and Automake.
7136
7137 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
7138 * bootstrap: Bootstrap from gnulib and po repositories.
7139 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
7140 * README-cvs: Document these changes. Remove version numbers from
7141 mentions of build tools, since they change so often. Mention Flex.
7142
7143 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
7144 (gl_USE_SYSTEM_EXTENSIONS): Add.
7145 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
7146 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
7147 does this for us.
7148 (AC_ISC_POSIX): Remove; we no longer support this
7149 ancient OS, as it gets in the way of latest Autoconf & gnulib.
7150 (AC_HEADER_STDC): Remove: we now assume C89 or better.
7151 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
7152 Do not check for C89 headers, except for locale.h which is used
7153 by the Yacc library and must port to K&R hosts.
7154 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
7155 Do not check for C89 functions, except for setlocale which is
7156 used by the Yacc library.
7157 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
7158 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
7159 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
7160 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
7161 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
7162 AM_GNU_GETTEXT): Remove; now done by:
7163 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
7164 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
7165 for us.
7166
7167 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
7168 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
7169 Define to empty, as gnulib.mk will do the rest for us.
7170 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
7171 for us.
7172 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
7173 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
7174
7175 * src/files.c: Include gnulib's xstrndup.h.
7176
7177 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
7178 (REALLOC): Use xnrealloc, for likewise.
7179 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
7180 (strnlen, memrchr): Remove decls; functions no longer used.
7181 Include <stpcpy.h>.
7182
7183 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
7184 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7185 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
7186 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
7187 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
7188 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
7189 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
7190 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
7191 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
7192 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
7193 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
7194 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7195 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
7196 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
7197 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
7198 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
7199 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
7200 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
7201 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
7202 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
7203 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
7204 Remove, as these files are now generated automatically
7205 by bootstrap or automake.
7206
7207 * po/ChangeLog: Remove: all but one entry was a duplicate
7208 of this file, and I moved that 2000-11-02 entry here.
7209
7210 * config/.cvsignore: Add Makefile, depcomp, install-sh.
7211 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
7212 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
7213 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
7214 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
7215 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
7216 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
7217 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
7218 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
7219 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
7220 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
7221 xstrndup.h.
7222 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
7223 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
7224 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
7225 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
7226 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
7227 * src/.cvsignore: Remove *_.c.
7228
7229
7230 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
7231 support it. (The latest stable gzip doesn't.)
7232
7233 2004-04-27 Paul Eggert <eggert@twinsun.com>
7234
7235 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
7236 case, as stos_ is now used by destructors due to the 2004-02-09
7237 change.
7238
7239 Remove more K&R C support.
7240 * lib/libiberty.y (PARAMS): Remove. All uses removed.
7241 * lib/subpipe.c (errno): Remove decl.
7242 Include <stdlib.h> unconditionally.
7243 (EXIT_FAILURE): Remove macro.
7244 * src/complain.c (vfprintf, strerror): Remove.
7245 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
7246 unconditionally.
7247 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
7248 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
7249 (strchr, strspn, memchr): Remove decls.
7250 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
7251 unconditionally. Do not declare perror.
7252 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
7253 unconditionally.
7254
7255 * src/complain.c (_): Remove useless defn, as system.h defines this.
7256
7257 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
7258 with latest obstack.h.
7259 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
7260 to procedure types, as obstack.h now does that for us.
7261 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
7262
7263 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
7264 so that this include file can stand alone.
7265 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
7266 does this now. Include subpipe.h first after config.h, to
7267 test whether it can stand alone.
7268
7269 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
7270 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
7271 unused declaration.
7272
7273 * tests/synclines.at (%union synch line): Put a dummy member in
7274 the union, because empty unions aren't allowed in C. Caught
7275 by GCC 3.4.0.
7276
7277 2004-04-13 Jim Meyering <jim@meyering.net>
7278
7279 * src/conflicts.c (conflicts_print): Correct format string typo:
7280 use `%%' to produce literal `%'. (trivial change)
7281
7282 2004-03-30 Paul Eggert <eggert@twinsun.com>
7283
7284 * src/getargs.c (version): Update copyright year to 2004.
7285
7286 * data/c.m4 (b4_int_type): Use 'short int' rather than
7287 'short', and similarly for 'long', 'unsigned', etc.
7288 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
7289 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
7290 yy_yypstack, yydumpstack): Likewise.
7291 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
7292 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
7293 Likewise.
7294 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
7295 yy_stack_print, yyparse): Likewise.
7296 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
7297 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
7298 * lib/bitset.c (bitset_print): Likewise.
7299 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
7300 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7301 * lib/bitsetv.c (bitsetv_dump): Likewise.
7302 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
7303 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
7304 Likewise.
7305 * src/LR0.c (allocate_itemsets): Likewise.
7306 * src/gram.h (rule_number, rule): Likewise.
7307 * src/lalr.h (goto_number): Likewise.
7308 * src/nullable.c (nullable_compute): Likewise.
7309 * src/output.c (prepare_rules): Likewise.
7310 * src/relation.c (relation_print, relation_digraph): Likewise.
7311 * src/relation.h (relation_node): Likewise.
7312 * src/state.h (state_number, transitions, errs, reductions,
7313 struct state): Likewise.
7314 * src/symtab.h (symbol_number, struct symbol): Likewise.
7315 * src/tables.c (vector_number, tally, action_number,
7316 default_goto, goto_actions): Likewise.
7317 * tests/existing.at (GNU Cim Grammar): Likewise.
7318 * tests/regression.at (Web2c Actions): Likewise.
7319
7320 * src/output.c (muscle_insert_short_int_table): Renamed from
7321 muscle_insert_short_table. All uses changed.
7322
7323 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7324
7325 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
7326 (declaration): Replace expected_conflicts with expected_sr_conflicts.
7327 Add %expect-rr rule.
7328
7329 * src/scan-gram.l: Recognize %expect-rr.
7330
7331 * src/conflicts.h (expected_sr_conflicts): Rename from
7332 expected_conflicts.
7333 (expected_rr_conflicts): Declare.
7334
7335 * src/conflicts.c (expected_sr_conflicts): Rename from
7336 expected_conflicts.
7337 (expected_rr_conflicts): Define.
7338 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
7339 for GLR parsers.
7340 Use expected_sr_conflicts in place of expected_conflicts.
7341 Warn if expected_rr_conflicts used in non-GLR parser.
7342
7343 * doc/bison.texinfo: Add documentation for %expect-rr.
7344
7345 2004-03-08 Paul Eggert <eggert@gnu.org>
7346
7347 Add support for hex token numbers. Suggested by Odd Arild Olsen in
7348 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
7349
7350 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
7351 in lalr1.cc.
7352 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
7353 * src/scan-gram.l (scan_integer): New function.
7354 ({int}): Use it.
7355 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
7356 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
7357 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
7358 Say "long int", not "long", for uniformity with GNU style.
7359
7360 2004-02-25 Paul Eggert <eggert@twinsun.com>
7361
7362 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
7363 compilers. This fixes a problem with Intel's C++ compiler being
7364 chatty, reported by Guido Trentalancia in
7365 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
7366
7367 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
7368
7369 Support %destructor and merge error locations in lalr1.cc.
7370
7371 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
7372 (Parser::stos_): Define unconditionally.
7373 (Parser::destruct_): New method. Generate its body with
7374 b4_yydestruct_generate.
7375 (Parser::error_start_): New attribute.
7376 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
7377 token which are discarded.
7378 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
7379 error_start_ when erroneous token are discarded.
7380 (Parser::parse) <yyerrlab1>: Compute the location of the error
7381 token so that it covers all the discarded tokens.
7382 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
7383 it can be called with `%skeleton "lalr1.cc"', and do that.
7384
7385 2004-02-02 Paul Eggert <eggert@twinsun.com>
7386
7387 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
7388 $(top_srcdir)/lib and ../lib. This fixes a bug reported
7389 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
7390 There's no need to mention top_builddir since Automake does that
7391 for us.
7392 (INCLUDES): Remove, as Automake says it's obsolescent.
7393 Contents migrated into AM_CPPFLAGS as described above.
7394 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
7395
7396 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7397
7398 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
7399 (yyreportSyntaxError): Handle case where lookahead token is
7400 YYEMPTY.
7401
7402 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7403
7404 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
7405 resulting parsers are compilable with C++.
7406
7407 2003-12-23 Paul Eggert <eggert@twinsun.com>
7408
7409 * config/depcomp, config/install-sh: Sync with Automake 1.8.
7410 * src/output.c (output_skeleton): Rename local var.
7411 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
7412 Bison tokens, as this runs afoul of the 2003-10-07 change that
7413 disallowed NUL bytes in character constants or string literals.
7414
7415 * tests/local.at: Require Autoconf 2.59's Autotest.
7416 * tests/testsuite.at: Don't include local.at, since we now assume
7417 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
7418 including it.
7419 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
7420 multiple inclusion warnings.
7421
7422 2003-12-02 Akim Demaille <akim@epita.fr>
7423
7424 * doc/bison.texinfo (How Can I Reset the Parser): More about start
7425 conditions.
7426 From Bruno Haible.
7427
7428 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
7429
7430 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
7431
7432 2003-10-07 Paul Eggert <eggert@twinsun.com>
7433
7434 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
7435 if testsuite doesn't exist.
7436
7437 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
7438 literals, unfortunately.
7439 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
7440 Complain about NUL bytes in character constants or string literals.
7441
7442 2003-10-05 Paul Eggert <eggert@twinsun.com>
7443
7444 * NEWS: Don't document %no-default-prec, as it's still
7445 too experimental.
7446 * doc/bison.texinfo: Document %no-default-prec only if
7447 the defaultprec flag is set. Normally it's not.
7448
7449 2003-10-04 Paul Eggert <eggert@twinsun.com>
7450
7451 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
7452 non-modifiable lvalue, instead of a modifiable one.
7453 * doc/bison.texinfo (Actions): Document that $$ can
7454 be assigned to. Do not claim that $$ and $N are
7455 array element references: user code should not rely on this.
7456
7457 2003-10-01 Paul Eggert <eggert@twinsun.com>
7458
7459 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
7460 (grammar_declaration): Use it.
7461 * src/scan-gram.l: New token %no-default-prec.
7462 * tests/conflicts.at: Revamp tests to use %no-default-prec.
7463 * NEWS, doc/bison.texinfo: Document the above.
7464
7465 2003-10-01 Akim Demaille <akim@epita.fr>
7466
7467 VCG no longer supports long_straight_phase.
7468
7469 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
7470 * src/print_graph.c (print_graph): Adjust.
7471
7472 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
7473 and Paul Eggert <eggert@twinsun.com>
7474
7475 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
7476 Table of Symbols): Document %default-prec.
7477 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
7478 (grammar_declaration): Set default_prec on %default-prec.
7479 * src/scan-gram.l (%default-prec): New token.
7480 * src/reader.h (default_prec): New flag.
7481 * src/reader.c: Likewise.
7482 (packgram): Handle it.
7483 * tests/conflicts.at (%default-prec without %prec,
7484 %default-prec with %prec, %default-prec 1): New tests.
7485
7486 2003-09-30 Paul Eggert <eggert@twinsun.com>
7487
7488 * tests/testsuite.at: Include local.at, not input.at, fixing
7489 a typo in the 2003-08-25 patch.
7490
7491 2003-08-27 Akim Demaille <akim@epita.fr>
7492
7493 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
7494 GCC warnings.
7495
7496 2003-08-26 Akim Demaille <akim@epita.fr>
7497
7498 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
7499 "<\#" to avoid magic from Gnus when posting parts of this script.
7500
7501 2003-08-26 Akim Demaille <akim@epita.fr>
7502
7503 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
7504 (Parser::parse): here.
7505 Adjust: nerrs and errstatus is now replaced by...
7506 (Parser::nerrs_, Parser::errstatus_): New.
7507
7508 2003-08-25 Akim Demaille <akim@epita.fr>
7509
7510 * config/announce-gen, Makefile.cfg: New.
7511 * Makefile.am: Adjust.
7512 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
7513 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
7514
7515 2003-08-25 Akim Demaille <akim@epita.fr>
7516
7517 When reducing initial empty rules, Bison parser read an initial
7518 location that is not defined. This results in garbage, and that
7519 affects Bison's own parser. Therefore we need (i) to extend Bison
7520 to support a means to initialize this location, and (ii) to use
7521 this CVS Bison to fix CVS Bison's parser.
7522
7523 * src/reader.h, reader.c (epilogue_augment): Remove, replace
7524 with...
7525 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
7526 * src/parse-gram.y: Adjust.
7527 (%initial-action): New.
7528 (%error-verbose): Since we require CVS Bison, there is no reason
7529 not to use it.
7530 * src/scan-gram.l: Adjust.
7531 * src/Makefile.am (YACC): New, to make sure we use our own parser.
7532 * data/yacc.c (yyparse): Use b4_initial_action.
7533
7534 2003-08-25 Akim Demaille <akim@epita.fr>
7535
7536 * doc/bison.texinfo: Don't promote stdout for error messages.
7537
7538 2003-08-25 Akim Demaille <akim@epita.fr>
7539
7540 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
7541 From Alexandre Duret-Lutz.
7542
7543 2003-08-25 Akim Demaille <akim@epita.fr>
7544
7545 Version 1.875c.
7546
7547 2003-08-25 Akim Demaille <akim@epita.fr>
7548
7549 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
7550 Use them.
7551
7552 2003-08-25 Akim Demaille <akim@epita.fr>
7553
7554 * data/lalr1.cc (Parser::reduce_print_): New.
7555 Use it.
7556
7557 2003-08-25 Akim Demaille <akim@epita.fr>
7558
7559 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
7560 error recovery loops. This patch is based on
7561 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
7562 Also, augment the similarity between lalr1.cc and yacc.c.
7563 Note: the locations of error recovery rules are not correct yet.
7564
7565 * data/lalr1.cc: Comment changes to augment the similarity between
7566 lalr1.cc and yacc.c.
7567 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
7568 (yyerrlab1): Remove, but where it used to be (now the bottom part of
7569 yyerrlab), when hitting EOF, pop the whole stack here instead of
7570 merely falling thru the default error handling mechanism.
7571 (yyerrorlab): New label, with the old contents of YYERROR,
7572 plus the following change: pop the stack of rhs corresponding
7573 to the production that invoked YYERROR. That is how Yacc
7574 behaves (required by POSIX).
7575 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
7576 fail.
7577
7578 2003-08-25 Akim Demaille <akim@epita.fr>
7579
7580 Tune local.at so that people can "autom4te -l autotest calc.at -o
7581 calc" for instance, to extract a sub test suite.
7582
7583 * tests/testsuite.at: Move the initialization, Autotest version
7584 requirement, and AT_TESTED invocation into...
7585 * tests/local.at: here.
7586 * tests/testsuite.at: Include it for compatibility with Autoconf
7587 2.57.
7588 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
7589 be ignore.
7590
7591 2003-08-04 Paul Eggert <eggert@twinsun.com>
7592
7593 Rework code slightly to avoid gcc -Wtraditional warnings.
7594 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
7595 The returned value is now stored in *YY0. All callers changed.
7596 * src/output.c (merge_output): Adjust to the above change.
7597
7598 2003-07-26 Paul Eggert <eggert@twinsun.com>
7599
7600 * data/glr.c (YYASSERT): New macro.
7601 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
7602 yyresolveStates, yyprocessOneStack):
7603 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
7604 Derived from a suggestion by Frank Heckenbach.
7605
7606 2003-07-25 Paul Eggert <eggert@twinsun.com>
7607
7608 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
7609 for portability to K&R C (after ansi2knr, presumably). See
7610 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
7611 by Frank Heckenbach, though I have omitted the structure-initialization
7612 part of his glr-knr.diff patch since I recall that the Portable
7613 C Compiler didn't require that change.
7614
7615 Let the user specify how to allocate and free memory.
7616 Derived from a suggestion by Frank Heckenbach in
7617 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
7618 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
7619 All uses of free, malloc, realloc changed to use these macros,
7620 and unnecessary casts removed.
7621 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
7622
7623 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
7624
7625 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
7626 use s.empty() rather than s == "" to test for empty string; see
7627 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
7628 (trivial change)
7629
7630 2003-06-25 Akim Demaille <akim@epita.fr>
7631
7632 * config/depcomp, config/install-sh: Update from masters.
7633
7634 2003-06-20 Paul Eggert <eggert@twinsun.com>
7635
7636 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
7637 and return properly parenthesized result.
7638 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
7639 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7640 Remove unnecessary parentheses from uses.
7641 * doc/bison.texinfo (Location Default Action): Describe the
7642 conventions for parentheses.
7643
7644 2003-06-19 Paul Eggert <eggert@twinsun.com>
7645
7646 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
7647 yyreportTree): Do not assume that size_t is the same width as int,
7648 when printing sizes. Print sizes using an unsigned format.
7649 Problem reported by Frank Heckenbach in
7650 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
7651
7652 Port to Forte Developer 7 C compiler.
7653 * data/glr.c (struct YYLTYPE): If locations are not being used,
7654 declare a single dummy member, as empty structs do not conform
7655 to the C standard.
7656 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
7657 the Forte Developer 7 C compiler complains that end-of-loop
7658 code is not reached.
7659
7660 2003-06-17 Paul Eggert <eggert@twinsun.com>
7661
7662 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
7663 avoid warnings from picky compilers about redefinition of PARAMS.
7664
7665 2003-06-17 Paul Eggert <eggert@twinsun.com>
7666
7667 Version 1.875b.
7668
7669 * NEWS: Document 1.875b.
7670
7671 * lib/bbitset.h: Do not include config.h; that's the includer's job.
7672 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
7673 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
7674 Don't use 'index' in comments, as it's a builtin fn on some hosts.
7675 * lib/bitset_stats.c: Include gettext.h unconditionally, as
7676 per recent gettext manual's suggestion.
7677 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
7678 Use prototypes, not old-style definitions.
7679 * lib/lbitset.c (lbitset_unused_clear): Likewise.
7680 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
7681 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
7682 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
7683 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
7684 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
7685 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
7686 vbitset_or_and_cmp, vbitset_copy): Likewise.
7687
7688 * lib/libiberty.h: Do not include config.h; that's the includer's job.
7689 Do not include <stdlib.h>.
7690 (PARAMS): Define unconditionally for C89.
7691 (ATTRIBUTE_NORETURN): Remove.
7692 (ATTRIBUTE_UNUSED): Define unconditionally.
7693
7694 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
7695 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
7696 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
7697 * lib/vbitset.c, lib/vbitset.h: New files.
7698 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
7699 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
7700 from libbitset.
7701
7702 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
7703 `How Can I Reset @code{yyparse}', since texinfo does not allow
7704 arbitrary @ in node names.
7705
7706 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
7707 shouldn't be needed according to the gettext 0.12.1 documentation
7708 but which seem to be needed anyway: codeset.m4 glibc21.m4
7709 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
7710 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
7711 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
7712
7713 * lib/.cvsignore: Add stdbool.h.
7714 * m4/.cvsignore: Add nls.m4, po.m4.
7715
7716 Upgrade to CVS gnulib.
7717 * stdbool_.h: File renamed from stdbool.h.in.
7718 * configure.ac (AM_STDBOOL_H): Invoke this instead of
7719 AC_HEADER_STDBOOL.
7720 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
7721 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
7722 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
7723 (MOSTLYCLEANFILES): New var.
7724 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
7725 (stdbool.h): New rule.
7726 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
7727 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
7728 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
7729 m4/quote.m4: Upgrade to today's gnulib.
7730
7731 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
7732 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
7733 the tests right now.
7734 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
7735 yyerror are declared before use; C99 requires this.
7736
7737 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7738
7739 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
7740 first.
7741 (yyrecoverSyntaxError): Correct the logic for setting and testing
7742 yyerrState.
7743 Correct comment on handling EOF.
7744 Allow states with only a default reduction, rather than failing
7745 (I can't quite reconstruct why these were not allowed before).
7746
7747 Fixes to avoid problem that $-N rules in GLR parsers can cause
7748 buffer overruns, corrupting state.
7749
7750 * src/output.c (prepare_rules): Output max_left_semantic_context
7751 definition.
7752 * src/reader.h (max_left_semantic_context): New variable declaration.
7753 * src/scan-gram.l (max_left_semantic_context): Define.
7754 (handle_action_dollar): Update max_left_semantic_context.
7755 * data/glr.c (YYMAXLEFT): New definition.
7756 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
7757 (yyresolveAction): Ditto.
7758
7759 Fixes to problems with location handling in GLR parsers reported by
7760 Frank Heckenbach (2003/06/05).
7761
7762 * data/glr.c (YYLTYPE): Make trivial if locations not used.
7763 (YYRHSLOC): Add parentheses, and define only if locations used.
7764 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
7765 locations not used.
7766 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
7767 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
7768
7769 * tests/cxx-type.at: Exercise location information; update tests
7770 to differentiate output with and without locations.
7771 Remove forward declarations of yylex and yyerror---caused errors
7772 because default YYLTYPE not yet defined.
7773 Change semantic actions to compute strings, rather than printing
7774 them directly (to test proper passing of semantics values). Change
7775 output to prefix notation and update test data and expected results.
7776 (yylex): Track locations.
7777 (stmtMerge): Return value rather than printing, and include arguments
7778 in value.
7779
7780 2003-06-03 Paul Eggert <eggert@twinsun.com>
7781
7782 Avoid warnings generated by GCC 2.95.4 when Bison is
7783 configured with --enable-gcc-warnings.
7784 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
7785 yy::]b4_parser_class_name[::translate_,
7786 yy::Stack::operator[] (unsigned),
7787 yy::Stack::operator[] (unsigned) const,
7788 yy::Slice::operator[] (unsigned),
7789 yy::Slice::operator[] (unsigned) const):
7790 Rename local vars to avoid warnings.
7791 * tests/glr-regression.at (Improper handling of embedded actions
7792 and $-N in GLR parsers): Remove unused local variable from yylex.
7793 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
7794 (void) as arg when not pure, since we now assume C89 when building
7795 Bison. Pacify GCC by using parameter.
7796
7797 2003-06-02 Paul Eggert <eggert@twinsun.com>
7798
7799 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
7800 yy::Location::lines, yy::Location::columns): Rename arguments
7801 to avoid shadowing; this removes a warning generated by GCC 3.3.
7802
7803 2003-06-01 Paul Eggert <eggert@twinsun.com>
7804
7805 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
7806 to g++, as GCC 3.3 complains if you do it.
7807 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
7808 everything that WARNING_CFLAGS has, except omit warnings
7809 not suitable for C++.
7810 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
7811 * tests/atlocal.in (CXXFLAGS): New var.
7812 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
7813
7814 Fix a GLR parser bug I reported in February; see
7815 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
7816 The problem was that GLR parsers did not conform to the C standard,
7817 because actions like { $1 = $2 + $3; } expanded to expressions
7818 that invoked YYFILL in separate subexpressions, and YYFILL assigned
7819 to a local variable. The C standard says that expressions
7820 like (var = f ()) + (var = f ()) have undefined behavior.
7821 Another problem was that GCC sometimes issues warnings that
7822 yyfill and its parameters are unused.
7823
7824 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
7825 as possibly unused.
7826 (yyfill): New function.
7827 (YYFILL): Use it.
7828 (yyuserAction): Change type of yynormal to bool, so that it matches
7829 the new yyfill signature. Mark it as possibly unused.
7830
7831
7832 Follow up on a bug I reported in February, where a Bison-generated
7833 parser can loop. Provide a test case and a fix for yacc.c. I
7834 don't have a fix for lalr1.cc or for glr.c, unfortunately.
7835 The original bug report is in:
7836 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
7837
7838 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
7839 macro's size was becoming unwieldy.
7840 (yyerrlab): Do not discard an empty lookahead symbol, as this
7841 might destroy garbage.
7842 (yyerrorlab): New label, with the old contents of YYERROR,
7843 plus the following change: pop the stack of rhs corresponding
7844 to the production that invoked YYERROR. That is how Yacc
7845 behaves, and POSIX requires this behavior.
7846 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
7847 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
7848 Define 'alarm' to do nothing if unistd.h is not available.
7849 Add a new rule "exp: '-' error;" to test the above change to
7850 data/yacc.c. Use 'alarm' to abort any test taking longer than
7851 10 seconds, as it's probably looping.
7852 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
7853 Also, the new yacc.c generates two fewer diagnostics for an
7854 existing test.
7855
7856 2003-05-24 Paul Eggert <eggert@twinsun.com>
7857
7858 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
7859 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
7860 This fixes a problem reported by John Bowman when the Compaq/HP
7861 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
7862 -ansi -Wall -gall).
7863 * data/yacc.c (union yyalloc): Likewise.
7864 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
7865
7866 Switch from 'int' to 'bool' where that makes sense.
7867
7868 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
7869 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
7870 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
7871 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
7872 Return or accept bool, not int. All callers changed.
7873 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
7874 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
7875 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
7876 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
7877 bitset_or_and_cmp_): Likewise.
7878 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
7879 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
7880 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
7881 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
7882 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
7883 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
7884 bitset_stats_or_and_cmp): Likewise.
7885 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
7886 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
7887 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
7888 ebitset_xor_cmp): Likewise.
7889 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
7890 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
7891 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
7892 lbitset_xor_cmp): Likewise.
7893 * lib/bbitset.h: Include <stdbool.h>.
7894 (struct bitset_vtable): The following members now return bool, not
7895 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
7896 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
7897 or_and_cmp).
7898 * src/conflicts.c (count_rr_conflicts): Likewise.
7899 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
7900 All uses changed.
7901 * lib/ebitset.c (ebitset_obstack_init): Likewise.
7902 * lib/lbitset.c (lbitset_obstack_init): Likewise.
7903 * src/getargs.c (debug_flag, defines_flag, locations_flag,
7904 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7905 graph_flag): Likewise.
7906 * src/getargs.h (debug_flag, defines_flag, locations_flag,
7907 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7908 graph_flag): Likewise.
7909 * src/output.c (error_verbose): Likewise.
7910 * src/output.h (error_verbose): Likewise.
7911 * src/reader.c (start_flag, typed): Likewise.
7912 * src/reader.h (typed): Likewise.
7913 * src/getargs.c (LOCATIONS_OPTION): New constant.
7914 (long_options, getargs): Use it.
7915 * src/lalr.c (build_relations): Use bool, not int.
7916 * src/nullable.c (nullable_compute): Likewise.
7917 * src/print.c (print_reductions): Likewise.
7918 * src/tables.c (action_row, pack_vector): Likewise.
7919 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
7920 * src/output.c (prepare): Use it.
7921 * src/output.c (token_definitions_output,
7922 symbol_destructors_output, symbol_destructors_output): Use string,
7923 not boolean integer, to keep track of whether to output separator.
7924 * src/print_graph.c (print_core): Likewise.
7925 * src/state.c (state_rule_lookaheads_print): Likewise.
7926
7927 * config/install-sh: Sync from automake 1.7.5.
7928
7929 2003-05-14 Paul Eggert <eggert@twinsun.com>
7930
7931 * src/parse-gram.y (rules_or_grammar_declaration): Require a
7932 semicolon after a grammar declaration, in the interest of possible
7933 future changes to the Bison input language.
7934 Do not allow a stray semicolon at the start of the grammar.
7935 (rhses.1): Allow one or more semicolons after any rule, including
7936 just before "|" as required by POSIX.
7937 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
7938 grammar.
7939
7940 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
7941
7942 %parse-param support for lalr1.cc.
7943
7944 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
7945 b4_cc_constructor_calls, b4_cc_constructor_call,
7946 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
7947 definitions.
7948 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
7949 parse-param arguments.
7950 (yy::b4_parser_class_name): Declare instance variables to
7951 hold parse-param arguments.
7952 * tests/calc.at: s/value/semantic_value/ because value clashes
7953 with a member of yy::b4_parser_class_name. Adjust C++ code
7954 to handle %parse-param. Enable %parse-param test in C++.
7955
7956 2003-05-12 Paul Eggert <eggert@twinsun.com>
7957
7958 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
7959 English a bit. Fix fclose typo. Change "const char" to "char
7960 const", and use ANSI C rather than K&R for "main". Suggest
7961 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
7962 and suggest yy_switch_to_buffer.
7963
7964 2003-05-05 Paul Eggert <eggert@twinsun.com>
7965
7966 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
7967 C89. This avoids a diagnostic on compilers that define __STDC__
7968 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
7969 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7970
7971 2003-05-03 Paul Eggert <eggert@twinsun.com>
7972
7973 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
7974 Do not overrun array bounds.
7975 This should fix a bug reported today by Olatunji Oluwabukunmi in
7976 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
7977
7978 2003-04-29 Akim Demaille <akim@epita.fr>
7979
7980 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
7981 * src/getargs.c, src/getargs.h: here, as bool, not int.
7982 (nondeterministic_parser): New.
7983 * src/parse-gram.y, src/scan-gram.l: Support
7984 %nondeterministic-parser.
7985 * src/output.c (prepare): Use nondeterministic_parser instead
7986 of glr_parser where appropriate.
7987 * src/tables.c (conflict_row, action_row, save_row)
7988 (token_actions, token_actions, pack_vector): Ditto.
7989
7990 2003-04-29 Akim Demaille <akim@epita.fr>
7991
7992 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
7993
7994 2003-04-29 Akim Demaille <akim@epita.fr>
7995
7996 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
7997 with %pure-parser and %locations to exercise the patch from Yakov
7998 Markovitch below.
7999
8000 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
8001
8002 * data/yacc.c: (b4_lex_param): Corrected for the case where
8003 %lex-param is provided and %pure-parser isn't.
8004
8005 2003-04-27 Paul Eggert <eggert@twinsun.com>
8006
8007 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
8008 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
8009 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
8010 if it is not defined.
8011 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
8012
8013 2003-04-26 Paul Eggert <eggert@twinsun.com>
8014
8015 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
8016 Declare to be of type suitable for the ninf value itself, not of
8017 type suitable for the corresponding table, since the latter might
8018 be unsigned but the ninf value might be negative. This fixes a
8019 bug reported by Alexandre Duret-Lutz in
8020 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
8021
8022 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
8023 invokes it. We shouldn't invoke it twice because it will attempt
8024 to put error.o in the archive twice. This fixes a glitch reported
8025 by Martin Mokrejs in
8026 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
8027
8028 2003-04-21 Paul Eggert <eggert@twinsun.com>
8029
8030 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
8031 to gnulib.
8032
8033 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
8034
8035 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
8036 Fix obvious typo that results in uncompilable GLR parsers
8037 when both %pure-parser and %locations are used. (trivial change)
8038
8039 2003-04-17 Paul Eggert <eggert@twinsun.com>
8040
8041 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
8042 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
8043 Do not insert the expected token via unput, as this runs afoul
8044 of a POSIX-compatibility bug in flex 2.5.31.
8045 All uses changed to BEGIN the parent state,
8046 since we no longer insert the expected token via unput.
8047 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
8048 that is no longer emitted after the above change.
8049
8050 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
8051 the first one. This change is from Paul Hilfinger, and it fixes
8052 regression reported by Werner Lemberg in
8053 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
8054
8055 (resolve_sr_conflict): Don't invoke state_errs_set
8056 unless one or more tokens have been explicitly made errors.
8057 Otherwise, the above change causes Bison to abort.
8058
8059 * tests/existing.at (GNU pic Grammar): New test case, taken from
8060 Lemberg's email.
8061
8062 2003-03-31 Akim Demaille <akim@epita.fr>
8063
8064 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
8065
8066 2003-03-31 Akim Demaille <akim@epita.fr>
8067
8068 * src/output.c (prepare_symbols): Avoid trailing spaces in the
8069 output.
8070
8071 2003-03-31 Akim Demaille <akim@epita.fr>
8072
8073 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
8074 From Paul Hilfinger.
8075
8076 2003-03-29 Akim Demaille <akim@epita.fr>
8077
8078 * m4/error.m4: Do not put under dynamic conditions some code which
8079 expansion is under static control.
8080
8081 2003-03-29 Akim Demaille <akim@epita.fr>
8082
8083 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
8084
8085 2003-03-29 Akim Demaille <akim@epita.fr>
8086
8087 * doc/bison.texinfo (Strings are Destroyed): New.
8088
8089 2003-03-13 Paul Eggert <eggert@twinsun.com>
8090
8091 * .cvsignore: Add configure.lineno.
8092 * src/.cvsignore: Add yacc.
8093 * tests/.cvsignore: Add testsuite.log.
8094 * doc/fdl.texi: Sync with latest FSF version.
8095
8096 2003-03-12 Paul Eggert <eggert@twinsun.com>
8097
8098 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
8099 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
8100 cursor, instead of leaving it undefined. This fixes a bug
8101 reported by Tim Van Holder in
8102 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
8103 * tests/input.at (Torturing the Scanner): Test the scanner on
8104 an empty input file, which was Tim Van Holder's test case.
8105
8106 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
8107 <sys/resource.h> can be included, include sys/time.h and
8108 sys/times.h first, if available. This works around the SunOS
8109 4.1.4 porting bug reported by Bruce Becker in
8110 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
8111
8112 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
8113 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
8114 AC_HEADER_SYS_WAIT.
8115
8116 Merge changes from gnulib. This was prompted because the CVS
8117 snapshot didn't build on Solaris 7 due to strnlen problems.
8118
8119 These changes need to be merged back into gnulib:
8120 * lib/hash.c: Include <stdbool.h> unconditionally.
8121 * m4/onceonly.m4 (m4_quote): New macro.
8122 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
8123 Quote AC_FOREACH variable-expansions properly.
8124 The 2003-01-03 obstack.h change also needs merging.
8125 {end of changes requiring merging}
8126
8127 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8128 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
8129 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
8130 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
8131 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
8132 New files, imported from gnulib.
8133 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
8134 above.
8135
8136 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
8137 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
8138 gnulib sources.
8139
8140 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
8141 Add.
8142 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
8143 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
8144 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
8145 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
8146 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
8147 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
8148 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
8149 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
8150 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
8151 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
8152 (jm_PREREQ_ARGMATCH): Remove.
8153 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
8154 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
8155
8156 * src/system.h: Include <stdbool.h> unconditionally.
8157
8158 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
8159 assuming at least C89 in the bitset code for some time now.
8160
8161 2003-03-03 Akim Demaille <akim@epita.fr>
8162
8163 * ro.po: New.
8164
8165 2003-03-02 Akim Demaille <akim@epita.fr>
8166
8167 * doc/bison.texinfo (Table of Symbols): Reactivate the
8168 documentation for %lex-param, and %parse-param.
8169
8170 2003-03-02 Akim Demaille <akim@epita.fr>
8171
8172 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
8173 generate verbose error messages.
8174 Use the number of tokens as an upper bound in yytname, as it
8175 cannot be a non terminal.
8176
8177 2003-03-02 Akim Demaille <akim@epita.fr>
8178
8179 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
8180 message.
8181
8182 2003-03-02 Akim Demaille <akim@epita.fr>
8183
8184 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
8185 Use them to exercise yycheck overrun.
8186 Based on Andrew Suffield's grammar.
8187
8188 2003-03-02 Akim Demaille <akim@epita.fr>
8189
8190 Create tests/local.at for Bison generic testing macros.
8191
8192 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
8193 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
8194 This new file.
8195 * tests/calc.at (AT_CHECK_CALC): Adjust.
8196 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
8197 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
8198 * tests/local.at: here.
8199 (AT_COMPILE_CXX): Tags the tests using it as c++.
8200 Ignore the test if CXX is not functional.
8201
8202 2003-03-01 Paul Eggert <eggert@twinsun.com>
8203
8204 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
8205 not loc->end, since loc->end might contain garbage and this leads
8206 to undefined behavior on some platforms.
8207 (id_loc, token_start): Use (IF_LINTed) initial values that do not
8208 depend on *loc, so that the reader doesn't give the the false
8209 impression that *loc is initialized.
8210 (<INITIAL>"%%"): Do not bother setting code_start, since its value
8211 does not survive the return.
8212
8213 2003-03-01 Akim Demaille <akim@epita.fr>
8214
8215 * src/scan-gram.l (code_start): Always initialize it when entering
8216 into yylex, as SC_EPILOGUE is activated *before* the corresponding
8217 yylex invocation. An alternative would be making it static, but
8218 then it starts with the second %%'s beginning, instead of its end.
8219
8220 2003-02-28 Paul Eggert <eggert@twinsun.com>
8221
8222 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
8223 around a UnixWare 7.1.1 porting bug reported by John Hughes in
8224 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
8225
8226 2003-02-26 Paul Eggert <eggert@twinsun.com>
8227
8228 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
8229 Remove Sequent/Pyramid discussion (nobody uses them any more).
8230 Merge VMS and MS-DOS discussion; these ports may well be dead
8231 but let's keep mentioning them for now. Put <> around email
8232 addresses. Add copyright notice.
8233
8234 2003-02-24 Paul Eggert <eggert@twinsun.com>
8235
8236 * data/glr.c (yy_reduce_print): yylineno -> yylno,
8237 to avoid collision with flex use of yylineno.
8238 Problem reported by Bruce Lilly in
8239 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
8240 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8241 * data/yacc.c (yy_reduce_print): Likewise.
8242
8243 * config/depcomp: Sync with Automake 1.7.3.
8244
8245 2003-02-21 Akim Demaille <akim@epita.fr>
8246
8247 * data/lalr1.cc: Use temporary variables instead of casts to
8248 change integer types.
8249 Suggested by Paul Eggert.
8250
8251 2003-02-21 Akim Demaille <akim@epita.fr>
8252
8253 * doc/bison.texinfo: Use "location" consistently to refer to @n,
8254 to avoid confusions with lalr1.cc's notion of Position.
8255 Suggested by Paul Eggert.
8256
8257 2003-02-20 Akim Demaille <akim@epita.fr>
8258
8259 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
8260 before initial_columns.
8261 (location.hh): Use consistent variable names when defining the
8262 operator<<.
8263 Use "last" so that we subtract from Positions, not from unsigned.
8264
8265 2003-02-20 Akim Demaille <akim@epita.fr>
8266
8267 * data/lalr1.cc (position.hh): New subfile, including the extended
8268 and Doxygen'ed documentation of class Position.
8269 (location.hh): Use it.
8270 Document a` la Doxygen.
8271 With the help of Benoit Perrot.
8272
8273 2003-02-20 Akim Demaille <akim@epita.fr>
8274
8275 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
8276 AT_YACC_IF.
8277 Redefine AT_YYERROR_SEES_LOC_IF using it.
8278 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
8279 not defined.
8280 Don't use the location in yy::Parser::error_ and
8281 yy::Parser::print_ when not %locations.
8282 Activate more lalr1.cc tests.
8283
8284 2003-02-19 Akim Demaille <akim@epita.fr>
8285
8286 * data/lalr1.cc: When displaying a line number, be sure to make it
8287 an int.
8288
8289 2003-02-19 Akim Demaille <akim@epita.fr>
8290
8291 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
8292 Remove, useless.
8293 (YYABORT, YYACCEPT, YYERROR): New.
8294 * tests/calc.at: Renable the lalr1.cc test.
8295
8296 2003-02-19 Akim Demaille <akim@epita.fr>
8297
8298 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
8299 error recovery, mixing with/without pops and discarding of the
8300 lookahead.
8301 Exercise YYERROR.
8302 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
8303
8304 2003-02-17 Paul Eggert <eggert@twinsun.com>
8305
8306 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
8307 * tests/testsuite.at (AT_COMPILE): Use them.
8308 This fixes the testsuite problem reported by Robert Lentz in
8309 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
8310
8311 2003-02-12 Paul Eggert <eggert@twinsun.com>
8312
8313 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
8314 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
8315 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
8316 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
8317 Check for malloc failure, for consistency with yacc.c.
8318 (yytname_size): Remove, for consistency with yacc.c.
8319
8320 The bug still remains in data/lalr1.cc, as I didn't have time
8321 to fix it there.
8322
8323 2003-02-06 Akim Demaille <akim@epita.fr>
8324
8325 * configure.ac (GXX): Rename as...
8326 (CXX): this, to keep the original Autoconf semantics.
8327 Require 2.57.
8328 * data/lalr1.cc: Fix b4_copyright invocations.
8329 If YYDEBUG is not defined, don't depend upon name_ being defined.
8330 (location.hh): Include string and iostream.
8331 (Position::filename): New member.
8332 (Position::Position ()): New.
8333 (operator<< (Position)): New.
8334 (operator- (Position, int)): New.
8335 (Location::first, Location::last): Rename as...
8336 (Location::begin, Location::end): these, to mock the conventional
8337 iterator names.
8338 (operator<< (Location)): New.
8339 * tests/atlocal.in (CXX): New.
8340 * tests/testsuite.at (AT_COMPILE_CXX): New.
8341 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
8342 locations in a more synthetic way.
8343 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
8344 lalr1.cc is used.
8345 Adjust the C locations to match those from Emacs: first column is
8346 column 0.
8347 Change all the expected results.
8348 Conform to the GCS: simplify the locations when applicable.
8349 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
8350 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
8351 these CPP macros with the m4 macros new defined by...
8352 (AT_CHECK_PUSHDEFS): this, i.e.:
8353 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
8354 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
8355 New macros.
8356 (AT_CHECK_POPDEFS): Undefine them.
8357 (AT_CHECK_CALC_LALR1_CC): New.
8358 Use it for the first lalr1.cc test.
8359
8360 2003-02-04 Akim Demaille <akim@epita.fr>
8361
8362 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
8363 Location as is defined.
8364
8365 2003-02-04 Akim Demaille <akim@epita.fr>
8366
8367 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
8368 name_ being defined.
8369
8370 2003-02-03 Paul Eggert <eggert@twinsun.com>
8371
8372 * src/gram.h (start_symbol): Remove unused decl.
8373
8374 Use more-consistent naming conventions for local vars.
8375
8376 * src/derives.c (derives_compute): Change type of local var from
8377 int to rule_number.
8378 * src/gram.c (grammar_rules_partial_print): Likewise.
8379 * src/print.c (print_core): Likewise.
8380 * src/reduce.c (reduce_grammar_tables): Likewise.
8381
8382 * src/gram.c (grammar_dump): Change name of item_number *
8383 local var from r to rp.
8384 * src/nullable.c (nullable_compute): Likewise.
8385
8386 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
8387
8388 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
8389 for symbol or symbol_number var.
8390 * src/reader.c (grammar_start_symbol_set): Likewise.
8391 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
8392 Likewise.
8393 * src/state.c (transitions_to): Likewise.
8394 * src/state.h: Likewise.
8395 * src/tables.c (symbol_number_to_vector_number): Likewise.
8396
8397 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
8398 char * var.
8399
8400 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
8401 var.
8402
8403 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
8404 var.
8405
8406 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
8407 Use str, not s, for char * var. Use ch, not c, for character var.
8408 Use size for size var.
8409
8410 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
8411 char * var.
8412 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
8413 uniqstr var.
8414 * src/uniqstr.h: Likewise.
8415
8416 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8417 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8418 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
8419 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
8420 param to have same name as that of enum, so that we don't use
8421 "s" to stand for a non-state.
8422
8423 2003-02-02 Akim Demaille <akim@epita.fr>
8424
8425 * src/scan-skel.l: Scan more than one inert character per yylex
8426 invocation.
8427
8428 2003-02-01 Paul Eggert <eggert@twinsun.com>
8429
8430 Version 1.875a.
8431
8432 * po/LINGUAS: Add ms.
8433
8434 2003-01-30 Akim Demaille <akim@epita.fr>
8435
8436 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
8437
8438 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8439
8440 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
8441 of $1.
8442
8443 Changes in response to error report by S. Eken: GLR mode does not
8444 handle negative $ indices or $ indices in embedded rules correctly.
8445 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
8446
8447 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
8448 (b4_rhs_location): Ditto.
8449 (yyfill): New function to copy from stack tree into array
8450 incrementally.
8451 (yyuserAction): Modify to allow incremental move of semantic values
8452 to rhs array when in GLR mode.
8453 Define YYFILL to use in user-defined actions to fill semantic array
8454 as needed.
8455 Remove dummy use of yystack, as there is now a guaranteed use.
8456 (yydoAction): Modify to allow incremental move of semantic values
8457 to rhs array when in GLR mode.
8458 (yyresolveAction): Ditto.
8459 (yyglrShiftDefer): Update comment.
8460 (yyresolveStates): Use X == NULL for pointers, not !X.
8461 (yyglrReduce): Ditto.
8462 (yydoAction): Ditto
8463
8464 * tests/glr-regr1.at: Rename to ...
8465 * tests/glr-regression.at: Add new regression test for the problems
8466 described above (adapted from S. Eken).
8467 Update copyright notice.
8468 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
8469 * tests/Makefile.am: Ditto.
8470
8471 2003-01-28 Paul Eggert <eggert@twinsun.com>
8472
8473 * data/lalr1.cc: Do not use @output_header_name@ unless
8474 b4_defines_flag is set. This fixes two bugs reported by
8475 Tim Van Holder in
8476 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
8477 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
8478
8479 2003-01-21 Paul Eggert <eggert@twinsun.com>
8480
8481 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
8482 we don't need to worry about yyerrlab1 being reported as an
8483 "unused label" by non-GCC C compilers. The downside is that if
8484 locations are used then a couple of statements are duplicated each
8485 time YYERROR is invoked, but the upside is that the warnings
8486 should vanish.
8487 (yyerrlab1): Move code to YERROR.
8488 (yyerrlab2): Remove. Change uses back to yyerrlab1.
8489 This reverts some of the 2002-12-27 change.
8490
8491 2003-01-17 Paul Eggert <eggert@twinsun.com>
8492
8493 * src/output.c (symbol_printers_output): Fix typo that led
8494 to core dump. Problem reported by Antonio Rus in
8495 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
8496
8497 2003-01-13 Akim Demaille <akim@epita.fr>,
8498 Quoc Peyrot <chojin@lrde.epita.fr>,
8499 Robert Anisko <anisko_r@lrde.epita.fr>
8500
8501 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
8502 when the stacks contain one element, as the loop would otherwise
8503 free the last state, and then use the top state (the one we just
8504 popped). This means that the initial elements will not be freed
8505 explicitly, as is the case in yacc.c; it is not a problem, as
8506 these elements have fake values.
8507
8508 2003-01-11 Paul Eggert <eggert@twinsun.com>
8509
8510 * NEWS: %expect-violations are now just warnings, reverting
8511 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
8512 bootstrapping problem reported by Matthias Klose; see
8513 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
8514 * src/conflicts.c (conflicts_print): Likewise.
8515 * tests/conflicts.at (%expect not enough, %expect too much,
8516 %expect with reduce conflicts): Likewise.
8517 * doc/bison.texinfo (Expect Decl): Document this. Also mention
8518 that the warning is enabled if the number of conflicts changes
8519 (not necessarily increases).
8520
8521 * src/getargs.c (version): Update copyright year.
8522
8523 2003-01-09 Akim Demaille <akim@epita.fr>
8524
8525 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
8526
8527 2003-01-08 Paul Eggert <eggert@twinsun.com>
8528
8529 * Makefile.maint (WGETFLAGS):
8530 New macro, containing "-C off" to disable proxy caches.
8531 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
8532 (rel-check): Use $(WGET) instead of wget.
8533
8534 2003-01-06 Paul Eggert <eggert@twinsun.com>
8535
8536 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
8537 the GLR paper of Scott, Johnstone and Hussain.
8538
8539 2003-01-04 Paul Eggert <eggert@twinsun.com>
8540
8541 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
8542 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
8543 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
8544 (EXTRA_LIBRARIES): New var, for liby.a.
8545 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
8546 (EXTRA_SCRIPTS): New var, for yacc.
8547
8548 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
8549 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
8550 Problem reported by Nelson H. F. Beebe.
8551
8552 2003-01-03 Paul Eggert <eggert@twinsun.com>
8553
8554 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
8555 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8556 when compiling Bison 1.875's `bitset bset = obstack_alloc
8557 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8558
8559 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
8560 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
8561 grow to a huge size with typical invocation.
8562
8563 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
8564 Use the pattern recommended by Autoconf 2.57, except also protect
8565 against double-definition.
8566 * src/system.h: Likewise.
8567 Portability issues reported by Nelson H. F. Beebe.
8568
8569 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
8570 All uses changed. Provide a definition in both C and C++.
8571 (yytrue, yyfalse): Define even if defined (__cplusplus).
8572
8573 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
8574 Reported by Nelson H. F. Beebe.
8575
8576 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
8577
8578 2003-01-02 Paul Eggert <eggert@twinsun.com>
8579
8580 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
8581 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
8582 Bug reported by Nelson H. F. Beebe.
8583
8584 2003-01-01 Paul Eggert <eggert@twinsun.com>
8585
8586 * Version 1.875.
8587
8588 2002-12-30 Paul Eggert <eggert@twinsun.com>
8589
8590 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
8591 Moved here from...
8592 (<INITIAL>","): Here. This causes stray "," to be treated
8593 more uniformly.
8594
8595 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
8596 last brace in braced code when not in Yacc mode, for compatibility
8597 with Bison 1.35. This resurrects the 2001-12-15 patch to
8598 src/reader.c.
8599
8600 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
8601 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
8602
8603 2002-12-28 Paul Eggert <eggert@twinsun.com>
8604
8605 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
8606 that of SYM's type. This fixes Debian bug 168069, reported by
8607 Thomas Olsson.
8608
8609 2002-12-28 Paul Eggert <eggert@twinsun.com>
8610
8611 Version 1.75f.
8612
8613 Switch back to the Yacc style of conflict reports, undoing some
8614 of the 2002-07-30 change.
8615 * doc/bison.texinfo (Understanding): Use Yacc style for
8616 conflict reports. Also, use new way of locating rules.
8617 * src/conflicts.c (conflict_report):
8618 Renamed from conflict_report_yacc, removing the old
8619 'conflict_report'. Translate the entire conflict report at once,
8620 so that we don't assume that "," has the same interpretation in
8621 all languages.
8622 (conflicts_output): Use Yacc-style conflict report for each state,
8623 instead of our more-complicated style.
8624 (conflicts_print): Use Yacc-style conflict report, except print
8625 the input file name when not emulating Yacc.
8626 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
8627 Conflicted Reduction, %expect not enough, %expect too much,
8628 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
8629 * tests/existing.at (GNU Cim Grammar): Likewise.
8630 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
8631
8632 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
8633 fatal): Don't invoke fflush; it's not needed and it might even be
8634 harmful for stdout, as stdout might not be open.
8635 * src/reduce.c (reduce_print): Likewise.
8636
8637 2002-12-27 Paul Eggert <eggert@twinsun.com>
8638
8639 Fix a bug where error locations were not being recorded correctly.
8640 This problem was originally reported by Paul Hilfinger in
8641 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
8642
8643 * data/yacc.c (yyparse): New local var yylerrsp, to record the
8644 top of the location stack's error locations.
8645 (yyerrlab): Set it. When discarding a token, push its location
8646 onto yylerrsp so that we don't lose track of the error's end.
8647 (yyerrlab1): Now is only the target of YYERROR, so that we can
8648 properly record the location of the action that failed. For GCC
8649 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
8650 GCC warning about yyerrlab1 being unused if YYERROR is unused.
8651 (yyerrlab2): New label, which yyerrlab now falls through to.
8652 Compute the error's location by applying YYLLOC_DEFAULT to
8653 the locations of all the symbols that went into the error.
8654 * doc/bison.texinfo (Location Default Action): Mention that
8655 YYLLOC_DEFAULT is also invoked for syntax errors.
8656 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8657 Error locations include the locations of all the tokens that were
8658 discarded, not just the last token.
8659
8660 2002-12-26 Paul Eggert <eggert@twinsun.com>
8661
8662 * src/files.c: Include quote.h.
8663 (compute_output_file_names): Warn if we detect conflicting
8664 outputs to the same file. This should catch the misunderstanding
8665 exemplified by Debian Bug 165349, reported by Bruce Stephens..
8666
8667 * src/conflicts.c (conflicts_print): If the user specifies
8668 "%expect N", report an error if there are any reduce/reduce
8669 conflicts. This is what the manual says should happen.
8670 This fixes Debian bug 130890, reported by Anthony DeRobertis.
8671 * tests/conflicts.at (%expect with reduce conflicts): New test.
8672
8673 Don't use m4_include on relative file names, as it doesn't work as
8674 desired if there happens to be a file with that name under ".".
8675
8676 * m4sugar/version.m4: Remove; it was included but it wasn't used.
8677 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
8678 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
8679 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
8680 * src/output.c (output_skeleton): Use full path names when
8681 specifying a file to include; don't rely on include path, as
8682 it's unreliable when the working file contains a file with
8683 that name.
8684
8685 2002-12-25 Paul Eggert <eggert@twinsun.com>
8686
8687 Remove obsolete references to bison.simple and bison.hairy.
8688 Problem mentioned by Aubin Mahe in
8689 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
8690 * data/glr.c: Comment fix.
8691 * doc/bison.1: Remove references. Also, mention "yacc".
8692
8693 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
8694 with -g option.
8695
8696 * src/parse-gram.y (declaration): Use enum "report_states" rather
8697 than its numeric value 1.
8698
8699 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
8700 opening a new one. This fixes Debian bug 165349, reported by
8701 Bruce Stephens.
8702
8703 2002-12-24 Paul Eggert <eggert@twinsun.com>
8704
8705 Version 1.75e.
8706
8707 * Makefile.maint (cvs-update): Don't assume that the shell
8708 supports $(...), as Solaris sh doesn't.
8709
8710 * src/parse-gram.y (lloc_default): Remove test for empty
8711 nonterminals at the end, since it didn't change the result.
8712
8713 2002-12-24 Paul Eggert <eggert@twinsun.com>
8714
8715 If the user does not define YYSTYPE as a macro, Bison now declares it
8716 using typedef instead of defining it as a macro. POSIX requires this.
8717 For consistency, YYLTYPE is also declared instead of defined.
8718
8719 %union directives can now have a tag before the `{', e.g., the
8720 directive `%union foo {...}' now generates the C code
8721 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
8722 The default union tag is `YYSTYPE', for compatibility with Solaris 9
8723 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
8724 instead of `yyltype'.
8725
8726 `yystype' and `yyltype' are now obsolescent macros instead of being
8727 typedefs or tags; they are no longer documented and will be
8728 withdrawn in a future release.
8729
8730 * data/glr.c (b4_location_type): Remove.
8731 (YYSTYPE): Renamed from yystype.
8732 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
8733 (struct YYLTYPE): Renamed from struct yyltype.
8734 (YYLTYPE): Renamed from yyltype.
8735 (yyltype, yystype): New (and obsolescent) macros,
8736 for backward compatibility.
8737 * data/yacc.c: Likewise.
8738
8739 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
8740 does not specify a union tag. This is for compatibility with
8741 Solaris 9 yacc.
8742
8743 * src/parse-gram.y (add_param): 2nd arg is now char * not char
8744 const *, since it is now modified by stripping surrounding { }.
8745 (current_braced_code): Remove.
8746 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
8747 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
8748 trailing " {...}". Now of type <chars>.
8749 (grammar_declaration): Adjust to bundled tokens.
8750 (code_content): Remove; stripping is now done by add_param.
8751 (print_token_value): Print contents of bundled tokens.
8752 (token_name): New function.
8753
8754 * src/reader.h (braced_code, current_braced_code): Remove.
8755 (token_name): New decl.
8756
8757 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
8758 token_type, not braced_code code_kind. All uses changed.
8759 (SC_PRE_CODE): New state, for scanning after a keyword that
8760 has (or usually has) an immediately-following braced code.
8761 (token_type): New local var, to keep track of which token type
8762 to return when scanning braced code.
8763 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
8764 <INITIAL>"%parse-param", <INITIAL>"%printer",
8765 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
8766 instead of returning a token type immediately.
8767 (<INITIAL>"{"): Set token type.
8768 (<SC_BRACED_CODE>"}"): Use it.
8769 (handle_action_dollar, handle_action_at): Now returns bool
8770 indicating success. Fail if ! current_rule; this prevents a core dump.
8771 (handle_symbol_code_dollar, handle_symbol_code_at):
8772 Remove; merge body into caller.
8773 (handle_dollar, handle_at): Complain in invalid contexts.
8774
8775 * NEWS, doc/bison.texinfo: Document the above.
8776 * NEWS: Fix years and program names in copyright notice.
8777
8778 2002-12-17 Paul Eggert <eggert@twinsun.com>
8779
8780 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
8781 Reporting, Table of Symbols): Omit mentions of %lex-param and
8782 %parse-param from the documentation for now.
8783
8784 2002-12-15 Paul Eggert <eggert@twinsun.com>
8785
8786 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
8787 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
8788 lookahead symbol, and which sets yychar in parser actions) and it
8789 disagreed with the Bison documentation. Bug
8790 reported by Andrew Walrond.
8791
8792 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
8793 as the caller now does that.
8794 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
8795 (YYEMPTY): Parenthesize right hand side, since others use it.
8796 (yyparse): Don't assume that our generated code is the only code
8797 that sets yychar.
8798
8799 2002-12-13 Paul Eggert <eggert@twinsun.com>
8800
8801 Version 1.75d.
8802
8803 POSIX requires a "yacc" command.
8804 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
8805 (MOSTLYCLEANFILES): Add yacc.
8806 (yacc): New rule.
8807 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
8808 as an alias for bison y.
8809
8810 * po/LINGUAS: Add da.
8811
8812 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
8813 problem with latest <getopt.h>.
8814 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
8815
8816 * doc/fdl.texi: Upgrade to 1.2.
8817 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
8818 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
8819 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
8820 gnulib.
8821 * config/install-sh: Sync with autotools.
8822
8823 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
8824 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8825 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
8826 locations are requested.
8827 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
8828 locations are requested.
8829
8830 2002-12-12 Paul Eggert <eggert@twinsun.com>
8831
8832 Remove unportable casts and storage allocation tricks.
8833 While we're at it, remove almost all casts, since they
8834 usually aren't needed and are a sign of trouble.
8835
8836 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
8837
8838 * src/derives.c (derives_compute): Do not subtract NTOKENS from
8839 the pointer DSET returned by malloc; this isn't portable.
8840 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
8841 Similarly for DERIVES.
8842 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
8843 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
8844 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
8845
8846 * src/derives.c (derives_compute): Do not bother invoking
8847 int_of_rule_number, since rule numbers are integers.
8848
8849 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
8850 rather than XMALLOC (char, N).
8851
8852 * src/files.c (filename_split): Rewrite to avoid cast.
8853
8854 * src/gram.h (symbol_number_as_item_number,
8855 item_number_as_symbol_number, rule_number_as_item_number,
8856 item_number_as_rule_number):
8857 Now inline functions rather than macros, to avoid casts.
8858 * src/state.h (state_number_as_int): Likewise.
8859 * src/tables.c (state_number_to_vector_number,
8860 symbol_number_to_vector_number): Likewise.
8861
8862 * src/gram.h (int_of_rule_number): Remove; no longer used.
8863
8864 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
8865 since the resulting storage is always stored into.
8866
8867 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
8868 where it's needed.
8869
8870 * src/muscle_tab.c (muscle_m4_output):
8871 Now inline. Return bool, not int.
8872 * src/state.c (state_compare): Likewise.
8873 * src/symtab.c (symbol_check_defined,
8874 symbol_check_alias_consistency, symbol_pack, symbol_translation,
8875 hash_compare_symbol, hash_symbol):
8876 Likewise.
8877 * src/uniqstr.c (uniqstr_print): Likewise.
8878 * src/muscle_tab.c (muscle_m4_output_processor):
8879 New function, to avoid casts.
8880 * src/state.c (state_comparator, stage_hasher): Likewise.
8881 * src/symtab.c (symbol_check_defined_processor,
8882 symbol_check_alias_consistency_processor, symbol_pack_processor,
8883 symbol_translation_processor, hash_symbol_comparator,
8884 hash_symbol_hasher): Likewise.
8885 * src/uniqstr.c (uniqstr_print_processor): Likewise.
8886 * src/muscle_tab.c (muscles_m4_output):
8887 Use new functions instead of casting old functions unportably.
8888 * src/state.c (state_hash_new): Likewise.
8889 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
8890 symbols_token_translations_init):
8891 Likewise.
8892 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
8893
8894 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
8895 var instead of casting to long, to avoid casts.
8896 (prepare_states): Use MALLOC rather than alloca, so that we don't
8897 have to worry about alloca.
8898 * src/state.c (state_hash_lookup): Likewise.
8899
8900 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
8901 local var instead of casting to unsigned char, to avoid casts.
8902
8903 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
8904 STATE_ALLOC): Remove.
8905 (transitions_new, errs_new, reductions_new, state_new): Use malloc
8906 rather than calloc, and use offsetof to avoid allocating slightly
8907 too much storage.
8908 (state_new): Initialize all members.
8909
8910 * src/state.c (state_hash): Use unsigned accumulator, not signed.
8911
8912 * src/symtab.c (symbol_free): Remove; unused.
8913 (symbol_get): Remove cast in lhs of assignment.
8914 (symbols_do): Now static. Accept generic arguments, not
8915 hashing-related ones.
8916
8917 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
8918 (symbol_processor): Remove.
8919 (symbols_do): Remove decl; now static.
8920
8921 * src/system.h (alloca): Remove; decl no longer needed.
8922 (<stddef.h>): Include, for offsetof.
8923 (<inttypes.>, <stdint.h>): Include if available.
8924 (uintptr_t): New type, if system lacks it.
8925 (CALLOC, MALLOC, REALLOC): New macros.
8926 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
8927 new macros.
8928
8929 * src/tables.c (table_size): Now int, to pacify GCC.
8930 (table_grow, table_ninf_remap): Use signed table size.
8931 (save_row): Don't bother initializing locals when not needed.
8932 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
8933 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
8934
8935 * src/vcg.h: Correct misspellings.
8936
8937 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
8938
8939
8940 * src/getargs.c (getargs): Don't assume EOF == -1.
8941
8942 2002-12-09 Paul Eggert <eggert@twinsun.com>
8943
8944 Change identifier spellings to avoid collisions with names
8945 that are reserved by POSIX.
8946
8947 Don't use names ending in _t, since POSIX reserves them.
8948 For consistency, remove _e and _s endings -- they're weren't
8949 needed to remove ambiguity. All uses changed.
8950 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
8951 turn was just renamed from struniq_t.
8952 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
8953 which in turn was just renamed from struniq_processor_t.
8954 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
8955 in turn was renamed from hash_compare_struniq_t.
8956 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
8957 (state_list): Renamed from state_list_t.
8958 * src/assoc.h (assoc): Renamed from assoc_t.
8959 * src/conflicts.c (enum conflict_resolution): Renamed from
8960 enum conflict_resolution_e.
8961 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
8962 (rule_list): Renamed from rule_list_t.
8963 * src/getargs.h (enum trace): Renamed from enum trace_e.
8964 (enum report): Renamed from enum report_e.
8965 * src/gram.h (item_number): Renamed from item_number_t.
8966 (rule_number): Renamed from rule_number_t.
8967 (struct rule_s): Remove the "rule_s" part; not used.
8968 (rule): Renamed from rule_t.
8969 (rule_filter): Renamed from rule_filter_t.
8970 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
8971 (goto_list): Renamed from goto_list_t.
8972 * src/lalr.h (goto_number): Renamed from goto_number_t.
8973 * src/location.h (location): Renamed from location_t.
8974 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
8975 and moved here from:
8976 * src/muscle_tab.h (muscle_entry_t): here.
8977 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
8978 (rule_list): Renamed from rule_list_t.
8979 * src/print_graph.c (static_graph): Renamed from graph.
8980 * src/reader.h (braced_code): Renamed from braced_code_t.
8981 Remove brace_code_e tag.
8982 * src/relation.h (relation_node): Renamed from relation_node_t.
8983 (relation_nodes): Renamed from relation_nodes_t.
8984 (relation): Renamed from relation_t.
8985 * src/state.h (state_number): Renamed from state_number_t.
8986 (struct state): Renamed from struct state_s.
8987 (state): Renamed from state_t.
8988 (transitions): Renamed from transitions_t. Unused (and
8989 misspelled) transtion_s tag removed.
8990 (errs): Renamed from errs_t. Unused errs_s tag removed.
8991 (reductions): Renamed from reductions_t. Unused tag
8992 reductions_s removed.
8993 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
8994 (struct symbol_list): Renamed from struct symbol_list_s.
8995 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
8996 (struct symbol): Renamed from struct symbol_s.
8997 (symbol): Renamed from symbol_t.
8998 * src/tables.c (vector_number): Renamed from vector_number_t.
8999 (action_number): Renamed from action_t.
9000 * src/tables.h (base_number): Renamed from base_t.
9001 * src/vcg.h (enum color): Renamed from enum color_e.
9002 (enum textmode): Renamed from enum textmode_e.
9003 (enum shape): Renamed from enum shape_e.
9004 (struct colorentry): Renamed from struct colorentry_s.
9005 (struct classname): Renamed from struct classname_s.
9006 (struct infoname): Renamed from struct infoname_s.
9007 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
9008 (enum decision): Renamed from enum decision_e.
9009 (enum orientation): Renamed from enum orientation_e.
9010 (enum alignment): Renamed from enum alignment_e.
9011 (enum arrow_mode): Renamed from enum arrow_mode_e.
9012 (enum crossing_type): Renamed from enum crossing_type_e.
9013 (enum view): Renamed from enum view_e.
9014 (struct node): Renamed from struct node_s.
9015 (node): Renamed from node_t.
9016 (enum linestyle): Renamed from enum linestyle_e.
9017 (enum arrowstyle): Renamed from enum arrowstyle_e.
9018 (struct edge): Renamed from struct edge.
9019 (edge): Renamed from edge_t.
9020 (struct graph): Renamed from struct graph_s.
9021 (graph): Renamed from graph_t.
9022 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
9023 Rename value_t -> value.
9024 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
9025 value_t_as_yystype -> value_as_yystype.
9026
9027 Don't include <errno.h> in the mainstream code, since it
9028 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
9029 * lib/get-errno.c, lib/get-errno.h: New files.
9030 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
9031 get-errno.c.
9032 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
9033 * src/output.c (output_skeleton): Likewise.
9034 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
9035 instead of errno.
9036 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
9037 Likewise.
9038 (handle_action_dollar, handle_action_at): Likewise.
9039 * src/system.h: Do not include <errno.h>.
9040 (TAB_EXT): Renamed from EXT_TAB.
9041 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
9042
9043 Avoid str[a-z]*, since <string.h> reserves that name space.
9044 Change all instances of "struniq" in names to "uniqstr", and
9045 likewise for "STRUNIQ" and "UNIQSTR".
9046 * src/uniqstr.c: Renamed from src/struniq.c.
9047 * src/uniqstr.h: Renamed from src/struniq.h.
9048 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
9049 * src/files.c (strsuffix): Remove; unused.
9050 (concat2): Renamed from stringappend. Now static.
9051 * src/files.h (strsuffix, stringappend): Remove; unused.
9052 * src/parse-gram.y (<chars>): Renamed from <string>.
9053 (<uniqstr>): Renamed from <struniq>.
9054 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
9055 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
9056 (struct graph_s.expand): Renamed from struct graph_s.stretch.
9057 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
9058 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
9059 (N_EXPAND): Renamed from N_STRETCH.
9060
9061 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
9062 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
9063 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
9064 Remove; unused.
9065 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
9066 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
9067 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
9068 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
9069 (BASE_MAXIMUM): Renamed from BASE_MAX.
9070 (BASE_MINIMUM): Renamed from BASE_MIN.
9071 (ACTION_MAX): Remove; unused.
9072 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
9073 Unnecessary casts removed from above defines.
9074
9075
9076 Fix misspelling in names.
9077 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
9078 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
9079 G_NODE_ALIGNEMENT.
9080
9081
9082 * lib/timevar.c (timevar_report): Renamed from time_report,
9083 for consistency with other names.
9084 * lib/timevar.h (timevar_report): New decl.
9085 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
9086
9087
9088 Sort include-file uses.
9089
9090 Reorder all include files under src to be in the order "system.h".
9091 then the ../lib include files in angle brackets (alphabetized),
9092 then the . include files in double-quotes (alphabetized). Fix
9093 dependency breakages encountered in this process, as follows:
9094 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
9095 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
9096 * src/state.h: Include "symtab.h".
9097
9098 2002-12-08 Paul Eggert <eggert@twinsun.com>
9099
9100 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
9101 since this causes problems when __file__ contains character
9102 sequences like "@" that are treated specially by src/scan-skel.l.
9103 Instead, just use the file's basename. This fixes the bug
9104 reported by Martin Mokrejs in
9105 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
9106
9107 2002-12-06 Paul Eggert <eggert@twinsun.com>
9108
9109 Add support for rules that do not have trailing semicolons, as
9110 POSIX requires. Improve the quality of locations in Bison
9111 diagnostics.
9112
9113 * src/location.c: Include <quotearg.h>.
9114 (empty_location): Now const.
9115 (location_print): New function. Follow the recommendation of the
9116 GNU Coding Standards for locations that span file boundaries.
9117 * src/location.h: Do not include <quotearg.h>; no longer needed.
9118 (boundary): New type.
9119 (location_t): Use it. This allows locations to span file boundaries.
9120 All member uses changed: file -> start.file or end.file (as needed),
9121 first_line -> start.line, first_column -> start.column,
9122 last_line -> end.line, last_column -> end.column.
9123 (equal_boundaries): New function.
9124 (LOCATION_RESET, LOCATION_STEP): Remove.
9125 (LOCATION_PRINT): Remove. All callers changed to use location_print.
9126 (empty_location): Now const.
9127 (location_print): New decl.
9128 * src/parse-gram.y (lloc_default): New function, which handles
9129 empty locations more accurately.
9130 (YYLLOC_DEFAULT): Use it.
9131 (%token COLON): Remove.
9132 (%token ID_COLON): New token.
9133 (rules): Use it.
9134 (declarations, rules): Remove trailing semicolon.
9135 (declaration, rules_or_grammar_declaration):
9136 Allow empty (";") declaration.
9137 (symbol_def): Remove empty actions; no longer needed.
9138 (rules_or_grammar_declaration): Remove trailing semicolon.
9139 (semi_colon.opt): Remove.
9140 * src/reader.h: Include location.h.
9141 (scanner_cursor): New decl.
9142 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
9143 rolling our own.
9144 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
9145 of *loc.
9146 (STEP): Remove. No longer needed, now that adjust_location does
9147 the work. All uses removed.
9148 (scanner_cursor): New var.
9149 (adjust_location): Renamed from extend_location. It now sets
9150 *loc and adjusts the scanner cursor. All uses changed.
9151 Don't bother testing for CR.
9152 (handle_syncline): Remove location arg; now updates scanner cursor.
9153 All callers changed.
9154 (unexpected_end_of_file): Now accepts start boundary of token or
9155 comment, not location. All callers changed. Update scanner cursor,
9156 not the location.
9157 (SC_AFTER_IDENTIFIER): New state.
9158 (context_state): Renamed from c_context. All uses changed.
9159 (id_loc, code_start, token_start): New local vars.
9160 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
9161 processing of Yacc white space and equivalents here.
9162 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
9163 instead of returning ID immediately, since we need to search for
9164 a subsequent colon.
9165 (<INITIAL>"'", "\""): Save token_start.
9166 (<INITIAL>"%{", "{", "%%"): Save code_start.
9167 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
9168 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
9169 BEGIN context_state at end, not INITIAL.
9170 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
9171 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
9172 Return correct token start.
9173 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
9174 the start of a character, string or multiline comment is found.
9175 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
9176 Reduction): Adjust reported locations to match the more-precise
9177 results now expected.
9178 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
9179 * tests/reduce.at (Useless Rules, Reduced Automaton,
9180 Underivable Rules): Likewise.
9181 * tests/regression.at (Invalid inputs): No longer `expecting ";"
9182 or "|"' now that so many other tokens are allowed by the new grammar.
9183
9184 * src/complain.h (current_file): Remove duplicate decl;
9185 current_file is now owned by files.h.
9186 * src/complain.c, src/scan-gram.l: Include files.h.
9187
9188 2002-12-06 Paul Eggert <eggert@twinsun.com>
9189
9190 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
9191 promotes to int; it might be unsigned int.
9192 * data/yacc.c (yy_reduce_print): Likewise.
9193
9194 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
9195 be #defined in the prologue, not in the Bison declarations.
9196 This fixes Debian Bug 102878, reported by Shaul Karl.
9197
9198 2002-12-02 Paul Eggert <eggert@twinsun.com>
9199
9200 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
9201 * lib/strtoul.c: New file, from gnulib.
9202 This fixes a porting bug reported by Peter Klein in
9203 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
9204
9205 2002-11-30 Paul Eggert <eggert@twinsun.com>
9206
9207 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
9208 and put only a forward declaration in the prologue. This is for
9209 consistency with the other scanner helper functions.
9210
9211 Type clashes now generate warnings, not errors, since it
9212 appears that POSIX may allow some grammars with type clashes.
9213 * src/reader.c (grammar_current_rule_check): Warn about
9214 type clashes instead of complaining.
9215 * tests/input.at (Type Clashes): Expect warnings, not complaints.
9216
9217 Add Yacc library, since POSIX requires it.
9218 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
9219 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
9220 * lib/main.c, lib/yyerror.c: New files.
9221
9222 gram_error can be static; it need not be extern.
9223 * src/reader.h (gram_error): Remove decl.
9224 * src/parse-gram.y (gram_error): Now static. Add static decl.
9225 (print_token_value): Omit parameter names from forward decl,
9226 for consistency.
9227
9228 2002-11-29 Paul Eggert <eggert@twinsun.com>
9229
9230 * doc/bison.texinfo: Emphasize that yylex and yyerror must
9231 be declared before being used. E.g., one should typically
9232 declare them in the prologue. Use GNU coding style in examples.
9233 Put "const" consistently after the type it modifies. Mention
9234 that C99 supports "inline". Mention that yyerror traditionally
9235 returns "int".
9236
9237 %parse-param and %lex-param now take just one argument, the
9238 declaration; the argument name is deduced from the declaration.
9239
9240 * doc/bison.texinfo (Parser Function, Pure Calling, Error
9241 Reporting, Table of Symbols): Document this.
9242 * src/parse-gram.y (add_param): New function.
9243 (COMMA): Remove.
9244 (declaration): Implement new rule for %parse-param and %lex-param.
9245 * src/scan-gram.l: "," now elicits a warning, rather than being
9246 a token; this is more compatible with byacc.
9247 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
9248
9249 2002-11-27 Paul Eggert <eggert@twinsun.com>
9250
9251 Rename identifiers to avoid real and potential collisions.
9252
9253 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
9254 to avoid collision with lex macro described by Bruce Lilly in
9255 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
9256 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9257 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
9258 * src/parse-gram.y (print_token_value): Renamed from yyprint.
9259 All uses changed.
9260 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
9261 The name "yycontrol" violates the name space rules, and this stuff
9262 wasn't being used anyway.
9263 (input): Remove action; this stuff wasn't being used.
9264 (gram_error): Rename local variable yylloc -> loc.
9265 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
9266 (YY_DECL): Don't use "yy" at start of local variables.
9267 All uses changed, e.g., yylloc -> loc.
9268 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
9269 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
9270 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
9271 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
9272
9273 * src/parse-gram.y (gram_error): loc is now const *.
9274 * src/reader.h (gram_error): Likewise.
9275
9276 2002-11-24 Paul Eggert <eggert@twinsun.com>
9277
9278 Version 1.75c.
9279
9280 * tests/actions.at (Actions after errors): Use an output format
9281 more similar to that of the Printers and Destructors test.
9282 Test the position of the ';' token too.
9283 (Printers and Destructors): Likewise.
9284 (Printers and Destructors: %glr-parser): Remove for now, to avoid
9285 unnecessarily alarming people when the test fails.
9286
9287 * data/yacc.c (yyerrlab1): Move this label down, so that the
9288 parser does not discard the lookahead token if the user code
9289 invokes YYERROR. This change is required for POSIX conformance.
9290
9291 * lib/error.c: Sync with gnulib.
9292
9293 2002-11-22 Paul Eggert <eggert@twinsun.com>
9294
9295 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
9296 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
9297 * lib/xmalloc.c: Likewise.
9298
9299 2002-11-20 Paul Eggert <eggert@twinsun.com>
9300
9301 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
9302
9303 2002-11-20 Paul Eggert <eggert@twinsun.com>
9304
9305 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
9306 should use `if (! x) abort ();' rather than `assert (x);', and
9307 anyway it's one less thing to worry about configuring.
9308
9309 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
9310 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
9311 and replace all instances of assert with abort.
9312 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9313 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
9314
9315 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
9316 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
9317 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
9318 hash_find_entry, hash_rehash, hash_insert): Likewise.
9319 * src/conflicts.c (resolve_sr_conflict): Likewise.
9320 * src/lalr.c (set_goto_map, map_goto): Likewise.
9321 * src/nullable.c (nullable_compute): Likewise.
9322 * src/output.c (prepare_rules, token_definitions_output): Likewise.
9323 * src/reader.c (packgram, reader): Likewise.
9324 * src/state.c (state_new, state_free, state_transitions_set,
9325 state_reduction_find): Likewise.
9326 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
9327 symbol_pack): Likewise.
9328 * src/tables.c (conflict_row, pack_vector): Likewise.
9329 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9330 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9331 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
9332 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
9333
9334 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
9335 (ARGMATCH_CONSTRAINT): New macro.
9336 (ARGMATCH_ASSERT): Use it.
9337
9338 * src/system.h (verify): New macro.
9339 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
9340 rather than assert.
9341 * src/tables.c (tables_generate): Likewise.
9342
9343 * src/struniq.c (struniq_assert): Now returns void, and aborts
9344 if the assertion is false.
9345 (struniq_assert_p): Remove.
9346 * src/struniq.h: Likewise.
9347
9348 2002-11-18 Paul Eggert <eggert@twinsun.com>
9349
9350 * data/glr.c (yygetLRActions): Replace `yyindex' with
9351 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
9352 This fixes the regression with Sun ONE Studio 7 cc that I reported in
9353 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
9354
9355 2002-11-18 Akim Demaille <akim@epita.fr>
9356
9357 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
9358 space.
9359 From Tim Van Holder.
9360
9361 2002-11-17 Paul Eggert <eggert@twinsun.com>
9362
9363 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
9364 to "SyntaxError" for consistency with my 2002-11-15 change.
9365
9366 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
9367 not define to {}, since this breaks the common use of `YYDPRINTF
9368 ((...));' if a single statement is desired (e.g. before `else').
9369 Work around GCC warnings by surrounding corresponding calls with
9370 {} if needed.
9371 (yyhasResolvedValue): Remove unused function.
9372 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
9373 loop body.
9374 (yyreportSyntaxError): Renamed from yyreportParseError.
9375 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
9376 All uses changed.
9377 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
9378 extern when possible. Remove unused initializations.
9379
9380 2002-11-16 Akim Demaille <akim@epita.fr>
9381
9382 Augment the similarity between GLR and LALR traces.
9383
9384 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
9385 (YY_REDUCE_PRINT): New.
9386 (yyparse): Use them.
9387 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
9388 YYDPRINT here.
9389 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
9390 state reached after the reduction/recovery, since...
9391 (yyparse, yyprocessOneStack): Report the state we are entering in.
9392
9393 2002-11-16 Akim Demaille <akim@epita.fr>
9394
9395 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
9396 Add support for --trace=skeleton.
9397 * src/scan-skel.l: %option debug.
9398 Scan strings of non-@ or \n instead of character by character.
9399 (scan_skel): Handle trace_skeleton.
9400 (QPUTS): New.
9401 (@output_parser_name@, @output_header_name@): ``Restore'' their
9402 support (used to be M4 macros).
9403 * data/yacc.c: Quote larger chunks, a la glr.c.
9404 * data/lalr1.cc: Likewise.
9405 The header guards are no longer available, so use some other
9406 string than `YYLSP_NEEDED'.
9407
9408 2002-11-16 Akim Demaille <akim@epita.fr>
9409
9410 Make the ``Printers and Destructors'' test more verbose, taking
9411 `yacc.c''s behavior as (possibly wrong) reference.
9412
9413 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
9414 instead of fprint on stdout.
9415 Set and report the last_line of the symbols.
9416 Consistently display values and locations.
9417
9418 2002-11-16 Paul Eggert <eggert@twinsun.com>
9419
9420 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
9421
9422 2002-11-15 Paul Eggert <eggert@twinsun.com>
9423
9424 * tests/actions.at (Actions after errors): New test case.
9425
9426 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
9427 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
9428 tests/action.at, tests/calc.at, tests/conflicts.at,
9429 tests/cxx-type.at, tests/regression.at:
9430 "parse error" -> "syntax error" for POSIX compatibility.
9431 "parsing stack overflow..." -> "parser stack overflow" so
9432 that code matches Bison documentation.
9433
9434 2002-11-15 Akim Demaille <akim@epita.fr>
9435
9436 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
9437 take two BRACED_CODE, not two string_content.
9438 Free the scanner's obstack when we are done.
9439 (code_content): New.
9440 * tests/calc.at: Adjust.
9441 * doc/bison.texinfo: Adjust.
9442 Also, make sure to include the `,' for these declarations.
9443
9444 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
9445
9446 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
9447 definition; avoids potential autoreconf problems.
9448
9449 2002-11-15 Akim Demaille <akim@epita.fr>
9450
9451 Always check the value returned by yyparse.
9452
9453 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
9454 returned by yyparse.
9455 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
9456 Adjust calls.
9457 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
9458 returned by yyparse.
9459
9460 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9461
9462 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
9463 on input.at test.
9464
9465 2002-11-14 Paul Eggert <eggert@twinsun.com>
9466
9467 * src/output.c (output_skeleton): Call xfopen instead of
9468 duplicating xfopen's body.
9469
9470 Fix bugs reported by Nelson H. F. Beebe in
9471 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
9472
9473 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
9474 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
9475 Group compiler. Instead, use "$CC -E bar.c". Include the .h
9476 file twice in the grammar, as an extra check.
9477
9478 * tests/input.at (Torturing the Scanner): Surround the
9479 backslash-newline tests with "#if 0", to make it less likely that
9480 we'll run into compiler bugs. Bring back solitary \ inside
9481 comment, but add a closing comment to work around HP C bug. Don't
9482 test backslash-newline in C character constant.
9483
9484 2002-11-14 Akim Demaille <akim@epita.fr>
9485
9486 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
9487 status of the compiler.
9488 Calling `exit 1' is no longer needed.
9489 Reported by Nelson H. F. Beebe.
9490
9491 2002-11-14 Akim Demaille <akim@epita.fr>
9492
9493 * tests/atlocal.in (CPPFLAGS): We have config.h.
9494 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
9495 New.
9496 * tests/actions.at, tests/calc.at, tests/conflicts.at,
9497 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
9498 * tests/regression.at, tests/torture.at: Use them for all the
9499 grammars that are to be compiled.
9500 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
9501 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
9502 * doc/bison.texinfo (GLR Parsers): Document `inline'.
9503
9504 2002-11-14 Akim Demaille <akim@epita.fr>
9505
9506 * doc/bison.texinfo: Various formatting changes (alignments in
9507 samples, additional @group/@end group, GCS in samples.
9508 Use @deffn instead of simple @table to define the directives,
9509 macros, variables etc.
9510
9511 2002-11-13 Paul Eggert <eggert@twinsun.com>
9512
9513 Fix some bugs reported by Albert Chin-A-Young in
9514 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
9515
9516 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
9517 -o c"; the HP C compiler chatters during compilation.
9518 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
9519 * tests/headers.at (export YYLTYPE): Likewise.
9520
9521 * tests/input.at (Torturing the Scanner): Remove lines containing
9522 solitary backslashes, as they tickle a bug in the HP C compiler.
9523
9524 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
9525 comments, since they're not portable. Use GNU coding style.
9526
9527 2002-11-13 Akim Demaille <akim@epita.fr>
9528
9529 * data/yacc.c: Leave bigger chunks of quoted text.
9530 (YYDSYMPRINTF): New.
9531 Use it to report symbol activities.
9532 * data/glr.c (YYDSYMPRINTF): New.
9533 Use it.
9534
9535 2002-11-12 Paul Eggert <eggert@twinsun.com>
9536
9537 Version 1.75b.
9538
9539 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
9540 (yyglrReduce): Return yyok, not 0.
9541 This should avoid the enumerated-type warnings reported
9542 by Nelson H. F. Beebe in
9543 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
9544
9545 * lib/bbitset.h (BITSET_INLINE): Remove.
9546 * lib/bitset.h [! BITSET_INLINE]: Remove.
9547 (bitset_set, bitset_reset, bitset_test): Rename local vars
9548 to avoid shadowing warnings by GCC.
9549
9550 * data/glr.c (inline): Remove #define. It's the user's
9551 responsibility to #define it away, just like 'const'.
9552 This fixes one of the bugs reported by Nelson H. F. Beebe in
9553 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
9554
9555 * Makefile.maint (po-check): Scan .l and .y files instead of the
9556 .c and the .h files that they generate. This fixes the bug
9557 reported by Tim Van Holder in:
9558 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
9559 Look for N_ as well as for _. Try to avoid matching #define for
9560 N_ and _.
9561 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
9562 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
9563 * src/scan-gram.l: Revamp regular expressions so that " and '
9564 do not confuse xgettext.
9565
9566 * src/struniq.h (struniq_new): Do not declare the return type
9567 to be 'const'; this violates the C standard.
9568 * src/struniq.c (struniq_new): Likewise.
9569
9570 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
9571
9572 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
9573 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
9574 linker.
9575
9576 2002-11-12 Akim Demaille <akim@epita.fr>
9577
9578 * Makefile.maint: Sync with Autoconf:
9579 (local_updates): New.
9580
9581 2002-11-12 Akim Demaille <akim@epita.fr>
9582
9583 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
9584
9585 2002-11-12 Akim Demaille <akim@epita.fr>
9586
9587 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
9588 locations.
9589
9590 2002-11-12 Akim Demaille <akim@epita.fr>
9591
9592 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
9593 not yyvalue.
9594
9595 2002-11-12 Akim Demaille <akim@epita.fr>
9596
9597 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
9598 Use it to test the GLR parser.
9599
9600 2002-11-12 Akim Demaille <akim@epita.fr>
9601
9602 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
9603 defines it.
9604 * data/glr.c (yystos): New.
9605 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
9606 (YYDSYMPRINT): New.
9607 (yyval): Don't define it, it is handled via M4.
9608 (yyrecoverParseError): Free verbosely the discarded symbols.
9609 * data/yacc.c (yysymprint): Remove, rather...
9610 (b4_yysymprint_generate): invoke.
9611 * data/c.m4 (b4_yysymprint_generate): New.
9612 Accept pointers as arguments, as opposed to the version from
9613 yacc.c.
9614 (b4_yydestruct_generate): Likewise.
9615 * tests/cations.at (Printers and Destructors): Use Bison directives
9616 instead of CPP macros.
9617 Don't rely on internal details.
9618
9619 2002-11-12 Akim Demaille <akim@epita.fr>
9620
9621 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
9622 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
9623 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
9624 it against YYEMPTY and so forth), work on yytoken (i.e., set
9625 it to YYEMPTY etc.).
9626 (yydestruct): Replace with a b4_yydestruct_generate invocation.
9627 (b4_symbol_actions): Remove.
9628 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
9629 for 0, end-of-input.
9630
9631 2002-11-12 Akim Demaille <akim@epita.fr>
9632
9633 * doc/bison.texinfo (Destructor Decl): New.
9634
9635 2002-11-12 Akim Demaille <akim@epita.fr>
9636
9637 * src/tables.c (tables_generate): Use free for pointers that
9638 cannot be NULL, not XFREE.
9639 (pack_vector): Use assert, not fatal, for bound violations.
9640 * src/state.c (state_new): Likewise.
9641 * src/reader.c (reader): Likewise.
9642 * src/lalr.c (set_goto_map): Likewise.
9643 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
9644 the file name.
9645
9646 2002-11-12 Akim Demaille <akim@epita.fr>
9647
9648 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
9649 Restore.
9650 * src/scan-gram.l (last_string): Is global to the file, not to
9651 yylex.
9652 * src/parse-gram.y (input): Don't append the epilogue here,
9653 (epilogue.opt): do it here, and free the scanner's obstack.
9654 * src/reader.c (epilogue_set): Rename as...
9655 (epilogue_augment): this.
9656 * data/c.m4 (b4_epilogue): Defaults to empty.
9657
9658 2002-11-12 Akim Demaille <akim@epita.fr>
9659
9660 * src/getargs.c (long_options): Remove duplicates.
9661 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
9662 Remove.
9663 * doc/bison.rnh: Remove.
9664 * doc/bison.texinfo (VMS Invocation): Remove.
9665
9666 2002-11-12 Akim Demaille <akim@epita.fr>
9667
9668 * src/struniq.h, src/struniq.c (struniq_t): Is const.
9669 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
9670
9671 Use struniq for symbols.
9672
9673 * src/symtab.h (symbol_t): The tag member is a struniq.
9674 (symbol_type_set): Adjust.
9675 * src/symtab.c (symbol_new): Takes a struniq.
9676 (symbol_free): Don't free the tag member.
9677 (hash_compare_symbol_t, hash_symbol_t): Rename as...
9678 (hash_compare_symbol, hash_symbol): these.
9679 Use the fact that tags as struniqs.
9680 (symbol_get): Use struniq_new.
9681 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
9682 Returns a strniq.
9683 * src/reader.h (merger_list, grammar_currentmerge_set): The name
9684 and type members are struniqs.
9685 * src/reader.c (get_merge_function)
9686 (grammar_current_rule_merge_set): Adjust.
9687 (TYPE, current_type): Are struniq.
9688
9689 Use struniq for file names.
9690
9691 * src/files.h, src/files.c (infile): Split into...
9692 (grammar_file, current_file): these.
9693 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
9694 * src/reduce.c (reduce_print): Likewise.
9695 * src/getargs.c (getargs): Likewise.
9696 * src/complain.h, src/complain.c: Likewise.
9697 * src/main.c (main): Call struniqs_new early enough to use it for
9698 file names.
9699 Don't free the input file name.
9700
9701 2002-11-12 Akim Demaille <akim@epita.fr>
9702
9703 * src/symtab.c (symbol_free): Remove dead deactivated code:
9704 type_name are properly removed.
9705 Don't use XFREE to free items that cannot be NULL.
9706 * src/struniq.h, src/struniq.c: New.
9707 * src/main.c (main): Initialize/free struniqs.
9708 * src/parse-gram.y (%union): Add astruniq member.
9709 (yyprint): Adjust.
9710 * src/scan-gram.l (<{tag}>): Return a struniq.
9711 Free the obstack bit that used to store it.
9712 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
9713
9714 2002-11-11 Paul Eggert <eggert@twinsun.com>
9715
9716 Revamp to fix many (but not all) of the C- and M4-related quoting
9717 problems. Among other things, this fixes the Bison bug reported
9718 by Jan Hubicka when processing the Bash grammar; see:
9719 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
9720
9721 Use new @ escapes consistently. Represent brackets with @{ and @}
9722 rather than @<:@ and @:>@, since this works a bit better with dumb
9723 editors like vi. Represent @ with @@, since @ is now consistently
9724 an escape. Use @oline@ and @ofile@ rather than __oline__ and
9725 __ofile__, to avoid unexpected expansions. Similarly, use @output
9726 rather than #output.
9727
9728 * data/c.m4 (b4_copyright): Omit file name from comment, since
9729 the file name could contain "*/".
9730 (b4_synclines_flag): Don't quote the 2nd argument; it should already
9731 be quoted. All uses changed.
9732
9733 * data/glr.c: Use new @ escapes consistently.
9734 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
9735 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
9736 Remove, since they couldn't handle arbitrary characters in file
9737 names.
9738 * data/lalr1.cc: Likewise.
9739 * data/yacc.c: Likewise.
9740
9741 * src/files.c (output_infix): Remove; all uses removed.
9742 * src/files.h: Likewise.
9743
9744 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
9745 mishandled funny characters in file names, and anyway it isn't
9746 needed any more.
9747 * data/yacc.c: Likewise.
9748 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
9749
9750 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
9751 * data/yacc.c: Likewise.
9752
9753 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
9754 strings now.
9755 (muscle_init): Quote filename as a C string.
9756 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
9757 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
9758 * src/output.c (escaped_file_name_output): New function.
9759 (prepare_symbols): Quote tokens for M4.
9760 (prepare): Don't insert output_infix, output_prefix,
9761 output_parser_name, output_header_name; this is now down by scan-skel.
9762 Insert skeleton as a C string.
9763
9764 * src/output.c (user_actions_output, symbol_destructors_output,
9765 symbol_printers_output): Quote filenames for C and M4.
9766 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9767
9768 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
9769 escapes other than \\ and \'; this simplifies the code.
9770 (<SC_STRING>): Likewise, for \\ and \".
9771 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
9772 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
9773 Use new escapes @{ and @} for [ and ].
9774
9775 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
9776 them with auto vars.
9777 Switch to new escape scheme, where @ is the escape character uniformly.
9778 Abort if a stray escape character is found. Avoid unbounded input
9779 buffer when parsing non-escaped text.
9780
9781 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
9782 __oline__, #output, $@, and @{ do not have unintended meanings.
9783
9784 2002-11-09 Paul Eggert <eggert@twinsun.com>
9785
9786 Fix the test failure due to GCC warnings described in
9787 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
9788 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
9789 evaluate to 0 if it's impossible for NINF to be in the respective
9790 table.
9791 (yygetLRActions, yyrecoverParseError): Use them.
9792
9793 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
9794 counted in the token inserted at end of file. Now takes
9795 location_t *, not location_t, so that the location can be
9796 adjusted. All uses changed.
9797
9798 * tests/regression.at (Invalid inputs): Adjust wording in
9799 diagnostic to match the new behavior.
9800
9801 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
9802 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
9803 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
9804 abort ();'. This reduces the runtime of the "Many lookaheads"
9805 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
9806 GCC 3.2.
9807
9808 2002-11-07 Paul Eggert <eggert@twinsun.com>
9809
9810 * src/parse-gram.y (CHARACTER): Remove unused token.
9811 All uses removed.
9812
9813 * src/scan-gram.l: Remove stack option. We no longer use the
9814 stack, since the stack was never deeper than 1; instead, use the
9815 new auto var c_context to record the stacked value.
9816
9817 Remove nounput option. At an unexpected end of file, we now unput
9818 the minimal input necessary to end cleanly; this simplifies the
9819 code.
9820
9821 Avoid unbounded token sizes where this is easy.
9822
9823 (unexpected_end_of_file): New function.
9824 Use it to systematize the error message on unexpected EOF.
9825 (last-string): Now auto, not static.
9826 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
9827 (scanner_last_string_free): Remove; not used.
9828 (percent_percent_count): Move decl to just before use.
9829 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
9830 not the (never otherwised-used) CHARACTER.
9831
9832 2002-11-07 Akim Demaille <akim@epita.fr>
9833
9834 Let yyerror always receive the msg as last argument, so that
9835 yyerror can be variadic.
9836
9837 * data/yacc.c (b4_yyerror_args): New.
9838 Use it when calling yyerror.
9839 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
9840 Use it when calling yyerror.
9841 * doc/bison.texinfo (Error Reporting): Adjust.
9842 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
9843 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
9844
9845 2002-11-06 Akim Demaille <akim@epita.fr>
9846
9847 #line should have quoted strings.
9848 Ideally, this should be done by m4_quotearg.
9849
9850 * src/scan-skel.l: Include quotearg.h.
9851 Quote __ofile__.
9852 * src/output.c (symbol_printers_output)
9853 (symbol_destructors_output): Quote the file name.
9854
9855 2002-11-06 Akim Demaille <akim@epita.fr>
9856
9857 * tests/regression.at (Invalid inputs): Adjust to the recent
9858 messages.
9859
9860 2002-11-06 Akim Demaille <akim@epita.fr>
9861
9862 Restore --no-lines.
9863 Reported by Jim Kent.
9864
9865 * data/c.m4 (b4_syncline): New.
9866 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
9867 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
9868 * src/output.c (user_actions_output): Likewise.
9869 (prepare): Define 'b4_synclines_flag'.
9870 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
9871
9872 2002-11-06 Akim Demaille <akim@epita.fr>
9873
9874 * src/main.c (main): Free `infile'.
9875 * src/scan-gram.l (handle_syncline): New.
9876 Recognize `#line'.
9877 * src/output.c (user_actions_output, symbol_destructors_output)
9878 (symbol_printers_output): Use the location's file name, not
9879 infile.
9880 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9881
9882 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9883
9884 * src/tables.c (matching_state): Don't allow states to match if
9885 either has GLR conflict entries.
9886
9887 2002-11-05 Paul Eggert <eggert@twinsun.com>
9888
9889 * src/scan-gram.l: Use more accurate diagnostics, e.g.
9890 "integer out of range" rather than "invalid value".
9891 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
9892 accordingly.
9893
9894 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
9895 Also, remove one static variable in the scanner.
9896
9897 * src/scan-gram.l (braces_level): Now auto, not static.
9898 Initialize to zero if the compiler is being picky.
9899 (INITIAL): Clear braces_level instead of incrementing it.
9900 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
9901 as POSIX 1003.1-2001 requires.
9902 * src/system.h (IF_LINT): New macro, taken from coreutils.
9903 * configure.ac: Define "lint" if --enable-gcc-warnings.
9904
9905 2002-11-05 Akim Demaille <akim@epita.fr>
9906
9907 * src/scan-gram.l: When it starts with `%', complain about the
9908 whole directive, not just that `invalid character: %'.
9909
9910 2002-11-04 Akim Demaille <akim@epita.fr>
9911
9912 * Makefile.maint: Update from Autoconf.
9913 (update, cvs-update, po-update, do-po-update): New.
9914
9915 2002-11-04 Akim Demaille <akim@epita.fr>
9916
9917 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
9918 and yyerror.
9919 Have yyerror `use' its arguments.
9920 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
9921 returns true when location & yacc & pure & parse-param.
9922 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
9923
9924 2002-11-04 Akim Demaille <akim@epita.fr>
9925
9926 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
9927 clashes.
9928 * src/scan-gram.l: Use [\'] instead of ['] to pacify
9929 font-lock-mode.
9930 Use complain_at.
9931 Use quote, not quote_n since LOCATION_PRINT no longer uses the
9932 slot 0.
9933
9934 2002-11-03 Paul Eggert <eggert@twinsun.com>
9935
9936 * src/reader.c (get_merge_function, grammar_current_rule_check):
9937 Use consistent diagnostics for reporting type name clashes.
9938 Quote the types with <>, for consistency with Yacc.
9939 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
9940
9941 2002-11-03 Akim Demaille <akim@epita.fr>
9942
9943 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
9944 New.
9945 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
9946 (b4_parse_param): Remove.
9947 Use b4_identification.
9948 Propagate b4_pure_args where needed to pass them to yyerror.
9949 * data/glr.m4 (b4_parse_param): Remove.
9950 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
9951 (b4_lpure_formals): New.
9952 Use b4_identification.
9953 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
9954 b4_user_formals and b4_user_args.
9955 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
9956 (yyreportAmbiguity): When using a pure parser, also need
9957 the location, and the parse-params.
9958 Adjust callers.
9959 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
9960 When using a pure parser, also need the parse-params.
9961 Adjust callers.
9962 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
9963 (%pure-parser + %parse-param) LALR and GLR parsers.
9964 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
9965 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
9966 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
9967 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
9968 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
9969 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
9970 * doc/bison.texinfo: Untabify the whole file.
9971 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
9972 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
9973 (Error Reporting): Adjust to these new directives.
9974 Document %error-verbose, deprecate YYERROR_VERBOSE.
9975
9976 2002-11-03 Akim Demaille <akim@epita.fr>
9977
9978 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
9979 AT_CHECK_CALC_GLR invocations to use % directives, instead of
9980 command line options.
9981 * tests/cxx-type.at: Formatting changes.
9982
9983 2002-11-03 Paul Eggert <eggert@twinsun.com>
9984
9985 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
9986 to count columns correctly, and to check for invalid inputs.
9987
9988 Use mbsnwidth to count columns correctly. Account for tabs, too.
9989 Include mbswidth.h.
9990 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
9991 (extend_location): New function.
9992 (YY_LINES): Remove.
9993
9994 Handle CRLF in C code rather than in Lex code.
9995 (YY_INPUT): New macro.
9996 (no_cr_read): New function.
9997
9998 Scan UCNs, even though we don't fully handle them yet.
9999 (convert_ucn_to_byte): New function.
10000
10001 Handle backslash-newline correctly in C code.
10002 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
10003 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
10004 all uses changed.
10005 (tag, splice): New EREs. Do not allow NUL or newline in tags.
10006 Use {splice} wherever C allows backslash-newline.
10007 YY_STEP after space, newline, vertical-tab.
10008 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
10009
10010 (letter, id): Don't assume ASCII; e.g., spell out a-z.
10011
10012 ({int}, handle_action_dollar, handle_action_at): Check for integer
10013 overflow.
10014
10015 (YY_STEP): Omit trailing semicolon, so that it's more like C.
10016
10017 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
10018 as well as \000. Check for UCHAR_MAX, not 255.
10019 Allow \x with an arbitrary positive number of digits, as in C.
10020 Check for overflow here.
10021 Allow \? and UCNs, for compatibility with C.
10022
10023 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
10024 with quote slot used by complain_at.
10025
10026 * tests/input.at: Add tests for backslash-newline, m4 quotes
10027 in symbols, long literals, and funny escapes in strings.
10028
10029 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
10030 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
10031 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
10032 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
10033 * m4/mbswidth.m4: New file, from GNU coreutils.
10034
10035 * doc/bison.texinfo (Grammar Outline): Document // comments.
10036 (Symbols): Document that trigraphs have no special meaning in Bison,
10037 nor is backslash-newline allowed.
10038 (Actions): Document that trigraphs have no special meaning.
10039
10040 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
10041 no longer used.
10042
10043 2002-11-02 Paul Eggert <eggert@twinsun.com>
10044
10045 * src/reader.c: Don't include quote.h; not needed.
10046 (get_merge_function): Reword warning to be consistent with
10047 type clash diagnostic in grammar_current_rule_check.
10048
10049 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
10050 bug in trigraph handling.
10051
10052 * src/output.c (prepare_symbols): When printing token names,
10053 escape "[" as "@<:@" and likewise for "]".
10054
10055 * src/system.h (errno): Remove declaration, as we are now
10056 assuming C89 or better, and C89 guarantees errno.
10057
10058 2002-10-30 Paul Eggert <eggert@twinsun.com>
10059
10060 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
10061 Check for close failures.
10062 * src/files.h (xfclose): Return void, not int, since it always
10063 returned zero.
10064 * src/files.c (xfclose): Likewise. Report I/O error if ferror
10065 indicates one.
10066 * src/output.c (output_skeleton): Use xfclose rather than fclose
10067 and ferror. xfclose now checks ferror.
10068
10069 * data/glr.c (YYLEFTMOST_STATE): Remove.
10070 (yyreportTree): Use a stack-based leftmost state. This avoids
10071 our continuing battles with bogus warnings about initializers.
10072
10073 2002-10-30 Akim Demaille <akim@epita.fr>
10074
10075 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
10076 #if.
10077
10078 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10079
10080 * tests/glr-regr1.at: New test for reported regressions.
10081 * tests/testsuite.at: Add glr-regr1.at test.
10082 * tests/Makefile.am: Add glr-regr1.at test.
10083
10084 2002-10-24 Paul Eggert <eggert@twinsun.com>
10085
10086 Version 1.75a.
10087
10088 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
10089 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
10090 we use malloc. Don't assume 'A' through 'Z' are contiguous.
10091 Don't assume strdup exists; POSIX says its an XSI extension.
10092 Check for buffer overflow on input.
10093
10094 2002-10-24 Akim Demaille <akim@epita.fr>
10095
10096 * src/output.c (output_skeleton): Don't disable M4sugar comments
10097 too soon: it results in comments being expanded.
10098 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
10099 first output.
10100
10101 2002-10-24 Akim Demaille <akim@epita.fr>
10102
10103 * data/yacc.c (m4_int_type): New.
10104 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
10105 char' as only yacc.c wants K&R portability.
10106 * data/glr.c (yysigned_char): Remove.
10107 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
10108 Reported by Quoc Peyrot.
10109
10110 2002-10-23 Paul Eggert <eggert@twinsun.com>
10111
10112 * src/main.c (main): With --trace=time, report times even if a
10113 non-fatal error occurs. Formerly, the times were reported in some
10114 such cases but not in others.
10115 * src/reader.c (reader): Just return if a complaint has been issued,
10116 instead of exiting, so that 'main' can report times.
10117
10118 2002-10-22 Akim Demaille <akim@epita.fr>
10119
10120 * src/system.h: Include sys/types.
10121 Reported by Bert Deknuydt.
10122
10123 2002-10-23 Paul Eggert <eggert@twinsun.com>
10124
10125 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
10126 Suggested by Art Haas.
10127
10128 2002-10-22 Paul Eggert <eggert@twinsun.com>
10129
10130 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
10131 decl; not needed any more.
10132 * src/main.c (main): Use return to exit, undoing yesterday's change.
10133 The last OS that we could find where this wouldn't work is
10134 SunOS 3.5, and that's too old to worry about now.
10135
10136 * data/glr.c (struct yyltype): Define members even when not
10137 doing locations. This is more consistent with yacc.c, and it
10138 works around the following bug reports:
10139 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
10140 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
10141
10142 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
10143 @acronym consistently. Standardize on "Yacc" instead of "YACC",
10144 "Algol" instead of "ALGOL". Give a bit more history about BNF.
10145
10146 2002-10-22 Akim Demaille <akim@epita.fr>
10147
10148 * data/README: New.
10149
10150 2002-10-21 Paul Eggert <eggert@twinsun.com>
10151
10152 Be consistent about 'bool'; the old code used an enum in one
10153 module and an int in another, and this violates the C standard.
10154 * m4/stdbool.m4: New file, from coreutils 4.5.3.
10155 * configure.ac (AC_HEADER_STDBOOL): Add.
10156 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
10157 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
10158 * src/symtab.c (hash_compare_symbol_t): Likewise.
10159 * src/system.h (bool, false, true): Use a definition consistent
10160 with ../lib/hash.c. All uses changed.
10161
10162 * src/complain.c (warning_issued): Renamed from warn_message_count,
10163 so that we needn't worry about integer overflow (!).
10164 Now of type bool. All uses changed.
10165 (complaint_issued): Renamed from complain_message_count; likewise.
10166
10167 * src/main.c (main): Use exit to exit with failure.
10168
10169 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
10170 rather than 1 and 0.
10171 * src/main.c (main): Likewise.
10172 * src/getargs.c (getargs): Likewise.
10173 * src/reader.c (reader): Likewise.
10174
10175 * src/getarg.c (getargs): Remove duplicate code for
10176 "Try `bison --help'".
10177
10178 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
10179 What was that "2" for?
10180
10181 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
10182 * src/getargs.c (usage): Likewise.
10183
10184 * src/getargs.c (getargs): When there are too few operands, report
10185 the last one. When there are too many, report the first extra
10186 one. This is how diffutils does it.
10187
10188 2002-10-20 Paul Eggert <eggert@twinsun.com>
10189
10190 Remove K&R vestiges.
10191 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
10192 * src/complain.c (VA_START): Remove. Assume prototypes.
10193 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
10194 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
10195 fatal): Assume prototypes.
10196 * src/complain.h: Assume prototypes.
10197 * src/system.h (PARAMS): Remove.
10198 Include <limits.h> unconditionally, since it's guaranteeed even
10199 for a freestanding C89 compiler.
10200 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
10201 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
10202
10203 2002-10-20 Akim Demaille <akim@epita.fr>
10204
10205 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
10206 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
10207 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
10208 (yyresolveStates, yyresolveAction, yyresolveStack)
10209 (yyprocessOneStack): Use them.
10210 (yy_reduce_print): New.
10211 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
10212
10213 2002-10-20 Akim Demaille <akim@epita.fr>
10214
10215 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
10216 arguments and output `void'.
10217 (b4_c_function): Rename as...
10218 (b4_c_function_def): this.
10219 (b4_c_function_decl, b4_c_ansi_function_def)
10220 (b4_c_ansi_function_decl): New.
10221 Change the interpretation of the arguments: before `int, foo', now
10222 `int foo, foo'.
10223 * data/yacc.c (yyparse): Prototype and define thanks to these.
10224 Adjust b4_c_function_def uses.
10225 * data/glr.c (yyparse): Likewise, but ANSI only.
10226
10227 2002-10-20 Akim Demaille <akim@epita.fr>
10228
10229 * src/output.c (prepare): Move the definition of `tokens_number',
10230 `nterms_number', `undef_token_number', `user_token_number_max'
10231 to...
10232 (prepare_tokens): Here.
10233 (prepare_tokens): Rename as...
10234 (prepare_symbols): this.
10235 (prepare): Move the definition of `rules_number' to...
10236 (prepare_rules): here.
10237 (prepare): Move the definition of `last', `final_state_number',
10238 `states_number' to...
10239 (prepare_states): here.
10240 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
10241
10242 2002-10-20 Akim Demaille <akim@epita.fr>
10243
10244 * src/tables.h, src/tables.c, src/output.c: Comment changes.
10245
10246 2002-10-20 Akim Demaille <akim@epita.fr>
10247
10248 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
10249 * data/c.m4: here.
10250
10251 2002-10-20 Akim Demaille <akim@epita.fr>
10252
10253 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
10254 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
10255 `pair'.
10256 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
10257 `name' to...
10258 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
10259 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
10260 These.
10261
10262 2002-10-19 Paul Eggert <eggert@twinsun.com>
10263
10264 Do not create a temporary file, as that involves security and
10265 cleanup headaches. Instead, use a pair of pipes.
10266 Derived from a suggestion by Florian Krohm.
10267 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
10268 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
10269 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
10270 (BISON_PREREQ_SUBPIPE): Add.
10271 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
10272 Add subpipe.h, subpipe.c.
10273 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
10274 * po/POTFILES.in: Add lib/subpipe.c.
10275 * src/output.c: Include "subpipe.h".
10276 (m4_invoke): Remove decl.
10277 (scan_skel): New decl.
10278 (output_skeleton): Use pipe rather than temporary file for m4 input.
10279 Check that m4sugar.m4 is readable, to avoid deadlock.
10280 Check for pipe I/O error.
10281 * src/scan-skel.l (readpipe): Remove decl.
10282 (scan_skel): New function, to be used in place of m4_invoke.
10283 Read from stream rather than file.
10284
10285 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
10286 float, as this generates a warning on Solaris 8 + GCC 3.2 with
10287 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
10288 this generates a more-accurate value anyway.
10289
10290 * lib/timevar.c (timervar_accumulate): Rename locals to
10291 avoid confusion with similarly-named more-global.
10292 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
10293
10294 * src/output.c (prepare): Use xstrdup to convert char const *
10295 to char *, to avoid GCC warning.
10296
10297 2002-10-19 Akim Demaille <akim@epita.fr>
10298
10299 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
10300 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
10301 Use them to have `calc.y' ready for %pure-parser.
10302 * data/yacc.c (YYLEX): Pass a yylex return type to
10303 b4_c_function_call.
10304
10305 2002-10-19 Akim Demaille <akim@epita.fr>
10306
10307 Prototype support of %lex-param and %parse-param.
10308
10309 * src/parse-gram.y: Add the definition of the %lex-param and
10310 %parse-param tokens, plus their rules.
10311 Drop the `_' version of %glr-parser.
10312 Add the "," token.
10313 * src/scan-gram.l (INITIAL): Scan them.
10314 * src/muscle_tab.c: Comment changes.
10315 (muscle_insert, muscle_find): Rename `pair' as `probe'.
10316 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
10317 (muscle_entry_s): The `value' member is no longer const.
10318 Adjust all dependencies.
10319 * src/muscle_tab.c (muscle_init): Adjust: use
10320 MUSCLE_INSERT_STRING.
10321 Initialize the obstack earlier.
10322 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
10323 (muscle_pair_list_grow): New.
10324 * data/c.m4 (b4_c_function_call, b4_c_args): New.
10325 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
10326 * tests/calc.at: Use %locations, not --locations.
10327 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
10328
10329 2002-10-19 Akim Demaille <akim@epita.fr>
10330
10331 * src/getargs.c (usage): Take status as argument and exit
10332 accordingly.
10333 Report the traditional `Try ... --help' message when status != 0.
10334 (usage, version): Don't take a FILE * as arg, it is pointless.
10335 (getargs): When there is an incorrect number of arguments, make it
10336 an error, and report it GNUlically thanks to `usage ()'.
10337
10338 2002-10-18 Paul Eggert <eggert@twinsun.com>
10339
10340 * data/glr.c (yyreportParseError): Don't assume that sprintf
10341 yields the length of the printed string, as this is not true
10342 on SunOS 4.1.4. Reported by Peter Klein.
10343
10344 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
10345 * tests/conflicts.at (%nonassoc and eof): Likewise.
10346 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
10347
10348 2002-10-17 Akim Demaille <akim@epita.fr>
10349
10350 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
10351 * src/getargs.c (trace_types, trace_args): Adjust.
10352 * src/reader.c (grammar_current_rule_prec_set)
10353 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
10354 Standardize error messages.
10355 And s/@prec/%prec/!
10356 (reader): Use trace_flag to enable scanner/parser debugging,
10357 instead of an adhoc scheme.
10358 * src/scan-gram.l: Remove trailing debugging code.
10359
10360 2002-10-16 Paul Eggert <eggert@twinsun.com>
10361
10362 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
10363 MUSCLE_TAB_H.
10364
10365 * NEWS: Officially drop support for building Bison with K&R C,
10366 since it didn't work anyway and it's not worth worrying about.
10367 * Makefile.maint (wget_files): Remove ansi2knr.c.
10368 (ansi2knr.c-url_prefix): Remove.
10369 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
10370 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10371 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10372
10373 2002-10-15 Paul Eggert <eggert@twinsun.com>
10374
10375 Stop using the "enum_" trick for K&R-style function definitions;
10376 it confused me, and I was the author! Instead, assume that people
10377 who want to use K&R C compilers (when using these modules in GCC,
10378 perhaps?) will run ansi2knr.
10379
10380 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
10381 All uses of "enum_" changed to "enum ".
10382 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10383 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10384
10385 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
10386 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
10387 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
10388 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
10389 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
10390 abitset_not, abitset_ones, abitset_or, abitset_or_and,
10391 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
10392 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
10393 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
10394 Use function prototypes; this removes the need for declaring
10395 static functions simply to provide their prototypes.
10396 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
10397 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
10398 bitset_count_, bitset_create, bitset_dump, bitset_first,
10399 bitset_free, bitset_init, bitset_last, bitset_next,
10400 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
10401 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
10402 bitset_print, bitset_release_memory, bitset_toggle_,
10403 bitset_type_choose, bitset_type_get, bitset_type_name_get,
10404 debug_bitset): Likewise.
10405 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
10406 * lib/bitset_stats.c (bitset_log_histogram_print,
10407 bitset_percent_histogram_print, bitset_stats_and,
10408 bitset_stats_and_cmp, bitset_stats_and_or,
10409 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
10410 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
10411 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
10412 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
10413 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
10414 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
10415 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
10416 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
10417 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
10418 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
10419 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
10420 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
10421 bitset_stats_zero): Likewise.
10422 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10423 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10424 bitsetv_dump, debug_bitsetv): Likewise.
10425 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
10426 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
10427 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
10428 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
10429 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
10430 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
10431 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
10432 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
10433 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
10434 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
10435 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
10436 Likewise.
10437 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
10438 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
10439 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
10440 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
10441 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
10442 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
10443 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
10444 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
10445 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
10446 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
10447 lbitset_xor_cmp, lbitset_zero): Likewise.
10448
10449 2002-10-14 Akim Demaille <akim@epita.fr>
10450
10451 Version 1.75.
10452
10453 2002-10-14 Akim Demaille <akim@epita.fr>
10454
10455 * tests/Makefile.am (maintainer-check-posix): New.
10456
10457 2002-10-14 Akim Demaille <akim@epita.fr>
10458
10459 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
10460 member.
10461
10462 2002-10-14 Akim Demaille <akim@epita.fr>
10463
10464 * src/tables.c (table_ninf_remap): base -> tab.
10465 Reported by Matt Rosing.
10466
10467 2002-10-14 Paul Eggert <eggert@twinsun.com>
10468
10469 * tests/action.at, tests/calc.at, tests/conflicts.at,
10470 tests/cxx-type.at, tests/headers.at, tests/input.at,
10471 tests/regression.at, tests/synclines.at, tests/torture.at:
10472 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
10473 so that the tests still work even if POSIXLY_CORRECT is set.
10474 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
10475
10476 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
10477 for portability to K&R hosts. Fix typo: signed char is guaranteed
10478 only to 127, not to 128.
10479 * data/glr.c (yysigned_char): New type.
10480 * data/yacc.c (yysigned_char): Likewise.
10481 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
10482
10483 2002-10-13 Paul Eggert <eggert@twinsun.com>
10484
10485 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
10486 true due to limited range of data type" warning from GCC.
10487
10488 * data/c.m4 (b4_token_defines): Protect against double-inclusion
10489 by wrapping enum yytokentype's definition inside #ifndef
10490 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
10491
10492 2002-10-13 Akim Demaille <akim@epita.fr>
10493
10494 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
10495 Un yy- yyrhs to avoid the name clash with the global YYRHS.
10496
10497 2002-10-13 Akim Demaille <akim@epita.fr>
10498
10499 * Makefile.maint: Update from Autoconf 2.54.
10500 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
10501
10502 2002-10-13 Akim Demaille <akim@epita.fr>
10503
10504 * src/print.c (print_state): Separate the list of solved conflicts
10505 from the other items.
10506 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
10507
10508 2002-10-13 Akim Demaille <akim@epita.fr>
10509
10510 Let nondeterministic skeletons be usable with deterministic
10511 tables.
10512
10513 With the patch, GAWK compiled by GCC without -O2 passes its test
10514 suite using a GLR parser driven by LALR tables. It fails with -O2
10515 because `struct stat' gives two different answers on my machine:
10516 88 (definition of an auto var) and later 96 (memset on this var).
10517 Hence the stack is badly corrumpted. The headers inclusion is to
10518 blame: if I move the awk.h inclusion before GLR's system header
10519 inclusion, the two struct stat have the same size.
10520
10521 * src/tables.c (pack_table): Always create conflict_table.
10522 (token_actions): Always create conflict_list.
10523 * data/glr.c (YYFLAG): Remove, unused.
10524
10525 2002-10-13 Akim Demaille <akim@epita.fr>
10526
10527 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
10528 (O0FLAGS): New.
10529 (VALGRIND, GXX): New.
10530 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
10531 * tests/bison.in: Run $PREBISON a pre-command.
10532 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
10533 (maintainer-check-g++): New.
10534 * Makefile.am (maintainer-check): New.
10535
10536 2002-10-13 Akim Demaille <akim@epita.fr>
10537
10538 * data/glr.c: Formatting changes.
10539 Tweak some trace messages to match yacc.c's.
10540
10541 2002-10-13 Akim Demaille <akim@epita.fr>
10542
10543 GLR parsers sometimes raise parse errors instead of performing the
10544 default reduction.
10545 Reported by Charles-Henry de Boysson.
10546
10547 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
10548 check the length of the traces when %glr.
10549 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
10550 GLR's traces.
10551 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
10552 Test GLR parsers.
10553 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
10554 (yyltype): Remove the yy prefix from the member names.
10555 (yytable): Complete its comment.
10556 (yygetLRActions): Map error action number from YYTABLE from
10557 YYTABLE_NINF to 0.
10558 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
10559 (which was a bug: it should have been YYTABEL_NINF, and yet it was
10560 not satisfying as we could compare an YYACTION computed from
10561 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
10562 only value for error actions.
10563 (yyreportParseError): In verbose parse error messages, don't issue
10564 `error' in the list of expected tokens.
10565 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
10566 next action to perform to match glr.c's decoding.
10567 (yytable): Complete its comment.
10568
10569 2002-10-13 Paul Eggert <eggert@twinsun.com>
10570
10571 Fix problem reported by Henrik Grubbstroem in
10572 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
10573 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
10574 because the Bison parser reads the second action before reducing
10575 the first one.
10576 * src/scan-gram.l (rule_length): New static var.
10577 Use it to keep track of the rule length in the scanner, since
10578 we can't expect the parser to be in lock-step sync with the scanner.
10579 (handle_action_dollar, handle_action_at): Use this var.
10580 * tests/actions.at (Exotic Dollars): Test for the problem.
10581
10582 2002-10-12 Paul Eggert <eggert@twinsun.com>
10583
10584 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
10585 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
10586 Include <sys/time.h> when checking for clock_t and struct tms.
10587 Use same include order as source.
10588 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
10589 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
10590
10591 * lib/timevar.c: Update copyright date and clarify comments.
10592 (get_time) [IN_GCC]: Keep the GCC version for reference.
10593
10594 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
10595 GCC version as of today, then merge Bison's changes.
10596 Change "GCC" to "Bison" in copyright notice. timevar.def's
10597 author is Akim, so change that too.
10598
10599 * src/reader.c (grammar_current_rule_check):
10600 Don't worry about the default action if $$ is untyped.
10601 Prevents bogus warnings reported by Jim Gifford in
10602 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
10603
10604 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
10605 * data/glr.c, data/lalr1.cc, data/yacc.c:
10606 Output token definitions before the first part of user declarations.
10607 Fixes compatibility problem reported by Jim Gifford for kbd in
10608 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
10609
10610 2002-10-11 Paul Eggert <eggert@twinsun.com>
10611
10612 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
10613 (yyparse): here. This undoes some of the 2002-07-25 change.
10614 Compatibility problem reported by Ralf S. Engelschall with
10615 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
10616
10617 2002-10-11 Akim Demaille <akim@epita.fr>
10618
10619 * tests/regression.at Characters Escapes): New.
10620 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
10621 characters.
10622 Reported by Jan Nieuwenhuizen.
10623
10624 2002-10-11 Akim Demaille <akim@epita.fr>
10625
10626 * po/id.po: New.
10627
10628 2002-10-10 Paul Eggert <eggert@twinsun.com>
10629
10630 Portability fixes for bitsets; this also avoids several GCC
10631 warnings.
10632
10633 * lib/abitset.c: Include <stddef.h>, for offsetof.
10634 * lib/lbitset.c: Likewise.
10635
10636 * lib/abitset.c (abitset_bytes): Return a size that is aligned
10637 properly for vectors of objects. Do not assume that adding a
10638 header size to a multiple of a word size yields a value that is
10639 properly aligned for the whole union.
10640 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10641
10642 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
10643 unique names for structures.
10644 * lib/ebitset.c (ebitset_bytes): Likewise.
10645 * lib/lbitset.c (lbitset_bytes): Likewise.
10646
10647 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
10648 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
10649 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
10650 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
10651 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
10652 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
10653 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
10654 to improve the type-checking that GCC can do.
10655 * lib/bitset.c (bitset_op4_cmp): Likewise.
10656 * lib/bitset_stats.c (bitset_stats_count,
10657 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
10658 bitset_stats_copy, bitset_stats_disjoint_p,
10659 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
10660 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
10661 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
10662 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
10663 bitset_stats_and_or_cmp, bitset_stats_andn_or,
10664 bitset_stats_andn_or_cmp, bitset_stats_or_and,
10665 bitset_stats_or_and_cmp): Likewise.
10666 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
10667 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
10668 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
10669 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
10670
10671 * lib/abitset.h: Include bitset.h, not bbitset.h.
10672 * lib/ebitset.h: Likewise.
10673 * lib/lbitset.h: Likewise.
10674
10675 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
10676 All instances of parameters of type enum bitset_opts are now of
10677 type enum_bitset_opts, to conform to the C Standard, and similarly
10678 for enum_bitset_type.
10679 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10680 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10681
10682 Do not use "struct bitset_struct" to mean different things in
10683 different modules. Not only is this confusing, it violates
10684 the C Standard, which requires that structure types in different
10685 modules must be compatible if one is to be passed to the other.
10686 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
10687 All instances of "struct bitset_struct *" replaced with "bitset".
10688 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
10689 (union bitset_union, struct abitset_struct, struct ebitset_struct,
10690 struct lbitset_struct, struct bitset_stats_struct): New types.
10691 All uses of struct bitset_struct changed to union bitset_union,
10692 etc.
10693 * lib/abitset.c (struct abitset_struct, abitset,
10694 struct bitset_struct): Remove.
10695 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
10696 struct bitset_struct): Remove.
10697 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
10698 bitset_struct): Remove.
10699 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
10700 Likewise.
10701
10702 Do not call a function of type T using a call that assumes the
10703 function is of a different type U. Standard C requires that a
10704 function must be called with a type that is compatible with its
10705 definition.
10706 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10707 New decls.
10708 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10709 New functions.
10710 * lib/ebitset.c (PFV): Remove.
10711 * lib/lbitset.c (PFV): Likewise.
10712 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
10713 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
10714 decls.
10715 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
10716 (ebitset_vtable): Use them.
10717 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
10718 lbitset_xor): New functions.
10719 (lbitset_vtable): Use them.
10720
10721 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
10722 Declare.
10723
10724 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
10725 GCC warning.
10726 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
10727 Use offsetof, for simplicity.
10728
10729 2002-10-06 Paul Eggert <eggert@twinsun.com>
10730
10731 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
10732 the same width as int. This reapplies a hunk of the 2002-08-12 patch
10733 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
10734 which was inadvertently undone by the 2002-09-30 patch.
10735 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
10736 the same width as int.
10737
10738 2002-10-04 Paul Eggert <eggert@twinsun.com>
10739
10740 Version 1.50.
10741
10742 * configure.ac (AC_INIT), NEWS: Increment version number.
10743
10744 * doc/bison.texinfo: Minor spelling, grammar, and white space
10745 fixes.
10746 (Symbols): Mention that any negative value returned from yylex
10747 signifies end-of-input. Warn about negative chars. Mention
10748 the portable Standard C character set.
10749
10750 The GNU coding standard says CFLAGS and YFLAGS are reserved
10751 for the installer to set.
10752 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
10753 * src/Makefile.am (AM_CFLAGS): Likewise.
10754 (AM_YFLAGS): Renamed from YFLAGS.
10755
10756 Fix some MAX and MIN problems.
10757 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
10758 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
10759 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
10760 * src/reader.c (reader): Use it.
10761
10762 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
10763 POSIX 1003.1-2001 has removed fgrep.
10764
10765 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
10766
10767 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
10768 interpreted as signed.
10769 * lib/ebitset.c (ebitset_list): Fix bug.
10770
10771 2002-10-01 Paul Eggert <eggert@twinsun.com>
10772
10773 More fixes for 64-bit hosts and large bitsets.
10774
10775 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
10776 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
10777 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
10778 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
10779 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
10780 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
10781 bitset_count_): Likewise.
10782 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
10783 bitset_first, bitset_last): Likewise.
10784 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
10785 bitset_stats_list_reverse, bitset_stats_size,
10786 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
10787 Likewise.
10788 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10789 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10790 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10791 bitsetv_reflexive_transitive_closure): Likewise.
10792 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
10793 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
10794 Likewise.
10795 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
10796 Likewise.
10797
10798 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
10799 Use size_t, not unsigned int, to count bytes.
10800 * lib/abitset.h (abitset_bytes): Likewise.
10801 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
10802 Likewise.
10803 * lib/bitset.h (bitset_bytes): Likewise.
10804 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
10805 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
10806 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10807 * lib/ebitset.c (ebitset_bytes): Likewise.
10808 * lib/ebitset.h (ebitset_bytes): Likewise.
10809 * lib/lbitset.c (lbitset_bytes): Likewise.
10810 * lib/lbitset.h (lbitset_bytes): Likewise.
10811
10812 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
10813 abitset_subset_p, abitset_disjoint_p, abitset_and,
10814 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
10815 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
10816 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
10817 abitset_or_and, abitset_or_and_cmp):
10818 Use bitset_windex instead of unsigned int.
10819 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10820 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
10821 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
10822 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
10823 Likewise.
10824 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
10825
10826 * lib/bitset.c (bitset_print):
10827 Use proper printf formats for widths of integer types.
10828 * lib/bitset_stats.c (bitset_percent_histogram_print,
10829 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
10830 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10831 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10832 * lib/lbitset.c (lbitset_bytes): Likewise.
10833
10834 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
10835 BITSET_SIZE_MAX): New macros.
10836 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
10837 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
10838 to BITSET_WINDEX_MAX.
10839
10840 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
10841 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
10842 since we now return the bitset_bindex type (not int).
10843
10844 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
10845 when computing sizes.
10846 * lib/ebitset.c (ebitset_elts_grow): Likewise.
10847
10848 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
10849 and avoid cast to unsigned.
10850
10851 2002-09-30 Akim Demaille <akim@epita.fr>
10852
10853 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10854 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
10855 Updates from Michael Hayes.
10856
10857 2002-09-30 Art Haas <ahaas@neosoft.com>
10858
10859 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
10860 invocations.
10861 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
10862 defined.
10863
10864 2002-09-27 Akim Demaille <akim@epita.fr>
10865
10866 Version 1.49c.
10867
10868 2002-09-27 Akim Demaille <akim@epita.fr>
10869
10870 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
10871 (Because of AC_LIBSOURCE).
10872
10873 2002-09-27 Akim Demaille <akim@epita.fr>
10874
10875 Playing with Autoscan.
10876
10877 * configure.ac: Remove the old LIBOBJ tweaks.
10878 (AC_REPLACE_FUNCS): Add strrchr and strtol.
10879 * lib/strrchr.c: New.
10880 * lib/strtol.c: New, from the Coreutils 4.5.1.
10881
10882 2002-09-27 Akim Demaille <akim@epita.fr>
10883
10884 Playing with Autoscan.
10885
10886 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
10887 * lib/Makefile.am (libbison_a_SOURCES): No longer include
10888 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
10889 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
10890 Coreutils 4.5.1.
10891
10892 2002-09-24 Akim Demaille <akim@epita.fr>
10893
10894 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
10895 (Frequently Asked Questions, Parser Stack Overflow): New.
10896
10897 2002-09-13 Akim Demaille <akim@epita.fr>
10898
10899 Playing with autoscan.
10900
10901 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
10902 * src/files.c (skeleton_find): Remove, unused.
10903 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
10904 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
10905
10906 2002-09-13 Akim Demaille <akim@epita.fr>
10907
10908 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
10909 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
10910
10911 2002-09-13 Akim Demaille <akim@epita.fr>
10912
10913 * configure.ac: Require 2.54.
10914 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
10915 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
10916 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
10917 Remove, provided by Autoconf macros.
10918
10919 2002-09-12 Akim Demaille <akim@epita.fr>
10920
10921 * m4/prereq.m4: Update, from Coreutils 4.5.1.
10922
10923 2002-09-12 Akim Demaille <akim@epita.fr>
10924
10925 * m4/prereq.m4: Update, from Fileutils 4.1.5.
10926 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
10927 Reported by Martin Mokrejs.
10928
10929 2002-09-10 Akim Demaille <akim@epita.fr>
10930
10931 * src/parse-gram.y: Associate a human readable string to each
10932 token type.
10933 * tests/regression.at (Invalid inputs): Adjust.
10934
10935 2002-09-10 Gary V. Vaughan <gary@gnu.org>
10936
10937 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
10938 with an Autoconf-2.5x style configure.ac.
10939
10940 2002-09-06 Paul Eggert <eggert@twinsun.com>
10941
10942 * doc/bison.texinfo (Conditions): Make explicit that the GPL
10943 exception applies only to yacc.c. This is a modification of a
10944 patch originally suggested by Akim Demaille.
10945
10946 2002-09-06 Akim Demaille <akim@epita.fr>
10947
10948 * data/c.m4 (b4_copyright): Move the GPL exception comment from
10949 here to...
10950 * data/yacc.c: here.
10951
10952 * data/lalr1.cc (struct yyltype): Don't define it, since we use
10953 LocationType.
10954 (b4_ltype): Default to yy::Location from location.hh.
10955
10956 2002-09-04 Jim Meyering <jim@meyering.net>
10957
10958 * data/yacc.c: Guard the declaration of yytoknum also with
10959 `#ifdef YYPRINT', so it is declared only when used.
10960
10961 2002-09-04 Akim Demaille <akim@epita.fr>
10962
10963 * configure.in: Rename as...
10964 * configure.ac: this.
10965 Bump to 1.49c.
10966
10967 2002-09-04 Akim Demaille <akim@epita.fr>
10968
10969 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
10970 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
10971 translate maintainer only messages.
10972
10973 2002-08-12 Paul Eggert <eggert@twinsun.com>
10974
10975 Version 1.49b.
10976
10977 * Makefile.am (SUBDIRS): Remove intl.
10978 (DISTCLEANFILES): Remove.
10979 * NEWS: Mention that GNU M4 is now required. Clarify what is
10980 meant by "larger grammars". Mention the pt_BR translation.
10981 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
10982 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
10983 Bump version from 0.11.2 to 0.11.5.
10984 (BISON_PREREQ_STAGE): Remove.
10985 (AM_GNU_GETTEXT): Use external gettext.
10986 (AC_OUTPUT): Remove intl/Makefile.
10987
10988 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
10989
10990 * data/glr.c: Include string.h, for strlen.
10991 (yyreportParseError): Use size_t for yysize.
10992 (yy_yypstack): No longer nested inside yypstates, as nested
10993 functions are not portable. Do not assume size_t is the
10994 same width as int.
10995 (yypstates): Do not assume that ptrdiff_t is the same width
10996 as int, and similarly for yyposn and YYINDEX.
10997
10998 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
10999
11000 * lib/Makefile.am (INCLUDES): Do not include from the intl
11001 directory, which has been removed.
11002 * src/Makefile.am (INCLUDES): Likewise.
11003
11004 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
11005 (bitsets_sources, additional_bitsets_sources, timevars_sources):
11006 New vars.
11007
11008 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
11009 * tests/Makefile.am (EXTRA_DIST): Likewise.
11010
11011 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
11012 Do not assume that bitset_windex is the same width as unsigned.
11013
11014 * lib/abitset.c (abitset_unused_clear): Do not assume that
11015 bitset_word is the same width as int.
11016 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
11017 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
11018 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
11019 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
11020 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
11021
11022 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
11023 portability to one's complement hosts!).
11024 * lib/ebitset.c (ebitset_op1): Likewise.
11025 * lib/lbitset.c (lbitset_op1): Likewise.
11026
11027 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
11028 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11029 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
11030 Sync with fileutils.
11031 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
11032 lib/gettext.h: Sync with diffutils.
11033
11034 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
11035 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
11036
11037 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
11038 PROTOTYPES to check for prototypes, and "defined __STDC__" to
11039 check for void *.
11040
11041 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
11042 size_t; the old version tried to do this but casted improperly.
11043 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
11044 (bitset_test): Now returns int, not unsigned long.
11045
11046 * lib/bitset_stats.c: Include "gettext.h".
11047 (_): New macro.
11048 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
11049 name locals "index", as it generates unnecessary warnings on some
11050 hosts that have an "index" function.
11051
11052 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
11053 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
11054 they need translation.
11055 * src/LR0.c (state_list_append, new_itemsets, get_state,
11056 append_states, generate_states): Likewise.
11057 * src/assoc.c (assoc_to_string): Likewise.
11058 * src/closure.c (print_closure, set_firsts, closure): Likewise.
11059 * src/gram.c (grammar_dump): Likewise.
11060 * src/injections.c (injections_compute): Likewise.
11061 * src/lalr.c (lookaheads_print): Likewise.
11062 * src/relation.c (relation_transpose): Likewise.
11063 * src/scan-gram.l: Likewise.
11064 * src/tables.c (table_grow, pack_vector): Likewise.
11065
11066 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
11067 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
11068 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
11069 * m4/mbstate_t.m4: Sync with fileutils.
11070 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
11071
11072 * po/LINGUAS: Add pt_BR.
11073 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
11074 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
11075 lib/timevar.c.
11076 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
11077 manual recommends.
11078 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
11079
11080 * src/complain.c (strerror_r): Remove decl; not needed.
11081 (strerror): Use same pattern as ../lib/error.c.
11082
11083 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
11084
11085 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
11086
11087 * src/main.c (main): Cast result of bindtextdomain and textdomain
11088 to void, to avoid a GCC warning when --disable-nls is in effect.
11089
11090 * src/scan-gram.l: Use strings rather than escapes when possible,
11091 to minimize the number of warnings from xgettext.
11092 (handle_action_dollar, handle_action_at): Don't use isdigit,
11093 as it mishandles negative chars and it may not work as expected
11094 outside the C locale.
11095
11096 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
11097 this is a GCC extension and is not portable to other compilers.
11098
11099 * src/system.h (alloca): Use same pattern as ../lib/error.c.
11100 Do not include <ctype.h>; no longer needed.
11101 Do not include <malloc.h>; no longer needed (and generates
11102 warnings on OpenBSD 3.0).
11103
11104 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
11105 it's not portable.
11106
11107 * tests/regression.at: Do not use 'cc -c input.c -o input';
11108 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
11109
11110 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
11111 exit status as failure, not just exit status 1. Sun C exits
11112 with status 2 sometimes.
11113
11114 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
11115 Use it for the two large tests.
11116
11117 2002-08-02 Akim Demaille <akim@epita.fr>
11118
11119 * src/conflicts.c (conflicts_output): Don't output rules never
11120 reduced here, since anyway that computation doesn't work.
11121 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
11122 (rule_useless_p, rule_never_reduced_p): New.
11123 (grammar_rules_partial_print): Use a filter instead of a range.
11124 Display the title only if needed.
11125 (grammar_rules_print): Adjust.
11126 (grammar_rules_never_reduced_report): New.
11127 * src/tables.c (action_row): Move the computation of rules never
11128 reduced to...
11129 (token_actions): here.
11130 * src/main.c (main): Make the parser before making the report, so
11131 that rules never reduced are computed.
11132 Call grammar_rules_never_reduced_report.
11133 * src/print.c (print_results): Report rules never reduced.
11134 * tests/conflicts.at, tests/reduce.at: Adjust.
11135
11136 2002-08-01 Akim Demaille <akim@epita.fr>
11137
11138 Instead of attaching lookaheads and duplicating the rules being
11139 reduced by a state, attach the lookaheads to the reductions.
11140
11141 * src/state.h (state_t): Remove the `lookaheads',
11142 `lookaheads_rule' member.
11143 (reductions_t): Add a `lookaheads' member.
11144 Use a regular array for the `rules'.
11145 * src/state.c (reductions_new): Initialize the lookaheads member
11146 to 0.
11147 (state_rule_lookaheads_print): Adjust.
11148 * src/state.h, src/state.c (state_reductions_find): New.
11149 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
11150 (count_rr_conflicts): Adjust.
11151 * src/lalr.c (LArule): Remove.
11152 (add_lookback_edge): Adjust.
11153 (state_lookaheads_count): New.
11154 (states_lookaheads_initialize): Merge into...
11155 (initialize_LA): this.
11156 (lalr_free): Adjust.
11157 * src/main.c (main): Don't free nullable and derives too early: it
11158 is used by --verbose.
11159 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
11160
11161 2002-08-01 Akim Demaille <akim@epita.fr>
11162
11163 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
11164 `rule_number_t**'.
11165 (set_derives, free_derives): Rename as...
11166 (derives_compute, derives_free): this.
11167 Adjust all dependencies.
11168 * src/nullable.c (set_nullable, free_nullable): Rename as...
11169 (nullable_compute, nullable_free): these.
11170 (rule_list_t): Store rule_t *, not rule_number_t.
11171 * src/state.c (state_rule_lookaheads_print): Directly compare rule
11172 pointers, instead of their numbers.
11173 * src/main.c (main): Call nullable_free, and derives_free earlier,
11174 as they were lo longer used.
11175
11176 2002-08-01 Akim Demaille <akim@epita.fr>
11177
11178 * lib/timevar.c (get_time): Include children time.
11179 * src/lalr.h (LA, LArule): Don't export them: used with the
11180 state_t.
11181 * src/lalr.c (LA, LArule): Static.
11182 * src/lalr.h, src/lalr.c (lalr_free): New.
11183 * src/main.c (main): Call it.
11184 * src/tables.c (pack_vector): Check whether loc is >= to the
11185 table_size, not >.
11186 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
11187 (tables_generate): do it, since that's also it which allocates
11188 them.
11189 Don't free LA and LArule, main does.
11190
11191 2002-07-31 Akim Demaille <akim@epita.fr>
11192
11193 Separate parser tables computation and output.
11194
11195 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
11196 (conflict_list, conflict_list_cnt, table, check, table_ninf)
11197 (yydefgoto, yydefact, high): Move to...
11198 * src/tables.h, src/tables.c: here.
11199 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11200 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11201 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
11202 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
11203 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
11204 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
11205 (action_row, save_row, token_actions, save_column, default_goto)
11206 (goto_actions, sort_actions, matching_state, pack_vector)
11207 (table_ninf_remap, pack_table, prepare_actions): Move to...
11208 * src/tables.c: here.
11209 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
11210 * src/output.c (token_actions, output_base, output_conflicts)
11211 (output_check): Merge into...
11212 (prepare_actions): this.
11213 (actions_output): Rename as...
11214 (user_actions_output): this.
11215 * src/main.c (main): Call tables_generate and tables_free.
11216
11217 2002-07-31 Akim Demaille <akim@epita.fr>
11218
11219 Steal GCC's --time-report support.
11220
11221 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
11222 stolen/adjusted from GCC.
11223 * m4/stage.m4: Remove time related checks.
11224 * m4/timevar.m4: New.
11225 * configure.in: Adjust.
11226 * src/system.h: Adjust to using timevar.h.
11227 * src/getargs.h, src/getargs.c: Support trace_time for
11228 --trace=time.
11229 * src/main.c (stage): Remove.
11230 (main): Replace `stage' invocations with timevar calls.
11231 * src/output.c: Insert pertinent timevar calls.
11232
11233 2002-07-31 Akim Demaille <akim@epita.fr>
11234
11235 Let --trace have arguments.
11236
11237 * src/getargs.h (enum trace_e): New.
11238 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
11239 (long_options, short_options): --trace/-T takes an optional
11240 argument.
11241 Change all the uses of trace_flag to reflect the new flags.
11242 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
11243
11244 Strengthen `stage' portability.
11245
11246 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
11247 * configure.in: Use it.
11248 Don't check for malloc.h and sys/times.h.
11249 * src/system.h: Include them when appropriate.
11250 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
11251 times and struct tms are available.
11252
11253 2002-07-30 Akim Demaille <akim@epita.fr>
11254
11255 In verbose parse error message, don't report `error' as an
11256 expected token.
11257 * tests/actions.at (Printers and Destructors): Adjust.
11258 * tests/calc.at (Calculator $1): Adjust.
11259 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
11260 error message, do not report the parser accepts the error token in
11261 that state.
11262
11263 2002-07-30 Akim Demaille <akim@epita.fr>
11264
11265 Normalize conflict related messages.
11266
11267 * src/complain.h, src/complain.c (warn, complain): New.
11268 * src/conflicts.c (conflicts_print): Use them.
11269 (conflict_report_yacc): New, extracted from...
11270 (conflicts_print): here.
11271 * tests/conflicts.at, tests/existing.at: Adjust.
11272
11273 2002-07-30 Akim Demaille <akim@epita.fr>
11274
11275 Report rules which are never reduced by the parser: those hidden
11276 by conflicts.
11277
11278 * src/LR0.c (save_reductions): Don't make the final state too
11279 different: save its reduction (accept) instead of having a state
11280 without any action (no shift or goto, no reduce).
11281 Note: the final state is now a ``regular'' state, i.e., the
11282 parsers now contain `reduce 0' as default reduction.
11283 Nevertheless, since they decide to `accept' when yystate =
11284 final_state, they still will not reduce rule 0.
11285 * src/print.c (print_actions, print_reduction): Adjust.
11286 * src/output.c (action_row): Track reduced rules.
11287 (token_actions): Report rules never reduced.
11288 * tests/conflicts.at, tests/regression.at: Adjust.
11289
11290 2002-07-30 Akim Demaille <akim@epita.fr>
11291
11292 `stage' was accidently included in a previous patch.
11293 Initiate its autoconfiscation.
11294
11295 * configure.in: Look for malloc.h and sys/times.h.
11296 * src/main.c (stage): Adjust.
11297 Report only when trace_flag.
11298
11299 2002-07-29 Akim Demaille <akim@epita.fr>
11300
11301 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
11302 state_number_t.
11303 (errs_t): symbol_t*, not symbol_number_t.
11304 (reductions_t): rule_t*, not rule_number_t.
11305 (FOR_EACH_SHIFT): New.
11306 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
11307 * src/print.c, src/print_graph.c: Adjust.
11308
11309 2002-07-29 Akim Demaille <akim@epita.fr>
11310
11311 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
11312
11313 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
11314 (endtoken, accept): these.
11315 * src/reader.c (reader): Set endtoken's default tag to "$end".
11316 Set undeftoken's tag to "$undefined" instead of "$undefined.".
11317 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
11318 Adjust.
11319
11320 2002-07-29 Akim Demaille <akim@epita.fr>
11321
11322 * src/reduce.c (reduce_grammar): When the language is empty,
11323 complain about the start symbol, not the axiom.
11324 Use its location.
11325 * tests/reduce.at (Empty Language): New.
11326
11327 2002-07-26 Akim Demaille <akim@epita.fr>
11328
11329 * src/reader.h, src/reader.c (gram_error): ... can't get
11330 yycontrol without making too strong assumptions on the parser
11331 itself.
11332 * src/output.c (prepare_tokens): Use the real 0th value of
11333 token_translations instead of `0'.
11334 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
11335 visible here.
11336 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
11337 for the time being: %locations ought to provide it to yyerror.
11338
11339 2002-07-25 Akim Demaille <akim@epita.fr>
11340
11341 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
11342 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
11343 * tests/regression.at (Web2c Actions): Adjust.
11344
11345 2002-07-25 Akim Demaille <akim@epita.fr>
11346
11347 Stop storing rules from 1 to nrules + 1.
11348
11349 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
11350 * src/nullable.c, src/output.c, src/print.c, src/reader.c
11351 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
11352 Iterate from 0 to nrules.
11353 Use rule_number_as_item_number and item_number_as_rule_number.
11354 Adjust to `derive' now containing possibly 0.
11355 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
11356 Handle the `- 1' part in rule numbers from/to item numbers.
11357 * src/conflicts.c (log_resolution): Fix the message which reversed
11358 shift and reduce.
11359 * src/output.c (action_row): Initialize default_rule to -1.
11360 (token_actions): Adjust.
11361 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
11362 expected output.
11363 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
11364
11365 2002-07-25 Akim Demaille <akim@epita.fr>
11366
11367 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
11368 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
11369 (b4_c_knr_arg_decl): New.
11370 * data/yacc.c: Use it to define yysymprint, yydestruct, and
11371 yyreport_parse_error.
11372
11373 2002-07-25 Akim Demaille <akim@epita.fr>
11374
11375 * data/yacc.c (yyreport_parse_error): New, extracted from...
11376 (yyparse): here.
11377 (yydestruct, yysymprint): Move above yyparse.
11378 Be K&R compliant.
11379
11380 2002-07-25 Akim Demaille <akim@epita.fr>
11381
11382 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
11383 replace...
11384 (b4_sint_type, b4_uint_type): these.
11385 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
11386 * tests/regression.at (Web2c Actions): Adjust.
11387
11388 2002-07-25 Akim Demaille <akim@epita.fr>
11389
11390 * src/gram.h (TIEM_NUMBER_MAX): New.
11391 (item_number_of_rule_number, rule_number_of_item_number): Rename
11392 as...
11393 (rule_number_as_item_number, item_number_as_rule_number): these.
11394 Adjust dependencies.
11395 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11396 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11397 (symbol_number_to_vector_number): New.
11398 (order): Of vector_number_t* type.
11399 (base_t, BASE_MAX, BASE_MIN): New.
11400 (froms, tos, width, pos, check): Of base_t type.
11401 (action_number_t, ACTION_MIN, ACTION_MAX): New.
11402 (actrow): Of action_number_t type.
11403 (conflrow): Of unsigned int type.
11404 (table_ninf, base_ninf): New.
11405 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
11406 (muscle_insert_int_table, muscle_insert_base_table)
11407 (muscle_insert_rule_number_table): New.
11408 (prepare_tokens): Output `toknum' as int_table.
11409 (action_row): Returns a rule_number_t.
11410 Use ACTION_MIN, not SHRT_MIN.
11411 (token_actions): yydefact is rule_number_t*.
11412 (table_ninf_remap): New.
11413 (pack_table): Use it for `base' and `table'.
11414 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
11415 replaced with...
11416 (YYPACT_NINF, YYTABLE_NINF): these.
11417 (yypact, yytable): Compute their types instead of hard-coded
11418 `short'.
11419 * tests/regression.at (Web2c Actions): Adjust.
11420
11421 2002-07-19 Akim Demaille <akim@epita.fr>
11422
11423 * src/scan-gram.l (id): Can start with an underscore.
11424
11425 2002-07-16 Akim Demaille <akim@epita.fr>
11426
11427 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
11428 Adjust all former `associativity' dependencies.
11429 * src/symtab.c (symbol_new): Default associativity is `undef', not
11430 `right'.
11431 (symbol_check_alias_consistence): Adjust.
11432
11433 2002-07-09 Akim Demaille <akim@epita.fr>
11434
11435 * doc/bison.texinfo: Properly set the ``header'' part.
11436 Use @dircategory ``GNU programming tools'' as per Texinfo's
11437 documentation.
11438 Use @copying.
11439
11440 2002-07-09 Akim Demaille <akim@epita.fr>
11441
11442 * lib/quotearg.h: Protect against multiple inclusions.
11443 * src/location.h (location_t): Add a `file' member.
11444 (LOCATION_RESET, LOCATION_PRINT): Adjust.
11445 * src/complain.c (warn_at, complain_at, fatal_at): Drop
11446 `error_one_per_line' support.
11447
11448 2002-07-09 Akim Demaille <akim@epita.fr>
11449
11450 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
11451 * src/reader.c (lineno): Remove.
11452 Adjust all dependencies.
11453 (get_merge_function): Take a location and use complain_at.
11454 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
11455 * tests/regression.at (Invalid inputs, Mixing %token styles):
11456 Adjust.
11457
11458 2002-07-09 Akim Demaille <akim@epita.fr>
11459
11460 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
11461 recovery rule, and forbid extensions when --yacc.
11462 (gram_error): Use complain_at.
11463 * src/reader.c (reader): Exit if there were parse errors.
11464
11465 2002-07-09 Akim Demaille <akim@epita.fr>
11466
11467 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
11468 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
11469 Reported by R Blake <blakers@mac.com>.
11470
11471 2002-07-09 Akim Demaille <akim@epita.fr>
11472
11473 * data/yacc.c: Output the copyright notive in the header.
11474
11475 2002-07-03 Akim Demaille <akim@epita.fr>
11476
11477 * src/output.c (froms, tos): Are state_number_t.
11478 (save_column): sp, sp1, and sp2 are state_number_t.
11479 (prepare): Rename `final' as `final_state_number', `nnts' as
11480 `nterms_number', `nrules' as `rules_number', `nstates' as
11481 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
11482 unused.
11483 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
11484 * data/lalr1.cc (nsym_): Remove, unused.
11485
11486 2002-07-03 Akim Demaille <akim@epita.fr>
11487
11488 * src/lalr.h, src/lalr.c (goto_number_t): New.
11489 * src/lalr.c (goto_list_t): New.
11490 Propagate them.
11491 * src/nullable.c (rule_list_t): New.
11492 Propagate.
11493 * src/types.h: Remove.
11494
11495 2002-07-03 Akim Demaille <akim@epita.fr>
11496
11497 * src/closure.c (print_fderives): Use rule_rhs_print.
11498 * src/derives.c (print_derives): Use rule_rhs_print.
11499 (rule_list_t): New, replaces `shorts'.
11500 (set_derives): Add comments.
11501 * tests/sets.at (Nullable, Firsts): Adjust.
11502
11503 2002-07-03 Akim Demaille <akim@epita.fr>
11504
11505 * src/output.c (prepare_actions): Free `tally' and `width'.
11506 (prepare_actions): Allocate and free `order'.
11507 * src/symtab.c (symbols_free): Free `symbols'.
11508 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
11509 * src/output.c (m4_invoke): Move to...
11510 * src/scan-skel.l: here.
11511 (<<EOF>>): Close yyout, and free its name.
11512
11513 2002-07-03 Akim Demaille <akim@epita.fr>
11514
11515 Fix some memory leaks, and fix a bug: state 0 was examined twice.
11516
11517 * src/LR0.c (new_state): Merge into...
11518 (state_list_append): this.
11519 (new_states): Merge into...
11520 (generate_states): here.
11521 (set_states): Don't ensure a proper `errs' state member here, do it...
11522 * src/conflicts.c (conflicts_solve): here.
11523 * src/state.h, src/state.c: Comment changes.
11524 (state_t): Rename member `shifts' as `transitions'.
11525 Adjust all dependencies.
11526 (errs_new): For consistency, also take the values as argument.
11527 (errs_dup): Remove.
11528 (state_errs_set): New.
11529 (state_reductions_set, state_transitions_set): Assert that no
11530 previous value was assigned.
11531 (state_free): New.
11532 (states_free): Use it.
11533 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
11534 temporary storage: use `errs' and `nerrs' as elsewhere.
11535 (set_conflicts): Allocate and free this `errs'.
11536
11537 2002-07-02 Akim Demaille <akim@epita.fr>
11538
11539 * lib/libiberty.h: New.
11540 * lib: Update the bitset implementation from upstream.
11541 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
11542 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
11543 * src/main.c: Adjust bitset stats calls.
11544
11545 2002-07-01 Paul Eggert <eggert@twinsun.com>
11546
11547 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
11548 char, so that negative chars don't collide with $.
11549
11550 2002-06-30 Akim Demaille <akim@epita.fr>
11551
11552 Have the GLR tests be `warning' checked, and fix the warnings.
11553
11554 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
11555 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
11556 (yyremoveDeletes): `yyi' and `yyj' are size_t.
11557 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
11558 (yyaddDeferredAction): static.
11559 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
11560 (yyreportParseError): yyprefix is const.
11561 yytokenp is used only when verbose.
11562 (yy__GNUC__): Replace with __GNUC__.
11563 (yypdumpstack): yyi is size_t.
11564 (yypreference): Un-yy local variables and arguments, to avoid
11565 clashes with `yyr1'. Anyway, we are not in the user name space.
11566 (yytname_size): be an int, as is compared with ints.
11567 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
11568 Use them.
11569 * tests/cxx-gram.at: Use quotation to protect $1.
11570 Use AT_COMPILE to enable warnings hunts.
11571 Prototype yylex and yyerror.
11572 `Use' argc.
11573 Include `string.h', not `strings.h'.
11574 Produce and prototype stmtMerge only when used.
11575 yylex takes a location.
11576
11577 2002-06-30 Akim Demaille <akim@epita.fr>
11578
11579 We spend a lot of time in quotearg, in particular when --verbose.
11580
11581 * src/symtab.c (symbol_get): Store a quoted version of the key.
11582 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
11583 Adjust all callers.
11584
11585 2002-06-30 Akim Demaille <akim@epita.fr>
11586
11587 * src/state.h (reductions_t): Rename member `nreds' as num.
11588 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
11589 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
11590
11591 2002-06-30 Akim Demaille <akim@epita.fr>
11592
11593 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
11594 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
11595 (shifts_to): Rename as...
11596 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
11597 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
11598 (TRANSITION_IS_DISABLED, transitions_to): these.
11599
11600 2002-06-30 Akim Demaille <akim@epita.fr>
11601
11602 * src/print.c (print_shifts, print_gotos): Merge into...
11603 (print_transitions): this.
11604 (print_transitions, print_errs, print_reductions): Align the
11605 lookaheads columns.
11606 (print_core, print_transitions, print_errs, print_state,
11607 print_grammar): Output empty lines separator before, not after.
11608 (state_default_rule_compute): Rename as...
11609 (state_default_rule): this.
11610 * tests/conflicts.at (Defaulted Conflicted Reduction),
11611 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
11612 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
11613
11614 2002-06-30 Akim Demaille <akim@epita.fr>
11615
11616 Display items as we display rules.
11617
11618 * src/gram.h, src/gram.c (rule_lhs_print): New.
11619 * src/gram.c (grammar_rules_partial_print): Use it.
11620 * src/print.c (print_core): Likewise.
11621 * tests/conflicts.at (Defaulted Conflicted Reduction),
11622 (Unresolved SR Conflicts): Adjust.
11623 (Unresolved SR Conflicts): Adjust and rename as...
11624 (Resolved SR Conflicts): this, as was meant.
11625 * tests/regression.at (Web2c Report): Adjust.
11626
11627 2002-06-30 Akim Demaille <akim@epita.fr>
11628
11629 * src/print.c (state_default_rule_compute): New, extracted from...
11630 (print_reductions): here.
11631 Pessimize, but clarify the code.
11632 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
11633
11634 2002-06-30 Akim Demaille <akim@epita.fr>
11635
11636 * src/output.c (action_row): Let default_rule be always a rule
11637 number.
11638
11639 2002-06-30 Akim Demaille <akim@epita.fr>
11640
11641 * src/closure.c (print_firsts, print_fderives, closure):
11642 Use BITSET_EXECUTE.
11643 * src/lalr.c (lookaheads_print): Likewise.
11644 * src/state.c (state_rule_lookaheads_print): Likewise.
11645 * src/print_graph.c (print_core): Likewise.
11646 * src/print.c (print_reductions): Likewise.
11647 * src/output.c (action_row): Likewise.
11648 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
11649
11650 2002-06-30 Akim Demaille <akim@epita.fr>
11651
11652 * src/print_graph.c: Use report_flag.
11653
11654 2002-06-30 Akim Demaille <akim@epita.fr>
11655
11656 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
11657 to...
11658 * src/relation.h, src/relation.c (traverse, relation_digraph)
11659 (relation_print, relation_transpose): New.
11660
11661 2002-06-30 Akim Demaille <akim@epita.fr>
11662
11663 * src/state.h, src/state.c (shifts_to): New.
11664 * src/lalr.c (build_relations): Use it.
11665
11666 2002-06-30 Akim Demaille <akim@epita.fr>
11667
11668 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
11669 (item_number_of_rule_number, rule_number_of_item_number): New.
11670 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
11671 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
11672 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
11673 Propagate their use.
11674 Much remains to be done, in particular wrt `shorts' from types.h.
11675
11676 2002-06-30 Akim Demaille <akim@epita.fr>
11677
11678 * src/symtab.c (symbol_new): Initialize the `printer' member.
11679
11680 2002-06-30 Akim Demaille <akim@epita.fr>
11681
11682 * src/LR0.c (save_reductions): Remove, replaced by...
11683 * src/state.h, src/state.c (state_reductions_set): New.
11684 (reductions, errs): Rename as...
11685 (reductions_t, errs_t): these.
11686 Adjust all dependencies.
11687
11688 2002-06-30 Akim Demaille <akim@epita.fr>
11689
11690 * src/LR0.c (state_list_t, state_list_append): New.
11691 (first_state, last_state): Now symbol_list_t.
11692 (this_state): Remove.
11693 (new_itemsets, append_states, save_reductions): Take a state_t as
11694 argument.
11695 (set_states, generate_states): Adjust.
11696 (save_shifts): Remove, replaced by...
11697 * src/state.h, src/state.c (state_shifts_set): New.
11698 (shifts): Rename as...
11699 (shifts_t): this.
11700 Adjust all dependencies.
11701 * src/state.h (state_t): Remove the `next' member.
11702
11703 2002-06-30 Akim Demaille <akim@epita.fr>
11704
11705 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
11706 escaped in slot 0.
11707
11708 2002-06-30 Akim Demaille <akim@epita.fr>
11709
11710 Use hash.h for the state hash table.
11711
11712 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
11713 (allocate_storage): Use state_hash_new.
11714 (free_storage): Use state_hash_free.
11715 (new_state, get_state): Adjust.
11716 * src/lalr.h, src/lalr.c (states): Move to...
11717 * src/states.h (state_t): Remove the `link' member, no longer
11718 used.
11719 * src/states.h, src/states.c: here.
11720 (state_hash_new, state_hash_free, state_hash_lookup)
11721 (state_hash_insert, states_free): New.
11722 * src/states.c (state_table, state_compare, state_hash): New.
11723 * src/output.c (output_actions): Do not free states now, since we
11724 still need to know the final_state number in `prepare', called
11725 afterwards. Do it...
11726 * src/main.c (main): here: call states_free after `output'.
11727
11728 2002-06-30 Akim Demaille <akim@epita.fr>
11729
11730 * src/state.h, src/state.c (state_new): New, extracted from...
11731 * src/LR0.c (new_state): here.
11732 * src/state.h (STATE_ALLOC): Move to...
11733 * src/state.c: here.
11734 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
11735 * src/state.h, src/state.c: here.
11736
11737 2002-06-30 Akim Demaille <akim@epita.fr>
11738
11739 * src/reader.c (gensym): Rename as...
11740 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
11741 (getsym): Rename as...
11742 (symbol_get): this.
11743
11744 2002-06-30 Akim Demaille <akim@epita.fr>
11745
11746 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
11747 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
11748 * src/output.c, src/print.c, src/print_graph.c: Propagate.
11749 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
11750
11751 2002-06-30 Akim Demaille <akim@epita.fr>
11752
11753 Make the test suite pass with warnings checked.
11754
11755 * tests/actions.at (Printers and Destructors): Improve.
11756 Avoid unsigned vs. signed issues.
11757 * tests/calc.at: Don't exercise the scanner here, do it...
11758 * tests/input.at (Torturing the Scanner): here.
11759
11760 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11761
11762 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
11763 reorganize first lines parallel to yacc.c.
11764
11765 2002-06-28 Akim Demaille <akim@epita.fr>
11766
11767 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
11768 (b4_token_enum, b4_token_defines): New, factored from...
11769 * data/lalr1.cc, data/yacc.c, glr.c: here.
11770
11771 2002-06-28 Akim Demaille <akim@epita.fr>
11772
11773 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
11774 unused variables.
11775 * src/output.c (merger_output): static.
11776
11777 2002-06-28 Akim Demaille <akim@epita.fr>
11778
11779 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
11780 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
11781 pacify GCC.
11782 * src/output.c (save_row): Initialize all the variables to pacify GCC.
11783
11784 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11785
11786 Accumulated changelog for new GLR parsing features.
11787
11788 * src/conflicts.c (count_total_conflicts): Change name to
11789 conflicts_total_count.
11790 * src/conflicts.h: Ditto.
11791 * src/output.c (token_actions): Use the new name.
11792 (output_conflicts): Change conflp => conflict_list_heads, and
11793 confl => conflict_list for better readability.
11794 * data/glr.c: Use the new names.
11795 * NEWS: Add self to GLR announcement.
11796
11797 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
11798
11799 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
11800 Akim Demaille.
11801
11802 * data/bison.glr: Change name to glr.c
11803 * data/glr.c: Renamed from bison.glr.
11804 * data/Makefile.am: Add glr.c
11805
11806 * src/getargs.c:
11807
11808 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
11809 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
11810
11811 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11812
11813 * data/bison.glr: Be sure to restore the
11814 current #line when returning to the skeleton contents after having
11815 exposed the input file's #line.
11816
11817 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11818
11819 * data/bison.glr: Bring up to date with changes to bison.simple.
11820
11821 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11822
11823 * data/bison.glr: Correct definitions that use b4_prefix.
11824 Various reformatting.
11825 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
11826 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
11827 yytokenp argument; now part of stack.
11828 (yychar): Define to behave as documented.
11829 (yyclearin): Ditto.
11830
11831 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11832
11833 * src/reader.h: Add declaration for free_merger_functions.
11834
11835 * src/reader.c (merge_functions): New variable.
11836 (get_merge_function): New function.
11837 (free_merger_functions): New function.
11838 (readgram): Check for %prec that is not followed by a symbol.
11839 Handle %dprec and %merge declarations.
11840 (packgram): Initialize dprec and merger fields in rules array.
11841
11842 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
11843 conflict_list_cnt, conflict_list_free): New variables.
11844 (table_grow): Also grow conflict_table.
11845 (prepare_rules): Output dprec and merger tables.
11846 (conflict_row): New function.
11847 (action_row): Output conflict lists for GLR parser. Don't use
11848 default reduction in conflicted states for GLR parser so that there
11849 are spaces for the conflict lists.
11850 (save_row): Also save conflict information.
11851 (token_actions): Allocate conflict list.
11852 (merger_output): New function.
11853 (pack_vector): Pack conflict table, too.
11854 (output_conflicts): New function to output yyconflp and yyconfl.
11855 (output_check): Allocate conflict_tos.
11856 (output_actions): Output conflict tables, also.
11857 (output_skeleton): Output b4_mergers definition.
11858 (prepare): Output b4_max_rhs_length definition.
11859 Use 'bison.glr' as default skeleton for GLR parsers.
11860
11861 * src/gram.c (glr_parser): New flag.
11862 (grammar_free): Call free_merger_functions.
11863
11864 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
11865 all pairs of conflicting reductions, rather than just all tokens
11866 causing conflicts. Needed to size conflict tables.
11867 (conflicts_output): Modify call to count_rr_conflicts for new
11868 interface.
11869 (conflicts_print): Ditto.
11870 (count_total_conflicts): New function.
11871
11872 * src/reader.h (merger_list): New type.
11873 (merge_functions): New variable.
11874
11875 * src/lex.h (tok_dprec, tok_merge): New token types.
11876
11877 * src/gram.h (rule_s): Add dprec and merger fields.
11878 (glr_parser): New flag.
11879
11880 * src/conflicts.h (count_total_conflicts): New function.
11881
11882 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
11883
11884 * doc/bison.texinfo (Generalized LR Parsing): New section.
11885 (GLR Parsers): New section.
11886 (Language and Grammar): Mention GLR parsing.
11887 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
11888 Correct typo ("tge" -> "the").
11889
11890 * data/bison.glr: New skeleton for GLR parsing.
11891
11892 * tests/cxx-gram.at: New tests for GLR parsing.
11893
11894 * tests/testsuite.at: Include cxx-gram.at.
11895
11896 * tests/Makefile.am: Add cxx-gram.at.
11897
11898 * src/parse-gram.y:
11899
11900 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
11901
11902 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
11903
11904 2002-06-27 Akim Demaille <akim@epita.fr>
11905
11906 * src/options.h, src/options.c: Remove.
11907 * src/getargs.c (short_options, long_options): New.
11908
11909 2002-06-27 Akim Demaille <akim@epita.fr>
11910
11911 * data/bison.simple, data/bison.c++: Rename as...
11912 * data/yacc.c, data/lalr1.cc: these.
11913 * doc/bison.texinfo (Environment Variables): Remove.
11914
11915 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
11916
11917 * src/getargs.c (report_argmatch): Initialize strtok().
11918
11919 2002-06-20 Akim Demaille <akim@epita.fr>
11920
11921 * data/bison.simple (b4_symbol_actions): New, replaces...
11922 (b4_symbol_destructor, b4_symbol_printer): these.
11923 (yysymprint): Be sure to call YYPRINT only for tokens, and using
11924 user token numbers.
11925
11926 2002-06-20 Akim Demaille <akim@epita.fr>
11927
11928 * data/bison.simple (yydestructor): Rename as...
11929 (yydestruct): this.
11930
11931 2002-06-20 Akim Demaille <akim@epita.fr>
11932
11933 * src/symtab.h, src/symtab.c (symbol_type_set)
11934 (symbol_destructor_set, symbol_precedence_set): The location is
11935 the last argument.
11936 Adjust all callers.
11937
11938 2002-06-20 Akim Demaille <akim@epita.fr>
11939
11940 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
11941 internals.
11942 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
11943 Takes a location.
11944 * src/symtab.h, src/symtab.c (symbol_class_set)
11945 (symbol_user_token_number_set): Likewise.
11946 Adjust all callers.
11947 Promote complain_at.
11948 * tests/input.at (Type Clashes): Adjust.
11949
11950 2002-06-20 Akim Demaille <akim@epita.fr>
11951
11952 * data/bison.simple (YYLEX): Fix the declaration when
11953 %pure-parser.
11954
11955 2002-06-20 Akim Demaille <akim@epita.fr>
11956
11957 * data/bison.simple (yysymprint): Don't print the token number,
11958 just its name.
11959 * tests/actions.at (Destructors): Rename as...
11960 (Printers and Destructors): this.
11961 Also exercise %printer.
11962
11963 2002-06-20 Akim Demaille <akim@epita.fr>
11964
11965 * data/bison.simple (YYDSYMPRINT): New.
11966 Use it to remove many of the #if YYDEBUG/if (yydebug).
11967
11968 2002-06-20 Akim Demaille <akim@epita.fr>
11969
11970 * src/symtab.h, src/symtab.c (symbol_t): printer and
11971 printer_location are new members.
11972 (symbol_printer_set): New.
11973 * src/parse-gram.y (PERCENT_PRINTER): New token.
11974 Handle its associated rule.
11975 * src/scan-gram.l: Adjust.
11976 (handle_destructor_at, handle_destructor_dollar): Rename as...
11977 (handle_symbol_code_at, handle_symbol_code_dollar): these.
11978 * src/output.c (symbol_printers_output): New.
11979 (output_skeleton): Call it.
11980 * data/bison.simple (yysymprint): New. Cannot be named yyprint
11981 since there are already many grammar files with a user `yyprint'.
11982 Replace the calls to YYPRINT to calls to yysymprint.
11983 * tests/calc.at: Adjust.
11984 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
11985 taking advantage of parser very internal details (stack size!).
11986
11987 2002-06-20 Akim Demaille <akim@epita.fr>
11988
11989 * src/scan-gram.l: Complete the scanner with the missing patterns
11990 to pacify Flex.
11991 Use `quote' and `symbol_tag_get' where appropriate.
11992
11993 2002-06-19 Akim Demaille <akim@epita.fr>
11994
11995 * tests/actions.at (Destructors): Augment to test locations.
11996 * data/bison.simple (yydestructor): Pass it the current location
11997 if locations are enabled.
11998 Prototype only when __STDC__ or C++.
11999 Change the argument names to move into the yy name space: there is
12000 user code here.
12001
12002 2002-06-19 Akim Demaille <akim@epita.fr>
12003
12004 * data/bison.simple (b4_pure_if): New.
12005 Use it instead of #ifdef YYPURE.
12006
12007 2002-06-19 Akim Demaille <akim@epita.fr>
12008
12009 * data/bison.simple (b4_location_if): New.
12010 Use it instead of #ifdef YYLSP_NEEDED.
12011
12012 2002-06-19 Akim Demaille <akim@epita.fr>
12013
12014 Prepare @$ in %destructor, but currently don't bind it in the
12015 skeleton, as %location use is not cleaned up yet.
12016
12017 * src/scan-gram.l (handle_dollar, handle_destructor_at)
12018 (handle_action_at): New.
12019 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
12020 a braced_code_t and a location as additional arguments.
12021 (handle_destructor_dollar): Instead of requiring `b4_eval', just
12022 unquote one when outputting `b4_dollar_dollar'.
12023 Adjust callers.
12024 * data/bison.simple (b4_eval): Remove.
12025 (b4_symbol_destructor): Adjust.
12026 * tests/input.at (Invalid @n): Adjust.
12027
12028 2002-06-19 Zack Weinberg <zack@codesourcery.com>
12029
12030 * doc/bison.texinfo: Document ability to have multiple
12031 prologue sections.
12032
12033 2002-06-18 Akim Demaille <akim@epita.fr>
12034
12035 * src/files.c (compute_base_names): When computing the output file
12036 names from the input file name, strip the directory part.
12037
12038 2002-06-18 Akim Demaille <akim@epita.fr>
12039
12040 * data/bison.simple.new: Comment changes.
12041 Reported by Andreas Schwab.
12042
12043 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
12044
12045 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
12046 there are no `label `yyoverflowlab' defined but not used' warnings
12047 when yyoverflow is defined.
12048
12049 2002-06-18 Akim Demaille <akim@epita.fr>
12050
12051 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
12052 new member.
12053 (symbol_destructor_set): Adjust.
12054 * src/output.c (symbol_destructors_output): Output the destructor
12055 locations.
12056 Output the symbol name.
12057 * data/bison.simple (b4_symbol_destructor): Adjust.
12058
12059 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
12060 and Akim Demaille <akim@epita.fr>
12061
12062 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
12063 what's left on the stack when the error recovery hits EOF.
12064 * tests/actions.at (Destructors): Complete to exercise this case.
12065
12066 2002-06-17 Akim Demaille <akim@epita.fr>
12067
12068 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
12069 arguments is really empty, not only equal to `[]'.
12070 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
12071 member.
12072 (symbol_destructor_set): New.
12073 * src/output.c (symbol_destructors_output): New.
12074 * src/reader.h (brace_code_t, current_braced_code): New.
12075 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
12076 (handle_dollar): Rename as...
12077 (handle_action_dollar): this.
12078 (handle_destructor_dollar): New.
12079 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
12080 (grammar_declaration): Use it.
12081 * data/bison.simple (yystos): Is always defined.
12082 (yydestructor): New.
12083 * tests/actions.at (Destructors): New.
12084 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
12085
12086 2002-06-17 Akim Demaille <akim@epita.fr>
12087
12088 * src/symlist.h, src/symlist.c (symbol_list_length): New.
12089 * src/scan-gram.l (handle_dollar, handle_at): Compute the
12090 rule_length only when needed.
12091 * src/output.c (actions_output, token_definitions_output): Output
12092 the full M4 block.
12093 * src/symtab.c: Don't access directly to the symbol tag, use
12094 symbol_tag_get.
12095 * src/parse-gram.y: Use symbol_list_free.
12096
12097 2002-06-17 Akim Demaille <akim@epita.fr>
12098
12099 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
12100 (symbol_list_prepend, get_type_name): Move to...
12101 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
12102 (symbol_list_prepend, symbol_list_n_type_name_get): here.
12103 Adjust all callers.
12104 (symbol_list_free): New.
12105 * src/scan-gram.l (handle_dollar): Takes a location.
12106 * tests/input.at (Invalid $n): Adjust.
12107
12108 2002-06-17 Akim Demaille <akim@epita.fr>
12109
12110 * src/reader.h, src/reader.c (symbol_list_new): Export it.
12111 (symbol_list_prepend): New.
12112 * src/parse-gram.y (%union): `list' is a new member.
12113 (symbols.1): New, replaces...
12114 (terms_to_prec.1, nterms_to_type.1): these.
12115 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
12116 Take a location as additional argument.
12117 Adjust all callers.
12118
12119 2002-06-15 Akim Demaille <akim@epita.fr>
12120
12121 * src/parse-gram.y: Move %token in the declaration section so that
12122 we don't depend upon CVS Bison.
12123
12124 2002-06-15 Akim Demaille <akim@epita.fr>
12125
12126 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
12127 * src/print.c (print_core): Use it.
12128
12129 2002-06-15 Akim Demaille <akim@epita.fr>
12130
12131 * src/conflicts.c (log_resolution): Accept the rule involved in
12132 the sr conflicts instead of the lookahead number that points to
12133 that rule.
12134 (flush_reduce): Accept the current lookahead vector as argument,
12135 instead of the index in LA.
12136 (resolve_sr_conflict): Accept the current number of lookahead
12137 bitset to consider for the STATE, instead of the index in LA.
12138 (set_conflicts): Adjust.
12139 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
12140
12141 2002-06-15 Akim Demaille <akim@epita.fr>
12142
12143 * src/state.h (state_t): Replace the `lookaheadsp' member, a
12144 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
12145 Adjust all dependencies.
12146 * src/lalr.c (initialize_lookaheads): Split into...
12147 (states_lookaheads_count, states_lookaheads_initialize): these.
12148 (lalr): Adjust.
12149
12150 2002-06-15 Akim Demaille <akim@epita.fr>
12151
12152 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
12153 out of...
12154 (grammar_rules_print): here.
12155 * src/reduce.c (reduce_output): Use it.
12156 * tests/reduce.at (Useless Rules, Reduced Automaton)
12157 (Underivable Rules): Adjust.
12158
12159 2002-06-15 Akim Demaille <akim@epita.fr>
12160
12161 Copy BYacc's nice way to report the grammar.
12162
12163 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
12164 New.
12165 Don't print the rules' location, it is confusing and useless.
12166 (rule_print): Use grammar_rhs_print.
12167 * src/print.c (print_grammar): Use grammar_rules_print.
12168
12169 2002-06-15 Akim Demaille <akim@epita.fr>
12170
12171 Complete and rationalize `useless thing' warnings.
12172
12173 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
12174 (symbol_tag_print): New.
12175 Use them everywhere in place of accessing directly the tag member.
12176 * src/gram.h, src/gram.c (rule_print): New.
12177 Use it where a rule used to be printed `by hand'.
12178 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
12179 (reduce_grammar_tables): Report the useless rules.
12180 (reduce_print): Useless things are a warning, not an error.
12181 Report it as such.
12182 * tests/reduce.at (Useless Nonterminals, Useless Rules):
12183 (Reduced Automaton, Underivable Rules): Adjust.
12184 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
12185 * tests/conflicts.at (Unresolved SR Conflicts)
12186 (Solved SR Conflicts): Adjust.
12187
12188 2002-06-15 Akim Demaille <akim@epita.fr>
12189
12190 Let symbols have a location.
12191
12192 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
12193 (getsym): Adjust.
12194 Adjust all callers.
12195 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
12196 Use location_t, not int.
12197 * src/symtab.c (symbol_check_defined): Take advantage of the
12198 location.
12199 * tests/regression.at (Invalid inputs): Adjust.
12200
12201 2002-06-15 Akim Demaille <akim@epita.fr>
12202
12203 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
12204 (input): Don't try to initialize yylloc here, do it in the
12205 scanner.
12206 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
12207 * src/gram.h (rule_t): Change line and action_line into location
12208 and action_location, of location_t type.
12209 Adjust all dependencies.
12210 * src/location.h, src/location.c (empty_location): New.
12211 * src/reader.h, src/reader.c (grammar_start_symbol_set)
12212 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
12213 (grammar_current_rule_symbol_append)
12214 (grammar_current_rule_action_append): Expect a location as argument.
12215 * src/reader.c (grammar_midrule_action): Adjust to attach an
12216 action's location as dummy symbol location.
12217 * src/symtab.h, src/symtab.c (startsymbol_location): New.
12218 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
12219 the line numbers.
12220
12221 2002-06-14 Akim Demaille <akim@epita.fr>
12222
12223 Grammar declarations may be found in the grammar section.
12224
12225 * src/parse-gram.y (rules_or_grammar_declaration): New.
12226 (declarations): Each declaration may end with a semicolon, not
12227 just...
12228 (grammar_declaration): `"%union"'.
12229 (grammar): Branch to rules_or_grammar_declaration.
12230
12231 2002-06-14 Akim Demaille <akim@epita.fr>
12232
12233 * src/main.c (main): Invoke scanner_free.
12234
12235 2002-06-14 Akim Demaille <akim@epita.fr>
12236
12237 * src/output.c (m4_invoke): Extracted from...
12238 (output_skeleton): here.
12239 Free tempfile.
12240
12241 2002-06-14 Akim Demaille <akim@epita.fr>
12242
12243 * src/parse-gram.y (directives, directive, gram)
12244 (grammar_directives, precedence_directives, precedence_directive):
12245 Rename as...
12246 (declarations, declaration, grammar, grammar_declaration)
12247 (precedence_declaration, precedence_declarator): these.
12248 (symbol_declaration): New.
12249
12250 2002-06-14 Akim Demaille <akim@epita.fr>
12251
12252 * src/files.c (action_obstack): Remove, unused.
12253 (output_obstack): Remove it, and all its dependencies, as it is no
12254 longer needed.
12255 * src/reader.c (epilogue_set): Build the epilogue in the
12256 muscle_obstack.
12257 * src/output.h, src/output.c (muscle_obstack): Move to...
12258 * src/muscle_tab.h, src/muscle_tab.h: here.
12259 (muscle_init): Initialize muscle_obstack.
12260 (muscle_free): New.
12261 * src/main.c (main): Call it.
12262
12263 2002-06-14 Akim Demaille <akim@epita.fr>
12264
12265 * src/location.h: New, extracted from...
12266 * src/reader.h: here.
12267 * src/Makefile.am (noinst_HEADERS): Merge into
12268 (bison_SOURCES): this.
12269 Add location.h.
12270 * src/parse-gram.y: Use location_t instead of Bison's.
12271 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
12272 Use location_t instead of ints.
12273
12274 2002-06-14 Akim Demaille <akim@epita.fr>
12275
12276 * data/bison.simple, data/bison.c++: Be sure to restore the
12277 current #line when returning to the skeleton contents after having
12278 exposed the input file's #line.
12279
12280 2002-06-12 Akim Demaille <akim@epita.fr>
12281
12282 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
12283 eager.
12284 * tests/actions.at (Exotic Dollars): New.
12285
12286 2002-06-12 Akim Demaille <akim@epita.fr>
12287
12288 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
12289 ['"/] too eagerly.
12290 * tests/input.at (Torturing the Scanner): New.
12291
12292 2002-06-11 Akim Demaille <akim@epita.fr>
12293
12294 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
12295 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
12296 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
12297 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
12298 * src/reader.c (reader): Use it.
12299
12300 2002-06-11 Akim Demaille <akim@epita.fr>
12301
12302 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
12303 Adjust all callers.
12304 (scanner_last_string_free): New.
12305
12306 2002-06-11 Akim Demaille <akim@epita.fr>
12307
12308 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
12309 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
12310 (last_string, YY_OBS_FREE): New.
12311 Use them when returning an ID.
12312
12313 2002-06-11 Akim Demaille <akim@epita.fr>
12314
12315 Have Bison grammars parsed by a Bison grammar.
12316
12317 * src/reader.c, src/reader.h (prologue_augment): New.
12318 * src/reader.c (copy_definition): Remove.
12319
12320 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
12321 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
12322 (grammar_current_rule_prec_set, grammar_current_rule_check)
12323 (grammar_current_rule_symbol_append)
12324 (grammar_current_rule_action_append): Export.
12325 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
12326 (symbol_list_action_append): Remove.
12327 Hook the routines from reader.
12328 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
12329 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
12330
12331 * src/reader.c (read_declarations): Remove, unused.
12332
12333 * src/parse-gram.y: Handle the epilogue.
12334 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
12335 (grammar_start_symbol_set): this.
12336 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
12337 * src/reader.c (readgram): Remove, unused.
12338 (reader): Adjust to insert eoftoken and axiom where appropriate.
12339
12340 * src/reader.c (copy_dollar): Replace with...
12341 * src/scan-gram.h (handle_dollar): this.
12342 * src/parse-gram.y: Remove `%thong'.
12343
12344 * src/reader.c (copy_at): Replace with...
12345 * src/scan-gram.h (handle_at): this.
12346
12347 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
12348 New.
12349
12350 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
12351 time being.
12352
12353 * src/reader.h, src/reader.c (grammar_rule_end): New.
12354
12355 * src/parse.y (current_type, current_class): New.
12356 Implement `%nterm', `%token' support.
12357 Merge `%term' into `%token'.
12358 (string_as_id): New.
12359 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
12360 type name.
12361
12362 * src/parse-gram.y: Be sure to handle properly the beginning of
12363 rules.
12364
12365 * src/parse-gram.y: Handle %type.
12366 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
12367
12368 * src/parse-gram.y: More directives support.
12369 * src/options.c: No longer handle source directives.
12370
12371 * src/parse-gram.y: Fix %output.
12372
12373 * src/parse-gram.y: Handle %union.
12374 Use the prologue locations.
12375 * src/reader.c (parse_union_decl): Remove.
12376
12377 * src/reader.h, src/reader.c (epilogue_set): New.
12378 * src/parse-gram.y: Use it.
12379
12380 * data/bison.simple, data/bison.c++: b4_stype is now either not
12381 defined, then default to int, or to the contents of %union,
12382 without `union' itself.
12383 Adjust.
12384 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
12385
12386 * src/output.c (actions_output): Don't output braces, as they are
12387 already handled by the scanner.
12388
12389 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
12390 characters to themselves.
12391
12392 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
12393 that the epilogue has a proper #line.
12394
12395 * src/parse-gram.y: Handle precedence/associativity.
12396
12397 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
12398 a terminal.
12399 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
12400 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
12401 at all to define terminals that cannot be emitted.
12402
12403 * src/scan-gram.l: Escape M4 characters.
12404
12405 * src/scan-gram.l: Working properly with escapes in user
12406 strings/characters.
12407
12408 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
12409 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
12410 grammar.
12411 Use more modest sizes, as for the time being the parser does not
12412 release memory, and therefore the process swallows a huge amount
12413 of memory.
12414
12415 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
12416 stricter %token grammar.
12417
12418 * src/symtab.h (associativity): Add `undef_assoc'.
12419 (symbol_precedence_set): Do nothing when passed an undef_assoc.
12420 * src/symtab.c (symbol_check_alias_consistence): Adjust.
12421
12422 * tests/regression.at (Invalid %directive): Remove, as it is now
12423 meaningless.
12424 (Invalid inputs): Adjust to the new error messages.
12425 (Token definitions): The new grammar doesn't allow too many
12426 eccentricities.
12427
12428 * src/lex.h, src/lex.c: Remove.
12429 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
12430 (copy_character, copy_string2, copy_string, copy_identifier)
12431 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
12432 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
12433 (parse_action): Remove.
12434 * po/POTFILES.in: Adjust.
12435
12436 2002-06-11 Akim Demaille <akim@epita.fr>
12437
12438 * src/reader.c (parse_action): Don't store directly into the
12439 rule's action member: return the action as a string.
12440 Don't require `rule_length' as an argument: compute it.
12441 (grammar_current_rule_symbol_append)
12442 (grammar_current_rule_action_append): New, eved out from
12443 (readgram): here.
12444 Remove `action_flag', `rulelength', unused now.
12445
12446 2002-06-11 Akim Demaille <akim@epita.fr>
12447
12448 * src/reader.c (grammar_current_rule_prec_set).
12449 (grammar_current_rule_check): New, eved out from...
12450 (readgram): here.
12451 Remove `xaction', `first_rhs': useless.
12452 * tests/input.at (Type clashes): New.
12453 * tests/existing.at (GNU Cim Grammar): Adjust.
12454
12455 2002-06-11 Akim Demaille <akim@epita.fr>
12456
12457 * src/reader.c (grammar_midrule_action): New, Eved out from
12458 (readgram): here.
12459
12460 2002-06-11 Akim Demaille <akim@epita.fr>
12461
12462 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
12463 New.
12464 (readgram): Use them as replacement of inlined code, crule and
12465 crule1.
12466
12467 2002-06-11 Akim Demaille <akim@epita.fr>
12468
12469 * src/reader.c (grammar_end, grammar_symbol_append): New.
12470 (readgram): Use them.
12471 Make the use of `p' as local as possible.
12472
12473 2002-06-10 Akim Demaille <akim@epita.fr>
12474
12475 GCJ's parser requires the tokens to be defined before the prologue.
12476
12477 * data/bison.simple: Output the token definition before the user's
12478 prologue.
12479 * tests/regression.at (Braces parsing, Duplicate string)
12480 (Mixing %token styles): Check the output from bison.
12481 (Early token definitions): New.
12482
12483 2002-06-10 Akim Demaille <akim@epita.fr>
12484
12485 * src/symtab.c (symbol_user_token_number_set): Don't complain when
12486 assigning twice the same user number to a token, so that we can
12487 use it in...
12488 * src/lex.c (lex): here.
12489 Also use `symbol_class_set' instead of hand written code.
12490 * src/reader.c (parse_assoc_decl): Likewise.
12491
12492 2002-06-10 Akim Demaille <akim@epita.fr>
12493
12494 * src/symtab.c, src/symtab.c (symbol_class_set)
12495 (symbol_user_token_number_set): New.
12496 * src/reader.c (parse_token_decl): Use them.
12497 Use a switch instead of ifs.
12498 Use a single argument.
12499
12500 2002-06-10 Akim Demaille <akim@epita.fr>
12501
12502 Remove `%thong' support as it is undocumented, unused, duplicates
12503 `%token's job, and creates useless e-mail traffic with people who
12504 want to know what it is, why it is undocumented, unused, and
12505 duplicates `%token's job.
12506
12507 * src/reader.c (parse_thong_decl): Remove.
12508 * src/options.c (option_table): Remove "thong".
12509 * src/lex.h (tok_thong): Remove.
12510
12511 2002-06-10 Akim Demaille <akim@epita.fr>
12512
12513 * src/symtab.c, src/symtab.c (symbol_type_set)
12514 (symbol_precedence_set): New.
12515 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
12516 (value_components_used): Remove, unused.
12517
12518 2002-06-09 Akim Demaille <akim@epita.fr>
12519
12520 Move symbols handling code out of the reader.
12521
12522 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
12523 (axiom): Move to...
12524 * src/symtab.h, src/symtab.c: here.
12525
12526 * src/gram.c (start_symbol): Remove: use startsymbol->number.
12527 * src/reader.c (startval): Rename as...
12528 * src/symtab.h, src/symtab.c (startsymbol): this.
12529 * src/reader.c: Adjust.
12530
12531 * src/reader.c (symbol_check_defined, symbol_make_alias)
12532 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12533 (token_translations_init)
12534 Move to...
12535 * src/symtab.c: here.
12536 * src/reader.c (packsymbols): Move to...
12537 * src/symtab.h, src/symtab.c (symbols_pack): here.
12538 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
12539 argument.
12540
12541 2002-06-03 Akim Demaille <akim@epita.fr>
12542
12543 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
12544 then statements.
12545
12546 2002-06-03 Akim Demaille <akim@epita.fr>
12547
12548 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
12549 structs with non literals.
12550 * src/scan-skel.l: never-interactive.
12551 * src/conflicts.c (enum conflict_resolution_e): No trailing
12552 comma.
12553 * src/getargs.c (usage): Split long literal strings.
12554 Reported by Hans Aberg.
12555
12556 2002-05-28 Akim Demaille <akim@epita.fr>
12557
12558 * data/bison.c++: Use C++ ostreams.
12559 (cdebug_): New member.
12560
12561 2002-05-28 Akim Demaille <akim@epita.fr>
12562
12563 * src/output.c (output_skeleton): Be sure to allocate enough room
12564 for `/' _and_ for `\0' in full_skeleton.
12565
12566 2002-05-28 Akim Demaille <akim@epita.fr>
12567
12568 * data/bison.c++: Catch up with bison.simple:
12569 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12570 and Paul Eggert <eggert@twinsun.com>: `error' handing.
12571 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
12572 and popping traces.
12573
12574 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12575
12576 * src/output.c (output_skeleton): Put an explicit path in front of
12577 the skeleton file name, rather than relying on the -I directory,
12578 to partially alleviate effects of having a skeleton file lying around
12579 in the current directory.
12580
12581 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12582
12583 * src/conflicts.c (log_resolution): Correct typo:
12584 obstack_printf should be obstack_fgrow1.
12585
12586 2002-05-26 Akim Demaille <akim@epita.fr>
12587
12588 * src/state.h (state_t): `solved_conflicts' is a new member.
12589 * src/LR0.c (new_state): Set it to 0.
12590 * src/conflicts.h, src/conflicts.c (print_conflicts)
12591 (free_conflicts, solve_conflicts): Rename as...
12592 (conflicts_print, conflicts_free, conflicts_solve): these.
12593 Adjust callers.
12594 * src/conflicts.c (enum conflict_resolution_e)
12595 (solved_conflicts_obstack): New, used by...
12596 (log_resolution): this.
12597 Adjust to attach the conflict resolution to each state.
12598 Complete the description with the precedence/associativity
12599 information.
12600 (resolve_sr_conflict): Adjust.
12601 * src/print.c (print_state): Output its solved_conflicts.
12602 * tests/conflicts.at (Unresolved SR Conflicts)
12603 (Solved SR Conflicts): Exercise --report=all.
12604
12605 2002-05-26 Akim Demaille <akim@epita.fr>
12606
12607 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12608 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12609 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
12610 (token_number_t, item_number_as_token_number)
12611 (token_number_as_item_number, muscle_insert_token_number_table):
12612 Rename as...
12613 (symbol_number_t, item_number_as_symbol_number)
12614 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
12615 these, since it is more appropriate.
12616
12617 2002-05-26 Akim Demaille <akim@epita.fr>
12618
12619 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
12620 `Error:' lines.
12621 * data/bison.simple (yystos) [YYDEBUG]: New.
12622 (yyparse) [YYDEBUG]: Display the symbols which are popped during
12623 error recovery.
12624 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
12625
12626 2002-05-25 Akim Demaille <akim@epita.fr>
12627
12628 * doc/bison.texinfo (Debugging): Split into...
12629 (Tracing): this new section, its former contents, and...
12630 (Understanding): this new section.
12631 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
12632 by...
12633 (report_flag): this.
12634 Adjust all dependencies.
12635 (report_args, report_types, report_argmatch): New.
12636 (usage, getargs): Report/support -r, --report.
12637 * src/options.h
12638 (struct option_table_struct): Rename as..,
12639 (struct option_table_s): this.
12640 Rename the `set_flag' member to `flag' to match with getopt_long's
12641 struct.
12642 * src/options.c (option_table): Split verbose into an entry for
12643 %verbose, and another for --verbose.
12644 Support --report/-r, so remove -r from the obsolete --raw.
12645 * src/print.c: Attach full item sets and lookaheads reports to
12646 report_flag instead of trace_flag.
12647 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
12648
12649 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12650 and Paul Eggert <eggert@twinsun.com>
12651
12652 * data/bison.simple (yyparse): Correct error handling to conform to
12653 POSIX and yacc. Specifically, after syntax error is discovered,
12654 do not reduce further before shifting the error token.
12655 Clean up the code a bit by removing the labels yyerrdefault,
12656 yyerrhandle, yyerrpop.
12657 * NEWS: Document the above.
12658
12659 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12660
12661 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
12662 type; it isn't always big enough, since it doesn't necessarily
12663 include non-terminals.
12664 (yytranslate): Expand definition of yy_token_number_type, so that
12665 the latter can be removed.
12666 (yy_token_number_type): Remove, only one use.
12667 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
12668 don't use TokenNumberType as element type.
12669
12670 * tests/regression.at: Modify expected output to agree with change
12671 to yyr1 and yytranslate.
12672
12673 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
12674
12675 * src/reader.c (parse_action): Use copy_character instead of
12676 obstack_1grow.
12677
12678 2002-05-13 Akim Demaille <akim@epita.fr>
12679
12680 * tests/regression.at (Token definitions): Prototype yylex and
12681 yyerror.
12682
12683 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12684
12685 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
12686 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
12687 32-bit arithmetic.
12688 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
12689
12690 2002-05-07 Akim Demaille <akim@epita.fr>
12691
12692 * tests/synclines.at: Be sure to prototype yylex and yyerror to
12693 avoid GCC warnings.
12694
12695 2002-05-07 Akim Demaille <akim@epita.fr>
12696
12697 Kill GCC warnings.
12698
12699 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
12700 over the RHS of each rule.
12701 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
12702 * src/state.h (state_t): Member `nitems' is unsigned short.
12703 * src/LR0.c (get_state): Adjust.
12704 * src/reader.c (packgram): Likewise.
12705 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
12706 `Type'.
12707 (muscle_insert_int_table): Remove, unused.
12708 (prepare_rules): Remove `max'.
12709
12710 2002-05-06 Akim Demaille <akim@epita.fr>
12711
12712 * src/closure.c (print_firsts): Display of the symbol tags.
12713 (bitmatrix_print): Move to...
12714 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
12715 here.
12716 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
12717
12718 2002-05-06 Akim Demaille <akim@epita.fr>
12719
12720 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
12721 hash_do_for_each.
12722
12723 2002-05-06 Akim Demaille <akim@epita.fr>
12724
12725 * src/LR0.c (new_state, get_state): Instead of using the global
12726 `kernel_size' and `kernel_base', have two new arguments:
12727 `core_size' and `core'.
12728 Adjust callers.
12729
12730 2002-05-06 Akim Demaille <akim@epita.fr>
12731
12732 * src/reader.c (packgram): No longer end `ritem' with a 0
12733 sentinel: it is not used.
12734
12735 2002-05-05 Akim Demaille <akim@epita.fr>
12736
12737 New experimental feature: display the lookaheads in the report and
12738 graph.
12739
12740 * src/print (print_core): When --trace-flag, display the rules
12741 lookaheads.
12742 * src/print_graph.c (print_core): Likewise.
12743 Swap the arguments.
12744 Adjust caller.
12745
12746 2002-05-05 Akim Demaille <akim@epita.fr>
12747
12748 * tests/torture.at (Many lookaheads): New test.
12749
12750 2002-05-05 Akim Demaille <akim@epita.fr>
12751
12752 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
12753 (GENERATE_MUSCLE_INSERT_TABLE): this.
12754 (output_int_table, output_unsigned_int_table, output_short_table)
12755 (output_token_number_table, output_item_number_table): Replace with...
12756 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
12757 (muscle_insert_short_table, muscle_insert_token_number_table)
12758 (muscle_insert_item_number_table): these.
12759 Adjust all callers.
12760 (prepare_tokens): Don't free `translations', since...
12761 * src/reader.h, src/reader.c (grammar_free): do it.
12762 Move to...
12763 * src/gram.h, src/gram.c (grammar_free): here.
12764 * data/bison.simple, data/bison.c++: b4_token_number_max is now
12765 b4_translate_max.
12766
12767 2002-05-05 Akim Demaille <akim@epita.fr>
12768
12769 * src/output.c (output_unsigned_int_table): New.
12770 (prepare_rules): `i' is unsigned.
12771 `prhs', `rline', `r2' are unsigned int.
12772 Rename muscle `rhs_number_max' as `rhs_max'.
12773 Output muscles `prhs_max', `rline_max', and `r2_max'.
12774 Free rline and r1.
12775 * data/bison.simple, data/bison.c++: Adjust to use these muscles
12776 to compute types instead of constant types.
12777 * tests/regression.at (Web2c Actions): Adjust.
12778
12779 2002-05-04 Akim Demaille <akim@epita.fr>
12780
12781 * src/symtab.h (SALIAS, SUNDEF): Rename as...
12782 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
12783 Adjust dependencies.
12784 * src/output.c (token_definitions_output): Be sure not to output a
12785 `#define 'a'' when fed with `%token 'a' "a"'.
12786 * tests/regression.at (Token definitions): New.
12787
12788 2002-05-03 Paul Eggert <eggert@twinsun.com>
12789
12790 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
12791 for K&R C.
12792
12793 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
12794
12795 * Makefile.am (SUBDIRS): Remove intl.
12796 (EXTRA_DIST): Add config/config.rpath.
12797
12798 2002-05-03 Akim Demaille <akim@epita.fr>
12799
12800 * data/bison.simple (m4_if): Don't output empty enums.
12801 And actually, output valid enum definitions :(.
12802
12803 2002-05-03 Akim Demaille <akim@epita.fr>
12804
12805 * configure.bat: Remove, completely obsolete.
12806 * Makefile.am (EXTRA_DIST): Adjust.
12807 Don't distribute config.rpath...
12808 * config/Makefile.am (EXTRA_DIST): Do it.
12809
12810 2002-05-03 Akim Demaille <akim@epita.fr>
12811
12812 * configure.in (GETTEXT_VERSION): New.
12813 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
12814
12815 2002-05-03 Akim Demaille <akim@epita.fr>
12816
12817 * data/bison.simple (b4_token_enum): New.
12818 (b4_token_defines): Use it to output tokens both as #define and
12819 enums.
12820 Suggested by Paul Eggert.
12821 * src/output.c (token_definitions_output): Don't output spurious
12822 white spaces.
12823
12824 2002-05-03 Akim Demaille <akim@epita.fr>
12825
12826 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12827
12828 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
12829
12830 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
12831 Update the stack class, give a try to deque as the default container.
12832
12833 2002-05-02 Akim Demaille <akim@epita.fr>
12834
12835 * data/bison.simple (yyparse): Do not implement @$ = @1.
12836 (YYLLOC_DEFAULT): Adjust to do it.
12837 * doc/bison.texinfo (Location Default Action): Fix.
12838
12839 2002-05-02 Akim Demaille <akim@epita.fr>
12840
12841 * src/reader.c (parse_braces): Merge into...
12842 (parse_action): this.
12843
12844 2002-05-02 Akim Demaille <akim@epita.fr>
12845
12846 * configure.in (ALL_LINGUAS): Remove.
12847 * po/LINGUAS, hr.po: New.
12848
12849 2002-05-02 Akim Demaille <akim@epita.fr>
12850
12851 Remove the so called hairy (semantic) parsers.
12852
12853 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
12854 * src/gram.h, src/gram.c (semantic_parser): Remove.
12855 (rule_t): Remove the guard and guard_line members.
12856 * src/lex.h (token_t): remove tok_guard.
12857 * src/options.c (option_table): Remove %guard and %semantic_parser
12858 support.
12859 * src/output.c, src/output.h (guards_output): Remove.
12860 (prepare): Adjust.
12861 (token_definitions_output): Don't output the `T'
12862 tokens (???).
12863 (output_skeleton): Don't output the guards.
12864 * src/files.c, src/files.c (attrsfile): Remove.
12865 * src/reader.c (symbol_list): Remove the guard and guard_line
12866 members.
12867 Adjust dependencies.
12868 (parse_guard): Remove.
12869 * data/bison.hairy: Remove.
12870 * doc/bison.texinfo (Environment Variables): Remove occurrences of
12871 BISON_HAIRY.
12872
12873 2002-05-02 Akim Demaille <akim@epita.fr>
12874
12875 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
12876 (parse_guard): Rename the formal argument `stack_offset' as
12877 `rule_length', which is more readable.
12878 Adjust callers.
12879 (copy_at, copy_dollar): Instead of outputting the hard coded
12880 values of $$, $n and so forth, output invocation to b4_lhs_value,
12881 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
12882 Note: this patch partially drops `semantic-parser' support: it
12883 always does `rule_length - n', where semantic parsers ought to
12884 always use `-n'.
12885 * data/bison.simple, data/bison.c++ (b4_lhs_value)
12886 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12887
12888 2002-05-02 Akim Demaille <akim@epita.fr>
12889
12890 * configure.in (AC_INIT): Bump to 1.49b.
12891 (AM_INIT_AUTOMAKE): Short invocation.
12892
12893 2002-05-02 Akim Demaille <akim@epita.fr>
12894
12895 Version 1.49a.
12896
12897 2002-05-01 Akim Demaille <akim@epita.fr>
12898
12899 * src/skeleton.h: Remove.
12900
12901 2002-05-01 Akim Demaille <akim@epita.fr>
12902
12903 * src/skeleton.h: Fix the #endif.
12904 Reported by Magnus Fromreide.
12905
12906 2002-04-26 Paul Eggert <eggert@twinsun.com>
12907
12908 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
12909 Define if we define YYSTYPE and YYLTYPE, respectively.
12910 (YYCOPY): Fix [] quoting problem in the non-GCC case.
12911
12912 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
12913
12914 * src/scan-skel.l: Postprocess quadrigraphs.
12915
12916 * src/reader.c (copy_character): New function, used to output
12917 single characters while replacing `[' and `]' with quadrigraphs, to
12918 avoid troubles with M4 quotes.
12919 (copy_comment): Output characters with copy_character.
12920 (read_additionnal_code): Likewise.
12921 (copy_string2): Likewise.
12922 (copy_definition): Likewise.
12923
12924 * tests/calc.at: Exercise M4 quoting.
12925
12926 2002-04-25 Akim Demaille <akim@epita.fr>
12927
12928 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
12929 between `!' and the command.
12930 Reported by Paul Eggert.
12931
12932 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
12933
12934 * tests/calc.at: Exercise prologue splitting.
12935
12936 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
12937 `b4_post_prologue' instead of `b4_prologue'.
12938
12939 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
12940 muscles.
12941 (output): Free pre_prologue_obstack and post_prologue_obstack.
12942 * src/files.h, src/files.c (attrs_obstack): Remove.
12943 (pre_prologue_obstack, post_prologue_obstack): New.
12944 * src/reader.c (copy_definition): Add a parameter to specify the
12945 obstack to fill, instead of using attrs_obstack unconditionally.
12946 (read_declarations): Pass pre_prologue_obstack to copy_definition if
12947 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
12948
12949 2002-04-23 Paul Eggert <eggert@twinsun.com>
12950
12951 * data/bison.simple: Remove unnecessary commentary and white
12952 space differences from 1_29-branch.
12953 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
12954
12955 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
12956 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
12957 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
12958 constructors or destructors.
12959
12960 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
12961
12962 2002-04-23 Akim Demaille <akim@epita.fr>
12963
12964 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
12965 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
12966 location with columns.
12967 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
12968 All reported by Paul Eggert.
12969
12970 2002-04-22 Akim Demaille <akim@epita.fr>
12971
12972 * src/reduce.c (dump_grammar): Move to...
12973 * src/gram.h, src/gram.c (grammar_dump): here.
12974 Be sure to separate long item numbers.
12975 Don't read the members of a rule's prec if its nil.
12976
12977 2002-04-22 Akim Demaille <akim@epita.fr>
12978
12979 * src/output.c (table_size, table_grow): New.
12980 (MAXTABLE): Remove, replace uses with table_size.
12981 (pack_vector): Instead of dying when the table is too big, grow it.
12982
12983 2002-04-22 Akim Demaille <akim@epita.fr>
12984
12985 * data/bison.simple (yyr1): Its type is that of a token number.
12986 * data/bison.c++ (r1_): Likewise.
12987 * tests/regression.at (Web2c Actions): Adjust.
12988
12989 2002-04-22 Akim Demaille <akim@epita.fr>
12990
12991 * src/reader.c (token_translations_init): 256 is now the default
12992 value for the error token, i.e., it will be assigned another
12993 number if the user assigned 256 to one of her tokens.
12994 (reader): Don't force 256 to error.
12995 * doc/bison.texinfo (Symbols): Adjust.
12996 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
12997 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
12998 etc. instead of 10, 20, 30 (which was used to `jump' over error
12999 (256) and undefined (2)).
13000
13001 2002-04-22 Akim Demaille <akim@epita.fr>
13002
13003 Propagate more token_number_t.
13004
13005 * src/gram.h (token_number_as_item_number)
13006 (item_number_as_token_number): New.
13007 * src/output.c (GENERATE_OUTPUT_TABLE): New.
13008 Use it to create output_item_number_table and
13009 output_token_number_table.
13010 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13011 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
13012 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
13013 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
13014
13015 2002-04-22 Akim Demaille <akim@epita.fr>
13016
13017 * src/output.h, src/output.c (get_lines_number): Remove.
13018
13019 2002-04-19 Akim Demaille <akim@epita.fr>
13020
13021 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
13022 as Lex/Flex'.
13023 (Debugging): More details about enabling the debugging features.
13024 (Table of Symbols): Describe $$, $n, @$, and @n.
13025 Suggested by Tim Josling.
13026
13027 2002-04-19 Akim Demaille <akim@epita.fr>
13028
13029 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
13030
13031 2002-04-10 Akim Demaille <akim@epita.fr>
13032
13033 * src/system.h: Rely on HAVE_LIMITS_H.
13034 Suggested by Paul Eggert.
13035
13036 2002-04-09 Akim Demaille <akim@epita.fr>
13037
13038 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
13039 full stderr, and strip it according to the bison options, instead
13040 of composing the error message from different bits.
13041 This makes it easier to check for several error messages.
13042 Adjust all the invocations.
13043 Add an invocation exercising the error token.
13044 Add an invocation demonstrating a stupid error message.
13045 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
13046 Adjust the tests.
13047 Error message are for stderr, not stdout.
13048
13049 2002-04-09 Akim Demaille <akim@epita.fr>
13050
13051 * src/gram.h, src/gram.c (error_token_number): Remove, use
13052 errtoken->number.
13053 * src/reader.c (reader): Don't specify the user token number (2)
13054 for $undefined, as it uselessly prevents using it.
13055 * src/gram.h (token_number_t): Move to...
13056 * src/symtab.h: here.
13057 (state_t.number): Is a token_number_t.
13058 * src/print.c, src/reader.c: Use undeftoken->number instead of
13059 hard coded 2.
13060 (Even though this 2 is not the same as above: the number of the
13061 undeftoken remains being 2, it is its user token number which
13062 might not be 2).
13063 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
13064 `user_token_number_max'.
13065 Output `undef_token_number'.
13066 * data/bison.simple, data/bison.c++: Use them.
13067 Be sure to map invalid yylex return values to
13068 `undef_token_number'. This saves us from gratuitous SEGV.
13069
13070 * tests/conflicts.at (Solved SR Conflicts)
13071 (Unresolved SR Conflicts): Adjust.
13072 * tests/regression.at (Web2c Actions): Adjust.
13073
13074 2002-04-08 Akim Demaille <akim@epita.fr>
13075
13076 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
13077 Adding #line.
13078 Remove the duplicate `typedefs'.
13079 (RhsNumberType): Fix the declaration and various other typos.
13080 Use __ofile__.
13081 * data/bison.simple: Use __ofile__.
13082 * src/scan-skel.l: Handle __ofile__.
13083
13084 2002-04-08 Akim Demaille <akim@epita.fr>
13085
13086 * src/gram.h (item_number_t): New, the type of item numbers in
13087 RITEM. Note that it must be able to code symbol numbers as
13088 positive number, and the negation of rule numbers as negative
13089 numbers.
13090 Adjust all dependencies (pretty many).
13091 * src/reduce.c (rule): Remove this `short *' pointer: use
13092 item_number_t.
13093 * src/system.h (MINSHORT, MAXSHORT): Remove.
13094 Include `limits.h'.
13095 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
13096 (shortcpy): Remove.
13097 (MAXTABLE): Move to...
13098 * src/output.c (MAXTABLE): here.
13099 (prepare_rules): Use output_int_table to output rhs.
13100 * data/bison.simple, data/bison.c++: Adjust.
13101 * tests/torture.at (Big triangle): Move the limit from 254 to
13102 500.
13103 * tests/regression.at (Web2c Actions): Ajust.
13104
13105 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
13106 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
13107 passes, but produces negative #line number, once fixed, GCC is
13108 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
13109 C), it passes.
13110 * src/state.h (state_h): Code input lines on ints, not shorts.
13111
13112 2002-04-08 Akim Demaille <akim@epita.fr>
13113
13114 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
13115 and then the grammar.
13116
13117 2002-04-08 Akim Demaille <akim@epita.fr>
13118
13119 * src/system.h: No longer using strndup.
13120
13121 2002-04-07 Akim Demaille <akim@epita.fr>
13122
13123 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
13124 * src/output.c (output_table_data): Return the longest number.
13125 (prepare_tokens): Output `token_number_max').
13126 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
13127 New.
13128 Use them to define yy_token_number_type/TokenNumberType.
13129 Use this type for yytranslate.
13130 * tests/torture.at (Big triangle): Push the limit from 124 to
13131 253.
13132 * tests/regression.at (Web2c Actions): Adjust.
13133
13134 2002-04-07 Akim Demaille <akim@epita.fr>
13135
13136 * tests/torture.at (Big triangle): New.
13137 (GNU AWK Grammar, GNU Cim Grammar): Move to...
13138 * tests/existing.at: here.
13139
13140 2002-04-07 Akim Demaille <akim@epita.fr>
13141
13142 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
13143 nritems.
13144 Adjust dependencies.
13145
13146 2002-04-07 Akim Demaille <akim@epita.fr>
13147
13148 * src/reader.c: Normalize increments to prefix form.
13149
13150 2002-04-07 Akim Demaille <akim@epita.fr>
13151
13152 * src/reader.c, symtab.c: Remove debugging code.
13153
13154 2002-04-07 Akim Demaille <akim@epita.fr>
13155
13156 Rename all the `bucket's as `symbol_t'.
13157
13158 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
13159 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
13160 * src/symtab.c, src/symtab.h (bucket): Rename as...
13161 (symbol_t): this.
13162 (symbol_list_new, bucket_check_defined, bucket_make_alias)
13163 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
13164 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13165 (buckets_new, buckets_free, buckets_do): Rename as...
13166 (symbol_list_new, symbol_check_defined, symbol_make_alias)
13167 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13168 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
13169 (symbols_new, symbols_free, symbols_do): these.
13170
13171 2002-04-07 Akim Demaille <akim@epita.fr>
13172
13173 Use lib/hash for the symbol table.
13174
13175 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
13176 EOF.
13177 * src/lex.c (lex): Set the `number' member of new terminals.
13178 * src/reader.c (bucket_check_defined, bucket_make_alias)
13179 (bucket_check_alias_consistence, bucket_translation): New.
13180 (reader, grammar_free, readgram, token_translations_init)
13181 (packsymbols): Adjust.
13182 (reader): Number the predefined tokens.
13183 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
13184 for predefined tokens.
13185 * src/symtab.h (bucket): Remove all the hash table related
13186 members.
13187 * src/symtab.c (symtab): Replace by...
13188 (bucket_table): this.
13189 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13190 (buckets_new, buckets_do): New.
13191
13192 2002-04-07 Akim Demaille <akim@epita.fr>
13193
13194 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
13195 (start_symbol, max_user_token_number, semantic_parser)
13196 (error_token_number): Initialize.
13197 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
13198 Initialize.
13199 (reader): Don't.
13200 (errtoken, eoftoken, undeftoken, axiom): Extern.
13201
13202 2002-04-07 Akim Demaille <akim@epita.fr>
13203
13204 * src/gram.h (rule_s): prec and precsym are now pointers
13205 to the bucket giving the priority/associativity.
13206 Member `associativity' removed: useless.
13207 * src/reduce.c, src/conflicts.c: Adjust.
13208
13209 2002-04-07 Akim Demaille <akim@epita.fr>
13210
13211 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
13212 Properly escape the symbols' TAG when outputting them.
13213
13214 2002-04-07 Akim Demaille <akim@epita.fr>
13215
13216 * src/lalr.h (LA): Is a bitsetv, not bitset*.
13217
13218 2002-04-07 Akim Demaille <akim@epita.fr>
13219
13220 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
13221 (LArule): this, which is an array to rule_t*.
13222 * src/print.c, src/conflicts.c: Adjust.
13223
13224 2002-04-07 Akim Demaille <akim@epita.fr>
13225
13226 * src/gram.h (rule_t): Rename `number' as `user_number'.
13227 `number' is a new member.
13228 Adjust dependencies.
13229 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
13230
13231 2002-04-07 Akim Demaille <akim@epita.fr>
13232
13233 As a result of the previous patch, it is no longer needed
13234 to reorder ritem itself.
13235
13236 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
13237
13238 2002-04-07 Akim Demaille <akim@epita.fr>
13239
13240 Be sure never to walk through RITEMS, but use only data related to
13241 the rules themselves. RITEMS should be banished.
13242
13243 * src/output.c (output_token_translations): Rename as...
13244 (prepare_tokens): this.
13245 In addition to `translate', prepare the muscles `tname' and
13246 `toknum', which were handled by...
13247 (output_rule_data): this.
13248 Remove, and move the remainder of its outputs into...
13249 (prepare_rules): this new routines, which also merges content from
13250 (output_gram): this.
13251 (prepare_rules): Be sure never to walk through RITEMS.
13252 (output_stos): Rename as...
13253 (prepare_stos): this.
13254 (output): Always invoke prepare_states, after all, just don't use it
13255 in the output if you don't need it.
13256
13257 2002-04-07 Akim Demaille <akim@epita.fr>
13258
13259 * src/LR0.c (new_state): Display `nstates' as the name of the
13260 newly created state.
13261 Adjust to initialize first_state and last_state if needed.
13262 Be sure to distinguish the initial from the final state.
13263 (new_states): Create the itemset of the initial state, and use
13264 new_state.
13265 * src/closure.c (closure): Now that the initial state has its
13266 items properly set, there is no need for a special case when
13267 creating `ruleset'.
13268
13269 As a result, now the rule 0, reducing to $axiom, is visible in the
13270 outputs. Adjust the test suite.
13271
13272 * tests/conflicts.at (Solved SR Conflicts)
13273 (Unresolved SR Conflicts): Adjust.
13274 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
13275 * tests/conflicts.at (S/R in initial): New.
13276
13277 2002-04-07 Akim Demaille <akim@epita.fr>
13278
13279 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
13280 the RHS of the rules.
13281 * src/output.c (output_gram): Likewise.
13282
13283 2002-04-07 Akim Demaille <akim@epita.fr>
13284
13285 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
13286 bucket.
13287 Adjust all dependencies.
13288 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
13289 `number' of the buckets too.
13290 * src/gram.h: Include `symtab.h'.
13291 (associativity): Move to...
13292 * src/symtab.h: here.
13293 No longer include `gram.h'.
13294
13295 2002-04-07 Akim Demaille <akim@epita.fr>
13296
13297 * src/gram.h, src/gram.c (rules_rhs_length): New.
13298 (ritem_longest_rhs): Use it.
13299 * src/gram.h (rule_t): `number' is a new member.
13300 * src/reader.c (packgram): Set it.
13301 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
13302 the end of `rules', and count them out of `nrules'.
13303 (reduce_output, dump_grammar): Adjust.
13304 * src/print.c (print_grammar): It is no longer needed to check for
13305 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
13306 * tests/reduce.at (Reduced Automaton): New test.
13307
13308 2002-04-07 Akim Demaille <akim@epita.fr>
13309
13310 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
13311 lacking `+ 1' to nrules, Bison reported as useless a token if it
13312 was used solely to set the precedence of the last rule...
13313
13314 2002-04-07 Akim Demaille <akim@epita.fr>
13315
13316 * data/bison.c++, data/bison.simple: Don't output the current file
13317 name in #line, to avoid useless diffs between two identical
13318 outputs under different names.
13319
13320 2002-04-07 Akim Demaille <akim@epita.fr>
13321
13322 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
13323 Normalize loops to using `< nrules + 1', not `<= nrules'.
13324
13325 2002-04-07 Akim Demaille <akim@epita.fr>
13326
13327 * TODO: Update.
13328
13329 2002-04-07 Akim Demaille <akim@epita.fr>
13330
13331 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
13332 bucket.value as bucket.number.
13333
13334 2002-04-07 Akim Demaille <akim@epita.fr>
13335
13336 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
13337 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13338 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
13339 RHS, instead of being an index in RITEMS.
13340
13341 2002-04-04 Paul Eggert <eggert@twinsun.com>
13342
13343 * doc/bison.texinfo: Update copyright date.
13344 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
13345 (Symbols): Warn about running Bison in one character set,
13346 but compiling and/or running in an incompatible one.
13347 Warn about character code 256, too.
13348
13349 2002-04-03 Paul Eggert <eggert@twinsun.com>
13350
13351 * src/bison.data (YYSTACK_ALLOC): Depend on whether
13352 YYERROR_VERBOSE is nonzero, not whether it is defined.
13353
13354 Merge changes from bison-1_29-branch.
13355
13356 2002-03-20 Paul Eggert <eggert@twinsun.com>
13357
13358 Merge fixes from Debian bison_1.34-1.diff.
13359
13360 * configure.in (AC_PREREQ): 2.53.
13361
13362 2002-03-20 Akim Demaille <akim@epita.fr>
13363
13364 * src/conflicts.c (log_resolution): Argument `resolution' is const.
13365
13366 2002-03-19 Paul Eggert <eggert@twinsun.com>
13367
13368 * src/bison.simple (YYCOPY): New macro.
13369 (YYSTACK_RELOCATE): Use it.
13370 Remove Type arg; no longer needed. All callers changed.
13371 (yymemcpy): Remove; no longer needed.
13372
13373 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
13374 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13375
13376 2002-03-19 Akim Demaille <akim@epita.fr>
13377
13378 Test and fix the #line outputs.
13379
13380 * tests/atlocal.at (GCC): New.
13381 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
13382 (Prologue synch line, %union synch line, Postprologue synch line)
13383 (Action synch line, Epilogue synch line): New tests.
13384 * src/reader.c (parse_union_decl): Define the muscle stype_line.
13385 * data/bison.simple, data/bison.c++: Use it.
13386
13387 2002-03-19 Akim Demaille <akim@epita.fr>
13388
13389 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
13390 (Solved SR Conflicts, %expect not enough, %expect right)
13391 (%expect too much): Move to...
13392 * tests/conflicts.at: this new file.
13393
13394 2002-03-19 Akim Demaille <akim@epita.fr>
13395
13396 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13397 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
13398 that we can move to enums for instance.
13399 * src/output.c (token_definitions_output): Output a list of
13400 `token-name, token-number' instead of the #define.
13401 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
13402
13403 2002-03-14 Akim Demaille <akim@epita.fr>
13404
13405 Use Gettext 0.11.1.
13406
13407 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
13408
13409 * data/bison.c++: Make the user able to add members to the generated
13410 parser by subclassing.
13411
13412 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
13413
13414 * src/reader.c (read_additionnal_code): `c' should be an integer, not
13415 a character.
13416 Reported by Nicolas Tisserand and Nicolas Burrus.
13417
13418 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
13419
13420 * src/reader.c: Warn about lacking semi-colons, do not complain.
13421
13422 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
13423
13424 * data/bison.c++: Remove a debug line.
13425
13426 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
13427
13428 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
13429 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
13430 provide a default implementation.
13431
13432 2002-03-04 Akim Demaille <akim@epita.fr>
13433
13434 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
13435 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
13436 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
13437 * tests/semantic.at (Parsing Guards): Similarly.
13438 * src/reader.at (readgram): Complain if the last rule is not ended
13439 with a semi-colon.
13440
13441 2002-03-04 Akim Demaille <akim@epita.fr>
13442
13443 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
13444 * src/closure.c: here.
13445 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
13446 RTC.
13447 * src/warshall.h, src/warshall.c: Remove.
13448 * tests/sets.at (Broken Closure): Adjust.
13449
13450 2002-03-04 Akim Demaille <akim@epita.fr>
13451
13452 * src/output.c (output_skeleton): tempdir is const.
13453 bytes_read is unused.
13454
13455 2002-03-04 Akim Demaille <akim@epita.fr>
13456
13457 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13458 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
13459 Update.
13460 From Michael Hayes.
13461
13462 2002-03-04 Akim Demaille <akim@epita.fr>
13463
13464 * src/closure.c (closure): `r' is unused.
13465
13466 2002-03-04 Akim Demaille <akim@epita.fr>
13467
13468 * tests/sets.at (Broken Closure): Add the ending `;'.
13469 * src/reader.at (readgram): Complain if a rule is not ended with a
13470 semi-colon.
13471
13472 2002-03-04 Akim Demaille <akim@epita.fr>
13473
13474 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
13475 (count_sr_conflicts): Use bitset_count.
13476 * src/reduce.c (inaccessable_symbols): Ditto.
13477 (bits_size): Remove.
13478 * src/warshall.h, src/warshall.c: Convert to bitsetv.
13479
13480 2002-03-04 Akim Demaille <akim@epita.fr>
13481
13482 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
13483 * src/reduce.c: Remove the `bitset_zero's following the
13484 `bitset_create's, as now it is performed by the latter.
13485
13486 2002-03-04 Akim Demaille <akim@epita.fr>
13487
13488 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
13489 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
13490 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
13491 latest sources from Michael.
13492
13493 2002-03-04 Akim Demaille <akim@epita.fr>
13494
13495 * src/output.c (output): Don't free the grammar.
13496 * src/reader.c (grammar_free): New.
13497 * src/main.c (main): Call it and don't free symtab here.
13498
13499 2002-03-04 Akim Demaille <akim@epita.fr>
13500
13501 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
13502 before returning.
13503 Reported by Benoit Perrot.
13504
13505 2002-03-04 Akim Demaille <akim@epita.fr>
13506
13507 Use bitset operations when possible, not loops over bits.
13508
13509 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
13510 bitset_or.
13511 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
13512 * src/reduce.c (useless_nonterminals): Formatting changes.
13513 * src/warshall.c (TC): Use bitset_or.
13514
13515 2002-03-04 Akim Demaille <akim@epita.fr>
13516
13517 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
13518 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
13519 Ditto.
13520
13521 2002-03-04 Akim Demaille <akim@epita.fr>
13522
13523 * src/lalr.c (F): Now a bitset*.
13524 Adjust all dependencies.
13525
13526 2002-03-04 Akim Demaille <akim@epita.fr>
13527
13528 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
13529 Adjust all dependencies.
13530
13531 2002-03-04 Akim Demaille <akim@epita.fr>
13532
13533 * src/L0.c, src/LR0.h (nstates): Be size_t.
13534 Adjust comparisons (signed vs unsigned).
13535 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
13536 bitset*.
13537 Adjust all dependencies.
13538
13539 2002-03-04 Akim Demaille <akim@epita.fr>
13540
13541 * src/closure.c (firsts): Now, also a bitset.
13542 Adjust all dependencies.
13543 (varsetsize): Remove, now unused.
13544 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
13545
13546 2002-03-04 Akim Demaille <akim@epita.fr>
13547
13548 * src/print.c: Convert to use bitset.h, not hand coded iterations
13549 over ints.
13550
13551 2002-03-04 Akim Demaille <akim@epita.fr>
13552
13553 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
13554
13555 2002-03-04 Akim Demaille <akim@epita.fr>
13556
13557 * src/closure.c (ruleset): Be a bitset.
13558 (rulesetsize): Remove.
13559
13560 2002-03-04 Akim Demaille <akim@epita.fr>
13561
13562 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13563 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
13564 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
13565 * src/closure.c (fderives): Be an array of bitsets.
13566
13567 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
13568
13569 * data/bison.c++: Merge the two generated headers. Insert a copyright
13570 notice in each output file.
13571
13572 2002-02-28 Akim Demaille <akim@epita.fr>
13573
13574 * data/bison.c++: Copy the prologue of bison.simple to fetch
13575 useful M4 definitions, such as b4_header_guard.
13576
13577 2002-02-25 Akim Demaille <akim@epita.fr>
13578
13579 * src/getargs.c (version): Give the name of the authors, and use a
13580 translator friendly scheme for the bgr
13581 copyright notice.
13582
13583 2002-02-25 Akim Demaille <akim@epita.fr>
13584
13585 * src/output.c (header_output): Remove, now handled completely via
13586 M4.
13587
13588 2002-02-25 Akim Demaille <akim@epita.fr>
13589
13590 * m4/m4.m4: New, from CVS Autoconf.
13591 * configure.in: Invoke it.
13592 * src/output.c (output_skeleton): Use its result instead of the
13593 hard coded name.
13594
13595 2002-02-25 Akim Demaille <akim@epita.fr>
13596
13597 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
13598 Fileutils 4.1.5.
13599 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
13600 * src/output.c (output_skeleton): Use mkstemp to create a real
13601 temporary file.
13602 Move the filling of `skeleton' and its muscle to...
13603 (prepare): here.
13604 (output): Move the definition of the prologue muscle to...
13605 (prepare): here.
13606 * src/system.h (DEFAULT_TMPDIR): New.
13607
13608 2002-02-14 Paul Eggert <eggert@twinsun.com>
13609
13610 Remove the support for C++ namespace cleanliness; it was
13611 causing more problems than it was curing, since it didn't work
13612 properly on some nonstandard C++ compilers. This can wait
13613 for a proper C++ parser.
13614
13615 * NEWS: Document this.
13616 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
13617 of C++, as it's treated like C now.
13618 * src/bison.simple (YYSTD): Remove.
13619 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
13620 Treat C++ just like Standard C instead of trying to support
13621 namespace cleanliness.
13622
13623 2002-02-14 Akim Demaille <akim@epita.fr>
13624
13625 * tests/regression.at (else): Adjust to Andreas' change.
13626
13627 2002-02-14 Akim Demaille <akim@epita.fr>
13628
13629 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
13630
13631 2002-02-13 Andreas Schwab <schwab@suse.de>
13632
13633 * src/output.c (output_rule_data): Don't output NULL, it might
13634 not be defined yet.
13635
13636 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
13637
13638 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
13639 (Copyright notice): Update.
13640
13641 2002-02-11 Akim Demaille <akim@epita.fr>
13642
13643 * tests/regression.at (%nonassoc and eof): Don't include
13644 nonportable headers.
13645
13646 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
13647
13648 * data/bison.c++: Correct error recovery. Make the user able to
13649 initialize the starting location.
13650
13651 2002-02-07 Akim Demaille <akim@epita.fr>
13652
13653 * tests/input.at: New.
13654
13655 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13656
13657 * data/bison.c++: Replace some direct m4 expansions by constants. Be
13658 more consistent when naming methods and variables. Put preprocessor
13659 directives around tables only needed for debugging.
13660
13661 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13662
13663 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
13664 C++ parsers.
13665 (yy::b4_name::parse): Use print_.
13666
13667 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13668
13669 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
13670
13671 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13672
13673 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
13674 C++ parsers.
13675 (yy::b4_name::parse): Build verbose error messages, and use error_.
13676
13677 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
13678
13679 * data/bison.c++: Fix m4 quoting in comments.
13680
13681 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
13682
13683 * data/bison.c++: Adjust the parser code. Fix some muscles that were
13684 not expanded by m4.
13685
13686 2002-02-05 Akim Demaille <akim@epita.fr>
13687
13688 * data/bison.c++: Adjust to the M4 back end.
13689 More is certainly needed.
13690
13691 2002-02-05 Akim Demaille <akim@epita.fr>
13692
13693 Give a try to M4 as a back end.
13694
13695 * lib/readpipe.c: New, from wdiff.
13696 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
13697 BISON_HAIRY.
13698 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
13699 specific values. Now it is m4 that performs the lookup.
13700 * src/parse-skel.y: Remove.
13701 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
13702 * src/output.c (actions_output, guards_output)
13703 (token_definitions_output): No longer keeps track of the output
13704 line number, hence remove the second argument.
13705 (guards_output): Check against the guard member of a rule, not the
13706 action member.
13707 Adjust callers.
13708 (output_skeleton): Don't look for the skeleton location, let m4 do
13709 that.
13710 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
13711 file will be used.
13712 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
13713 (prepare): Given that for the time being changesyntax is not
13714 usable in M4, rename the muscles using `-' to `_'.
13715 Define `defines_flag', `output_parser_name' and `output_header_name'.
13716 * src/output.h (actions_output, guards_output)
13717 (token_definitions_output): Adjust prototypes.
13718 * src/scan-skel.l: Instead of scanning the skeletons, it now
13719 processes the output of m4: `__oline__' and `#output'.
13720 * data/bison.simple: Adjust to be used by M4(sugar).
13721 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
13722 to date.
13723 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
13724 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
13725 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
13726 shamelessly stolen from CVS Autoconf.
13727
13728 2002-02-05 Akim Demaille <akim@epita.fr>
13729
13730 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
13731 * configure.in: Check for the declarations of free and malloc.
13732 * src/muscle_tab.c: Adjust.
13733
13734 2002-02-05 Akim Demaille <akim@epita.fr>
13735
13736 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
13737 which have no values.
13738
13739 2002-02-05 Akim Demaille <akim@epita.fr>
13740
13741 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
13742 * data/: here.
13743
13744 2002-01-29 Paul Eggert <eggert@twinsun.com>
13745
13746 * src/bison.simple (YYSIZE_T): Do not define merely because
13747 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
13748 On some platforms, <alloca.h> does not declare YYSTD (size_t).
13749
13750 2002-01-27 Akim Demaille <akim@epita.fr>
13751
13752 Fix `%nonassoc and eof'.
13753
13754 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
13755 which were not properly copied! Replace
13756 memcpy (res->errs, src->errs, src->nerrs);
13757 with
13758 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
13759 !!!
13760 * tests/regression.at (%nonassoc and eof): Adjust to newest
13761 Autotest: `.' is not in the PATH.
13762
13763 2002-01-27 Akim Demaille <akim@epita.fr>
13764
13765 * tests/sets.at (AT_EXTRACT_SETS): New.
13766 (Nullable): Use it.
13767 (Firsts): New.
13768
13769 2002-01-26 Akim Demaille <akim@epita.fr>
13770
13771 * tests/actions.at, tests/calc.at, tests/headers.at,
13772 * tests/torture.at: Adjust to the newest Autotest which no longer
13773 forces `.' in the PATH.
13774
13775 2002-01-25 Akim Demaille <akim@epita.fr>
13776
13777 * tests/regression.at (%nonassoc and eof): New.
13778 Suggested by Robert Anisko.
13779
13780 2002-01-24 Akim Demaille <akim@epita.fr>
13781
13782 Bison dumps core when trying to complain about broken input files.
13783 Reported by Cris van Pelt.
13784
13785 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
13786 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
13787 into...
13788 (Invalid inputs): Strengthen: exercise parse_percent_token.
13789
13790 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
13791
13792 * src/Makefile.am: Add bison.c++.
13793 * src/bison.c++: New skeleton.
13794
13795 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
13796
13797 * po/it.po: New.
13798
13799 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
13800
13801 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
13802
13803 2002-01-20 Marc Autret <marc@gnu.org>
13804
13805 * src/files.c (compute_output_file_names): Fix
13806
13807 2002-01-20 Marc Autret <marc@gnu.org>
13808
13809 * tests/output.at: New test.
13810 * src/files.c (compute_base_names): Don't map extensions when
13811 the YACC flag is set, use defaults.
13812 Reported by Evgeny Stambulchik.
13813
13814 2002-01-20 Marc Autret <marc@gnu.org>
13815
13816 * src/system.h: Need to define __attribute__ away for non-GCC
13817 compilers as well (i.e., the vendor C compiler).
13818 Suggested by Albert Chin-A-Young.
13819
13820 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
13821
13822 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
13823 canonical definition.
13824 * src/system.h: Use the canonical definition for PARAMS (avoids
13825 a conflict with the macro from lib/hash.h).
13826
13827 2002-01-11 Akim Demaille <akim@epita.fr>
13828
13829 * configure.in: Use AC_FUNC_STRNLEN.
13830 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
13831
13832 2002-01-09 Akim Demaille <akim@epita.fr>
13833
13834 * src/files.c, src/files.h (output_infix): New.
13835 (tab_extension): Remove.
13836 (compute_base_names): Compute the former, drop the latter.
13837 * src/output.c (prepare): Insert the muscles `output-infix', and
13838 `output-suffix'.
13839 * src/parse-skel.y (string, string.1): New.
13840 (section.header): Use it.
13841 (section.yacc): Remove.
13842 (prefix): Remove too.
13843 * src/scan-skel.l: Adjust.
13844 * src/bison.simple, src/bison.hairy: Adjust.
13845
13846 2002-01-09 Akim Demaille <akim@epita.fr>
13847
13848 * configure.in (WERROR_CFLAGS): Compute it.
13849 * src/Makefile.am (CFLAGS): Pass it.
13850 * tests/atlocal.in (CFLAGS): Idem.
13851 * src/files.c: Fix a few warnings.
13852 (get_extension_index): Remove, unused.
13853
13854 2002-01-08 Akim Demaille <akim@epita.fr>
13855
13856 * src/getargs.c (AS_FILE_NAME): New.
13857 (getargs): Use it to convert DOSish file names.
13858 * src/files.c (base_name): Rename as full_base_name to avoid
13859 clashes with `base_name ()'.
13860 (filename_split): New.
13861 (compute_base_names): N-th rewrite, using filename_split.
13862
13863 2002-01-08 Akim Demaille <akim@epita.fr>
13864
13865 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
13866 New, stolen from the Fileutils 4.1.
13867 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13868 * configure.in: Check for the presence of memrchr, and of its
13869 prototype.
13870
13871 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
13872
13873 * lib/hash.h (__P): Added definition for this macro.
13874 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
13875 BUILT_SOURCES, to ensure they are generated first.
13876 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
13877 %error-verbose to allow bootstrapping with bison 1.30x.
13878
13879 2002-01-06 Akim Demaille <akim@epita.fr>
13880
13881 * src/reader.c (parse_braces): Don't fetch the next char, the
13882 convention is to fetch on entry.
13883 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
13884 'switch' without a following semicolon.
13885 * tests/regression.at (braces parsing): New.
13886
13887 2002-01-06 Akim Demaille <akim@epita.fr>
13888
13889 Bison is dead wrong in its RR conflict reports.
13890
13891 * tests/torture.at (GNU Cim Grammar): New.
13892 * src/conflicts.c (count_rr_conflicts): Fix.
13893
13894 2002-01-06 Akim Demaille <akim@epita.fr>
13895
13896 Creating package.m4 from configure.ac causes too many problems.
13897
13898 * tests/Makefile.am (package.m4): Create it by hand,
13899 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
13900
13901 2002-01-06 Akim Demaille <akim@epita.fr>
13902
13903 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
13904 skeleton.h.
13905
13906 2002-01-04 Paul Eggert <eggert@twinsun.com>
13907
13908 * doc/bison.texinfo (Debugging):
13909 Remove YYSTDERR; it's no longer defined or used.
13910 Also, s/cstdio.h/cstdio/.
13911
13912 2002-01-03 Akim Demaille <akim@epita.fr>
13913
13914 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
13915
13916 2002-01-03 Akim Demaille <akim@epita.fr>
13917
13918 * src/parse-skel.y (process_skeleton): Don't bind the parser's
13919 tracing code to --trace, wait for a better --trace option, with
13920 args.
13921
13922 2002-01-03 Akim Demaille <akim@epita.fr>
13923
13924 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
13925 The ISO C++ standard is extremely clear about it: stderr is
13926 considered a macro, not a regular symbol (see table 94 `Header
13927 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
13928 Therefore std:: does not apply to it. It still does with fprintf.
13929 Also, s/cstdio.h/cstdio/.
13930
13931 2002-01-03 Akim Demaille <akim@epita.fr>
13932
13933 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
13934 for non system headers.
13935
13936 2002-01-02 Akim Demaille <akim@epita.fr>
13937
13938 Equip the skeleton chain with location tracking, runtime trace,
13939 pure parser and scanner.
13940
13941 * src/parse-skel.y: Request a pure parser, locations, and prefix
13942 renaming.
13943 (%union): Having several members with the same type does not help
13944 type mismatches, simplify.
13945 (YYPRINT, yyprint): New.
13946 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
13947 (skel_error): this.
13948 Handle locations.
13949 * src/scan-skel.l: Adjust to these changes.
13950 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
13951 (LOCATION_PRINT, skel_control_t): New.
13952
13953 2001-12-30 Akim Demaille <akim@epita.fr>
13954
13955 * src/parse-skel.y: Get rid of the shift/reduce conflict:
13956 replace `gb' with BLANKS.
13957 * src/scan-skel.l: Adjust.
13958
13959 2001-12-30 Akim Demaille <akim@epita.fr>
13960
13961 * src/system.h: We don't need nor want bcopy.
13962 Throw away MS-DOS crap: we don't need getpid.
13963 * configure.in: We don't need strndup. It was even causing
13964 problems: because Flex includes the headers *before* us,
13965 _GNU_SOURCE is not defined by config.h, and therefore strndup was
13966 not visible.
13967 * lib/xstrndup.c: New.
13968 * src/scan-skel.l: Use it.
13969 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
13970 * src/parse-skel.y: Use %directives instead of #defines.
13971
13972 2001-12-30 Akim Demaille <akim@epita.fr>
13973
13974 * src/skeleton.h: New.
13975 * src/output.c (output_parser, output_master_parser): Remove, dead
13976 code.
13977 * src/output.h (get_lines_number, actions_output, guards_output)
13978 (token_definitions_output): Prototype them.
13979 * src/parse-skel.y: Add the license notice.
13980 Include output.h and skeleton.h.
13981 (process_skeleton): Returns void, and takes a single parameter.
13982 * src/scan-skel.l: Add the license notice.
13983 Include skeleton.h.
13984 Don't use %option yylineno: it seems that then Flex imagines
13985 REJECT has been used, and therefore it won't reallocate its
13986 buffers (which makes no other sense to me than a bug). It results
13987 in warnings for `unused: yy_flex_realloc'.
13988
13989 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
13990
13991 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13992 (MUSCLE_INSERT_PREFIX): ...to there.
13993 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13994 (MUSCLE_INSERT_PREFIX): Move from here...
13995
13996 * src/bison.hairy: Add a section directive. Put braces around muscle
13997 names. This parser skeleton is still broken, but Bison should not
13998 choke on a bad muscle 'syntax'.
13999 * src/bison.simple: Add a section directive. Put braces around muscle
14000 names.
14001
14002 * src/files.h (strsuffix, stringappend): Add declarations.
14003 (tab_extension): Add declaration.
14004 (short_base_name): Add declaration.
14005
14006 * src/files.c (strsuffix, stringappend): No longer static. These
14007 functions are used in the skeleton parser.
14008 (tab_extension): New.
14009 (compute_base_names): Use the computations done in this function
14010 to guess if the generated parsers should have '.tab' in their
14011 names.
14012 (short_base_name): No longer static.
14013
14014 * src/output.c (output_skeleton): New.
14015 (output): Disable call to output_master_parser, and give a try to
14016 a new skeleton handling system.
14017 (guards_output, actions_output): No longer static.
14018 (token_definitions_output, get_lines_number): No longer static.
14019
14020 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
14021
14022 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
14023 parse-skel.y.
14024
14025 * src/parse-skel.y: New file.
14026 * src/scan-skel.l: New file.
14027
14028 2001-12-29 Akim Demaille <akim@epita.fr>
14029
14030 %name-prefix is broken.
14031
14032 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
14033 Adjust all dependencies.
14034 * tests/headers.at (export YYLTYPE): Strengthen this test: use
14035 %name-prefix.
14036
14037 Renaming yylval but not yylloc is not consistent. Now we do.
14038
14039 * src/bison.simple: Prefix yylloc if used.
14040 * doc/bison.texinfo (Decl Summary): Document that.
14041
14042 2001-12-29 Akim Demaille <akim@epita.fr>
14043
14044 * doc/bison.texinfo: Promote `%long-directive' over
14045 `%long_directive'.
14046 Remove all references to fixed-output-files, yacc is enough.
14047
14048 2001-12-29 Akim Demaille <akim@epita.fr>
14049
14050 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
14051 user prologue. These are defaults.
14052 * tests/actions.at (Mid-rule actions): Make sure the user can
14053 define YYDEBUG and YYERROR_VERBOSE.
14054
14055 2001-12-29 Akim Demaille <akim@epita.fr>
14056
14057 * src/output.c (header_output): Don't forget to export YYLTYPE and
14058 yylloc.
14059 * tests/headers.at (export YYLTYPE): New, make sure it does.
14060 * tests/regression.at (%union and --defines, Invalid CPP headers):
14061 Move to...
14062 * tests/headers.at: here.
14063
14064 2001-12-29 Akim Demaille <akim@epita.fr>
14065
14066 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
14067
14068 2001-12-29 Akim Demaille <akim@epita.fr>
14069
14070 * tests/actions.at (Mid-rule actions): Output on a single line
14071 instead of several.
14072
14073 2001-12-29 Akim Demaille <akim@epita.fr>
14074
14075 * doc/bison.texinfo: Formatting changes.
14076
14077 2001-12-29 Akim Demaille <akim@epita.fr>
14078
14079 Don't store the token defs in a muscle, just be ready to output it
14080 on command. Now possible via `symbols'. Fixes a memory leak.
14081
14082 * src/output.c (token_definitions_output): New.
14083 (output_parser, header_output): Use it.
14084 * src/reader.c (symbols_save): Remove.
14085
14086 2001-12-29 Akim Demaille <akim@epita.fr>
14087
14088 * src/bison.simple: Do not provide a default for YYSTYPE and
14089 YYLTYPE before the user's prologue. Otherwise it's hardly... a
14090 default.
14091
14092 2001-12-29 Akim Demaille <akim@epita.fr>
14093
14094 Mid-rule actions are simply... ignored!
14095
14096 * src/reader.c (readgram): Be sure to attach mid-rule actions to
14097 the empty-rule associated to the dummy symbol, not to the host
14098 rule.
14099 * tests/actions.at (Mid-rule actions): New.
14100
14101 2001-12-29 Akim Demaille <akim@epita.fr>
14102
14103 Memory leak.
14104
14105 * src/reader.c (reader): Free grammar.
14106
14107 2001-12-29 Akim Demaille <akim@epita.fr>
14108
14109 Memory leak.
14110
14111 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
14112 since it allocates it for each state, although only one is needed.
14113 (allocate_storage): Do it here.
14114
14115 2001-12-29 Akim Demaille <akim@epita.fr>
14116
14117 * src/options.h, src/options.c (create_long_option_table): Rename
14118 as...
14119 (long_option_table_new): this, with a clearer prototype.
14120 (percent_table): Remove, unused,
14121 * src/getargs.c (getargs): Adjust.
14122
14123 2001-12-29 Akim Demaille <akim@epita.fr>
14124
14125 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
14126 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
14127 as states.
14128
14129 2001-12-29 Akim Demaille <akim@epita.fr>
14130
14131 * src/lalr.c (build_relations): Rename `states' as `states1'.
14132 Sorry, I don't understand exactly what it is, no better name...
14133
14134 2001-12-29 Akim Demaille <akim@epita.fr>
14135
14136 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
14137 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
14138 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
14139 as rules.
14140
14141 2001-12-29 Akim Demaille <akim@epita.fr>
14142
14143 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
14144 ago.
14145
14146 2001-12-29 Akim Demaille <akim@epita.fr>
14147
14148 * src/reader.c, src/reader.h (user_toknums): Remove.
14149 Adjust all users to use symbols[i]->user_token_number.
14150
14151 2001-12-29 Akim Demaille <akim@epita.fr>
14152
14153 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
14154 Adjust all users to use symbols[i]->prec or ->assoc.
14155
14156 2001-12-29 Akim Demaille <akim@epita.fr>
14157
14158 * src/reader.c, src/reader.h (tags): Remove.
14159 Adjust all users to use symbols[i]->tag.
14160
14161 2001-12-29 Akim Demaille <akim@epita.fr>
14162
14163 * src/gram.h, src/gram.c (symbols): New, similar to state_table
14164 and rule_table.
14165 * src/reader.c (packsymbols): Fill this table.
14166 Drop sprec.
14167 * src/conflicts.c (resolve_sr_conflict): Adjust.
14168 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
14169 single table.
14170 Use symbols[i]->tag instead of tags[i].
14171
14172 2001-12-29 Akim Demaille <akim@epita.fr>
14173
14174 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
14175 In addition, put a comment in there, to replace...
14176 * tests/regression.at (%union and C comments): Remove.
14177
14178 2001-12-29 Akim Demaille <akim@epita.fr>
14179
14180 * tests/regression.at (Web2c Actions): Blindly move the actual
14181 output as expected output. The contents *seem* right to me, but I
14182 can't pretend reading perfectly parser tables... Nonetheless, all
14183 the other tests pass correctly, the table look OK, even though the
14184 presence of `$axiom' is to be noted: AFAICS it is useless (but
14185 harmless).
14186
14187 2001-12-29 Akim Demaille <akim@epita.fr>
14188
14189 * src/reader.c (readgram): Don't add the rule 0 if there were no
14190 rules read. In other words, add it _after_ having performed
14191 grammar sanity checks.
14192 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
14193
14194 2001-12-29 Akim Demaille <akim@epita.fr>
14195
14196 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
14197 visible, and some states have now a different number.
14198
14199 2001-12-29 Akim Demaille <akim@epita.fr>
14200
14201 * src/reader.c (readgram): Bind the initial rule's lineno to that
14202 of the first rule.
14203 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
14204 (Solved SR Conflicts): Adjust rule 0's line number.
14205
14206 2001-12-29 Akim Demaille <akim@epita.fr>
14207
14208 Fix the `GAWK Grammar' failure.
14209
14210 * src/LR0.c (final_state): Initialize to -1 so that we do compute
14211 the reductions of the first state which was mistakenly confused
14212 with the final state because precisely final_state was initialized
14213 to 0.
14214 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
14215 now noticed by Bison.
14216 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
14217 have a reduction on $default.
14218
14219 2001-12-29 Akim Demaille <akim@epita.fr>
14220
14221 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
14222 rule line numbers.
14223 * src/closure.c (print_closure): Likewise.
14224 * src/derives.c (print_derives): Likewise.
14225 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
14226 now.
14227
14228 2001-12-29 Akim Demaille <akim@epita.fr>
14229
14230 * src/lalr.c (lookaheads_print): New.
14231 (lalr): Call it when --trace-flag.
14232 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
14233 are dumped.
14234
14235 2001-12-29 Akim Demaille <akim@epita.fr>
14236
14237 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
14238 when walking through ritem, even via rule->rhs.
14239 * src/reduce.c (dump_grammar, useful_production, reduce_output)
14240 (useful_production, useless_nonterminals): Likewise.
14241 (reduce_grammar_tables): Likewise, plus update nritems.
14242 * src/nullable.c (set_nullable): Likewise.
14243 * src/lalr.c (build_relations): Likewise.
14244 * tests/sets.at (Nullable): Adjust.
14245 Fortunately, now, the $axiom is no longer nullable.
14246
14247 2001-12-29 Akim Demaille <akim@epita.fr>
14248
14249 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
14250 the 0-sentinel.
14251 * src/gram.c (ritem_longest_rhs): Likewise.
14252 * src/reduce.c (nonterminals_reduce): Likewise.
14253 * src/print_graph.c (print_graph): Likewise.
14254 * src/output.c (output_rule_data): Likewise.
14255 * src/nullable.c (set_nullable): Likewise.
14256
14257 2001-12-29 Akim Demaille <akim@epita.fr>
14258
14259 * src/output.c: Comment changes.
14260
14261 2001-12-27 Paul Eggert <eggert@twinsun.com>
14262
14263 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
14264 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
14265 Sparc, as they were causing more porting problems than the
14266 (minor) performance improvement was worth.
14267
14268 Also, catch up with 1.31's YYSTD.
14269
14270 2001-12-27 Akim Demaille <akim@epita.fr>
14271
14272 * src/output.c (output_gram): Rely on nritems, not the
14273 0-sentinel. See below.
14274 Use -1 as separator, not 0.
14275 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
14276 Rely on -1 as separator in yyrhs, instead of 0.
14277 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
14278 twice `Now at end of input', therefore there are two lines less to
14279 expect.
14280
14281 2001-12-27 Akim Demaille <akim@epita.fr>
14282
14283 * tests/regression.at (Unresolved SR Conflicts):
14284 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
14285 below.
14286
14287 2001-12-27 Akim Demaille <akim@epita.fr>
14288
14289 * src/LR0.c (new_state): Recognize the final state by the fact it
14290 is reached by eoftoken.
14291 (insert_start_shifting_state, insert_eof_shifting_state)
14292 (insert_accepting_state, augment_automaton): Remove, since now
14293 these states are automatically computed from the initial state.
14294 (generate_states): Adjust.
14295 * src/print.c: When reporting a rule number to the user, substract
14296 1, so that the axiom rule is rule 0, and the first user rule is 1.
14297 * src/reduce.c: Likewise.
14298 * src/print_graph.c (print_core): For the time being, just as for
14299 the report, depend upon --trace-flags to dump the full set of
14300 items.
14301 * src/reader.c (readgram): Once the grammar read, insert the rule
14302 0: `$axiom: START-SYMBOL $'.
14303 * tests/set.at: Adjust: rule 0 is now displayed, and since the
14304 number of the states has changed (the final state is no longer
14305 necessarily the last), catch up.
14306
14307 2001-12-27 Akim Demaille <akim@epita.fr>
14308
14309 Try to make the use of the eoftoken valid. Given that its value
14310 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
14311 is used instead of > 0 where appropriate, (ii), depend upon nritems
14312 instead of the 0-sentinel.
14313
14314 * src/gram.h, src/gram.c (nritems): New.
14315 Expected to be duplication of nitems, but for the time being...
14316 * src/reader.c (packgram): Assert nritems and nitems are equal.
14317 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
14318 * src/closure.c (print_closure, print_fderives): Likewise.
14319 * src/gram.c (ritem_print): Likewise.
14320 * src/print.c (print_core, print_grammar): Likewise.
14321 * src/print_graph.c: Likewise.
14322
14323 2001-12-27 Akim Demaille <akim@epita.fr>
14324
14325 * src/main.c (main): If there are complains after grammar
14326 reductions, then output the report anyway if requested, then die.
14327 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
14328 * src/reader.c (eoftoken): New.
14329 (parse_token_decl): If the token being defined has value `0', it
14330 is the eoftoken.
14331 (packsymbols): No longer hack `tags' to insert `$' by hand.
14332 Be sure to preserve the value of the eoftoken.
14333 (reader): Make sure eoftoken is defined.
14334 Initialize nsyms to 0: now eoftoken is created just like the others.
14335 * src/print.c (print_grammar): Don't special case the eof token.
14336 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
14337 lie anyway, albeit pleasant.
14338 * tests/calc.at: Exercise error messages with eoftoken.
14339 Change the grammar so that empty input is invalid.
14340 Adjust expectations.
14341 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
14342
14343 2001-12-27 Akim Demaille <akim@epita.fr>
14344
14345 * configure.in: Check the protos of strchr ans strspn.
14346 Replace strchr if needed.
14347 * src/system.h: Provide the protos of strchr, strspn and memchr if
14348 missing.
14349 * lib/strchr.c: New.
14350 * src/reader.c (symbols_save): Use strchr.
14351
14352 2001-12-27 Akim Demaille <akim@epita.fr>
14353
14354 * src/print.c, src/print_graph.c (escape): New.
14355 Use it to quote the TAGS outputs.
14356 * src/print_graph.c (print_state): Now errors are in red, and
14357 reductions in green.
14358 Prefer high to wide: output the state number on a line of its own.
14359
14360 2001-12-27 Akim Demaille <akim@epita.fr>
14361
14362 * src/state.h, src/state.c (reductions_new): New.
14363 * src/LR0.c (set_state_table): Let all the states have a
14364 `reductions', even if reduced to 0.
14365 (save_reductions): Adjust.
14366 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
14367 * src/print.c (print_reductions, print_actions): Adjust.
14368 * src/output.c (action_row): Adjust.
14369
14370 2001-12-27 Akim Demaille <akim@epita.fr>
14371
14372 * src/state.h, src/state.c (errs_new, errs_dup): New.
14373 * src/LR0.c (set_state_table): Let all the states have an errs,
14374 even if reduced to 0.
14375 * src/print.c (print_errs, print_reductions): Adjust.
14376 * src/output.c (output_actions, action_row): Adjust.
14377 * src/conflicts.c (resolve_sr_conflict): Adjust.
14378
14379 2001-12-27 Akim Demaille <akim@epita.fr>
14380
14381 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
14382
14383 2001-12-27 Akim Demaille <akim@epita.fr>
14384
14385 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
14386 * src/print.c: here.
14387 (lookaheadset, shiftset): New, used as additional storage by
14388 print_reductions.
14389 (print_results): Adjust.
14390 (print_shifts, print_gotos, print_errs): New, extracted from...
14391 (print_actions): here.
14392 * src/print_graph.c (print_actions): Remove dead code.
14393
14394 2001-12-27 Akim Demaille <akim@epita.fr>
14395
14396 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
14397 `$n' and `@n'.
14398
14399 2001-12-27 Akim Demaille <akim@epita.fr>
14400
14401 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
14402 (build_relations): Adjust.
14403
14404 2001-12-27 Akim Demaille <akim@epita.fr>
14405
14406 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
14407 duplication.
14408
14409 2001-12-27 Akim Demaille <akim@epita.fr>
14410
14411 * src/reader.c (packgram): Catch nitems overflows.
14412
14413 2001-12-27 Akim Demaille <akim@epita.fr>
14414
14415 * src/files.c, src/files.h (guard_obstack): Remove.
14416 * src/output.c (output): Adjust.
14417 * src/reader.c (parse_braces): New, factoring...
14418 (copy_action, copy_guard): these two which are renamed as...
14419 (parse_action, parse_guard): these.
14420 As a voluntary consequence, using braces around guards is now
14421 mandatory.
14422
14423 2001-12-27 Akim Demaille <akim@epita.fr>
14424
14425 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
14426 * src/reader.c (symbol_list): `guard' and `guard_line' are new
14427 members.
14428 (symbol_list_new): Adjust.
14429 (copy_action): action_line is the first line, not the last.
14430 (copy_guard): Just as for actions, store the `action' only, not
14431 the switch/case/break flesh.
14432 Don't parse the user action that might follow the guard, let...
14433 (readgram): do it, i.e., now, there can be an action after a
14434 guard.
14435 In other words the guard is just explicitly optional.
14436 (packgram): Adjust.
14437 * src/output.c (guards_output): New.
14438 (output_parser): Call it when needed.
14439 (output): Also free the guard and attrs obstacks.
14440 * src/files.c, src/files.h (obstack_save): Remove.
14441 (output_files): Remove.
14442 As a result, if one needs the former `.act' file, using an
14443 appropriate skeleton which requires actions and guards is now
14444 required.
14445 * src/main.c (main): Adjust.
14446 * tests/semantic.at: New.
14447 * tests/regression.at: Use `input.y' as input file name.
14448 Avoid 8+3 problems by requiring input.c when the test needs the
14449 parser.
14450
14451 2001-12-27 Akim Demaille <akim@epita.fr>
14452
14453 * src/reader.c (symbol_list_new): Be sure to initialize all the
14454 fields.
14455
14456 2001-12-27 Akim Demaille <akim@epita.fr>
14457
14458 All the hacks using a final pseudo state are now useless.
14459
14460 * src/LR0.c (set_state_table): state_table holds exactly nstates.
14461 * src/lalr.c (nLA): New.
14462 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
14463 instead of lookaheadsp from the pseudo state (nstate + 1).
14464
14465 2001-12-27 Akim Demaille <akim@epita.fr>
14466
14467 * src/output.c (action_row, token_actions): Use a state_t instead
14468 of a integer, and nlookaheads instead of the following state's
14469 lookaheadsp.
14470
14471 2001-12-27 Akim Demaille <akim@epita.fr>
14472
14473 * src/conflicts.c (log_resolution, flush_shift)
14474 (resolve_sr_conflict, set_conflicts, solve_conflicts)
14475 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
14476 (conflicts_print, print_reductions): Use a state_t instead of an
14477 integer when referring to a state.
14478 As much as possible, depend upon nlookaheads, instead of the
14479 `lookaheadsp' member of the following state (since lookaheads of
14480 successive states are successive, the difference between state n + 1
14481 and n served as the number of lookaheads for state n).
14482 * src/lalr.c (add_lookback_edge): Likewise.
14483 * src/print.c (print_core, print_actions, print_state)
14484 (print_results): Likewise.
14485 * src/print_graph.c (print_core, print_actions, print_state)
14486 (print_graph): Likewise.
14487 * src/conflicts.h: Adjust.
14488
14489 2001-12-27 Akim Demaille <akim@epita.fr>
14490
14491 * src/bison.hairy: Formatting/comment changes.
14492 ANSIfy.
14493 Remove `register' indications.
14494 Add plenty of `static'.
14495
14496 2001-12-27 Akim Demaille <akim@epita.fr>
14497
14498 * src/output.c (prepare): Drop the muscle `ntbase' which
14499 duplicates ntokens.
14500 * src/bison.simple: Formatting/comment changes.
14501 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
14502 is an undocumented synonym.
14503
14504 2001-12-22 Akim Demaille <akim@epita.fr>
14505
14506 * src/output.c (output_table_data): Change the prototype to use
14507 `int' for array ranges: some invocations do pass an int, not a
14508 short.
14509 Reported by Wayne Green.
14510
14511 2001-12-22 Akim Demaille <akim@epita.fr>
14512
14513 Some actions of web2c.y are improperly triggered.
14514 Reported by Mike Castle.
14515
14516 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
14517 * tests/regression.at (Web2c): Rename as...
14518 (Web2c Report): this.
14519 (Web2c Actions): New.
14520
14521 2001-12-22 Akim Demaille <akim@epita.fr>
14522
14523 Reductions in web2c.y are improperly reported.
14524 Reported by Mike Castle.
14525
14526 * src/conflicts.c (print_reductions): Fix.
14527 * tests/regression.at (Web2c): New.
14528
14529 2001-12-18 Akim Demaille <akim@epita.fr>
14530
14531 Some host fail on `assert (!"foo")', which expands to
14532 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
14533 Reported by Nelson Beebee.
14534
14535 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
14536 `#define it_succeeded 0' and `assert (it_succeeded)'.
14537
14538 2001-12-17 Marc Autret <autret_m@epita.fr>
14539
14540 * src/bison.simple: Don't hard code the skeleton line and filename.
14541 * src/output.c (output_parser): Rename 'line' as 'output_line'.
14542 New line counter 'skeleton_line' (skeleton-line muscle).
14543
14544 2001-12-17 Paul Eggert <eggert@twinsun.com>
14545
14546 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
14547 YYDEBUG must be defined to a nonzero value.
14548
14549 * src/bison.simple (yytname): Do not assume that the user defines
14550 YYDEBUG to a properly parenthesized expression.
14551
14552 2001-12-17 Akim Demaille <akim@epita.fr>
14553
14554 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
14555 nlookaheads is a new member.
14556 Adjust all users.
14557 * src/lalr.h (nlookaheads): Remove this orphan declaration.
14558 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
14559 state.
14560
14561 2001-12-17 Akim Demaille <akim@epita.fr>
14562
14563 * src/files.h, src/files.c (open_files, close_files): Remove.
14564 * src/main.c (main): Don't open/close files, nor invoke lex_free,
14565 let...
14566 * src/reader.c (reader): Do it.
14567
14568 2001-12-17 Akim Demaille <akim@epita.fr>
14569
14570 * src/conflicts.c (print_reductions): Formatting changes.
14571
14572 2001-12-17 Akim Demaille <akim@epita.fr>
14573
14574 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
14575 (flush_reduce): New.
14576 (resolve_sr_conflict): Adjust.
14577
14578 2001-12-17 Akim Demaille <akim@epita.fr>
14579
14580 * src/output.c (output_obstack): Be static and rename as...
14581 (format_obstack): this, to avoid any confusion with files.c's
14582 output_obstack.
14583 * src/reader.h (muscle_obstack): Move to...
14584 * src/output.h: here, since it's defined in output.c.
14585
14586 2001-12-17 Akim Demaille <akim@epita.fr>
14587
14588 * src/output.c (action_row, save_column, default_goto)
14589 (sort_actions, matching_state, pack_vector): Better variable
14590 locality.
14591
14592 2001-12-17 Akim Demaille <akim@epita.fr>
14593
14594 * src/output.c: Various formatting changes.
14595
14596 2001-12-17 Akim Demaille <akim@epita.fr>
14597
14598 * src/files.c (output_files): Free the output_obstack.
14599 * src/main.c (main): Call print and print_graph conditionally.
14600 * src/print.c (print): Work unconditionally.
14601 * src/print_graph.c (print_graph): Work unconditionally.
14602 * src/conflicts.c (log_resolution): Output only if verbose_flag.
14603
14604 2001-12-16 Marc Autret <autret_m@epita.fr>
14605
14606 * src/output.c (actions_output): Fix. When we use %no-lines,
14607 there is one less line per action.
14608
14609 2001-12-16 Marc Autret <autret_m@epita.fr>
14610
14611 * src/bison.simple: Remove a useless #line directive.
14612 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
14613 * src/output.c (get_lines_number): New.
14614 (output_parser): Adjust, now takes care about the lines of a
14615 output muscles.
14616 Fix line numbering.
14617 (actions_output): Computes the number of lines taken by actions.
14618 (output_master_parser): Insert new skeleton which is the name of
14619 the output parser file name.
14620
14621 2001-12-15 Marc Autret <autret_m@epita.fr>
14622
14623 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
14624
14625 2001-12-15 Marc Autret <autret_m@epita.fr>
14626
14627 * src/output.c (output_gram): Keep track of the hairy one.
14628
14629 2001-12-15 Akim Demaille <akim@epita.fr>
14630
14631 Make `make distcheck' work.
14632
14633 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
14634 system.h which uses libgettext.h.
14635
14636 2001-12-15 Akim Demaille <akim@epita.fr>
14637
14638 * src/nullable.c (set_nullable): Useless rules must be skipped,
14639 otherwise, since we range over their symbols, we might look at a
14640 nonterminal which no longer ``exists'', i.e., it is not counted in
14641 `nvars', hence we overflow our arrays.
14642
14643 2001-12-15 Akim Demaille <akim@epita.fr>
14644
14645 The header can also be produced directly, without any obstack!
14646 Yahoo!
14647
14648 * src/files.c, src/files.h (defines_obstack): Remove.
14649 (compute_header_macro): Global.
14650 (defines_obstack_save): Remove.
14651 * src/reader.c (parse_union_decl): No longer output to
14652 defines_obstack: its content can be found in the `stype' muscle
14653 anyway.
14654 (output_token_translations): Merge into...
14655 (symbols_output): this.
14656 Rename as...
14657 (symbols_save): this.
14658 (reader): Adjust.
14659 * src/output.c (header_output): New.
14660 (output): Call it.
14661
14662 2001-12-15 Akim Demaille <akim@epita.fr>
14663
14664 * src/reader.c (parse_union_decl): Instead of handling two obstack
14665 simultaneously, use one to define the `stype' muscle, and use the
14666 value of the latter to fill defines_obstack.
14667 (copy_comment): Remove.
14668 (copy_comment2): Work for a single obstack.
14669 Rename as...
14670 (copy_comment): this.
14671
14672 2001-12-15 Akim Demaille <akim@epita.fr>
14673
14674 * src/lex.c, src/lex.h (xgetc): No longer static.
14675 * src/reader.c (parse_union_decl): Revamp.
14676
14677 2001-12-15 Akim Demaille <akim@epita.fr>
14678
14679 Still making progress in separating Bison into (i) input, (ii)
14680 process, (iii) output: now we can directly output the parser file
14681 without using table_obstack at all.
14682
14683 * src/files.c, src/files.h (table_obstack): Bye bye.
14684 (parser_file_name): New.
14685 * src/files.c (compute_output_file_names): Compute it.
14686 * src/output.c (actions_output, output_parser)
14687 (output_master_parser): To a file instead of an obstack.
14688
14689 2001-12-15 Akim Demaille <akim@epita.fr>
14690
14691 Attach actions to rules, instead of pre-outputting them to
14692 actions_obstack.
14693
14694 * src/gram.h (rule_t): action and action_line are new members.
14695 * src/reader.c (symbol_list): Likewise.
14696 (copy_action): Save the actions within the rule.
14697 (packgram): Save them in rule_table.
14698 * src/output.c (actions_output): New.
14699 (output_parser): Use it on `%%actions'.
14700 (output_rule_data): Don't free rule_table.
14701 (output): Do it.
14702 (prepare): Don't save the `action' muscle.
14703 * src/bison.simple: s/%%action/%%actions/.
14704
14705 2001-12-15 Akim Demaille <akim@epita.fr>
14706
14707 * src/reader.c (copy_action): When --yacc, don't append a `;'
14708 to the user action: let it fail if lacking.
14709 Suggested by Arnold Robbins and Tom Tromey.
14710
14711 2001-12-14 Akim Demaille <akim@epita.fr>
14712
14713 * src/lex.c (literalchar): Simply return the char you decoded, non
14714 longer mess around with obstacks and int pointers.
14715 Adjust all callers.
14716
14717 2001-12-14 Akim Demaille <akim@epita.fr>
14718
14719 * src/lex.c (literalchar): Don't escape the special characters,
14720 just decode them, and keep them as char (before, eol was output as
14721 the 2 char string `\n' etc.).
14722 * src/output.c (output_rule_data): Use quotearg to output the
14723 token strings.
14724
14725 2001-12-13 Paul Eggert <eggert@twinsun.com>
14726
14727 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
14728 Do not infringe on the global user namespace when using C++.
14729 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
14730 All uses of `fprintf' and `stderr' changed.
14731
14732 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
14733
14734 2001-12-13 Akim Demaille <akim@epita.fr>
14735
14736 The computation of nullable is broken: it doesn't handle empty
14737 RHS's properly.
14738
14739 * tests/torture.at (GNU AWK Grammar): New.
14740 * tests/sets.at (Nullable): New.
14741 * src/nullable.c (set_nullable): Instead of blindly looping over
14742 `ritems', loop over the rules, and then over their rhs's.
14743
14744 Work around Autotest bugs.
14745
14746 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
14747 frame, because Autotest understand lines starting with a `+' as
14748 traces from the shell. Then, they are not processed properly.
14749 Admittedly an Autotest bug, but we don't have time to wait for
14750 Autotest to catch up.
14751 * tests/regression.at (Broken Closure): Adjust to the new table
14752 frames.
14753 Move to...
14754 * tests/sets.at: here.
14755
14756 2001-12-13 Akim Demaille <akim@epita.fr>
14757
14758 * src/closure.c (closure): Use nrules instead of playing tricks
14759 with BITS_PER_WORD.
14760
14761 2001-12-13 Akim Demaille <akim@epita.fr>
14762
14763 * src/print.c (print_actions): Output the handling of `$' as the
14764 traces do: shifting the token EOF. Before EOF was treated as a
14765 nonterminal.
14766 * tests/regression.at: Adjust some tests.
14767 * src/print_graph.c (print_core): Complete the set of items via
14768 closure. The next-to-final and final states are still unsatisfying,
14769 but that's to be addressed elsewhere.
14770 No longer output the rule numbers, but do output the state number.
14771 A single loop for the shifts + gotos is enough, but picked a
14772 distinct color for each.
14773 (print_graph): Initialize and finalize closure.
14774
14775 2001-12-13 Akim Demaille <akim@epita.fr>
14776
14777 * src/reader.c (readgram): Remove dead code, an strip useless
14778 braces.
14779 (get_type): Remove, unused.
14780
14781 2001-12-12 Akim Demaille <akim@epita.fr>
14782
14783 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
14784 on that of lib/error.c.
14785
14786 2001-12-12 Akim Demaille <akim@epita.fr>
14787
14788 Some hosts don't like `/' in includes.
14789
14790 * src/system.h: Include libgettext.h without qualifying the path.
14791 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
14792 $(top_srcdir).
14793
14794 2001-12-11 Marc Autret <autret_m@epita.fr>
14795
14796 * src/output.c (output_parser): Remove useless muscle.
14797
14798 2001-12-11 Marc Autret <autret_m@epita.fr>
14799
14800 * src/bison.simple: Remove #line just before %%epilogue. It
14801 is now handled in ...
14802 * src/reader.c (read_additionnal_code): Add the output of a
14803 #line for the epilogue.
14804
14805 2001-12-10 Marc Autret <autret_m@epita.fr>
14806
14807 * src/reader.c (copy_definition): Re-use CPP-outed code which
14808 replace precedent remove.
14809 * src/bison.simple: Remove #line before %%prologue because
14810 %%input-line is wrong at this time.
14811
14812 2001-12-10 Marc Autret <autret_m@epita.fr>
14813
14814 * src/reader.c (symbols_output): Clean up.
14815 * src/output.c (output_gram, output): Clean up.
14816
14817 2001-12-10 Akim Demaille <akim@epita.fr>
14818
14819 * src/lalr.c (initialize_lookaheads): New. Extracted from...
14820 * src/LR0.c (set_state_table): here.
14821 * src/lalr.c (lalr): Call it.
14822
14823 2001-12-10 Akim Demaille <akim@epita.fr>
14824
14825 * src/state.h (shifts): Remove the `number' member: shifts are
14826 attached to state, hence no longer need to be labelled with a
14827 state number.
14828
14829 2001-12-10 Akim Demaille <akim@epita.fr>
14830
14831 Now that states have a complete set of members, the linked list of
14832 shifts is useless: just fill directly the state's shifts member.
14833
14834 * src/state.h (shifts): Remove the `next' member.
14835 * src/LR0.c (first_state, last_state): Remove.
14836 Adjust the callers.
14837 (augment_automaton): Don't look for the shifts that must be added
14838 a shift on EOF: it is those of the state we looked for! But now,
14839 since shifts are attached, it is no longer needed to looking
14840 merely by its id: its number.
14841
14842 2001-12-10 Akim Demaille <akim@epita.fr>
14843
14844 * src/LR0.c (augment_automaton): Better variable locality.
14845 Remove an impossible branch: if there is a state corresponding to
14846 the start symbol being shifted, then there is shift for the start
14847 symbol from the initial state.
14848
14849 2001-12-10 Akim Demaille <akim@epita.fr>
14850
14851 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
14852 only when appropriate: when insert_start_shifting_state' is not
14853 invoked.
14854 * tests/regression.at (Rule Line Numbers): Adjust.
14855
14856 2001-12-10 Akim Demaille <akim@epita.fr>
14857
14858 * src/LR0.c (augment_automaton): Now that all states have shifts,
14859 merge the two cases addition shifts to the initial state.
14860
14861 2001-12-10 Akim Demaille <akim@epita.fr>
14862
14863 * src/lalr.c (set_state_table): Move to...
14864 * src/LR0.c: here.
14865 * src/lalr.c (lalr): Don't call it...
14866 * src/LR0.c (generate_states): do it.
14867 * src/LR0.h (first_state): Remove, only the table is used.
14868
14869 2001-12-10 Akim Demaille <akim@epita.fr>
14870
14871 * src/LR0.h (first_shift, first_reduction): Remove.
14872 * src/lalr.c: Don't use first_shift: find shifts through the
14873 states.
14874
14875 2001-12-10 Akim Demaille <akim@epita.fr>
14876
14877 * src/LR0.c: Attach shifts to states as soon as they are
14878 computed.
14879 * src/lalr.c (set_state_table): Instead of assigning shifts to
14880 state, just assert that the mapping was properly done.
14881
14882 2001-12-10 Akim Demaille <akim@epita.fr>
14883
14884 * src/LR0.c (insert_start_shift): Rename as...
14885 (insert_start_shifting_state): this.
14886 (insert_eof_shifting_state, insert_accepting_state): New.
14887 (augment_automaton): Adjust.
14888 Better locality of the variables.
14889 When looking if the start_symbol is shifted from the initial
14890 state, using `while (... symbol != start_symbol ...)' sounds
14891 better than `while (... symbol < start_symbol ...)': If fail
14892 to see how the order between symbols could be relevant!
14893
14894 2001-12-10 Akim Demaille <akim@epita.fr>
14895
14896 * src/getargs.h: Don't declare `spec_name_prefix' and
14897 `spec_file_prefix', declared by src/files.h.
14898 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
14899 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
14900 * src/output.c (prepare): Adjust.
14901 * src/reader.c (symbols_output): Likewise.
14902 * src/vmsgetargs.c: Vaguely adjust, but who cares?
14903
14904 2001-12-10 Akim Demaille <akim@epita.fr>
14905
14906 * src/muscle_tab.c (muscle_init): NULL is a better default than
14907 `"0"'.
14908
14909 2001-12-10 Akim Demaille <akim@epita.fr>
14910
14911 * src/reader.c (reader): Calling symbols_output once is enough.
14912
14913 2001-12-10 Akim Demaille <akim@epita.fr>
14914
14915 Now that states have a complete set of members, the linked list of
14916 reductions is useless: just fill directly the state's reductions
14917 member.
14918
14919 * src/state.h (struct reductions): Remove member `number' and
14920 `next'.
14921 * src/LR0.c (first_reduction, last_reduction): Remove.
14922 (save_reductions): Don't link the new reductions, store them in
14923 this_state.
14924 * src/lalr.c (set_state_table): No need to attach reductions to
14925 states, it's already done.
14926 * src/output.c (output_actions): No longer free the shifts, then
14927 the reductions, then the states: free all the states and their
14928 members.
14929
14930 2001-12-10 Akim Demaille <akim@epita.fr>
14931
14932 * src/options.c (OPTN, DRTV, BOTH): New.
14933 (option_table): Use them.
14934
14935 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
14936 the job of system.h.
14937 * src/options.c: Don't include stdio.h and xalloc.h for the same
14938 reasons.
14939
14940 2001-12-10 Akim Demaille <akim@epita.fr>
14941
14942 * src/output.c (output, prepare): Make sure the values of the
14943 muscles `action' and `prologue' are 0-terminated.
14944
14945 2001-12-10 Akim Demaille <akim@epita.fr>
14946
14947 Clean up GCC warnings.
14948
14949 * src/reader.c (copy_action): `buf' is not used.
14950 (parse_skel_decl): Be static.
14951 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
14952 * src/options.h (create_long_option_table): Have a real prototype.
14953 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
14954 (hash_delete_at): Return const void *.
14955 Adjust casts to preserve the const.
14956
14957 2001-12-10 Akim Demaille <akim@epita.fr>
14958
14959 * configure.in: Require 2.52g.
14960 M4 is not needed, but AUTOM4TE is.
14961 * m4/m4.m4: Remove.
14962 * tests/Makefile.am: Adjust.
14963
14964 2001-12-10 Akim Demaille <akim@epita.fr>
14965
14966 One structure for states is enough, even though theoretically
14967 there are LR(0) states and LALR(1) states.
14968
14969 * src/lalr.h (state_t): Remove.
14970 (state_table): Be state_t **, not state_t *.
14971 * src/state.h (core, CORE_ALLOC): Rename as...
14972 (state_t, STATE_ALLOC): this.
14973 Add the LALR(1) members: shifts, reductions, errs.
14974 * src/LR0.c (state_table): Rename as...
14975 (state_hash): this, to avoid name clashes with the global
14976 `state_table'.
14977 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
14978 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
14979
14980 2001-12-10 Akim Demaille <akim@epita.fr>
14981
14982 Bison dumps core on bash.y.
14983 Reported by Pascal Bart.
14984
14985 * src/warshall.c (bitmatrix_print): New.
14986 (TC): Use it.
14987 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
14988 j must be the outer loop.
14989 * tests/regression.at (Broken Closure): New.
14990
14991 2001-12-05 Akim Demaille <akim@epita.fr>
14992
14993 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
14994 its argument.
14995 Reported by Peter Hamorsky.
14996
14997 2001-12-05 Akim Demaille <akim@epita.fr>
14998
14999 * src/conflicts.c (err_table): Remove.
15000 (resolve_sr_conflict): Adjust.
15001 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
15002 Rename as...
15003 (state_t.reductions, state_t.shifts): this.
15004
15005 2001-12-05 Akim Demaille <akim@epita.fr>
15006
15007 * src/reduce.c (reduce_grammar_tables): No longer disable the
15008 removal of useless rules via CPP but via `if (0)', so that the
15009 compiler still check the code is valid.
15010 For instance, it should have noticed `rline' no longer exists: use
15011 the `line' member of rule_t.
15012 * src/gram.c (dummy, rline): Remove, unused.
15013
15014 2001-12-05 Akim Demaille <akim@epita.fr>
15015
15016 * src/output.c (pack_vector): Use assert, not berror.
15017 * src/main.c (berror): Remove, unused.
15018
15019 2001-12-05 Akim Demaille <akim@epita.fr>
15020
15021 New experimental feature: if --verbose --trace output all the
15022 items of a state, not only its kernel.
15023
15024 * src/print.c (print_core): If `trace_flag', then invoke closure
15025 before outputting the items of the state (print_core is no longer
15026 a correct name them).
15027 (print_results): Invoke new_closure/free_closure if needed.
15028
15029 2001-12-05 Akim Demaille <akim@epita.fr>
15030
15031 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
15032 * src/closure.c, src/closure.h (itemsetsize): Rename as...
15033 (nitemset): for consistency with the rest of the project.
15034
15035 2001-12-05 Akim Demaille <akim@epita.fr>
15036
15037 * src/closure.c (print_closure): Improve.
15038 (closure): Use it for printing input and output.
15039
15040 2001-12-05 Akim Demaille <akim@epita.fr>
15041
15042 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
15043 indexed by nonterminals.
15044
15045 2001-12-05 Akim Demaille <akim@epita.fr>
15046
15047 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
15048 what it was!).
15049 * src/warshall.h: Remove accidental duplication of the content.
15050
15051 2001-12-05 Akim Demaille <akim@epita.fr>
15052
15053 * src/closure.c (set_fderives): De-obfuscate.
15054
15055 2001-12-05 Akim Demaille <akim@epita.fr>
15056
15057 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
15058
15059 2001-12-05 Akim Demaille <akim@epita.fr>
15060
15061 * src/closure.c (set_firsts): De-obfuscate.
15062
15063 2001-12-05 Akim Demaille <akim@epita.fr>
15064
15065 * src/output.c (action_row): De-obfuscate
15066 using the good o' techniques: arrays not pointers, variable
15067 locality, BITISSET, RESETBIT etc.
15068
15069 2001-12-05 Akim Demaille <akim@epita.fr>
15070
15071 Pessimize the code to simplify it: from now on, all the states
15072 have a valid SHIFTS, which NSHIFTS is possibly 0.
15073
15074 * src/LR0.c (shifts_new): Be global and move to..
15075 * src/state.c, src/state.h: here.
15076 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
15077 * src/print_graph: Adjust.
15078
15079 2001-12-05 Akim Demaille <akim@epita.fr>
15080
15081 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
15082 * src/conflicts.c: Use it.
15083 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
15084 incorrectly ``simplified''.
15085
15086 2001-12-05 Akim Demaille <akim@epita.fr>
15087
15088 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
15089 using the good o' techniques: arrays not pointers, variable
15090 locality, BITISSET, RESETBIT etc.
15091
15092 2001-12-05 Akim Demaille <akim@epita.fr>
15093
15094 * src/state.h (SHIFT_SYMBOL): New.
15095 * src/conflicts.c: Use it to deobfuscate.
15096
15097 2001-12-05 Akim Demaille <akim@epita.fr>
15098
15099 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
15100 (print_reductions): De-obfuscate using the good o' techniques:
15101 arrays not pointers, variable locality, BITISSET.
15102
15103 2001-12-05 Akim Demaille <akim@epita.fr>
15104
15105 * src/conflicts.c (print_reductions): Arrays, not pointers.
15106 Use BITISSET.
15107
15108 2001-12-05 Akim Demaille <akim@epita.fr>
15109
15110 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15111
15112 2001-12-05 Akim Demaille <akim@epita.fr>
15113
15114 * src/conflicts.c (print_reductions): Improve variable locality.
15115
15116 2001-12-05 Akim Demaille <akim@epita.fr>
15117
15118 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15119
15120 2001-12-05 Akim Demaille <akim@epita.fr>
15121
15122 * src/conflicts.c (print_reductions): Improve variable locality.
15123
15124 2001-12-05 Akim Demaille <akim@epita.fr>
15125
15126 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
15127 * src/lalr.c: Use them.
15128
15129 2001-12-05 Akim Demaille <akim@epita.fr>
15130
15131 * src/LR0.c (augment_automaton): Formatting changes.
15132 Better variable locality.
15133
15134 2001-12-05 Akim Demaille <akim@epita.fr>
15135
15136 * src/lalr.c (matrix_print): New.
15137 (transpose): Use it.
15138 Use arrays instead of pointers.
15139
15140 2001-12-05 Akim Demaille <akim@epita.fr>
15141
15142 * src/lalr.c (maxrhs): Move to...
15143 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
15144 * src/lalr.c (build_relations): Adjust.
15145
15146 2001-12-05 Akim Demaille <akim@epita.fr>
15147
15148 * src/lalr.c (transpose): Free the memory allocated to the
15149 argument, as it is replaced by the results by the unique caller.
15150 (build_relations): Merely invoke transpose: it handles the memory
15151 deallocation.
15152 Improve variable locality.
15153 Avoid variables used as mere abbreviations.
15154 (compute_lookaheads): Use arrays instead of pointers.
15155
15156 2001-12-05 Akim Demaille <akim@epita.fr>
15157
15158 * src/lalr.c (initialize_F): Improve variable locality.
15159 Avoid variables used as mere abbreviations.
15160
15161 2001-12-05 Akim Demaille <akim@epita.fr>
15162
15163 * src/derives.c (print_derives): Display the ruleno.
15164 * src/lalr.c (initialize_F, transpose): Better variable locality
15165 to improve readability.
15166 Avoid variables used as mere abbreviations.
15167
15168 2001-12-05 Akim Demaille <akim@epita.fr>
15169
15170 * src/lalr.c (traverse): Use arrays instead of pointers.
15171
15172 2001-12-05 Akim Demaille <akim@epita.fr>
15173
15174 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
15175 the handling of squeue.
15176 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15177
15178 2001-12-05 Akim Demaille <akim@epita.fr>
15179
15180 Because useless nonterminals are now kept alive (instead of being
15181 `destroyed'), we now sometimes examine them, and store information
15182 related to them. Hence we need to know their number, and adjust
15183 memory allocations.
15184
15185 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
15186 static.
15187 * src/LR0.c (allocate_itemsets): The memory allocated to
15188 `symbol_count' was used for two different purpose: once to count
15189 the number of occurrences of each symbol, and later reassigned to
15190 `shift_symbol', containing the symbol that can be shifted from a
15191 given state.
15192 Deobfuscate, i.e., allocate, use and free `symbol_count' here
15193 only, and...
15194 (new_itemsets): Allocate `shift_symbol' here.
15195 (allocate_itemsets): symbol_count includes useless nonterminals.
15196 Make room for them.
15197 (free_storage): Use `free', not `XFREE', for pointers that cannot
15198 be null.
15199
15200 2001-12-05 Akim Demaille <akim@epita.fr>
15201
15202 * src/nullable.c (set_nullable): Deobfuscate the handling of
15203 ritem.
15204 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15205
15206 2001-12-05 Akim Demaille <akim@epita.fr>
15207
15208 * src/gram.c, src/gram.h (ritem_print): New.
15209 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
15210 (This useless function was defined only to work around VMS linkers
15211 that can't handle compilation units with variables only).
15212 * src/reduce.c (dump_grammar): Use it to trace the construction of
15213 ritem.
15214
15215 2001-12-04 Paul Eggert <eggert@twinsun.com>
15216
15217 * src/bison.simple (union yyalloc): Change member names
15218 to be the same as the stack names.
15219 (yyparse): yyptr is now union yyalloc *, not char *.
15220 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
15221 and may generate better code on some machines.
15222 (yystpcpy): Use prototype if __STDC__ is defined, not just
15223 if __cplusplus is defined.
15224
15225 2001-11-30 Akim Demaille <akim@epita.fr>
15226
15227 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
15228 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
15229 Gettext doesn't compile cleanly, and dies with -Werror.
15230 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
15231 Include WARNING_CFLAGS here.
15232 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
15233 before being defined.
15234
15235 2001-11-27 Paul Eggert <eggert@twinsun.com>
15236
15237 * lib/quotearg.h (quotearg_n, quotearg_n_style):
15238 First arg is int, not unsigned.
15239 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
15240 (SIZE_MAX, UINT_MAX): New macros.
15241 (quotearg_n_options): Abort if N is negative.
15242 Avoid overflow check on hosts where size_t is 64 bits and int
15243 is 32 bits, as overflow is impossible there.
15244 Fix off-by-one typo that caused unnecessary reallocation.
15245
15246 2001-11-29 Paul Eggert <eggert@twinsun.com>
15247
15248 Name space cleanup in generated parser.
15249
15250 * doc/bison.texinfo (Bison Parser): Discuss system headers
15251 and their effect on the user name space.
15252
15253 * src/bison.simple:
15254 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
15255 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
15256 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
15257
15258 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
15259 on user names when possible.
15260
15261 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
15262 Simplify test for whather <alloca.h> exists.
15263
15264 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
15265
15266 (<stdio.h>): Include if YYDEBUG.
15267
15268 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
15269 ! defined (yyoverflow) && ! defined (yymemcpy).
15270
15271 (yymemcpy, yyparse): Rename local variables as needed so that
15272 they all begin with 'yy'.
15273
15274 (yystrlen, yystpcpy): New functions.
15275
15276 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
15277 All uses changed.
15278
15279 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
15280 instead of relying on string.h functions. Use YYSTACK_ALLOC
15281 and YYSTACK_FREE instead of malloc and free.
15282
15283 2001-11-30 Akim Demaille <akim@epita.fr>
15284
15285 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
15286 before their first uses.
15287 (YYBISON, YYPURE): Move to the top of the output.
15288
15289 2001-11-30 Akim Demaille <akim@epita.fr>
15290
15291 * tests/reduce.at (Useless Nonterminals): Fix.
15292
15293 2001-11-30 Akim Demaille <akim@epita.fr>
15294
15295 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
15296 if body instead of `;' to pacify GCC's warnings.
15297
15298 2001-11-30 Akim Demaille <akim@epita.fr>
15299
15300 Instead of mapping the LHS of unused rules to -1, keep the LHS
15301 valid, but flag the rules as invalid.
15302
15303 * src/gram.h (rule_t): `useful' is a new member.
15304 * src/print.c (print_grammar): Adjust.
15305 * src/derives.c (set_derives): Likewise.
15306 * src/reader.c (packgram, reduce_output): Likewise.
15307 * src/reduce.c (reduce_grammar_tables): Likewise.
15308 * tests/reduce.at (Underivable Rules, Useless Rules): New.
15309
15310 2001-11-30 Akim Demaille <akim@epita.fr>
15311
15312 * src/reduce.c (reduce_output): Formatting changes.
15313 * src/print.c (print_results, print_grammar): Likewise.
15314 * tests/regression.at (Rule Line Numbers)
15315 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
15316
15317 2001-11-30 Akim Demaille <akim@epita.fr>
15318
15319 * src/reduce.c (nonterminals_reduce): Instead of throwing away
15320 useless nonterminals, move them at the end of the symbol arrays.
15321 (reduce_output): Adjust.
15322 * tests/reduce.at (Useless Nonterminals): Adjust.
15323
15324 2001-11-30 Akim Demaille <akim@epita.fr>
15325
15326 * src/reduce.c: Various comment/formatting changes.
15327 (nonterminals_reduce): New, extracted from...
15328 (reduce_grammar_tables): here.
15329 (reduce_grammar): Call nonterminals_reduce.
15330
15331 2001-11-29 Paul Eggert <eggert@twinsun.com>
15332
15333 * src/bison.simple (YYSTACK_REALLOC): Remove.
15334 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
15335 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
15336 New macros.
15337 (union yyalloc): New type.
15338 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
15339 an arbitrary restriction on hosts where size_t is wider than int.
15340
15341 (yyparse): Don't dump core if alloca or malloc fails; instead, report
15342 a parser stack overflow. Allocate just one block of memory for all
15343 three stacks, instead of allocating three blocks; this typically is
15344 faster and reduces fragmentation.
15345
15346 Do not limit the number of items in the stack to a value that fits
15347 in 'int', as this is an arbitrary limit on hosts with 64-bit
15348 size_t and 32-bit int.
15349
15350 2001-11-29 Marc Autret <autret_m@epita.fr>
15351
15352 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
15353 of defining YYERROR_VERBOSE.
15354 [AT_DATA]: $4 is now out of C declarations in the prologue.
15355
15356 2001-11-28 Marc Autret <autret_m@epita.fr>
15357
15358 * src/reader.c (parse_dquoted_param): New.
15359 (parse_skel_decl): Use it.
15360 * src/lex.h: Add its prototype.
15361 * src/lex.c (literalchar): Become not static.
15362
15363 2001-11-28 Marc Autret <autret_m@epita.fr>
15364
15365 * src/output.h: And put its extern declaration here.
15366 * src/output.c (error_verbose): Define here.
15367 (prepare): Echo name modification.
15368 * src/getargs.h: Clean its extern declaration.
15369 * src/getargs.c (error_verbose_flag): Remove.
15370 (getargs): Remove case 'e'.
15371 * src/options.c (option_table): 'error-verbose' is now seen as simple
15372 percent option.
15373 Include output.h.
15374
15375 * src/reader.c (read_declarations): Remove case tok_include.
15376 (parse_include_decl): Remove.
15377 * src/lex.h (token_t): Remove tok_include.
15378 * src/options.c (option_table): 'include' is now a simple command line
15379 option.
15380
15381 2001-11-28 Marc Autret <autret_m@epita.fr>
15382
15383 * src/bison.simple: Adjust muscle names.
15384 * src/muscle_tab.c (muscle_init): Also rename the muscles.
15385 * src/output.c (prepare): s/_/-/ for the muscles names.
15386 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
15387
15388 2001-11-28 Marc Autret <autret_m@epita.fr>
15389
15390 * src/bison.simple: Fix debug.
15391 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
15392
15393 2001-11-28 Akim Demaille <akim@epita.fr>
15394
15395 * src/LR0.c (shifts_new): New.
15396 (save_shifts, insert_start_shift, augment_automaton): Use it.
15397
15398 2001-11-28 Akim Demaille <akim@epita.fr>
15399
15400 * src/closure.c (closure): `b' and `ruleno' denote the same value:
15401 keep ruleno only.
15402
15403 2001-11-28 Akim Demaille <akim@epita.fr>
15404
15405 * src/closure.c (closure): Instead of looping over word in array
15406 then bits in words, loop over bits in array.
15407
15408 2001-11-28 Akim Demaille <akim@epita.fr>
15409
15410 * src/closure.c (closure): No longer optimize the special case
15411 where all the bits of `ruleset[r]' are set to 0, to make the code
15412 clearer.
15413
15414 2001-11-28 Akim Demaille <akim@epita.fr>
15415
15416 * src/closure.c (closure): `r' and `c' are new variables, used to
15417 de-obfuscate accesses to RULESET and CORE.
15418
15419 2001-11-28 Akim Demaille <akim@epita.fr>
15420
15421 * src/reduce.c (reduce_print): Use ngettext.
15422 (dump_grammar): Improve the trace accuracy.
15423
15424 2001-11-28 Akim Demaille <akim@epita.fr>
15425
15426 * src/reduce.c (dump_grammar): Don't translate trace messages.
15427
15428 2001-11-28 Akim Demaille <akim@epita.fr>
15429
15430 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
15431 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
15432 as all tags are free'ed afterwards.
15433 From Enrico Scholz.
15434
15435 2001-11-27 Paul Eggert <eggert@twinsun.com>
15436
15437 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
15438 use alloca when we didn't want to, and vice versa.
15439
15440 2001-11-27 Marc Autret <autret_m@epita.fr>
15441
15442 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
15443 initialization.
15444 * src/output.c (prepare): Remove its update.
15445
15446 2001-11-27 Marc Autret <autret_m@epita.fr>
15447
15448 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
15449 Use %error-verbose.
15450
15451 2001-11-27 Marc Autret <autret_m@epita.fr>
15452
15453 * src/bison.simple: Remove YYERROR_VERBOSE using.
15454 Use %%error_verbose.
15455 (yyparse): Likewise.
15456 * src/output.c (prepare): Give its final value.
15457 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
15458 * src/getargs.h: Add its extern declaration.
15459 * src/getargs.c (error_verbose_flag): New int.
15460 (getargs): Update to catch new case.
15461 * src/options.c (option_table): 'error-verbose' is a new option.
15462 (shortopts): Update.
15463
15464 2001-11-27 Akim Demaille <akim@epita.fr>
15465
15466 * src/system.h: Use intl/libgettext.h.
15467 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
15468
15469 2001-11-27 Akim Demaille <akim@epita.fr>
15470
15471 * tests/torture.at (Exploding the Stack Size with Malloc):
15472 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
15473
15474 2001-11-27 Akim Demaille <akim@epita.fr>
15475
15476 * src/files.c: Include error.h.
15477 Reported by Hans Aberg.
15478
15479 2001-11-26 Marc Autret <autret_m@epita.fr>
15480
15481 * src/reader.c (parse_include_decl): New, not yet implemented.
15482 (read_declarations): Add case tok_include.
15483 * src/getargs.h (include): Add its extern definition.
15484 * src/getargs.c (include): New const char *.
15485 (getargs): Add case '-I'.
15486 * src/options.c (option_table): Add include as command line and
15487 percent option.
15488 * src/lex.h (token_t): Add tok_include.
15489
15490 2001-11-26 Akim Demaille <akim@epita.fr>
15491
15492 * src/reader.c (readgram): Make sure rules for mid-rule actions
15493 have a lineno equal to that of their host rule.
15494 Reported by Hans Aberg.
15495 * tests/regression.at (Rule Line Numbers): New.
15496
15497 2001-11-26 Akim Demaille <akim@epita.fr>
15498
15499 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
15500 size_ts.
15501
15502 2001-11-26 Akim Demaille <akim@epita.fr>
15503
15504 * src/complain.c, src/complain.h (error): Remove, provided by
15505 lib/error.[ch].
15506
15507 2001-11-26 Akim Demaille <akim@epita.fr>
15508
15509 * src/reader.c (read_declarations): Don't abort on tok_illegal,
15510 issue an error message.
15511 * tests/regression.at (Invalid %directive): New.
15512 Reported by Hans Aberg.
15513
15514 2001-11-26 Akim Demaille <akim@epita.fr>
15515
15516 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
15517 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15518
15519 2001-11-26 Akim Demaille <akim@epita.fr>
15520
15521 * src/conflicts.c (conflicts_print): Don't complain at all when
15522 there are no reduce/reduce conflicts, and as many shift/reduce
15523 conflicts as expected.
15524 * tests/regression.at (%expect right): Adjust.
15525
15526 2001-11-23 Akim Demaille <akim@epita.fr>
15527
15528 * lib/alloca.c: Update, from fileutils.
15529
15530 2001-11-23 Akim Demaille <akim@epita.fr>
15531
15532 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
15533
15534 2001-11-23 Akim Demaille <akim@epita.fr>
15535
15536 * src/system.h: Include alloca.h.
15537 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
15538
15539 2001-11-23 Akim Demaille <akim@epita.fr>
15540
15541 * src/print_graph.c (print_actions): Remove `rule', unused.
15542 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
15543 pacify GCC's signed < unsigned warnings.
15544 * src/closure.c (itemsetsize): Likewise.
15545 * src/reader.c (symbol_list_new): Static.
15546
15547 2001-11-23 Akim Demaille <akim@epita.fr>
15548
15549 Attaching lineno to buckets is stupid, since only one copy of each
15550 symbol is kept, only the line of the first occurrence is kept too.
15551
15552 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
15553 * src/reader.c (rline_allocated): Remove, unused.
15554 (symbol_list): Have a `line' member.
15555 (symbol_list_new): New.
15556 (readgram): Use it.
15557 * src/print.c (print_grammar): Output the rule line numbers.
15558 * tests/regression.at (Solved SR Conflicts)
15559 (Unresolved SR Conflicts): Adjust.
15560 Reported by Hans Aberg.
15561
15562 2001-11-22 Marc Autret <autret_m@epita.fr>
15563
15564 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
15565
15566 2001-11-22 Marc Autret <autret_m@epita.fr>
15567
15568 * src/muscle_tab.c (muscle_init): Remove initialization of
15569 skeleton muscle.
15570 * src/output.c (output_master_parser): Do it here.
15571
15572 2001-11-20 Akim Demaille <akim@epita.fr>
15573
15574 * po/sv.po: New.
15575 * configure.in (ALL_LINGUAS): Adjust.
15576 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
15577 longer contains strings to translate.
15578
15579 2001-11-19 Akim Demaille <akim@epita.fr>
15580
15581 * src/conflicts.c (conflicts_print): Add a missing \n.
15582
15583 2001-11-19 Akim Demaille <akim@epita.fr>
15584
15585 * src/nullable.c (nullable_print): New.
15586 (set_nullable): Call it when tracing.
15587 Better locality of variables.
15588
15589 2001-11-19 Akim Demaille <akim@epita.fr>
15590
15591 * src/print.c (print_actions): Better locality of variables.
15592
15593 2001-11-19 Akim Demaille <akim@epita.fr>
15594
15595 * src/derives.c (print_derives): Fix and enrich.
15596 * src/closure.c (print_fderives): Likewise.
15597
15598 2001-11-19 Akim Demaille <akim@epita.fr>
15599
15600 * src/closure.c (itemsetend): Remove, replaced with...
15601 (itemsetsize): new.
15602
15603 2001-11-19 Akim Demaille <akim@epita.fr>
15604
15605 * src/LR0.c (kernel_end): Remove, replaced with...
15606 (kernel_size): new.
15607
15608 2001-11-19 Akim Demaille <akim@epita.fr>
15609
15610 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
15611 to clarify.
15612
15613 2001-11-19 Akim Demaille <akim@epita.fr>
15614
15615 * src/closure.c (closure): Use arrays instead of pointers to clarify.
15616
15617 2001-11-19 Akim Demaille <akim@epita.fr>
15618
15619 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
15620 trace messages.
15621 * src/LR0.c: Likewise.
15622 (allocate_itemsets): Use arrays instead of pointers to clarify.
15623
15624 2001-11-19 Akim Demaille <akim@epita.fr>
15625
15626 * src/getargs.c (statistics_flag): Replace with...
15627 (trace_flag): New.
15628 (longopts): Accept --trace instead of --statistics.
15629 * src/getargs.h, src/options.c: Adjust.
15630 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
15631 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
15632
15633 2001-11-19 Akim Demaille <akim@epita.fr>
15634
15635 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
15636 pointers to clarify the code.
15637 (save_reductions, save_shifts): Factor common parts of alternatives.
15638
15639 2001-11-19 Akim Demaille <akim@epita.fr>
15640
15641 * src/LR0.c (new_state, get_state): Complete TRACE code.
15642 * src/closure.c: Include `reader.h' to get `tags', needed by the
15643 trace code.
15644 Rename the conditional DEBUG as TRACE.
15645 Output consistently TRACEs to stderr, not stdout.
15646 * src/derives.c: Likewise.
15647 * src/reduce.c: (inaccessable_symbols): Using if is better style
15648 than goto.
15649 Use `#if TRACE' instead of `#if 0' for tracing code.
15650
15651 2001-11-19 Akim Demaille <akim@epita.fr>
15652
15653 * src/system.h (LIST_FREE, shortcpy): New.
15654 * src/LR0.c: Use them.
15655 * src/output.c (free_itemsets, free_reductions, free_shifts):
15656 Remove, replaced by LIST_FREE.
15657
15658 2001-11-19 Akim Demaille <akim@epita.fr>
15659
15660 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
15661 (REDUCTIONS_ALLOC): New.
15662 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
15663 allocation.
15664
15665 2001-11-19 Akim Demaille <akim@epita.fr>
15666
15667 * src/LR0.c (new_state): Complete trace code.
15668 * src/nullable.c (set_nullable): Don't translate traces.
15669
15670 2001-11-19 Akim Demaille <akim@epita.fr>
15671
15672 * src/print_graph.c (print_core): Better locality of variables.
15673 * src/print.c (print_core): Likewise.
15674
15675 2001-11-19 Akim Demaille <akim@epita.fr>
15676
15677 * src/vcg.c: You do the output, so you are responsible of the
15678 handling of VCG syntax, in particular: use quotearg.
15679 * src/print_graph.c: Don't.
15680 (print_actions): Don't output the actions as part of the nodes,
15681 since that's the job of the edges.
15682 (print_state): Don't output by hand: fill the node description,
15683 and ask for its output.
15684
15685 2001-11-19 Akim Demaille <akim@epita.fr>
15686
15687 * src/bison.simple (yyparse): When verbosely reporting an error,
15688 no longer put additional quotes around token names.
15689 * tests/calc.at: Adjust.
15690
15691 2001-11-19 Akim Demaille <akim@epita.fr>
15692
15693 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
15694 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
15695 * src/output.c: Adjust.
15696
15697 2001-11-19 Akim Demaille <akim@epita.fr>
15698
15699 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
15700 (rule_t): this.
15701 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
15702
15703 2001-11-19 Akim Demaille <akim@epita.fr>
15704
15705 * src/gram.h (rule_t): New.
15706 (rule_table): New.
15707 (rrhs, rlhs): Remove, part of state_t.
15708 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
15709 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15710 * src/reader.c, src/reduce.c: Adjust.
15711
15712 2001-11-19 Akim Demaille <akim@epita.fr>
15713
15714 * src/reader.c (symbols_output): New, extracted from...
15715 (packsymbols): Here.
15716 (reader): Call it.
15717
15718 2001-11-19 Akim Demaille <akim@epita.fr>
15719
15720 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
15721 (maxrhs): this new function.
15722
15723 2001-11-19 Akim Demaille <akim@epita.fr>
15724
15725 * src/lalr.c (F): New macro to access the variable F.
15726 Adjust.
15727
15728 2001-11-19 Akim Demaille <akim@epita.fr>
15729
15730 * src/lalr.h (LA): New macro to access the variable LA.
15731 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15732 * src/lalr.c: Adjust.
15733
15734 2001-11-19 Akim Demaille <akim@epita.fr>
15735
15736 * src/lalr.c (initialize_LA): Only initialize LA. Let...
15737 (set_state_table): handle the `lookaheads' members.
15738
15739 2001-11-19 Akim Demaille <akim@epita.fr>
15740
15741 * src/lalr.h (lookaheads): Removed array, whose contents is now
15742 a member of...
15743 (state_t): this structure.
15744 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15745 Adjust.
15746
15747 2001-11-19 Akim Demaille <akim@epita.fr>
15748
15749 * src/lalr.h (consistent): Removed array, whose contents is now
15750 a member of...
15751 (state_t): this structure.
15752 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15753 Adjust.
15754
15755 2001-11-19 Akim Demaille <akim@epita.fr>
15756
15757 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
15758 contents are now members of...
15759 (state_t): this structure.
15760 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15761 Adjust.
15762
15763 2001-11-19 Akim Demaille <akim@epita.fr>
15764
15765 * src/lalr.h (state_t): New.
15766 (state_table): Be a state_t * instead of a core **.
15767 (accessing_symbol): Remove, part of state_t.
15768 * src/lalr.c: Adjust.
15769 (set_accessing_symbol): Merge into...
15770 (set_state_table): this.
15771 * src/print_graph.c, src/conflicts.c: Adjust.
15772
15773 2001-11-14 Akim Demaille <akim@epita.fr>
15774
15775 * tests/calc.at, tests/output.at, tests/regression.at,
15776 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
15777 now the tests are run in private dirs, therefore AC_CLEANUP and
15778 family can be simplified to 0-ary.
15779 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
15780 use abs. path to find config.h.
15781 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
15782 stderr, there can be way too much random noise.
15783 Instead pass -Werror to GCC and rely on the exit status.
15784 Reported by Wolfram Wagner.
15785
15786 2001-11-14 Akim Demaille <akim@epita.fr>
15787
15788 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
15789 defined only if yyoverflow is defined, to avoid `warning: unused
15790 variable `yyvs1''.
15791 Reported by The Test Suite.
15792
15793 2001-11-14 Akim Demaille <akim@epita.fr>
15794
15795 * src/print.c: Include reduce.h.
15796 Reported by Hans Aberg.
15797
15798 2001-11-14 Akim Demaille <akim@epita.fr>
15799
15800 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
15801 Revert a previous patch: these are really const.
15802 * src/conflicts.c (conflict_report): Additional useless pair of
15803 braces to pacify GCC's warnings for `if () if () {} else {}'.
15804 * src/lex.c (parse_percent_token): Replace equal_offset with
15805 arg_offset.
15806 arg is const.
15807 Be sure to strdup `arg' when used, since there is no reason for
15808 token_buffer not to change.
15809
15810 2001-11-14 Akim Demaille <akim@epita.fr>
15811
15812 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
15813 definition.
15814 * src/main.c (main): Use them.
15815 Suggested by Hans Aberg.
15816
15817 2001-11-12 Akim Demaille <akim@epita.fr>
15818
15819 * src/system.h (ngettext): Now that we use ngettext, be sure to
15820 provide a default definition when NLS are not used.
15821
15822 2001-11-12 Akim Demaille <akim@epita.fr>
15823
15824 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
15825 Use @kbd to denote user input.
15826 (Language and Grammar): ANSIfy the example.
15827 Adjust its layout for info/notinfo.
15828 (Location Tracking Calc): Output error messages to stderr.
15829 Output locations in a more GNUtically correct way.
15830 Fix a couple of Englishos.
15831 Adjust @group/@end group pairs.
15832
15833 2001-11-12 Akim Demaille <akim@epita.fr>
15834
15835 %expect was not functioning at all.
15836
15837 * src/conflicts.c (expected_conflicts): Set to -1.
15838 (conflict_report): Use ngettext.
15839 (conflicts_print): Check %expect and make its violation an error.
15840 * doc/bison.texinfo (Expect Decl): Adjust.
15841 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
15842 * tests/regression.at (%expect not enough, %expect right)
15843 (%expect too much): New.
15844
15845 2001-11-12 Akim Demaille <akim@epita.fr>
15846
15847 * tests/regression.at (Conflicts): Rename as...
15848 (Unresolved SR Conflicts): this.
15849 (Solved SR Conflicts): New.
15850
15851 2001-11-12 Akim Demaille <akim@epita.fr>
15852
15853 * src/reduce.c (print_results): Rename as...
15854 (reduce_output): This.
15855 Output to OUT, passed as argument, instead of output_obstack.
15856 (dump_grammar): Likewise.
15857 (reduce_free): New.
15858 Also free V1.
15859 (reduce_grammar): No longer call reduce_output, since...
15860 * src/print.c (print_results): do it.
15861 * src/main.c (main): Call reduce_free;
15862
15863 2001-11-12 Akim Demaille <akim@epita.fr>
15864
15865 * src/conflicts.c (print_reductions): Accept OUT as argument.
15866 Output to it, not to output_obstack.
15867 * src/print.c (print_actions): Adjust.
15868
15869 2001-11-12 Akim Demaille <akim@epita.fr>
15870
15871 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
15872 the result instead of using...
15873 (src_total, rrc_total, src_count, rrc_count): Remove.
15874 (any_conflicts): Remove.
15875 (print_conflicts): Split into...
15876 (conflicts_print, conflicts_output): New.
15877 * src/conflicts.h: Adjust.
15878 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
15879 * src/print.c (print_grammar): Issue `\n' between two rules.
15880 * tests/regression.at (Conflicts): New.
15881 Reported by Tom Lane.
15882
15883 2001-11-12 Akim Demaille <akim@epita.fr>
15884
15885 * tests/regression.at (Invalid input): Remove, duplicate with
15886 ``Invalid input: 1''.
15887
15888 2001-11-12 Akim Demaille <akim@epita.fr>
15889
15890 * tests/torture.at (AT_DATA_STACK_TORTURE)
15891 (Exploding the Stack Size with Alloca)
15892 (Exploding the Stack Size with Malloc): New.
15893
15894 2001-11-12 Akim Demaille <akim@epita.fr>
15895
15896 * src/bison.simple (YYSTACK_REALLOC): New.
15897 (yyparse) [!yyoverflow]: Use it and free the old stack.
15898 Reported by Per Allansson.
15899
15900 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
15901
15902 * src/bison.simple: Define type yystype instead of YYSTYPE, and
15903 define CPP macro, which substitute YYSTYPE by yystype.
15904 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
15905 with yyltype/YYLTYPE. This allows inclusion of the generated
15906 header within the parser if the compiler, such as GGC, accepts
15907 multiple equivalent #defines.
15908 From Akim.
15909
15910 2001-11-05 Akim Demaille <akim@epita.fr>
15911
15912 * src/reader.c (symbols_output): New, extracted from...
15913 (packsymbols): here.
15914 (reader): Adjust.
15915
15916 2001-11-05 Akim Demaille <akim@epita.fr>
15917
15918 * src/lex.c (parse_percent_token): s/quotearg/quote/.
15919
15920 2001-11-05 Akim Demaille <akim@epita.fr>
15921
15922 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
15923 pattern.
15924
15925 2001-11-05 Akim Demaille <akim@epita.fr>
15926
15927 * src/options.h (struct option_table_struct): set_flags is void*.
15928 * src/options.c (longopts): Support `--output' and `%output'.
15929 (usage): Adjust.
15930 * src/lex.h (tok_setopt): Remove, replaced with...
15931 (tok_intopt, tok_stropt): these new guys.
15932 * src/lex.c (getopt.h): Not needed.
15933 (token_buffer, unlexed_token_buffer): Not const.
15934 (percent_table): Promote `-' over `_' in directive names.
15935 Active `%name-prefix', `file-prefix', and `output'.
15936 (parse_percent_token): Accept possible arguments to directives.
15937 Promote `-' over `_' in directive names.
15938
15939 2001-11-04 Akim Demaille <akim@epita.fr>
15940
15941 * doc/bison.texinfo (Decl Summary): Split the list into
15942 `directives for grammars' and `directives for bison'.
15943 Sort'em.
15944 Add description of `%name-prefix', `file-prefix', and `output'.
15945 Promote `-' over `_' in directive names.
15946 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
15947 Simplify the description of `--name-prefix'.
15948 Promote `-' over `_' in directive names.
15949 Promote `--output' over `--output-file'.
15950 Fix the description of `--defines'.
15951 * tests/output.at: Exercise %file-prefix and %output.
15952
15953 2001-11-02 Akim Demaille <akim@epita.fr>
15954
15955 * doc/refcard.tex: Update.
15956
15957 2001-11-02 Akim Demaille <akim@epita.fr>
15958
15959 * src/symtab.h (SUNDEF): New.
15960 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
15961 stand for `uninitialized', instead of 0.
15962 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
15963 * src/lex.c (lex): Adjust.
15964
15965 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
15966 Number it 0.
15967 Let yylex return it instead of a plain 0.
15968 Reported by Dick Streefland.
15969
15970 2001-11-02 Akim Demaille <akim@epita.fr>
15971
15972 * tests/regression.at (Mixing %token styles): New test.
15973
15974 2001-11-02 Akim Demaille <akim@epita.fr>
15975
15976 * src/reader.c (parse_thong_decl): Formatting changes.
15977 (token_translations_init): New, extracted from...
15978 (packsymbols): Here.
15979 Adjust.
15980
15981 2001-11-01 Akim Demaille <akim@epita.fr>
15982
15983 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
15984 Check that `9foo.y' produces correct cpp guards.
15985 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
15986 guards.
15987 Reported by Wwp.
15988
15989 2001-11-01 Akim Demaille <akim@epita.fr>
15990
15991 * tests/regression.at (Invalid input: 2): New.
15992 * src/lex.c (unlexed_token_buffer): New.
15993 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
15994 too.
15995 Reported by Wwp.
15996
15997 2001-11-01 Akim Demaille <akim@epita.fr>
15998
15999 * tests/calc.at: Catch up with 1.30.
16000 * configure.in: Bump to 1.49a.
16001 Adjust to newer Autotest.
16002
16003 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
16004
16005 * src/conflicts.c: Move global variables rrc_total and src_total ...
16006 (print_conflicts): here.
16007 * src/output.c (output): Free global variable user_toknums.
16008 * src/lex.c (token_obstack): Become static.
16009
16010 2001-10-18 Akim Demaille <akim@epita.fr>
16011
16012 * tests/atlocal.in (GCC): Add.
16013 * tests/calc.at: s/m4_match/m4_bmatch/.
16014 s/m4_patsubst/m4_bpatsubst/.
16015 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
16016 * configure.in: AC_SUBST(GCC).
16017
16018 2001-10-14 Marc Autret <autret_m@epita.fr>
16019
16020 * src/options.c (create_long_option_table): Fix.
16021
16022 2001-10-10 Akim Demaille <akim@epita.fr>
16023
16024 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
16025
16026 2001-10-04 Akim Demaille <akim@epita.fr>
16027
16028 * src/reader.c (parse_union_decl): Push the caracters in
16029 union_obstack, not attrs_obstack.
16030
16031 2001-10-04 Akim Demaille <akim@epita.fr>
16032
16033 Merge in the branch 1.29.
16034
16035 * src/reader.c (packsymbols): Use a temporary obstack for
16036 `%%tokendef', since output_stack is already used elsewhere.
16037
16038 2001-10-02 Akim Demaille <akim@epita.fr>
16039
16040 Bump 1.29d.
16041
16042 2001-10-02 Akim Demaille <akim@epita.fr>
16043
16044 Version 1.29c.
16045
16046 2001-10-02 Akim Demaille <akim@epita.fr>
16047
16048 * tests/regression.at (Invalid CPP headers): New.
16049 From Alexander Belopolsky.
16050 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
16051
16052 2001-10-02 Akim Demaille <akim@epita.fr>
16053
16054 * tests/regression.at (Invalid input): New.
16055 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
16056 Reported by Shura.
16057
16058 2001-10-02 Akim Demaille <akim@epita.fr>
16059
16060 * tests/calc.at: Now that --debug works, the tests must be adjusted.
16061
16062 2001-10-02 Akim Demaille <akim@epita.fr>
16063
16064 * src/output.c (output_parser): Assert `skeleton'.
16065 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
16066 systems.
16067 From Shura.
16068
16069 2001-10-01 Marc Autret <autret_m@epita.fr>
16070
16071 * src/lex.h: Echo modifications.
16072 * src/lex.c (unlex): Parameter is now token_t.
16073 From Hans Aberg.
16074
16075 2001-10-01 Marc Autret <autret_m@epita.fr>
16076
16077 * src/main.c: Include lex.h.
16078 From Hans Aberg.
16079
16080 2001-09-29 Akim Demaille <akim@epita.fr>
16081
16082 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
16083
16084 2001-09-28 Akim Demaille <akim@epita.fr>
16085
16086 * tests/testsuite.at: Update to newer Autotest.
16087 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
16088
16089 2001-09-27 Akim Demaille <akim@epita.fr>
16090
16091 Position independent wrapper.
16092
16093 * tests/bison: Remove.
16094 * tests/bison.in: New.
16095 * configure.in: Adjust.
16096
16097 2001-09-27 Paul Eggert <eggert@twinsun.com>
16098
16099 Port quotearg fixes from tar 1.13.24.
16100
16101 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
16102 tm to be declared.
16103 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
16104 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
16105
16106 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
16107 * m4/mbrtowc.m4: New file.
16108 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
16109 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
16110
16111 2001-09-27 Akim Demaille <akim@epita.fr>
16112
16113 Bump to 1.29c.
16114
16115 2001-09-27 Akim Demaille <akim@epita.fr>
16116
16117 Version 1.29b.
16118
16119 2001-09-25 Akim Demaille <akim@epita.fr>
16120
16121 * src/system.h: Include `xalloc.h'.
16122 Remove it from the C files.
16123 * src/files.c (output_files): Free the obstacks.
16124 * src/lex.c (init_lex): Rename as...
16125 (lex_init): this.
16126 (lex_free): New.
16127 * src/main.c (main): Use it.
16128
16129 2001-09-24 Marc Autret <autret_m@epita.fr>
16130
16131 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
16132 to output informations in fout (FILE*).
16133 (open_graph, close_graph): Likewise.
16134 (output_graph, output_edge, output_node): Likewise.
16135 * src/vcg.h: Update function prototypes.
16136 * src/print_graph.c (print_graph): Open output graph file.
16137 (print_actions): Adjust.
16138 * src/files.h: Remove extern declaration.
16139 * src/files.c: Remove graph_obstack declaration.
16140 (open_files): Remove graph_obstack initialization.
16141 (output_files): Remove graph_obstack saving.
16142
16143 2001-09-24 Marc Autret <autret_m@epita.fr>
16144
16145 * src/files.c (compute_output_file_names): Fix.
16146
16147 2001-09-24 Marc Autret <autret_m@epita.fr>,
16148 Akim Demaille <akim@epita.fr>
16149
16150 * src/reader.c (reader): Remove call to free_symtab ().
16151 * src/main.c (main): Call it here.
16152 Include symtab.h.
16153 * src/conflicts.c (initialize_conflicts): Rename as...
16154 (solve_conflicts): this.
16155 * src/print.c (print_core, print_actions, print_state)
16156 (print_grammar): Dump to a file instead a `output_obstack'.
16157 (print_results): Dump `output_obstack', and then proceed with the
16158 FILE *.
16159 * src/files.c (compute_output_file_names, close_files): New.
16160 (output_files): Adjust.
16161 * src/main.c (main): Adjust.
16162
16163 2001-09-23 Marc Autret <autret_m@epita.fr>
16164
16165 * src/files.c (compute_header_macro): Computes header macro name
16166 from spec_defines_file when given.
16167
16168 2001-09-23 Marc Autret <autret_m@epita.fr>
16169
16170 * src/files.c (output_files): Add default extensions.
16171
16172 2001-09-22 Akim Demaille <akim@epita.fr>
16173
16174 * src/conflicts.c (finalize_conflicts): Rename as...
16175 (free_conflicts): this.
16176
16177 2001-09-22 Akim Demaille <akim@epita.fr>
16178
16179 * src/gram.c (gram_free): Rename back as...
16180 (dummy): this.
16181 (output_token_translations): Free `token_translations'.
16182 * src/symtab.c (free_symtab): Free the tag field.
16183
16184 2001-09-22 Akim Demaille <akim@epita.fr>
16185
16186 Remove `translations' as it is always set to true.
16187
16188 * src/gram.h: Adjust.
16189 * src/reader.c (packsymbols, parse_token_decl): Adjust
16190 * src/print.c (print_grammar): Adjust.
16191 * src/output.c (output_token_translations): Adjust.
16192 * src/lex.c (lex): Adjust.
16193 * src/gram.c: Be sure the set pointers to NULL.
16194 (dummy): Rename as...
16195 (gram_free): this.
16196
16197 2001-09-22 Akim Demaille <akim@epita.fr>
16198
16199 * configure.in: Invoke AM_LIB_DMALLOC.
16200 * src/system.h: Use dmalloc.
16201 * src/LR0.c: Be sure to have pointers initialized to NULL.
16202 (allocate_itemsets): Allocate kernel_items only if needed.
16203
16204 2001-09-22 Akim Demaille <akim@epita.fr>
16205
16206 * configure.in: Bump to 1.29b.
16207 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
16208 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
16209 need xmalloc.c in calc.y.
16210 From Pascal Bart.
16211
16212 2001-09-21 Akim Demaille <akim@epita.fr>
16213
16214 Version 1.29a.
16215 * Makefile.maint, config/config.guess, config/config.sub,
16216 * config/missing: Update from masters.
16217 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
16218 upon package.m4.
16219 * configure.in (ALL_LINGUAS): Add `tr'.
16220
16221 2001-09-21 Akim Demaille <akim@epita.fr>
16222
16223 * tests/Makefile.am (package.m4): Move to...
16224 ($(srcdir)/$(TESTSUITE)): here.
16225
16226 2001-09-20 Akim Demaille <akim@epita.fr>
16227
16228 * src/complain.c: No longer try to be standalone: use system.h.
16229 Don't assume __STDC__ is defined to 1. Just test if it is defined.
16230 * src/complain.h: Likewise.
16231 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
16232 Remove the unused variable `n'.
16233 From Albert Chin-A-Young.
16234
16235 2001-09-18 Marc Autret <autret_m@epita.fr>
16236
16237 * doc/bison.1: Update.
16238 * doc/bison.texinfo (Bison Options): Update --defines and --graph
16239 descriptions.
16240 (Option Cross Key): Update.
16241 Add --graph.
16242
16243 2001-09-18 Marc Autret <autret_m@epita.fr>
16244
16245 * tests/regression.at: New test (comment in %union).
16246
16247 2001-09-18 Marc Autret <autret_m@epita.fr>
16248
16249 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
16250 do that.
16251 Reported by Keith Browne.
16252
16253 2001-09-18 Marc Autret <autret_m@epita.fr>
16254
16255 * tests/output.at: Add tests for --defines and --graph.
16256
16257 2001-09-18 Marc Autret <autret_m@epita.fr>
16258
16259 * tests/output.at: Removes tests of %{header,src}_extension features.
16260
16261 2001-09-18 Akim Demaille <akim@epita.fr>
16262
16263 * tests/Makefile.am (package.m4): New.
16264 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
16265 (_AT_CHECK_CALC_ERROR): Likewise.
16266 Factor the `, ' part of verbose error messages.
16267
16268 2001-09-18 Marc Autret <autret_m@epita.fr>
16269
16270 * src/getargs.c (longopts): Declare --defines and --graph as options
16271 with optional arguments.
16272 * src/files.h: Add extern declarations.
16273 * src/files.c (spec_graph_file, spec_defines_file): New.
16274 (output_files): Update.
16275 Remove CPP-outed code.
16276
16277 2001-09-18 Marc Autret <autret_m@epita.fr>
16278
16279 Turn off %{source,header}_extension feature.
16280
16281 * src/files.c (compute_exts_from_gf): Update.
16282 (compute_exts_from_src): Update.
16283 (output_files): CPP-out useless code.
16284 * src/files.h: Remove {header,source}_extension extern declarations.
16285 * src/reader.c (parse_dquoted_param): CPP-out.
16286 (parse_header_extension_decl): Remove.
16287 (parse_source_extension_decl): Remove.
16288 (read_declarations): Remove cases tok_{hdrext,srcext}.
16289 * src/lex.c (percent_table): Remove {header,source}_extension entries.
16290 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
16291
16292 2001-09-10 Akim Demaille <akim@epita.fr>
16293
16294 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
16295 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
16296 (AT_CHECK_OUTPUT): this.
16297 Merely check ls' exit status, its output is useless.
16298
16299 2001-09-10 Akim Demaille <akim@epita.fr>
16300
16301 * tests/calc.at: Use m4_match.
16302 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
16303
16304 2001-09-10 Marc Autret <autret_m@epita.fr>,
16305 Akim Demaille <akim@epita.fr>
16306
16307 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
16308 enum color_e.
16309 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
16310 to `normal'.
16311 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
16312 * src/lex.h: Adjust prototype.
16313 (token_t): Add `tok_undef'.
16314 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
16315 (parse_percent_token): Now returns token_t.
16316 Add default statement in switch.
16317 (lex): Separate `c' as an input variable, from the token_t result
16318 part.
16319 (unlexed): Is a token_t.
16320
16321 2001-09-10 Akim Demaille <akim@epita.fr>
16322
16323 * configure.in: Bump to 1.29a.
16324
16325 2001-09-07 Akim Demaille <akim@epita.fr>
16326
16327 Version 1.29.
16328
16329 2001-08-30 Akim Demaille <akim@epita.fr>
16330
16331 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
16332 * m4/atconfig.m4: Remove.
16333 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
16334 * tests/bison: New.
16335 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
16336 m4_if, m4_patsubst, and m4_regexp.
16337 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
16338 `input' file instead of echo.
16339
16340 2001-08-29 Akim Demaille <akim@epita.fr>
16341
16342 Bump to 1.28e.
16343
16344 2001-08-29 Akim Demaille <akim@epita.fr>
16345
16346 Version 1.28d.
16347
16348 2001-08-29 Paul Eggert <eggert@twinsun.com>
16349
16350 * src/bison.simple (yyparse): Don't take the address of an
16351 item before the start of an array, as that doesn't conform to
16352 the C Standard.
16353
16354 2001-08-29 Robert Anisko <anisko_r@epita.fr>
16355
16356 * doc/bison.texinfo (Location Tracking Calc): New node.
16357
16358 2001-08-29 Paul Eggert <eggert@twinsun.com>
16359
16360 * src/output.c (output): Do not define const, as this now
16361 causes more problems than it cures.
16362
16363 2001-08-29 Akim Demaille <akim@epita.fr>
16364
16365 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
16366 the nodes.
16367 Be sure to tag the `detailmenu'.
16368
16369 2001-08-29 Akim Demaille <akim@epita.fr>
16370
16371 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
16372 download in a tmp dir.
16373
16374 2001-08-28 Marc Autret <autret_m@epita.fr>
16375
16376 * config/depcomp: New file.
16377
16378 2001-08-28 Marc Autret <autret_m@epita.fr>
16379
16380 * doc/bison.1 (mandoc): Adjust.
16381 From Juan Manuel Guerrero.
16382
16383 2001-08-28 Marc Autret <autret_m@epita.fr>
16384
16385 * src/print_graph.c (print_state): Fix.
16386
16387 2001-08-27 Marc Autret <autret_m@epita.fr>
16388
16389 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
16390 char * members.
16391 Echo modifications to the functions prototypes.
16392 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
16393
16394 2001-08-27 Marc Autret <autret_m@epita.fr>
16395
16396 * src/vcg.c: Include `xalloc.h'.
16397 (add_colorentry): New.
16398 (add_classname): New.
16399 (add_infoname): New.
16400 * src/vcg.h: Add new prototypes.
16401
16402 2001-08-27 Akim Demaille <akim@epita.fr>
16403
16404 * Makefile.maint: Sync. again with CVS Autoconf.
16405
16406 2001-08-27 Akim Demaille <akim@epita.fr>
16407
16408 * Makefile.maint: Formatting changes.
16409 (po-update, cvs-update, update): New targets.
16410 (AMTAR): Remove.
16411
16412 2001-08-27 Akim Demaille <akim@epita.fr>
16413
16414 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16415 * Makefile.maint: Sync. with CVS Autoconf.
16416
16417 2001-08-27 Marc Autret <autret_m@epita.fr>
16418
16419 * src/vcg.h (struct infoname_s): New.
16420 (struct colorentry_s): New.
16421 (graph_s): New fields {vertical,horizontal}_order in structure.
16422 Add `infoname' field.
16423 Add `colorentry' field;
16424 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
16425 (G_HORIZONTAL_ORDER): New.
16426 (G_INFONAME): New.
16427 (G_COLORENTRY): New.
16428 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
16429 Add output of `infoname'.
16430 Add output of `colorentry'.
16431
16432 2001-08-27 Marc Autret <autret_m@epita.fr>
16433
16434 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
16435 This one shadowed a global parameter.
16436
16437 2001-08-24 Marc Autret <autret_m@epita.fr>
16438
16439 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
16440 instead of `unsigned'.
16441 (print_state): Do not call obstack_object_size () in obstack_grow ()
16442 to avoid macro variables shadowing.
16443
16444 2001-08-23 Marc Autret <autret_m@epita.fr>
16445
16446 * src/lex.c (percent_table): Typo: s/naem/name/.
16447 Add graph option.
16448 Normalize new options declarations.
16449
16450 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
16451
16452 * tests/suite.at: Exercise %header_extension and %source_extension.
16453
16454 2001-08-16 Marc Autret <autret_m@epita.fr>
16455
16456 * src/reader.c (parse_dquoted_param): New.
16457 (parse_header_extension_decl): Use it.
16458 (parse_source_extension_decl): Likewise.
16459
16460 2001-08-16 Marc Autret <autret_m@epita.fr>
16461
16462 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
16463 (get_xxxx_str): Use assert () instead of complain ().
16464 Remove return invokations in default cases.
16465 (get_decision_str): Modify default behaviour. Remove second argument.
16466 Echo modifications on calls.
16467 (output_graph): Fix.
16468
16469 2001-08-16 Marc Autret <autret_m@epita.fr>
16470
16471 * src/getargs.c (usage): Update with ``-g, --graph''.
16472
16473 2001-08-16 Marc Autret <autret_m@epita.fr>
16474
16475 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
16476 (Option Cross Key): Likewise.
16477 * doc/bison.1: Update.
16478
16479 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
16480
16481 * src/output.c (output_master_parser): Don't finish action_obstack.
16482 (output_parser): Don't care about the muscle action, here.
16483 (prepare): Copy the action_obstack in the action muscle.
16484 (output): Free action_obstack.
16485
16486 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
16487
16488 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
16489 will contain `%union' declaration.
16490 (parse_union_decl): Delete #line directive output.
16491 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
16492 informations about %union.
16493 (parse_union_decl): Copy the union_obstack in the muscle stype.
16494 * src/bison.simple: Add new #line directive.
16495 Add typdef %%stype YYSTYPE.
16496
16497 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
16498
16499 * src/bison.simple: Add new `#line' directive.
16500
16501 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
16502
16503 * src/bison.simple: New `#line' directive.
16504 * src/output.c (output_parser): Support new dynamic muscle input_line.
16505
16506 2001-09-22 Marc Autret <autret_m@epita.fr>
16507
16508 * src/output.c (output_master_parser): New.
16509 (output_parser): Be more re-entrant.
16510
16511 2001-09-21 Marc Autret <autret_m@epita.fr>
16512
16513 * src/reader.c (copy_definition, parse_union_decl): Update and use
16514 `linef' muscle.
16515 (copy_action): Likewise.
16516 Use obstack_1grow ().
16517 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
16518
16519 2001-09-21 Marc Autret <autret_m@epita.fr>
16520
16521 * src/options.c (option_table): Adjust.
16522 * src/lex.c (parse_percent_token): Fix.
16523
16524 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
16525
16526 * src/options.c (symtab.h): Include it, need by lex.h.
16527
16528 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
16529
16530 * src/lex.c (parse_percent_token): Change type of variable `tx', which
16531 is now an option_table_struct*.
16532 (option_strcmp): New function option_strcmp.
16533 (parse_percent_token): Call option_strcmp.
16534 * src/getargs.c (xalloc.h, options.h): Include it.
16535 (getargs): Call create_long_option_table.
16536 (getargs): Free longopts at the end of the function.
16537 (shortopts): Move in options.c.
16538 * src/options.c (create_long_option_table): New function. Convert
16539 information from option_table to option structure.
16540 * src/reader.c (options.h): Include it.
16541
16542 * src/Makefile.am: Adjust.
16543 * src/options.c (option_table): Create from longopts and percent_table.
16544 * src/getargs.c (longopts): Delete.
16545 * src/lex.c (struct percent_table_struct): Delete.
16546 (percent_table): Delete.
16547 (options.h): Include it.
16548 * src/options.c: Create.
16549 * src/options.h: Create.
16550 Declare enum opt_access_e.
16551 Define struct option_table_struct.
16552
16553 2001-09-20 Marc Autret <autret_m@epita.fr>
16554
16555 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
16556 sections of Bison.
16557
16558 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
16559
16560 * src/bison.simple: s/%%filename/%%skeleton.
16561 * src/muscle_tab.c (getargs.h): Include it.
16562 (muscle_init): Insert new muscle skeleton.
16563
16564 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
16565
16566 * src/output.c (output_parser): Delete unused variable actions_dumped.
16567
16568 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
16569
16570 * src/output.c (output): Delete call to reader_output_yylsp.
16571 * src/reader.c (reader): Likewise.
16572 * src/reader.h: Delete declaration of reader_output_yylsp.
16573
16574 2001-09-02 Marc Autret <autret_m@epita.fr>
16575
16576 * src/reader.c: Include muscle_tab.h.
16577 (parse_union_decl): Update.
16578 (parse_macro_decl): Rename parse_muscle_decl.
16579 Update to use renamed functions and variable.
16580 (read_declarations, copy_action, read_additionnal_code, : Updated
16581 with correct variables and functions names.
16582 (packsymbols, reader): Likewise.
16583
16584 * src/reader.h (muscle_obstack): Extern declaration update.
16585
16586 * src/output.c: Include muscle_tab.h
16587 In all functions using macro_insert, change by using muscle_insert ().
16588 (macro_obstack): Rename muscle_obstack.
16589 Echo modifications in the whole file.
16590 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
16591 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
16592 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
16593
16594 * src/muscle_tab.h: Update double inclusion macros.
16595 (macro_entry_s): Rename muscle_entry_s.
16596 Update prototypes.
16597
16598 * src/muscle_tab.c: Include muscle_tab.h.
16599 Rename macro_tabble to muscle_table.
16600 (mhash1, mhash2, mcmp): Use muscle_entry.
16601 (macro_init): Rename muscle_init. Update.
16602 (macro_insert): Rename muscle_insert. Update.
16603 (macro_find): Rename muscle_find. Update.
16604
16605 * src/main.c: Include muscle_tab.h.
16606 (main): Call muscle_init ().
16607 * src/Makefile.am (bison_SOURCES): Echo modifications.
16608
16609 2001-09-02 Marc Autret <autret_m@epita.fr>
16610
16611 Now the files macro_tab.[ch] are named muscle_tab.[ch].
16612
16613 * src/muscle_tab.c, src/muscle_tab.h: Add files.
16614
16615 2001-09-02 Marc Autret <autret_m@epita.fr>
16616
16617 * src/macrotab.c, src/macrotab.h: Remove.
16618
16619 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
16620
16621 * src/reader.c (copy_guard): Use muscle to specify the `#line'
16622 filename.
16623
16624 2001-09-01 Marc Autret <autret_m@epita.fr>
16625
16626 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
16627 to an explicit value to activate the feature. We do it here.
16628
16629 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16630
16631 * src/output.c (prepare): Delete the `filename' muscule insertion.
16632 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
16633 (parse_union_decl): Likewise.
16634 * src/macrotab.c (macro_init): Initialize filename by infile.
16635
16636 2001-08-31 Marc Autret <autret_m@epita.fr>
16637
16638 * src/bison.simple (YYLSP_NEEDED): New definition.
16639 * src/output.c (prepare): Add macro insertion of `locations_flag'
16640
16641 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16642
16643 * src/output.c (prepare): Delete insertion of previous muscles,
16644 and insert the `prefix' muscles.
16645 * src/macrotab.c (macro_init): Likewise.
16646 (macro_init): Initialization prefix directive by `yy'.
16647 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
16648 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
16649 yylval, yydebug, yyerror, yynerrs and yyparse.
16650 New directive `#define' to substitute yydebug, ... with option
16651 name_prefix.
16652
16653 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16654
16655 * src/main.c (main): Standardize.
16656 * src/output.c (output_table_data, output_parser): Likewise.
16657 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
16658
16659 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
16660
16661 * src/reader.c (read_additionnal_code): Rename %%user_code to
16662 %%epilogue.
16663 * src/output.c (output): Rename %%declarations to %%prologue.
16664 * src/bison.simple: Echo modifications.
16665
16666 2001-08-31 Marc Autret <autret_m@epita.fr>
16667
16668 * src/reader.c (readgram): CleanUp.
16669 (output_token_defines): Likewise.
16670 (packsymbols): Likewise.
16671 (reader): Likewise.
16672 * src/output.c (output): CPP-out useless code.
16673
16674 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16675
16676 * src/reader.c (reader): Delete obsolete call to function
16677 output_trailers and output_headers.
16678 * src/output.h: Remove obsolete functions prototypes of output_headers
16679 and output_trailers.
16680
16681 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
16682
16683 * src/main.c: Include macrotab.h.
16684 * src/macrotab.h (macro_entry_s): Constify fields.
16685 Adjust functions prototypes.
16686 * src/macrotab.c (macro_insert): Constify key and value.
16687 (macro_find): Constify key.
16688 (macro_insert): Include 'xalloc.h'
16689 (macro_insert): Use XMALLOC.
16690 (macro_find): Constify return value.
16691 * src/output.c (output_table_data): Rename table to table_data.
16692 (output_parser): Constify macro_key, macro_value.
16693
16694 2001-08-30 Marc Autret <autret_m@epita.fr>
16695
16696 * src/reader.c (parse_skel_decl): New.
16697 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
16698 * src/lex.h (token_t): New token `tok_skel'.
16699 * src/lex.c (percent_table): Add skeleton option entry.
16700 Standardize.
16701
16702 2001-08-29 Marc Autret <autret_m@epita.fr>
16703
16704 * src/bison.simple: Add %%user_code directive at the end.
16705 * src/reader.c (read_additionnal_code): New.
16706 (reader): Use it.
16707 * src/output.c (output_program): Remove.
16708 (output): Update.
16709
16710 2001-08-28 Marc Autret <autret_m@epita.fr>
16711
16712 * src/output.c (output_actions): Clean up.
16713 (output_gram): CPP-out useless code.
16714 * src/reader.c (reader): Clean up, CPP-out useless code.
16715
16716 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
16717
16718 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
16719 directive.
16720 * src/bison.simple: Add `%%definitions'.
16721
16722 2001-08-28 Marc Autret <autret_m@epita.fr>
16723
16724 * config/depcomp: New file.
16725
16726 2001-08-27 Paul Eggert <eggert@twinsun.com>
16727
16728 * src/bison.simple (yyparse): Don't take the address of an
16729 item before the start of an array, as that doesn't conform to
16730 the C Standard.
16731
16732 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
16733
16734 * src/output.c (output): Remove the initialization of the macro
16735 obstack. It was done too late here.
16736
16737 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
16738 completely wrong.
16739 (reader): Initialize the macro obstack here, since we need it to grow
16740 '%define' directives.
16741
16742 * src/reader.h: Declare the macro obstack as extern.
16743
16744 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
16745
16746 * src/output.c (output_parser): Fix. Store single '%' characters in
16747 the output obstack instead of throwing them away.
16748
16749 2001-08-27 Akim Demaille <akim@epita.fr>
16750
16751 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16752
16753 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16754
16755 * lib/Makefile.am: Adjust.
16756
16757 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16758
16759 * src/bison.simple: Update and add '%%' directives.
16760
16761 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16762
16763 * src/reader.c (reader): Remove calls to 'output_headers' and
16764 'output_trailers'. Remove some C output.
16765 (readgram): Disable a piece of code that was writing a default
16766 definition for 'YYSTYPE'.
16767 (reader_output_yylsp): Remove.
16768 (packsymbols): Output token defintions to a macro.
16769 (copy_definition): Disable C output.
16770
16771 * src/reader.c (parse_macro_decl): New function used to parse macro
16772 declarations.
16773 (copy_string2): Put the body of copy_string into this new function.
16774 Add a parameter to let the caller choose whether he wants to copy the
16775 string delimiters or not.
16776 (copy_string): Be a simple call to copy_string2 with the last argument
16777 bound to true.
16778 (read_declarations): Add case for macro definition.
16779 (copy_identifier): New.
16780 (parse_macro_decl): Read macro identifiers using copy_identifier
16781 rather than lex.
16782
16783 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16784
16785 * src/output.c (prepare): Add prefixed names.
16786 (output_parser): Output semantic actions.
16787 (output_parser): Fix bug on '%%line' directives.
16788
16789 * src/output.c (output_headers): Remove. The C code printed by this
16790 function should now be in the skeletons.
16791 (output_trailers): Remove.
16792 (output): Disable call to 'reader_output_yylsp'.
16793 (output_rule_data): Do not output tables to the table obstack.
16794
16795 * src/output.c: Remove some C dedicated output.
16796 Improve the use of macro and output obstacks.
16797 (output_defines): Remove.
16798
16799 * src/output.c (output_token_translations): Associate 'translate'
16800 table with a macro. No output to the table obstack.
16801 (output_gram): Same for 'rhs' and 'prhs'.
16802 (output_stos): Same for 'stos'.
16803 (output_rule_data): Same for 'r1' and 'r2'.
16804 (token_actions): Same for 'defact'.
16805 (goto_actions): Same for 'defgoto'.
16806 (output_base): Same for 'pact' and 'pgoto'.
16807 (output_table): Same for 'table'.
16808 (output_check): Same for 'check'.
16809
16810 * src/output.c (output_table_data): New function.
16811 (output_short_table): Remove.
16812 (output_short_or_char_table): Remove.
16813
16814 * src/output.c (output_parser): Replace most of the skeleton copy code
16815 with something new. Skeletons are now processed character by character
16816 rather than line by line, and Bison looks for '%%' macros. This is the
16817 first step in making Bison's output process (a lot) more flexible.
16818 (output_parser): Use the macro table.
16819
16820 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16821
16822 * src/main.c (main): Initialize the macro table.
16823
16824 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16825
16826 * src/lex.c (percent_table): Add tok_define.
16827 * src/lex.h: Add tok_define.
16828
16829 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16830
16831 * src/macrotab.c: New file.
16832 * src/macrotab.h: New file.
16833 * src/Makefile.am: Update.
16834
16835 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16836
16837 * lib/hash.c: New file.
16838 * lib/hash.h: New file.
16839 * lib/Makefile.am: Update.
16840
16841 2001-08-15 Akim Demaille <akim@epita.fr>
16842
16843 Version 1.28c.
16844
16845 2001-08-15 Marc Autret <autret_m@epita.fr>
16846
16847 * src/reader.c (readgram): Indent output macro YYSTYPE.
16848 (packsymbols): Likewise.
16849 (output_token_defines): Likewise.
16850 * src/files.c: Standardize.
16851 (compute_header_macro): New.
16852 (defines_obstack_save): New. Use compute_header_macro.
16853 (output_files): Update. Use defines_obstack_save.
16854
16855 2001-08-15 Akim Demaille <akim@epita.fr>
16856
16857 * doc/bison.texinfo (Table of Symbols): Document
16858 YYSTACK_USE_ALLOCA.
16859
16860 2001-08-15 Akim Demaille <akim@epita.fr>
16861
16862 * missing: Update from CVS Automake.
16863 * config/config.guess, config/config.sub, config/texinfo.tex:
16864 Update from gnu.org.
16865
16866 2001-08-15 Akim Demaille <akim@epita.fr>
16867
16868 * Makefile.maint: Sync with CVS Autoconf.
16869
16870 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
16871
16872 * doc/bison.texinfo: Include GNU Free Documentation License from
16873 `fdl.texi'.
16874 * doc/fdl.texi: Add to package.
16875
16876 2001-08-14 Marc Autret <autret_m@epita.fr>
16877
16878 Turn on %{source,header}_extension features.
16879
16880 * src/lex.c (percent_table): Un-CPP out header_extension and
16881 source_extension.
16882 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
16883 (compute_exts_from_src): Remove conditions. It restores priorities
16884 between options.
16885
16886 2001-08-14 Marc Autret <autret_m@epita.fr>
16887
16888 * src/files.c (compute_base_names): Add extensions computing when
16889 `--file-prefix' used.
16890 Standardize function calls.
16891
16892 2001-08-13 Marc Autret <autret_m@epita.fr>
16893
16894 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
16895 defining it (defined but null disables alloca).
16896
16897 2001-08-13 Marc Autret <autret_m@epita.fr>
16898
16899 * src/bison.simple (_yy_memcpy): CPP reformat.
16900
16901 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
16902
16903 * tests/atconfig.in (CPPFLAGS): Fix.
16904
16905 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
16906
16907 * doc/bison.texinfo: Include GNU General Public License from
16908 `gpl.texi'.
16909 * doc/gpl.texi: Add to package.
16910
16911 2001-08-10 Marc Autret <autret_m@epita.fr>
16912
16913 * src/print_graph.h: Fix.
16914 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
16915
16916 2001-08-10 Akim Demaille <akim@epita.fr>
16917
16918 * src/system.h: Provide default declarations for stpcpy, strndup,
16919 and strnlen.
16920
16921 2001-08-10 Robert Anisko <anisko_r@epita.fr>
16922
16923 * doc/bison.texinfo (Locations): Update @$ stuff.
16924
16925 2001-08-09 Robert Anisko <anisko_r@epita.fr>
16926
16927 * src/bison.simple (YYLLOC_DEFAULT): Update.
16928 (yyparse): Adjust.
16929
16930 2001-08-08 Marc Autret <autret_m@epita.fr>
16931
16932 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
16933 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
16934 Reported by Fabrice Bauzac.
16935
16936 2001-08-08 Marc Autret <autret_m@epita.fr>
16937
16938 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
16939 * src/vcg.c (output_node): Fix.
16940 * src/vcg.h: Cleanup.
16941 * src/print_graph.c: Add comments.
16942 (node_output_size): New global variable. Simplify the formatting of
16943 the VCG graph output.
16944 (print_actions): Unused code is now used. It notifies the final state
16945 and no action states in the VCG graph. It also give the reduce actions.
16946 The `shift and goto' edges are red and the `go to state' edges are
16947 blue.
16948 Get the current node name and node_obstack by argument.
16949 (node_obstack): New variable.
16950 (print_state): Manage node_obstack.
16951 (print_core): Use node_obstack given by argument.
16952 A node is not only computed here but in print_actions also.
16953 (print_graph): CPP out useless code instead of commenting it.
16954
16955 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
16956
16957 * tests/atconfig.in (CPPFLAGS): Fix.
16958
16959 2001-08-07 Akim Demaille <akim@epita.fr>
16960
16961 * src/print_graph.c (quote): New.
16962 (print_core): Use it.
16963
16964 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
16965
16966 * src/vcg.c (complain.h): Include it.
16967 Unepitaize `return' invocations.
16968 [NDEBUG] (main): Remove.
16969 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
16970 * src/files.c (open_files): Initialize graph_obstack.
16971 * src/print_graph.c (print_actions): CPP out useless code.
16972 (print_core): Don't output the last `\n' in labels.
16973 Use `quote'.
16974 * src/files.c (output_files): Output the VCG file.
16975 * src/main.c (main): Invoke print_graph ();
16976
16977 2001-08-06 Marc Autret <autret_m@epita.fr>
16978
16979 Automaton VCG graph output.
16980 Using option ``-g'' or long option ``--graph'', you can generate
16981 a gram_filename.vcg file containing a VCG description of the LALR (1)
16982 automaton of your grammar.
16983
16984 * src/main.c: Call to print_graph() function.
16985 * src/getargs.h: Update.
16986 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
16987 (graph_flag): New flag.
16988 (longopts): Update.
16989 (getargs): Add case `g'.
16990 * src/files.c (graph_obstack): New obstack struct.
16991 (open_files): Initialize new obstack.
16992 (output_files): Saves graph_obstack if required.
16993 * src/files.h (graph_obstack): New extern declaration.
16994 * src/Makefile.am: Add new source files.
16995
16996 2001-08-06 Marc Autret <autret_m@epita.fr>
16997
16998 * src/print_graph.c, src/print_graph.h (graph): New.
16999 * src/vcg.h: New file.
17000 * src/vcg.c: New file, VCG graph handling.
17001
17002 2001-08-06 Marc Autret <autret_m@epita.fr>
17003
17004 Add of %source_extension and %header_extension which specify
17005 the source or/and the header output file extension.
17006
17007 * src/files.c (compute_base_names): Remove initialisation of
17008 src_extension and header_extension.
17009 (compute_exts_from_gf): Update.
17010 (compute_exts_from_src): Update.
17011 (output_files): Update.
17012 * src/reader.c (parse_header_extension_decl): New.
17013 (parse_source_extension_decl): New.
17014 (read_declarations): New case statements for the new tokens.
17015 * src/lex.c (percent_table): Add entries for %source_extension
17016 and %header_extension.
17017 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
17018
17019 2001-08-06 Marc Autret <autret_m@epita.fr>
17020
17021 * configure.in: Bump to 1.28c.
17022 * doc/bison.texinfo: Texinfo thingies.
17023
17024 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
17025
17026 * tests/atconfig.in (CPPFLAGS): Add.
17027 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
17028
17029 2001-08-03 Akim Demaille <akim@epita.fr>
17030
17031 Version 1.28b.
17032
17033 2001-08-03 Akim Demaille <akim@epita.fr>
17034
17035 * tests/Makefile.am (check-local): Ship testsuite.
17036 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
17037 Include `string.h'.
17038
17039 2001-08-03 Akim Demaille <akim@epita.fr>
17040
17041 * configure.in: Try using -Wformat when compiling.
17042
17043 2001-08-03 Akim Demaille <akim@epita.fr>
17044
17045 * configure.in: Bump to 1.28b.
17046
17047 2001-08-03 Akim Demaille <akim@epita.fr>
17048
17049 * src/complain.c: Adjust strerror_r portability issues.
17050
17051 2001-08-03 Akim Demaille <akim@epita.fr>
17052
17053 Version 1.28a.
17054
17055 2001-08-03 Akim Demaille <akim@epita.fr>
17056
17057 * src/getargs.c, src/getarg.h (skeleton)): Constify.
17058 * src/lex.c (literalchar): Avoid name clashes on `buf'.
17059 * src/getargs.c: Include complain.h.
17060 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
17061 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
17062
17063 2001-08-03 Akim Demaille <akim@epita.fr>
17064
17065 * src/reader.c (readgram): Display hidden chars in error messages.
17066
17067 2001-08-03 Akim Demaille <akim@epita.fr>
17068
17069 Update to gettext 0.10.39.
17070
17071 2001-08-03 Akim Demaille <akim@epita.fr>
17072
17073 * lib/strspn.c: New.
17074
17075 2001-08-01 Marc Autret <autret_m@epita.fr>
17076
17077 * doc/bison.texinfo: Update.
17078 * doc/bison.1 (mandoc): Update.
17079 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
17080 * src/files.c: Support output files extensions computing.
17081 (src_extension): New static variable.
17082 (header_extension): New static variable.
17083 (tr): New function.
17084 (get_extension_index): New function, gets the index of an extension
17085 filename in a string.
17086 (compute_exts_from_gf): New function, computes extensions from the
17087 grammar file extension.
17088 (compute_exts_from_src): New functions, computes extensions from the
17089 C source file extension, file given by ``-o'' option.
17090 (compute_base_names): Update.
17091 (output_files): Update.
17092
17093 2001-08-01 Robert Anisko <anisko_r@epita.fr>
17094
17095 * doc/bison.texi: Document @$.
17096 (Locations): New section.
17097
17098 2001-07-18 Akim Demaille <akim@epita.fr>
17099
17100 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
17101 * config/prev-version.txt, config/move-if-change: New.
17102 * Makefile.am: Adjust.
17103
17104 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
17105
17106 * src/bison.simple (yyparse): Suppress warning `comparaison
17107 between signed and unsigned'.
17108
17109 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
17110
17111 * src/getargs.h (raw_flag): Remove.
17112 * src/getargs.c: Die on `-r'/`--raw'.
17113 * src/lex.c (parse_percent_token): Die on `%raw'.
17114 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
17115 * tests/calc.at: Suppress test with option `--raw'.
17116
17117 2001-07-14 Akim Demaille <akim@epita.fr>
17118
17119 * config/: New.
17120 * configure.in: Require Autoconf 2.50.
17121 Update to gettext 0.10.38.
17122
17123 2001-03-16 Akim Demaille <akim@epita.fr>
17124
17125 * doc/bison.texinfo: ANSIfy the examples.
17126
17127 2001-03-16 Akim Demaille <akim@epita.fr>
17128
17129 * getargs.c (skeleton): New variable.
17130 (longopts): --skeleton is a new option.
17131 (shortopts, getargs): -S is a new option.
17132 * getargs.h: Declare skeleton.
17133 * output.c (output_parser): Use it.
17134
17135 2001-03-16 Akim Demaille <akim@epita.fr>
17136
17137 * m4/strerror_r.m4: New.
17138 * m4/error.m4: Run AC_FUNC_STRERROR_R.
17139 * lib/error.h, lib/error.c: Update.
17140
17141 2001-03-16 Akim Demaille <akim@epita.fr>
17142
17143 * src/getargs.c (longopts): Clean up.
17144
17145 2001-02-21 Akim Demaille <akim@epita.fr>
17146
17147 * src/reader.c (gensym): `gensym_count' is your own.
17148 Use a static buf to create the symbol name, as token_buffer is no
17149 longer a buffer.
17150
17151 2001-02-08 Akim Demaille <akim@epita.fr>
17152
17153 * src/conflicts.c (conflict_report): Be sure not to append to res
17154 between two calls, which could happen if both first sprintf were
17155 skipped, but not the first cp += strlen.
17156
17157 2001-02-08 Akim Demaille <akim@epita.fr>
17158
17159 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
17160 New, from fileutils 4.0.37.
17161 * configure.in: Require Autoconf 2.49c. I took some time before
17162 making this decision. This is the only way out for portability
17163 issues in Bison, it would mean way too much duplicate effort to
17164 import in Bison features implemented in 2.49c since 2.13.
17165 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
17166
17167 2001-02-02 Akim Demaille <akim@epita.fr>
17168
17169 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
17170 * lib/xalloc.h, lib/xmalloc.c: Update.
17171
17172 2001-01-19 Akim Demaille <akim@epita.fr>
17173
17174 Get rid of the ad hoc handling of token_buffer in the scanner: use
17175 the obstacks.
17176
17177 * src/lex.c (token_obstack): New.
17178 (init_lex): Initialize it. No longer call...
17179 (grow_token_buffer): this. Remove it.
17180 Adjust all the places which used it to use the obstack.
17181
17182 2001-01-19 Akim Demaille <akim@epita.fr>
17183
17184 * src/lex.h: Rename all the tokens:
17185 s/\bENDFILE\b/tok_eof/g;
17186 s/\bIDENTIFIER\b/tok_identifier/g;
17187 etc.
17188 Let them be enums, not #define, to ease debugging.
17189 Adjust all the code.
17190
17191 2001-01-18 Akim Demaille <akim@epita.fr>
17192
17193 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
17194 * src/lex.c (maxtoken, grow_token_buffer): Static.
17195
17196 2001-01-18 Akim Demaille <akim@epita.fr>
17197
17198 Since we now use obstacks, more % directives can be enabled.
17199
17200 * src/lex.c (percent_table): Also accept `%yacc',
17201 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
17202 `%debug'.
17203 Handle the actions for `%semantic_parser' and `%pure_parser' here,
17204 instead of returning a token.
17205 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
17206 * src/reader.c (read_declarations): Adjust.
17207 * src/files.c (open_files): Don't call `compute_base_names', don't
17208 compute `attrsfile' since they depend upon data which might be
17209 *in* the input file now.
17210 (output_files): Do it here.
17211 * src/output.c (output_headers): Document the fact that this patch
17212 introduces a guaranteed SEGV for semantic parsers.
17213 * doc/bison.texinfo: Document them.
17214 * tests/suite.at: Exercise these %options.
17215
17216 2000-12-20 Akim Demaille <akim@epita.fr>
17217
17218 Also handle the output file (--verbose) with obstacks.
17219
17220 * files.c (foutput): Remove.
17221 (output_obstack): New.
17222 Adjust all dependencies.
17223 * src/conflicts.c: Return a string.
17224 * src/system.h (obstack_grow_string): Rename as...
17225 (obstack_sgrow): this. Be ready to work with non literals.
17226 (obstack_fgrow4): New.
17227
17228 2000-12-20 Akim Demaille <akim@epita.fr>
17229
17230 * src/files.c (open_files): Fix the computation of short_base_name
17231 in the case of `-o foo.tab.c'.
17232
17233 2000-12-20 Akim Demaille <akim@epita.fr>
17234
17235 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
17236 (copy_dollar): Now that everything uses obstacks, get rid of the
17237 FILE * parameters.
17238
17239 2000-12-20 Akim Demaille <akim@epita.fr>
17240
17241 * src/files.c (open_files): Actually the `.output' file is based
17242 on the short_base_name, not base_name.
17243 * tests/suite.at (Checking output file names): Adjust.
17244
17245 2000-12-20 Akim Demaille <akim@epita.fr>
17246
17247 * src/bison.s1: Remove, we now use directly...
17248 * src/bison.simple: this.
17249 * src/Makefile.am: Use pkgdata instead of data.
17250
17251 2000-12-20 Akim Demaille <akim@epita.fr>
17252
17253 * src/files.c (guard_obstack): New.
17254 (open_files): Initialize it.
17255 (output_files): Dump it...
17256 * src/files.h: Export it.
17257 * src/reader.c (copy_guard): Use it.
17258
17259 2000-12-19 Akim Demaille <akim@epita.fr>
17260
17261 * src/files.c (outfile, defsfile, actfile): Removed as global
17262 vars.
17263 (open_files): Don't compute them.
17264 (output_files): Adjust.
17265 (base_name, short_base_name): Be global.
17266 Adjust dependencies.
17267
17268 2000-12-19 Akim Demaille <akim@epita.fr>
17269
17270 * src/files.c (strsuffix): New.
17271 (stringappend): Be just like strcat but allocate.
17272 (base_names): Eve out from open_files.
17273 Try to simplify the rather hairy computation of base_name and
17274 short_base_name.
17275 (open_files): Use it.
17276 * tests/suite.at (Checking output file names): New test.
17277
17278 2000-12-19 Akim Demaille <akim@epita.fr>
17279
17280 * src/system.h (obstack_grow_literal_string): Rename as...
17281 (obstack_grow_string): this.
17282 * src/output.c (output_parser): Recognize `%% actions' instead of
17283 `$'.
17284 * src/bison.s1: s/$/%% actions/.
17285 * src/bison.hairy: Likewise.
17286
17287 2000-12-19 Akim Demaille <akim@epita.fr>
17288
17289 * src/output.c (output_parser): Compute the `#line' lines when
17290 there are.
17291 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
17292 Suggested by Hans Aberg.
17293
17294 2000-12-19 Akim Demaille <akim@epita.fr>
17295
17296 Let the handling of the skeleton files be local to the procedures
17297 that use it.
17298
17299 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
17300 longer static.
17301 (fparser, open_extra_files): Remove.
17302 (open_files, output_files): Don't take care of fparser.
17303 * src/files.h: Adjust.
17304 * src/output.c (output_parser): Open and close the file to the
17305 skeleton.
17306 * src/reader.c (read_declarations): When %semantic_parser, open
17307 fguard.
17308
17309 2000-12-19 Akim Demaille <akim@epita.fr>
17310
17311 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
17312 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
17313
17314 2000-12-19 Akim Demaille <akim@epita.fr>
17315
17316 * src/files.c (open_files): Yipee! We no longer need all the code
17317 looking for `/tmp' since we have no tmp file.
17318
17319 2000-12-19 Akim Demaille <akim@epita.fr>
17320
17321 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
17322 New macros.
17323 * src/files.c (open_files): Less dependency on MSDOS etc.
17324
17325 2000-12-14 Akim Demaille <akim@epita.fr>
17326
17327 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
17328 Provide a default definition.
17329 Use it when executing the default @ action.
17330 * src/reader.c (reader_output_yylsp): No longer include
17331 `timestamp' and `text' in the default YYLTYPE.
17332
17333 2000-12-12 Akim Demaille <akim@epita.fr>
17334
17335 * src/reader.c (copy_definition, parse_union_decl, copy_action)
17336 (copy_guard): Quote the file names.
17337 Reported by Laurent Mascherpa.
17338
17339 2000-12-12 Akim Demaille <akim@epita.fr>
17340
17341 * src/output.c (output_headers, output_program, output): Be sure
17342 to escape special characters when outputting filenames.
17343 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
17344 (output_headers): Don't depend on them, Use ACTSTR.
17345
17346 2000-11-17 Akim Demaille <akim@epita.fr>
17347
17348 * lib/obstack.h: Formatting changes.
17349 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
17350 prevents type checking.
17351 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
17352 cast the value to (void *): assigning a `foo *' to a `void *'
17353 variable is valid.
17354 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
17355 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
17356 append characters.
17357
17358 2000-11-17 Akim Demaille <akim@epita.fr>
17359
17360 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
17361 as...
17362 (suite.m4, regression.m4, calc.m4): these.
17363 * tests/atgeneral.m4: Update from CVS Autoconf.
17364
17365 2000-11-17 Akim Demaille <akim@epita.fr>
17366
17367 * tests/regression.m4 (%union and --defines): New test,
17368 demonstrating a current bug in the obstack implementation.
17369
17370 2000-11-17 Akim Demaille <akim@epita.fr>
17371
17372 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
17373 macros.
17374 Use them to declare the variables which are global or local to
17375 `yyparse'.
17376
17377 2000-11-17 Akim Demaille <akim@epita.fr>
17378
17379 * acconfig.h: Remove, no longer used.
17380
17381 2000-11-07 Akim Demaille <akim@epita.fr>
17382
17383 * src: s/Copyright (C)/Copyright/g.
17384
17385 2000-11-07 Akim Demaille <akim@epita.fr>
17386
17387 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
17388 defining.
17389 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
17390
17391 2000-11-07 Akim Demaille <akim@epita.fr>
17392
17393 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
17394 Merge in a single CPP if/else.
17395
17396 2000-11-07 Akim Demaille <akim@epita.fr>
17397
17398 * src/output.c (output): Remove useless variables.
17399 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
17400 argument `data' for consistency with the prototypes.
17401 Qualify it `const'.
17402 (obstack_copy, obstack_copy0): Rename the second argument as
17403 `address' for consistency. Qualify it `const'.
17404 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
17405 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
17406 `const' their input argument (`data' or `address').
17407 Adjust the corresponding macros to include `const' in casts.
17408
17409 2000-11-03 Akim Demaille <akim@epita.fr>
17410
17411 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
17412 s/PFILE1/BISON_HAIRY/.
17413 Adjust dependencies.
17414
17415 2000-11-03 Akim Demaille <akim@epita.fr>
17416
17417 For some reason, this was not applied.
17418
17419 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
17420 `unlink': it's no longer used.
17421
17422 2000-11-03 Akim Demaille <akim@epita.fr>
17423
17424 * src/files.c (skeleton_find): New function, eved out of...
17425 (open_files, open_extra_files): here.
17426
17427 2000-11-03 Akim Demaille <akim@epita.fr>
17428
17429 Don't use `atexit'.
17430
17431 * src/files.c (obstack_save): New function.
17432 (done): Rename as...
17433 (output_files): this.
17434 Use `obstack_save'.
17435 * src/main.c (main): Don't use `atexit' to register `done', since
17436 it no longer has to remove tmp files, just call `output_files'
17437 when there are no errors.
17438
17439 2000-11-02 Akim Demaille <akim@epita.fr>
17440
17441 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
17442 `unlink': it's no longer used.
17443 * src/files.h: Formatting changes.
17444
17445 2000-11-02 Akim Demaille <akim@epita.fr>
17446
17447 Remove the last uses of mktemp and unlink/delete.
17448
17449 * src/files.c (fdefines, ftable): Removed.
17450 (defines_ostack, table_obstack): New.
17451 Adjust dependencies of the former into uses of the latter.
17452 * src/output.c (output_short_or_char_table, output_short_table):
17453 Convert to using obstacks.
17454 * src/reader.c (copy_comment2): Accept one FILE * and two
17455 obstacks.
17456 (output_token_defines, reader_output_yylsp): Use obstacks.
17457 * src/system.h (obstack_fgrow3): New.
17458 * po/POTFILES.in: Adjust.
17459
17460 2000-11-01 Akim Demaille <akim@epita.fr>
17461
17462 Change each use of `fattrs' into a use of `attrs_obstack'.
17463
17464 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
17465 * src/files.c (fattrs): Remove.
17466 (attrs_obstack): New.
17467 Adjust all dependencies.
17468 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
17469
17470 2000-11-01 Akim Demaille <akim@epita.fr>
17471
17472 Introduce obstacks.
17473 Change each use of `faction' into a use of `action_obstack'.
17474
17475 * lib/obstack.h, lib/obstack.c: New files.
17476 * src/files.c (faction): Remove.
17477 (action_obstack): New.
17478 Adjust all dependencies.
17479
17480 2000-10-20 Akim Demaille <akim@epita.fr>
17481
17482 * lib/quote.h (PARAMS): New macro. Use it.
17483
17484 2000-10-16 Akim Demaille <akim@epita.fr>
17485
17486 * src/output.c (output_short_or_char_table): New function.
17487 (output_short_table, output_token_translations): Use it.
17488 (goto_actions): Use output_short_table.
17489
17490 2000-10-16 Akim Demaille <akim@epita.fr>
17491
17492 * src/symtab.c (bucket_new): New function.
17493 (getsym): Use it.
17494
17495 * src/output.c (output_short_table): New argument to display the
17496 comment associated with the table.
17497 Adjust dependencies.
17498 (output_gram): Use it.
17499 (output_rule_data): Nicer output layout for YYTNAME.
17500
17501 2000-10-16 Akim Demaille <akim@epita.fr>
17502
17503 * src/lex.c (read_typename): New function.
17504 (lex): Use it.
17505 * src/reader.c (copy_dollar): Likewise.
17506
17507 2000-10-16 Akim Demaille <akim@epita.fr>
17508
17509 * src/reader.c (copy_comment2): Expect the input stream to be on
17510 the `/' which is suspected to open a comment, instead of being
17511 called after `//' or `/*' was read.
17512 (copy_comment, copy_definition, parse_union_decl, copy_action)
17513 (copy_guard): Adjust.
17514
17515 2000-10-16 Akim Demaille <akim@epita.fr>
17516
17517 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
17518 `read_signed_integer'.
17519
17520 2000-10-16 Akim Demaille <akim@epita.fr>
17521
17522 * src/reader.c (copy_dollar): New function.
17523 (copy_guard, copy_action): Use it.
17524
17525 2000-10-16 Akim Demaille <akim@epita.fr>
17526
17527 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
17528 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
17529 New files, from Fileutils 4.0.27.
17530 * src/main.c (printable_version): Remove.
17531 * src/lex.c, src/reader.c: Use `quote'.
17532
17533 2000-10-04 Akim Demaille <akim@epita.fr>
17534
17535 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
17536
17537 2000-10-04 Akim Demaille <akim@epita.fr>
17538
17539 * doc/bison.texinfo: Various typos spotted by Neil Booth.
17540
17541 2000-10-04 Akim Demaille <akim@epita.fr>
17542
17543 When a literal string is used to define two different tokens,
17544 `bison -v' segfaults.
17545 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
17546
17547 * tests/regression.m4: New file.
17548 Include the core of the sample provided by Piotr Gackiewicz.
17549 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
17550 properly.
17551
17552 2000-10-04 Akim Demaille <akim@epita.fr>
17553
17554 * src/reader.c (parse_expect_decl): Keep `count' within the size
17555 of `buffer'.
17556 From Neil Booth.
17557
17558 2000-10-02 Paul Eggert <eggert@twinsun.com>
17559
17560 * bison.s1 (yyparse): Assign the default value
17561 unconditionally, to avoid a GCC warning and make the parser a
17562 tad smaller.
17563
17564 2000-10-02 Akim Demaille <akim@epita.fr>
17565
17566 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
17567 options.
17568
17569 2000-10-02 Akim Demaille <akim@epita.fr>
17570
17571 * src/derives.c, src/print.c, src/reduce.c: To ease the
17572 translation, move some `\n' out of the translated strings.
17573
17574 2000-10-02 Akim Demaille <akim@epita.fr>
17575
17576 The location tracking mechanism is precious for parse error
17577 messages. Nevertheless, it is enabled only when `@n' is used in
17578 the grammar, which is a different issue (you can use it in error
17579 message, but not in the grammar per se). Therefore, there should
17580 be another means to enable it.
17581
17582 * src/getargs.c (getargs): Support `--locations'.
17583 (usage): Report it.
17584 * src/getargs.h (locationsflag): Export it.
17585 * src/lex.c (percent_table): Support `%locations'.
17586 * src/reader.c (yylsp_needed): Remove this variable, now replaced
17587 with `locationsflag'.
17588 * doc/bison.texinfo: Document `--locations' and `%locations'.
17589 Sort the options.
17590 * tests/calc.m4: Test it.
17591
17592 For regularity of the names, replace each
17593 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
17594 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
17595 In addition replace each `flag' with `_flag'.
17596
17597 2000-10-02 Akim Demaille <akim@epita.fr>
17598
17599 Also test parse error messages, including with YYERROR_VERBOSE.
17600
17601 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
17602 associative).
17603 Use it to check the computations.
17604 Use it to check `nonassoc' is honored.
17605 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
17606 `--yyerror-verbose'.
17607 (_AT_CHECK_CALC): Adjust to this option.
17608 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
17609
17610 2000-10-02 Akim Demaille <akim@epita.fr>
17611
17612 Test also `--verbose', `--defines' and `--name-prefix'. Testing
17613 the latter demonstrates a flaw in the handling of non debugging
17614 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
17615 was used in order to simplify:
17616
17617 #if YYDEBUG
17618 if (yydebug)
17619 {
17620 ...
17621 }
17622 #endif
17623
17624 into
17625
17626 if (yydebug)
17627 {
17628 ...
17629 }
17630
17631 unfortunately this leads to a CPP conflict when
17632 `--name-prefix=foo' is used since it produces `#define yydebug
17633 foodebug'.
17634
17635 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
17636 (YYDPRINTF): New macro.
17637 Spread its use.
17638 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
17639 the bison options.
17640 Also test `--verbose', `--defines' and `--name-prefix'.
17641
17642 2000-10-02 Akim Demaille <akim@epita.fr>
17643
17644 Improve the readability of the produced parsers.
17645
17646 * src/bison.s1: Formatting changes.
17647 Improve the comment related to the `$' mark.
17648 (yydefault): Don't fall through to `yyresume': `goto' there.
17649 * src/output.c (output_parser): When the `$' is met, skip the end
17650 of its line.
17651 New variable, `number_of_dollar_signs', to check there's exactly
17652 one `$' in the parser skeleton.
17653
17654 2000-10-02 Akim Demaille <akim@epita.fr>
17655
17656 * lib/xstrdup.c: New file, from the fileutils.
17657 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
17658 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
17659 instead of strlen + xmalloc + strcpy.
17660 * src/symtab.c (copys): Remove, use xstrdup instead.
17661
17662 2000-10-02 Akim Demaille <akim@epita.fr>
17663
17664 * src/gram.h (associativity): New enum type which replaces the
17665 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
17666 `right_assoc', `left_assoc' and `non_assoc'.
17667 Adjust all dependencies.
17668 * src/reader.c: Formatting changes.
17669 (LTYPESTR): Don't define it, use it as a literal in
17670 `reader_output_yylsp'.
17671 * src/symtab.h (symbol_class): New enum type which replaces the
17672 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
17673 `sunknown', `stoken and `snterm'.
17674
17675 2000-10-02 Akim Demaille <akim@epita.fr>
17676
17677 * src/getargs.c (fixed_outfiles): Rename as...
17678 (yaccflag): for consistency and accuracy.
17679 Adjust dependencies.
17680
17681 2000-10-02 Akim Demaille <akim@epita.fr>
17682
17683 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
17684 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
17685 difficult and introduced a lot of core dump. It turns out that
17686 Bison used an implementation of `xmalloc' based on `calloc', and
17687 at various places it does depend upon the initialization to 0. I
17688 have not tried to isolate the pertinent places, and all the former
17689 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
17690 someone should address this issue.
17691
17692 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
17693 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
17694 files.
17695 Adjust dependencies.
17696 * src/warshall.h: New file.
17697 Propagate.
17698
17699 2000-10-02 Akim Demaille <akim@epita.fr>
17700
17701 Various anti-`extern in *.c' changes.
17702
17703 * src/system.h: Include `assert.h'.
17704
17705 2000-10-02 Akim Demaille <akim@epita.fr>
17706
17707 * src/state.h (nstates, final_state, first_state, first_shift)
17708 (first_reduction): Move their exportation from here...
17709 * src/LR0.h: to here.
17710 Adjust dependencies.
17711 * src/getargs.c (statisticsflag): New variable.
17712 Add support for `--statistics'.
17713 Adjust dependencies.
17714
17715 Remove a lot of now useless `extern' statements in most files.
17716
17717 2000-10-02 Akim Demaille <akim@epita.fr>
17718
17719 * src/LR0.h: New file.
17720 Propagate its use.
17721
17722 2000-10-02 Akim Demaille <akim@epita.fr>
17723
17724 * src/print.h: New file.
17725 Propagate its use.
17726 * src/print.c: Formatting and ordering changes.
17727 (verbose, terse): Replace with...
17728 (print_results): this new function.
17729 Adjust dependencies.
17730
17731 2000-10-02 Akim Demaille <akim@epita.fr>
17732
17733 * src/conflicts.c (conflict_report): New function.
17734 (conflict_log, verbose_conflict_log): Replace with...
17735 (print_conflicts): this function.
17736 Adjust dependencies.
17737 * src/conflicts.h: New file.
17738 Propagate its inclusion.
17739
17740 2000-10-02 Akim Demaille <akim@epita.fr>
17741
17742 * src/nullable.h: New file.
17743 Propagate its inclusion.
17744 * src/nullable.c: Formatting changes.
17745
17746 2000-10-02 Akim Demaille <akim@epita.fr>
17747
17748 * src/reduce.h: New file.
17749 Propagate its inclusion.
17750 * src/reduce.c: Topological sort and other formatting changes.
17751 (bool, TRUE, FALSE): Move their definition to...
17752 * src/system.h: here.
17753
17754 2000-10-02 Akim Demaille <akim@epita.fr>
17755
17756 * src/files.c: Formatting changes.
17757 (tryopen, tryclose, openfiles): Rename as...
17758 (xfopen, xfclose, open_files): this.
17759 (stringappend): static.
17760 * src/files.h: Complete the list of exported symbols.
17761 Propagate its use.
17762
17763 2000-10-02 Akim Demaille <akim@epita.fr>
17764
17765 * src/reader.h: New file.
17766 Propagate its use instead of tedious list of `extern' and
17767 prototypes.
17768 * src/reader.c: Formatting changes, topological sort,
17769 s/register//.
17770
17771 2000-10-02 Akim Demaille <akim@epita.fr>
17772
17773 * src/lex.h: Prototype `lex.c' exported functions.
17774 * src/reader.c: Adjust.
17775 * src/lex.c: Formatting changes.
17776 (safegetc): Rename as...
17777 (xgetc): this.
17778
17779 2000-10-02 Akim Demaille <akim@epita.fr>
17780
17781 * src/lalr.h: New file.
17782 Propagate its inclusion instead of prototypes and `extern'.
17783 * src/lalr.c: Formatting changes, topological sorting etc.
17784
17785 2000-10-02 Akim Demaille <akim@epita.fr>
17786
17787 * src/output.c (token_actions): Introduce a temporary array,
17788 YYDEFACT, that makes it possible for this function to use
17789 output_short_table.
17790
17791 2000-10-02 Akim Demaille <akim@epita.fr>
17792
17793 `user_toknums' is output as a `short[]' in `output.c', while it is
17794 defined as a `int[]' in `reader.c'. For consistency with the
17795 other output tables, `user_toknums' is now defined as a table of
17796 shorts.
17797
17798 * src/reader.c (user_toknums): Be a short table instead of an int
17799 table.
17800 Adjust dependencies.
17801
17802 Factor the short table outputs.
17803
17804 * src/output.c (output_short_table): New function.
17805 * src/output.c (output_gram, output_stos, output_rule_data)
17806 (output_base, output_table, output_check): Use it.
17807
17808 2000-10-02 Akim Demaille <akim@epita.fr>
17809
17810 * src/output.c (output): Topological sort of the functions, in
17811 order to get rid of the `static' prototypes.
17812 No longer use `register'.
17813 * src/output.h: New file.
17814 Propagate its inclusion in files explicitly prototyping functions
17815 from output.c.
17816
17817 2000-09-21 Akim Demaille <akim@epita.fr>
17818
17819 * src/atgeneral.m4: Update from Autoconf.
17820
17821 2000-09-21 Akim Demaille <akim@epita.fr>
17822
17823 * src/closure.h: New file.
17824 * src/closure.c: Formatting changes, topological sort over the
17825 functions, use of closure.h.
17826 (initialize_closure, finalize_closure): Rename as...
17827 (new_closure, free_closure): these. Adjust dependencies.
17828 * src/LR0.c: Formatting changes, topological sort, use of
17829 cloture.h.
17830 (initialize_states): Rename as...
17831 (new_states): this.
17832 * src/Makefile.am (noinst_HEADERS): Adjust.
17833
17834 2000-09-20 Akim Demaille <akim@epita.fr>
17835
17836 * src/acconfig.h: Don't protect config.h against multiple
17837 inclusion.
17838 Don't define PARAMS.
17839 * src/system.h: Define PARAMS.
17840 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
17841 purpose of config.h. system.h must not try to fix wrong
17842 definitions in config.h.
17843
17844 2000-09-20 Akim Demaille <akim@epita.fr>
17845
17846 * src/derives.h: New file.
17847 * src/main.c, src/derives.h: Use it.
17848 Formatting changes.
17849 * src/Makefile.am (noinst_HEADERS): Adjust.
17850
17851 2000-09-20 Akim Demaille <akim@epita.fr>
17852
17853 * tests/atgeneral.m4: Update from Autoconf.
17854 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
17855 (AT_CHECK_CALC): New macros.
17856 Use these macros to test bison with options `', `--raw',
17857 `--debug', `--yacc', `--yacc --debug'.
17858
17859 2000-09-19 Akim Demaille <akim@epita.fr>
17860
17861 * src/output.c: Formatting changes.
17862 * src/machine.h: Remove, leaving its contents in...
17863 * src/system.h: here.
17864 Include stdio.h.
17865 Adjust all dependencies on stdio.h and machine.h.
17866 * src/getargs.h: New file.
17867 Let all `extern' declarations about getargs.c be replaced with
17868 inclusion of `getargs.h'.
17869 * src/Makefile.am (noinst_HEADERS): Adjust.
17870
17871 * tests/calc.m4 (yyin): Be initialized in main, not on the global
17872 scope.
17873 (yyerror): Returns void, not int.
17874 * doc/bison.texinfo: Formatting changes.
17875
17876 2000-09-19 Akim Demaille <akim@epita.fr>
17877
17878 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
17879 portable.
17880
17881 2000-09-18 Akim Demaille <akim@epita.fr>
17882
17883 * configure.in: Append WARNING_CFLAGS to CFLAGS.
17884 * src/Makefile.am (INCLUDES): Don't.
17885 Be ready to fetch headers in lib/.
17886
17887 2000-09-18 Akim Demaille <akim@epita.fr>
17888
17889 * doc/bison.texinfo: Update the copyright.
17890 ANSIfy and GNUify the examples.
17891 Remove the old menu.
17892
17893 2000-09-18 Akim Demaille <akim@epita.fr>
17894
17895 First set of tests: use the `calc' example from the documentation.
17896
17897 * src/bison.s1 (yyparse): Condition the code using `yytname' which
17898 is defined only when YYDEBUG is.
17899 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
17900 * src/files.c (tryopen, tryclose): Formatting changes.
17901 Move to the top and be static.
17902 * src/reader.c (read_signed_integer): Likewise.
17903 * tests/calc.m4: New file.
17904 * Makefile.am, suite.m4: Adjust.
17905 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
17906
17907 2000-09-18 Akim Demaille <akim@epita.fr>
17908
17909 Add support for an Autotest test suite for Bison.
17910
17911 * m4/m4.m4, m4/atconfig.m4: New files.
17912 * m4/Makefile.am (EXTRA_DIST): Adjust.
17913 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
17914 files.
17915 * src/getargs.c: Display a more standard --version message.
17916 * src/reader.c (reader): Formatting changes.
17917 No longer depend upon VERSION_STRING.
17918 * configure.in: No longer use `dnl'.
17919 Set up the test suite and the new directory `tests/.
17920 (VERSION_STRING): Remove.
17921
17922 2000-04-14 Akim Demaille <akim@epita.fr>
17923
17924 * src/reader.c (copy_comment2): New function, same as former
17925 `copy_comment', but outputs into two FILE *.
17926 (copy_comment): Use it.
17927 (parse_union_decl): Use it.
17928 (get_type, parse_start_decl): Use the same `invalid' message.
17929 (parse_start_decl, parse_union_decl): Use the same `multiple'
17930 message.
17931 (parse_union_decl, copy_guard, copy_action): Use the same
17932 `unmatched' message.
17933 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
17934
17935 2000-03-31 Akim Demaille <akim@epita.fr>
17936
17937 * src/files.c (tryopen, tryclose): Move to the top.
17938 Be static.
17939
17940 2000-03-31 Akim Demaille <akim@epita.fr>
17941
17942 * src/main.c (main): Don't call `done', exit does it.
17943
17944 2000-03-31 Akim Demaille <akim@epita.fr>
17945
17946 * allocate.c: s/return (foo)/return foo/.
17947 * lalr.c: Likewise.
17948 * LR0.c: Likewise.
17949 * output.c: Likewise.
17950 * reader.c: Likewise.
17951 * symtab.c: Likewise.
17952 * vmsgetargs.c: Likewise.
17953
17954 2000-03-31 Akim Demaille <akim@epita.fr>
17955
17956 Clean up the error reporting functions.
17957
17958 * src/report.c: New file.
17959 * src/report.h: Likewise.
17960 * src/Makefile.am: Adjust.
17961 * m4/error.m4: New file.
17962 * m4/Makefile.am: Adjust.
17963 * configure.in (jm_PREREQ_ERROR): Call it.
17964 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
17965 Remove.
17966 (fatal, fatals): Remove. All callers use complain.c::fatal.
17967 (warn, warni, warns, warnss, warnss): Remove. All callers use
17968 complain.c::complain.
17969 (toomany): Remove, use fatal instead.
17970 * src/files.c (done): No argument, use complain_message_count.
17971 * src/main.c (main): Register `done' to `atexit'.
17972
17973 * src/getargs.c (usage): More `fputs', less `fprintf'.
17974
17975 2000-03-28 Akim Demaille <akim@epita.fr>
17976
17977 * lib/: New directory.
17978 * Makefile.am (SUBDIRS): Adjust.
17979 * configure.in: Adjust.
17980 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
17981 useless.
17982 * src/alloca.c: Moved to lib/.
17983 * src/getopt.c: Likewise.
17984 * src/getopt1.c: Likewise.
17985 * src/getopt.h: Likewise.
17986 * src/ansi2knr.c: Likewise.
17987 * src/ansi2knr.1: Likewise.
17988 * src/Makefile.am: Adjust.
17989 * lib/Makefile.am: New file.
17990
17991 2000-03-28 Akim Demaille <akim@epita.fr>
17992
17993 * src/getargs.c (usage): Refresh the help message.
17994
17995 2000-03-17 Akim Demaille <akim@epita.fr>
17996
17997 * src/getopt1.c: Updated from textutils 2.0e
17998 * src/getopt.c: Likewise.
17999 * src/getopt.h: Likewise.
18000
18001 2000-03-17 Akim Demaille <akim@epita.fr>
18002
18003 * src/Makefile.am (bison.simple): Fix the awk program: quote only
18004 the file name, not the whole `#line LINE FILE'.
18005
18006 2000-03-17 Akim Demaille <akim@epita.fr>
18007
18008 On syntax errors, report the token on which we choked.
18009
18010 * src/bison.s1 (yyparse): In the label yyerrlab, when
18011 YYERROR_VERBOSE, add yychar in msg.
18012
18013 2000-03-17 Akim Demaille <akim@epita.fr>
18014
18015 * src/reader.c (copy_at): New function.
18016 (copy_guard): Use it.
18017 (copy_action): Use it.
18018
18019 2000-03-17 Akim Demaille <akim@epita.fr>
18020
18021 Be kind to translators, save some useless translations.
18022
18023 * src/main.c (banner): New function.
18024 (fatal_banner): Use it.
18025 (warn_banner): Use it.
18026
18027 2000-03-17 Akim Demaille <akim@epita.fr>
18028
18029 * src/reader.c (copy_definition): Use copy_string and
18030 copy_comment. Removed now unused `match', `ended',
18031 `cplus_comment'.
18032 (copy_comment, copy_string): Moved, to be visible from
18033 copy_definition.
18034
18035 2000-03-17 Akim Demaille <akim@epita.fr>
18036
18037 * src/reader.c (copy_string): Declare `static inline'. No
18038 problems with inline, since it is checked by configure.
18039 (copy_comment): Likewise.
18040
18041 2000-03-17 Akim Demaille <akim@epita.fr>
18042
18043 * src/reader.c (packsymbols): Formatting changes.
18044
18045 2000-03-17 Akim Demaille <akim@epita.fr>
18046
18047 * src/reader.c (copy_comment): New function, factored out from:
18048 (copy_action): Use it. Removed now unused `match', `ended',
18049 `cplus_comment'.
18050 (copy_guard): Likewise.
18051
18052 2000-03-17 Akim Demaille <akim@epita.fr>
18053
18054 * src/reader.c (copy_string): New function, factored out from:
18055 (copy_action): Use it.
18056 (copy_guard): Likewise.
18057
18058 2000-03-17 Akim Demaille <akim@epita.fr>
18059
18060 Change the handling of @s so that they behave exactly like $s.
18061 There is now a pseudo variable @$ (readble and writable), location
18062 of the lhs of the rule (by default ranging from the location of
18063 the first symbol of the rhs, to the location of the last symbol,
18064 or, if the rhs is empty, YYLLOC).
18065
18066 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
18067 yyval.
18068 (yyparse): When providing a default semantic action, provide a
18069 default location action.
18070 (after the $): No longer change `*YYLSP', just stack YYLOC the
18071 same way you stack YYVAL.
18072 * src/reader.c (read_declarations): Use warns.
18073 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
18074 (copy_action, case '@'): Likewise.
18075 Use a standard error message, to save useless work from
18076 translators.
18077
18078 2000-03-17 Akim Demaille <akim@epita.fr>
18079
18080 * src/bison.s1: Formatting and cosmetics changes.
18081 * src/reader.c: Likewise.
18082 Update the Copyright notice.
18083
18084 2000-03-17 Akim Demaille <akim@epita.fr>
18085
18086 * src/bison.s1 (#line): All set to `#line' only, since the
18087 Makefile now handles them.
18088
18089 2000-03-16 Akim Demaille <akim@epita.fr>
18090
18091 * src/output.c (output_rule_data): Output the documentation of
18092 some of the tables.
18093 (Copyright notice): Update.
18094 Formatting changes.
18095
18096 2000-03-16 Akim Demaille <akim@epita.fr>
18097
18098 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
18099 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
18100 One `#if YYDEBUG' remains, since it uses variables which are
18101 defined only if `YYDEBUG != 0'.
18102
18103 2000-03-16 Akim Demaille <akim@epita.fr>
18104
18105 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
18106 and related variables so that the similarities are highlighted.
18107
18108 2000-03-16 Akim Demaille <akim@epita.fr>
18109
18110 * src/bison.s1: Properly indent CPP directives.
18111
18112 2000-03-16 Akim Demaille <akim@epita.fr>
18113
18114 * src/bison.s1: Properly indent the `alloca' CPP section.
18115
18116 2000-03-16 Akim Demaille <akim@epita.fr>
18117
18118 Do not hard code values of directories in `configure.in'.
18119 Update the `configure' tool chain.
18120
18121 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
18122 src/makefile.am.
18123 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
18124 (AC_OUTPUT): Add m4/Makefile.
18125 Bump to bison 1.28a, 1.29 has never been released.
18126 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
18127 handled via src/Makefile.am.
18128 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
18129 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
18130 autoheader.
18131 * Makefile.am (SUBDIRS): Add m4.
18132 (ACLOCAL_AM_FLAGS): New variable.
18133 (AUTOMAKE_OPTIONS): Add check-news.
18134 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
18135 the proper line number and file name.
18136 (DEFS): Propagate the location of bison library files and of the
18137 locale files.
18138 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
18139 builddir.
18140 * acinclude.m4: Remove, replaced by the directory m4.
18141 * m4/Makefile.am (EXTRA_DIST): New variable.
18142 * m4/gettext.m4: New file, from the fileutils.
18143 * m4/lcmessage.m4: Likewise
18144 * m4/progtest.m4: Likewise.
18145 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
18146
18147 2000-03-10 Akim Demaille <akim@epita.fr>
18148
18149 * src/closure.c:
18150 Formatting changes of various comments.
18151 Respect the GNU coding standards at various places.
18152 Don't use `_()' when no translation is needed.
18153
18154 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18155
18156 * src/files.c:
18157 OS/2 honors TMPDIR environment variable.
18158
18159 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18160
18161 * doc/bison.texinfo: Tweaked spelling and grammar.
18162 Updated ISBN.
18163 Removed reference to price of printed copy.
18164 Mention BISON_SIMPLE and BISON_HAIRY.
18165
18166 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18167
18168 * configure.in, NEWS:
18169 Bison 1.29 released.
18170
18171 1999-10-27 Jesse Thilo <jthilo@gnu.org>
18172
18173 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
18174 Added reference card.
18175
18176 1999-07-26 Jesse Thilo <jthilo@gnu.org>
18177
18178 * po/ru.po: Added Russian translation.
18179
18180 1999-07-26 Jesse Thilo <jthilo@gnu.org>
18181
18182 * configure.in: Added Russian translation.
18183
18184 1999-07-06 Jesse Thilo <jthilo@gnu.org>
18185
18186 * configure.in, NEWS, README:
18187 Released version 1.28.
18188
18189 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18190
18191 * src/system.h:
18192 Squashed redefinition warning on some systems.
18193
18194 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
18195 Have configure build version string instead of relying on ANSI string
18196 concatentation.
18197
18198 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18199
18200 * po/POTFILES.in: Got rid of version.c.
18201
18202 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18203
18204 * acconfig.h, configure.in:
18205 Have configure build version string instead of relying on ANSI string
18206 concatentation.
18207
18208 1999-06-08 Jesse Thilo <jthilo@gnu.org>
18209
18210 * doc/bison.1:
18211 Dropped mention of `+' for long-named options.
18212
18213 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18214
18215 * src/files.c: Added <unistd.h> for unlink().
18216
18217 * src/Makefile.am, src/system.h:
18218 I18n fixes.
18219
18220 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18221
18222 * README: Added a FAQ list.
18223
18224 * configure.in, acconfig.h:
18225 I18n fixes.
18226
18227 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18228
18229 * doc/FAQ, doc/Makefile.am:
18230 Added a FAQ list.
18231
18232 1999-05-19 Jesse Thilo <jthilo@gnu.org>
18233
18234 * src/alloc.h, src/symtab.h, src/version.c:
18235 Protected inclusion of "config.h" with HAVE_CONFIG_H.
18236
18237 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18238
18239 * src/.cvsignore, src/Makefile.am:
18240 Reorganized: sources in `src', documentation in `doc'.
18241
18242 * src/lex.c (literalchar):
18243 fixed the code for escaping double quotes (thanks
18244 Jonathan Czisny.)
18245
18246 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18247
18248 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
18249 Adjusted paths to reflect directory reorganization.
18250
18251 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18252
18253 * doc/.cvsignore, doc/Makefile.am:
18254 Reorganized: sources in `src', documentation in `doc'.
18255
18256 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18257
18258 * configure.in:
18259 Updated AC_INIT file to reflect directory reorganization.
18260
18261 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
18262 Reorganized: sources in `src', documentation in `doc'.
18263
18264 1999-04-13 Jesse Thilo <jthilo@gnu.org>
18265
18266 * src/allocate.c:
18267 Don't declare calloc() and realloc() if not necessary.
18268
18269 1999-04-13 Jesse Thilo <jthilo@gnu.org>
18270
18271 * configure.in, acconfig.h, acinclude.m4:
18272 Don't declare calloc() and realloc() if not necessary.
18273
18274 1999-03-23 Jesse Thilo <jthilo@gnu.org>
18275
18276 * po/.cvsignore: Added i18n support.
18277
18278 1999-03-23 Jesse Thilo <jthilo@gnu.org>
18279
18280 * acconfig.h, configure.in, Makefile.am:
18281 Added i18n support.
18282
18283 1999-03-22 Jesse Thilo <jthilo@gnu.org>
18284
18285 * src/bison.s1: Fixed #line numbers.
18286
18287 1999-03-15 Jesse Thilo <jthilo@gnu.org>
18288
18289 * po/es.po, po/fr.po, po/nl.po, po/de.po:
18290 Added PO files from Translation Project.
18291
18292 1999-03-03 Jesse Thilo <jthilo@gnu.org>
18293
18294 * Makefile.am:
18295 Added support for non-ANSI compilers (ansi2knr).
18296
18297 1999-02-16 Jesse Thilo <jthilo@gnu.org>
18298
18299 * configure.in: Bumped version number to 1.27.
18300
18301 * Makefile.am:
18302 Added `bison.simple' to list of files removed by `make distclean'.
18303
18304 1999-02-12 Jesse Thilo <jthilo@gnu.org>
18305
18306 * src/files.c, src/files.h:
18307 Defined locations of parser files in config.h instead of Makefile.
18308
18309 1999-02-12 Jesse Thilo <jthilo@gnu.org>
18310
18311 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
18312 Defined locations of parser files in config.h instead of Makefile.
18313
18314 1999-02-09 Jesse Thilo <jthilo@gnu.org>
18315
18316 * Makefile.am:
18317 Removed inappropriate use of $< macro.
18318
18319 1999-02-05 Jesse Thilo <jthilo@gnu.org>
18320
18321 * po/Makefile.in.in, po/POTFILES.in:
18322 Add `po' directory skeleton.
18323
18324 1999-01-27 Jesse Thilo <jthilo@gnu.org>
18325
18326 * README: Document help-bison list.
18327
18328 * configure.in: Add check for mkstemp().
18329
18330 1999-01-20 Jesse Thilo <jthilo@gnu.org>
18331
18332 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
18333 Hush a few compiler warnings.
18334
18335 * src/files.c:
18336 Add tryclose(), which verifies that fclose was successful.
18337 Hush a couple of compiler warnings.
18338
18339 1999-01-20 Jesse Thilo <jthilo@gnu.org>
18340
18341 * Makefile.am, OChangeLog:
18342 ChangeLog is now automatically generated. Include the old version as
18343 OChangeLog.
18344
18345 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18346
18347 * 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:
18348 Update FSF address.
18349
18350 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18351
18352 * doc/bison.texinfo: Fix formatting glitch.
18353
18354 * doc/bison.texinfo: Update FSF address.
18355
18356 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18357
18358 * acconfig.h: Update FSF address.
18359
18360 1999-01-08 Jesse Thilo <jthilo@gnu.org>
18361
18362 * src/system.h:
18363 Don't define PACKAGE here, since config.h defines it.
18364
18365 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18366
18367 * src/reader.c: Update copyright date.
18368
18369 * src/main.c:
18370 Ditch sprintf to statically-sized buffers in fatal/warn functions in
18371 favor of output directly to stderr (avoids buffer overruns).
18372
18373 * src/reader.c: Some checks for premature EOF.
18374
18375 * 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:
18376 Use prototypes if the compiler understands them.
18377
18378 * src/files.c: Honor TMPDIR on Unix hosts.
18379 Use prototypes if the compiler understands them.
18380
18381 * src/reader.c:
18382 Fix a couple of buffer overrun bugs.
18383 Use prototypes if the compiler understands them.
18384
18385 * src/system.h: Include unistd.h and ctype.h.
18386 Use #ifdef instead of #if for NLS symbols.
18387
18388 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18389
18390 * doc/bison.texinfo:
18391 Delete comment "consider using @set for edition number, etc..." since
18392 we now are doing so.
18393
18394 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18395
18396 * configure.in:
18397 Use prototypes if the compiler understands them.
18398
18399 * NEWS: Document 1.26 highlights.
18400
18401 * Makefile.am: Require Automake 1.3 or later.
18402
18403 * acconfig.h:
18404 Use prototypes if the compiler understands them.
18405
18406 1998-12-29 Jesse Thilo <jthilo@gnu.org>
18407
18408 * src/version.c:
18409 Use VERSION symbol from automake for version number.
18410
18411 1998-12-29 Jesse Thilo <jthilo@gnu.org>
18412
18413 * acconfig.h, configure.in, version.cin:
18414 Use VERSION symbol from automake for version number.
18415
18416 1998-11-28 Jesse Thilo <jthilo@gnu.org>
18417
18418 * Makefile.am:
18419 Distribute original version of simple parser (bison.s1), not built
18420 version (bison.simple).
18421
18422 1998-11-28 Jesse Thilo <jthilo@gnu.org>
18423
18424 * doc/bison.texinfo: Add info dir entry.
18425
18426 * doc/bison.texinfo:
18427 Let automake put version number into documentation.
18428
18429 1998-11-26 Jesse Thilo <jthilo@gnu.org>
18430
18431 * src/bison.cld, src/build.com, src/vmshlp.mar:
18432 Add non-RCS files from /gd/gnu/bison.
18433
18434 1998-11-26 Jesse Thilo <jthilo@gnu.org>
18435
18436 * doc/bison.1:
18437 Document the BISON_HAIRY and BISON_SIMPLE variables.
18438
18439 1998-11-25 Jesse Thilo <jthilo@gnu.org>
18440
18441 * src/version.c: Build version.c automatically.
18442
18443 * src/reader.c:
18444 Fix token numbering (used to start at 258, not 257).
18445
18446 * src/system.h: Include config.h.
18447
18448 * src/getargs.c: Update bug report address.
18449
18450 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
18451 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
18452
18453 1998-11-25 Jesse Thilo <jthilo@gnu.org>
18454
18455 * Makefile.am:
18456 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
18457
18458 * configure.in, version.cin:
18459 Build version.c automatically.
18460
18461 * AUTHORS: Add AUTHORS file.
18462
18463 * README: Update bug report address.
18464
18465 * bison.simple:
18466 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
18467
18468 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
18469 Add automake stuff.
18470
18471 1998-11-25 Jesse Thilo <jthilo@gnu.org>
18472
18473 * doc/bison.texinfo: Clean up some formatting.
18474
18475 1998-05-05 Richard Stallman <rms@gnu.org>
18476
18477 * doc/bison.texinfo:
18478 Explain better why to make a pure parser.
18479
18480 1998-01-05 Richard Stallman <rms@gnu.org>
18481
18482 * src/files.c (openfiles):
18483 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
18484 find a temporary directory, if possible. Do not unlink files while
18485 they are open.
18486
18487 1997-08-25 Richard Stallman <rms@gnu.org>
18488
18489 * src/reader.c (stack_offset;):
18490 Change some warni to warns.
18491
18492 * src/lex.c (literalchar): Use warns, not warni.
18493
18494 1997-06-28 Richard Stallman <rms@gnu.org>
18495
18496 * src/bison.s1: Add a Bison version comment.
18497
18498 * src/main.c (fatal, warn, berror):
18499 Use program_name.
18500
18501 1997-06-28 Richard Stallman <rms@gnu.org>
18502
18503 * Makefile.in (bison_version): New variable.
18504 (dist): Use that variable.
18505 (bison.s1): Substitute the Bison version into bison.simple.
18506
18507 * bison.simple: Add a Bison version comment.
18508
18509 1997-06-18 Richard Stallman <rms@gnu.org>
18510
18511 * src/main.c (fatal, warn, berror):
18512 Make error messages standard.
18513 (toomany): Improve error message text.
18514
18515 * 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:
18516 new.h renamed to alloc.h.
18517
18518 1997-06-18 Richard Stallman <rms@gnu.org>
18519
18520 * Makefile.in: new.h renamed to alloc.h.
18521
18522 1997-05-24 Richard Stallman <rms@gnu.org>
18523
18524 * src/lex.c (literalchar):
18525 Fix the code for escaping \, " and '.
18526
18527 (lex): Avoid trouble when there are many chars
18528 to discard in a char literal with just several chars in it.
18529
18530 1997-05-17 Richard Stallman <rms@gnu.org>
18531
18532 * src/bison.s1:
18533 Use malloc, if using alloca is troublesome.
18534 (YYSTACK_USE_ALLOCA): New flag macro.
18535 Define it for some systems and compilers.
18536 (YYSTACK_ALLOC): New macro.
18537 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18538 If it was malloc'd, free it.
18539
18540 1997-05-17 Richard Stallman <rms@gnu.org>
18541
18542 * bison.simple:
18543 Use malloc, if using alloca is troublesome.
18544 (YYSTACK_USE_ALLOCA): New flag macro.
18545 Define it for some systems and compilers.
18546 (YYSTACK_ALLOC): New macro.
18547 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18548 If it was malloc'd, free it.
18549
18550 1997-04-23 Richard Stallman <rms@gnu.org>
18551
18552 * src/bison.s1:
18553 (alloca) [__hpux]: Always define as __builtin_alloca.
18554
18555 1997-04-23 Richard Stallman <rms@gnu.org>
18556
18557 * bison.simple:
18558 (alloca) [__hpux]: Always define as __builtin_alloca.
18559
18560 1997-04-22 Richard Stallman <rms@gnu.org>
18561
18562 * src/bison.s1:
18563 [__hpux]: Include alloca.h (right for HPUX 10)
18564 instead of declaring alloca (right for HPUX 9).
18565
18566 * src/bison.s1 (__yy_memcpy):
18567 Declare arg `count' as unsigned int.
18568 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18569
18570 1997-04-22 Richard Stallman <rms@gnu.org>
18571
18572 * bison.simple:
18573 [__hpux]: Include alloca.h (right for HPUX 10)
18574 instead of declaring alloca (right for HPUX 9).
18575
18576 * bison.simple (__yy_memcpy):
18577 Declare arg `count' as unsigned int.
18578 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18579
18580 1997-01-03 Richard Stallman <rms@gnu.org>
18581
18582 * src/allocate.c: [__STDC__ or _MSC_VER]:
18583 Declare calloc and realloc to return void *.
18584
18585 1997-01-02 Richard Stallman <rms@gnu.org>
18586
18587 * src/system.h:
18588 [_MSC_VER]: Include stdlib.h and process.h.
18589 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
18590
18591 * src/main.c (main): Return FAILURE as a value.
18592 (printable_version): Declare arg as int, not char.
18593
18594 1997-01-02 Richard Stallman <rms@gnu.org>
18595
18596 * Makefile.in (dist):
18597 Explicitly check for symlinks, and copy them.
18598
18599 1996-12-19 Richard Stallman <rms@gnu.org>
18600
18601 * src/files.c:
18602 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
18603
18604 1996-12-18 Paul Eggert <eggert@gnu.org>
18605
18606 * src/bison.s1 (yyparse):
18607 If __GNUC__ and YYPARSE_PARAM are both defined,
18608 declare yyparse to have a void * argument.
18609
18610 1996-12-18 Paul Eggert <eggert@gnu.org>
18611
18612 * bison.simple (yyparse):
18613 If __GNUC__ and YYPARSE_PARAM are both defined,
18614 declare yyparse to have a void * argument.
18615
18616 1996-12-17 Richard Stallman <rms@gnu.org>
18617
18618 * src/reduce.c (nbits): Add some casts.
18619
18620 1996-08-12 Richard Stallman <rms@gnu.org>
18621
18622 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
18623
18624 1996-08-12 Richard Stallman <rms@gnu.org>
18625
18626 * bison.simple: Test _MSDOS as well as _MSDOS_.
18627
18628 1996-07-31 Richard Stallman <rms@gnu.org>
18629
18630 * src/bison.s1:
18631 [__sun && __i386]: Include alloca.h.
18632
18633 1996-07-31 Richard Stallman <rms@gnu.org>
18634
18635 * bison.simple:
18636 [__sun && __i386]: Include alloca.h.
18637
18638 1996-07-30 Richard Stallman <rms@gnu.org>
18639
18640 * src/bison.s1: Comment change.
18641
18642 * src/bison.s1: Test _MSDOS_, not MSDOS.
18643
18644 1996-07-30 Richard Stallman <rms@gnu.org>
18645
18646 * bison.simple: Comment change.
18647
18648 * bison.simple: Test _MSDOS_, not MSDOS.
18649
18650 1996-06-01 Richard Stallman <rms@gnu.org>
18651
18652 * 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:
18653 Insert `_' macro around many string constants.
18654
18655 * src/main.c:
18656 Insert `_' macro around many string constants.
18657
18658 (main): Call setlocale, bindtextdomain and textdomain.
18659
18660 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
18661 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
18662 [ENABLE_NLS]: Include libintl.h.
18663 [ENABLE_NLS] (gettext): Define.
18664 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
18665 (N_, PACKAGE, LOCALEDIR): New macros.
18666
18667 1996-06-01 Richard Stallman <rms@gnu.org>
18668
18669 * POTFILES.in: New file.
18670
18671 * Makefile.in (allocate.o):
18672 Define target explicitly.
18673
18674 * Makefile.in (CFLAGS): Set to @CFLAGS@.
18675 (LDFLAGS): Set to @LDFLAGS@.
18676 (configure): Run autoconf only if preceding `cd' succeeds.
18677 (bison.s1): Redirect output to temporary file then move the
18678 temporary to the target, rather than redirecting directly to bison.s1.
18679 (clean): Remove config.status and config.log.
18680 (distclean): Don't remove config.status here.
18681
18682 1996-05-12 Richard Stallman <rms@gnu.org>
18683
18684 * src/bison.s1:
18685 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18686
18687 1996-05-12 Richard Stallman <rms@gnu.org>
18688
18689 * bison.simple:
18690 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18691
18692 1996-05-11 Richard Stallman <rms@gnu.org>
18693
18694 * src/bison.s1 (__yy_memcpy):
18695 Really reorder the args, as was supposedly done on Feb 14 1995.
18696 (yyparse): Calls changed accordingly.
18697
18698 1996-05-11 Richard Stallman <rms@gnu.org>
18699
18700 * Makefile.in (dist): Don't use $(srcdir).
18701
18702 * bison.simple (__yy_memcpy):
18703 Really reorder the args, as was supposedly done on Feb 14 1995.
18704 (yyparse): Calls changed accordingly.
18705
18706 1996-01-27 Richard Stallman <rms@gnu.org>
18707
18708 * src/output.c (output_rule_data):
18709 Test YYERROR_VERBOSE in the conditional
18710 around the definition of ttyname.
18711
18712 1995-12-29 Richard Stallman <rms@gnu.org>
18713
18714 * src/bison.s1:
18715 Fix line numbers in #line commands.
18716
18717 1995-12-29 Richard Stallman <rms@gnu.org>
18718
18719 * bison.simple:
18720 Fix line numbers in #line commands.
18721
18722 1995-12-27 Richard Stallman <rms@gnu.org>
18723
18724 * src/bison.s1 (YYPARSE_PARAM_DECL):
18725 In C++, make it always null.
18726 (YYPARSE_PARAM_ARG): New macro.
18727 (yyparse): Use YYPARSE_PARAM_ARG.
18728
18729 1995-12-27 Richard Stallman <rms@gnu.org>
18730
18731 * bison.simple (YYPARSE_PARAM_DECL):
18732 In C++, make it always null.
18733 (YYPARSE_PARAM_ARG): New macro.
18734 (yyparse): Use YYPARSE_PARAM_ARG.
18735
18736 1995-11-29 Richard Stallman <rms@gnu.org>
18737
18738 * doc/bison.texinfo:
18739 Describe literal string tokens, %raw, %no_lines, %token_table.
18740
18741 1995-11-29 Daniel Hagerty <hag@gnu.org>
18742
18743 * doc/bison.texinfo: Fixed update date
18744
18745 1995-10-16 Richard Stallman <rms@gnu.org>
18746
18747 * src/version.c: Version 1.25.
18748
18749 1995-10-16 Richard Stallman <rms@gnu.org>
18750
18751 * NEWS: *** empty log message ***
18752
18753 1995-10-16 Richard Stallman <rms@gnu.org>
18754
18755 * doc/bison.1, doc/bison.rnh:
18756 Add new options.
18757
18758 1995-10-15 Richard Stallman <rms@gnu.org>
18759
18760 * src/vmsgetargs.c, src/getargs.c:
18761 Added -n, -k, and -raw switches.
18762 (noparserflag, toknumflag, rawtoknumflag): New variables.
18763
18764 * src/symtab.h (SALIAS):
18765 New #define for adding aliases to %token.
18766 (struct bucket): Added `alias' field.
18767
18768 * src/reduce.c (reduce_grammar):
18769 Revise error message.
18770 (print_notices): Remove final `.' from error message.
18771
18772 * src/reader.c (reader_output_yylsp):
18773 New function.
18774 (readgram): Use `#if 0' around code that accepted %command
18775 inside grammar rules: The documentation doesn't allow it,
18776 and it will fail since the %command processors scan for the next %.
18777 (parse_token_decl): Extended the %token
18778 declaration to allow a multi-character symbol as an alias.
18779 (parse_thong_decl): New function.
18780 (read_declarations): Added %thong declarations.
18781 (read_declarations): Handle NOOP to deal with allowing
18782 % declarations as another means to specify the flags.
18783 (readgram): Allow %prec prior to semantics embedded in a rule.
18784 (skip_to_char, read_declarations, copy_definition)
18785 (parse_token_decl, parse_start_decl, parse_type_decl)
18786 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
18787 (get_type_name, copy_guard, copy_action, readgram)
18788 (get_type, packsymbols): Revised most error messages.
18789 Changed `fatal' to `warnxxx' to avoid aborting for error.
18790 Revised and use multiple warnxxx functions to avoid using VARARGS1.
18791 (read_declarations): Improve the error message for
18792 an invalid character. Do not abort.
18793 (read_declarations, copy_guard, copy_action): Use
18794 printable_version to avoid unprintable characters in printed output.
18795 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
18796 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
18797 Allow the type of a non-terminal can be given
18798 more than once, as long as all specifications give the same type.
18799
18800 * src/output.c:
18801 (output_headers, output_trailers, output, output_gram)
18802 (output_rule_data): Implement noparserflag variable.
18803 Implement toknumflag variable.
18804 (output): Call reader_output_yylsp to output LTYPESTR.
18805
18806 * src/main.c (main):
18807 If reader sees an error, don't process the grammar.
18808 (fatals): Updated to not use VARARGS1.
18809 (printable_version, int_to_string, warn, warni, warns, warnss)
18810 (warnsss): New error reporting functions. Avoid abort for error.
18811
18812 * src/lex.h:
18813 Added THONG and NOOP for alias processing.
18814 Added SETOPT for the new code that allows setting options with %flags.
18815
18816 * src/lex.c:
18817 Include getopt.h. Add some extern decls.
18818 (safegetc): New function to deal with EOF gracefully.
18819 (literalchar); new function to deal with reading \ escapes.
18820 (lex): Use literalchar.
18821 (lex): Implemented "..." tokens.
18822 (literalchar, lex, parse_percent_token): Made tokenbuffer
18823 always contain the token. This includes growing the token
18824 buffer while reading an integer.
18825 (parse_percent_token): Replaced if-else statement with percent_table.
18826 (parse_percent_token): Added % declarations as another
18827 way to specify the flags -n, -l, and -r. Also added hooks for
18828 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
18829 major changes to files.c.
18830 (lex) Retain in the incoming stream a character following
18831 an incorrect '/'.
18832 (skip_white_space, lex): Revised most error messages
18833 and changed fatal to warn to avoid aborting.
18834 (percent_table): Added %thong declarations.
18835
18836 * src/gram.h: Comment changes.
18837
18838 * src/files.c (openfiles, open_extra_files, done):
18839 Add faction flag
18840 and actfile file. Handle noparserflag. Both for -n switch.
18841
18842 * src/conflicts.c (resolve_sr_conflict):
18843 Remove use of alloca.
18844
18845 1995-06-01 Jim Meyering <meyering@gnu.org>
18846
18847 * doc/bison.texinfo: *** empty log message ***
18848
18849 1995-05-06 Richard Stallman <rms@gnu.org>
18850
18851 * src/bison.s1: Comment change.
18852
18853 1995-05-06 Richard Stallman <rms@gnu.org>
18854
18855 * bison.simple: Comment change.
18856
18857 1995-05-03 Richard Stallman <rms@gnu.org>
18858
18859 * src/version.c: Version now 1.24.
18860
18861 * src/bison.s1: Change distribution terms.
18862
18863 * src/version.c: Version now 1.23.
18864
18865 1995-05-03 Richard Stallman <rms@gnu.org>
18866
18867 * doc/bison.texinfo:
18868 Rewrite "Conditions for Using Bison".
18869 Update version to 1.24.
18870
18871 1995-05-03 Richard Stallman <rms@gnu.org>
18872
18873 * bison.simple: Change distribution terms.
18874
18875 1995-02-23 Richard Stallman <rms@gnu.org>
18876
18877 * src/files.c: Test __VMS_POSIX as well as VMS.
18878
18879 1995-02-14 Jim Meyering <meyering@gnu.org>
18880
18881 * src/bison.s1 (__yy_memcpy):
18882 Renamed from __yy_bcopy to avoid
18883 confusion. Reverse FROM and TO arguments to be consistent with
18884 those of memcpy.
18885
18886 1995-02-14 Jim Meyering <meyering@gnu.org>
18887
18888 * bison.simple (__yy_memcpy):
18889 Renamed from __yy_bcopy to avoid
18890 confusion. Reverse FROM and TO arguments to be consistent with
18891 those of memcpy.
18892
18893 1994-11-10 David J. MacKenzie <djm@gnu.org>
18894
18895 * NEWS: reformat
18896
18897 * NEWS: New file.
18898
18899 * Makefile.in (DISTFILES): Include NEWS.
18900
18901 * Makefile.in (DISTFILES):
18902 Include install-sh, not install.sh.
18903
18904 * configure.in: Update to Autoconf v2 macro names.
18905
18906 1994-10-05 David J. MacKenzie <djm@gnu.org>
18907
18908 * Makefile.in: fix typo
18909
18910 * Makefile.in (prefix, exec_prefix):
18911 Let configure set them.
18912
18913 1994-09-28 David J. MacKenzie <djm@gnu.org>
18914
18915 * Makefile.in: Set datadir to $(prefix)/share.
18916
18917 1994-09-15 Richard Stallman <rms@gnu.org>
18918
18919 * src/bison.s1:
18920 Update copyright notice and GPL version.
18921
18922 1994-09-15 Richard Stallman <rms@gnu.org>
18923
18924 * bison.simple:
18925 Update copyright notice and GPL version.
18926
18927 1994-07-12 Richard Stallman <rms@gnu.org>
18928
18929 * src/reduce.c, src/reader.c:
18930 entered into RCS
18931
18932 1994-05-05 David J. MacKenzie <djm@gnu.org>
18933
18934 * Makefile.in: entered into RCS
18935
18936 1994-03-26 Richard Stallman <rms@gnu.org>
18937
18938 * src/bison.s1: entered into RCS
18939
18940 1994-03-26 Richard Stallman <rms@gnu.org>
18941
18942 * bison.simple: entered into RCS
18943
18944 1994-03-25 Richard Stallman <rms@gnu.org>
18945
18946 * src/main.c: entered into RCS
18947
18948 1994-03-24 Richard Stallman <rms@gnu.org>
18949
18950 * src/conflicts.c: entered into RCS
18951
18952 1994-01-02 Richard Stallman <rms@gnu.org>
18953
18954 * Makefile.in: *** empty log message ***
18955
18956 1993-11-21 Richard Stallman <rms@gnu.org>
18957
18958 * src/bison.s1: *** empty log message ***
18959
18960 1993-11-21 Richard Stallman <rms@gnu.org>
18961
18962 * doc/bison.texinfo: entered into RCS
18963
18964 * doc/bison.texinfo: *** empty log message ***
18965
18966 1993-11-21 Richard Stallman <rms@gnu.org>
18967
18968 * bison.simple: *** empty log message ***
18969
18970 1993-10-25 David J. MacKenzie <djm@gnu.org>
18971
18972 * doc/bison.texinfo: *** empty log message ***
18973
18974 1993-10-19 Richard Stallman <rms@gnu.org>
18975
18976 * src/bison.s1: *** empty log message ***
18977
18978 1993-10-19 Richard Stallman <rms@gnu.org>
18979
18980 * bison.simple: *** empty log message ***
18981
18982 1993-10-14 Richard Stallman <rms@gnu.org>
18983
18984 * src/bison.s1: *** empty log message ***
18985
18986 1993-10-14 Richard Stallman <rms@gnu.org>
18987
18988 * bison.simple: *** empty log message ***
18989
18990 1993-09-14 David J. MacKenzie <djm@gnu.org>
18991
18992 * doc/bison.texinfo: *** empty log message ***
18993
18994 1993-09-13 Noah Friedman <friedman@gnu.org>
18995
18996 * Makefile.in: *** empty log message ***
18997
18998 1993-09-10 Richard Stallman <rms@gnu.org>
18999
19000 * src/conflicts.c: *** empty log message ***
19001
19002 * src/system.h: entered into RCS
19003
19004 1993-09-10 Richard Stallman <rms@gnu.org>
19005
19006 * doc/bison.1: entered into RCS
19007
19008 1993-09-06 Noah Friedman <friedman@gnu.org>
19009
19010 * src/version.c: entered into RCS
19011
19012 1993-09-06 Noah Friedman <friedman@gnu.org>
19013
19014 * Makefile.in: *** empty log message ***
19015
19016 1993-07-30 David J. MacKenzie <djm@gnu.org>
19017
19018 * Makefile.in: *** empty log message ***
19019
19020 1993-07-24 Richard Stallman <rms@gnu.org>
19021
19022 * src/bison.s1: *** empty log message ***
19023
19024 1993-07-24 Richard Stallman <rms@gnu.org>
19025
19026 * bison.simple: *** empty log message ***
19027
19028 1993-07-08 David J. MacKenzie <djm@gnu.org>
19029
19030 * Makefile.in: *** empty log message ***
19031
19032 1993-07-04 Richard Stallman <rms@gnu.org>
19033
19034 * src/bison.s1: *** empty log message ***
19035
19036 1993-07-04 Richard Stallman <rms@gnu.org>
19037
19038 * bison.simple: *** empty log message ***
19039
19040 1993-06-26 David J. MacKenzie <djm@gnu.org>
19041
19042 * src/getargs.c: entered into RCS
19043
19044 1993-06-26 David J. MacKenzie <djm@gnu.org>
19045
19046 * doc/bison.texinfo: *** empty log message ***
19047
19048 * doc/bison.1: New file.
19049
19050 1993-06-25 Richard Stallman <rms@gnu.org>
19051
19052 * src/getargs.c: New file.
19053
19054 1993-06-16 Richard Stallman <rms@gnu.org>
19055
19056 * src/bison.s1: *** empty log message ***
19057
19058 1993-06-16 Richard Stallman <rms@gnu.org>
19059
19060 * bison.simple: *** empty log message ***
19061
19062 1993-06-03 Richard Stallman <rms@gnu.org>
19063
19064 * src/bison.s1: New file.
19065
19066 1993-06-03 Richard Stallman <rms@gnu.org>
19067
19068 * doc/bison.texinfo: *** empty log message ***
19069
19070 1993-06-03 Richard Stallman <rms@gnu.org>
19071
19072 * bison.simple: New file.
19073
19074 1993-05-19 Richard Stallman <rms@gnu.org>
19075
19076 * doc/bison.texinfo: New file.
19077
19078 1993-05-07 Noah Friedman <friedman@gnu.org>
19079
19080 * Makefile.in: *** empty log message ***
19081
19082 1993-04-28 Noah Friedman <friedman@gnu.org>
19083
19084 * src/reader.c: *** empty log message ***
19085
19086 1993-04-23 Noah Friedman <friedman@gnu.org>
19087
19088 * src/alloc.h: entered into RCS
19089
19090 1993-04-20 David J. MacKenzie <djm@gnu.org>
19091
19092 * src/version.c: *** empty log message ***
19093
19094 * src/files.c, src/allocate.c:
19095 entered into RCS
19096
19097 * src/reader.c: *** empty log message ***
19098
19099 * src/lex.c: entered into RCS
19100
19101 * src/conflicts.c: New file.
19102
19103 * src/symtab.c: entered into RCS
19104
19105 * src/alloc.h: New file.
19106
19107 * src/LR0.c: entered into RCS
19108
19109 1993-04-18 Noah Friedman <friedman@gnu.org>
19110
19111 * src/reader.c: New file.
19112
19113 * src/version.c: *** empty log message ***
19114
19115 1993-04-18 Noah Friedman <friedman@gnu.org>
19116
19117 * Makefile.in: *** empty log message ***
19118
19119 1993-04-17 Noah Friedman <friedman@gnu.org>
19120
19121 * Makefile.in: *** empty log message ***
19122
19123 1993-04-15 Richard Stallman <rms@gnu.org>
19124
19125 * src/main.c, src/files.c:
19126 New file.
19127
19128 1993-04-15 Noah Friedman <friedman@gnu.org>
19129
19130 * configure.in: entered into RCS
19131
19132 * configure.in: *** empty log message ***
19133
19134 * configure.in: New file.
19135
19136 1993-04-14 Richard Stallman <rms@gnu.org>
19137
19138 * Makefile.in: New file.
19139
19140 1993-04-13 Richard Stallman <rms@gnu.org>
19141
19142 * src/version.c: New file.
19143
19144 1993-03-25 Richard Stallman <rms@gnu.org>
19145
19146 * src/output.c: entered into RCS
19147
19148 1992-09-25 Richard Stallman <rms@gnu.org>
19149
19150 * configure.bat: entered into RCS
19151
19152 1992-06-22 Richard Stallman <rms@gnu.org>
19153
19154 * src/vmsgetargs.c: entered into RCS
19155
19156 1992-06-22 Richard Stallman <rms@gnu.org>
19157
19158 * doc/bison.rnh: entered into RCS
19159
19160 1992-04-20 David J. MacKenzie <djm@gnu.org>
19161
19162 * README: entered into RCS
19163
19164 1992-01-22 Richard Stallman <rms@gnu.org>
19165
19166 * src/machine.h: entered into RCS
19167
19168 1991-12-21 Richard Stallman <rms@gnu.org>
19169
19170 * src/lalr.c, src/closure.c:
19171 entered into RCS
19172
19173 1991-12-20 Richard Stallman <rms@gnu.org>
19174
19175 * src/state.h: entered into RCS
19176
19177 1991-12-18 Richard Stallman <rms@gnu.org>
19178
19179 * src/print.c, src/nullable.c, src/derives.c:
19180 entered into RCS
19181
19182 1991-11-03 David J. MacKenzie <djm@gnu.org>
19183
19184 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
19185 entered into RCS
19186
19187 1988-09-09 Richard Stallman <rms@gnu.org>
19188
19189 * src/bison.hairy: entered into RCS
19190
19191 1987-12-16 Richard Stallman <rms@gnu.org>
19192
19193 * REFERENCES: entered into RCS
19194
19195
19196 -----
19197
19198 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
19199 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
19200 Free Software Foundation, Inc.
19201
19202 Copying and distribution of this file, with or without
19203 modification, are permitted provided the copyright notice and this
19204 notice are preserved.
19205
19206 $Id$