]> git.saurik.com Git - bison.git/blob - ChangeLog
* djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
[bison.git] / ChangeLog
1 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2
3 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6
7 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
8
9 Undo my 2007-02-07 change, switching back to the c-strcase module
10 introduced in the 2007-02-03 change. Bruno Haible reported that
11 the 2007-02-07 change would be dangerous in Turkish if we add a
12 language whose name contains "i", since "i" is not lowercase "I"
13 in Turkish.
14 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
15 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
16 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
17 * m4/.cvsignore: Remove strcase.m4.
18 * src/getargs.c: Revert 2007-02-07 change, as follows.
19 Include c-strcase.h.
20 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
21
22 2007-02-11 Bruno Haible <bruno@clisp.org>
23
24 Enable the Java related testsuite tests when the only Java compiler
25 found is a gcj < 4.3. Discussed at
26 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
27 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
28
29 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
30
31 * data/Makefile.am: Update copyright date.
32 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
33 yypstate_new returns NULL.
34 (yypstate_new): Return NULL if malloc does.
35 * src/reader.c (packgram): Move translation of rule actions from the
36 beginning of packgram to...
37 (check_and_convert_grammar): ... here right before packgram is invoked
38 so it's easier to write more complete comments, and remove redundant
39 code.
40
41 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
42
43 As in semantic actions, make @$ in %initial-action, %destructor, and
44 %printer imply %locations.
45 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
46 scanning @$.
47 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
48 (@$ in %initial-action implies %locations,
49 @$ in %destructor implies %locations,
50 @$ in %printer implies %locations): ... these new test cases.
51
52 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
53
54 Undo most of the 2007-02-03 change, switching to the strcase module
55 now that gnulib strcase has been fixed.
56 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
57 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
58 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
59 * m4/.cvsignore: Add strcase.m4.
60 * src/getargs.c: Revert 2007-02-03 change, as follows.
61 Don't include c-strcase.h.
62 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
63 strcasecmp has "unspecified behavior" outside the POSIX locale,
64 but it works fine in practice if at least one argument is ASCII,
65 as is the case in Bison.
66
67 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
68
69 * tests/java.at: Skip tests if only one of javac/java is present.
70 Reported by Joel E. Denny.
71 * tests/atlocal.in: Adjust copyright years.
72
73 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
74
75 * data/lalr1.java (Stack): Work around old verifiers that disallow
76 access to the private fields of an inner class, from the outer class.
77 We can make Stack's fields public because user code doesn't have access
78 to the instance of Stack used by parse(). Reported by Paul Eggert.
79
80 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
81
82 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
83 the right spot for these files?
84 * bootstrap.conf (gnulib_modules): Add c-strcase.
85 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
86 c-strncasecmp.c.
87 * src/getargs.c: Include c-strcase.h.
88 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
89 to avoid unspecified behavior.
90
91 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
92
93 * doc/bison.texinfo (Decl Summary): Correct typo.
94
95 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
96
97 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
98 Complain if the value does not match empty, "true" or "false".
99 * data/c++.m4: Adjust default definitions of %define variables.
100 * data/java.m4: Adjust default definitions of %define variables.
101 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
102 to above behavior.
103 * tests/input.at (Boolean %define variables): Test new behavior.
104
105 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
106
107 * NEWS: Mention java.
108 * TODO: Remove things that are done.
109 * bootstrap.conf: Add javacomp-script and javaexec-script.
110 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
111
112 * data/Makefile.am: Add new files.
113 * data/java-skel.m4: New.
114 * data/java.m4: New.
115 * data/lalr1.java: New.
116
117 * doc/bison.texinfo: Put "A Complete C++ Example" under
118 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
119 under Other Languages.
120
121 * src/getargs.c (valid_languages): Add Java.
122 * src/getargs.h (struct bison_language): Update size of string fields.
123
124 * tests/Makefile.am: Add java.at.
125 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
126 * tests/java.at: New.
127 * tests/testsuite.at: Include it.
128
129 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
130
131 Clean up.
132 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
133 at_directive_argv arguments so these no longer have to be global
134 variables. Also, update the implementation for the following changes.
135 (fail_for_at_directive_too_many_args,
136 fail_for_at_directive_too_few_args): Add at_directive_name argument.
137 (at_directive_name): Remove as at_directive_argv[0] will be used for
138 this now.
139 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
140 for the directive name.
141 (at_directive_argc, at_directive_argv): Make these local within
142 skel_lex instead of global.
143 (INITIAL): Update directive start action for above changes.
144 (SC_AT_DIRECTIVE_ARG): Rename to...
145 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
146 (SC_AT_DIRECTIVE_SKIP_WS): Update.
147 (scan_skel): Move yylex_destroy to...
148 (skel_scanner_free): ... here.
149 * tests/skeletons.at (installed skeleton file name): Rename to...
150 (installed skeleton file names): ... this.
151
152 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
153
154 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
155 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
156 Summary" not "Directives".
157 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
158 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
159 since the former is now the more complete one.
160 (Prologue Alternatives): Likewise and do the same for %defines.
161 (Table of Symbols): Add summary of %code, add summary of %define, and
162 move full %code documentation to...
163 (Decl Summary): ... here for consistency with other entries in these
164 sections.
165 Move %define entry in order to keep this list alphabetized.
166 Reword %define entry a little to put less emphasis on the skeleton
167 concept, which most users shouldn't have to think about.
168
169 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
170
171 Adjust to recent gnulib changes.
172 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
173 Add string.h, string_.h, unistd_.h, wchar_.h.
174 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
175 * src/system.h: Don't include <stpcpy.h>; this is now done by
176 <string.h>.
177
178 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
179
180 Simplify implementation of unqualified %code, implement macros for
181 uniform treatment of boolean %define flags. Document %define.
182 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
183 b4_percent_code_ifdef): New.
184 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
185 * data/c++.m4: Define default value for global_tokens_and_yystype.
186 * data/glr.cc: Likewise.
187 * data/location.cc: Use b4_percent_define_flag_if.
188
189 * doc/bison.texinfo (Decl Summary): Document %define.
190
191 * src/parse-gram.y (Unqualified %code): Change muscle name to
192 b4_percent_code().
193 (content.opt): Default to empty.
194
195 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
196
197 Implement support for relative and absolute skeleton file names.
198 Discussed starting at
199 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
200 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
201 (Bison Options): Document in --skeleton entry.
202 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
203 full_skeleton can't necessarily hold all of pkgdatadir.
204 If the specified skeleton file name contains a `/', don't prepend
205 pkgdatadir.
206 * src/parse-gram.y (prologue_declaration): If the specified skeleton
207 file name contains a `/', prepend the grammar file directory.
208 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
209 * skeletons.at: New file.
210 (relative skeleton file names): New test case.
211 (installed skeleton file names): New test case.
212 * tests/testsuite.at: Include skeletons.at.
213
214 * bootstrap: Update copyright to 2007.
215
216 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
217
218 * bootstrap: Remove occurrences of .#bootmp from the files.
219
220 2007-01-17 Akim Demaille <akim@epita.fr>
221
222 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
223 nonterminals.
224 Use per-type %printer.
225
226 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
227
228 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
229 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
230 djgpp/config.site, src/files.c, src/files.h, src/main.c,
231 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
232 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
233 tests/glr-regression.at, tests/input.at, tests/local.at,
234 tests/output.at, tests/torture.at: Update copyright to 2007.
235
236 2007-01-16 Akim Demaille <akim@epita.fr>
237
238 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
239 error code.
240 (Calc++ Scanner): Exit with failure if we can't open the input
241 file.
242 Accept "-" standing for stdin.
243 (Calc++ Top Level): Print the result only if the parsing was
244 successful.
245
246 2007-01-16 Akim Demaille <akim@epita.fr>
247
248 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
249
250 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
251 and Joel E. Denny <jdenny@ces.clemson.edu>
252
253 Clean up %define and %code implementation in M4 some. Most
254 importantly, rename all related macros to be in the b4_percent_define
255 and b4_percent_code namespaces. Also, complete support for `.' in
256 %define variable names and %code qualifiers.
257 * data/bison.m4 (b4_check_user_names): Check for special
258 "SKELETON-NAMESPACE(name)" macros instead of using two nested
259 m4_foreach loops.
260 (b4_get_percent_define, b4_get_percent_code): Rename to...
261 (b4_percent_define_get, b4_percent_code_get): ... these.
262 Extend documentation with examples.
263 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
264 b4_percent_define_skeleton_variables and
265 b4_percent_code_skeleton_qualifiers.
266 Expect any value for the %define variable `foo' to be stored in the
267 macro named `b4_percent_define(foo)'; expect any %code blocks for the
268 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
269 expect any unqualified %code blocks to be stored in a macro named
270 `b4_percent_code_unqualified'.
271 Use m4_indir so that %define variable names and %code qualifiers can
272 contain `.', which is allowed by the grammar parser.
273 (b4_percent_define_default): New macro to set a default value for a
274 %define variable.
275 (m4_wrap): Update wrapped code, and fix some underquoting.
276 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
277 Expect grammar uses of %define variables and %code qualifiers to be
278 defined in b4_percent_define_user_variables and
279 b4_percent_code_user_qualifiers.
280 * data/c++.m4: Use b4_percent_define_default rather than
281 m4_define_default. Fix some underquoting. Skeleton usage of %define
282 variable define_location_comparison now implies skeleton usage of
283 %define variable filename_type.
284 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
285 data/push.c, data/yacc.c: Update macro names.
286 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
287 muscle names.
288
289 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
290
291 DJGPP specific issues.
292
293 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
294 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
295
296 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
297
298 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
299 run parsers in all tests so that Valgrind is invoked during
300 maintainer-check-valgrind.
301 (Duplicate representation of merged trees): Free all semantic values.
302 (Duplicated user destructor for lookahead): Likewise.
303
304 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
305
306 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
307 command-line prefix.
308 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
309 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
310 miss Valgrind messages.
311 (Exploding the Stack Size with Malloc): Likewise.
312
313 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
314
315 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
316 locals. Reported by Juan Manuel Guerrero at
317 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
318 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
319 Fix some indentation also.
320 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
321 explaining this issue.
322
323 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
324 and Joel E. Denny <jdenny@ces.clemson.edu>
325
326 Simplify union and prologue handling, and escape union and lex/parse
327 params with digraphs.
328 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
329 values to the empty string since these are no longer guaranteed
330 initialized by the front-end.
331 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
332 braces around b4_user_stype since this is no longer done by the
333 front-end.
334 * src/files.c, src/files.h (pre_prologue_obstack,
335 post_prologue_obstack): Remove.
336 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
337 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
338 with digraphs. This fixes lex params and parse params.
339 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
340 * src/output.c (prepare): Remove muscle insertion of the prologues.
341 (output): Remove freeing of pre_prologue_obstack and
342 post_prologue_obstack.
343 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
344 than prologue_augment for prologue parsing so you don't need prologue
345 obstacks.
346 (grammar_declaration): For %union RHS, use `braceless' instead of
347 "{...}" so that braces are already stripped and code is escaped with
348 digraphs.
349 * src/reader.c (prologue_augment): Remove.
350 (reader): Remove initialization of pre_prologue_obstack and
351 post_prologue_obstack.
352 * src/reader.h (prologue_augment): Remove.
353
354 * data/c.m4: Remove stray parenthesis.
355
356 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
357
358 Remove quotes from variables names in %define directives and from
359 qualifiers in %code directives, and restrict the characters that are
360 allowed in them to M4-friendly ones. For %define, continue to support
361 the quoted form as a deprecated feature. Discussed starting at
362 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
363 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
364 %code.
365 * doc/bison.texinfo (Prologue Alternatives): Update.
366 (Bison Declaration Summary): In %defines entry, update mention of
367 `%code requires' and `%code provides'.
368 (C++ Location Values): Update %define uses.
369 (Calc++ Parser Interface): Likewise.
370 (Calc++ Parser): Likewise, and update `%code requires' uses.
371 (Table of Symbols): Update %code documentation.
372 * src/parse-gram.y (prologue_declaration): For %define variables, use
373 `variable' instead of `STRING'.
374 (grammar_declaration): For %code qualifiers, use `ID' instead of
375 `STRING'.
376 (variable): New nonterminal that takes an `ID' or a `STRING'.
377 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
378 and %define uses.
379 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
380 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
381 (%define errors): Update %define uses.
382
383 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
384
385 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
386 instead of muscle_insert for %define values so that M4-special
387 characters are replaced with digraphs.
388 * tests/input.at (%define errors): Extend to check weird values.
389
390 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
391
392 Instead of having skeletons declare all valid %define variables and
393 %code qualifiers, provide macros that retrieve the associated values
394 and build these lists automatically. Thus Bison will now warn when a
395 variable or qualifier is not used by the skeleton in the current
396 invocation regardless of whether it might sometimes be used by that
397 skeleton in other invocations. Also, move all %define value macros to
398 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
399 form, which is replaced by %code.
400 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
401 (b4_check_user_names): ... this, and change the series of valid name
402 arguments to a single list argument for names used in the skeleton
403 similar to the existing list argument for names used in the grammar.
404 Warn instead of complaining.
405 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
406 values and %code code, to format %code code properly, and to build
407 lists of all %define variables and %code qualifiers used in the
408 skeleton: b4_skeleton_percent_define_variables and
409 b4_skeleton_percent_code_qualifiers.
410 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
411 Remove, and...
412 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
413 the skeleton names lists can finish building first. In place of
414 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
415 expect the lists b4_user_percent_define_variables and
416 b4_user_percent_code_qualifiers.
417 * data/c++.m4: Where setting default values for b4_parser_class_name,
418 b4_location_type, b4_filename_type, b4_namespace, and
419 b4_define_location_comparison, update their names to the
420 b4_percent_define_ namespace.
421 * data/glr.c: Don't use b4_check_percent_define_variables and
422 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
423 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
424 (b4_parser_class_name, b4_namespace): Define these using
425 b4_get_percent_define for parser_class_name and namespace.
426 * data/location.cc: Use b4_get_percent_define.
427 * data/push.c: Don't use b4_check_percent_define_variables and
428 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
429 * data/yacc.c: Likewise, and don't call m4_exit in
430 b4_use_push_for_pull_if or m4_wrap code will never execute.
431 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
432 Rename to...
433 (muscle_grow_user_name_list): ... this for consistency with the
434 terminology used in bison.m4.
435 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
436 %define variable names, and rename muscle used_percent_define_variables
437 to user_percent_define_variables.
438 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
439 user_percent_code_qualifiers.
440 (content): Remove.
441 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
442 {CODE} form is no longer accepted.
443 * tests/input.at (Reject bad %code qualifiers): Rename to...
444 (Reject unused %code qualifiers): ... this, and update test output.
445 (%define error): Update test output.
446
447 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
448
449 Check for unrecognized %define variables similar to checking for
450 unrecognized %code qualifiers. Check for redefined %define variables.
451 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
452 generalizes...
453 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
454 (b4_check_percent_define_variables): New, also wraps it.
455 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
456 variables using b4_check_percent_define_variables.
457 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
458 all those exercised in the test suite and all those listed in the
459 `Default values' section of c++.m4. Are there others?
460 * data/push.c, data/yacc.c: Declare no valid %define variables.
461 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
462 similar to muscle_find, but it works even when the muscle stores a
463 const value.
464 (muscle_grow_used_name_list): New function for constructing the used
465 name list muscles that b4_check_for_unrecognized_names requires.
466 * src/parse-gram.y (prologue_declaration): Warn if a variable is
467 %define'd more than once. Define the b4_used_percent_define_variables
468 muscle with muscle_grow_used_name_list.
469 (grammar_declaration): Abbreviate %code code with
470 muscle_grow_used_name_list.
471 * tests/input.at (%define errors): New.
472
473 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
474
475 Provide warn_at, complain_at, and fatal_at function callbacks to the
476 skeletons, and use this for %code qualifier complaints.
477 * data/bison.m4 (b4_error_at): New, invoked by...
478 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
479 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
480 @fatal_at(...@) directives.
481 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
482 qualifiers in b4_used_percent_code_qualifiers and to use
483 b4_complain_at.
484 * src/location.c, src/location.h (boundary_set_from_string): New global
485 function.
486 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
487 function.
488 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
489 to b4_used_percent_code_qualifiers.
490 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
491 function.
492 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
493 (lineno): Rename to...
494 (out_lineno): ... this so I don't misunderstand it again.
495 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
496 here; these newlines are in the input but not the output file.
497 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
498 (at_directive_perform): ... this new static function, and add handling
499 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
500 directives.
501 * tests/input.at (Reject bad %code qualifiers): Update test output with
502 locations and extend.
503
504 * tests/output.at (Output file name: [, Output file name: ]): Remove
505 bogus comment about these tests failing.
506
507 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
508
509 Clean up b4_check_percent_code_qualifiers a little.
510 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
511 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
512 documentation and add examples.
513 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
514 qualifiers here.
515
516 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
517
518 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
519 unreliable -- especially when they're hidden inside another macro.
520 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
521 data/c.m4: Remove m4_divert(-1).
522 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
523 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
524 m4_divert_push(0) and m4_divert_pop(0).
525 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
526 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
527 pushed and popped by m4sugar, should be first on the stack.
528
529 Provide warn, complain, and fatal function callbacks to the skeletons.
530 This provides more flexibility than m4_fatal, improves the error
531 message format, and captures messages for translation. Discussed
532 starting at
533 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
534 * data/bison.m4 (b4_error): New, invoked by...
535 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
536 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
537 directives. Because these M4 macros might be called when the current
538 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
539 the previous removal of uses of m4_divert, which caused trouble.
540 (b4_check_percent_code_qualifiers): Use b4_complain instead of
541 m4_fatal to report unrecognized %code qualifiers.
542 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
543 push parser requests.
544 * data/glr.c: Use b4_complain instead of m4_fatal to report
545 non-deterministic push parser requests.
546 Update @output usage to @output(...@) form.
547 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
548 report missing %defines. Update @output usage to @output(...@) form.
549 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
550 @output(...@) form.
551 * src/main.c (main): Invoke skel_scanner_free.
552 * src/scan-skel.h (skel_scanner_free): Prototype new function.
553 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
554 obstack_for_string from flex-scanner.h.
555 (YY_DECL): Use to declare skel_lex static.
556 (decode_at_digraphs): Remove; now handled in the new
557 SC_AT_DIRECTIVE_ARG start condition.
558 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
559 functions.
560 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
561 at_directive_argv): New static globals.
562 (INITIAL): Use fail_for_invalid_at.
563 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
564 recognize the start of a generalized `@directive(...@)' form and
565 start...
566 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
567 directive args (using the new obstack_for_string), to decode the
568 contained @ diagraphs, and to perform the directive. It recognizes
569 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
570 @output(...@).
571 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
572 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
573 `@,'.
574 (scan_skel): Initialize obstack_for_string on the first call.
575 (skel_scanner_free): New function to free obstack_for_string.
576 * tests/input.at (Reject bad %code qualifiers): Update test output.
577
578 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
579
580 Consolidate the 4 prologue alternative directives (%code, %requires,
581 %provides, and %code-top) into a single %code directive with an
582 optional qualifier field. Discussed at
583 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
584 * NEWS (2.3a+): Rewrite the existing entry for the prologue
585 alternatives.
586 * doc/bison.texinfo (Prologue Alternatives): Update.
587 (Decl Summary): Update to %code "requires" and %code "provides".
588 (Calc++ Parser): Update to %code "requires".
589 (Table of Symbols): Remove entries for %requires, %provides, and
590 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
591 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
592 are replaced by b4_percent_code_provides and b4_percent_code_requires,
593 which are skeleton-specific.
594 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
595 declare what %code qualifiers it supports and to complain if any other
596 qualifiers were used in the grammar.
597 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
598 and b4_user_code([b4_percent_code_provides]) in place of
599 b4_user_requires and b4_user_provides.
600 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
601 Add b4_user_code([b4_percent_code_top]) and
602 b4_user_code([b4_percent_code]).
603 Invoke b4_check_percent_code_qualifiers.
604 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
605 PERCENT_REQUIRES): Remove.
606 (grammar_declaration): Remove RHS's for %code-top, %provides, and
607 %requires. Rewrite the %code RHS as the unqualified form defining the
608 muscle b4_percent_code. Add another RHS for the qualified %code form,
609 which defines muscles of the form b4_percent_code_QUALIFIER and the
610 b4_used_percent_code_qualifiers muscle.
611 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
612 PERCENT_REQUIRES): Remove.
613 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
614 %code "requires" and %code "provides".
615 * tests/input.at (Reject bad %code qualifiers): New.
616
617 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
618
619 Use the new code_props interface for destructors and printers.
620 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
621 printer_location members, and change the type of the destructor and
622 printer members to code_props.
623 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
624 symbol_printer_get, semantic_type_destructor_set,
625 semantic_type_printer_set, default_tagged_destructor_set,
626 default_tagless_destructor_set, default_tagged_printer_set,
627 default_tagless_printer_set): Use code_props in arguments and return
628 types in place of char const * and location.
629 (symbol_destructor_location_get, symbol_printer_location_get): Remove
630 since the locations are now contained in the return of
631 symbol_destructor_get and symbol_printer_get.
632 * src/output.c (symbol_destructors_output, symbol_printers_output):
633 Replace with...
634 (symbol_code_props_output): ... this to eliminate duplicate code.
635 (output_skeleton): Update to use symbol_code_props_output.
636 * src/reader.c (symbol_should_be_used): Update use of
637 symbol_destructor_get.
638 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
639 Update uses of the various _destructor_set and _printer_set functions.
640 * src/symtab.c: (default_tagged_destructor_location,
641 default_tagless_destructor_location, default_tagged_printer_location,
642 default_tagless_printer_location): Remove since we...
643 (default_tagged_destructor, default_tagless_destructor,
644 default_tagged_printer, default_tagless_printer): ... change the type
645 of these to code_props.
646 (symbol_new, semantic_type_new, symbol_destructor_set,
647 semantic_type_destructor_set, symbol_destructor_get,
648 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
649 symbol_check_alias_consistency, default_tagged_destructor_set,
650 default_tagless_destructor_set, default_tagged_printer_set,
651 default_tagless_printer_set): Update.
652 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
653 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
654 code_props members.
655 (symbol_print): Use SYMBOL_CODE_PRINT.
656
657 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
658
659 Use the new code_props interface for rule actions.
660 * src/symlist.h (symbol_list): Replace action, action_location, and
661 used members with a code_props action_props member.
662 * src/reader.c (symbol_should_be_used, grammar_rule_check,
663 grammar_midrule_action, grammar_current_rule_merge_set,
664 grammar_current_rule_symbol_append, packgram): Update.
665 * src/scan-code.h (translate_rule_action): Remove, no longer used.
666 * src/scan-code.l (handle_action_dollar): Update.
667 (translate_rule_action): Remove, no longer used.
668 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
669
670 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
671
672 Use the new code_props interface in parse-gram.y.
673 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
674 Update all uses of translate_* functions to use the new code_props
675 interface and to use gram_scanner_last_string_free and
676 code_scanner_last_string_free where possible.
677 (grammar_declaration): symbol_list_destructor_set and
678 symbol_list_printer_set now perform the translation, so don't do it
679 here. Use gram_scanner_last_string_free where possible.
680 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
681 translate_code): Remove, no longer used.
682 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
683 symbol_list_printer_set): Perform code translation here rather than
684 depending on the caller to do so.
685
686 * src/symlist.h (struct symbol_list): Correct some documentation typos.
687 * src/scan-gram.h (gram_last_string): Remove declaration.
688 * src/scan-gram.l (last_string): Declare it static.
689
690 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
691
692 Encapsulate code properties and related functionality for the various
693 destructors, printers, and actions into a code_props structure and
694 interface. This patch merely implements code_props in scan-code.h and
695 scan-code.l. Future patches will rewrite other modules to use it.
696 Discussed starting at
697 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
698 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
699 consistently initialize const structs that have an empty location
700 field.
701 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
702 to ensure consistency.
703 * src/scan-code.h (code_props): New structure.
704 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
705 function, macro, and const global variable for initializing a
706 code_props with no code.
707 (code_props_plain_init, code_props_symbol_action_init,
708 code_props_rule_action_init, code_props_translate_code): The rest of
709 the new code_props functional interface. Among other things, the init
710 functions set the code_props kind field so that
711 code_props_translate_code will know whether to behave like
712 translate_symbol_action, translate_rule_action, or translate_code.
713 These old translate functions must remain until all other modules are
714 updated to use the new code_props interface.
715 (code_scanner_last_string_free): New function similar to
716 gram_scanner_last_string_free.
717 (code_scanner_free): Add documentation.
718 * src/scan-code.l: Implement the new interface.
719 (code_lex): Make it static, add a code_props* argument, and remove the
720 rule argument.
721 (last_string): New static global similar to the one in scan-gram.l.
722 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
723 instead of rule.
724 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
725 code_props since Bison may one day use this information for destructors
726 and printers.
727 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
728 (handle_action_dollar): Use symbol_list_n_get and set used flag
729 directly since symbol_list_n_used_set is removed.
730 (translate_action): Add a code_props* argument and remove the rule,
731 action, and location arguments. Pass the code_props* on to code_lex.
732 (translate_rule_action, translate_symbol_action, translate_code):
733 Rewrite as wrappers around the new code_props interface.
734 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
735 it would eventually need to break the encapsulation of code_props.
736
737 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
738
739 * etc/.cvsignore: New.
740
741 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
742
743 Add maintainer-push-check to run maintainer-check using push parsing in
744 place of pull parsing where available.
745 * Makefile.am (maintainer-push-check): New.
746 * data/bison.m4 (b4_use_push_for_pull_if): New.
747 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
748 appropriately based on their existing values.
749 (yypush_parse): Don't print push-parser-specific diagnostics if push
750 parsing is being used in place of pull parsing.
751 * data/yacc.c: If push parsing should replace pull parsing, redirect to
752 push.c.
753 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
754 variable, and insert b4_use_push_for_pull_flag into muscles.
755 * tests/Makefile.am (maintainer-push-check): New.
756
757 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
758
759 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
760 (whether successful or failed) so that yypush_parse can be invoked
761 again to start a new parse using the same yypstate.
762 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
763 check multiple yypull_parse invocations on the same yypstate. For pull
764 mode, extend to check multiple yyparse invocations.
765 (Exploding the Stack Size with Alloca): Extend to try with
766 %push-pull-parser.
767 (Exploding the Stack Size with Malloc): Likewise.
768
769 * tests/calc.at (Simple LALR Calculator): Don't specify
770 %skeleton "push.c" since %push-pull-parser implies that now.
771 * tests/headers.at (export YYLTYPE): Don't check for the push
772 declarations. Otherwise, this test case can't be used to see if push
773 mode can truly emulate pull mode.
774 * tests/input.at (Torturing the Scanner): Likewise.
775 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
776 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
777 AT_YACC_IF, which now includes the case of push mode since %skeleton
778 need not be used for push mode. This will be more intuitive once
779 push.c is renamed to yacc.c.
780
781 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
782
783 For push mode, convert yyparse from a macro to a function, invoke yylex
784 instead of passing a yylexp argument to yypull_parse, and don't
785 generate yypull_parse or yyparse unless %push-pull-parser is declared.
786 Discussed starting at
787 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
788 * data/bison.m4 (b4_pull_if): New.
789 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
790 * data/push.c: Improve M4 quoting a little.
791 (b4_generate_macro_args, b4_parenthesize): Remove.
792 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
793 any time a pull parser is requested.
794 Don't #define this as a wrapper around yypull_parse. Instead, when
795 both push and pull are requested, make it a function that does that
796 same thing.
797 (yypull_parse): If there's a b4_prefix, #define this to
798 b4_prefix[pull_parse] when both push and pull are requested.
799 Don't define this as a function unless both push and pull are
800 requested.
801 Remove the yylexp argument and hard-code yylex invocation instead.
802 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
803 %push-parser.
804 * src/getargs.c (pull_parser): New global initialized to true.
805 * getargs.h (pull_parser): extern it.
806 * src/output.c (prepare): Insert pull_flag muscle.
807 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
808 (prologue_declaration): Set both push_parser and pull_parser = true for
809 %push-pull-parser. Set push_parser = true and pull_parser = false for
810 %push-parser.
811 * src/scan-gram.l: Don't accept %push_parser as an alternative to
812 %push-parser since there's no backward-compatibility concern here.
813 Scan %push-pull-parser.
814 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
815 instead of %push-parser.
816 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
817 prototype it in the module that calls yyparse.
818 * tests/input.at (Torturing the Scanner): Likewise.
819 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
820
821 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
822
823 Update etc/bench.pl. Optimize push mode a little (the yyn change
824 deserves most of the credit).
825 * Makefile.am (SUBDIRS): Add etc subdirectory.
826 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
827 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
828 yytoken, yyval, and yyloc declarations to...
829 (yyparse or yypush_parse): ... here to improve performance. For
830 yypush_parse invocations after the first, be sure to assign yyn its old
831 value again.
832 (yypstate_new): Don't bother initializing the yyresult field since the
833 initial value isn't used.
834 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
835 remove the #define that, in push mode, set it to yyps->NAME.
836 * etc/Makefile.am: New.
837 * etc/bench.pl: Remove and build it instead from...
838 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
839 "tests/bison" from the build directory by default rather than just
840 invoking "bison" from $PATH.
841 (calc_grammar): Update push parser code: don't declare yylval globally,
842 don't define yyparse_wrapper, and don't #define yyparse.
843 (bench_grammar): Update to check all working combinations of yacc.c,
844 push.c, impure, pure, pull, and push.
845
846 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
847
848 For push mode, add pull wrappers around yypush_parse.
849 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
850 (yypull_parse): New function wrapping yypush_parse.
851 (yyparse): New #define wrapping yypull_parse.
852 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
853 is declared.
854 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
855 prototype yylex in the module that calls yyparse, and don't prototype
856 yyparse there. Otherwise, the yyparse expansion won't compile.
857 * tests/input.at (Torturing the Scanner): Likewise.
858
859 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
860
861 Enable push parsers to operate in impure mode. Thus, %push-parser no
862 longer implies %pure-parser. The point of this change is to move
863 towards being able to test the push parser code by running the entire
864 test suite as if %push-parser had been declared.
865 * data/push.c (yypush_parse): For impure mode, remove the
866 yypushed_char, yypushed_val, and yypushed_loc arguments.
867 Instead, declare these as local variables initialized to the global
868 yychar, yylval, and yylloc.
869 For the first yypush_parse invocation only, restore the initial values
870 of these global variables when it's time to read a token since they
871 have been overwritten.
872 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
873 %push-parser.
874 * tests/calc.at (Simple LALR(1) Calculator): Always declare
875 %pure-parser along with %push-parser since this test case was designed
876 for pure push parsers.
877 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
878 (AT_YACC_OR_PUSH_IF): New.
879 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
880 add a note that it's still wrong for some cases (as it has been for a
881 while).
882 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
883 %push-parser no longer implies %pure-parser.
884
885 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
886
887 Remove some unnecessary differences between the pull parser code and
888 the push parser code. This patch enables yynerrs in push mode.
889 * data/push.c: Reformat M4 a little.
890 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
891 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
892 because push mode is on. Instead, if pure mode is on, move yynerrs
893 to...
894 (b4_declare_parser_state_variables): ... here.
895 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
896 to yyps->NAME so it can be used in yypush_parse.
897 (yypush_parse): Don't omit uses of yynerrs in push mode.
898
899 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
900
901 Fix bug such that the first pushed token's value and location are
902 sometimes overwritten (sometimes by %initial-action) before being used.
903 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
904 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
905 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
906 more closely mimic the pull parser logic.
907 Don't copy the pushed token to yychar, yylval, and yylloc until it's
908 time to read a token, which is after any initialization of yylval and
909 yylloc.
910 (gottoken): Rename label to...
911 (yyread_pushed_token): ... for clarity and to avoid infringing on the
912 user namespace.
913
914 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
915
916 Rearrange initialization of the parser state variables so that the
917 skeleton doesn't have to have a copy for pull mode and another for push
918 mode. This patch also fixes at least a bug such that yylloc was not
919 initialized (with b4_location_initial_line and
920 b4_location_initial_column) upon calling yypush_parse. However, that
921 initialization now overwrites the first token's location;
922 %initial-action assigning @$ already did the same thing, and both bugs
923 will be fixed in a later patch.
924 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
925 (b4_declare_parser_state_variables): Remove initialization of yytoken,
926 yyss, yyvs, yyls, and yystacksize.
927 (yypstate_new): Remove initialization of some yypstate fields: yystate,
928 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
929 yylsp.
930 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
931 yyps->NAME so it can be used in yypush_parse.
932 (yyparse or yypush_parse): For yypush_parse, don't print the
933 "Starting parse" diagnostic for invocations after the first.
934 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
935 yypush_parse, only do it for the first invocation.
936 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
937 initialization to occur in yypush_parse but only on the first
938 invocation.
939
940 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
941
942 * data/push.c: Add CPP guards around push parser declarations in both
943 the header and the code file.
944 In the code file, move the push parser declarations to the same place
945 they appear in the header file.
946 Clean up the M4 some, especially the inconsistent underquoting in
947 some b4_c_function_def and b4_c_function_decl uses.
948
949 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
950
951 Encapsulate the push parser state variables into an M4 macro so the
952 push skeleton doesn't have to list them again for pull mode's yyparse.
953 For push mode, remove yypush_parse's local equivalents of these
954 variables to eliminate unnecessary copying between the two sets at
955 run-time. This patch also fixes at least a bug related to multiple
956 %initial-action invocations in push mode.
957 * data/push.c (b4_declare_parser_variables): Rename to...
958 (b4_declare_scanner_communication_variables): ... this for clarity and
959 update both uses.
960 (b4_declare_yyparse_variables): Remove and move its contents to the one
961 spot where it was invoked.
962 (b4_declare_parser_state_variables): New macro containing the parser
963 state variables required by push mode.
964 (struct yypstate): Replace all fields but yynew with
965 b4_declare_parser_state_variables.
966 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
967 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
968 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
969 (yyparse or yypush_parse): For yyparse in pull mode, replace local
970 parser state variable declarations with
971 b4_declare_parser_state_variables.
972 Don't initialize parser state variables when calling yypush_parse since
973 yypstate_new already does that.
974 Invoke the user's initial action only upon the first yypush_parse
975 invocation.
976 Remove all code that copies between the local parser state variables
977 and the yypstate.
978
979 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
980
981 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
982 prevent a name collision in a future patch where these names will
983 sometimes be #define'd.
984 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
985 since it no longer has the same name as the existing argument.
986 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
987
988 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
989 and Joel E. Denny <jdenny@ces.clemson.edu>
990
991 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
992 that the argument is case-insensitive, and there's no `=' here.
993 For the %skeleton entry, mention that %language is better.
994 (Bison Options): Likewise for --language and --skeleton. Move the
995 --skeleton entry so that the `Tuning the parser' section is sorted
996 alphabetically on long options.
997 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
998 %language directive in detail here; cross-reference the %language
999 documentation instead.
1000 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
1001 `%require "2.3b"' so that the example is always up-to-date.
1002 (Table of Symbols): Add entries for %language and %skeleton.
1003 * examples/extexi (normalize): Instead of replacing every %require
1004 argument with the current Bison version, just substitute for
1005 `@value{VERSION}'. This guarantees that we're testing what actually
1006 appears in the documentation.
1007 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
1008 rather than `@VERSION@'.
1009
1010 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1011
1012 * NEWS: Reword the %language news a bit, and put it earlier.
1013
1014 * src/getargs.c (skeleton_arg): Last arg is now location const *.
1015 Rewrite to simplify the logic.
1016 (language_argmatch): Likewise.
1017 (program_name): We now own this var.
1018 * src/getargs.h (struct bison_language): Use char[] rather than
1019 const char *.
1020
1021 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
1022 Java is supported.
1023 * src/complain.c (program_name): Remove decl; no longer needed.
1024 * src/main.c (program_name): Remove; now belongs to getargs.
1025
1026 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
1027
1028 * NEWS: Document %language.
1029
1030 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
1031
1032 * data/c-skel.m4, data/c++-skel.m4: New files.
1033 * data/glr.c: Complain on push parsers.
1034
1035 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
1036 over %skeleton.
1037 (Decl Summary): Document %language and %skeleton.
1038 (Command line): Document -L.
1039
1040 * examples/extexi: Rewrite %require directive.
1041 * examples/calc++/Makefile.am: Pass VERSION to extexi.
1042
1043 * src/files.c (compute_exts_from_gc): Look in language structure
1044 for .y extension.
1045 (compute_file_name_parts): Check whether .tab should be added.
1046 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
1047 (language, skeleton_arg, language_argmatch): New.
1048 (long_options): Add --language.
1049 (getargs): Use skeleton_arg, add -L/--language.
1050 * src/getargs.h: Include location.h.
1051 (struct bison_language, language, skeleton_arg, language_argmatch): New.
1052 * src/output.c (prepare): Pick default skeleton from struct language.
1053 Don't dispatch C skeletons here.
1054 * src/parse-gram.y (PERCENT_LANGUAGE): New.
1055 (prologue_declaration): Add "%language" rule, use skeleton_arg.
1056 * src/scan-gram.l ("%language"): New rule.
1057
1058 * tests/calc.at: Test %skeleton and %language.
1059 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
1060 (AT_GLR_IF): Look for %skeleton "glr.cc".
1061 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
1062 (AT_YACC_IF): Reject %language.
1063
1064 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1065
1066 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
1067 since it wasn't used; only the typedef name 'semantic_type' is needed.
1068 Also, omit trailing white space.
1069
1070 * bootstrap: Sync from coreutils.
1071 (gnulib_extra_files): Add build-aux/announce.gen.
1072 (slurp): Adjust .gitignore files like .cvsignore files.
1073 * build-aux/announce-gen: Remove from CVS, since bootstrap
1074 now creates this.
1075
1076 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
1077
1078 Make %push-parser imply %pure-parser. This fixes several bugs; see
1079 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
1080 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
1081 pure_parser = true.
1082 * data/push.c: Don't bother testing b4_push_if when deciding whether
1083 to expand b4_declare_parser_variables globally.
1084 (yypush_parse): Likewise in here.
1085
1086 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
1087 (yy_reduce_print): Reformat M4 for readability.
1088
1089 2006-12-15 Bob Rossi <bob@brasko.net>
1090 and Joel Denny <jdenny@ces.clemson.edu>
1091
1092 * data/push.c (yypstate): Add typedef, and update all uses of
1093 struct yypstate to just yypstate.
1094 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
1095
1096 2006-12-14 Bob Rossi <bob@brasko.net>
1097
1098 * data/push.c (yypush_parse): Declare prototype regardless of
1099 %locations option.
1100
1101 2006-12-14 Bob Rossi <bob@brasko.net>
1102
1103 * data/push.c (yyparse): Remove the prototype and the #define when in
1104 push-parser mode.
1105
1106 2006-12-13 Bob Rossi <bob@brasko.net>
1107
1108 * data/push.c (yypstate_init): Rename to...
1109 (yypstate_new): ... this and use b4_c_function_def.
1110 (yypstate_delete): New.
1111 (yypush_parse): Change parameters yynval and yynlloc to be const.
1112 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
1113 yypstate_delete functions.
1114
1115 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
1116
1117 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
1118 strange test case titles. Reported by Bob Rossi.
1119
1120 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
1121
1122 * TODO: Add pointer to Sylvain Schmitz's work on static detection
1123 of potential ambiguities in GLR grammers.
1124
1125 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
1126
1127 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
1128 `bison ', use m4_index instead of m4_substr since chopping up a string
1129 containing M4-special characters causes problems here.
1130
1131 Fix a couple of bugs related to special characters in user-specified
1132 file names, and make it easier for skeletons to compute output file
1133 names with the same file name prefix as Bison-computed output file
1134 names.
1135 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
1136 b4_parser_file_name and b4_spec_defines_file instead of
1137 @output_parser_name@ and @output_header_name@, which are now redundant.
1138 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
1139 b4_parser_file_name, b4_spec_defines_file, and the new
1140 @basename(FILENAME@) instead of @output_parser_name@ and
1141 @output_header_name@, which inappropriately escaped the file names as
1142 C string literals.
1143 * src/files.c (all_but_ext): Remove static qualifier.
1144 (compute_output_file_names): Move `free (all_but_ext)' to...
1145 (output_file_names_free): ... here since all_but_ext is needed later.
1146 * src/files.h (all_but_ext): Extern.
1147 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
1148 exactly what MUSCLE_INSERT_STRING used to do.
1149 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
1150 characters are escaped properly.
1151 * src/output.c (prepare): Define muscle file_name_all_but_ext as
1152 all_but_ext.
1153 For pkgdatadir muscle, maintain previous functionality by using
1154 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
1155 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
1156 digraphs would never be expanded. Hopefully no one has M4-special
1157 characters in his Bison installation path.
1158 * src/scan-skel.l: Don't parse @output_header_name@ and
1159 @output_parser_name@ anymore since they're now redundant.
1160 In @output, use decode_at_digraphs.
1161 Parse a new @basename command that invokes last_component.
1162 (decode_at_digraphs): New.
1163 (BASE_QPUTS): Remove unused.
1164 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
1165 (Output file name): New tests.
1166
1167 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
1168
1169 Warn about output files that are generated by the skeletons and that
1170 conflict with other output files.
1171 * data/glr.c: Don't generate the header file here when glr.cc does.
1172 * src/files.c (file_names, file_names_count): New static globals.
1173 (compute_output_file_names): Invoke output_file_name_check for files
1174 not generated by the skeletons and remove existing checks.
1175 (output_file_name_check): New function that warns about conflicting
1176 output file names.
1177 (output_file_names_free): Free file_names.
1178 * src/files.h (output_file_name_check): Declare.
1179 * src/scan-skel.l: Invoke output_file_name_check for files generated by
1180 the skeletons.
1181 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
1182 (Conflicting output files): New tests.
1183
1184 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1185
1186 * doc/bison.texinfo: Fix a couple of typos.
1187
1188 2006-12-08 Bob Rossi <bob@brasko.net>
1189
1190 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
1191 Rename to...
1192 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
1193 update all uses.
1194 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
1195 (yypush_parse): Rename yypvars argument to yyps and remove redundant
1196 local pv.
1197 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
1198 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
1199
1200 2006-12-07 Bob Rossi <bob@brasko.net>
1201 and Joel Denny <jdenny@ces.clemson.edu>
1202
1203 * data/push.c (yypvarsinit): Change return type from void* to struct
1204 yypvars*. No longer cast to void* on return.
1205 (struct yypvars): Remove yylen since it need not be remembered between
1206 yypushparse invocations.
1207 (yypushparse): Don't copy between yylen and pv->yylen.
1208
1209 2006-12-05 Bob Rossi <bob@brasko.net>
1210
1211 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
1212 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
1213 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
1214 (struct yypvars): Remove b4_declare_parser_variables.
1215 (yypvarsinit): Remove init code for removed variables.
1216 (global scope): Do not declare b4_declare_parser_variables if
1217 push or pure mode.
1218 (yypushparse): Add b4_declare_parser_variables.
1219 Init new local variables, and remove init code for removed
1220 yypvars variables.
1221 (yyparse): Delete.
1222 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
1223 and yyparse for other modes.
1224 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
1225 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
1226 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
1227 (AT_PURE_LEX_IF): True if pure or push parser.
1228
1229 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
1230
1231 Document Yacc prologue alternatives and default %destructor's and
1232 %printer's as experimental. Don't mention Java yet. Discussed at
1233 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
1234 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
1235 (2.3a): Annotate this entry to say the old forms of these features were
1236 also experimental.
1237 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
1238 Table of Symbols): Say they're experimental. Comment out any mention
1239 of Java (we'll want this back eventually).
1240
1241 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1242
1243 Support a file name argument to %defines. Deprecate `=' in
1244 %file-prefix, %name-prefix, and %output. Discussed at
1245 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
1246 * NEWS (2.3a+): Mention.
1247 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
1248 form of %defines, and remove `=' from entries for %file-prefix,
1249 %name-prefix, and %output.
1250 * src/parse-gram.y (prologue_declaration): Implement.
1251 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
1252 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
1253 all but one occurrence of %name-prefix.
1254 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
1255 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
1256 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
1257 occurrence of each of %file-prefix and %output. Add check for %defines
1258 with argument.
1259 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
1260 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
1261 Remove the `=' from %output.
1262
1263 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
1264
1265 Don't escape $ in test case titles since Autoconf 2.61 now does that
1266 correctly.
1267 * tests/actions.at (Default %printer and %destructor are not for error
1268 or $undefined): Here.
1269 (Default %printer and %destructor are not for $accept): Here.
1270 * tests/input.at (Invalid $n and @n): Here.
1271
1272 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
1273
1274 Rename <!> to <>. Discussed starting at
1275 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
1276 * NEWS (2.3a+): Update.
1277 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
1278 Update.
1279 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
1280 * src/scan-gram.l (INITIAL): Implement.
1281 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
1282 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
1283 comment.
1284 * tests/actions.at (Default tagless %printer and %destructor,
1285 Default tagged and per-type %printer and %destructor,
1286 Default %printer and %destructor are not for error or $undefined,
1287 Default %printer and %destructor are not for $accept,
1288 Default %printer and %destructor for mid-rule values): Update.
1289 * tests/input.at (Default %printer and %destructor redeclared,
1290 Unused values with default %destructor): Update.
1291
1292 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1293
1294 Don't let %prec take a nonterminal.
1295 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
1296 token.
1297 * tests/input.at (%prec takes a token): New test checking that %prec
1298 won't take a nonterminal.
1299
1300 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1301
1302 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
1303 it was double-quoted.
1304 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
1305 grammar is maintained with Bison's highest standards.
1306 * src/getargs.c: Fix some typos in Doxygen comments.
1307
1308 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1309
1310 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
1311 later. Reported by Paul Eggert in
1312 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
1313 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
1314 * src/scan-code.l (translate_action): Don't bother invoking
1315 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
1316 (code_scanner_free): Instead of invoking
1317 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
1318 which frees more.
1319 * src/scan-gram.l (gram_scanner_free): Likewise.
1320 * src/scan-skel.l (scan_skel): Likewise.
1321
1322 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
1323
1324 * src/files.c (tr): Change return type to void.
1325 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
1326 has been called previously for the same key.
1327 (muscle_find): Return storage instead of value so that
1328 --enable-gcc-warnings doesn't produce warnings that the return discards
1329 const. aver that the value and storage are the same since storage
1330 could potentially be NULL when value is not.
1331 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
1332 same as 0.
1333
1334 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1335
1336 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
1337 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
1338 us a slightly cleaner distribution, and also works.
1339 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
1340 gnulib changes.
1341
1342 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
1343 and Paul Eggert <eggert@cs.ucla.edu>
1344
1345 Don't let Bison leak memory except when it complains.
1346 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
1347 (spec_defines_file, dir_prefix): Now char *, not const char *,
1348 since they are freed.
1349 * src/files.c: Likewise.
1350 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
1351 Likewise.
1352 (tr): Now operates in-place. All uses changed.
1353 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
1354 values.
1355 (compute_file_name_parts, compute_output_file_names): Don't store
1356 read-only data in variables that will be freed.
1357 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
1358 src_extension, and header_extension.
1359 (output_file_names_free): New public function to free
1360 spec_verbose_file, spec_graph_file, spec_defines_file,
1361 parser_file_name, and dir_prefix.
1362 * src/getargs.c (getargs): Don't store read-only data in variables that
1363 will be freed.
1364 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
1365 (which previously existed but was unused), and quotearg_free.
1366 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
1367 * src/muscle_tab.c: Likewise.
1368 (muscle_entry): Make the value char const *,
1369 and add a new storage member that is char * and can be freed.
1370 (muscle_entry_free): New private function.
1371 (muscle_init): Use it instead of free.
1372 (muscle_insert, muscle_grow): Update and use new storage member.
1373 (muscle_code_grow): Free the string passed to muscle_grow
1374 since it's not needed anymore.
1375 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
1376 add a new `char *code' member.
1377 ("{...}"): Declare semantic type as code.
1378 * src/scan-code.h (translate_rule_action):
1379 (translate_symbol_action, translate_code, translate_action): Return
1380 `char const *' rather than `char *' since external code should not free
1381 these strings.
1382 * src/scan-code.l: Likewise.
1383 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
1384 which is "{...}" in the parser.
1385 * tests/Makefile.am (maintainer-check-valgrind): Set
1386 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
1387 Valgrind.
1388 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
1389 complain.
1390 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
1391 expecting a non-zero exit status sets --leak-check=summary and
1392 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
1393 this case, and we don't want to hear about it.
1394
1395 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1396
1397 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
1398 instead of from the template, to simplify configuration a bit.
1399 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
1400 and m4/wint_t.m4, as they are needed with the latest gnulib.
1401
1402 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1403
1404 Disable unset/unused mid-rule value warnings by default, and recognize
1405 --warnings=midrule-values to enable them. Discussed starting at
1406 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
1407 * NEWS (2.3a+): Mention.
1408 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
1409 warnings): Add entry for midrule-values subargument.
1410 * src/reader.c (symbol_should_be_used): Don't return true just because
1411 the value is a set/used mid-rule value unless
1412 --warnings=midrule-values was specified.
1413 * tests/input.at (Unused values, Unused values before symbol
1414 declarations): Run tests with and without --warnings=midrule-values.
1415
1416 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
1417 than LIST_FREE directly.
1418
1419 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1420
1421 Finish implementing --warnings=error, which should not be implied by
1422 --warnings=all (or by its synonyms -W and --warnings without
1423 subarguments).
1424 * src/complain.c (set_warning_issued): New function to report that
1425 warnings are being treated as errors and to record an error if so.
1426 Invoke...
1427 (warn_at, warn): ... here.
1428 * src/getargs.c (warnings_args, warnings_types): Reorder so that
1429 "error - warnings are errors" does not appear above "all - all of the
1430 above".
1431 (getargs): For -W and --warnings without subarguments, don't let
1432 FLAGS_ARGMATCH set warnings_error in warnings_flag.
1433 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
1434
1435 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1436
1437 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
1438 empty subargument list. For example: `bison --warnings= parser.y'.
1439
1440 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1441
1442 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
1443 the parser header file so that gcc doesn't warn.
1444
1445 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1446
1447 Split the default %destructor/%printer into two kinds: <*> and <!>.
1448 Discussed starting at
1449 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
1450 * NEWS (2.3a+): Mention.
1451 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
1452 previous change today related to mid-rules.
1453 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
1454 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
1455 (TYPE_TAG_ANY): Add as <*>.
1456 (TYPE_TAG_NONE): Add as <!>.
1457 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
1458 for <*> and <!>.
1459 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
1460 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
1461 * src/symlist.c (symbol_list_default_new): Split into tagged and
1462 tagless versions.
1463 (symbol_list_destructor_set, symbol_list_printer_set): Split
1464 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
1465 SYMLIST_DEFAULT_TAGLESS.
1466 * src/symlist.h: Update symbol_list_default*_new prototypes.
1467 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
1468 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
1469 * src/symtab.c (default_destructor, default_destructor_location,
1470 default_printer, default_printer_location): Split each into tagged and
1471 tagless versions.
1472 (symbol_destructor_get, symbol_destructor_location_get,
1473 symbol_printer_get, symbol_printer_location_get): Implement tagged
1474 default and tagless default cases.
1475 (default_destructor_set, default_printer_set): Split each into tagged
1476 and tagless versions.
1477 * src/symtab.h: Update prototypes.
1478 * tests/actions.at (Default %printer and %destructor): Rename to...
1479 (Default tagless %printer and %destructor): ... this, and extend.
1480 (Per-type %printer and %destructor): Rename to...
1481 (Default tagged and per-type %printer and %destructor): ... this, and
1482 extend.
1483 (Default %printer and %destructor for user-defined end token): Extend.
1484 (Default %printer and %destructor are not for error or $undefined):
1485 Update.
1486 (Default %printer and %destructor are not for $accept): Update.
1487 (Default %printer and %destructor for mid-rule values): Extend.
1488 * tests/input.at (Default %printer and %destructor redeclared): Extend.
1489 (Unused values with default %destructor): Extend.
1490
1491 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1492
1493 Don't apply the default %destructor/%printer to an unreferenced midrule
1494 value. Mentioned at
1495 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
1496 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
1497 like $@n instead of just @n so that the default %destructor/%printer
1498 logic doesn't see them as user-defined symbols.
1499 (symbol_is_dummy): Check for both forms of the name.
1500 * src/reader.c (packgram): Remove the `$' from each midrule symbol
1501 name for which the midrule value is referenced in any action.
1502 * tests/actions.at (Default %printer and %destructor for mid-rule
1503 values): New test.
1504 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
1505 for change to dummy symbol names.
1506
1507 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1508
1509 Warn about unset midrule $$ if the corresponding $n is used.
1510 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
1511 $n usage.
1512 (packgram): Before invoking grammar_rule_check on any rule, make sure
1513 all actions have already been scanned in order to set `used' flags.
1514 Otherwise, checking that a midrule's $$ is set will not always work
1515 properly because the midrule check must forward-reference the midrule's
1516 parent rule.
1517 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
1518 warning.
1519
1520 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1521
1522 More improvements to the documentation of the prologue alternatives:
1523 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
1524 Bison manual.
1525 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
1526 some text to clarify the relative importance of the new directives and
1527 to show how these directives may be viewed as code labels.
1528
1529 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
1530
1531 Similar to the recently removed %before-header, add %code-top as the
1532 alternative to the pre-prologue. Mentioned at
1533 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
1534 Also, let the prologue alternatives appear in the grammar section.
1535 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
1536 (prologue_declaration): Move the existing prologue alternatives to...
1537 (grammar_declaration): ... here and add %code-top.
1538 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
1539
1540 Clean up and extend documentation for the prologue alternatives.
1541 * NEWS (2.3a+): Describe prologue alternatives.
1542 * doc/bison.texinfo (Prologue): Move discussion of prologue
1543 alternatives to...
1544 (Prologue Alternatives): ... this new section, and extend it to discuss
1545 all 4 directives in detail.
1546 (Table of Symbols): Clean up discussion of prologue alternatives and
1547 add %code-top.
1548
1549 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1550
1551 DJGPP specific issues.
1552
1553 * djgpp/config.bat: config.hin has been moved to lib. Adjust
1554 config.bat accordingly.
1555 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
1556 * djgpp/config.site: Likewise.
1557
1558 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
1559
1560 Replace %*-header with %provides, %requires, %code. See discussion at
1561 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
1562
1563 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
1564 (b4_user_start_header): Remove.
1565 * data/glr.c: Use new macros instead of b4_*start_header
1566 and b4_*end_header.
1567 * data/glr.cc: Likewise.
1568 * data/lalr1.cc: Likewise.
1569 * data/push.c: Likewise.
1570 * data/yacc.c: Likewise.
1571
1572 * doc/bison.texinfo: Remove %before-header, rename
1573 %{start,end,after}-header to %requires, %provides, %code.
1574
1575 * src/parse-gram.y: Likewise (also rename token names accordingly).
1576 * src/scan-gram.l: Likewise.
1577 * tests/actions.at: Likewise.
1578
1579 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
1580
1581 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
1582 Problem reported by Joel E. Denny.
1583
1584 2006-10-14 Jim Meyering <jim@meyering.net>
1585
1586 (Sync from coreutils.)
1587 Work also when the working directory (with e.g. coreutils sources)
1588 is version controlled with git, rather than CVS.
1589 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
1590 rather than CVS.
1591 In messages and comments, say e.g., "checked-out sources",
1592 rather than "CVS sources".
1593 (version_controlled_file): New function. Work for git as well as
1594 for CVS. Don't use grep's -q option.
1595 (slurp): Call it here, in place of CVS-specific code.
1596
1597 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
1598
1599 Fix testsuite for ./configure --enable-gcc-warnings:
1600 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
1601 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
1602 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
1603 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
1604 * test/regression.at (Diagnostic that expects two alternatives):
1605 Likewise.
1606
1607 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1608
1609 * bootstrap.conf (gnulib_modules): Add config-h.
1610 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
1611 worry about HAVE_CONFIG_H.
1612 * lib/abitset.c: Likewise.
1613 * lib/bitset.c: Likewise.
1614 * lib/bitset_stats.c: Likewise.
1615 * lib/bitsetv-print.c: Likewise.
1616 * lib/bitsetv.c: Likewise.
1617 * lib/ebitset.c: Likewise.
1618 * lib/get-errno.c: Likewise.
1619 * lib/lbitset.c: Likewise.
1620 * lib/subpipe.c: Likewise.
1621 * lib/timevar.c: Likewise.
1622 * lib/vbitset.c: Likewise.
1623 * lib/bitset.c: Include "bitset.h" first, to test interface.
1624 * lib/bitset_stats.c: Include "bitset_stats.h" first.
1625 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
1626 * lib/bitsetv.c: Include "bitsetv.h" first.
1627 * lib/get-errno.c: Include "get-errno.h" first.
1628 * m4/.cvsignore: Add config-h.m4.
1629 * tests/actions.at (Default %printer and %destructor for ...):
1630 Adjust expected line numbers in output to reflect removal of #if
1631 HAVE_CONFIG_H lines.
1632 * tests/glr-regression.at (Missed %merge type warnings when ...):
1633 Likewise.
1634 * tests/regression.at (Braced code in declaration in rules section):
1635 Likewise.
1636 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
1637 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
1638 Include <config.h> unconditionally.
1639
1640 * bootstrap: Sync from coreutils, as follows:
1641
1642 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1643
1644 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
1645 variable was sometimes used without being initialized. This
1646 messed up the installation of the INSTALL file in some cases.
1647
1648 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1649
1650 * bootstrap (usage, main program, symlink_to_gnulib): Add option
1651 --copy. Inspired by a suggestion from Bruno Haible.
1652
1653 2006-10-03 Jim Meyering <jim@meyering.net>
1654
1655 * bootstrap: Undo last change to this file, since now gnulib-tool
1656 sticks with the automake default in generating dependencies.
1657
1658 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1659
1660 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
1661 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
1662
1663 * doc/bison.1: Add copyright notice.
1664
1665 * data/glr.c: Don't include <stdarg.h>; not used.
1666
1667 * NEWS: The -g and --graph options now output graphs in Graphviz
1668 DOT format, not VCG format.
1669 * doc/bison.1: Likewise.
1670 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
1671 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
1672 of this change in
1673 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
1674 * TODO: Remove Graphviz entry.
1675 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
1676 remove vcg.c, vcg.h, vcg_defaults.h.
1677 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
1678 * src/graphviz.c, src/graphviz.h: New files.
1679 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
1680 * src/files.h: Make comment more generic.
1681 * src/main.c (main): Likewise.
1682 * src/print_graph.h: Likewise.
1683 * src/getargs.c (usage): Make usage description more generic.
1684 * src/print_graph.c: Include graphviz.h rather than vcg.h.
1685 (static_graph, fgraph): Remove. All uses changed to pass
1686 arguments instead of sharing a static var.
1687 (print_core, print_actions, print_state, print_graph):
1688 Output graphviz format rather than VCG format.
1689 * tests/.cvsignore: Remove *.vcg; add *.dot.
1690 * tests/output.at: Expect *.dot files, not *.vcg files.
1691
1692 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
1693 accommodates the 2006-10-08 change.
1694
1695 2006-10-11 Bob Rossi <bob@brasko.net>
1696
1697 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
1698 (b4_yyssa, b4_yyerror_range): New macros.
1699 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
1700 (yypvarsinit): Remove init of removed fields.
1701 (yypushparse): Remove use of removed fields; use new macros instead.
1702
1703 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1704
1705 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
1706 in a push parser. Reindent slightly to match yacc.c better.
1707
1708 2006-10-11 Bob Rossi <bob@brasko.net>
1709
1710 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
1711 yymsg_alloc fields.
1712 (yypvarsinit, yypushparse): Remove init of removed fields.
1713 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
1714
1715 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1716
1717 * THANKS: Add Paolo Bonzini and Bob Rossi.
1718
1719 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
1720
1721 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
1722 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
1723 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
1724 b4_define_user_cde and uses): Remove.
1725 (b4_comment, b4_prefix, b4_sync_start): New.
1726 * data/bison.m4: New file, with most of the content removed from c.m4.
1727 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
1728 * src/output.c (output_skeleton): Pass bison.m4.
1729 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
1730 only if specified.
1731
1732 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
1733
1734 Fix test failure reported by Tom Lane in
1735 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
1736 and try to make such failures easier to catch in the future.
1737 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
1738 that's now the caller's responsibility.
1739 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
1740 Set yychar = YYEOF if it's negative.
1741 * tests/actions.at (yylex): Abort if asked to read past EOF.
1742 * tests/conflicts.at (yylex): Likewise.
1743 * tests/cxx-type.at (yylex): Likewise.
1744 * tests/glr-regression.at (yylex): Likewise.
1745 * tests/input.at (yylex): Likewise.
1746 * tests/regression.at (yylex): Likewise.
1747 * tests/torture.at (yylex): Likewise.
1748
1749 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
1750
1751 Fix problems with translating English-language diagnostics.
1752 * bootstrap: Fix bug introduced in recent bootstrap changes, with
1753 respect to bison-runtime pot generation. The YY_ stuff
1754 wasn't being captured.
1755 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
1756 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
1757 * runtime-po/POTFILES.in: Add data/push.c.
1758
1759 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
1760
1761 Merge bootstrap changes from coreutils.
1762
1763 2006-09-28 Jim Meyering <jim@meyering.net>
1764
1765 Automatically generated dependencies are important even
1766 when all of the sources in a directory come from gnulib.
1767 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
1768 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
1769
1770 2006-09-23 Jim Meyering <jim@meyering.net>
1771
1772 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
1773
1774 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1775
1776 * bootstrap: Add support for --force.
1777 (usage): New function. Describe usage less tersely.
1778 (CVS_only_file): New var.
1779
1780 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
1781
1782 * data/push.c (YYPUSH_MORE): Make it an enum instead.
1783 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
1784 Adjust white space and comments to match GNU style better.
1785
1786 2006-09-20 Bob Rossi <bob@brasko.net>
1787
1788 * data/push.c (yyresult_get): Remove function.
1789 (YYPUSH_MORE): Add #define.
1790 (yypushparse): Modify return value.
1791
1792 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1793
1794 * stamp-h.in: Remove; no longer needed.
1795 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
1796 Remove config.h, config.hin, intl (no longer created).
1797 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
1798 stamp-h1.
1799
1800 Sync bootstrap from coreutils, as follows:
1801
1802 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
1803
1804 * bootstrap (symlink_to_gnulib): New function.
1805 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
1806 to copies-of-gnulib.
1807 (cp_mark_as_generated, slurp, gnulib_files):
1808 Avoid making a copy if it's the same as the old version.
1809 (gnulib_files): Add support for this variable (used by Bison).
1810
1811 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1812
1813 * src/getargs.c (usage): Rework to use conventions similar to
1814 coreutils, to make translation a bit easier and the code a bit
1815 smaller. Problem reported by Tim Van Holder.
1816
1817 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
1818
1819 Use some of gnulib's new modules, taken from coreutils.
1820
1821 * bootstrap: Sync from coreutils, except add support for gnulib_files.
1822 * bootstrap.conf: New file.
1823 (gnulib_modules): Add configmake, inttypes, unistd.
1824 (XGETTEXT_OPTIONS): Add complain, complain_at,
1825 fatal, fatal_at, warn, warn_at, unexpected_end.
1826 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
1827 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
1828 (gl_EARLY): Add.
1829 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
1830 (gl_INIT): Add
1831 (GNULIB_AUTOCONF_SNIPPET): Remove.
1832 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
1833 the pickiest.
1834 * lib/.cvsignore: Add inttypes_.h.
1835 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
1836 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
1837 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
1838 no-longer-necessary initializations.
1839 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
1840 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
1841 use the unistd module.
1842 * src/system.h: Likewise.
1843 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
1844 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
1845 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
1846 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
1847 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
1848 * src/system.h: Include inttypes.h unconditionally, now that we
1849 use the inttypes module. Don't bother to include stdint.h, since
1850 inttypes.h now does that for us.
1851 (LOCALEDIR): Remove, now that we use the configmake module.
1852 * src/getargs.c: Include configmake.h.
1853 * src/main.c: Likewise.
1854 * src/output.c: Likewise.
1855 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
1856 not from $abs_top_builddir, since config.h moved.
1857
1858
1859 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
1860 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
1861
1862 * src/parse-gram.y (symbol_declaration): Don't put statements
1863 before declarations; it's not portable to C89.
1864 * src/scan-code.l (handle_action_at): Likewise.
1865
1866 * src/scan-code.l: Always initialize braces_level; the old code
1867 left it uninitialized and therefore had undefined behavior.
1868
1869 Don't attempt to redefine 'assert', since it runs afoul of
1870 systems where standard headers (mistakenly) include <assert.h>.
1871 Instead, define and use our own alternative, called 'aver'.
1872 * src/reader.c: Don't include assert.h, since we no longer
1873 use assert.
1874 * src/scan-code.l: Likewise.
1875 * src/system.h (assert): Remove, replacing with....
1876 (aver): New function, taking a bool arg. All uses changed.
1877 * src/tables.c (pack_vector): Ensure that aver arg is bool,
1878 not merely an integer.
1879
1880 2006-09-15 Bob Rossi <bob@brasko.net>
1881
1882 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
1883 * data/c.m4 (YYPUSH): New.
1884 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
1885 * src/getargs.c (push_parser): New var.
1886 * src/getargs.h (push_parser): New declaration.
1887 * src/output.c (prepare): Add macro insertion of `push_flag'.
1888 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
1889 (prologue_declaration): Parse %push-parser.
1890 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
1891 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
1892 list of removed lines from the traces observed.
1893 (AT_CHECK_CALC_LALR): Added push parser tests.
1894
1895 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
1896
1897 * NEWS: Version 2.3a.
1898 * configure.ac (AC_INIT): Likewise.
1899
1900 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
1901 "#define YYSTYPE int" that caused "make maintainer-check" to fail
1902 due to header ordering dependencies. I don't know why the #define
1903 was there.
1904
1905 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
1906 runtime cost when YYDEBUG is not defined, and so that some tests
1907 that used to fail now work. Problem and initial suggestion by
1908 Paolo Bonzini.
1909 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
1910 * data/glr.cc (b4_parser_class_name):
1911 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
1912 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
1913 (yydebug_) [YYDEBUG]: New member.
1914 (yycdebug_): Now defined only if YYDEBUG.
1915 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
1916 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
1917 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
1918 if YYYDEBUG.
1919 (debug_stream, set_debug_stream, debug_level, set_debug_level):
1920 Define only if YYDEBUG.
1921 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
1922 set_debug_level.
1923 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
1924 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
1925 AT_CHECK_CALC_GLR_CC that are working now.
1926
1927 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
1928
1929 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
1930 We don't need them in glr.cc, and glr.c defines them.
1931 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
1932 assumes that defining it to anything is the same as defining
1933 it to 1. Problem reported by Paolo Bonzini.
1934
1935 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
1936
1937 * data/c.m4 (b4_null, b4_case): Define.
1938 * src/output.c (prepare_symbols): Use b4_null.
1939 (user_actions_output): Use b4_case.
1940
1941 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
1942
1943 * data/glr.c (b4_shared_declarations): Put start-header first,
1944 before any #includes that we generate, so that feature-test
1945 macros work. Problem reported by Michael Deutschmann in
1946 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
1947 * data/lalr1.cc: Likewise.
1948 * doc/bison.texinfo (Prologue): Document that feature-test macros
1949 should be defined before any Bison declarations.
1950 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
1951 that depend on location.hh after, not before, Bison decls, since
1952 we now include location.hh after the first user prologue.
1953
1954 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
1955 Sander Brandenburg in
1956 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
1957 Also, fix minor white space and comment issues.
1958 (Prologue): Mention that it's better to define feature-test macros
1959 before Bison declarations. Problem reported by Michael Deutschmann.
1960
1961 * README-cvs: Fix typo: "&" should be "&&". Problem reported
1962 by Jim Meyering.
1963 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
1964 This adjusts to recent gnulib changes.
1965
1966 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1967
1968 Finish implementation of per-type %destructor/%printer. Discussed
1969 starting at
1970 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
1971 and
1972 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
1973 * NEWS (2.3+): Add a description of this feature to the default
1974 %destructor/%printer description.
1975 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
1976 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1977 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
1978 list node contains a semantic type.
1979 * src/symtab.c, src/symtab.h: Extend with a table that associates
1980 semantic types with their %destructor's and %printer's.
1981 (semantic_type_from_uniqstr, semantic_type_get,
1982 semantic_type_destructor_set, semantic_type_printer_set): New functions
1983 composing the public interface of that table.
1984 (symbol_destructor_get, symbol_destructor_location_get,
1985 symbol_printer_get, symbol_printer_location_get): If there's no
1986 per-symbol %destructor/%printer, look up the per-type before trying
1987 the default.
1988 * tests/actions.at (Per-type %printer and %destructor): New test case.
1989 * tests/input.at (Default %printer and %destructor redeclared):
1990 Extend to check that multiple occurrences of %symbol-default in a
1991 single %destructor/%printer declaration is an error.
1992 (Per-type %printer and %destructor redeclared, Unused values with
1993 per-type %destructor): New test cases.
1994
1995 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1996
1997 Require default %destructor/%printer to be declared using
1998 %symbol-default instead of an empty symbol list, and start working on
1999 new per-type %destructor/%printer. Discussed at
2000 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
2001 * NEWS (2.3+): Add %symbol-default to example.
2002 * bison.texinfo (Freeing Discarded Symbols): Likewise.
2003 (Table of Symbols): Add entry for %symbol-default.
2004 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
2005 (generic_symlist, generic_symlist_item): New nonterminals for creating
2006 a list in which each item is a symbol, semantic type, or
2007 %symbol-default.
2008 (grammar_declaration): Use generic_symlist in %destructor and %printer
2009 declarations instead of symbols.1 or an empty list.
2010 (symbol_declaration, precedence_declaration, symbols.1): Update actions
2011 for changes to symbol_list.
2012 * src/reader.c: Update for changes to symbol_list.
2013 * src/scan-code.l: Likewise.
2014 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
2015 * src/symlist.c, src/symlist.h: Extend such that a list node may
2016 represent a semantic type or a %symbol-default in addition to just an
2017 ordinary symbol. Add switched functions for setting %destructor's and
2018 %printer's.
2019 * tests/actions.at, tests/input.at: Add %symbol-default to all default
2020 %destructor/%printer declarations.
2021
2022 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
2023
2024 Whether the default %destructor/%printer applies to a particular symbol
2025 isn't a question of whether the user *declares* that symbol (in %token,
2026 for example). It's a question of whether the user by any means
2027 *defines* the symbol at all (by simply using a char token, for
2028 example). $end is defined by Bison whereas any other token with token
2029 number 0 is defined by the user. The error token is always defined by
2030 Bison regardless of whether the user declares it with %token, but we
2031 may one day let the user define error as a nonterminal instead.
2032 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
2033 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
2034 the meaning of "user-defined".
2035 * tests/actions.at (Default %printer and %destructor for user-declared
2036 end token): Rename to...
2037 (Default %printer and %destructor for user-defined end token): ...
2038 this.
2039
2040 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
2041 computation of whether to apply the default, don't maintain a list of
2042 every Bison-defined symbol. Instead, just check for a first character
2043 of '$', which a user symbol cannot have, and check for the error token.
2044
2045 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
2046
2047 Don't apply the default %destructor or %printer to the error token,
2048 $undefined, or $accept. This change fits the general rule that the
2049 default %destructor and %printer are only for user-declared symbols,
2050 and it solves several difficulties that are described in the new test
2051 cases listed below.
2052 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
2053 * tests/actions.at (Default %printer and %destructor are not for error
2054 or $undefined, Default %printer and %destructor are not for $accept):
2055 New test cases.
2056
2057 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
2058
2059 Allow %start after the first rule.
2060 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
2061 when parsing the first rule.
2062 (check_and_convert_grammar): Search for it here after all grammar
2063 declarations have been parsed. Skip midrules, which have dummy LHS
2064 nonterminals.
2065 * src/symtab.c (symbol_is_dummy): New function.
2066 * src/symtab.h (symbol_is_dummy): Declare it.
2067 * tests/input.at (%start after first rule): New test.
2068
2069 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2070
2071 Redo some of the previous commit: add back the ability to use
2072 non-aliased/undeclared string literals since it might be useful to
2073 those declaring %token-table.
2074 * src/reader.c (check_and_convert_grammar): Undo changes in previous
2075 commit: don't worry about complaints from symbols_pack.
2076 * src/symtab.c (symbol_new, symbol_class_set,
2077 symbol_check_alias_consistency): Undo changes in previous commit: count
2078 each string literal as a new symbol and token, assign it a symbol
2079 number, and don't complain about non-aliased string literals.
2080 (symbols_pack): Since symbol_make_alias still does not decrement symbol
2081 and token counts but does still set aliased tokens to the same number,
2082 symbol_pack_processor now leaves empty slots in the symbols array.
2083 Remove those slots.
2084 * tests/regression.at (Undeclared string literal): Remove test case
2085 added in previous commit since non-aliased string literals are allowed
2086 again.
2087 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
2088 remove unnecessary string literal declarations.
2089 * tests/sets.at (Firsts): Likewise.
2090
2091 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2092
2093 Don't allow an undeclared string literal, but allow a string literal to
2094 be used before its declaration.
2095 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
2096 symbols_pack complained.
2097 * src/symtab.c (symbol_new): Don't count a string literal as a new
2098 symbol.
2099 (symbol_class_set): Don't count a string literal as a new token, and
2100 don't assign it a symbol number since symbol_make_alias does that.
2101 (symbol_make_alias): It's not necessary to decrement the symbol and
2102 token counts anymore. Don't assume that an alias declaration occurs
2103 before any uses of the identifier or string, and thus don't assert that
2104 one of them has the highest symbol number so far.
2105 (symbol_check_alias_consistency): Complain if there's a string literal
2106 that wasn't declared as an alias.
2107 (symbols_pack): Bail if symbol_check_alias_consistency failed since
2108 symbol_pack asserts that every token has been assigned a symbol number
2109 although undeclared string literals have not.
2110 * tests/regression.at (String alias declared after use, Undeclared
2111 string literal): New test cases.
2112 (Characters Escapes, Web2c Actions): Declare string literals as
2113 aliases.
2114 * tests/sets.at (Firsts): Likewise.
2115
2116 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
2117
2118 In the grammar scanner, STRING_FINISH unclosed constructs and return
2119 them to the parser in order to improve error messages.
2120 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
2121 SC_BRACED_CODE, SC_PROLOGUE): Implement.
2122 * tests/input.at (Unclosed constructs): New test case.
2123 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
2124 seen.
2125
2126 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
2127 unused global.
2128
2129 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
2130
2131 Handle string aliases for character tokens correctly.
2132 * src/symtab.c (symbol_user_token_number_set): If the token has an
2133 alias, check and set its alias's user token number instead of its own,
2134 which is set to indicate the alias. Previously, every occurrence of
2135 the character token in the grammar overwrote that alias indicator with
2136 the character code.
2137 * tests/input.at (String aliases for character tokens): New test.
2138
2139 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
2140
2141 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
2142
2143 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
2144
2145 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
2146 to prevent failures when building on older platforms.
2147 Check for autopoint failure.
2148 Set XGETTEXT_OPTIONS to values that check for C format strings,
2149 so that translators are warned about them (this also helps
2150 prevent core dumps).
2151
2152 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
2153 function, since it simplifies our code a bit.
2154
2155 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
2156 rather than -W, so we don't get bogus warnings about sign comparisons.
2157 Add -Wpointer-arith, since that warning is useful (it reports code
2158 that does not conform to C89 and that some compilers reject).
2159 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
2160 since it's no longer needed.
2161
2162 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
2163
2164 Clean up scanners a bit.
2165 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
2166 definitions so gcc won't warn when obstack_for_string is unused.
2167 * src/scan-code.l: config.h and system.h are already #include'd by
2168 scan-code-c.c, so get rid of them here.
2169 * src/scan-gram.l: Likewise.
2170 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
2171 definitions rather than duplicating the rest of it.
2172 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
2173
2174 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
2175
2176 Suppress signed/unsigned comparison warnings for yycheck.
2177 * data/c.m4 (b4_safest_int_type): New macro.
2178 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
2179 a signed int type, cast it to b4_safest_int_type first.
2180 * data/yacc.c: Likewise.
2181 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
2182 also overwritten.
2183
2184 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2185
2186 * doc/bison.texinfo: Fix some typos.
2187
2188 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
2189
2190 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
2191 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
2192
2193 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
2194 the latest gnulib does this a different way.
2195 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
2196 translation was patched, so stop omitting it.
2197
2198 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2199
2200 Enable declaration of default %printer/%destructor. Make the parser
2201 use these for all user-declared grammar symbols for which the user does
2202 not declare a specific %printer/%destructor. Thus, the parser uses it
2203 for token 0 if the user declares it but not if Bison generates it as
2204 $end. Discussed starting at
2205 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
2206 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
2207 and
2208 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
2209 * NEWS (2.3+): Mention.
2210 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
2211 declare a %destructor for a mid-rule's semantic value. It's just
2212 impossible to declare one specific to it.
2213 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
2214 code. Describe default %destructor form.
2215 * src/parse-gram.y (grammar_declaration): Parse default
2216 %printer/%destructor declarations.
2217 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
2218 and symbol_destructor_location_get rather than accessing the destructor
2219 and destructor_location members of struct symbol.
2220 (symbol_printers_output): Likewise but for %printer's.
2221 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
2222 again.
2223 * src/symtab.c (default_destructor, default_destructor_location,
2224 default_printer, default_printer_location): New static global
2225 variables to record the default %destructor and %printer.
2226 (symbol_destructor_get, symbol_destructor_location_get,
2227 symbol_printer_get, symbol_printer_location_get): New functions to
2228 compute the appropriate %destructor and %printer for a symbol.
2229 (default_destructor_set, default_printer_set): New functions to set the
2230 default %destructor and %printer.
2231 * src/symtab.h: Prototype all those new functions.
2232 * tests/actions.at (Default %printer and %destructor): New test to
2233 check that the right %printer and %destructor are called, that they're
2234 not called for $end, and that $$ and @$ work correctly.
2235 (Default %printer and %destructor for user-declared end token): New
2236 test to check that the default %printer and %destructor are called for
2237 a user-declared end token.
2238 * tests/input.at (Default %printer and %destructor redeclared, Unused
2239 values with default %destructor): New tests to check related grammar
2240 warnings and errors.
2241
2242 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2243
2244 Clean up handling of %destructor for the end token (token 0).
2245 Discussed starting at
2246 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
2247 and
2248 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
2249
2250 Make the skeletons consistent in how they pop the end token and invoke
2251 its %destructor.
2252 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
2253 state, which has token number 0, since this would invoke the
2254 %destructor for the end token.
2255 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
2256 until after shifting the end token, or else it won't be popped.
2257 * data/yacc.c (yyparse): Likewise.
2258
2259 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
2260 it's the end token. Upon termination, destroy an unshifted lookahead
2261 even when it's the end token.
2262 * data/lalr1.cc (yy::parser::parse): Likewise.
2263 * data/yacc.c (yyparse): Likewise.
2264
2265 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
2266 value warnings for the end token when the user gives the end token a
2267 %destructor.
2268
2269 * tests/actions.at (Printers and Destructors): Test all the above.
2270
2271 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
2272
2273 Update to latest gnulib and gettext versions.
2274 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
2275 Add fopen-safer.
2276 (gnulib_files): Add m4/warning.m4. Don't worry about files
2277 overwritten by autopoint.
2278 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
2279 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
2280 rejects them.
2281 Don't use autoreconf; instead, invoke autopoint etc. by hand,
2282 so that we can remove the intl files at a better time.
2283 (intl_files_to_remove): Remove aclocal.m4, since it gets
2284 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
2285 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
2286 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
2287 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
2288 Remove datarootdir hack; no longer needed.
2289 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
2290 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
2291 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
2292 strdup.h.
2293 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
2294 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
2295
2296 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
2297
2298 * bootstrap: Adjust to today's change to gnulib-tool by invoking
2299 it with --assume-autoconf='latest-stable'.
2300
2301 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
2302
2303 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
2304 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
2305 YYSTYPE' and `{'.
2306 * src/muscle_tab.h (muscle_grow): Replace the header comments with
2307 those from muscle_tab.c since the old ones are misleading.
2308
2309 2006-07-13 Akim Demaille <akim@epita.fr>
2310
2311 Support %define "KEY" {VALUE}.
2312 * src/scan-code.h, src/scan-code.l (translate_action)
2313 (translate_rule_action, translate_symbol_action, translate_code):
2314 Return char *, not const char *.
2315 * src/parse-gram.y (declaration): Rename as...
2316 (prologue_declaration): this.
2317 (string_content): Remove this nonterminal, use STRING.
2318 (braceless, content, content.opt): New nonterminal.
2319 Use them.
2320 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
2321 as value.
2322 * src/scan-gram.l (getargs.h): Don't include it.
2323
2324 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
2325
2326 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
2327 rather than a for-loop that declares a local bool variable. This
2328 should work around a compatibility problem with a Cray x1e C++
2329 compiler reported by Hung Nguyen in
2330 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
2331 The for-loop was introduced in the 2004-11-17 change but I don't
2332 know why it was needed.
2333
2334 2006-07-12 Akim Demaille <akim@epita.fr>
2335
2336 * data/c.m4: Comment changes.
2337
2338 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
2339
2340 * src/complain.c (error_message, ERROR_MESSAGE): New.
2341 To factor...
2342 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
2343 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
2344
2345 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2346
2347 * NEWS: Instead of %union, you can define and use your own union type
2348 YYSTYPE if your grammar contains at least one <type> tag.
2349 Your YYSTYPE need not be a macro; it can be a typedef.
2350 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
2351 (Union Decl, Decl Summary): Document this.
2352 * data/glr.c (YYSTYPE): Implement this.
2353 * data/glr.cc (YYSTYPE): Likewise.
2354 * data/lalr1.cc (YYSTYPE): Likewise.
2355 * data/yacc.c (YYSTYPE): Likewise.
2356 * src/output.c (prepare): Output tag_seen_flag.
2357 * src/parse-gram.y (declaration, grammar_declaration):
2358 Use 'union_seen' rather than 'typed' to determine whether
2359 %union has been seen, since grammars can now be typed without
2360 %union.
2361 (symbol_declaration, type.opt, symbol_def):
2362 Keep track of whether a tag has been seen.
2363 * src/reader.c (union_seen, tag_seen): New vars.
2364 (typed): remove.
2365 * src/reader.h (union_seen, tag_seen, typed): Likewise.
2366 * src/scan-code.l (untyped_var_seen): New variable.
2367 (handle_action_dollar): Adjust to above changes.
2368 (handle_action_dollar, handle_action_at):
2369 Improve overflow checking for outlandish numbers.
2370 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
2371 avoid new diagnostics generated by above changes.
2372 * tests/regression.at (YYSTYPE typedef): Add test to check
2373 for type tags without %union.
2374
2375 * src/symlist.c (symbol_list_length): Return int, not unsigned
2376 int, since callers expect int. This may need to get revisited
2377 once we have proper integer overflow checking.
2378
2379 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
2380 object is now static.
2381
2382 * src/getargs.c (flags_argmatch): Return void, not int,
2383 to pacify ./configure --enable-gcc-warnings.
2384
2385 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
2386 since last_string is already defined to FLEX_PREFIX (last_string).
2387
2388 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
2389
2390 Implement --warnings/-W.
2391 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
2392 replaced by...
2393 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
2394 Adjust callers.
2395 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
2396 (warnings_args, warnings_types): New.
2397 (getargs, short_options, long_options): Accept -W/--warnings.
2398 Sort the options by alphabetical order, upper case letter right
2399 before its lower case.
2400
2401 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2402
2403 Change %merge result type clash warnings to errors. Discussed at
2404 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
2405 * src/reader.c (record_merge_function_type): Use complain_at.
2406 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2407 declared later): Update test case results.
2408
2409 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
2410
2411 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
2412 to be in alphabetical order.
2413 (trace_args): Spelling fixes.
2414
2415 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2416
2417 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
2418 so they don't collide with user-defined macros.
2419 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
2420 this was never guaranteed, and now that we're using gnulib stdint,
2421 which defines int_fast16_t to long int, the problem is exposed.
2422
2423 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
2424
2425 * data/c.m4 (b4_basename): Simplify a bit, since we don't
2426 need the full POSIX semantics (and weren't implementing them
2427 anyway).
2428
2429 Adjust to Autoconf 2.60 and today's gnulib.
2430 * bootstrap (gnulib_modules): Add stdint.
2431 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
2432 no longer copies it.
2433 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
2434 since stdint needs the former and wcwidth (which is now required
2435 by mbswidth) needs the latter.
2436 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
2437 work around a compatibility glitch between gettext 0.14.6 and
2438 Autoconf 2.60.
2439 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
2440 Do not check for uintptr_t, since new stdint module does the right
2441 thing.
2442 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
2443 Add stdint.h, stdint_.h, wcwidth.h.
2444 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
2445 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
2446 stdint.m4, wchar_t.m4, wcwidth.m4.
2447 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
2448 usual order for ../lib/*.h files.
2449 (file_name_split): Use last_component, not base_name, to adjust
2450 to gnulib changes.
2451 * src/parse-gram.h: Include <strverscmp.h> in the usual order
2452 for ../lib/*.h files.
2453 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
2454 Define unconditionally, since we now assume the stdint module.
2455 * src/scan-skel.l: Include <dirname.h>.
2456 (BASE_QPUTS): Use last_component, not base_name.
2457 * src/system.h: Include <unlocked-io.h> in the usual order
2458 for ../lib/*.h files. Include <stdint.h> unconditionally,
2459 since we now use the stdint module.
2460 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
2461 HAVE_UINTPTR_T, since we now use the stdint module.
2462 (base_name): Remove decl, since files now include <dirname.h>
2463 to get the decl.
2464
2465 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
2466
2467 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
2468 New, default to 1.
2469 * data/yacc.c, data/glr.c, data/location.cc: Use them.
2470 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
2471 default.
2472 * tests/calc.at: Adjust.
2473
2474 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
2475
2476 * data/c.m4 (b4_basename): New.
2477 (b4_syncline): Also output the location of its invocation (from
2478 the skeleton).
2479 (b4_user_action, b4_define_user_action, b4_user_actions)
2480 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
2481 (b4_user_stype): New.
2482 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
2483
2484 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2485
2486 In the grammar file, the first column is 1 not 0 on the first line as
2487 on every other line.
2488 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
2489 * tests/input.at (Torturing the Scanner): Update output.
2490
2491 * src/scan-gram.l (scanner_cursor): Declare it static.
2492
2493 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2494
2495 In warnings, say "previous declaration" rather than "first
2496 declaration".
2497 * src/symtab.c (redeclaration): Do that here.
2498 * src/reader.c (record_merge_function_type): In the case of a result
2499 type clash, report the previous declaration rather than the very first
2500 one in the grammar file.
2501 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2502 declared later): Add a third declaration to check this behavior.
2503 * tests/input.at (Incompatible Aliases): Update output.
2504
2505 2006-06-27 Akim Demaille <akim@epita.fr>
2506
2507 * doc/Doxyfile.in: New.
2508 * doc/Makefile.am: Use it.
2509 * src/lalr.h, src/symtab.h: Initial doxygenation.
2510
2511 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2512
2513 Don't miss %merge result type warnings just because the LHS types are
2514 declared after the %merge. This continues the effort of the previous
2515 patch.
2516 * src/reader.c (get_merge_function): Don't set the merger type yet.
2517 (record_merge_function_type): New function for setting the merger type
2518 and checking for clashes.
2519 (grammar_current_rule_merge_set): Set the location of the %merge for
2520 the current rule.
2521 (packgram): Invoke record_merge_function_type for each rule now that
2522 all symbol type declarations have been parsed.
2523 * src/reader.h (merger_list.type_declaration_location): New member
2524 storing the location of the first %merge from which the type for this
2525 merging function was derived.
2526 * src/symlist.h (symbol_list.merger_declaration_location): New member
2527 storing the location of a rule's %merge, if any.
2528 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2529 declared later): New test to catch the error fixed by the above patch.
2530
2531 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2532
2533 Get action warnings (grammar_rule_check) right even when symbol
2534 declarations appear after the rules. Discussed at
2535 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
2536 and
2537 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
2538 Don't mistake the type of $$ in a midrule to be that of its parent
2539 rule's $$.
2540 * src/reader.c (grammar_current_rule_end): Don't invoke
2541 grammar_rule_check yet since not all symbol declarations may have been
2542 parsed yet.
2543 (grammar_midrule_action): Likewise.
2544 Don't record whether the midrule's $$ has been used yet since actions
2545 haven't been translated yet.
2546 Record the midrule's parent rule and its RHS index within the parent
2547 rule.
2548 (grammar_current_rule_action_append): Don't translate the action yet
2549 since not all symbol declarations may have been parsed yet and, thus,
2550 warnings about types for $$, $n, @$, and @n can't be reported yet.
2551 (packgram): Translate the action and invoke grammar_rule_check now that
2552 all symbol declarations have been parsed.
2553 * src/scan-code.l (handle_action_dollar): Now that this is invoked
2554 after parsing the entire grammar file, the symbol list here in the case
2555 of a midrule is actually the midrule's empty RHS, so reference its
2556 parent rule's RHS where necessary.
2557 On the other hand, now that you can already know it's a midrule, you
2558 aren't forced to think $$ has the same type as its parent rule's $$.
2559 (handle_action_at): In the case of a midrule, reference the parent rule
2560 where necessary.
2561 * src/symlist.c (symbol_list_new): Initialize new midrule-related
2562 members.
2563 (symbol_list_length): Now that this is invoked after all rules have
2564 been parsed, a NULL symbol (rather than a NULL symbol list node)
2565 terminates a rule. symbol_list_print already does this correctly.
2566 * src/symlist.h (symbol_list.midrule_parent_rule,
2567 symbol_list.midrule_parent_rhs_index): New members so that midrules can
2568 remember their relationships with their parents.
2569 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
2570 fixed by the above patch.
2571 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
2572 implementing...
2573 (Unused values): ... this old test case and...
2574 (Unused values before symbol declarations): ... this new test case.
2575 This one is the same as `Unused values' except that all symbol
2576 declarations appear after the rules in order to catch the rest of the
2577 errors fixed by the above patch.
2578
2579 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2580
2581 More cleanup.
2582 * src/reader.c (current_rule): Declare it static since it's no longer
2583 used outside this file.
2584 (grammar_current_rule_action_append): Remove redundant arguments from
2585 translate_rule_action invocation.
2586 * src/reader.h (current_rule): Remove this unused extern.
2587 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
2588 * src/scan-code.l (translate_rule_action): Likewise.
2589
2590 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
2591
2592 Clean up yesterday's patch.
2593 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
2594 to...
2595 * src/reader.c (grammar_current_rule_action_append): ... here for
2596 consistency with grammar_current_rule_symbol_append.
2597 * tests/regression.at (Braced code in declaration in rules section):
2598 Make yyerror and yylex static as usual.
2599
2600 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
2601
2602 Fix bug that mistakes braced code in a declaration in the rules section
2603 to be a rule action. Mentioned at
2604 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
2605 * src/scan-gram.l: Move midrule action detection from the start of the
2606 scanning of any braced code to...
2607 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
2608 action. For readability, use $2 and @2 rather than the equivalent
2609 global variables.
2610 * tests/regression.at (Braced code in declaration in rules section):
2611 New test to catch the error fixed by the above patch.
2612
2613 Work on code readability some.
2614 * src/scan-code.l (current_rule): Get rid of this misleading and
2615 redundant declaration: it's actually extern'ed in reader.h.
2616 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
2617 translate_action): Add a rule argument and use it instead of the global
2618 current_rule.
2619 (translate_rule_action): This already receives current_rule through an
2620 argument, so pass it on to translate_action instead of assigning
2621 current_rule to current_rule.
2622 (translate_symbol_action, translate_code): Pass rule = NULL to
2623 translate_action.
2624
2625 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
2626
2627 Rename %before-definitions to %start-header and %after-definitions to
2628 %end-header. Don't use these declarations to separate pre-prologue
2629 blocks from post-prologue blocks. Add new order-independent
2630 declarations %before-header and %after-header as alternatives to the
2631 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
2632 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
2633 * NEWS (2.3+): Update for these changes.
2634 * data/glr.c (b4_before_definitions): Update to...
2635 (b4_start_header): ... this.
2636 (b4_after_definitions): Update to...
2637 (b4_end_header): ... this.
2638 * data/glr.cc: Likewise.
2639 * data/lalr1.cc: Likewise.
2640 * data/yacc.c: Likewise.
2641 * doc/bison.texinfo (The prologue): Update names, and replace remaining
2642 prologue blocks with %*-header declarations.
2643 (Calc++ Parser): Likewise.
2644 (Bison Declaration Summary): Update names.
2645 (Table of Symbols): Update description.
2646 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
2647 (PERCENT_END_HEADER): ... this.
2648 (PERCENT_BEFORE_DEFINITIONS): Update to...
2649 (PERCENT_START_HEADER): ... this.
2650 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2651 (declaration): Update token names and m4 macro names.
2652 When parsing %end-header and %start-header, invoke translate_code
2653 before muscle_code_grow, and no longer set global booleans to remember
2654 whether these declarations have been seen.
2655 Parse new %after-header and %before-header.
2656 * src/reader.c (before_definitions, after_definitions): Remove.
2657 (prologue_augment): Accept a new bool argument to specify whether to
2658 augment the pre-prologue or post-prologue.
2659 * src/reader.h (before_definitions, after_definitions): Remove these
2660 extern's.
2661 (prologue_augment): Add new bool argument.
2662 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
2663 (PERCENT_END_HEADER): ... this.
2664 (PERCENT_BEFORE_DEFINITIONS): Update to...
2665 (PERCENT_START_HEADER): ... this.
2666 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2667 * tests/actions.at (Printers and Destructors): Update names.
2668
2669 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
2670
2671 Add comparison operators for C++ location classes. Discussed at
2672 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
2673 * data/c++.m4 (b4_define_location_comparison): New boolean %define
2674 declaration indicating whether filename_type has an operator==. If
2675 filename_type is `std::string', it defaults to `1', `0' otherwise.
2676 * data/location.cc: Iff b4_define_location_comparison is `1', add
2677 operator== and operator!= for class position and for class location.
2678
2679 Some minor fixes.
2680 * src/scan-action.l: Remove unused file.
2681 * src/symtab.c (symbol_printer_set): Use printer_location not
2682 destructor_location.
2683 * src/symtab.h (struct symbol): Replace incorrect source comment for
2684 printer members.
2685 * tests/input.at (Incompatible Aliases): Update output with correct
2686 printer location.
2687
2688 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
2689
2690 Don't put the pre-prologue in the header file. For the yacc.c code
2691 file and the glr.c header and code files, move the pre-prologue before
2692 the token definitions. Add new %before-definitions and
2693 %after-definitions to declare code that will go in both the header file
2694 and code file. Discussed at
2695 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
2696 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
2697 and
2698 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
2699 * NEWS (2.3+): Describe these changes.
2700 * data/glr.c (b4_pre_prologue): Move from within to before...
2701 (b4_shared_declarations): ... this.
2702 Add new b4_before_definitions before b4_token_enums.
2703 Add new b4_after_definitions at the end.
2704 * data/glr.cc (b4_pre_prologue): Replace with...
2705 (b4_before_definitions): ... this in the header file.
2706 (b4_after_definitions): New near the end of the header file.
2707 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
2708 code file right before including the header file.
2709 (b4_before_definitions): New in the previous position of
2710 b4_pre_prologue in the header file.
2711 (b4_after_definitions): New near the end of the header file.
2712 * data/yacc.c: Clean up some m4 quoting especially in the header file.
2713 (b4_token_enums_defines): In the code file, move to right before
2714 YYSTYPE for consistency with the header file.
2715 (b4_before_definitions): New right before b4_token_enums_defines in
2716 both the header and code file.
2717 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
2718 header and code file.
2719 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
2720 of prologues for %union dependencies.
2721 (Bison Declaration Summary): In %defines description, mention the
2722 effect of %before-definitions and %after-definitions on the header
2723 file.
2724 (Calc++ Parser): Forward declare driver in a %before-definitions rather
2725 than in the pre-prologue so that make check succeeds.
2726 (Table of Symbols): Add entries for %before-definitions and
2727 %after-definitions.
2728 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
2729 %before-definitions.
2730 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
2731 (declaration): Parse those declarations and append to
2732 b4_before_definitions and b4_after_definitions, respectively.
2733 * src/reader.c (before_definitions, after_definitions): New bools to
2734 track whether those declarations have been seen.
2735 (prologue_augment): Add to the post-prologue if %union,
2736 %before-definitions, or %after-definitions has been seen.
2737 * src/reader.h (before_definitions, after_definitions): New extern's.
2738 * src/scan-gram.l: Scan the new declarations.
2739 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
2740 prologue block in a %before-definitions or a %after-definitions based
2741 on whether the %union is declared.
2742 * tests/regression.at (Early token definitions with --yacc, Early token
2743 definitions without --yacc): Move tests for token definitions into the
2744 post-prologue since token names are no longer defined in the
2745 pre-prologue.
2746
2747 2006-06-20 Akim Demaille <akim@epita.fr>
2748
2749 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
2750 (symbol_get): Use it.
2751 * src/parse-gram.y: Use it.
2752
2753 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
2754
2755 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
2756 build succeeds when configured with --enable-gcc-warnings.
2757
2758 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
2759
2760 * src/parse-gram.y (char_name): New function.
2761 (CHAR, STRING, string_content): For %printer, properly escape.
2762 (ID): Prefer fputs to fprintf.
2763 (id): Reindent to be consistent with other rules.
2764 Properly quote char.
2765
2766 The Translation Project changed its way of publishing translations
2767 to maintainers. I haven't received any responses to my request
2768 for supporting the old way, or for documenting the new way. I
2769 have modified 'bootstrap' to use screen scraping
2770 (in this case, HTML scraping). This is unreliable and inelegant,
2771 but I don't see any better way. Yuck.
2772 * bootstrap (TP_URL, WGET_COMMAND): New vars.
2773 (get_translations): New function, which uses HTML scraping to
2774 deduce locations of latest translations.
2775 Use this function to grab both bison and bison-runtime .po files.
2776 Don't bother priming the pump for the runtime-po domain any more,
2777 as it's now translated better than bison is.
2778
2779 2006-06-19 Akim Demaille <akim@epita.fr>
2780
2781 * src/scan-gram.l: No longer "parse" things after `%union' until
2782 `{'. Rather, return a single "%union" token.
2783 No longer make symbols: return strings, and leave the conversion
2784 to symbols to the parser.
2785 (SC_PRE_CODE, token_type): Remove.
2786 * src/parse-gram.y (%union): New field `character'.
2787 Sort tokens.
2788 (CHAR): New token.
2789 (ID, ID_COLON): Now that the scanner no longer makes them
2790 identifiers, adjust all uses to invoke symbol_get.
2791 (id_colon): New, wraps the conversion from string to symbol.
2792 (%union): Accept a possible union_name.
2793 (symbol): Now can be a char.
2794 * data/c.m4 (b4_union_name): Leave a default value.
2795 * data/glr.c, data/yacc.c: Use it.
2796
2797 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
2798
2799 For associating token numbers with token names for "yacc.c", don't use
2800 #define statements unless `--yacc' is specified; always use enum
2801 yytokentype. Most important discussions start at:
2802 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
2803 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
2804 and
2805 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
2806 * NEWS (2.3+): Mention.
2807 * data/c.m4 (b4_yacc_if): New.
2808 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
2809 token #define's.
2810 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
2811 on token name definitions.
2812 * src/getargs.c (usage): Capitalize `Yacc' in English.
2813 * src/output.c (prepare): Define b4_yacc_flag.
2814 * tests/regression.at (Early token definitions): Test that tokens names
2815 are defined before the pre-prologue not just before the post-prologue.
2816 Remove this test case and copy to...
2817 (Early token definitions with --yacc): ... this to test #define's.
2818 (Early token definitions without --yacc): ... and this to test enums.
2819
2820 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
2821
2822 * NEWS: Reword the post-2.3 change to not be so optimistic about
2823 removing the old "look-ahead" spelling.
2824 Update previous look-ahead/lookahead change reports.
2825 * REFERENCES: look-ahead -> lookahead (since that's
2826 what he actually wrote).
2827 * doc/refcard.tex: look ahead -> lookahead,
2828 look-ahead -> lookahead
2829
2830 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
2831
2832 For consistency, use `lookahead' instead of `look-ahead' or
2833 `look_ahead'. Discussed starting at
2834 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
2835 and then at
2836 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
2837 * NEWS: For the next release, note the change to `--report'.
2838 * TODO, doc/bison.1: Update English.
2839 * doc/bison.texinfo: Update English.
2840 (Understanding Your Parser, Bison Options): Document as
2841 `--report=lookahead' rather than `--report=look-ahead'.
2842 * src/conflicts.c: Update English in comments.
2843 (lookahead_set): Rename from look_ahead_set.
2844 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
2845 (resolve_sr_conflict): Rename local look_ahead_tokens to
2846 lookahead_tokens, and update other uses.
2847 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
2848 count_rr_conflicts, conflicts_free): Update uses.
2849 * src/getargs.c (report_args): Move "lookahead" before alternate
2850 spellings.
2851 (report_types): Update uses.
2852 (usage): For `--report' usage description, state `lookahead' spelling
2853 rather than `look-ahead'.
2854 * src/getargs.h (report.report_lookahead_tokens): Rename from
2855 report_look_ahead_tokens.
2856 * src/lalr.c: Update English in comments.
2857 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
2858 (state_lookahead_tokens_count): Rename from
2859 state_look_ahead_tokens_count.
2860 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2861 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
2862 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2863 Update other uses.
2864 Update English in output.
2865 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
2866 * src/print.c: Update English in comments.
2867 (lookahead_set): Rename from look_ahead_set.
2868 (print_reduction): Rename argument lookahead_token from
2869 look_ahead_token.
2870 (print_core, state_default_rule, print_reductions, print_results):
2871 Update uses.
2872 * src/print_graph.c: Update English in comments.
2873 (print_core): Update uses.
2874 * src/state.c: Update English in comments.
2875 (reductions_new): Update uses.
2876 (state_rule_lookahead_tokens_print): Rename from
2877 state_rule_look_ahead_tokens_print, and update other uses.
2878 * src/state.h: Update English in comments.
2879 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
2880 (state_rule_lookahead_tokens_print): Rename from
2881 state_rule_look_ahead_tokens_print.
2882 * src/tables.c: Update English in comments.
2883 (conflict_row, action_row): Update uses.
2884 * tests/glr-regression.at
2885 (Incorrect lookahead during deterministic GLR,
2886 Incorrect lookahead during nondeterministic GLR): Rename
2887 print_look_ahead to print_lookahead.
2888 * tests/torture.at: Update English in comments.
2889 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
2890 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
2891 (Many lookahead tokens): Update uses.
2892 * data/glr.c: Update English in comments.
2893 * lalr1.cc: Likewise.
2894 * yacc.c: Likewise.
2895 * src/conflicts.h: Likewise.
2896 * src/lalr.h: Likewise.
2897 * src/main.c: Likewise.
2898 * src/output.c: Likewise.
2899 * src/parse-gram.c: Likewise.
2900 * src/tables.h: Likewise.
2901 * tests/calc.at: Likewise.
2902
2903 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
2904
2905 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
2906
2907 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
2908
2909 * TODO: Add request from Nelson H. F. Beebe to be able to install
2910 Bison without installing the yacc script.
2911
2912 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2913
2914 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
2915 and yytext if they're already #define'd.
2916 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
2917 * src/scan-code-c.c: ... here.
2918 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
2919 <config.h>.
2920
2921 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2922
2923 Get Bison to build again when configured with --enable-gcc-warnings.
2924 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
2925 missing #include's.
2926 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
2927 loc argument as it shadows a global.
2928 * src/scan-gram.l: Remove stray comma that prevents boundary_set
2929 invocation.
2930
2931 * src/.cvsignore: Add scan-code.c.
2932
2933 2006-06-07 Akim Demaille <akim@epita.fr>
2934
2935 * src/scan-gram.l: Move the "add a trailing ; to actions" code
2936 to...
2937 * src/scan-code.l: here.
2938 * tests/input.at (Torturing the Scanner): Fix another location
2939 error.
2940
2941 2006-06-07 Akim Demaille <akim@epita.fr>
2942
2943 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
2944
2945 2006-06-06 Akim Demaille <akim@epita.fr>
2946
2947 Extract the parsing of user actions from the grammar scanner.
2948 As a consequence, the relation between the grammar scanner and
2949 parser is much simpler. We can also split "composite tokens" back
2950 into simple tokens.
2951 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
2952 * src/scan-gram.l (add_column_width, adjust_location): Move to and
2953 rename as...
2954 * src/location.h, src/location.c (add_column_width)
2955 (location_compute): these.
2956 Fix the column count: the initial column is 0.
2957 (location_print): Be robust to ending column being 0.
2958 * src/location.h (boundary_set): New.
2959 * src/main.c: Adjust to scanner_free being renamed as
2960 gram_scanner_free.
2961 * src/output.c: Include scan-code.h.
2962 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
2963 Use boundary_set.
2964 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
2965 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
2966 which is now, again, a separate token.
2967 Adjust all dependencies.
2968 Whereever actions with $ and @ are used, use translate_code.
2969 (action): Remove this nonterminal which is now useless.
2970 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
2971 (grammar_current_rule_action_append): Use translate_code.
2972 (packgram): Bound check ruleno, itemno, and rule_length.
2973 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
2974 (last_string, last_braced_code_loc, max_left_semantic_context)
2975 (scanner_initialize, scanner_free, scanner_last_string_free)
2976 (gram_out, gram_lineno, YY_DECL_): Move to...
2977 * src/scan-gram.h: this new file.
2978 (YY_DECL): Rename as...
2979 (GRAM_DECL): this.
2980 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
2981 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
2982 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
2983 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
2984 Move these declarations, and...
2985 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
2986 these to...
2987 * src/flex-scanner.h: this new file.
2988 * src/scan-gram.l (rule_length, rule_length_overflow)
2989 (increment_rule_length): Remove.
2990 (last_braced_code_loc): Rename as...
2991 (gram_last_braced_code_loc): this.
2992 Adjust to the changes of the parser.
2993 Move all the handling of $ and @ into...
2994 * src/scan-code.l: here.
2995 * src/scan-gram.l (handle_dollar, handle_at): Remove.
2996 (handle_action_dollar, handle_action_at): Move to...
2997 * src/scan-code.l: here.
2998 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
2999 scan-code.h, scan-code-c.c, scan-gram.h.
3000 (EXTRA_bison_SOURCES): Add scan-code.l.
3001 (BUILT_SOURCES): Add scan-code.c.
3002 (yacc): Be robust to white spaces.
3003
3004 * tests/conflicts.at, tests/input.at, tests/reduce.at,
3005 * tests/regression.at: Adjust the column numbers.
3006 * tests/regression.at: Adjust the error message.
3007
3008 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3009
3010 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3011 Use Akim's wording from
3012 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
3013
3014 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3015
3016 Between Bison releases, manually append `+' to the previous Bison
3017 release number, and use that as a signal to automatically print the
3018 ChangeLog's CVS Id keyword from --version. Discussed starting at
3019 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
3020 * ChangeLog: Add Id header.
3021 * configure.ac (AC_INIT): Append `+' to `2.3'.
3022 * src/.cvsignore: Add revision.c.
3023 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
3024 (BUILT_SOURCES): Add revision.c.
3025 (revision.c): New target rule. This file defines a new global variable
3026 named revision. It initializes it with either the Id from ChangeLog
3027 or, if VERSION doesn't contain `+', with the empty string.
3028 * src/getargs.c (version): Print the value of revision.
3029 * src/revision.h: Extern revision.
3030
3031 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
3032
3033 * NEWS: Version 2.3.
3034 * configure.ac (AC_INIT): Likewise.
3035
3036 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
3037
3038 * data/glr.c (YYRECOVERING): Define to be a function-like macro
3039 with no arguments, not as an object-like macro. This is for
3040 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
3041 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
3042 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
3043 Document this.
3044
3045 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
3046
3047 * src/getargs.c (usage): Back out yesterday's modification of the
3048 --help output so that we don't have to wait for translation before
3049 releasing 2.3.
3050
3051 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
3052
3053 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
3054 Problem reported by Akim Demaille.
3055
3056 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3057
3058 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3059
3060 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
3061
3062 * data/yacc.c (yy_reduce_print): Omit trailing white space in
3063 generated source code. Problem reported by Frans Englich in
3064 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
3065
3066 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
3067
3068 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
3069 shell, not within 'make', so that 'make' by an ordinary builder
3070 (using GNU make) does not worry about configuring gzip. This also
3071 works around a bug reported independently by Keith Thompson and by
3072 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
3073 stderr rather than stdout, messing up the build logs.
3074
3075 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3076
3077 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
3078 to make sure that YYID will never be unused. This fixes a 'make
3079 maintainer-check' failure caused by the recent changes to the 'Trivial
3080 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
3081 not used.
3082 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
3083
3084 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3085
3086 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
3087 state before an empty RHS is always resolved here. Only the location
3088 of that state is guaranteed to be resolved, and that's enough. This
3089 fixes the remaining bug reported by Derek M. Jones in
3090 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3091 * tests/glr-regression.at (Uninitialized location when reporting
3092 ambiguity): Test the above case.
3093 Also, the embedded comments in this test case claim it checks the case
3094 of an empty RHS that has inherited the initial location. However, the
3095 corresponding LHS was already resolved, so yyresolveLocations didn't
3096 actually have reason to modify it. Fix this by forcing
3097 nondeterministic operation at the beginning of the parse.
3098
3099 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
3100
3101 * data/c.m4 (b4_yy_symbol_print_generate):
3102 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
3103 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
3104 of the bugs reported today by Derek M Jones in
3105 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3106 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
3107 defined to be a type name without parens or brackets.
3108 (Location Type): Similarly for YYLTYPE.
3109 * tests/regression.at (Trivial grammars): Put in a test for this
3110 bug that will be caught by 'make maintainer-check' (though not,
3111 alas, by 'make check' unless your compiler is picky).
3112
3113 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
3114
3115 * NEWS: Version 2.2.
3116 * configure.ac (AC_INIT): Likewise.
3117
3118 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
3119
3120 * data/glr.c (yyreportTree): Make room in yystates for the state
3121 preceding the RHS. This fixes the segmentation fault reported by Derek
3122 M. Jones in
3123 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
3124 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
3125 to the user. Reported for yyreportTree by Derek M. Jones later in the
3126 same thread.
3127 * THANKS: Add Derek M. Jones.
3128 Update my email address.
3129 Fix typo in Steve Murphy's name.
3130
3131 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
3132
3133 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
3134 checking against YYLAST that caused the parser to miss a potential
3135 alternative in its diagnostic.
3136 Problem reported by Maria Jose Moron Fernandez in
3137 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
3138 * data/lalr1.cc (yysyntax_error_): Likewise.
3139 * data/yacc.c (yysyntax_error): Likewise.
3140 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
3141 tokens, in case we run into an older C compiler.
3142 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
3143 Use them to check for the off-by-one error fixed above.
3144
3145 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
3146 YYSIZE_T, not size_t.
3147 * tests/regression.at (Trivial grammars): New test, to catch
3148 the error fixed by the above patch.
3149
3150 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3151
3152 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
3153 scheme.
3154 Reported by Steve Murphy.
3155
3156 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3157
3158 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
3159 * data/glr.cc: b4_location_flag is now b4_locations_flag.
3160
3161 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3162
3163 Implement --trace=m4.
3164 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
3165 * src/output.c (output_skeleton): When set, pass -dV to m4.
3166
3167 Factor the handling of flags in m4.
3168 * src/output.c (prepare): Rename the muscle names debug, defines,
3169 error_verbose to debug_flag, defines_flag, error_verbose_flag.
3170 * data/c.m4: Adjust.
3171 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
3172 Use b4_define_flag_if to define other b4_FLAG_if macros.
3173 (b4_location_if): As a consequence, rename as...
3174 (b4_locations_if): this, for consistency.
3175 Adjust all the skeletons.
3176
3177 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3178
3179 * etc/bench.pm: Shorten bench names.
3180
3181 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3182
3183 * src/output.h, src/output.c (error_verbose): Move to...
3184 * src/getargs.h, src/getargs.c: here.
3185 Sort the flags.
3186 Adjust dependencies.
3187
3188 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
3189
3190 * data/c.m4 (b4_copyright): Put the special exception for Bison
3191 skeletons here, so we don't have to put it in each skeleton. All
3192 uses changed. Suggested by Akim Demaille. Also, wrap the
3193 copyright notice, in case it is longer than 80 columns. Replace
3194 comma by newline after title.
3195
3196 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
3197
3198 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
3199 incompatibility, not a bug. Mention that it wasn't fixed as of
3200 flex 2.5.33.
3201
3202 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
3203
3204 * examples/extexi: Enforce the precedence of concatenation over
3205 >>.
3206 Reported by Tommy Nordgren.
3207
3208 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
3209
3210 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
3211 with the member "token".
3212 Reported by Martin Nylin.
3213
3214 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
3215
3216 * data/glr.c: Switch to Bison 2.2 special-exception language in
3217 the copyright notice. Use more-regular format for titles and
3218 copyright notices.
3219 * data/glr.cc: Likewise.
3220 * data/location.cc: Likewise.
3221 * data/yacc.cc: Likewise.
3222 * doc/bison.texinfo (Conditions): Document this.
3223 * NEWS: likewise. Upgrade version to 2.2.
3224
3225 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
3226
3227 * data/glr.cc: Remove dead code.
3228
3229 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
3230
3231 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
3232 that variable and the line breaks the bootstrap. Problem reported
3233 by Juan M. Guerrero.
3234
3235 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
3236
3237 * doc/bison.texinfo (Multiple start-symbols): New.
3238
3239 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
3240
3241 * etc/README, etc/bench.pl: New.
3242
3243 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
3244
3245 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
3246 rule.
3247 Reported by Mickael Labau.
3248 * tests/input.at (Torturing the Scanner): Test it.
3249
3250 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
3251
3252 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
3253 Problem reported by Bob Rossi.
3254
3255 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
3256
3257 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
3258 and didn't really work.
3259 For the index, use @ifnotinfo, not @iftex.
3260 Minor cleanups of spacing and terminology.
3261
3262 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
3263
3264 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
3265 of AT_NAME_PREFIX when %name-prefix is not used.
3266
3267 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
3268
3269 Apply --prefix to C++ skeletons too: they change the namespace.
3270 The test suite already exercize these cases.
3271 * data/c++.m4 (b4_namespace): New.
3272 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
3273 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
3274 * data/yacc.c, data/glr.c: Remove a useless `[]'.
3275 * doc/bison.texinfo: Document it.
3276 (Option Cross Key): Use @multitable in all formats. It looks
3277 nicer, even in TeX outputs.
3278 (Rules): Use the same code whatever the output type is.
3279 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
3280 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
3281 * tests/calc.at: Use it, instead of hard coding `yy'.
3282
3283 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
3284
3285 * TODO: Remove dead items.
3286
3287 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
3288
3289 * doc/FAQ: Remove, merged into...
3290 * doc/bison.texinfo (FAQ): this.
3291 * doc/Makefile.am (EXTRA_DIST): Adjust.
3292
3293 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
3294
3295 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
3296 even if empty.
3297 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
3298 * doc/bison.texinfo (Calc++ Scanner): Use it.
3299
3300 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
3301
3302 Fix two nits reported by twlevo, plus one more that I discovered.
3303
3304 * src/assoc.h (assoc_to_string): Give a name to the arg, as
3305 this is the usual Bison style.
3306 * src/location.h (location_print): Likewise.
3307
3308 * src/reader.h (token_name): Likewise.
3309
3310 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
3311
3312 Fix some nits reported by twlevo.
3313 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
3314 and "POSIX". Use more-modern syntax for URLs. Mention C++
3315 and ask for Java. Don't hardwire OS version numbers. Add
3316 copyright notice.
3317 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
3318 * src/conflicts.c (solved_conflicts_obstack): Now static.
3319
3320 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3321
3322 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
3323 page. Say "you can use it" not "you may use it" as on the web page;
3324 we're describing capabilities not granting permission.
3325
3326 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
3327
3328 * data/glr.c (yyresolveLocations): Rename local variables to avoid
3329 shadowing warnings. Use usual patter for iterating through RHS.
3330 * tests/glr-regression.at
3331 (Uninitialized location when reporting ambiguity):
3332 Modify yylex so that it uses its argument, rather than trying
3333 to rely on ARGSUSED (which doesn't work for gcc with warnings).
3334 const char -> char const.
3335
3336 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
3337 Don't use tabs inside commands; it messes up 'ps'.
3338 Problem reported by twlevo.
3339
3340 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
3341
3342 * tests/glr-regression.at (Uninitialized location when reporting
3343 ambiguity): New test case.
3344 * data/glr.c (yyresolveLocations): New function, which uses
3345 YYLLOC_DEFAULT.
3346 (yyresolveValue): Invoke yyresolveLocations before reporting an
3347 ambiguity.
3348 * doc/bison.texinfo (Default Action for Locations): Note
3349 YYLLOC_DEFAULT's usage for ambiguity locations.
3350 (GLR Semantic Actions): Cross-reference those notes.
3351
3352 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
3353
3354 * tests/glr-regression.at (Leaked semantic values when reporting
3355 ambiguity): Remove unnecessary union and type declarations.
3356 (Leaked lookahead after nondeterministic parse syntax error): New test
3357 case.
3358 * data/glr.c (yyparse): Check for zero stacks remaining before
3359 attempting to shift the lookahead so that you don't lose it.
3360
3361 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3362
3363 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
3364 * tests/glr-regression.at (Leaked semantic values when reporting
3365 ambiguity): New test case.
3366 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
3367 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
3368 now unnecessary yystackp parameter.
3369 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
3370 destructors can be called.
3371
3372 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
3373 in existing testcases.
3374
3375 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3376
3377 Don't leak semantic values for parent RHS when a user action cuts the
3378 parser, and clean up related code a bit.
3379 * tests/glr-regression.at (Leaked merged semantic value if user action
3380 cuts parse): Rename to...
3381 (Leaked semantic values if user action cuts parse): ... this. Add check
3382 for leaked parent RHS values.
3383 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
3384 between an unresolved state (non-empty chain of semantic options) and
3385 an incomplete one (signaled by an empty chain).
3386 (yyresolveStates): Document the interface. Move all manipulation of a
3387 successfully or unsuccessfully resolved yyGLRState to...
3388 (yyresolveValue): ... here so that yyresolveValue always leaves a
3389 yyGLRState with consistent data and thus is easier to understand.
3390 Remove the yyvalp and yylocp parameters since they are always just
3391 taken from the yys parameter. When reporting a discarded merged value
3392 in debugging output, note that it is incompletely merged. Document the
3393 interface.
3394 (yyresolveAction): If resolving any of the RHS states fails, destroy
3395 them all rather than leaking them. Thus, as long as user actions are
3396 written to clean up the RHS correctly, yyresolveAction always cleans up
3397 the RHS of a semantic option. Document the interface.
3398
3399 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
3400
3401 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
3402 led to a segmentation fault in GNU Pascal. Problem reported
3403 by Waldek Hebisch.
3404
3405 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
3406
3407 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
3408 mid-rule action inside a nonterminal symbol in order to declare a
3409 destructor for its semantic value.
3410
3411 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
3412
3413 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
3414 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
3415 __cplusplus && ! defined _STDLIB_H && !
3416 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
3417 defined free))]: Include <stdlib.h> rather than rolling our own
3418 declarations of malloc and free, to avoid problems with
3419 incompatible declarations (using 'throw') C++'s stdlib.h. This
3420 should fix Debian bug 340012
3421 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
3422 reported by Guillaume Melquiond.
3423
3424 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3425
3426 * NEWS: Clarify symbols versus types in unused-value warnings.
3427
3428 * configure.ac (AC_INIT): Bump version number.
3429
3430 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3431
3432 * NEWS: Version 2.1a.
3433 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
3434 since C99 requires this.
3435
3436 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
3437
3438 * m4/c-working.m4: New file.
3439 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
3440
3441 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
3442
3443 * Makefile.maint: Merge from coreutils.
3444
3445 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
3446
3447 More portability fixes for problems summarized by Nelson H. F. Beebe.
3448
3449 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
3450 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
3451 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
3452 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
3453 messes up because C++ code is compiled in 32-bit mode but linked
3454 in 64-bit mode.
3455
3456 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
3457
3458 More portability fixes for problems summarized by Nelson H. F. Beebe.
3459
3460 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
3461 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
3462
3463 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
3464 nodist_PROGRAMS, since we don't need to actually compile the
3465 example if we're just doing a plain 'make'. This avoids bothering
3466 the installer unnecessarily about problems due to weird C++
3467 compilers.
3468
3469 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
3470
3471 More portability fixes for problems summarized by Nelson H. F. Beebe.
3472
3473 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
3474 than #include "...", and compile with -I'.'. The old method was
3475 not portable, according to Posix and the C standard, and it does
3476 not work with Sun C 5.7, where previous #line directives affect
3477 the working directory used in later #include "..." directives.
3478
3479 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3480
3481 Various DJGGP specific issues in /djgpp
3482
3483 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
3484
3485 More portability fixes for problems summarized by Nelson H. F. Beebe.
3486
3487 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
3488 '#include <map>' works and that you can apply ++ to iterators.
3489
3490 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
3491
3492 Work around portability problems summarized by Nelson H. F. Beebe in
3493 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
3494
3495 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3496 that '#include <string>' works.
3497
3498 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
3499 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
3500 "warning: sorry: semantics of inline function static data `const
3501 unsigned char translate_table[262]' are wrong (you'll wind up with
3502 multiple copies)".
3503
3504 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
3505 or, xor to not_, and_, or_, and xor_, respectively. This works
3506 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
3507 random system header somewhere that includes the equivalent of
3508 <iso646.h>.
3509
3510 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
3511 -E" works; it apparently doesn't work with PathScale EKO Compiler
3512 Suite Version 2.0.
3513
3514 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
3515
3516 During deterministic GLR operation, user actions should be able to
3517 influence the parse by changing yychar. To make this easier to fix and
3518 to make glr.c easier to evolve in general, don't maintain yytoken in
3519 parallel with yychar; just compute yytoken when needed.
3520 * tests/glr-regression.at (Incorrect lookahead during deterministic
3521 GLR): Check that setting yychar in a user action has the intended
3522 effect.
3523 * data/glr.c (yyGLRStack): Remove yytokenp member.
3524 (yyclearin): Don't set *yytokenp.
3525 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
3526 yychar rather than *yytokenp to determine the current lookahead.
3527 Compute yytoken locally when needed.
3528 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
3529 point to.
3530
3531 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
3532 after `--report' documentation.
3533
3534 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
3535
3536 * src/parse-gram.y (grammar_declaration): Location of printer
3537 symbol is @1, not list->location. Bug reported by twlevo.
3538 * tests/input.at (Incompatible Aliases): Adjust to above change.
3539
3540 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
3541
3542 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
3543 all the test at once. This makes the output easier to read in the
3544 normal case.
3545
3546 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
3547 got from <http://bro-ids.org/download.html>. The bug is that
3548 when two actions appeared in succession, the second one was
3549 scanned before the first one was added to the grammar rule
3550 as a midrule action. Bison then output the incorrect warning
3551 "parse.y:905.17-906.36: warning: unused value: $3".
3552 * src/parse-gram.y (BRACED_CODE, action): These are no longer
3553 associated with a value.
3554 (rhs): Don't invoke grammar_current_rule_action_append.
3555 (action): Invoke it here instead.
3556 * src/reader.c (grammar_midrule_action): Now extern.
3557 (grammar_current_rule_action_append): Don't invoke
3558 grammar_midrule_action; that is now the scanner's job.
3559 * src/reader.h (last_string, last_braced_code_loc):
3560 (grammar_midrule_action): New decls.
3561 * src/scan-gram.l (last_string): Now extern, sigh.
3562 (last_braced_code_loc): New extern variable.
3563 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
3564 rule already has an action.
3565 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
3566 * tests/input.at (AT_CHECK_UNUSED_VALUES):
3567 Add some tests to check that the above changes fixed the bug.
3568
3569 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
3570
3571 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
3572 All used changed. Check whether the symbol has a destructor,
3573 not whether it is typed.
3574 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
3575 that the values are still reported as unused. All line numbers
3576 adjusted.
3577
3578 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
3579
3580 Work around a bug in bro 0.8, which underparenthesizes its
3581 definition of YYLLOC_DEFAULT.
3582 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
3583 their arguments.
3584 * data/lalr1.cc: Likewise.
3585 * data/yacc.cc: Likewise.
3586
3587 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
3588
3589 Work around a bug in Pike 7.0, and give the Pike folks a
3590 better way to override the usual int widths.
3591 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
3592 user can override the types.
3593 (short): #undef, to work around a bug in Pike 7.0.
3594 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
3595 (union yyalloc.yyss): Use yytype_int16 rather than short.
3596 All uses changed.
3597 (yysigned_char): Remove.
3598 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
3599 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
3600 * tests/regression.at (Web2c Actions): Adjust to above changes.
3601
3602 * src/reader.c (check_and_convert_grammar): New function.
3603 (reader): Close the input file even if something went wrong during
3604 parsing. Minor file descriptor leak reported by twlevo.
3605
3606 * src/assoc.c (assoc_to_string): Use a default: abort (); case
3607 to pacify gcc -Wswitch-default.
3608 * src/scan-gram.l (adjust_location): Use a default: break; case
3609 to pacify gcc -Wswitch-default.
3610 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
3611 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3612 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3613 Move these decls to scan-skel.l, since they don't need to be
3614 visible elsewhere.
3615 * src/scan-skel.l: Accept the above decls.
3616 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
3617 is used.
3618
3619 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
3620
3621 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
3622 since we don't want to insist on a version number at the start
3623 of the changelog every time.
3624 * Makefile.maint: Sync from coreutils a bit better.
3625 (sc_trailing_blank): Renamed from sc_trailing_space.
3626 All uses changed.
3627 (sc_no_if_have_config_h, sc_require_config_h):
3628 (sc_prohibit_assert_without_use): New rules.
3629 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
3630 (sc_dd_max_sym_length): Fix leading spaces in rule.
3631 (sc_system_h_headers): Prefix with @.
3632 (sc_useless_cpp_parens, m4-check): Output line numbers.
3633 (changelog-check): Allow version only in head.
3634 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
3635 satisfy new Makefile.maint rule.
3636 * data/glr.c: Likewise.
3637 * data/glr.cc: Likewise.
3638 * data/lalr1.cc: Likewise.
3639 * data/yacc.c: Likewise.
3640 * lib/ebitsetv.c: Likewise.
3641 * lib/lbitset.c: Likewise.
3642 * lib/subpipe.c: Likewise.
3643 * lib/timevar.c: Likewise.
3644 * src/system.h: Likewise.
3645 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
3646 * djgpp/Makefile.maint: Add copyright notice.
3647 * djgpp/README.in: Likewise.
3648 * djgpp/config.bat: Likewise.
3649 * djgpp/config.site: Likewise.
3650 * djgpp/config_h.sed: Likewise.
3651 * djgpp/djunpack.bat: Likewise.
3652 * djgpp/config.sed: Fix copyright notice to match standard format.
3653 * djgpp/subpipe.h: Likewise.
3654 * lib/bitsetv-print.c: Likewise.
3655 * lib/bitsetv.c: Likewise.
3656 * lib/subpipe.h: Likewise.
3657 * lib/timevar.c: Likewise.
3658 * lib/timevar.h: Likewise.
3659 * djgpp/subpipe.c: Use standard recipe for config.h.
3660 * lib/abitset.c: Likewise.
3661 * lib/bitset.c: Likewise.
3662 * lib/bitset_stats.c: Likewise.
3663 * lib/bitsetv-print.c: Likewise.
3664 * lib/bitsetv.c: Likewise.
3665 * lib/ebitsetv.c: Likewise.
3666 * lib/get-errno.c: Likewise.
3667 * lib/lbitset.c: Likewise.
3668 * lib/subpipe.c: Likewise.
3669 * lib/timevar.c: Likewise.
3670 * lib/vbitset.c: Likewise.
3671 * tests/local.at: Likewise.
3672 * src/scan-gram.l: Don't include verify.h, since system.h does
3673 that for us.
3674 * .x-sc_require_config_h: New file.
3675 * .x-sc_unmarked_diagnostics: New file.
3676
3677 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
3678
3679 Be a bit more systematic about using 'abort'.
3680 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
3681 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
3682 Put 'default: abort ();' before some other case, to satisfy older
3683 pedantic compilers.
3684 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3685 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
3686 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
3687 * src/conflicts.c (resolve_sr_conflict): Likewise.
3688 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
3689 (get_decision_str, get_orientation_str, get_node_alignment_str):
3690 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
3691 (get_linestyle_str, get_arrowstyle_str): Likewise.
3692 * src/conflicts.c (resolve_sr_conflict):
3693 Use a default case rather than one for the one remaining enum
3694 value, to catch invalid enum values as well.
3695 * src/lalr.c (set_goto_map, map_goto):
3696 Prefer "assert (FOO);" to "if (!FOO) abort ();".
3697 * src/nullable.c (nullable_compute, token_definitions_output):
3698 Likewise.
3699 * src/reader.c (packgram, reader): Likewise.
3700 * src/state.c (transitions_to, state_new, state_reduction_find):
3701 Likewise.
3702 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
3703 (symbol_pack): Likewise.
3704 * src/tables.c (conflict_row, pack_vector): Likewise.
3705 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
3706 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
3707 * src/system.h: Don't include <assert.h>.
3708 (assert): New macro.
3709
3710 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
3711 (Destructor Decl, Parser Function, Pure Calling):
3712 Describe rules for braces inside C code more carefully.
3713
3714 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
3715
3716 Fix some porting glitches found by Nelson H. F. Beebe.
3717 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
3718 compilers that don't understand that abort () does not return.
3719 * src/state.c (transitions_to): Likewise.
3720 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3721 that '#include <cstdlib>' works.
3722 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
3723 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
3724 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
3725 for the benefit of some pre-C99 compilers.
3726
3727 * bootstrap: Undo changes to gnulib files that autoreconf made.
3728
3729 Minor fixups to get 'make maintainer-check' to work.
3730 * configure.ac: Don't use -Wnested-externs, as it's incompatible
3731 with the new verify.h implementation.
3732 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
3733 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
3734 * data/yacc.c (YYUSE): Likewise.
3735 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
3736 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
3737 * src/parse-gram.y (declaration): Don't pass a string constant
3738 to a function that expects char *, since GCC might complain
3739 about the constant value.
3740 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
3741 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
3742 before #defining them.
3743 * tests/glr-regression.at
3744 (Incorrectly initialized location for empty right-hand side in GLR):
3745 In yyerror, use the msg arg.
3746 (Corrupted semantic options if user action cuts parse):
3747 (Incorrect lookahead during deterministic GLR):
3748 (Incorrect lookahead during nondeterministic GLR):
3749 Don't name a local var 'index'; it shadows string.h's 'index'.
3750
3751 2006-01-19 Akim Demaille <akim@epita.fr>
3752
3753 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
3754 location, not just parts of it.
3755
3756 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
3757
3758 * NEWS: Document the fact that multiple %unions are now allowed.
3759 * doc/bison.texinfo (Union Decl): Likewise.
3760 * TODO: This feature is now implemented, so remove it from
3761 the wishlist.
3762
3763 * Makefile.maint: Merge with coreutils Makefile.maint.
3764 (CVS_LIST): Use build-aux version if available.
3765 (VERSION_REGEXP): New macro.
3766 (syntax-check-rules): Add sc_no_if_have_config_h,
3767 sc_prohibit_assert_without_use, sc_require_config_h,
3768 sc_useless_cpp_parens.
3769 (sc_obsolete_symbols): Check for O_NDELAY.
3770 (sc_dd_max_sym_length): Track coreutils.
3771 (sc_unmarked_diagnostics): Look in all files, not just *.c.
3772 (sc_useless_cpp_parens): New rule.
3773 (news-date-check): Look for version or today's date.
3774 (changelog-check): Don't require version number near head.
3775 (copyright-check): Use current year instead of hardwiring 2005.
3776 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
3777 (announcement): Add --gpg-key-ID.
3778
3779 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
3780 with "file system".
3781
3782 Avoid undefined behavior that addressed just before the start of an
3783 array. Problem reported by twlevo.
3784 * src/reader.c (packgram): Prepend a new sentinel before ritem.
3785 * src/lalr.c (build_relations): Rely on new sentinel.
3786 * src/gram.c (gram_free): Adjust to new sentinel.
3787
3788 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
3789
3790 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
3791 yylookaheadNeeds. All uses updated.
3792 (yysplitStack): Rename local yynewLookaheadStatuses to
3793 yynewLookaheadNeeds.
3794 * data/glr-regression.at (Incorrect lookahead during nondeterministic
3795 GLR): In comments, change `lookahead status' to `lookahead need'.
3796
3797 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3798
3799 * data/glr.c (yysplitStack): A little stylistic rewrite.
3800
3801 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3802
3803 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
3804
3805 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
3806
3807 * doc/bison.texinfo: Fix some typos.
3808 (GLR Semantic Actions): New subsection discussing special
3809 considerations because GLR semantic actions might be deferred.
3810 (Actions): Mention look-ahead usage of yylval.
3811 (Actions and Locations): Mention look-ahead usage of yylloc.
3812 (Special Features for Use in Actions): Add YYEOF entry and mention it
3813 in the yychar entry.
3814 In the yychar entry, remove mention of the local yychar case (pure
3815 parser) since this is irrelevant information when writing semantic
3816 actions and since it's already discussed in `Table of Symbols' where
3817 yychar is otherwise described as an external variable.
3818 In the yychar entry, don't call it the `current' look-ahead since it
3819 isn't when semantic actions are deferred.
3820 In the yychar and yyclearin entries, add note about deferred semantic
3821 actions.
3822 Add yylloc and yylval entries discussing look-ahead usage.
3823 (Look-Ahead Tokens): When discussing yychar, don't call it the
3824 `current' look-ahead, and do mention yylval and yylloc.
3825 (Error Recovery): Cross-reference `Action Features' when mentioning
3826 yyclearin.
3827 (Table of Symbols): In the yychar entry, don't call it the `current'
3828 look-ahead.
3829 In the yylloc and yylval entries, mention look-ahead usage.
3830
3831 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3832
3833 * tests/glr-regression.at: Update copyright year to 2006.
3834
3835 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3836
3837 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
3838 use during nondeterministic operation to track which stacks have
3839 actually needed the current lookahead.
3840 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
3841 Allocate, deallocate, resize, and otherwise shuffle space for
3842 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
3843 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
3844 appropriately during nondeterministic operation.
3845 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
3846 members to store the current lookahead to be used by the deferred
3847 user action.
3848 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
3849 from which the RHS is taken. Set the lookahead members of the new
3850 yySemanticOption according to the lookahead status for stack yyk.
3851 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
3852 yyaddDeferredAction.
3853 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
3854 members of yySemanticOption before invoking yyuserAction, and then set
3855 them back to their current values afterward.
3856 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
3857 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
3858 * tests/glr-regression.at: Remove `.' from the ends of recent test case
3859 titles for consistency.
3860 (Leaked merged semantic value if user action cuts parse): In order to
3861 suppress lint warnings, use arguments in merge function, and assign
3862 char value < 128 in main.
3863 (Incorrect lookahead during deterministic GLR): New test case.
3864 (Incorrect lookahead during nondeterministic GLR): New test case.
3865
3866 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3867
3868 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
3869 !yyvaluep as signal that no semantic value is available to print.
3870 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
3871 to print a semantic value.
3872
3873 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3874
3875 * tests/glr-regression.at: For consistency with my newer test cases,
3876 don't thank myself.
3877
3878 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3879
3880 * data/glr.c (yyresolveValue): When merging semantic options, if at
3881 least one user action succeeds but a later one cuts the parse, then
3882 destroy the semantic value before returning rather than leaking it.
3883 (yyresolveStates): If a user action cuts the parse and thus
3884 yyresolveValue fails, ignore the (unset) semantic value rather than
3885 corrupting the yyGLRState, and empty the semantic options list since
3886 the user actions should have called all necessary destructors.
3887 Simplify code with YYCHK.
3888 * tests/glr-regression.at (Corrupted semantic options if user action
3889 cuts parse): New test case.
3890 (Undesirable destructors if user action cuts parse): New test case.
3891 Before applying any of this patch, this test case never actually failed
3892 for me... but only because the corrupted semantic options usually
3893 masked this bug.
3894 (Leaked merged semantic value if user action cuts parse): New test
3895 case.
3896
3897 2006-01-05 Akim Demaille <akim@epita.fr>
3898
3899 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
3900
3901 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
3902
3903 * data/c.m4 (b4_c_modern): New macro, with a new provision for
3904 _MSC_VER. Problem reported by Cenzato Marco.
3905 (b4_c_function_def): Use it.
3906 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
3907 b4_c_modern.
3908 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
3909 than rolling our own.
3910
3911 2006-01-04 Akim Demaille <akim@epita.fr>
3912
3913 Also warn about non-used mid-rule values.
3914 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
3915 member.
3916 (symbol_list_new): Adjust.
3917 * src/reader.c (symbol_typed_p): New.
3918 (grammar_rule_check): Use it.
3919 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
3920 Check its rule.
3921 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
3922 Use it.
3923 * tests/actions.at (Exotic Dollars): Adjust.
3924
3925 2006-01-04 Akim Demaille <akim@epita.fr>
3926
3927 * src/reader.c (grammar_midrule_action): If $$ is set in a
3928 mid-rule, move the `used' bit to its lhs.
3929 * tests/input.at (Unused values): New.
3930 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
3931
3932 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
3933
3934 * doc/bison.texinfo (Bison Options): Say more accurately what
3935 --yacc does.
3936 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
3937 about declarations in the grammar when in Yacc mode, as POSIX does
3938 not require a diagnostic when the grammar uses extensions.
3939
3940 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
3941
3942 Warn about dubious constructions like "%token T T".
3943 Reported by twlevo.
3944 * src/symtab.h (struct symbol.declared): New member.
3945 * src/symtab.c (symbol_new): Initialize it to false.
3946 (symbol_class_set): New arg DECLARING, specifying whether
3947 this is a declaration that we want to warn about, if there
3948 is more than one of them. All uses changed.
3949
3950 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
3951 Allow multiple %union directives, whose contents concatenate.
3952 * src/parse-gram.y (grammar_declaration): Likewise.
3953 Use muscle_code_grow, so that we don't need stype_line any more.
3954 All uses changed.
3955
3956 * src/muscle_tab.c (muscle_grow): Fix comment.
3957
3958 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
3959 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
3960 Update copyright year to 2006.
3961
3962 2006-01-03 Akim Demaille <akim@epita.fr>
3963
3964 Have glr.cc pass (some of) the calc.at tests.
3965 * data/glr.cc (b4_parse_param_orig): New.
3966 (b4_parse_param): Improve its definition, and bound it more
3967 clearly in the skeleton.
3968 (b4_epilogue): Append, instead of prepending, in order to keep
3969 #line consistency.
3970 Simplify the generation of auxiliary functions: locations and
3971 purity are mandated.
3972 (b4_global_tokens_and_yystype): Honor it.
3973 * data/location.cc (c++.m4): Don't include it.
3974 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
3975 and AT_SKEL_CC_IF.
3976 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
3977 AT_LALR1_CC_IF.
3978 Be sure to initialize the first position's filename.
3979 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
3980 mandated anyway.
3981 (AT_CHECK_CALC_GLR_CC): New.
3982 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
3983
3984 2006-01-02 Akim Demaille <akim@epita.fr>
3985
3986 * src/output.c (output_skeleton): Don't hard wire the inclusion of
3987 c.m4.
3988 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3989 * data/glr.cc: Do not include stack.hh.
3990
3991 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3992
3993 * data/glr.c: Reformat whitespace with tabs.
3994 (b4_lpure_formals): Remove this unused m4 macro.
3995 * tests/cxx-type.at: Reformat whitespace with tabs.
3996 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
3997 since it's a member. Rename type to isNterm for clarity.
3998
3999 2005-12-29 Akim <akim@sulaco.local>
4000
4001 Let glr.cc catch up with symbol_value_print.
4002 * data/glr.cc (b4_yysymprint_generate): Replace by...
4003 (b4_yy_symbol_print_generate): this.
4004 (yy_symbol_print, yy_symbol_value_print): Declare them.
4005
4006 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
4007
4008 * src/location.h (boundary): Note that a line or column equal
4009 to INT_MAX indicates an overflow.
4010 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
4011 (rule_length_overflow, increment_rule_length, add_column_width):
4012 New functions.
4013 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
4014 (<SC_BRACED_CODE>"}"):
4015 Use increment_rule_length rather than incrementing it by hand.
4016 (adjust_location, handle_syncline): Diagnose overflow.
4017 (handle_action_dollar, handle_action_at):
4018 Fix bug with monstrosities like $-2147483648.
4019 Remove now-unnecessary checks.
4020 (scan_integer): Verify assumptions and remove now-unnecessary checks.
4021 (convert_ucn_to_byte): Verify assumptions.
4022 (handle_syncline): New arg LOC. All callers changed.
4023 Don't store through a value derived from char const * pointer.
4024
4025 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
4026 GCC warnings.
4027
4028 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
4029
4030 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
4031 Remove unnecessary forward static decls.
4032
4033 2005-12-27 Akim Demaille <akim@epita.fr>
4034
4035 * src/reader.c (grammar_current_rule_check): Also check that $$
4036 is used.
4037 Take the rule to check as argument, hence rename as...
4038 (grammar_rule_check): this.
4039 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
4040 Rename as...
4041 (grammar_rule_begin, grammar_rule_end): these, for consistency.
4042 (grammar_midrule_action, grammar_symbol_append): Now static.
4043 * tests/torture.at (input): Don't rely on the default action
4044 being always performed.
4045 * tests/calc.at: "Set" $$ even when the action is "cut" with
4046 YYERROR or other.
4047 * tests/actions.at (Exotic Dollars): Instead of using unused
4048 values, check that the warning is issued.
4049
4050 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
4051
4052 * NEWS: Improve wording for unused-value warnings.
4053
4054 2005-12-22 Akim Demaille <akim@epita.fr>
4055
4056 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
4057 (b4_yysymprint_generate): Rename as...
4058 (b4_yy_symbol_print_generate): this.
4059 Generate yy_symbol_print instead of yysymprint.
4060 Generate also yy_symbol_value_print, and use it.
4061
4062 2005-12-22 Akim Demaille <akim@epita.fr>
4063
4064 * NEWS: Warn about unused values.
4065 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
4066 a `used' member.
4067 (symbol_list_n_get, symbol_list_n_used_set): New.
4068 (symbol_list_n_type_name_get): Use symbol_list_n_get.
4069 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
4070 * src/reader.c (grammar_current_rule_check): Check that values are
4071 used.
4072 * src/symtab.c (symbol_print): Accept 0.
4073 * tests/existing.at: Remove the type information.
4074 Empty the actions.
4075 Remove useless actions (beware of mid-rule actions: perl -000
4076 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
4077 * tests/actions.at (Exotic Dollars): Use unused values.
4078 * tests/calc.at: Likewise.
4079 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4080 Likewise.
4081
4082 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
4083 rule_useful_p.
4084
4085 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
4086
4087 Undo 2005-12-01 tentative license wording change. The wording is
4088 still being reviewed by the lawyers, and we don't want to wait for
4089 them before publishing a test release. For now, revert to the
4090 previous wording.
4091 * NEWS: Undo 2005-12-01 change.
4092 * data/glr.c: Revert to previous license wording.
4093 * data/glr.cc: Likewise.
4094 * data/lalr1.cc: Likewise.
4095 * data/location.cc: Likewise.
4096 * data/yacc.c: Likewise.
4097
4098 * NEWS: Reword %destructor vs YYABORT etc.
4099 * data/glr.c: Use American spacing, for consistency.
4100 * data/glr.cc: Likewise.
4101 * data/lalr1.cc: Likewise.
4102 * data/yacc.c: Likewise.
4103 * data/yacc.c: Reformat comments slightly.
4104 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
4105 for consistency. Fix some spelling errors and reword recently-included
4106 text slightly.
4107 * tests/cxx-type.at: Cast results of malloc, for C++.
4108
4109 2005-12-21 Joel E. Denny <address@hidden>
4110
4111 * tests/cxx-type.at: Construct a tree, count the parents of shared
4112 nodes, and free each node once and only once. Previously, the memory
4113 for semantic values was leaked instead.
4114
4115 2005-12-21 Joel E. Denny <address@hidden>
4116
4117 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
4118 (yylval, yylloc): If pure, #define to yystackp->yyval and
4119 yystackp->yyloc similar to yychar and yynerrs.
4120 (yyparse): If pure, remove local yylval and yylloc. Add local
4121 yystackp to accommodate pure definitions of yylval and yylloc.
4122 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
4123 yylvalp and yyllocp to &yylval and &yylloc.
4124 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
4125 namespace. Previously, nerrs and char were missing, but lval and lloc
4126 weren't necessary.
4127 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
4128 yylvalp and yyllocp parameters since, if pure, these are now always
4129 accessible through yystackp. If not pure, they are still accessible
4130 globally.
4131 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
4132 `if (YYID (N))' to pacify lint.
4133
4134 2005-12-21 Akim Demaille <akim@epita.fr>
4135
4136 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
4137 destroy the RHS symbols of a rule.
4138 * data/yacc.c (yylen): Initialize to 0.
4139 Keep its value to the number of items to possibly shift.
4140 In particular, a regular successful parse that ends on YYFINAL by
4141 a (internal) YYACCEPT must not have yylen != 0.
4142 (yyerrorlab, yyreturn): Pop the RHS.
4143 Reorder a bit to emphasize the `shifting' bits of code.
4144 (YYPOPSTACK): Now accept a number of items to pop.
4145 * data/lalr1.cc: Likewise.
4146 * data/glr.c: Formatting changes.
4147 Use goto instead of fall through.
4148 * doc/bison.texinfo (Destructor Decl): Complete.
4149
4150 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4151
4152 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4153 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
4154 * djgpp/config.bat: Replace every occurence of the file name
4155 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4156 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4157 * djgpp/config.sed: Replace every occurence of the file name
4158 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4159 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4160 * djgpp/djunpack.bat: DJGPP specific file.
4161 * djgpp/fnchange.lst: DJGPP specific file.
4162 * djgpp/README.in: Add new information about how to unpack the bison
4163 source on MSDOS and other systems which have 8.3 file name restrictions
4164 using djunpack.bat and fnchange.lst.
4165
4166 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
4167
4168 * bootstrap (build_cvs_prefix): Remove; unused.
4169 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
4170 when getting gnulib.
4171
4172 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
4173
4174 * data/glr.c: Reorder typedef declarations for structs to match order
4175 of struct declarations.
4176 Rename yystack everywhere to yystackp except in yyparse where it's not
4177 a pointer.
4178 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
4179 consistency.
4180 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
4181 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
4182 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
4183 lint.
4184
4185 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
4186
4187 * tests/sets.at (Accept): Fix typos in regular expression used to
4188 sed out the final state number.
4189
4190 Work around portability problem on Solaris 10: flex-generated
4191 files include <stdio.h> before <config.h>, which messes up
4192 because the latter defines __EXTENSIONS__. Address the problem
4193 by creating two new little files that include <config.h> first,
4194 then include the flex-generated files. Rewrite everyone else
4195 to include <config.h> first, as well.
4196 * lib/timevar.c: Always include "config.h".
4197 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
4198 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
4199 (EXTRA_bison_SOURCES): New macro.
4200 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
4201 * src/system.h: Don't include config.h.
4202 * src/LR0.c: Include <config.h> first.
4203 * src/assoc.c: Likewise.
4204 * src/closure.c: Likewise.
4205 * src/complain.c: Likewise.
4206 * src/conflicts.c: Likewise.
4207 * src/derives.c: Likewise.
4208 * src/files.c: Likewise.
4209 * src/getargs.c: Likewise.
4210 * src/gram.c: Likewise.
4211 * src/lalr.c: Likewise.
4212 * src/location.c: Likewise.
4213 * src/main.c: Likewise.
4214 * src/muscle_tab.c: Likewise.
4215 * src/nullable.c: Likewise.
4216 * src/output.c: Likewise.
4217 * src/parse-gram.y: Likewise.
4218 * src/print.c: Likewise.
4219 * src/print_graph.c: Likewise.
4220 * src/reader.c: Likewise.
4221 * src/reduce.c: Likewise.
4222 * src/relation.c: Likewise.
4223 * src/state.c: Likewise.
4224 * src/symlist.c: Likewise.
4225 * src/symtab.c: Likewise.
4226 * src/tables.c: Likewise.
4227 * src/uniqstr.c: Likewise.
4228 * src/vcg.c: Likewise.
4229
4230 * src/parse-gram.y: Fix minor problems uncovered by lint.
4231 (current_lhs, current_lhs_location): Now static.
4232 (current_assoc): Remove unused variable.
4233
4234 Cleanups so that Bison-generated parsers have less lint.
4235 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
4236 Prepend /*ARGSUSED*/, for lint's sake.
4237 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
4238 definition if 'lint' is defined.
4239 (YYID): New macro (or function, if lint).
4240 All uses of /*CONSTCOND*/0 replaced by YYID(0).
4241 * data/yacc.c: Likewise.
4242 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
4243 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
4244 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
4245 is C++ only.
4246 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
4247 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
4248 Use YYID(0) rather than 0, for lint.
4249 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
4250 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
4251
4252 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
4253
4254 * tests/glr-regression.at
4255 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4256 Close memory leak reported by twlevo.
4257
4258 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
4259
4260 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
4261 all stacks.
4262 (yyparse): Iterate another stack in order to call user destructors.
4263 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4264 New test case.
4265 (Duplicated user destructor for lookahead): This test now is expected
4266 to succeed.
4267
4268 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
4269
4270 * NEWS: Document the following change.
4271 * data/yacc.c: Say "parser skeleton" rather than "file", since
4272 it's no longer just a file.
4273 * data/glr.c: Grant a special exception for C GLR parsers, that
4274 reads like the already-existing exception for C LALR(1) parsers.
4275 * data/glr.cc: Likewise.
4276 * data/lalr1.cc: Likewise.
4277 * data/location.cc: Likewise.
4278 * data/yacc.c: Reword the "written by" statement to clarify that
4279 it was the parser skeleton, not the entire output file.
4280 * data/glr.c: Written by Paul Hilfinger.
4281 * data/glr.cc: Written by Akim Demaille.
4282 * data/lalr1.cc: Likewise.
4283
4284 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
4285
4286 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
4287 Fix typos in previous change that broke 'make check'.
4288 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
4289 supported in C.
4290 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
4291 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
4292 We can revert this once things settle down.
4293
4294 * src/conflicts.c (conflicts_print): Don't print file name twice
4295 when %expect fails because there were no conflicts.
4296 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
4297 change.
4298 * tests/conflicts.at (%expect not enough, %expect too much):
4299 (%expect with reduce conflicts): Adjust to new behavior.
4300
4301 2005-11-18 Akim Demaille <akim@epita.fr>
4302
4303 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
4304 errors.
4305 * NEWS: Document this.
4306 * doc/bison.texinfo (Expect Decl): Likewise.
4307
4308 2005-11-16 Akim Demaille <akim@epita.fr>
4309
4310 Generalize the display of semantic values and locations in traces.
4311 * data/glr.c (yy_reduce_print): Fix indices (again).
4312 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
4313 literal integers.
4314 * data/lalr1.cc (yyreduce_print): Rename as...
4315 (yy_reduce_print): this.
4316 Display values and locations.
4317 * data/yacc.c (yy_reduce_print): Likewise.
4318 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
4319 (yysymprint): Move higher to be visible from yy_reduce_print).
4320 (yyparse): Adjust.
4321 * tests/calc.at: Adjust the expected length of the traces.
4322
4323 2005-11-14 Akim Demaille <akim@epita.fr>
4324
4325 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
4326 from 1 to N, while values and location start at 0.
4327 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
4328
4329 2005-11-14 Akim Demaille <akim@epita.fr>
4330
4331 * data/glr.c (yy_reduce_print): Fix the $ number.
4332
4333 2005-11-14 Akim Demaille <akim@epita.fr>
4334
4335 "Use" parse parameters.
4336 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
4337 * data/glr.c, data/glr.cc: Use them.
4338 * data/glr.c (YYUSE): Have a C++ definition that supports
4339 non-pointer types.
4340
4341 2005-11-14 Akim Demaille <akim@epita.fr>
4342
4343 * data/glr.c (yyexpandGLRStack): Declare only if defined.
4344
4345 2005-11-14 Akim Demaille <akim@epita.fr>
4346
4347 * data/glr.cc: New.
4348 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
4349
4350 2005-11-12 Akim Demaille <akim@epita.fr>
4351
4352 Let position and location be PODs.
4353 * data/location.cc (position::initialize, location::initialize): New.
4354 (position::position, location::location): Define only if
4355 b4_location_constructors is defined.
4356 * data/lalr1.cc (b4_location_constructors): Define it for backward
4357 compatibility.
4358 * doc/bison.texinfo (Initial Action Decl): Use initialize.
4359
4360 2005-11-12 Akim Demaille <akim@epita.fr>
4361
4362 * data/lalr1.cc: Move the body of the ctor and dtor into the
4363 parser file (instead of the header).
4364 Wrap the implementations in a "namespace yy".
4365
4366 2005-11-12 Akim Demaille <akim@epita.fr>
4367
4368 Have glr.c include its header file when created.
4369 * data/glr.c (b4_shared_declarations): New.
4370 Output them verbatim in the parser if !%defines, otherwise
4371 output then in the header file, and include it instead.
4372
4373 2005-11-11 Akim Demaille <akim@epita.fr>
4374
4375 * data/glr.c: Comment changes.
4376
4377 2005-11-11 Akim Demaille <akim@epita.fr>
4378
4379 When yydebug, report semantic and location values for reductions.
4380 * data/glr.c (yy_reduce_print): Report the semantic values and the
4381 locations.
4382 (YY_REDUCE_PRINT): Adjust.
4383 (yyglrReduce): Use them.
4384 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
4385 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
4386 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
4387 traces.
4388
4389 2005-11-10 Akim Demaille <akim@epita.fr>
4390
4391 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
4392 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
4393 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
4394
4395 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
4396
4397 * m4/cxx.m4, examples/Makefile.am: Don't build
4398 examples/calc++ if no C++ compiler is available. (trivial change)
4399
4400 2005-11-09 Akim Demaille <akim@epita.fr>
4401
4402 * src/scan-skel.l: Use a couple of asserts.
4403
4404 2005-11-03 Akim Demaille <akim@epita.fr>
4405
4406 In some (weird) cases, the final state number is incorrect.
4407 Reported by Alexandre Duret-Lutz.
4408 * src/LR0.c (state_list_append): Remove the computation of
4409 final_state.
4410 (save_reductions): Do it here.
4411 (get_state): Alpha conversion.
4412 (generate_states): Use a for loop.
4413 * src/gram.h (item_number_is_rule_number)
4414 (item_number_is_symbol_number): New.
4415 * src/state.c: Use assert.
4416 * src/system.h: Include assert.h.
4417 * tests/sets.at (Accept): New.
4418
4419 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4420
4421 * data/glr.c (yyfill): Adjust comment.
4422 (yyresolveAction): Initialize default location properly
4423 for empty right-hand sides.
4424 (yydoAction): Ditto.
4425 Add comment explaining apparently dead code.
4426 * tests/glr-regression.at
4427 (Incorrectly initialized location for empty right-hand side in GLR):
4428 New test.
4429
4430 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
4431
4432 * bootstrap (cleanup_gnulib): New function. Use it to clean up
4433 gnulib when interrupted. This fixes some race conditions and
4434 works around some portability problems (one noted by Paul
4435 Hilfinger).
4436
4437 2005-10-22 Akim <akim@epita.fr>
4438
4439 * Makefile.cfg: Adjust to config -> build-aux.
4440 Reported by twledo.
4441
4442 2005-10-21 Akim Demaille <akim@epita.fr>
4443
4444 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
4445 the %parse-params.
4446 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
4447 * data/yacc.c (b4_Pure_if): Rename as...
4448 (b4_yacc_pure_if): this.
4449 (YY_SYMBOL_PRINT, yyparse): Adjust.
4450 * doc/bison.texinfo: Formatting changes.
4451
4452 2005-10-21 Akim Demaille <akim@epita.fr>
4453
4454 Finish the transition config -> build-aux.
4455 * configure.ac, Makefile.am: Use build-aux.
4456 * config/prev-version, config/announce-gen, config/Makefile.am:
4457 Move to...
4458 * build-aux/prev-version, build-aux/announce-gen,
4459 * build-aux/Makefile.am: here.
4460
4461 2005-10-14 Akim Demaille <akim@epita.fr>
4462
4463 * examples/calc++/test: Use set -x only when VERBOSE.
4464
4465 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
4466
4467 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
4468 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
4469
4470 2005-10-13 Akim Demaille <akim@epita.fr>
4471
4472 * src/scan-skel.l: Output the base name parts of the parser and
4473 header file names.
4474 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
4475 additional checks.
4476 Use this to exercise C++ outputs in subdirs.
4477 Reported by Oleg Smolsky.
4478
4479 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
4480
4481 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
4482 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
4483 Problem reported by John P. Hartmann.
4484 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
4485 already defined it.
4486
4487 2005-10-12 Akim Demaille <akim@epita.fr>
4488
4489 * src/parse-gram.y (version_check): Exit 63 to please missing
4490 (stands for "version mismatch).
4491 * tests/input.at, doc/bison.texinfo: Adjust.
4492
4493 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
4494
4495 Work around portability problems with Visual Age C compiler
4496 (xlc and xlC_r) reported by John P. Hartmann.
4497 * data/location.cc (initial_column, initial_line): Remove.
4498 All uses replaced by 0 and 1.
4499 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
4500 that xlc complains about.
4501 * src/scan-skel.l (skel_wrap): Likewise.
4502 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
4503 as __STDC__.
4504 * data/yacc.c (YYMODERN_C): New macro, which also looks at
4505 __STDC_VERSION__. Use it everywhere instead of looking at
4506 __STDC__ and __cplusplus.
4507
4508 2005-10-10 Akim Demaille <akim@epita.fr>
4509
4510 * examples/calc++/test: Be quiet unless VERBOSE.
4511
4512 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
4513
4514 * data/c.m4 (yydestruct, yysymprint):
4515 Use YYUSE instead of casting to void.
4516 * data/glr.c (YYUSE): New macro.
4517 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4518 Use it instead of rolling our own.
4519 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4520 (YYCHK1):
4521 Use /*CONSTCOND*/ to suppress lint warnings.
4522 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4523 (YY_STACK_PRINT): Use 'false' not '0'.
4524 (YYUSE): New macro.
4525 (yysymprint_, yydestruct_): Use it instead of rolling our own.
4526 * data/yacc.c (YYUSE): New macro.
4527 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
4528 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
4529 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
4530
4531
4532 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
4533 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
4534
4535 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
4536
4537 Undo the parts of the unlocked-I/O change that substituted
4538 putc or puts for printf. This might hurt performance a bit,
4539 but some people prefer the printf style.
4540 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
4541 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
4542 All uses replaced by YYFPRINTF and YYDPRINTF.
4543 * data/yacc.c: Likewise.
4544 * lib/bitset.c (bitset_print): Likewise.
4545 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
4546 putc and puts.
4547 * lib/lbitset.c (debug_lbitset): Likewise.
4548 * src/closure.c (print_firsts, print_fderives): Likewise.
4549 * src/gram.c (grammar_dump): Likewise.
4550 * src/lalr.c (look_ahead_tokens_print): Likewise.
4551 * src/output.c (escaped_output): Likewise.
4552 (user_actions_output): Break apart two printfs.
4553 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
4554 * src/reduce.c (reduce_print): Likewise.
4555 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4556 * src/system.h: Include unlocked-io.h rathe than stdio.h.
4557
4558 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4559 Use assignments rather than casts-to-void to suppress
4560 unused-variable warnings. This pacifies 'lint'.
4561 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
4562 unused-variable warnings.
4563
4564 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4565
4566 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4567
4568 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
4569
4570 Use unlocked I/O for a minor performance improvement on hosts like
4571 GNU/Linux and Solaris that support unlocked I/O. The basic idea
4572 is to use the gnlib unlocked-io module, and to prefer putc and
4573 puts to printf when either will work (since the latter doesn't
4574 come in an unlocked flavor).
4575 * bootstrap (gnulib_modules): Add unlocked-io.
4576 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
4577 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
4578 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
4579 and similarly for puts and putc and printf.
4580 * data/yacc.c: Likewise.
4581 * lib/bitset.c (bitset_print): Likewise.
4582 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
4583 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
4584 to printf.
4585 * lib/lbitset.c (debug_lbitset): Likewise.
4586 * src/closure.c (print_firsts, print_fderives): Likewise.
4587 * src/gram.c (grammar_dump): Likewise.
4588 * src/lalr.c (look_ahead_tokens_print): Likewise.
4589 * src/output.c (escaped_output): Likewise.
4590 (user_actions_output): Coalesce two printfs.
4591 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
4592 * src/reduce.c (reduce_print): Likewise.
4593 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4594 * src/system.h: Include unlocked-io.h rather than stdio.h.
4595
4596 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
4597 this confuses xgettext.
4598
4599 2005-10-02 Akim Demaille <akim@epita.fr>
4600
4601 * bootstrap (gnulib_modules): Add strverscmp.
4602 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
4603 * m4/.cvsignore: Add strverscmp.m4.
4604 * src/parse-gram.y (%require): New token, new rule.
4605 (version_check): New.
4606 * src/scan-gram.l (%require): Adjust.
4607 * tests/input.at (AT_REQUIRE): New.
4608 Use it.
4609 * doc/bison.texinfo (Require Decl): New.
4610 (Calc++ Parser): Use %require.
4611
4612 2005-10-02 Akim Demaille <akim@epita.fr>
4613
4614 * data/location.cc: New.
4615
4616 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
4617 Akim Demaille <akim@epita.fr>
4618
4619 Make sure -odir/foo.cc creates dir/location.hh etc.
4620 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
4621 (spec_file_prefix, spec_verbose_file, spec_graph_file)
4622 (spec_defines_file): Now const.
4623 (dir_prefix): New.
4624 (short_base_name): Remove.
4625 * src/files.c: Adjust.
4626 (dirname.h): Include.
4627 (base_name): Don't prototype it.
4628 (finput): Remove, duplicates gram_in.
4629 (full_base_name, short_base_name): Replace by...
4630 (all_but_ext, all_but_tab_ext): these.
4631 (compute_base_names): Rename as...
4632 (compute_file_name_parts): this.
4633 Update to compute the new variables, including dir_prefix.
4634 Adjust dependencies.
4635 * src/output.c (prepare): Output them.
4636 * src/reader.c: Adjust to use gram_in, not finput.
4637 * src/scan-skel.l (@dir_prefix@): New.
4638
4639 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4640
4641 * lib/subpipe.c: New function end_of_output_subpipe() added
4642 to allow support for non-posix systems. This is a no-op function
4643 for posix systems.
4644
4645 * lib/subpipe.h: New function end_of_output_subpipe() added
4646 to allow support for non-posix systems. This is a no-op function
4647 for posix systems.
4648
4649 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
4650 handle the lack of pipe/fork functionality on non-posix systems.
4651
4652 * djgpp/Makefile.maint: DJGPP specific file.
4653
4654 * djgpp/README.in: DJGPP specific file.
4655
4656 * djgpp/config.bat: DJGPP specific configuration file.
4657
4658 * djgpp/config.sed: DJGPP specific configuration file.
4659
4660 * djgpp/config.site: DJGPP specific configuration file.
4661
4662 * djgpp/config_h.sed: DJGPP specific configuration file.
4663
4664 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
4665
4666 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
4667
4668 2005-10-02 Akim Demaille <akim@epita.fr>
4669
4670 * data/location.cc: New, extract from...
4671 * data/lalr1.cc: here.
4672 (location.hh): Include it after the user prologue, in case the
4673 filename type is defined by the user.
4674 Forward declation location and position before the pre-prologue.
4675 (yyresult_): Rename as...
4676 (yyresult): this, it's a local variable, not an attribute.
4677 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
4678
4679 2005-10-01 Akim Demaille <akim@epita.fr>
4680
4681 * examples/extexi: Restore the #line generation.
4682
4683 2005-09-30 Akim Demaille <akim@epita.fr>,
4684 Alexandre Duret-Lutz <adl@gnu.org>
4685
4686 Move the token type and YYSTYPE in the parser class.
4687 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
4688 (parser::token): New, from the moved free definition of tokens.
4689 (parser::semantic_value): Now a full definition instead of an
4690 indirection to YYSTYPE.
4691 (b4_post_prologue): No longer included in the header file, but
4692 in the implementation file.
4693 * doc/bison.texi (C+ Language Interface): Update.
4694 * src/parse-gram.y: Support unary %define.
4695 * tests/actions.at: Define global_tokens_and_yystype for backward
4696 compatibility until we update the tests.
4697 * tests/calc.at: Idem.
4698 (first_line, first_column, last_line, last_column): Define for lalr1.cc
4699 to simplify the code.
4700
4701 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
4702
4703 Port to SunOS 4.1.4, which lacks strtoul and strerror.
4704 Ah, the good old days! Problem reported by Peter Klein.
4705 * bootstrap (gnulib_modules): Add strerror, strtoul.
4706 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
4707 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
4708
4709 2005-09-29 Akim Demaille <akim@epita.fr>
4710
4711 * data/c.m4 (b4_error_verbose_if): New.
4712 * data/lalr1.cc: Use it.
4713 (YYERROR_VERBOSE_IF): Remove.
4714 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
4715 parser members, replaced by...
4716 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
4717 local variables.
4718 (yysyntax_error_): Takes the state number as argument.
4719 (yyreduce_print_): Use the argument yyrule, not the former
4720 attribute yyn_.
4721
4722 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
4723
4724 * bootstrap (gnulib_modules): Add verify.
4725 * lib/.cvsignore: Add verify.h.
4726 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
4727 * src/system.h (verify): Remove.
4728 Include verify.h instead.
4729 * src/tables.c (tables_generate): Use new API for 'verify'.
4730
4731 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
4732
4733 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
4734 local variables whose names begin with 'yy'.
4735 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4736 Trivial changes from Joel E. Denny.
4737
4738 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
4739 it itself.
4740 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
4741 don't use alloca any more.
4742
4743 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
4744 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
4745 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
4746 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
4747 to match yacc.c, to test more hosts.
4748
4749 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
4750
4751 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
4752 doesn't affect behavior.
4753 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
4754 Solaris, AIX, MSC.
4755 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
4756 This works a bit better with glibc, if user code has already included
4757 stdlib.h.
4758 * doc/bison.texinfo (Bison Parser): Document that users can't
4759 arbitrarily use malloc and free for other purposes. Document
4760 that <alloca.h> and <malloc.h> might be included.
4761 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
4762 user must declare alloca.
4763
4764 * HACKING (release): Forwarn the Translation Project about
4765 stable releses.
4766
4767 2005-09-20 Akim Demaille <akim@epita.fr>
4768
4769 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
4770
4771 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
4772
4773 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
4774 (YYSTACK_ALLOC_MAXIMUM): Use it.
4775 (yysyntax_error): New function.
4776 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
4777 multiple syntax errors are reported, and alloca is being used.
4778 Instead, reallocate buffers twice as big each time, so that
4779 we waste at most half the allocated memory. Start with a small
4780 (128-byte) buffer that will suffice in most cases anyway.
4781 Use yysyntax_error to do most of the work.
4782
4783 * doc/bison.texinfo (Error Reporting, Table of Symbols):
4784 yynerrs is the number of errors reported, not the number of
4785 errors encountered.
4786
4787 * tests/glr-regression.at (Duplicated user destructor for lookahead):
4788 Mark it as expected to fail.
4789 Cast result of malloc; problem reported by twlevo@xs4all.nl.
4790 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
4791 Don't start user-code symbols with "yy", to avoid name space problems.
4792
4793 2005-09-19 Akim Demaille <akim@epita.fr>
4794
4795 Remove the traits, failed experiment.
4796 It never proved useful, and anyway because of the current
4797 definition, it was not possible to have several specialization of
4798 this traits, making it useless.
4799 * data/lalr1.cc (yy:traits): Remove.
4800 Inline its definitions in the parser class.
4801
4802 2005-09-19 Akim Demaille <akim@epita.fr>
4803
4804 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
4805 least Mac OSX with a /usr/local install of gettext.
4806
4807 2005-09-19 Akim Demaille <akim@epita.fr>
4808
4809 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
4810 and yytoken for similarity with the other skeletons.
4811
4812 2005-09-19 Akim Demaille <akim@epita.fr>
4813
4814 * NEWS, configure.ac: update version number to 2.1a.
4815
4816 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
4817
4818 * NEWS: Version 2.1.
4819
4820 * NEWS: Remove notice of yytname change, since it was never in an
4821 official release.
4822 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
4823 diagnostic.
4824 * src/output.c (prepare): Likewise.
4825 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
4826 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
4827 is not defined. This is an awful hack, but it's enough for now.
4828 All callers changed.
4829 * tests/glr-regression-at (make_value): Args are const pointers now,
4830 to avoid GCC warning.
4831 (Duplicated user destructor for lookahead): New test. Currently
4832 skipped. It fails on my host but I'm not sure it'll always fail.
4833
4834 2005-09-16 Akim Demaille <akim@epita.fr>
4835
4836 * src/symtab.h (struct symbol): Declare the printer and destructor
4837 as const, to avoid accidental calls to free.
4838 (symbol_destructor_set, symbol_printer_set): Adjust.
4839 * src/symtab.c: Adjust.
4840
4841 2005-09-16 Akim Demaille <akim@epita.fr>
4842
4843 * data/c.m4 (b4_token_enums): New.
4844 (b4_token_defines): Rename as...
4845 (b4_token_enums_defines): this.
4846 (b4_token_defines): New, output only the #defines.
4847 * data/yacc.c, data/glr.c: Adjust.
4848 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
4849 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
4850 as default values.
4851
4852 2005-09-16 Akim Demaille <akim@epita.fr>
4853
4854 * data/lalr1.cc (yylex_): Remove, inline its code.
4855 (yyreport_syntax_error_): Remove, replaced by...
4856 (yysyntax_error_): this which returns a string and leaves to the
4857 caller the call to the users' error function.
4858 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
4859 Move from members of the parser object...
4860 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
4861 to local variables of the parse function.
4862
4863 2005-09-16 Akim Demaille <akim@epita.fr>
4864
4865 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
4866 since it's in Bison's name space.
4867
4868 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
4869
4870 * data/glr.c (yyresolveValue): Add default case to pacify
4871 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
4872
4873 * NEWS: Document when yyparse started to return 2.
4874 * doc/bison.texinfo (Parser Function): Document when yyparse
4875 returns 2.
4876
4877 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
4878 (b4_filename_type): Renamed back from b4_file_name_type. All uses
4879 changed.
4880 (class position): file_name -> filename (reverting). All uses changed.
4881
4882 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
4883
4884 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
4885 do anything if $@ exists. This reverts part of the 2005-07-07
4886 patch.
4887
4888 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
4889
4890 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
4891 contains obsolete information and isn't worth distributing as a
4892 separate file anyway.
4893 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
4894 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
4895 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
4896 (yyparse): Abort if user code uses longjmp to throw an unexpected
4897 value.
4898
4899 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
4900
4901 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
4902 Suggested by twlevo@xs4all.nl.
4903
4904 * data/glr.c (YYCHK1): Do not assume YYE is in range.
4905 This avoids a diagnostic from gcc -Wswitch-enum.
4906 Problem reported by twlevo@xs4all.nl.
4907
4908 * doc/bison.texinfo: Don't use "filename", as per GNU coding
4909 standards. Use "file name" or "file" or "name", depending on
4910 the context.
4911 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
4912 not to hack/foo.tab.c.
4913 (Calc++ Top Level): 2nd arg of main is not const.
4914 * data/glr.c: b4_filename -> b4_file_name.
4915 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
4916 All uses changed.
4917 (class position): filename -> file_name. All uses changed.
4918 * data/yacc.c: b4_filename -> b4_file_name.
4919 * lib/bitset.h: filename -> file_name in local vars.
4920 * lib/bitset_stats.c: Likewise.
4921 * src/files.c: Likewise.
4922 * src/scan-skel.l ("@output ".*\n): Likewise.
4923 * src/files.c (file_name_split): Renamed from filename_split.
4924 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
4925
4926 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
4927
4928 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
4929 to accommodate latest gnulib.
4930
4931 * tests/glr-regression.at (Duplicate representation of merged trees):
4932 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
4933
4934 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
4935 needed.
4936
4937 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
4938
4939 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
4940 All uses changed. Invoke user destructor after an error during a
4941 split parse (trivial change from Joel E. Denny).
4942
4943 * tests/glr-regression.at
4944 (User destructor after an error during a split parse): New test case.
4945 Problem reported by Joel E. Denny in:
4946 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
4947
4948 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
4949
4950 * README-cvs: Give URLs for recommended tools.
4951 Mention Gzip version problem, and bootstrapping issues.
4952 Remove troubleshooting section, as it's somewhat obsolete.
4953
4954 * bootstrap (no_cache): New var, to accommodate different wget
4955 variants. Use it instead of '-C off'. Problem reported by
4956 twlevo@xs4all.nl.
4957
4958 * data/glr.c (yydestroyStackItem): New function.
4959 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
4960 debugging information. Problem reported by Joel E. Denny.
4961
4962 2005-08-25 Akim Demaille <akim@epita.fr>
4963
4964 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
4965
4966 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
4967
4968 * data/glr.c (yyrecoverSyntaxError, yyreturn):
4969 Don't invoke destructor on unresolved entries.
4970 * tests/glr-regression.at
4971 (User destructor for unresolved GLR semantic value): New test case.
4972 Problem reported by Joel E. Denny in:
4973 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
4974
4975 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
4976
4977 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
4978 Add strnlen.c.
4979 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
4980 lib-prefix.m4, po.m4.
4981
4982 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
4983 in yydestruct diagnostic, since it might not be an error.
4984 Problem reported by Joel Denny near end of
4985 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4986 * data/lalr1.cc (yyerturn): Likewise.
4987 * data/yacc.c (yyreturn): Likewise.
4988 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
4989
4990 * src/files.c: Remove obsolete FIXME comment.
4991
4992 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
4993 with the other templates, and to fix bogus run-on messages such
4994 as the one reported at the end of
4995 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4996 All callers changed to avoid the newline.
4997 (yyprocessOneStack): Output two lines rather than one, to accommodate
4998 the above change. This changes the debug output format slightly.
4999
5000 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
5001 reported by Joel E. Denny in
5002 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
5003 (trivial change).
5004 * tests/glr-regression.at (Duplicate representation of merged trees):
5005 New test, from Joel E. Denny in:
5006 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
5007 * THANKS: Add Joel E. Denny.
5008
5009 * configure.ac (AC_INIT): Bump to 2.0c.
5010
5011 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
5012
5013 * NEWS: Version 2.0b.
5014
5015 * Makefile.am (SUBDIRS): Put examples before tests, so that
5016 "make check" doesn't finish with "All 1 tests passed".
5017
5018 * tests/regression.at (Token definitions): Don't rely on
5019 AT_PARSER_CHECK for data that contains backslashes. It currently
5020 uses 'echo', and 'echo' isn't portable if its argument contains
5021 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
5022 that the byte '\0xff' is not printable in the C locale; it is,
5023 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
5024 not printable, so use '\0x81' to test.
5025
5026 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
5027 version of GCC, since the macro is used with non-GCC compilers.
5028
5029 Fix core dump reported by Pablo De Napoli in
5030 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
5031 * tests/regression.at (Invalid inputs with {}): New test.
5032 * src/parse-gram.y (token_name): Translate type before using
5033 it as an index.
5034
5035 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
5036 the user's name space. All uses changed to __attribute__
5037 ((__unused__)).
5038 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
5039 Add __attribute__ ((__noreturn__)).
5040
5041 * etc/clcommit: Remove. We weren't using it, and it failed
5042 "make maintainer-distcheck".
5043 * Makefile.maint: Merge from coreutils.
5044 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
5045 (syntax-check-rules): Change list of rules as described below.
5046 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
5047 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
5048 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
5049 (sc_trailing_space): New rules.
5050 (sc_xalloc_h_in_src): Remove.
5051 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
5052 (sc_space_tab, sc_error_exit_success, sc_changelog):
5053 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
5054 (makefile-check, po-check, author_mark_check):
5055 (makefile_path_separator_check, copyright-check):
5056 Use grep -n, to make it easier to find violations.
5057 Use CVS_LIST and CVS_LIST_EXCEPT.
5058 (header_regexp, h_re): Remove.
5059 (dd_c): New macro.
5060 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
5061 (my-distcheck): Use more-modern GCC flags.
5062 (signatures, %.asc): Remove.
5063 (rel-files, announcement): Remove signatures.
5064 Restore old updating code, even though we don't use it, so
5065 that we're the same as coreutils.
5066 (alpha, beta, major): Depend on news-date-check.
5067 Make the upload commands.
5068
5069 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
5070 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
5071 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
5072 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
5073 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
5074 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
5075 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
5076 * tests/sets.at: Likewise.
5077
5078 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
5079 we comment out the Autoconf version number.
5080 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
5081 it's error-prone and "make maintainer-distcheck" rejects it.
5082
5083 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
5084 Indent calls to "error" to pacify "make maintainer-distcheck",
5085 when the calls are not intended to be translated.
5086 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
5087
5088 * src/Makefile.am (DEFS): Use +=, to pacify
5089 "make maintainer-distcheck".
5090 (bison_SOURCES): Add scan-skel.h.
5091 (sc_tight_scope): New rule, from coreutils.
5092
5093 * src/files.c (src_extension, header_extension):
5094 Now static, not extern.
5095 * src/getargs.c (short_options): Likewise.
5096 * src/muscle_tab.c (muscle_table): Likewise.
5097 * src/parse-gram.y (current_class, current_type, current_prec):
5098 Likewise.
5099 * src/reader.c (grammar_end, previous_rule_end): Likewise.
5100 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
5101 * src/main.c (main): Cast bindtextdomain and textdomain calls to
5102 void, to avoid warning when NLS is disabled.
5103 * src/output.c: Include scan-skel.h.
5104 (scan_skel): Remove decl, since scan-skel.h does this.
5105 (output_skeleton):
5106 Indent calls to "error" to pacify "make maintainer-distcheck".
5107 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
5108 * src/reader.h (gram_end, gram_lineno): New decls to pacify
5109 "make maintainer-distcheck".
5110 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
5111 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
5112 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
5113 (skel_lex_destroy, scan_skel): Move these decls to...
5114 * src/scan-skel.h: New file.
5115 * src/uniqstr.c (uniqstr_assert):
5116 Indent calls to "error" to pacify "make maintainer-distcheck".
5117
5118 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
5119 not @VAR@.
5120
5121 * tests/torture.at: Revamp to avoid misuse of atoi that
5122 "make maintainer-distcheck" complained about.
5123
5124 * examples/extexi (message): Don't print a message more than once,
5125 and omit line-number decoration that makes Emacs compile think
5126 that informative messages are worth worrying about.
5127
5128 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
5129
5130 * configure.ac: Update version number.
5131
5132 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
5133 accidentally.
5134 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
5135 autogenerated by the maintainer.
5136 * examples/calc++/.cvsignore: Add *.yy.
5137
5138 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
5139 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5140 * lib/bitsetv.c (bitsetv_alloc): Likewise.
5141
5142 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
5143
5144 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
5145 from maintainer-distcheck about casting the argument of 'free'.
5146
5147 * NEWS: Mention recent yytname changes.
5148 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
5149
5150 * bootstrap: For translations that have not yet been upgraded to
5151 the new runtime-po domain, prime the pump by extracting the
5152 relevant strings from the obsolete translations. This code can be
5153 removed once the bison-runtime domain has been translated by each
5154 team.
5155
5156 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
5157 now that token names are already quoted.
5158
5159 Fix problem reported by Anthony Heading.
5160 * data/glr.c (YYTOKEN_TABLE): New macro.
5161 (yytname): Define if YYTOKEN_TABLE.
5162 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
5163 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
5164 (YYERROR_VERBOSE): Define the same way the other skeletons do.
5165 * src/output.c (prepare_symbols): Output token_table_flag.
5166
5167 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
5168
5169 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
5170 again if the first call fails.
5171
5172 * data/glr.c (yytnamerr): New function.
5173 (yyreportSyntaxError): Use it to dequote most string literals.
5174 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
5175 with other skeletons. All uses changed.
5176 (yytnameerr_): New function.
5177 (yyreport_syntax_error): Use it to dequote most string literals.
5178 * data/yacc.c (yytnamerr): New function.
5179 (yyerrlab): Use it to decode most string literals.
5180 * doc/bison.texinfo (Decl Summary, Calling Convention):
5181 Clarify quoting convention of yytname.
5182 * src/output.c (prepare_symbols): Quote all names. This undoes
5183 the 2005-04-17 change, which is now accomplished (mostly) via
5184 changes in the parsers as described above.
5185 * tests/regression.at (Token definitions, Web2c Actions):
5186 Undo most 2005-04-17 change here, too.
5187
5188 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
5189
5190 Fix more problems reported by twlevo@xs4all.nl.
5191 * tests/cxx-type.at: Don't pipe output of ./types through sed to
5192 remove trailing spaces. This loses the exit status of ./types,
5193 and isn't needed since ./types shouldn't be emitting trailing
5194 spaces.
5195 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
5196 as the stack isn't valid in that case.
5197
5198 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5199 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5200 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5201 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
5202 is used.
5203 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
5204 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5205 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5206 Likewise.
5207
5208 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
5209 overly-picky compilers that reject 'char *foo = "bar";'.
5210
5211 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
5212 to FILE * parameter, not to stderr. This fixes a typo introduced
5213 in the 2005-07-12 change.
5214
5215 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
5216 warnings from GCC 4.
5217
5218 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
5219 (yyglrShiftDefer, yysplitStack):
5220 Remove unused parameters b4_pure_formals. All uses changed.
5221 (yyglrShift): Remove unused parameters b4_user_formals.
5222 All uses changed.
5223 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
5224
5225 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
5226
5227 Destructor cleanups and regularization among the three skeletons.
5228 * NEWS: Document the behavior changes.
5229 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
5230 stack before failing, as the cleanup code will do it for us now.
5231 * data/lalr1.cc (yyerrlab): Likewise.
5232 * data/glr.c (yyparse): Pop everything off the stack before
5233 freeing it, so that destructors get called properly.
5234 * data/lalr1.cc (yyreturn): Likewise.
5235 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
5236 This is more consistent.
5237 * doc/bison.texinfo (Destructor Decl): Mention more reasons
5238 why destructors might be called. 1.875 -> 2.1.
5239 (Destructor Decl, Decl Summary, Table of Symbols):
5240 Some English-language cleanups for %destructor.
5241 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5242 Add output line for destructor of start symbol.
5243 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
5244 because of that same extra output line.
5245
5246 * NEWS: Document minor wording changes in diagnostics of
5247 Bison-generated parsers.
5248 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
5249 Remove unused formals. All uses changed.
5250 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
5251 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
5252 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
5253 Rename yyoverflowab to yyexhaustedlab.
5254 When memory exhaustion occurs during syntax-error reporting,
5255 report it separately rather than in a single diagnostic; this
5256 eases translation.
5257 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
5258 (Memory Exhausted): Renamed from Parser Stack Overflow.
5259 Revamp wording slightly to prefer "memory exhaustion".
5260 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
5261
5262 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
5263
5264 Add i18n support to the GLR skeleton. Partially fix the C++
5265 skeleton; a C++ expert needs to finish this. Remove debugging
5266 msgids; there's little point to having them translated, since they
5267 can be understood only by someone who can read the
5268 (English-language) source code.
5269
5270 Generate runtime-po/bison-runtime.pot automatically, so that we
5271 don't have to worry about garbage getting in that file. We'll
5272 make sure after the next official release that old msgids don't
5273 get lost. See
5274 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
5275
5276 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
5277 Now auto-generated.
5278 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
5279 Fix typos in explanations of the runtime file.
5280 * bootstrap: Change gettext keyword from YYI18N to YY_.
5281 Use standard Makefile.in.in in runtime-po, since we'll arrange
5282 for backward-compatible bison-runtime.po files in a different way.
5283 * data/glr.c (YY_): New macro, from yacc.c.
5284 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
5285 Translate messages intended for users.
5286 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
5287 the wording in the other skeletons. We don't know that the memory
5288 is virtual.
5289 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
5290 Use same method that yacc.c uses.
5291 Don't translate debugging messages.
5292 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
5293 it doesn't work (yet), and requires C++ expertise to fix.
5294 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
5295 Move defn to a more logical place, to be consistent with other
5296 skeletons.
5297 Don't translate debugging messages.
5298 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
5299 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
5300 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
5301 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
5302
5303 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
5304 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
5305 void, not int.
5306 * tests/glr-regression.at (Badly Collapsed GLR States):
5307 Likewise.
5308 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5309 yylex should return 0 at EOF rather than aborting.
5310
5311 Improve tests for stack overflow in GLR parser.
5312 Problem reported by twlevo@xs4all.nl.
5313 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
5314 All uses removed.
5315 (yyStackOverflow): Just longjmp, but with value 2 so that caller
5316 can handle the problem.
5317 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
5318 (yyparse): New local variable yyresult to record the result.
5319 Use result of setjmp to set it, rather than storing itinto
5320 struct.
5321 (yyDone): Remove label.
5322 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
5323 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
5324 if YYABORT is used).
5325 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
5326 yyparse status; put status > 1 into diagnostic.
5327 Check that status==2 works.
5328 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
5329 Use exit status 3 for failure to open (which shouldn't happen).
5330
5331 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
5332
5333 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
5334 1 on syntax error; just let yyparse do its thing.
5335 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
5336 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
5337 (Exploding the Stack Size with Alloca):
5338 (Exploding the Stack Size with Malloc):
5339 Expect exit status 2, not 1, since the parser is supposed to blow
5340 its stack. Problem reported by twlevo@xs4all.nl.
5341
5342 * data/glr.c (yyparse): Don't assume that the initial calls
5343 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
5344 Print a stack-overflow message and fail instead.
5345 Initialize the line-number information before creating the stack,
5346 so that the stack-overflow message can report line zero safely.
5347
5348 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
5349
5350 Fix problems reported by twlevo@xs4all.nl.
5351 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
5352 (yyuserMerge): Provide a default case if b4_mergers is empty.
5353 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
5354 * tests/glr-regression.at
5355 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5356 Add casts to pacify C++ compilers.
5357 * tests/glr-regression.at (Improper merging of GLR delayed action
5358 sets): Declare yylex before using it.
5359 * tests/Makefile.am (maintainer-check-g++): Fix a stray
5360 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
5361 test for valgrind; valgrind is independent of g++.
5362 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
5363 for compatibility with POSIX 1003.1-2001 (if running coreutils).
5364 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
5365 Use a destructor, so that we can expand the stack. Change
5366 YYSTYPE to char * so that we can free it. Cast result of malloc.
5367
5368 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5369
5370 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
5371 a valgrind failure. Problem reported by twlevo@xs4all.nl.
5372
5373 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
5374
5375 * PACKAGING: New file, suggested by Bruno Haible and taken from
5376 similar wording in gettext's PACKAGING file.
5377 * NEWS: Mention PACKAGING.
5378 * Makefile.am (EXTRA_DIST): Add PACKAGING.
5379
5380 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
5381
5382 * NEWS: Document recent i18n improvements.
5383 * bootstrap: Get runtime translations into runtime-po.
5384 Create runtime-po files automatically, if possible.
5385 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
5386 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
5387 does not infringe on the user's name space.
5388 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
5389 * doc/bison.texinfo (Internationalization): Revamp the English
5390 and Texinfo syntax a bit, to try to make it clearer.
5391 (Bison Options, Option Cross Key): Mention --print-localedir.
5392 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
5393 YYENABLE_NLS. Quote a bit more.
5394 * runtime-po/.cvsignore: New file.
5395 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
5396 * runtime-po/Rules-quot: Remove; now created by bootstrap.
5397 * runtime-po/quot.sed: Likewise.
5398 * runtime-po/boldquot.sed: Likewise.
5399 * runtime-po/en@quot.header: Likewise.
5400 * runtime-po/en@boldquot.header: Likewise.
5401 * runtime-po/insert-header.sin: Likewise.
5402 * runtime-po/remove-potcdate.sin: Likewise.
5403 * runtime-po/Makevars: Likewise.
5404 * runtime-po/LINGUAS: Likewise.
5405 * runtime-po/de.po: Likewise; we will rely on the translation project
5406 to maintain this, so "bootstrap" should get it.
5407 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
5408 its value.
5409 * src/main.c (main): Bind the bison-runtime domain, too.
5410
5411 2005-07-12 Bruno Haible <bruno@clisp.org>
5412
5413 * data/yacc.c: Include <libintl.h> when NLS is enabled.
5414 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
5415 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
5416 * runtime-po: New directory.
5417 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
5418 $(DOMAIN).pot-update rule, so that old messages are never dropped.
5419 * runtime-po/Rules-quot: New file, copied from po/.
5420 * runtime-po/quot.sed: Likewise.
5421 * runtime-po/boldquot.sed: Likewise.
5422 * runtime-po/en@quot.header: Likewise.
5423 * runtime-po/en@boldquot.header: Likewise.
5424 * runtime-po/insert-header.sin: Likewise.
5425 * runtime-po/remove-potcdate.sin: Likewise.
5426 * runtime-po/Makevars: New file.
5427 * runtime-po/POTFILES.in: New file.
5428 * runtime-po/LINGUAS: New file.
5429 * runtime-po/bison-runtime.pot: New file.
5430 * runtime-po/de.po: New file.
5431 * m4/bison.m4: New file.
5432 * Makefile.am (SUBDIRS): Add runtime-po.
5433 (aclocaldir, aclocal_DATA): New variables.
5434 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
5435 Define aclocaldir.
5436 * src/getargs.c (usage): Document --print-localedir option.
5437 (PRINT_LOCALEDIR_OPTION): New enum item.
5438 (long_options): Add --print-localedir option.
5439 (getargs): Handle --print-localedir option.
5440 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
5441 (Internationalization): New section.
5442
5443 2005-07-12 Akim Demaille <akim@epita.fr>
5444
5445 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
5446 for consistency with the rest of the code.
5447 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
5448 Add separators.
5449
5450 2005-07-12 Akim Demaille <akim@epita.fr>
5451
5452 * src/parse-gram.y: Use %printer instead of YYPRINT.
5453
5454 2005-07-12 Akim Demaille <akim@epita.fr>
5455
5456 * src/symtab.h, src/symtab.c (symbol_print): New.
5457 * src/symlist.h, src/symlist.c (symbol_list_print): New.
5458 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
5459
5460 2005-07-12 Akim Demaille <akim@epita.fr>
5461
5462 * data/glr.c (b4_syncline): Fix (swap) the definitions of
5463 b4_at_dollar and b4_dollar_dollar.
5464
5465 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
5466
5467 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
5468 and Pennello's paper.
5469
5470 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
5471
5472 * data/yacc.c (yyparse): Undo previous patch. Instead,
5473 set yylsp[0] and yyvsp[0] only if the initial action
5474 sets yylloc and yylval, respectively.
5475
5476 * data/yacc.c (yyparse): In the initial action, set
5477 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
5478 This avoids the use of undefined variables if the initial
5479 action does not set yylloc and/or yylval.
5480
5481 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5482
5483 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
5484 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
5485 Remove from CVS. These files are automatically generated.
5486 * examples/extexi: Clarify that this file is now part of Bison,
5487 not GNU M4, and that it works with any POSIX-compatible Awk.
5488 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
5489 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
5490 so that we also get calc++-parser.yy. Geneate it.
5491 Use $(AWK), not gawk, since any conforming Awk will do.
5492 Put comment before action, since older 'make' can't handle comment
5493 in action.
5494 $(BUILT_SOURCES): List all built sources, not just some of them.
5495 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
5496 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
5497 $($(calc_sources_generated)): Remove unnecessary test for existence
5498 of target. (This had a shell syntax error anyway; a stray "x".)
5499 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
5500 calc++-parser.yy.
5501 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
5502
5503 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
5504 implied by the other modules.
5505
5506 2005-07-06 Akim Demaille <akim@epita.fr>
5507
5508 Bind examples/calc++ to the package.
5509 * examples/calc++/Makefile: Remove, replaced by...
5510 * examples/calc++/Makefile.am: ... this new file.
5511 * examples/calc++/test: Remove input.
5512 * examples/calc++/compile: Remove.
5513 * examples/Makefile.am: New.
5514 * configure.ac, Makefile.am: Adjust.
5515 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
5516
5517 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
5518
5519 * data/glr.c (yyFail): Drastically simplify; since the format argument
5520 never had any % directives, we can simply pass it to yyerror.
5521 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
5522 be modified later, as that is the usual style in glr.c.
5523 Problems reported by Paul Hilfinger.
5524
5525 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
5526 and size overflow errors.
5527 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
5528 in case the user prolog sets feature-test macros like _GNU_SOURCE.
5529 (YYSIZEMAX): New macro.
5530 (yystpcpy): New function, taken from yacc.c.
5531 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
5532 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
5533 so that we don't have to maintain their signatures.
5534 (yyFail): Check for buffer overflow, by using vsnprintf rather
5535 than vsprintf. Allocate a bigger buffer if possible.
5536 Report an error if buffer allocation fails.
5537 (yyStackOverflow): New function.
5538 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
5539 the initialization was successful. It might fail if storage was
5540 exhausted.
5541 (yyexpandGLRStack): Add more checks for storage allocation failure.
5542 Use yyStackOverflow to report failures.
5543 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
5544 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
5545 Don't assume stack number fits in int.
5546 (yysplitStack): Check for storage allocation failure.
5547 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
5548 can print diagnostics on storage allocation failure. All callers
5549 changed.
5550 (yyresolveValue): Use yybool for boolean.
5551 (yyreportSyntaxError): Check for size-calculation overflow.
5552 This code is taken from yacc.c.
5553 (yyparse): Check for storage allocation errors when allocating
5554 the initial stack.
5555
5556 2005-07-05 Akim Demaille <akim@epita.fr>
5557
5558 Extract calc++ from the documentation.
5559 * doc/bison.texinfo (Calc++): Add the extraction marks.
5560 * examples/extexi: New, from the aborted GNU Programming 2E.
5561 Separate the different paragraph of a file with empty lines.
5562 * examples/Makefile: Use it to extract the whole calc++ example.
5563
5564 2005-06-24 Akim Demaille <akim@epita.fr>
5565
5566 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
5567 class typedefs.
5568
5569 2005-06-22 Akim Demaille <akim@epita.fr>
5570
5571 * doc/bison.texinfo (C++ Language Interface): First stab.
5572 (C++ Parsers): Remove.
5573
5574 2005-06-22 Akim Demaille <akim@epita.fr>
5575
5576 * data/lalr1.cc (yylex_): Honor %lex-param.
5577
5578 2005-06-22 Akim Demaille <akim@epita.fr>
5579
5580 Start a set of simple examples.
5581 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
5582 * examples/calc++/calc++-driver.hh,
5583 * examples/calc++/calc++-parser.yy,
5584 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
5585 * examples/calc++/compile, examples/calc++/test: New.
5586
5587 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
5588
5589 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
5590 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
5591 which stems from the 2005-05-27 patch.
5592
5593 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5594
5595 * data/glr.c: Modify treatment of unused parameters to permit use
5596 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
5597
5598 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
5599
5600 Fix infringement on user name space reported by Janos Zoltan Szabo.
5601 * data/yacc.c (yyparse): strlen -> yystrlen.
5602
5603 2005-05-30 Akim Demaille <akim@epita.fr>
5604
5605 * data/lalr1.cc (_): New.
5606 Translate the various messages.
5607
5608 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
5609
5610 Fix infringement on user name space reported by Bruno Haible.
5611 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
5612 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
5613 the user's name space.
5614 (alloca): Include <stdlib.h> to get it, if it's not built in.
5615 (YYMALLOC, YYFREE): Define only if needed.
5616 (malloc, free): Declare, but only if needed, as this infringes on
5617 the user name space.
5618
5619 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
5620
5621 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
5622 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
5623 with %d format.
5624 * lib/ebitset.c (min, max): Undef before defining.
5625 * lib/vbitset.c (min, max): Likewise.
5626 * lib/subpipe.c (create_subpipe): Save local variables in case
5627 vfork clobbers them.
5628
5629 2005-05-24 Bruno Haible <bruno@clisp.org>
5630
5631 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
5632 error message syntax used by gcc-4.0.
5633
5634 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
5635
5636 * README: Mention m4 1.4.3. Remove obsolete advice about
5637 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
5638
5639 * bootstrap: Remove workaround for problem I encountered with
5640 gettext 0.14.1; it seems to be fixed now.
5641
5642 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
5643
5644 * NEWS: Version 2.0a.
5645
5646 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
5647 the previous change.
5648
5649 Various maintainer cleanups.
5650 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
5651 conftest*, for benefit of CVS commands run at the same time as
5652 "configure". Add build-aux, since "bootstrap" now creates it and
5653 its subfiles.
5654 * Makefile.cfg (move_if_change): Remove.
5655 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
5656 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
5657 (po_repo, do-po-update, po-update, wget_files, get-targets):
5658 (config.guess-url_prefix, config.sub-url_prefix):
5659 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
5660 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
5661 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
5662 Remove.
5663 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
5664 this is now the recommended name.
5665 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
5666 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
5667 ylwrap. These files now go into build-aux.
5668 * config/move-if-change: Remove.
5669 * config/prev-version.txt: Bump from 1.75 to 2.0.
5670
5671 * bootstrap: Add stdio-safer, unistd-safer modules.
5672 Remove m4/glibc2.m4 (introduced by latest gnulib, but
5673 we don't need it).
5674 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
5675 fopen-safer.c, stdio-safer.h, unistd-safer.h.
5676 * lib/subpipe.c: Include "unistd-safer.h".
5677 (create_subpipe): Make sure all the newly-created
5678 file descriptors are > 2, so that diagnostics don't
5679 get sent down them (which might cause Bison to hang, in theory).
5680 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
5681 * src/files.c (xfopen): Use fopen_safer, not fopen.
5682
5683 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
5684 yesterday's yacc.c fix.
5685
5686 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
5687
5688 * data/glr.c, data/lalr1.cc: Update copyright date.
5689
5690 Fix a destructor bug reported by Wolfgang Spraul in
5691 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
5692 * data/yacc.c (yyabortlab): Don't call destructor, and
5693 don't set yychar to EMPTY.
5694 (yyoverflowlab): Don't call destructor.
5695 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
5696 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
5697 since we no longer output the message "discarding lookahead token
5698 end of input ()".
5699
5700 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5701
5702 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
5703 fix a small glitch in debugging output.
5704 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
5705 after YY_SYMBOL_PRINT where needed.
5706
5707 (struct yyGLRState): Add some comments.
5708 (struct yySemanticOption): Add some comments.
5709 (union yyGLRStackItem): Add comment.
5710
5711 (yymergeOptionSets): Correct this to properly perform the union,
5712 avoiding infinite reported by Michael Rosien.
5713 Update comment.
5714
5715 * tests/glr-regression.at: Add test for GLR merging error reported
5716 by M. Rosien.
5717
5718 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
5719
5720 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
5721 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
5722 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
5723 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
5724 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
5725 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
5726 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
5727 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
5728 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
5729 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
5730 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
5731 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
5732 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
5733 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
5734 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
5735 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
5736 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
5737 src/derives.h, src/files.c, src/files.h, src/getargs.c,
5738 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
5739 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
5740 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
5741 src/output.h, src/parse-gram.c, src/parse-gram.h,
5742 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
5743 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
5744 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
5745 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
5746 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
5747 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
5748 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
5749 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
5750 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
5751 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
5752 tests/reduce.at, tests/regression.at, tests/sets.at,
5753 tests/synclines.at, tests/testsuite.at, tests/torture.at:
5754 Update FSF postal mail address.
5755
5756 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
5757
5758 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
5759 Problem reported by Ralf Menzel.
5760
5761 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
5762
5763 * tests/actions.at: Test that stack overflow invokes destructors.
5764 From Marcus Holland-Moritz.
5765 * data/yacc.c (yyerrlab): Move the code that destroys the stack
5766 from here....
5767 (yyreturn): to here. That way, destructors are called properly
5768 even if the stack overflows, or the user calls YYACCEPT or
5769 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
5770 (yyoverflowlab): Destroy the lookahead.
5771
5772 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
5773
5774 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
5775
5776 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
5777
5778 * NEWS: Bison-generated C parsers no longer quote literal strings
5779 associated with tokens.
5780 * src/output.c (prepare_symbols): Don't escape strings,
5781 since users don't want to see C escapes.
5782 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
5783 in diagnostics.
5784 * tests/input.at (Torturing the Scanner): Likewise.
5785 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
5786
5787 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
5788
5789 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
5790 the data size is known to be too small and we can't increase it.
5791 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
5792
5793 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
5794
5795 * src/parse-gram.y: Include quotearg.h.
5796 (string_as_id): Quote $1 before using it as a key, since the
5797 lexer no longer quotes it for us.
5798 (string_content): Don't strip quotes, since lexer no longer
5799 quotes it for us.
5800 * src/scan-gram.l: Include quotearg.h.
5801 ("\""): Omit quote.
5802 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
5803 a key, since the rest of the lexer doesn't quote it.
5804 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
5805 * tests/regression.at (Token definitions): Check for backslashes
5806 in token strings.
5807
5808 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
5809 (YYSIZE_T): Define to unsigned long int when using an older compiler.
5810 (yyparse): Revamp code to generate long syntax error message, to
5811 make it easier to translate, and to avoid problems with arithmetic
5812 overflow. Change "virtual memory" to "memory" in diagnostic, since
5813 we don't know whether the memory is virtual.
5814
5815 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
5816
5817 * NEWS: Bison-generated C parsers now use the _ macro to
5818 translate strings.
5819 * data/yacc.c (_) [!defined _]: New macro.
5820 All English strings wrapped inside this macro.
5821 * doc/bison.texinfo (Bison Parser): Document _.
5822 * po/POTFILES.in: Include src/parse-gram.c, since it now
5823 includes translateable strings that parse-gram.y doesn't.
5824
5825 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
5826
5827 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
5828 reverting the 2004-10-11 change to this function.
5829 (symbol_check_alias_consistency): Don't call symbol_type_set
5830 if the type name is already correct.
5831 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
5832
5833 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
5834
5835 * tests/regression.at (Token definitions): Don't use a token named
5836 c, as that generates a "#define c ..." that runs afoul of buggy
5837 stdlib.h that uses the identifier c as a member of struct
5838 drand48_data. Problem reported by Horst Wente.
5839
5840 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
5841
5842 * bootstrap: Change translation URL from
5843 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
5844 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
5845 redirection glitches. Problem reported by twlevo@xs4all.nl.
5846
5847 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
5848
5849 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
5850 after operands; POSIX says this isn't portable for the c99 command.
5851
5852 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
5853
5854 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
5855 immediately if a data overrun has occurred; this may help us track
5856 down what may be a spurious failure on MacOS.
5857
5858 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
5859
5860 Respond to problems reported by twlevo@xs4all.nl.
5861
5862 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
5863
5864 * src/vcg.h: Comment fix.
5865 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
5866 (G_CMAX): Change to -1 instead of INT_MAX.
5867
5868 * data/yacc.c (yyparse): Omit spaces before #line.
5869
5870 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
5871
5872 * src/tables.c (state_number_to_vector_number): Put it inside an
5873 "#if 0", since it's not currently used. Problem reported by
5874 Roland McGrath.
5875
5876 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
5877
5878 * src/output.c (escaped_output): Renamed from
5879 escaped_file_name_output, since we now use it for symbol tags as
5880 well. All uses changed.
5881 (symbol_destructors_output, symbol_printers_output):
5882 Escape symbol tags too.
5883 Problem reported by Matyas Forstner in
5884 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
5885
5886 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
5887 not needed.
5888 * src/output.c (user_actions_output, token_definitions_output,
5889 symbol_destructors_output, symbol_printers_output): Likewise.
5890 * src/reader.c (prologue_augment): Likewise.
5891 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
5892
5893 * src/vcg.c (output_edge): Don't quote linestyle arg.
5894 Problem reported by twlevo@xs4all.nl.
5895
5896 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
5897
5898 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
5899 example, reported by Derek M Jones. Also, make the example even
5900 more outrageous, to better illustrate how bad the problem is.
5901
5902 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
5903
5904 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
5905 putsym. Typo reported by Sebastian Piping.
5906
5907 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
5908
5909 * doc/bison.texinfo (Language and Grammar): some -> same
5910 (Epilogue): int he -> in the
5911 Typos reported by Sebastian Piping via Justin Pence.
5912
5913 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
5914
5915 * tests/glr-regression.at (Improper handling of embedded actions
5916 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
5917 embedded actions and $-N in GLR parsers", work around an Autoconf bug
5918 with dollar signs in test names.
5919 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
5920 for a similar reason.
5921
5922 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
5923
5924 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
5925 wants to redefine G_VIEW.
5926
5927 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
5928
5929 * src/vcg.c (get_view_str): Remove case for normal_view.
5930 Problem reported by twlevo@xs4all.nl.
5931
5932 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
5933
5934 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
5935 Problem reported by twlevo@xs4all.nl.
5936
5937 * doc/bison.texinfo: Change @dircategory from "GNU programming
5938 tools" to "Software development". Requested by Richard Stallman
5939 via Karl Berry.
5940
5941 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
5942
5943 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
5944 Problem reported by twlevo@xs4all.nl.
5945
5946 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
5947
5948 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
5949 keyword; it's not needed with modern compilers, and it doesn't
5950 affect correctness with older compilers. Suggested by
5951 twlevo@xs4all.nl.
5952
5953 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
5954
5955 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
5956 gcc -Wswitch-default.
5957 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
5958 * data/yacc.c (yyparse): Likewise.
5959
5960 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
5961
5962 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
5963 already. Let config.h define any nonstandard values.
5964
5965 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
5966
5967 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
5968 for the benefit of slower hosts. Problem reported by
5969 Nelson H. F. Beebe.
5970
5971 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
5972
5973 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
5974 being defined and not used.
5975 * data/lalr1.cc (yyparse): Likewise.
5976 Use "if (false)" rather than "if (0)".
5977
5978 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
5979
5980 * TODO: Mention that we should allow NUL bytes in tokens.
5981
5982 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
5983
5984 * src/scan-skel.l (<<EOF>>): Don't close standard output.
5985 Problem reported by Hans Aberg.
5986
5987 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
5988
5989 * src/getargs.c (version): Happy new year; update overall
5990 program copyright date from 2004 to 2005.
5991
5992 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
5993 Problem reported by Hans Aberg.
5994 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
5995 (Output file names.): Add a test for the case when standard output
5996 is closed.
5997
5998 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
5999
6000 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
6001 to fix an oversight in the Bison 2.0 manual.
6002
6003 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
6004
6005 * NEWS: Version 2.0. Reformat the existing news items since
6006 1.875, so that related items are grouped together.
6007 * configure.ac (AC_INIT): Bump version to 2.0.
6008 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
6009
6010 * tests/torture.at (Exploding the Stack Size with Alloca): Set
6011 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
6012 otherwise, we're not testing alloca. Unfortunately there's no
6013 simple way to consult HAVE_ALLOCA here.
6014
6015 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
6016 for yymsg, too.
6017
6018 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
6019 hand. This avoids a warning about comparing int to size_t when
6020 GCC warnings are enabled.
6021
6022 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
6023
6024 * NEWS: Bison-generated parsers no longer default to using the
6025 alloca function (when available) to extend the parser stack, due
6026 to widespread problems in unchecked stack-overflow detection.
6027 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
6028 responsibility to set it to a positive value. This lets the user
6029 specify a value that is not a preprocessor constant.
6030 * data/yacc.c (YYMAXDEPTH): Likewise.
6031 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
6032 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
6033 to be a compile-time constant. However, explain the constraints on it.
6034 Also, explain the constraints on YYINITDEPTH.
6035 (Table of Symbols): Explain that alloca is no longer the default.
6036 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
6037 to 1.
6038
6039 * doc/bison.texinfo (Location Default Action): Mention that n must
6040 be zero when k is zero. Suggested by Frank Heckenbach.
6041
6042 2004-12-22 Akim Demaille <akim@epita.fr>
6043
6044 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
6045 (parser::state_type, parser::semantic_type, parser::location_type):
6046 Private, not public.
6047 (parser::parse): Return ints, not bool.
6048 Returning a bool introduces a problem: 0 corresponds to false, and
6049 it seems weird to return false on success. Returning true changes
6050 the conventions for yyparse.
6051 Alternatively we could return void and send an exception.
6052 There is no clear consensus (yet?).
6053 (state_stack, semantic_stack, location_stack): Rename as...
6054 (state_stack_type, semantic_stack_type, location_stack_type): these.
6055 Private, not public.
6056 * tests/c++.at: New.
6057 * tests/testsuite.at, tests/Makefile.am: Adjust.
6058
6059 2004-12-21 Akim Demaille <akim@epita.fr>
6060
6061 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
6062
6063 2004-12-21 Akim Demaille <akim@epita.fr>
6064
6065 Don't impose std::string for filenames.
6066
6067 * data/lalr1.cc (b4_filename_type): New.
6068 (position::filename): Use it.
6069 (parser.hh): Move the inclusion of stack.hh and location.hh below
6070 the user code, so that needed headers for the filename type can be
6071 included first.
6072 Forward declare them before the user code.
6073 * tests/Makefile.am (check-local, installcheck-local): Pass
6074 TESTSUITEFLAGS to the TESTSUITE.
6075
6076 2004-12-20 Akim Demaille <akim@epita.fr>
6077
6078 Use more STL like names: my_class instead of MyClass.
6079
6080 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
6081 (SemanticStack, SemanticType, StateStack, StateType)
6082 (TokenNumberType, Stack, Slice, Traits, Parser::location)
6083 (Parser::value): Rename as...
6084 (location_stack, location_type, rhs_number_type, semantic_stack)
6085 (semantic_type, state_stack, state_type, token_number_type, stack)
6086 (slice, traits, parser::yylloc, parser::yylval): these.
6087
6088 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
6089
6090 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
6091
6092 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
6093 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6094
6095 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
6096
6097 Remove uses of 'short int' and 'unsigned short int'. This raises
6098 some arbitrary limits. It uses more memory but nowadays that's
6099 not much of an issue.
6100
6101 This change does not affect the generated parsers; that's a different
6102 task, as some users will want to conserve memory there.
6103
6104 Ideally we should use size_t to represent all object counts, and
6105 something like ptrdiff_t to represent signed differences of object
6106 counts; but that will require more code-cleanup than I have the
6107 time to do right now.
6108
6109 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
6110 Use size_t, not int or short int, to count objects.
6111 * src/closure.c (nritemset, closure): Likewise.
6112 * src/closure.h (nritemset, closure): Likewise.
6113 * src/nullable.c (nullable_compute): Likewise.
6114 * src/print.c (print_core): Likewise.
6115 * src/print_graph.c (print_core): Likewise.
6116 * src/state.c (state_compare, state_hash): Likewise.
6117 * src/state.h (struct state): Likewise.
6118 * src/tables.c (default_goto, goto_actions): Likewise.
6119
6120 * src/gram.h (rule_number, rule): Use int, not short int.
6121 * src/output.c (prepare_rules): Likewise.
6122 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
6123 errs, reductions): Likewise.
6124 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
6125 Likewise.
6126 * src/tables.c (vector_number, tally, action_number,
6127 ACTION_NUMBER_MINIMUM): Likewise.
6128 * src/output.c (muscle_insert_short_int_table): Remove.
6129
6130 2004-12-17 Akim Demaille <akim@epita.fr>
6131
6132 * data/lalr1.cc: Extensive Doxygenation.
6133 (error_): Rename as...
6134 (error): this, since it is visible to the user.
6135 Adjust callers.
6136 (Parser::message): Now an automatic variable from...
6137 (Parser::yyreport_syntax_error_): here.
6138 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
6139 Parser::error.
6140 * tests/input.at: Escape $.
6141
6142 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
6143
6144 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
6145 Parenthesize rhs to avoid obscure problems with mistakes like
6146 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
6147 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6148 b4_rhs_location): Likewise.
6149 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6150 b4_rhs_location): Likewise.
6151
6152 2004-12-16 Akim Demaille <akim@epita.fr>
6153
6154 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
6155 yacc.c: be sure to stay within yycheck_.
6156 * tests/actions.at: Re-enable C++ tests.
6157
6158 2004-12-16 Akim Demaille <akim@epita.fr>
6159
6160 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
6161 real.
6162
6163 2004-12-16 Akim Demaille <akim@epita.fr>
6164
6165 Use #define to handle the %name-prefix.
6166
6167 * data/glr.c, data/yacc.c: Comment changes.
6168 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
6169 so that one can refer to yylex in the parser file, and have it
6170 renamed, as is the case with other skeletons.
6171
6172 2004-12-16 Akim Demaille <akim@epita.fr>
6173
6174 Move lalr1.cc internals into yy*.
6175
6176 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
6177 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
6178 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
6179 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
6180 (empty_, final_, terror_, errcode_, ntokens_)
6181 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
6182 (looka_, ilooka_, error_range_, nerrs_):
6183 Rename as...
6184 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
6185 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
6186 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
6187 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
6188 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
6189 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
6190 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
6191 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
6192 these.
6193
6194 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
6195
6196 Fix some problems reported by twlevo at xs4all.
6197 * src/symtab.c (symbol_new): Report an error if the input grammar
6198 contains too many symbols. This is better than calling abort() later.
6199 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
6200 (struct node, struct graph):
6201 Rename member expand to stretch. All uses changed.
6202 (struct graph): Remove member layoutalgorithm. All uses removed.
6203 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
6204 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
6205 All uses changed.
6206 (N_STRETCH): Rename from N_EXPAND. All uses changed.
6207
6208 2004-12-15 Akim Demaille <akim@epita.fr>
6209
6210 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
6211 Add more Doxygen comments.
6212 (symprint_, stack_print_, reduce_print_, destruct_, pop)
6213 (report_syntax_error_, translate_): Rename as...
6214 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
6215 (yypop_, yyreport_syntax_error_, yytranslate_): this.
6216
6217 2004-12-15 Akim Demaille <akim@epita.fr>
6218
6219 * data/lalr1.cc (lex_): Rename as...
6220 (yylex_): this.
6221 Move the trace here.
6222 Take the %name-prefix into account.
6223 Reported by Alexandre Duret-Lutz.
6224
6225 2004-12-15 Akim Demaille <akim@epita.fr>
6226
6227 Simplify the C++ parser constructor.
6228
6229 * data/lalr1.cc (debug_): Rename as...
6230 (yydebug_): so that the parser's internals are always in the yy*
6231 pseudo namespace.
6232 Adjust uses.
6233 (b4_parse_param_decl): Remove the leading comma as it is now only
6234 called as unique argument list.
6235 (Parser::Parser): Remove the constructor accepting a location and
6236 an initial debugging level.
6237 Remove from the other ctor the argument for the debugging level.
6238 (debug_level_type, debug_level, set_debug_level): New.
6239
6240 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
6241 constructor calls.
6242
6243 2004-12-15 Akim Demaille <akim@epita.fr>
6244
6245 Remove b4_root related material: failure experiment
6246 (which goal was to allow to derive from a class).
6247
6248 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
6249 definitions and uses.
6250
6251 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
6252
6253 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
6254 not 2, since it's not portable to subtract 1 from the start of an
6255 array. The new item 0 is never set or used. All uses changed.
6256
6257 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
6258 the default definition of YYLLOC_DEFAULT. Problem reported
6259 by Frank Heckenbach.
6260
6261 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
6262
6263 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
6264 the normal case and one for the error case. Just use the
6265 first one uniformly. Problem reported by Frank Heckenbach.
6266 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
6267 use exactly the same macro in both places.
6268 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
6269 so that the normal-case YYRHSLOC works for the error case too.
6270 All uses changed.
6271 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
6272 (YYLLOC_DEFAULT): Use the same macro as glr.c.
6273 * doc/bison.texinfo (Location Default Action): Don't claim that
6274 we have an array of locations. Use the same macro for both glr
6275 and lalr parsers. Mention YYRHSLOC. Mention what happens when
6276 the index is 0.
6277
6278 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
6279
6280 * HACKING: Update email addresses to send announcements to.
6281
6282 * configure.ac (AC_INIT): Bump version to 1.875f.
6283
6284 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
6285
6286 * NEWS: Version 1.875e.
6287 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
6288
6289 * src/scan-skel.l: Include "complain.h", for "fatal".
6290
6291 * src/relation.h (relation_print, relation_digraph):
6292 Relation sizes are of type relation_node, not size_t (this is
6293 merely a doc fix, since the two types are equivalent).
6294 (relation_transpose): Relation sizes are of type relation_node,
6295 not int.
6296 * src/relation.c: Likewise.
6297 (top, infinity): Now of type relation_node, not int.
6298 (traverse, relation_transpose): Use relation_node, not int.
6299
6300 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
6301 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
6302 (yyparse): Remove unused local introduced in 2004-10-25 patch.
6303
6304 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
6305 specifying whether the test should be skipped. Use it tp
6306 specify that the [%defines %skeleton "lalr1.cc"] tests currently
6307 fail on some hosts, and should be skipped.
6308
6309 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
6310
6311 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
6312 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
6313 unless otherwise specified below.
6314
6315 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
6316 to allocate kernel_base, kernel_items, kernel_size, since
6317 they needn't be initialized to 0.
6318 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
6319 * src/closure.c (new_closure): Likewise, for itemset.
6320 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
6321 * src/lalr.c (set_goto_map): Likewise, for temp_map.
6322 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
6323 (build_relations): Likewise for edge, states1, includes.
6324 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
6325 * src/reader.c (packgram): Likewise, for ritem, rules.
6326 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
6327 * src/relation.c (relation_digraph): Likewise for VERTICES.
6328 (relation_transpose): Likewise for new_R, end_R.
6329 * src/symtab.c (symbols_token_translations_init): Likewise for
6330 token_translations.
6331 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
6332 (token_actions): Likewise for yydefact, actrow, conflrow,
6333 conflict_list.
6334 (save_column): Likewise for froms[symno], tos[symno].
6335 (goto_actions): Likewise for state_count.
6336 (pack_table): Likewise for base, pos, check.
6337 (tables_generate): Likewise for width.
6338
6339 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
6340 for initial core. Just have a separate core, so we needn't worry
6341 about whether kernel_size and kernel_base are initialized.
6342
6343 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
6344 kernel_size, kernel_items): Remove unnecessary initialization.
6345 * src/conflicts.c (conflicts): Likewise.
6346 * src/derives.c (derives): Likewise.
6347 * src/muscle_tablc (muscle_insert): Likewise.
6348 * src/relation.c (relation_digraph): Likewise.
6349 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
6350 conflrow, conflict_table, conflict_list, table, check):
6351 Likewise.
6352
6353 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
6354 This is because all callers pass unsigned int.
6355 * src/closure.h (new_closure): Likewise.
6356
6357 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
6358 (build_relations): Initialize includes[i] in all cases.
6359 * src/reader.c (packgram): Always initialize rules[ruleno].prec
6360 and rules[ruleno].precsym. Initialize members in order.
6361 * src/relation.c (relation_transpose): Always initialize new_R[i]
6362 and end_R[i].
6363 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
6364
6365 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
6366 conflict_list[0] was always 0, but now it isn't initialized.
6367
6368 * src/table.c (table_grow): When conflict_table grew, the grown
6369 area wasn't cleared. Fix this.
6370
6371 * lib/.cvsignore: Add strdup.c, strdup.h.
6372 * m4/.cvsignore: Add strdup.m4.
6373
6374 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
6375
6376 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
6377 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
6378 GOTO_NUMBER_MAXIMUM, since we occasionally compute
6379 ngotos + 1 without checking for overflow.
6380 (build_relations): Use END_NODE, not -1, to denote end of edges.
6381 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
6382 build_relations): Use goto_number, not int, for goto numbers.
6383 * src/tables.c (save_column, default_goto): Likewise.
6384
6385 2004-11-23 Akim Demaille <akim@epita.fr>
6386
6387 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
6388 of #defining from yystype.
6389 Don't typedef yystype, C++ does not need it.
6390 This lets it possible to forward declare it as union.
6391
6392 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
6393
6394 * bootstrap (gnulib_modules): Add extensions.
6395 Problem reported by Jim Meyering.
6396
6397 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
6398
6399 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
6400 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
6401 src/system.h, src/tables.c: XFREE -> free, to accommodate
6402 recent change to gnulib xalloc.h.
6403 Problem reported by Jim Meyering.
6404
6405 2004-11-17 Akim Demaille <akim@epita.fr>
6406
6407 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
6408
6409 2004-11-17 Akim Demaille <akim@epita.fr>,
6410 Alexandre Duret-Lutz <adl@gnu.org>
6411
6412 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
6413 changes.
6414 (YYCDEBUG): Adjust.
6415 Use it instead of cdebug_.
6416 (Parser::debug_stream, Parser::set_debug_stream): New.
6417 (Parser::symprint_): Define cdebug_ for temporary backward
6418 compatibility.
6419 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
6420 debug_stream ().
6421
6422 2004-11-17 Akim Demaille <akim@epita.fr>
6423
6424 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
6425 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
6426 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
6427 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
6428
6429 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
6430
6431 * data/glr.c (yyloc_default): Remove; not used.
6432 Problem reported by Frank Heckenbach.
6433
6434 2004-10-25 Akim Demaille <akim@epita.fr>
6435
6436 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
6437 Introduce another definition to address simple location arrays.
6438 (yyGLRStack): New member: yyerror_range.
6439 (yyrecoverSyntaxError, yyparse): Update it.
6440 (yyrecoverSyntaxError): Use it when shifting the error token to
6441 have an accurate range, equivalent to the one computed by both
6442 yacc.c and lalr1.cc.
6443 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
6444 that column numbers start at column 0, as per GNU Coding
6445 Standards, the others tests, and the doc.
6446 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
6447 Adjust to the above change (first column is 0).
6448 And adjust the location of the "<error>", now covering the whole
6449 line.
6450
6451 2004-10-22 Akim Demaille <akim@epita.fr>
6452 and Paul Eggert <eggert@cs.ucla.edu>
6453
6454 Remove some arbitrary limits on goto numbers and relations.
6455 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
6456 initial values, since they're never used.
6457 (set_goto_map): ngotos is now unsigned, so test for overflow
6458 by seeing whether it wraps around to zero.
6459 * src/lalr.h (goto_number): Now size_t, not short int.
6460 (GOTO_NUMBER_MAXIMUM): Remove.
6461 * src/relation.c (relation_print, traverse, relation_transpose):
6462 Check for END_NODE rather than looking at sign.
6463 * src/relation.h (END_NODE): New macro.
6464 (relation_node): Now size_t, not short int.
6465
6466 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
6467
6468 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
6469 keyword, not an identifier. Problem reported by Baron Schwartz in
6470 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
6471
6472 2004-10-11 Akim Demaille <akim@epita.fr>
6473
6474 * src/symtab.c (symbol_check_alias_consistency): Also check
6475 type names, destructors, and printers.
6476 Reported by Alexandre Duret-Lutz.
6477 Recode the handling of associativity and precedence in terms
6478 of symbol_precedence_set.
6479 Accept no redeclaration at all, not even equal to the previous
6480 value.
6481 (redeclaration): New.
6482 Use it to factor redeclaration complaints.
6483 (symbol_make_alias): Don't set the type of the alias, let
6484 symbol_check_alias_consistency do it as for other features.
6485 * src/symtab.h (symbol): Add new member prec_location, and
6486 type_location.
6487 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
6488 * tests/input.at (Incompatible Aliases): New.
6489
6490 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
6491
6492 .cvsignore fixes to accommodate gnulib changes,
6493 and the practice of naming build directories "_build".
6494 * .cvsignore: Add "_*". Sort.
6495 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
6496 * m4/.cvsignore: Add "*_gl.m4".
6497
6498 2004-10-06 Akim Demaille <akim@epita.fr>
6499
6500 * src/parse-gram.y (add_param): Fix the truncation of trailing
6501 spaces.
6502
6503 2004-10-05 Akim Demaille <akim@epita.fr>
6504
6505 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
6506 whether the reducion was empty or not. This leaves room to
6507 improve the use of YYLLOC_DEFAULT in such a case.
6508 lalr1.cc is still experimental, so changing this is acceptable.
6509 And finally, there are probably not many users who changed the
6510 handling of locations in GLR, so changing is admissible too.
6511
6512 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
6513 empty reduction, set @$ to an empty location ending the previously
6514 stacked symbol.
6515 Adjust uses to make sure the code is triggered on empty
6516 reductions.
6517 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
6518 expected output: empty reductions have empty locations.
6519
6520 2004-09-29 Akim Demaille <akim@epita.fr>
6521
6522 * data/lalr1.cc: Move towards a more standard C++ coding style
6523 for templates: Class < T > -> Class<T>.
6524
6525 2004-09-29 Akim Demaille <akim@epita.fr>
6526
6527 * data/lalr1.cc: Reinstall the former ctor, for sake of
6528 compatibility, but warn it will be removed.
6529 Move towards a more standard C++ coding style (i.e., type *var ->
6530 type* var).
6531
6532 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
6533
6534 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
6535 since it's less likely to work if NULs are involved in the future.
6536
6537 2004-09-27 Akim Demaille <akim@epita.fr>
6538
6539 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
6540
6541 2004-09-27 Akim Demaille <akim@epita.fr>
6542
6543 * data/lalr1.cc (b4_parse_param_decl_1): New.
6544 (b4_parse_param_decl): Use it to have different names between attribute
6545 and argument names.
6546 (b4_cc_constructor_call): Likewise.
6547
6548 2004-09-24 Akim Demaille <akim@epita.fr>
6549
6550 * src/parse-gram.y (add_param): Strip the leading and trailing
6551 blanks from a formal argument declaration.
6552 (YY_LOCATION_PRINT): New.
6553
6554 2004-09-24 Akim Demaille <akim@epita.fr>
6555
6556 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
6557 after the location.
6558
6559 2004-09-24 Akim Demaille <akim@epita.fr>
6560
6561 * doc/bison.texinfo (Table of Symbols): Sort.
6562
6563 2004-09-21 Akim Demaille <akim@epita.fr>
6564
6565 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
6566 the useless parentheses.
6567 Suggested by Paul Eggert.
6568
6569 2004-09-20 Akim Demaille <akim@epita.fr>
6570
6571 Let the initial-action act on the look-ahead, and use it for the
6572 "initial push" (corresponding to an hypothetical beginning-of-file).
6573 And let lalr1.cc honor %initial-action.
6574
6575 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
6576 example.
6577 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
6578 (Parser::Parser): Remove the ctor that used to initialize it.
6579 (Parser::parse): Like in the other skeletons, issue the "starting
6580 parse" message before any action.
6581 Honor %initial-action.
6582 Initialize the stacks with the lookahead.
6583 * data/yacc.c: Let $$ and @$ in %initial-action designate the
6584 look-ahead.
6585 Push them in the stacks.
6586 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
6587
6588 2004-09-20 Akim Demaille <akim@epita.fr>
6589
6590 * doc/bison.texinfo (Initial Action Decl): New.
6591
6592 2004-09-20 Akim Demaille <akim@epita.fr>
6593
6594 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
6595 clearer criterion to define it.
6596 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
6597 When reducing on an empty RHS, use the latest stacked location as
6598 location.
6599 yylloc is not always available.
6600 * data/glr.c: Likewise.
6601 Also, honor initial-actions.
6602
6603 2004-09-20 Akim Demaille <akim@epita.fr>
6604
6605 * data/yacc.c (YY_LOCATION_PRINT): New.
6606 Define when we know YYLTYPE's structure, i.e., when the default
6607 YYLLOC_DEFAULT is used.
6608 * data/c.m4 (b4_yysymprint_generate): Use it.
6609 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
6610 value of the result.
6611 (error_start_): Replace with...
6612 (error_range_): this location array.
6613 This allows to replace code relying on the implementation of
6614 locations by portable code.
6615 * data/yacc.c (yylerrsp): Replace with...
6616 (yyerror_range): this.
6617 Every time a token is popped, update yyerror_range[0], to have an
6618 accurate location for the error token.
6619 * data/glr.c (YY_LOCATION_PRINT): New.
6620 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
6621 deference a pointer.
6622 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
6623 report the location in %printers.
6624
6625 * src/scan-skel.l: Instead of abort, report error messages to ease
6626 understanding skeleton scanning failures.
6627
6628 2004-09-16 Akim Demaille <akim@epita.fr>
6629
6630 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
6631 (iterator, const_iterator): these, to be more in the C++ spirit.
6632 Also, return reverse iterators so that when displaying the stack
6633 we display its bottom first.
6634 (Parser::stack_print_, Parser::reduce_print_): Match the messages
6635 from yacc.c.
6636 We should probably use vector here though.
6637
6638 2004-09-16 Akim Demaille <akim@epita.fr>
6639
6640 Have more complete shift traces.
6641
6642 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
6643 to report Shifts instead of ad hoc YYDPRINTF invocations,
6644 including for the error token.
6645 * data/lalr1.cc (symprint_): Output the location.
6646 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
6647 output the location within the %printer.
6648 Activate GLR tests, at least to make sure they compile properly.
6649 They still don't pass though.
6650 * tests/calc.at: Adjust expect verbose output, since now "Entering
6651 state..." is on a different line than the "Shifting" message.
6652
6653 2004-09-08 Akim Demaille <akim@epita.fr>
6654
6655 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
6656 Bison directive from the Bison file to the invocation of this
6657 macro, so that these directives are passed to
6658 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
6659 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
6660 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
6661 the extra Bison directives instead of the whole series.
6662 Change the grammar so that there are recoverable errors, and
6663 unrecoverable errors. Now we can have the parser give up before
6664 consuming the whole input. As a result we now can observe that
6665 the lookahead is freed when needed.
6666 Change the parser source to parse argv[1] instead of a hard coded
6667 string.
6668 Simplify yylex, and give a value and location to EOF.
6669 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
6670 passed directives already coded in the file.
6671 Add some tests to check the location of "error".
6672 For some tests, the C++ parser is correct, and not yacc.c.
6673 For other tests, they provide different, but unsatisfying, values,
6674 so keep the C++ value so that at least one parser is "correct"
6675 according to the test suite.
6676 (Actions after errors): Remove, this is subsumed by the
6677 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
6678
6679 2004-09-06 Akim Demaille <akim@epita.fr>
6680
6681 * data/lalr1.cc: Adjust the indentation of the labels.
6682 (Parser::pop): New.
6683 Use it.
6684
6685 2004-09-06 Akim Demaille <akim@epita.fr>
6686
6687 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
6688 argument, an informative message.
6689 Call YY_SYMBOL_PRINT.
6690 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
6691 * data/lalr1.cc (destruct_): Likewise.
6692 In addition, no longer depend on b4_yysymprint_generate and
6693 b4_yydestruct_generate to generate these functions, do it "by
6694 hand".
6695
6696 2004-09-03 Akim Demaille <akim@epita.fr>
6697
6698 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
6699 invoked, yydestruct the lookahead.
6700 * tests/calc.at (Calculator $1): Update the expected lengths of
6701 traces: there is an added line for the discarded lookahead.
6702 * doc/bison.texinfo (Destructor Decl): Some rewording.
6703 Define "discarded" symbols.
6704
6705 2004-09-02 Akim Demaille <akim@epita.fr>
6706
6707 * data/lalr1.cc (translate_, destruct_): No reason to be static.
6708
6709 2004-09-02 Akim Demaille <akim@epita.fr>
6710
6711 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
6712 (YYDSYMPRINTF): Rename as...
6713 (YY_SYMBOL_PRINT): this.
6714 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
6715 two.
6716 Use it instead of direct symprint_ calls.
6717 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
6718 one.
6719
6720 2004-09-02 Akim Demaille <akim@epita.fr>
6721
6722 * data/lalr1.cc (b4_yysymprint_generate): New.
6723 (symprint_): New member function, defined when YYDEBUG.
6724 Use it consistently instead of token/nterm debugging output by
6725 hand.
6726 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
6727 %printer calls to use cdebug_ when using lalr1.cc.
6728
6729 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
6730
6731 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
6732 with #ifdef YYDEBUG.
6733
6734 2004-08-26 Akim Demaille <akim@epita.fr>
6735
6736 * doc/bison.texinfo (Implementing Loops): Rename as...
6737 (Implementing Gotos/Loops): this.
6738
6739 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
6740
6741 Adjust to latest gnulib.
6742 * bootstrap (gnulib_modules): Add xalloc-die.
6743 Set LC_ALL=C so that file names sort consistently.
6744 Prefer the gnulib copies of gettext.m4, glibc21.m4,
6745 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
6746 uintmax_t.m4, ulonglong.m4.
6747 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
6748 po.m4 since we are now using _gl.m4 instead.
6749
6750 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
6751
6752 * src/scan-action.l: Remove. Scanning of semantic actions is
6753 handled in scan-gram.l.
6754
6755 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
6756
6757 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
6758
6759 * src/location.h (struct): The file member is a uniqstr.
6760 (equal_boundaries): Use UNIQSTR_EQ for comparison.
6761
6762 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
6763
6764 Fix bug with non-%union parsers that have printers or destructors,
6765 which led to a Bison core dump. Reported by Peter Fales in
6766 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
6767
6768 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
6769 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
6770 not to our own type.
6771 * src/output.c (symbol_destructors_output, symbol_printers_output):
6772 Don't assume %union.
6773 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
6774 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
6775 UNION-FLAG. All callers changed.
6776 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
6777 Use type char, not unsigned int, when declaring an array of char;
6778 this lets us remove a cast.
6779 (Printers and Destructors): Add non-%union test cases.
6780
6781 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6782
6783 * doc/bison.texinfo: Minor editorial changes, mostly to the new
6784 GLR writeups. E.g., avoid frenchspacing and the future tense,
6785 change "lookahead" to "look-ahead", and change "wrt" to "with
6786 respect to".
6787
6788 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6789
6790 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
6791 New sections, split off from the GLR Parsers section. Put the new
6792 Simple GLR Parser near the start of the GLR section, for clarity.
6793 Rewrite connective text.
6794
6795 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
6796
6797 * doc/bison.texinfo (Simple GLR Parsers): New section.
6798
6799 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6800
6801 * NEWS, TODO, doc/bison.texinfo:
6802 Use "look-ahead" instead of "lookahead", to be consistent.
6803 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
6804 while we're fixing "look-ahead".
6805 * src/conflicts.c (shift_set): Renamed from shiftset.
6806 (look_ahead_set): Renamed from lookaheadset.
6807 * src/print.c: Likewise.
6808 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
6809 name for "lookahead".
6810 (report_types, usage): Likewise.
6811 * src/getargs.h (report_look_ahead_tokens): Renamed from
6812 report_lookaheads.
6813 * src/lalr.c (compute_look_ahead_tokens): Renamed from
6814 compute_lookaheads.
6815 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
6816 (look_ahead_tokens_print): Renamed from lookaheads_print.
6817 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
6818 state_rule_lookaheads_print.
6819 * src/state.h: Likewise.
6820 (reductions.look_ahead_tokens): Renamed from lookaheads.
6821 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
6822 AT_DATA_LOOKAHEADS_GRAMMAR.
6823
6824 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
6825
6826 * README: Update location of patched M4 distribution.
6827
6828 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
6829
6830 Don't assume the C++ compiler takes the same arguments as the C compiler
6831 (trivial change).
6832 * configure.ac (O0CXXFLAGS): New var.
6833 * tests/atlocal.in (CXXFLAGS): Use it.
6834
6835 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
6836
6837 Fix some "make check" problems with C++ reported by
6838 Albert Chin-A-Young for Tru64 C++ in this thread:
6839 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
6840
6841 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
6842 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6843 Output to a .cc file for C++, not to a .c file.
6844 * tests/calc.at (AT_CHECK_CALC): Likewise.
6845 * tests/regression.at (AT_CHECK_DANCER): Likewise.
6846 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
6847
6848 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
6849
6850 * tests/calc.at, tests/actions.at: Workaround for SGI
6851 C++ compiler. (trivial change)
6852
6853 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
6854
6855 Spent a few hours checking out which prerequisite versions the
6856 current sources actually require. I went all the way back to
6857 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
6858 a seemingly endless set of combinations of versions more recent
6859 than that. The bottom line is that the current sources require
6860 fairly recent versions of the build tools, and it'll be some work
6861 to change this.
6862 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
6863 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
6864 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
6865 Add comments explaining why those particular versions are
6866 currently needed.
6867
6868 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
6869 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
6870 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
6871
6872 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
6873 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
6874
6875 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
6876
6877 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
6878 0.11.5. Suggested by Bruno Haible.
6879 * bootstrap: Remove gettext version checking.
6880
6881 * doc/bison.texinfo (Decl Summary): Also mention that %union
6882 can depend on prerequisite types. Problem reported by Tim
6883 Van Holder.
6884
6885 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
6886
6887 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
6888 * README-alpha: Don't tell people not to package this.
6889
6890 * bootstrap: Don't assume $(...) works; use `...` instead.
6891 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
6892 gettext better.
6893
6894 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
6895 put into the -d output file, and mention what to do if YYSTYPE is
6896 defined as a macro.
6897
6898 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
6899
6900 Undo change made earlier today: it caused autopoint to not bring
6901 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
6902 autopoint's.
6903
6904 * bootstrap: Check that gettext version matches what's in
6905 configure.ac. Warn users to ignore robots.txt ERROR 404.
6906 * bootstrap: Undo today's earlier change (logged below).
6907 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
6908
6909 The gettext version checking is causing more trouble than it's
6910 curing; remove it. Problem reported by Paul Hilfinger.
6911
6912 * bootstrap: Issue a warning that one can expect a message
6913 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
6914 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
6915
6916 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
6917
6918 Ensure that the C++ compiler used for testing actually works on a
6919 simple test program; if not, skip the C++-related tests. Problem
6920 reported by Vin Shelton in:
6921 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
6922
6923 * m4/cxx.m4: New file.
6924 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
6925 * tests/atlocal.in (BISON_CXX_WORKS): Add.
6926 * tests/local.at (AT_COMPILE_CXX): Use it.
6927
6928 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6929
6930 * data/glr.c (yylloc): Output this macro even if locations are not
6931 being generated, as the GLR parser needs it even in that case.
6932 Problem reported by Troy A. Johnson
6933 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
6934
6935 * configure.ac (AC_INIT): Update to 1.875e.
6936
6937 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6938
6939 * NEWS: Version 1.875d.
6940 * configure.ac (AC_INIT): Likewise.
6941 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
6942
6943 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
6944 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
6945 lalr1.cc runs afoul of the first, and the last two are no longer
6946 supported by GCC 3.4.0.
6947 * README: Mention GNU m4 1.4 or later; mention m4 patches.
6948 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
6949
6950 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6951
6952 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
6953 unsigned int, for compatibility with latest gnulib hash module.
6954 * src/state.c (state_hash, state_hasher): Likewise.
6955 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
6956 * src/uniqstr.c (hash_uniqstr): Likewise.
6957
6958 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
6959
6960 * NEWS: Unescaped newlines are no longer allowed in char & strings.
6961
6962 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
6963 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
6964 character and string literals.
6965 (unexpected_end): New function.
6966 (unexpected_eof): Use it.
6967 (unexpected_newline): New function.
6968 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
6969 actions.
6970
6971 * NEWS: Document %expect-rr.
6972
6973 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
6974 Fix typo by replacing $1 with $option.
6975 Remove more 'intl'-related files.
6976 Don't DEFUN AM_INTL_SUBDIR twice.
6977
6978 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
6979 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
6980 strtoul.c.
6981 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
6982 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
6983 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
6984 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
6985 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
6986 * src/.cvsignore: Add *.output.
6987
6988 * src/parse-gram.y: Put copyright notice inside %{ %} so it
6989 gets copied to the output file.
6990
6991 2004-04-28 Paul Eggert <eggert@twinsun.com>
6992
6993 Get files from the gnulib and po repositories, instead of relying
6994 on them being in our CVS. Upgrade to latest versions of gnulib
6995 and Automake.
6996
6997 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
6998 * bootstrap: Bootstrap from gnulib and po repositories.
6999 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
7000 * README-cvs: Document these changes. Remove version numbers from
7001 mentions of build tools, since they change so often. Mention Flex.
7002
7003 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
7004 (gl_USE_SYSTEM_EXTENSIONS): Add.
7005 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
7006 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
7007 does this for us.
7008 (AC_ISC_POSIX): Remove; we no longer support this
7009 ancient OS, as it gets in the way of latest Autoconf & gnulib.
7010 (AC_HEADER_STDC): Remove: we now assume C89 or better.
7011 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
7012 Do not check for C89 headers, except for locale.h which is used
7013 by the Yacc library and must port to K&R hosts.
7014 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
7015 Do not check for C89 functions, except for setlocale which is
7016 used by the Yacc library.
7017 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
7018 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
7019 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
7020 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
7021 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
7022 AM_GNU_GETTEXT): Remove; now done by:
7023 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
7024 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
7025 for us.
7026
7027 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
7028 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
7029 Define to empty, as gnulib.mk will do the rest for us.
7030 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
7031 for us.
7032 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
7033 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
7034
7035 * src/files.c: Include gnulib's xstrndup.h.
7036
7037 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
7038 (REALLOC): Use xnrealloc, for likewise.
7039 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
7040 (strnlen, memrchr): Remove decls; functions no longer used.
7041 Include <stpcpy.h>.
7042
7043 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
7044 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7045 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
7046 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
7047 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
7048 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
7049 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
7050 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
7051 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
7052 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
7053 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
7054 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7055 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
7056 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
7057 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
7058 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
7059 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
7060 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
7061 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
7062 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
7063 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
7064 Remove, as these files are now generated automatically
7065 by bootstrap or automake.
7066
7067 * po/ChangeLog: Remove: all but one entry was a duplicate
7068 of this file, and I moved that 2000-11-02 entry here.
7069
7070 * config/.cvsignore: Add Makefile, depcomp, install-sh.
7071 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
7072 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
7073 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
7074 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
7075 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
7076 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
7077 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
7078 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
7079 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
7080 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
7081 xstrndup.h.
7082 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
7083 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
7084 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
7085 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
7086 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
7087 * src/.cvsignore: Remove *_.c.
7088
7089
7090 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
7091 support it. (The latest stable gzip doesn't.)
7092
7093 2004-04-27 Paul Eggert <eggert@twinsun.com>
7094
7095 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
7096 case, as stos_ is now used by destructors due to the 2004-02-09
7097 change.
7098
7099 Remove more K&R C support.
7100 * lib/libiberty.y (PARAMS): Remove. All uses removed.
7101 * lib/subpipe.c (errno): Remove decl.
7102 Include <stdlib.h> unconditionally.
7103 (EXIT_FAILURE): Remove macro.
7104 * src/complain.c (vfprintf, strerror): Remove.
7105 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
7106 unconditionally.
7107 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
7108 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
7109 (strchr, strspn, memchr): Remove decls.
7110 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
7111 unconditionally. Do not declare perror.
7112 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
7113 unconditionally.
7114
7115 * src/complain.c (_): Remove useless defn, as system.h defines this.
7116
7117 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
7118 with latest obstack.h.
7119 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
7120 to procedure types, as obstack.h now does that for us.
7121 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
7122
7123 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
7124 so that this include file can stand alone.
7125 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
7126 does this now. Include subpipe.h first after config.h, to
7127 test whether it can stand alone.
7128
7129 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
7130 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
7131 unused declaration.
7132
7133 * tests/synclines.at (%union synch line): Put a dummy member in
7134 the union, because empty unions aren't allowed in C. Caught
7135 by GCC 3.4.0.
7136
7137 2004-04-13 Jim Meyering <jim@meyering.net>
7138
7139 * src/conflicts.c (conflicts_print): Correct format string typo:
7140 use `%%' to produce literal `%'. (trivial change)
7141
7142 2004-03-30 Paul Eggert <eggert@twinsun.com>
7143
7144 * src/getargs.c (version): Update copyright year to 2004.
7145
7146 * data/c.m4 (b4_int_type): Use 'short int' rather than
7147 'short', and similarly for 'long', 'unsigned', etc.
7148 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
7149 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
7150 yy_yypstack, yydumpstack): Likewise.
7151 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
7152 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
7153 Likewise.
7154 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
7155 yy_stack_print, yyparse): Likewise.
7156 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
7157 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
7158 * lib/bitset.c (bitset_print): Likewise.
7159 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
7160 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7161 * lib/bitsetv.c (bitsetv_dump): Likewise.
7162 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
7163 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
7164 Likewise.
7165 * src/LR0.c (allocate_itemsets): Likewise.
7166 * src/gram.h (rule_number, rule): Likewise.
7167 * src/lalr.h (goto_number): Likewise.
7168 * src/nullable.c (nullable_compute): Likewise.
7169 * src/output.c (prepare_rules): Likewise.
7170 * src/relation.c (relation_print, relation_digraph): Likewise.
7171 * src/relation.h (relation_node): Likewise.
7172 * src/state.h (state_number, transitions, errs, reductions,
7173 struct state): Likewise.
7174 * src/symtab.h (symbol_number, struct symbol): Likewise.
7175 * src/tables.c (vector_number, tally, action_number,
7176 default_goto, goto_actions): Likewise.
7177 * tests/existing.at (GNU Cim Grammar): Likewise.
7178 * tests/regression.at (Web2c Actions): Likewise.
7179
7180 * src/output.c (muscle_insert_short_int_table): Renamed from
7181 muscle_insert_short_table. All uses changed.
7182
7183 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7184
7185 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
7186 (declaration): Replace expected_conflicts with expected_sr_conflicts.
7187 Add %expect-rr rule.
7188
7189 * src/scan-gram.l: Recognize %expect-rr.
7190
7191 * src/conflicts.h (expected_sr_conflicts): Rename from
7192 expected_conflicts.
7193 (expected_rr_conflicts): Declare.
7194
7195 * src/conflicts.c (expected_sr_conflicts): Rename from
7196 expected_conflicts.
7197 (expected_rr_conflicts): Define.
7198 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
7199 for GLR parsers.
7200 Use expected_sr_conflicts in place of expected_conflicts.
7201 Warn if expected_rr_conflicts used in non-GLR parser.
7202
7203 * doc/bison.texinfo: Add documentation for %expect-rr.
7204
7205 2004-03-08 Paul Eggert <eggert@gnu.org>
7206
7207 Add support for hex token numbers. Suggested by Odd Arild Olsen in
7208 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
7209
7210 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
7211 in lalr1.cc.
7212 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
7213 * src/scan-gram.l (scan_integer): New function.
7214 ({int}): Use it.
7215 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
7216 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
7217 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
7218 Say "long int", not "long", for uniformity with GNU style.
7219
7220 2004-02-25 Paul Eggert <eggert@twinsun.com>
7221
7222 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
7223 compilers. This fixes a problem with Intel's C++ compiler being
7224 chatty, reported by Guido Trentalancia in
7225 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
7226
7227 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
7228
7229 Support %destructor and merge error locations in lalr1.cc.
7230
7231 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
7232 (Parser::stos_): Define unconditionally.
7233 (Parser::destruct_): New method. Generate its body with
7234 b4_yydestruct_generate.
7235 (Parser::error_start_): New attribute.
7236 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
7237 token which are discarded.
7238 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
7239 error_start_ when erroneous token are discarded.
7240 (Parser::parse) <yyerrlab1>: Compute the location of the error
7241 token so that it covers all the discarded tokens.
7242 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
7243 it can be called with `%skeleton "lalr1.cc"', and do that.
7244
7245 2004-02-02 Paul Eggert <eggert@twinsun.com>
7246
7247 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
7248 $(top_srcdir)/lib and ../lib. This fixes a bug reported
7249 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
7250 There's no need to mention top_builddir since Automake does that
7251 for us.
7252 (INCLUDES): Remove, as Automake says it's obsolescent.
7253 Contents migrated into AM_CPPFLAGS as described above.
7254 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
7255
7256 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7257
7258 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
7259 (yyreportSyntaxError): Handle case where lookahead token is
7260 YYEMPTY.
7261
7262 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7263
7264 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
7265 resulting parsers are compilable with C++.
7266
7267 2003-12-23 Paul Eggert <eggert@twinsun.com>
7268
7269 * config/depcomp, config/install-sh: Sync with Automake 1.8.
7270 * src/output.c (output_skeleton): Rename local var.
7271 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
7272 Bison tokens, as this runs afoul of the 2003-10-07 change that
7273 disallowed NUL bytes in character constants or string literals.
7274
7275 * tests/local.at: Require Autoconf 2.59's Autotest.
7276 * tests/testsuite.at: Don't include local.at, since we now assume
7277 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
7278 including it.
7279 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
7280 multiple inclusion warnings.
7281
7282 2003-12-02 Akim Demaille <akim@epita.fr>
7283
7284 * doc/bison.texinfo (How Can I Reset the Parser): More about start
7285 conditions.
7286 From Bruno Haible.
7287
7288 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
7289
7290 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
7291
7292 2003-10-07 Paul Eggert <eggert@twinsun.com>
7293
7294 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
7295 if testsuite doesn't exist.
7296
7297 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
7298 literals, unfortunately.
7299 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
7300 Complain about NUL bytes in character constants or string literals.
7301
7302 2003-10-05 Paul Eggert <eggert@twinsun.com>
7303
7304 * NEWS: Don't document %no-default-prec, as it's still
7305 too experimental.
7306 * doc/bison.texinfo: Document %no-default-prec only if
7307 the defaultprec flag is set. Normally it's not.
7308
7309 2003-10-04 Paul Eggert <eggert@twinsun.com>
7310
7311 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
7312 non-modifiable lvalue, instead of a modifiable one.
7313 * doc/bison.texinfo (Actions): Document that $$ can
7314 be assigned to. Do not claim that $$ and $N are
7315 array element references: user code should not rely on this.
7316
7317 2003-10-01 Paul Eggert <eggert@twinsun.com>
7318
7319 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
7320 (grammar_declaration): Use it.
7321 * src/scan-gram.l: New token %no-default-prec.
7322 * tests/conflicts.at: Revamp tests to use %no-default-prec.
7323 * NEWS, doc/bison.texinfo: Document the above.
7324
7325 2003-10-01 Akim Demaille <akim@epita.fr>
7326
7327 VCG no longer supports long_straight_phase.
7328
7329 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
7330 * src/print_graph.c (print_graph): Adjust.
7331
7332 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
7333 and Paul Eggert <eggert@twinsun.com>
7334
7335 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
7336 Table of Symbols): Document %default-prec.
7337 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
7338 (grammar_declaration): Set default_prec on %default-prec.
7339 * src/scan-gram.l (%default-prec): New token.
7340 * src/reader.h (default_prec): New flag.
7341 * src/reader.c: Likewise.
7342 (packgram): Handle it.
7343 * tests/conflicts.at (%default-prec without %prec,
7344 %default-prec with %prec, %default-prec 1): New tests.
7345
7346 2003-09-30 Paul Eggert <eggert@twinsun.com>
7347
7348 * tests/testsuite.at: Include local.at, not input.at, fixing
7349 a typo in the 2003-08-25 patch.
7350
7351 2003-08-27 Akim Demaille <akim@epita.fr>
7352
7353 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
7354 GCC warnings.
7355
7356 2003-08-26 Akim Demaille <akim@epita.fr>
7357
7358 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
7359 "<\#" to avoid magic from Gnus when posting parts of this script.
7360
7361 2003-08-26 Akim Demaille <akim@epita.fr>
7362
7363 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
7364 (Parser::parse): here.
7365 Adjust: nerrs and errstatus is now replaced by...
7366 (Parser::nerrs_, Parser::errstatus_): New.
7367
7368 2003-08-25 Akim Demaille <akim@epita.fr>
7369
7370 * config/announce-gen, Makefile.cfg: New.
7371 * Makefile.am: Adjust.
7372 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
7373 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
7374
7375 2003-08-25 Akim Demaille <akim@epita.fr>
7376
7377 When reducing initial empty rules, Bison parser read an initial
7378 location that is not defined. This results in garbage, and that
7379 affects Bison's own parser. Therefore we need (i) to extend Bison
7380 to support a means to initialize this location, and (ii) to use
7381 this CVS Bison to fix CVS Bison's parser.
7382
7383 * src/reader.h, reader.c (epilogue_augment): Remove, replace
7384 with...
7385 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
7386 * src/parse-gram.y: Adjust.
7387 (%initial-action): New.
7388 (%error-verbose): Since we require CVS Bison, there is no reason
7389 not to use it.
7390 * src/scan-gram.l: Adjust.
7391 * src/Makefile.am (YACC): New, to make sure we use our own parser.
7392 * data/yacc.c (yyparse): Use b4_initial_action.
7393
7394 2003-08-25 Akim Demaille <akim@epita.fr>
7395
7396 * doc/bison.texinfo: Don't promote stdout for error messages.
7397
7398 2003-08-25 Akim Demaille <akim@epita.fr>
7399
7400 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
7401 From Alexandre Duret-Lutz.
7402
7403 2003-08-25 Akim Demaille <akim@epita.fr>
7404
7405 Version 1.875c.
7406
7407 2003-08-25 Akim Demaille <akim@epita.fr>
7408
7409 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
7410 Use them.
7411
7412 2003-08-25 Akim Demaille <akim@epita.fr>
7413
7414 * data/lalr1.cc (Parser::reduce_print_): New.
7415 Use it.
7416
7417 2003-08-25 Akim Demaille <akim@epita.fr>
7418
7419 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
7420 error recovery loops. This patch is based on
7421 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
7422 Also, augment the similarity between lalr1.cc and yacc.c.
7423 Note: the locations of error recovery rules are not correct yet.
7424
7425 * data/lalr1.cc: Comment changes to augment the similarity between
7426 lalr1.cc and yacc.c.
7427 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
7428 (yyerrlab1): Remove, but where it used to be (now the bottom part of
7429 yyerrlab), when hitting EOF, pop the whole stack here instead of
7430 merely falling thru the default error handling mechanism.
7431 (yyerrorlab): New label, with the old contents of YYERROR,
7432 plus the following change: pop the stack of rhs corresponding
7433 to the production that invoked YYERROR. That is how Yacc
7434 behaves (required by POSIX).
7435 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
7436 fail.
7437
7438 2003-08-25 Akim Demaille <akim@epita.fr>
7439
7440 Tune local.at so that people can "autom4te -l autotest calc.at -o
7441 calc" for instance, to extract a sub test suite.
7442
7443 * tests/testsuite.at: Move the initialization, Autotest version
7444 requirement, and AT_TESTED invocation into...
7445 * tests/local.at: here.
7446 * tests/testsuite.at: Include it for compatibility with Autoconf
7447 2.57.
7448 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
7449 be ignore.
7450
7451 2003-08-04 Paul Eggert <eggert@twinsun.com>
7452
7453 Rework code slightly to avoid gcc -Wtraditional warnings.
7454 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
7455 The returned value is now stored in *YY0. All callers changed.
7456 * src/output.c (merge_output): Adjust to the above change.
7457
7458 2003-07-26 Paul Eggert <eggert@twinsun.com>
7459
7460 * data/glr.c (YYASSERT): New macro.
7461 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
7462 yyresolveStates, yyprocessOneStack):
7463 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
7464 Derived from a suggestion by Frank Heckenbach.
7465
7466 2003-07-25 Paul Eggert <eggert@twinsun.com>
7467
7468 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
7469 for portability to K&R C (after ansi2knr, presumably). See
7470 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
7471 by Frank Heckenbach, though I have omitted the structure-initialization
7472 part of his glr-knr.diff patch since I recall that the Portable
7473 C Compiler didn't require that change.
7474
7475 Let the user specify how to allocate and free memory.
7476 Derived from a suggestion by Frank Heckenbach in
7477 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
7478 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
7479 All uses of free, malloc, realloc changed to use these macros,
7480 and unnecessary casts removed.
7481 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
7482
7483 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
7484
7485 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
7486 use s.empty() rather than s == "" to test for empty string; see
7487 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
7488 (trivial change)
7489
7490 2003-06-25 Akim Demaille <akim@epita.fr>
7491
7492 * config/depcomp, config/install-sh: Update from masters.
7493
7494 2003-06-20 Paul Eggert <eggert@twinsun.com>
7495
7496 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
7497 and return properly parenthesized result.
7498 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
7499 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7500 Remove unnecessary parentheses from uses.
7501 * doc/bison.texinfo (Location Default Action): Describe the
7502 conventions for parentheses.
7503
7504 2003-06-19 Paul Eggert <eggert@twinsun.com>
7505
7506 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
7507 yyreportTree): Do not assume that size_t is the same width as int,
7508 when printing sizes. Print sizes using an unsigned format.
7509 Problem reported by Frank Heckenbach in
7510 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
7511
7512 Port to Forte Developer 7 C compiler.
7513 * data/glr.c (struct YYLTYPE): If locations are not being used,
7514 declare a single dummy member, as empty structs do not conform
7515 to the C standard.
7516 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
7517 the Forte Developer 7 C compiler complains that end-of-loop
7518 code is not reached.
7519
7520 2003-06-17 Paul Eggert <eggert@twinsun.com>
7521
7522 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
7523 avoid warnings from picky compilers about redefinition of PARAMS.
7524
7525 2003-06-17 Paul Eggert <eggert@twinsun.com>
7526
7527 Version 1.875b.
7528
7529 * NEWS: Document 1.875b.
7530
7531 * lib/bbitset.h: Do not include config.h; that's the includer's job.
7532 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
7533 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
7534 Don't use 'index' in comments, as it's a builtin fn on some hosts.
7535 * lib/bitset_stats.c: Include gettext.h unconditionally, as
7536 per recent gettext manual's suggestion.
7537 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
7538 Use prototypes, not old-style definitions.
7539 * lib/lbitset.c (lbitset_unused_clear): Likewise.
7540 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
7541 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
7542 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
7543 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
7544 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
7545 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
7546 vbitset_or_and_cmp, vbitset_copy): Likewise.
7547
7548 * lib/libiberty.h: Do not include config.h; that's the includer's job.
7549 Do not include <stdlib.h>.
7550 (PARAMS): Define unconditionally for C89.
7551 (ATTRIBUTE_NORETURN): Remove.
7552 (ATTRIBUTE_UNUSED): Define unconditionally.
7553
7554 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
7555 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
7556 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
7557 * lib/vbitset.c, lib/vbitset.h: New files.
7558 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
7559 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
7560 from libbitset.
7561
7562 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
7563 `How Can I Reset @code{yyparse}', since texinfo does not allow
7564 arbitrary @ in node names.
7565
7566 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
7567 shouldn't be needed according to the gettext 0.12.1 documentation
7568 but which seem to be needed anyway: codeset.m4 glibc21.m4
7569 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
7570 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
7571 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
7572
7573 * lib/.cvsignore: Add stdbool.h.
7574 * m4/.cvsignore: Add nls.m4, po.m4.
7575
7576 Upgrade to CVS gnulib.
7577 * stdbool_.h: File renamed from stdbool.h.in.
7578 * configure.ac (AM_STDBOOL_H): Invoke this instead of
7579 AC_HEADER_STDBOOL.
7580 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
7581 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
7582 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
7583 (MOSTLYCLEANFILES): New var.
7584 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
7585 (stdbool.h): New rule.
7586 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
7587 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
7588 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
7589 m4/quote.m4: Upgrade to today's gnulib.
7590
7591 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
7592 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
7593 the tests right now.
7594 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
7595 yyerror are declared before use; C99 requires this.
7596
7597 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7598
7599 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
7600 first.
7601 (yyrecoverSyntaxError): Correct the logic for setting and testing
7602 yyerrState.
7603 Correct comment on handling EOF.
7604 Allow states with only a default reduction, rather than failing
7605 (I can't quite reconstruct why these were not allowed before).
7606
7607 Fixes to avoid problem that $-N rules in GLR parsers can cause
7608 buffer overruns, corrupting state.
7609
7610 * src/output.c (prepare_rules): Output max_left_semantic_context
7611 definition.
7612 * src/reader.h (max_left_semantic_context): New variable declaration.
7613 * src/scan-gram.l (max_left_semantic_context): Define.
7614 (handle_action_dollar): Update max_left_semantic_context.
7615 * data/glr.c (YYMAXLEFT): New definition.
7616 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
7617 (yyresolveAction): Ditto.
7618
7619 Fixes to problems with location handling in GLR parsers reported by
7620 Frank Heckenbach (2003/06/05).
7621
7622 * data/glr.c (YYLTYPE): Make trivial if locations not used.
7623 (YYRHSLOC): Add parentheses, and define only if locations used.
7624 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
7625 locations not used.
7626 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
7627 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
7628
7629 * tests/cxx-type.at: Exercise location information; update tests
7630 to differentiate output with and without locations.
7631 Remove forward declarations of yylex and yyerror---caused errors
7632 because default YYLTYPE not yet defined.
7633 Change semantic actions to compute strings, rather than printing
7634 them directly (to test proper passing of semantics values). Change
7635 output to prefix notation and update test data and expected results.
7636 (yylex): Track locations.
7637 (stmtMerge): Return value rather than printing, and include arguments
7638 in value.
7639
7640 2003-06-03 Paul Eggert <eggert@twinsun.com>
7641
7642 Avoid warnings generated by GCC 2.95.4 when Bison is
7643 configured with --enable-gcc-warnings.
7644 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
7645 yy::]b4_parser_class_name[::translate_,
7646 yy::Stack::operator[] (unsigned),
7647 yy::Stack::operator[] (unsigned) const,
7648 yy::Slice::operator[] (unsigned),
7649 yy::Slice::operator[] (unsigned) const):
7650 Rename local vars to avoid warnings.
7651 * tests/glr-regression.at (Improper handling of embedded actions
7652 and $-N in GLR parsers): Remove unused local variable from yylex.
7653 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
7654 (void) as arg when not pure, since we now assume C89 when building
7655 Bison. Pacify GCC by using parameter.
7656
7657 2003-06-02 Paul Eggert <eggert@twinsun.com>
7658
7659 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
7660 yy::Location::lines, yy::Location::columns): Rename arguments
7661 to avoid shadowing; this removes a warning generated by GCC 3.3.
7662
7663 2003-06-01 Paul Eggert <eggert@twinsun.com>
7664
7665 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
7666 to g++, as GCC 3.3 complains if you do it.
7667 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
7668 everything that WARNING_CFLAGS has, except omit warnings
7669 not suitable for C++.
7670 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
7671 * tests/atlocal.in (CXXFLAGS): New var.
7672 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
7673
7674 Fix a GLR parser bug I reported in February; see
7675 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
7676 The problem was that GLR parsers did not conform to the C standard,
7677 because actions like { $1 = $2 + $3; } expanded to expressions
7678 that invoked YYFILL in separate subexpressions, and YYFILL assigned
7679 to a local variable. The C standard says that expressions
7680 like (var = f ()) + (var = f ()) have undefined behavior.
7681 Another problem was that GCC sometimes issues warnings that
7682 yyfill and its parameters are unused.
7683
7684 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
7685 as possibly unused.
7686 (yyfill): New function.
7687 (YYFILL): Use it.
7688 (yyuserAction): Change type of yynormal to bool, so that it matches
7689 the new yyfill signature. Mark it as possibly unused.
7690
7691
7692 Follow up on a bug I reported in February, where a Bison-generated
7693 parser can loop. Provide a test case and a fix for yacc.c. I
7694 don't have a fix for lalr1.cc or for glr.c, unfortunately.
7695 The original bug report is in:
7696 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
7697
7698 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
7699 macro's size was becoming unwieldy.
7700 (yyerrlab): Do not discard an empty lookahead symbol, as this
7701 might destroy garbage.
7702 (yyerrorlab): New label, with the old contents of YYERROR,
7703 plus the following change: pop the stack of rhs corresponding
7704 to the production that invoked YYERROR. That is how Yacc
7705 behaves, and POSIX requires this behavior.
7706 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
7707 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
7708 Define 'alarm' to do nothing if unistd.h is not available.
7709 Add a new rule "exp: '-' error;" to test the above change to
7710 data/yacc.c. Use 'alarm' to abort any test taking longer than
7711 10 seconds, as it's probably looping.
7712 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
7713 Also, the new yacc.c generates two fewer diagnostics for an
7714 existing test.
7715
7716 2003-05-24 Paul Eggert <eggert@twinsun.com>
7717
7718 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
7719 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
7720 This fixes a problem reported by John Bowman when the Compaq/HP
7721 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
7722 -ansi -Wall -gall).
7723 * data/yacc.c (union yyalloc): Likewise.
7724 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
7725
7726 Switch from 'int' to 'bool' where that makes sense.
7727
7728 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
7729 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
7730 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
7731 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
7732 Return or accept bool, not int. All callers changed.
7733 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
7734 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
7735 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
7736 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
7737 bitset_or_and_cmp_): Likewise.
7738 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
7739 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
7740 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
7741 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
7742 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
7743 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
7744 bitset_stats_or_and_cmp): Likewise.
7745 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
7746 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
7747 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
7748 ebitset_xor_cmp): Likewise.
7749 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
7750 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
7751 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
7752 lbitset_xor_cmp): Likewise.
7753 * lib/bbitset.h: Include <stdbool.h>.
7754 (struct bitset_vtable): The following members now return bool, not
7755 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
7756 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
7757 or_and_cmp).
7758 * src/conflicts.c (count_rr_conflicts): Likewise.
7759 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
7760 All uses changed.
7761 * lib/ebitset.c (ebitset_obstack_init): Likewise.
7762 * lib/lbitset.c (lbitset_obstack_init): Likewise.
7763 * src/getargs.c (debug_flag, defines_flag, locations_flag,
7764 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7765 graph_flag): Likewise.
7766 * src/getargs.h (debug_flag, defines_flag, locations_flag,
7767 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7768 graph_flag): Likewise.
7769 * src/output.c (error_verbose): Likewise.
7770 * src/output.h (error_verbose): Likewise.
7771 * src/reader.c (start_flag, typed): Likewise.
7772 * src/reader.h (typed): Likewise.
7773 * src/getargs.c (LOCATIONS_OPTION): New constant.
7774 (long_options, getargs): Use it.
7775 * src/lalr.c (build_relations): Use bool, not int.
7776 * src/nullable.c (nullable_compute): Likewise.
7777 * src/print.c (print_reductions): Likewise.
7778 * src/tables.c (action_row, pack_vector): Likewise.
7779 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
7780 * src/output.c (prepare): Use it.
7781 * src/output.c (token_definitions_output,
7782 symbol_destructors_output, symbol_destructors_output): Use string,
7783 not boolean integer, to keep track of whether to output separator.
7784 * src/print_graph.c (print_core): Likewise.
7785 * src/state.c (state_rule_lookaheads_print): Likewise.
7786
7787 * config/install-sh: Sync from automake 1.7.5.
7788
7789 2003-05-14 Paul Eggert <eggert@twinsun.com>
7790
7791 * src/parse-gram.y (rules_or_grammar_declaration): Require a
7792 semicolon after a grammar declaration, in the interest of possible
7793 future changes to the Bison input language.
7794 Do not allow a stray semicolon at the start of the grammar.
7795 (rhses.1): Allow one or more semicolons after any rule, including
7796 just before "|" as required by POSIX.
7797 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
7798 grammar.
7799
7800 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
7801
7802 %parse-param support for lalr1.cc.
7803
7804 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
7805 b4_cc_constructor_calls, b4_cc_constructor_call,
7806 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
7807 definitions.
7808 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
7809 parse-param arguments.
7810 (yy::b4_parser_class_name): Declare instance variables to
7811 hold parse-param arguments.
7812 * tests/calc.at: s/value/semantic_value/ because value clashes
7813 with a member of yy::b4_parser_class_name. Adjust C++ code
7814 to handle %parse-param. Enable %parse-param test in C++.
7815
7816 2003-05-12 Paul Eggert <eggert@twinsun.com>
7817
7818 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
7819 English a bit. Fix fclose typo. Change "const char" to "char
7820 const", and use ANSI C rather than K&R for "main". Suggest
7821 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
7822 and suggest yy_switch_to_buffer.
7823
7824 2003-05-05 Paul Eggert <eggert@twinsun.com>
7825
7826 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
7827 C89. This avoids a diagnostic on compilers that define __STDC__
7828 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
7829 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7830
7831 2003-05-03 Paul Eggert <eggert@twinsun.com>
7832
7833 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
7834 Do not overrun array bounds.
7835 This should fix a bug reported today by Olatunji Oluwabukunmi in
7836 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
7837
7838 2003-04-29 Akim Demaille <akim@epita.fr>
7839
7840 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
7841 * src/getargs.c, src/getargs.h: here, as bool, not int.
7842 (nondeterministic_parser): New.
7843 * src/parse-gram.y, src/scan-gram.l: Support
7844 %nondeterministic-parser.
7845 * src/output.c (prepare): Use nondeterministic_parser instead
7846 of glr_parser where appropriate.
7847 * src/tables.c (conflict_row, action_row, save_row)
7848 (token_actions, token_actions, pack_vector): Ditto.
7849
7850 2003-04-29 Akim Demaille <akim@epita.fr>
7851
7852 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
7853
7854 2003-04-29 Akim Demaille <akim@epita.fr>
7855
7856 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
7857 with %pure-parser and %locations to exercise the patch from Yakov
7858 Markovitch below.
7859
7860 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
7861
7862 * data/yacc.c: (b4_lex_param): Corrected for the case where
7863 %lex-param is provided and %pure-parser isn't.
7864
7865 2003-04-27 Paul Eggert <eggert@twinsun.com>
7866
7867 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
7868 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
7869 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
7870 if it is not defined.
7871 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
7872
7873 2003-04-26 Paul Eggert <eggert@twinsun.com>
7874
7875 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
7876 Declare to be of type suitable for the ninf value itself, not of
7877 type suitable for the corresponding table, since the latter might
7878 be unsigned but the ninf value might be negative. This fixes a
7879 bug reported by Alexandre Duret-Lutz in
7880 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
7881
7882 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
7883 invokes it. We shouldn't invoke it twice because it will attempt
7884 to put error.o in the archive twice. This fixes a glitch reported
7885 by Martin Mokrejs in
7886 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7887
7888 2003-04-21 Paul Eggert <eggert@twinsun.com>
7889
7890 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
7891 to gnulib.
7892
7893 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
7894
7895 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
7896 Fix obvious typo that results in uncompilable GLR parsers
7897 when both %pure-parser and %locations are used. (trivial change)
7898
7899 2003-04-17 Paul Eggert <eggert@twinsun.com>
7900
7901 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
7902 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
7903 Do not insert the expected token via unput, as this runs afoul
7904 of a POSIX-compatibility bug in flex 2.5.31.
7905 All uses changed to BEGIN the parent state,
7906 since we no longer insert the expected token via unput.
7907 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
7908 that is no longer emitted after the above change.
7909
7910 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
7911 the first one. This change is from Paul Hilfinger, and it fixes
7912 regression reported by Werner Lemberg in
7913 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
7914
7915 (resolve_sr_conflict): Don't invoke state_errs_set
7916 unless one or more tokens have been explicitly made errors.
7917 Otherwise, the above change causes Bison to abort.
7918
7919 * tests/existing.at (GNU pic Grammar): New test case, taken from
7920 Lemberg's email.
7921
7922 2003-03-31 Akim Demaille <akim@epita.fr>
7923
7924 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
7925
7926 2003-03-31 Akim Demaille <akim@epita.fr>
7927
7928 * src/output.c (prepare_symbols): Avoid trailing spaces in the
7929 output.
7930
7931 2003-03-31 Akim Demaille <akim@epita.fr>
7932
7933 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
7934 From Paul Hilfinger.
7935
7936 2003-03-29 Akim Demaille <akim@epita.fr>
7937
7938 * m4/error.m4: Do not put under dynamic conditions some code which
7939 expansion is under static control.
7940
7941 2003-03-29 Akim Demaille <akim@epita.fr>
7942
7943 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
7944
7945 2003-03-29 Akim Demaille <akim@epita.fr>
7946
7947 * doc/bison.texinfo (Strings are Destroyed): New.
7948
7949 2003-03-13 Paul Eggert <eggert@twinsun.com>
7950
7951 * .cvsignore: Add configure.lineno.
7952 * src/.cvsignore: Add yacc.
7953 * tests/.cvsignore: Add testsuite.log.
7954 * doc/fdl.texi: Sync with latest FSF version.
7955
7956 2003-03-12 Paul Eggert <eggert@twinsun.com>
7957
7958 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
7959 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
7960 cursor, instead of leaving it undefined. This fixes a bug
7961 reported by Tim Van Holder in
7962 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
7963 * tests/input.at (Torturing the Scanner): Test the scanner on
7964 an empty input file, which was Tim Van Holder's test case.
7965
7966 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
7967 <sys/resource.h> can be included, include sys/time.h and
7968 sys/times.h first, if available. This works around the SunOS
7969 4.1.4 porting bug reported by Bruce Becker in
7970 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
7971
7972 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
7973 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
7974 AC_HEADER_SYS_WAIT.
7975
7976 Merge changes from gnulib. This was prompted because the CVS
7977 snapshot didn't build on Solaris 7 due to strnlen problems.
7978
7979 These changes need to be merged back into gnulib:
7980 * lib/hash.c: Include <stdbool.h> unconditionally.
7981 * m4/onceonly.m4 (m4_quote): New macro.
7982 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
7983 Quote AC_FOREACH variable-expansions properly.
7984 The 2003-01-03 obstack.h change also needs merging.
7985 {end of changes requiring merging}
7986
7987 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7988 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
7989 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
7990 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
7991 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
7992 New files, imported from gnulib.
7993 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
7994 above.
7995
7996 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
7997 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
7998 gnulib sources.
7999
8000 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
8001 Add.
8002 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
8003 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
8004 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
8005 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
8006 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
8007 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
8008 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
8009 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
8010 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
8011 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
8012 (jm_PREREQ_ARGMATCH): Remove.
8013 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
8014 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
8015
8016 * src/system.h: Include <stdbool.h> unconditionally.
8017
8018 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
8019 assuming at least C89 in the bitset code for some time now.
8020
8021 2003-03-03 Akim Demaille <akim@epita.fr>
8022
8023 * ro.po: New.
8024
8025 2003-03-02 Akim Demaille <akim@epita.fr>
8026
8027 * doc/bison.texinfo (Table of Symbols): Reactivate the
8028 documentation for %lex-param, and %parse-param.
8029
8030 2003-03-02 Akim Demaille <akim@epita.fr>
8031
8032 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
8033 generate verbose error messages.
8034 Use the number of tokens as an upper bound in yytname, as it
8035 cannot be a non terminal.
8036
8037 2003-03-02 Akim Demaille <akim@epita.fr>
8038
8039 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
8040 message.
8041
8042 2003-03-02 Akim Demaille <akim@epita.fr>
8043
8044 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
8045 Use them to exercise yycheck overrun.
8046 Based on Andrew Suffield's grammar.
8047
8048 2003-03-02 Akim Demaille <akim@epita.fr>
8049
8050 Create tests/local.at for Bison generic testing macros.
8051
8052 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
8053 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
8054 This new file.
8055 * tests/calc.at (AT_CHECK_CALC): Adjust.
8056 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
8057 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
8058 * tests/local.at: here.
8059 (AT_COMPILE_CXX): Tags the tests using it as c++.
8060 Ignore the test if CXX is not functional.
8061
8062 2003-03-01 Paul Eggert <eggert@twinsun.com>
8063
8064 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
8065 not loc->end, since loc->end might contain garbage and this leads
8066 to undefined behavior on some platforms.
8067 (id_loc, token_start): Use (IF_LINTed) initial values that do not
8068 depend on *loc, so that the reader doesn't give the the false
8069 impression that *loc is initialized.
8070 (<INITIAL>"%%"): Do not bother setting code_start, since its value
8071 does not survive the return.
8072
8073 2003-03-01 Akim Demaille <akim@epita.fr>
8074
8075 * src/scan-gram.l (code_start): Always initialize it when entering
8076 into yylex, as SC_EPILOGUE is activated *before* the corresponding
8077 yylex invocation. An alternative would be making it static, but
8078 then it starts with the second %%'s beginning, instead of its end.
8079
8080 2003-02-28 Paul Eggert <eggert@twinsun.com>
8081
8082 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
8083 around a UnixWare 7.1.1 porting bug reported by John Hughes in
8084 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
8085
8086 2003-02-26 Paul Eggert <eggert@twinsun.com>
8087
8088 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
8089 Remove Sequent/Pyramid discussion (nobody uses them any more).
8090 Merge VMS and MS-DOS discussion; these ports may well be dead
8091 but let's keep mentioning them for now. Put <> around email
8092 addresses. Add copyright notice.
8093
8094 2003-02-24 Paul Eggert <eggert@twinsun.com>
8095
8096 * data/glr.c (yy_reduce_print): yylineno -> yylno,
8097 to avoid collision with flex use of yylineno.
8098 Problem reported by Bruce Lilly in
8099 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
8100 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8101 * data/yacc.c (yy_reduce_print): Likewise.
8102
8103 * config/depcomp: Sync with Automake 1.7.3.
8104
8105 2003-02-21 Akim Demaille <akim@epita.fr>
8106
8107 * data/lalr1.cc: Use temporary variables instead of casts to
8108 change integer types.
8109 Suggested by Paul Eggert.
8110
8111 2003-02-21 Akim Demaille <akim@epita.fr>
8112
8113 * doc/bison.texinfo: Use "location" consistently to refer to @n,
8114 to avoid confusions with lalr1.cc's notion of Position.
8115 Suggested by Paul Eggert.
8116
8117 2003-02-20 Akim Demaille <akim@epita.fr>
8118
8119 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
8120 before initial_columns.
8121 (location.hh): Use consistent variable names when defining the
8122 operator<<.
8123 Use "last" so that we subtract from Positions, not from unsigned.
8124
8125 2003-02-20 Akim Demaille <akim@epita.fr>
8126
8127 * data/lalr1.cc (position.hh): New subfile, including the extended
8128 and Doxygen'ed documentation of class Position.
8129 (location.hh): Use it.
8130 Document a` la Doxygen.
8131 With the help of Benoit Perrot.
8132
8133 2003-02-20 Akim Demaille <akim@epita.fr>
8134
8135 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
8136 AT_YACC_IF.
8137 Redefine AT_YYERROR_SEES_LOC_IF using it.
8138 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
8139 not defined.
8140 Don't use the location in yy::Parser::error_ and
8141 yy::Parser::print_ when not %locations.
8142 Activate more lalr1.cc tests.
8143
8144 2003-02-19 Akim Demaille <akim@epita.fr>
8145
8146 * data/lalr1.cc: When displaying a line number, be sure to make it
8147 an int.
8148
8149 2003-02-19 Akim Demaille <akim@epita.fr>
8150
8151 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
8152 Remove, useless.
8153 (YYABORT, YYACCEPT, YYERROR): New.
8154 * tests/calc.at: Renable the lalr1.cc test.
8155
8156 2003-02-19 Akim Demaille <akim@epita.fr>
8157
8158 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
8159 error recovery, mixing with/without pops and discarding of the
8160 lookahead.
8161 Exercise YYERROR.
8162 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
8163
8164 2003-02-17 Paul Eggert <eggert@twinsun.com>
8165
8166 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
8167 * tests/testsuite.at (AT_COMPILE): Use them.
8168 This fixes the testsuite problem reported by Robert Lentz in
8169 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
8170
8171 2003-02-12 Paul Eggert <eggert@twinsun.com>
8172
8173 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
8174 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
8175 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
8176 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
8177 Check for malloc failure, for consistency with yacc.c.
8178 (yytname_size): Remove, for consistency with yacc.c.
8179
8180 The bug still remains in data/lalr1.cc, as I didn't have time
8181 to fix it there.
8182
8183 2003-02-06 Akim Demaille <akim@epita.fr>
8184
8185 * configure.ac (GXX): Rename as...
8186 (CXX): this, to keep the original Autoconf semantics.
8187 Require 2.57.
8188 * data/lalr1.cc: Fix b4_copyright invocations.
8189 If YYDEBUG is not defined, don't depend upon name_ being defined.
8190 (location.hh): Include string and iostream.
8191 (Position::filename): New member.
8192 (Position::Position ()): New.
8193 (operator<< (Position)): New.
8194 (operator- (Position, int)): New.
8195 (Location::first, Location::last): Rename as...
8196 (Location::begin, Location::end): these, to mock the conventional
8197 iterator names.
8198 (operator<< (Location)): New.
8199 * tests/atlocal.in (CXX): New.
8200 * tests/testsuite.at (AT_COMPILE_CXX): New.
8201 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
8202 locations in a more synthetic way.
8203 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
8204 lalr1.cc is used.
8205 Adjust the C locations to match those from Emacs: first column is
8206 column 0.
8207 Change all the expected results.
8208 Conform to the GCS: simplify the locations when applicable.
8209 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
8210 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
8211 these CPP macros with the m4 macros new defined by...
8212 (AT_CHECK_PUSHDEFS): this, i.e.:
8213 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
8214 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
8215 New macros.
8216 (AT_CHECK_POPDEFS): Undefine them.
8217 (AT_CHECK_CALC_LALR1_CC): New.
8218 Use it for the first lalr1.cc test.
8219
8220 2003-02-04 Akim Demaille <akim@epita.fr>
8221
8222 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
8223 Location as is defined.
8224
8225 2003-02-04 Akim Demaille <akim@epita.fr>
8226
8227 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
8228 name_ being defined.
8229
8230 2003-02-03 Paul Eggert <eggert@twinsun.com>
8231
8232 * src/gram.h (start_symbol): Remove unused decl.
8233
8234 Use more-consistent naming conventions for local vars.
8235
8236 * src/derives.c (derives_compute): Change type of local var from
8237 int to rule_number.
8238 * src/gram.c (grammar_rules_partial_print): Likewise.
8239 * src/print.c (print_core): Likewise.
8240 * src/reduce.c (reduce_grammar_tables): Likewise.
8241
8242 * src/gram.c (grammar_dump): Change name of item_number *
8243 local var from r to rp.
8244 * src/nullable.c (nullable_compute): Likewise.
8245
8246 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
8247
8248 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
8249 for symbol or symbol_number var.
8250 * src/reader.c (grammar_start_symbol_set): Likewise.
8251 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
8252 Likewise.
8253 * src/state.c (transitions_to): Likewise.
8254 * src/state.h: Likewise.
8255 * src/tables.c (symbol_number_to_vector_number): Likewise.
8256
8257 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
8258 char * var.
8259
8260 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
8261 var.
8262
8263 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
8264 var.
8265
8266 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
8267 Use str, not s, for char * var. Use ch, not c, for character var.
8268 Use size for size var.
8269
8270 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
8271 char * var.
8272 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
8273 uniqstr var.
8274 * src/uniqstr.h: Likewise.
8275
8276 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8277 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8278 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
8279 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
8280 param to have same name as that of enum, so that we don't use
8281 "s" to stand for a non-state.
8282
8283 2003-02-02 Akim Demaille <akim@epita.fr>
8284
8285 * src/scan-skel.l: Scan more than one inert character per yylex
8286 invocation.
8287
8288 2003-02-01 Paul Eggert <eggert@twinsun.com>
8289
8290 Version 1.875a.
8291
8292 * po/LINGUAS: Add ms.
8293
8294 2003-01-30 Akim Demaille <akim@epita.fr>
8295
8296 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
8297
8298 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8299
8300 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
8301 of $1.
8302
8303 Changes in response to error report by S. Eken: GLR mode does not
8304 handle negative $ indices or $ indices in embedded rules correctly.
8305 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
8306
8307 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
8308 (b4_rhs_location): Ditto.
8309 (yyfill): New function to copy from stack tree into array
8310 incrementally.
8311 (yyuserAction): Modify to allow incremental move of semantic values
8312 to rhs array when in GLR mode.
8313 Define YYFILL to use in user-defined actions to fill semantic array
8314 as needed.
8315 Remove dummy use of yystack, as there is now a guaranteed use.
8316 (yydoAction): Modify to allow incremental move of semantic values
8317 to rhs array when in GLR mode.
8318 (yyresolveAction): Ditto.
8319 (yyglrShiftDefer): Update comment.
8320 (yyresolveStates): Use X == NULL for pointers, not !X.
8321 (yyglrReduce): Ditto.
8322 (yydoAction): Ditto
8323
8324 * tests/glr-regr1.at: Rename to ...
8325 * tests/glr-regression.at: Add new regression test for the problems
8326 described above (adapted from S. Eken).
8327 Update copyright notice.
8328 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
8329 * tests/Makefile.am: Ditto.
8330
8331 2003-01-28 Paul Eggert <eggert@twinsun.com>
8332
8333 * data/lalr1.cc: Do not use @output_header_name@ unless
8334 b4_defines_flag is set. This fixes two bugs reported by
8335 Tim Van Holder in
8336 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
8337 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
8338
8339 2003-01-21 Paul Eggert <eggert@twinsun.com>
8340
8341 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
8342 we don't need to worry about yyerrlab1 being reported as an
8343 "unused label" by non-GCC C compilers. The downside is that if
8344 locations are used then a couple of statements are duplicated each
8345 time YYERROR is invoked, but the upside is that the warnings
8346 should vanish.
8347 (yyerrlab1): Move code to YERROR.
8348 (yyerrlab2): Remove. Change uses back to yyerrlab1.
8349 This reverts some of the 2002-12-27 change.
8350
8351 2003-01-17 Paul Eggert <eggert@twinsun.com>
8352
8353 * src/output.c (symbol_printers_output): Fix typo that led
8354 to core dump. Problem reported by Antonio Rus in
8355 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
8356
8357 2003-01-13 Akim Demaille <akim@epita.fr>,
8358 Quoc Peyrot <chojin@lrde.epita.fr>,
8359 Robert Anisko <anisko_r@lrde.epita.fr>
8360
8361 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
8362 when the stacks contain one element, as the loop would otherwise
8363 free the last state, and then use the top state (the one we just
8364 popped). This means that the initial elements will not be freed
8365 explicitly, as is the case in yacc.c; it is not a problem, as
8366 these elements have fake values.
8367
8368 2003-01-11 Paul Eggert <eggert@twinsun.com>
8369
8370 * NEWS: %expect-violations are now just warnings, reverting
8371 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
8372 bootstrapping problem reported by Matthias Klose; see
8373 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
8374 * src/conflicts.c (conflicts_print): Likewise.
8375 * tests/conflicts.at (%expect not enough, %expect too much,
8376 %expect with reduce conflicts): Likewise.
8377 * doc/bison.texinfo (Expect Decl): Document this. Also mention
8378 that the warning is enabled if the number of conflicts changes
8379 (not necessarily increases).
8380
8381 * src/getargs.c (version): Update copyright year.
8382
8383 2003-01-09 Akim Demaille <akim@epita.fr>
8384
8385 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
8386
8387 2003-01-08 Paul Eggert <eggert@twinsun.com>
8388
8389 * Makefile.maint (WGETFLAGS):
8390 New macro, containing "-C off" to disable proxy caches.
8391 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
8392 (rel-check): Use $(WGET) instead of wget.
8393
8394 2003-01-06 Paul Eggert <eggert@twinsun.com>
8395
8396 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
8397 the GLR paper of Scott, Johnstone and Hussain.
8398
8399 2003-01-04 Paul Eggert <eggert@twinsun.com>
8400
8401 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
8402 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
8403 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
8404 (EXTRA_LIBRARIES): New var, for liby.a.
8405 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
8406 (EXTRA_SCRIPTS): New var, for yacc.
8407
8408 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
8409 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
8410 Problem reported by Nelson H. F. Beebe.
8411
8412 2003-01-03 Paul Eggert <eggert@twinsun.com>
8413
8414 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
8415 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8416 when compiling Bison 1.875's `bitset bset = obstack_alloc
8417 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8418
8419 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
8420 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
8421 grow to a huge size with typical invocation.
8422
8423 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
8424 Use the pattern recommended by Autoconf 2.57, except also protect
8425 against double-definition.
8426 * src/system.h: Likewise.
8427 Portability issues reported by Nelson H. F. Beebe.
8428
8429 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
8430 All uses changed. Provide a definition in both C and C++.
8431 (yytrue, yyfalse): Define even if defined (__cplusplus).
8432
8433 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
8434 Reported by Nelson H. F. Beebe.
8435
8436 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
8437
8438 2003-01-02 Paul Eggert <eggert@twinsun.com>
8439
8440 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
8441 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
8442 Bug reported by Nelson H. F. Beebe.
8443
8444 2003-01-01 Paul Eggert <eggert@twinsun.com>
8445
8446 * Version 1.875.
8447
8448 2002-12-30 Paul Eggert <eggert@twinsun.com>
8449
8450 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
8451 Moved here from...
8452 (<INITIAL>","): Here. This causes stray "," to be treated
8453 more uniformly.
8454
8455 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
8456 last brace in braced code when not in Yacc mode, for compatibility
8457 with Bison 1.35. This resurrects the 2001-12-15 patch to
8458 src/reader.c.
8459
8460 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
8461 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
8462
8463 2002-12-28 Paul Eggert <eggert@twinsun.com>
8464
8465 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
8466 that of SYM's type. This fixes Debian bug 168069, reported by
8467 Thomas Olsson.
8468
8469 2002-12-28 Paul Eggert <eggert@twinsun.com>
8470
8471 Version 1.75f.
8472
8473 Switch back to the Yacc style of conflict reports, undoing some
8474 of the 2002-07-30 change.
8475 * doc/bison.texinfo (Understanding): Use Yacc style for
8476 conflict reports. Also, use new way of locating rules.
8477 * src/conflicts.c (conflict_report):
8478 Renamed from conflict_report_yacc, removing the old
8479 'conflict_report'. Translate the entire conflict report at once,
8480 so that we don't assume that "," has the same interpretation in
8481 all languages.
8482 (conflicts_output): Use Yacc-style conflict report for each state,
8483 instead of our more-complicated style.
8484 (conflicts_print): Use Yacc-style conflict report, except print
8485 the input file name when not emulating Yacc.
8486 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
8487 Conflicted Reduction, %expect not enough, %expect too much,
8488 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
8489 * tests/existing.at (GNU Cim Grammar): Likewise.
8490 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
8491
8492 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
8493 fatal): Don't invoke fflush; it's not needed and it might even be
8494 harmful for stdout, as stdout might not be open.
8495 * src/reduce.c (reduce_print): Likewise.
8496
8497 2002-12-27 Paul Eggert <eggert@twinsun.com>
8498
8499 Fix a bug where error locations were not being recorded correctly.
8500 This problem was originally reported by Paul Hilfinger in
8501 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
8502
8503 * data/yacc.c (yyparse): New local var yylerrsp, to record the
8504 top of the location stack's error locations.
8505 (yyerrlab): Set it. When discarding a token, push its location
8506 onto yylerrsp so that we don't lose track of the error's end.
8507 (yyerrlab1): Now is only the target of YYERROR, so that we can
8508 properly record the location of the action that failed. For GCC
8509 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
8510 GCC warning about yyerrlab1 being unused if YYERROR is unused.
8511 (yyerrlab2): New label, which yyerrlab now falls through to.
8512 Compute the error's location by applying YYLLOC_DEFAULT to
8513 the locations of all the symbols that went into the error.
8514 * doc/bison.texinfo (Location Default Action): Mention that
8515 YYLLOC_DEFAULT is also invoked for syntax errors.
8516 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8517 Error locations include the locations of all the tokens that were
8518 discarded, not just the last token.
8519
8520 2002-12-26 Paul Eggert <eggert@twinsun.com>
8521
8522 * src/files.c: Include quote.h.
8523 (compute_output_file_names): Warn if we detect conflicting
8524 outputs to the same file. This should catch the misunderstanding
8525 exemplified by Debian Bug 165349, reported by Bruce Stephens..
8526
8527 * src/conflicts.c (conflicts_print): If the user specifies
8528 "%expect N", report an error if there are any reduce/reduce
8529 conflicts. This is what the manual says should happen.
8530 This fixes Debian bug 130890, reported by Anthony DeRobertis.
8531 * tests/conflicts.at (%expect with reduce conflicts): New test.
8532
8533 Don't use m4_include on relative file names, as it doesn't work as
8534 desired if there happens to be a file with that name under ".".
8535
8536 * m4sugar/version.m4: Remove; it was included but it wasn't used.
8537 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
8538 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
8539 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
8540 * src/output.c (output_skeleton): Use full path names when
8541 specifying a file to include; don't rely on include path, as
8542 it's unreliable when the working file contains a file with
8543 that name.
8544
8545 2002-12-25 Paul Eggert <eggert@twinsun.com>
8546
8547 Remove obsolete references to bison.simple and bison.hairy.
8548 Problem mentioned by Aubin Mahe in
8549 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
8550 * data/glr.c: Comment fix.
8551 * doc/bison.1: Remove references. Also, mention "yacc".
8552
8553 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
8554 with -g option.
8555
8556 * src/parse-gram.y (declaration): Use enum "report_states" rather
8557 than its numeric value 1.
8558
8559 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
8560 opening a new one. This fixes Debian bug 165349, reported by
8561 Bruce Stephens.
8562
8563 2002-12-24 Paul Eggert <eggert@twinsun.com>
8564
8565 Version 1.75e.
8566
8567 * Makefile.maint (cvs-update): Don't assume that the shell
8568 supports $(...), as Solaris sh doesn't.
8569
8570 * src/parse-gram.y (lloc_default): Remove test for empty
8571 nonterminals at the end, since it didn't change the result.
8572
8573 2002-12-24 Paul Eggert <eggert@twinsun.com>
8574
8575 If the user does not define YYSTYPE as a macro, Bison now declares it
8576 using typedef instead of defining it as a macro. POSIX requires this.
8577 For consistency, YYLTYPE is also declared instead of defined.
8578
8579 %union directives can now have a tag before the `{', e.g., the
8580 directive `%union foo {...}' now generates the C code
8581 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
8582 The default union tag is `YYSTYPE', for compatibility with Solaris 9
8583 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
8584 instead of `yyltype'.
8585
8586 `yystype' and `yyltype' are now obsolescent macros instead of being
8587 typedefs or tags; they are no longer documented and will be
8588 withdrawn in a future release.
8589
8590 * data/glr.c (b4_location_type): Remove.
8591 (YYSTYPE): Renamed from yystype.
8592 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
8593 (struct YYLTYPE): Renamed from struct yyltype.
8594 (YYLTYPE): Renamed from yyltype.
8595 (yyltype, yystype): New (and obsolescent) macros,
8596 for backward compatibility.
8597 * data/yacc.c: Likewise.
8598
8599 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
8600 does not specify a union tag. This is for compatibility with
8601 Solaris 9 yacc.
8602
8603 * src/parse-gram.y (add_param): 2nd arg is now char * not char
8604 const *, since it is now modified by stripping surrounding { }.
8605 (current_braced_code): Remove.
8606 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
8607 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
8608 trailing " {...}". Now of type <chars>.
8609 (grammar_declaration): Adjust to bundled tokens.
8610 (code_content): Remove; stripping is now done by add_param.
8611 (print_token_value): Print contents of bundled tokens.
8612 (token_name): New function.
8613
8614 * src/reader.h (braced_code, current_braced_code): Remove.
8615 (token_name): New decl.
8616
8617 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
8618 token_type, not braced_code code_kind. All uses changed.
8619 (SC_PRE_CODE): New state, for scanning after a keyword that
8620 has (or usually has) an immediately-following braced code.
8621 (token_type): New local var, to keep track of which token type
8622 to return when scanning braced code.
8623 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
8624 <INITIAL>"%parse-param", <INITIAL>"%printer",
8625 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
8626 instead of returning a token type immediately.
8627 (<INITIAL>"{"): Set token type.
8628 (<SC_BRACED_CODE>"}"): Use it.
8629 (handle_action_dollar, handle_action_at): Now returns bool
8630 indicating success. Fail if ! current_rule; this prevents a core dump.
8631 (handle_symbol_code_dollar, handle_symbol_code_at):
8632 Remove; merge body into caller.
8633 (handle_dollar, handle_at): Complain in invalid contexts.
8634
8635 * NEWS, doc/bison.texinfo: Document the above.
8636 * NEWS: Fix years and program names in copyright notice.
8637
8638 2002-12-17 Paul Eggert <eggert@twinsun.com>
8639
8640 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
8641 Reporting, Table of Symbols): Omit mentions of %lex-param and
8642 %parse-param from the documentation for now.
8643
8644 2002-12-15 Paul Eggert <eggert@twinsun.com>
8645
8646 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
8647 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
8648 lookahead symbol, and which sets yychar in parser actions) and it
8649 disagreed with the Bison documentation. Bug
8650 reported by Andrew Walrond.
8651
8652 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
8653 as the caller now does that.
8654 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
8655 (YYEMPTY): Parenthesize right hand side, since others use it.
8656 (yyparse): Don't assume that our generated code is the only code
8657 that sets yychar.
8658
8659 2002-12-13 Paul Eggert <eggert@twinsun.com>
8660
8661 Version 1.75d.
8662
8663 POSIX requires a "yacc" command.
8664 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
8665 (MOSTLYCLEANFILES): Add yacc.
8666 (yacc): New rule.
8667 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
8668 as an alias for bison y.
8669
8670 * po/LINGUAS: Add da.
8671
8672 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
8673 problem with latest <getopt.h>.
8674 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
8675
8676 * doc/fdl.texi: Upgrade to 1.2.
8677 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
8678 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
8679 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
8680 gnulib.
8681 * config/install-sh: Sync with autotools.
8682
8683 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
8684 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8685 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
8686 locations are requested.
8687 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
8688 locations are requested.
8689
8690 2002-12-12 Paul Eggert <eggert@twinsun.com>
8691
8692 Remove unportable casts and storage allocation tricks.
8693 While we're at it, remove almost all casts, since they
8694 usually aren't needed and are a sign of trouble.
8695
8696 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
8697
8698 * src/derives.c (derives_compute): Do not subtract NTOKENS from
8699 the pointer DSET returned by malloc; this isn't portable.
8700 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
8701 Similarly for DERIVES.
8702 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
8703 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
8704 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
8705
8706 * src/derives.c (derives_compute): Do not bother invoking
8707 int_of_rule_number, since rule numbers are integers.
8708
8709 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
8710 rather than XMALLOC (char, N).
8711
8712 * src/files.c (filename_split): Rewrite to avoid cast.
8713
8714 * src/gram.h (symbol_number_as_item_number,
8715 item_number_as_symbol_number, rule_number_as_item_number,
8716 item_number_as_rule_number):
8717 Now inline functions rather than macros, to avoid casts.
8718 * src/state.h (state_number_as_int): Likewise.
8719 * src/tables.c (state_number_to_vector_number,
8720 symbol_number_to_vector_number): Likewise.
8721
8722 * src/gram.h (int_of_rule_number): Remove; no longer used.
8723
8724 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
8725 since the resulting storage is always stored into.
8726
8727 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
8728 where it's needed.
8729
8730 * src/muscle_tab.c (muscle_m4_output):
8731 Now inline. Return bool, not int.
8732 * src/state.c (state_compare): Likewise.
8733 * src/symtab.c (symbol_check_defined,
8734 symbol_check_alias_consistency, symbol_pack, symbol_translation,
8735 hash_compare_symbol, hash_symbol):
8736 Likewise.
8737 * src/uniqstr.c (uniqstr_print): Likewise.
8738 * src/muscle_tab.c (muscle_m4_output_processor):
8739 New function, to avoid casts.
8740 * src/state.c (state_comparator, stage_hasher): Likewise.
8741 * src/symtab.c (symbol_check_defined_processor,
8742 symbol_check_alias_consistency_processor, symbol_pack_processor,
8743 symbol_translation_processor, hash_symbol_comparator,
8744 hash_symbol_hasher): Likewise.
8745 * src/uniqstr.c (uniqstr_print_processor): Likewise.
8746 * src/muscle_tab.c (muscles_m4_output):
8747 Use new functions instead of casting old functions unportably.
8748 * src/state.c (state_hash_new): Likewise.
8749 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
8750 symbols_token_translations_init):
8751 Likewise.
8752 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
8753
8754 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
8755 var instead of casting to long, to avoid casts.
8756 (prepare_states): Use MALLOC rather than alloca, so that we don't
8757 have to worry about alloca.
8758 * src/state.c (state_hash_lookup): Likewise.
8759
8760 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
8761 local var instead of casting to unsigned char, to avoid casts.
8762
8763 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
8764 STATE_ALLOC): Remove.
8765 (transitions_new, errs_new, reductions_new, state_new): Use malloc
8766 rather than calloc, and use offsetof to avoid allocating slightly
8767 too much storage.
8768 (state_new): Initialize all members.
8769
8770 * src/state.c (state_hash): Use unsigned accumulator, not signed.
8771
8772 * src/symtab.c (symbol_free): Remove; unused.
8773 (symbol_get): Remove cast in lhs of assignment.
8774 (symbols_do): Now static. Accept generic arguments, not
8775 hashing-related ones.
8776
8777 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
8778 (symbol_processor): Remove.
8779 (symbols_do): Remove decl; now static.
8780
8781 * src/system.h (alloca): Remove; decl no longer needed.
8782 (<stddef.h>): Include, for offsetof.
8783 (<inttypes.>, <stdint.h>): Include if available.
8784 (uintptr_t): New type, if system lacks it.
8785 (CALLOC, MALLOC, REALLOC): New macros.
8786 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
8787 new macros.
8788
8789 * src/tables.c (table_size): Now int, to pacify GCC.
8790 (table_grow, table_ninf_remap): Use signed table size.
8791 (save_row): Don't bother initializing locals when not needed.
8792 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
8793 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
8794
8795 * src/vcg.h: Correct misspellings.
8796
8797 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
8798
8799
8800 * src/getargs.c (getargs): Don't assume EOF == -1.
8801
8802 2002-12-09 Paul Eggert <eggert@twinsun.com>
8803
8804 Change identifier spellings to avoid collisions with names
8805 that are reserved by POSIX.
8806
8807 Don't use names ending in _t, since POSIX reserves them.
8808 For consistency, remove _e and _s endings -- they're weren't
8809 needed to remove ambiguity. All uses changed.
8810 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
8811 turn was just renamed from struniq_t.
8812 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
8813 which in turn was just renamed from struniq_processor_t.
8814 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
8815 in turn was renamed from hash_compare_struniq_t.
8816 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
8817 (state_list): Renamed from state_list_t.
8818 * src/assoc.h (assoc): Renamed from assoc_t.
8819 * src/conflicts.c (enum conflict_resolution): Renamed from
8820 enum conflict_resolution_e.
8821 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
8822 (rule_list): Renamed from rule_list_t.
8823 * src/getargs.h (enum trace): Renamed from enum trace_e.
8824 (enum report): Renamed from enum report_e.
8825 * src/gram.h (item_number): Renamed from item_number_t.
8826 (rule_number): Renamed from rule_number_t.
8827 (struct rule_s): Remove the "rule_s" part; not used.
8828 (rule): Renamed from rule_t.
8829 (rule_filter): Renamed from rule_filter_t.
8830 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
8831 (goto_list): Renamed from goto_list_t.
8832 * src/lalr.h (goto_number): Renamed from goto_number_t.
8833 * src/location.h (location): Renamed from location_t.
8834 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
8835 and moved here from:
8836 * src/muscle_tab.h (muscle_entry_t): here.
8837 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
8838 (rule_list): Renamed from rule_list_t.
8839 * src/print_graph.c (static_graph): Renamed from graph.
8840 * src/reader.h (braced_code): Renamed from braced_code_t.
8841 Remove brace_code_e tag.
8842 * src/relation.h (relation_node): Renamed from relation_node_t.
8843 (relation_nodes): Renamed from relation_nodes_t.
8844 (relation): Renamed from relation_t.
8845 * src/state.h (state_number): Renamed from state_number_t.
8846 (struct state): Renamed from struct state_s.
8847 (state): Renamed from state_t.
8848 (transitions): Renamed from transitions_t. Unused (and
8849 misspelled) transtion_s tag removed.
8850 (errs): Renamed from errs_t. Unused errs_s tag removed.
8851 (reductions): Renamed from reductions_t. Unused tag
8852 reductions_s removed.
8853 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
8854 (struct symbol_list): Renamed from struct symbol_list_s.
8855 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
8856 (struct symbol): Renamed from struct symbol_s.
8857 (symbol): Renamed from symbol_t.
8858 * src/tables.c (vector_number): Renamed from vector_number_t.
8859 (action_number): Renamed from action_t.
8860 * src/tables.h (base_number): Renamed from base_t.
8861 * src/vcg.h (enum color): Renamed from enum color_e.
8862 (enum textmode): Renamed from enum textmode_e.
8863 (enum shape): Renamed from enum shape_e.
8864 (struct colorentry): Renamed from struct colorentry_s.
8865 (struct classname): Renamed from struct classname_s.
8866 (struct infoname): Renamed from struct infoname_s.
8867 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
8868 (enum decision): Renamed from enum decision_e.
8869 (enum orientation): Renamed from enum orientation_e.
8870 (enum alignment): Renamed from enum alignment_e.
8871 (enum arrow_mode): Renamed from enum arrow_mode_e.
8872 (enum crossing_type): Renamed from enum crossing_type_e.
8873 (enum view): Renamed from enum view_e.
8874 (struct node): Renamed from struct node_s.
8875 (node): Renamed from node_t.
8876 (enum linestyle): Renamed from enum linestyle_e.
8877 (enum arrowstyle): Renamed from enum arrowstyle_e.
8878 (struct edge): Renamed from struct edge.
8879 (edge): Renamed from edge_t.
8880 (struct graph): Renamed from struct graph_s.
8881 (graph): Renamed from graph_t.
8882 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
8883 Rename value_t -> value.
8884 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
8885 value_t_as_yystype -> value_as_yystype.
8886
8887 Don't include <errno.h> in the mainstream code, since it
8888 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
8889 * lib/get-errno.c, lib/get-errno.h: New files.
8890 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
8891 get-errno.c.
8892 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
8893 * src/output.c (output_skeleton): Likewise.
8894 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
8895 instead of errno.
8896 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
8897 Likewise.
8898 (handle_action_dollar, handle_action_at): Likewise.
8899 * src/system.h: Do not include <errno.h>.
8900 (TAB_EXT): Renamed from EXT_TAB.
8901 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
8902
8903 Avoid str[a-z]*, since <string.h> reserves that name space.
8904 Change all instances of "struniq" in names to "uniqstr", and
8905 likewise for "STRUNIQ" and "UNIQSTR".
8906 * src/uniqstr.c: Renamed from src/struniq.c.
8907 * src/uniqstr.h: Renamed from src/struniq.h.
8908 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
8909 * src/files.c (strsuffix): Remove; unused.
8910 (concat2): Renamed from stringappend. Now static.
8911 * src/files.h (strsuffix, stringappend): Remove; unused.
8912 * src/parse-gram.y (<chars>): Renamed from <string>.
8913 (<uniqstr>): Renamed from <struniq>.
8914 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
8915 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
8916 (struct graph_s.expand): Renamed from struct graph_s.stretch.
8917 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
8918 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
8919 (N_EXPAND): Renamed from N_STRETCH.
8920
8921 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
8922 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
8923 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
8924 Remove; unused.
8925 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
8926 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
8927 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
8928 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
8929 (BASE_MAXIMUM): Renamed from BASE_MAX.
8930 (BASE_MINIMUM): Renamed from BASE_MIN.
8931 (ACTION_MAX): Remove; unused.
8932 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
8933 Unnecessary casts removed from above defines.
8934
8935
8936 Fix misspelling in names.
8937 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
8938 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
8939 G_NODE_ALIGNEMENT.
8940
8941
8942 * lib/timevar.c (timevar_report): Renamed from time_report,
8943 for consistency with other names.
8944 * lib/timevar.h (timevar_report): New decl.
8945 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
8946
8947
8948 Sort include-file uses.
8949
8950 Reorder all include files under src to be in the order "system.h".
8951 then the ../lib include files in angle brackets (alphabetized),
8952 then the . include files in double-quotes (alphabetized). Fix
8953 dependency breakages encountered in this process, as follows:
8954 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
8955 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
8956 * src/state.h: Include "symtab.h".
8957
8958 2002-12-08 Paul Eggert <eggert@twinsun.com>
8959
8960 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
8961 since this causes problems when __file__ contains character
8962 sequences like "@" that are treated specially by src/scan-skel.l.
8963 Instead, just use the file's basename. This fixes the bug
8964 reported by Martin Mokrejs in
8965 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
8966
8967 2002-12-06 Paul Eggert <eggert@twinsun.com>
8968
8969 Add support for rules that do not have trailing semicolons, as
8970 POSIX requires. Improve the quality of locations in Bison
8971 diagnostics.
8972
8973 * src/location.c: Include <quotearg.h>.
8974 (empty_location): Now const.
8975 (location_print): New function. Follow the recommendation of the
8976 GNU Coding Standards for locations that span file boundaries.
8977 * src/location.h: Do not include <quotearg.h>; no longer needed.
8978 (boundary): New type.
8979 (location_t): Use it. This allows locations to span file boundaries.
8980 All member uses changed: file -> start.file or end.file (as needed),
8981 first_line -> start.line, first_column -> start.column,
8982 last_line -> end.line, last_column -> end.column.
8983 (equal_boundaries): New function.
8984 (LOCATION_RESET, LOCATION_STEP): Remove.
8985 (LOCATION_PRINT): Remove. All callers changed to use location_print.
8986 (empty_location): Now const.
8987 (location_print): New decl.
8988 * src/parse-gram.y (lloc_default): New function, which handles
8989 empty locations more accurately.
8990 (YYLLOC_DEFAULT): Use it.
8991 (%token COLON): Remove.
8992 (%token ID_COLON): New token.
8993 (rules): Use it.
8994 (declarations, rules): Remove trailing semicolon.
8995 (declaration, rules_or_grammar_declaration):
8996 Allow empty (";") declaration.
8997 (symbol_def): Remove empty actions; no longer needed.
8998 (rules_or_grammar_declaration): Remove trailing semicolon.
8999 (semi_colon.opt): Remove.
9000 * src/reader.h: Include location.h.
9001 (scanner_cursor): New decl.
9002 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
9003 rolling our own.
9004 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
9005 of *loc.
9006 (STEP): Remove. No longer needed, now that adjust_location does
9007 the work. All uses removed.
9008 (scanner_cursor): New var.
9009 (adjust_location): Renamed from extend_location. It now sets
9010 *loc and adjusts the scanner cursor. All uses changed.
9011 Don't bother testing for CR.
9012 (handle_syncline): Remove location arg; now updates scanner cursor.
9013 All callers changed.
9014 (unexpected_end_of_file): Now accepts start boundary of token or
9015 comment, not location. All callers changed. Update scanner cursor,
9016 not the location.
9017 (SC_AFTER_IDENTIFIER): New state.
9018 (context_state): Renamed from c_context. All uses changed.
9019 (id_loc, code_start, token_start): New local vars.
9020 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
9021 processing of Yacc white space and equivalents here.
9022 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
9023 instead of returning ID immediately, since we need to search for
9024 a subsequent colon.
9025 (<INITIAL>"'", "\""): Save token_start.
9026 (<INITIAL>"%{", "{", "%%"): Save code_start.
9027 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
9028 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
9029 BEGIN context_state at end, not INITIAL.
9030 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
9031 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
9032 Return correct token start.
9033 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
9034 the start of a character, string or multiline comment is found.
9035 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
9036 Reduction): Adjust reported locations to match the more-precise
9037 results now expected.
9038 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
9039 * tests/reduce.at (Useless Rules, Reduced Automaton,
9040 Underivable Rules): Likewise.
9041 * tests/regression.at (Invalid inputs): No longer `expecting ";"
9042 or "|"' now that so many other tokens are allowed by the new grammar.
9043
9044 * src/complain.h (current_file): Remove duplicate decl;
9045 current_file is now owned by files.h.
9046 * src/complain.c, src/scan-gram.l: Include files.h.
9047
9048 2002-12-06 Paul Eggert <eggert@twinsun.com>
9049
9050 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
9051 promotes to int; it might be unsigned int.
9052 * data/yacc.c (yy_reduce_print): Likewise.
9053
9054 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
9055 be #defined in the prologue, not in the Bison declarations.
9056 This fixes Debian Bug 102878, reported by Shaul Karl.
9057
9058 2002-12-02 Paul Eggert <eggert@twinsun.com>
9059
9060 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
9061 * lib/strtoul.c: New file, from gnulib.
9062 This fixes a porting bug reported by Peter Klein in
9063 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
9064
9065 2002-11-30 Paul Eggert <eggert@twinsun.com>
9066
9067 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
9068 and put only a forward declaration in the prologue. This is for
9069 consistency with the other scanner helper functions.
9070
9071 Type clashes now generate warnings, not errors, since it
9072 appears that POSIX may allow some grammars with type clashes.
9073 * src/reader.c (grammar_current_rule_check): Warn about
9074 type clashes instead of complaining.
9075 * tests/input.at (Type Clashes): Expect warnings, not complaints.
9076
9077 Add Yacc library, since POSIX requires it.
9078 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
9079 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
9080 * lib/main.c, lib/yyerror.c: New files.
9081
9082 gram_error can be static; it need not be extern.
9083 * src/reader.h (gram_error): Remove decl.
9084 * src/parse-gram.y (gram_error): Now static. Add static decl.
9085 (print_token_value): Omit parameter names from forward decl,
9086 for consistency.
9087
9088 2002-11-29 Paul Eggert <eggert@twinsun.com>
9089
9090 * doc/bison.texinfo: Emphasize that yylex and yyerror must
9091 be declared before being used. E.g., one should typically
9092 declare them in the prologue. Use GNU coding style in examples.
9093 Put "const" consistently after the type it modifies. Mention
9094 that C99 supports "inline". Mention that yyerror traditionally
9095 returns "int".
9096
9097 %parse-param and %lex-param now take just one argument, the
9098 declaration; the argument name is deduced from the declaration.
9099
9100 * doc/bison.texinfo (Parser Function, Pure Calling, Error
9101 Reporting, Table of Symbols): Document this.
9102 * src/parse-gram.y (add_param): New function.
9103 (COMMA): Remove.
9104 (declaration): Implement new rule for %parse-param and %lex-param.
9105 * src/scan-gram.l: "," now elicits a warning, rather than being
9106 a token; this is more compatible with byacc.
9107 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
9108
9109 2002-11-27 Paul Eggert <eggert@twinsun.com>
9110
9111 Rename identifiers to avoid real and potential collisions.
9112
9113 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
9114 to avoid collision with lex macro described by Bruce Lilly in
9115 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
9116 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9117 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
9118 * src/parse-gram.y (print_token_value): Renamed from yyprint.
9119 All uses changed.
9120 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
9121 The name "yycontrol" violates the name space rules, and this stuff
9122 wasn't being used anyway.
9123 (input): Remove action; this stuff wasn't being used.
9124 (gram_error): Rename local variable yylloc -> loc.
9125 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
9126 (YY_DECL): Don't use "yy" at start of local variables.
9127 All uses changed, e.g., yylloc -> loc.
9128 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
9129 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
9130 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
9131 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
9132
9133 * src/parse-gram.y (gram_error): loc is now const *.
9134 * src/reader.h (gram_error): Likewise.
9135
9136 2002-11-24 Paul Eggert <eggert@twinsun.com>
9137
9138 Version 1.75c.
9139
9140 * tests/actions.at (Actions after errors): Use an output format
9141 more similar to that of the Printers and Destructors test.
9142 Test the position of the ';' token too.
9143 (Printers and Destructors): Likewise.
9144 (Printers and Destructors: %glr-parser): Remove for now, to avoid
9145 unnecessarily alarming people when the test fails.
9146
9147 * data/yacc.c (yyerrlab1): Move this label down, so that the
9148 parser does not discard the lookahead token if the user code
9149 invokes YYERROR. This change is required for POSIX conformance.
9150
9151 * lib/error.c: Sync with gnulib.
9152
9153 2002-11-22 Paul Eggert <eggert@twinsun.com>
9154
9155 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
9156 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
9157 * lib/xmalloc.c: Likewise.
9158
9159 2002-11-20 Paul Eggert <eggert@twinsun.com>
9160
9161 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
9162
9163 2002-11-20 Paul Eggert <eggert@twinsun.com>
9164
9165 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
9166 should use `if (! x) abort ();' rather than `assert (x);', and
9167 anyway it's one less thing to worry about configuring.
9168
9169 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
9170 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
9171 and replace all instances of assert with abort.
9172 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9173 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
9174
9175 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
9176 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
9177 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
9178 hash_find_entry, hash_rehash, hash_insert): Likewise.
9179 * src/conflicts.c (resolve_sr_conflict): Likewise.
9180 * src/lalr.c (set_goto_map, map_goto): Likewise.
9181 * src/nullable.c (nullable_compute): Likewise.
9182 * src/output.c (prepare_rules, token_definitions_output): Likewise.
9183 * src/reader.c (packgram, reader): Likewise.
9184 * src/state.c (state_new, state_free, state_transitions_set,
9185 state_reduction_find): Likewise.
9186 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
9187 symbol_pack): Likewise.
9188 * src/tables.c (conflict_row, pack_vector): Likewise.
9189 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9190 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9191 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
9192 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
9193
9194 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
9195 (ARGMATCH_CONSTRAINT): New macro.
9196 (ARGMATCH_ASSERT): Use it.
9197
9198 * src/system.h (verify): New macro.
9199 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
9200 rather than assert.
9201 * src/tables.c (tables_generate): Likewise.
9202
9203 * src/struniq.c (struniq_assert): Now returns void, and aborts
9204 if the assertion is false.
9205 (struniq_assert_p): Remove.
9206 * src/struniq.h: Likewise.
9207
9208 2002-11-18 Paul Eggert <eggert@twinsun.com>
9209
9210 * data/glr.c (yygetLRActions): Replace `yyindex' with
9211 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
9212 This fixes the regression with Sun ONE Studio 7 cc that I reported in
9213 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
9214
9215 2002-11-18 Akim Demaille <akim@epita.fr>
9216
9217 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
9218 space.
9219 From Tim Van Holder.
9220
9221 2002-11-17 Paul Eggert <eggert@twinsun.com>
9222
9223 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
9224 to "SyntaxError" for consistency with my 2002-11-15 change.
9225
9226 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
9227 not define to {}, since this breaks the common use of `YYDPRINTF
9228 ((...));' if a single statement is desired (e.g. before `else').
9229 Work around GCC warnings by surrounding corresponding calls with
9230 {} if needed.
9231 (yyhasResolvedValue): Remove unused function.
9232 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
9233 loop body.
9234 (yyreportSyntaxError): Renamed from yyreportParseError.
9235 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
9236 All uses changed.
9237 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
9238 extern when possible. Remove unused initializations.
9239
9240 2002-11-16 Akim Demaille <akim@epita.fr>
9241
9242 Augment the similarity between GLR and LALR traces.
9243
9244 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
9245 (YY_REDUCE_PRINT): New.
9246 (yyparse): Use them.
9247 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
9248 YYDPRINT here.
9249 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
9250 state reached after the reduction/recovery, since...
9251 (yyparse, yyprocessOneStack): Report the state we are entering in.
9252
9253 2002-11-16 Akim Demaille <akim@epita.fr>
9254
9255 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
9256 Add support for --trace=skeleton.
9257 * src/scan-skel.l: %option debug.
9258 Scan strings of non-@ or \n instead of character by character.
9259 (scan_skel): Handle trace_skeleton.
9260 (QPUTS): New.
9261 (@output_parser_name@, @output_header_name@): ``Restore'' their
9262 support (used to be M4 macros).
9263 * data/yacc.c: Quote larger chunks, a la glr.c.
9264 * data/lalr1.cc: Likewise.
9265 The header guards are no longer available, so use some other
9266 string than `YYLSP_NEEDED'.
9267
9268 2002-11-16 Akim Demaille <akim@epita.fr>
9269
9270 Make the ``Printers and Destructors'' test more verbose, taking
9271 `yacc.c''s behavior as (possibly wrong) reference.
9272
9273 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
9274 instead of fprint on stdout.
9275 Set and report the last_line of the symbols.
9276 Consistently display values and locations.
9277
9278 2002-11-16 Paul Eggert <eggert@twinsun.com>
9279
9280 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
9281
9282 2002-11-15 Paul Eggert <eggert@twinsun.com>
9283
9284 * tests/actions.at (Actions after errors): New test case.
9285
9286 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
9287 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
9288 tests/action.at, tests/calc.at, tests/conflicts.at,
9289 tests/cxx-type.at, tests/regression.at:
9290 "parse error" -> "syntax error" for POSIX compatibility.
9291 "parsing stack overflow..." -> "parser stack overflow" so
9292 that code matches Bison documentation.
9293
9294 2002-11-15 Akim Demaille <akim@epita.fr>
9295
9296 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
9297 take two BRACED_CODE, not two string_content.
9298 Free the scanner's obstack when we are done.
9299 (code_content): New.
9300 * tests/calc.at: Adjust.
9301 * doc/bison.texinfo: Adjust.
9302 Also, make sure to include the `,' for these declarations.
9303
9304 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
9305
9306 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
9307 definition; avoids potential autoreconf problems.
9308
9309 2002-11-15 Akim Demaille <akim@epita.fr>
9310
9311 Always check the value returned by yyparse.
9312
9313 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
9314 returned by yyparse.
9315 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
9316 Adjust calls.
9317 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
9318 returned by yyparse.
9319
9320 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9321
9322 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
9323 on input.at test.
9324
9325 2002-11-14 Paul Eggert <eggert@twinsun.com>
9326
9327 * src/output.c (output_skeleton): Call xfopen instead of
9328 duplicating xfopen's body.
9329
9330 Fix bugs reported by Nelson H. F. Beebe in
9331 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
9332
9333 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
9334 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
9335 Group compiler. Instead, use "$CC -E bar.c". Include the .h
9336 file twice in the grammar, as an extra check.
9337
9338 * tests/input.at (Torturing the Scanner): Surround the
9339 backslash-newline tests with "#if 0", to make it less likely that
9340 we'll run into compiler bugs. Bring back solitary \ inside
9341 comment, but add a closing comment to work around HP C bug. Don't
9342 test backslash-newline in C character constant.
9343
9344 2002-11-14 Akim Demaille <akim@epita.fr>
9345
9346 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
9347 status of the compiler.
9348 Calling `exit 1' is no longer needed.
9349 Reported by Nelson H. F. Beebe.
9350
9351 2002-11-14 Akim Demaille <akim@epita.fr>
9352
9353 * tests/atlocal.in (CPPFLAGS): We have config.h.
9354 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
9355 New.
9356 * tests/actions.at, tests/calc.at, tests/conflicts.at,
9357 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
9358 * tests/regression.at, tests/torture.at: Use them for all the
9359 grammars that are to be compiled.
9360 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
9361 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
9362 * doc/bison.texinfo (GLR Parsers): Document `inline'.
9363
9364 2002-11-14 Akim Demaille <akim@epita.fr>
9365
9366 * doc/bison.texinfo: Various formatting changes (alignments in
9367 samples, additional @group/@end group, GCS in samples.
9368 Use @deffn instead of simple @table to define the directives,
9369 macros, variables etc.
9370
9371 2002-11-13 Paul Eggert <eggert@twinsun.com>
9372
9373 Fix some bugs reported by Albert Chin-A-Young in
9374 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
9375
9376 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
9377 -o c"; the HP C compiler chatters during compilation.
9378 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
9379 * tests/headers.at (export YYLTYPE): Likewise.
9380
9381 * tests/input.at (Torturing the Scanner): Remove lines containing
9382 solitary backslashes, as they tickle a bug in the HP C compiler.
9383
9384 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
9385 comments, since they're not portable. Use GNU coding style.
9386
9387 2002-11-13 Akim Demaille <akim@epita.fr>
9388
9389 * data/yacc.c: Leave bigger chunks of quoted text.
9390 (YYDSYMPRINTF): New.
9391 Use it to report symbol activities.
9392 * data/glr.c (YYDSYMPRINTF): New.
9393 Use it.
9394
9395 2002-11-12 Paul Eggert <eggert@twinsun.com>
9396
9397 Version 1.75b.
9398
9399 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
9400 (yyglrReduce): Return yyok, not 0.
9401 This should avoid the enumerated-type warnings reported
9402 by Nelson H. F. Beebe in
9403 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
9404
9405 * lib/bbitset.h (BITSET_INLINE): Remove.
9406 * lib/bitset.h [! BITSET_INLINE]: Remove.
9407 (bitset_set, bitset_reset, bitset_test): Rename local vars
9408 to avoid shadowing warnings by GCC.
9409
9410 * data/glr.c (inline): Remove #define. It's the user's
9411 responsibility to #define it away, just like 'const'.
9412 This fixes one of the bugs reported by Nelson H. F. Beebe in
9413 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
9414
9415 * Makefile.maint (po-check): Scan .l and .y files instead of the
9416 .c and the .h files that they generate. This fixes the bug
9417 reported by Tim Van Holder in:
9418 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
9419 Look for N_ as well as for _. Try to avoid matching #define for
9420 N_ and _.
9421 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
9422 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
9423 * src/scan-gram.l: Revamp regular expressions so that " and '
9424 do not confuse xgettext.
9425
9426 * src/struniq.h (struniq_new): Do not declare the return type
9427 to be 'const'; this violates the C standard.
9428 * src/struniq.c (struniq_new): Likewise.
9429
9430 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
9431
9432 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
9433 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
9434 linker.
9435
9436 2002-11-12 Akim Demaille <akim@epita.fr>
9437
9438 * Makefile.maint: Sync with Autoconf:
9439 (local_updates): New.
9440
9441 2002-11-12 Akim Demaille <akim@epita.fr>
9442
9443 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
9444
9445 2002-11-12 Akim Demaille <akim@epita.fr>
9446
9447 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
9448 locations.
9449
9450 2002-11-12 Akim Demaille <akim@epita.fr>
9451
9452 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
9453 not yyvalue.
9454
9455 2002-11-12 Akim Demaille <akim@epita.fr>
9456
9457 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
9458 Use it to test the GLR parser.
9459
9460 2002-11-12 Akim Demaille <akim@epita.fr>
9461
9462 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
9463 defines it.
9464 * data/glr.c (yystos): New.
9465 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
9466 (YYDSYMPRINT): New.
9467 (yyval): Don't define it, it is handled via M4.
9468 (yyrecoverParseError): Free verbosely the discarded symbols.
9469 * data/yacc.c (yysymprint): Remove, rather...
9470 (b4_yysymprint_generate): invoke.
9471 * data/c.m4 (b4_yysymprint_generate): New.
9472 Accept pointers as arguments, as opposed to the version from
9473 yacc.c.
9474 (b4_yydestruct_generate): Likewise.
9475 * tests/cations.at (Printers and Destructors): Use Bison directives
9476 instead of CPP macros.
9477 Don't rely on internal details.
9478
9479 2002-11-12 Akim Demaille <akim@epita.fr>
9480
9481 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
9482 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
9483 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
9484 it against YYEMPTY and so forth), work on yytoken (i.e., set
9485 it to YYEMPTY etc.).
9486 (yydestruct): Replace with a b4_yydestruct_generate invocation.
9487 (b4_symbol_actions): Remove.
9488 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
9489 for 0, end-of-input.
9490
9491 2002-11-12 Akim Demaille <akim@epita.fr>
9492
9493 * doc/bison.texinfo (Destructor Decl): New.
9494
9495 2002-11-12 Akim Demaille <akim@epita.fr>
9496
9497 * src/tables.c (tables_generate): Use free for pointers that
9498 cannot be NULL, not XFREE.
9499 (pack_vector): Use assert, not fatal, for bound violations.
9500 * src/state.c (state_new): Likewise.
9501 * src/reader.c (reader): Likewise.
9502 * src/lalr.c (set_goto_map): Likewise.
9503 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
9504 the file name.
9505
9506 2002-11-12 Akim Demaille <akim@epita.fr>
9507
9508 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
9509 Restore.
9510 * src/scan-gram.l (last_string): Is global to the file, not to
9511 yylex.
9512 * src/parse-gram.y (input): Don't append the epilogue here,
9513 (epilogue.opt): do it here, and free the scanner's obstack.
9514 * src/reader.c (epilogue_set): Rename as...
9515 (epilogue_augment): this.
9516 * data/c.m4 (b4_epilogue): Defaults to empty.
9517
9518 2002-11-12 Akim Demaille <akim@epita.fr>
9519
9520 * src/getargs.c (long_options): Remove duplicates.
9521 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
9522 Remove.
9523 * doc/bison.rnh: Remove.
9524 * doc/bison.texinfo (VMS Invocation): Remove.
9525
9526 2002-11-12 Akim Demaille <akim@epita.fr>
9527
9528 * src/struniq.h, src/struniq.c (struniq_t): Is const.
9529 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
9530
9531 Use struniq for symbols.
9532
9533 * src/symtab.h (symbol_t): The tag member is a struniq.
9534 (symbol_type_set): Adjust.
9535 * src/symtab.c (symbol_new): Takes a struniq.
9536 (symbol_free): Don't free the tag member.
9537 (hash_compare_symbol_t, hash_symbol_t): Rename as...
9538 (hash_compare_symbol, hash_symbol): these.
9539 Use the fact that tags as struniqs.
9540 (symbol_get): Use struniq_new.
9541 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
9542 Returns a strniq.
9543 * src/reader.h (merger_list, grammar_currentmerge_set): The name
9544 and type members are struniqs.
9545 * src/reader.c (get_merge_function)
9546 (grammar_current_rule_merge_set): Adjust.
9547 (TYPE, current_type): Are struniq.
9548
9549 Use struniq for file names.
9550
9551 * src/files.h, src/files.c (infile): Split into...
9552 (grammar_file, current_file): these.
9553 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
9554 * src/reduce.c (reduce_print): Likewise.
9555 * src/getargs.c (getargs): Likewise.
9556 * src/complain.h, src/complain.c: Likewise.
9557 * src/main.c (main): Call struniqs_new early enough to use it for
9558 file names.
9559 Don't free the input file name.
9560
9561 2002-11-12 Akim Demaille <akim@epita.fr>
9562
9563 * src/symtab.c (symbol_free): Remove dead deactivated code:
9564 type_name are properly removed.
9565 Don't use XFREE to free items that cannot be NULL.
9566 * src/struniq.h, src/struniq.c: New.
9567 * src/main.c (main): Initialize/free struniqs.
9568 * src/parse-gram.y (%union): Add astruniq member.
9569 (yyprint): Adjust.
9570 * src/scan-gram.l (<{tag}>): Return a struniq.
9571 Free the obstack bit that used to store it.
9572 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
9573
9574 2002-11-11 Paul Eggert <eggert@twinsun.com>
9575
9576 Revamp to fix many (but not all) of the C- and M4-related quoting
9577 problems. Among other things, this fixes the Bison bug reported
9578 by Jan Hubicka when processing the Bash grammar; see:
9579 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
9580
9581 Use new @ escapes consistently. Represent brackets with @{ and @}
9582 rather than @<:@ and @:>@, since this works a bit better with dumb
9583 editors like vi. Represent @ with @@, since @ is now consistently
9584 an escape. Use @oline@ and @ofile@ rather than __oline__ and
9585 __ofile__, to avoid unexpected expansions. Similarly, use @output
9586 rather than #output.
9587
9588 * data/c.m4 (b4_copyright): Omit file name from comment, since
9589 the file name could contain "*/".
9590 (b4_synclines_flag): Don't quote the 2nd argument; it should already
9591 be quoted. All uses changed.
9592
9593 * data/glr.c: Use new @ escapes consistently.
9594 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
9595 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
9596 Remove, since they couldn't handle arbitrary characters in file
9597 names.
9598 * data/lalr1.cc: Likewise.
9599 * data/yacc.c: Likewise.
9600
9601 * src/files.c (output_infix): Remove; all uses removed.
9602 * src/files.h: Likewise.
9603
9604 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
9605 mishandled funny characters in file names, and anyway it isn't
9606 needed any more.
9607 * data/yacc.c: Likewise.
9608 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
9609
9610 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
9611 * data/yacc.c: Likewise.
9612
9613 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
9614 strings now.
9615 (muscle_init): Quote filename as a C string.
9616 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
9617 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
9618 * src/output.c (escaped_file_name_output): New function.
9619 (prepare_symbols): Quote tokens for M4.
9620 (prepare): Don't insert output_infix, output_prefix,
9621 output_parser_name, output_header_name; this is now down by scan-skel.
9622 Insert skeleton as a C string.
9623
9624 * src/output.c (user_actions_output, symbol_destructors_output,
9625 symbol_printers_output): Quote filenames for C and M4.
9626 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9627
9628 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
9629 escapes other than \\ and \'; this simplifies the code.
9630 (<SC_STRING>): Likewise, for \\ and \".
9631 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
9632 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
9633 Use new escapes @{ and @} for [ and ].
9634
9635 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
9636 them with auto vars.
9637 Switch to new escape scheme, where @ is the escape character uniformly.
9638 Abort if a stray escape character is found. Avoid unbounded input
9639 buffer when parsing non-escaped text.
9640
9641 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
9642 __oline__, #output, $@, and @{ do not have unintended meanings.
9643
9644 2002-11-09 Paul Eggert <eggert@twinsun.com>
9645
9646 Fix the test failure due to GCC warnings described in
9647 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
9648 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
9649 evaluate to 0 if it's impossible for NINF to be in the respective
9650 table.
9651 (yygetLRActions, yyrecoverParseError): Use them.
9652
9653 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
9654 counted in the token inserted at end of file. Now takes
9655 location_t *, not location_t, so that the location can be
9656 adjusted. All uses changed.
9657
9658 * tests/regression.at (Invalid inputs): Adjust wording in
9659 diagnostic to match the new behavior.
9660
9661 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
9662 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
9663 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
9664 abort ();'. This reduces the runtime of the "Many lookaheads"
9665 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
9666 GCC 3.2.
9667
9668 2002-11-07 Paul Eggert <eggert@twinsun.com>
9669
9670 * src/parse-gram.y (CHARACTER): Remove unused token.
9671 All uses removed.
9672
9673 * src/scan-gram.l: Remove stack option. We no longer use the
9674 stack, since the stack was never deeper than 1; instead, use the
9675 new auto var c_context to record the stacked value.
9676
9677 Remove nounput option. At an unexpected end of file, we now unput
9678 the minimal input necessary to end cleanly; this simplifies the
9679 code.
9680
9681 Avoid unbounded token sizes where this is easy.
9682
9683 (unexpected_end_of_file): New function.
9684 Use it to systematize the error message on unexpected EOF.
9685 (last-string): Now auto, not static.
9686 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
9687 (scanner_last_string_free): Remove; not used.
9688 (percent_percent_count): Move decl to just before use.
9689 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
9690 not the (never otherwised-used) CHARACTER.
9691
9692 2002-11-07 Akim Demaille <akim@epita.fr>
9693
9694 Let yyerror always receive the msg as last argument, so that
9695 yyerror can be variadic.
9696
9697 * data/yacc.c (b4_yyerror_args): New.
9698 Use it when calling yyerror.
9699 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
9700 Use it when calling yyerror.
9701 * doc/bison.texinfo (Error Reporting): Adjust.
9702 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
9703 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
9704
9705 2002-11-06 Akim Demaille <akim@epita.fr>
9706
9707 #line should have quoted strings.
9708 Ideally, this should be done by m4_quotearg.
9709
9710 * src/scan-skel.l: Include quotearg.h.
9711 Quote __ofile__.
9712 * src/output.c (symbol_printers_output)
9713 (symbol_destructors_output): Quote the file name.
9714
9715 2002-11-06 Akim Demaille <akim@epita.fr>
9716
9717 * tests/regression.at (Invalid inputs): Adjust to the recent
9718 messages.
9719
9720 2002-11-06 Akim Demaille <akim@epita.fr>
9721
9722 Restore --no-lines.
9723 Reported by Jim Kent.
9724
9725 * data/c.m4 (b4_syncline): New.
9726 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
9727 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
9728 * src/output.c (user_actions_output): Likewise.
9729 (prepare): Define 'b4_synclines_flag'.
9730 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
9731
9732 2002-11-06 Akim Demaille <akim@epita.fr>
9733
9734 * src/main.c (main): Free `infile'.
9735 * src/scan-gram.l (handle_syncline): New.
9736 Recognize `#line'.
9737 * src/output.c (user_actions_output, symbol_destructors_output)
9738 (symbol_printers_output): Use the location's file name, not
9739 infile.
9740 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9741
9742 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9743
9744 * src/tables.c (matching_state): Don't allow states to match if
9745 either has GLR conflict entries.
9746
9747 2002-11-05 Paul Eggert <eggert@twinsun.com>
9748
9749 * src/scan-gram.l: Use more accurate diagnostics, e.g.
9750 "integer out of range" rather than "invalid value".
9751 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
9752 accordingly.
9753
9754 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
9755 Also, remove one static variable in the scanner.
9756
9757 * src/scan-gram.l (braces_level): Now auto, not static.
9758 Initialize to zero if the compiler is being picky.
9759 (INITIAL): Clear braces_level instead of incrementing it.
9760 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
9761 as POSIX 1003.1-2001 requires.
9762 * src/system.h (IF_LINT): New macro, taken from coreutils.
9763 * configure.ac: Define "lint" if --enable-gcc-warnings.
9764
9765 2002-11-05 Akim Demaille <akim@epita.fr>
9766
9767 * src/scan-gram.l: When it starts with `%', complain about the
9768 whole directive, not just that `invalid character: %'.
9769
9770 2002-11-04 Akim Demaille <akim@epita.fr>
9771
9772 * Makefile.maint: Update from Autoconf.
9773 (update, cvs-update, po-update, do-po-update): New.
9774
9775 2002-11-04 Akim Demaille <akim@epita.fr>
9776
9777 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
9778 and yyerror.
9779 Have yyerror `use' its arguments.
9780 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
9781 returns true when location & yacc & pure & parse-param.
9782 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
9783
9784 2002-11-04 Akim Demaille <akim@epita.fr>
9785
9786 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
9787 clashes.
9788 * src/scan-gram.l: Use [\'] instead of ['] to pacify
9789 font-lock-mode.
9790 Use complain_at.
9791 Use quote, not quote_n since LOCATION_PRINT no longer uses the
9792 slot 0.
9793
9794 2002-11-03 Paul Eggert <eggert@twinsun.com>
9795
9796 * src/reader.c (get_merge_function, grammar_current_rule_check):
9797 Use consistent diagnostics for reporting type name clashes.
9798 Quote the types with <>, for consistency with Yacc.
9799 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
9800
9801 2002-11-03 Akim Demaille <akim@epita.fr>
9802
9803 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
9804 New.
9805 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
9806 (b4_parse_param): Remove.
9807 Use b4_identification.
9808 Propagate b4_pure_args where needed to pass them to yyerror.
9809 * data/glr.m4 (b4_parse_param): Remove.
9810 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
9811 (b4_lpure_formals): New.
9812 Use b4_identification.
9813 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
9814 b4_user_formals and b4_user_args.
9815 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
9816 (yyreportAmbiguity): When using a pure parser, also need
9817 the location, and the parse-params.
9818 Adjust callers.
9819 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
9820 When using a pure parser, also need the parse-params.
9821 Adjust callers.
9822 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
9823 (%pure-parser + %parse-param) LALR and GLR parsers.
9824 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
9825 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
9826 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
9827 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
9828 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
9829 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
9830 * doc/bison.texinfo: Untabify the whole file.
9831 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
9832 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
9833 (Error Reporting): Adjust to these new directives.
9834 Document %error-verbose, deprecate YYERROR_VERBOSE.
9835
9836 2002-11-03 Akim Demaille <akim@epita.fr>
9837
9838 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
9839 AT_CHECK_CALC_GLR invocations to use % directives, instead of
9840 command line options.
9841 * tests/cxx-type.at: Formatting changes.
9842
9843 2002-11-03 Paul Eggert <eggert@twinsun.com>
9844
9845 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
9846 to count columns correctly, and to check for invalid inputs.
9847
9848 Use mbsnwidth to count columns correctly. Account for tabs, too.
9849 Include mbswidth.h.
9850 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
9851 (extend_location): New function.
9852 (YY_LINES): Remove.
9853
9854 Handle CRLF in C code rather than in Lex code.
9855 (YY_INPUT): New macro.
9856 (no_cr_read): New function.
9857
9858 Scan UCNs, even though we don't fully handle them yet.
9859 (convert_ucn_to_byte): New function.
9860
9861 Handle backslash-newline correctly in C code.
9862 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
9863 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
9864 all uses changed.
9865 (tag, splice): New EREs. Do not allow NUL or newline in tags.
9866 Use {splice} wherever C allows backslash-newline.
9867 YY_STEP after space, newline, vertical-tab.
9868 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9869
9870 (letter, id): Don't assume ASCII; e.g., spell out a-z.
9871
9872 ({int}, handle_action_dollar, handle_action_at): Check for integer
9873 overflow.
9874
9875 (YY_STEP): Omit trailing semicolon, so that it's more like C.
9876
9877 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
9878 as well as \000. Check for UCHAR_MAX, not 255.
9879 Allow \x with an arbitrary positive number of digits, as in C.
9880 Check for overflow here.
9881 Allow \? and UCNs, for compatibility with C.
9882
9883 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
9884 with quote slot used by complain_at.
9885
9886 * tests/input.at: Add tests for backslash-newline, m4 quotes
9887 in symbols, long literals, and funny escapes in strings.
9888
9889 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
9890 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
9891 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
9892 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
9893 * m4/mbswidth.m4: New file, from GNU coreutils.
9894
9895 * doc/bison.texinfo (Grammar Outline): Document // comments.
9896 (Symbols): Document that trigraphs have no special meaning in Bison,
9897 nor is backslash-newline allowed.
9898 (Actions): Document that trigraphs have no special meaning.
9899
9900 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
9901 no longer used.
9902
9903 2002-11-02 Paul Eggert <eggert@twinsun.com>
9904
9905 * src/reader.c: Don't include quote.h; not needed.
9906 (get_merge_function): Reword warning to be consistent with
9907 type clash diagnostic in grammar_current_rule_check.
9908
9909 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
9910 bug in trigraph handling.
9911
9912 * src/output.c (prepare_symbols): When printing token names,
9913 escape "[" as "@<:@" and likewise for "]".
9914
9915 * src/system.h (errno): Remove declaration, as we are now
9916 assuming C89 or better, and C89 guarantees errno.
9917
9918 2002-10-30 Paul Eggert <eggert@twinsun.com>
9919
9920 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
9921 Check for close failures.
9922 * src/files.h (xfclose): Return void, not int, since it always
9923 returned zero.
9924 * src/files.c (xfclose): Likewise. Report I/O error if ferror
9925 indicates one.
9926 * src/output.c (output_skeleton): Use xfclose rather than fclose
9927 and ferror. xfclose now checks ferror.
9928
9929 * data/glr.c (YYLEFTMOST_STATE): Remove.
9930 (yyreportTree): Use a stack-based leftmost state. This avoids
9931 our continuing battles with bogus warnings about initializers.
9932
9933 2002-10-30 Akim Demaille <akim@epita.fr>
9934
9935 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
9936 #if.
9937
9938 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9939
9940 * tests/glr-regr1.at: New test for reported regressions.
9941 * tests/testsuite.at: Add glr-regr1.at test.
9942 * tests/Makefile.am: Add glr-regr1.at test.
9943
9944 2002-10-24 Paul Eggert <eggert@twinsun.com>
9945
9946 Version 1.75a.
9947
9948 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
9949 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
9950 we use malloc. Don't assume 'A' through 'Z' are contiguous.
9951 Don't assume strdup exists; POSIX says its an XSI extension.
9952 Check for buffer overflow on input.
9953
9954 2002-10-24 Akim Demaille <akim@epita.fr>
9955
9956 * src/output.c (output_skeleton): Don't disable M4sugar comments
9957 too soon: it results in comments being expanded.
9958 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
9959 first output.
9960
9961 2002-10-24 Akim Demaille <akim@epita.fr>
9962
9963 * data/yacc.c (m4_int_type): New.
9964 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
9965 char' as only yacc.c wants K&R portability.
9966 * data/glr.c (yysigned_char): Remove.
9967 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
9968 Reported by Quoc Peyrot.
9969
9970 2002-10-23 Paul Eggert <eggert@twinsun.com>
9971
9972 * src/main.c (main): With --trace=time, report times even if a
9973 non-fatal error occurs. Formerly, the times were reported in some
9974 such cases but not in others.
9975 * src/reader.c (reader): Just return if a complaint has been issued,
9976 instead of exiting, so that 'main' can report times.
9977
9978 2002-10-22 Akim Demaille <akim@epita.fr>
9979
9980 * src/system.h: Include sys/types.
9981 Reported by Bert Deknuydt.
9982
9983 2002-10-23 Paul Eggert <eggert@twinsun.com>
9984
9985 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
9986 Suggested by Art Haas.
9987
9988 2002-10-22 Paul Eggert <eggert@twinsun.com>
9989
9990 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
9991 decl; not needed any more.
9992 * src/main.c (main): Use return to exit, undoing yesterday's change.
9993 The last OS that we could find where this wouldn't work is
9994 SunOS 3.5, and that's too old to worry about now.
9995
9996 * data/glr.c (struct yyltype): Define members even when not
9997 doing locations. This is more consistent with yacc.c, and it
9998 works around the following bug reports:
9999 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
10000 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
10001
10002 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
10003 @acronym consistently. Standardize on "Yacc" instead of "YACC",
10004 "Algol" instead of "ALGOL". Give a bit more history about BNF.
10005
10006 2002-10-22 Akim Demaille <akim@epita.fr>
10007
10008 * data/README: New.
10009
10010 2002-10-21 Paul Eggert <eggert@twinsun.com>
10011
10012 Be consistent about 'bool'; the old code used an enum in one
10013 module and an int in another, and this violates the C standard.
10014 * m4/stdbool.m4: New file, from coreutils 4.5.3.
10015 * configure.ac (AC_HEADER_STDBOOL): Add.
10016 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
10017 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
10018 * src/symtab.c (hash_compare_symbol_t): Likewise.
10019 * src/system.h (bool, false, true): Use a definition consistent
10020 with ../lib/hash.c. All uses changed.
10021
10022 * src/complain.c (warning_issued): Renamed from warn_message_count,
10023 so that we needn't worry about integer overflow (!).
10024 Now of type bool. All uses changed.
10025 (complaint_issued): Renamed from complain_message_count; likewise.
10026
10027 * src/main.c (main): Use exit to exit with failure.
10028
10029 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
10030 rather than 1 and 0.
10031 * src/main.c (main): Likewise.
10032 * src/getargs.c (getargs): Likewise.
10033 * src/reader.c (reader): Likewise.
10034
10035 * src/getarg.c (getargs): Remove duplicate code for
10036 "Try `bison --help'".
10037
10038 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
10039 What was that "2" for?
10040
10041 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
10042 * src/getargs.c (usage): Likewise.
10043
10044 * src/getargs.c (getargs): When there are too few operands, report
10045 the last one. When there are too many, report the first extra
10046 one. This is how diffutils does it.
10047
10048 2002-10-20 Paul Eggert <eggert@twinsun.com>
10049
10050 Remove K&R vestiges.
10051 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
10052 * src/complain.c (VA_START): Remove. Assume prototypes.
10053 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
10054 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
10055 fatal): Assume prototypes.
10056 * src/complain.h: Assume prototypes.
10057 * src/system.h (PARAMS): Remove.
10058 Include <limits.h> unconditionally, since it's guaranteeed even
10059 for a freestanding C89 compiler.
10060 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
10061 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
10062
10063 2002-10-20 Akim Demaille <akim@epita.fr>
10064
10065 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
10066 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
10067 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
10068 (yyresolveStates, yyresolveAction, yyresolveStack)
10069 (yyprocessOneStack): Use them.
10070 (yy_reduce_print): New.
10071 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
10072
10073 2002-10-20 Akim Demaille <akim@epita.fr>
10074
10075 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
10076 arguments and output `void'.
10077 (b4_c_function): Rename as...
10078 (b4_c_function_def): this.
10079 (b4_c_function_decl, b4_c_ansi_function_def)
10080 (b4_c_ansi_function_decl): New.
10081 Change the interpretation of the arguments: before `int, foo', now
10082 `int foo, foo'.
10083 * data/yacc.c (yyparse): Prototype and define thanks to these.
10084 Adjust b4_c_function_def uses.
10085 * data/glr.c (yyparse): Likewise, but ANSI only.
10086
10087 2002-10-20 Akim Demaille <akim@epita.fr>
10088
10089 * src/output.c (prepare): Move the definition of `tokens_number',
10090 `nterms_number', `undef_token_number', `user_token_number_max'
10091 to...
10092 (prepare_tokens): Here.
10093 (prepare_tokens): Rename as...
10094 (prepare_symbols): this.
10095 (prepare): Move the definition of `rules_number' to...
10096 (prepare_rules): here.
10097 (prepare): Move the definition of `last', `final_state_number',
10098 `states_number' to...
10099 (prepare_states): here.
10100 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
10101
10102 2002-10-20 Akim Demaille <akim@epita.fr>
10103
10104 * src/tables.h, src/tables.c, src/output.c: Comment changes.
10105
10106 2002-10-20 Akim Demaille <akim@epita.fr>
10107
10108 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
10109 * data/c.m4: here.
10110
10111 2002-10-20 Akim Demaille <akim@epita.fr>
10112
10113 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
10114 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
10115 `pair'.
10116 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
10117 `name' to...
10118 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
10119 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
10120 These.
10121
10122 2002-10-19 Paul Eggert <eggert@twinsun.com>
10123
10124 Do not create a temporary file, as that involves security and
10125 cleanup headaches. Instead, use a pair of pipes.
10126 Derived from a suggestion by Florian Krohm.
10127 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
10128 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
10129 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
10130 (BISON_PREREQ_SUBPIPE): Add.
10131 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
10132 Add subpipe.h, subpipe.c.
10133 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
10134 * po/POTFILES.in: Add lib/subpipe.c.
10135 * src/output.c: Include "subpipe.h".
10136 (m4_invoke): Remove decl.
10137 (scan_skel): New decl.
10138 (output_skeleton): Use pipe rather than temporary file for m4 input.
10139 Check that m4sugar.m4 is readable, to avoid deadlock.
10140 Check for pipe I/O error.
10141 * src/scan-skel.l (readpipe): Remove decl.
10142 (scan_skel): New function, to be used in place of m4_invoke.
10143 Read from stream rather than file.
10144
10145 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
10146 float, as this generates a warning on Solaris 8 + GCC 3.2 with
10147 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
10148 this generates a more-accurate value anyway.
10149
10150 * lib/timevar.c (timervar_accumulate): Rename locals to
10151 avoid confusion with similarly-named more-global.
10152 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
10153
10154 * src/output.c (prepare): Use xstrdup to convert char const *
10155 to char *, to avoid GCC warning.
10156
10157 2002-10-19 Akim Demaille <akim@epita.fr>
10158
10159 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
10160 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
10161 Use them to have `calc.y' ready for %pure-parser.
10162 * data/yacc.c (YYLEX): Pass a yylex return type to
10163 b4_c_function_call.
10164
10165 2002-10-19 Akim Demaille <akim@epita.fr>
10166
10167 Prototype support of %lex-param and %parse-param.
10168
10169 * src/parse-gram.y: Add the definition of the %lex-param and
10170 %parse-param tokens, plus their rules.
10171 Drop the `_' version of %glr-parser.
10172 Add the "," token.
10173 * src/scan-gram.l (INITIAL): Scan them.
10174 * src/muscle_tab.c: Comment changes.
10175 (muscle_insert, muscle_find): Rename `pair' as `probe'.
10176 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
10177 (muscle_entry_s): The `value' member is no longer const.
10178 Adjust all dependencies.
10179 * src/muscle_tab.c (muscle_init): Adjust: use
10180 MUSCLE_INSERT_STRING.
10181 Initialize the obstack earlier.
10182 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
10183 (muscle_pair_list_grow): New.
10184 * data/c.m4 (b4_c_function_call, b4_c_args): New.
10185 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
10186 * tests/calc.at: Use %locations, not --locations.
10187 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
10188
10189 2002-10-19 Akim Demaille <akim@epita.fr>
10190
10191 * src/getargs.c (usage): Take status as argument and exit
10192 accordingly.
10193 Report the traditional `Try ... --help' message when status != 0.
10194 (usage, version): Don't take a FILE * as arg, it is pointless.
10195 (getargs): When there is an incorrect number of arguments, make it
10196 an error, and report it GNUlically thanks to `usage ()'.
10197
10198 2002-10-18 Paul Eggert <eggert@twinsun.com>
10199
10200 * data/glr.c (yyreportParseError): Don't assume that sprintf
10201 yields the length of the printed string, as this is not true
10202 on SunOS 4.1.4. Reported by Peter Klein.
10203
10204 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
10205 * tests/conflicts.at (%nonassoc and eof): Likewise.
10206 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
10207
10208 2002-10-17 Akim Demaille <akim@epita.fr>
10209
10210 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
10211 * src/getargs.c (trace_types, trace_args): Adjust.
10212 * src/reader.c (grammar_current_rule_prec_set)
10213 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
10214 Standardize error messages.
10215 And s/@prec/%prec/!
10216 (reader): Use trace_flag to enable scanner/parser debugging,
10217 instead of an adhoc scheme.
10218 * src/scan-gram.l: Remove trailing debugging code.
10219
10220 2002-10-16 Paul Eggert <eggert@twinsun.com>
10221
10222 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
10223 MUSCLE_TAB_H.
10224
10225 * NEWS: Officially drop support for building Bison with K&R C,
10226 since it didn't work anyway and it's not worth worrying about.
10227 * Makefile.maint (wget_files): Remove ansi2knr.c.
10228 (ansi2knr.c-url_prefix): Remove.
10229 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
10230 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10231 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10232
10233 2002-10-15 Paul Eggert <eggert@twinsun.com>
10234
10235 Stop using the "enum_" trick for K&R-style function definitions;
10236 it confused me, and I was the author! Instead, assume that people
10237 who want to use K&R C compilers (when using these modules in GCC,
10238 perhaps?) will run ansi2knr.
10239
10240 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
10241 All uses of "enum_" changed to "enum ".
10242 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10243 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10244
10245 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
10246 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
10247 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
10248 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
10249 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
10250 abitset_not, abitset_ones, abitset_or, abitset_or_and,
10251 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
10252 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
10253 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
10254 Use function prototypes; this removes the need for declaring
10255 static functions simply to provide their prototypes.
10256 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
10257 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
10258 bitset_count_, bitset_create, bitset_dump, bitset_first,
10259 bitset_free, bitset_init, bitset_last, bitset_next,
10260 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
10261 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
10262 bitset_print, bitset_release_memory, bitset_toggle_,
10263 bitset_type_choose, bitset_type_get, bitset_type_name_get,
10264 debug_bitset): Likewise.
10265 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
10266 * lib/bitset_stats.c (bitset_log_histogram_print,
10267 bitset_percent_histogram_print, bitset_stats_and,
10268 bitset_stats_and_cmp, bitset_stats_and_or,
10269 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
10270 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
10271 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
10272 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
10273 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
10274 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
10275 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
10276 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
10277 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
10278 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
10279 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
10280 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
10281 bitset_stats_zero): Likewise.
10282 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10283 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10284 bitsetv_dump, debug_bitsetv): Likewise.
10285 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
10286 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
10287 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
10288 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
10289 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
10290 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
10291 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
10292 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
10293 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
10294 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
10295 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
10296 Likewise.
10297 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
10298 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
10299 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
10300 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
10301 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
10302 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
10303 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
10304 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
10305 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
10306 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
10307 lbitset_xor_cmp, lbitset_zero): Likewise.
10308
10309 2002-10-14 Akim Demaille <akim@epita.fr>
10310
10311 Version 1.75.
10312
10313 2002-10-14 Akim Demaille <akim@epita.fr>
10314
10315 * tests/Makefile.am (maintainer-check-posix): New.
10316
10317 2002-10-14 Akim Demaille <akim@epita.fr>
10318
10319 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
10320 member.
10321
10322 2002-10-14 Akim Demaille <akim@epita.fr>
10323
10324 * src/tables.c (table_ninf_remap): base -> tab.
10325 Reported by Matt Rosing.
10326
10327 2002-10-14 Paul Eggert <eggert@twinsun.com>
10328
10329 * tests/action.at, tests/calc.at, tests/conflicts.at,
10330 tests/cxx-type.at, tests/headers.at, tests/input.at,
10331 tests/regression.at, tests/synclines.at, tests/torture.at:
10332 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
10333 so that the tests still work even if POSIXLY_CORRECT is set.
10334 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
10335
10336 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
10337 for portability to K&R hosts. Fix typo: signed char is guaranteed
10338 only to 127, not to 128.
10339 * data/glr.c (yysigned_char): New type.
10340 * data/yacc.c (yysigned_char): Likewise.
10341 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
10342
10343 2002-10-13 Paul Eggert <eggert@twinsun.com>
10344
10345 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
10346 true due to limited range of data type" warning from GCC.
10347
10348 * data/c.m4 (b4_token_defines): Protect against double-inclusion
10349 by wrapping enum yytokentype's definition inside #ifndef
10350 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
10351
10352 2002-10-13 Akim Demaille <akim@epita.fr>
10353
10354 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
10355 Un yy- yyrhs to avoid the name clash with the global YYRHS.
10356
10357 2002-10-13 Akim Demaille <akim@epita.fr>
10358
10359 * Makefile.maint: Update from Autoconf 2.54.
10360 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
10361
10362 2002-10-13 Akim Demaille <akim@epita.fr>
10363
10364 * src/print.c (print_state): Separate the list of solved conflicts
10365 from the other items.
10366 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
10367
10368 2002-10-13 Akim Demaille <akim@epita.fr>
10369
10370 Let nondeterministic skeletons be usable with deterministic
10371 tables.
10372
10373 With the patch, GAWK compiled by GCC without -O2 passes its test
10374 suite using a GLR parser driven by LALR tables. It fails with -O2
10375 because `struct stat' gives two different answers on my machine:
10376 88 (definition of an auto var) and later 96 (memset on this var).
10377 Hence the stack is badly corrumpted. The headers inclusion is to
10378 blame: if I move the awk.h inclusion before GLR's system header
10379 inclusion, the two struct stat have the same size.
10380
10381 * src/tables.c (pack_table): Always create conflict_table.
10382 (token_actions): Always create conflict_list.
10383 * data/glr.c (YYFLAG): Remove, unused.
10384
10385 2002-10-13 Akim Demaille <akim@epita.fr>
10386
10387 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
10388 (O0FLAGS): New.
10389 (VALGRIND, GXX): New.
10390 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
10391 * tests/bison.in: Run $PREBISON a pre-command.
10392 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
10393 (maintainer-check-g++): New.
10394 * Makefile.am (maintainer-check): New.
10395
10396 2002-10-13 Akim Demaille <akim@epita.fr>
10397
10398 * data/glr.c: Formatting changes.
10399 Tweak some trace messages to match yacc.c's.
10400
10401 2002-10-13 Akim Demaille <akim@epita.fr>
10402
10403 GLR parsers sometimes raise parse errors instead of performing the
10404 default reduction.
10405 Reported by Charles-Henry de Boysson.
10406
10407 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
10408 check the length of the traces when %glr.
10409 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
10410 GLR's traces.
10411 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
10412 Test GLR parsers.
10413 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
10414 (yyltype): Remove the yy prefix from the member names.
10415 (yytable): Complete its comment.
10416 (yygetLRActions): Map error action number from YYTABLE from
10417 YYTABLE_NINF to 0.
10418 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
10419 (which was a bug: it should have been YYTABEL_NINF, and yet it was
10420 not satisfying as we could compare an YYACTION computed from
10421 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
10422 only value for error actions.
10423 (yyreportParseError): In verbose parse error messages, don't issue
10424 `error' in the list of expected tokens.
10425 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
10426 next action to perform to match glr.c's decoding.
10427 (yytable): Complete its comment.
10428
10429 2002-10-13 Paul Eggert <eggert@twinsun.com>
10430
10431 Fix problem reported by Henrik Grubbstroem in
10432 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
10433 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
10434 because the Bison parser reads the second action before reducing
10435 the first one.
10436 * src/scan-gram.l (rule_length): New static var.
10437 Use it to keep track of the rule length in the scanner, since
10438 we can't expect the parser to be in lock-step sync with the scanner.
10439 (handle_action_dollar, handle_action_at): Use this var.
10440 * tests/actions.at (Exotic Dollars): Test for the problem.
10441
10442 2002-10-12 Paul Eggert <eggert@twinsun.com>
10443
10444 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
10445 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
10446 Include <sys/time.h> when checking for clock_t and struct tms.
10447 Use same include order as source.
10448 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
10449 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
10450
10451 * lib/timevar.c: Update copyright date and clarify comments.
10452 (get_time) [IN_GCC]: Keep the GCC version for reference.
10453
10454 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
10455 GCC version as of today, then merge Bison's changes.
10456 Change "GCC" to "Bison" in copyright notice. timevar.def's
10457 author is Akim, so change that too.
10458
10459 * src/reader.c (grammar_current_rule_check):
10460 Don't worry about the default action if $$ is untyped.
10461 Prevents bogus warnings reported by Jim Gifford in
10462 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
10463
10464 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
10465 * data/glr.c, data/lalr1.cc, data/yacc.c:
10466 Output token definitions before the first part of user declarations.
10467 Fixes compatibility problem reported by Jim Gifford for kbd in
10468 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
10469
10470 2002-10-11 Paul Eggert <eggert@twinsun.com>
10471
10472 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
10473 (yyparse): here. This undoes some of the 2002-07-25 change.
10474 Compatibility problem reported by Ralf S. Engelschall with
10475 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
10476
10477 2002-10-11 Akim Demaille <akim@epita.fr>
10478
10479 * tests/regression.at Characters Escapes): New.
10480 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
10481 characters.
10482 Reported by Jan Nieuwenhuizen.
10483
10484 2002-10-11 Akim Demaille <akim@epita.fr>
10485
10486 * po/id.po: New.
10487
10488 2002-10-10 Paul Eggert <eggert@twinsun.com>
10489
10490 Portability fixes for bitsets; this also avoids several GCC
10491 warnings.
10492
10493 * lib/abitset.c: Include <stddef.h>, for offsetof.
10494 * lib/lbitset.c: Likewise.
10495
10496 * lib/abitset.c (abitset_bytes): Return a size that is aligned
10497 properly for vectors of objects. Do not assume that adding a
10498 header size to a multiple of a word size yields a value that is
10499 properly aligned for the whole union.
10500 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10501
10502 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
10503 unique names for structures.
10504 * lib/ebitset.c (ebitset_bytes): Likewise.
10505 * lib/lbitset.c (lbitset_bytes): Likewise.
10506
10507 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
10508 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
10509 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
10510 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
10511 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
10512 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
10513 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
10514 to improve the type-checking that GCC can do.
10515 * lib/bitset.c (bitset_op4_cmp): Likewise.
10516 * lib/bitset_stats.c (bitset_stats_count,
10517 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
10518 bitset_stats_copy, bitset_stats_disjoint_p,
10519 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
10520 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
10521 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
10522 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
10523 bitset_stats_and_or_cmp, bitset_stats_andn_or,
10524 bitset_stats_andn_or_cmp, bitset_stats_or_and,
10525 bitset_stats_or_and_cmp): Likewise.
10526 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
10527 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
10528 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
10529 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
10530
10531 * lib/abitset.h: Include bitset.h, not bbitset.h.
10532 * lib/ebitset.h: Likewise.
10533 * lib/lbitset.h: Likewise.
10534
10535 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
10536 All instances of parameters of type enum bitset_opts are now of
10537 type enum_bitset_opts, to conform to the C Standard, and similarly
10538 for enum_bitset_type.
10539 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10540 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10541
10542 Do not use "struct bitset_struct" to mean different things in
10543 different modules. Not only is this confusing, it violates
10544 the C Standard, which requires that structure types in different
10545 modules must be compatible if one is to be passed to the other.
10546 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
10547 All instances of "struct bitset_struct *" replaced with "bitset".
10548 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
10549 (union bitset_union, struct abitset_struct, struct ebitset_struct,
10550 struct lbitset_struct, struct bitset_stats_struct): New types.
10551 All uses of struct bitset_struct changed to union bitset_union,
10552 etc.
10553 * lib/abitset.c (struct abitset_struct, abitset,
10554 struct bitset_struct): Remove.
10555 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
10556 struct bitset_struct): Remove.
10557 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
10558 bitset_struct): Remove.
10559 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
10560 Likewise.
10561
10562 Do not call a function of type T using a call that assumes the
10563 function is of a different type U. Standard C requires that a
10564 function must be called with a type that is compatible with its
10565 definition.
10566 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10567 New decls.
10568 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10569 New functions.
10570 * lib/ebitset.c (PFV): Remove.
10571 * lib/lbitset.c (PFV): Likewise.
10572 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
10573 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
10574 decls.
10575 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
10576 (ebitset_vtable): Use them.
10577 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
10578 lbitset_xor): New functions.
10579 (lbitset_vtable): Use them.
10580
10581 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
10582 Declare.
10583
10584 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
10585 GCC warning.
10586 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
10587 Use offsetof, for simplicity.
10588
10589 2002-10-06 Paul Eggert <eggert@twinsun.com>
10590
10591 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
10592 the same width as int. This reapplies a hunk of the 2002-08-12 patch
10593 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
10594 which was inadvertently undone by the 2002-09-30 patch.
10595 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
10596 the same width as int.
10597
10598 2002-10-04 Paul Eggert <eggert@twinsun.com>
10599
10600 Version 1.50.
10601
10602 * configure.ac (AC_INIT), NEWS: Increment version number.
10603
10604 * doc/bison.texinfo: Minor spelling, grammar, and white space
10605 fixes.
10606 (Symbols): Mention that any negative value returned from yylex
10607 signifies end-of-input. Warn about negative chars. Mention
10608 the portable Standard C character set.
10609
10610 The GNU coding standard says CFLAGS and YFLAGS are reserved
10611 for the installer to set.
10612 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
10613 * src/Makefile.am (AM_CFLAGS): Likewise.
10614 (AM_YFLAGS): Renamed from YFLAGS.
10615
10616 Fix some MAX and MIN problems.
10617 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
10618 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
10619 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
10620 * src/reader.c (reader): Use it.
10621
10622 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
10623 POSIX 1003.1-2001 has removed fgrep.
10624
10625 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
10626
10627 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
10628 interpreted as signed.
10629 * lib/ebitset.c (ebitset_list): Fix bug.
10630
10631 2002-10-01 Paul Eggert <eggert@twinsun.com>
10632
10633 More fixes for 64-bit hosts and large bitsets.
10634
10635 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
10636 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
10637 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
10638 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
10639 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
10640 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
10641 bitset_count_): Likewise.
10642 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
10643 bitset_first, bitset_last): Likewise.
10644 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
10645 bitset_stats_list_reverse, bitset_stats_size,
10646 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
10647 Likewise.
10648 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10649 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10650 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10651 bitsetv_reflexive_transitive_closure): Likewise.
10652 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
10653 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
10654 Likewise.
10655 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
10656 Likewise.
10657
10658 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
10659 Use size_t, not unsigned int, to count bytes.
10660 * lib/abitset.h (abitset_bytes): Likewise.
10661 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
10662 Likewise.
10663 * lib/bitset.h (bitset_bytes): Likewise.
10664 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
10665 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
10666 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10667 * lib/ebitset.c (ebitset_bytes): Likewise.
10668 * lib/ebitset.h (ebitset_bytes): Likewise.
10669 * lib/lbitset.c (lbitset_bytes): Likewise.
10670 * lib/lbitset.h (lbitset_bytes): Likewise.
10671
10672 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
10673 abitset_subset_p, abitset_disjoint_p, abitset_and,
10674 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
10675 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
10676 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
10677 abitset_or_and, abitset_or_and_cmp):
10678 Use bitset_windex instead of unsigned int.
10679 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10680 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
10681 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
10682 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
10683 Likewise.
10684 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
10685
10686 * lib/bitset.c (bitset_print):
10687 Use proper printf formats for widths of integer types.
10688 * lib/bitset_stats.c (bitset_percent_histogram_print,
10689 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
10690 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10691 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10692 * lib/lbitset.c (lbitset_bytes): Likewise.
10693
10694 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
10695 BITSET_SIZE_MAX): New macros.
10696 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
10697 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
10698 to BITSET_WINDEX_MAX.
10699
10700 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
10701 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
10702 since we now return the bitset_bindex type (not int).
10703
10704 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
10705 when computing sizes.
10706 * lib/ebitset.c (ebitset_elts_grow): Likewise.
10707
10708 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
10709 and avoid cast to unsigned.
10710
10711 2002-09-30 Akim Demaille <akim@epita.fr>
10712
10713 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10714 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
10715 Updates from Michael Hayes.
10716
10717 2002-09-30 Art Haas <ahaas@neosoft.com>
10718
10719 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
10720 invocations.
10721 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
10722 defined.
10723
10724 2002-09-27 Akim Demaille <akim@epita.fr>
10725
10726 Version 1.49c.
10727
10728 2002-09-27 Akim Demaille <akim@epita.fr>
10729
10730 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
10731 (Because of AC_LIBSOURCE).
10732
10733 2002-09-27 Akim Demaille <akim@epita.fr>
10734
10735 Playing with Autoscan.
10736
10737 * configure.ac: Remove the old LIBOBJ tweaks.
10738 (AC_REPLACE_FUNCS): Add strrchr and strtol.
10739 * lib/strrchr.c: New.
10740 * lib/strtol.c: New, from the Coreutils 4.5.1.
10741
10742 2002-09-27 Akim Demaille <akim@epita.fr>
10743
10744 Playing with Autoscan.
10745
10746 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
10747 * lib/Makefile.am (libbison_a_SOURCES): No longer include
10748 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
10749 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
10750 Coreutils 4.5.1.
10751
10752 2002-09-24 Akim Demaille <akim@epita.fr>
10753
10754 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
10755 (Frequently Asked Questions, Parser Stack Overflow): New.
10756
10757 2002-09-13 Akim Demaille <akim@epita.fr>
10758
10759 Playing with autoscan.
10760
10761 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
10762 * src/files.c (skeleton_find): Remove, unused.
10763 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
10764 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
10765
10766 2002-09-13 Akim Demaille <akim@epita.fr>
10767
10768 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
10769 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
10770
10771 2002-09-13 Akim Demaille <akim@epita.fr>
10772
10773 * configure.ac: Require 2.54.
10774 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
10775 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
10776 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
10777 Remove, provided by Autoconf macros.
10778
10779 2002-09-12 Akim Demaille <akim@epita.fr>
10780
10781 * m4/prereq.m4: Update, from Coreutils 4.5.1.
10782
10783 2002-09-12 Akim Demaille <akim@epita.fr>
10784
10785 * m4/prereq.m4: Update, from Fileutils 4.1.5.
10786 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
10787 Reported by Martin Mokrejs.
10788
10789 2002-09-10 Akim Demaille <akim@epita.fr>
10790
10791 * src/parse-gram.y: Associate a human readable string to each
10792 token type.
10793 * tests/regression.at (Invalid inputs): Adjust.
10794
10795 2002-09-10 Gary V. Vaughan <gary@gnu.org>
10796
10797 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
10798 with an Autoconf-2.5x style configure.ac.
10799
10800 2002-09-06 Paul Eggert <eggert@twinsun.com>
10801
10802 * doc/bison.texinfo (Conditions): Make explicit that the GPL
10803 exception applies only to yacc.c. This is a modification of a
10804 patch originally suggested by Akim Demaille.
10805
10806 2002-09-06 Akim Demaille <akim@epita.fr>
10807
10808 * data/c.m4 (b4_copyright): Move the GPL exception comment from
10809 here to...
10810 * data/yacc.c: here.
10811
10812 * data/lalr1.cc (struct yyltype): Don't define it, since we use
10813 LocationType.
10814 (b4_ltype): Default to yy::Location from location.hh.
10815
10816 2002-09-04 Jim Meyering <jim@meyering.net>
10817
10818 * data/yacc.c: Guard the declaration of yytoknum also with
10819 `#ifdef YYPRINT', so it is declared only when used.
10820
10821 2002-09-04 Akim Demaille <akim@epita.fr>
10822
10823 * configure.in: Rename as...
10824 * configure.ac: this.
10825 Bump to 1.49c.
10826
10827 2002-09-04 Akim Demaille <akim@epita.fr>
10828
10829 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
10830 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
10831 translate maintainer only messages.
10832
10833 2002-08-12 Paul Eggert <eggert@twinsun.com>
10834
10835 Version 1.49b.
10836
10837 * Makefile.am (SUBDIRS): Remove intl.
10838 (DISTCLEANFILES): Remove.
10839 * NEWS: Mention that GNU M4 is now required. Clarify what is
10840 meant by "larger grammars". Mention the pt_BR translation.
10841 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
10842 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
10843 Bump version from 0.11.2 to 0.11.5.
10844 (BISON_PREREQ_STAGE): Remove.
10845 (AM_GNU_GETTEXT): Use external gettext.
10846 (AC_OUTPUT): Remove intl/Makefile.
10847
10848 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
10849
10850 * data/glr.c: Include string.h, for strlen.
10851 (yyreportParseError): Use size_t for yysize.
10852 (yy_yypstack): No longer nested inside yypstates, as nested
10853 functions are not portable. Do not assume size_t is the
10854 same width as int.
10855 (yypstates): Do not assume that ptrdiff_t is the same width
10856 as int, and similarly for yyposn and YYINDEX.
10857
10858 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
10859
10860 * lib/Makefile.am (INCLUDES): Do not include from the intl
10861 directory, which has been removed.
10862 * src/Makefile.am (INCLUDES): Likewise.
10863
10864 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
10865 (bitsets_sources, additional_bitsets_sources, timevars_sources):
10866 New vars.
10867
10868 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
10869 * tests/Makefile.am (EXTRA_DIST): Likewise.
10870
10871 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
10872 Do not assume that bitset_windex is the same width as unsigned.
10873
10874 * lib/abitset.c (abitset_unused_clear): Do not assume that
10875 bitset_word is the same width as int.
10876 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
10877 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
10878 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
10879 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
10880 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
10881
10882 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
10883 portability to one's complement hosts!).
10884 * lib/ebitset.c (ebitset_op1): Likewise.
10885 * lib/lbitset.c (lbitset_op1): Likewise.
10886
10887 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
10888 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10889 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
10890 Sync with fileutils.
10891 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
10892 lib/gettext.h: Sync with diffutils.
10893
10894 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
10895 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
10896
10897 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
10898 PROTOTYPES to check for prototypes, and "defined __STDC__" to
10899 check for void *.
10900
10901 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
10902 size_t; the old version tried to do this but casted improperly.
10903 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
10904 (bitset_test): Now returns int, not unsigned long.
10905
10906 * lib/bitset_stats.c: Include "gettext.h".
10907 (_): New macro.
10908 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
10909 name locals "index", as it generates unnecessary warnings on some
10910 hosts that have an "index" function.
10911
10912 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
10913 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
10914 they need translation.
10915 * src/LR0.c (state_list_append, new_itemsets, get_state,
10916 append_states, generate_states): Likewise.
10917 * src/assoc.c (assoc_to_string): Likewise.
10918 * src/closure.c (print_closure, set_firsts, closure): Likewise.
10919 * src/gram.c (grammar_dump): Likewise.
10920 * src/injections.c (injections_compute): Likewise.
10921 * src/lalr.c (lookaheads_print): Likewise.
10922 * src/relation.c (relation_transpose): Likewise.
10923 * src/scan-gram.l: Likewise.
10924 * src/tables.c (table_grow, pack_vector): Likewise.
10925
10926 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
10927 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
10928 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
10929 * m4/mbstate_t.m4: Sync with fileutils.
10930 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
10931
10932 * po/LINGUAS: Add pt_BR.
10933 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
10934 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
10935 lib/timevar.c.
10936 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
10937 manual recommends.
10938 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
10939
10940 * src/complain.c (strerror_r): Remove decl; not needed.
10941 (strerror): Use same pattern as ../lib/error.c.
10942
10943 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
10944
10945 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
10946
10947 * src/main.c (main): Cast result of bindtextdomain and textdomain
10948 to void, to avoid a GCC warning when --disable-nls is in effect.
10949
10950 * src/scan-gram.l: Use strings rather than escapes when possible,
10951 to minimize the number of warnings from xgettext.
10952 (handle_action_dollar, handle_action_at): Don't use isdigit,
10953 as it mishandles negative chars and it may not work as expected
10954 outside the C locale.
10955
10956 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
10957 this is a GCC extension and is not portable to other compilers.
10958
10959 * src/system.h (alloca): Use same pattern as ../lib/error.c.
10960 Do not include <ctype.h>; no longer needed.
10961 Do not include <malloc.h>; no longer needed (and generates
10962 warnings on OpenBSD 3.0).
10963
10964 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
10965 it's not portable.
10966
10967 * tests/regression.at: Do not use 'cc -c input.c -o input';
10968 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
10969
10970 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
10971 exit status as failure, not just exit status 1. Sun C exits
10972 with status 2 sometimes.
10973
10974 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
10975 Use it for the two large tests.
10976
10977 2002-08-02 Akim Demaille <akim@epita.fr>
10978
10979 * src/conflicts.c (conflicts_output): Don't output rules never
10980 reduced here, since anyway that computation doesn't work.
10981 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
10982 (rule_useless_p, rule_never_reduced_p): New.
10983 (grammar_rules_partial_print): Use a filter instead of a range.
10984 Display the title only if needed.
10985 (grammar_rules_print): Adjust.
10986 (grammar_rules_never_reduced_report): New.
10987 * src/tables.c (action_row): Move the computation of rules never
10988 reduced to...
10989 (token_actions): here.
10990 * src/main.c (main): Make the parser before making the report, so
10991 that rules never reduced are computed.
10992 Call grammar_rules_never_reduced_report.
10993 * src/print.c (print_results): Report rules never reduced.
10994 * tests/conflicts.at, tests/reduce.at: Adjust.
10995
10996 2002-08-01 Akim Demaille <akim@epita.fr>
10997
10998 Instead of attaching lookaheads and duplicating the rules being
10999 reduced by a state, attach the lookaheads to the reductions.
11000
11001 * src/state.h (state_t): Remove the `lookaheads',
11002 `lookaheads_rule' member.
11003 (reductions_t): Add a `lookaheads' member.
11004 Use a regular array for the `rules'.
11005 * src/state.c (reductions_new): Initialize the lookaheads member
11006 to 0.
11007 (state_rule_lookaheads_print): Adjust.
11008 * src/state.h, src/state.c (state_reductions_find): New.
11009 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
11010 (count_rr_conflicts): Adjust.
11011 * src/lalr.c (LArule): Remove.
11012 (add_lookback_edge): Adjust.
11013 (state_lookaheads_count): New.
11014 (states_lookaheads_initialize): Merge into...
11015 (initialize_LA): this.
11016 (lalr_free): Adjust.
11017 * src/main.c (main): Don't free nullable and derives too early: it
11018 is used by --verbose.
11019 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
11020
11021 2002-08-01 Akim Demaille <akim@epita.fr>
11022
11023 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
11024 `rule_number_t**'.
11025 (set_derives, free_derives): Rename as...
11026 (derives_compute, derives_free): this.
11027 Adjust all dependencies.
11028 * src/nullable.c (set_nullable, free_nullable): Rename as...
11029 (nullable_compute, nullable_free): these.
11030 (rule_list_t): Store rule_t *, not rule_number_t.
11031 * src/state.c (state_rule_lookaheads_print): Directly compare rule
11032 pointers, instead of their numbers.
11033 * src/main.c (main): Call nullable_free, and derives_free earlier,
11034 as they were lo longer used.
11035
11036 2002-08-01 Akim Demaille <akim@epita.fr>
11037
11038 * lib/timevar.c (get_time): Include children time.
11039 * src/lalr.h (LA, LArule): Don't export them: used with the
11040 state_t.
11041 * src/lalr.c (LA, LArule): Static.
11042 * src/lalr.h, src/lalr.c (lalr_free): New.
11043 * src/main.c (main): Call it.
11044 * src/tables.c (pack_vector): Check whether loc is >= to the
11045 table_size, not >.
11046 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
11047 (tables_generate): do it, since that's also it which allocates
11048 them.
11049 Don't free LA and LArule, main does.
11050
11051 2002-07-31 Akim Demaille <akim@epita.fr>
11052
11053 Separate parser tables computation and output.
11054
11055 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
11056 (conflict_list, conflict_list_cnt, table, check, table_ninf)
11057 (yydefgoto, yydefact, high): Move to...
11058 * src/tables.h, src/tables.c: here.
11059 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11060 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11061 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
11062 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
11063 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
11064 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
11065 (action_row, save_row, token_actions, save_column, default_goto)
11066 (goto_actions, sort_actions, matching_state, pack_vector)
11067 (table_ninf_remap, pack_table, prepare_actions): Move to...
11068 * src/tables.c: here.
11069 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
11070 * src/output.c (token_actions, output_base, output_conflicts)
11071 (output_check): Merge into...
11072 (prepare_actions): this.
11073 (actions_output): Rename as...
11074 (user_actions_output): this.
11075 * src/main.c (main): Call tables_generate and tables_free.
11076
11077 2002-07-31 Akim Demaille <akim@epita.fr>
11078
11079 Steal GCC's --time-report support.
11080
11081 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
11082 stolen/adjusted from GCC.
11083 * m4/stage.m4: Remove time related checks.
11084 * m4/timevar.m4: New.
11085 * configure.in: Adjust.
11086 * src/system.h: Adjust to using timevar.h.
11087 * src/getargs.h, src/getargs.c: Support trace_time for
11088 --trace=time.
11089 * src/main.c (stage): Remove.
11090 (main): Replace `stage' invocations with timevar calls.
11091 * src/output.c: Insert pertinent timevar calls.
11092
11093 2002-07-31 Akim Demaille <akim@epita.fr>
11094
11095 Let --trace have arguments.
11096
11097 * src/getargs.h (enum trace_e): New.
11098 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
11099 (long_options, short_options): --trace/-T takes an optional
11100 argument.
11101 Change all the uses of trace_flag to reflect the new flags.
11102 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
11103
11104 Strengthen `stage' portability.
11105
11106 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
11107 * configure.in: Use it.
11108 Don't check for malloc.h and sys/times.h.
11109 * src/system.h: Include them when appropriate.
11110 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
11111 times and struct tms are available.
11112
11113 2002-07-30 Akim Demaille <akim@epita.fr>
11114
11115 In verbose parse error message, don't report `error' as an
11116 expected token.
11117 * tests/actions.at (Printers and Destructors): Adjust.
11118 * tests/calc.at (Calculator $1): Adjust.
11119 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
11120 error message, do not report the parser accepts the error token in
11121 that state.
11122
11123 2002-07-30 Akim Demaille <akim@epita.fr>
11124
11125 Normalize conflict related messages.
11126
11127 * src/complain.h, src/complain.c (warn, complain): New.
11128 * src/conflicts.c (conflicts_print): Use them.
11129 (conflict_report_yacc): New, extracted from...
11130 (conflicts_print): here.
11131 * tests/conflicts.at, tests/existing.at: Adjust.
11132
11133 2002-07-30 Akim Demaille <akim@epita.fr>
11134
11135 Report rules which are never reduced by the parser: those hidden
11136 by conflicts.
11137
11138 * src/LR0.c (save_reductions): Don't make the final state too
11139 different: save its reduction (accept) instead of having a state
11140 without any action (no shift or goto, no reduce).
11141 Note: the final state is now a ``regular'' state, i.e., the
11142 parsers now contain `reduce 0' as default reduction.
11143 Nevertheless, since they decide to `accept' when yystate =
11144 final_state, they still will not reduce rule 0.
11145 * src/print.c (print_actions, print_reduction): Adjust.
11146 * src/output.c (action_row): Track reduced rules.
11147 (token_actions): Report rules never reduced.
11148 * tests/conflicts.at, tests/regression.at: Adjust.
11149
11150 2002-07-30 Akim Demaille <akim@epita.fr>
11151
11152 `stage' was accidently included in a previous patch.
11153 Initiate its autoconfiscation.
11154
11155 * configure.in: Look for malloc.h and sys/times.h.
11156 * src/main.c (stage): Adjust.
11157 Report only when trace_flag.
11158
11159 2002-07-29 Akim Demaille <akim@epita.fr>
11160
11161 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
11162 state_number_t.
11163 (errs_t): symbol_t*, not symbol_number_t.
11164 (reductions_t): rule_t*, not rule_number_t.
11165 (FOR_EACH_SHIFT): New.
11166 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
11167 * src/print.c, src/print_graph.c: Adjust.
11168
11169 2002-07-29 Akim Demaille <akim@epita.fr>
11170
11171 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
11172
11173 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
11174 (endtoken, accept): these.
11175 * src/reader.c (reader): Set endtoken's default tag to "$end".
11176 Set undeftoken's tag to "$undefined" instead of "$undefined.".
11177 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
11178 Adjust.
11179
11180 2002-07-29 Akim Demaille <akim@epita.fr>
11181
11182 * src/reduce.c (reduce_grammar): When the language is empty,
11183 complain about the start symbol, not the axiom.
11184 Use its location.
11185 * tests/reduce.at (Empty Language): New.
11186
11187 2002-07-26 Akim Demaille <akim@epita.fr>
11188
11189 * src/reader.h, src/reader.c (gram_error): ... can't get
11190 yycontrol without making too strong assumptions on the parser
11191 itself.
11192 * src/output.c (prepare_tokens): Use the real 0th value of
11193 token_translations instead of `0'.
11194 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
11195 visible here.
11196 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
11197 for the time being: %locations ought to provide it to yyerror.
11198
11199 2002-07-25 Akim Demaille <akim@epita.fr>
11200
11201 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
11202 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
11203 * tests/regression.at (Web2c Actions): Adjust.
11204
11205 2002-07-25 Akim Demaille <akim@epita.fr>
11206
11207 Stop storing rules from 1 to nrules + 1.
11208
11209 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
11210 * src/nullable.c, src/output.c, src/print.c, src/reader.c
11211 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
11212 Iterate from 0 to nrules.
11213 Use rule_number_as_item_number and item_number_as_rule_number.
11214 Adjust to `derive' now containing possibly 0.
11215 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
11216 Handle the `- 1' part in rule numbers from/to item numbers.
11217 * src/conflicts.c (log_resolution): Fix the message which reversed
11218 shift and reduce.
11219 * src/output.c (action_row): Initialize default_rule to -1.
11220 (token_actions): Adjust.
11221 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
11222 expected output.
11223 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
11224
11225 2002-07-25 Akim Demaille <akim@epita.fr>
11226
11227 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
11228 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
11229 (b4_c_knr_arg_decl): New.
11230 * data/yacc.c: Use it to define yysymprint, yydestruct, and
11231 yyreport_parse_error.
11232
11233 2002-07-25 Akim Demaille <akim@epita.fr>
11234
11235 * data/yacc.c (yyreport_parse_error): New, extracted from...
11236 (yyparse): here.
11237 (yydestruct, yysymprint): Move above yyparse.
11238 Be K&R compliant.
11239
11240 2002-07-25 Akim Demaille <akim@epita.fr>
11241
11242 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
11243 replace...
11244 (b4_sint_type, b4_uint_type): these.
11245 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
11246 * tests/regression.at (Web2c Actions): Adjust.
11247
11248 2002-07-25 Akim Demaille <akim@epita.fr>
11249
11250 * src/gram.h (TIEM_NUMBER_MAX): New.
11251 (item_number_of_rule_number, rule_number_of_item_number): Rename
11252 as...
11253 (rule_number_as_item_number, item_number_as_rule_number): these.
11254 Adjust dependencies.
11255 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11256 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11257 (symbol_number_to_vector_number): New.
11258 (order): Of vector_number_t* type.
11259 (base_t, BASE_MAX, BASE_MIN): New.
11260 (froms, tos, width, pos, check): Of base_t type.
11261 (action_number_t, ACTION_MIN, ACTION_MAX): New.
11262 (actrow): Of action_number_t type.
11263 (conflrow): Of unsigned int type.
11264 (table_ninf, base_ninf): New.
11265 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
11266 (muscle_insert_int_table, muscle_insert_base_table)
11267 (muscle_insert_rule_number_table): New.
11268 (prepare_tokens): Output `toknum' as int_table.
11269 (action_row): Returns a rule_number_t.
11270 Use ACTION_MIN, not SHRT_MIN.
11271 (token_actions): yydefact is rule_number_t*.
11272 (table_ninf_remap): New.
11273 (pack_table): Use it for `base' and `table'.
11274 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
11275 replaced with...
11276 (YYPACT_NINF, YYTABLE_NINF): these.
11277 (yypact, yytable): Compute their types instead of hard-coded
11278 `short'.
11279 * tests/regression.at (Web2c Actions): Adjust.
11280
11281 2002-07-19 Akim Demaille <akim@epita.fr>
11282
11283 * src/scan-gram.l (id): Can start with an underscore.
11284
11285 2002-07-16 Akim Demaille <akim@epita.fr>
11286
11287 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
11288 Adjust all former `associativity' dependencies.
11289 * src/symtab.c (symbol_new): Default associativity is `undef', not
11290 `right'.
11291 (symbol_check_alias_consistence): Adjust.
11292
11293 2002-07-09 Akim Demaille <akim@epita.fr>
11294
11295 * doc/bison.texinfo: Properly set the ``header'' part.
11296 Use @dircategory ``GNU programming tools'' as per Texinfo's
11297 documentation.
11298 Use @copying.
11299
11300 2002-07-09 Akim Demaille <akim@epita.fr>
11301
11302 * lib/quotearg.h: Protect against multiple inclusions.
11303 * src/location.h (location_t): Add a `file' member.
11304 (LOCATION_RESET, LOCATION_PRINT): Adjust.
11305 * src/complain.c (warn_at, complain_at, fatal_at): Drop
11306 `error_one_per_line' support.
11307
11308 2002-07-09 Akim Demaille <akim@epita.fr>
11309
11310 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
11311 * src/reader.c (lineno): Remove.
11312 Adjust all dependencies.
11313 (get_merge_function): Take a location and use complain_at.
11314 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
11315 * tests/regression.at (Invalid inputs, Mixing %token styles):
11316 Adjust.
11317
11318 2002-07-09 Akim Demaille <akim@epita.fr>
11319
11320 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
11321 recovery rule, and forbid extensions when --yacc.
11322 (gram_error): Use complain_at.
11323 * src/reader.c (reader): Exit if there were parse errors.
11324
11325 2002-07-09 Akim Demaille <akim@epita.fr>
11326
11327 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
11328 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
11329 Reported by R Blake <blakers@mac.com>.
11330
11331 2002-07-09 Akim Demaille <akim@epita.fr>
11332
11333 * data/yacc.c: Output the copyright notive in the header.
11334
11335 2002-07-03 Akim Demaille <akim@epita.fr>
11336
11337 * src/output.c (froms, tos): Are state_number_t.
11338 (save_column): sp, sp1, and sp2 are state_number_t.
11339 (prepare): Rename `final' as `final_state_number', `nnts' as
11340 `nterms_number', `nrules' as `rules_number', `nstates' as
11341 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
11342 unused.
11343 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
11344 * data/lalr1.cc (nsym_): Remove, unused.
11345
11346 2002-07-03 Akim Demaille <akim@epita.fr>
11347
11348 * src/lalr.h, src/lalr.c (goto_number_t): New.
11349 * src/lalr.c (goto_list_t): New.
11350 Propagate them.
11351 * src/nullable.c (rule_list_t): New.
11352 Propagate.
11353 * src/types.h: Remove.
11354
11355 2002-07-03 Akim Demaille <akim@epita.fr>
11356
11357 * src/closure.c (print_fderives): Use rule_rhs_print.
11358 * src/derives.c (print_derives): Use rule_rhs_print.
11359 (rule_list_t): New, replaces `shorts'.
11360 (set_derives): Add comments.
11361 * tests/sets.at (Nullable, Firsts): Adjust.
11362
11363 2002-07-03 Akim Demaille <akim@epita.fr>
11364
11365 * src/output.c (prepare_actions): Free `tally' and `width'.
11366 (prepare_actions): Allocate and free `order'.
11367 * src/symtab.c (symbols_free): Free `symbols'.
11368 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
11369 * src/output.c (m4_invoke): Move to...
11370 * src/scan-skel.l: here.
11371 (<<EOF>>): Close yyout, and free its name.
11372
11373 2002-07-03 Akim Demaille <akim@epita.fr>
11374
11375 Fix some memory leaks, and fix a bug: state 0 was examined twice.
11376
11377 * src/LR0.c (new_state): Merge into...
11378 (state_list_append): this.
11379 (new_states): Merge into...
11380 (generate_states): here.
11381 (set_states): Don't ensure a proper `errs' state member here, do it...
11382 * src/conflicts.c (conflicts_solve): here.
11383 * src/state.h, src/state.c: Comment changes.
11384 (state_t): Rename member `shifts' as `transitions'.
11385 Adjust all dependencies.
11386 (errs_new): For consistency, also take the values as argument.
11387 (errs_dup): Remove.
11388 (state_errs_set): New.
11389 (state_reductions_set, state_transitions_set): Assert that no
11390 previous value was assigned.
11391 (state_free): New.
11392 (states_free): Use it.
11393 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
11394 temporary storage: use `errs' and `nerrs' as elsewhere.
11395 (set_conflicts): Allocate and free this `errs'.
11396
11397 2002-07-02 Akim Demaille <akim@epita.fr>
11398
11399 * lib/libiberty.h: New.
11400 * lib: Update the bitset implementation from upstream.
11401 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
11402 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
11403 * src/main.c: Adjust bitset stats calls.
11404
11405 2002-07-01 Paul Eggert <eggert@twinsun.com>
11406
11407 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
11408 char, so that negative chars don't collide with $.
11409
11410 2002-06-30 Akim Demaille <akim@epita.fr>
11411
11412 Have the GLR tests be `warning' checked, and fix the warnings.
11413
11414 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
11415 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
11416 (yyremoveDeletes): `yyi' and `yyj' are size_t.
11417 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
11418 (yyaddDeferredAction): static.
11419 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
11420 (yyreportParseError): yyprefix is const.
11421 yytokenp is used only when verbose.
11422 (yy__GNUC__): Replace with __GNUC__.
11423 (yypdumpstack): yyi is size_t.
11424 (yypreference): Un-yy local variables and arguments, to avoid
11425 clashes with `yyr1'. Anyway, we are not in the user name space.
11426 (yytname_size): be an int, as is compared with ints.
11427 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
11428 Use them.
11429 * tests/cxx-gram.at: Use quotation to protect $1.
11430 Use AT_COMPILE to enable warnings hunts.
11431 Prototype yylex and yyerror.
11432 `Use' argc.
11433 Include `string.h', not `strings.h'.
11434 Produce and prototype stmtMerge only when used.
11435 yylex takes a location.
11436
11437 2002-06-30 Akim Demaille <akim@epita.fr>
11438
11439 We spend a lot of time in quotearg, in particular when --verbose.
11440
11441 * src/symtab.c (symbol_get): Store a quoted version of the key.
11442 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
11443 Adjust all callers.
11444
11445 2002-06-30 Akim Demaille <akim@epita.fr>
11446
11447 * src/state.h (reductions_t): Rename member `nreds' as num.
11448 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
11449 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
11450
11451 2002-06-30 Akim Demaille <akim@epita.fr>
11452
11453 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
11454 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
11455 (shifts_to): Rename as...
11456 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
11457 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
11458 (TRANSITION_IS_DISABLED, transitions_to): these.
11459
11460 2002-06-30 Akim Demaille <akim@epita.fr>
11461
11462 * src/print.c (print_shifts, print_gotos): Merge into...
11463 (print_transitions): this.
11464 (print_transitions, print_errs, print_reductions): Align the
11465 lookaheads columns.
11466 (print_core, print_transitions, print_errs, print_state,
11467 print_grammar): Output empty lines separator before, not after.
11468 (state_default_rule_compute): Rename as...
11469 (state_default_rule): this.
11470 * tests/conflicts.at (Defaulted Conflicted Reduction),
11471 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
11472 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
11473
11474 2002-06-30 Akim Demaille <akim@epita.fr>
11475
11476 Display items as we display rules.
11477
11478 * src/gram.h, src/gram.c (rule_lhs_print): New.
11479 * src/gram.c (grammar_rules_partial_print): Use it.
11480 * src/print.c (print_core): Likewise.
11481 * tests/conflicts.at (Defaulted Conflicted Reduction),
11482 (Unresolved SR Conflicts): Adjust.
11483 (Unresolved SR Conflicts): Adjust and rename as...
11484 (Resolved SR Conflicts): this, as was meant.
11485 * tests/regression.at (Web2c Report): Adjust.
11486
11487 2002-06-30 Akim Demaille <akim@epita.fr>
11488
11489 * src/print.c (state_default_rule_compute): New, extracted from...
11490 (print_reductions): here.
11491 Pessimize, but clarify the code.
11492 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
11493
11494 2002-06-30 Akim Demaille <akim@epita.fr>
11495
11496 * src/output.c (action_row): Let default_rule be always a rule
11497 number.
11498
11499 2002-06-30 Akim Demaille <akim@epita.fr>
11500
11501 * src/closure.c (print_firsts, print_fderives, closure):
11502 Use BITSET_EXECUTE.
11503 * src/lalr.c (lookaheads_print): Likewise.
11504 * src/state.c (state_rule_lookaheads_print): Likewise.
11505 * src/print_graph.c (print_core): Likewise.
11506 * src/print.c (print_reductions): Likewise.
11507 * src/output.c (action_row): Likewise.
11508 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
11509
11510 2002-06-30 Akim Demaille <akim@epita.fr>
11511
11512 * src/print_graph.c: Use report_flag.
11513
11514 2002-06-30 Akim Demaille <akim@epita.fr>
11515
11516 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
11517 to...
11518 * src/relation.h, src/relation.c (traverse, relation_digraph)
11519 (relation_print, relation_transpose): New.
11520
11521 2002-06-30 Akim Demaille <akim@epita.fr>
11522
11523 * src/state.h, src/state.c (shifts_to): New.
11524 * src/lalr.c (build_relations): Use it.
11525
11526 2002-06-30 Akim Demaille <akim@epita.fr>
11527
11528 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
11529 (item_number_of_rule_number, rule_number_of_item_number): New.
11530 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
11531 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
11532 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
11533 Propagate their use.
11534 Much remains to be done, in particular wrt `shorts' from types.h.
11535
11536 2002-06-30 Akim Demaille <akim@epita.fr>
11537
11538 * src/symtab.c (symbol_new): Initialize the `printer' member.
11539
11540 2002-06-30 Akim Demaille <akim@epita.fr>
11541
11542 * src/LR0.c (save_reductions): Remove, replaced by...
11543 * src/state.h, src/state.c (state_reductions_set): New.
11544 (reductions, errs): Rename as...
11545 (reductions_t, errs_t): these.
11546 Adjust all dependencies.
11547
11548 2002-06-30 Akim Demaille <akim@epita.fr>
11549
11550 * src/LR0.c (state_list_t, state_list_append): New.
11551 (first_state, last_state): Now symbol_list_t.
11552 (this_state): Remove.
11553 (new_itemsets, append_states, save_reductions): Take a state_t as
11554 argument.
11555 (set_states, generate_states): Adjust.
11556 (save_shifts): Remove, replaced by...
11557 * src/state.h, src/state.c (state_shifts_set): New.
11558 (shifts): Rename as...
11559 (shifts_t): this.
11560 Adjust all dependencies.
11561 * src/state.h (state_t): Remove the `next' member.
11562
11563 2002-06-30 Akim Demaille <akim@epita.fr>
11564
11565 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
11566 escaped in slot 0.
11567
11568 2002-06-30 Akim Demaille <akim@epita.fr>
11569
11570 Use hash.h for the state hash table.
11571
11572 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
11573 (allocate_storage): Use state_hash_new.
11574 (free_storage): Use state_hash_free.
11575 (new_state, get_state): Adjust.
11576 * src/lalr.h, src/lalr.c (states): Move to...
11577 * src/states.h (state_t): Remove the `link' member, no longer
11578 used.
11579 * src/states.h, src/states.c: here.
11580 (state_hash_new, state_hash_free, state_hash_lookup)
11581 (state_hash_insert, states_free): New.
11582 * src/states.c (state_table, state_compare, state_hash): New.
11583 * src/output.c (output_actions): Do not free states now, since we
11584 still need to know the final_state number in `prepare', called
11585 afterwards. Do it...
11586 * src/main.c (main): here: call states_free after `output'.
11587
11588 2002-06-30 Akim Demaille <akim@epita.fr>
11589
11590 * src/state.h, src/state.c (state_new): New, extracted from...
11591 * src/LR0.c (new_state): here.
11592 * src/state.h (STATE_ALLOC): Move to...
11593 * src/state.c: here.
11594 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
11595 * src/state.h, src/state.c: here.
11596
11597 2002-06-30 Akim Demaille <akim@epita.fr>
11598
11599 * src/reader.c (gensym): Rename as...
11600 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
11601 (getsym): Rename as...
11602 (symbol_get): this.
11603
11604 2002-06-30 Akim Demaille <akim@epita.fr>
11605
11606 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
11607 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
11608 * src/output.c, src/print.c, src/print_graph.c: Propagate.
11609 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
11610
11611 2002-06-30 Akim Demaille <akim@epita.fr>
11612
11613 Make the test suite pass with warnings checked.
11614
11615 * tests/actions.at (Printers and Destructors): Improve.
11616 Avoid unsigned vs. signed issues.
11617 * tests/calc.at: Don't exercise the scanner here, do it...
11618 * tests/input.at (Torturing the Scanner): here.
11619
11620 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11621
11622 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
11623 reorganize first lines parallel to yacc.c.
11624
11625 2002-06-28 Akim Demaille <akim@epita.fr>
11626
11627 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
11628 (b4_token_enum, b4_token_defines): New, factored from...
11629 * data/lalr1.cc, data/yacc.c, glr.c: here.
11630
11631 2002-06-28 Akim Demaille <akim@epita.fr>
11632
11633 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
11634 unused variables.
11635 * src/output.c (merger_output): static.
11636
11637 2002-06-28 Akim Demaille <akim@epita.fr>
11638
11639 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
11640 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
11641 pacify GCC.
11642 * src/output.c (save_row): Initialize all the variables to pacify GCC.
11643
11644 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11645
11646 Accumulated changelog for new GLR parsing features.
11647
11648 * src/conflicts.c (count_total_conflicts): Change name to
11649 conflicts_total_count.
11650 * src/conflicts.h: Ditto.
11651 * src/output.c (token_actions): Use the new name.
11652 (output_conflicts): Change conflp => conflict_list_heads, and
11653 confl => conflict_list for better readability.
11654 * data/glr.c: Use the new names.
11655 * NEWS: Add self to GLR announcement.
11656
11657 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
11658
11659 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
11660 Akim Demaille.
11661
11662 * data/bison.glr: Change name to glr.c
11663 * data/glr.c: Renamed from bison.glr.
11664 * data/Makefile.am: Add glr.c
11665
11666 * src/getargs.c:
11667
11668 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
11669 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
11670
11671 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11672
11673 * data/bison.glr: Be sure to restore the
11674 current #line when returning to the skeleton contents after having
11675 exposed the input file's #line.
11676
11677 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11678
11679 * data/bison.glr: Bring up to date with changes to bison.simple.
11680
11681 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11682
11683 * data/bison.glr: Correct definitions that use b4_prefix.
11684 Various reformatting.
11685 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
11686 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
11687 yytokenp argument; now part of stack.
11688 (yychar): Define to behave as documented.
11689 (yyclearin): Ditto.
11690
11691 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11692
11693 * src/reader.h: Add declaration for free_merger_functions.
11694
11695 * src/reader.c (merge_functions): New variable.
11696 (get_merge_function): New function.
11697 (free_merger_functions): New function.
11698 (readgram): Check for %prec that is not followed by a symbol.
11699 Handle %dprec and %merge declarations.
11700 (packgram): Initialize dprec and merger fields in rules array.
11701
11702 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
11703 conflict_list_cnt, conflict_list_free): New variables.
11704 (table_grow): Also grow conflict_table.
11705 (prepare_rules): Output dprec and merger tables.
11706 (conflict_row): New function.
11707 (action_row): Output conflict lists for GLR parser. Don't use
11708 default reduction in conflicted states for GLR parser so that there
11709 are spaces for the conflict lists.
11710 (save_row): Also save conflict information.
11711 (token_actions): Allocate conflict list.
11712 (merger_output): New function.
11713 (pack_vector): Pack conflict table, too.
11714 (output_conflicts): New function to output yyconflp and yyconfl.
11715 (output_check): Allocate conflict_tos.
11716 (output_actions): Output conflict tables, also.
11717 (output_skeleton): Output b4_mergers definition.
11718 (prepare): Output b4_max_rhs_length definition.
11719 Use 'bison.glr' as default skeleton for GLR parsers.
11720
11721 * src/gram.c (glr_parser): New flag.
11722 (grammar_free): Call free_merger_functions.
11723
11724 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
11725 all pairs of conflicting reductions, rather than just all tokens
11726 causing conflicts. Needed to size conflict tables.
11727 (conflicts_output): Modify call to count_rr_conflicts for new
11728 interface.
11729 (conflicts_print): Ditto.
11730 (count_total_conflicts): New function.
11731
11732 * src/reader.h (merger_list): New type.
11733 (merge_functions): New variable.
11734
11735 * src/lex.h (tok_dprec, tok_merge): New token types.
11736
11737 * src/gram.h (rule_s): Add dprec and merger fields.
11738 (glr_parser): New flag.
11739
11740 * src/conflicts.h (count_total_conflicts): New function.
11741
11742 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
11743
11744 * doc/bison.texinfo (Generalized LR Parsing): New section.
11745 (GLR Parsers): New section.
11746 (Language and Grammar): Mention GLR parsing.
11747 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
11748 Correct typo ("tge" -> "the").
11749
11750 * data/bison.glr: New skeleton for GLR parsing.
11751
11752 * tests/cxx-gram.at: New tests for GLR parsing.
11753
11754 * tests/testsuite.at: Include cxx-gram.at.
11755
11756 * tests/Makefile.am: Add cxx-gram.at.
11757
11758 * src/parse-gram.y:
11759
11760 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
11761
11762 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
11763
11764 2002-06-27 Akim Demaille <akim@epita.fr>
11765
11766 * src/options.h, src/options.c: Remove.
11767 * src/getargs.c (short_options, long_options): New.
11768
11769 2002-06-27 Akim Demaille <akim@epita.fr>
11770
11771 * data/bison.simple, data/bison.c++: Rename as...
11772 * data/yacc.c, data/lalr1.cc: these.
11773 * doc/bison.texinfo (Environment Variables): Remove.
11774
11775 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
11776
11777 * src/getargs.c (report_argmatch): Initialize strtok().
11778
11779 2002-06-20 Akim Demaille <akim@epita.fr>
11780
11781 * data/bison.simple (b4_symbol_actions): New, replaces...
11782 (b4_symbol_destructor, b4_symbol_printer): these.
11783 (yysymprint): Be sure to call YYPRINT only for tokens, and using
11784 user token numbers.
11785
11786 2002-06-20 Akim Demaille <akim@epita.fr>
11787
11788 * data/bison.simple (yydestructor): Rename as...
11789 (yydestruct): this.
11790
11791 2002-06-20 Akim Demaille <akim@epita.fr>
11792
11793 * src/symtab.h, src/symtab.c (symbol_type_set)
11794 (symbol_destructor_set, symbol_precedence_set): The location is
11795 the last argument.
11796 Adjust all callers.
11797
11798 2002-06-20 Akim Demaille <akim@epita.fr>
11799
11800 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
11801 internals.
11802 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
11803 Takes a location.
11804 * src/symtab.h, src/symtab.c (symbol_class_set)
11805 (symbol_user_token_number_set): Likewise.
11806 Adjust all callers.
11807 Promote complain_at.
11808 * tests/input.at (Type Clashes): Adjust.
11809
11810 2002-06-20 Akim Demaille <akim@epita.fr>
11811
11812 * data/bison.simple (YYLEX): Fix the declaration when
11813 %pure-parser.
11814
11815 2002-06-20 Akim Demaille <akim@epita.fr>
11816
11817 * data/bison.simple (yysymprint): Don't print the token number,
11818 just its name.
11819 * tests/actions.at (Destructors): Rename as...
11820 (Printers and Destructors): this.
11821 Also exercise %printer.
11822
11823 2002-06-20 Akim Demaille <akim@epita.fr>
11824
11825 * data/bison.simple (YYDSYMPRINT): New.
11826 Use it to remove many of the #if YYDEBUG/if (yydebug).
11827
11828 2002-06-20 Akim Demaille <akim@epita.fr>
11829
11830 * src/symtab.h, src/symtab.c (symbol_t): printer and
11831 printer_location are new members.
11832 (symbol_printer_set): New.
11833 * src/parse-gram.y (PERCENT_PRINTER): New token.
11834 Handle its associated rule.
11835 * src/scan-gram.l: Adjust.
11836 (handle_destructor_at, handle_destructor_dollar): Rename as...
11837 (handle_symbol_code_at, handle_symbol_code_dollar): these.
11838 * src/output.c (symbol_printers_output): New.
11839 (output_skeleton): Call it.
11840 * data/bison.simple (yysymprint): New. Cannot be named yyprint
11841 since there are already many grammar files with a user `yyprint'.
11842 Replace the calls to YYPRINT to calls to yysymprint.
11843 * tests/calc.at: Adjust.
11844 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
11845 taking advantage of parser very internal details (stack size!).
11846
11847 2002-06-20 Akim Demaille <akim@epita.fr>
11848
11849 * src/scan-gram.l: Complete the scanner with the missing patterns
11850 to pacify Flex.
11851 Use `quote' and `symbol_tag_get' where appropriate.
11852
11853 2002-06-19 Akim Demaille <akim@epita.fr>
11854
11855 * tests/actions.at (Destructors): Augment to test locations.
11856 * data/bison.simple (yydestructor): Pass it the current location
11857 if locations are enabled.
11858 Prototype only when __STDC__ or C++.
11859 Change the argument names to move into the yy name space: there is
11860 user code here.
11861
11862 2002-06-19 Akim Demaille <akim@epita.fr>
11863
11864 * data/bison.simple (b4_pure_if): New.
11865 Use it instead of #ifdef YYPURE.
11866
11867 2002-06-19 Akim Demaille <akim@epita.fr>
11868
11869 * data/bison.simple (b4_location_if): New.
11870 Use it instead of #ifdef YYLSP_NEEDED.
11871
11872 2002-06-19 Akim Demaille <akim@epita.fr>
11873
11874 Prepare @$ in %destructor, but currently don't bind it in the
11875 skeleton, as %location use is not cleaned up yet.
11876
11877 * src/scan-gram.l (handle_dollar, handle_destructor_at)
11878 (handle_action_at): New.
11879 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
11880 a braced_code_t and a location as additional arguments.
11881 (handle_destructor_dollar): Instead of requiring `b4_eval', just
11882 unquote one when outputting `b4_dollar_dollar'.
11883 Adjust callers.
11884 * data/bison.simple (b4_eval): Remove.
11885 (b4_symbol_destructor): Adjust.
11886 * tests/input.at (Invalid @n): Adjust.
11887
11888 2002-06-19 Zack Weinberg <zack@codesourcery.com>
11889
11890 * doc/bison.texinfo: Document ability to have multiple
11891 prologue sections.
11892
11893 2002-06-18 Akim Demaille <akim@epita.fr>
11894
11895 * src/files.c (compute_base_names): When computing the output file
11896 names from the input file name, strip the directory part.
11897
11898 2002-06-18 Akim Demaille <akim@epita.fr>
11899
11900 * data/bison.simple.new: Comment changes.
11901 Reported by Andreas Schwab.
11902
11903 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
11904
11905 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
11906 there are no `label `yyoverflowlab' defined but not used' warnings
11907 when yyoverflow is defined.
11908
11909 2002-06-18 Akim Demaille <akim@epita.fr>
11910
11911 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
11912 new member.
11913 (symbol_destructor_set): Adjust.
11914 * src/output.c (symbol_destructors_output): Output the destructor
11915 locations.
11916 Output the symbol name.
11917 * data/bison.simple (b4_symbol_destructor): Adjust.
11918
11919 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
11920 and Akim Demaille <akim@epita.fr>
11921
11922 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
11923 what's left on the stack when the error recovery hits EOF.
11924 * tests/actions.at (Destructors): Complete to exercise this case.
11925
11926 2002-06-17 Akim Demaille <akim@epita.fr>
11927
11928 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
11929 arguments is really empty, not only equal to `[]'.
11930 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
11931 member.
11932 (symbol_destructor_set): New.
11933 * src/output.c (symbol_destructors_output): New.
11934 * src/reader.h (brace_code_t, current_braced_code): New.
11935 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
11936 (handle_dollar): Rename as...
11937 (handle_action_dollar): this.
11938 (handle_destructor_dollar): New.
11939 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
11940 (grammar_declaration): Use it.
11941 * data/bison.simple (yystos): Is always defined.
11942 (yydestructor): New.
11943 * tests/actions.at (Destructors): New.
11944 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
11945
11946 2002-06-17 Akim Demaille <akim@epita.fr>
11947
11948 * src/symlist.h, src/symlist.c (symbol_list_length): New.
11949 * src/scan-gram.l (handle_dollar, handle_at): Compute the
11950 rule_length only when needed.
11951 * src/output.c (actions_output, token_definitions_output): Output
11952 the full M4 block.
11953 * src/symtab.c: Don't access directly to the symbol tag, use
11954 symbol_tag_get.
11955 * src/parse-gram.y: Use symbol_list_free.
11956
11957 2002-06-17 Akim Demaille <akim@epita.fr>
11958
11959 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
11960 (symbol_list_prepend, get_type_name): Move to...
11961 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
11962 (symbol_list_prepend, symbol_list_n_type_name_get): here.
11963 Adjust all callers.
11964 (symbol_list_free): New.
11965 * src/scan-gram.l (handle_dollar): Takes a location.
11966 * tests/input.at (Invalid $n): Adjust.
11967
11968 2002-06-17 Akim Demaille <akim@epita.fr>
11969
11970 * src/reader.h, src/reader.c (symbol_list_new): Export it.
11971 (symbol_list_prepend): New.
11972 * src/parse-gram.y (%union): `list' is a new member.
11973 (symbols.1): New, replaces...
11974 (terms_to_prec.1, nterms_to_type.1): these.
11975 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
11976 Take a location as additional argument.
11977 Adjust all callers.
11978
11979 2002-06-15 Akim Demaille <akim@epita.fr>
11980
11981 * src/parse-gram.y: Move %token in the declaration section so that
11982 we don't depend upon CVS Bison.
11983
11984 2002-06-15 Akim Demaille <akim@epita.fr>
11985
11986 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
11987 * src/print.c (print_core): Use it.
11988
11989 2002-06-15 Akim Demaille <akim@epita.fr>
11990
11991 * src/conflicts.c (log_resolution): Accept the rule involved in
11992 the sr conflicts instead of the lookahead number that points to
11993 that rule.
11994 (flush_reduce): Accept the current lookahead vector as argument,
11995 instead of the index in LA.
11996 (resolve_sr_conflict): Accept the current number of lookahead
11997 bitset to consider for the STATE, instead of the index in LA.
11998 (set_conflicts): Adjust.
11999 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
12000
12001 2002-06-15 Akim Demaille <akim@epita.fr>
12002
12003 * src/state.h (state_t): Replace the `lookaheadsp' member, a
12004 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
12005 Adjust all dependencies.
12006 * src/lalr.c (initialize_lookaheads): Split into...
12007 (states_lookaheads_count, states_lookaheads_initialize): these.
12008 (lalr): Adjust.
12009
12010 2002-06-15 Akim Demaille <akim@epita.fr>
12011
12012 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
12013 out of...
12014 (grammar_rules_print): here.
12015 * src/reduce.c (reduce_output): Use it.
12016 * tests/reduce.at (Useless Rules, Reduced Automaton)
12017 (Underivable Rules): Adjust.
12018
12019 2002-06-15 Akim Demaille <akim@epita.fr>
12020
12021 Copy BYacc's nice way to report the grammar.
12022
12023 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
12024 New.
12025 Don't print the rules' location, it is confusing and useless.
12026 (rule_print): Use grammar_rhs_print.
12027 * src/print.c (print_grammar): Use grammar_rules_print.
12028
12029 2002-06-15 Akim Demaille <akim@epita.fr>
12030
12031 Complete and rationalize `useless thing' warnings.
12032
12033 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
12034 (symbol_tag_print): New.
12035 Use them everywhere in place of accessing directly the tag member.
12036 * src/gram.h, src/gram.c (rule_print): New.
12037 Use it where a rule used to be printed `by hand'.
12038 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
12039 (reduce_grammar_tables): Report the useless rules.
12040 (reduce_print): Useless things are a warning, not an error.
12041 Report it as such.
12042 * tests/reduce.at (Useless Nonterminals, Useless Rules):
12043 (Reduced Automaton, Underivable Rules): Adjust.
12044 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
12045 * tests/conflicts.at (Unresolved SR Conflicts)
12046 (Solved SR Conflicts): Adjust.
12047
12048 2002-06-15 Akim Demaille <akim@epita.fr>
12049
12050 Let symbols have a location.
12051
12052 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
12053 (getsym): Adjust.
12054 Adjust all callers.
12055 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
12056 Use location_t, not int.
12057 * src/symtab.c (symbol_check_defined): Take advantage of the
12058 location.
12059 * tests/regression.at (Invalid inputs): Adjust.
12060
12061 2002-06-15 Akim Demaille <akim@epita.fr>
12062
12063 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
12064 (input): Don't try to initialize yylloc here, do it in the
12065 scanner.
12066 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
12067 * src/gram.h (rule_t): Change line and action_line into location
12068 and action_location, of location_t type.
12069 Adjust all dependencies.
12070 * src/location.h, src/location.c (empty_location): New.
12071 * src/reader.h, src/reader.c (grammar_start_symbol_set)
12072 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
12073 (grammar_current_rule_symbol_append)
12074 (grammar_current_rule_action_append): Expect a location as argument.
12075 * src/reader.c (grammar_midrule_action): Adjust to attach an
12076 action's location as dummy symbol location.
12077 * src/symtab.h, src/symtab.c (startsymbol_location): New.
12078 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
12079 the line numbers.
12080
12081 2002-06-14 Akim Demaille <akim@epita.fr>
12082
12083 Grammar declarations may be found in the grammar section.
12084
12085 * src/parse-gram.y (rules_or_grammar_declaration): New.
12086 (declarations): Each declaration may end with a semicolon, not
12087 just...
12088 (grammar_declaration): `"%union"'.
12089 (grammar): Branch to rules_or_grammar_declaration.
12090
12091 2002-06-14 Akim Demaille <akim@epita.fr>
12092
12093 * src/main.c (main): Invoke scanner_free.
12094
12095 2002-06-14 Akim Demaille <akim@epita.fr>
12096
12097 * src/output.c (m4_invoke): Extracted from...
12098 (output_skeleton): here.
12099 Free tempfile.
12100
12101 2002-06-14 Akim Demaille <akim@epita.fr>
12102
12103 * src/parse-gram.y (directives, directive, gram)
12104 (grammar_directives, precedence_directives, precedence_directive):
12105 Rename as...
12106 (declarations, declaration, grammar, grammar_declaration)
12107 (precedence_declaration, precedence_declarator): these.
12108 (symbol_declaration): New.
12109
12110 2002-06-14 Akim Demaille <akim@epita.fr>
12111
12112 * src/files.c (action_obstack): Remove, unused.
12113 (output_obstack): Remove it, and all its dependencies, as it is no
12114 longer needed.
12115 * src/reader.c (epilogue_set): Build the epilogue in the
12116 muscle_obstack.
12117 * src/output.h, src/output.c (muscle_obstack): Move to...
12118 * src/muscle_tab.h, src/muscle_tab.h: here.
12119 (muscle_init): Initialize muscle_obstack.
12120 (muscle_free): New.
12121 * src/main.c (main): Call it.
12122
12123 2002-06-14 Akim Demaille <akim@epita.fr>
12124
12125 * src/location.h: New, extracted from...
12126 * src/reader.h: here.
12127 * src/Makefile.am (noinst_HEADERS): Merge into
12128 (bison_SOURCES): this.
12129 Add location.h.
12130 * src/parse-gram.y: Use location_t instead of Bison's.
12131 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
12132 Use location_t instead of ints.
12133
12134 2002-06-14 Akim Demaille <akim@epita.fr>
12135
12136 * data/bison.simple, data/bison.c++: Be sure to restore the
12137 current #line when returning to the skeleton contents after having
12138 exposed the input file's #line.
12139
12140 2002-06-12 Akim Demaille <akim@epita.fr>
12141
12142 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
12143 eager.
12144 * tests/actions.at (Exotic Dollars): New.
12145
12146 2002-06-12 Akim Demaille <akim@epita.fr>
12147
12148 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
12149 ['"/] too eagerly.
12150 * tests/input.at (Torturing the Scanner): New.
12151
12152 2002-06-11 Akim Demaille <akim@epita.fr>
12153
12154 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
12155 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
12156 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
12157 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
12158 * src/reader.c (reader): Use it.
12159
12160 2002-06-11 Akim Demaille <akim@epita.fr>
12161
12162 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
12163 Adjust all callers.
12164 (scanner_last_string_free): New.
12165
12166 2002-06-11 Akim Demaille <akim@epita.fr>
12167
12168 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
12169 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
12170 (last_string, YY_OBS_FREE): New.
12171 Use them when returning an ID.
12172
12173 2002-06-11 Akim Demaille <akim@epita.fr>
12174
12175 Have Bison grammars parsed by a Bison grammar.
12176
12177 * src/reader.c, src/reader.h (prologue_augment): New.
12178 * src/reader.c (copy_definition): Remove.
12179
12180 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
12181 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
12182 (grammar_current_rule_prec_set, grammar_current_rule_check)
12183 (grammar_current_rule_symbol_append)
12184 (grammar_current_rule_action_append): Export.
12185 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
12186 (symbol_list_action_append): Remove.
12187 Hook the routines from reader.
12188 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
12189 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
12190
12191 * src/reader.c (read_declarations): Remove, unused.
12192
12193 * src/parse-gram.y: Handle the epilogue.
12194 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
12195 (grammar_start_symbol_set): this.
12196 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
12197 * src/reader.c (readgram): Remove, unused.
12198 (reader): Adjust to insert eoftoken and axiom where appropriate.
12199
12200 * src/reader.c (copy_dollar): Replace with...
12201 * src/scan-gram.h (handle_dollar): this.
12202 * src/parse-gram.y: Remove `%thong'.
12203
12204 * src/reader.c (copy_at): Replace with...
12205 * src/scan-gram.h (handle_at): this.
12206
12207 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
12208 New.
12209
12210 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
12211 time being.
12212
12213 * src/reader.h, src/reader.c (grammar_rule_end): New.
12214
12215 * src/parse.y (current_type, current_class): New.
12216 Implement `%nterm', `%token' support.
12217 Merge `%term' into `%token'.
12218 (string_as_id): New.
12219 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
12220 type name.
12221
12222 * src/parse-gram.y: Be sure to handle properly the beginning of
12223 rules.
12224
12225 * src/parse-gram.y: Handle %type.
12226 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
12227
12228 * src/parse-gram.y: More directives support.
12229 * src/options.c: No longer handle source directives.
12230
12231 * src/parse-gram.y: Fix %output.
12232
12233 * src/parse-gram.y: Handle %union.
12234 Use the prologue locations.
12235 * src/reader.c (parse_union_decl): Remove.
12236
12237 * src/reader.h, src/reader.c (epilogue_set): New.
12238 * src/parse-gram.y: Use it.
12239
12240 * data/bison.simple, data/bison.c++: b4_stype is now either not
12241 defined, then default to int, or to the contents of %union,
12242 without `union' itself.
12243 Adjust.
12244 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
12245
12246 * src/output.c (actions_output): Don't output braces, as they are
12247 already handled by the scanner.
12248
12249 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
12250 characters to themselves.
12251
12252 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
12253 that the epilogue has a proper #line.
12254
12255 * src/parse-gram.y: Handle precedence/associativity.
12256
12257 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
12258 a terminal.
12259 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
12260 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
12261 at all to define terminals that cannot be emitted.
12262
12263 * src/scan-gram.l: Escape M4 characters.
12264
12265 * src/scan-gram.l: Working properly with escapes in user
12266 strings/characters.
12267
12268 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
12269 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
12270 grammar.
12271 Use more modest sizes, as for the time being the parser does not
12272 release memory, and therefore the process swallows a huge amount
12273 of memory.
12274
12275 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
12276 stricter %token grammar.
12277
12278 * src/symtab.h (associativity): Add `undef_assoc'.
12279 (symbol_precedence_set): Do nothing when passed an undef_assoc.
12280 * src/symtab.c (symbol_check_alias_consistence): Adjust.
12281
12282 * tests/regression.at (Invalid %directive): Remove, as it is now
12283 meaningless.
12284 (Invalid inputs): Adjust to the new error messages.
12285 (Token definitions): The new grammar doesn't allow too many
12286 eccentricities.
12287
12288 * src/lex.h, src/lex.c: Remove.
12289 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
12290 (copy_character, copy_string2, copy_string, copy_identifier)
12291 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
12292 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
12293 (parse_action): Remove.
12294 * po/POTFILES.in: Adjust.
12295
12296 2002-06-11 Akim Demaille <akim@epita.fr>
12297
12298 * src/reader.c (parse_action): Don't store directly into the
12299 rule's action member: return the action as a string.
12300 Don't require `rule_length' as an argument: compute it.
12301 (grammar_current_rule_symbol_append)
12302 (grammar_current_rule_action_append): New, eved out from
12303 (readgram): here.
12304 Remove `action_flag', `rulelength', unused now.
12305
12306 2002-06-11 Akim Demaille <akim@epita.fr>
12307
12308 * src/reader.c (grammar_current_rule_prec_set).
12309 (grammar_current_rule_check): New, eved out from...
12310 (readgram): here.
12311 Remove `xaction', `first_rhs': useless.
12312 * tests/input.at (Type clashes): New.
12313 * tests/existing.at (GNU Cim Grammar): Adjust.
12314
12315 2002-06-11 Akim Demaille <akim@epita.fr>
12316
12317 * src/reader.c (grammar_midrule_action): New, Eved out from
12318 (readgram): here.
12319
12320 2002-06-11 Akim Demaille <akim@epita.fr>
12321
12322 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
12323 New.
12324 (readgram): Use them as replacement of inlined code, crule and
12325 crule1.
12326
12327 2002-06-11 Akim Demaille <akim@epita.fr>
12328
12329 * src/reader.c (grammar_end, grammar_symbol_append): New.
12330 (readgram): Use them.
12331 Make the use of `p' as local as possible.
12332
12333 2002-06-10 Akim Demaille <akim@epita.fr>
12334
12335 GCJ's parser requires the tokens to be defined before the prologue.
12336
12337 * data/bison.simple: Output the token definition before the user's
12338 prologue.
12339 * tests/regression.at (Braces parsing, Duplicate string)
12340 (Mixing %token styles): Check the output from bison.
12341 (Early token definitions): New.
12342
12343 2002-06-10 Akim Demaille <akim@epita.fr>
12344
12345 * src/symtab.c (symbol_user_token_number_set): Don't complain when
12346 assigning twice the same user number to a token, so that we can
12347 use it in...
12348 * src/lex.c (lex): here.
12349 Also use `symbol_class_set' instead of hand written code.
12350 * src/reader.c (parse_assoc_decl): Likewise.
12351
12352 2002-06-10 Akim Demaille <akim@epita.fr>
12353
12354 * src/symtab.c, src/symtab.c (symbol_class_set)
12355 (symbol_user_token_number_set): New.
12356 * src/reader.c (parse_token_decl): Use them.
12357 Use a switch instead of ifs.
12358 Use a single argument.
12359
12360 2002-06-10 Akim Demaille <akim@epita.fr>
12361
12362 Remove `%thong' support as it is undocumented, unused, duplicates
12363 `%token's job, and creates useless e-mail traffic with people who
12364 want to know what it is, why it is undocumented, unused, and
12365 duplicates `%token's job.
12366
12367 * src/reader.c (parse_thong_decl): Remove.
12368 * src/options.c (option_table): Remove "thong".
12369 * src/lex.h (tok_thong): Remove.
12370
12371 2002-06-10 Akim Demaille <akim@epita.fr>
12372
12373 * src/symtab.c, src/symtab.c (symbol_type_set)
12374 (symbol_precedence_set): New.
12375 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
12376 (value_components_used): Remove, unused.
12377
12378 2002-06-09 Akim Demaille <akim@epita.fr>
12379
12380 Move symbols handling code out of the reader.
12381
12382 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
12383 (axiom): Move to...
12384 * src/symtab.h, src/symtab.c: here.
12385
12386 * src/gram.c (start_symbol): Remove: use startsymbol->number.
12387 * src/reader.c (startval): Rename as...
12388 * src/symtab.h, src/symtab.c (startsymbol): this.
12389 * src/reader.c: Adjust.
12390
12391 * src/reader.c (symbol_check_defined, symbol_make_alias)
12392 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12393 (token_translations_init)
12394 Move to...
12395 * src/symtab.c: here.
12396 * src/reader.c (packsymbols): Move to...
12397 * src/symtab.h, src/symtab.c (symbols_pack): here.
12398 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
12399 argument.
12400
12401 2002-06-03 Akim Demaille <akim@epita.fr>
12402
12403 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
12404 then statements.
12405
12406 2002-06-03 Akim Demaille <akim@epita.fr>
12407
12408 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
12409 structs with non literals.
12410 * src/scan-skel.l: never-interactive.
12411 * src/conflicts.c (enum conflict_resolution_e): No trailing
12412 comma.
12413 * src/getargs.c (usage): Split long literal strings.
12414 Reported by Hans Aberg.
12415
12416 2002-05-28 Akim Demaille <akim@epita.fr>
12417
12418 * data/bison.c++: Use C++ ostreams.
12419 (cdebug_): New member.
12420
12421 2002-05-28 Akim Demaille <akim@epita.fr>
12422
12423 * src/output.c (output_skeleton): Be sure to allocate enough room
12424 for `/' _and_ for `\0' in full_skeleton.
12425
12426 2002-05-28 Akim Demaille <akim@epita.fr>
12427
12428 * data/bison.c++: Catch up with bison.simple:
12429 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12430 and Paul Eggert <eggert@twinsun.com>: `error' handing.
12431 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
12432 and popping traces.
12433
12434 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12435
12436 * src/output.c (output_skeleton): Put an explicit path in front of
12437 the skeleton file name, rather than relying on the -I directory,
12438 to partially alleviate effects of having a skeleton file lying around
12439 in the current directory.
12440
12441 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12442
12443 * src/conflicts.c (log_resolution): Correct typo:
12444 obstack_printf should be obstack_fgrow1.
12445
12446 2002-05-26 Akim Demaille <akim@epita.fr>
12447
12448 * src/state.h (state_t): `solved_conflicts' is a new member.
12449 * src/LR0.c (new_state): Set it to 0.
12450 * src/conflicts.h, src/conflicts.c (print_conflicts)
12451 (free_conflicts, solve_conflicts): Rename as...
12452 (conflicts_print, conflicts_free, conflicts_solve): these.
12453 Adjust callers.
12454 * src/conflicts.c (enum conflict_resolution_e)
12455 (solved_conflicts_obstack): New, used by...
12456 (log_resolution): this.
12457 Adjust to attach the conflict resolution to each state.
12458 Complete the description with the precedence/associativity
12459 information.
12460 (resolve_sr_conflict): Adjust.
12461 * src/print.c (print_state): Output its solved_conflicts.
12462 * tests/conflicts.at (Unresolved SR Conflicts)
12463 (Solved SR Conflicts): Exercise --report=all.
12464
12465 2002-05-26 Akim Demaille <akim@epita.fr>
12466
12467 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12468 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12469 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
12470 (token_number_t, item_number_as_token_number)
12471 (token_number_as_item_number, muscle_insert_token_number_table):
12472 Rename as...
12473 (symbol_number_t, item_number_as_symbol_number)
12474 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
12475 these, since it is more appropriate.
12476
12477 2002-05-26 Akim Demaille <akim@epita.fr>
12478
12479 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
12480 `Error:' lines.
12481 * data/bison.simple (yystos) [YYDEBUG]: New.
12482 (yyparse) [YYDEBUG]: Display the symbols which are popped during
12483 error recovery.
12484 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
12485
12486 2002-05-25 Akim Demaille <akim@epita.fr>
12487
12488 * doc/bison.texinfo (Debugging): Split into...
12489 (Tracing): this new section, its former contents, and...
12490 (Understanding): this new section.
12491 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
12492 by...
12493 (report_flag): this.
12494 Adjust all dependencies.
12495 (report_args, report_types, report_argmatch): New.
12496 (usage, getargs): Report/support -r, --report.
12497 * src/options.h
12498 (struct option_table_struct): Rename as..,
12499 (struct option_table_s): this.
12500 Rename the `set_flag' member to `flag' to match with getopt_long's
12501 struct.
12502 * src/options.c (option_table): Split verbose into an entry for
12503 %verbose, and another for --verbose.
12504 Support --report/-r, so remove -r from the obsolete --raw.
12505 * src/print.c: Attach full item sets and lookaheads reports to
12506 report_flag instead of trace_flag.
12507 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
12508
12509 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12510 and Paul Eggert <eggert@twinsun.com>
12511
12512 * data/bison.simple (yyparse): Correct error handling to conform to
12513 POSIX and yacc. Specifically, after syntax error is discovered,
12514 do not reduce further before shifting the error token.
12515 Clean up the code a bit by removing the labels yyerrdefault,
12516 yyerrhandle, yyerrpop.
12517 * NEWS: Document the above.
12518
12519 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12520
12521 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
12522 type; it isn't always big enough, since it doesn't necessarily
12523 include non-terminals.
12524 (yytranslate): Expand definition of yy_token_number_type, so that
12525 the latter can be removed.
12526 (yy_token_number_type): Remove, only one use.
12527 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
12528 don't use TokenNumberType as element type.
12529
12530 * tests/regression.at: Modify expected output to agree with change
12531 to yyr1 and yytranslate.
12532
12533 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
12534
12535 * src/reader.c (parse_action): Use copy_character instead of
12536 obstack_1grow.
12537
12538 2002-05-13 Akim Demaille <akim@epita.fr>
12539
12540 * tests/regression.at (Token definitions): Prototype yylex and
12541 yyerror.
12542
12543 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12544
12545 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
12546 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
12547 32-bit arithmetic.
12548 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
12549
12550 2002-05-07 Akim Demaille <akim@epita.fr>
12551
12552 * tests/synclines.at: Be sure to prototype yylex and yyerror to
12553 avoid GCC warnings.
12554
12555 2002-05-07 Akim Demaille <akim@epita.fr>
12556
12557 Kill GCC warnings.
12558
12559 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
12560 over the RHS of each rule.
12561 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
12562 * src/state.h (state_t): Member `nitems' is unsigned short.
12563 * src/LR0.c (get_state): Adjust.
12564 * src/reader.c (packgram): Likewise.
12565 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
12566 `Type'.
12567 (muscle_insert_int_table): Remove, unused.
12568 (prepare_rules): Remove `max'.
12569
12570 2002-05-06 Akim Demaille <akim@epita.fr>
12571
12572 * src/closure.c (print_firsts): Display of the symbol tags.
12573 (bitmatrix_print): Move to...
12574 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
12575 here.
12576 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
12577
12578 2002-05-06 Akim Demaille <akim@epita.fr>
12579
12580 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
12581 hash_do_for_each.
12582
12583 2002-05-06 Akim Demaille <akim@epita.fr>
12584
12585 * src/LR0.c (new_state, get_state): Instead of using the global
12586 `kernel_size' and `kernel_base', have two new arguments:
12587 `core_size' and `core'.
12588 Adjust callers.
12589
12590 2002-05-06 Akim Demaille <akim@epita.fr>
12591
12592 * src/reader.c (packgram): No longer end `ritem' with a 0
12593 sentinel: it is not used.
12594
12595 2002-05-05 Akim Demaille <akim@epita.fr>
12596
12597 New experimental feature: display the lookaheads in the report and
12598 graph.
12599
12600 * src/print (print_core): When --trace-flag, display the rules
12601 lookaheads.
12602 * src/print_graph.c (print_core): Likewise.
12603 Swap the arguments.
12604 Adjust caller.
12605
12606 2002-05-05 Akim Demaille <akim@epita.fr>
12607
12608 * tests/torture.at (Many lookaheads): New test.
12609
12610 2002-05-05 Akim Demaille <akim@epita.fr>
12611
12612 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
12613 (GENERATE_MUSCLE_INSERT_TABLE): this.
12614 (output_int_table, output_unsigned_int_table, output_short_table)
12615 (output_token_number_table, output_item_number_table): Replace with...
12616 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
12617 (muscle_insert_short_table, muscle_insert_token_number_table)
12618 (muscle_insert_item_number_table): these.
12619 Adjust all callers.
12620 (prepare_tokens): Don't free `translations', since...
12621 * src/reader.h, src/reader.c (grammar_free): do it.
12622 Move to...
12623 * src/gram.h, src/gram.c (grammar_free): here.
12624 * data/bison.simple, data/bison.c++: b4_token_number_max is now
12625 b4_translate_max.
12626
12627 2002-05-05 Akim Demaille <akim@epita.fr>
12628
12629 * src/output.c (output_unsigned_int_table): New.
12630 (prepare_rules): `i' is unsigned.
12631 `prhs', `rline', `r2' are unsigned int.
12632 Rename muscle `rhs_number_max' as `rhs_max'.
12633 Output muscles `prhs_max', `rline_max', and `r2_max'.
12634 Free rline and r1.
12635 * data/bison.simple, data/bison.c++: Adjust to use these muscles
12636 to compute types instead of constant types.
12637 * tests/regression.at (Web2c Actions): Adjust.
12638
12639 2002-05-04 Akim Demaille <akim@epita.fr>
12640
12641 * src/symtab.h (SALIAS, SUNDEF): Rename as...
12642 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
12643 Adjust dependencies.
12644 * src/output.c (token_definitions_output): Be sure not to output a
12645 `#define 'a'' when fed with `%token 'a' "a"'.
12646 * tests/regression.at (Token definitions): New.
12647
12648 2002-05-03 Paul Eggert <eggert@twinsun.com>
12649
12650 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
12651 for K&R C.
12652
12653 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
12654
12655 * Makefile.am (SUBDIRS): Remove intl.
12656 (EXTRA_DIST): Add config/config.rpath.
12657
12658 2002-05-03 Akim Demaille <akim@epita.fr>
12659
12660 * data/bison.simple (m4_if): Don't output empty enums.
12661 And actually, output valid enum definitions :(.
12662
12663 2002-05-03 Akim Demaille <akim@epita.fr>
12664
12665 * configure.bat: Remove, completely obsolete.
12666 * Makefile.am (EXTRA_DIST): Adjust.
12667 Don't distribute config.rpath...
12668 * config/Makefile.am (EXTRA_DIST): Do it.
12669
12670 2002-05-03 Akim Demaille <akim@epita.fr>
12671
12672 * configure.in (GETTEXT_VERSION): New.
12673 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
12674
12675 2002-05-03 Akim Demaille <akim@epita.fr>
12676
12677 * data/bison.simple (b4_token_enum): New.
12678 (b4_token_defines): Use it to output tokens both as #define and
12679 enums.
12680 Suggested by Paul Eggert.
12681 * src/output.c (token_definitions_output): Don't output spurious
12682 white spaces.
12683
12684 2002-05-03 Akim Demaille <akim@epita.fr>
12685
12686 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12687
12688 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
12689
12690 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
12691 Update the stack class, give a try to deque as the default container.
12692
12693 2002-05-02 Akim Demaille <akim@epita.fr>
12694
12695 * data/bison.simple (yyparse): Do not implement @$ = @1.
12696 (YYLLOC_DEFAULT): Adjust to do it.
12697 * doc/bison.texinfo (Location Default Action): Fix.
12698
12699 2002-05-02 Akim Demaille <akim@epita.fr>
12700
12701 * src/reader.c (parse_braces): Merge into...
12702 (parse_action): this.
12703
12704 2002-05-02 Akim Demaille <akim@epita.fr>
12705
12706 * configure.in (ALL_LINGUAS): Remove.
12707 * po/LINGUAS, hr.po: New.
12708
12709 2002-05-02 Akim Demaille <akim@epita.fr>
12710
12711 Remove the so called hairy (semantic) parsers.
12712
12713 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
12714 * src/gram.h, src/gram.c (semantic_parser): Remove.
12715 (rule_t): Remove the guard and guard_line members.
12716 * src/lex.h (token_t): remove tok_guard.
12717 * src/options.c (option_table): Remove %guard and %semantic_parser
12718 support.
12719 * src/output.c, src/output.h (guards_output): Remove.
12720 (prepare): Adjust.
12721 (token_definitions_output): Don't output the `T'
12722 tokens (???).
12723 (output_skeleton): Don't output the guards.
12724 * src/files.c, src/files.c (attrsfile): Remove.
12725 * src/reader.c (symbol_list): Remove the guard and guard_line
12726 members.
12727 Adjust dependencies.
12728 (parse_guard): Remove.
12729 * data/bison.hairy: Remove.
12730 * doc/bison.texinfo (Environment Variables): Remove occurrences of
12731 BISON_HAIRY.
12732
12733 2002-05-02 Akim Demaille <akim@epita.fr>
12734
12735 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
12736 (parse_guard): Rename the formal argument `stack_offset' as
12737 `rule_length', which is more readable.
12738 Adjust callers.
12739 (copy_at, copy_dollar): Instead of outputting the hard coded
12740 values of $$, $n and so forth, output invocation to b4_lhs_value,
12741 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
12742 Note: this patch partially drops `semantic-parser' support: it
12743 always does `rule_length - n', where semantic parsers ought to
12744 always use `-n'.
12745 * data/bison.simple, data/bison.c++ (b4_lhs_value)
12746 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12747
12748 2002-05-02 Akim Demaille <akim@epita.fr>
12749
12750 * configure.in (AC_INIT): Bump to 1.49b.
12751 (AM_INIT_AUTOMAKE): Short invocation.
12752
12753 2002-05-02 Akim Demaille <akim@epita.fr>
12754
12755 Version 1.49a.
12756
12757 2002-05-01 Akim Demaille <akim@epita.fr>
12758
12759 * src/skeleton.h: Remove.
12760
12761 2002-05-01 Akim Demaille <akim@epita.fr>
12762
12763 * src/skeleton.h: Fix the #endif.
12764 Reported by Magnus Fromreide.
12765
12766 2002-04-26 Paul Eggert <eggert@twinsun.com>
12767
12768 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
12769 Define if we define YYSTYPE and YYLTYPE, respectively.
12770 (YYCOPY): Fix [] quoting problem in the non-GCC case.
12771
12772 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
12773
12774 * src/scan-skel.l: Postprocess quadrigraphs.
12775
12776 * src/reader.c (copy_character): New function, used to output
12777 single characters while replacing `[' and `]' with quadrigraphs, to
12778 avoid troubles with M4 quotes.
12779 (copy_comment): Output characters with copy_character.
12780 (read_additionnal_code): Likewise.
12781 (copy_string2): Likewise.
12782 (copy_definition): Likewise.
12783
12784 * tests/calc.at: Exercise M4 quoting.
12785
12786 2002-04-25 Akim Demaille <akim@epita.fr>
12787
12788 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
12789 between `!' and the command.
12790 Reported by Paul Eggert.
12791
12792 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
12793
12794 * tests/calc.at: Exercise prologue splitting.
12795
12796 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
12797 `b4_post_prologue' instead of `b4_prologue'.
12798
12799 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
12800 muscles.
12801 (output): Free pre_prologue_obstack and post_prologue_obstack.
12802 * src/files.h, src/files.c (attrs_obstack): Remove.
12803 (pre_prologue_obstack, post_prologue_obstack): New.
12804 * src/reader.c (copy_definition): Add a parameter to specify the
12805 obstack to fill, instead of using attrs_obstack unconditionally.
12806 (read_declarations): Pass pre_prologue_obstack to copy_definition if
12807 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
12808
12809 2002-04-23 Paul Eggert <eggert@twinsun.com>
12810
12811 * data/bison.simple: Remove unnecessary commentary and white
12812 space differences from 1_29-branch.
12813 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
12814
12815 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
12816 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
12817 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
12818 constructors or destructors.
12819
12820 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
12821
12822 2002-04-23 Akim Demaille <akim@epita.fr>
12823
12824 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
12825 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
12826 location with columns.
12827 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
12828 All reported by Paul Eggert.
12829
12830 2002-04-22 Akim Demaille <akim@epita.fr>
12831
12832 * src/reduce.c (dump_grammar): Move to...
12833 * src/gram.h, src/gram.c (grammar_dump): here.
12834 Be sure to separate long item numbers.
12835 Don't read the members of a rule's prec if its nil.
12836
12837 2002-04-22 Akim Demaille <akim@epita.fr>
12838
12839 * src/output.c (table_size, table_grow): New.
12840 (MAXTABLE): Remove, replace uses with table_size.
12841 (pack_vector): Instead of dying when the table is too big, grow it.
12842
12843 2002-04-22 Akim Demaille <akim@epita.fr>
12844
12845 * data/bison.simple (yyr1): Its type is that of a token number.
12846 * data/bison.c++ (r1_): Likewise.
12847 * tests/regression.at (Web2c Actions): Adjust.
12848
12849 2002-04-22 Akim Demaille <akim@epita.fr>
12850
12851 * src/reader.c (token_translations_init): 256 is now the default
12852 value for the error token, i.e., it will be assigned another
12853 number if the user assigned 256 to one of her tokens.
12854 (reader): Don't force 256 to error.
12855 * doc/bison.texinfo (Symbols): Adjust.
12856 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
12857 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
12858 etc. instead of 10, 20, 30 (which was used to `jump' over error
12859 (256) and undefined (2)).
12860
12861 2002-04-22 Akim Demaille <akim@epita.fr>
12862
12863 Propagate more token_number_t.
12864
12865 * src/gram.h (token_number_as_item_number)
12866 (item_number_as_token_number): New.
12867 * src/output.c (GENERATE_OUTPUT_TABLE): New.
12868 Use it to create output_item_number_table and
12869 output_token_number_table.
12870 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12871 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
12872 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
12873 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
12874
12875 2002-04-22 Akim Demaille <akim@epita.fr>
12876
12877 * src/output.h, src/output.c (get_lines_number): Remove.
12878
12879 2002-04-19 Akim Demaille <akim@epita.fr>
12880
12881 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
12882 as Lex/Flex'.
12883 (Debugging): More details about enabling the debugging features.
12884 (Table of Symbols): Describe $$, $n, @$, and @n.
12885 Suggested by Tim Josling.
12886
12887 2002-04-19 Akim Demaille <akim@epita.fr>
12888
12889 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
12890
12891 2002-04-10 Akim Demaille <akim@epita.fr>
12892
12893 * src/system.h: Rely on HAVE_LIMITS_H.
12894 Suggested by Paul Eggert.
12895
12896 2002-04-09 Akim Demaille <akim@epita.fr>
12897
12898 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
12899 full stderr, and strip it according to the bison options, instead
12900 of composing the error message from different bits.
12901 This makes it easier to check for several error messages.
12902 Adjust all the invocations.
12903 Add an invocation exercising the error token.
12904 Add an invocation demonstrating a stupid error message.
12905 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
12906 Adjust the tests.
12907 Error message are for stderr, not stdout.
12908
12909 2002-04-09 Akim Demaille <akim@epita.fr>
12910
12911 * src/gram.h, src/gram.c (error_token_number): Remove, use
12912 errtoken->number.
12913 * src/reader.c (reader): Don't specify the user token number (2)
12914 for $undefined, as it uselessly prevents using it.
12915 * src/gram.h (token_number_t): Move to...
12916 * src/symtab.h: here.
12917 (state_t.number): Is a token_number_t.
12918 * src/print.c, src/reader.c: Use undeftoken->number instead of
12919 hard coded 2.
12920 (Even though this 2 is not the same as above: the number of the
12921 undeftoken remains being 2, it is its user token number which
12922 might not be 2).
12923 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
12924 `user_token_number_max'.
12925 Output `undef_token_number'.
12926 * data/bison.simple, data/bison.c++: Use them.
12927 Be sure to map invalid yylex return values to
12928 `undef_token_number'. This saves us from gratuitous SEGV.
12929
12930 * tests/conflicts.at (Solved SR Conflicts)
12931 (Unresolved SR Conflicts): Adjust.
12932 * tests/regression.at (Web2c Actions): Adjust.
12933
12934 2002-04-08 Akim Demaille <akim@epita.fr>
12935
12936 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
12937 Adding #line.
12938 Remove the duplicate `typedefs'.
12939 (RhsNumberType): Fix the declaration and various other typos.
12940 Use __ofile__.
12941 * data/bison.simple: Use __ofile__.
12942 * src/scan-skel.l: Handle __ofile__.
12943
12944 2002-04-08 Akim Demaille <akim@epita.fr>
12945
12946 * src/gram.h (item_number_t): New, the type of item numbers in
12947 RITEM. Note that it must be able to code symbol numbers as
12948 positive number, and the negation of rule numbers as negative
12949 numbers.
12950 Adjust all dependencies (pretty many).
12951 * src/reduce.c (rule): Remove this `short *' pointer: use
12952 item_number_t.
12953 * src/system.h (MINSHORT, MAXSHORT): Remove.
12954 Include `limits.h'.
12955 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
12956 (shortcpy): Remove.
12957 (MAXTABLE): Move to...
12958 * src/output.c (MAXTABLE): here.
12959 (prepare_rules): Use output_int_table to output rhs.
12960 * data/bison.simple, data/bison.c++: Adjust.
12961 * tests/torture.at (Big triangle): Move the limit from 254 to
12962 500.
12963 * tests/regression.at (Web2c Actions): Ajust.
12964
12965 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
12966 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
12967 passes, but produces negative #line number, once fixed, GCC is
12968 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
12969 C), it passes.
12970 * src/state.h (state_h): Code input lines on ints, not shorts.
12971
12972 2002-04-08 Akim Demaille <akim@epita.fr>
12973
12974 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
12975 and then the grammar.
12976
12977 2002-04-08 Akim Demaille <akim@epita.fr>
12978
12979 * src/system.h: No longer using strndup.
12980
12981 2002-04-07 Akim Demaille <akim@epita.fr>
12982
12983 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
12984 * src/output.c (output_table_data): Return the longest number.
12985 (prepare_tokens): Output `token_number_max').
12986 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
12987 New.
12988 Use them to define yy_token_number_type/TokenNumberType.
12989 Use this type for yytranslate.
12990 * tests/torture.at (Big triangle): Push the limit from 124 to
12991 253.
12992 * tests/regression.at (Web2c Actions): Adjust.
12993
12994 2002-04-07 Akim Demaille <akim@epita.fr>
12995
12996 * tests/torture.at (Big triangle): New.
12997 (GNU AWK Grammar, GNU Cim Grammar): Move to...
12998 * tests/existing.at: here.
12999
13000 2002-04-07 Akim Demaille <akim@epita.fr>
13001
13002 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
13003 nritems.
13004 Adjust dependencies.
13005
13006 2002-04-07 Akim Demaille <akim@epita.fr>
13007
13008 * src/reader.c: Normalize increments to prefix form.
13009
13010 2002-04-07 Akim Demaille <akim@epita.fr>
13011
13012 * src/reader.c, symtab.c: Remove debugging code.
13013
13014 2002-04-07 Akim Demaille <akim@epita.fr>
13015
13016 Rename all the `bucket's as `symbol_t'.
13017
13018 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
13019 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
13020 * src/symtab.c, src/symtab.h (bucket): Rename as...
13021 (symbol_t): this.
13022 (symbol_list_new, bucket_check_defined, bucket_make_alias)
13023 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
13024 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13025 (buckets_new, buckets_free, buckets_do): Rename as...
13026 (symbol_list_new, symbol_check_defined, symbol_make_alias)
13027 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13028 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
13029 (symbols_new, symbols_free, symbols_do): these.
13030
13031 2002-04-07 Akim Demaille <akim@epita.fr>
13032
13033 Use lib/hash for the symbol table.
13034
13035 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
13036 EOF.
13037 * src/lex.c (lex): Set the `number' member of new terminals.
13038 * src/reader.c (bucket_check_defined, bucket_make_alias)
13039 (bucket_check_alias_consistence, bucket_translation): New.
13040 (reader, grammar_free, readgram, token_translations_init)
13041 (packsymbols): Adjust.
13042 (reader): Number the predefined tokens.
13043 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
13044 for predefined tokens.
13045 * src/symtab.h (bucket): Remove all the hash table related
13046 members.
13047 * src/symtab.c (symtab): Replace by...
13048 (bucket_table): this.
13049 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13050 (buckets_new, buckets_do): New.
13051
13052 2002-04-07 Akim Demaille <akim@epita.fr>
13053
13054 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
13055 (start_symbol, max_user_token_number, semantic_parser)
13056 (error_token_number): Initialize.
13057 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
13058 Initialize.
13059 (reader): Don't.
13060 (errtoken, eoftoken, undeftoken, axiom): Extern.
13061
13062 2002-04-07 Akim Demaille <akim@epita.fr>
13063
13064 * src/gram.h (rule_s): prec and precsym are now pointers
13065 to the bucket giving the priority/associativity.
13066 Member `associativity' removed: useless.
13067 * src/reduce.c, src/conflicts.c: Adjust.
13068
13069 2002-04-07 Akim Demaille <akim@epita.fr>
13070
13071 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
13072 Properly escape the symbols' TAG when outputting them.
13073
13074 2002-04-07 Akim Demaille <akim@epita.fr>
13075
13076 * src/lalr.h (LA): Is a bitsetv, not bitset*.
13077
13078 2002-04-07 Akim Demaille <akim@epita.fr>
13079
13080 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
13081 (LArule): this, which is an array to rule_t*.
13082 * src/print.c, src/conflicts.c: Adjust.
13083
13084 2002-04-07 Akim Demaille <akim@epita.fr>
13085
13086 * src/gram.h (rule_t): Rename `number' as `user_number'.
13087 `number' is a new member.
13088 Adjust dependencies.
13089 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
13090
13091 2002-04-07 Akim Demaille <akim@epita.fr>
13092
13093 As a result of the previous patch, it is no longer needed
13094 to reorder ritem itself.
13095
13096 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
13097
13098 2002-04-07 Akim Demaille <akim@epita.fr>
13099
13100 Be sure never to walk through RITEMS, but use only data related to
13101 the rules themselves. RITEMS should be banished.
13102
13103 * src/output.c (output_token_translations): Rename as...
13104 (prepare_tokens): this.
13105 In addition to `translate', prepare the muscles `tname' and
13106 `toknum', which were handled by...
13107 (output_rule_data): this.
13108 Remove, and move the remainder of its outputs into...
13109 (prepare_rules): this new routines, which also merges content from
13110 (output_gram): this.
13111 (prepare_rules): Be sure never to walk through RITEMS.
13112 (output_stos): Rename as...
13113 (prepare_stos): this.
13114 (output): Always invoke prepare_states, after all, just don't use it
13115 in the output if you don't need it.
13116
13117 2002-04-07 Akim Demaille <akim@epita.fr>
13118
13119 * src/LR0.c (new_state): Display `nstates' as the name of the
13120 newly created state.
13121 Adjust to initialize first_state and last_state if needed.
13122 Be sure to distinguish the initial from the final state.
13123 (new_states): Create the itemset of the initial state, and use
13124 new_state.
13125 * src/closure.c (closure): Now that the initial state has its
13126 items properly set, there is no need for a special case when
13127 creating `ruleset'.
13128
13129 As a result, now the rule 0, reducing to $axiom, is visible in the
13130 outputs. Adjust the test suite.
13131
13132 * tests/conflicts.at (Solved SR Conflicts)
13133 (Unresolved SR Conflicts): Adjust.
13134 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
13135 * tests/conflicts.at (S/R in initial): New.
13136
13137 2002-04-07 Akim Demaille <akim@epita.fr>
13138
13139 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
13140 the RHS of the rules.
13141 * src/output.c (output_gram): Likewise.
13142
13143 2002-04-07 Akim Demaille <akim@epita.fr>
13144
13145 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
13146 bucket.
13147 Adjust all dependencies.
13148 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
13149 `number' of the buckets too.
13150 * src/gram.h: Include `symtab.h'.
13151 (associativity): Move to...
13152 * src/symtab.h: here.
13153 No longer include `gram.h'.
13154
13155 2002-04-07 Akim Demaille <akim@epita.fr>
13156
13157 * src/gram.h, src/gram.c (rules_rhs_length): New.
13158 (ritem_longest_rhs): Use it.
13159 * src/gram.h (rule_t): `number' is a new member.
13160 * src/reader.c (packgram): Set it.
13161 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
13162 the end of `rules', and count them out of `nrules'.
13163 (reduce_output, dump_grammar): Adjust.
13164 * src/print.c (print_grammar): It is no longer needed to check for
13165 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
13166 * tests/reduce.at (Reduced Automaton): New test.
13167
13168 2002-04-07 Akim Demaille <akim@epita.fr>
13169
13170 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
13171 lacking `+ 1' to nrules, Bison reported as useless a token if it
13172 was used solely to set the precedence of the last rule...
13173
13174 2002-04-07 Akim Demaille <akim@epita.fr>
13175
13176 * data/bison.c++, data/bison.simple: Don't output the current file
13177 name in #line, to avoid useless diffs between two identical
13178 outputs under different names.
13179
13180 2002-04-07 Akim Demaille <akim@epita.fr>
13181
13182 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
13183 Normalize loops to using `< nrules + 1', not `<= nrules'.
13184
13185 2002-04-07 Akim Demaille <akim@epita.fr>
13186
13187 * TODO: Update.
13188
13189 2002-04-07 Akim Demaille <akim@epita.fr>
13190
13191 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
13192 bucket.value as bucket.number.
13193
13194 2002-04-07 Akim Demaille <akim@epita.fr>
13195
13196 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
13197 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13198 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
13199 RHS, instead of being an index in RITEMS.
13200
13201 2002-04-04 Paul Eggert <eggert@twinsun.com>
13202
13203 * doc/bison.texinfo: Update copyright date.
13204 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
13205 (Symbols): Warn about running Bison in one character set,
13206 but compiling and/or running in an incompatible one.
13207 Warn about character code 256, too.
13208
13209 2002-04-03 Paul Eggert <eggert@twinsun.com>
13210
13211 * src/bison.data (YYSTACK_ALLOC): Depend on whether
13212 YYERROR_VERBOSE is nonzero, not whether it is defined.
13213
13214 Merge changes from bison-1_29-branch.
13215
13216 2002-03-20 Paul Eggert <eggert@twinsun.com>
13217
13218 Merge fixes from Debian bison_1.34-1.diff.
13219
13220 * configure.in (AC_PREREQ): 2.53.
13221
13222 2002-03-20 Akim Demaille <akim@epita.fr>
13223
13224 * src/conflicts.c (log_resolution): Argument `resolution' is const.
13225
13226 2002-03-19 Paul Eggert <eggert@twinsun.com>
13227
13228 * src/bison.simple (YYCOPY): New macro.
13229 (YYSTACK_RELOCATE): Use it.
13230 Remove Type arg; no longer needed. All callers changed.
13231 (yymemcpy): Remove; no longer needed.
13232
13233 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
13234 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13235
13236 2002-03-19 Akim Demaille <akim@epita.fr>
13237
13238 Test and fix the #line outputs.
13239
13240 * tests/atlocal.at (GCC): New.
13241 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
13242 (Prologue synch line, %union synch line, Postprologue synch line)
13243 (Action synch line, Epilogue synch line): New tests.
13244 * src/reader.c (parse_union_decl): Define the muscle stype_line.
13245 * data/bison.simple, data/bison.c++: Use it.
13246
13247 2002-03-19 Akim Demaille <akim@epita.fr>
13248
13249 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
13250 (Solved SR Conflicts, %expect not enough, %expect right)
13251 (%expect too much): Move to...
13252 * tests/conflicts.at: this new file.
13253
13254 2002-03-19 Akim Demaille <akim@epita.fr>
13255
13256 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13257 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
13258 that we can move to enums for instance.
13259 * src/output.c (token_definitions_output): Output a list of
13260 `token-name, token-number' instead of the #define.
13261 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
13262
13263 2002-03-14 Akim Demaille <akim@epita.fr>
13264
13265 Use Gettext 0.11.1.
13266
13267 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
13268
13269 * data/bison.c++: Make the user able to add members to the generated
13270 parser by subclassing.
13271
13272 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
13273
13274 * src/reader.c (read_additionnal_code): `c' should be an integer, not
13275 a character.
13276 Reported by Nicolas Tisserand and Nicolas Burrus.
13277
13278 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
13279
13280 * src/reader.c: Warn about lacking semi-colons, do not complain.
13281
13282 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
13283
13284 * data/bison.c++: Remove a debug line.
13285
13286 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
13287
13288 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
13289 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
13290 provide a default implementation.
13291
13292 2002-03-04 Akim Demaille <akim@epita.fr>
13293
13294 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
13295 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
13296 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
13297 * tests/semantic.at (Parsing Guards): Similarly.
13298 * src/reader.at (readgram): Complain if the last rule is not ended
13299 with a semi-colon.
13300
13301 2002-03-04 Akim Demaille <akim@epita.fr>
13302
13303 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
13304 * src/closure.c: here.
13305 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
13306 RTC.
13307 * src/warshall.h, src/warshall.c: Remove.
13308 * tests/sets.at (Broken Closure): Adjust.
13309
13310 2002-03-04 Akim Demaille <akim@epita.fr>
13311
13312 * src/output.c (output_skeleton): tempdir is const.
13313 bytes_read is unused.
13314
13315 2002-03-04 Akim Demaille <akim@epita.fr>
13316
13317 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13318 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
13319 Update.
13320 From Michael Hayes.
13321
13322 2002-03-04 Akim Demaille <akim@epita.fr>
13323
13324 * src/closure.c (closure): `r' is unused.
13325
13326 2002-03-04 Akim Demaille <akim@epita.fr>
13327
13328 * tests/sets.at (Broken Closure): Add the ending `;'.
13329 * src/reader.at (readgram): Complain if a rule is not ended with a
13330 semi-colon.
13331
13332 2002-03-04 Akim Demaille <akim@epita.fr>
13333
13334 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
13335 (count_sr_conflicts): Use bitset_count.
13336 * src/reduce.c (inaccessable_symbols): Ditto.
13337 (bits_size): Remove.
13338 * src/warshall.h, src/warshall.c: Convert to bitsetv.
13339
13340 2002-03-04 Akim Demaille <akim@epita.fr>
13341
13342 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
13343 * src/reduce.c: Remove the `bitset_zero's following the
13344 `bitset_create's, as now it is performed by the latter.
13345
13346 2002-03-04 Akim Demaille <akim@epita.fr>
13347
13348 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
13349 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
13350 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
13351 latest sources from Michael.
13352
13353 2002-03-04 Akim Demaille <akim@epita.fr>
13354
13355 * src/output.c (output): Don't free the grammar.
13356 * src/reader.c (grammar_free): New.
13357 * src/main.c (main): Call it and don't free symtab here.
13358
13359 2002-03-04 Akim Demaille <akim@epita.fr>
13360
13361 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
13362 before returning.
13363 Reported by Benoit Perrot.
13364
13365 2002-03-04 Akim Demaille <akim@epita.fr>
13366
13367 Use bitset operations when possible, not loops over bits.
13368
13369 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
13370 bitset_or.
13371 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
13372 * src/reduce.c (useless_nonterminals): Formatting changes.
13373 * src/warshall.c (TC): Use bitset_or.
13374
13375 2002-03-04 Akim Demaille <akim@epita.fr>
13376
13377 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
13378 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
13379 Ditto.
13380
13381 2002-03-04 Akim Demaille <akim@epita.fr>
13382
13383 * src/lalr.c (F): Now a bitset*.
13384 Adjust all dependencies.
13385
13386 2002-03-04 Akim Demaille <akim@epita.fr>
13387
13388 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
13389 Adjust all dependencies.
13390
13391 2002-03-04 Akim Demaille <akim@epita.fr>
13392
13393 * src/L0.c, src/LR0.h (nstates): Be size_t.
13394 Adjust comparisons (signed vs unsigned).
13395 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
13396 bitset*.
13397 Adjust all dependencies.
13398
13399 2002-03-04 Akim Demaille <akim@epita.fr>
13400
13401 * src/closure.c (firsts): Now, also a bitset.
13402 Adjust all dependencies.
13403 (varsetsize): Remove, now unused.
13404 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
13405
13406 2002-03-04 Akim Demaille <akim@epita.fr>
13407
13408 * src/print.c: Convert to use bitset.h, not hand coded iterations
13409 over ints.
13410
13411 2002-03-04 Akim Demaille <akim@epita.fr>
13412
13413 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
13414
13415 2002-03-04 Akim Demaille <akim@epita.fr>
13416
13417 * src/closure.c (ruleset): Be a bitset.
13418 (rulesetsize): Remove.
13419
13420 2002-03-04 Akim Demaille <akim@epita.fr>
13421
13422 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13423 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
13424 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
13425 * src/closure.c (fderives): Be an array of bitsets.
13426
13427 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
13428
13429 * data/bison.c++: Merge the two generated headers. Insert a copyright
13430 notice in each output file.
13431
13432 2002-02-28 Akim Demaille <akim@epita.fr>
13433
13434 * data/bison.c++: Copy the prologue of bison.simple to fetch
13435 useful M4 definitions, such as b4_header_guard.
13436
13437 2002-02-25 Akim Demaille <akim@epita.fr>
13438
13439 * src/getargs.c (version): Give the name of the authors, and use a
13440 translator friendly scheme for the bgr
13441 copyright notice.
13442
13443 2002-02-25 Akim Demaille <akim@epita.fr>
13444
13445 * src/output.c (header_output): Remove, now handled completely via
13446 M4.
13447
13448 2002-02-25 Akim Demaille <akim@epita.fr>
13449
13450 * m4/m4.m4: New, from CVS Autoconf.
13451 * configure.in: Invoke it.
13452 * src/output.c (output_skeleton): Use its result instead of the
13453 hard coded name.
13454
13455 2002-02-25 Akim Demaille <akim@epita.fr>
13456
13457 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
13458 Fileutils 4.1.5.
13459 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
13460 * src/output.c (output_skeleton): Use mkstemp to create a real
13461 temporary file.
13462 Move the filling of `skeleton' and its muscle to...
13463 (prepare): here.
13464 (output): Move the definition of the prologue muscle to...
13465 (prepare): here.
13466 * src/system.h (DEFAULT_TMPDIR): New.
13467
13468 2002-02-14 Paul Eggert <eggert@twinsun.com>
13469
13470 Remove the support for C++ namespace cleanliness; it was
13471 causing more problems than it was curing, since it didn't work
13472 properly on some nonstandard C++ compilers. This can wait
13473 for a proper C++ parser.
13474
13475 * NEWS: Document this.
13476 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
13477 of C++, as it's treated like C now.
13478 * src/bison.simple (YYSTD): Remove.
13479 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
13480 Treat C++ just like Standard C instead of trying to support
13481 namespace cleanliness.
13482
13483 2002-02-14 Akim Demaille <akim@epita.fr>
13484
13485 * tests/regression.at (else): Adjust to Andreas' change.
13486
13487 2002-02-14 Akim Demaille <akim@epita.fr>
13488
13489 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
13490
13491 2002-02-13 Andreas Schwab <schwab@suse.de>
13492
13493 * src/output.c (output_rule_data): Don't output NULL, it might
13494 not be defined yet.
13495
13496 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
13497
13498 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
13499 (Copyright notice): Update.
13500
13501 2002-02-11 Akim Demaille <akim@epita.fr>
13502
13503 * tests/regression.at (%nonassoc and eof): Don't include
13504 nonportable headers.
13505
13506 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
13507
13508 * data/bison.c++: Correct error recovery. Make the user able to
13509 initialize the starting location.
13510
13511 2002-02-07 Akim Demaille <akim@epita.fr>
13512
13513 * tests/input.at: New.
13514
13515 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13516
13517 * data/bison.c++: Replace some direct m4 expansions by constants. Be
13518 more consistent when naming methods and variables. Put preprocessor
13519 directives around tables only needed for debugging.
13520
13521 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13522
13523 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
13524 C++ parsers.
13525 (yy::b4_name::parse): Use print_.
13526
13527 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13528
13529 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
13530
13531 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13532
13533 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
13534 C++ parsers.
13535 (yy::b4_name::parse): Build verbose error messages, and use error_.
13536
13537 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
13538
13539 * data/bison.c++: Fix m4 quoting in comments.
13540
13541 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
13542
13543 * data/bison.c++: Adjust the parser code. Fix some muscles that were
13544 not expanded by m4.
13545
13546 2002-02-05 Akim Demaille <akim@epita.fr>
13547
13548 * data/bison.c++: Adjust to the M4 back end.
13549 More is certainly needed.
13550
13551 2002-02-05 Akim Demaille <akim@epita.fr>
13552
13553 Give a try to M4 as a back end.
13554
13555 * lib/readpipe.c: New, from wdiff.
13556 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
13557 BISON_HAIRY.
13558 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
13559 specific values. Now it is m4 that performs the lookup.
13560 * src/parse-skel.y: Remove.
13561 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
13562 * src/output.c (actions_output, guards_output)
13563 (token_definitions_output): No longer keeps track of the output
13564 line number, hence remove the second argument.
13565 (guards_output): Check against the guard member of a rule, not the
13566 action member.
13567 Adjust callers.
13568 (output_skeleton): Don't look for the skeleton location, let m4 do
13569 that.
13570 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
13571 file will be used.
13572 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
13573 (prepare): Given that for the time being changesyntax is not
13574 usable in M4, rename the muscles using `-' to `_'.
13575 Define `defines_flag', `output_parser_name' and `output_header_name'.
13576 * src/output.h (actions_output, guards_output)
13577 (token_definitions_output): Adjust prototypes.
13578 * src/scan-skel.l: Instead of scanning the skeletons, it now
13579 processes the output of m4: `__oline__' and `#output'.
13580 * data/bison.simple: Adjust to be used by M4(sugar).
13581 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
13582 to date.
13583 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
13584 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
13585 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
13586 shamelessly stolen from CVS Autoconf.
13587
13588 2002-02-05 Akim Demaille <akim@epita.fr>
13589
13590 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
13591 * configure.in: Check for the declarations of free and malloc.
13592 * src/muscle_tab.c: Adjust.
13593
13594 2002-02-05 Akim Demaille <akim@epita.fr>
13595
13596 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
13597 which have no values.
13598
13599 2002-02-05 Akim Demaille <akim@epita.fr>
13600
13601 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
13602 * data/: here.
13603
13604 2002-01-29 Paul Eggert <eggert@twinsun.com>
13605
13606 * src/bison.simple (YYSIZE_T): Do not define merely because
13607 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
13608 On some platforms, <alloca.h> does not declare YYSTD (size_t).
13609
13610 2002-01-27 Akim Demaille <akim@epita.fr>
13611
13612 Fix `%nonassoc and eof'.
13613
13614 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
13615 which were not properly copied! Replace
13616 memcpy (res->errs, src->errs, src->nerrs);
13617 with
13618 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
13619 !!!
13620 * tests/regression.at (%nonassoc and eof): Adjust to newest
13621 Autotest: `.' is not in the PATH.
13622
13623 2002-01-27 Akim Demaille <akim@epita.fr>
13624
13625 * tests/sets.at (AT_EXTRACT_SETS): New.
13626 (Nullable): Use it.
13627 (Firsts): New.
13628
13629 2002-01-26 Akim Demaille <akim@epita.fr>
13630
13631 * tests/actions.at, tests/calc.at, tests/headers.at,
13632 * tests/torture.at: Adjust to the newest Autotest which no longer
13633 forces `.' in the PATH.
13634
13635 2002-01-25 Akim Demaille <akim@epita.fr>
13636
13637 * tests/regression.at (%nonassoc and eof): New.
13638 Suggested by Robert Anisko.
13639
13640 2002-01-24 Akim Demaille <akim@epita.fr>
13641
13642 Bison dumps core when trying to complain about broken input files.
13643 Reported by Cris van Pelt.
13644
13645 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
13646 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
13647 into...
13648 (Invalid inputs): Strengthen: exercise parse_percent_token.
13649
13650 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
13651
13652 * src/Makefile.am: Add bison.c++.
13653 * src/bison.c++: New skeleton.
13654
13655 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
13656
13657 * po/it.po: New.
13658
13659 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
13660
13661 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
13662
13663 2002-01-20 Marc Autret <marc@gnu.org>
13664
13665 * src/files.c (compute_output_file_names): Fix
13666
13667 2002-01-20 Marc Autret <marc@gnu.org>
13668
13669 * tests/output.at: New test.
13670 * src/files.c (compute_base_names): Don't map extensions when
13671 the YACC flag is set, use defaults.
13672 Reported by Evgeny Stambulchik.
13673
13674 2002-01-20 Marc Autret <marc@gnu.org>
13675
13676 * src/system.h: Need to define __attribute__ away for non-GCC
13677 compilers as well (i.e., the vendor C compiler).
13678 Suggested by Albert Chin-A-Young.
13679
13680 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
13681
13682 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
13683 canonical definition.
13684 * src/system.h: Use the canonical definition for PARAMS (avoids
13685 a conflict with the macro from lib/hash.h).
13686
13687 2002-01-11 Akim Demaille <akim@epita.fr>
13688
13689 * configure.in: Use AC_FUNC_STRNLEN.
13690 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
13691
13692 2002-01-09 Akim Demaille <akim@epita.fr>
13693
13694 * src/files.c, src/files.h (output_infix): New.
13695 (tab_extension): Remove.
13696 (compute_base_names): Compute the former, drop the latter.
13697 * src/output.c (prepare): Insert the muscles `output-infix', and
13698 `output-suffix'.
13699 * src/parse-skel.y (string, string.1): New.
13700 (section.header): Use it.
13701 (section.yacc): Remove.
13702 (prefix): Remove too.
13703 * src/scan-skel.l: Adjust.
13704 * src/bison.simple, src/bison.hairy: Adjust.
13705
13706 2002-01-09 Akim Demaille <akim@epita.fr>
13707
13708 * configure.in (WERROR_CFLAGS): Compute it.
13709 * src/Makefile.am (CFLAGS): Pass it.
13710 * tests/atlocal.in (CFLAGS): Idem.
13711 * src/files.c: Fix a few warnings.
13712 (get_extension_index): Remove, unused.
13713
13714 2002-01-08 Akim Demaille <akim@epita.fr>
13715
13716 * src/getargs.c (AS_FILE_NAME): New.
13717 (getargs): Use it to convert DOSish file names.
13718 * src/files.c (base_name): Rename as full_base_name to avoid
13719 clashes with `base_name ()'.
13720 (filename_split): New.
13721 (compute_base_names): N-th rewrite, using filename_split.
13722
13723 2002-01-08 Akim Demaille <akim@epita.fr>
13724
13725 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
13726 New, stolen from the Fileutils 4.1.
13727 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13728 * configure.in: Check for the presence of memrchr, and of its
13729 prototype.
13730
13731 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
13732
13733 * lib/hash.h (__P): Added definition for this macro.
13734 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
13735 BUILT_SOURCES, to ensure they are generated first.
13736 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
13737 %error-verbose to allow bootstrapping with bison 1.30x.
13738
13739 2002-01-06 Akim Demaille <akim@epita.fr>
13740
13741 * src/reader.c (parse_braces): Don't fetch the next char, the
13742 convention is to fetch on entry.
13743 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
13744 'switch' without a following semicolon.
13745 * tests/regression.at (braces parsing): New.
13746
13747 2002-01-06 Akim Demaille <akim@epita.fr>
13748
13749 Bison is dead wrong in its RR conflict reports.
13750
13751 * tests/torture.at (GNU Cim Grammar): New.
13752 * src/conflicts.c (count_rr_conflicts): Fix.
13753
13754 2002-01-06 Akim Demaille <akim@epita.fr>
13755
13756 Creating package.m4 from configure.ac causes too many problems.
13757
13758 * tests/Makefile.am (package.m4): Create it by hand,
13759 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
13760
13761 2002-01-06 Akim Demaille <akim@epita.fr>
13762
13763 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
13764 skeleton.h.
13765
13766 2002-01-04 Paul Eggert <eggert@twinsun.com>
13767
13768 * doc/bison.texinfo (Debugging):
13769 Remove YYSTDERR; it's no longer defined or used.
13770 Also, s/cstdio.h/cstdio/.
13771
13772 2002-01-03 Akim Demaille <akim@epita.fr>
13773
13774 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
13775
13776 2002-01-03 Akim Demaille <akim@epita.fr>
13777
13778 * src/parse-skel.y (process_skeleton): Don't bind the parser's
13779 tracing code to --trace, wait for a better --trace option, with
13780 args.
13781
13782 2002-01-03 Akim Demaille <akim@epita.fr>
13783
13784 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
13785 The ISO C++ standard is extremely clear about it: stderr is
13786 considered a macro, not a regular symbol (see table 94 `Header
13787 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
13788 Therefore std:: does not apply to it. It still does with fprintf.
13789 Also, s/cstdio.h/cstdio/.
13790
13791 2002-01-03 Akim Demaille <akim@epita.fr>
13792
13793 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
13794 for non system headers.
13795
13796 2002-01-02 Akim Demaille <akim@epita.fr>
13797
13798 Equip the skeleton chain with location tracking, runtime trace,
13799 pure parser and scanner.
13800
13801 * src/parse-skel.y: Request a pure parser, locations, and prefix
13802 renaming.
13803 (%union): Having several members with the same type does not help
13804 type mismatches, simplify.
13805 (YYPRINT, yyprint): New.
13806 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
13807 (skel_error): this.
13808 Handle locations.
13809 * src/scan-skel.l: Adjust to these changes.
13810 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
13811 (LOCATION_PRINT, skel_control_t): New.
13812
13813 2001-12-30 Akim Demaille <akim@epita.fr>
13814
13815 * src/parse-skel.y: Get rid of the shift/reduce conflict:
13816 replace `gb' with BLANKS.
13817 * src/scan-skel.l: Adjust.
13818
13819 2001-12-30 Akim Demaille <akim@epita.fr>
13820
13821 * src/system.h: We don't need nor want bcopy.
13822 Throw away MS-DOS crap: we don't need getpid.
13823 * configure.in: We don't need strndup. It was even causing
13824 problems: because Flex includes the headers *before* us,
13825 _GNU_SOURCE is not defined by config.h, and therefore strndup was
13826 not visible.
13827 * lib/xstrndup.c: New.
13828 * src/scan-skel.l: Use it.
13829 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
13830 * src/parse-skel.y: Use %directives instead of #defines.
13831
13832 2001-12-30 Akim Demaille <akim@epita.fr>
13833
13834 * src/skeleton.h: New.
13835 * src/output.c (output_parser, output_master_parser): Remove, dead
13836 code.
13837 * src/output.h (get_lines_number, actions_output, guards_output)
13838 (token_definitions_output): Prototype them.
13839 * src/parse-skel.y: Add the license notice.
13840 Include output.h and skeleton.h.
13841 (process_skeleton): Returns void, and takes a single parameter.
13842 * src/scan-skel.l: Add the license notice.
13843 Include skeleton.h.
13844 Don't use %option yylineno: it seems that then Flex imagines
13845 REJECT has been used, and therefore it won't reallocate its
13846 buffers (which makes no other sense to me than a bug). It results
13847 in warnings for `unused: yy_flex_realloc'.
13848
13849 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
13850
13851 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13852 (MUSCLE_INSERT_PREFIX): ...to there.
13853 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13854 (MUSCLE_INSERT_PREFIX): Move from here...
13855
13856 * src/bison.hairy: Add a section directive. Put braces around muscle
13857 names. This parser skeleton is still broken, but Bison should not
13858 choke on a bad muscle 'syntax'.
13859 * src/bison.simple: Add a section directive. Put braces around muscle
13860 names.
13861
13862 * src/files.h (strsuffix, stringappend): Add declarations.
13863 (tab_extension): Add declaration.
13864 (short_base_name): Add declaration.
13865
13866 * src/files.c (strsuffix, stringappend): No longer static. These
13867 functions are used in the skeleton parser.
13868 (tab_extension): New.
13869 (compute_base_names): Use the computations done in this function
13870 to guess if the generated parsers should have '.tab' in their
13871 names.
13872 (short_base_name): No longer static.
13873
13874 * src/output.c (output_skeleton): New.
13875 (output): Disable call to output_master_parser, and give a try to
13876 a new skeleton handling system.
13877 (guards_output, actions_output): No longer static.
13878 (token_definitions_output, get_lines_number): No longer static.
13879
13880 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
13881
13882 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
13883 parse-skel.y.
13884
13885 * src/parse-skel.y: New file.
13886 * src/scan-skel.l: New file.
13887
13888 2001-12-29 Akim Demaille <akim@epita.fr>
13889
13890 %name-prefix is broken.
13891
13892 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
13893 Adjust all dependencies.
13894 * tests/headers.at (export YYLTYPE): Strengthen this test: use
13895 %name-prefix.
13896
13897 Renaming yylval but not yylloc is not consistent. Now we do.
13898
13899 * src/bison.simple: Prefix yylloc if used.
13900 * doc/bison.texinfo (Decl Summary): Document that.
13901
13902 2001-12-29 Akim Demaille <akim@epita.fr>
13903
13904 * doc/bison.texinfo: Promote `%long-directive' over
13905 `%long_directive'.
13906 Remove all references to fixed-output-files, yacc is enough.
13907
13908 2001-12-29 Akim Demaille <akim@epita.fr>
13909
13910 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
13911 user prologue. These are defaults.
13912 * tests/actions.at (Mid-rule actions): Make sure the user can
13913 define YYDEBUG and YYERROR_VERBOSE.
13914
13915 2001-12-29 Akim Demaille <akim@epita.fr>
13916
13917 * src/output.c (header_output): Don't forget to export YYLTYPE and
13918 yylloc.
13919 * tests/headers.at (export YYLTYPE): New, make sure it does.
13920 * tests/regression.at (%union and --defines, Invalid CPP headers):
13921 Move to...
13922 * tests/headers.at: here.
13923
13924 2001-12-29 Akim Demaille <akim@epita.fr>
13925
13926 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
13927
13928 2001-12-29 Akim Demaille <akim@epita.fr>
13929
13930 * tests/actions.at (Mid-rule actions): Output on a single line
13931 instead of several.
13932
13933 2001-12-29 Akim Demaille <akim@epita.fr>
13934
13935 * doc/bison.texinfo: Formatting changes.
13936
13937 2001-12-29 Akim Demaille <akim@epita.fr>
13938
13939 Don't store the token defs in a muscle, just be ready to output it
13940 on command. Now possible via `symbols'. Fixes a memory leak.
13941
13942 * src/output.c (token_definitions_output): New.
13943 (output_parser, header_output): Use it.
13944 * src/reader.c (symbols_save): Remove.
13945
13946 2001-12-29 Akim Demaille <akim@epita.fr>
13947
13948 * src/bison.simple: Do not provide a default for YYSTYPE and
13949 YYLTYPE before the user's prologue. Otherwise it's hardly... a
13950 default.
13951
13952 2001-12-29 Akim Demaille <akim@epita.fr>
13953
13954 Mid-rule actions are simply... ignored!
13955
13956 * src/reader.c (readgram): Be sure to attach mid-rule actions to
13957 the empty-rule associated to the dummy symbol, not to the host
13958 rule.
13959 * tests/actions.at (Mid-rule actions): New.
13960
13961 2001-12-29 Akim Demaille <akim@epita.fr>
13962
13963 Memory leak.
13964
13965 * src/reader.c (reader): Free grammar.
13966
13967 2001-12-29 Akim Demaille <akim@epita.fr>
13968
13969 Memory leak.
13970
13971 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
13972 since it allocates it for each state, although only one is needed.
13973 (allocate_storage): Do it here.
13974
13975 2001-12-29 Akim Demaille <akim@epita.fr>
13976
13977 * src/options.h, src/options.c (create_long_option_table): Rename
13978 as...
13979 (long_option_table_new): this, with a clearer prototype.
13980 (percent_table): Remove, unused,
13981 * src/getargs.c (getargs): Adjust.
13982
13983 2001-12-29 Akim Demaille <akim@epita.fr>
13984
13985 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
13986 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
13987 as states.
13988
13989 2001-12-29 Akim Demaille <akim@epita.fr>
13990
13991 * src/lalr.c (build_relations): Rename `states' as `states1'.
13992 Sorry, I don't understand exactly what it is, no better name...
13993
13994 2001-12-29 Akim Demaille <akim@epita.fr>
13995
13996 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
13997 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
13998 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
13999 as rules.
14000
14001 2001-12-29 Akim Demaille <akim@epita.fr>
14002
14003 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
14004 ago.
14005
14006 2001-12-29 Akim Demaille <akim@epita.fr>
14007
14008 * src/reader.c, src/reader.h (user_toknums): Remove.
14009 Adjust all users to use symbols[i]->user_token_number.
14010
14011 2001-12-29 Akim Demaille <akim@epita.fr>
14012
14013 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
14014 Adjust all users to use symbols[i]->prec or ->assoc.
14015
14016 2001-12-29 Akim Demaille <akim@epita.fr>
14017
14018 * src/reader.c, src/reader.h (tags): Remove.
14019 Adjust all users to use symbols[i]->tag.
14020
14021 2001-12-29 Akim Demaille <akim@epita.fr>
14022
14023 * src/gram.h, src/gram.c (symbols): New, similar to state_table
14024 and rule_table.
14025 * src/reader.c (packsymbols): Fill this table.
14026 Drop sprec.
14027 * src/conflicts.c (resolve_sr_conflict): Adjust.
14028 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
14029 single table.
14030 Use symbols[i]->tag instead of tags[i].
14031
14032 2001-12-29 Akim Demaille <akim@epita.fr>
14033
14034 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
14035 In addition, put a comment in there, to replace...
14036 * tests/regression.at (%union and C comments): Remove.
14037
14038 2001-12-29 Akim Demaille <akim@epita.fr>
14039
14040 * tests/regression.at (Web2c Actions): Blindly move the actual
14041 output as expected output. The contents *seem* right to me, but I
14042 can't pretend reading perfectly parser tables... Nonetheless, all
14043 the other tests pass correctly, the table look OK, even though the
14044 presence of `$axiom' is to be noted: AFAICS it is useless (but
14045 harmless).
14046
14047 2001-12-29 Akim Demaille <akim@epita.fr>
14048
14049 * src/reader.c (readgram): Don't add the rule 0 if there were no
14050 rules read. In other words, add it _after_ having performed
14051 grammar sanity checks.
14052 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
14053
14054 2001-12-29 Akim Demaille <akim@epita.fr>
14055
14056 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
14057 visible, and some states have now a different number.
14058
14059 2001-12-29 Akim Demaille <akim@epita.fr>
14060
14061 * src/reader.c (readgram): Bind the initial rule's lineno to that
14062 of the first rule.
14063 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
14064 (Solved SR Conflicts): Adjust rule 0's line number.
14065
14066 2001-12-29 Akim Demaille <akim@epita.fr>
14067
14068 Fix the `GAWK Grammar' failure.
14069
14070 * src/LR0.c (final_state): Initialize to -1 so that we do compute
14071 the reductions of the first state which was mistakenly confused
14072 with the final state because precisely final_state was initialized
14073 to 0.
14074 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
14075 now noticed by Bison.
14076 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
14077 have a reduction on $default.
14078
14079 2001-12-29 Akim Demaille <akim@epita.fr>
14080
14081 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
14082 rule line numbers.
14083 * src/closure.c (print_closure): Likewise.
14084 * src/derives.c (print_derives): Likewise.
14085 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
14086 now.
14087
14088 2001-12-29 Akim Demaille <akim@epita.fr>
14089
14090 * src/lalr.c (lookaheads_print): New.
14091 (lalr): Call it when --trace-flag.
14092 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
14093 are dumped.
14094
14095 2001-12-29 Akim Demaille <akim@epita.fr>
14096
14097 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
14098 when walking through ritem, even via rule->rhs.
14099 * src/reduce.c (dump_grammar, useful_production, reduce_output)
14100 (useful_production, useless_nonterminals): Likewise.
14101 (reduce_grammar_tables): Likewise, plus update nritems.
14102 * src/nullable.c (set_nullable): Likewise.
14103 * src/lalr.c (build_relations): Likewise.
14104 * tests/sets.at (Nullable): Adjust.
14105 Fortunately, now, the $axiom is no longer nullable.
14106
14107 2001-12-29 Akim Demaille <akim@epita.fr>
14108
14109 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
14110 the 0-sentinel.
14111 * src/gram.c (ritem_longest_rhs): Likewise.
14112 * src/reduce.c (nonterminals_reduce): Likewise.
14113 * src/print_graph.c (print_graph): Likewise.
14114 * src/output.c (output_rule_data): Likewise.
14115 * src/nullable.c (set_nullable): Likewise.
14116
14117 2001-12-29 Akim Demaille <akim@epita.fr>
14118
14119 * src/output.c: Comment changes.
14120
14121 2001-12-27 Paul Eggert <eggert@twinsun.com>
14122
14123 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
14124 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
14125 Sparc, as they were causing more porting problems than the
14126 (minor) performance improvement was worth.
14127
14128 Also, catch up with 1.31's YYSTD.
14129
14130 2001-12-27 Akim Demaille <akim@epita.fr>
14131
14132 * src/output.c (output_gram): Rely on nritems, not the
14133 0-sentinel. See below.
14134 Use -1 as separator, not 0.
14135 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
14136 Rely on -1 as separator in yyrhs, instead of 0.
14137 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
14138 twice `Now at end of input', therefore there are two lines less to
14139 expect.
14140
14141 2001-12-27 Akim Demaille <akim@epita.fr>
14142
14143 * tests/regression.at (Unresolved SR Conflicts):
14144 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
14145 below.
14146
14147 2001-12-27 Akim Demaille <akim@epita.fr>
14148
14149 * src/LR0.c (new_state): Recognize the final state by the fact it
14150 is reached by eoftoken.
14151 (insert_start_shifting_state, insert_eof_shifting_state)
14152 (insert_accepting_state, augment_automaton): Remove, since now
14153 these states are automatically computed from the initial state.
14154 (generate_states): Adjust.
14155 * src/print.c: When reporting a rule number to the user, substract
14156 1, so that the axiom rule is rule 0, and the first user rule is 1.
14157 * src/reduce.c: Likewise.
14158 * src/print_graph.c (print_core): For the time being, just as for
14159 the report, depend upon --trace-flags to dump the full set of
14160 items.
14161 * src/reader.c (readgram): Once the grammar read, insert the rule
14162 0: `$axiom: START-SYMBOL $'.
14163 * tests/set.at: Adjust: rule 0 is now displayed, and since the
14164 number of the states has changed (the final state is no longer
14165 necessarily the last), catch up.
14166
14167 2001-12-27 Akim Demaille <akim@epita.fr>
14168
14169 Try to make the use of the eoftoken valid. Given that its value
14170 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
14171 is used instead of > 0 where appropriate, (ii), depend upon nritems
14172 instead of the 0-sentinel.
14173
14174 * src/gram.h, src/gram.c (nritems): New.
14175 Expected to be duplication of nitems, but for the time being...
14176 * src/reader.c (packgram): Assert nritems and nitems are equal.
14177 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
14178 * src/closure.c (print_closure, print_fderives): Likewise.
14179 * src/gram.c (ritem_print): Likewise.
14180 * src/print.c (print_core, print_grammar): Likewise.
14181 * src/print_graph.c: Likewise.
14182
14183 2001-12-27 Akim Demaille <akim@epita.fr>
14184
14185 * src/main.c (main): If there are complains after grammar
14186 reductions, then output the report anyway if requested, then die.
14187 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
14188 * src/reader.c (eoftoken): New.
14189 (parse_token_decl): If the token being defined has value `0', it
14190 is the eoftoken.
14191 (packsymbols): No longer hack `tags' to insert `$' by hand.
14192 Be sure to preserve the value of the eoftoken.
14193 (reader): Make sure eoftoken is defined.
14194 Initialize nsyms to 0: now eoftoken is created just like the others.
14195 * src/print.c (print_grammar): Don't special case the eof token.
14196 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
14197 lie anyway, albeit pleasant.
14198 * tests/calc.at: Exercise error messages with eoftoken.
14199 Change the grammar so that empty input is invalid.
14200 Adjust expectations.
14201 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
14202
14203 2001-12-27 Akim Demaille <akim@epita.fr>
14204
14205 * configure.in: Check the protos of strchr ans strspn.
14206 Replace strchr if needed.
14207 * src/system.h: Provide the protos of strchr, strspn and memchr if
14208 missing.
14209 * lib/strchr.c: New.
14210 * src/reader.c (symbols_save): Use strchr.
14211
14212 2001-12-27 Akim Demaille <akim@epita.fr>
14213
14214 * src/print.c, src/print_graph.c (escape): New.
14215 Use it to quote the TAGS outputs.
14216 * src/print_graph.c (print_state): Now errors are in red, and
14217 reductions in green.
14218 Prefer high to wide: output the state number on a line of its own.
14219
14220 2001-12-27 Akim Demaille <akim@epita.fr>
14221
14222 * src/state.h, src/state.c (reductions_new): New.
14223 * src/LR0.c (set_state_table): Let all the states have a
14224 `reductions', even if reduced to 0.
14225 (save_reductions): Adjust.
14226 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
14227 * src/print.c (print_reductions, print_actions): Adjust.
14228 * src/output.c (action_row): Adjust.
14229
14230 2001-12-27 Akim Demaille <akim@epita.fr>
14231
14232 * src/state.h, src/state.c (errs_new, errs_dup): New.
14233 * src/LR0.c (set_state_table): Let all the states have an errs,
14234 even if reduced to 0.
14235 * src/print.c (print_errs, print_reductions): Adjust.
14236 * src/output.c (output_actions, action_row): Adjust.
14237 * src/conflicts.c (resolve_sr_conflict): Adjust.
14238
14239 2001-12-27 Akim Demaille <akim@epita.fr>
14240
14241 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
14242
14243 2001-12-27 Akim Demaille <akim@epita.fr>
14244
14245 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
14246 * src/print.c: here.
14247 (lookaheadset, shiftset): New, used as additional storage by
14248 print_reductions.
14249 (print_results): Adjust.
14250 (print_shifts, print_gotos, print_errs): New, extracted from...
14251 (print_actions): here.
14252 * src/print_graph.c (print_actions): Remove dead code.
14253
14254 2001-12-27 Akim Demaille <akim@epita.fr>
14255
14256 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
14257 `$n' and `@n'.
14258
14259 2001-12-27 Akim Demaille <akim@epita.fr>
14260
14261 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
14262 (build_relations): Adjust.
14263
14264 2001-12-27 Akim Demaille <akim@epita.fr>
14265
14266 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
14267 duplication.
14268
14269 2001-12-27 Akim Demaille <akim@epita.fr>
14270
14271 * src/reader.c (packgram): Catch nitems overflows.
14272
14273 2001-12-27 Akim Demaille <akim@epita.fr>
14274
14275 * src/files.c, src/files.h (guard_obstack): Remove.
14276 * src/output.c (output): Adjust.
14277 * src/reader.c (parse_braces): New, factoring...
14278 (copy_action, copy_guard): these two which are renamed as...
14279 (parse_action, parse_guard): these.
14280 As a voluntary consequence, using braces around guards is now
14281 mandatory.
14282
14283 2001-12-27 Akim Demaille <akim@epita.fr>
14284
14285 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
14286 * src/reader.c (symbol_list): `guard' and `guard_line' are new
14287 members.
14288 (symbol_list_new): Adjust.
14289 (copy_action): action_line is the first line, not the last.
14290 (copy_guard): Just as for actions, store the `action' only, not
14291 the switch/case/break flesh.
14292 Don't parse the user action that might follow the guard, let...
14293 (readgram): do it, i.e., now, there can be an action after a
14294 guard.
14295 In other words the guard is just explicitly optional.
14296 (packgram): Adjust.
14297 * src/output.c (guards_output): New.
14298 (output_parser): Call it when needed.
14299 (output): Also free the guard and attrs obstacks.
14300 * src/files.c, src/files.h (obstack_save): Remove.
14301 (output_files): Remove.
14302 As a result, if one needs the former `.act' file, using an
14303 appropriate skeleton which requires actions and guards is now
14304 required.
14305 * src/main.c (main): Adjust.
14306 * tests/semantic.at: New.
14307 * tests/regression.at: Use `input.y' as input file name.
14308 Avoid 8+3 problems by requiring input.c when the test needs the
14309 parser.
14310
14311 2001-12-27 Akim Demaille <akim@epita.fr>
14312
14313 * src/reader.c (symbol_list_new): Be sure to initialize all the
14314 fields.
14315
14316 2001-12-27 Akim Demaille <akim@epita.fr>
14317
14318 All the hacks using a final pseudo state are now useless.
14319
14320 * src/LR0.c (set_state_table): state_table holds exactly nstates.
14321 * src/lalr.c (nLA): New.
14322 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
14323 instead of lookaheadsp from the pseudo state (nstate + 1).
14324
14325 2001-12-27 Akim Demaille <akim@epita.fr>
14326
14327 * src/output.c (action_row, token_actions): Use a state_t instead
14328 of a integer, and nlookaheads instead of the following state's
14329 lookaheadsp.
14330
14331 2001-12-27 Akim Demaille <akim@epita.fr>
14332
14333 * src/conflicts.c (log_resolution, flush_shift)
14334 (resolve_sr_conflict, set_conflicts, solve_conflicts)
14335 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
14336 (conflicts_print, print_reductions): Use a state_t instead of an
14337 integer when referring to a state.
14338 As much as possible, depend upon nlookaheads, instead of the
14339 `lookaheadsp' member of the following state (since lookaheads of
14340 successive states are successive, the difference between state n + 1
14341 and n served as the number of lookaheads for state n).
14342 * src/lalr.c (add_lookback_edge): Likewise.
14343 * src/print.c (print_core, print_actions, print_state)
14344 (print_results): Likewise.
14345 * src/print_graph.c (print_core, print_actions, print_state)
14346 (print_graph): Likewise.
14347 * src/conflicts.h: Adjust.
14348
14349 2001-12-27 Akim Demaille <akim@epita.fr>
14350
14351 * src/bison.hairy: Formatting/comment changes.
14352 ANSIfy.
14353 Remove `register' indications.
14354 Add plenty of `static'.
14355
14356 2001-12-27 Akim Demaille <akim@epita.fr>
14357
14358 * src/output.c (prepare): Drop the muscle `ntbase' which
14359 duplicates ntokens.
14360 * src/bison.simple: Formatting/comment changes.
14361 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
14362 is an undocumented synonym.
14363
14364 2001-12-22 Akim Demaille <akim@epita.fr>
14365
14366 * src/output.c (output_table_data): Change the prototype to use
14367 `int' for array ranges: some invocations do pass an int, not a
14368 short.
14369 Reported by Wayne Green.
14370
14371 2001-12-22 Akim Demaille <akim@epita.fr>
14372
14373 Some actions of web2c.y are improperly triggered.
14374 Reported by Mike Castle.
14375
14376 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
14377 * tests/regression.at (Web2c): Rename as...
14378 (Web2c Report): this.
14379 (Web2c Actions): New.
14380
14381 2001-12-22 Akim Demaille <akim@epita.fr>
14382
14383 Reductions in web2c.y are improperly reported.
14384 Reported by Mike Castle.
14385
14386 * src/conflicts.c (print_reductions): Fix.
14387 * tests/regression.at (Web2c): New.
14388
14389 2001-12-18 Akim Demaille <akim@epita.fr>
14390
14391 Some host fail on `assert (!"foo")', which expands to
14392 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
14393 Reported by Nelson Beebee.
14394
14395 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
14396 `#define it_succeeded 0' and `assert (it_succeeded)'.
14397
14398 2001-12-17 Marc Autret <autret_m@epita.fr>
14399
14400 * src/bison.simple: Don't hard code the skeleton line and filename.
14401 * src/output.c (output_parser): Rename 'line' as 'output_line'.
14402 New line counter 'skeleton_line' (skeleton-line muscle).
14403
14404 2001-12-17 Paul Eggert <eggert@twinsun.com>
14405
14406 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
14407 YYDEBUG must be defined to a nonzero value.
14408
14409 * src/bison.simple (yytname): Do not assume that the user defines
14410 YYDEBUG to a properly parenthesized expression.
14411
14412 2001-12-17 Akim Demaille <akim@epita.fr>
14413
14414 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
14415 nlookaheads is a new member.
14416 Adjust all users.
14417 * src/lalr.h (nlookaheads): Remove this orphan declaration.
14418 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
14419 state.
14420
14421 2001-12-17 Akim Demaille <akim@epita.fr>
14422
14423 * src/files.h, src/files.c (open_files, close_files): Remove.
14424 * src/main.c (main): Don't open/close files, nor invoke lex_free,
14425 let...
14426 * src/reader.c (reader): Do it.
14427
14428 2001-12-17 Akim Demaille <akim@epita.fr>
14429
14430 * src/conflicts.c (print_reductions): Formatting changes.
14431
14432 2001-12-17 Akim Demaille <akim@epita.fr>
14433
14434 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
14435 (flush_reduce): New.
14436 (resolve_sr_conflict): Adjust.
14437
14438 2001-12-17 Akim Demaille <akim@epita.fr>
14439
14440 * src/output.c (output_obstack): Be static and rename as...
14441 (format_obstack): this, to avoid any confusion with files.c's
14442 output_obstack.
14443 * src/reader.h (muscle_obstack): Move to...
14444 * src/output.h: here, since it's defined in output.c.
14445
14446 2001-12-17 Akim Demaille <akim@epita.fr>
14447
14448 * src/output.c (action_row, save_column, default_goto)
14449 (sort_actions, matching_state, pack_vector): Better variable
14450 locality.
14451
14452 2001-12-17 Akim Demaille <akim@epita.fr>
14453
14454 * src/output.c: Various formatting changes.
14455
14456 2001-12-17 Akim Demaille <akim@epita.fr>
14457
14458 * src/files.c (output_files): Free the output_obstack.
14459 * src/main.c (main): Call print and print_graph conditionally.
14460 * src/print.c (print): Work unconditionally.
14461 * src/print_graph.c (print_graph): Work unconditionally.
14462 * src/conflicts.c (log_resolution): Output only if verbose_flag.
14463
14464 2001-12-16 Marc Autret <autret_m@epita.fr>
14465
14466 * src/output.c (actions_output): Fix. When we use %no-lines,
14467 there is one less line per action.
14468
14469 2001-12-16 Marc Autret <autret_m@epita.fr>
14470
14471 * src/bison.simple: Remove a useless #line directive.
14472 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
14473 * src/output.c (get_lines_number): New.
14474 (output_parser): Adjust, now takes care about the lines of a
14475 output muscles.
14476 Fix line numbering.
14477 (actions_output): Computes the number of lines taken by actions.
14478 (output_master_parser): Insert new skeleton which is the name of
14479 the output parser file name.
14480
14481 2001-12-15 Marc Autret <autret_m@epita.fr>
14482
14483 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
14484
14485 2001-12-15 Marc Autret <autret_m@epita.fr>
14486
14487 * src/output.c (output_gram): Keep track of the hairy one.
14488
14489 2001-12-15 Akim Demaille <akim@epita.fr>
14490
14491 Make `make distcheck' work.
14492
14493 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
14494 system.h which uses libgettext.h.
14495
14496 2001-12-15 Akim Demaille <akim@epita.fr>
14497
14498 * src/nullable.c (set_nullable): Useless rules must be skipped,
14499 otherwise, since we range over their symbols, we might look at a
14500 nonterminal which no longer ``exists'', i.e., it is not counted in
14501 `nvars', hence we overflow our arrays.
14502
14503 2001-12-15 Akim Demaille <akim@epita.fr>
14504
14505 The header can also be produced directly, without any obstack!
14506 Yahoo!
14507
14508 * src/files.c, src/files.h (defines_obstack): Remove.
14509 (compute_header_macro): Global.
14510 (defines_obstack_save): Remove.
14511 * src/reader.c (parse_union_decl): No longer output to
14512 defines_obstack: its content can be found in the `stype' muscle
14513 anyway.
14514 (output_token_translations): Merge into...
14515 (symbols_output): this.
14516 Rename as...
14517 (symbols_save): this.
14518 (reader): Adjust.
14519 * src/output.c (header_output): New.
14520 (output): Call it.
14521
14522 2001-12-15 Akim Demaille <akim@epita.fr>
14523
14524 * src/reader.c (parse_union_decl): Instead of handling two obstack
14525 simultaneously, use one to define the `stype' muscle, and use the
14526 value of the latter to fill defines_obstack.
14527 (copy_comment): Remove.
14528 (copy_comment2): Work for a single obstack.
14529 Rename as...
14530 (copy_comment): this.
14531
14532 2001-12-15 Akim Demaille <akim@epita.fr>
14533
14534 * src/lex.c, src/lex.h (xgetc): No longer static.
14535 * src/reader.c (parse_union_decl): Revamp.
14536
14537 2001-12-15 Akim Demaille <akim@epita.fr>
14538
14539 Still making progress in separating Bison into (i) input, (ii)
14540 process, (iii) output: now we can directly output the parser file
14541 without using table_obstack at all.
14542
14543 * src/files.c, src/files.h (table_obstack): Bye bye.
14544 (parser_file_name): New.
14545 * src/files.c (compute_output_file_names): Compute it.
14546 * src/output.c (actions_output, output_parser)
14547 (output_master_parser): To a file instead of an obstack.
14548
14549 2001-12-15 Akim Demaille <akim@epita.fr>
14550
14551 Attach actions to rules, instead of pre-outputting them to
14552 actions_obstack.
14553
14554 * src/gram.h (rule_t): action and action_line are new members.
14555 * src/reader.c (symbol_list): Likewise.
14556 (copy_action): Save the actions within the rule.
14557 (packgram): Save them in rule_table.
14558 * src/output.c (actions_output): New.
14559 (output_parser): Use it on `%%actions'.
14560 (output_rule_data): Don't free rule_table.
14561 (output): Do it.
14562 (prepare): Don't save the `action' muscle.
14563 * src/bison.simple: s/%%action/%%actions/.
14564
14565 2001-12-15 Akim Demaille <akim@epita.fr>
14566
14567 * src/reader.c (copy_action): When --yacc, don't append a `;'
14568 to the user action: let it fail if lacking.
14569 Suggested by Arnold Robbins and Tom Tromey.
14570
14571 2001-12-14 Akim Demaille <akim@epita.fr>
14572
14573 * src/lex.c (literalchar): Simply return the char you decoded, non
14574 longer mess around with obstacks and int pointers.
14575 Adjust all callers.
14576
14577 2001-12-14 Akim Demaille <akim@epita.fr>
14578
14579 * src/lex.c (literalchar): Don't escape the special characters,
14580 just decode them, and keep them as char (before, eol was output as
14581 the 2 char string `\n' etc.).
14582 * src/output.c (output_rule_data): Use quotearg to output the
14583 token strings.
14584
14585 2001-12-13 Paul Eggert <eggert@twinsun.com>
14586
14587 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
14588 Do not infringe on the global user namespace when using C++.
14589 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
14590 All uses of `fprintf' and `stderr' changed.
14591
14592 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
14593
14594 2001-12-13 Akim Demaille <akim@epita.fr>
14595
14596 The computation of nullable is broken: it doesn't handle empty
14597 RHS's properly.
14598
14599 * tests/torture.at (GNU AWK Grammar): New.
14600 * tests/sets.at (Nullable): New.
14601 * src/nullable.c (set_nullable): Instead of blindly looping over
14602 `ritems', loop over the rules, and then over their rhs's.
14603
14604 Work around Autotest bugs.
14605
14606 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
14607 frame, because Autotest understand lines starting with a `+' as
14608 traces from the shell. Then, they are not processed properly.
14609 Admittedly an Autotest bug, but we don't have time to wait for
14610 Autotest to catch up.
14611 * tests/regression.at (Broken Closure): Adjust to the new table
14612 frames.
14613 Move to...
14614 * tests/sets.at: here.
14615
14616 2001-12-13 Akim Demaille <akim@epita.fr>
14617
14618 * src/closure.c (closure): Use nrules instead of playing tricks
14619 with BITS_PER_WORD.
14620
14621 2001-12-13 Akim Demaille <akim@epita.fr>
14622
14623 * src/print.c (print_actions): Output the handling of `$' as the
14624 traces do: shifting the token EOF. Before EOF was treated as a
14625 nonterminal.
14626 * tests/regression.at: Adjust some tests.
14627 * src/print_graph.c (print_core): Complete the set of items via
14628 closure. The next-to-final and final states are still unsatisfying,
14629 but that's to be addressed elsewhere.
14630 No longer output the rule numbers, but do output the state number.
14631 A single loop for the shifts + gotos is enough, but picked a
14632 distinct color for each.
14633 (print_graph): Initialize and finalize closure.
14634
14635 2001-12-13 Akim Demaille <akim@epita.fr>
14636
14637 * src/reader.c (readgram): Remove dead code, an strip useless
14638 braces.
14639 (get_type): Remove, unused.
14640
14641 2001-12-12 Akim Demaille <akim@epita.fr>
14642
14643 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
14644 on that of lib/error.c.
14645
14646 2001-12-12 Akim Demaille <akim@epita.fr>
14647
14648 Some hosts don't like `/' in includes.
14649
14650 * src/system.h: Include libgettext.h without qualifying the path.
14651 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
14652 $(top_srcdir).
14653
14654 2001-12-11 Marc Autret <autret_m@epita.fr>
14655
14656 * src/output.c (output_parser): Remove useless muscle.
14657
14658 2001-12-11 Marc Autret <autret_m@epita.fr>
14659
14660 * src/bison.simple: Remove #line just before %%epilogue. It
14661 is now handled in ...
14662 * src/reader.c (read_additionnal_code): Add the output of a
14663 #line for the epilogue.
14664
14665 2001-12-10 Marc Autret <autret_m@epita.fr>
14666
14667 * src/reader.c (copy_definition): Re-use CPP-outed code which
14668 replace precedent remove.
14669 * src/bison.simple: Remove #line before %%prologue because
14670 %%input-line is wrong at this time.
14671
14672 2001-12-10 Marc Autret <autret_m@epita.fr>
14673
14674 * src/reader.c (symbols_output): Clean up.
14675 * src/output.c (output_gram, output): Clean up.
14676
14677 2001-12-10 Akim Demaille <akim@epita.fr>
14678
14679 * src/lalr.c (initialize_lookaheads): New. Extracted from...
14680 * src/LR0.c (set_state_table): here.
14681 * src/lalr.c (lalr): Call it.
14682
14683 2001-12-10 Akim Demaille <akim@epita.fr>
14684
14685 * src/state.h (shifts): Remove the `number' member: shifts are
14686 attached to state, hence no longer need to be labelled with a
14687 state number.
14688
14689 2001-12-10 Akim Demaille <akim@epita.fr>
14690
14691 Now that states have a complete set of members, the linked list of
14692 shifts is useless: just fill directly the state's shifts member.
14693
14694 * src/state.h (shifts): Remove the `next' member.
14695 * src/LR0.c (first_state, last_state): Remove.
14696 Adjust the callers.
14697 (augment_automaton): Don't look for the shifts that must be added
14698 a shift on EOF: it is those of the state we looked for! But now,
14699 since shifts are attached, it is no longer needed to looking
14700 merely by its id: its number.
14701
14702 2001-12-10 Akim Demaille <akim@epita.fr>
14703
14704 * src/LR0.c (augment_automaton): Better variable locality.
14705 Remove an impossible branch: if there is a state corresponding to
14706 the start symbol being shifted, then there is shift for the start
14707 symbol from the initial state.
14708
14709 2001-12-10 Akim Demaille <akim@epita.fr>
14710
14711 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
14712 only when appropriate: when insert_start_shifting_state' is not
14713 invoked.
14714 * tests/regression.at (Rule Line Numbers): Adjust.
14715
14716 2001-12-10 Akim Demaille <akim@epita.fr>
14717
14718 * src/LR0.c (augment_automaton): Now that all states have shifts,
14719 merge the two cases addition shifts to the initial state.
14720
14721 2001-12-10 Akim Demaille <akim@epita.fr>
14722
14723 * src/lalr.c (set_state_table): Move to...
14724 * src/LR0.c: here.
14725 * src/lalr.c (lalr): Don't call it...
14726 * src/LR0.c (generate_states): do it.
14727 * src/LR0.h (first_state): Remove, only the table is used.
14728
14729 2001-12-10 Akim Demaille <akim@epita.fr>
14730
14731 * src/LR0.h (first_shift, first_reduction): Remove.
14732 * src/lalr.c: Don't use first_shift: find shifts through the
14733 states.
14734
14735 2001-12-10 Akim Demaille <akim@epita.fr>
14736
14737 * src/LR0.c: Attach shifts to states as soon as they are
14738 computed.
14739 * src/lalr.c (set_state_table): Instead of assigning shifts to
14740 state, just assert that the mapping was properly done.
14741
14742 2001-12-10 Akim Demaille <akim@epita.fr>
14743
14744 * src/LR0.c (insert_start_shift): Rename as...
14745 (insert_start_shifting_state): this.
14746 (insert_eof_shifting_state, insert_accepting_state): New.
14747 (augment_automaton): Adjust.
14748 Better locality of the variables.
14749 When looking if the start_symbol is shifted from the initial
14750 state, using `while (... symbol != start_symbol ...)' sounds
14751 better than `while (... symbol < start_symbol ...)': If fail
14752 to see how the order between symbols could be relevant!
14753
14754 2001-12-10 Akim Demaille <akim@epita.fr>
14755
14756 * src/getargs.h: Don't declare `spec_name_prefix' and
14757 `spec_file_prefix', declared by src/files.h.
14758 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
14759 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
14760 * src/output.c (prepare): Adjust.
14761 * src/reader.c (symbols_output): Likewise.
14762 * src/vmsgetargs.c: Vaguely adjust, but who cares?
14763
14764 2001-12-10 Akim Demaille <akim@epita.fr>
14765
14766 * src/muscle_tab.c (muscle_init): NULL is a better default than
14767 `"0"'.
14768
14769 2001-12-10 Akim Demaille <akim@epita.fr>
14770
14771 * src/reader.c (reader): Calling symbols_output once is enough.
14772
14773 2001-12-10 Akim Demaille <akim@epita.fr>
14774
14775 Now that states have a complete set of members, the linked list of
14776 reductions is useless: just fill directly the state's reductions
14777 member.
14778
14779 * src/state.h (struct reductions): Remove member `number' and
14780 `next'.
14781 * src/LR0.c (first_reduction, last_reduction): Remove.
14782 (save_reductions): Don't link the new reductions, store them in
14783 this_state.
14784 * src/lalr.c (set_state_table): No need to attach reductions to
14785 states, it's already done.
14786 * src/output.c (output_actions): No longer free the shifts, then
14787 the reductions, then the states: free all the states and their
14788 members.
14789
14790 2001-12-10 Akim Demaille <akim@epita.fr>
14791
14792 * src/options.c (OPTN, DRTV, BOTH): New.
14793 (option_table): Use them.
14794
14795 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
14796 the job of system.h.
14797 * src/options.c: Don't include stdio.h and xalloc.h for the same
14798 reasons.
14799
14800 2001-12-10 Akim Demaille <akim@epita.fr>
14801
14802 * src/output.c (output, prepare): Make sure the values of the
14803 muscles `action' and `prologue' are 0-terminated.
14804
14805 2001-12-10 Akim Demaille <akim@epita.fr>
14806
14807 Clean up GCC warnings.
14808
14809 * src/reader.c (copy_action): `buf' is not used.
14810 (parse_skel_decl): Be static.
14811 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
14812 * src/options.h (create_long_option_table): Have a real prototype.
14813 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
14814 (hash_delete_at): Return const void *.
14815 Adjust casts to preserve the const.
14816
14817 2001-12-10 Akim Demaille <akim@epita.fr>
14818
14819 * configure.in: Require 2.52g.
14820 M4 is not needed, but AUTOM4TE is.
14821 * m4/m4.m4: Remove.
14822 * tests/Makefile.am: Adjust.
14823
14824 2001-12-10 Akim Demaille <akim@epita.fr>
14825
14826 One structure for states is enough, even though theoretically
14827 there are LR(0) states and LALR(1) states.
14828
14829 * src/lalr.h (state_t): Remove.
14830 (state_table): Be state_t **, not state_t *.
14831 * src/state.h (core, CORE_ALLOC): Rename as...
14832 (state_t, STATE_ALLOC): this.
14833 Add the LALR(1) members: shifts, reductions, errs.
14834 * src/LR0.c (state_table): Rename as...
14835 (state_hash): this, to avoid name clashes with the global
14836 `state_table'.
14837 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
14838 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
14839
14840 2001-12-10 Akim Demaille <akim@epita.fr>
14841
14842 Bison dumps core on bash.y.
14843 Reported by Pascal Bart.
14844
14845 * src/warshall.c (bitmatrix_print): New.
14846 (TC): Use it.
14847 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
14848 j must be the outer loop.
14849 * tests/regression.at (Broken Closure): New.
14850
14851 2001-12-05 Akim Demaille <akim@epita.fr>
14852
14853 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
14854 its argument.
14855 Reported by Peter Hamorsky.
14856
14857 2001-12-05 Akim Demaille <akim@epita.fr>
14858
14859 * src/conflicts.c (err_table): Remove.
14860 (resolve_sr_conflict): Adjust.
14861 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
14862 Rename as...
14863 (state_t.reductions, state_t.shifts): this.
14864
14865 2001-12-05 Akim Demaille <akim@epita.fr>
14866
14867 * src/reduce.c (reduce_grammar_tables): No longer disable the
14868 removal of useless rules via CPP but via `if (0)', so that the
14869 compiler still check the code is valid.
14870 For instance, it should have noticed `rline' no longer exists: use
14871 the `line' member of rule_t.
14872 * src/gram.c (dummy, rline): Remove, unused.
14873
14874 2001-12-05 Akim Demaille <akim@epita.fr>
14875
14876 * src/output.c (pack_vector): Use assert, not berror.
14877 * src/main.c (berror): Remove, unused.
14878
14879 2001-12-05 Akim Demaille <akim@epita.fr>
14880
14881 New experimental feature: if --verbose --trace output all the
14882 items of a state, not only its kernel.
14883
14884 * src/print.c (print_core): If `trace_flag', then invoke closure
14885 before outputting the items of the state (print_core is no longer
14886 a correct name them).
14887 (print_results): Invoke new_closure/free_closure if needed.
14888
14889 2001-12-05 Akim Demaille <akim@epita.fr>
14890
14891 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
14892 * src/closure.c, src/closure.h (itemsetsize): Rename as...
14893 (nitemset): for consistency with the rest of the project.
14894
14895 2001-12-05 Akim Demaille <akim@epita.fr>
14896
14897 * src/closure.c (print_closure): Improve.
14898 (closure): Use it for printing input and output.
14899
14900 2001-12-05 Akim Demaille <akim@epita.fr>
14901
14902 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
14903 indexed by nonterminals.
14904
14905 2001-12-05 Akim Demaille <akim@epita.fr>
14906
14907 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
14908 what it was!).
14909 * src/warshall.h: Remove accidental duplication of the content.
14910
14911 2001-12-05 Akim Demaille <akim@epita.fr>
14912
14913 * src/closure.c (set_fderives): De-obfuscate.
14914
14915 2001-12-05 Akim Demaille <akim@epita.fr>
14916
14917 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
14918
14919 2001-12-05 Akim Demaille <akim@epita.fr>
14920
14921 * src/closure.c (set_firsts): De-obfuscate.
14922
14923 2001-12-05 Akim Demaille <akim@epita.fr>
14924
14925 * src/output.c (action_row): De-obfuscate
14926 using the good o' techniques: arrays not pointers, variable
14927 locality, BITISSET, RESETBIT etc.
14928
14929 2001-12-05 Akim Demaille <akim@epita.fr>
14930
14931 Pessimize the code to simplify it: from now on, all the states
14932 have a valid SHIFTS, which NSHIFTS is possibly 0.
14933
14934 * src/LR0.c (shifts_new): Be global and move to..
14935 * src/state.c, src/state.h: here.
14936 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
14937 * src/print_graph: Adjust.
14938
14939 2001-12-05 Akim Demaille <akim@epita.fr>
14940
14941 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
14942 * src/conflicts.c: Use it.
14943 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
14944 incorrectly ``simplified''.
14945
14946 2001-12-05 Akim Demaille <akim@epita.fr>
14947
14948 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
14949 using the good o' techniques: arrays not pointers, variable
14950 locality, BITISSET, RESETBIT etc.
14951
14952 2001-12-05 Akim Demaille <akim@epita.fr>
14953
14954 * src/state.h (SHIFT_SYMBOL): New.
14955 * src/conflicts.c: Use it to deobfuscate.
14956
14957 2001-12-05 Akim Demaille <akim@epita.fr>
14958
14959 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
14960 (print_reductions): De-obfuscate using the good o' techniques:
14961 arrays not pointers, variable locality, BITISSET.
14962
14963 2001-12-05 Akim Demaille <akim@epita.fr>
14964
14965 * src/conflicts.c (print_reductions): Arrays, not pointers.
14966 Use BITISSET.
14967
14968 2001-12-05 Akim Demaille <akim@epita.fr>
14969
14970 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14971
14972 2001-12-05 Akim Demaille <akim@epita.fr>
14973
14974 * src/conflicts.c (print_reductions): Improve variable locality.
14975
14976 2001-12-05 Akim Demaille <akim@epita.fr>
14977
14978 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14979
14980 2001-12-05 Akim Demaille <akim@epita.fr>
14981
14982 * src/conflicts.c (print_reductions): Improve variable locality.
14983
14984 2001-12-05 Akim Demaille <akim@epita.fr>
14985
14986 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
14987 * src/lalr.c: Use them.
14988
14989 2001-12-05 Akim Demaille <akim@epita.fr>
14990
14991 * src/LR0.c (augment_automaton): Formatting changes.
14992 Better variable locality.
14993
14994 2001-12-05 Akim Demaille <akim@epita.fr>
14995
14996 * src/lalr.c (matrix_print): New.
14997 (transpose): Use it.
14998 Use arrays instead of pointers.
14999
15000 2001-12-05 Akim Demaille <akim@epita.fr>
15001
15002 * src/lalr.c (maxrhs): Move to...
15003 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
15004 * src/lalr.c (build_relations): Adjust.
15005
15006 2001-12-05 Akim Demaille <akim@epita.fr>
15007
15008 * src/lalr.c (transpose): Free the memory allocated to the
15009 argument, as it is replaced by the results by the unique caller.
15010 (build_relations): Merely invoke transpose: it handles the memory
15011 deallocation.
15012 Improve variable locality.
15013 Avoid variables used as mere abbreviations.
15014 (compute_lookaheads): Use arrays instead of pointers.
15015
15016 2001-12-05 Akim Demaille <akim@epita.fr>
15017
15018 * src/lalr.c (initialize_F): Improve variable locality.
15019 Avoid variables used as mere abbreviations.
15020
15021 2001-12-05 Akim Demaille <akim@epita.fr>
15022
15023 * src/derives.c (print_derives): Display the ruleno.
15024 * src/lalr.c (initialize_F, transpose): Better variable locality
15025 to improve readability.
15026 Avoid variables used as mere abbreviations.
15027
15028 2001-12-05 Akim Demaille <akim@epita.fr>
15029
15030 * src/lalr.c (traverse): Use arrays instead of pointers.
15031
15032 2001-12-05 Akim Demaille <akim@epita.fr>
15033
15034 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
15035 the handling of squeue.
15036 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15037
15038 2001-12-05 Akim Demaille <akim@epita.fr>
15039
15040 Because useless nonterminals are now kept alive (instead of being
15041 `destroyed'), we now sometimes examine them, and store information
15042 related to them. Hence we need to know their number, and adjust
15043 memory allocations.
15044
15045 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
15046 static.
15047 * src/LR0.c (allocate_itemsets): The memory allocated to
15048 `symbol_count' was used for two different purpose: once to count
15049 the number of occurrences of each symbol, and later reassigned to
15050 `shift_symbol', containing the symbol that can be shifted from a
15051 given state.
15052 Deobfuscate, i.e., allocate, use and free `symbol_count' here
15053 only, and...
15054 (new_itemsets): Allocate `shift_symbol' here.
15055 (allocate_itemsets): symbol_count includes useless nonterminals.
15056 Make room for them.
15057 (free_storage): Use `free', not `XFREE', for pointers that cannot
15058 be null.
15059
15060 2001-12-05 Akim Demaille <akim@epita.fr>
15061
15062 * src/nullable.c (set_nullable): Deobfuscate the handling of
15063 ritem.
15064 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15065
15066 2001-12-05 Akim Demaille <akim@epita.fr>
15067
15068 * src/gram.c, src/gram.h (ritem_print): New.
15069 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
15070 (This useless function was defined only to work around VMS linkers
15071 that can't handle compilation units with variables only).
15072 * src/reduce.c (dump_grammar): Use it to trace the construction of
15073 ritem.
15074
15075 2001-12-04 Paul Eggert <eggert@twinsun.com>
15076
15077 * src/bison.simple (union yyalloc): Change member names
15078 to be the same as the stack names.
15079 (yyparse): yyptr is now union yyalloc *, not char *.
15080 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
15081 and may generate better code on some machines.
15082 (yystpcpy): Use prototype if __STDC__ is defined, not just
15083 if __cplusplus is defined.
15084
15085 2001-11-30 Akim Demaille <akim@epita.fr>
15086
15087 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
15088 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
15089 Gettext doesn't compile cleanly, and dies with -Werror.
15090 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
15091 Include WARNING_CFLAGS here.
15092 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
15093 before being defined.
15094
15095 2001-11-27 Paul Eggert <eggert@twinsun.com>
15096
15097 * lib/quotearg.h (quotearg_n, quotearg_n_style):
15098 First arg is int, not unsigned.
15099 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
15100 (SIZE_MAX, UINT_MAX): New macros.
15101 (quotearg_n_options): Abort if N is negative.
15102 Avoid overflow check on hosts where size_t is 64 bits and int
15103 is 32 bits, as overflow is impossible there.
15104 Fix off-by-one typo that caused unnecessary reallocation.
15105
15106 2001-11-29 Paul Eggert <eggert@twinsun.com>
15107
15108 Name space cleanup in generated parser.
15109
15110 * doc/bison.texinfo (Bison Parser): Discuss system headers
15111 and their effect on the user name space.
15112
15113 * src/bison.simple:
15114 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
15115 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
15116 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
15117
15118 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
15119 on user names when possible.
15120
15121 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
15122 Simplify test for whather <alloca.h> exists.
15123
15124 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
15125
15126 (<stdio.h>): Include if YYDEBUG.
15127
15128 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
15129 ! defined (yyoverflow) && ! defined (yymemcpy).
15130
15131 (yymemcpy, yyparse): Rename local variables as needed so that
15132 they all begin with 'yy'.
15133
15134 (yystrlen, yystpcpy): New functions.
15135
15136 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
15137 All uses changed.
15138
15139 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
15140 instead of relying on string.h functions. Use YYSTACK_ALLOC
15141 and YYSTACK_FREE instead of malloc and free.
15142
15143 2001-11-30 Akim Demaille <akim@epita.fr>
15144
15145 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
15146 before their first uses.
15147 (YYBISON, YYPURE): Move to the top of the output.
15148
15149 2001-11-30 Akim Demaille <akim@epita.fr>
15150
15151 * tests/reduce.at (Useless Nonterminals): Fix.
15152
15153 2001-11-30 Akim Demaille <akim@epita.fr>
15154
15155 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
15156 if body instead of `;' to pacify GCC's warnings.
15157
15158 2001-11-30 Akim Demaille <akim@epita.fr>
15159
15160 Instead of mapping the LHS of unused rules to -1, keep the LHS
15161 valid, but flag the rules as invalid.
15162
15163 * src/gram.h (rule_t): `useful' is a new member.
15164 * src/print.c (print_grammar): Adjust.
15165 * src/derives.c (set_derives): Likewise.
15166 * src/reader.c (packgram, reduce_output): Likewise.
15167 * src/reduce.c (reduce_grammar_tables): Likewise.
15168 * tests/reduce.at (Underivable Rules, Useless Rules): New.
15169
15170 2001-11-30 Akim Demaille <akim@epita.fr>
15171
15172 * src/reduce.c (reduce_output): Formatting changes.
15173 * src/print.c (print_results, print_grammar): Likewise.
15174 * tests/regression.at (Rule Line Numbers)
15175 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
15176
15177 2001-11-30 Akim Demaille <akim@epita.fr>
15178
15179 * src/reduce.c (nonterminals_reduce): Instead of throwing away
15180 useless nonterminals, move them at the end of the symbol arrays.
15181 (reduce_output): Adjust.
15182 * tests/reduce.at (Useless Nonterminals): Adjust.
15183
15184 2001-11-30 Akim Demaille <akim@epita.fr>
15185
15186 * src/reduce.c: Various comment/formatting changes.
15187 (nonterminals_reduce): New, extracted from...
15188 (reduce_grammar_tables): here.
15189 (reduce_grammar): Call nonterminals_reduce.
15190
15191 2001-11-29 Paul Eggert <eggert@twinsun.com>
15192
15193 * src/bison.simple (YYSTACK_REALLOC): Remove.
15194 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
15195 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
15196 New macros.
15197 (union yyalloc): New type.
15198 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
15199 an arbitrary restriction on hosts where size_t is wider than int.
15200
15201 (yyparse): Don't dump core if alloca or malloc fails; instead, report
15202 a parser stack overflow. Allocate just one block of memory for all
15203 three stacks, instead of allocating three blocks; this typically is
15204 faster and reduces fragmentation.
15205
15206 Do not limit the number of items in the stack to a value that fits
15207 in 'int', as this is an arbitrary limit on hosts with 64-bit
15208 size_t and 32-bit int.
15209
15210 2001-11-29 Marc Autret <autret_m@epita.fr>
15211
15212 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
15213 of defining YYERROR_VERBOSE.
15214 [AT_DATA]: $4 is now out of C declarations in the prologue.
15215
15216 2001-11-28 Marc Autret <autret_m@epita.fr>
15217
15218 * src/reader.c (parse_dquoted_param): New.
15219 (parse_skel_decl): Use it.
15220 * src/lex.h: Add its prototype.
15221 * src/lex.c (literalchar): Become not static.
15222
15223 2001-11-28 Marc Autret <autret_m@epita.fr>
15224
15225 * src/output.h: And put its extern declaration here.
15226 * src/output.c (error_verbose): Define here.
15227 (prepare): Echo name modification.
15228 * src/getargs.h: Clean its extern declaration.
15229 * src/getargs.c (error_verbose_flag): Remove.
15230 (getargs): Remove case 'e'.
15231 * src/options.c (option_table): 'error-verbose' is now seen as simple
15232 percent option.
15233 Include output.h.
15234
15235 * src/reader.c (read_declarations): Remove case tok_include.
15236 (parse_include_decl): Remove.
15237 * src/lex.h (token_t): Remove tok_include.
15238 * src/options.c (option_table): 'include' is now a simple command line
15239 option.
15240
15241 2001-11-28 Marc Autret <autret_m@epita.fr>
15242
15243 * src/bison.simple: Adjust muscle names.
15244 * src/muscle_tab.c (muscle_init): Also rename the muscles.
15245 * src/output.c (prepare): s/_/-/ for the muscles names.
15246 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
15247
15248 2001-11-28 Marc Autret <autret_m@epita.fr>
15249
15250 * src/bison.simple: Fix debug.
15251 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
15252
15253 2001-11-28 Akim Demaille <akim@epita.fr>
15254
15255 * src/LR0.c (shifts_new): New.
15256 (save_shifts, insert_start_shift, augment_automaton): Use it.
15257
15258 2001-11-28 Akim Demaille <akim@epita.fr>
15259
15260 * src/closure.c (closure): `b' and `ruleno' denote the same value:
15261 keep ruleno only.
15262
15263 2001-11-28 Akim Demaille <akim@epita.fr>
15264
15265 * src/closure.c (closure): Instead of looping over word in array
15266 then bits in words, loop over bits in array.
15267
15268 2001-11-28 Akim Demaille <akim@epita.fr>
15269
15270 * src/closure.c (closure): No longer optimize the special case
15271 where all the bits of `ruleset[r]' are set to 0, to make the code
15272 clearer.
15273
15274 2001-11-28 Akim Demaille <akim@epita.fr>
15275
15276 * src/closure.c (closure): `r' and `c' are new variables, used to
15277 de-obfuscate accesses to RULESET and CORE.
15278
15279 2001-11-28 Akim Demaille <akim@epita.fr>
15280
15281 * src/reduce.c (reduce_print): Use ngettext.
15282 (dump_grammar): Improve the trace accuracy.
15283
15284 2001-11-28 Akim Demaille <akim@epita.fr>
15285
15286 * src/reduce.c (dump_grammar): Don't translate trace messages.
15287
15288 2001-11-28 Akim Demaille <akim@epita.fr>
15289
15290 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
15291 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
15292 as all tags are free'ed afterwards.
15293 From Enrico Scholz.
15294
15295 2001-11-27 Paul Eggert <eggert@twinsun.com>
15296
15297 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
15298 use alloca when we didn't want to, and vice versa.
15299
15300 2001-11-27 Marc Autret <autret_m@epita.fr>
15301
15302 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
15303 initialization.
15304 * src/output.c (prepare): Remove its update.
15305
15306 2001-11-27 Marc Autret <autret_m@epita.fr>
15307
15308 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
15309 Use %error-verbose.
15310
15311 2001-11-27 Marc Autret <autret_m@epita.fr>
15312
15313 * src/bison.simple: Remove YYERROR_VERBOSE using.
15314 Use %%error_verbose.
15315 (yyparse): Likewise.
15316 * src/output.c (prepare): Give its final value.
15317 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
15318 * src/getargs.h: Add its extern declaration.
15319 * src/getargs.c (error_verbose_flag): New int.
15320 (getargs): Update to catch new case.
15321 * src/options.c (option_table): 'error-verbose' is a new option.
15322 (shortopts): Update.
15323
15324 2001-11-27 Akim Demaille <akim@epita.fr>
15325
15326 * src/system.h: Use intl/libgettext.h.
15327 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
15328
15329 2001-11-27 Akim Demaille <akim@epita.fr>
15330
15331 * tests/torture.at (Exploding the Stack Size with Malloc):
15332 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
15333
15334 2001-11-27 Akim Demaille <akim@epita.fr>
15335
15336 * src/files.c: Include error.h.
15337 Reported by Hans Aberg.
15338
15339 2001-11-26 Marc Autret <autret_m@epita.fr>
15340
15341 * src/reader.c (parse_include_decl): New, not yet implemented.
15342 (read_declarations): Add case tok_include.
15343 * src/getargs.h (include): Add its extern definition.
15344 * src/getargs.c (include): New const char *.
15345 (getargs): Add case '-I'.
15346 * src/options.c (option_table): Add include as command line and
15347 percent option.
15348 * src/lex.h (token_t): Add tok_include.
15349
15350 2001-11-26 Akim Demaille <akim@epita.fr>
15351
15352 * src/reader.c (readgram): Make sure rules for mid-rule actions
15353 have a lineno equal to that of their host rule.
15354 Reported by Hans Aberg.
15355 * tests/regression.at (Rule Line Numbers): New.
15356
15357 2001-11-26 Akim Demaille <akim@epita.fr>
15358
15359 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
15360 size_ts.
15361
15362 2001-11-26 Akim Demaille <akim@epita.fr>
15363
15364 * src/complain.c, src/complain.h (error): Remove, provided by
15365 lib/error.[ch].
15366
15367 2001-11-26 Akim Demaille <akim@epita.fr>
15368
15369 * src/reader.c (read_declarations): Don't abort on tok_illegal,
15370 issue an error message.
15371 * tests/regression.at (Invalid %directive): New.
15372 Reported by Hans Aberg.
15373
15374 2001-11-26 Akim Demaille <akim@epita.fr>
15375
15376 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
15377 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15378
15379 2001-11-26 Akim Demaille <akim@epita.fr>
15380
15381 * src/conflicts.c (conflicts_print): Don't complain at all when
15382 there are no reduce/reduce conflicts, and as many shift/reduce
15383 conflicts as expected.
15384 * tests/regression.at (%expect right): Adjust.
15385
15386 2001-11-23 Akim Demaille <akim@epita.fr>
15387
15388 * lib/alloca.c: Update, from fileutils.
15389
15390 2001-11-23 Akim Demaille <akim@epita.fr>
15391
15392 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
15393
15394 2001-11-23 Akim Demaille <akim@epita.fr>
15395
15396 * src/system.h: Include alloca.h.
15397 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
15398
15399 2001-11-23 Akim Demaille <akim@epita.fr>
15400
15401 * src/print_graph.c (print_actions): Remove `rule', unused.
15402 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
15403 pacify GCC's signed < unsigned warnings.
15404 * src/closure.c (itemsetsize): Likewise.
15405 * src/reader.c (symbol_list_new): Static.
15406
15407 2001-11-23 Akim Demaille <akim@epita.fr>
15408
15409 Attaching lineno to buckets is stupid, since only one copy of each
15410 symbol is kept, only the line of the first occurrence is kept too.
15411
15412 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
15413 * src/reader.c (rline_allocated): Remove, unused.
15414 (symbol_list): Have a `line' member.
15415 (symbol_list_new): New.
15416 (readgram): Use it.
15417 * src/print.c (print_grammar): Output the rule line numbers.
15418 * tests/regression.at (Solved SR Conflicts)
15419 (Unresolved SR Conflicts): Adjust.
15420 Reported by Hans Aberg.
15421
15422 2001-11-22 Marc Autret <autret_m@epita.fr>
15423
15424 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
15425
15426 2001-11-22 Marc Autret <autret_m@epita.fr>
15427
15428 * src/muscle_tab.c (muscle_init): Remove initialization of
15429 skeleton muscle.
15430 * src/output.c (output_master_parser): Do it here.
15431
15432 2001-11-20 Akim Demaille <akim@epita.fr>
15433
15434 * po/sv.po: New.
15435 * configure.in (ALL_LINGUAS): Adjust.
15436 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
15437 longer contains strings to translate.
15438
15439 2001-11-19 Akim Demaille <akim@epita.fr>
15440
15441 * src/conflicts.c (conflicts_print): Add a missing \n.
15442
15443 2001-11-19 Akim Demaille <akim@epita.fr>
15444
15445 * src/nullable.c (nullable_print): New.
15446 (set_nullable): Call it when tracing.
15447 Better locality of variables.
15448
15449 2001-11-19 Akim Demaille <akim@epita.fr>
15450
15451 * src/print.c (print_actions): Better locality of variables.
15452
15453 2001-11-19 Akim Demaille <akim@epita.fr>
15454
15455 * src/derives.c (print_derives): Fix and enrich.
15456 * src/closure.c (print_fderives): Likewise.
15457
15458 2001-11-19 Akim Demaille <akim@epita.fr>
15459
15460 * src/closure.c (itemsetend): Remove, replaced with...
15461 (itemsetsize): new.
15462
15463 2001-11-19 Akim Demaille <akim@epita.fr>
15464
15465 * src/LR0.c (kernel_end): Remove, replaced with...
15466 (kernel_size): new.
15467
15468 2001-11-19 Akim Demaille <akim@epita.fr>
15469
15470 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
15471 to clarify.
15472
15473 2001-11-19 Akim Demaille <akim@epita.fr>
15474
15475 * src/closure.c (closure): Use arrays instead of pointers to clarify.
15476
15477 2001-11-19 Akim Demaille <akim@epita.fr>
15478
15479 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
15480 trace messages.
15481 * src/LR0.c: Likewise.
15482 (allocate_itemsets): Use arrays instead of pointers to clarify.
15483
15484 2001-11-19 Akim Demaille <akim@epita.fr>
15485
15486 * src/getargs.c (statistics_flag): Replace with...
15487 (trace_flag): New.
15488 (longopts): Accept --trace instead of --statistics.
15489 * src/getargs.h, src/options.c: Adjust.
15490 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
15491 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
15492
15493 2001-11-19 Akim Demaille <akim@epita.fr>
15494
15495 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
15496 pointers to clarify the code.
15497 (save_reductions, save_shifts): Factor common parts of alternatives.
15498
15499 2001-11-19 Akim Demaille <akim@epita.fr>
15500
15501 * src/LR0.c (new_state, get_state): Complete TRACE code.
15502 * src/closure.c: Include `reader.h' to get `tags', needed by the
15503 trace code.
15504 Rename the conditional DEBUG as TRACE.
15505 Output consistently TRACEs to stderr, not stdout.
15506 * src/derives.c: Likewise.
15507 * src/reduce.c: (inaccessable_symbols): Using if is better style
15508 than goto.
15509 Use `#if TRACE' instead of `#if 0' for tracing code.
15510
15511 2001-11-19 Akim Demaille <akim@epita.fr>
15512
15513 * src/system.h (LIST_FREE, shortcpy): New.
15514 * src/LR0.c: Use them.
15515 * src/output.c (free_itemsets, free_reductions, free_shifts):
15516 Remove, replaced by LIST_FREE.
15517
15518 2001-11-19 Akim Demaille <akim@epita.fr>
15519
15520 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
15521 (REDUCTIONS_ALLOC): New.
15522 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
15523 allocation.
15524
15525 2001-11-19 Akim Demaille <akim@epita.fr>
15526
15527 * src/LR0.c (new_state): Complete trace code.
15528 * src/nullable.c (set_nullable): Don't translate traces.
15529
15530 2001-11-19 Akim Demaille <akim@epita.fr>
15531
15532 * src/print_graph.c (print_core): Better locality of variables.
15533 * src/print.c (print_core): Likewise.
15534
15535 2001-11-19 Akim Demaille <akim@epita.fr>
15536
15537 * src/vcg.c: You do the output, so you are responsible of the
15538 handling of VCG syntax, in particular: use quotearg.
15539 * src/print_graph.c: Don't.
15540 (print_actions): Don't output the actions as part of the nodes,
15541 since that's the job of the edges.
15542 (print_state): Don't output by hand: fill the node description,
15543 and ask for its output.
15544
15545 2001-11-19 Akim Demaille <akim@epita.fr>
15546
15547 * src/bison.simple (yyparse): When verbosely reporting an error,
15548 no longer put additional quotes around token names.
15549 * tests/calc.at: Adjust.
15550
15551 2001-11-19 Akim Demaille <akim@epita.fr>
15552
15553 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
15554 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
15555 * src/output.c: Adjust.
15556
15557 2001-11-19 Akim Demaille <akim@epita.fr>
15558
15559 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
15560 (rule_t): this.
15561 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
15562
15563 2001-11-19 Akim Demaille <akim@epita.fr>
15564
15565 * src/gram.h (rule_t): New.
15566 (rule_table): New.
15567 (rrhs, rlhs): Remove, part of state_t.
15568 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
15569 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15570 * src/reader.c, src/reduce.c: Adjust.
15571
15572 2001-11-19 Akim Demaille <akim@epita.fr>
15573
15574 * src/reader.c (symbols_output): New, extracted from...
15575 (packsymbols): Here.
15576 (reader): Call it.
15577
15578 2001-11-19 Akim Demaille <akim@epita.fr>
15579
15580 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
15581 (maxrhs): this new function.
15582
15583 2001-11-19 Akim Demaille <akim@epita.fr>
15584
15585 * src/lalr.c (F): New macro to access the variable F.
15586 Adjust.
15587
15588 2001-11-19 Akim Demaille <akim@epita.fr>
15589
15590 * src/lalr.h (LA): New macro to access the variable LA.
15591 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15592 * src/lalr.c: Adjust.
15593
15594 2001-11-19 Akim Demaille <akim@epita.fr>
15595
15596 * src/lalr.c (initialize_LA): Only initialize LA. Let...
15597 (set_state_table): handle the `lookaheads' members.
15598
15599 2001-11-19 Akim Demaille <akim@epita.fr>
15600
15601 * src/lalr.h (lookaheads): Removed array, whose contents is now
15602 a member of...
15603 (state_t): this structure.
15604 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15605 Adjust.
15606
15607 2001-11-19 Akim Demaille <akim@epita.fr>
15608
15609 * src/lalr.h (consistent): Removed array, whose contents is now
15610 a member of...
15611 (state_t): this structure.
15612 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15613 Adjust.
15614
15615 2001-11-19 Akim Demaille <akim@epita.fr>
15616
15617 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
15618 contents are now members of...
15619 (state_t): this structure.
15620 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15621 Adjust.
15622
15623 2001-11-19 Akim Demaille <akim@epita.fr>
15624
15625 * src/lalr.h (state_t): New.
15626 (state_table): Be a state_t * instead of a core **.
15627 (accessing_symbol): Remove, part of state_t.
15628 * src/lalr.c: Adjust.
15629 (set_accessing_symbol): Merge into...
15630 (set_state_table): this.
15631 * src/print_graph.c, src/conflicts.c: Adjust.
15632
15633 2001-11-14 Akim Demaille <akim@epita.fr>
15634
15635 * tests/calc.at, tests/output.at, tests/regression.at,
15636 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
15637 now the tests are run in private dirs, therefore AC_CLEANUP and
15638 family can be simplified to 0-ary.
15639 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
15640 use abs. path to find config.h.
15641 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
15642 stderr, there can be way too much random noise.
15643 Instead pass -Werror to GCC and rely on the exit status.
15644 Reported by Wolfram Wagner.
15645
15646 2001-11-14 Akim Demaille <akim@epita.fr>
15647
15648 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
15649 defined only if yyoverflow is defined, to avoid `warning: unused
15650 variable `yyvs1''.
15651 Reported by The Test Suite.
15652
15653 2001-11-14 Akim Demaille <akim@epita.fr>
15654
15655 * src/print.c: Include reduce.h.
15656 Reported by Hans Aberg.
15657
15658 2001-11-14 Akim Demaille <akim@epita.fr>
15659
15660 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
15661 Revert a previous patch: these are really const.
15662 * src/conflicts.c (conflict_report): Additional useless pair of
15663 braces to pacify GCC's warnings for `if () if () {} else {}'.
15664 * src/lex.c (parse_percent_token): Replace equal_offset with
15665 arg_offset.
15666 arg is const.
15667 Be sure to strdup `arg' when used, since there is no reason for
15668 token_buffer not to change.
15669
15670 2001-11-14 Akim Demaille <akim@epita.fr>
15671
15672 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
15673 definition.
15674 * src/main.c (main): Use them.
15675 Suggested by Hans Aberg.
15676
15677 2001-11-12 Akim Demaille <akim@epita.fr>
15678
15679 * src/system.h (ngettext): Now that we use ngettext, be sure to
15680 provide a default definition when NLS are not used.
15681
15682 2001-11-12 Akim Demaille <akim@epita.fr>
15683
15684 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
15685 Use @kbd to denote user input.
15686 (Language and Grammar): ANSIfy the example.
15687 Adjust its layout for info/notinfo.
15688 (Location Tracking Calc): Output error messages to stderr.
15689 Output locations in a more GNUtically correct way.
15690 Fix a couple of Englishos.
15691 Adjust @group/@end group pairs.
15692
15693 2001-11-12 Akim Demaille <akim@epita.fr>
15694
15695 %expect was not functioning at all.
15696
15697 * src/conflicts.c (expected_conflicts): Set to -1.
15698 (conflict_report): Use ngettext.
15699 (conflicts_print): Check %expect and make its violation an error.
15700 * doc/bison.texinfo (Expect Decl): Adjust.
15701 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
15702 * tests/regression.at (%expect not enough, %expect right)
15703 (%expect too much): New.
15704
15705 2001-11-12 Akim Demaille <akim@epita.fr>
15706
15707 * tests/regression.at (Conflicts): Rename as...
15708 (Unresolved SR Conflicts): this.
15709 (Solved SR Conflicts): New.
15710
15711 2001-11-12 Akim Demaille <akim@epita.fr>
15712
15713 * src/reduce.c (print_results): Rename as...
15714 (reduce_output): This.
15715 Output to OUT, passed as argument, instead of output_obstack.
15716 (dump_grammar): Likewise.
15717 (reduce_free): New.
15718 Also free V1.
15719 (reduce_grammar): No longer call reduce_output, since...
15720 * src/print.c (print_results): do it.
15721 * src/main.c (main): Call reduce_free;
15722
15723 2001-11-12 Akim Demaille <akim@epita.fr>
15724
15725 * src/conflicts.c (print_reductions): Accept OUT as argument.
15726 Output to it, not to output_obstack.
15727 * src/print.c (print_actions): Adjust.
15728
15729 2001-11-12 Akim Demaille <akim@epita.fr>
15730
15731 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
15732 the result instead of using...
15733 (src_total, rrc_total, src_count, rrc_count): Remove.
15734 (any_conflicts): Remove.
15735 (print_conflicts): Split into...
15736 (conflicts_print, conflicts_output): New.
15737 * src/conflicts.h: Adjust.
15738 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
15739 * src/print.c (print_grammar): Issue `\n' between two rules.
15740 * tests/regression.at (Conflicts): New.
15741 Reported by Tom Lane.
15742
15743 2001-11-12 Akim Demaille <akim@epita.fr>
15744
15745 * tests/regression.at (Invalid input): Remove, duplicate with
15746 ``Invalid input: 1''.
15747
15748 2001-11-12 Akim Demaille <akim@epita.fr>
15749
15750 * tests/torture.at (AT_DATA_STACK_TORTURE)
15751 (Exploding the Stack Size with Alloca)
15752 (Exploding the Stack Size with Malloc): New.
15753
15754 2001-11-12 Akim Demaille <akim@epita.fr>
15755
15756 * src/bison.simple (YYSTACK_REALLOC): New.
15757 (yyparse) [!yyoverflow]: Use it and free the old stack.
15758 Reported by Per Allansson.
15759
15760 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
15761
15762 * src/bison.simple: Define type yystype instead of YYSTYPE, and
15763 define CPP macro, which substitute YYSTYPE by yystype.
15764 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
15765 with yyltype/YYLTYPE. This allows inclusion of the generated
15766 header within the parser if the compiler, such as GGC, accepts
15767 multiple equivalent #defines.
15768 From Akim.
15769
15770 2001-11-05 Akim Demaille <akim@epita.fr>
15771
15772 * src/reader.c (symbols_output): New, extracted from...
15773 (packsymbols): here.
15774 (reader): Adjust.
15775
15776 2001-11-05 Akim Demaille <akim@epita.fr>
15777
15778 * src/lex.c (parse_percent_token): s/quotearg/quote/.
15779
15780 2001-11-05 Akim Demaille <akim@epita.fr>
15781
15782 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
15783 pattern.
15784
15785 2001-11-05 Akim Demaille <akim@epita.fr>
15786
15787 * src/options.h (struct option_table_struct): set_flags is void*.
15788 * src/options.c (longopts): Support `--output' and `%output'.
15789 (usage): Adjust.
15790 * src/lex.h (tok_setopt): Remove, replaced with...
15791 (tok_intopt, tok_stropt): these new guys.
15792 * src/lex.c (getopt.h): Not needed.
15793 (token_buffer, unlexed_token_buffer): Not const.
15794 (percent_table): Promote `-' over `_' in directive names.
15795 Active `%name-prefix', `file-prefix', and `output'.
15796 (parse_percent_token): Accept possible arguments to directives.
15797 Promote `-' over `_' in directive names.
15798
15799 2001-11-04 Akim Demaille <akim@epita.fr>
15800
15801 * doc/bison.texinfo (Decl Summary): Split the list into
15802 `directives for grammars' and `directives for bison'.
15803 Sort'em.
15804 Add description of `%name-prefix', `file-prefix', and `output'.
15805 Promote `-' over `_' in directive names.
15806 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
15807 Simplify the description of `--name-prefix'.
15808 Promote `-' over `_' in directive names.
15809 Promote `--output' over `--output-file'.
15810 Fix the description of `--defines'.
15811 * tests/output.at: Exercise %file-prefix and %output.
15812
15813 2001-11-02 Akim Demaille <akim@epita.fr>
15814
15815 * doc/refcard.tex: Update.
15816
15817 2001-11-02 Akim Demaille <akim@epita.fr>
15818
15819 * src/symtab.h (SUNDEF): New.
15820 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
15821 stand for `uninitialized', instead of 0.
15822 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
15823 * src/lex.c (lex): Adjust.
15824
15825 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
15826 Number it 0.
15827 Let yylex return it instead of a plain 0.
15828 Reported by Dick Streefland.
15829
15830 2001-11-02 Akim Demaille <akim@epita.fr>
15831
15832 * tests/regression.at (Mixing %token styles): New test.
15833
15834 2001-11-02 Akim Demaille <akim@epita.fr>
15835
15836 * src/reader.c (parse_thong_decl): Formatting changes.
15837 (token_translations_init): New, extracted from...
15838 (packsymbols): Here.
15839 Adjust.
15840
15841 2001-11-01 Akim Demaille <akim@epita.fr>
15842
15843 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
15844 Check that `9foo.y' produces correct cpp guards.
15845 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
15846 guards.
15847 Reported by Wwp.
15848
15849 2001-11-01 Akim Demaille <akim@epita.fr>
15850
15851 * tests/regression.at (Invalid input: 2): New.
15852 * src/lex.c (unlexed_token_buffer): New.
15853 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
15854 too.
15855 Reported by Wwp.
15856
15857 2001-11-01 Akim Demaille <akim@epita.fr>
15858
15859 * tests/calc.at: Catch up with 1.30.
15860 * configure.in: Bump to 1.49a.
15861 Adjust to newer Autotest.
15862
15863 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
15864
15865 * src/conflicts.c: Move global variables rrc_total and src_total ...
15866 (print_conflicts): here.
15867 * src/output.c (output): Free global variable user_toknums.
15868 * src/lex.c (token_obstack): Become static.
15869
15870 2001-10-18 Akim Demaille <akim@epita.fr>
15871
15872 * tests/atlocal.in (GCC): Add.
15873 * tests/calc.at: s/m4_match/m4_bmatch/.
15874 s/m4_patsubst/m4_bpatsubst/.
15875 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
15876 * configure.in: AC_SUBST(GCC).
15877
15878 2001-10-14 Marc Autret <autret_m@epita.fr>
15879
15880 * src/options.c (create_long_option_table): Fix.
15881
15882 2001-10-10 Akim Demaille <akim@epita.fr>
15883
15884 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
15885
15886 2001-10-04 Akim Demaille <akim@epita.fr>
15887
15888 * src/reader.c (parse_union_decl): Push the caracters in
15889 union_obstack, not attrs_obstack.
15890
15891 2001-10-04 Akim Demaille <akim@epita.fr>
15892
15893 Merge in the branch 1.29.
15894
15895 * src/reader.c (packsymbols): Use a temporary obstack for
15896 `%%tokendef', since output_stack is already used elsewhere.
15897
15898 2001-10-02 Akim Demaille <akim@epita.fr>
15899
15900 Bump 1.29d.
15901
15902 2001-10-02 Akim Demaille <akim@epita.fr>
15903
15904 Version 1.29c.
15905
15906 2001-10-02 Akim Demaille <akim@epita.fr>
15907
15908 * tests/regression.at (Invalid CPP headers): New.
15909 From Alexander Belopolsky.
15910 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
15911
15912 2001-10-02 Akim Demaille <akim@epita.fr>
15913
15914 * tests/regression.at (Invalid input): New.
15915 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
15916 Reported by Shura.
15917
15918 2001-10-02 Akim Demaille <akim@epita.fr>
15919
15920 * tests/calc.at: Now that --debug works, the tests must be adjusted.
15921
15922 2001-10-02 Akim Demaille <akim@epita.fr>
15923
15924 * src/output.c (output_parser): Assert `skeleton'.
15925 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
15926 systems.
15927 From Shura.
15928
15929 2001-10-01 Marc Autret <autret_m@epita.fr>
15930
15931 * src/lex.h: Echo modifications.
15932 * src/lex.c (unlex): Parameter is now token_t.
15933 From Hans Aberg.
15934
15935 2001-10-01 Marc Autret <autret_m@epita.fr>
15936
15937 * src/main.c: Include lex.h.
15938 From Hans Aberg.
15939
15940 2001-09-29 Akim Demaille <akim@epita.fr>
15941
15942 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
15943
15944 2001-09-28 Akim Demaille <akim@epita.fr>
15945
15946 * tests/testsuite.at: Update to newer Autotest.
15947 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
15948
15949 2001-09-27 Akim Demaille <akim@epita.fr>
15950
15951 Position independent wrapper.
15952
15953 * tests/bison: Remove.
15954 * tests/bison.in: New.
15955 * configure.in: Adjust.
15956
15957 2001-09-27 Paul Eggert <eggert@twinsun.com>
15958
15959 Port quotearg fixes from tar 1.13.24.
15960
15961 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
15962 tm to be declared.
15963 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
15964 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
15965
15966 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
15967 * m4/mbrtowc.m4: New file.
15968 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
15969 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
15970
15971 2001-09-27 Akim Demaille <akim@epita.fr>
15972
15973 Bump to 1.29c.
15974
15975 2001-09-27 Akim Demaille <akim@epita.fr>
15976
15977 Version 1.29b.
15978
15979 2001-09-25 Akim Demaille <akim@epita.fr>
15980
15981 * src/system.h: Include `xalloc.h'.
15982 Remove it from the C files.
15983 * src/files.c (output_files): Free the obstacks.
15984 * src/lex.c (init_lex): Rename as...
15985 (lex_init): this.
15986 (lex_free): New.
15987 * src/main.c (main): Use it.
15988
15989 2001-09-24 Marc Autret <autret_m@epita.fr>
15990
15991 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
15992 to output informations in fout (FILE*).
15993 (open_graph, close_graph): Likewise.
15994 (output_graph, output_edge, output_node): Likewise.
15995 * src/vcg.h: Update function prototypes.
15996 * src/print_graph.c (print_graph): Open output graph file.
15997 (print_actions): Adjust.
15998 * src/files.h: Remove extern declaration.
15999 * src/files.c: Remove graph_obstack declaration.
16000 (open_files): Remove graph_obstack initialization.
16001 (output_files): Remove graph_obstack saving.
16002
16003 2001-09-24 Marc Autret <autret_m@epita.fr>
16004
16005 * src/files.c (compute_output_file_names): Fix.
16006
16007 2001-09-24 Marc Autret <autret_m@epita.fr>,
16008 Akim Demaille <akim@epita.fr>
16009
16010 * src/reader.c (reader): Remove call to free_symtab ().
16011 * src/main.c (main): Call it here.
16012 Include symtab.h.
16013 * src/conflicts.c (initialize_conflicts): Rename as...
16014 (solve_conflicts): this.
16015 * src/print.c (print_core, print_actions, print_state)
16016 (print_grammar): Dump to a file instead a `output_obstack'.
16017 (print_results): Dump `output_obstack', and then proceed with the
16018 FILE *.
16019 * src/files.c (compute_output_file_names, close_files): New.
16020 (output_files): Adjust.
16021 * src/main.c (main): Adjust.
16022
16023 2001-09-23 Marc Autret <autret_m@epita.fr>
16024
16025 * src/files.c (compute_header_macro): Computes header macro name
16026 from spec_defines_file when given.
16027
16028 2001-09-23 Marc Autret <autret_m@epita.fr>
16029
16030 * src/files.c (output_files): Add default extensions.
16031
16032 2001-09-22 Akim Demaille <akim@epita.fr>
16033
16034 * src/conflicts.c (finalize_conflicts): Rename as...
16035 (free_conflicts): this.
16036
16037 2001-09-22 Akim Demaille <akim@epita.fr>
16038
16039 * src/gram.c (gram_free): Rename back as...
16040 (dummy): this.
16041 (output_token_translations): Free `token_translations'.
16042 * src/symtab.c (free_symtab): Free the tag field.
16043
16044 2001-09-22 Akim Demaille <akim@epita.fr>
16045
16046 Remove `translations' as it is always set to true.
16047
16048 * src/gram.h: Adjust.
16049 * src/reader.c (packsymbols, parse_token_decl): Adjust
16050 * src/print.c (print_grammar): Adjust.
16051 * src/output.c (output_token_translations): Adjust.
16052 * src/lex.c (lex): Adjust.
16053 * src/gram.c: Be sure the set pointers to NULL.
16054 (dummy): Rename as...
16055 (gram_free): this.
16056
16057 2001-09-22 Akim Demaille <akim@epita.fr>
16058
16059 * configure.in: Invoke AM_LIB_DMALLOC.
16060 * src/system.h: Use dmalloc.
16061 * src/LR0.c: Be sure to have pointers initialized to NULL.
16062 (allocate_itemsets): Allocate kernel_items only if needed.
16063
16064 2001-09-22 Akim Demaille <akim@epita.fr>
16065
16066 * configure.in: Bump to 1.29b.
16067 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
16068 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
16069 need xmalloc.c in calc.y.
16070 From Pascal Bart.
16071
16072 2001-09-21 Akim Demaille <akim@epita.fr>
16073
16074 Version 1.29a.
16075 * Makefile.maint, config/config.guess, config/config.sub,
16076 * config/missing: Update from masters.
16077 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
16078 upon package.m4.
16079 * configure.in (ALL_LINGUAS): Add `tr'.
16080
16081 2001-09-21 Akim Demaille <akim@epita.fr>
16082
16083 * tests/Makefile.am (package.m4): Move to...
16084 ($(srcdir)/$(TESTSUITE)): here.
16085
16086 2001-09-20 Akim Demaille <akim@epita.fr>
16087
16088 * src/complain.c: No longer try to be standalone: use system.h.
16089 Don't assume __STDC__ is defined to 1. Just test if it is defined.
16090 * src/complain.h: Likewise.
16091 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
16092 Remove the unused variable `n'.
16093 From Albert Chin-A-Young.
16094
16095 2001-09-18 Marc Autret <autret_m@epita.fr>
16096
16097 * doc/bison.1: Update.
16098 * doc/bison.texinfo (Bison Options): Update --defines and --graph
16099 descriptions.
16100 (Option Cross Key): Update.
16101 Add --graph.
16102
16103 2001-09-18 Marc Autret <autret_m@epita.fr>
16104
16105 * tests/regression.at: New test (comment in %union).
16106
16107 2001-09-18 Marc Autret <autret_m@epita.fr>
16108
16109 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
16110 do that.
16111 Reported by Keith Browne.
16112
16113 2001-09-18 Marc Autret <autret_m@epita.fr>
16114
16115 * tests/output.at: Add tests for --defines and --graph.
16116
16117 2001-09-18 Marc Autret <autret_m@epita.fr>
16118
16119 * tests/output.at: Removes tests of %{header,src}_extension features.
16120
16121 2001-09-18 Akim Demaille <akim@epita.fr>
16122
16123 * tests/Makefile.am (package.m4): New.
16124 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
16125 (_AT_CHECK_CALC_ERROR): Likewise.
16126 Factor the `, ' part of verbose error messages.
16127
16128 2001-09-18 Marc Autret <autret_m@epita.fr>
16129
16130 * src/getargs.c (longopts): Declare --defines and --graph as options
16131 with optional arguments.
16132 * src/files.h: Add extern declarations.
16133 * src/files.c (spec_graph_file, spec_defines_file): New.
16134 (output_files): Update.
16135 Remove CPP-outed code.
16136
16137 2001-09-18 Marc Autret <autret_m@epita.fr>
16138
16139 Turn off %{source,header}_extension feature.
16140
16141 * src/files.c (compute_exts_from_gf): Update.
16142 (compute_exts_from_src): Update.
16143 (output_files): CPP-out useless code.
16144 * src/files.h: Remove {header,source}_extension extern declarations.
16145 * src/reader.c (parse_dquoted_param): CPP-out.
16146 (parse_header_extension_decl): Remove.
16147 (parse_source_extension_decl): Remove.
16148 (read_declarations): Remove cases tok_{hdrext,srcext}.
16149 * src/lex.c (percent_table): Remove {header,source}_extension entries.
16150 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
16151
16152 2001-09-10 Akim Demaille <akim@epita.fr>
16153
16154 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
16155 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
16156 (AT_CHECK_OUTPUT): this.
16157 Merely check ls' exit status, its output is useless.
16158
16159 2001-09-10 Akim Demaille <akim@epita.fr>
16160
16161 * tests/calc.at: Use m4_match.
16162 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
16163
16164 2001-09-10 Marc Autret <autret_m@epita.fr>,
16165 Akim Demaille <akim@epita.fr>
16166
16167 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
16168 enum color_e.
16169 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
16170 to `normal'.
16171 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
16172 * src/lex.h: Adjust prototype.
16173 (token_t): Add `tok_undef'.
16174 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
16175 (parse_percent_token): Now returns token_t.
16176 Add default statement in switch.
16177 (lex): Separate `c' as an input variable, from the token_t result
16178 part.
16179 (unlexed): Is a token_t.
16180
16181 2001-09-10 Akim Demaille <akim@epita.fr>
16182
16183 * configure.in: Bump to 1.29a.
16184
16185 2001-09-07 Akim Demaille <akim@epita.fr>
16186
16187 Version 1.29.
16188
16189 2001-08-30 Akim Demaille <akim@epita.fr>
16190
16191 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
16192 * m4/atconfig.m4: Remove.
16193 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
16194 * tests/bison: New.
16195 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
16196 m4_if, m4_patsubst, and m4_regexp.
16197 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
16198 `input' file instead of echo.
16199
16200 2001-08-29 Akim Demaille <akim@epita.fr>
16201
16202 Bump to 1.28e.
16203
16204 2001-08-29 Akim Demaille <akim@epita.fr>
16205
16206 Version 1.28d.
16207
16208 2001-08-29 Paul Eggert <eggert@twinsun.com>
16209
16210 * src/bison.simple (yyparse): Don't take the address of an
16211 item before the start of an array, as that doesn't conform to
16212 the C Standard.
16213
16214 2001-08-29 Robert Anisko <anisko_r@epita.fr>
16215
16216 * doc/bison.texinfo (Location Tracking Calc): New node.
16217
16218 2001-08-29 Paul Eggert <eggert@twinsun.com>
16219
16220 * src/output.c (output): Do not define const, as this now
16221 causes more problems than it cures.
16222
16223 2001-08-29 Akim Demaille <akim@epita.fr>
16224
16225 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
16226 the nodes.
16227 Be sure to tag the `detailmenu'.
16228
16229 2001-08-29 Akim Demaille <akim@epita.fr>
16230
16231 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
16232 download in a tmp dir.
16233
16234 2001-08-28 Marc Autret <autret_m@epita.fr>
16235
16236 * config/depcomp: New file.
16237
16238 2001-08-28 Marc Autret <autret_m@epita.fr>
16239
16240 * doc/bison.1 (mandoc): Adjust.
16241 From Juan Manuel Guerrero.
16242
16243 2001-08-28 Marc Autret <autret_m@epita.fr>
16244
16245 * src/print_graph.c (print_state): Fix.
16246
16247 2001-08-27 Marc Autret <autret_m@epita.fr>
16248
16249 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
16250 char * members.
16251 Echo modifications to the functions prototypes.
16252 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
16253
16254 2001-08-27 Marc Autret <autret_m@epita.fr>
16255
16256 * src/vcg.c: Include `xalloc.h'.
16257 (add_colorentry): New.
16258 (add_classname): New.
16259 (add_infoname): New.
16260 * src/vcg.h: Add new prototypes.
16261
16262 2001-08-27 Akim Demaille <akim@epita.fr>
16263
16264 * Makefile.maint: Sync. again with CVS Autoconf.
16265
16266 2001-08-27 Akim Demaille <akim@epita.fr>
16267
16268 * Makefile.maint: Formatting changes.
16269 (po-update, cvs-update, update): New targets.
16270 (AMTAR): Remove.
16271
16272 2001-08-27 Akim Demaille <akim@epita.fr>
16273
16274 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16275 * Makefile.maint: Sync. with CVS Autoconf.
16276
16277 2001-08-27 Marc Autret <autret_m@epita.fr>
16278
16279 * src/vcg.h (struct infoname_s): New.
16280 (struct colorentry_s): New.
16281 (graph_s): New fields {vertical,horizontal}_order in structure.
16282 Add `infoname' field.
16283 Add `colorentry' field;
16284 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
16285 (G_HORIZONTAL_ORDER): New.
16286 (G_INFONAME): New.
16287 (G_COLORENTRY): New.
16288 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
16289 Add output of `infoname'.
16290 Add output of `colorentry'.
16291
16292 2001-08-27 Marc Autret <autret_m@epita.fr>
16293
16294 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
16295 This one shadowed a global parameter.
16296
16297 2001-08-24 Marc Autret <autret_m@epita.fr>
16298
16299 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
16300 instead of `unsigned'.
16301 (print_state): Do not call obstack_object_size () in obstack_grow ()
16302 to avoid macro variables shadowing.
16303
16304 2001-08-23 Marc Autret <autret_m@epita.fr>
16305
16306 * src/lex.c (percent_table): Typo: s/naem/name/.
16307 Add graph option.
16308 Normalize new options declarations.
16309
16310 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
16311
16312 * tests/suite.at: Exercise %header_extension and %source_extension.
16313
16314 2001-08-16 Marc Autret <autret_m@epita.fr>
16315
16316 * src/reader.c (parse_dquoted_param): New.
16317 (parse_header_extension_decl): Use it.
16318 (parse_source_extension_decl): Likewise.
16319
16320 2001-08-16 Marc Autret <autret_m@epita.fr>
16321
16322 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
16323 (get_xxxx_str): Use assert () instead of complain ().
16324 Remove return invokations in default cases.
16325 (get_decision_str): Modify default behaviour. Remove second argument.
16326 Echo modifications on calls.
16327 (output_graph): Fix.
16328
16329 2001-08-16 Marc Autret <autret_m@epita.fr>
16330
16331 * src/getargs.c (usage): Update with ``-g, --graph''.
16332
16333 2001-08-16 Marc Autret <autret_m@epita.fr>
16334
16335 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
16336 (Option Cross Key): Likewise.
16337 * doc/bison.1: Update.
16338
16339 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
16340
16341 * src/output.c (output_master_parser): Don't finish action_obstack.
16342 (output_parser): Don't care about the muscle action, here.
16343 (prepare): Copy the action_obstack in the action muscle.
16344 (output): Free action_obstack.
16345
16346 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
16347
16348 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
16349 will contain `%union' declaration.
16350 (parse_union_decl): Delete #line directive output.
16351 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
16352 informations about %union.
16353 (parse_union_decl): Copy the union_obstack in the muscle stype.
16354 * src/bison.simple: Add new #line directive.
16355 Add typdef %%stype YYSTYPE.
16356
16357 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
16358
16359 * src/bison.simple: Add new `#line' directive.
16360
16361 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
16362
16363 * src/bison.simple: New `#line' directive.
16364 * src/output.c (output_parser): Support new dynamic muscle input_line.
16365
16366 2001-09-22 Marc Autret <autret_m@epita.fr>
16367
16368 * src/output.c (output_master_parser): New.
16369 (output_parser): Be more re-entrant.
16370
16371 2001-09-21 Marc Autret <autret_m@epita.fr>
16372
16373 * src/reader.c (copy_definition, parse_union_decl): Update and use
16374 `linef' muscle.
16375 (copy_action): Likewise.
16376 Use obstack_1grow ().
16377 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
16378
16379 2001-09-21 Marc Autret <autret_m@epita.fr>
16380
16381 * src/options.c (option_table): Adjust.
16382 * src/lex.c (parse_percent_token): Fix.
16383
16384 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
16385
16386 * src/options.c (symtab.h): Include it, need by lex.h.
16387
16388 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
16389
16390 * src/lex.c (parse_percent_token): Change type of variable `tx', which
16391 is now an option_table_struct*.
16392 (option_strcmp): New function option_strcmp.
16393 (parse_percent_token): Call option_strcmp.
16394 * src/getargs.c (xalloc.h, options.h): Include it.
16395 (getargs): Call create_long_option_table.
16396 (getargs): Free longopts at the end of the function.
16397 (shortopts): Move in options.c.
16398 * src/options.c (create_long_option_table): New function. Convert
16399 information from option_table to option structure.
16400 * src/reader.c (options.h): Include it.
16401
16402 * src/Makefile.am: Adjust.
16403 * src/options.c (option_table): Create from longopts and percent_table.
16404 * src/getargs.c (longopts): Delete.
16405 * src/lex.c (struct percent_table_struct): Delete.
16406 (percent_table): Delete.
16407 (options.h): Include it.
16408 * src/options.c: Create.
16409 * src/options.h: Create.
16410 Declare enum opt_access_e.
16411 Define struct option_table_struct.
16412
16413 2001-09-20 Marc Autret <autret_m@epita.fr>
16414
16415 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
16416 sections of Bison.
16417
16418 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
16419
16420 * src/bison.simple: s/%%filename/%%skeleton.
16421 * src/muscle_tab.c (getargs.h): Include it.
16422 (muscle_init): Insert new muscle skeleton.
16423
16424 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
16425
16426 * src/output.c (output_parser): Delete unused variable actions_dumped.
16427
16428 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
16429
16430 * src/output.c (output): Delete call to reader_output_yylsp.
16431 * src/reader.c (reader): Likewise.
16432 * src/reader.h: Delete declaration of reader_output_yylsp.
16433
16434 2001-09-02 Marc Autret <autret_m@epita.fr>
16435
16436 * src/reader.c: Include muscle_tab.h.
16437 (parse_union_decl): Update.
16438 (parse_macro_decl): Rename parse_muscle_decl.
16439 Update to use renamed functions and variable.
16440 (read_declarations, copy_action, read_additionnal_code, : Updated
16441 with correct variables and functions names.
16442 (packsymbols, reader): Likewise.
16443
16444 * src/reader.h (muscle_obstack): Extern declaration update.
16445
16446 * src/output.c: Include muscle_tab.h
16447 In all functions using macro_insert, change by using muscle_insert ().
16448 (macro_obstack): Rename muscle_obstack.
16449 Echo modifications in the whole file.
16450 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
16451 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
16452 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
16453
16454 * src/muscle_tab.h: Update double inclusion macros.
16455 (macro_entry_s): Rename muscle_entry_s.
16456 Update prototypes.
16457
16458 * src/muscle_tab.c: Include muscle_tab.h.
16459 Rename macro_tabble to muscle_table.
16460 (mhash1, mhash2, mcmp): Use muscle_entry.
16461 (macro_init): Rename muscle_init. Update.
16462 (macro_insert): Rename muscle_insert. Update.
16463 (macro_find): Rename muscle_find. Update.
16464
16465 * src/main.c: Include muscle_tab.h.
16466 (main): Call muscle_init ().
16467 * src/Makefile.am (bison_SOURCES): Echo modifications.
16468
16469 2001-09-02 Marc Autret <autret_m@epita.fr>
16470
16471 Now the files macro_tab.[ch] are named muscle_tab.[ch].
16472
16473 * src/muscle_tab.c, src/muscle_tab.h: Add files.
16474
16475 2001-09-02 Marc Autret <autret_m@epita.fr>
16476
16477 * src/macrotab.c, src/macrotab.h: Remove.
16478
16479 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
16480
16481 * src/reader.c (copy_guard): Use muscle to specify the `#line'
16482 filename.
16483
16484 2001-09-01 Marc Autret <autret_m@epita.fr>
16485
16486 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
16487 to an explicit value to activate the feature. We do it here.
16488
16489 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16490
16491 * src/output.c (prepare): Delete the `filename' muscule insertion.
16492 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
16493 (parse_union_decl): Likewise.
16494 * src/macrotab.c (macro_init): Initialize filename by infile.
16495
16496 2001-08-31 Marc Autret <autret_m@epita.fr>
16497
16498 * src/bison.simple (YYLSP_NEEDED): New definition.
16499 * src/output.c (prepare): Add macro insertion of `locations_flag'
16500
16501 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16502
16503 * src/output.c (prepare): Delete insertion of previous muscles,
16504 and insert the `prefix' muscles.
16505 * src/macrotab.c (macro_init): Likewise.
16506 (macro_init): Initialization prefix directive by `yy'.
16507 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
16508 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
16509 yylval, yydebug, yyerror, yynerrs and yyparse.
16510 New directive `#define' to substitute yydebug, ... with option
16511 name_prefix.
16512
16513 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16514
16515 * src/main.c (main): Standardize.
16516 * src/output.c (output_table_data, output_parser): Likewise.
16517 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
16518
16519 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
16520
16521 * src/reader.c (read_additionnal_code): Rename %%user_code to
16522 %%epilogue.
16523 * src/output.c (output): Rename %%declarations to %%prologue.
16524 * src/bison.simple: Echo modifications.
16525
16526 2001-08-31 Marc Autret <autret_m@epita.fr>
16527
16528 * src/reader.c (readgram): CleanUp.
16529 (output_token_defines): Likewise.
16530 (packsymbols): Likewise.
16531 (reader): Likewise.
16532 * src/output.c (output): CPP-out useless code.
16533
16534 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16535
16536 * src/reader.c (reader): Delete obsolete call to function
16537 output_trailers and output_headers.
16538 * src/output.h: Remove obsolete functions prototypes of output_headers
16539 and output_trailers.
16540
16541 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
16542
16543 * src/main.c: Include macrotab.h.
16544 * src/macrotab.h (macro_entry_s): Constify fields.
16545 Adjust functions prototypes.
16546 * src/macrotab.c (macro_insert): Constify key and value.
16547 (macro_find): Constify key.
16548 (macro_insert): Include 'xalloc.h'
16549 (macro_insert): Use XMALLOC.
16550 (macro_find): Constify return value.
16551 * src/output.c (output_table_data): Rename table to table_data.
16552 (output_parser): Constify macro_key, macro_value.
16553
16554 2001-08-30 Marc Autret <autret_m@epita.fr>
16555
16556 * src/reader.c (parse_skel_decl): New.
16557 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
16558 * src/lex.h (token_t): New token `tok_skel'.
16559 * src/lex.c (percent_table): Add skeleton option entry.
16560 Standardize.
16561
16562 2001-08-29 Marc Autret <autret_m@epita.fr>
16563
16564 * src/bison.simple: Add %%user_code directive at the end.
16565 * src/reader.c (read_additionnal_code): New.
16566 (reader): Use it.
16567 * src/output.c (output_program): Remove.
16568 (output): Update.
16569
16570 2001-08-28 Marc Autret <autret_m@epita.fr>
16571
16572 * src/output.c (output_actions): Clean up.
16573 (output_gram): CPP-out useless code.
16574 * src/reader.c (reader): Clean up, CPP-out useless code.
16575
16576 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
16577
16578 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
16579 directive.
16580 * src/bison.simple: Add `%%definitions'.
16581
16582 2001-08-28 Marc Autret <autret_m@epita.fr>
16583
16584 * config/depcomp: New file.
16585
16586 2001-08-27 Paul Eggert <eggert@twinsun.com>
16587
16588 * src/bison.simple (yyparse): Don't take the address of an
16589 item before the start of an array, as that doesn't conform to
16590 the C Standard.
16591
16592 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
16593
16594 * src/output.c (output): Remove the initialization of the macro
16595 obstack. It was done too late here.
16596
16597 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
16598 completely wrong.
16599 (reader): Initialize the macro obstack here, since we need it to grow
16600 '%define' directives.
16601
16602 * src/reader.h: Declare the macro obstack as extern.
16603
16604 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
16605
16606 * src/output.c (output_parser): Fix. Store single '%' characters in
16607 the output obstack instead of throwing them away.
16608
16609 2001-08-27 Akim Demaille <akim@epita.fr>
16610
16611 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16612
16613 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16614
16615 * lib/Makefile.am: Adjust.
16616
16617 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16618
16619 * src/bison.simple: Update and add '%%' directives.
16620
16621 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16622
16623 * src/reader.c (reader): Remove calls to 'output_headers' and
16624 'output_trailers'. Remove some C output.
16625 (readgram): Disable a piece of code that was writing a default
16626 definition for 'YYSTYPE'.
16627 (reader_output_yylsp): Remove.
16628 (packsymbols): Output token defintions to a macro.
16629 (copy_definition): Disable C output.
16630
16631 * src/reader.c (parse_macro_decl): New function used to parse macro
16632 declarations.
16633 (copy_string2): Put the body of copy_string into this new function.
16634 Add a parameter to let the caller choose whether he wants to copy the
16635 string delimiters or not.
16636 (copy_string): Be a simple call to copy_string2 with the last argument
16637 bound to true.
16638 (read_declarations): Add case for macro definition.
16639 (copy_identifier): New.
16640 (parse_macro_decl): Read macro identifiers using copy_identifier
16641 rather than lex.
16642
16643 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16644
16645 * src/output.c (prepare): Add prefixed names.
16646 (output_parser): Output semantic actions.
16647 (output_parser): Fix bug on '%%line' directives.
16648
16649 * src/output.c (output_headers): Remove. The C code printed by this
16650 function should now be in the skeletons.
16651 (output_trailers): Remove.
16652 (output): Disable call to 'reader_output_yylsp'.
16653 (output_rule_data): Do not output tables to the table obstack.
16654
16655 * src/output.c: Remove some C dedicated output.
16656 Improve the use of macro and output obstacks.
16657 (output_defines): Remove.
16658
16659 * src/output.c (output_token_translations): Associate 'translate'
16660 table with a macro. No output to the table obstack.
16661 (output_gram): Same for 'rhs' and 'prhs'.
16662 (output_stos): Same for 'stos'.
16663 (output_rule_data): Same for 'r1' and 'r2'.
16664 (token_actions): Same for 'defact'.
16665 (goto_actions): Same for 'defgoto'.
16666 (output_base): Same for 'pact' and 'pgoto'.
16667 (output_table): Same for 'table'.
16668 (output_check): Same for 'check'.
16669
16670 * src/output.c (output_table_data): New function.
16671 (output_short_table): Remove.
16672 (output_short_or_char_table): Remove.
16673
16674 * src/output.c (output_parser): Replace most of the skeleton copy code
16675 with something new. Skeletons are now processed character by character
16676 rather than line by line, and Bison looks for '%%' macros. This is the
16677 first step in making Bison's output process (a lot) more flexible.
16678 (output_parser): Use the macro table.
16679
16680 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16681
16682 * src/main.c (main): Initialize the macro table.
16683
16684 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16685
16686 * src/lex.c (percent_table): Add tok_define.
16687 * src/lex.h: Add tok_define.
16688
16689 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16690
16691 * src/macrotab.c: New file.
16692 * src/macrotab.h: New file.
16693 * src/Makefile.am: Update.
16694
16695 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16696
16697 * lib/hash.c: New file.
16698 * lib/hash.h: New file.
16699 * lib/Makefile.am: Update.
16700
16701 2001-08-15 Akim Demaille <akim@epita.fr>
16702
16703 Version 1.28c.
16704
16705 2001-08-15 Marc Autret <autret_m@epita.fr>
16706
16707 * src/reader.c (readgram): Indent output macro YYSTYPE.
16708 (packsymbols): Likewise.
16709 (output_token_defines): Likewise.
16710 * src/files.c: Standardize.
16711 (compute_header_macro): New.
16712 (defines_obstack_save): New. Use compute_header_macro.
16713 (output_files): Update. Use defines_obstack_save.
16714
16715 2001-08-15 Akim Demaille <akim@epita.fr>
16716
16717 * doc/bison.texinfo (Table of Symbols): Document
16718 YYSTACK_USE_ALLOCA.
16719
16720 2001-08-15 Akim Demaille <akim@epita.fr>
16721
16722 * missing: Update from CVS Automake.
16723 * config/config.guess, config/config.sub, config/texinfo.tex:
16724 Update from gnu.org.
16725
16726 2001-08-15 Akim Demaille <akim@epita.fr>
16727
16728 * Makefile.maint: Sync with CVS Autoconf.
16729
16730 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
16731
16732 * doc/bison.texinfo: Include GNU Free Documentation License from
16733 `fdl.texi'.
16734 * doc/fdl.texi: Add to package.
16735
16736 2001-08-14 Marc Autret <autret_m@epita.fr>
16737
16738 Turn on %{source,header}_extension features.
16739
16740 * src/lex.c (percent_table): Un-CPP out header_extension and
16741 source_extension.
16742 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
16743 (compute_exts_from_src): Remove conditions. It restores priorities
16744 between options.
16745
16746 2001-08-14 Marc Autret <autret_m@epita.fr>
16747
16748 * src/files.c (compute_base_names): Add extensions computing when
16749 `--file-prefix' used.
16750 Standardize function calls.
16751
16752 2001-08-13 Marc Autret <autret_m@epita.fr>
16753
16754 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
16755 defining it (defined but null disables alloca).
16756
16757 2001-08-13 Marc Autret <autret_m@epita.fr>
16758
16759 * src/bison.simple (_yy_memcpy): CPP reformat.
16760
16761 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
16762
16763 * tests/atconfig.in (CPPFLAGS): Fix.
16764
16765 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
16766
16767 * doc/bison.texinfo: Include GNU General Public License from
16768 `gpl.texi'.
16769 * doc/gpl.texi: Add to package.
16770
16771 2001-08-10 Marc Autret <autret_m@epita.fr>
16772
16773 * src/print_graph.h: Fix.
16774 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
16775
16776 2001-08-10 Akim Demaille <akim@epita.fr>
16777
16778 * src/system.h: Provide default declarations for stpcpy, strndup,
16779 and strnlen.
16780
16781 2001-08-10 Robert Anisko <anisko_r@epita.fr>
16782
16783 * doc/bison.texinfo (Locations): Update @$ stuff.
16784
16785 2001-08-09 Robert Anisko <anisko_r@epita.fr>
16786
16787 * src/bison.simple (YYLLOC_DEFAULT): Update.
16788 (yyparse): Adjust.
16789
16790 2001-08-08 Marc Autret <autret_m@epita.fr>
16791
16792 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
16793 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
16794 Reported by Fabrice Bauzac.
16795
16796 2001-08-08 Marc Autret <autret_m@epita.fr>
16797
16798 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
16799 * src/vcg.c (output_node): Fix.
16800 * src/vcg.h: Cleanup.
16801 * src/print_graph.c: Add comments.
16802 (node_output_size): New global variable. Simplify the formatting of
16803 the VCG graph output.
16804 (print_actions): Unused code is now used. It notifies the final state
16805 and no action states in the VCG graph. It also give the reduce actions.
16806 The `shift and goto' edges are red and the `go to state' edges are
16807 blue.
16808 Get the current node name and node_obstack by argument.
16809 (node_obstack): New variable.
16810 (print_state): Manage node_obstack.
16811 (print_core): Use node_obstack given by argument.
16812 A node is not only computed here but in print_actions also.
16813 (print_graph): CPP out useless code instead of commenting it.
16814
16815 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
16816
16817 * tests/atconfig.in (CPPFLAGS): Fix.
16818
16819 2001-08-07 Akim Demaille <akim@epita.fr>
16820
16821 * src/print_graph.c (quote): New.
16822 (print_core): Use it.
16823
16824 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
16825
16826 * src/vcg.c (complain.h): Include it.
16827 Unepitaize `return' invocations.
16828 [NDEBUG] (main): Remove.
16829 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
16830 * src/files.c (open_files): Initialize graph_obstack.
16831 * src/print_graph.c (print_actions): CPP out useless code.
16832 (print_core): Don't output the last `\n' in labels.
16833 Use `quote'.
16834 * src/files.c (output_files): Output the VCG file.
16835 * src/main.c (main): Invoke print_graph ();
16836
16837 2001-08-06 Marc Autret <autret_m@epita.fr>
16838
16839 Automaton VCG graph output.
16840 Using option ``-g'' or long option ``--graph'', you can generate
16841 a gram_filename.vcg file containing a VCG description of the LALR (1)
16842 automaton of your grammar.
16843
16844 * src/main.c: Call to print_graph() function.
16845 * src/getargs.h: Update.
16846 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
16847 (graph_flag): New flag.
16848 (longopts): Update.
16849 (getargs): Add case `g'.
16850 * src/files.c (graph_obstack): New obstack struct.
16851 (open_files): Initialize new obstack.
16852 (output_files): Saves graph_obstack if required.
16853 * src/files.h (graph_obstack): New extern declaration.
16854 * src/Makefile.am: Add new source files.
16855
16856 2001-08-06 Marc Autret <autret_m@epita.fr>
16857
16858 * src/print_graph.c, src/print_graph.h (graph): New.
16859 * src/vcg.h: New file.
16860 * src/vcg.c: New file, VCG graph handling.
16861
16862 2001-08-06 Marc Autret <autret_m@epita.fr>
16863
16864 Add of %source_extension and %header_extension which specify
16865 the source or/and the header output file extension.
16866
16867 * src/files.c (compute_base_names): Remove initialisation of
16868 src_extension and header_extension.
16869 (compute_exts_from_gf): Update.
16870 (compute_exts_from_src): Update.
16871 (output_files): Update.
16872 * src/reader.c (parse_header_extension_decl): New.
16873 (parse_source_extension_decl): New.
16874 (read_declarations): New case statements for the new tokens.
16875 * src/lex.c (percent_table): Add entries for %source_extension
16876 and %header_extension.
16877 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
16878
16879 2001-08-06 Marc Autret <autret_m@epita.fr>
16880
16881 * configure.in: Bump to 1.28c.
16882 * doc/bison.texinfo: Texinfo thingies.
16883
16884 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
16885
16886 * tests/atconfig.in (CPPFLAGS): Add.
16887 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
16888
16889 2001-08-03 Akim Demaille <akim@epita.fr>
16890
16891 Version 1.28b.
16892
16893 2001-08-03 Akim Demaille <akim@epita.fr>
16894
16895 * tests/Makefile.am (check-local): Ship testsuite.
16896 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
16897 Include `string.h'.
16898
16899 2001-08-03 Akim Demaille <akim@epita.fr>
16900
16901 * configure.in: Try using -Wformat when compiling.
16902
16903 2001-08-03 Akim Demaille <akim@epita.fr>
16904
16905 * configure.in: Bump to 1.28b.
16906
16907 2001-08-03 Akim Demaille <akim@epita.fr>
16908
16909 * src/complain.c: Adjust strerror_r portability issues.
16910
16911 2001-08-03 Akim Demaille <akim@epita.fr>
16912
16913 Version 1.28a.
16914
16915 2001-08-03 Akim Demaille <akim@epita.fr>
16916
16917 * src/getargs.c, src/getarg.h (skeleton)): Constify.
16918 * src/lex.c (literalchar): Avoid name clashes on `buf'.
16919 * src/getargs.c: Include complain.h.
16920 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
16921 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
16922
16923 2001-08-03 Akim Demaille <akim@epita.fr>
16924
16925 * src/reader.c (readgram): Display hidden chars in error messages.
16926
16927 2001-08-03 Akim Demaille <akim@epita.fr>
16928
16929 Update to gettext 0.10.39.
16930
16931 2001-08-03 Akim Demaille <akim@epita.fr>
16932
16933 * lib/strspn.c: New.
16934
16935 2001-08-01 Marc Autret <autret_m@epita.fr>
16936
16937 * doc/bison.texinfo: Update.
16938 * doc/bison.1 (mandoc): Update.
16939 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
16940 * src/files.c: Support output files extensions computing.
16941 (src_extension): New static variable.
16942 (header_extension): New static variable.
16943 (tr): New function.
16944 (get_extension_index): New function, gets the index of an extension
16945 filename in a string.
16946 (compute_exts_from_gf): New function, computes extensions from the
16947 grammar file extension.
16948 (compute_exts_from_src): New functions, computes extensions from the
16949 C source file extension, file given by ``-o'' option.
16950 (compute_base_names): Update.
16951 (output_files): Update.
16952
16953 2001-08-01 Robert Anisko <anisko_r@epita.fr>
16954
16955 * doc/bison.texi: Document @$.
16956 (Locations): New section.
16957
16958 2001-07-18 Akim Demaille <akim@epita.fr>
16959
16960 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
16961 * config/prev-version.txt, config/move-if-change: New.
16962 * Makefile.am: Adjust.
16963
16964 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
16965
16966 * src/bison.simple (yyparse): Suppress warning `comparaison
16967 between signed and unsigned'.
16968
16969 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
16970
16971 * src/getargs.h (raw_flag): Remove.
16972 * src/getargs.c: Die on `-r'/`--raw'.
16973 * src/lex.c (parse_percent_token): Die on `%raw'.
16974 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
16975 * tests/calc.at: Suppress test with option `--raw'.
16976
16977 2001-07-14 Akim Demaille <akim@epita.fr>
16978
16979 * config/: New.
16980 * configure.in: Require Autoconf 2.50.
16981 Update to gettext 0.10.38.
16982
16983 2001-03-16 Akim Demaille <akim@epita.fr>
16984
16985 * doc/bison.texinfo: ANSIfy the examples.
16986
16987 2001-03-16 Akim Demaille <akim@epita.fr>
16988
16989 * getargs.c (skeleton): New variable.
16990 (longopts): --skeleton is a new option.
16991 (shortopts, getargs): -S is a new option.
16992 * getargs.h: Declare skeleton.
16993 * output.c (output_parser): Use it.
16994
16995 2001-03-16 Akim Demaille <akim@epita.fr>
16996
16997 * m4/strerror_r.m4: New.
16998 * m4/error.m4: Run AC_FUNC_STRERROR_R.
16999 * lib/error.h, lib/error.c: Update.
17000
17001 2001-03-16 Akim Demaille <akim@epita.fr>
17002
17003 * src/getargs.c (longopts): Clean up.
17004
17005 2001-02-21 Akim Demaille <akim@epita.fr>
17006
17007 * src/reader.c (gensym): `gensym_count' is your own.
17008 Use a static buf to create the symbol name, as token_buffer is no
17009 longer a buffer.
17010
17011 2001-02-08 Akim Demaille <akim@epita.fr>
17012
17013 * src/conflicts.c (conflict_report): Be sure not to append to res
17014 between two calls, which could happen if both first sprintf were
17015 skipped, but not the first cp += strlen.
17016
17017 2001-02-08 Akim Demaille <akim@epita.fr>
17018
17019 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
17020 New, from fileutils 4.0.37.
17021 * configure.in: Require Autoconf 2.49c. I took some time before
17022 making this decision. This is the only way out for portability
17023 issues in Bison, it would mean way too much duplicate effort to
17024 import in Bison features implemented in 2.49c since 2.13.
17025 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
17026
17027 2001-02-02 Akim Demaille <akim@epita.fr>
17028
17029 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
17030 * lib/xalloc.h, lib/xmalloc.c: Update.
17031
17032 2001-01-19 Akim Demaille <akim@epita.fr>
17033
17034 Get rid of the ad hoc handling of token_buffer in the scanner: use
17035 the obstacks.
17036
17037 * src/lex.c (token_obstack): New.
17038 (init_lex): Initialize it. No longer call...
17039 (grow_token_buffer): this. Remove it.
17040 Adjust all the places which used it to use the obstack.
17041
17042 2001-01-19 Akim Demaille <akim@epita.fr>
17043
17044 * src/lex.h: Rename all the tokens:
17045 s/\bENDFILE\b/tok_eof/g;
17046 s/\bIDENTIFIER\b/tok_identifier/g;
17047 etc.
17048 Let them be enums, not #define, to ease debugging.
17049 Adjust all the code.
17050
17051 2001-01-18 Akim Demaille <akim@epita.fr>
17052
17053 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
17054 * src/lex.c (maxtoken, grow_token_buffer): Static.
17055
17056 2001-01-18 Akim Demaille <akim@epita.fr>
17057
17058 Since we now use obstacks, more % directives can be enabled.
17059
17060 * src/lex.c (percent_table): Also accept `%yacc',
17061 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
17062 `%debug'.
17063 Handle the actions for `%semantic_parser' and `%pure_parser' here,
17064 instead of returning a token.
17065 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
17066 * src/reader.c (read_declarations): Adjust.
17067 * src/files.c (open_files): Don't call `compute_base_names', don't
17068 compute `attrsfile' since they depend upon data which might be
17069 *in* the input file now.
17070 (output_files): Do it here.
17071 * src/output.c (output_headers): Document the fact that this patch
17072 introduces a guaranteed SEGV for semantic parsers.
17073 * doc/bison.texinfo: Document them.
17074 * tests/suite.at: Exercise these %options.
17075
17076 2000-12-20 Akim Demaille <akim@epita.fr>
17077
17078 Also handle the output file (--verbose) with obstacks.
17079
17080 * files.c (foutput): Remove.
17081 (output_obstack): New.
17082 Adjust all dependencies.
17083 * src/conflicts.c: Return a string.
17084 * src/system.h (obstack_grow_string): Rename as...
17085 (obstack_sgrow): this. Be ready to work with non literals.
17086 (obstack_fgrow4): New.
17087
17088 2000-12-20 Akim Demaille <akim@epita.fr>
17089
17090 * src/files.c (open_files): Fix the computation of short_base_name
17091 in the case of `-o foo.tab.c'.
17092
17093 2000-12-20 Akim Demaille <akim@epita.fr>
17094
17095 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
17096 (copy_dollar): Now that everything uses obstacks, get rid of the
17097 FILE * parameters.
17098
17099 2000-12-20 Akim Demaille <akim@epita.fr>
17100
17101 * src/files.c (open_files): Actually the `.output' file is based
17102 on the short_base_name, not base_name.
17103 * tests/suite.at (Checking output file names): Adjust.
17104
17105 2000-12-20 Akim Demaille <akim@epita.fr>
17106
17107 * src/bison.s1: Remove, we now use directly...
17108 * src/bison.simple: this.
17109 * src/Makefile.am: Use pkgdata instead of data.
17110
17111 2000-12-20 Akim Demaille <akim@epita.fr>
17112
17113 * src/files.c (guard_obstack): New.
17114 (open_files): Initialize it.
17115 (output_files): Dump it...
17116 * src/files.h: Export it.
17117 * src/reader.c (copy_guard): Use it.
17118
17119 2000-12-19 Akim Demaille <akim@epita.fr>
17120
17121 * src/files.c (outfile, defsfile, actfile): Removed as global
17122 vars.
17123 (open_files): Don't compute them.
17124 (output_files): Adjust.
17125 (base_name, short_base_name): Be global.
17126 Adjust dependencies.
17127
17128 2000-12-19 Akim Demaille <akim@epita.fr>
17129
17130 * src/files.c (strsuffix): New.
17131 (stringappend): Be just like strcat but allocate.
17132 (base_names): Eve out from open_files.
17133 Try to simplify the rather hairy computation of base_name and
17134 short_base_name.
17135 (open_files): Use it.
17136 * tests/suite.at (Checking output file names): New test.
17137
17138 2000-12-19 Akim Demaille <akim@epita.fr>
17139
17140 * src/system.h (obstack_grow_literal_string): Rename as...
17141 (obstack_grow_string): this.
17142 * src/output.c (output_parser): Recognize `%% actions' instead of
17143 `$'.
17144 * src/bison.s1: s/$/%% actions/.
17145 * src/bison.hairy: Likewise.
17146
17147 2000-12-19 Akim Demaille <akim@epita.fr>
17148
17149 * src/output.c (output_parser): Compute the `#line' lines when
17150 there are.
17151 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
17152 Suggested by Hans Aberg.
17153
17154 2000-12-19 Akim Demaille <akim@epita.fr>
17155
17156 Let the handling of the skeleton files be local to the procedures
17157 that use it.
17158
17159 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
17160 longer static.
17161 (fparser, open_extra_files): Remove.
17162 (open_files, output_files): Don't take care of fparser.
17163 * src/files.h: Adjust.
17164 * src/output.c (output_parser): Open and close the file to the
17165 skeleton.
17166 * src/reader.c (read_declarations): When %semantic_parser, open
17167 fguard.
17168
17169 2000-12-19 Akim Demaille <akim@epita.fr>
17170
17171 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
17172 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
17173
17174 2000-12-19 Akim Demaille <akim@epita.fr>
17175
17176 * src/files.c (open_files): Yipee! We no longer need all the code
17177 looking for `/tmp' since we have no tmp file.
17178
17179 2000-12-19 Akim Demaille <akim@epita.fr>
17180
17181 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
17182 New macros.
17183 * src/files.c (open_files): Less dependency on MSDOS etc.
17184
17185 2000-12-14 Akim Demaille <akim@epita.fr>
17186
17187 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
17188 Provide a default definition.
17189 Use it when executing the default @ action.
17190 * src/reader.c (reader_output_yylsp): No longer include
17191 `timestamp' and `text' in the default YYLTYPE.
17192
17193 2000-12-12 Akim Demaille <akim@epita.fr>
17194
17195 * src/reader.c (copy_definition, parse_union_decl, copy_action)
17196 (copy_guard): Quote the file names.
17197 Reported by Laurent Mascherpa.
17198
17199 2000-12-12 Akim Demaille <akim@epita.fr>
17200
17201 * src/output.c (output_headers, output_program, output): Be sure
17202 to escape special characters when outputting filenames.
17203 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
17204 (output_headers): Don't depend on them, Use ACTSTR.
17205
17206 2000-11-17 Akim Demaille <akim@epita.fr>
17207
17208 * lib/obstack.h: Formatting changes.
17209 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
17210 prevents type checking.
17211 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
17212 cast the value to (void *): assigning a `foo *' to a `void *'
17213 variable is valid.
17214 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
17215 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
17216 append characters.
17217
17218 2000-11-17 Akim Demaille <akim@epita.fr>
17219
17220 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
17221 as...
17222 (suite.m4, regression.m4, calc.m4): these.
17223 * tests/atgeneral.m4: Update from CVS Autoconf.
17224
17225 2000-11-17 Akim Demaille <akim@epita.fr>
17226
17227 * tests/regression.m4 (%union and --defines): New test,
17228 demonstrating a current bug in the obstack implementation.
17229
17230 2000-11-17 Akim Demaille <akim@epita.fr>
17231
17232 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
17233 macros.
17234 Use them to declare the variables which are global or local to
17235 `yyparse'.
17236
17237 2000-11-17 Akim Demaille <akim@epita.fr>
17238
17239 * acconfig.h: Remove, no longer used.
17240
17241 2000-11-07 Akim Demaille <akim@epita.fr>
17242
17243 * src: s/Copyright (C)/Copyright/g.
17244
17245 2000-11-07 Akim Demaille <akim@epita.fr>
17246
17247 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
17248 defining.
17249 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
17250
17251 2000-11-07 Akim Demaille <akim@epita.fr>
17252
17253 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
17254 Merge in a single CPP if/else.
17255
17256 2000-11-07 Akim Demaille <akim@epita.fr>
17257
17258 * src/output.c (output): Remove useless variables.
17259 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
17260 argument `data' for consistency with the prototypes.
17261 Qualify it `const'.
17262 (obstack_copy, obstack_copy0): Rename the second argument as
17263 `address' for consistency. Qualify it `const'.
17264 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
17265 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
17266 `const' their input argument (`data' or `address').
17267 Adjust the corresponding macros to include `const' in casts.
17268
17269 2000-11-03 Akim Demaille <akim@epita.fr>
17270
17271 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
17272 s/PFILE1/BISON_HAIRY/.
17273 Adjust dependencies.
17274
17275 2000-11-03 Akim Demaille <akim@epita.fr>
17276
17277 For some reason, this was not applied.
17278
17279 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
17280 `unlink': it's no longer used.
17281
17282 2000-11-03 Akim Demaille <akim@epita.fr>
17283
17284 * src/files.c (skeleton_find): New function, eved out of...
17285 (open_files, open_extra_files): here.
17286
17287 2000-11-03 Akim Demaille <akim@epita.fr>
17288
17289 Don't use `atexit'.
17290
17291 * src/files.c (obstack_save): New function.
17292 (done): Rename as...
17293 (output_files): this.
17294 Use `obstack_save'.
17295 * src/main.c (main): Don't use `atexit' to register `done', since
17296 it no longer has to remove tmp files, just call `output_files'
17297 when there are no errors.
17298
17299 2000-11-02 Akim Demaille <akim@epita.fr>
17300
17301 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
17302 `unlink': it's no longer used.
17303 * src/files.h: Formatting changes.
17304
17305 2000-11-02 Akim Demaille <akim@epita.fr>
17306
17307 Remove the last uses of mktemp and unlink/delete.
17308
17309 * src/files.c (fdefines, ftable): Removed.
17310 (defines_ostack, table_obstack): New.
17311 Adjust dependencies of the former into uses of the latter.
17312 * src/output.c (output_short_or_char_table, output_short_table):
17313 Convert to using obstacks.
17314 * src/reader.c (copy_comment2): Accept one FILE * and two
17315 obstacks.
17316 (output_token_defines, reader_output_yylsp): Use obstacks.
17317 * src/system.h (obstack_fgrow3): New.
17318 * po/POTFILES.in: Adjust.
17319
17320 2000-11-01 Akim Demaille <akim@epita.fr>
17321
17322 Change each use of `fattrs' into a use of `attrs_obstack'.
17323
17324 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
17325 * src/files.c (fattrs): Remove.
17326 (attrs_obstack): New.
17327 Adjust all dependencies.
17328 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
17329
17330 2000-11-01 Akim Demaille <akim@epita.fr>
17331
17332 Introduce obstacks.
17333 Change each use of `faction' into a use of `action_obstack'.
17334
17335 * lib/obstack.h, lib/obstack.c: New files.
17336 * src/files.c (faction): Remove.
17337 (action_obstack): New.
17338 Adjust all dependencies.
17339
17340 2000-10-20 Akim Demaille <akim@epita.fr>
17341
17342 * lib/quote.h (PARAMS): New macro. Use it.
17343
17344 2000-10-16 Akim Demaille <akim@epita.fr>
17345
17346 * src/output.c (output_short_or_char_table): New function.
17347 (output_short_table, output_token_translations): Use it.
17348 (goto_actions): Use output_short_table.
17349
17350 2000-10-16 Akim Demaille <akim@epita.fr>
17351
17352 * src/symtab.c (bucket_new): New function.
17353 (getsym): Use it.
17354
17355 * src/output.c (output_short_table): New argument to display the
17356 comment associated with the table.
17357 Adjust dependencies.
17358 (output_gram): Use it.
17359 (output_rule_data): Nicer output layout for YYTNAME.
17360
17361 2000-10-16 Akim Demaille <akim@epita.fr>
17362
17363 * src/lex.c (read_typename): New function.
17364 (lex): Use it.
17365 * src/reader.c (copy_dollar): Likewise.
17366
17367 2000-10-16 Akim Demaille <akim@epita.fr>
17368
17369 * src/reader.c (copy_comment2): Expect the input stream to be on
17370 the `/' which is suspected to open a comment, instead of being
17371 called after `//' or `/*' was read.
17372 (copy_comment, copy_definition, parse_union_decl, copy_action)
17373 (copy_guard): Adjust.
17374
17375 2000-10-16 Akim Demaille <akim@epita.fr>
17376
17377 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
17378 `read_signed_integer'.
17379
17380 2000-10-16 Akim Demaille <akim@epita.fr>
17381
17382 * src/reader.c (copy_dollar): New function.
17383 (copy_guard, copy_action): Use it.
17384
17385 2000-10-16 Akim Demaille <akim@epita.fr>
17386
17387 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
17388 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
17389 New files, from Fileutils 4.0.27.
17390 * src/main.c (printable_version): Remove.
17391 * src/lex.c, src/reader.c: Use `quote'.
17392
17393 2000-10-04 Akim Demaille <akim@epita.fr>
17394
17395 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
17396
17397 2000-10-04 Akim Demaille <akim@epita.fr>
17398
17399 * doc/bison.texinfo: Various typos spotted by Neil Booth.
17400
17401 2000-10-04 Akim Demaille <akim@epita.fr>
17402
17403 When a literal string is used to define two different tokens,
17404 `bison -v' segfaults.
17405 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
17406
17407 * tests/regression.m4: New file.
17408 Include the core of the sample provided by Piotr Gackiewicz.
17409 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
17410 properly.
17411
17412 2000-10-04 Akim Demaille <akim@epita.fr>
17413
17414 * src/reader.c (parse_expect_decl): Keep `count' within the size
17415 of `buffer'.
17416 From Neil Booth.
17417
17418 2000-10-02 Paul Eggert <eggert@twinsun.com>
17419
17420 * bison.s1 (yyparse): Assign the default value
17421 unconditionally, to avoid a GCC warning and make the parser a
17422 tad smaller.
17423
17424 2000-10-02 Akim Demaille <akim@epita.fr>
17425
17426 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
17427 options.
17428
17429 2000-10-02 Akim Demaille <akim@epita.fr>
17430
17431 * src/derives.c, src/print.c, src/reduce.c: To ease the
17432 translation, move some `\n' out of the translated strings.
17433
17434 2000-10-02 Akim Demaille <akim@epita.fr>
17435
17436 The location tracking mechanism is precious for parse error
17437 messages. Nevertheless, it is enabled only when `@n' is used in
17438 the grammar, which is a different issue (you can use it in error
17439 message, but not in the grammar per se). Therefore, there should
17440 be another means to enable it.
17441
17442 * src/getargs.c (getargs): Support `--locations'.
17443 (usage): Report it.
17444 * src/getargs.h (locationsflag): Export it.
17445 * src/lex.c (percent_table): Support `%locations'.
17446 * src/reader.c (yylsp_needed): Remove this variable, now replaced
17447 with `locationsflag'.
17448 * doc/bison.texinfo: Document `--locations' and `%locations'.
17449 Sort the options.
17450 * tests/calc.m4: Test it.
17451
17452 For regularity of the names, replace each
17453 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
17454 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
17455 In addition replace each `flag' with `_flag'.
17456
17457 2000-10-02 Akim Demaille <akim@epita.fr>
17458
17459 Also test parse error messages, including with YYERROR_VERBOSE.
17460
17461 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
17462 associative).
17463 Use it to check the computations.
17464 Use it to check `nonassoc' is honored.
17465 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
17466 `--yyerror-verbose'.
17467 (_AT_CHECK_CALC): Adjust to this option.
17468 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
17469
17470 2000-10-02 Akim Demaille <akim@epita.fr>
17471
17472 Test also `--verbose', `--defines' and `--name-prefix'. Testing
17473 the latter demonstrates a flaw in the handling of non debugging
17474 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
17475 was used in order to simplify:
17476
17477 #if YYDEBUG
17478 if (yydebug)
17479 {
17480 ...
17481 }
17482 #endif
17483
17484 into
17485
17486 if (yydebug)
17487 {
17488 ...
17489 }
17490
17491 unfortunately this leads to a CPP conflict when
17492 `--name-prefix=foo' is used since it produces `#define yydebug
17493 foodebug'.
17494
17495 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
17496 (YYDPRINTF): New macro.
17497 Spread its use.
17498 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
17499 the bison options.
17500 Also test `--verbose', `--defines' and `--name-prefix'.
17501
17502 2000-10-02 Akim Demaille <akim@epita.fr>
17503
17504 Improve the readability of the produced parsers.
17505
17506 * src/bison.s1: Formatting changes.
17507 Improve the comment related to the `$' mark.
17508 (yydefault): Don't fall through to `yyresume': `goto' there.
17509 * src/output.c (output_parser): When the `$' is met, skip the end
17510 of its line.
17511 New variable, `number_of_dollar_signs', to check there's exactly
17512 one `$' in the parser skeleton.
17513
17514 2000-10-02 Akim Demaille <akim@epita.fr>
17515
17516 * lib/xstrdup.c: New file, from the fileutils.
17517 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
17518 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
17519 instead of strlen + xmalloc + strcpy.
17520 * src/symtab.c (copys): Remove, use xstrdup instead.
17521
17522 2000-10-02 Akim Demaille <akim@epita.fr>
17523
17524 * src/gram.h (associativity): New enum type which replaces the
17525 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
17526 `right_assoc', `left_assoc' and `non_assoc'.
17527 Adjust all dependencies.
17528 * src/reader.c: Formatting changes.
17529 (LTYPESTR): Don't define it, use it as a literal in
17530 `reader_output_yylsp'.
17531 * src/symtab.h (symbol_class): New enum type which replaces the
17532 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
17533 `sunknown', `stoken and `snterm'.
17534
17535 2000-10-02 Akim Demaille <akim@epita.fr>
17536
17537 * src/getargs.c (fixed_outfiles): Rename as...
17538 (yaccflag): for consistency and accuracy.
17539 Adjust dependencies.
17540
17541 2000-10-02 Akim Demaille <akim@epita.fr>
17542
17543 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
17544 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
17545 difficult and introduced a lot of core dump. It turns out that
17546 Bison used an implementation of `xmalloc' based on `calloc', and
17547 at various places it does depend upon the initialization to 0. I
17548 have not tried to isolate the pertinent places, and all the former
17549 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
17550 someone should address this issue.
17551
17552 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
17553 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
17554 files.
17555 Adjust dependencies.
17556 * src/warshall.h: New file.
17557 Propagate.
17558
17559 2000-10-02 Akim Demaille <akim@epita.fr>
17560
17561 Various anti-`extern in *.c' changes.
17562
17563 * src/system.h: Include `assert.h'.
17564
17565 2000-10-02 Akim Demaille <akim@epita.fr>
17566
17567 * src/state.h (nstates, final_state, first_state, first_shift)
17568 (first_reduction): Move their exportation from here...
17569 * src/LR0.h: to here.
17570 Adjust dependencies.
17571 * src/getargs.c (statisticsflag): New variable.
17572 Add support for `--statistics'.
17573 Adjust dependencies.
17574
17575 Remove a lot of now useless `extern' statements in most files.
17576
17577 2000-10-02 Akim Demaille <akim@epita.fr>
17578
17579 * src/LR0.h: New file.
17580 Propagate its use.
17581
17582 2000-10-02 Akim Demaille <akim@epita.fr>
17583
17584 * src/print.h: New file.
17585 Propagate its use.
17586 * src/print.c: Formatting and ordering changes.
17587 (verbose, terse): Replace with...
17588 (print_results): this new function.
17589 Adjust dependencies.
17590
17591 2000-10-02 Akim Demaille <akim@epita.fr>
17592
17593 * src/conflicts.c (conflict_report): New function.
17594 (conflict_log, verbose_conflict_log): Replace with...
17595 (print_conflicts): this function.
17596 Adjust dependencies.
17597 * src/conflicts.h: New file.
17598 Propagate its inclusion.
17599
17600 2000-10-02 Akim Demaille <akim@epita.fr>
17601
17602 * src/nullable.h: New file.
17603 Propagate its inclusion.
17604 * src/nullable.c: Formatting changes.
17605
17606 2000-10-02 Akim Demaille <akim@epita.fr>
17607
17608 * src/reduce.h: New file.
17609 Propagate its inclusion.
17610 * src/reduce.c: Topological sort and other formatting changes.
17611 (bool, TRUE, FALSE): Move their definition to...
17612 * src/system.h: here.
17613
17614 2000-10-02 Akim Demaille <akim@epita.fr>
17615
17616 * src/files.c: Formatting changes.
17617 (tryopen, tryclose, openfiles): Rename as...
17618 (xfopen, xfclose, open_files): this.
17619 (stringappend): static.
17620 * src/files.h: Complete the list of exported symbols.
17621 Propagate its use.
17622
17623 2000-10-02 Akim Demaille <akim@epita.fr>
17624
17625 * src/reader.h: New file.
17626 Propagate its use instead of tedious list of `extern' and
17627 prototypes.
17628 * src/reader.c: Formatting changes, topological sort,
17629 s/register//.
17630
17631 2000-10-02 Akim Demaille <akim@epita.fr>
17632
17633 * src/lex.h: Prototype `lex.c' exported functions.
17634 * src/reader.c: Adjust.
17635 * src/lex.c: Formatting changes.
17636 (safegetc): Rename as...
17637 (xgetc): this.
17638
17639 2000-10-02 Akim Demaille <akim@epita.fr>
17640
17641 * src/lalr.h: New file.
17642 Propagate its inclusion instead of prototypes and `extern'.
17643 * src/lalr.c: Formatting changes, topological sorting etc.
17644
17645 2000-10-02 Akim Demaille <akim@epita.fr>
17646
17647 * src/output.c (token_actions): Introduce a temporary array,
17648 YYDEFACT, that makes it possible for this function to use
17649 output_short_table.
17650
17651 2000-10-02 Akim Demaille <akim@epita.fr>
17652
17653 `user_toknums' is output as a `short[]' in `output.c', while it is
17654 defined as a `int[]' in `reader.c'. For consistency with the
17655 other output tables, `user_toknums' is now defined as a table of
17656 shorts.
17657
17658 * src/reader.c (user_toknums): Be a short table instead of an int
17659 table.
17660 Adjust dependencies.
17661
17662 Factor the short table outputs.
17663
17664 * src/output.c (output_short_table): New function.
17665 * src/output.c (output_gram, output_stos, output_rule_data)
17666 (output_base, output_table, output_check): Use it.
17667
17668 2000-10-02 Akim Demaille <akim@epita.fr>
17669
17670 * src/output.c (output): Topological sort of the functions, in
17671 order to get rid of the `static' prototypes.
17672 No longer use `register'.
17673 * src/output.h: New file.
17674 Propagate its inclusion in files explicitly prototyping functions
17675 from output.c.
17676
17677 2000-09-21 Akim Demaille <akim@epita.fr>
17678
17679 * src/atgeneral.m4: Update from Autoconf.
17680
17681 2000-09-21 Akim Demaille <akim@epita.fr>
17682
17683 * src/closure.h: New file.
17684 * src/closure.c: Formatting changes, topological sort over the
17685 functions, use of closure.h.
17686 (initialize_closure, finalize_closure): Rename as...
17687 (new_closure, free_closure): these. Adjust dependencies.
17688 * src/LR0.c: Formatting changes, topological sort, use of
17689 cloture.h.
17690 (initialize_states): Rename as...
17691 (new_states): this.
17692 * src/Makefile.am (noinst_HEADERS): Adjust.
17693
17694 2000-09-20 Akim Demaille <akim@epita.fr>
17695
17696 * src/acconfig.h: Don't protect config.h against multiple
17697 inclusion.
17698 Don't define PARAMS.
17699 * src/system.h: Define PARAMS.
17700 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
17701 purpose of config.h. system.h must not try to fix wrong
17702 definitions in config.h.
17703
17704 2000-09-20 Akim Demaille <akim@epita.fr>
17705
17706 * src/derives.h: New file.
17707 * src/main.c, src/derives.h: Use it.
17708 Formatting changes.
17709 * src/Makefile.am (noinst_HEADERS): Adjust.
17710
17711 2000-09-20 Akim Demaille <akim@epita.fr>
17712
17713 * tests/atgeneral.m4: Update from Autoconf.
17714 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
17715 (AT_CHECK_CALC): New macros.
17716 Use these macros to test bison with options `', `--raw',
17717 `--debug', `--yacc', `--yacc --debug'.
17718
17719 2000-09-19 Akim Demaille <akim@epita.fr>
17720
17721 * src/output.c: Formatting changes.
17722 * src/machine.h: Remove, leaving its contents in...
17723 * src/system.h: here.
17724 Include stdio.h.
17725 Adjust all dependencies on stdio.h and machine.h.
17726 * src/getargs.h: New file.
17727 Let all `extern' declarations about getargs.c be replaced with
17728 inclusion of `getargs.h'.
17729 * src/Makefile.am (noinst_HEADERS): Adjust.
17730
17731 * tests/calc.m4 (yyin): Be initialized in main, not on the global
17732 scope.
17733 (yyerror): Returns void, not int.
17734 * doc/bison.texinfo: Formatting changes.
17735
17736 2000-09-19 Akim Demaille <akim@epita.fr>
17737
17738 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
17739 portable.
17740
17741 2000-09-18 Akim Demaille <akim@epita.fr>
17742
17743 * configure.in: Append WARNING_CFLAGS to CFLAGS.
17744 * src/Makefile.am (INCLUDES): Don't.
17745 Be ready to fetch headers in lib/.
17746
17747 2000-09-18 Akim Demaille <akim@epita.fr>
17748
17749 * doc/bison.texinfo: Update the copyright.
17750 ANSIfy and GNUify the examples.
17751 Remove the old menu.
17752
17753 2000-09-18 Akim Demaille <akim@epita.fr>
17754
17755 First set of tests: use the `calc' example from the documentation.
17756
17757 * src/bison.s1 (yyparse): Condition the code using `yytname' which
17758 is defined only when YYDEBUG is.
17759 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
17760 * src/files.c (tryopen, tryclose): Formatting changes.
17761 Move to the top and be static.
17762 * src/reader.c (read_signed_integer): Likewise.
17763 * tests/calc.m4: New file.
17764 * Makefile.am, suite.m4: Adjust.
17765 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
17766
17767 2000-09-18 Akim Demaille <akim@epita.fr>
17768
17769 Add support for an Autotest test suite for Bison.
17770
17771 * m4/m4.m4, m4/atconfig.m4: New files.
17772 * m4/Makefile.am (EXTRA_DIST): Adjust.
17773 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
17774 files.
17775 * src/getargs.c: Display a more standard --version message.
17776 * src/reader.c (reader): Formatting changes.
17777 No longer depend upon VERSION_STRING.
17778 * configure.in: No longer use `dnl'.
17779 Set up the test suite and the new directory `tests/.
17780 (VERSION_STRING): Remove.
17781
17782 2000-04-14 Akim Demaille <akim@epita.fr>
17783
17784 * src/reader.c (copy_comment2): New function, same as former
17785 `copy_comment', but outputs into two FILE *.
17786 (copy_comment): Use it.
17787 (parse_union_decl): Use it.
17788 (get_type, parse_start_decl): Use the same `invalid' message.
17789 (parse_start_decl, parse_union_decl): Use the same `multiple'
17790 message.
17791 (parse_union_decl, copy_guard, copy_action): Use the same
17792 `unmatched' message.
17793 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
17794
17795 2000-03-31 Akim Demaille <akim@epita.fr>
17796
17797 * src/files.c (tryopen, tryclose): Move to the top.
17798 Be static.
17799
17800 2000-03-31 Akim Demaille <akim@epita.fr>
17801
17802 * src/main.c (main): Don't call `done', exit does it.
17803
17804 2000-03-31 Akim Demaille <akim@epita.fr>
17805
17806 * allocate.c: s/return (foo)/return foo/.
17807 * lalr.c: Likewise.
17808 * LR0.c: Likewise.
17809 * output.c: Likewise.
17810 * reader.c: Likewise.
17811 * symtab.c: Likewise.
17812 * vmsgetargs.c: Likewise.
17813
17814 2000-03-31 Akim Demaille <akim@epita.fr>
17815
17816 Clean up the error reporting functions.
17817
17818 * src/report.c: New file.
17819 * src/report.h: Likewise.
17820 * src/Makefile.am: Adjust.
17821 * m4/error.m4: New file.
17822 * m4/Makefile.am: Adjust.
17823 * configure.in (jm_PREREQ_ERROR): Call it.
17824 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
17825 Remove.
17826 (fatal, fatals): Remove. All callers use complain.c::fatal.
17827 (warn, warni, warns, warnss, warnss): Remove. All callers use
17828 complain.c::complain.
17829 (toomany): Remove, use fatal instead.
17830 * src/files.c (done): No argument, use complain_message_count.
17831 * src/main.c (main): Register `done' to `atexit'.
17832
17833 * src/getargs.c (usage): More `fputs', less `fprintf'.
17834
17835 2000-03-28 Akim Demaille <akim@epita.fr>
17836
17837 * lib/: New directory.
17838 * Makefile.am (SUBDIRS): Adjust.
17839 * configure.in: Adjust.
17840 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
17841 useless.
17842 * src/alloca.c: Moved to lib/.
17843 * src/getopt.c: Likewise.
17844 * src/getopt1.c: Likewise.
17845 * src/getopt.h: Likewise.
17846 * src/ansi2knr.c: Likewise.
17847 * src/ansi2knr.1: Likewise.
17848 * src/Makefile.am: Adjust.
17849 * lib/Makefile.am: New file.
17850
17851 2000-03-28 Akim Demaille <akim@epita.fr>
17852
17853 * src/getargs.c (usage): Refresh the help message.
17854
17855 2000-03-17 Akim Demaille <akim@epita.fr>
17856
17857 * src/getopt1.c: Updated from textutils 2.0e
17858 * src/getopt.c: Likewise.
17859 * src/getopt.h: Likewise.
17860
17861 2000-03-17 Akim Demaille <akim@epita.fr>
17862
17863 * src/Makefile.am (bison.simple): Fix the awk program: quote only
17864 the file name, not the whole `#line LINE FILE'.
17865
17866 2000-03-17 Akim Demaille <akim@epita.fr>
17867
17868 On syntax errors, report the token on which we choked.
17869
17870 * src/bison.s1 (yyparse): In the label yyerrlab, when
17871 YYERROR_VERBOSE, add yychar in msg.
17872
17873 2000-03-17 Akim Demaille <akim@epita.fr>
17874
17875 * src/reader.c (copy_at): New function.
17876 (copy_guard): Use it.
17877 (copy_action): Use it.
17878
17879 2000-03-17 Akim Demaille <akim@epita.fr>
17880
17881 Be kind to translators, save some useless translations.
17882
17883 * src/main.c (banner): New function.
17884 (fatal_banner): Use it.
17885 (warn_banner): Use it.
17886
17887 2000-03-17 Akim Demaille <akim@epita.fr>
17888
17889 * src/reader.c (copy_definition): Use copy_string and
17890 copy_comment. Removed now unused `match', `ended',
17891 `cplus_comment'.
17892 (copy_comment, copy_string): Moved, to be visible from
17893 copy_definition.
17894
17895 2000-03-17 Akim Demaille <akim@epita.fr>
17896
17897 * src/reader.c (copy_string): Declare `static inline'. No
17898 problems with inline, since it is checked by configure.
17899 (copy_comment): Likewise.
17900
17901 2000-03-17 Akim Demaille <akim@epita.fr>
17902
17903 * src/reader.c (packsymbols): Formatting changes.
17904
17905 2000-03-17 Akim Demaille <akim@epita.fr>
17906
17907 * src/reader.c (copy_comment): New function, factored out from:
17908 (copy_action): Use it. Removed now unused `match', `ended',
17909 `cplus_comment'.
17910 (copy_guard): Likewise.
17911
17912 2000-03-17 Akim Demaille <akim@epita.fr>
17913
17914 * src/reader.c (copy_string): New function, factored out from:
17915 (copy_action): Use it.
17916 (copy_guard): Likewise.
17917
17918 2000-03-17 Akim Demaille <akim@epita.fr>
17919
17920 Change the handling of @s so that they behave exactly like $s.
17921 There is now a pseudo variable @$ (readble and writable), location
17922 of the lhs of the rule (by default ranging from the location of
17923 the first symbol of the rhs, to the location of the last symbol,
17924 or, if the rhs is empty, YYLLOC).
17925
17926 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
17927 yyval.
17928 (yyparse): When providing a default semantic action, provide a
17929 default location action.
17930 (after the $): No longer change `*YYLSP', just stack YYLOC the
17931 same way you stack YYVAL.
17932 * src/reader.c (read_declarations): Use warns.
17933 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
17934 (copy_action, case '@'): Likewise.
17935 Use a standard error message, to save useless work from
17936 translators.
17937
17938 2000-03-17 Akim Demaille <akim@epita.fr>
17939
17940 * src/bison.s1: Formatting and cosmetics changes.
17941 * src/reader.c: Likewise.
17942 Update the Copyright notice.
17943
17944 2000-03-17 Akim Demaille <akim@epita.fr>
17945
17946 * src/bison.s1 (#line): All set to `#line' only, since the
17947 Makefile now handles them.
17948
17949 2000-03-16 Akim Demaille <akim@epita.fr>
17950
17951 * src/output.c (output_rule_data): Output the documentation of
17952 some of the tables.
17953 (Copyright notice): Update.
17954 Formatting changes.
17955
17956 2000-03-16 Akim Demaille <akim@epita.fr>
17957
17958 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
17959 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
17960 One `#if YYDEBUG' remains, since it uses variables which are
17961 defined only if `YYDEBUG != 0'.
17962
17963 2000-03-16 Akim Demaille <akim@epita.fr>
17964
17965 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
17966 and related variables so that the similarities are highlighted.
17967
17968 2000-03-16 Akim Demaille <akim@epita.fr>
17969
17970 * src/bison.s1: Properly indent CPP directives.
17971
17972 2000-03-16 Akim Demaille <akim@epita.fr>
17973
17974 * src/bison.s1: Properly indent the `alloca' CPP section.
17975
17976 2000-03-16 Akim Demaille <akim@epita.fr>
17977
17978 Do not hard code values of directories in `configure.in'.
17979 Update the `configure' tool chain.
17980
17981 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
17982 src/makefile.am.
17983 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
17984 (AC_OUTPUT): Add m4/Makefile.
17985 Bump to bison 1.28a, 1.29 has never been released.
17986 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
17987 handled via src/Makefile.am.
17988 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
17989 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
17990 autoheader.
17991 * Makefile.am (SUBDIRS): Add m4.
17992 (ACLOCAL_AM_FLAGS): New variable.
17993 (AUTOMAKE_OPTIONS): Add check-news.
17994 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
17995 the proper line number and file name.
17996 (DEFS): Propagate the location of bison library files and of the
17997 locale files.
17998 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
17999 builddir.
18000 * acinclude.m4: Remove, replaced by the directory m4.
18001 * m4/Makefile.am (EXTRA_DIST): New variable.
18002 * m4/gettext.m4: New file, from the fileutils.
18003 * m4/lcmessage.m4: Likewise
18004 * m4/progtest.m4: Likewise.
18005 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
18006
18007 2000-03-10 Akim Demaille <akim@epita.fr>
18008
18009 * src/closure.c:
18010 Formatting changes of various comments.
18011 Respect the GNU coding standards at various places.
18012 Don't use `_()' when no translation is needed.
18013
18014 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18015
18016 * src/files.c:
18017 OS/2 honors TMPDIR environment variable.
18018
18019 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18020
18021 * doc/bison.texinfo: Tweaked spelling and grammar.
18022 Updated ISBN.
18023 Removed reference to price of printed copy.
18024 Mention BISON_SIMPLE and BISON_HAIRY.
18025
18026 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18027
18028 * configure.in, NEWS:
18029 Bison 1.29 released.
18030
18031 1999-10-27 Jesse Thilo <jthilo@gnu.org>
18032
18033 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
18034 Added reference card.
18035
18036 1999-07-26 Jesse Thilo <jthilo@gnu.org>
18037
18038 * po/ru.po: Added Russian translation.
18039
18040 1999-07-26 Jesse Thilo <jthilo@gnu.org>
18041
18042 * configure.in: Added Russian translation.
18043
18044 1999-07-06 Jesse Thilo <jthilo@gnu.org>
18045
18046 * configure.in, NEWS, README:
18047 Released version 1.28.
18048
18049 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18050
18051 * src/system.h:
18052 Squashed redefinition warning on some systems.
18053
18054 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
18055 Have configure build version string instead of relying on ANSI string
18056 concatentation.
18057
18058 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18059
18060 * po/POTFILES.in: Got rid of version.c.
18061
18062 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18063
18064 * acconfig.h, configure.in:
18065 Have configure build version string instead of relying on ANSI string
18066 concatentation.
18067
18068 1999-06-08 Jesse Thilo <jthilo@gnu.org>
18069
18070 * doc/bison.1:
18071 Dropped mention of `+' for long-named options.
18072
18073 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18074
18075 * src/files.c: Added <unistd.h> for unlink().
18076
18077 * src/Makefile.am, src/system.h:
18078 I18n fixes.
18079
18080 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18081
18082 * README: Added a FAQ list.
18083
18084 * configure.in, acconfig.h:
18085 I18n fixes.
18086
18087 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18088
18089 * doc/FAQ, doc/Makefile.am:
18090 Added a FAQ list.
18091
18092 1999-05-19 Jesse Thilo <jthilo@gnu.org>
18093
18094 * src/alloc.h, src/symtab.h, src/version.c:
18095 Protected inclusion of "config.h" with HAVE_CONFIG_H.
18096
18097 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18098
18099 * src/.cvsignore, src/Makefile.am:
18100 Reorganized: sources in `src', documentation in `doc'.
18101
18102 * src/lex.c (literalchar):
18103 fixed the code for escaping double quotes (thanks
18104 Jonathan Czisny.)
18105
18106 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18107
18108 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
18109 Adjusted paths to reflect directory reorganization.
18110
18111 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18112
18113 * doc/.cvsignore, doc/Makefile.am:
18114 Reorganized: sources in `src', documentation in `doc'.
18115
18116 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18117
18118 * configure.in:
18119 Updated AC_INIT file to reflect directory reorganization.
18120
18121 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
18122 Reorganized: sources in `src', documentation in `doc'.
18123
18124 1999-04-13 Jesse Thilo <jthilo@gnu.org>
18125
18126 * src/allocate.c:
18127 Don't declare calloc() and realloc() if not necessary.
18128
18129 1999-04-13 Jesse Thilo <jthilo@gnu.org>
18130
18131 * configure.in, acconfig.h, acinclude.m4:
18132 Don't declare calloc() and realloc() if not necessary.
18133
18134 1999-03-23 Jesse Thilo <jthilo@gnu.org>
18135
18136 * po/.cvsignore: Added i18n support.
18137
18138 1999-03-23 Jesse Thilo <jthilo@gnu.org>
18139
18140 * acconfig.h, configure.in, Makefile.am:
18141 Added i18n support.
18142
18143 1999-03-22 Jesse Thilo <jthilo@gnu.org>
18144
18145 * src/bison.s1: Fixed #line numbers.
18146
18147 1999-03-15 Jesse Thilo <jthilo@gnu.org>
18148
18149 * po/es.po, po/fr.po, po/nl.po, po/de.po:
18150 Added PO files from Translation Project.
18151
18152 1999-03-03 Jesse Thilo <jthilo@gnu.org>
18153
18154 * Makefile.am:
18155 Added support for non-ANSI compilers (ansi2knr).
18156
18157 1999-02-16 Jesse Thilo <jthilo@gnu.org>
18158
18159 * configure.in: Bumped version number to 1.27.
18160
18161 * Makefile.am:
18162 Added `bison.simple' to list of files removed by `make distclean'.
18163
18164 1999-02-12 Jesse Thilo <jthilo@gnu.org>
18165
18166 * src/files.c, src/files.h:
18167 Defined locations of parser files in config.h instead of Makefile.
18168
18169 1999-02-12 Jesse Thilo <jthilo@gnu.org>
18170
18171 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
18172 Defined locations of parser files in config.h instead of Makefile.
18173
18174 1999-02-09 Jesse Thilo <jthilo@gnu.org>
18175
18176 * Makefile.am:
18177 Removed inappropriate use of $< macro.
18178
18179 1999-02-05 Jesse Thilo <jthilo@gnu.org>
18180
18181 * po/Makefile.in.in, po/POTFILES.in:
18182 Add `po' directory skeleton.
18183
18184 1999-01-27 Jesse Thilo <jthilo@gnu.org>
18185
18186 * README: Document help-bison list.
18187
18188 * configure.in: Add check for mkstemp().
18189
18190 1999-01-20 Jesse Thilo <jthilo@gnu.org>
18191
18192 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
18193 Hush a few compiler warnings.
18194
18195 * src/files.c:
18196 Add tryclose(), which verifies that fclose was successful.
18197 Hush a couple of compiler warnings.
18198
18199 1999-01-20 Jesse Thilo <jthilo@gnu.org>
18200
18201 * Makefile.am, OChangeLog:
18202 ChangeLog is now automatically generated. Include the old version as
18203 OChangeLog.
18204
18205 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18206
18207 * 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:
18208 Update FSF address.
18209
18210 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18211
18212 * doc/bison.texinfo: Fix formatting glitch.
18213
18214 * doc/bison.texinfo: Update FSF address.
18215
18216 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18217
18218 * acconfig.h: Update FSF address.
18219
18220 1999-01-08 Jesse Thilo <jthilo@gnu.org>
18221
18222 * src/system.h:
18223 Don't define PACKAGE here, since config.h defines it.
18224
18225 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18226
18227 * src/reader.c: Update copyright date.
18228
18229 * src/main.c:
18230 Ditch sprintf to statically-sized buffers in fatal/warn functions in
18231 favor of output directly to stderr (avoids buffer overruns).
18232
18233 * src/reader.c: Some checks for premature EOF.
18234
18235 * 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:
18236 Use prototypes if the compiler understands them.
18237
18238 * src/files.c: Honor TMPDIR on Unix hosts.
18239 Use prototypes if the compiler understands them.
18240
18241 * src/reader.c:
18242 Fix a couple of buffer overrun bugs.
18243 Use prototypes if the compiler understands them.
18244
18245 * src/system.h: Include unistd.h and ctype.h.
18246 Use #ifdef instead of #if for NLS symbols.
18247
18248 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18249
18250 * doc/bison.texinfo:
18251 Delete comment "consider using @set for edition number, etc..." since
18252 we now are doing so.
18253
18254 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18255
18256 * configure.in:
18257 Use prototypes if the compiler understands them.
18258
18259 * NEWS: Document 1.26 highlights.
18260
18261 * Makefile.am: Require Automake 1.3 or later.
18262
18263 * acconfig.h:
18264 Use prototypes if the compiler understands them.
18265
18266 1998-12-29 Jesse Thilo <jthilo@gnu.org>
18267
18268 * src/version.c:
18269 Use VERSION symbol from automake for version number.
18270
18271 1998-12-29 Jesse Thilo <jthilo@gnu.org>
18272
18273 * acconfig.h, configure.in, version.cin:
18274 Use VERSION symbol from automake for version number.
18275
18276 1998-11-28 Jesse Thilo <jthilo@gnu.org>
18277
18278 * Makefile.am:
18279 Distribute original version of simple parser (bison.s1), not built
18280 version (bison.simple).
18281
18282 1998-11-28 Jesse Thilo <jthilo@gnu.org>
18283
18284 * doc/bison.texinfo: Add info dir entry.
18285
18286 * doc/bison.texinfo:
18287 Let automake put version number into documentation.
18288
18289 1998-11-26 Jesse Thilo <jthilo@gnu.org>
18290
18291 * src/bison.cld, src/build.com, src/vmshlp.mar:
18292 Add non-RCS files from /gd/gnu/bison.
18293
18294 1998-11-26 Jesse Thilo <jthilo@gnu.org>
18295
18296 * doc/bison.1:
18297 Document the BISON_HAIRY and BISON_SIMPLE variables.
18298
18299 1998-11-25 Jesse Thilo <jthilo@gnu.org>
18300
18301 * src/version.c: Build version.c automatically.
18302
18303 * src/reader.c:
18304 Fix token numbering (used to start at 258, not 257).
18305
18306 * src/system.h: Include config.h.
18307
18308 * src/getargs.c: Update bug report address.
18309
18310 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
18311 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
18312
18313 1998-11-25 Jesse Thilo <jthilo@gnu.org>
18314
18315 * Makefile.am:
18316 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
18317
18318 * configure.in, version.cin:
18319 Build version.c automatically.
18320
18321 * AUTHORS: Add AUTHORS file.
18322
18323 * README: Update bug report address.
18324
18325 * bison.simple:
18326 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
18327
18328 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
18329 Add automake stuff.
18330
18331 1998-11-25 Jesse Thilo <jthilo@gnu.org>
18332
18333 * doc/bison.texinfo: Clean up some formatting.
18334
18335 1998-05-05 Richard Stallman <rms@gnu.org>
18336
18337 * doc/bison.texinfo:
18338 Explain better why to make a pure parser.
18339
18340 1998-01-05 Richard Stallman <rms@gnu.org>
18341
18342 * src/files.c (openfiles):
18343 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
18344 find a temporary directory, if possible. Do not unlink files while
18345 they are open.
18346
18347 1997-08-25 Richard Stallman <rms@gnu.org>
18348
18349 * src/reader.c (stack_offset;):
18350 Change some warni to warns.
18351
18352 * src/lex.c (literalchar): Use warns, not warni.
18353
18354 1997-06-28 Richard Stallman <rms@gnu.org>
18355
18356 * src/bison.s1: Add a Bison version comment.
18357
18358 * src/main.c (fatal, warn, berror):
18359 Use program_name.
18360
18361 1997-06-28 Richard Stallman <rms@gnu.org>
18362
18363 * Makefile.in (bison_version): New variable.
18364 (dist): Use that variable.
18365 (bison.s1): Substitute the Bison version into bison.simple.
18366
18367 * bison.simple: Add a Bison version comment.
18368
18369 1997-06-18 Richard Stallman <rms@gnu.org>
18370
18371 * src/main.c (fatal, warn, berror):
18372 Make error messages standard.
18373 (toomany): Improve error message text.
18374
18375 * 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:
18376 new.h renamed to alloc.h.
18377
18378 1997-06-18 Richard Stallman <rms@gnu.org>
18379
18380 * Makefile.in: new.h renamed to alloc.h.
18381
18382 1997-05-24 Richard Stallman <rms@gnu.org>
18383
18384 * src/lex.c (literalchar):
18385 Fix the code for escaping \, " and '.
18386
18387 (lex): Avoid trouble when there are many chars
18388 to discard in a char literal with just several chars in it.
18389
18390 1997-05-17 Richard Stallman <rms@gnu.org>
18391
18392 * src/bison.s1:
18393 Use malloc, if using alloca is troublesome.
18394 (YYSTACK_USE_ALLOCA): New flag macro.
18395 Define it for some systems and compilers.
18396 (YYSTACK_ALLOC): New macro.
18397 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18398 If it was malloc'd, free it.
18399
18400 1997-05-17 Richard Stallman <rms@gnu.org>
18401
18402 * bison.simple:
18403 Use malloc, if using alloca is troublesome.
18404 (YYSTACK_USE_ALLOCA): New flag macro.
18405 Define it for some systems and compilers.
18406 (YYSTACK_ALLOC): New macro.
18407 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18408 If it was malloc'd, free it.
18409
18410 1997-04-23 Richard Stallman <rms@gnu.org>
18411
18412 * src/bison.s1:
18413 (alloca) [__hpux]: Always define as __builtin_alloca.
18414
18415 1997-04-23 Richard Stallman <rms@gnu.org>
18416
18417 * bison.simple:
18418 (alloca) [__hpux]: Always define as __builtin_alloca.
18419
18420 1997-04-22 Richard Stallman <rms@gnu.org>
18421
18422 * src/bison.s1:
18423 [__hpux]: Include alloca.h (right for HPUX 10)
18424 instead of declaring alloca (right for HPUX 9).
18425
18426 * src/bison.s1 (__yy_memcpy):
18427 Declare arg `count' as unsigned int.
18428 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18429
18430 1997-04-22 Richard Stallman <rms@gnu.org>
18431
18432 * bison.simple:
18433 [__hpux]: Include alloca.h (right for HPUX 10)
18434 instead of declaring alloca (right for HPUX 9).
18435
18436 * bison.simple (__yy_memcpy):
18437 Declare arg `count' as unsigned int.
18438 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18439
18440 1997-01-03 Richard Stallman <rms@gnu.org>
18441
18442 * src/allocate.c: [__STDC__ or _MSC_VER]:
18443 Declare calloc and realloc to return void *.
18444
18445 1997-01-02 Richard Stallman <rms@gnu.org>
18446
18447 * src/system.h:
18448 [_MSC_VER]: Include stdlib.h and process.h.
18449 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
18450
18451 * src/main.c (main): Return FAILURE as a value.
18452 (printable_version): Declare arg as int, not char.
18453
18454 1997-01-02 Richard Stallman <rms@gnu.org>
18455
18456 * Makefile.in (dist):
18457 Explicitly check for symlinks, and copy them.
18458
18459 1996-12-19 Richard Stallman <rms@gnu.org>
18460
18461 * src/files.c:
18462 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
18463
18464 1996-12-18 Paul Eggert <eggert@gnu.org>
18465
18466 * src/bison.s1 (yyparse):
18467 If __GNUC__ and YYPARSE_PARAM are both defined,
18468 declare yyparse to have a void * argument.
18469
18470 1996-12-18 Paul Eggert <eggert@gnu.org>
18471
18472 * bison.simple (yyparse):
18473 If __GNUC__ and YYPARSE_PARAM are both defined,
18474 declare yyparse to have a void * argument.
18475
18476 1996-12-17 Richard Stallman <rms@gnu.org>
18477
18478 * src/reduce.c (nbits): Add some casts.
18479
18480 1996-08-12 Richard Stallman <rms@gnu.org>
18481
18482 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
18483
18484 1996-08-12 Richard Stallman <rms@gnu.org>
18485
18486 * bison.simple: Test _MSDOS as well as _MSDOS_.
18487
18488 1996-07-31 Richard Stallman <rms@gnu.org>
18489
18490 * src/bison.s1:
18491 [__sun && __i386]: Include alloca.h.
18492
18493 1996-07-31 Richard Stallman <rms@gnu.org>
18494
18495 * bison.simple:
18496 [__sun && __i386]: Include alloca.h.
18497
18498 1996-07-30 Richard Stallman <rms@gnu.org>
18499
18500 * src/bison.s1: Comment change.
18501
18502 * src/bison.s1: Test _MSDOS_, not MSDOS.
18503
18504 1996-07-30 Richard Stallman <rms@gnu.org>
18505
18506 * bison.simple: Comment change.
18507
18508 * bison.simple: Test _MSDOS_, not MSDOS.
18509
18510 1996-06-01 Richard Stallman <rms@gnu.org>
18511
18512 * 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:
18513 Insert `_' macro around many string constants.
18514
18515 * src/main.c:
18516 Insert `_' macro around many string constants.
18517
18518 (main): Call setlocale, bindtextdomain and textdomain.
18519
18520 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
18521 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
18522 [ENABLE_NLS]: Include libintl.h.
18523 [ENABLE_NLS] (gettext): Define.
18524 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
18525 (N_, PACKAGE, LOCALEDIR): New macros.
18526
18527 1996-06-01 Richard Stallman <rms@gnu.org>
18528
18529 * POTFILES.in: New file.
18530
18531 * Makefile.in (allocate.o):
18532 Define target explicitly.
18533
18534 * Makefile.in (CFLAGS): Set to @CFLAGS@.
18535 (LDFLAGS): Set to @LDFLAGS@.
18536 (configure): Run autoconf only if preceding `cd' succeeds.
18537 (bison.s1): Redirect output to temporary file then move the
18538 temporary to the target, rather than redirecting directly to bison.s1.
18539 (clean): Remove config.status and config.log.
18540 (distclean): Don't remove config.status here.
18541
18542 1996-05-12 Richard Stallman <rms@gnu.org>
18543
18544 * src/bison.s1:
18545 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18546
18547 1996-05-12 Richard Stallman <rms@gnu.org>
18548
18549 * bison.simple:
18550 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18551
18552 1996-05-11 Richard Stallman <rms@gnu.org>
18553
18554 * src/bison.s1 (__yy_memcpy):
18555 Really reorder the args, as was supposedly done on Feb 14 1995.
18556 (yyparse): Calls changed accordingly.
18557
18558 1996-05-11 Richard Stallman <rms@gnu.org>
18559
18560 * Makefile.in (dist): Don't use $(srcdir).
18561
18562 * bison.simple (__yy_memcpy):
18563 Really reorder the args, as was supposedly done on Feb 14 1995.
18564 (yyparse): Calls changed accordingly.
18565
18566 1996-01-27 Richard Stallman <rms@gnu.org>
18567
18568 * src/output.c (output_rule_data):
18569 Test YYERROR_VERBOSE in the conditional
18570 around the definition of ttyname.
18571
18572 1995-12-29 Richard Stallman <rms@gnu.org>
18573
18574 * src/bison.s1:
18575 Fix line numbers in #line commands.
18576
18577 1995-12-29 Richard Stallman <rms@gnu.org>
18578
18579 * bison.simple:
18580 Fix line numbers in #line commands.
18581
18582 1995-12-27 Richard Stallman <rms@gnu.org>
18583
18584 * src/bison.s1 (YYPARSE_PARAM_DECL):
18585 In C++, make it always null.
18586 (YYPARSE_PARAM_ARG): New macro.
18587 (yyparse): Use YYPARSE_PARAM_ARG.
18588
18589 1995-12-27 Richard Stallman <rms@gnu.org>
18590
18591 * bison.simple (YYPARSE_PARAM_DECL):
18592 In C++, make it always null.
18593 (YYPARSE_PARAM_ARG): New macro.
18594 (yyparse): Use YYPARSE_PARAM_ARG.
18595
18596 1995-11-29 Richard Stallman <rms@gnu.org>
18597
18598 * doc/bison.texinfo:
18599 Describe literal string tokens, %raw, %no_lines, %token_table.
18600
18601 1995-11-29 Daniel Hagerty <hag@gnu.org>
18602
18603 * doc/bison.texinfo: Fixed update date
18604
18605 1995-10-16 Richard Stallman <rms@gnu.org>
18606
18607 * src/version.c: Version 1.25.
18608
18609 1995-10-16 Richard Stallman <rms@gnu.org>
18610
18611 * NEWS: *** empty log message ***
18612
18613 1995-10-16 Richard Stallman <rms@gnu.org>
18614
18615 * doc/bison.1, doc/bison.rnh:
18616 Add new options.
18617
18618 1995-10-15 Richard Stallman <rms@gnu.org>
18619
18620 * src/vmsgetargs.c, src/getargs.c:
18621 Added -n, -k, and -raw switches.
18622 (noparserflag, toknumflag, rawtoknumflag): New variables.
18623
18624 * src/symtab.h (SALIAS):
18625 New #define for adding aliases to %token.
18626 (struct bucket): Added `alias' field.
18627
18628 * src/reduce.c (reduce_grammar):
18629 Revise error message.
18630 (print_notices): Remove final `.' from error message.
18631
18632 * src/reader.c (reader_output_yylsp):
18633 New function.
18634 (readgram): Use `#if 0' around code that accepted %command
18635 inside grammar rules: The documentation doesn't allow it,
18636 and it will fail since the %command processors scan for the next %.
18637 (parse_token_decl): Extended the %token
18638 declaration to allow a multi-character symbol as an alias.
18639 (parse_thong_decl): New function.
18640 (read_declarations): Added %thong declarations.
18641 (read_declarations): Handle NOOP to deal with allowing
18642 % declarations as another means to specify the flags.
18643 (readgram): Allow %prec prior to semantics embedded in a rule.
18644 (skip_to_char, read_declarations, copy_definition)
18645 (parse_token_decl, parse_start_decl, parse_type_decl)
18646 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
18647 (get_type_name, copy_guard, copy_action, readgram)
18648 (get_type, packsymbols): Revised most error messages.
18649 Changed `fatal' to `warnxxx' to avoid aborting for error.
18650 Revised and use multiple warnxxx functions to avoid using VARARGS1.
18651 (read_declarations): Improve the error message for
18652 an invalid character. Do not abort.
18653 (read_declarations, copy_guard, copy_action): Use
18654 printable_version to avoid unprintable characters in printed output.
18655 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
18656 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
18657 Allow the type of a non-terminal can be given
18658 more than once, as long as all specifications give the same type.
18659
18660 * src/output.c:
18661 (output_headers, output_trailers, output, output_gram)
18662 (output_rule_data): Implement noparserflag variable.
18663 Implement toknumflag variable.
18664 (output): Call reader_output_yylsp to output LTYPESTR.
18665
18666 * src/main.c (main):
18667 If reader sees an error, don't process the grammar.
18668 (fatals): Updated to not use VARARGS1.
18669 (printable_version, int_to_string, warn, warni, warns, warnss)
18670 (warnsss): New error reporting functions. Avoid abort for error.
18671
18672 * src/lex.h:
18673 Added THONG and NOOP for alias processing.
18674 Added SETOPT for the new code that allows setting options with %flags.
18675
18676 * src/lex.c:
18677 Include getopt.h. Add some extern decls.
18678 (safegetc): New function to deal with EOF gracefully.
18679 (literalchar); new function to deal with reading \ escapes.
18680 (lex): Use literalchar.
18681 (lex): Implemented "..." tokens.
18682 (literalchar, lex, parse_percent_token): Made tokenbuffer
18683 always contain the token. This includes growing the token
18684 buffer while reading an integer.
18685 (parse_percent_token): Replaced if-else statement with percent_table.
18686 (parse_percent_token): Added % declarations as another
18687 way to specify the flags -n, -l, and -r. Also added hooks for
18688 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
18689 major changes to files.c.
18690 (lex) Retain in the incoming stream a character following
18691 an incorrect '/'.
18692 (skip_white_space, lex): Revised most error messages
18693 and changed fatal to warn to avoid aborting.
18694 (percent_table): Added %thong declarations.
18695
18696 * src/gram.h: Comment changes.
18697
18698 * src/files.c (openfiles, open_extra_files, done):
18699 Add faction flag
18700 and actfile file. Handle noparserflag. Both for -n switch.
18701
18702 * src/conflicts.c (resolve_sr_conflict):
18703 Remove use of alloca.
18704
18705 1995-06-01 Jim Meyering <meyering@gnu.org>
18706
18707 * doc/bison.texinfo: *** empty log message ***
18708
18709 1995-05-06 Richard Stallman <rms@gnu.org>
18710
18711 * src/bison.s1: Comment change.
18712
18713 1995-05-06 Richard Stallman <rms@gnu.org>
18714
18715 * bison.simple: Comment change.
18716
18717 1995-05-03 Richard Stallman <rms@gnu.org>
18718
18719 * src/version.c: Version now 1.24.
18720
18721 * src/bison.s1: Change distribution terms.
18722
18723 * src/version.c: Version now 1.23.
18724
18725 1995-05-03 Richard Stallman <rms@gnu.org>
18726
18727 * doc/bison.texinfo:
18728 Rewrite "Conditions for Using Bison".
18729 Update version to 1.24.
18730
18731 1995-05-03 Richard Stallman <rms@gnu.org>
18732
18733 * bison.simple: Change distribution terms.
18734
18735 1995-02-23 Richard Stallman <rms@gnu.org>
18736
18737 * src/files.c: Test __VMS_POSIX as well as VMS.
18738
18739 1995-02-14 Jim Meyering <meyering@gnu.org>
18740
18741 * src/bison.s1 (__yy_memcpy):
18742 Renamed from __yy_bcopy to avoid
18743 confusion. Reverse FROM and TO arguments to be consistent with
18744 those of memcpy.
18745
18746 1995-02-14 Jim Meyering <meyering@gnu.org>
18747
18748 * bison.simple (__yy_memcpy):
18749 Renamed from __yy_bcopy to avoid
18750 confusion. Reverse FROM and TO arguments to be consistent with
18751 those of memcpy.
18752
18753 1994-11-10 David J. MacKenzie <djm@gnu.org>
18754
18755 * NEWS: reformat
18756
18757 * NEWS: New file.
18758
18759 * Makefile.in (DISTFILES): Include NEWS.
18760
18761 * Makefile.in (DISTFILES):
18762 Include install-sh, not install.sh.
18763
18764 * configure.in: Update to Autoconf v2 macro names.
18765
18766 1994-10-05 David J. MacKenzie <djm@gnu.org>
18767
18768 * Makefile.in: fix typo
18769
18770 * Makefile.in (prefix, exec_prefix):
18771 Let configure set them.
18772
18773 1994-09-28 David J. MacKenzie <djm@gnu.org>
18774
18775 * Makefile.in: Set datadir to $(prefix)/share.
18776
18777 1994-09-15 Richard Stallman <rms@gnu.org>
18778
18779 * src/bison.s1:
18780 Update copyright notice and GPL version.
18781
18782 1994-09-15 Richard Stallman <rms@gnu.org>
18783
18784 * bison.simple:
18785 Update copyright notice and GPL version.
18786
18787 1994-07-12 Richard Stallman <rms@gnu.org>
18788
18789 * src/reduce.c, src/reader.c:
18790 entered into RCS
18791
18792 1994-05-05 David J. MacKenzie <djm@gnu.org>
18793
18794 * Makefile.in: entered into RCS
18795
18796 1994-03-26 Richard Stallman <rms@gnu.org>
18797
18798 * src/bison.s1: entered into RCS
18799
18800 1994-03-26 Richard Stallman <rms@gnu.org>
18801
18802 * bison.simple: entered into RCS
18803
18804 1994-03-25 Richard Stallman <rms@gnu.org>
18805
18806 * src/main.c: entered into RCS
18807
18808 1994-03-24 Richard Stallman <rms@gnu.org>
18809
18810 * src/conflicts.c: entered into RCS
18811
18812 1994-01-02 Richard Stallman <rms@gnu.org>
18813
18814 * Makefile.in: *** empty log message ***
18815
18816 1993-11-21 Richard Stallman <rms@gnu.org>
18817
18818 * src/bison.s1: *** empty log message ***
18819
18820 1993-11-21 Richard Stallman <rms@gnu.org>
18821
18822 * doc/bison.texinfo: entered into RCS
18823
18824 * doc/bison.texinfo: *** empty log message ***
18825
18826 1993-11-21 Richard Stallman <rms@gnu.org>
18827
18828 * bison.simple: *** empty log message ***
18829
18830 1993-10-25 David J. MacKenzie <djm@gnu.org>
18831
18832 * doc/bison.texinfo: *** empty log message ***
18833
18834 1993-10-19 Richard Stallman <rms@gnu.org>
18835
18836 * src/bison.s1: *** empty log message ***
18837
18838 1993-10-19 Richard Stallman <rms@gnu.org>
18839
18840 * bison.simple: *** empty log message ***
18841
18842 1993-10-14 Richard Stallman <rms@gnu.org>
18843
18844 * src/bison.s1: *** empty log message ***
18845
18846 1993-10-14 Richard Stallman <rms@gnu.org>
18847
18848 * bison.simple: *** empty log message ***
18849
18850 1993-09-14 David J. MacKenzie <djm@gnu.org>
18851
18852 * doc/bison.texinfo: *** empty log message ***
18853
18854 1993-09-13 Noah Friedman <friedman@gnu.org>
18855
18856 * Makefile.in: *** empty log message ***
18857
18858 1993-09-10 Richard Stallman <rms@gnu.org>
18859
18860 * src/conflicts.c: *** empty log message ***
18861
18862 * src/system.h: entered into RCS
18863
18864 1993-09-10 Richard Stallman <rms@gnu.org>
18865
18866 * doc/bison.1: entered into RCS
18867
18868 1993-09-06 Noah Friedman <friedman@gnu.org>
18869
18870 * src/version.c: entered into RCS
18871
18872 1993-09-06 Noah Friedman <friedman@gnu.org>
18873
18874 * Makefile.in: *** empty log message ***
18875
18876 1993-07-30 David J. MacKenzie <djm@gnu.org>
18877
18878 * Makefile.in: *** empty log message ***
18879
18880 1993-07-24 Richard Stallman <rms@gnu.org>
18881
18882 * src/bison.s1: *** empty log message ***
18883
18884 1993-07-24 Richard Stallman <rms@gnu.org>
18885
18886 * bison.simple: *** empty log message ***
18887
18888 1993-07-08 David J. MacKenzie <djm@gnu.org>
18889
18890 * Makefile.in: *** empty log message ***
18891
18892 1993-07-04 Richard Stallman <rms@gnu.org>
18893
18894 * src/bison.s1: *** empty log message ***
18895
18896 1993-07-04 Richard Stallman <rms@gnu.org>
18897
18898 * bison.simple: *** empty log message ***
18899
18900 1993-06-26 David J. MacKenzie <djm@gnu.org>
18901
18902 * src/getargs.c: entered into RCS
18903
18904 1993-06-26 David J. MacKenzie <djm@gnu.org>
18905
18906 * doc/bison.texinfo: *** empty log message ***
18907
18908 * doc/bison.1: New file.
18909
18910 1993-06-25 Richard Stallman <rms@gnu.org>
18911
18912 * src/getargs.c: New file.
18913
18914 1993-06-16 Richard Stallman <rms@gnu.org>
18915
18916 * src/bison.s1: *** empty log message ***
18917
18918 1993-06-16 Richard Stallman <rms@gnu.org>
18919
18920 * bison.simple: *** empty log message ***
18921
18922 1993-06-03 Richard Stallman <rms@gnu.org>
18923
18924 * src/bison.s1: New file.
18925
18926 1993-06-03 Richard Stallman <rms@gnu.org>
18927
18928 * doc/bison.texinfo: *** empty log message ***
18929
18930 1993-06-03 Richard Stallman <rms@gnu.org>
18931
18932 * bison.simple: New file.
18933
18934 1993-05-19 Richard Stallman <rms@gnu.org>
18935
18936 * doc/bison.texinfo: New file.
18937
18938 1993-05-07 Noah Friedman <friedman@gnu.org>
18939
18940 * Makefile.in: *** empty log message ***
18941
18942 1993-04-28 Noah Friedman <friedman@gnu.org>
18943
18944 * src/reader.c: *** empty log message ***
18945
18946 1993-04-23 Noah Friedman <friedman@gnu.org>
18947
18948 * src/alloc.h: entered into RCS
18949
18950 1993-04-20 David J. MacKenzie <djm@gnu.org>
18951
18952 * src/version.c: *** empty log message ***
18953
18954 * src/files.c, src/allocate.c:
18955 entered into RCS
18956
18957 * src/reader.c: *** empty log message ***
18958
18959 * src/lex.c: entered into RCS
18960
18961 * src/conflicts.c: New file.
18962
18963 * src/symtab.c: entered into RCS
18964
18965 * src/alloc.h: New file.
18966
18967 * src/LR0.c: entered into RCS
18968
18969 1993-04-18 Noah Friedman <friedman@gnu.org>
18970
18971 * src/reader.c: New file.
18972
18973 * src/version.c: *** empty log message ***
18974
18975 1993-04-18 Noah Friedman <friedman@gnu.org>
18976
18977 * Makefile.in: *** empty log message ***
18978
18979 1993-04-17 Noah Friedman <friedman@gnu.org>
18980
18981 * Makefile.in: *** empty log message ***
18982
18983 1993-04-15 Richard Stallman <rms@gnu.org>
18984
18985 * src/main.c, src/files.c:
18986 New file.
18987
18988 1993-04-15 Noah Friedman <friedman@gnu.org>
18989
18990 * configure.in: entered into RCS
18991
18992 * configure.in: *** empty log message ***
18993
18994 * configure.in: New file.
18995
18996 1993-04-14 Richard Stallman <rms@gnu.org>
18997
18998 * Makefile.in: New file.
18999
19000 1993-04-13 Richard Stallman <rms@gnu.org>
19001
19002 * src/version.c: New file.
19003
19004 1993-03-25 Richard Stallman <rms@gnu.org>
19005
19006 * src/output.c: entered into RCS
19007
19008 1992-09-25 Richard Stallman <rms@gnu.org>
19009
19010 * configure.bat: entered into RCS
19011
19012 1992-06-22 Richard Stallman <rms@gnu.org>
19013
19014 * src/vmsgetargs.c: entered into RCS
19015
19016 1992-06-22 Richard Stallman <rms@gnu.org>
19017
19018 * doc/bison.rnh: entered into RCS
19019
19020 1992-04-20 David J. MacKenzie <djm@gnu.org>
19021
19022 * README: entered into RCS
19023
19024 1992-01-22 Richard Stallman <rms@gnu.org>
19025
19026 * src/machine.h: entered into RCS
19027
19028 1991-12-21 Richard Stallman <rms@gnu.org>
19029
19030 * src/lalr.c, src/closure.c:
19031 entered into RCS
19032
19033 1991-12-20 Richard Stallman <rms@gnu.org>
19034
19035 * src/state.h: entered into RCS
19036
19037 1991-12-18 Richard Stallman <rms@gnu.org>
19038
19039 * src/print.c, src/nullable.c, src/derives.c:
19040 entered into RCS
19041
19042 1991-11-03 David J. MacKenzie <djm@gnu.org>
19043
19044 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
19045 entered into RCS
19046
19047 1988-09-09 Richard Stallman <rms@gnu.org>
19048
19049 * src/bison.hairy: entered into RCS
19050
19051 1987-12-16 Richard Stallman <rms@gnu.org>
19052
19053 * REFERENCES: entered into RCS
19054
19055
19056 -----
19057
19058 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
19059 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
19060 Free Software Foundation, Inc.
19061
19062 Copying and distribution of this file, with or without
19063 modification, are permitted provided the copyright notice and this
19064 notice are preserved.
19065
19066 $Id$