]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
2007-01-30 Paolo Bonzini <bonzini@gnu.org>
[bison.git] / ChangeLog
... / ...
CommitLineData
12007-01-30 Paolo Bonzini <bonzini@gnu.org>
2
3 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4 Complain if the value does not match empty, "true" or "false".
5 * data/c++.m4: Adjust default definitions of %define variables.
6 * data/java.m4: Adjust default definitions of %define variables.
7 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
8 to above behavior.
9 * tests/input.at (Boolean %define variables): Test new behavior.
10
112007-01-29 Paolo Bonzini <bonzini@gnu.org>
12
13 * NEWS: Mention java.
14 * TODO: Remove things that are done.
15 * bootstrap.conf: Add javacomp-script and javaexec-script.
16 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
17
18 * data/Makefile.am: Add new files.
19 * data/java-skel.m4: New.
20 * data/java.m4: New.
21 * data/lalr1.java: New.
22
23 * doc/bison.texinfo: Put "A Complete C++ Example" under
24 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
25 under Other Languages.
26
27 * src/getargs.c (valid_languages): Add Java.
28 * src/getargs.h (struct bison_language): Update size of string fields.
29
30 * tests/Makefile.am: Add java.at.
31 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
32 * tests/java.at: New.
33 * tests/testsuite.at: Include it.
34
352007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
36
37 Clean up.
38 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
39 at_directive_argv arguments so these no longer have to be global
40 variables. Also, update the implementation for the following changes.
41 (fail_for_at_directive_too_many_args,
42 fail_for_at_directive_too_few_args): Add at_directive_name argument.
43 (at_directive_name): Remove as at_directive_argv[0] will be used for
44 this now.
45 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
46 for the directive name.
47 (at_directive_argc, at_directive_argv): Make these local within
48 skel_lex instead of global.
49 (INITIAL): Update directive start action for above changes.
50 (SC_AT_DIRECTIVE_ARG): Rename to...
51 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
52 (SC_AT_DIRECTIVE_SKIP_WS): Update.
53 (scan_skel): Move yylex_destroy to...
54 (skel_scanner_free): ... here.
55 * tests/skeletons.at (installed skeleton file name): Rename to...
56 (installed skeleton file names): ... this.
57
582007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
59
60 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
61 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
62 Summary" not "Directives".
63 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
64 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
65 since the former is now the more complete one.
66 (Prologue Alternatives): Likewise and do the same for %defines.
67 (Table of Symbols): Add summary of %code, add summary of %define, and
68 move full %code documentation to...
69 (Decl Summary): ... here for consistency with other entries in these
70 sections.
71 Move %define entry in order to keep this list alphabetized.
72 Reword %define entry a little to put less emphasis on the skeleton
73 concept, which most users shouldn't have to think about.
74
752007-01-26 Paul Eggert <eggert@cs.ucla.edu>
76
77 Adjust to recent gnulib changes.
78 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
79 Add string.h, string_.h, unistd_.h, wchar_.h.
80 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
81 * src/system.h: Don't include <stpcpy.h>; this is now done by
82 <string.h>.
83
842007-01-23 Paolo Bonzini <bonzini@gnu.org>
85
86 Simplify implementation of unqualified %code, implement macros for
87 uniform treatment of boolean %define flags. Document %define.
88 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
89 b4_percent_code_ifdef): New.
90 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
91 * data/c++.m4: Define default value for global_tokens_and_yystype.
92 * data/glr.cc: Likewise.
93 * data/location.cc: Use b4_percent_define_flag_if.
94
95 * doc/bison.texinfo (Decl Summary): Document %define.
96
97 * src/parse-gram.y (Unqualified %code): Change muscle name to
98 b4_percent_code().
99 (content.opt): Default to empty.
100
1012007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
102
103 Implement support for relative and absolute skeleton file names.
104 Discussed starting at
105 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
106 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
107 (Bison Options): Document in --skeleton entry.
108 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
109 full_skeleton can't necessarily hold all of pkgdatadir.
110 If the specified skeleton file name contains a `/', don't prepend
111 pkgdatadir.
112 * src/parse-gram.y (prologue_declaration): If the specified skeleton
113 file name contains a `/', prepend the grammar file directory.
114 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
115 * skeletons.at: New file.
116 (relative skeleton file names): New test case.
117 (installed skeleton file names): New test case.
118 * tests/testsuite.at: Include skeletons.at.
119
120 * bootstrap: Update copyright to 2007.
121
1222007-01-17 Paolo Bonzini <bonzini@gnu.org>
123
124 * bootstrap: Remove occurrences of .#bootmp from the files.
125
1262007-01-17 Akim Demaille <akim@epita.fr>
127
128 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
129 nonterminals.
130 Use per-type %printer.
131
1322007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
133
134 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
135 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
136 djgpp/config.site, src/files.c, src/files.h, src/main.c,
137 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
138 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
139 tests/glr-regression.at, tests/input.at, tests/local.at,
140 tests/output.at, tests/torture.at: Update copyright to 2007.
141
1422007-01-16 Akim Demaille <akim@epita.fr>
143
144 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
145 error code.
146 (Calc++ Scanner): Exit with failure if we can't open the input
147 file.
148 Accept "-" standing for stdin.
149 (Calc++ Top Level): Print the result only if the parsing was
150 successful.
151
1522007-01-16 Akim Demaille <akim@epita.fr>
153
154 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
155
1562007-01-15 Paolo Bonzini <bonzini@gnu.org>
157 and Joel E. Denny <jdenny@ces.clemson.edu>
158
159 Clean up %define and %code implementation in M4 some. Most
160 importantly, rename all related macros to be in the b4_percent_define
161 and b4_percent_code namespaces. Also, complete support for `.' in
162 %define variable names and %code qualifiers.
163 * data/bison.m4 (b4_check_user_names): Check for special
164 "SKELETON-NAMESPACE(name)" macros instead of using two nested
165 m4_foreach loops.
166 (b4_get_percent_define, b4_get_percent_code): Rename to...
167 (b4_percent_define_get, b4_percent_code_get): ... these.
168 Extend documentation with examples.
169 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
170 b4_percent_define_skeleton_variables and
171 b4_percent_code_skeleton_qualifiers.
172 Expect any value for the %define variable `foo' to be stored in the
173 macro named `b4_percent_define(foo)'; expect any %code blocks for the
174 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
175 expect any unqualified %code blocks to be stored in a macro named
176 `b4_percent_code_unqualified'.
177 Use m4_indir so that %define variable names and %code qualifiers can
178 contain `.', which is allowed by the grammar parser.
179 (b4_percent_define_default): New macro to set a default value for a
180 %define variable.
181 (m4_wrap): Update wrapped code, and fix some underquoting.
182 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
183 Expect grammar uses of %define variables and %code qualifiers to be
184 defined in b4_percent_define_user_variables and
185 b4_percent_code_user_qualifiers.
186 * data/c++.m4: Use b4_percent_define_default rather than
187 m4_define_default. Fix some underquoting. Skeleton usage of %define
188 variable define_location_comparison now implies skeleton usage of
189 %define variable filename_type.
190 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
191 data/push.c, data/yacc.c: Update macro names.
192 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
193 muscle names.
194
1952007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
196
197 DJGPP specific issues.
198
199 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
200 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
201
2022007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
203
204 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
205 run parsers in all tests so that Valgrind is invoked during
206 maintainer-check-valgrind.
207 (Duplicate representation of merged trees): Free all semantic values.
208 (Duplicated user destructor for lookahead): Likewise.
209
2102007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
211
212 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
213 command-line prefix.
214 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
215 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
216 miss Valgrind messages.
217 (Exploding the Stack Size with Malloc): Likewise.
218
2192007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
220
221 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
222 locals. Reported by Juan Manuel Guerrero at
223 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
224 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
225 Fix some indentation also.
226 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
227 explaining this issue.
228
2292007-01-09 Paolo Bonzini <bonzini@gnu.org>
230 and Joel E. Denny <jdenny@ces.clemson.edu>
231
232 Simplify union and prologue handling, and escape union and lex/parse
233 params with digraphs.
234 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
235 values to the empty string since these are no longer guaranteed
236 initialized by the front-end.
237 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
238 braces around b4_user_stype since this is no longer done by the
239 front-end.
240 * src/files.c, src/files.h (pre_prologue_obstack,
241 post_prologue_obstack): Remove.
242 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
243 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
244 with digraphs. This fixes lex params and parse params.
245 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
246 * src/output.c (prepare): Remove muscle insertion of the prologues.
247 (output): Remove freeing of pre_prologue_obstack and
248 post_prologue_obstack.
249 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
250 than prologue_augment for prologue parsing so you don't need prologue
251 obstacks.
252 (grammar_declaration): For %union RHS, use `braceless' instead of
253 "{...}" so that braces are already stripped and code is escaped with
254 digraphs.
255 * src/reader.c (prologue_augment): Remove.
256 (reader): Remove initialization of pre_prologue_obstack and
257 post_prologue_obstack.
258 * src/reader.h (prologue_augment): Remove.
259
260 * data/c.m4: Remove stray parenthesis.
261
2622007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
263
264 Remove quotes from variables names in %define directives and from
265 qualifiers in %code directives, and restrict the characters that are
266 allowed in them to M4-friendly ones. For %define, continue to support
267 the quoted form as a deprecated feature. Discussed starting at
268 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
269 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
270 %code.
271 * doc/bison.texinfo (Prologue Alternatives): Update.
272 (Bison Declaration Summary): In %defines entry, update mention of
273 `%code requires' and `%code provides'.
274 (C++ Location Values): Update %define uses.
275 (Calc++ Parser Interface): Likewise.
276 (Calc++ Parser): Likewise, and update `%code requires' uses.
277 (Table of Symbols): Update %code documentation.
278 * src/parse-gram.y (prologue_declaration): For %define variables, use
279 `variable' instead of `STRING'.
280 (grammar_declaration): For %code qualifiers, use `ID' instead of
281 `STRING'.
282 (variable): New nonterminal that takes an `ID' or a `STRING'.
283 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
284 and %define uses.
285 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
286 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
287 (%define errors): Update %define uses.
288
2892007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
290
291 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
292 instead of muscle_insert for %define values so that M4-special
293 characters are replaced with digraphs.
294 * tests/input.at (%define errors): Extend to check weird values.
295
2962007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
297
298 Instead of having skeletons declare all valid %define variables and
299 %code qualifiers, provide macros that retrieve the associated values
300 and build these lists automatically. Thus Bison will now warn when a
301 variable or qualifier is not used by the skeleton in the current
302 invocation regardless of whether it might sometimes be used by that
303 skeleton in other invocations. Also, move all %define value macros to
304 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
305 form, which is replaced by %code.
306 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
307 (b4_check_user_names): ... this, and change the series of valid name
308 arguments to a single list argument for names used in the skeleton
309 similar to the existing list argument for names used in the grammar.
310 Warn instead of complaining.
311 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
312 values and %code code, to format %code code properly, and to build
313 lists of all %define variables and %code qualifiers used in the
314 skeleton: b4_skeleton_percent_define_variables and
315 b4_skeleton_percent_code_qualifiers.
316 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
317 Remove, and...
318 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
319 the skeleton names lists can finish building first. In place of
320 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
321 expect the lists b4_user_percent_define_variables and
322 b4_user_percent_code_qualifiers.
323 * data/c++.m4: Where setting default values for b4_parser_class_name,
324 b4_location_type, b4_filename_type, b4_namespace, and
325 b4_define_location_comparison, update their names to the
326 b4_percent_define_ namespace.
327 * data/glr.c: Don't use b4_check_percent_define_variables and
328 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
329 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
330 (b4_parser_class_name, b4_namespace): Define these using
331 b4_get_percent_define for parser_class_name and namespace.
332 * data/location.cc: Use b4_get_percent_define.
333 * data/push.c: Don't use b4_check_percent_define_variables and
334 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
335 * data/yacc.c: Likewise, and don't call m4_exit in
336 b4_use_push_for_pull_if or m4_wrap code will never execute.
337 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
338 Rename to...
339 (muscle_grow_user_name_list): ... this for consistency with the
340 terminology used in bison.m4.
341 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
342 %define variable names, and rename muscle used_percent_define_variables
343 to user_percent_define_variables.
344 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
345 user_percent_code_qualifiers.
346 (content): Remove.
347 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
348 {CODE} form is no longer accepted.
349 * tests/input.at (Reject bad %code qualifiers): Rename to...
350 (Reject unused %code qualifiers): ... this, and update test output.
351 (%define error): Update test output.
352
3532007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
354
355 Check for unrecognized %define variables similar to checking for
356 unrecognized %code qualifiers. Check for redefined %define variables.
357 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
358 generalizes...
359 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
360 (b4_check_percent_define_variables): New, also wraps it.
361 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
362 variables using b4_check_percent_define_variables.
363 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
364 all those exercised in the test suite and all those listed in the
365 `Default values' section of c++.m4. Are there others?
366 * data/push.c, data/yacc.c: Declare no valid %define variables.
367 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
368 similar to muscle_find, but it works even when the muscle stores a
369 const value.
370 (muscle_grow_used_name_list): New function for constructing the used
371 name list muscles that b4_check_for_unrecognized_names requires.
372 * src/parse-gram.y (prologue_declaration): Warn if a variable is
373 %define'd more than once. Define the b4_used_percent_define_variables
374 muscle with muscle_grow_used_name_list.
375 (grammar_declaration): Abbreviate %code code with
376 muscle_grow_used_name_list.
377 * tests/input.at (%define errors): New.
378
3792007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
380
381 Provide warn_at, complain_at, and fatal_at function callbacks to the
382 skeletons, and use this for %code qualifier complaints.
383 * data/bison.m4 (b4_error_at): New, invoked by...
384 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
385 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
386 @fatal_at(...@) directives.
387 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
388 qualifiers in b4_used_percent_code_qualifiers and to use
389 b4_complain_at.
390 * src/location.c, src/location.h (boundary_set_from_string): New global
391 function.
392 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
393 function.
394 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
395 to b4_used_percent_code_qualifiers.
396 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
397 function.
398 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
399 (lineno): Rename to...
400 (out_lineno): ... this so I don't misunderstand it again.
401 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
402 here; these newlines are in the input but not the output file.
403 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
404 (at_directive_perform): ... this new static function, and add handling
405 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
406 directives.
407 * tests/input.at (Reject bad %code qualifiers): Update test output with
408 locations and extend.
409
410 * tests/output.at (Output file name: [, Output file name: ]): Remove
411 bogus comment about these tests failing.
412
4132007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
414
415 Clean up b4_check_percent_code_qualifiers a little.
416 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
417 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
418 documentation and add examples.
419 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
420 qualifiers here.
421
4222007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
423
424 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
425 unreliable -- especially when they're hidden inside another macro.
426 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
427 data/c.m4: Remove m4_divert(-1).
428 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
429 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
430 m4_divert_push(0) and m4_divert_pop(0).
431 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
432 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
433 pushed and popped by m4sugar, should be first on the stack.
434
435 Provide warn, complain, and fatal function callbacks to the skeletons.
436 This provides more flexibility than m4_fatal, improves the error
437 message format, and captures messages for translation. Discussed
438 starting at
439 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
440 * data/bison.m4 (b4_error): New, invoked by...
441 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
442 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
443 directives. Because these M4 macros might be called when the current
444 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
445 the previous removal of uses of m4_divert, which caused trouble.
446 (b4_check_percent_code_qualifiers): Use b4_complain instead of
447 m4_fatal to report unrecognized %code qualifiers.
448 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
449 push parser requests.
450 * data/glr.c: Use b4_complain instead of m4_fatal to report
451 non-deterministic push parser requests.
452 Update @output usage to @output(...@) form.
453 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
454 report missing %defines. Update @output usage to @output(...@) form.
455 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
456 @output(...@) form.
457 * src/main.c (main): Invoke skel_scanner_free.
458 * src/scan-skel.h (skel_scanner_free): Prototype new function.
459 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
460 obstack_for_string from flex-scanner.h.
461 (YY_DECL): Use to declare skel_lex static.
462 (decode_at_digraphs): Remove; now handled in the new
463 SC_AT_DIRECTIVE_ARG start condition.
464 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
465 functions.
466 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
467 at_directive_argv): New static globals.
468 (INITIAL): Use fail_for_invalid_at.
469 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
470 recognize the start of a generalized `@directive(...@)' form and
471 start...
472 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
473 directive args (using the new obstack_for_string), to decode the
474 contained @ diagraphs, and to perform the directive. It recognizes
475 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
476 @output(...@).
477 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
478 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
479 `@,'.
480 (scan_skel): Initialize obstack_for_string on the first call.
481 (skel_scanner_free): New function to free obstack_for_string.
482 * tests/input.at (Reject bad %code qualifiers): Update test output.
483
4842007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
485
486 Consolidate the 4 prologue alternative directives (%code, %requires,
487 %provides, and %code-top) into a single %code directive with an
488 optional qualifier field. Discussed at
489 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
490 * NEWS (2.3a+): Rewrite the existing entry for the prologue
491 alternatives.
492 * doc/bison.texinfo (Prologue Alternatives): Update.
493 (Decl Summary): Update to %code "requires" and %code "provides".
494 (Calc++ Parser): Update to %code "requires".
495 (Table of Symbols): Remove entries for %requires, %provides, and
496 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
497 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
498 are replaced by b4_percent_code_provides and b4_percent_code_requires,
499 which are skeleton-specific.
500 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
501 declare what %code qualifiers it supports and to complain if any other
502 qualifiers were used in the grammar.
503 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
504 and b4_user_code([b4_percent_code_provides]) in place of
505 b4_user_requires and b4_user_provides.
506 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
507 Add b4_user_code([b4_percent_code_top]) and
508 b4_user_code([b4_percent_code]).
509 Invoke b4_check_percent_code_qualifiers.
510 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
511 PERCENT_REQUIRES): Remove.
512 (grammar_declaration): Remove RHS's for %code-top, %provides, and
513 %requires. Rewrite the %code RHS as the unqualified form defining the
514 muscle b4_percent_code. Add another RHS for the qualified %code form,
515 which defines muscles of the form b4_percent_code_QUALIFIER and the
516 b4_used_percent_code_qualifiers muscle.
517 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
518 PERCENT_REQUIRES): Remove.
519 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
520 %code "requires" and %code "provides".
521 * tests/input.at (Reject bad %code qualifiers): New.
522
5232007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
524
525 Use the new code_props interface for destructors and printers.
526 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
527 printer_location members, and change the type of the destructor and
528 printer members to code_props.
529 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
530 symbol_printer_get, semantic_type_destructor_set,
531 semantic_type_printer_set, default_tagged_destructor_set,
532 default_tagless_destructor_set, default_tagged_printer_set,
533 default_tagless_printer_set): Use code_props in arguments and return
534 types in place of char const * and location.
535 (symbol_destructor_location_get, symbol_printer_location_get): Remove
536 since the locations are now contained in the return of
537 symbol_destructor_get and symbol_printer_get.
538 * src/output.c (symbol_destructors_output, symbol_printers_output):
539 Replace with...
540 (symbol_code_props_output): ... this to eliminate duplicate code.
541 (output_skeleton): Update to use symbol_code_props_output.
542 * src/reader.c (symbol_should_be_used): Update use of
543 symbol_destructor_get.
544 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
545 Update uses of the various _destructor_set and _printer_set functions.
546 * src/symtab.c: (default_tagged_destructor_location,
547 default_tagless_destructor_location, default_tagged_printer_location,
548 default_tagless_printer_location): Remove since we...
549 (default_tagged_destructor, default_tagless_destructor,
550 default_tagged_printer, default_tagless_printer): ... change the type
551 of these to code_props.
552 (symbol_new, semantic_type_new, symbol_destructor_set,
553 semantic_type_destructor_set, symbol_destructor_get,
554 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
555 symbol_check_alias_consistency, default_tagged_destructor_set,
556 default_tagless_destructor_set, default_tagged_printer_set,
557 default_tagless_printer_set): Update.
558 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
559 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
560 code_props members.
561 (symbol_print): Use SYMBOL_CODE_PRINT.
562
5632007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
564
565 Use the new code_props interface for rule actions.
566 * src/symlist.h (symbol_list): Replace action, action_location, and
567 used members with a code_props action_props member.
568 * src/reader.c (symbol_should_be_used, grammar_rule_check,
569 grammar_midrule_action, grammar_current_rule_merge_set,
570 grammar_current_rule_symbol_append, packgram): Update.
571 * src/scan-code.h (translate_rule_action): Remove, no longer used.
572 * src/scan-code.l (handle_action_dollar): Update.
573 (translate_rule_action): Remove, no longer used.
574 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
575
5762007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
577
578 Use the new code_props interface in parse-gram.y.
579 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
580 Update all uses of translate_* functions to use the new code_props
581 interface and to use gram_scanner_last_string_free and
582 code_scanner_last_string_free where possible.
583 (grammar_declaration): symbol_list_destructor_set and
584 symbol_list_printer_set now perform the translation, so don't do it
585 here. Use gram_scanner_last_string_free where possible.
586 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
587 translate_code): Remove, no longer used.
588 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
589 symbol_list_printer_set): Perform code translation here rather than
590 depending on the caller to do so.
591
592 * src/symlist.h (struct symbol_list): Correct some documentation typos.
593 * src/scan-gram.h (gram_last_string): Remove declaration.
594 * src/scan-gram.l (last_string): Declare it static.
595
5962007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
597
598 Encapsulate code properties and related functionality for the various
599 destructors, printers, and actions into a code_props structure and
600 interface. This patch merely implements code_props in scan-code.h and
601 scan-code.l. Future patches will rewrite other modules to use it.
602 Discussed starting at
603 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
604 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
605 consistently initialize const structs that have an empty location
606 field.
607 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
608 to ensure consistency.
609 * src/scan-code.h (code_props): New structure.
610 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
611 function, macro, and const global variable for initializing a
612 code_props with no code.
613 (code_props_plain_init, code_props_symbol_action_init,
614 code_props_rule_action_init, code_props_translate_code): The rest of
615 the new code_props functional interface. Among other things, the init
616 functions set the code_props kind field so that
617 code_props_translate_code will know whether to behave like
618 translate_symbol_action, translate_rule_action, or translate_code.
619 These old translate functions must remain until all other modules are
620 updated to use the new code_props interface.
621 (code_scanner_last_string_free): New function similar to
622 gram_scanner_last_string_free.
623 (code_scanner_free): Add documentation.
624 * src/scan-code.l: Implement the new interface.
625 (code_lex): Make it static, add a code_props* argument, and remove the
626 rule argument.
627 (last_string): New static global similar to the one in scan-gram.l.
628 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
629 instead of rule.
630 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
631 code_props since Bison may one day use this information for destructors
632 and printers.
633 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
634 (handle_action_dollar): Use symbol_list_n_get and set used flag
635 directly since symbol_list_n_used_set is removed.
636 (translate_action): Add a code_props* argument and remove the rule,
637 action, and location arguments. Pass the code_props* on to code_lex.
638 (translate_rule_action, translate_symbol_action, translate_code):
639 Rewrite as wrappers around the new code_props interface.
640 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
641 it would eventually need to break the encapsulation of code_props.
642
6432007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
644
645 * etc/.cvsignore: New.
646
6472007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
648
649 Add maintainer-push-check to run maintainer-check using push parsing in
650 place of pull parsing where available.
651 * Makefile.am (maintainer-push-check): New.
652 * data/bison.m4 (b4_use_push_for_pull_if): New.
653 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
654 appropriately based on their existing values.
655 (yypush_parse): Don't print push-parser-specific diagnostics if push
656 parsing is being used in place of pull parsing.
657 * data/yacc.c: If push parsing should replace pull parsing, redirect to
658 push.c.
659 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
660 variable, and insert b4_use_push_for_pull_flag into muscles.
661 * tests/Makefile.am (maintainer-push-check): New.
662
6632006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
664
665 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
666 (whether successful or failed) so that yypush_parse can be invoked
667 again to start a new parse using the same yypstate.
668 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
669 check multiple yypull_parse invocations on the same yypstate. For pull
670 mode, extend to check multiple yyparse invocations.
671 (Exploding the Stack Size with Alloca): Extend to try with
672 %push-pull-parser.
673 (Exploding the Stack Size with Malloc): Likewise.
674
675 * tests/calc.at (Simple LALR Calculator): Don't specify
676 %skeleton "push.c" since %push-pull-parser implies that now.
677 * tests/headers.at (export YYLTYPE): Don't check for the push
678 declarations. Otherwise, this test case can't be used to see if push
679 mode can truly emulate pull mode.
680 * tests/input.at (Torturing the Scanner): Likewise.
681 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
682 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
683 AT_YACC_IF, which now includes the case of push mode since %skeleton
684 need not be used for push mode. This will be more intuitive once
685 push.c is renamed to yacc.c.
686
6872006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
688
689 For push mode, convert yyparse from a macro to a function, invoke yylex
690 instead of passing a yylexp argument to yypull_parse, and don't
691 generate yypull_parse or yyparse unless %push-pull-parser is declared.
692 Discussed starting at
693 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
694 * data/bison.m4 (b4_pull_if): New.
695 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
696 * data/push.c: Improve M4 quoting a little.
697 (b4_generate_macro_args, b4_parenthesize): Remove.
698 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
699 any time a pull parser is requested.
700 Don't #define this as a wrapper around yypull_parse. Instead, when
701 both push and pull are requested, make it a function that does that
702 same thing.
703 (yypull_parse): If there's a b4_prefix, #define this to
704 b4_prefix[pull_parse] when both push and pull are requested.
705 Don't define this as a function unless both push and pull are
706 requested.
707 Remove the yylexp argument and hard-code yylex invocation instead.
708 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
709 %push-parser.
710 * src/getargs.c (pull_parser): New global initialized to true.
711 * getargs.h (pull_parser): extern it.
712 * src/output.c (prepare): Insert pull_flag muscle.
713 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
714 (prologue_declaration): Set both push_parser and pull_parser = true for
715 %push-pull-parser. Set push_parser = true and pull_parser = false for
716 %push-parser.
717 * src/scan-gram.l: Don't accept %push_parser as an alternative to
718 %push-parser since there's no backward-compatibility concern here.
719 Scan %push-pull-parser.
720 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
721 instead of %push-parser.
722 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
723 prototype it in the module that calls yyparse.
724 * tests/input.at (Torturing the Scanner): Likewise.
725 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
726
7272006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
728
729 Update etc/bench.pl. Optimize push mode a little (the yyn change
730 deserves most of the credit).
731 * Makefile.am (SUBDIRS): Add etc subdirectory.
732 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
733 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
734 yytoken, yyval, and yyloc declarations to...
735 (yyparse or yypush_parse): ... here to improve performance. For
736 yypush_parse invocations after the first, be sure to assign yyn its old
737 value again.
738 (yypstate_new): Don't bother initializing the yyresult field since the
739 initial value isn't used.
740 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
741 remove the #define that, in push mode, set it to yyps->NAME.
742 * etc/Makefile.am: New.
743 * etc/bench.pl: Remove and build it instead from...
744 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
745 "tests/bison" from the build directory by default rather than just
746 invoking "bison" from $PATH.
747 (calc_grammar): Update push parser code: don't declare yylval globally,
748 don't define yyparse_wrapper, and don't #define yyparse.
749 (bench_grammar): Update to check all working combinations of yacc.c,
750 push.c, impure, pure, pull, and push.
751
7522006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
753
754 For push mode, add pull wrappers around yypush_parse.
755 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
756 (yypull_parse): New function wrapping yypush_parse.
757 (yyparse): New #define wrapping yypull_parse.
758 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
759 is declared.
760 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
761 prototype yylex in the module that calls yyparse, and don't prototype
762 yyparse there. Otherwise, the yyparse expansion won't compile.
763 * tests/input.at (Torturing the Scanner): Likewise.
764
7652006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
766
767 Enable push parsers to operate in impure mode. Thus, %push-parser no
768 longer implies %pure-parser. The point of this change is to move
769 towards being able to test the push parser code by running the entire
770 test suite as if %push-parser had been declared.
771 * data/push.c (yypush_parse): For impure mode, remove the
772 yypushed_char, yypushed_val, and yypushed_loc arguments.
773 Instead, declare these as local variables initialized to the global
774 yychar, yylval, and yylloc.
775 For the first yypush_parse invocation only, restore the initial values
776 of these global variables when it's time to read a token since they
777 have been overwritten.
778 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
779 %push-parser.
780 * tests/calc.at (Simple LALR(1) Calculator): Always declare
781 %pure-parser along with %push-parser since this test case was designed
782 for pure push parsers.
783 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
784 (AT_YACC_OR_PUSH_IF): New.
785 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
786 add a note that it's still wrong for some cases (as it has been for a
787 while).
788 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
789 %push-parser no longer implies %pure-parser.
790
7912006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
792
793 Remove some unnecessary differences between the pull parser code and
794 the push parser code. This patch enables yynerrs in push mode.
795 * data/push.c: Reformat M4 a little.
796 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
797 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
798 because push mode is on. Instead, if pure mode is on, move yynerrs
799 to...
800 (b4_declare_parser_state_variables): ... here.
801 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
802 to yyps->NAME so it can be used in yypush_parse.
803 (yypush_parse): Don't omit uses of yynerrs in push mode.
804
8052006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
806
807 Fix bug such that the first pushed token's value and location are
808 sometimes overwritten (sometimes by %initial-action) before being used.
809 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
810 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
811 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
812 more closely mimic the pull parser logic.
813 Don't copy the pushed token to yychar, yylval, and yylloc until it's
814 time to read a token, which is after any initialization of yylval and
815 yylloc.
816 (gottoken): Rename label to...
817 (yyread_pushed_token): ... for clarity and to avoid infringing on the
818 user namespace.
819
8202006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
821
822 Rearrange initialization of the parser state variables so that the
823 skeleton doesn't have to have a copy for pull mode and another for push
824 mode. This patch also fixes at least a bug such that yylloc was not
825 initialized (with b4_location_initial_line and
826 b4_location_initial_column) upon calling yypush_parse. However, that
827 initialization now overwrites the first token's location;
828 %initial-action assigning @$ already did the same thing, and both bugs
829 will be fixed in a later patch.
830 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
831 (b4_declare_parser_state_variables): Remove initialization of yytoken,
832 yyss, yyvs, yyls, and yystacksize.
833 (yypstate_new): Remove initialization of some yypstate fields: yystate,
834 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
835 yylsp.
836 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
837 yyps->NAME so it can be used in yypush_parse.
838 (yyparse or yypush_parse): For yypush_parse, don't print the
839 "Starting parse" diagnostic for invocations after the first.
840 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
841 yypush_parse, only do it for the first invocation.
842 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
843 initialization to occur in yypush_parse but only on the first
844 invocation.
845
8462006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
847
848 * data/push.c: Add CPP guards around push parser declarations in both
849 the header and the code file.
850 In the code file, move the push parser declarations to the same place
851 they appear in the header file.
852 Clean up the M4 some, especially the inconsistent underquoting in
853 some b4_c_function_def and b4_c_function_decl uses.
854
8552006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
856
857 Encapsulate the push parser state variables into an M4 macro so the
858 push skeleton doesn't have to list them again for pull mode's yyparse.
859 For push mode, remove yypush_parse's local equivalents of these
860 variables to eliminate unnecessary copying between the two sets at
861 run-time. This patch also fixes at least a bug related to multiple
862 %initial-action invocations in push mode.
863 * data/push.c (b4_declare_parser_variables): Rename to...
864 (b4_declare_scanner_communication_variables): ... this for clarity and
865 update both uses.
866 (b4_declare_yyparse_variables): Remove and move its contents to the one
867 spot where it was invoked.
868 (b4_declare_parser_state_variables): New macro containing the parser
869 state variables required by push mode.
870 (struct yypstate): Replace all fields but yynew with
871 b4_declare_parser_state_variables.
872 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
873 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
874 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
875 (yyparse or yypush_parse): For yyparse in pull mode, replace local
876 parser state variable declarations with
877 b4_declare_parser_state_variables.
878 Don't initialize parser state variables when calling yypush_parse since
879 yypstate_new already does that.
880 Invoke the user's initial action only upon the first yypush_parse
881 invocation.
882 Remove all code that copies between the local parser state variables
883 and the yypstate.
884
8852006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
886
887 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
888 prevent a name collision in a future patch where these names will
889 sometimes be #define'd.
890 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
891 since it no longer has the same name as the existing argument.
892 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
893
8942006-12-19 Paolo Bonzini <bonzini@gnu.org>
895 and Joel E. Denny <jdenny@ces.clemson.edu>
896
897 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
898 that the argument is case-insensitive, and there's no `=' here.
899 For the %skeleton entry, mention that %language is better.
900 (Bison Options): Likewise for --language and --skeleton. Move the
901 --skeleton entry so that the `Tuning the parser' section is sorted
902 alphabetically on long options.
903 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
904 %language directive in detail here; cross-reference the %language
905 documentation instead.
906 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
907 `%require "2.3b"' so that the example is always up-to-date.
908 (Table of Symbols): Add entries for %language and %skeleton.
909 * examples/extexi (normalize): Instead of replacing every %require
910 argument with the current Bison version, just substitute for
911 `@value{VERSION}'. This guarantees that we're testing what actually
912 appears in the documentation.
913 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
914 rather than `@VERSION@'.
915
9162006-12-18 Paul Eggert <eggert@cs.ucla.edu>
917
918 * NEWS: Reword the %language news a bit, and put it earlier.
919
920 * src/getargs.c (skeleton_arg): Last arg is now location const *.
921 Rewrite to simplify the logic.
922 (language_argmatch): Likewise.
923 (program_name): We now own this var.
924 * src/getargs.h (struct bison_language): Use char[] rather than
925 const char *.
926
927 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
928 Java is supported.
929 * src/complain.c (program_name): Remove decl; no longer needed.
930 * src/main.c (program_name): Remove; now belongs to getargs.
931
9322006-12-18 Paolo Bonzini <bonzini@gnu.org>
933
934 * NEWS: Document %language.
935
936 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
937
938 * data/c-skel.m4, data/c++-skel.m4: New files.
939 * data/glr.c: Complain on push parsers.
940
941 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
942 over %skeleton.
943 (Decl Summary): Document %language and %skeleton.
944 (Command line): Document -L.
945
946 * examples/extexi: Rewrite %require directive.
947 * examples/calc++/Makefile.am: Pass VERSION to extexi.
948
949 * src/files.c (compute_exts_from_gc): Look in language structure
950 for .y extension.
951 (compute_file_name_parts): Check whether .tab should be added.
952 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
953 (language, skeleton_arg, language_argmatch): New.
954 (long_options): Add --language.
955 (getargs): Use skeleton_arg, add -L/--language.
956 * src/getargs.h: Include location.h.
957 (struct bison_language, language, skeleton_arg, language_argmatch): New.
958 * src/output.c (prepare): Pick default skeleton from struct language.
959 Don't dispatch C skeletons here.
960 * src/parse-gram.y (PERCENT_LANGUAGE): New.
961 (prologue_declaration): Add "%language" rule, use skeleton_arg.
962 * src/scan-gram.l ("%language"): New rule.
963
964 * tests/calc.at: Test %skeleton and %language.
965 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
966 (AT_GLR_IF): Look for %skeleton "glr.cc".
967 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
968 (AT_YACC_IF): Reject %language.
969
9702006-12-18 Paul Eggert <eggert@cs.ucla.edu>
971
972 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
973 since it wasn't used; only the typedef name 'semantic_type' is needed.
974 Also, omit trailing white space.
975
976 * bootstrap: Sync from coreutils.
977 (gnulib_extra_files): Add build-aux/announce.gen.
978 (slurp): Adjust .gitignore files like .cvsignore files.
979 * build-aux/announce-gen: Remove from CVS, since bootstrap
980 now creates this.
981
9822006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
983
984 Make %push-parser imply %pure-parser. This fixes several bugs; see
985 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
986 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
987 pure_parser = true.
988 * data/push.c: Don't bother testing b4_push_if when deciding whether
989 to expand b4_declare_parser_variables globally.
990 (yypush_parse): Likewise in here.
991
992 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
993 (yy_reduce_print): Reformat M4 for readability.
994
9952006-12-15 Bob Rossi <bob@brasko.net>
996 and Joel Denny <jdenny@ces.clemson.edu>
997
998 * data/push.c (yypstate): Add typedef, and update all uses of
999 struct yypstate to just yypstate.
1000 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
1001
10022006-12-14 Bob Rossi <bob@brasko.net>
1003
1004 * data/push.c (yypush_parse): Declare prototype regardless of
1005 %locations option.
1006
10072006-12-14 Bob Rossi <bob@brasko.net>
1008
1009 * data/push.c (yyparse): Remove the prototype and the #define when in
1010 push-parser mode.
1011
10122006-12-13 Bob Rossi <bob@brasko.net>
1013
1014 * data/push.c (yypstate_init): Rename to...
1015 (yypstate_new): ... this and use b4_c_function_def.
1016 (yypstate_delete): New.
1017 (yypush_parse): Change parameters yynval and yynlloc to be const.
1018 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
1019 yypstate_delete functions.
1020
10212006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
1022
1023 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
1024 strange test case titles. Reported by Bob Rossi.
1025
10262006-12-13 Paul Eggert <eggert@cs.ucla.edu>
1027
1028 * TODO: Add pointer to Sylvain Schmitz's work on static detection
1029 of potential ambiguities in GLR grammers.
1030
10312006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
1032
1033 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
1034 `bison ', use m4_index instead of m4_substr since chopping up a string
1035 containing M4-special characters causes problems here.
1036
1037 Fix a couple of bugs related to special characters in user-specified
1038 file names, and make it easier for skeletons to compute output file
1039 names with the same file name prefix as Bison-computed output file
1040 names.
1041 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
1042 b4_parser_file_name and b4_spec_defines_file instead of
1043 @output_parser_name@ and @output_header_name@, which are now redundant.
1044 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
1045 b4_parser_file_name, b4_spec_defines_file, and the new
1046 @basename(FILENAME@) instead of @output_parser_name@ and
1047 @output_header_name@, which inappropriately escaped the file names as
1048 C string literals.
1049 * src/files.c (all_but_ext): Remove static qualifier.
1050 (compute_output_file_names): Move `free (all_but_ext)' to...
1051 (output_file_names_free): ... here since all_but_ext is needed later.
1052 * src/files.h (all_but_ext): Extern.
1053 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
1054 exactly what MUSCLE_INSERT_STRING used to do.
1055 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
1056 characters are escaped properly.
1057 * src/output.c (prepare): Define muscle file_name_all_but_ext as
1058 all_but_ext.
1059 For pkgdatadir muscle, maintain previous functionality by using
1060 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
1061 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
1062 digraphs would never be expanded. Hopefully no one has M4-special
1063 characters in his Bison installation path.
1064 * src/scan-skel.l: Don't parse @output_header_name@ and
1065 @output_parser_name@ anymore since they're now redundant.
1066 In @output, use decode_at_digraphs.
1067 Parse a new @basename command that invokes last_component.
1068 (decode_at_digraphs): New.
1069 (BASE_QPUTS): Remove unused.
1070 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
1071 (Output file name): New tests.
1072
10732006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
1074
1075 Warn about output files that are generated by the skeletons and that
1076 conflict with other output files.
1077 * data/glr.c: Don't generate the header file here when glr.cc does.
1078 * src/files.c (file_names, file_names_count): New static globals.
1079 (compute_output_file_names): Invoke output_file_name_check for files
1080 not generated by the skeletons and remove existing checks.
1081 (output_file_name_check): New function that warns about conflicting
1082 output file names.
1083 (output_file_names_free): Free file_names.
1084 * src/files.h (output_file_name_check): Declare.
1085 * src/scan-skel.l: Invoke output_file_name_check for files generated by
1086 the skeletons.
1087 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
1088 (Conflicting output files): New tests.
1089
10902006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1091
1092 * doc/bison.texinfo: Fix a couple of typos.
1093
10942006-12-08 Bob Rossi <bob@brasko.net>
1095
1096 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
1097 Rename to...
1098 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
1099 update all uses.
1100 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
1101 (yypush_parse): Rename yypvars argument to yyps and remove redundant
1102 local pv.
1103 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
1104 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
1105
11062006-12-07 Bob Rossi <bob@brasko.net>
1107 and Joel Denny <jdenny@ces.clemson.edu>
1108
1109 * data/push.c (yypvarsinit): Change return type from void* to struct
1110 yypvars*. No longer cast to void* on return.
1111 (struct yypvars): Remove yylen since it need not be remembered between
1112 yypushparse invocations.
1113 (yypushparse): Don't copy between yylen and pv->yylen.
1114
11152006-12-05 Bob Rossi <bob@brasko.net>
1116
1117 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
1118 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
1119 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
1120 (struct yypvars): Remove b4_declare_parser_variables.
1121 (yypvarsinit): Remove init code for removed variables.
1122 (global scope): Do not declare b4_declare_parser_variables if
1123 push or pure mode.
1124 (yypushparse): Add b4_declare_parser_variables.
1125 Init new local variables, and remove init code for removed
1126 yypvars variables.
1127 (yyparse): Delete.
1128 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
1129 and yyparse for other modes.
1130 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
1131 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
1132 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
1133 (AT_PURE_LEX_IF): True if pure or push parser.
1134
11352006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
1136
1137 Document Yacc prologue alternatives and default %destructor's and
1138 %printer's as experimental. Don't mention Java yet. Discussed at
1139 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
1140 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
1141 (2.3a): Annotate this entry to say the old forms of these features were
1142 also experimental.
1143 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
1144 Table of Symbols): Say they're experimental. Comment out any mention
1145 of Java (we'll want this back eventually).
1146
11472006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1148
1149 Support a file name argument to %defines. Deprecate `=' in
1150 %file-prefix, %name-prefix, and %output. Discussed at
1151 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
1152 * NEWS (2.3a+): Mention.
1153 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
1154 form of %defines, and remove `=' from entries for %file-prefix,
1155 %name-prefix, and %output.
1156 * src/parse-gram.y (prologue_declaration): Implement.
1157 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
1158 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
1159 all but one occurrence of %name-prefix.
1160 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
1161 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
1162 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
1163 occurrence of each of %file-prefix and %output. Add check for %defines
1164 with argument.
1165 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
1166 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
1167 Remove the `=' from %output.
1168
11692006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
1170
1171 Don't escape $ in test case titles since Autoconf 2.61 now does that
1172 correctly.
1173 * tests/actions.at (Default %printer and %destructor are not for error
1174 or $undefined): Here.
1175 (Default %printer and %destructor are not for $accept): Here.
1176 * tests/input.at (Invalid $n and @n): Here.
1177
11782006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
1179
1180 Rename <!> to <>. Discussed starting at
1181 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
1182 * NEWS (2.3a+): Update.
1183 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
1184 Update.
1185 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
1186 * src/scan-gram.l (INITIAL): Implement.
1187 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
1188 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
1189 comment.
1190 * tests/actions.at (Default tagless %printer and %destructor,
1191 Default tagged and per-type %printer and %destructor,
1192 Default %printer and %destructor are not for error or $undefined,
1193 Default %printer and %destructor are not for $accept,
1194 Default %printer and %destructor for mid-rule values): Update.
1195 * tests/input.at (Default %printer and %destructor redeclared,
1196 Unused values with default %destructor): Update.
1197
11982006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1199
1200 Don't let %prec take a nonterminal.
1201 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
1202 token.
1203 * tests/input.at (%prec takes a token): New test checking that %prec
1204 won't take a nonterminal.
1205
12062006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1207
1208 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
1209 it was double-quoted.
1210 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
1211 grammar is maintained with Bison's highest standards.
1212 * src/getargs.c: Fix some typos in Doxygen comments.
1213
12142006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1215
1216 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
1217 later. Reported by Paul Eggert in
1218 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
1219 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
1220 * src/scan-code.l (translate_action): Don't bother invoking
1221 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
1222 (code_scanner_free): Instead of invoking
1223 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
1224 which frees more.
1225 * src/scan-gram.l (gram_scanner_free): Likewise.
1226 * src/scan-skel.l (scan_skel): Likewise.
1227
12282006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
1229
1230 * src/files.c (tr): Change return type to void.
1231 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
1232 has been called previously for the same key.
1233 (muscle_find): Return storage instead of value so that
1234 --enable-gcc-warnings doesn't produce warnings that the return discards
1235 const. aver that the value and storage are the same since storage
1236 could potentially be NULL when value is not.
1237 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
1238 same as 0.
1239
12402006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1241
1242 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
1243 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
1244 us a slightly cleaner distribution, and also works.
1245 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
1246 gnulib changes.
1247
12482006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
1249 and Paul Eggert <eggert@cs.ucla.edu>
1250
1251 Don't let Bison leak memory except when it complains.
1252 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
1253 (spec_defines_file, dir_prefix): Now char *, not const char *,
1254 since they are freed.
1255 * src/files.c: Likewise.
1256 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
1257 Likewise.
1258 (tr): Now operates in-place. All uses changed.
1259 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
1260 values.
1261 (compute_file_name_parts, compute_output_file_names): Don't store
1262 read-only data in variables that will be freed.
1263 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
1264 src_extension, and header_extension.
1265 (output_file_names_free): New public function to free
1266 spec_verbose_file, spec_graph_file, spec_defines_file,
1267 parser_file_name, and dir_prefix.
1268 * src/getargs.c (getargs): Don't store read-only data in variables that
1269 will be freed.
1270 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
1271 (which previously existed but was unused), and quotearg_free.
1272 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
1273 * src/muscle_tab.c: Likewise.
1274 (muscle_entry): Make the value char const *,
1275 and add a new storage member that is char * and can be freed.
1276 (muscle_entry_free): New private function.
1277 (muscle_init): Use it instead of free.
1278 (muscle_insert, muscle_grow): Update and use new storage member.
1279 (muscle_code_grow): Free the string passed to muscle_grow
1280 since it's not needed anymore.
1281 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
1282 add a new `char *code' member.
1283 ("{...}"): Declare semantic type as code.
1284 * src/scan-code.h (translate_rule_action):
1285 (translate_symbol_action, translate_code, translate_action): Return
1286 `char const *' rather than `char *' since external code should not free
1287 these strings.
1288 * src/scan-code.l: Likewise.
1289 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
1290 which is "{...}" in the parser.
1291 * tests/Makefile.am (maintainer-check-valgrind): Set
1292 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
1293 Valgrind.
1294 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
1295 complain.
1296 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
1297 expecting a non-zero exit status sets --leak-check=summary and
1298 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
1299 this case, and we don't want to hear about it.
1300
13012006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1302
1303 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
1304 instead of from the template, to simplify configuration a bit.
1305 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
1306 and m4/wint_t.m4, as they are needed with the latest gnulib.
1307
13082006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1309
1310 Disable unset/unused mid-rule value warnings by default, and recognize
1311 --warnings=midrule-values to enable them. Discussed starting at
1312 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
1313 * NEWS (2.3a+): Mention.
1314 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
1315 warnings): Add entry for midrule-values subargument.
1316 * src/reader.c (symbol_should_be_used): Don't return true just because
1317 the value is a set/used mid-rule value unless
1318 --warnings=midrule-values was specified.
1319 * tests/input.at (Unused values, Unused values before symbol
1320 declarations): Run tests with and without --warnings=midrule-values.
1321
1322 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
1323 than LIST_FREE directly.
1324
13252006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1326
1327 Finish implementing --warnings=error, which should not be implied by
1328 --warnings=all (or by its synonyms -W and --warnings without
1329 subarguments).
1330 * src/complain.c (set_warning_issued): New function to report that
1331 warnings are being treated as errors and to record an error if so.
1332 Invoke...
1333 (warn_at, warn): ... here.
1334 * src/getargs.c (warnings_args, warnings_types): Reorder so that
1335 "error - warnings are errors" does not appear above "all - all of the
1336 above".
1337 (getargs): For -W and --warnings without subarguments, don't let
1338 FLAGS_ARGMATCH set warnings_error in warnings_flag.
1339 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
1340
13412006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1342
1343 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
1344 empty subargument list. For example: `bison --warnings= parser.y'.
1345
13462006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1347
1348 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
1349 the parser header file so that gcc doesn't warn.
1350
13512006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1352
1353 Split the default %destructor/%printer into two kinds: <*> and <!>.
1354 Discussed starting at
1355 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
1356 * NEWS (2.3a+): Mention.
1357 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
1358 previous change today related to mid-rules.
1359 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
1360 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
1361 (TYPE_TAG_ANY): Add as <*>.
1362 (TYPE_TAG_NONE): Add as <!>.
1363 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
1364 for <*> and <!>.
1365 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
1366 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
1367 * src/symlist.c (symbol_list_default_new): Split into tagged and
1368 tagless versions.
1369 (symbol_list_destructor_set, symbol_list_printer_set): Split
1370 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
1371 SYMLIST_DEFAULT_TAGLESS.
1372 * src/symlist.h: Update symbol_list_default*_new prototypes.
1373 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
1374 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
1375 * src/symtab.c (default_destructor, default_destructor_location,
1376 default_printer, default_printer_location): Split each into tagged and
1377 tagless versions.
1378 (symbol_destructor_get, symbol_destructor_location_get,
1379 symbol_printer_get, symbol_printer_location_get): Implement tagged
1380 default and tagless default cases.
1381 (default_destructor_set, default_printer_set): Split each into tagged
1382 and tagless versions.
1383 * src/symtab.h: Update prototypes.
1384 * tests/actions.at (Default %printer and %destructor): Rename to...
1385 (Default tagless %printer and %destructor): ... this, and extend.
1386 (Per-type %printer and %destructor): Rename to...
1387 (Default tagged and per-type %printer and %destructor): ... this, and
1388 extend.
1389 (Default %printer and %destructor for user-defined end token): Extend.
1390 (Default %printer and %destructor are not for error or $undefined):
1391 Update.
1392 (Default %printer and %destructor are not for $accept): Update.
1393 (Default %printer and %destructor for mid-rule values): Extend.
1394 * tests/input.at (Default %printer and %destructor redeclared): Extend.
1395 (Unused values with default %destructor): Extend.
1396
13972006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1398
1399 Don't apply the default %destructor/%printer to an unreferenced midrule
1400 value. Mentioned at
1401 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
1402 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
1403 like $@n instead of just @n so that the default %destructor/%printer
1404 logic doesn't see them as user-defined symbols.
1405 (symbol_is_dummy): Check for both forms of the name.
1406 * src/reader.c (packgram): Remove the `$' from each midrule symbol
1407 name for which the midrule value is referenced in any action.
1408 * tests/actions.at (Default %printer and %destructor for mid-rule
1409 values): New test.
1410 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
1411 for change to dummy symbol names.
1412
14132006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1414
1415 Warn about unset midrule $$ if the corresponding $n is used.
1416 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
1417 $n usage.
1418 (packgram): Before invoking grammar_rule_check on any rule, make sure
1419 all actions have already been scanned in order to set `used' flags.
1420 Otherwise, checking that a midrule's $$ is set will not always work
1421 properly because the midrule check must forward-reference the midrule's
1422 parent rule.
1423 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
1424 warning.
1425
14262006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1427
1428 More improvements to the documentation of the prologue alternatives:
1429 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
1430 Bison manual.
1431 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
1432 some text to clarify the relative importance of the new directives and
1433 to show how these directives may be viewed as code labels.
1434
14352006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
1436
1437 Similar to the recently removed %before-header, add %code-top as the
1438 alternative to the pre-prologue. Mentioned at
1439 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
1440 Also, let the prologue alternatives appear in the grammar section.
1441 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
1442 (prologue_declaration): Move the existing prologue alternatives to...
1443 (grammar_declaration): ... here and add %code-top.
1444 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
1445
1446 Clean up and extend documentation for the prologue alternatives.
1447 * NEWS (2.3a+): Describe prologue alternatives.
1448 * doc/bison.texinfo (Prologue): Move discussion of prologue
1449 alternatives to...
1450 (Prologue Alternatives): ... this new section, and extend it to discuss
1451 all 4 directives in detail.
1452 (Table of Symbols): Clean up discussion of prologue alternatives and
1453 add %code-top.
1454
14552006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1456
1457 DJGPP specific issues.
1458
1459 * djgpp/config.bat: config.hin has been moved to lib. Adjust
1460 config.bat accordingly.
1461 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
1462 * djgpp/config.site: Likewise.
1463
14642006-10-16 Paolo Bonzini <bonzini@gnu.org>
1465
1466 Replace %*-header with %provides, %requires, %code. See discussion at
1467 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
1468
1469 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
1470 (b4_user_start_header): Remove.
1471 * data/glr.c: Use new macros instead of b4_*start_header
1472 and b4_*end_header.
1473 * data/glr.cc: Likewise.
1474 * data/lalr1.cc: Likewise.
1475 * data/push.c: Likewise.
1476 * data/yacc.c: Likewise.
1477
1478 * doc/bison.texinfo: Remove %before-header, rename
1479 %{start,end,after}-header to %requires, %provides, %code.
1480
1481 * src/parse-gram.y: Likewise (also rename token names accordingly).
1482 * src/scan-gram.l: Likewise.
1483 * tests/actions.at: Likewise.
1484
14852006-10-14 Paul Eggert <eggert@cs.ucla.edu>
1486
1487 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
1488 Problem reported by Joel E. Denny.
1489
14902006-10-14 Jim Meyering <jim@meyering.net>
1491
1492 (Sync from coreutils.)
1493 Work also when the working directory (with e.g. coreutils sources)
1494 is version controlled with git, rather than CVS.
1495 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
1496 rather than CVS.
1497 In messages and comments, say e.g., "checked-out sources",
1498 rather than "CVS sources".
1499 (version_controlled_file): New function. Work for git as well as
1500 for CVS. Don't use grep's -q option.
1501 (slurp): Call it here, in place of CVS-specific code.
1502
15032006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
1504
1505 Fix testsuite for ./configure --enable-gcc-warnings:
1506 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
1507 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
1508 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
1509 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
1510 * test/regression.at (Diagnostic that expects two alternatives):
1511 Likewise.
1512
15132006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1514
1515 * bootstrap.conf (gnulib_modules): Add config-h.
1516 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
1517 worry about HAVE_CONFIG_H.
1518 * lib/abitset.c: Likewise.
1519 * lib/bitset.c: Likewise.
1520 * lib/bitset_stats.c: Likewise.
1521 * lib/bitsetv-print.c: Likewise.
1522 * lib/bitsetv.c: Likewise.
1523 * lib/ebitset.c: Likewise.
1524 * lib/get-errno.c: Likewise.
1525 * lib/lbitset.c: Likewise.
1526 * lib/subpipe.c: Likewise.
1527 * lib/timevar.c: Likewise.
1528 * lib/vbitset.c: Likewise.
1529 * lib/bitset.c: Include "bitset.h" first, to test interface.
1530 * lib/bitset_stats.c: Include "bitset_stats.h" first.
1531 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
1532 * lib/bitsetv.c: Include "bitsetv.h" first.
1533 * lib/get-errno.c: Include "get-errno.h" first.
1534 * m4/.cvsignore: Add config-h.m4.
1535 * tests/actions.at (Default %printer and %destructor for ...):
1536 Adjust expected line numbers in output to reflect removal of #if
1537 HAVE_CONFIG_H lines.
1538 * tests/glr-regression.at (Missed %merge type warnings when ...):
1539 Likewise.
1540 * tests/regression.at (Braced code in declaration in rules section):
1541 Likewise.
1542 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
1543 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
1544 Include <config.h> unconditionally.
1545
1546 * bootstrap: Sync from coreutils, as follows:
1547
1548 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1549
1550 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
1551 variable was sometimes used without being initialized. This
1552 messed up the installation of the INSTALL file in some cases.
1553
1554 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1555
1556 * bootstrap (usage, main program, symlink_to_gnulib): Add option
1557 --copy. Inspired by a suggestion from Bruno Haible.
1558
1559 2006-10-03 Jim Meyering <jim@meyering.net>
1560
1561 * bootstrap: Undo last change to this file, since now gnulib-tool
1562 sticks with the automake default in generating dependencies.
1563
15642006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1565
1566 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
1567 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
1568
1569 * doc/bison.1: Add copyright notice.
1570
1571 * data/glr.c: Don't include <stdarg.h>; not used.
1572
1573 * NEWS: The -g and --graph options now output graphs in Graphviz
1574 DOT format, not VCG format.
1575 * doc/bison.1: Likewise.
1576 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
1577 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
1578 of this change in
1579 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
1580 * TODO: Remove Graphviz entry.
1581 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
1582 remove vcg.c, vcg.h, vcg_defaults.h.
1583 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
1584 * src/graphviz.c, src/graphviz.h: New files.
1585 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
1586 * src/files.h: Make comment more generic.
1587 * src/main.c (main): Likewise.
1588 * src/print_graph.h: Likewise.
1589 * src/getargs.c (usage): Make usage description more generic.
1590 * src/print_graph.c: Include graphviz.h rather than vcg.h.
1591 (static_graph, fgraph): Remove. All uses changed to pass
1592 arguments instead of sharing a static var.
1593 (print_core, print_actions, print_state, print_graph):
1594 Output graphviz format rather than VCG format.
1595 * tests/.cvsignore: Remove *.vcg; add *.dot.
1596 * tests/output.at: Expect *.dot files, not *.vcg files.
1597
1598 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
1599 accommodates the 2006-10-08 change.
1600
16012006-10-11 Bob Rossi <bob@brasko.net>
1602
1603 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
1604 (b4_yyssa, b4_yyerror_range): New macros.
1605 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
1606 (yypvarsinit): Remove init of removed fields.
1607 (yypushparse): Remove use of removed fields; use new macros instead.
1608
16092006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1610
1611 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
1612 in a push parser. Reindent slightly to match yacc.c better.
1613
16142006-10-11 Bob Rossi <bob@brasko.net>
1615
1616 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
1617 yymsg_alloc fields.
1618 (yypvarsinit, yypushparse): Remove init of removed fields.
1619 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
1620
16212006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1622
1623 * THANKS: Add Paolo Bonzini and Bob Rossi.
1624
16252006-10-08 Paolo Bonzini <bonzini@gnu.org>
1626
1627 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
1628 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
1629 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
1630 b4_define_user_cde and uses): Remove.
1631 (b4_comment, b4_prefix, b4_sync_start): New.
1632 * data/bison.m4: New file, with most of the content removed from c.m4.
1633 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
1634 * src/output.c (output_skeleton): Pass bison.m4.
1635 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
1636 only if specified.
1637
16382006-10-05 Paul Eggert <eggert@cs.ucla.edu>
1639
1640 Fix test failure reported by Tom Lane in
1641 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
1642 and try to make such failures easier to catch in the future.
1643 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
1644 that's now the caller's responsibility.
1645 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
1646 Set yychar = YYEOF if it's negative.
1647 * tests/actions.at (yylex): Abort if asked to read past EOF.
1648 * tests/conflicts.at (yylex): Likewise.
1649 * tests/cxx-type.at (yylex): Likewise.
1650 * tests/glr-regression.at (yylex): Likewise.
1651 * tests/input.at (yylex): Likewise.
1652 * tests/regression.at (yylex): Likewise.
1653 * tests/torture.at (yylex): Likewise.
1654
16552006-10-01 Paul Eggert <eggert@cs.ucla.edu>
1656
1657 Fix problems with translating English-language diagnostics.
1658 * bootstrap: Fix bug introduced in recent bootstrap changes, with
1659 respect to bison-runtime pot generation. The YY_ stuff
1660 wasn't being captured.
1661 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
1662 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
1663 * runtime-po/POTFILES.in: Add data/push.c.
1664
16652006-09-29 Paul Eggert <eggert@cs.ucla.edu>
1666
1667 Merge bootstrap changes from coreutils.
1668
1669 2006-09-28 Jim Meyering <jim@meyering.net>
1670
1671 Automatically generated dependencies are important even
1672 when all of the sources in a directory come from gnulib.
1673 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
1674 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
1675
1676 2006-09-23 Jim Meyering <jim@meyering.net>
1677
1678 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
1679
1680 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1681
1682 * bootstrap: Add support for --force.
1683 (usage): New function. Describe usage less tersely.
1684 (CVS_only_file): New var.
1685
16862006-09-21 Paul Eggert <eggert@cs.ucla.edu>
1687
1688 * data/push.c (YYPUSH_MORE): Make it an enum instead.
1689 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
1690 Adjust white space and comments to match GNU style better.
1691
16922006-09-20 Bob Rossi <bob@brasko.net>
1693
1694 * data/push.c (yyresult_get): Remove function.
1695 (YYPUSH_MORE): Add #define.
1696 (yypushparse): Modify return value.
1697
16982006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1699
1700 * stamp-h.in: Remove; no longer needed.
1701 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
1702 Remove config.h, config.hin, intl (no longer created).
1703 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
1704 stamp-h1.
1705
1706 Sync bootstrap from coreutils, as follows:
1707
1708 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
1709
1710 * bootstrap (symlink_to_gnulib): New function.
1711 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
1712 to copies-of-gnulib.
1713 (cp_mark_as_generated, slurp, gnulib_files):
1714 Avoid making a copy if it's the same as the old version.
1715 (gnulib_files): Add support for this variable (used by Bison).
1716
17172006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1718
1719 * src/getargs.c (usage): Rework to use conventions similar to
1720 coreutils, to make translation a bit easier and the code a bit
1721 smaller. Problem reported by Tim Van Holder.
1722
17232006-09-15 Paul Eggert <eggert@cs.ucla.edu>
1724
1725 Use some of gnulib's new modules, taken from coreutils.
1726
1727 * bootstrap: Sync from coreutils, except add support for gnulib_files.
1728 * bootstrap.conf: New file.
1729 (gnulib_modules): Add configmake, inttypes, unistd.
1730 (XGETTEXT_OPTIONS): Add complain, complain_at,
1731 fatal, fatal_at, warn, warn_at, unexpected_end.
1732 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
1733 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
1734 (gl_EARLY): Add.
1735 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
1736 (gl_INIT): Add
1737 (GNULIB_AUTOCONF_SNIPPET): Remove.
1738 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
1739 the pickiest.
1740 * lib/.cvsignore: Add inttypes_.h.
1741 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
1742 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
1743 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
1744 no-longer-necessary initializations.
1745 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
1746 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
1747 use the unistd module.
1748 * src/system.h: Likewise.
1749 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
1750 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
1751 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
1752 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
1753 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
1754 * src/system.h: Include inttypes.h unconditionally, now that we
1755 use the inttypes module. Don't bother to include stdint.h, since
1756 inttypes.h now does that for us.
1757 (LOCALEDIR): Remove, now that we use the configmake module.
1758 * src/getargs.c: Include configmake.h.
1759 * src/main.c: Likewise.
1760 * src/output.c: Likewise.
1761 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
1762 not from $abs_top_builddir, since config.h moved.
1763
1764
1765 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
1766 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
1767
1768 * src/parse-gram.y (symbol_declaration): Don't put statements
1769 before declarations; it's not portable to C89.
1770 * src/scan-code.l (handle_action_at): Likewise.
1771
1772 * src/scan-code.l: Always initialize braces_level; the old code
1773 left it uninitialized and therefore had undefined behavior.
1774
1775 Don't attempt to redefine 'assert', since it runs afoul of
1776 systems where standard headers (mistakenly) include <assert.h>.
1777 Instead, define and use our own alternative, called 'aver'.
1778 * src/reader.c: Don't include assert.h, since we no longer
1779 use assert.
1780 * src/scan-code.l: Likewise.
1781 * src/system.h (assert): Remove, replacing with....
1782 (aver): New function, taking a bool arg. All uses changed.
1783 * src/tables.c (pack_vector): Ensure that aver arg is bool,
1784 not merely an integer.
1785
17862006-09-15 Bob Rossi <bob@brasko.net>
1787
1788 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
1789 * data/c.m4 (YYPUSH): New.
1790 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
1791 * src/getargs.c (push_parser): New var.
1792 * src/getargs.h (push_parser): New declaration.
1793 * src/output.c (prepare): Add macro insertion of `push_flag'.
1794 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
1795 (prologue_declaration): Parse %push-parser.
1796 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
1797 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
1798 list of removed lines from the traces observed.
1799 (AT_CHECK_CALC_LALR): Added push parser tests.
1800
18012006-09-13 Paul Eggert <eggert@cs.ucla.edu>
1802
1803 * NEWS: Version 2.3a.
1804 * configure.ac (AC_INIT): Likewise.
1805
1806 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
1807 "#define YYSTYPE int" that caused "make maintainer-check" to fail
1808 due to header ordering dependencies. I don't know why the #define
1809 was there.
1810
1811 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
1812 runtime cost when YYDEBUG is not defined, and so that some tests
1813 that used to fail now work. Problem and initial suggestion by
1814 Paolo Bonzini.
1815 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
1816 * data/glr.cc (b4_parser_class_name):
1817 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
1818 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
1819 (yydebug_) [YYDEBUG]: New member.
1820 (yycdebug_): Now defined only if YYDEBUG.
1821 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
1822 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
1823 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
1824 if YYYDEBUG.
1825 (debug_stream, set_debug_stream, debug_level, set_debug_level):
1826 Define only if YYDEBUG.
1827 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
1828 set_debug_level.
1829 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
1830 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
1831 AT_CHECK_CALC_GLR_CC that are working now.
1832
18332006-09-12 Paul Eggert <eggert@cs.ucla.edu>
1834
1835 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
1836 We don't need them in glr.cc, and glr.c defines them.
1837 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
1838 assumes that defining it to anything is the same as defining
1839 it to 1. Problem reported by Paolo Bonzini.
1840
18412006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
1842
1843 * data/c.m4 (b4_null, b4_case): Define.
1844 * src/output.c (prepare_symbols): Use b4_null.
1845 (user_actions_output): Use b4_case.
1846
18472006-09-11 Paul Eggert <eggert@cs.ucla.edu>
1848
1849 * data/glr.c (b4_shared_declarations): Put start-header first,
1850 before any #includes that we generate, so that feature-test
1851 macros work. Problem reported by Michael Deutschmann in
1852 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
1853 * data/lalr1.cc: Likewise.
1854 * doc/bison.texinfo (Prologue): Document that feature-test macros
1855 should be defined before any Bison declarations.
1856 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
1857 that depend on location.hh after, not before, Bison decls, since
1858 we now include location.hh after the first user prologue.
1859
1860 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
1861 Sander Brandenburg in
1862 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
1863 Also, fix minor white space and comment issues.
1864 (Prologue): Mention that it's better to define feature-test macros
1865 before Bison declarations. Problem reported by Michael Deutschmann.
1866
1867 * README-cvs: Fix typo: "&" should be "&&". Problem reported
1868 by Jim Meyering.
1869 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
1870 This adjusts to recent gnulib changes.
1871
18722006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1873
1874 Finish implementation of per-type %destructor/%printer. Discussed
1875 starting at
1876 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
1877 and
1878 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
1879 * NEWS (2.3+): Add a description of this feature to the default
1880 %destructor/%printer description.
1881 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
1882 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1883 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
1884 list node contains a semantic type.
1885 * src/symtab.c, src/symtab.h: Extend with a table that associates
1886 semantic types with their %destructor's and %printer's.
1887 (semantic_type_from_uniqstr, semantic_type_get,
1888 semantic_type_destructor_set, semantic_type_printer_set): New functions
1889 composing the public interface of that table.
1890 (symbol_destructor_get, symbol_destructor_location_get,
1891 symbol_printer_get, symbol_printer_location_get): If there's no
1892 per-symbol %destructor/%printer, look up the per-type before trying
1893 the default.
1894 * tests/actions.at (Per-type %printer and %destructor): New test case.
1895 * tests/input.at (Default %printer and %destructor redeclared):
1896 Extend to check that multiple occurrences of %symbol-default in a
1897 single %destructor/%printer declaration is an error.
1898 (Per-type %printer and %destructor redeclared, Unused values with
1899 per-type %destructor): New test cases.
1900
19012006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1902
1903 Require default %destructor/%printer to be declared using
1904 %symbol-default instead of an empty symbol list, and start working on
1905 new per-type %destructor/%printer. Discussed at
1906 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
1907 * NEWS (2.3+): Add %symbol-default to example.
1908 * bison.texinfo (Freeing Discarded Symbols): Likewise.
1909 (Table of Symbols): Add entry for %symbol-default.
1910 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
1911 (generic_symlist, generic_symlist_item): New nonterminals for creating
1912 a list in which each item is a symbol, semantic type, or
1913 %symbol-default.
1914 (grammar_declaration): Use generic_symlist in %destructor and %printer
1915 declarations instead of symbols.1 or an empty list.
1916 (symbol_declaration, precedence_declaration, symbols.1): Update actions
1917 for changes to symbol_list.
1918 * src/reader.c: Update for changes to symbol_list.
1919 * src/scan-code.l: Likewise.
1920 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
1921 * src/symlist.c, src/symlist.h: Extend such that a list node may
1922 represent a semantic type or a %symbol-default in addition to just an
1923 ordinary symbol. Add switched functions for setting %destructor's and
1924 %printer's.
1925 * tests/actions.at, tests/input.at: Add %symbol-default to all default
1926 %destructor/%printer declarations.
1927
19282006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
1929
1930 Whether the default %destructor/%printer applies to a particular symbol
1931 isn't a question of whether the user *declares* that symbol (in %token,
1932 for example). It's a question of whether the user by any means
1933 *defines* the symbol at all (by simply using a char token, for
1934 example). $end is defined by Bison whereas any other token with token
1935 number 0 is defined by the user. The error token is always defined by
1936 Bison regardless of whether the user declares it with %token, but we
1937 may one day let the user define error as a nonterminal instead.
1938 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
1939 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
1940 the meaning of "user-defined".
1941 * tests/actions.at (Default %printer and %destructor for user-declared
1942 end token): Rename to...
1943 (Default %printer and %destructor for user-defined end token): ...
1944 this.
1945
1946 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
1947 computation of whether to apply the default, don't maintain a list of
1948 every Bison-defined symbol. Instead, just check for a first character
1949 of '$', which a user symbol cannot have, and check for the error token.
1950
19512006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
1952
1953 Don't apply the default %destructor or %printer to the error token,
1954 $undefined, or $accept. This change fits the general rule that the
1955 default %destructor and %printer are only for user-declared symbols,
1956 and it solves several difficulties that are described in the new test
1957 cases listed below.
1958 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
1959 * tests/actions.at (Default %printer and %destructor are not for error
1960 or $undefined, Default %printer and %destructor are not for $accept):
1961 New test cases.
1962
19632006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
1964
1965 Allow %start after the first rule.
1966 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
1967 when parsing the first rule.
1968 (check_and_convert_grammar): Search for it here after all grammar
1969 declarations have been parsed. Skip midrules, which have dummy LHS
1970 nonterminals.
1971 * src/symtab.c (symbol_is_dummy): New function.
1972 * src/symtab.h (symbol_is_dummy): Declare it.
1973 * tests/input.at (%start after first rule): New test.
1974
19752006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1976
1977 Redo some of the previous commit: add back the ability to use
1978 non-aliased/undeclared string literals since it might be useful to
1979 those declaring %token-table.
1980 * src/reader.c (check_and_convert_grammar): Undo changes in previous
1981 commit: don't worry about complaints from symbols_pack.
1982 * src/symtab.c (symbol_new, symbol_class_set,
1983 symbol_check_alias_consistency): Undo changes in previous commit: count
1984 each string literal as a new symbol and token, assign it a symbol
1985 number, and don't complain about non-aliased string literals.
1986 (symbols_pack): Since symbol_make_alias still does not decrement symbol
1987 and token counts but does still set aliased tokens to the same number,
1988 symbol_pack_processor now leaves empty slots in the symbols array.
1989 Remove those slots.
1990 * tests/regression.at (Undeclared string literal): Remove test case
1991 added in previous commit since non-aliased string literals are allowed
1992 again.
1993 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
1994 remove unnecessary string literal declarations.
1995 * tests/sets.at (Firsts): Likewise.
1996
19972006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1998
1999 Don't allow an undeclared string literal, but allow a string literal to
2000 be used before its declaration.
2001 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
2002 symbols_pack complained.
2003 * src/symtab.c (symbol_new): Don't count a string literal as a new
2004 symbol.
2005 (symbol_class_set): Don't count a string literal as a new token, and
2006 don't assign it a symbol number since symbol_make_alias does that.
2007 (symbol_make_alias): It's not necessary to decrement the symbol and
2008 token counts anymore. Don't assume that an alias declaration occurs
2009 before any uses of the identifier or string, and thus don't assert that
2010 one of them has the highest symbol number so far.
2011 (symbol_check_alias_consistency): Complain if there's a string literal
2012 that wasn't declared as an alias.
2013 (symbols_pack): Bail if symbol_check_alias_consistency failed since
2014 symbol_pack asserts that every token has been assigned a symbol number
2015 although undeclared string literals have not.
2016 * tests/regression.at (String alias declared after use, Undeclared
2017 string literal): New test cases.
2018 (Characters Escapes, Web2c Actions): Declare string literals as
2019 aliases.
2020 * tests/sets.at (Firsts): Likewise.
2021
20222006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
2023
2024 In the grammar scanner, STRING_FINISH unclosed constructs and return
2025 them to the parser in order to improve error messages.
2026 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
2027 SC_BRACED_CODE, SC_PROLOGUE): Implement.
2028 * tests/input.at (Unclosed constructs): New test case.
2029 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
2030 seen.
2031
2032 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
2033 unused global.
2034
20352006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
2036
2037 Handle string aliases for character tokens correctly.
2038 * src/symtab.c (symbol_user_token_number_set): If the token has an
2039 alias, check and set its alias's user token number instead of its own,
2040 which is set to indicate the alias. Previously, every occurrence of
2041 the character token in the grammar overwrote that alias indicator with
2042 the character code.
2043 * tests/input.at (String aliases for character tokens): New test.
2044
20452006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
2046
2047 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
2048
20492006-08-11 Paul Eggert <eggert@cs.ucla.edu>
2050
2051 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
2052 to prevent failures when building on older platforms.
2053 Check for autopoint failure.
2054 Set XGETTEXT_OPTIONS to values that check for C format strings,
2055 so that translators are warned about them (this also helps
2056 prevent core dumps).
2057
2058 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
2059 function, since it simplifies our code a bit.
2060
2061 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
2062 rather than -W, so we don't get bogus warnings about sign comparisons.
2063 Add -Wpointer-arith, since that warning is useful (it reports code
2064 that does not conform to C89 and that some compilers reject).
2065 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
2066 since it's no longer needed.
2067
20682006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
2069
2070 Clean up scanners a bit.
2071 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
2072 definitions so gcc won't warn when obstack_for_string is unused.
2073 * src/scan-code.l: config.h and system.h are already #include'd by
2074 scan-code-c.c, so get rid of them here.
2075 * src/scan-gram.l: Likewise.
2076 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
2077 definitions rather than duplicating the rest of it.
2078 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
2079
20802006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
2081
2082 Suppress signed/unsigned comparison warnings for yycheck.
2083 * data/c.m4 (b4_safest_int_type): New macro.
2084 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
2085 a signed int type, cast it to b4_safest_int_type first.
2086 * data/yacc.c: Likewise.
2087 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
2088 also overwritten.
2089
20902006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2091
2092 * doc/bison.texinfo: Fix some typos.
2093
20942006-08-02 Paul Eggert <eggert@cs.ucla.edu>
2095
2096 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
2097 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
2098
2099 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
2100 the latest gnulib does this a different way.
2101 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
2102 translation was patched, so stop omitting it.
2103
21042006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2105
2106 Enable declaration of default %printer/%destructor. Make the parser
2107 use these for all user-declared grammar symbols for which the user does
2108 not declare a specific %printer/%destructor. Thus, the parser uses it
2109 for token 0 if the user declares it but not if Bison generates it as
2110 $end. Discussed starting at
2111 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
2112 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
2113 and
2114 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
2115 * NEWS (2.3+): Mention.
2116 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
2117 declare a %destructor for a mid-rule's semantic value. It's just
2118 impossible to declare one specific to it.
2119 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
2120 code. Describe default %destructor form.
2121 * src/parse-gram.y (grammar_declaration): Parse default
2122 %printer/%destructor declarations.
2123 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
2124 and symbol_destructor_location_get rather than accessing the destructor
2125 and destructor_location members of struct symbol.
2126 (symbol_printers_output): Likewise but for %printer's.
2127 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
2128 again.
2129 * src/symtab.c (default_destructor, default_destructor_location,
2130 default_printer, default_printer_location): New static global
2131 variables to record the default %destructor and %printer.
2132 (symbol_destructor_get, symbol_destructor_location_get,
2133 symbol_printer_get, symbol_printer_location_get): New functions to
2134 compute the appropriate %destructor and %printer for a symbol.
2135 (default_destructor_set, default_printer_set): New functions to set the
2136 default %destructor and %printer.
2137 * src/symtab.h: Prototype all those new functions.
2138 * tests/actions.at (Default %printer and %destructor): New test to
2139 check that the right %printer and %destructor are called, that they're
2140 not called for $end, and that $$ and @$ work correctly.
2141 (Default %printer and %destructor for user-declared end token): New
2142 test to check that the default %printer and %destructor are called for
2143 a user-declared end token.
2144 * tests/input.at (Default %printer and %destructor redeclared, Unused
2145 values with default %destructor): New tests to check related grammar
2146 warnings and errors.
2147
21482006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2149
2150 Clean up handling of %destructor for the end token (token 0).
2151 Discussed starting at
2152 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
2153 and
2154 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
2155
2156 Make the skeletons consistent in how they pop the end token and invoke
2157 its %destructor.
2158 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
2159 state, which has token number 0, since this would invoke the
2160 %destructor for the end token.
2161 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
2162 until after shifting the end token, or else it won't be popped.
2163 * data/yacc.c (yyparse): Likewise.
2164
2165 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
2166 it's the end token. Upon termination, destroy an unshifted lookahead
2167 even when it's the end token.
2168 * data/lalr1.cc (yy::parser::parse): Likewise.
2169 * data/yacc.c (yyparse): Likewise.
2170
2171 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
2172 value warnings for the end token when the user gives the end token a
2173 %destructor.
2174
2175 * tests/actions.at (Printers and Destructors): Test all the above.
2176
21772006-07-24 Paul Eggert <eggert@cs.ucla.edu>
2178
2179 Update to latest gnulib and gettext versions.
2180 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
2181 Add fopen-safer.
2182 (gnulib_files): Add m4/warning.m4. Don't worry about files
2183 overwritten by autopoint.
2184 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
2185 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
2186 rejects them.
2187 Don't use autoreconf; instead, invoke autopoint etc. by hand,
2188 so that we can remove the intl files at a better time.
2189 (intl_files_to_remove): Remove aclocal.m4, since it gets
2190 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
2191 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
2192 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
2193 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
2194 Remove datarootdir hack; no longer needed.
2195 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
2196 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
2197 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
2198 strdup.h.
2199 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
2200 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
2201
22022006-07-20 Paul Eggert <eggert@cs.ucla.edu>
2203
2204 * bootstrap: Adjust to today's change to gnulib-tool by invoking
2205 it with --assume-autoconf='latest-stable'.
2206
22072006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
2208
2209 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
2210 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
2211 YYSTYPE' and `{'.
2212 * src/muscle_tab.h (muscle_grow): Replace the header comments with
2213 those from muscle_tab.c since the old ones are misleading.
2214
22152006-07-13 Akim Demaille <akim@epita.fr>
2216
2217 Support %define "KEY" {VALUE}.
2218 * src/scan-code.h, src/scan-code.l (translate_action)
2219 (translate_rule_action, translate_symbol_action, translate_code):
2220 Return char *, not const char *.
2221 * src/parse-gram.y (declaration): Rename as...
2222 (prologue_declaration): this.
2223 (string_content): Remove this nonterminal, use STRING.
2224 (braceless, content, content.opt): New nonterminal.
2225 Use them.
2226 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
2227 as value.
2228 * src/scan-gram.l (getargs.h): Don't include it.
2229
22302006-07-12 Paul Eggert <eggert@cs.ucla.edu>
2231
2232 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
2233 rather than a for-loop that declares a local bool variable. This
2234 should work around a compatibility problem with a Cray x1e C++
2235 compiler reported by Hung Nguyen in
2236 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
2237 The for-loop was introduced in the 2004-11-17 change but I don't
2238 know why it was needed.
2239
22402006-07-12 Akim Demaille <akim@epita.fr>
2241
2242 * data/c.m4: Comment changes.
2243
22442006-07-10 Akim Demaille <akim@lrde.epita.fr>
2245
2246 * src/complain.c (error_message, ERROR_MESSAGE): New.
2247 To factor...
2248 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
2249 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
2250
22512006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2252
2253 * NEWS: Instead of %union, you can define and use your own union type
2254 YYSTYPE if your grammar contains at least one <type> tag.
2255 Your YYSTYPE need not be a macro; it can be a typedef.
2256 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
2257 (Union Decl, Decl Summary): Document this.
2258 * data/glr.c (YYSTYPE): Implement this.
2259 * data/glr.cc (YYSTYPE): Likewise.
2260 * data/lalr1.cc (YYSTYPE): Likewise.
2261 * data/yacc.c (YYSTYPE): Likewise.
2262 * src/output.c (prepare): Output tag_seen_flag.
2263 * src/parse-gram.y (declaration, grammar_declaration):
2264 Use 'union_seen' rather than 'typed' to determine whether
2265 %union has been seen, since grammars can now be typed without
2266 %union.
2267 (symbol_declaration, type.opt, symbol_def):
2268 Keep track of whether a tag has been seen.
2269 * src/reader.c (union_seen, tag_seen): New vars.
2270 (typed): remove.
2271 * src/reader.h (union_seen, tag_seen, typed): Likewise.
2272 * src/scan-code.l (untyped_var_seen): New variable.
2273 (handle_action_dollar): Adjust to above changes.
2274 (handle_action_dollar, handle_action_at):
2275 Improve overflow checking for outlandish numbers.
2276 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
2277 avoid new diagnostics generated by above changes.
2278 * tests/regression.at (YYSTYPE typedef): Add test to check
2279 for type tags without %union.
2280
2281 * src/symlist.c (symbol_list_length): Return int, not unsigned
2282 int, since callers expect int. This may need to get revisited
2283 once we have proper integer overflow checking.
2284
2285 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
2286 object is now static.
2287
2288 * src/getargs.c (flags_argmatch): Return void, not int,
2289 to pacify ./configure --enable-gcc-warnings.
2290
2291 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
2292 since last_string is already defined to FLEX_PREFIX (last_string).
2293
22942006-07-09 Akim Demaille <akim@lrde.epita.fr>
2295
2296 Implement --warnings/-W.
2297 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
2298 replaced by...
2299 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
2300 Adjust callers.
2301 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
2302 (warnings_args, warnings_types): New.
2303 (getargs, short_options, long_options): Accept -W/--warnings.
2304 Sort the options by alphabetical order, upper case letter right
2305 before its lower case.
2306
23072006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2308
2309 Change %merge result type clash warnings to errors. Discussed at
2310 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
2311 * src/reader.c (record_merge_function_type): Use complain_at.
2312 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2313 declared later): Update test case results.
2314
23152006-07-09 Akim Demaille <akim@lrde.epita.fr>
2316
2317 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
2318 to be in alphabetical order.
2319 (trace_args): Spelling fixes.
2320
23212006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2322
2323 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
2324 so they don't collide with user-defined macros.
2325 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
2326 this was never guaranteed, and now that we're using gnulib stdint,
2327 which defines int_fast16_t to long int, the problem is exposed.
2328
23292006-07-08 Paul Eggert <eggert@cs.ucla.edu>
2330
2331 * data/c.m4 (b4_basename): Simplify a bit, since we don't
2332 need the full POSIX semantics (and weren't implementing them
2333 anyway).
2334
2335 Adjust to Autoconf 2.60 and today's gnulib.
2336 * bootstrap (gnulib_modules): Add stdint.
2337 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
2338 no longer copies it.
2339 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
2340 since stdint needs the former and wcwidth (which is now required
2341 by mbswidth) needs the latter.
2342 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
2343 work around a compatibility glitch between gettext 0.14.6 and
2344 Autoconf 2.60.
2345 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
2346 Do not check for uintptr_t, since new stdint module does the right
2347 thing.
2348 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
2349 Add stdint.h, stdint_.h, wcwidth.h.
2350 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
2351 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
2352 stdint.m4, wchar_t.m4, wcwidth.m4.
2353 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
2354 usual order for ../lib/*.h files.
2355 (file_name_split): Use last_component, not base_name, to adjust
2356 to gnulib changes.
2357 * src/parse-gram.h: Include <strverscmp.h> in the usual order
2358 for ../lib/*.h files.
2359 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
2360 Define unconditionally, since we now assume the stdint module.
2361 * src/scan-skel.l: Include <dirname.h>.
2362 (BASE_QPUTS): Use last_component, not base_name.
2363 * src/system.h: Include <unlocked-io.h> in the usual order
2364 for ../lib/*.h files. Include <stdint.h> unconditionally,
2365 since we now use the stdint module.
2366 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
2367 HAVE_UINTPTR_T, since we now use the stdint module.
2368 (base_name): Remove decl, since files now include <dirname.h>
2369 to get the decl.
2370
23712006-07-08 Akim Demaille <akim@lrde.epita.fr>
2372
2373 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
2374 New, default to 1.
2375 * data/yacc.c, data/glr.c, data/location.cc: Use them.
2376 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
2377 default.
2378 * tests/calc.at: Adjust.
2379
23802006-07-08 Akim Demaille <akim@lrde.epita.fr>
2381
2382 * data/c.m4 (b4_basename): New.
2383 (b4_syncline): Also output the location of its invocation (from
2384 the skeleton).
2385 (b4_user_action, b4_define_user_action, b4_user_actions)
2386 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
2387 (b4_user_stype): New.
2388 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
2389
23902006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2391
2392 In the grammar file, the first column is 1 not 0 on the first line as
2393 on every other line.
2394 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
2395 * tests/input.at (Torturing the Scanner): Update output.
2396
2397 * src/scan-gram.l (scanner_cursor): Declare it static.
2398
23992006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2400
2401 In warnings, say "previous declaration" rather than "first
2402 declaration".
2403 * src/symtab.c (redeclaration): Do that here.
2404 * src/reader.c (record_merge_function_type): In the case of a result
2405 type clash, report the previous declaration rather than the very first
2406 one in the grammar file.
2407 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2408 declared later): Add a third declaration to check this behavior.
2409 * tests/input.at (Incompatible Aliases): Update output.
2410
24112006-06-27 Akim Demaille <akim@epita.fr>
2412
2413 * doc/Doxyfile.in: New.
2414 * doc/Makefile.am: Use it.
2415 * src/lalr.h, src/symtab.h: Initial doxygenation.
2416
24172006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2418
2419 Don't miss %merge result type warnings just because the LHS types are
2420 declared after the %merge. This continues the effort of the previous
2421 patch.
2422 * src/reader.c (get_merge_function): Don't set the merger type yet.
2423 (record_merge_function_type): New function for setting the merger type
2424 and checking for clashes.
2425 (grammar_current_rule_merge_set): Set the location of the %merge for
2426 the current rule.
2427 (packgram): Invoke record_merge_function_type for each rule now that
2428 all symbol type declarations have been parsed.
2429 * src/reader.h (merger_list.type_declaration_location): New member
2430 storing the location of the first %merge from which the type for this
2431 merging function was derived.
2432 * src/symlist.h (symbol_list.merger_declaration_location): New member
2433 storing the location of a rule's %merge, if any.
2434 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2435 declared later): New test to catch the error fixed by the above patch.
2436
24372006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2438
2439 Get action warnings (grammar_rule_check) right even when symbol
2440 declarations appear after the rules. Discussed at
2441 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
2442 and
2443 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
2444 Don't mistake the type of $$ in a midrule to be that of its parent
2445 rule's $$.
2446 * src/reader.c (grammar_current_rule_end): Don't invoke
2447 grammar_rule_check yet since not all symbol declarations may have been
2448 parsed yet.
2449 (grammar_midrule_action): Likewise.
2450 Don't record whether the midrule's $$ has been used yet since actions
2451 haven't been translated yet.
2452 Record the midrule's parent rule and its RHS index within the parent
2453 rule.
2454 (grammar_current_rule_action_append): Don't translate the action yet
2455 since not all symbol declarations may have been parsed yet and, thus,
2456 warnings about types for $$, $n, @$, and @n can't be reported yet.
2457 (packgram): Translate the action and invoke grammar_rule_check now that
2458 all symbol declarations have been parsed.
2459 * src/scan-code.l (handle_action_dollar): Now that this is invoked
2460 after parsing the entire grammar file, the symbol list here in the case
2461 of a midrule is actually the midrule's empty RHS, so reference its
2462 parent rule's RHS where necessary.
2463 On the other hand, now that you can already know it's a midrule, you
2464 aren't forced to think $$ has the same type as its parent rule's $$.
2465 (handle_action_at): In the case of a midrule, reference the parent rule
2466 where necessary.
2467 * src/symlist.c (symbol_list_new): Initialize new midrule-related
2468 members.
2469 (symbol_list_length): Now that this is invoked after all rules have
2470 been parsed, a NULL symbol (rather than a NULL symbol list node)
2471 terminates a rule. symbol_list_print already does this correctly.
2472 * src/symlist.h (symbol_list.midrule_parent_rule,
2473 symbol_list.midrule_parent_rhs_index): New members so that midrules can
2474 remember their relationships with their parents.
2475 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
2476 fixed by the above patch.
2477 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
2478 implementing...
2479 (Unused values): ... this old test case and...
2480 (Unused values before symbol declarations): ... this new test case.
2481 This one is the same as `Unused values' except that all symbol
2482 declarations appear after the rules in order to catch the rest of the
2483 errors fixed by the above patch.
2484
24852006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2486
2487 More cleanup.
2488 * src/reader.c (current_rule): Declare it static since it's no longer
2489 used outside this file.
2490 (grammar_current_rule_action_append): Remove redundant arguments from
2491 translate_rule_action invocation.
2492 * src/reader.h (current_rule): Remove this unused extern.
2493 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
2494 * src/scan-code.l (translate_rule_action): Likewise.
2495
24962006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
2497
2498 Clean up yesterday's patch.
2499 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
2500 to...
2501 * src/reader.c (grammar_current_rule_action_append): ... here for
2502 consistency with grammar_current_rule_symbol_append.
2503 * tests/regression.at (Braced code in declaration in rules section):
2504 Make yyerror and yylex static as usual.
2505
25062006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
2507
2508 Fix bug that mistakes braced code in a declaration in the rules section
2509 to be a rule action. Mentioned at
2510 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
2511 * src/scan-gram.l: Move midrule action detection from the start of the
2512 scanning of any braced code to...
2513 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
2514 action. For readability, use $2 and @2 rather than the equivalent
2515 global variables.
2516 * tests/regression.at (Braced code in declaration in rules section):
2517 New test to catch the error fixed by the above patch.
2518
2519 Work on code readability some.
2520 * src/scan-code.l (current_rule): Get rid of this misleading and
2521 redundant declaration: it's actually extern'ed in reader.h.
2522 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
2523 translate_action): Add a rule argument and use it instead of the global
2524 current_rule.
2525 (translate_rule_action): This already receives current_rule through an
2526 argument, so pass it on to translate_action instead of assigning
2527 current_rule to current_rule.
2528 (translate_symbol_action, translate_code): Pass rule = NULL to
2529 translate_action.
2530
25312006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
2532
2533 Rename %before-definitions to %start-header and %after-definitions to
2534 %end-header. Don't use these declarations to separate pre-prologue
2535 blocks from post-prologue blocks. Add new order-independent
2536 declarations %before-header and %after-header as alternatives to the
2537 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
2538 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
2539 * NEWS (2.3+): Update for these changes.
2540 * data/glr.c (b4_before_definitions): Update to...
2541 (b4_start_header): ... this.
2542 (b4_after_definitions): Update to...
2543 (b4_end_header): ... this.
2544 * data/glr.cc: Likewise.
2545 * data/lalr1.cc: Likewise.
2546 * data/yacc.c: Likewise.
2547 * doc/bison.texinfo (The prologue): Update names, and replace remaining
2548 prologue blocks with %*-header declarations.
2549 (Calc++ Parser): Likewise.
2550 (Bison Declaration Summary): Update names.
2551 (Table of Symbols): Update description.
2552 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
2553 (PERCENT_END_HEADER): ... this.
2554 (PERCENT_BEFORE_DEFINITIONS): Update to...
2555 (PERCENT_START_HEADER): ... this.
2556 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2557 (declaration): Update token names and m4 macro names.
2558 When parsing %end-header and %start-header, invoke translate_code
2559 before muscle_code_grow, and no longer set global booleans to remember
2560 whether these declarations have been seen.
2561 Parse new %after-header and %before-header.
2562 * src/reader.c (before_definitions, after_definitions): Remove.
2563 (prologue_augment): Accept a new bool argument to specify whether to
2564 augment the pre-prologue or post-prologue.
2565 * src/reader.h (before_definitions, after_definitions): Remove these
2566 extern's.
2567 (prologue_augment): Add new bool argument.
2568 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
2569 (PERCENT_END_HEADER): ... this.
2570 (PERCENT_BEFORE_DEFINITIONS): Update to...
2571 (PERCENT_START_HEADER): ... this.
2572 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2573 * tests/actions.at (Printers and Destructors): Update names.
2574
25752006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
2576
2577 Add comparison operators for C++ location classes. Discussed at
2578 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
2579 * data/c++.m4 (b4_define_location_comparison): New boolean %define
2580 declaration indicating whether filename_type has an operator==. If
2581 filename_type is `std::string', it defaults to `1', `0' otherwise.
2582 * data/location.cc: Iff b4_define_location_comparison is `1', add
2583 operator== and operator!= for class position and for class location.
2584
2585 Some minor fixes.
2586 * src/scan-action.l: Remove unused file.
2587 * src/symtab.c (symbol_printer_set): Use printer_location not
2588 destructor_location.
2589 * src/symtab.h (struct symbol): Replace incorrect source comment for
2590 printer members.
2591 * tests/input.at (Incompatible Aliases): Update output with correct
2592 printer location.
2593
25942006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
2595
2596 Don't put the pre-prologue in the header file. For the yacc.c code
2597 file and the glr.c header and code files, move the pre-prologue before
2598 the token definitions. Add new %before-definitions and
2599 %after-definitions to declare code that will go in both the header file
2600 and code file. Discussed at
2601 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
2602 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
2603 and
2604 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
2605 * NEWS (2.3+): Describe these changes.
2606 * data/glr.c (b4_pre_prologue): Move from within to before...
2607 (b4_shared_declarations): ... this.
2608 Add new b4_before_definitions before b4_token_enums.
2609 Add new b4_after_definitions at the end.
2610 * data/glr.cc (b4_pre_prologue): Replace with...
2611 (b4_before_definitions): ... this in the header file.
2612 (b4_after_definitions): New near the end of the header file.
2613 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
2614 code file right before including the header file.
2615 (b4_before_definitions): New in the previous position of
2616 b4_pre_prologue in the header file.
2617 (b4_after_definitions): New near the end of the header file.
2618 * data/yacc.c: Clean up some m4 quoting especially in the header file.
2619 (b4_token_enums_defines): In the code file, move to right before
2620 YYSTYPE for consistency with the header file.
2621 (b4_before_definitions): New right before b4_token_enums_defines in
2622 both the header and code file.
2623 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
2624 header and code file.
2625 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
2626 of prologues for %union dependencies.
2627 (Bison Declaration Summary): In %defines description, mention the
2628 effect of %before-definitions and %after-definitions on the header
2629 file.
2630 (Calc++ Parser): Forward declare driver in a %before-definitions rather
2631 than in the pre-prologue so that make check succeeds.
2632 (Table of Symbols): Add entries for %before-definitions and
2633 %after-definitions.
2634 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
2635 %before-definitions.
2636 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
2637 (declaration): Parse those declarations and append to
2638 b4_before_definitions and b4_after_definitions, respectively.
2639 * src/reader.c (before_definitions, after_definitions): New bools to
2640 track whether those declarations have been seen.
2641 (prologue_augment): Add to the post-prologue if %union,
2642 %before-definitions, or %after-definitions has been seen.
2643 * src/reader.h (before_definitions, after_definitions): New extern's.
2644 * src/scan-gram.l: Scan the new declarations.
2645 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
2646 prologue block in a %before-definitions or a %after-definitions based
2647 on whether the %union is declared.
2648 * tests/regression.at (Early token definitions with --yacc, Early token
2649 definitions without --yacc): Move tests for token definitions into the
2650 post-prologue since token names are no longer defined in the
2651 pre-prologue.
2652
26532006-06-20 Akim Demaille <akim@epita.fr>
2654
2655 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
2656 (symbol_get): Use it.
2657 * src/parse-gram.y: Use it.
2658
26592006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
2660
2661 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
2662 build succeeds when configured with --enable-gcc-warnings.
2663
26642006-06-19 Paul Eggert <eggert@cs.ucla.edu>
2665
2666 * src/parse-gram.y (char_name): New function.
2667 (CHAR, STRING, string_content): For %printer, properly escape.
2668 (ID): Prefer fputs to fprintf.
2669 (id): Reindent to be consistent with other rules.
2670 Properly quote char.
2671
2672 The Translation Project changed its way of publishing translations
2673 to maintainers. I haven't received any responses to my request
2674 for supporting the old way, or for documenting the new way. I
2675 have modified 'bootstrap' to use screen scraping
2676 (in this case, HTML scraping). This is unreliable and inelegant,
2677 but I don't see any better way. Yuck.
2678 * bootstrap (TP_URL, WGET_COMMAND): New vars.
2679 (get_translations): New function, which uses HTML scraping to
2680 deduce locations of latest translations.
2681 Use this function to grab both bison and bison-runtime .po files.
2682 Don't bother priming the pump for the runtime-po domain any more,
2683 as it's now translated better than bison is.
2684
26852006-06-19 Akim Demaille <akim@epita.fr>
2686
2687 * src/scan-gram.l: No longer "parse" things after `%union' until
2688 `{'. Rather, return a single "%union" token.
2689 No longer make symbols: return strings, and leave the conversion
2690 to symbols to the parser.
2691 (SC_PRE_CODE, token_type): Remove.
2692 * src/parse-gram.y (%union): New field `character'.
2693 Sort tokens.
2694 (CHAR): New token.
2695 (ID, ID_COLON): Now that the scanner no longer makes them
2696 identifiers, adjust all uses to invoke symbol_get.
2697 (id_colon): New, wraps the conversion from string to symbol.
2698 (%union): Accept a possible union_name.
2699 (symbol): Now can be a char.
2700 * data/c.m4 (b4_union_name): Leave a default value.
2701 * data/glr.c, data/yacc.c: Use it.
2702
27032006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
2704
2705 For associating token numbers with token names for "yacc.c", don't use
2706 #define statements unless `--yacc' is specified; always use enum
2707 yytokentype. Most important discussions start at:
2708 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
2709 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
2710 and
2711 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
2712 * NEWS (2.3+): Mention.
2713 * data/c.m4 (b4_yacc_if): New.
2714 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
2715 token #define's.
2716 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
2717 on token name definitions.
2718 * src/getargs.c (usage): Capitalize `Yacc' in English.
2719 * src/output.c (prepare): Define b4_yacc_flag.
2720 * tests/regression.at (Early token definitions): Test that tokens names
2721 are defined before the pre-prologue not just before the post-prologue.
2722 Remove this test case and copy to...
2723 (Early token definitions with --yacc): ... this to test #define's.
2724 (Early token definitions without --yacc): ... and this to test enums.
2725
27262006-06-11 Paul Eggert <eggert@cs.ucla.edu>
2727
2728 * NEWS: Reword the post-2.3 change to not be so optimistic about
2729 removing the old "look-ahead" spelling.
2730 Update previous look-ahead/lookahead change reports.
2731 * REFERENCES: look-ahead -> lookahead (since that's
2732 what he actually wrote).
2733 * doc/refcard.tex: look ahead -> lookahead,
2734 look-ahead -> lookahead
2735
27362006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
2737
2738 For consistency, use `lookahead' instead of `look-ahead' or
2739 `look_ahead'. Discussed starting at
2740 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
2741 and then at
2742 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
2743 * NEWS: For the next release, note the change to `--report'.
2744 * TODO, doc/bison.1: Update English.
2745 * doc/bison.texinfo: Update English.
2746 (Understanding Your Parser, Bison Options): Document as
2747 `--report=lookahead' rather than `--report=look-ahead'.
2748 * src/conflicts.c: Update English in comments.
2749 (lookahead_set): Rename from look_ahead_set.
2750 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
2751 (resolve_sr_conflict): Rename local look_ahead_tokens to
2752 lookahead_tokens, and update other uses.
2753 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
2754 count_rr_conflicts, conflicts_free): Update uses.
2755 * src/getargs.c (report_args): Move "lookahead" before alternate
2756 spellings.
2757 (report_types): Update uses.
2758 (usage): For `--report' usage description, state `lookahead' spelling
2759 rather than `look-ahead'.
2760 * src/getargs.h (report.report_lookahead_tokens): Rename from
2761 report_look_ahead_tokens.
2762 * src/lalr.c: Update English in comments.
2763 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
2764 (state_lookahead_tokens_count): Rename from
2765 state_look_ahead_tokens_count.
2766 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2767 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
2768 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2769 Update other uses.
2770 Update English in output.
2771 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
2772 * src/print.c: Update English in comments.
2773 (lookahead_set): Rename from look_ahead_set.
2774 (print_reduction): Rename argument lookahead_token from
2775 look_ahead_token.
2776 (print_core, state_default_rule, print_reductions, print_results):
2777 Update uses.
2778 * src/print_graph.c: Update English in comments.
2779 (print_core): Update uses.
2780 * src/state.c: Update English in comments.
2781 (reductions_new): Update uses.
2782 (state_rule_lookahead_tokens_print): Rename from
2783 state_rule_look_ahead_tokens_print, and update other uses.
2784 * src/state.h: Update English in comments.
2785 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
2786 (state_rule_lookahead_tokens_print): Rename from
2787 state_rule_look_ahead_tokens_print.
2788 * src/tables.c: Update English in comments.
2789 (conflict_row, action_row): Update uses.
2790 * tests/glr-regression.at
2791 (Incorrect lookahead during deterministic GLR,
2792 Incorrect lookahead during nondeterministic GLR): Rename
2793 print_look_ahead to print_lookahead.
2794 * tests/torture.at: Update English in comments.
2795 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
2796 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
2797 (Many lookahead tokens): Update uses.
2798 * data/glr.c: Update English in comments.
2799 * lalr1.cc: Likewise.
2800 * yacc.c: Likewise.
2801 * src/conflicts.h: Likewise.
2802 * src/lalr.h: Likewise.
2803 * src/main.c: Likewise.
2804 * src/output.c: Likewise.
2805 * src/parse-gram.c: Likewise.
2806 * src/tables.h: Likewise.
2807 * tests/calc.at: Likewise.
2808
28092006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
2810
2811 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
2812
28132006-06-07 Paul Eggert <eggert@cs.ucla.edu>
2814
2815 * TODO: Add request from Nelson H. F. Beebe to be able to install
2816 Bison without installing the yacc script.
2817
28182006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2819
2820 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
2821 and yytext if they're already #define'd.
2822 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
2823 * src/scan-code-c.c: ... here.
2824 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
2825 <config.h>.
2826
28272006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2828
2829 Get Bison to build again when configured with --enable-gcc-warnings.
2830 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
2831 missing #include's.
2832 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
2833 loc argument as it shadows a global.
2834 * src/scan-gram.l: Remove stray comma that prevents boundary_set
2835 invocation.
2836
2837 * src/.cvsignore: Add scan-code.c.
2838
28392006-06-07 Akim Demaille <akim@epita.fr>
2840
2841 * src/scan-gram.l: Move the "add a trailing ; to actions" code
2842 to...
2843 * src/scan-code.l: here.
2844 * tests/input.at (Torturing the Scanner): Fix another location
2845 error.
2846
28472006-06-07 Akim Demaille <akim@epita.fr>
2848
2849 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
2850
28512006-06-06 Akim Demaille <akim@epita.fr>
2852
2853 Extract the parsing of user actions from the grammar scanner.
2854 As a consequence, the relation between the grammar scanner and
2855 parser is much simpler. We can also split "composite tokens" back
2856 into simple tokens.
2857 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
2858 * src/scan-gram.l (add_column_width, adjust_location): Move to and
2859 rename as...
2860 * src/location.h, src/location.c (add_column_width)
2861 (location_compute): these.
2862 Fix the column count: the initial column is 0.
2863 (location_print): Be robust to ending column being 0.
2864 * src/location.h (boundary_set): New.
2865 * src/main.c: Adjust to scanner_free being renamed as
2866 gram_scanner_free.
2867 * src/output.c: Include scan-code.h.
2868 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
2869 Use boundary_set.
2870 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
2871 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
2872 which is now, again, a separate token.
2873 Adjust all dependencies.
2874 Whereever actions with $ and @ are used, use translate_code.
2875 (action): Remove this nonterminal which is now useless.
2876 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
2877 (grammar_current_rule_action_append): Use translate_code.
2878 (packgram): Bound check ruleno, itemno, and rule_length.
2879 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
2880 (last_string, last_braced_code_loc, max_left_semantic_context)
2881 (scanner_initialize, scanner_free, scanner_last_string_free)
2882 (gram_out, gram_lineno, YY_DECL_): Move to...
2883 * src/scan-gram.h: this new file.
2884 (YY_DECL): Rename as...
2885 (GRAM_DECL): this.
2886 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
2887 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
2888 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
2889 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
2890 Move these declarations, and...
2891 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
2892 these to...
2893 * src/flex-scanner.h: this new file.
2894 * src/scan-gram.l (rule_length, rule_length_overflow)
2895 (increment_rule_length): Remove.
2896 (last_braced_code_loc): Rename as...
2897 (gram_last_braced_code_loc): this.
2898 Adjust to the changes of the parser.
2899 Move all the handling of $ and @ into...
2900 * src/scan-code.l: here.
2901 * src/scan-gram.l (handle_dollar, handle_at): Remove.
2902 (handle_action_dollar, handle_action_at): Move to...
2903 * src/scan-code.l: here.
2904 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
2905 scan-code.h, scan-code-c.c, scan-gram.h.
2906 (EXTRA_bison_SOURCES): Add scan-code.l.
2907 (BUILT_SOURCES): Add scan-code.c.
2908 (yacc): Be robust to white spaces.
2909
2910 * tests/conflicts.at, tests/input.at, tests/reduce.at,
2911 * tests/regression.at: Adjust the column numbers.
2912 * tests/regression.at: Adjust the error message.
2913
29142006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2915
2916 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2917 Use Akim's wording from
2918 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
2919
29202006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2921
2922 Between Bison releases, manually append `+' to the previous Bison
2923 release number, and use that as a signal to automatically print the
2924 ChangeLog's CVS Id keyword from --version. Discussed starting at
2925 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
2926 * ChangeLog: Add Id header.
2927 * configure.ac (AC_INIT): Append `+' to `2.3'.
2928 * src/.cvsignore: Add revision.c.
2929 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
2930 (BUILT_SOURCES): Add revision.c.
2931 (revision.c): New target rule. This file defines a new global variable
2932 named revision. It initializes it with either the Id from ChangeLog
2933 or, if VERSION doesn't contain `+', with the empty string.
2934 * src/getargs.c (version): Print the value of revision.
2935 * src/revision.h: Extern revision.
2936
29372006-06-05 Paul Eggert <eggert@cs.ucla.edu>
2938
2939 * NEWS: Version 2.3.
2940 * configure.ac (AC_INIT): Likewise.
2941
29422006-05-30 Paul Eggert <eggert@cs.ucla.edu>
2943
2944 * data/glr.c (YYRECOVERING): Define to be a function-like macro
2945 with no arguments, not as an object-like macro. This is for
2946 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
2947 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
2948 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
2949 Document this.
2950
29512006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
2952
2953 * src/getargs.c (usage): Back out yesterday's modification of the
2954 --help output so that we don't have to wait for translation before
2955 releasing 2.3.
2956
29572006-05-29 Paul Eggert <eggert@cs.ucla.edu>
2958
2959 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
2960 Problem reported by Akim Demaille.
2961
29622006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2963
2964 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2965
29662006-05-26 Paul Eggert <eggert@cs.ucla.edu>
2967
2968 * data/yacc.c (yy_reduce_print): Omit trailing white space in
2969 generated source code. Problem reported by Frans Englich in
2970 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
2971
29722006-05-22 Paul Eggert <eggert@cs.ucla.edu>
2973
2974 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
2975 shell, not within 'make', so that 'make' by an ordinary builder
2976 (using GNU make) does not worry about configuring gzip. This also
2977 works around a bug reported independently by Keith Thompson and by
2978 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
2979 stderr rather than stdout, messing up the build logs.
2980
29812006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2982
2983 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
2984 to make sure that YYID will never be unused. This fixes a 'make
2985 maintainer-check' failure caused by the recent changes to the 'Trivial
2986 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
2987 not used.
2988 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
2989
29902006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2991
2992 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
2993 state before an empty RHS is always resolved here. Only the location
2994 of that state is guaranteed to be resolved, and that's enough. This
2995 fixes the remaining bug reported by Derek M. Jones in
2996 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2997 * tests/glr-regression.at (Uninitialized location when reporting
2998 ambiguity): Test the above case.
2999 Also, the embedded comments in this test case claim it checks the case
3000 of an empty RHS that has inherited the initial location. However, the
3001 corresponding LHS was already resolved, so yyresolveLocations didn't
3002 actually have reason to modify it. Fix this by forcing
3003 nondeterministic operation at the beginning of the parse.
3004
30052006-05-20 Paul Eggert <eggert@cs.ucla.edu>
3006
3007 * data/c.m4 (b4_yy_symbol_print_generate):
3008 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
3009 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
3010 of the bugs reported today by Derek M Jones in
3011 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3012 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
3013 defined to be a type name without parens or brackets.
3014 (Location Type): Similarly for YYLTYPE.
3015 * tests/regression.at (Trivial grammars): Put in a test for this
3016 bug that will be caught by 'make maintainer-check' (though not,
3017 alas, by 'make check' unless your compiler is picky).
3018
30192006-05-19 Paul Eggert <eggert@cs.ucla.edu>
3020
3021 * NEWS: Version 2.2.
3022 * configure.ac (AC_INIT): Likewise.
3023
30242006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
3025
3026 * data/glr.c (yyreportTree): Make room in yystates for the state
3027 preceding the RHS. This fixes the segmentation fault reported by Derek
3028 M. Jones in
3029 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
3030 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
3031 to the user. Reported for yyreportTree by Derek M. Jones later in the
3032 same thread.
3033 * THANKS: Add Derek M. Jones.
3034 Update my email address.
3035 Fix typo in Steve Murphy's name.
3036
30372006-05-14 Paul Eggert <eggert@cs.ucla.edu>
3038
3039 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
3040 checking against YYLAST that caused the parser to miss a potential
3041 alternative in its diagnostic.
3042 Problem reported by Maria Jose Moron Fernandez in
3043 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
3044 * data/lalr1.cc (yysyntax_error_): Likewise.
3045 * data/yacc.c (yysyntax_error): Likewise.
3046 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
3047 tokens, in case we run into an older C compiler.
3048 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
3049 Use them to check for the off-by-one error fixed above.
3050
3051 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
3052 YYSIZE_T, not size_t.
3053 * tests/regression.at (Trivial grammars): New test, to catch
3054 the error fixed by the above patch.
3055
30562006-05-14 Akim Demaille <akim@lrde.epita.fr>
3057
3058 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
3059 scheme.
3060 Reported by Steve Murphy.
3061
30622006-05-14 Akim Demaille <akim@lrde.epita.fr>
3063
3064 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
3065 * data/glr.cc: b4_location_flag is now b4_locations_flag.
3066
30672006-05-14 Akim Demaille <akim@lrde.epita.fr>
3068
3069 Implement --trace=m4.
3070 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
3071 * src/output.c (output_skeleton): When set, pass -dV to m4.
3072
3073 Factor the handling of flags in m4.
3074 * src/output.c (prepare): Rename the muscle names debug, defines,
3075 error_verbose to debug_flag, defines_flag, error_verbose_flag.
3076 * data/c.m4: Adjust.
3077 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
3078 Use b4_define_flag_if to define other b4_FLAG_if macros.
3079 (b4_location_if): As a consequence, rename as...
3080 (b4_locations_if): this, for consistency.
3081 Adjust all the skeletons.
3082
30832006-05-14 Akim Demaille <akim@lrde.epita.fr>
3084
3085 * etc/bench.pm: Shorten bench names.
3086
30872006-05-14 Akim Demaille <akim@lrde.epita.fr>
3088
3089 * src/output.h, src/output.c (error_verbose): Move to...
3090 * src/getargs.h, src/getargs.c: here.
3091 Sort the flags.
3092 Adjust dependencies.
3093
30942006-05-13 Paul Eggert <eggert@cs.ucla.edu>
3095
3096 * data/c.m4 (b4_copyright): Put the special exception for Bison
3097 skeletons here, so we don't have to put it in each skeleton. All
3098 uses changed. Suggested by Akim Demaille. Also, wrap the
3099 copyright notice, in case it is longer than 80 columns. Replace
3100 comma by newline after title.
3101
31022006-05-11 Paul Eggert <eggert@cs.ucla.edu>
3103
3104 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
3105 incompatibility, not a bug. Mention that it wasn't fixed as of
3106 flex 2.5.33.
3107
31082006-05-11 Akim Demaille <akim@lrde.epita.fr>
3109
3110 * examples/extexi: Enforce the precedence of concatenation over
3111 >>.
3112 Reported by Tommy Nordgren.
3113
31142006-05-11 Akim Demaille <akim@lrde.epita.fr>
3115
3116 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
3117 with the member "token".
3118 Reported by Martin Nylin.
3119
31202006-05-08 Paul Eggert <eggert@cs.ucla.edu>
3121
3122 * data/glr.c: Switch to Bison 2.2 special-exception language in
3123 the copyright notice. Use more-regular format for titles and
3124 copyright notices.
3125 * data/glr.cc: Likewise.
3126 * data/location.cc: Likewise.
3127 * data/yacc.cc: Likewise.
3128 * doc/bison.texinfo (Conditions): Document this.
3129 * NEWS: likewise. Upgrade version to 2.2.
3130
31312006-04-27 Akim Demaille <akim@lrde.epita.fr>
3132
3133 * data/glr.cc: Remove dead code.
3134
31352006-04-25 Paul Eggert <eggert@cs.ucla.edu>
3136
3137 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
3138 that variable and the line breaks the bootstrap. Problem reported
3139 by Juan M. Guerrero.
3140
31412006-04-24 Akim Demaille <akim@lrde.epita.fr>
3142
3143 * doc/bison.texinfo (Multiple start-symbols): New.
3144
31452006-04-24 Akim Demaille <akim@lrde.epita.fr>
3146
3147 * etc/README, etc/bench.pl: New.
3148
31492006-04-03 Akim Demaille <akim@lrde.epita.fr>
3150
3151 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
3152 rule.
3153 Reported by Mickael Labau.
3154 * tests/input.at (Torturing the Scanner): Test it.
3155
31562006-03-16 Paul Eggert <eggert@cs.ucla.edu>
3157
3158 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
3159 Problem reported by Bob Rossi.
3160
31612006-03-13 Paul Eggert <eggert@cs.ucla.edu>
3162
3163 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
3164 and didn't really work.
3165 For the index, use @ifnotinfo, not @iftex.
3166 Minor cleanups of spacing and terminology.
3167
31682006-03-12 Akim Demaille <akim@lrde.epita.fr>
3169
3170 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
3171 of AT_NAME_PREFIX when %name-prefix is not used.
3172
31732006-03-12 Akim Demaille <akim@lrde.epita.fr>
3174
3175 Apply --prefix to C++ skeletons too: they change the namespace.
3176 The test suite already exercize these cases.
3177 * data/c++.m4 (b4_namespace): New.
3178 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
3179 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
3180 * data/yacc.c, data/glr.c: Remove a useless `[]'.
3181 * doc/bison.texinfo: Document it.
3182 (Option Cross Key): Use @multitable in all formats. It looks
3183 nicer, even in TeX outputs.
3184 (Rules): Use the same code whatever the output type is.
3185 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
3186 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
3187 * tests/calc.at: Use it, instead of hard coding `yy'.
3188
31892006-03-10 Akim Demaille <akim@lrde.epita.fr>
3190
3191 * TODO: Remove dead items.
3192
31932006-03-10 Akim Demaille <akim@lrde.epita.fr>
3194
3195 * doc/FAQ: Remove, merged into...
3196 * doc/bison.texinfo (FAQ): this.
3197 * doc/Makefile.am (EXTRA_DIST): Adjust.
3198
31992006-03-10 Akim Demaille <akim@lrde.epita.fr>
3200
3201 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
3202 even if empty.
3203 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
3204 * doc/bison.texinfo (Calc++ Scanner): Use it.
3205
32062006-03-09 Paul Eggert <eggert@cs.ucla.edu>
3207
3208 Fix two nits reported by twlevo, plus one more that I discovered.
3209
3210 * src/assoc.h (assoc_to_string): Give a name to the arg, as
3211 this is the usual Bison style.
3212 * src/location.h (location_print): Likewise.
3213
3214 * src/reader.h (token_name): Likewise.
3215
32162006-03-08 Paul Eggert <eggert@cs.ucla.edu>
3217
3218 Fix some nits reported by twlevo.
3219 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
3220 and "POSIX". Use more-modern syntax for URLs. Mention C++
3221 and ask for Java. Don't hardwire OS version numbers. Add
3222 copyright notice.
3223 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
3224 * src/conflicts.c (solved_conflicts_obstack): Now static.
3225
32262006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3227
3228 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
3229 page. Say "you can use it" not "you may use it" as on the web page;
3230 we're describing capabilities not granting permission.
3231
32322006-03-06 Paul Eggert <eggert@cs.ucla.edu>
3233
3234 * data/glr.c (yyresolveLocations): Rename local variables to avoid
3235 shadowing warnings. Use usual patter for iterating through RHS.
3236 * tests/glr-regression.at
3237 (Uninitialized location when reporting ambiguity):
3238 Modify yylex so that it uses its argument, rather than trying
3239 to rely on ARGSUSED (which doesn't work for gcc with warnings).
3240 const char -> char const.
3241
3242 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
3243 Don't use tabs inside commands; it messes up 'ps'.
3244 Problem reported by twlevo.
3245
32462006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
3247
3248 * tests/glr-regression.at (Uninitialized location when reporting
3249 ambiguity): New test case.
3250 * data/glr.c (yyresolveLocations): New function, which uses
3251 YYLLOC_DEFAULT.
3252 (yyresolveValue): Invoke yyresolveLocations before reporting an
3253 ambiguity.
3254 * doc/bison.texinfo (Default Action for Locations): Note
3255 YYLLOC_DEFAULT's usage for ambiguity locations.
3256 (GLR Semantic Actions): Cross-reference those notes.
3257
32582006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
3259
3260 * tests/glr-regression.at (Leaked semantic values when reporting
3261 ambiguity): Remove unnecessary union and type declarations.
3262 (Leaked lookahead after nondeterministic parse syntax error): New test
3263 case.
3264 * data/glr.c (yyparse): Check for zero stacks remaining before
3265 attempting to shift the lookahead so that you don't lose it.
3266
32672006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3268
3269 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
3270 * tests/glr-regression.at (Leaked semantic values when reporting
3271 ambiguity): New test case.
3272 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
3273 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
3274 now unnecessary yystackp parameter.
3275 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
3276 destructors can be called.
3277
3278 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
3279 in existing testcases.
3280
32812006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3282
3283 Don't leak semantic values for parent RHS when a user action cuts the
3284 parser, and clean up related code a bit.
3285 * tests/glr-regression.at (Leaked merged semantic value if user action
3286 cuts parse): Rename to...
3287 (Leaked semantic values if user action cuts parse): ... this. Add check
3288 for leaked parent RHS values.
3289 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
3290 between an unresolved state (non-empty chain of semantic options) and
3291 an incomplete one (signaled by an empty chain).
3292 (yyresolveStates): Document the interface. Move all manipulation of a
3293 successfully or unsuccessfully resolved yyGLRState to...
3294 (yyresolveValue): ... here so that yyresolveValue always leaves a
3295 yyGLRState with consistent data and thus is easier to understand.
3296 Remove the yyvalp and yylocp parameters since they are always just
3297 taken from the yys parameter. When reporting a discarded merged value
3298 in debugging output, note that it is incompletely merged. Document the
3299 interface.
3300 (yyresolveAction): If resolving any of the RHS states fails, destroy
3301 them all rather than leaking them. Thus, as long as user actions are
3302 written to clean up the RHS correctly, yyresolveAction always cleans up
3303 the RHS of a semantic option. Document the interface.
3304
33052006-02-27 Paul Eggert <eggert@cs.ucla.edu>
3306
3307 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
3308 led to a segmentation fault in GNU Pascal. Problem reported
3309 by Waldek Hebisch.
3310
33112006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
3312
3313 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
3314 mid-rule action inside a nonterminal symbol in order to declare a
3315 destructor for its semantic value.
3316
33172006-02-16 Paul Eggert <eggert@cs.ucla.edu>
3318
3319 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
3320 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
3321 __cplusplus && ! defined _STDLIB_H && !
3322 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
3323 defined free))]: Include <stdlib.h> rather than rolling our own
3324 declarations of malloc and free, to avoid problems with
3325 incompatible declarations (using 'throw') C++'s stdlib.h. This
3326 should fix Debian bug 340012
3327 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
3328 reported by Guillaume Melquiond.
3329
33302006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3331
3332 * NEWS: Clarify symbols versus types in unused-value warnings.
3333
3334 * configure.ac (AC_INIT): Bump version number.
3335
33362006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3337
3338 * NEWS: Version 2.1a.
3339 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
3340 since C99 requires this.
3341
33422006-02-11 Paul Eggert <eggert@cs.ucla.edu>
3343
3344 * m4/c-working.m4: New file.
3345 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
3346
33472006-02-10 Paul Eggert <eggert@cs.ucla.edu>
3348
3349 * Makefile.maint: Merge from coreutils.
3350
33512006-02-09 Paul Eggert <eggert@cs.ucla.edu>
3352
3353 More portability fixes for problems summarized by Nelson H. F. Beebe.
3354
3355 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
3356 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
3357 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
3358 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
3359 messes up because C++ code is compiled in 32-bit mode but linked
3360 in 64-bit mode.
3361
33622006-02-08 Paul Eggert <eggert@cs.ucla.edu>
3363
3364 More portability fixes for problems summarized by Nelson H. F. Beebe.
3365
3366 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
3367 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
3368
3369 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
3370 nodist_PROGRAMS, since we don't need to actually compile the
3371 example if we're just doing a plain 'make'. This avoids bothering
3372 the installer unnecessarily about problems due to weird C++
3373 compilers.
3374
33752006-02-06 Paul Eggert <eggert@cs.ucla.edu>
3376
3377 More portability fixes for problems summarized by Nelson H. F. Beebe.
3378
3379 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
3380 than #include "...", and compile with -I'.'. The old method was
3381 not portable, according to Posix and the C standard, and it does
3382 not work with Sun C 5.7, where previous #line directives affect
3383 the working directory used in later #include "..." directives.
3384
33852006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3386
3387 Various DJGGP specific issues in /djgpp
3388
33892006-02-02 Paul Eggert <eggert@cs.ucla.edu>
3390
3391 More portability fixes for problems summarized by Nelson H. F. Beebe.
3392
3393 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
3394 '#include <map>' works and that you can apply ++ to iterators.
3395
33962006-02-01 Paul Eggert <eggert@cs.ucla.edu>
3397
3398 Work around portability problems summarized by Nelson H. F. Beebe in
3399 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
3400
3401 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3402 that '#include <string>' works.
3403
3404 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
3405 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
3406 "warning: sorry: semantics of inline function static data `const
3407 unsigned char translate_table[262]' are wrong (you'll wind up with
3408 multiple copies)".
3409
3410 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
3411 or, xor to not_, and_, or_, and xor_, respectively. This works
3412 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
3413 random system header somewhere that includes the equivalent of
3414 <iso646.h>.
3415
3416 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
3417 -E" works; it apparently doesn't work with PathScale EKO Compiler
3418 Suite Version 2.0.
3419
34202006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
3421
3422 During deterministic GLR operation, user actions should be able to
3423 influence the parse by changing yychar. To make this easier to fix and
3424 to make glr.c easier to evolve in general, don't maintain yytoken in
3425 parallel with yychar; just compute yytoken when needed.
3426 * tests/glr-regression.at (Incorrect lookahead during deterministic
3427 GLR): Check that setting yychar in a user action has the intended
3428 effect.
3429 * data/glr.c (yyGLRStack): Remove yytokenp member.
3430 (yyclearin): Don't set *yytokenp.
3431 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
3432 yychar rather than *yytokenp to determine the current lookahead.
3433 Compute yytoken locally when needed.
3434 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
3435 point to.
3436
3437 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
3438 after `--report' documentation.
3439
34402006-01-30 Paul Eggert <eggert@cs.ucla.edu>
3441
3442 * src/parse-gram.y (grammar_declaration): Location of printer
3443 symbol is @1, not list->location. Bug reported by twlevo.
3444 * tests/input.at (Incompatible Aliases): Adjust to above change.
3445
34462006-01-29 Paul Eggert <eggert@cs.ucla.edu>
3447
3448 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
3449 all the test at once. This makes the output easier to read in the
3450 normal case.
3451
3452 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
3453 got from <http://bro-ids.org/download.html>. The bug is that
3454 when two actions appeared in succession, the second one was
3455 scanned before the first one was added to the grammar rule
3456 as a midrule action. Bison then output the incorrect warning
3457 "parse.y:905.17-906.36: warning: unused value: $3".
3458 * src/parse-gram.y (BRACED_CODE, action): These are no longer
3459 associated with a value.
3460 (rhs): Don't invoke grammar_current_rule_action_append.
3461 (action): Invoke it here instead.
3462 * src/reader.c (grammar_midrule_action): Now extern.
3463 (grammar_current_rule_action_append): Don't invoke
3464 grammar_midrule_action; that is now the scanner's job.
3465 * src/reader.h (last_string, last_braced_code_loc):
3466 (grammar_midrule_action): New decls.
3467 * src/scan-gram.l (last_string): Now extern, sigh.
3468 (last_braced_code_loc): New extern variable.
3469 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
3470 rule already has an action.
3471 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
3472 * tests/input.at (AT_CHECK_UNUSED_VALUES):
3473 Add some tests to check that the above changes fixed the bug.
3474
34752006-01-27 Paul Eggert <eggert@cs.ucla.edu>
3476
3477 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
3478 All used changed. Check whether the symbol has a destructor,
3479 not whether it is typed.
3480 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
3481 that the values are still reported as unused. All line numbers
3482 adjusted.
3483
34842006-01-23 Paul Eggert <eggert@cs.ucla.edu>
3485
3486 Work around a bug in bro 0.8, which underparenthesizes its
3487 definition of YYLLOC_DEFAULT.
3488 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
3489 their arguments.
3490 * data/lalr1.cc: Likewise.
3491 * data/yacc.cc: Likewise.
3492
34932006-01-22 Paul Eggert <eggert@cs.ucla.edu>
3494
3495 Work around a bug in Pike 7.0, and give the Pike folks a
3496 better way to override the usual int widths.
3497 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
3498 user can override the types.
3499 (short): #undef, to work around a bug in Pike 7.0.
3500 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
3501 (union yyalloc.yyss): Use yytype_int16 rather than short.
3502 All uses changed.
3503 (yysigned_char): Remove.
3504 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
3505 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
3506 * tests/regression.at (Web2c Actions): Adjust to above changes.
3507
3508 * src/reader.c (check_and_convert_grammar): New function.
3509 (reader): Close the input file even if something went wrong during
3510 parsing. Minor file descriptor leak reported by twlevo.
3511
3512 * src/assoc.c (assoc_to_string): Use a default: abort (); case
3513 to pacify gcc -Wswitch-default.
3514 * src/scan-gram.l (adjust_location): Use a default: break; case
3515 to pacify gcc -Wswitch-default.
3516 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
3517 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3518 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3519 Move these decls to scan-skel.l, since they don't need to be
3520 visible elsewhere.
3521 * src/scan-skel.l: Accept the above decls.
3522 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
3523 is used.
3524
35252006-01-21 Paul Eggert <eggert@cs.ucla.edu>
3526
3527 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
3528 since we don't want to insist on a version number at the start
3529 of the changelog every time.
3530 * Makefile.maint: Sync from coreutils a bit better.
3531 (sc_trailing_blank): Renamed from sc_trailing_space.
3532 All uses changed.
3533 (sc_no_if_have_config_h, sc_require_config_h):
3534 (sc_prohibit_assert_without_use): New rules.
3535 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
3536 (sc_dd_max_sym_length): Fix leading spaces in rule.
3537 (sc_system_h_headers): Prefix with @.
3538 (sc_useless_cpp_parens, m4-check): Output line numbers.
3539 (changelog-check): Allow version only in head.
3540 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
3541 satisfy new Makefile.maint rule.
3542 * data/glr.c: Likewise.
3543 * data/glr.cc: Likewise.
3544 * data/lalr1.cc: Likewise.
3545 * data/yacc.c: Likewise.
3546 * lib/ebitsetv.c: Likewise.
3547 * lib/lbitset.c: Likewise.
3548 * lib/subpipe.c: Likewise.
3549 * lib/timevar.c: Likewise.
3550 * src/system.h: Likewise.
3551 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
3552 * djgpp/Makefile.maint: Add copyright notice.
3553 * djgpp/README.in: Likewise.
3554 * djgpp/config.bat: Likewise.
3555 * djgpp/config.site: Likewise.
3556 * djgpp/config_h.sed: Likewise.
3557 * djgpp/djunpack.bat: Likewise.
3558 * djgpp/config.sed: Fix copyright notice to match standard format.
3559 * djgpp/subpipe.h: Likewise.
3560 * lib/bitsetv-print.c: Likewise.
3561 * lib/bitsetv.c: Likewise.
3562 * lib/subpipe.h: Likewise.
3563 * lib/timevar.c: Likewise.
3564 * lib/timevar.h: Likewise.
3565 * djgpp/subpipe.c: Use standard recipe for config.h.
3566 * lib/abitset.c: Likewise.
3567 * lib/bitset.c: Likewise.
3568 * lib/bitset_stats.c: Likewise.
3569 * lib/bitsetv-print.c: Likewise.
3570 * lib/bitsetv.c: Likewise.
3571 * lib/ebitsetv.c: Likewise.
3572 * lib/get-errno.c: Likewise.
3573 * lib/lbitset.c: Likewise.
3574 * lib/subpipe.c: Likewise.
3575 * lib/timevar.c: Likewise.
3576 * lib/vbitset.c: Likewise.
3577 * tests/local.at: Likewise.
3578 * src/scan-gram.l: Don't include verify.h, since system.h does
3579 that for us.
3580 * .x-sc_require_config_h: New file.
3581 * .x-sc_unmarked_diagnostics: New file.
3582
35832006-01-20 Paul Eggert <eggert@cs.ucla.edu>
3584
3585 Be a bit more systematic about using 'abort'.
3586 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
3587 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
3588 Put 'default: abort ();' before some other case, to satisfy older
3589 pedantic compilers.
3590 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3591 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
3592 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
3593 * src/conflicts.c (resolve_sr_conflict): Likewise.
3594 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
3595 (get_decision_str, get_orientation_str, get_node_alignment_str):
3596 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
3597 (get_linestyle_str, get_arrowstyle_str): Likewise.
3598 * src/conflicts.c (resolve_sr_conflict):
3599 Use a default case rather than one for the one remaining enum
3600 value, to catch invalid enum values as well.
3601 * src/lalr.c (set_goto_map, map_goto):
3602 Prefer "assert (FOO);" to "if (!FOO) abort ();".
3603 * src/nullable.c (nullable_compute, token_definitions_output):
3604 Likewise.
3605 * src/reader.c (packgram, reader): Likewise.
3606 * src/state.c (transitions_to, state_new, state_reduction_find):
3607 Likewise.
3608 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
3609 (symbol_pack): Likewise.
3610 * src/tables.c (conflict_row, pack_vector): Likewise.
3611 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
3612 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
3613 * src/system.h: Don't include <assert.h>.
3614 (assert): New macro.
3615
3616 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
3617 (Destructor Decl, Parser Function, Pure Calling):
3618 Describe rules for braces inside C code more carefully.
3619
36202006-01-19 Paul Eggert <eggert@cs.ucla.edu>
3621
3622 Fix some porting glitches found by Nelson H. F. Beebe.
3623 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
3624 compilers that don't understand that abort () does not return.
3625 * src/state.c (transitions_to): Likewise.
3626 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3627 that '#include <cstdlib>' works.
3628 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
3629 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
3630 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
3631 for the benefit of some pre-C99 compilers.
3632
3633 * bootstrap: Undo changes to gnulib files that autoreconf made.
3634
3635 Minor fixups to get 'make maintainer-check' to work.
3636 * configure.ac: Don't use -Wnested-externs, as it's incompatible
3637 with the new verify.h implementation.
3638 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
3639 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
3640 * data/yacc.c (YYUSE): Likewise.
3641 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
3642 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
3643 * src/parse-gram.y (declaration): Don't pass a string constant
3644 to a function that expects char *, since GCC might complain
3645 about the constant value.
3646 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
3647 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
3648 before #defining them.
3649 * tests/glr-regression.at
3650 (Incorrectly initialized location for empty right-hand side in GLR):
3651 In yyerror, use the msg arg.
3652 (Corrupted semantic options if user action cuts parse):
3653 (Incorrect lookahead during deterministic GLR):
3654 (Incorrect lookahead during nondeterministic GLR):
3655 Don't name a local var 'index'; it shadows string.h's 'index'.
3656
36572006-01-19 Akim Demaille <akim@epita.fr>
3658
3659 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
3660 location, not just parts of it.
3661
36622006-01-18 Paul Eggert <eggert@cs.ucla.edu>
3663
3664 * NEWS: Document the fact that multiple %unions are now allowed.
3665 * doc/bison.texinfo (Union Decl): Likewise.
3666 * TODO: This feature is now implemented, so remove it from
3667 the wishlist.
3668
3669 * Makefile.maint: Merge with coreutils Makefile.maint.
3670 (CVS_LIST): Use build-aux version if available.
3671 (VERSION_REGEXP): New macro.
3672 (syntax-check-rules): Add sc_no_if_have_config_h,
3673 sc_prohibit_assert_without_use, sc_require_config_h,
3674 sc_useless_cpp_parens.
3675 (sc_obsolete_symbols): Check for O_NDELAY.
3676 (sc_dd_max_sym_length): Track coreutils.
3677 (sc_unmarked_diagnostics): Look in all files, not just *.c.
3678 (sc_useless_cpp_parens): New rule.
3679 (news-date-check): Look for version or today's date.
3680 (changelog-check): Don't require version number near head.
3681 (copyright-check): Use current year instead of hardwiring 2005.
3682 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
3683 (announcement): Add --gpg-key-ID.
3684
3685 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
3686 with "file system".
3687
3688 Avoid undefined behavior that addressed just before the start of an
3689 array. Problem reported by twlevo.
3690 * src/reader.c (packgram): Prepend a new sentinel before ritem.
3691 * src/lalr.c (build_relations): Rely on new sentinel.
3692 * src/gram.c (gram_free): Adjust to new sentinel.
3693
36942006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
3695
3696 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
3697 yylookaheadNeeds. All uses updated.
3698 (yysplitStack): Rename local yynewLookaheadStatuses to
3699 yynewLookaheadNeeds.
3700 * data/glr-regression.at (Incorrect lookahead during nondeterministic
3701 GLR): In comments, change `lookahead status' to `lookahead need'.
3702
37032006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3704
3705 * data/glr.c (yysplitStack): A little stylistic rewrite.
3706
37072006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3708
3709 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
3710
37112006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
3712
3713 * doc/bison.texinfo: Fix some typos.
3714 (GLR Semantic Actions): New subsection discussing special
3715 considerations because GLR semantic actions might be deferred.
3716 (Actions): Mention look-ahead usage of yylval.
3717 (Actions and Locations): Mention look-ahead usage of yylloc.
3718 (Special Features for Use in Actions): Add YYEOF entry and mention it
3719 in the yychar entry.
3720 In the yychar entry, remove mention of the local yychar case (pure
3721 parser) since this is irrelevant information when writing semantic
3722 actions and since it's already discussed in `Table of Symbols' where
3723 yychar is otherwise described as an external variable.
3724 In the yychar entry, don't call it the `current' look-ahead since it
3725 isn't when semantic actions are deferred.
3726 In the yychar and yyclearin entries, add note about deferred semantic
3727 actions.
3728 Add yylloc and yylval entries discussing look-ahead usage.
3729 (Look-Ahead Tokens): When discussing yychar, don't call it the
3730 `current' look-ahead, and do mention yylval and yylloc.
3731 (Error Recovery): Cross-reference `Action Features' when mentioning
3732 yyclearin.
3733 (Table of Symbols): In the yychar entry, don't call it the `current'
3734 look-ahead.
3735 In the yylloc and yylval entries, mention look-ahead usage.
3736
37372006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3738
3739 * tests/glr-regression.at: Update copyright year to 2006.
3740
37412006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3742
3743 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
3744 use during nondeterministic operation to track which stacks have
3745 actually needed the current lookahead.
3746 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
3747 Allocate, deallocate, resize, and otherwise shuffle space for
3748 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
3749 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
3750 appropriately during nondeterministic operation.
3751 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
3752 members to store the current lookahead to be used by the deferred
3753 user action.
3754 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
3755 from which the RHS is taken. Set the lookahead members of the new
3756 yySemanticOption according to the lookahead status for stack yyk.
3757 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
3758 yyaddDeferredAction.
3759 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
3760 members of yySemanticOption before invoking yyuserAction, and then set
3761 them back to their current values afterward.
3762 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
3763 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
3764 * tests/glr-regression.at: Remove `.' from the ends of recent test case
3765 titles for consistency.
3766 (Leaked merged semantic value if user action cuts parse): In order to
3767 suppress lint warnings, use arguments in merge function, and assign
3768 char value < 128 in main.
3769 (Incorrect lookahead during deterministic GLR): New test case.
3770 (Incorrect lookahead during nondeterministic GLR): New test case.
3771
37722006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3773
3774 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
3775 !yyvaluep as signal that no semantic value is available to print.
3776 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
3777 to print a semantic value.
3778
37792006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3780
3781 * tests/glr-regression.at: For consistency with my newer test cases,
3782 don't thank myself.
3783
37842006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3785
3786 * data/glr.c (yyresolveValue): When merging semantic options, if at
3787 least one user action succeeds but a later one cuts the parse, then
3788 destroy the semantic value before returning rather than leaking it.
3789 (yyresolveStates): If a user action cuts the parse and thus
3790 yyresolveValue fails, ignore the (unset) semantic value rather than
3791 corrupting the yyGLRState, and empty the semantic options list since
3792 the user actions should have called all necessary destructors.
3793 Simplify code with YYCHK.
3794 * tests/glr-regression.at (Corrupted semantic options if user action
3795 cuts parse): New test case.
3796 (Undesirable destructors if user action cuts parse): New test case.
3797 Before applying any of this patch, this test case never actually failed
3798 for me... but only because the corrupted semantic options usually
3799 masked this bug.
3800 (Leaked merged semantic value if user action cuts parse): New test
3801 case.
3802
38032006-01-05 Akim Demaille <akim@epita.fr>
3804
3805 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
3806
38072006-01-04 Paul Eggert <eggert@cs.ucla.edu>
3808
3809 * data/c.m4 (b4_c_modern): New macro, with a new provision for
3810 _MSC_VER. Problem reported by Cenzato Marco.
3811 (b4_c_function_def): Use it.
3812 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
3813 b4_c_modern.
3814 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
3815 than rolling our own.
3816
38172006-01-04 Akim Demaille <akim@epita.fr>
3818
3819 Also warn about non-used mid-rule values.
3820 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
3821 member.
3822 (symbol_list_new): Adjust.
3823 * src/reader.c (symbol_typed_p): New.
3824 (grammar_rule_check): Use it.
3825 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
3826 Check its rule.
3827 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
3828 Use it.
3829 * tests/actions.at (Exotic Dollars): Adjust.
3830
38312006-01-04 Akim Demaille <akim@epita.fr>
3832
3833 * src/reader.c (grammar_midrule_action): If $$ is set in a
3834 mid-rule, move the `used' bit to its lhs.
3835 * tests/input.at (Unused values): New.
3836 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
3837
38382006-01-03 Paul Eggert <eggert@cs.ucla.edu>
3839
3840 * doc/bison.texinfo (Bison Options): Say more accurately what
3841 --yacc does.
3842 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
3843 about declarations in the grammar when in Yacc mode, as POSIX does
3844 not require a diagnostic when the grammar uses extensions.
3845
3846 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
3847
3848 Warn about dubious constructions like "%token T T".
3849 Reported by twlevo.
3850 * src/symtab.h (struct symbol.declared): New member.
3851 * src/symtab.c (symbol_new): Initialize it to false.
3852 (symbol_class_set): New arg DECLARING, specifying whether
3853 this is a declaration that we want to warn about, if there
3854 is more than one of them. All uses changed.
3855
3856 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
3857 Allow multiple %union directives, whose contents concatenate.
3858 * src/parse-gram.y (grammar_declaration): Likewise.
3859 Use muscle_code_grow, so that we don't need stype_line any more.
3860 All uses changed.
3861
3862 * src/muscle_tab.c (muscle_grow): Fix comment.
3863
3864 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
3865 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
3866 Update copyright year to 2006.
3867
38682006-01-03 Akim Demaille <akim@epita.fr>
3869
3870 Have glr.cc pass (some of) the calc.at tests.
3871 * data/glr.cc (b4_parse_param_orig): New.
3872 (b4_parse_param): Improve its definition, and bound it more
3873 clearly in the skeleton.
3874 (b4_epilogue): Append, instead of prepending, in order to keep
3875 #line consistency.
3876 Simplify the generation of auxiliary functions: locations and
3877 purity are mandated.
3878 (b4_global_tokens_and_yystype): Honor it.
3879 * data/location.cc (c++.m4): Don't include it.
3880 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
3881 and AT_SKEL_CC_IF.
3882 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
3883 AT_LALR1_CC_IF.
3884 Be sure to initialize the first position's filename.
3885 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
3886 mandated anyway.
3887 (AT_CHECK_CALC_GLR_CC): New.
3888 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
3889
38902006-01-02 Akim Demaille <akim@epita.fr>
3891
3892 * src/output.c (output_skeleton): Don't hard wire the inclusion of
3893 c.m4.
3894 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3895 * data/glr.cc: Do not include stack.hh.
3896
38972006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3898
3899 * data/glr.c: Reformat whitespace with tabs.
3900 (b4_lpure_formals): Remove this unused m4 macro.
3901 * tests/cxx-type.at: Reformat whitespace with tabs.
3902 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
3903 since it's a member. Rename type to isNterm for clarity.
3904
39052005-12-29 Akim <akim@sulaco.local>
3906
3907 Let glr.cc catch up with symbol_value_print.
3908 * data/glr.cc (b4_yysymprint_generate): Replace by...
3909 (b4_yy_symbol_print_generate): this.
3910 (yy_symbol_print, yy_symbol_value_print): Declare them.
3911
39122005-12-28 Paul Eggert <eggert@cs.ucla.edu>
3913
3914 * src/location.h (boundary): Note that a line or column equal
3915 to INT_MAX indicates an overflow.
3916 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
3917 (rule_length_overflow, increment_rule_length, add_column_width):
3918 New functions.
3919 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
3920 (<SC_BRACED_CODE>"}"):
3921 Use increment_rule_length rather than incrementing it by hand.
3922 (adjust_location, handle_syncline): Diagnose overflow.
3923 (handle_action_dollar, handle_action_at):
3924 Fix bug with monstrosities like $-2147483648.
3925 Remove now-unnecessary checks.
3926 (scan_integer): Verify assumptions and remove now-unnecessary checks.
3927 (convert_ucn_to_byte): Verify assumptions.
3928 (handle_syncline): New arg LOC. All callers changed.
3929 Don't store through a value derived from char const * pointer.
3930
3931 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
3932 GCC warnings.
3933
39342005-12-27 Paul Eggert <eggert@cs.ucla.edu>
3935
3936 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
3937 Remove unnecessary forward static decls.
3938
39392005-12-27 Akim Demaille <akim@epita.fr>
3940
3941 * src/reader.c (grammar_current_rule_check): Also check that $$
3942 is used.
3943 Take the rule to check as argument, hence rename as...
3944 (grammar_rule_check): this.
3945 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
3946 Rename as...
3947 (grammar_rule_begin, grammar_rule_end): these, for consistency.
3948 (grammar_midrule_action, grammar_symbol_append): Now static.
3949 * tests/torture.at (input): Don't rely on the default action
3950 being always performed.
3951 * tests/calc.at: "Set" $$ even when the action is "cut" with
3952 YYERROR or other.
3953 * tests/actions.at (Exotic Dollars): Instead of using unused
3954 values, check that the warning is issued.
3955
39562005-12-22 Paul Eggert <eggert@cs.ucla.edu>
3957
3958 * NEWS: Improve wording for unused-value warnings.
3959
39602005-12-22 Akim Demaille <akim@epita.fr>
3961
3962 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
3963 (b4_yysymprint_generate): Rename as...
3964 (b4_yy_symbol_print_generate): this.
3965 Generate yy_symbol_print instead of yysymprint.
3966 Generate also yy_symbol_value_print, and use it.
3967
39682005-12-22 Akim Demaille <akim@epita.fr>
3969
3970 * NEWS: Warn about unused values.
3971 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
3972 a `used' member.
3973 (symbol_list_n_get, symbol_list_n_used_set): New.
3974 (symbol_list_n_type_name_get): Use symbol_list_n_get.
3975 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
3976 * src/reader.c (grammar_current_rule_check): Check that values are
3977 used.
3978 * src/symtab.c (symbol_print): Accept 0.
3979 * tests/existing.at: Remove the type information.
3980 Empty the actions.
3981 Remove useless actions (beware of mid-rule actions: perl -000
3982 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
3983 * tests/actions.at (Exotic Dollars): Use unused values.
3984 * tests/calc.at: Likewise.
3985 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3986 Likewise.
3987
3988 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
3989 rule_useful_p.
3990
39912005-12-21 Paul Eggert <eggert@cs.ucla.edu>
3992
3993 Undo 2005-12-01 tentative license wording change. The wording is
3994 still being reviewed by the lawyers, and we don't want to wait for
3995 them before publishing a test release. For now, revert to the
3996 previous wording.
3997 * NEWS: Undo 2005-12-01 change.
3998 * data/glr.c: Revert to previous license wording.
3999 * data/glr.cc: Likewise.
4000 * data/lalr1.cc: Likewise.
4001 * data/location.cc: Likewise.
4002 * data/yacc.c: Likewise.
4003
4004 * NEWS: Reword %destructor vs YYABORT etc.
4005 * data/glr.c: Use American spacing, for consistency.
4006 * data/glr.cc: Likewise.
4007 * data/lalr1.cc: Likewise.
4008 * data/yacc.c: Likewise.
4009 * data/yacc.c: Reformat comments slightly.
4010 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
4011 for consistency. Fix some spelling errors and reword recently-included
4012 text slightly.
4013 * tests/cxx-type.at: Cast results of malloc, for C++.
4014
40152005-12-21 Joel E. Denny <address@hidden>
4016
4017 * tests/cxx-type.at: Construct a tree, count the parents of shared
4018 nodes, and free each node once and only once. Previously, the memory
4019 for semantic values was leaked instead.
4020
40212005-12-21 Joel E. Denny <address@hidden>
4022
4023 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
4024 (yylval, yylloc): If pure, #define to yystackp->yyval and
4025 yystackp->yyloc similar to yychar and yynerrs.
4026 (yyparse): If pure, remove local yylval and yylloc. Add local
4027 yystackp to accommodate pure definitions of yylval and yylloc.
4028 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
4029 yylvalp and yyllocp to &yylval and &yylloc.
4030 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
4031 namespace. Previously, nerrs and char were missing, but lval and lloc
4032 weren't necessary.
4033 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
4034 yylvalp and yyllocp parameters since, if pure, these are now always
4035 accessible through yystackp. If not pure, they are still accessible
4036 globally.
4037 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
4038 `if (YYID (N))' to pacify lint.
4039
40402005-12-21 Akim Demaille <akim@epita.fr>
4041
4042 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
4043 destroy the RHS symbols of a rule.
4044 * data/yacc.c (yylen): Initialize to 0.
4045 Keep its value to the number of items to possibly shift.
4046 In particular, a regular successful parse that ends on YYFINAL by
4047 a (internal) YYACCEPT must not have yylen != 0.
4048 (yyerrorlab, yyreturn): Pop the RHS.
4049 Reorder a bit to emphasize the `shifting' bits of code.
4050 (YYPOPSTACK): Now accept a number of items to pop.
4051 * data/lalr1.cc: Likewise.
4052 * data/glr.c: Formatting changes.
4053 Use goto instead of fall through.
4054 * doc/bison.texinfo (Destructor Decl): Complete.
4055
40562005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4057
4058 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4059 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
4060 * djgpp/config.bat: Replace every occurence of the file name
4061 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4062 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4063 * djgpp/config.sed: Replace every occurence of the file name
4064 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4065 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4066 * djgpp/djunpack.bat: DJGPP specific file.
4067 * djgpp/fnchange.lst: DJGPP specific file.
4068 * djgpp/README.in: Add new information about how to unpack the bison
4069 source on MSDOS and other systems which have 8.3 file name restrictions
4070 using djunpack.bat and fnchange.lst.
4071
40722005-12-12 Paul Eggert <eggert@cs.ucla.edu>
4073
4074 * bootstrap (build_cvs_prefix): Remove; unused.
4075 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
4076 when getting gnulib.
4077
40782005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
4079
4080 * data/glr.c: Reorder typedef declarations for structs to match order
4081 of struct declarations.
4082 Rename yystack everywhere to yystackp except in yyparse where it's not
4083 a pointer.
4084 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
4085 consistency.
4086 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
4087 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
4088 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
4089 lint.
4090
40912005-12-09 Paul Eggert <eggert@cs.ucla.edu>
4092
4093 * tests/sets.at (Accept): Fix typos in regular expression used to
4094 sed out the final state number.
4095
4096 Work around portability problem on Solaris 10: flex-generated
4097 files include <stdio.h> before <config.h>, which messes up
4098 because the latter defines __EXTENSIONS__. Address the problem
4099 by creating two new little files that include <config.h> first,
4100 then include the flex-generated files. Rewrite everyone else
4101 to include <config.h> first, as well.
4102 * lib/timevar.c: Always include "config.h".
4103 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
4104 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
4105 (EXTRA_bison_SOURCES): New macro.
4106 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
4107 * src/system.h: Don't include config.h.
4108 * src/LR0.c: Include <config.h> first.
4109 * src/assoc.c: Likewise.
4110 * src/closure.c: Likewise.
4111 * src/complain.c: Likewise.
4112 * src/conflicts.c: Likewise.
4113 * src/derives.c: Likewise.
4114 * src/files.c: Likewise.
4115 * src/getargs.c: Likewise.
4116 * src/gram.c: Likewise.
4117 * src/lalr.c: Likewise.
4118 * src/location.c: Likewise.
4119 * src/main.c: Likewise.
4120 * src/muscle_tab.c: Likewise.
4121 * src/nullable.c: Likewise.
4122 * src/output.c: Likewise.
4123 * src/parse-gram.y: Likewise.
4124 * src/print.c: Likewise.
4125 * src/print_graph.c: Likewise.
4126 * src/reader.c: Likewise.
4127 * src/reduce.c: Likewise.
4128 * src/relation.c: Likewise.
4129 * src/state.c: Likewise.
4130 * src/symlist.c: Likewise.
4131 * src/symtab.c: Likewise.
4132 * src/tables.c: Likewise.
4133 * src/uniqstr.c: Likewise.
4134 * src/vcg.c: Likewise.
4135
4136 * src/parse-gram.y: Fix minor problems uncovered by lint.
4137 (current_lhs, current_lhs_location): Now static.
4138 (current_assoc): Remove unused variable.
4139
4140 Cleanups so that Bison-generated parsers have less lint.
4141 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
4142 Prepend /*ARGSUSED*/, for lint's sake.
4143 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
4144 definition if 'lint' is defined.
4145 (YYID): New macro (or function, if lint).
4146 All uses of /*CONSTCOND*/0 replaced by YYID(0).
4147 * data/yacc.c: Likewise.
4148 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
4149 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
4150 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
4151 is C++ only.
4152 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
4153 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
4154 Use YYID(0) rather than 0, for lint.
4155 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
4156 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
4157
41582005-12-07 Paul Eggert <eggert@cs.ucla.edu>
4159
4160 * tests/glr-regression.at
4161 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4162 Close memory leak reported by twlevo.
4163
41642005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
4165
4166 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
4167 all stacks.
4168 (yyparse): Iterate another stack in order to call user destructors.
4169 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4170 New test case.
4171 (Duplicated user destructor for lookahead): This test now is expected
4172 to succeed.
4173
41742005-12-01 Paul Eggert <eggert@cs.ucla.edu>
4175
4176 * NEWS: Document the following change.
4177 * data/yacc.c: Say "parser skeleton" rather than "file", since
4178 it's no longer just a file.
4179 * data/glr.c: Grant a special exception for C GLR parsers, that
4180 reads like the already-existing exception for C LALR(1) parsers.
4181 * data/glr.cc: Likewise.
4182 * data/lalr1.cc: Likewise.
4183 * data/location.cc: Likewise.
4184 * data/yacc.c: Reword the "written by" statement to clarify that
4185 it was the parser skeleton, not the entire output file.
4186 * data/glr.c: Written by Paul Hilfinger.
4187 * data/glr.cc: Written by Akim Demaille.
4188 * data/lalr1.cc: Likewise.
4189
41902005-11-18 Paul Eggert <eggert@cs.ucla.edu>
4191
4192 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
4193 Fix typos in previous change that broke 'make check'.
4194 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
4195 supported in C.
4196 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
4197 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
4198 We can revert this once things settle down.
4199
4200 * src/conflicts.c (conflicts_print): Don't print file name twice
4201 when %expect fails because there were no conflicts.
4202 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
4203 change.
4204 * tests/conflicts.at (%expect not enough, %expect too much):
4205 (%expect with reduce conflicts): Adjust to new behavior.
4206
42072005-11-18 Akim Demaille <akim@epita.fr>
4208
4209 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
4210 errors.
4211 * NEWS: Document this.
4212 * doc/bison.texinfo (Expect Decl): Likewise.
4213
42142005-11-16 Akim Demaille <akim@epita.fr>
4215
4216 Generalize the display of semantic values and locations in traces.
4217 * data/glr.c (yy_reduce_print): Fix indices (again).
4218 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
4219 literal integers.
4220 * data/lalr1.cc (yyreduce_print): Rename as...
4221 (yy_reduce_print): this.
4222 Display values and locations.
4223 * data/yacc.c (yy_reduce_print): Likewise.
4224 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
4225 (yysymprint): Move higher to be visible from yy_reduce_print).
4226 (yyparse): Adjust.
4227 * tests/calc.at: Adjust the expected length of the traces.
4228
42292005-11-14 Akim Demaille <akim@epita.fr>
4230
4231 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
4232 from 1 to N, while values and location start at 0.
4233 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
4234
42352005-11-14 Akim Demaille <akim@epita.fr>
4236
4237 * data/glr.c (yy_reduce_print): Fix the $ number.
4238
42392005-11-14 Akim Demaille <akim@epita.fr>
4240
4241 "Use" parse parameters.
4242 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
4243 * data/glr.c, data/glr.cc: Use them.
4244 * data/glr.c (YYUSE): Have a C++ definition that supports
4245 non-pointer types.
4246
42472005-11-14 Akim Demaille <akim@epita.fr>
4248
4249 * data/glr.c (yyexpandGLRStack): Declare only if defined.
4250
42512005-11-14 Akim Demaille <akim@epita.fr>
4252
4253 * data/glr.cc: New.
4254 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
4255
42562005-11-12 Akim Demaille <akim@epita.fr>
4257
4258 Let position and location be PODs.
4259 * data/location.cc (position::initialize, location::initialize): New.
4260 (position::position, location::location): Define only if
4261 b4_location_constructors is defined.
4262 * data/lalr1.cc (b4_location_constructors): Define it for backward
4263 compatibility.
4264 * doc/bison.texinfo (Initial Action Decl): Use initialize.
4265
42662005-11-12 Akim Demaille <akim@epita.fr>
4267
4268 * data/lalr1.cc: Move the body of the ctor and dtor into the
4269 parser file (instead of the header).
4270 Wrap the implementations in a "namespace yy".
4271
42722005-11-12 Akim Demaille <akim@epita.fr>
4273
4274 Have glr.c include its header file when created.
4275 * data/glr.c (b4_shared_declarations): New.
4276 Output them verbatim in the parser if !%defines, otherwise
4277 output then in the header file, and include it instead.
4278
42792005-11-11 Akim Demaille <akim@epita.fr>
4280
4281 * data/glr.c: Comment changes.
4282
42832005-11-11 Akim Demaille <akim@epita.fr>
4284
4285 When yydebug, report semantic and location values for reductions.
4286 * data/glr.c (yy_reduce_print): Report the semantic values and the
4287 locations.
4288 (YY_REDUCE_PRINT): Adjust.
4289 (yyglrReduce): Use them.
4290 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
4291 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
4292 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
4293 traces.
4294
42952005-11-10 Akim Demaille <akim@epita.fr>
4296
4297 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
4298 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
4299 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
4300
43012005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
4302
4303 * m4/cxx.m4, examples/Makefile.am: Don't build
4304 examples/calc++ if no C++ compiler is available. (trivial change)
4305
43062005-11-09 Akim Demaille <akim@epita.fr>
4307
4308 * src/scan-skel.l: Use a couple of asserts.
4309
43102005-11-03 Akim Demaille <akim@epita.fr>
4311
4312 In some (weird) cases, the final state number is incorrect.
4313 Reported by Alexandre Duret-Lutz.
4314 * src/LR0.c (state_list_append): Remove the computation of
4315 final_state.
4316 (save_reductions): Do it here.
4317 (get_state): Alpha conversion.
4318 (generate_states): Use a for loop.
4319 * src/gram.h (item_number_is_rule_number)
4320 (item_number_is_symbol_number): New.
4321 * src/state.c: Use assert.
4322 * src/system.h: Include assert.h.
4323 * tests/sets.at (Accept): New.
4324
43252005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4326
4327 * data/glr.c (yyfill): Adjust comment.
4328 (yyresolveAction): Initialize default location properly
4329 for empty right-hand sides.
4330 (yydoAction): Ditto.
4331 Add comment explaining apparently dead code.
4332 * tests/glr-regression.at
4333 (Incorrectly initialized location for empty right-hand side in GLR):
4334 New test.
4335
43362005-10-30 Paul Eggert <eggert@cs.ucla.edu>
4337
4338 * bootstrap (cleanup_gnulib): New function. Use it to clean up
4339 gnulib when interrupted. This fixes some race conditions and
4340 works around some portability problems (one noted by Paul
4341 Hilfinger).
4342
43432005-10-22 Akim <akim@epita.fr>
4344
4345 * Makefile.cfg: Adjust to config -> build-aux.
4346 Reported by twledo.
4347
43482005-10-21 Akim Demaille <akim@epita.fr>
4349
4350 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
4351 the %parse-params.
4352 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
4353 * data/yacc.c (b4_Pure_if): Rename as...
4354 (b4_yacc_pure_if): this.
4355 (YY_SYMBOL_PRINT, yyparse): Adjust.
4356 * doc/bison.texinfo: Formatting changes.
4357
43582005-10-21 Akim Demaille <akim@epita.fr>
4359
4360 Finish the transition config -> build-aux.
4361 * configure.ac, Makefile.am: Use build-aux.
4362 * config/prev-version, config/announce-gen, config/Makefile.am:
4363 Move to...
4364 * build-aux/prev-version, build-aux/announce-gen,
4365 * build-aux/Makefile.am: here.
4366
43672005-10-14 Akim Demaille <akim@epita.fr>
4368
4369 * examples/calc++/test: Use set -x only when VERBOSE.
4370
43712005-10-13 Paul Eggert <eggert@cs.ucla.edu>
4372
4373 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
4374 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
4375
43762005-10-13 Akim Demaille <akim@epita.fr>
4377
4378 * src/scan-skel.l: Output the base name parts of the parser and
4379 header file names.
4380 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
4381 additional checks.
4382 Use this to exercise C++ outputs in subdirs.
4383 Reported by Oleg Smolsky.
4384
43852005-10-12 Paul Eggert <eggert@cs.ucla.edu>
4386
4387 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
4388 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
4389 Problem reported by John P. Hartmann.
4390 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
4391 already defined it.
4392
43932005-10-12 Akim Demaille <akim@epita.fr>
4394
4395 * src/parse-gram.y (version_check): Exit 63 to please missing
4396 (stands for "version mismatch).
4397 * tests/input.at, doc/bison.texinfo: Adjust.
4398
43992005-10-10 Paul Eggert <eggert@cs.ucla.edu>
4400
4401 Work around portability problems with Visual Age C compiler
4402 (xlc and xlC_r) reported by John P. Hartmann.
4403 * data/location.cc (initial_column, initial_line): Remove.
4404 All uses replaced by 0 and 1.
4405 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
4406 that xlc complains about.
4407 * src/scan-skel.l (skel_wrap): Likewise.
4408 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
4409 as __STDC__.
4410 * data/yacc.c (YYMODERN_C): New macro, which also looks at
4411 __STDC_VERSION__. Use it everywhere instead of looking at
4412 __STDC__ and __cplusplus.
4413
44142005-10-10 Akim Demaille <akim@epita.fr>
4415
4416 * examples/calc++/test: Be quiet unless VERBOSE.
4417
44182005-10-05 Paul Eggert <eggert@cs.ucla.edu>
4419
4420 * data/c.m4 (yydestruct, yysymprint):
4421 Use YYUSE instead of casting to void.
4422 * data/glr.c (YYUSE): New macro.
4423 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4424 Use it instead of rolling our own.
4425 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4426 (YYCHK1):
4427 Use /*CONSTCOND*/ to suppress lint warnings.
4428 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4429 (YY_STACK_PRINT): Use 'false' not '0'.
4430 (YYUSE): New macro.
4431 (yysymprint_, yydestruct_): Use it instead of rolling our own.
4432 * data/yacc.c (YYUSE): New macro.
4433 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
4434 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
4435 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
4436
4437
4438 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
4439 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
4440
44412005-10-04 Paul Eggert <eggert@cs.ucla.edu>
4442
4443 Undo the parts of the unlocked-I/O change that substituted
4444 putc or puts for printf. This might hurt performance a bit,
4445 but some people prefer the printf style.
4446 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
4447 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
4448 All uses replaced by YYFPRINTF and YYDPRINTF.
4449 * data/yacc.c: Likewise.
4450 * lib/bitset.c (bitset_print): Likewise.
4451 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
4452 putc and puts.
4453 * lib/lbitset.c (debug_lbitset): Likewise.
4454 * src/closure.c (print_firsts, print_fderives): Likewise.
4455 * src/gram.c (grammar_dump): Likewise.
4456 * src/lalr.c (look_ahead_tokens_print): Likewise.
4457 * src/output.c (escaped_output): Likewise.
4458 (user_actions_output): Break apart two printfs.
4459 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
4460 * src/reduce.c (reduce_print): Likewise.
4461 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4462 * src/system.h: Include unlocked-io.h rathe than stdio.h.
4463
4464 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4465 Use assignments rather than casts-to-void to suppress
4466 unused-variable warnings. This pacifies 'lint'.
4467 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
4468 unused-variable warnings.
4469
44702005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4471
4472 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4473
44742005-10-02 Paul Eggert <eggert@cs.ucla.edu>
4475
4476 Use unlocked I/O for a minor performance improvement on hosts like
4477 GNU/Linux and Solaris that support unlocked I/O. The basic idea
4478 is to use the gnlib unlocked-io module, and to prefer putc and
4479 puts to printf when either will work (since the latter doesn't
4480 come in an unlocked flavor).
4481 * bootstrap (gnulib_modules): Add unlocked-io.
4482 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
4483 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
4484 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
4485 and similarly for puts and putc and printf.
4486 * data/yacc.c: Likewise.
4487 * lib/bitset.c (bitset_print): Likewise.
4488 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
4489 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
4490 to printf.
4491 * lib/lbitset.c (debug_lbitset): Likewise.
4492 * src/closure.c (print_firsts, print_fderives): Likewise.
4493 * src/gram.c (grammar_dump): Likewise.
4494 * src/lalr.c (look_ahead_tokens_print): Likewise.
4495 * src/output.c (escaped_output): Likewise.
4496 (user_actions_output): Coalesce two printfs.
4497 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
4498 * src/reduce.c (reduce_print): Likewise.
4499 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4500 * src/system.h: Include unlocked-io.h rather than stdio.h.
4501
4502 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
4503 this confuses xgettext.
4504
45052005-10-02 Akim Demaille <akim@epita.fr>
4506
4507 * bootstrap (gnulib_modules): Add strverscmp.
4508 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
4509 * m4/.cvsignore: Add strverscmp.m4.
4510 * src/parse-gram.y (%require): New token, new rule.
4511 (version_check): New.
4512 * src/scan-gram.l (%require): Adjust.
4513 * tests/input.at (AT_REQUIRE): New.
4514 Use it.
4515 * doc/bison.texinfo (Require Decl): New.
4516 (Calc++ Parser): Use %require.
4517
45182005-10-02 Akim Demaille <akim@epita.fr>
4519
4520 * data/location.cc: New.
4521
45222005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
4523 Akim Demaille <akim@epita.fr>
4524
4525 Make sure -odir/foo.cc creates dir/location.hh etc.
4526 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
4527 (spec_file_prefix, spec_verbose_file, spec_graph_file)
4528 (spec_defines_file): Now const.
4529 (dir_prefix): New.
4530 (short_base_name): Remove.
4531 * src/files.c: Adjust.
4532 (dirname.h): Include.
4533 (base_name): Don't prototype it.
4534 (finput): Remove, duplicates gram_in.
4535 (full_base_name, short_base_name): Replace by...
4536 (all_but_ext, all_but_tab_ext): these.
4537 (compute_base_names): Rename as...
4538 (compute_file_name_parts): this.
4539 Update to compute the new variables, including dir_prefix.
4540 Adjust dependencies.
4541 * src/output.c (prepare): Output them.
4542 * src/reader.c: Adjust to use gram_in, not finput.
4543 * src/scan-skel.l (@dir_prefix@): New.
4544
45452005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4546
4547 * lib/subpipe.c: New function end_of_output_subpipe() added
4548 to allow support for non-posix systems. This is a no-op function
4549 for posix systems.
4550
4551 * lib/subpipe.h: New function end_of_output_subpipe() added
4552 to allow support for non-posix systems. This is a no-op function
4553 for posix systems.
4554
4555 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
4556 handle the lack of pipe/fork functionality on non-posix systems.
4557
4558 * djgpp/Makefile.maint: DJGPP specific file.
4559
4560 * djgpp/README.in: DJGPP specific file.
4561
4562 * djgpp/config.bat: DJGPP specific configuration file.
4563
4564 * djgpp/config.sed: DJGPP specific configuration file.
4565
4566 * djgpp/config.site: DJGPP specific configuration file.
4567
4568 * djgpp/config_h.sed: DJGPP specific configuration file.
4569
4570 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
4571
4572 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
4573
45742005-10-02 Akim Demaille <akim@epita.fr>
4575
4576 * data/location.cc: New, extract from...
4577 * data/lalr1.cc: here.
4578 (location.hh): Include it after the user prologue, in case the
4579 filename type is defined by the user.
4580 Forward declation location and position before the pre-prologue.
4581 (yyresult_): Rename as...
4582 (yyresult): this, it's a local variable, not an attribute.
4583 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
4584
45852005-10-01 Akim Demaille <akim@epita.fr>
4586
4587 * examples/extexi: Restore the #line generation.
4588
45892005-09-30 Akim Demaille <akim@epita.fr>,
4590 Alexandre Duret-Lutz <adl@gnu.org>
4591
4592 Move the token type and YYSTYPE in the parser class.
4593 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
4594 (parser::token): New, from the moved free definition of tokens.
4595 (parser::semantic_value): Now a full definition instead of an
4596 indirection to YYSTYPE.
4597 (b4_post_prologue): No longer included in the header file, but
4598 in the implementation file.
4599 * doc/bison.texi (C+ Language Interface): Update.
4600 * src/parse-gram.y: Support unary %define.
4601 * tests/actions.at: Define global_tokens_and_yystype for backward
4602 compatibility until we update the tests.
4603 * tests/calc.at: Idem.
4604 (first_line, first_column, last_line, last_column): Define for lalr1.cc
4605 to simplify the code.
4606
46072005-09-29 Paul Eggert <eggert@cs.ucla.edu>
4608
4609 Port to SunOS 4.1.4, which lacks strtoul and strerror.
4610 Ah, the good old days! Problem reported by Peter Klein.
4611 * bootstrap (gnulib_modules): Add strerror, strtoul.
4612 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
4613 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
4614
46152005-09-29 Akim Demaille <akim@epita.fr>
4616
4617 * data/c.m4 (b4_error_verbose_if): New.
4618 * data/lalr1.cc: Use it.
4619 (YYERROR_VERBOSE_IF): Remove.
4620 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
4621 parser members, replaced by...
4622 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
4623 local variables.
4624 (yysyntax_error_): Takes the state number as argument.
4625 (yyreduce_print_): Use the argument yyrule, not the former
4626 attribute yyn_.
4627
46282005-09-26 Paul Eggert <eggert@cs.ucla.edu>
4629
4630 * bootstrap (gnulib_modules): Add verify.
4631 * lib/.cvsignore: Add verify.h.
4632 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
4633 * src/system.h (verify): Remove.
4634 Include verify.h instead.
4635 * src/tables.c (tables_generate): Use new API for 'verify'.
4636
46372005-09-21 Paul Eggert <eggert@cs.ucla.edu>
4638
4639 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
4640 local variables whose names begin with 'yy'.
4641 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4642 Trivial changes from Joel E. Denny.
4643
4644 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
4645 it itself.
4646 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
4647 don't use alloca any more.
4648
4649 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
4650 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
4651 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
4652 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
4653 to match yacc.c, to test more hosts.
4654
46552005-09-20 Paul Eggert <eggert@cs.ucla.edu>
4656
4657 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
4658 doesn't affect behavior.
4659 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
4660 Solaris, AIX, MSC.
4661 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
4662 This works a bit better with glibc, if user code has already included
4663 stdlib.h.
4664 * doc/bison.texinfo (Bison Parser): Document that users can't
4665 arbitrarily use malloc and free for other purposes. Document
4666 that <alloca.h> and <malloc.h> might be included.
4667 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
4668 user must declare alloca.
4669
4670 * HACKING (release): Forwarn the Translation Project about
4671 stable releses.
4672
46732005-09-20 Akim Demaille <akim@epita.fr>
4674
4675 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
4676
46772005-09-19 Paul Eggert <eggert@cs.ucla.edu>
4678
4679 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
4680 (YYSTACK_ALLOC_MAXIMUM): Use it.
4681 (yysyntax_error): New function.
4682 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
4683 multiple syntax errors are reported, and alloca is being used.
4684 Instead, reallocate buffers twice as big each time, so that
4685 we waste at most half the allocated memory. Start with a small
4686 (128-byte) buffer that will suffice in most cases anyway.
4687 Use yysyntax_error to do most of the work.
4688
4689 * doc/bison.texinfo (Error Reporting, Table of Symbols):
4690 yynerrs is the number of errors reported, not the number of
4691 errors encountered.
4692
4693 * tests/glr-regression.at (Duplicated user destructor for lookahead):
4694 Mark it as expected to fail.
4695 Cast result of malloc; problem reported by twlevo@xs4all.nl.
4696 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
4697 Don't start user-code symbols with "yy", to avoid name space problems.
4698
46992005-09-19 Akim Demaille <akim@epita.fr>
4700
4701 Remove the traits, failed experiment.
4702 It never proved useful, and anyway because of the current
4703 definition, it was not possible to have several specialization of
4704 this traits, making it useless.
4705 * data/lalr1.cc (yy:traits): Remove.
4706 Inline its definitions in the parser class.
4707
47082005-09-19 Akim Demaille <akim@epita.fr>
4709
4710 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
4711 least Mac OSX with a /usr/local install of gettext.
4712
47132005-09-19 Akim Demaille <akim@epita.fr>
4714
4715 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
4716 and yytoken for similarity with the other skeletons.
4717
47182005-09-19 Akim Demaille <akim@epita.fr>
4719
4720 * NEWS, configure.ac: update version number to 2.1a.
4721
47222005-09-16 Paul Eggert <eggert@cs.ucla.edu>
4723
4724 * NEWS: Version 2.1.
4725
4726 * NEWS: Remove notice of yytname change, since it was never in an
4727 official release.
4728 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
4729 diagnostic.
4730 * src/output.c (prepare): Likewise.
4731 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
4732 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
4733 is not defined. This is an awful hack, but it's enough for now.
4734 All callers changed.
4735 * tests/glr-regression-at (make_value): Args are const pointers now,
4736 to avoid GCC warning.
4737 (Duplicated user destructor for lookahead): New test. Currently
4738 skipped. It fails on my host but I'm not sure it'll always fail.
4739
47402005-09-16 Akim Demaille <akim@epita.fr>
4741
4742 * src/symtab.h (struct symbol): Declare the printer and destructor
4743 as const, to avoid accidental calls to free.
4744 (symbol_destructor_set, symbol_printer_set): Adjust.
4745 * src/symtab.c: Adjust.
4746
47472005-09-16 Akim Demaille <akim@epita.fr>
4748
4749 * data/c.m4 (b4_token_enums): New.
4750 (b4_token_defines): Rename as...
4751 (b4_token_enums_defines): this.
4752 (b4_token_defines): New, output only the #defines.
4753 * data/yacc.c, data/glr.c: Adjust.
4754 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
4755 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
4756 as default values.
4757
47582005-09-16 Akim Demaille <akim@epita.fr>
4759
4760 * data/lalr1.cc (yylex_): Remove, inline its code.
4761 (yyreport_syntax_error_): Remove, replaced by...
4762 (yysyntax_error_): this which returns a string and leaves to the
4763 caller the call to the users' error function.
4764 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
4765 Move from members of the parser object...
4766 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
4767 to local variables of the parse function.
4768
47692005-09-16 Akim Demaille <akim@epita.fr>
4770
4771 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
4772 since it's in Bison's name space.
4773
47742005-09-15 Paul Eggert <eggert@cs.ucla.edu>
4775
4776 * data/glr.c (yyresolveValue): Add default case to pacify
4777 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
4778
4779 * NEWS: Document when yyparse started to return 2.
4780 * doc/bison.texinfo (Parser Function): Document when yyparse
4781 returns 2.
4782
4783 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
4784 (b4_filename_type): Renamed back from b4_file_name_type. All uses
4785 changed.
4786 (class position): file_name -> filename (reverting). All uses changed.
4787
47882005-09-14 Paul Eggert <eggert@cs.ucla.edu>
4789
4790 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
4791 do anything if $@ exists. This reverts part of the 2005-07-07
4792 patch.
4793
47942005-09-11 Paul Eggert <eggert@cs.ucla.edu>
4795
4796 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
4797 contains obsolete information and isn't worth distributing as a
4798 separate file anyway.
4799 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
4800 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
4801 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
4802 (yyparse): Abort if user code uses longjmp to throw an unexpected
4803 value.
4804
48052005-09-09 Paul Eggert <eggert@cs.ucla.edu>
4806
4807 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
4808 Suggested by twlevo@xs4all.nl.
4809
4810 * data/glr.c (YYCHK1): Do not assume YYE is in range.
4811 This avoids a diagnostic from gcc -Wswitch-enum.
4812 Problem reported by twlevo@xs4all.nl.
4813
4814 * doc/bison.texinfo: Don't use "filename", as per GNU coding
4815 standards. Use "file name" or "file" or "name", depending on
4816 the context.
4817 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
4818 not to hack/foo.tab.c.
4819 (Calc++ Top Level): 2nd arg of main is not const.
4820 * data/glr.c: b4_filename -> b4_file_name.
4821 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
4822 All uses changed.
4823 (class position): filename -> file_name. All uses changed.
4824 * data/yacc.c: b4_filename -> b4_file_name.
4825 * lib/bitset.h: filename -> file_name in local vars.
4826 * lib/bitset_stats.c: Likewise.
4827 * src/files.c: Likewise.
4828 * src/scan-skel.l ("@output ".*\n): Likewise.
4829 * src/files.c (file_name_split): Renamed from filename_split.
4830 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
4831
48322005-09-08 Paul Eggert <eggert@cs.ucla.edu>
4833
4834 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
4835 to accommodate latest gnulib.
4836
4837 * tests/glr-regression.at (Duplicate representation of merged trees):
4838 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
4839
4840 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
4841 needed.
4842
48432005-08-26 Paul Eggert <eggert@cs.ucla.edu>
4844
4845 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
4846 All uses changed. Invoke user destructor after an error during a
4847 split parse (trivial change from Joel E. Denny).
4848
4849 * tests/glr-regression.at
4850 (User destructor after an error during a split parse): New test case.
4851 Problem reported by Joel E. Denny in:
4852 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
4853
48542005-08-25 Paul Eggert <eggert@cs.ucla.edu>
4855
4856 * README-cvs: Give URLs for recommended tools.
4857 Mention Gzip version problem, and bootstrapping issues.
4858 Remove troubleshooting section, as it's somewhat obsolete.
4859
4860 * bootstrap (no_cache): New var, to accommodate different wget
4861 variants. Use it instead of '-C off'. Problem reported by
4862 twlevo@xs4all.nl.
4863
4864 * data/glr.c (yydestroyStackItem): New function.
4865 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
4866 debugging information. Problem reported by Joel E. Denny.
4867
48682005-08-25 Akim Demaille <akim@epita.fr>
4869
4870 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
4871
48722005-08-24 Paul Eggert <eggert@cs.ucla.edu>
4873
4874 * data/glr.c (yyrecoverSyntaxError, yyreturn):
4875 Don't invoke destructor on unresolved entries.
4876 * tests/glr-regression.at
4877 (User destructor for unresolved GLR semantic value): New test case.
4878 Problem reported by Joel E. Denny in:
4879 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
4880
48812005-08-21 Paul Eggert <eggert@cs.ucla.edu>
4882
4883 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
4884 Add strnlen.c.
4885 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
4886 lib-prefix.m4, po.m4.
4887
4888 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
4889 in yydestruct diagnostic, since it might not be an error.
4890 Problem reported by Joel Denny near end of
4891 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4892 * data/lalr1.cc (yyerturn): Likewise.
4893 * data/yacc.c (yyreturn): Likewise.
4894 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
4895
4896 * src/files.c: Remove obsolete FIXME comment.
4897
4898 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
4899 with the other templates, and to fix bogus run-on messages such
4900 as the one reported at the end of
4901 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4902 All callers changed to avoid the newline.
4903 (yyprocessOneStack): Output two lines rather than one, to accommodate
4904 the above change. This changes the debug output format slightly.
4905
4906 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
4907 reported by Joel E. Denny in
4908 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
4909 (trivial change).
4910 * tests/glr-regression.at (Duplicate representation of merged trees):
4911 New test, from Joel E. Denny in:
4912 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
4913 * THANKS: Add Joel E. Denny.
4914
4915 * configure.ac (AC_INIT): Bump to 2.0c.
4916
49172005-07-24 Paul Eggert <eggert@cs.ucla.edu>
4918
4919 * NEWS: Version 2.0b.
4920
4921 * Makefile.am (SUBDIRS): Put examples before tests, so that
4922 "make check" doesn't finish with "All 1 tests passed".
4923
4924 * tests/regression.at (Token definitions): Don't rely on
4925 AT_PARSER_CHECK for data that contains backslashes. It currently
4926 uses 'echo', and 'echo' isn't portable if its argument contains
4927 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
4928 that the byte '\0xff' is not printable in the C locale; it is,
4929 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
4930 not printable, so use '\0x81' to test.
4931
4932 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
4933 version of GCC, since the macro is used with non-GCC compilers.
4934
4935 Fix core dump reported by Pablo De Napoli in
4936 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
4937 * tests/regression.at (Invalid inputs with {}): New test.
4938 * src/parse-gram.y (token_name): Translate type before using
4939 it as an index.
4940
4941 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
4942 the user's name space. All uses changed to __attribute__
4943 ((__unused__)).
4944 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
4945 Add __attribute__ ((__noreturn__)).
4946
4947 * etc/clcommit: Remove. We weren't using it, and it failed
4948 "make maintainer-distcheck".
4949 * Makefile.maint: Merge from coreutils.
4950 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
4951 (syntax-check-rules): Change list of rules as described below.
4952 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
4953 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
4954 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
4955 (sc_trailing_space): New rules.
4956 (sc_xalloc_h_in_src): Remove.
4957 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
4958 (sc_space_tab, sc_error_exit_success, sc_changelog):
4959 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
4960 (makefile-check, po-check, author_mark_check):
4961 (makefile_path_separator_check, copyright-check):
4962 Use grep -n, to make it easier to find violations.
4963 Use CVS_LIST and CVS_LIST_EXCEPT.
4964 (header_regexp, h_re): Remove.
4965 (dd_c): New macro.
4966 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
4967 (my-distcheck): Use more-modern GCC flags.
4968 (signatures, %.asc): Remove.
4969 (rel-files, announcement): Remove signatures.
4970 Restore old updating code, even though we don't use it, so
4971 that we're the same as coreutils.
4972 (alpha, beta, major): Depend on news-date-check.
4973 Make the upload commands.
4974
4975 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
4976 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
4977 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
4978 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
4979 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
4980 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
4981 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
4982 * tests/sets.at: Likewise.
4983
4984 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
4985 we comment out the Autoconf version number.
4986 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
4987 it's error-prone and "make maintainer-distcheck" rejects it.
4988
4989 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
4990 Indent calls to "error" to pacify "make maintainer-distcheck",
4991 when the calls are not intended to be translated.
4992 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
4993
4994 * src/Makefile.am (DEFS): Use +=, to pacify
4995 "make maintainer-distcheck".
4996 (bison_SOURCES): Add scan-skel.h.
4997 (sc_tight_scope): New rule, from coreutils.
4998
4999 * src/files.c (src_extension, header_extension):
5000 Now static, not extern.
5001 * src/getargs.c (short_options): Likewise.
5002 * src/muscle_tab.c (muscle_table): Likewise.
5003 * src/parse-gram.y (current_class, current_type, current_prec):
5004 Likewise.
5005 * src/reader.c (grammar_end, previous_rule_end): Likewise.
5006 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
5007 * src/main.c (main): Cast bindtextdomain and textdomain calls to
5008 void, to avoid warning when NLS is disabled.
5009 * src/output.c: Include scan-skel.h.
5010 (scan_skel): Remove decl, since scan-skel.h does this.
5011 (output_skeleton):
5012 Indent calls to "error" to pacify "make maintainer-distcheck".
5013 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
5014 * src/reader.h (gram_end, gram_lineno): New decls to pacify
5015 "make maintainer-distcheck".
5016 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
5017 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
5018 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
5019 (skel_lex_destroy, scan_skel): Move these decls to...
5020 * src/scan-skel.h: New file.
5021 * src/uniqstr.c (uniqstr_assert):
5022 Indent calls to "error" to pacify "make maintainer-distcheck".
5023
5024 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
5025 not @VAR@.
5026
5027 * tests/torture.at: Revamp to avoid misuse of atoi that
5028 "make maintainer-distcheck" complained about.
5029
5030 * examples/extexi (message): Don't print a message more than once,
5031 and omit line-number decoration that makes Emacs compile think
5032 that informative messages are worth worrying about.
5033
50342005-07-22 Paul Eggert <eggert@cs.ucla.edu>
5035
5036 * configure.ac: Update version number.
5037
5038 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
5039 accidentally.
5040 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
5041 autogenerated by the maintainer.
5042 * examples/calc++/.cvsignore: Add *.yy.
5043
5044 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
5045 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5046 * lib/bitsetv.c (bitsetv_alloc): Likewise.
5047
5048 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
5049
5050 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
5051 from maintainer-distcheck about casting the argument of 'free'.
5052
5053 * NEWS: Mention recent yytname changes.
5054 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
5055
5056 * bootstrap: For translations that have not yet been upgraded to
5057 the new runtime-po domain, prime the pump by extracting the
5058 relevant strings from the obsolete translations. This code can be
5059 removed once the bison-runtime domain has been translated by each
5060 team.
5061
5062 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
5063 now that token names are already quoted.
5064
5065 Fix problem reported by Anthony Heading.
5066 * data/glr.c (YYTOKEN_TABLE): New macro.
5067 (yytname): Define if YYTOKEN_TABLE.
5068 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
5069 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
5070 (YYERROR_VERBOSE): Define the same way the other skeletons do.
5071 * src/output.c (prepare_symbols): Output token_table_flag.
5072
50732005-07-21 Paul Eggert <eggert@cs.ucla.edu>
5074
5075 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
5076 again if the first call fails.
5077
5078 * data/glr.c (yytnamerr): New function.
5079 (yyreportSyntaxError): Use it to dequote most string literals.
5080 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
5081 with other skeletons. All uses changed.
5082 (yytnameerr_): New function.
5083 (yyreport_syntax_error): Use it to dequote most string literals.
5084 * data/yacc.c (yytnamerr): New function.
5085 (yyerrlab): Use it to decode most string literals.
5086 * doc/bison.texinfo (Decl Summary, Calling Convention):
5087 Clarify quoting convention of yytname.
5088 * src/output.c (prepare_symbols): Quote all names. This undoes
5089 the 2005-04-17 change, which is now accomplished (mostly) via
5090 changes in the parsers as described above.
5091 * tests/regression.at (Token definitions, Web2c Actions):
5092 Undo most 2005-04-17 change here, too.
5093
50942005-07-20 Paul Eggert <eggert@cs.ucla.edu>
5095
5096 Fix more problems reported by twlevo@xs4all.nl.
5097 * tests/cxx-type.at: Don't pipe output of ./types through sed to
5098 remove trailing spaces. This loses the exit status of ./types,
5099 and isn't needed since ./types shouldn't be emitting trailing
5100 spaces.
5101 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
5102 as the stack isn't valid in that case.
5103
5104 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5105 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5106 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5107 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
5108 is used.
5109 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
5110 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5111 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5112 Likewise.
5113
5114 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
5115 overly-picky compilers that reject 'char *foo = "bar";'.
5116
5117 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
5118 to FILE * parameter, not to stderr. This fixes a typo introduced
5119 in the 2005-07-12 change.
5120
5121 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
5122 warnings from GCC 4.
5123
5124 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
5125 (yyglrShiftDefer, yysplitStack):
5126 Remove unused parameters b4_pure_formals. All uses changed.
5127 (yyglrShift): Remove unused parameters b4_user_formals.
5128 All uses changed.
5129 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
5130
51312005-07-18 Paul Eggert <eggert@cs.ucla.edu>
5132
5133 Destructor cleanups and regularization among the three skeletons.
5134 * NEWS: Document the behavior changes.
5135 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
5136 stack before failing, as the cleanup code will do it for us now.
5137 * data/lalr1.cc (yyerrlab): Likewise.
5138 * data/glr.c (yyparse): Pop everything off the stack before
5139 freeing it, so that destructors get called properly.
5140 * data/lalr1.cc (yyreturn): Likewise.
5141 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
5142 This is more consistent.
5143 * doc/bison.texinfo (Destructor Decl): Mention more reasons
5144 why destructors might be called. 1.875 -> 2.1.
5145 (Destructor Decl, Decl Summary, Table of Symbols):
5146 Some English-language cleanups for %destructor.
5147 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5148 Add output line for destructor of start symbol.
5149 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
5150 because of that same extra output line.
5151
5152 * NEWS: Document minor wording changes in diagnostics of
5153 Bison-generated parsers.
5154 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
5155 Remove unused formals. All uses changed.
5156 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
5157 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
5158 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
5159 Rename yyoverflowab to yyexhaustedlab.
5160 When memory exhaustion occurs during syntax-error reporting,
5161 report it separately rather than in a single diagnostic; this
5162 eases translation.
5163 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
5164 (Memory Exhausted): Renamed from Parser Stack Overflow.
5165 Revamp wording slightly to prefer "memory exhaustion".
5166 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
5167
5168 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
5169
5170 Add i18n support to the GLR skeleton. Partially fix the C++
5171 skeleton; a C++ expert needs to finish this. Remove debugging
5172 msgids; there's little point to having them translated, since they
5173 can be understood only by someone who can read the
5174 (English-language) source code.
5175
5176 Generate runtime-po/bison-runtime.pot automatically, so that we
5177 don't have to worry about garbage getting in that file. We'll
5178 make sure after the next official release that old msgids don't
5179 get lost. See
5180 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
5181
5182 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
5183 Now auto-generated.
5184 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
5185 Fix typos in explanations of the runtime file.
5186 * bootstrap: Change gettext keyword from YYI18N to YY_.
5187 Use standard Makefile.in.in in runtime-po, since we'll arrange
5188 for backward-compatible bison-runtime.po files in a different way.
5189 * data/glr.c (YY_): New macro, from yacc.c.
5190 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
5191 Translate messages intended for users.
5192 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
5193 the wording in the other skeletons. We don't know that the memory
5194 is virtual.
5195 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
5196 Use same method that yacc.c uses.
5197 Don't translate debugging messages.
5198 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
5199 it doesn't work (yet), and requires C++ expertise to fix.
5200 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
5201 Move defn to a more logical place, to be consistent with other
5202 skeletons.
5203 Don't translate debugging messages.
5204 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
5205 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
5206 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
5207 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
5208
5209 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
5210 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
5211 void, not int.
5212 * tests/glr-regression.at (Badly Collapsed GLR States):
5213 Likewise.
5214 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5215 yylex should return 0 at EOF rather than aborting.
5216
5217 Improve tests for stack overflow in GLR parser.
5218 Problem reported by twlevo@xs4all.nl.
5219 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
5220 All uses removed.
5221 (yyStackOverflow): Just longjmp, but with value 2 so that caller
5222 can handle the problem.
5223 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
5224 (yyparse): New local variable yyresult to record the result.
5225 Use result of setjmp to set it, rather than storing itinto
5226 struct.
5227 (yyDone): Remove label.
5228 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
5229 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
5230 if YYABORT is used).
5231 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
5232 yyparse status; put status > 1 into diagnostic.
5233 Check that status==2 works.
5234 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
5235 Use exit status 3 for failure to open (which shouldn't happen).
5236
52372005-07-17 Paul Eggert <eggert@cs.ucla.edu>
5238
5239 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
5240 1 on syntax error; just let yyparse do its thing.
5241 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
5242 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
5243 (Exploding the Stack Size with Alloca):
5244 (Exploding the Stack Size with Malloc):
5245 Expect exit status 2, not 1, since the parser is supposed to blow
5246 its stack. Problem reported by twlevo@xs4all.nl.
5247
5248 * data/glr.c (yyparse): Don't assume that the initial calls
5249 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
5250 Print a stack-overflow message and fail instead.
5251 Initialize the line-number information before creating the stack,
5252 so that the stack-overflow message can report line zero safely.
5253
52542005-07-14 Paul Eggert <eggert@cs.ucla.edu>
5255
5256 Fix problems reported by twlevo@xs4all.nl.
5257 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
5258 (yyuserMerge): Provide a default case if b4_mergers is empty.
5259 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
5260 * tests/glr-regression.at
5261 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5262 Add casts to pacify C++ compilers.
5263 * tests/glr-regression.at (Improper merging of GLR delayed action
5264 sets): Declare yylex before using it.
5265 * tests/Makefile.am (maintainer-check-g++): Fix a stray
5266 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
5267 test for valgrind; valgrind is independent of g++.
5268 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
5269 for compatibility with POSIX 1003.1-2001 (if running coreutils).
5270 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
5271 Use a destructor, so that we can expand the stack. Change
5272 YYSTYPE to char * so that we can free it. Cast result of malloc.
5273
52742005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5275
5276 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
5277 a valgrind failure. Problem reported by twlevo@xs4all.nl.
5278
52792005-07-13 Paul Eggert <eggert@cs.ucla.edu>
5280
5281 * PACKAGING: New file, suggested by Bruno Haible and taken from
5282 similar wording in gettext's PACKAGING file.
5283 * NEWS: Mention PACKAGING.
5284 * Makefile.am (EXTRA_DIST): Add PACKAGING.
5285
52862005-07-12 Paul Eggert <eggert@cs.ucla.edu>
5287
5288 * NEWS: Document recent i18n improvements.
5289 * bootstrap: Get runtime translations into runtime-po.
5290 Create runtime-po files automatically, if possible.
5291 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
5292 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
5293 does not infringe on the user's name space.
5294 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
5295 * doc/bison.texinfo (Internationalization): Revamp the English
5296 and Texinfo syntax a bit, to try to make it clearer.
5297 (Bison Options, Option Cross Key): Mention --print-localedir.
5298 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
5299 YYENABLE_NLS. Quote a bit more.
5300 * runtime-po/.cvsignore: New file.
5301 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
5302 * runtime-po/Rules-quot: Remove; now created by bootstrap.
5303 * runtime-po/quot.sed: Likewise.
5304 * runtime-po/boldquot.sed: Likewise.
5305 * runtime-po/en@quot.header: Likewise.
5306 * runtime-po/en@boldquot.header: Likewise.
5307 * runtime-po/insert-header.sin: Likewise.
5308 * runtime-po/remove-potcdate.sin: Likewise.
5309 * runtime-po/Makevars: Likewise.
5310 * runtime-po/LINGUAS: Likewise.
5311 * runtime-po/de.po: Likewise; we will rely on the translation project
5312 to maintain this, so "bootstrap" should get it.
5313 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
5314 its value.
5315 * src/main.c (main): Bind the bison-runtime domain, too.
5316
53172005-07-12 Bruno Haible <bruno@clisp.org>
5318
5319 * data/yacc.c: Include <libintl.h> when NLS is enabled.
5320 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
5321 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
5322 * runtime-po: New directory.
5323 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
5324 $(DOMAIN).pot-update rule, so that old messages are never dropped.
5325 * runtime-po/Rules-quot: New file, copied from po/.
5326 * runtime-po/quot.sed: Likewise.
5327 * runtime-po/boldquot.sed: Likewise.
5328 * runtime-po/en@quot.header: Likewise.
5329 * runtime-po/en@boldquot.header: Likewise.
5330 * runtime-po/insert-header.sin: Likewise.
5331 * runtime-po/remove-potcdate.sin: Likewise.
5332 * runtime-po/Makevars: New file.
5333 * runtime-po/POTFILES.in: New file.
5334 * runtime-po/LINGUAS: New file.
5335 * runtime-po/bison-runtime.pot: New file.
5336 * runtime-po/de.po: New file.
5337 * m4/bison.m4: New file.
5338 * Makefile.am (SUBDIRS): Add runtime-po.
5339 (aclocaldir, aclocal_DATA): New variables.
5340 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
5341 Define aclocaldir.
5342 * src/getargs.c (usage): Document --print-localedir option.
5343 (PRINT_LOCALEDIR_OPTION): New enum item.
5344 (long_options): Add --print-localedir option.
5345 (getargs): Handle --print-localedir option.
5346 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
5347 (Internationalization): New section.
5348
53492005-07-12 Akim Demaille <akim@epita.fr>
5350
5351 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
5352 for consistency with the rest of the code.
5353 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
5354 Add separators.
5355
53562005-07-12 Akim Demaille <akim@epita.fr>
5357
5358 * src/parse-gram.y: Use %printer instead of YYPRINT.
5359
53602005-07-12 Akim Demaille <akim@epita.fr>
5361
5362 * src/symtab.h, src/symtab.c (symbol_print): New.
5363 * src/symlist.h, src/symlist.c (symbol_list_print): New.
5364 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
5365
53662005-07-12 Akim Demaille <akim@epita.fr>
5367
5368 * data/glr.c (b4_syncline): Fix (swap) the definitions of
5369 b4_at_dollar and b4_dollar_dollar.
5370
53712005-07-11 Paul Eggert <eggert@cs.ucla.edu>
5372
5373 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
5374 and Pennello's paper.
5375
53762005-07-09 Paul Eggert <eggert@cs.ucla.edu>
5377
5378 * data/yacc.c (yyparse): Undo previous patch. Instead,
5379 set yylsp[0] and yyvsp[0] only if the initial action
5380 sets yylloc and yylval, respectively.
5381
5382 * data/yacc.c (yyparse): In the initial action, set
5383 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
5384 This avoids the use of undefined variables if the initial
5385 action does not set yylloc and/or yylval.
5386
53872005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5388
5389 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
5390 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
5391 Remove from CVS. These files are automatically generated.
5392 * examples/extexi: Clarify that this file is now part of Bison,
5393 not GNU M4, and that it works with any POSIX-compatible Awk.
5394 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
5395 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
5396 so that we also get calc++-parser.yy. Geneate it.
5397 Use $(AWK), not gawk, since any conforming Awk will do.
5398 Put comment before action, since older 'make' can't handle comment
5399 in action.
5400 $(BUILT_SOURCES): List all built sources, not just some of them.
5401 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
5402 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
5403 $($(calc_sources_generated)): Remove unnecessary test for existence
5404 of target. (This had a shell syntax error anyway; a stray "x".)
5405 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
5406 calc++-parser.yy.
5407 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
5408
5409 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
5410 implied by the other modules.
5411
54122005-07-06 Akim Demaille <akim@epita.fr>
5413
5414 Bind examples/calc++ to the package.
5415 * examples/calc++/Makefile: Remove, replaced by...
5416 * examples/calc++/Makefile.am: ... this new file.
5417 * examples/calc++/test: Remove input.
5418 * examples/calc++/compile: Remove.
5419 * examples/Makefile.am: New.
5420 * configure.ac, Makefile.am: Adjust.
5421 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
5422
54232005-07-05 Paul Eggert <eggert@cs.ucla.edu>
5424
5425 * data/glr.c (yyFail): Drastically simplify; since the format argument
5426 never had any % directives, we can simply pass it to yyerror.
5427 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
5428 be modified later, as that is the usual style in glr.c.
5429 Problems reported by Paul Hilfinger.
5430
5431 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
5432 and size overflow errors.
5433 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
5434 in case the user prolog sets feature-test macros like _GNU_SOURCE.
5435 (YYSIZEMAX): New macro.
5436 (yystpcpy): New function, taken from yacc.c.
5437 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
5438 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
5439 so that we don't have to maintain their signatures.
5440 (yyFail): Check for buffer overflow, by using vsnprintf rather
5441 than vsprintf. Allocate a bigger buffer if possible.
5442 Report an error if buffer allocation fails.
5443 (yyStackOverflow): New function.
5444 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
5445 the initialization was successful. It might fail if storage was
5446 exhausted.
5447 (yyexpandGLRStack): Add more checks for storage allocation failure.
5448 Use yyStackOverflow to report failures.
5449 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
5450 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
5451 Don't assume stack number fits in int.
5452 (yysplitStack): Check for storage allocation failure.
5453 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
5454 can print diagnostics on storage allocation failure. All callers
5455 changed.
5456 (yyresolveValue): Use yybool for boolean.
5457 (yyreportSyntaxError): Check for size-calculation overflow.
5458 This code is taken from yacc.c.
5459 (yyparse): Check for storage allocation errors when allocating
5460 the initial stack.
5461
54622005-07-05 Akim Demaille <akim@epita.fr>
5463
5464 Extract calc++ from the documentation.
5465 * doc/bison.texinfo (Calc++): Add the extraction marks.
5466 * examples/extexi: New, from the aborted GNU Programming 2E.
5467 Separate the different paragraph of a file with empty lines.
5468 * examples/Makefile: Use it to extract the whole calc++ example.
5469
54702005-06-24 Akim Demaille <akim@epita.fr>
5471
5472 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
5473 class typedefs.
5474
54752005-06-22 Akim Demaille <akim@epita.fr>
5476
5477 * doc/bison.texinfo (C++ Language Interface): First stab.
5478 (C++ Parsers): Remove.
5479
54802005-06-22 Akim Demaille <akim@epita.fr>
5481
5482 * data/lalr1.cc (yylex_): Honor %lex-param.
5483
54842005-06-22 Akim Demaille <akim@epita.fr>
5485
5486 Start a set of simple examples.
5487 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
5488 * examples/calc++/calc++-driver.hh,
5489 * examples/calc++/calc++-parser.yy,
5490 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
5491 * examples/calc++/compile, examples/calc++/test: New.
5492
54932005-06-09 Paul Eggert <eggert@cs.ucla.edu>
5494
5495 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
5496 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
5497 which stems from the 2005-05-27 patch.
5498
54992005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5500
5501 * data/glr.c: Modify treatment of unused parameters to permit use
5502 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
5503
55042005-05-30 Paul Eggert <eggert@cs.ucla.edu>
5505
5506 Fix infringement on user name space reported by Janos Zoltan Szabo.
5507 * data/yacc.c (yyparse): strlen -> yystrlen.
5508
55092005-05-30 Akim Demaille <akim@epita.fr>
5510
5511 * data/lalr1.cc (_): New.
5512 Translate the various messages.
5513
55142005-05-27 Paul Eggert <eggert@cs.ucla.edu>
5515
5516 Fix infringement on user name space reported by Bruno Haible.
5517 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
5518 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
5519 the user's name space.
5520 (alloca): Include <stdlib.h> to get it, if it's not built in.
5521 (YYMALLOC, YYFREE): Define only if needed.
5522 (malloc, free): Declare, but only if needed, as this infringes on
5523 the user name space.
5524
55252005-05-25 Paul Eggert <eggert@cs.ucla.edu>
5526
5527 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
5528 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
5529 with %d format.
5530 * lib/ebitset.c (min, max): Undef before defining.
5531 * lib/vbitset.c (min, max): Likewise.
5532 * lib/subpipe.c (create_subpipe): Save local variables in case
5533 vfork clobbers them.
5534
55352005-05-24 Bruno Haible <bruno@clisp.org>
5536
5537 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
5538 error message syntax used by gcc-4.0.
5539
55402005-05-23 Paul Eggert <eggert@cs.ucla.edu>
5541
5542 * README: Mention m4 1.4.3. Remove obsolete advice about
5543 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
5544
5545 * bootstrap: Remove workaround for problem I encountered with
5546 gettext 0.14.1; it seems to be fixed now.
5547
55482005-05-22 Paul Eggert <eggert@cs.ucla.edu>
5549
5550 * NEWS: Version 2.0a.
5551
5552 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
5553 the previous change.
5554
5555 Various maintainer cleanups.
5556 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
5557 conftest*, for benefit of CVS commands run at the same time as
5558 "configure". Add build-aux, since "bootstrap" now creates it and
5559 its subfiles.
5560 * Makefile.cfg (move_if_change): Remove.
5561 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
5562 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
5563 (po_repo, do-po-update, po-update, wget_files, get-targets):
5564 (config.guess-url_prefix, config.sub-url_prefix):
5565 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
5566 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
5567 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
5568 Remove.
5569 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
5570 this is now the recommended name.
5571 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
5572 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
5573 ylwrap. These files now go into build-aux.
5574 * config/move-if-change: Remove.
5575 * config/prev-version.txt: Bump from 1.75 to 2.0.
5576
5577 * bootstrap: Add stdio-safer, unistd-safer modules.
5578 Remove m4/glibc2.m4 (introduced by latest gnulib, but
5579 we don't need it).
5580 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
5581 fopen-safer.c, stdio-safer.h, unistd-safer.h.
5582 * lib/subpipe.c: Include "unistd-safer.h".
5583 (create_subpipe): Make sure all the newly-created
5584 file descriptors are > 2, so that diagnostics don't
5585 get sent down them (which might cause Bison to hang, in theory).
5586 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
5587 * src/files.c (xfopen): Use fopen_safer, not fopen.
5588
5589 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
5590 yesterday's yacc.c fix.
5591
55922005-05-21 Paul Eggert <eggert@cs.ucla.edu>
5593
5594 * data/glr.c, data/lalr1.cc: Update copyright date.
5595
5596 Fix a destructor bug reported by Wolfgang Spraul in
5597 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
5598 * data/yacc.c (yyabortlab): Don't call destructor, and
5599 don't set yychar to EMPTY.
5600 (yyoverflowlab): Don't call destructor.
5601 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
5602 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
5603 since we no longer output the message "discarding lookahead token
5604 end of input ()".
5605
56062005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5607
5608 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
5609 fix a small glitch in debugging output.
5610 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
5611 after YY_SYMBOL_PRINT where needed.
5612
5613 (struct yyGLRState): Add some comments.
5614 (struct yySemanticOption): Add some comments.
5615 (union yyGLRStackItem): Add comment.
5616
5617 (yymergeOptionSets): Correct this to properly perform the union,
5618 avoiding infinite reported by Michael Rosien.
5619 Update comment.
5620
5621 * tests/glr-regression.at: Add test for GLR merging error reported
5622 by M. Rosien.
5623
56242005-05-13 Paul Eggert <eggert@cs.ucla.edu>
5625
5626 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
5627 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
5628 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
5629 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
5630 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
5631 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
5632 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
5633 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
5634 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
5635 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
5636 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
5637 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
5638 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
5639 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
5640 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
5641 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
5642 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
5643 src/derives.h, src/files.c, src/files.h, src/getargs.c,
5644 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
5645 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
5646 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
5647 src/output.h, src/parse-gram.c, src/parse-gram.h,
5648 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
5649 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
5650 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
5651 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
5652 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
5653 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
5654 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
5655 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
5656 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
5657 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
5658 tests/reduce.at, tests/regression.at, tests/sets.at,
5659 tests/synclines.at, tests/testsuite.at, tests/torture.at:
5660 Update FSF postal mail address.
5661
56622005-05-11 Paul Eggert <eggert@cs.ucla.edu>
5663
5664 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
5665 Problem reported by Ralf Menzel.
5666
56672005-05-01 Paul Eggert <eggert@cs.ucla.edu>
5668
5669 * tests/actions.at: Test that stack overflow invokes destructors.
5670 From Marcus Holland-Moritz.
5671 * data/yacc.c (yyerrlab): Move the code that destroys the stack
5672 from here....
5673 (yyreturn): to here. That way, destructors are called properly
5674 even if the stack overflows, or the user calls YYACCEPT or
5675 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
5676 (yyoverflowlab): Destroy the lookahead.
5677
56782005-04-24 Paul Eggert <eggert@cs.ucla.edu>
5679
5680 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
5681
56822005-04-17 Paul Eggert <eggert@cs.ucla.edu>
5683
5684 * NEWS: Bison-generated C parsers no longer quote literal strings
5685 associated with tokens.
5686 * src/output.c (prepare_symbols): Don't escape strings,
5687 since users don't want to see C escapes.
5688 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
5689 in diagnostics.
5690 * tests/input.at (Torturing the Scanner): Likewise.
5691 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
5692
56932005-04-16 Paul Eggert <eggert@cs.ucla.edu>
5694
5695 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
5696 the data size is known to be too small and we can't increase it.
5697 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
5698
56992005-04-15 Paul Eggert <eggert@cs.ucla.edu>
5700
5701 * src/parse-gram.y: Include quotearg.h.
5702 (string_as_id): Quote $1 before using it as a key, since the
5703 lexer no longer quotes it for us.
5704 (string_content): Don't strip quotes, since lexer no longer
5705 quotes it for us.
5706 * src/scan-gram.l: Include quotearg.h.
5707 ("\""): Omit quote.
5708 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
5709 a key, since the rest of the lexer doesn't quote it.
5710 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
5711 * tests/regression.at (Token definitions): Check for backslashes
5712 in token strings.
5713
5714 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
5715 (YYSIZE_T): Define to unsigned long int when using an older compiler.
5716 (yyparse): Revamp code to generate long syntax error message, to
5717 make it easier to translate, and to avoid problems with arithmetic
5718 overflow. Change "virtual memory" to "memory" in diagnostic, since
5719 we don't know whether the memory is virtual.
5720
57212005-04-13 Paul Eggert <eggert@cs.ucla.edu>
5722
5723 * NEWS: Bison-generated C parsers now use the _ macro to
5724 translate strings.
5725 * data/yacc.c (_) [!defined _]: New macro.
5726 All English strings wrapped inside this macro.
5727 * doc/bison.texinfo (Bison Parser): Document _.
5728 * po/POTFILES.in: Include src/parse-gram.c, since it now
5729 includes translateable strings that parse-gram.y doesn't.
5730
57312005-04-12 Paul Eggert <eggert@cs.ucla.edu>
5732
5733 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
5734 reverting the 2004-10-11 change to this function.
5735 (symbol_check_alias_consistency): Don't call symbol_type_set
5736 if the type name is already correct.
5737 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
5738
57392005-03-25 Paul Eggert <eggert@cs.ucla.edu>
5740
5741 * tests/regression.at (Token definitions): Don't use a token named
5742 c, as that generates a "#define c ..." that runs afoul of buggy
5743 stdlib.h that uses the identifier c as a member of struct
5744 drand48_data. Problem reported by Horst Wente.
5745
57462005-03-21 Paul Eggert <eggert@cs.ucla.edu>
5747
5748 * bootstrap: Change translation URL from
5749 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
5750 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
5751 redirection glitches. Problem reported by twlevo@xs4all.nl.
5752
57532005-03-20 Paul Eggert <eggert@cs.ucla.edu>
5754
5755 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
5756 after operands; POSIX says this isn't portable for the c99 command.
5757
57582005-03-18 Paul Eggert <eggert@cs.ucla.edu>
5759
5760 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
5761 immediately if a data overrun has occurred; this may help us track
5762 down what may be a spurious failure on MacOS.
5763
57642005-03-17 Paul Eggert <eggert@cs.ucla.edu>
5765
5766 Respond to problems reported by twlevo@xs4all.nl.
5767
5768 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
5769
5770 * src/vcg.h: Comment fix.
5771 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
5772 (G_CMAX): Change to -1 instead of INT_MAX.
5773
5774 * data/yacc.c (yyparse): Omit spaces before #line.
5775
57762005-03-15 Paul Eggert <eggert@cs.ucla.edu>
5777
5778 * src/tables.c (state_number_to_vector_number): Put it inside an
5779 "#if 0", since it's not currently used. Problem reported by
5780 Roland McGrath.
5781
57822005-03-06 Paul Eggert <eggert@cs.ucla.edu>
5783
5784 * src/output.c (escaped_output): Renamed from
5785 escaped_file_name_output, since we now use it for symbol tags as
5786 well. All uses changed.
5787 (symbol_destructors_output, symbol_printers_output):
5788 Escape symbol tags too.
5789 Problem reported by Matyas Forstner in
5790 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
5791
5792 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
5793 not needed.
5794 * src/output.c (user_actions_output, token_definitions_output,
5795 symbol_destructors_output, symbol_printers_output): Likewise.
5796 * src/reader.c (prologue_augment): Likewise.
5797 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
5798
5799 * src/vcg.c (output_edge): Don't quote linestyle arg.
5800 Problem reported by twlevo@xs4all.nl.
5801
58022005-02-28 Paul Eggert <eggert@cs.ucla.edu>
5803
5804 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
5805 example, reported by Derek M Jones. Also, make the example even
5806 more outrageous, to better illustrate how bad the problem is.
5807
58082005-02-24 Paul Eggert <eggert@cs.ucla.edu>
5809
5810 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
5811 putsym. Typo reported by Sebastian Piping.
5812
58132005-02-23 Paul Eggert <eggert@cs.ucla.edu>
5814
5815 * doc/bison.texinfo (Language and Grammar): some -> same
5816 (Epilogue): int he -> in the
5817 Typos reported by Sebastian Piping via Justin Pence.
5818
58192005-02-07 Paul Eggert <eggert@cs.ucla.edu>
5820
5821 * tests/glr-regression.at (Improper handling of embedded actions
5822 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
5823 embedded actions and $-N in GLR parsers", work around an Autoconf bug
5824 with dollar signs in test names.
5825 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
5826 for a similar reason.
5827
58282005-01-28 Paul Eggert <eggert@cs.ucla.edu>
5829
5830 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
5831 wants to redefine G_VIEW.
5832
58332005-01-27 Paul Eggert <eggert@cs.ucla.edu>
5834
5835 * src/vcg.c (get_view_str): Remove case for normal_view.
5836 Problem reported by twlevo@xs4all.nl.
5837
58382005-01-24 Paul Eggert <eggert@cs.ucla.edu>
5839
5840 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
5841 Problem reported by twlevo@xs4all.nl.
5842
5843 * doc/bison.texinfo: Change @dircategory from "GNU programming
5844 tools" to "Software development". Requested by Richard Stallman
5845 via Karl Berry.
5846
58472005-01-23 Paul Eggert <eggert@cs.ucla.edu>
5848
5849 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
5850 Problem reported by twlevo@xs4all.nl.
5851
58522005-01-21 Paul Eggert <eggert@cs.ucla.edu>
5853
5854 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
5855 keyword; it's not needed with modern compilers, and it doesn't
5856 affect correctness with older compilers. Suggested by
5857 twlevo@xs4all.nl.
5858
58592005-01-17 Paul Eggert <eggert@cs.ucla.edu>
5860
5861 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
5862 gcc -Wswitch-default.
5863 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
5864 * data/yacc.c (yyparse): Likewise.
5865
58662005-01-12 Paul Eggert <eggert@cs.ucla.edu>
5867
5868 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
5869 already. Let config.h define any nonstandard values.
5870
58712005-01-10 Paul Eggert <eggert@cs.ucla.edu>
5872
5873 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
5874 for the benefit of slower hosts. Problem reported by
5875 Nelson H. F. Beebe.
5876
58772005-01-07 Paul Eggert <eggert@cs.ucla.edu>
5878
5879 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
5880 being defined and not used.
5881 * data/lalr1.cc (yyparse): Likewise.
5882 Use "if (false)" rather than "if (0)".
5883
58842005-01-05 Paul Eggert <eggert@cs.ucla.edu>
5885
5886 * TODO: Mention that we should allow NUL bytes in tokens.
5887
58882005-01-02 Paul Eggert <eggert@cs.ucla.edu>
5889
5890 * src/scan-skel.l (<<EOF>>): Don't close standard output.
5891 Problem reported by Hans Aberg.
5892
58932005-01-01 Paul Eggert <eggert@cs.ucla.edu>
5894
5895 * src/getargs.c (version): Happy new year; update overall
5896 program copyright date from 2004 to 2005.
5897
5898 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
5899 Problem reported by Hans Aberg.
5900 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
5901 (Output file names.): Add a test for the case when standard output
5902 is closed.
5903
59042004-12-26 Paul Eggert <eggert@cs.ucla.edu>
5905
5906 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
5907 to fix an oversight in the Bison 2.0 manual.
5908
59092004-12-25 Paul Eggert <eggert@cs.ucla.edu>
5910
5911 * NEWS: Version 2.0. Reformat the existing news items since
5912 1.875, so that related items are grouped together.
5913 * configure.ac (AC_INIT): Bump version to 2.0.
5914 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
5915
5916 * tests/torture.at (Exploding the Stack Size with Alloca): Set
5917 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
5918 otherwise, we're not testing alloca. Unfortunately there's no
5919 simple way to consult HAVE_ALLOCA here.
5920
5921 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
5922 for yymsg, too.
5923
5924 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
5925 hand. This avoids a warning about comparing int to size_t when
5926 GCC warnings are enabled.
5927
59282004-12-22 Paul Eggert <eggert@cs.ucla.edu>
5929
5930 * NEWS: Bison-generated parsers no longer default to using the
5931 alloca function (when available) to extend the parser stack, due
5932 to widespread problems in unchecked stack-overflow detection.
5933 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
5934 responsibility to set it to a positive value. This lets the user
5935 specify a value that is not a preprocessor constant.
5936 * data/yacc.c (YYMAXDEPTH): Likewise.
5937 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
5938 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
5939 to be a compile-time constant. However, explain the constraints on it.
5940 Also, explain the constraints on YYINITDEPTH.
5941 (Table of Symbols): Explain that alloca is no longer the default.
5942 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
5943 to 1.
5944
5945 * doc/bison.texinfo (Location Default Action): Mention that n must
5946 be zero when k is zero. Suggested by Frank Heckenbach.
5947
59482004-12-22 Akim Demaille <akim@epita.fr>
5949
5950 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
5951 (parser::state_type, parser::semantic_type, parser::location_type):
5952 Private, not public.
5953 (parser::parse): Return ints, not bool.
5954 Returning a bool introduces a problem: 0 corresponds to false, and
5955 it seems weird to return false on success. Returning true changes
5956 the conventions for yyparse.
5957 Alternatively we could return void and send an exception.
5958 There is no clear consensus (yet?).
5959 (state_stack, semantic_stack, location_stack): Rename as...
5960 (state_stack_type, semantic_stack_type, location_stack_type): these.
5961 Private, not public.
5962 * tests/c++.at: New.
5963 * tests/testsuite.at, tests/Makefile.am: Adjust.
5964
59652004-12-21 Akim Demaille <akim@epita.fr>
5966
5967 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
5968
59692004-12-21 Akim Demaille <akim@epita.fr>
5970
5971 Don't impose std::string for filenames.
5972
5973 * data/lalr1.cc (b4_filename_type): New.
5974 (position::filename): Use it.
5975 (parser.hh): Move the inclusion of stack.hh and location.hh below
5976 the user code, so that needed headers for the filename type can be
5977 included first.
5978 Forward declare them before the user code.
5979 * tests/Makefile.am (check-local, installcheck-local): Pass
5980 TESTSUITEFLAGS to the TESTSUITE.
5981
59822004-12-20 Akim Demaille <akim@epita.fr>
5983
5984 Use more STL like names: my_class instead of MyClass.
5985
5986 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
5987 (SemanticStack, SemanticType, StateStack, StateType)
5988 (TokenNumberType, Stack, Slice, Traits, Parser::location)
5989 (Parser::value): Rename as...
5990 (location_stack, location_type, rhs_number_type, semantic_stack)
5991 (semantic_type, state_stack, state_type, token_number_type, stack)
5992 (slice, traits, parser::yylloc, parser::yylval): these.
5993
5994 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
5995
59962004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5997
5998 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
5999 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6000
60012004-12-17 Paul Eggert <eggert@cs.ucla.edu>
6002
6003 Remove uses of 'short int' and 'unsigned short int'. This raises
6004 some arbitrary limits. It uses more memory but nowadays that's
6005 not much of an issue.
6006
6007 This change does not affect the generated parsers; that's a different
6008 task, as some users will want to conserve memory there.
6009
6010 Ideally we should use size_t to represent all object counts, and
6011 something like ptrdiff_t to represent signed differences of object
6012 counts; but that will require more code-cleanup than I have the
6013 time to do right now.
6014
6015 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
6016 Use size_t, not int or short int, to count objects.
6017 * src/closure.c (nritemset, closure): Likewise.
6018 * src/closure.h (nritemset, closure): Likewise.
6019 * src/nullable.c (nullable_compute): Likewise.
6020 * src/print.c (print_core): Likewise.
6021 * src/print_graph.c (print_core): Likewise.
6022 * src/state.c (state_compare, state_hash): Likewise.
6023 * src/state.h (struct state): Likewise.
6024 * src/tables.c (default_goto, goto_actions): Likewise.
6025
6026 * src/gram.h (rule_number, rule): Use int, not short int.
6027 * src/output.c (prepare_rules): Likewise.
6028 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
6029 errs, reductions): Likewise.
6030 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
6031 Likewise.
6032 * src/tables.c (vector_number, tally, action_number,
6033 ACTION_NUMBER_MINIMUM): Likewise.
6034 * src/output.c (muscle_insert_short_int_table): Remove.
6035
60362004-12-17 Akim Demaille <akim@epita.fr>
6037
6038 * data/lalr1.cc: Extensive Doxygenation.
6039 (error_): Rename as...
6040 (error): this, since it is visible to the user.
6041 Adjust callers.
6042 (Parser::message): Now an automatic variable from...
6043 (Parser::yyreport_syntax_error_): here.
6044 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
6045 Parser::error.
6046 * tests/input.at: Escape $.
6047
60482004-12-16 Paul Eggert <eggert@cs.ucla.edu>
6049
6050 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
6051 Parenthesize rhs to avoid obscure problems with mistakes like
6052 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
6053 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6054 b4_rhs_location): Likewise.
6055 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6056 b4_rhs_location): Likewise.
6057
60582004-12-16 Akim Demaille <akim@epita.fr>
6059
6060 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
6061 yacc.c: be sure to stay within yycheck_.
6062 * tests/actions.at: Re-enable C++ tests.
6063
60642004-12-16 Akim Demaille <akim@epita.fr>
6065
6066 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
6067 real.
6068
60692004-12-16 Akim Demaille <akim@epita.fr>
6070
6071 Use #define to handle the %name-prefix.
6072
6073 * data/glr.c, data/yacc.c: Comment changes.
6074 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
6075 so that one can refer to yylex in the parser file, and have it
6076 renamed, as is the case with other skeletons.
6077
60782004-12-16 Akim Demaille <akim@epita.fr>
6079
6080 Move lalr1.cc internals into yy*.
6081
6082 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
6083 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
6084 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
6085 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
6086 (empty_, final_, terror_, errcode_, ntokens_)
6087 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
6088 (looka_, ilooka_, error_range_, nerrs_):
6089 Rename as...
6090 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
6091 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
6092 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
6093 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
6094 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
6095 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
6096 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
6097 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
6098 these.
6099
61002004-12-15 Paul Eggert <eggert@cs.ucla.edu>
6101
6102 Fix some problems reported by twlevo at xs4all.
6103 * src/symtab.c (symbol_new): Report an error if the input grammar
6104 contains too many symbols. This is better than calling abort() later.
6105 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
6106 (struct node, struct graph):
6107 Rename member expand to stretch. All uses changed.
6108 (struct graph): Remove member layoutalgorithm. All uses removed.
6109 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
6110 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
6111 All uses changed.
6112 (N_STRETCH): Rename from N_EXPAND. All uses changed.
6113
61142004-12-15 Akim Demaille <akim@epita.fr>
6115
6116 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
6117 Add more Doxygen comments.
6118 (symprint_, stack_print_, reduce_print_, destruct_, pop)
6119 (report_syntax_error_, translate_): Rename as...
6120 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
6121 (yypop_, yyreport_syntax_error_, yytranslate_): this.
6122
61232004-12-15 Akim Demaille <akim@epita.fr>
6124
6125 * data/lalr1.cc (lex_): Rename as...
6126 (yylex_): this.
6127 Move the trace here.
6128 Take the %name-prefix into account.
6129 Reported by Alexandre Duret-Lutz.
6130
61312004-12-15 Akim Demaille <akim@epita.fr>
6132
6133 Simplify the C++ parser constructor.
6134
6135 * data/lalr1.cc (debug_): Rename as...
6136 (yydebug_): so that the parser's internals are always in the yy*
6137 pseudo namespace.
6138 Adjust uses.
6139 (b4_parse_param_decl): Remove the leading comma as it is now only
6140 called as unique argument list.
6141 (Parser::Parser): Remove the constructor accepting a location and
6142 an initial debugging level.
6143 Remove from the other ctor the argument for the debugging level.
6144 (debug_level_type, debug_level, set_debug_level): New.
6145
6146 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
6147 constructor calls.
6148
61492004-12-15 Akim Demaille <akim@epita.fr>
6150
6151 Remove b4_root related material: failure experiment
6152 (which goal was to allow to derive from a class).
6153
6154 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
6155 definitions and uses.
6156
61572004-12-14 Paul Eggert <eggert@cs.ucla.edu>
6158
6159 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
6160 not 2, since it's not portable to subtract 1 from the start of an
6161 array. The new item 0 is never set or used. All uses changed.
6162
6163 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
6164 the default definition of YYLLOC_DEFAULT. Problem reported
6165 by Frank Heckenbach.
6166
61672004-12-12 Paul Eggert <eggert@cs.ucla.edu>
6168
6169 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
6170 the normal case and one for the error case. Just use the
6171 first one uniformly. Problem reported by Frank Heckenbach.
6172 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
6173 use exactly the same macro in both places.
6174 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
6175 so that the normal-case YYRHSLOC works for the error case too.
6176 All uses changed.
6177 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
6178 (YYLLOC_DEFAULT): Use the same macro as glr.c.
6179 * doc/bison.texinfo (Location Default Action): Don't claim that
6180 we have an array of locations. Use the same macro for both glr
6181 and lalr parsers. Mention YYRHSLOC. Mention what happens when
6182 the index is 0.
6183
61842004-12-10 Paul Eggert <eggert@cs.ucla.edu>
6185
6186 * HACKING: Update email addresses to send announcements to.
6187
6188 * configure.ac (AC_INIT): Bump version to 1.875f.
6189
61902004-12-10 Paul Eggert <eggert@cs.ucla.edu>
6191
6192 * NEWS: Version 1.875e.
6193 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
6194
6195 * src/scan-skel.l: Include "complain.h", for "fatal".
6196
6197 * src/relation.h (relation_print, relation_digraph):
6198 Relation sizes are of type relation_node, not size_t (this is
6199 merely a doc fix, since the two types are equivalent).
6200 (relation_transpose): Relation sizes are of type relation_node,
6201 not int.
6202 * src/relation.c: Likewise.
6203 (top, infinity): Now of type relation_node, not int.
6204 (traverse, relation_transpose): Use relation_node, not int.
6205
6206 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
6207 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
6208 (yyparse): Remove unused local introduced in 2004-10-25 patch.
6209
6210 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
6211 specifying whether the test should be skipped. Use it tp
6212 specify that the [%defines %skeleton "lalr1.cc"] tests currently
6213 fail on some hosts, and should be skipped.
6214
62152004-12-08 Paul Eggert <eggert@cs.ucla.edu>
6216
6217 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
6218 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
6219 unless otherwise specified below.
6220
6221 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
6222 to allocate kernel_base, kernel_items, kernel_size, since
6223 they needn't be initialized to 0.
6224 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
6225 * src/closure.c (new_closure): Likewise, for itemset.
6226 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
6227 * src/lalr.c (set_goto_map): Likewise, for temp_map.
6228 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
6229 (build_relations): Likewise for edge, states1, includes.
6230 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
6231 * src/reader.c (packgram): Likewise, for ritem, rules.
6232 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
6233 * src/relation.c (relation_digraph): Likewise for VERTICES.
6234 (relation_transpose): Likewise for new_R, end_R.
6235 * src/symtab.c (symbols_token_translations_init): Likewise for
6236 token_translations.
6237 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
6238 (token_actions): Likewise for yydefact, actrow, conflrow,
6239 conflict_list.
6240 (save_column): Likewise for froms[symno], tos[symno].
6241 (goto_actions): Likewise for state_count.
6242 (pack_table): Likewise for base, pos, check.
6243 (tables_generate): Likewise for width.
6244
6245 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
6246 for initial core. Just have a separate core, so we needn't worry
6247 about whether kernel_size and kernel_base are initialized.
6248
6249 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
6250 kernel_size, kernel_items): Remove unnecessary initialization.
6251 * src/conflicts.c (conflicts): Likewise.
6252 * src/derives.c (derives): Likewise.
6253 * src/muscle_tablc (muscle_insert): Likewise.
6254 * src/relation.c (relation_digraph): Likewise.
6255 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
6256 conflrow, conflict_table, conflict_list, table, check):
6257 Likewise.
6258
6259 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
6260 This is because all callers pass unsigned int.
6261 * src/closure.h (new_closure): Likewise.
6262
6263 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
6264 (build_relations): Initialize includes[i] in all cases.
6265 * src/reader.c (packgram): Always initialize rules[ruleno].prec
6266 and rules[ruleno].precsym. Initialize members in order.
6267 * src/relation.c (relation_transpose): Always initialize new_R[i]
6268 and end_R[i].
6269 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
6270
6271 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
6272 conflict_list[0] was always 0, but now it isn't initialized.
6273
6274 * src/table.c (table_grow): When conflict_table grew, the grown
6275 area wasn't cleared. Fix this.
6276
6277 * lib/.cvsignore: Add strdup.c, strdup.h.
6278 * m4/.cvsignore: Add strdup.m4.
6279
62802004-12-07 Paul Eggert <eggert@cs.ucla.edu>
6281
6282 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
6283 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
6284 GOTO_NUMBER_MAXIMUM, since we occasionally compute
6285 ngotos + 1 without checking for overflow.
6286 (build_relations): Use END_NODE, not -1, to denote end of edges.
6287 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
6288 build_relations): Use goto_number, not int, for goto numbers.
6289 * src/tables.c (save_column, default_goto): Likewise.
6290
62912004-11-23 Akim Demaille <akim@epita.fr>
6292
6293 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
6294 of #defining from yystype.
6295 Don't typedef yystype, C++ does not need it.
6296 This lets it possible to forward declare it as union.
6297
62982004-11-23 Paul Eggert <eggert@cs.ucla.edu>
6299
6300 * bootstrap (gnulib_modules): Add extensions.
6301 Problem reported by Jim Meyering.
6302
63032004-11-22 Paul Eggert <eggert@cs.ucla.edu>
6304
6305 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
6306 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
6307 src/system.h, src/tables.c: XFREE -> free, to accommodate
6308 recent change to gnulib xalloc.h.
6309 Problem reported by Jim Meyering.
6310
63112004-11-17 Akim Demaille <akim@epita.fr>
6312
6313 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
6314
63152004-11-17 Akim Demaille <akim@epita.fr>,
6316 Alexandre Duret-Lutz <adl@gnu.org>
6317
6318 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
6319 changes.
6320 (YYCDEBUG): Adjust.
6321 Use it instead of cdebug_.
6322 (Parser::debug_stream, Parser::set_debug_stream): New.
6323 (Parser::symprint_): Define cdebug_ for temporary backward
6324 compatibility.
6325 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
6326 debug_stream ().
6327
63282004-11-17 Akim Demaille <akim@epita.fr>
6329
6330 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
6331 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
6332 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
6333 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
6334
63352004-10-27 Paul Eggert <eggert@cs.ucla.edu>
6336
6337 * data/glr.c (yyloc_default): Remove; not used.
6338 Problem reported by Frank Heckenbach.
6339
63402004-10-25 Akim Demaille <akim@epita.fr>
6341
6342 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
6343 Introduce another definition to address simple location arrays.
6344 (yyGLRStack): New member: yyerror_range.
6345 (yyrecoverSyntaxError, yyparse): Update it.
6346 (yyrecoverSyntaxError): Use it when shifting the error token to
6347 have an accurate range, equivalent to the one computed by both
6348 yacc.c and lalr1.cc.
6349 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
6350 that column numbers start at column 0, as per GNU Coding
6351 Standards, the others tests, and the doc.
6352 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
6353 Adjust to the above change (first column is 0).
6354 And adjust the location of the "<error>", now covering the whole
6355 line.
6356
63572004-10-22 Akim Demaille <akim@epita.fr>
6358 and Paul Eggert <eggert@cs.ucla.edu>
6359
6360 Remove some arbitrary limits on goto numbers and relations.
6361 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
6362 initial values, since they're never used.
6363 (set_goto_map): ngotos is now unsigned, so test for overflow
6364 by seeing whether it wraps around to zero.
6365 * src/lalr.h (goto_number): Now size_t, not short int.
6366 (GOTO_NUMBER_MAXIMUM): Remove.
6367 * src/relation.c (relation_print, traverse, relation_transpose):
6368 Check for END_NODE rather than looking at sign.
6369 * src/relation.h (END_NODE): New macro.
6370 (relation_node): Now size_t, not short int.
6371
63722004-10-22 Paul Eggert <eggert@cs.ucla.edu>
6373
6374 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
6375 keyword, not an identifier. Problem reported by Baron Schwartz in
6376 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
6377
63782004-10-11 Akim Demaille <akim@epita.fr>
6379
6380 * src/symtab.c (symbol_check_alias_consistency): Also check
6381 type names, destructors, and printers.
6382 Reported by Alexandre Duret-Lutz.
6383 Recode the handling of associativity and precedence in terms
6384 of symbol_precedence_set.
6385 Accept no redeclaration at all, not even equal to the previous
6386 value.
6387 (redeclaration): New.
6388 Use it to factor redeclaration complaints.
6389 (symbol_make_alias): Don't set the type of the alias, let
6390 symbol_check_alias_consistency do it as for other features.
6391 * src/symtab.h (symbol): Add new member prec_location, and
6392 type_location.
6393 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
6394 * tests/input.at (Incompatible Aliases): New.
6395
63962004-10-09 Paul Eggert <eggert@cs.ucla.edu>
6397
6398 .cvsignore fixes to accommodate gnulib changes,
6399 and the practice of naming build directories "_build".
6400 * .cvsignore: Add "_*". Sort.
6401 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
6402 * m4/.cvsignore: Add "*_gl.m4".
6403
64042004-10-06 Akim Demaille <akim@epita.fr>
6405
6406 * src/parse-gram.y (add_param): Fix the truncation of trailing
6407 spaces.
6408
64092004-10-05 Akim Demaille <akim@epita.fr>
6410
6411 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
6412 whether the reducion was empty or not. This leaves room to
6413 improve the use of YYLLOC_DEFAULT in such a case.
6414 lalr1.cc is still experimental, so changing this is acceptable.
6415 And finally, there are probably not many users who changed the
6416 handling of locations in GLR, so changing is admissible too.
6417
6418 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
6419 empty reduction, set @$ to an empty location ending the previously
6420 stacked symbol.
6421 Adjust uses to make sure the code is triggered on empty
6422 reductions.
6423 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
6424 expected output: empty reductions have empty locations.
6425
64262004-09-29 Akim Demaille <akim@epita.fr>
6427
6428 * data/lalr1.cc: Move towards a more standard C++ coding style
6429 for templates: Class < T > -> Class<T>.
6430
64312004-09-29 Akim Demaille <akim@epita.fr>
6432
6433 * data/lalr1.cc: Reinstall the former ctor, for sake of
6434 compatibility, but warn it will be removed.
6435 Move towards a more standard C++ coding style (i.e., type *var ->
6436 type* var).
6437
64382004-09-27 Paul Eggert <eggert@cs.ucla.edu>
6439
6440 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
6441 since it's less likely to work if NULs are involved in the future.
6442
64432004-09-27 Akim Demaille <akim@epita.fr>
6444
6445 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
6446
64472004-09-27 Akim Demaille <akim@epita.fr>
6448
6449 * data/lalr1.cc (b4_parse_param_decl_1): New.
6450 (b4_parse_param_decl): Use it to have different names between attribute
6451 and argument names.
6452 (b4_cc_constructor_call): Likewise.
6453
64542004-09-24 Akim Demaille <akim@epita.fr>
6455
6456 * src/parse-gram.y (add_param): Strip the leading and trailing
6457 blanks from a formal argument declaration.
6458 (YY_LOCATION_PRINT): New.
6459
64602004-09-24 Akim Demaille <akim@epita.fr>
6461
6462 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
6463 after the location.
6464
64652004-09-24 Akim Demaille <akim@epita.fr>
6466
6467 * doc/bison.texinfo (Table of Symbols): Sort.
6468
64692004-09-21 Akim Demaille <akim@epita.fr>
6470
6471 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
6472 the useless parentheses.
6473 Suggested by Paul Eggert.
6474
64752004-09-20 Akim Demaille <akim@epita.fr>
6476
6477 Let the initial-action act on the look-ahead, and use it for the
6478 "initial push" (corresponding to an hypothetical beginning-of-file).
6479 And let lalr1.cc honor %initial-action.
6480
6481 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
6482 example.
6483 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
6484 (Parser::Parser): Remove the ctor that used to initialize it.
6485 (Parser::parse): Like in the other skeletons, issue the "starting
6486 parse" message before any action.
6487 Honor %initial-action.
6488 Initialize the stacks with the lookahead.
6489 * data/yacc.c: Let $$ and @$ in %initial-action designate the
6490 look-ahead.
6491 Push them in the stacks.
6492 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
6493
64942004-09-20 Akim Demaille <akim@epita.fr>
6495
6496 * doc/bison.texinfo (Initial Action Decl): New.
6497
64982004-09-20 Akim Demaille <akim@epita.fr>
6499
6500 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
6501 clearer criterion to define it.
6502 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
6503 When reducing on an empty RHS, use the latest stacked location as
6504 location.
6505 yylloc is not always available.
6506 * data/glr.c: Likewise.
6507 Also, honor initial-actions.
6508
65092004-09-20 Akim Demaille <akim@epita.fr>
6510
6511 * data/yacc.c (YY_LOCATION_PRINT): New.
6512 Define when we know YYLTYPE's structure, i.e., when the default
6513 YYLLOC_DEFAULT is used.
6514 * data/c.m4 (b4_yysymprint_generate): Use it.
6515 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
6516 value of the result.
6517 (error_start_): Replace with...
6518 (error_range_): this location array.
6519 This allows to replace code relying on the implementation of
6520 locations by portable code.
6521 * data/yacc.c (yylerrsp): Replace with...
6522 (yyerror_range): this.
6523 Every time a token is popped, update yyerror_range[0], to have an
6524 accurate location for the error token.
6525 * data/glr.c (YY_LOCATION_PRINT): New.
6526 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
6527 deference a pointer.
6528 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
6529 report the location in %printers.
6530
6531 * src/scan-skel.l: Instead of abort, report error messages to ease
6532 understanding skeleton scanning failures.
6533
65342004-09-16 Akim Demaille <akim@epita.fr>
6535
6536 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
6537 (iterator, const_iterator): these, to be more in the C++ spirit.
6538 Also, return reverse iterators so that when displaying the stack
6539 we display its bottom first.
6540 (Parser::stack_print_, Parser::reduce_print_): Match the messages
6541 from yacc.c.
6542 We should probably use vector here though.
6543
65442004-09-16 Akim Demaille <akim@epita.fr>
6545
6546 Have more complete shift traces.
6547
6548 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
6549 to report Shifts instead of ad hoc YYDPRINTF invocations,
6550 including for the error token.
6551 * data/lalr1.cc (symprint_): Output the location.
6552 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
6553 output the location within the %printer.
6554 Activate GLR tests, at least to make sure they compile properly.
6555 They still don't pass though.
6556 * tests/calc.at: Adjust expect verbose output, since now "Entering
6557 state..." is on a different line than the "Shifting" message.
6558
65592004-09-08 Akim Demaille <akim@epita.fr>
6560
6561 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
6562 Bison directive from the Bison file to the invocation of this
6563 macro, so that these directives are passed to
6564 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
6565 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
6566 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
6567 the extra Bison directives instead of the whole series.
6568 Change the grammar so that there are recoverable errors, and
6569 unrecoverable errors. Now we can have the parser give up before
6570 consuming the whole input. As a result we now can observe that
6571 the lookahead is freed when needed.
6572 Change the parser source to parse argv[1] instead of a hard coded
6573 string.
6574 Simplify yylex, and give a value and location to EOF.
6575 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
6576 passed directives already coded in the file.
6577 Add some tests to check the location of "error".
6578 For some tests, the C++ parser is correct, and not yacc.c.
6579 For other tests, they provide different, but unsatisfying, values,
6580 so keep the C++ value so that at least one parser is "correct"
6581 according to the test suite.
6582 (Actions after errors): Remove, this is subsumed by the
6583 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
6584
65852004-09-06 Akim Demaille <akim@epita.fr>
6586
6587 * data/lalr1.cc: Adjust the indentation of the labels.
6588 (Parser::pop): New.
6589 Use it.
6590
65912004-09-06 Akim Demaille <akim@epita.fr>
6592
6593 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
6594 argument, an informative message.
6595 Call YY_SYMBOL_PRINT.
6596 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
6597 * data/lalr1.cc (destruct_): Likewise.
6598 In addition, no longer depend on b4_yysymprint_generate and
6599 b4_yydestruct_generate to generate these functions, do it "by
6600 hand".
6601
66022004-09-03 Akim Demaille <akim@epita.fr>
6603
6604 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
6605 invoked, yydestruct the lookahead.
6606 * tests/calc.at (Calculator $1): Update the expected lengths of
6607 traces: there is an added line for the discarded lookahead.
6608 * doc/bison.texinfo (Destructor Decl): Some rewording.
6609 Define "discarded" symbols.
6610
66112004-09-02 Akim Demaille <akim@epita.fr>
6612
6613 * data/lalr1.cc (translate_, destruct_): No reason to be static.
6614
66152004-09-02 Akim Demaille <akim@epita.fr>
6616
6617 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
6618 (YYDSYMPRINTF): Rename as...
6619 (YY_SYMBOL_PRINT): this.
6620 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
6621 two.
6622 Use it instead of direct symprint_ calls.
6623 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
6624 one.
6625
66262004-09-02 Akim Demaille <akim@epita.fr>
6627
6628 * data/lalr1.cc (b4_yysymprint_generate): New.
6629 (symprint_): New member function, defined when YYDEBUG.
6630 Use it consistently instead of token/nterm debugging output by
6631 hand.
6632 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
6633 %printer calls to use cdebug_ when using lalr1.cc.
6634
66352004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
6636
6637 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
6638 with #ifdef YYDEBUG.
6639
66402004-08-26 Akim Demaille <akim@epita.fr>
6641
6642 * doc/bison.texinfo (Implementing Loops): Rename as...
6643 (Implementing Gotos/Loops): this.
6644
66452004-08-13 Paul Eggert <eggert@cs.ucla.edu>
6646
6647 Adjust to latest gnulib.
6648 * bootstrap (gnulib_modules): Add xalloc-die.
6649 Set LC_ALL=C so that file names sort consistently.
6650 Prefer the gnulib copies of gettext.m4, glibc21.m4,
6651 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
6652 uintmax_t.m4, ulonglong.m4.
6653 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
6654 po.m4 since we are now using _gl.m4 instead.
6655
66562004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
6657
6658 * src/scan-action.l: Remove. Scanning of semantic actions is
6659 handled in scan-gram.l.
6660
66612004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
6662
6663 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
6664
6665 * src/location.h (struct): The file member is a uniqstr.
6666 (equal_boundaries): Use UNIQSTR_EQ for comparison.
6667
66682004-07-22 Paul Eggert <eggert@cs.ucla.edu>
6669
6670 Fix bug with non-%union parsers that have printers or destructors,
6671 which led to a Bison core dump. Reported by Peter Fales in
6672 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
6673
6674 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
6675 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
6676 not to our own type.
6677 * src/output.c (symbol_destructors_output, symbol_printers_output):
6678 Don't assume %union.
6679 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
6680 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
6681 UNION-FLAG. All callers changed.
6682 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
6683 Use type char, not unsigned int, when declaring an array of char;
6684 this lets us remove a cast.
6685 (Printers and Destructors): Add non-%union test cases.
6686
66872004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6688
6689 * doc/bison.texinfo: Minor editorial changes, mostly to the new
6690 GLR writeups. E.g., avoid frenchspacing and the future tense,
6691 change "lookahead" to "look-ahead", and change "wrt" to "with
6692 respect to".
6693
66942004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6695
6696 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
6697 New sections, split off from the GLR Parsers section. Put the new
6698 Simple GLR Parser near the start of the GLR section, for clarity.
6699 Rewrite connective text.
6700
67012004-06-21 Frank Heckenbach <frank@g-n-u.de>
6702
6703 * doc/bison.texinfo (Simple GLR Parsers): New section.
6704
67052004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6706
6707 * NEWS, TODO, doc/bison.texinfo:
6708 Use "look-ahead" instead of "lookahead", to be consistent.
6709 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
6710 while we're fixing "look-ahead".
6711 * src/conflicts.c (shift_set): Renamed from shiftset.
6712 (look_ahead_set): Renamed from lookaheadset.
6713 * src/print.c: Likewise.
6714 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
6715 name for "lookahead".
6716 (report_types, usage): Likewise.
6717 * src/getargs.h (report_look_ahead_tokens): Renamed from
6718 report_lookaheads.
6719 * src/lalr.c (compute_look_ahead_tokens): Renamed from
6720 compute_lookaheads.
6721 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
6722 (look_ahead_tokens_print): Renamed from lookaheads_print.
6723 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
6724 state_rule_lookaheads_print.
6725 * src/state.h: Likewise.
6726 (reductions.look_ahead_tokens): Renamed from lookaheads.
6727 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
6728 AT_DATA_LOOKAHEADS_GRAMMAR.
6729
67302004-06-03 Paul Eggert <eggert@cs.ucla.edu>
6731
6732 * README: Update location of patched M4 distribution.
6733
67342004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
6735
6736 Don't assume the C++ compiler takes the same arguments as the C compiler
6737 (trivial change).
6738 * configure.ac (O0CXXFLAGS): New var.
6739 * tests/atlocal.in (CXXFLAGS): Use it.
6740
67412004-05-29 Paul Eggert <eggert@cs.ucla.edu>
6742
6743 Fix some "make check" problems with C++ reported by
6744 Albert Chin-A-Young for Tru64 C++ in this thread:
6745 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
6746
6747 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
6748 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6749 Output to a .cc file for C++, not to a .c file.
6750 * tests/calc.at (AT_CHECK_CALC): Likewise.
6751 * tests/regression.at (AT_CHECK_DANCER): Likewise.
6752 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
6753
67542004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
6755
6756 * tests/calc.at, tests/actions.at: Workaround for SGI
6757 C++ compiler. (trivial change)
6758
67592004-05-27 Paul Eggert <eggert@cs.ucla.edu>
6760
6761 Spent a few hours checking out which prerequisite versions the
6762 current sources actually require. I went all the way back to
6763 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
6764 a seemingly endless set of combinations of versions more recent
6765 than that. The bottom line is that the current sources require
6766 fairly recent versions of the build tools, and it'll be some work
6767 to change this.
6768 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
6769 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
6770 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
6771 Add comments explaining why those particular versions are
6772 currently needed.
6773
6774 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
6775 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
6776 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
6777
6778 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
6779 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
6780
67812004-05-26 Paul Eggert <eggert@cs.ucla.edu>
6782
6783 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
6784 0.11.5. Suggested by Bruno Haible.
6785 * bootstrap: Remove gettext version checking.
6786
6787 * doc/bison.texinfo (Decl Summary): Also mention that %union
6788 can depend on prerequisite types. Problem reported by Tim
6789 Van Holder.
6790
67912004-05-25 Paul Eggert <eggert@cs.ucla.edu>
6792
6793 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
6794 * README-alpha: Don't tell people not to package this.
6795
6796 * bootstrap: Don't assume $(...) works; use `...` instead.
6797 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
6798 gettext better.
6799
6800 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
6801 put into the -d output file, and mention what to do if YYSTYPE is
6802 defined as a macro.
6803
68042004-05-24 Paul Eggert <eggert@cs.ucla.edu>
6805
6806 Undo change made earlier today: it caused autopoint to not bring
6807 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
6808 autopoint's.
6809
6810 * bootstrap: Check that gettext version matches what's in
6811 configure.ac. Warn users to ignore robots.txt ERROR 404.
6812 * bootstrap: Undo today's earlier change (logged below).
6813 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
6814
6815 The gettext version checking is causing more trouble than it's
6816 curing; remove it. Problem reported by Paul Hilfinger.
6817
6818 * bootstrap: Issue a warning that one can expect a message
6819 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
6820 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
6821
68222004-05-23 Paul Eggert <eggert@cs.ucla.edu>
6823
6824 Ensure that the C++ compiler used for testing actually works on a
6825 simple test program; if not, skip the C++-related tests. Problem
6826 reported by Vin Shelton in:
6827 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
6828
6829 * m4/cxx.m4: New file.
6830 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
6831 * tests/atlocal.in (BISON_CXX_WORKS): Add.
6832 * tests/local.at (AT_COMPILE_CXX): Use it.
6833
68342004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6835
6836 * data/glr.c (yylloc): Output this macro even if locations are not
6837 being generated, as the GLR parser needs it even in that case.
6838 Problem reported by Troy A. Johnson
6839 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
6840
6841 * configure.ac (AC_INIT): Update to 1.875e.
6842
68432004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6844
6845 * NEWS: Version 1.875d.
6846 * configure.ac (AC_INIT): Likewise.
6847 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
6848
6849 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
6850 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
6851 lalr1.cc runs afoul of the first, and the last two are no longer
6852 supported by GCC 3.4.0.
6853 * README: Mention GNU m4 1.4 or later; mention m4 patches.
6854 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
6855
68562004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6857
6858 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
6859 unsigned int, for compatibility with latest gnulib hash module.
6860 * src/state.c (state_hash, state_hasher): Likewise.
6861 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
6862 * src/uniqstr.c (hash_uniqstr): Likewise.
6863
68642004-05-03 Paul Eggert <eggert@cs.ucla.edu>
6865
6866 * NEWS: Unescaped newlines are no longer allowed in char & strings.
6867
6868 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
6869 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
6870 character and string literals.
6871 (unexpected_end): New function.
6872 (unexpected_eof): Use it.
6873 (unexpected_newline): New function.
6874 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
6875 actions.
6876
6877 * NEWS: Document %expect-rr.
6878
6879 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
6880 Fix typo by replacing $1 with $option.
6881 Remove more 'intl'-related files.
6882 Don't DEFUN AM_INTL_SUBDIR twice.
6883
6884 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
6885 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
6886 strtoul.c.
6887 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
6888 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
6889 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
6890 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
6891 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
6892 * src/.cvsignore: Add *.output.
6893
6894 * src/parse-gram.y: Put copyright notice inside %{ %} so it
6895 gets copied to the output file.
6896
68972004-04-28 Paul Eggert <eggert@twinsun.com>
6898
6899 Get files from the gnulib and po repositories, instead of relying
6900 on them being in our CVS. Upgrade to latest versions of gnulib
6901 and Automake.
6902
6903 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
6904 * bootstrap: Bootstrap from gnulib and po repositories.
6905 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
6906 * README-cvs: Document these changes. Remove version numbers from
6907 mentions of build tools, since they change so often. Mention Flex.
6908
6909 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
6910 (gl_USE_SYSTEM_EXTENSIONS): Add.
6911 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
6912 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
6913 does this for us.
6914 (AC_ISC_POSIX): Remove; we no longer support this
6915 ancient OS, as it gets in the way of latest Autoconf & gnulib.
6916 (AC_HEADER_STDC): Remove: we now assume C89 or better.
6917 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
6918 Do not check for C89 headers, except for locale.h which is used
6919 by the Yacc library and must port to K&R hosts.
6920 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
6921 Do not check for C89 functions, except for setlocale which is
6922 used by the Yacc library.
6923 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
6924 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
6925 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
6926 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
6927 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
6928 AM_GNU_GETTEXT): Remove; now done by:
6929 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
6930 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
6931 for us.
6932
6933 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
6934 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
6935 Define to empty, as gnulib.mk will do the rest for us.
6936 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
6937 for us.
6938 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
6939 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
6940
6941 * src/files.c: Include gnulib's xstrndup.h.
6942
6943 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
6944 (REALLOC): Use xnrealloc, for likewise.
6945 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
6946 (strnlen, memrchr): Remove decls; functions no longer used.
6947 Include <stpcpy.h>.
6948
6949 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
6950 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
6951 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
6952 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
6953 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
6954 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
6955 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
6956 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
6957 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
6958 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
6959 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
6960 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6961 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
6962 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
6963 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
6964 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
6965 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
6966 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
6967 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
6968 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
6969 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
6970 Remove, as these files are now generated automatically
6971 by bootstrap or automake.
6972
6973 * po/ChangeLog: Remove: all but one entry was a duplicate
6974 of this file, and I moved that 2000-11-02 entry here.
6975
6976 * config/.cvsignore: Add Makefile, depcomp, install-sh.
6977 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
6978 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
6979 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
6980 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
6981 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
6982 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
6983 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
6984 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
6985 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
6986 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
6987 xstrndup.h.
6988 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
6989 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
6990 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
6991 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
6992 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
6993 * src/.cvsignore: Remove *_.c.
6994
6995
6996 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
6997 support it. (The latest stable gzip doesn't.)
6998
69992004-04-27 Paul Eggert <eggert@twinsun.com>
7000
7001 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
7002 case, as stos_ is now used by destructors due to the 2004-02-09
7003 change.
7004
7005 Remove more K&R C support.
7006 * lib/libiberty.y (PARAMS): Remove. All uses removed.
7007 * lib/subpipe.c (errno): Remove decl.
7008 Include <stdlib.h> unconditionally.
7009 (EXIT_FAILURE): Remove macro.
7010 * src/complain.c (vfprintf, strerror): Remove.
7011 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
7012 unconditionally.
7013 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
7014 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
7015 (strchr, strspn, memchr): Remove decls.
7016 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
7017 unconditionally. Do not declare perror.
7018 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
7019 unconditionally.
7020
7021 * src/complain.c (_): Remove useless defn, as system.h defines this.
7022
7023 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
7024 with latest obstack.h.
7025 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
7026 to procedure types, as obstack.h now does that for us.
7027 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
7028
7029 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
7030 so that this include file can stand alone.
7031 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
7032 does this now. Include subpipe.h first after config.h, to
7033 test whether it can stand alone.
7034
7035 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
7036 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
7037 unused declaration.
7038
7039 * tests/synclines.at (%union synch line): Put a dummy member in
7040 the union, because empty unions aren't allowed in C. Caught
7041 by GCC 3.4.0.
7042
70432004-04-13 Jim Meyering <jim@meyering.net>
7044
7045 * src/conflicts.c (conflicts_print): Correct format string typo:
7046 use `%%' to produce literal `%'. (trivial change)
7047
70482004-03-30 Paul Eggert <eggert@twinsun.com>
7049
7050 * src/getargs.c (version): Update copyright year to 2004.
7051
7052 * data/c.m4 (b4_int_type): Use 'short int' rather than
7053 'short', and similarly for 'long', 'unsigned', etc.
7054 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
7055 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
7056 yy_yypstack, yydumpstack): Likewise.
7057 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
7058 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
7059 Likewise.
7060 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
7061 yy_stack_print, yyparse): Likewise.
7062 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
7063 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
7064 * lib/bitset.c (bitset_print): Likewise.
7065 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
7066 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7067 * lib/bitsetv.c (bitsetv_dump): Likewise.
7068 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
7069 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
7070 Likewise.
7071 * src/LR0.c (allocate_itemsets): Likewise.
7072 * src/gram.h (rule_number, rule): Likewise.
7073 * src/lalr.h (goto_number): Likewise.
7074 * src/nullable.c (nullable_compute): Likewise.
7075 * src/output.c (prepare_rules): Likewise.
7076 * src/relation.c (relation_print, relation_digraph): Likewise.
7077 * src/relation.h (relation_node): Likewise.
7078 * src/state.h (state_number, transitions, errs, reductions,
7079 struct state): Likewise.
7080 * src/symtab.h (symbol_number, struct symbol): Likewise.
7081 * src/tables.c (vector_number, tally, action_number,
7082 default_goto, goto_actions): Likewise.
7083 * tests/existing.at (GNU Cim Grammar): Likewise.
7084 * tests/regression.at (Web2c Actions): Likewise.
7085
7086 * src/output.c (muscle_insert_short_int_table): Renamed from
7087 muscle_insert_short_table. All uses changed.
7088
70892004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7090
7091 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
7092 (declaration): Replace expected_conflicts with expected_sr_conflicts.
7093 Add %expect-rr rule.
7094
7095 * src/scan-gram.l: Recognize %expect-rr.
7096
7097 * src/conflicts.h (expected_sr_conflicts): Rename from
7098 expected_conflicts.
7099 (expected_rr_conflicts): Declare.
7100
7101 * src/conflicts.c (expected_sr_conflicts): Rename from
7102 expected_conflicts.
7103 (expected_rr_conflicts): Define.
7104 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
7105 for GLR parsers.
7106 Use expected_sr_conflicts in place of expected_conflicts.
7107 Warn if expected_rr_conflicts used in non-GLR parser.
7108
7109 * doc/bison.texinfo: Add documentation for %expect-rr.
7110
71112004-03-08 Paul Eggert <eggert@gnu.org>
7112
7113 Add support for hex token numbers. Suggested by Odd Arild Olsen in
7114 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
7115
7116 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
7117 in lalr1.cc.
7118 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
7119 * src/scan-gram.l (scan_integer): New function.
7120 ({int}): Use it.
7121 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
7122 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
7123 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
7124 Say "long int", not "long", for uniformity with GNU style.
7125
71262004-02-25 Paul Eggert <eggert@twinsun.com>
7127
7128 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
7129 compilers. This fixes a problem with Intel's C++ compiler being
7130 chatty, reported by Guido Trentalancia in
7131 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
7132
71332004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
7134
7135 Support %destructor and merge error locations in lalr1.cc.
7136
7137 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
7138 (Parser::stos_): Define unconditionally.
7139 (Parser::destruct_): New method. Generate its body with
7140 b4_yydestruct_generate.
7141 (Parser::error_start_): New attribute.
7142 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
7143 token which are discarded.
7144 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
7145 error_start_ when erroneous token are discarded.
7146 (Parser::parse) <yyerrlab1>: Compute the location of the error
7147 token so that it covers all the discarded tokens.
7148 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
7149 it can be called with `%skeleton "lalr1.cc"', and do that.
7150
71512004-02-02 Paul Eggert <eggert@twinsun.com>
7152
7153 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
7154 $(top_srcdir)/lib and ../lib. This fixes a bug reported
7155 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
7156 There's no need to mention top_builddir since Automake does that
7157 for us.
7158 (INCLUDES): Remove, as Automake says it's obsolescent.
7159 Contents migrated into AM_CPPFLAGS as described above.
7160 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
7161
71622004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7163
7164 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
7165 (yyreportSyntaxError): Handle case where lookahead token is
7166 YYEMPTY.
7167
71682004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7169
7170 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
7171 resulting parsers are compilable with C++.
7172
71732003-12-23 Paul Eggert <eggert@twinsun.com>
7174
7175 * config/depcomp, config/install-sh: Sync with Automake 1.8.
7176 * src/output.c (output_skeleton): Rename local var.
7177 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
7178 Bison tokens, as this runs afoul of the 2003-10-07 change that
7179 disallowed NUL bytes in character constants or string literals.
7180
7181 * tests/local.at: Require Autoconf 2.59's Autotest.
7182 * tests/testsuite.at: Don't include local.at, since we now assume
7183 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
7184 including it.
7185 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
7186 multiple inclusion warnings.
7187
71882003-12-02 Akim Demaille <akim@epita.fr>
7189
7190 * doc/bison.texinfo (How Can I Reset the Parser): More about start
7191 conditions.
7192 From Bruno Haible.
7193
71942003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
7195
7196 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
7197
71982003-10-07 Paul Eggert <eggert@twinsun.com>
7199
7200 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
7201 if testsuite doesn't exist.
7202
7203 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
7204 literals, unfortunately.
7205 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
7206 Complain about NUL bytes in character constants or string literals.
7207
72082003-10-05 Paul Eggert <eggert@twinsun.com>
7209
7210 * NEWS: Don't document %no-default-prec, as it's still
7211 too experimental.
7212 * doc/bison.texinfo: Document %no-default-prec only if
7213 the defaultprec flag is set. Normally it's not.
7214
72152003-10-04 Paul Eggert <eggert@twinsun.com>
7216
7217 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
7218 non-modifiable lvalue, instead of a modifiable one.
7219 * doc/bison.texinfo (Actions): Document that $$ can
7220 be assigned to. Do not claim that $$ and $N are
7221 array element references: user code should not rely on this.
7222
72232003-10-01 Paul Eggert <eggert@twinsun.com>
7224
7225 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
7226 (grammar_declaration): Use it.
7227 * src/scan-gram.l: New token %no-default-prec.
7228 * tests/conflicts.at: Revamp tests to use %no-default-prec.
7229 * NEWS, doc/bison.texinfo: Document the above.
7230
72312003-10-01 Akim Demaille <akim@epita.fr>
7232
7233 VCG no longer supports long_straight_phase.
7234
7235 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
7236 * src/print_graph.c (print_graph): Adjust.
7237
72382003-09-30 Frank Heckenbach <frank@g-n-u.de>
7239 and Paul Eggert <eggert@twinsun.com>
7240
7241 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
7242 Table of Symbols): Document %default-prec.
7243 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
7244 (grammar_declaration): Set default_prec on %default-prec.
7245 * src/scan-gram.l (%default-prec): New token.
7246 * src/reader.h (default_prec): New flag.
7247 * src/reader.c: Likewise.
7248 (packgram): Handle it.
7249 * tests/conflicts.at (%default-prec without %prec,
7250 %default-prec with %prec, %default-prec 1): New tests.
7251
72522003-09-30 Paul Eggert <eggert@twinsun.com>
7253
7254 * tests/testsuite.at: Include local.at, not input.at, fixing
7255 a typo in the 2003-08-25 patch.
7256
72572003-08-27 Akim Demaille <akim@epita.fr>
7258
7259 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
7260 GCC warnings.
7261
72622003-08-26 Akim Demaille <akim@epita.fr>
7263
7264 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
7265 "<\#" to avoid magic from Gnus when posting parts of this script.
7266
72672003-08-26 Akim Demaille <akim@epita.fr>
7268
7269 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
7270 (Parser::parse): here.
7271 Adjust: nerrs and errstatus is now replaced by...
7272 (Parser::nerrs_, Parser::errstatus_): New.
7273
72742003-08-25 Akim Demaille <akim@epita.fr>
7275
7276 * config/announce-gen, Makefile.cfg: New.
7277 * Makefile.am: Adjust.
7278 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
7279 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
7280
72812003-08-25 Akim Demaille <akim@epita.fr>
7282
7283 When reducing initial empty rules, Bison parser read an initial
7284 location that is not defined. This results in garbage, and that
7285 affects Bison's own parser. Therefore we need (i) to extend Bison
7286 to support a means to initialize this location, and (ii) to use
7287 this CVS Bison to fix CVS Bison's parser.
7288
7289 * src/reader.h, reader.c (epilogue_augment): Remove, replace
7290 with...
7291 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
7292 * src/parse-gram.y: Adjust.
7293 (%initial-action): New.
7294 (%error-verbose): Since we require CVS Bison, there is no reason
7295 not to use it.
7296 * src/scan-gram.l: Adjust.
7297 * src/Makefile.am (YACC): New, to make sure we use our own parser.
7298 * data/yacc.c (yyparse): Use b4_initial_action.
7299
73002003-08-25 Akim Demaille <akim@epita.fr>
7301
7302 * doc/bison.texinfo: Don't promote stdout for error messages.
7303
73042003-08-25 Akim Demaille <akim@epita.fr>
7305
7306 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
7307 From Alexandre Duret-Lutz.
7308
73092003-08-25 Akim Demaille <akim@epita.fr>
7310
7311 Version 1.875c.
7312
73132003-08-25 Akim Demaille <akim@epita.fr>
7314
7315 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
7316 Use them.
7317
73182003-08-25 Akim Demaille <akim@epita.fr>
7319
7320 * data/lalr1.cc (Parser::reduce_print_): New.
7321 Use it.
7322
73232003-08-25 Akim Demaille <akim@epita.fr>
7324
7325 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
7326 error recovery loops. This patch is based on
7327 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
7328 Also, augment the similarity between lalr1.cc and yacc.c.
7329 Note: the locations of error recovery rules are not correct yet.
7330
7331 * data/lalr1.cc: Comment changes to augment the similarity between
7332 lalr1.cc and yacc.c.
7333 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
7334 (yyerrlab1): Remove, but where it used to be (now the bottom part of
7335 yyerrlab), when hitting EOF, pop the whole stack here instead of
7336 merely falling thru the default error handling mechanism.
7337 (yyerrorlab): New label, with the old contents of YYERROR,
7338 plus the following change: pop the stack of rhs corresponding
7339 to the production that invoked YYERROR. That is how Yacc
7340 behaves (required by POSIX).
7341 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
7342 fail.
7343
73442003-08-25 Akim Demaille <akim@epita.fr>
7345
7346 Tune local.at so that people can "autom4te -l autotest calc.at -o
7347 calc" for instance, to extract a sub test suite.
7348
7349 * tests/testsuite.at: Move the initialization, Autotest version
7350 requirement, and AT_TESTED invocation into...
7351 * tests/local.at: here.
7352 * tests/testsuite.at: Include it for compatibility with Autoconf
7353 2.57.
7354 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
7355 be ignore.
7356
73572003-08-04 Paul Eggert <eggert@twinsun.com>
7358
7359 Rework code slightly to avoid gcc -Wtraditional warnings.
7360 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
7361 The returned value is now stored in *YY0. All callers changed.
7362 * src/output.c (merge_output): Adjust to the above change.
7363
73642003-07-26 Paul Eggert <eggert@twinsun.com>
7365
7366 * data/glr.c (YYASSERT): New macro.
7367 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
7368 yyresolveStates, yyprocessOneStack):
7369 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
7370 Derived from a suggestion by Frank Heckenbach.
7371
73722003-07-25 Paul Eggert <eggert@twinsun.com>
7373
7374 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
7375 for portability to K&R C (after ansi2knr, presumably). See
7376 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
7377 by Frank Heckenbach, though I have omitted the structure-initialization
7378 part of his glr-knr.diff patch since I recall that the Portable
7379 C Compiler didn't require that change.
7380
7381 Let the user specify how to allocate and free memory.
7382 Derived from a suggestion by Frank Heckenbach in
7383 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
7384 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
7385 All uses of free, malloc, realloc changed to use these macros,
7386 and unnecessary casts removed.
7387 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
7388
73892003-07-06 Matthias Mann <MatthiasMann@gmx.de>
7390
7391 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
7392 use s.empty() rather than s == "" to test for empty string; see
7393 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
7394 (trivial change)
7395
73962003-06-25 Akim Demaille <akim@epita.fr>
7397
7398 * config/depcomp, config/install-sh: Update from masters.
7399
74002003-06-20 Paul Eggert <eggert@twinsun.com>
7401
7402 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
7403 and return properly parenthesized result.
7404 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
7405 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7406 Remove unnecessary parentheses from uses.
7407 * doc/bison.texinfo (Location Default Action): Describe the
7408 conventions for parentheses.
7409
74102003-06-19 Paul Eggert <eggert@twinsun.com>
7411
7412 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
7413 yyreportTree): Do not assume that size_t is the same width as int,
7414 when printing sizes. Print sizes using an unsigned format.
7415 Problem reported by Frank Heckenbach in
7416 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
7417
7418 Port to Forte Developer 7 C compiler.
7419 * data/glr.c (struct YYLTYPE): If locations are not being used,
7420 declare a single dummy member, as empty structs do not conform
7421 to the C standard.
7422 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
7423 the Forte Developer 7 C compiler complains that end-of-loop
7424 code is not reached.
7425
74262003-06-17 Paul Eggert <eggert@twinsun.com>
7427
7428 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
7429 avoid warnings from picky compilers about redefinition of PARAMS.
7430
74312003-06-17 Paul Eggert <eggert@twinsun.com>
7432
7433 Version 1.875b.
7434
7435 * NEWS: Document 1.875b.
7436
7437 * lib/bbitset.h: Do not include config.h; that's the includer's job.
7438 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
7439 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
7440 Don't use 'index' in comments, as it's a builtin fn on some hosts.
7441 * lib/bitset_stats.c: Include gettext.h unconditionally, as
7442 per recent gettext manual's suggestion.
7443 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
7444 Use prototypes, not old-style definitions.
7445 * lib/lbitset.c (lbitset_unused_clear): Likewise.
7446 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
7447 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
7448 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
7449 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
7450 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
7451 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
7452 vbitset_or_and_cmp, vbitset_copy): Likewise.
7453
7454 * lib/libiberty.h: Do not include config.h; that's the includer's job.
7455 Do not include <stdlib.h>.
7456 (PARAMS): Define unconditionally for C89.
7457 (ATTRIBUTE_NORETURN): Remove.
7458 (ATTRIBUTE_UNUSED): Define unconditionally.
7459
7460 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
7461 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
7462 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
7463 * lib/vbitset.c, lib/vbitset.h: New files.
7464 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
7465 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
7466 from libbitset.
7467
7468 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
7469 `How Can I Reset @code{yyparse}', since texinfo does not allow
7470 arbitrary @ in node names.
7471
7472 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
7473 shouldn't be needed according to the gettext 0.12.1 documentation
7474 but which seem to be needed anyway: codeset.m4 glibc21.m4
7475 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
7476 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
7477 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
7478
7479 * lib/.cvsignore: Add stdbool.h.
7480 * m4/.cvsignore: Add nls.m4, po.m4.
7481
7482 Upgrade to CVS gnulib.
7483 * stdbool_.h: File renamed from stdbool.h.in.
7484 * configure.ac (AM_STDBOOL_H): Invoke this instead of
7485 AC_HEADER_STDBOOL.
7486 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
7487 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
7488 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
7489 (MOSTLYCLEANFILES): New var.
7490 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
7491 (stdbool.h): New rule.
7492 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
7493 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
7494 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
7495 m4/quote.m4: Upgrade to today's gnulib.
7496
7497 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
7498 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
7499 the tests right now.
7500 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
7501 yyerror are declared before use; C99 requires this.
7502
75032003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7504
7505 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
7506 first.
7507 (yyrecoverSyntaxError): Correct the logic for setting and testing
7508 yyerrState.
7509 Correct comment on handling EOF.
7510 Allow states with only a default reduction, rather than failing
7511 (I can't quite reconstruct why these were not allowed before).
7512
7513 Fixes to avoid problem that $-N rules in GLR parsers can cause
7514 buffer overruns, corrupting state.
7515
7516 * src/output.c (prepare_rules): Output max_left_semantic_context
7517 definition.
7518 * src/reader.h (max_left_semantic_context): New variable declaration.
7519 * src/scan-gram.l (max_left_semantic_context): Define.
7520 (handle_action_dollar): Update max_left_semantic_context.
7521 * data/glr.c (YYMAXLEFT): New definition.
7522 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
7523 (yyresolveAction): Ditto.
7524
7525 Fixes to problems with location handling in GLR parsers reported by
7526 Frank Heckenbach (2003/06/05).
7527
7528 * data/glr.c (YYLTYPE): Make trivial if locations not used.
7529 (YYRHSLOC): Add parentheses, and define only if locations used.
7530 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
7531 locations not used.
7532 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
7533 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
7534
7535 * tests/cxx-type.at: Exercise location information; update tests
7536 to differentiate output with and without locations.
7537 Remove forward declarations of yylex and yyerror---caused errors
7538 because default YYLTYPE not yet defined.
7539 Change semantic actions to compute strings, rather than printing
7540 them directly (to test proper passing of semantics values). Change
7541 output to prefix notation and update test data and expected results.
7542 (yylex): Track locations.
7543 (stmtMerge): Return value rather than printing, and include arguments
7544 in value.
7545
75462003-06-03 Paul Eggert <eggert@twinsun.com>
7547
7548 Avoid warnings generated by GCC 2.95.4 when Bison is
7549 configured with --enable-gcc-warnings.
7550 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
7551 yy::]b4_parser_class_name[::translate_,
7552 yy::Stack::operator[] (unsigned),
7553 yy::Stack::operator[] (unsigned) const,
7554 yy::Slice::operator[] (unsigned),
7555 yy::Slice::operator[] (unsigned) const):
7556 Rename local vars to avoid warnings.
7557 * tests/glr-regression.at (Improper handling of embedded actions
7558 and $-N in GLR parsers): Remove unused local variable from yylex.
7559 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
7560 (void) as arg when not pure, since we now assume C89 when building
7561 Bison. Pacify GCC by using parameter.
7562
75632003-06-02 Paul Eggert <eggert@twinsun.com>
7564
7565 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
7566 yy::Location::lines, yy::Location::columns): Rename arguments
7567 to avoid shadowing; this removes a warning generated by GCC 3.3.
7568
75692003-06-01 Paul Eggert <eggert@twinsun.com>
7570
7571 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
7572 to g++, as GCC 3.3 complains if you do it.
7573 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
7574 everything that WARNING_CFLAGS has, except omit warnings
7575 not suitable for C++.
7576 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
7577 * tests/atlocal.in (CXXFLAGS): New var.
7578 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
7579
7580 Fix a GLR parser bug I reported in February; see
7581 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
7582 The problem was that GLR parsers did not conform to the C standard,
7583 because actions like { $1 = $2 + $3; } expanded to expressions
7584 that invoked YYFILL in separate subexpressions, and YYFILL assigned
7585 to a local variable. The C standard says that expressions
7586 like (var = f ()) + (var = f ()) have undefined behavior.
7587 Another problem was that GCC sometimes issues warnings that
7588 yyfill and its parameters are unused.
7589
7590 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
7591 as possibly unused.
7592 (yyfill): New function.
7593 (YYFILL): Use it.
7594 (yyuserAction): Change type of yynormal to bool, so that it matches
7595 the new yyfill signature. Mark it as possibly unused.
7596
7597
7598 Follow up on a bug I reported in February, where a Bison-generated
7599 parser can loop. Provide a test case and a fix for yacc.c. I
7600 don't have a fix for lalr1.cc or for glr.c, unfortunately.
7601 The original bug report is in:
7602 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
7603
7604 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
7605 macro's size was becoming unwieldy.
7606 (yyerrlab): Do not discard an empty lookahead symbol, as this
7607 might destroy garbage.
7608 (yyerrorlab): New label, with the old contents of YYERROR,
7609 plus the following change: pop the stack of rhs corresponding
7610 to the production that invoked YYERROR. That is how Yacc
7611 behaves, and POSIX requires this behavior.
7612 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
7613 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
7614 Define 'alarm' to do nothing if unistd.h is not available.
7615 Add a new rule "exp: '-' error;" to test the above change to
7616 data/yacc.c. Use 'alarm' to abort any test taking longer than
7617 10 seconds, as it's probably looping.
7618 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
7619 Also, the new yacc.c generates two fewer diagnostics for an
7620 existing test.
7621
76222003-05-24 Paul Eggert <eggert@twinsun.com>
7623
7624 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
7625 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
7626 This fixes a problem reported by John Bowman when the Compaq/HP
7627 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
7628 -ansi -Wall -gall).
7629 * data/yacc.c (union yyalloc): Likewise.
7630 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
7631
7632 Switch from 'int' to 'bool' where that makes sense.
7633
7634 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
7635 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
7636 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
7637 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
7638 Return or accept bool, not int. All callers changed.
7639 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
7640 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
7641 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
7642 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
7643 bitset_or_and_cmp_): Likewise.
7644 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
7645 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
7646 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
7647 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
7648 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
7649 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
7650 bitset_stats_or_and_cmp): Likewise.
7651 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
7652 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
7653 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
7654 ebitset_xor_cmp): Likewise.
7655 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
7656 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
7657 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
7658 lbitset_xor_cmp): Likewise.
7659 * lib/bbitset.h: Include <stdbool.h>.
7660 (struct bitset_vtable): The following members now return bool, not
7661 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
7662 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
7663 or_and_cmp).
7664 * src/conflicts.c (count_rr_conflicts): Likewise.
7665 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
7666 All uses changed.
7667 * lib/ebitset.c (ebitset_obstack_init): Likewise.
7668 * lib/lbitset.c (lbitset_obstack_init): Likewise.
7669 * src/getargs.c (debug_flag, defines_flag, locations_flag,
7670 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7671 graph_flag): Likewise.
7672 * src/getargs.h (debug_flag, defines_flag, locations_flag,
7673 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7674 graph_flag): Likewise.
7675 * src/output.c (error_verbose): Likewise.
7676 * src/output.h (error_verbose): Likewise.
7677 * src/reader.c (start_flag, typed): Likewise.
7678 * src/reader.h (typed): Likewise.
7679 * src/getargs.c (LOCATIONS_OPTION): New constant.
7680 (long_options, getargs): Use it.
7681 * src/lalr.c (build_relations): Use bool, not int.
7682 * src/nullable.c (nullable_compute): Likewise.
7683 * src/print.c (print_reductions): Likewise.
7684 * src/tables.c (action_row, pack_vector): Likewise.
7685 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
7686 * src/output.c (prepare): Use it.
7687 * src/output.c (token_definitions_output,
7688 symbol_destructors_output, symbol_destructors_output): Use string,
7689 not boolean integer, to keep track of whether to output separator.
7690 * src/print_graph.c (print_core): Likewise.
7691 * src/state.c (state_rule_lookaheads_print): Likewise.
7692
7693 * config/install-sh: Sync from automake 1.7.5.
7694
76952003-05-14 Paul Eggert <eggert@twinsun.com>
7696
7697 * src/parse-gram.y (rules_or_grammar_declaration): Require a
7698 semicolon after a grammar declaration, in the interest of possible
7699 future changes to the Bison input language.
7700 Do not allow a stray semicolon at the start of the grammar.
7701 (rhses.1): Allow one or more semicolons after any rule, including
7702 just before "|" as required by POSIX.
7703 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
7704 grammar.
7705
77062003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
7707
7708 %parse-param support for lalr1.cc.
7709
7710 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
7711 b4_cc_constructor_calls, b4_cc_constructor_call,
7712 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
7713 definitions.
7714 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
7715 parse-param arguments.
7716 (yy::b4_parser_class_name): Declare instance variables to
7717 hold parse-param arguments.
7718 * tests/calc.at: s/value/semantic_value/ because value clashes
7719 with a member of yy::b4_parser_class_name. Adjust C++ code
7720 to handle %parse-param. Enable %parse-param test in C++.
7721
77222003-05-12 Paul Eggert <eggert@twinsun.com>
7723
7724 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
7725 English a bit. Fix fclose typo. Change "const char" to "char
7726 const", and use ANSI C rather than K&R for "main". Suggest
7727 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
7728 and suggest yy_switch_to_buffer.
7729
77302003-05-05 Paul Eggert <eggert@twinsun.com>
7731
7732 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
7733 C89. This avoids a diagnostic on compilers that define __STDC__
7734 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
7735 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7736
77372003-05-03 Paul Eggert <eggert@twinsun.com>
7738
7739 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
7740 Do not overrun array bounds.
7741 This should fix a bug reported today by Olatunji Oluwabukunmi in
7742 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
7743
77442003-04-29 Akim Demaille <akim@epita.fr>
7745
7746 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
7747 * src/getargs.c, src/getargs.h: here, as bool, not int.
7748 (nondeterministic_parser): New.
7749 * src/parse-gram.y, src/scan-gram.l: Support
7750 %nondeterministic-parser.
7751 * src/output.c (prepare): Use nondeterministic_parser instead
7752 of glr_parser where appropriate.
7753 * src/tables.c (conflict_row, action_row, save_row)
7754 (token_actions, token_actions, pack_vector): Ditto.
7755
77562003-04-29 Akim Demaille <akim@epita.fr>
7757
7758 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
7759
77602003-04-29 Akim Demaille <akim@epita.fr>
7761
7762 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
7763 with %pure-parser and %locations to exercise the patch from Yakov
7764 Markovitch below.
7765
77662003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
7767
7768 * data/yacc.c: (b4_lex_param): Corrected for the case where
7769 %lex-param is provided and %pure-parser isn't.
7770
77712003-04-27 Paul Eggert <eggert@twinsun.com>
7772
7773 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
7774 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
7775 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
7776 if it is not defined.
7777 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
7778
77792003-04-26 Paul Eggert <eggert@twinsun.com>
7780
7781 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
7782 Declare to be of type suitable for the ninf value itself, not of
7783 type suitable for the corresponding table, since the latter might
7784 be unsigned but the ninf value might be negative. This fixes a
7785 bug reported by Alexandre Duret-Lutz in
7786 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
7787
7788 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
7789 invokes it. We shouldn't invoke it twice because it will attempt
7790 to put error.o in the archive twice. This fixes a glitch reported
7791 by Martin Mokrejs in
7792 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7793
77942003-04-21 Paul Eggert <eggert@twinsun.com>
7795
7796 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
7797 to gnulib.
7798
77992003-04-21 Yakov Markovitch <Markovitch@iso.ru>
7800
7801 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
7802 Fix obvious typo that results in uncompilable GLR parsers
7803 when both %pure-parser and %locations are used. (trivial change)
7804
78052003-04-17 Paul Eggert <eggert@twinsun.com>
7806
7807 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
7808 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
7809 Do not insert the expected token via unput, as this runs afoul
7810 of a POSIX-compatibility bug in flex 2.5.31.
7811 All uses changed to BEGIN the parent state,
7812 since we no longer insert the expected token via unput.
7813 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
7814 that is no longer emitted after the above change.
7815
7816 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
7817 the first one. This change is from Paul Hilfinger, and it fixes
7818 regression reported by Werner Lemberg in
7819 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
7820
7821 (resolve_sr_conflict): Don't invoke state_errs_set
7822 unless one or more tokens have been explicitly made errors.
7823 Otherwise, the above change causes Bison to abort.
7824
7825 * tests/existing.at (GNU pic Grammar): New test case, taken from
7826 Lemberg's email.
7827
78282003-03-31 Akim Demaille <akim@epita.fr>
7829
7830 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
7831
78322003-03-31 Akim Demaille <akim@epita.fr>
7833
7834 * src/output.c (prepare_symbols): Avoid trailing spaces in the
7835 output.
7836
78372003-03-31 Akim Demaille <akim@epita.fr>
7838
7839 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
7840 From Paul Hilfinger.
7841
78422003-03-29 Akim Demaille <akim@epita.fr>
7843
7844 * m4/error.m4: Do not put under dynamic conditions some code which
7845 expansion is under static control.
7846
78472003-03-29 Akim Demaille <akim@epita.fr>
7848
7849 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
7850
78512003-03-29 Akim Demaille <akim@epita.fr>
7852
7853 * doc/bison.texinfo (Strings are Destroyed): New.
7854
78552003-03-13 Paul Eggert <eggert@twinsun.com>
7856
7857 * .cvsignore: Add configure.lineno.
7858 * src/.cvsignore: Add yacc.
7859 * tests/.cvsignore: Add testsuite.log.
7860 * doc/fdl.texi: Sync with latest FSF version.
7861
78622003-03-12 Paul Eggert <eggert@twinsun.com>
7863
7864 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
7865 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
7866 cursor, instead of leaving it undefined. This fixes a bug
7867 reported by Tim Van Holder in
7868 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
7869 * tests/input.at (Torturing the Scanner): Test the scanner on
7870 an empty input file, which was Tim Van Holder's test case.
7871
7872 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
7873 <sys/resource.h> can be included, include sys/time.h and
7874 sys/times.h first, if available. This works around the SunOS
7875 4.1.4 porting bug reported by Bruce Becker in
7876 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
7877
7878 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
7879 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
7880 AC_HEADER_SYS_WAIT.
7881
7882 Merge changes from gnulib. This was prompted because the CVS
7883 snapshot didn't build on Solaris 7 due to strnlen problems.
7884
7885 These changes need to be merged back into gnulib:
7886 * lib/hash.c: Include <stdbool.h> unconditionally.
7887 * m4/onceonly.m4 (m4_quote): New macro.
7888 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
7889 Quote AC_FOREACH variable-expansions properly.
7890 The 2003-01-03 obstack.h change also needs merging.
7891 {end of changes requiring merging}
7892
7893 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7894 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
7895 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
7896 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
7897 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
7898 New files, imported from gnulib.
7899 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
7900 above.
7901
7902 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
7903 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
7904 gnulib sources.
7905
7906 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
7907 Add.
7908 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
7909 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
7910 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
7911 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
7912 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
7913 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
7914 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
7915 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
7916 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
7917 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
7918 (jm_PREREQ_ARGMATCH): Remove.
7919 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
7920 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
7921
7922 * src/system.h: Include <stdbool.h> unconditionally.
7923
7924 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
7925 assuming at least C89 in the bitset code for some time now.
7926
79272003-03-03 Akim Demaille <akim@epita.fr>
7928
7929 * ro.po: New.
7930
79312003-03-02 Akim Demaille <akim@epita.fr>
7932
7933 * doc/bison.texinfo (Table of Symbols): Reactivate the
7934 documentation for %lex-param, and %parse-param.
7935
79362003-03-02 Akim Demaille <akim@epita.fr>
7937
7938 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
7939 generate verbose error messages.
7940 Use the number of tokens as an upper bound in yytname, as it
7941 cannot be a non terminal.
7942
79432003-03-02 Akim Demaille <akim@epita.fr>
7944
7945 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
7946 message.
7947
79482003-03-02 Akim Demaille <akim@epita.fr>
7949
7950 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
7951 Use them to exercise yycheck overrun.
7952 Based on Andrew Suffield's grammar.
7953
79542003-03-02 Akim Demaille <akim@epita.fr>
7955
7956 Create tests/local.at for Bison generic testing macros.
7957
7958 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
7959 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
7960 This new file.
7961 * tests/calc.at (AT_CHECK_CALC): Adjust.
7962 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
7963 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
7964 * tests/local.at: here.
7965 (AT_COMPILE_CXX): Tags the tests using it as c++.
7966 Ignore the test if CXX is not functional.
7967
79682003-03-01 Paul Eggert <eggert@twinsun.com>
7969
7970 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
7971 not loc->end, since loc->end might contain garbage and this leads
7972 to undefined behavior on some platforms.
7973 (id_loc, token_start): Use (IF_LINTed) initial values that do not
7974 depend on *loc, so that the reader doesn't give the the false
7975 impression that *loc is initialized.
7976 (<INITIAL>"%%"): Do not bother setting code_start, since its value
7977 does not survive the return.
7978
79792003-03-01 Akim Demaille <akim@epita.fr>
7980
7981 * src/scan-gram.l (code_start): Always initialize it when entering
7982 into yylex, as SC_EPILOGUE is activated *before* the corresponding
7983 yylex invocation. An alternative would be making it static, but
7984 then it starts with the second %%'s beginning, instead of its end.
7985
79862003-02-28 Paul Eggert <eggert@twinsun.com>
7987
7988 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
7989 around a UnixWare 7.1.1 porting bug reported by John Hughes in
7990 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
7991
79922003-02-26 Paul Eggert <eggert@twinsun.com>
7993
7994 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
7995 Remove Sequent/Pyramid discussion (nobody uses them any more).
7996 Merge VMS and MS-DOS discussion; these ports may well be dead
7997 but let's keep mentioning them for now. Put <> around email
7998 addresses. Add copyright notice.
7999
80002003-02-24 Paul Eggert <eggert@twinsun.com>
8001
8002 * data/glr.c (yy_reduce_print): yylineno -> yylno,
8003 to avoid collision with flex use of yylineno.
8004 Problem reported by Bruce Lilly in
8005 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
8006 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8007 * data/yacc.c (yy_reduce_print): Likewise.
8008
8009 * config/depcomp: Sync with Automake 1.7.3.
8010
80112003-02-21 Akim Demaille <akim@epita.fr>
8012
8013 * data/lalr1.cc: Use temporary variables instead of casts to
8014 change integer types.
8015 Suggested by Paul Eggert.
8016
80172003-02-21 Akim Demaille <akim@epita.fr>
8018
8019 * doc/bison.texinfo: Use "location" consistently to refer to @n,
8020 to avoid confusions with lalr1.cc's notion of Position.
8021 Suggested by Paul Eggert.
8022
80232003-02-20 Akim Demaille <akim@epita.fr>
8024
8025 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
8026 before initial_columns.
8027 (location.hh): Use consistent variable names when defining the
8028 operator<<.
8029 Use "last" so that we subtract from Positions, not from unsigned.
8030
80312003-02-20 Akim Demaille <akim@epita.fr>
8032
8033 * data/lalr1.cc (position.hh): New subfile, including the extended
8034 and Doxygen'ed documentation of class Position.
8035 (location.hh): Use it.
8036 Document a` la Doxygen.
8037 With the help of Benoit Perrot.
8038
80392003-02-20 Akim Demaille <akim@epita.fr>
8040
8041 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
8042 AT_YACC_IF.
8043 Redefine AT_YYERROR_SEES_LOC_IF using it.
8044 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
8045 not defined.
8046 Don't use the location in yy::Parser::error_ and
8047 yy::Parser::print_ when not %locations.
8048 Activate more lalr1.cc tests.
8049
80502003-02-19 Akim Demaille <akim@epita.fr>
8051
8052 * data/lalr1.cc: When displaying a line number, be sure to make it
8053 an int.
8054
80552003-02-19 Akim Demaille <akim@epita.fr>
8056
8057 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
8058 Remove, useless.
8059 (YYABORT, YYACCEPT, YYERROR): New.
8060 * tests/calc.at: Renable the lalr1.cc test.
8061
80622003-02-19 Akim Demaille <akim@epita.fr>
8063
8064 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
8065 error recovery, mixing with/without pops and discarding of the
8066 lookahead.
8067 Exercise YYERROR.
8068 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
8069
80702003-02-17 Paul Eggert <eggert@twinsun.com>
8071
8072 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
8073 * tests/testsuite.at (AT_COMPILE): Use them.
8074 This fixes the testsuite problem reported by Robert Lentz in
8075 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
8076
80772003-02-12 Paul Eggert <eggert@twinsun.com>
8078
8079 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
8080 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
8081 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
8082 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
8083 Check for malloc failure, for consistency with yacc.c.
8084 (yytname_size): Remove, for consistency with yacc.c.
8085
8086 The bug still remains in data/lalr1.cc, as I didn't have time
8087 to fix it there.
8088
80892003-02-06 Akim Demaille <akim@epita.fr>
8090
8091 * configure.ac (GXX): Rename as...
8092 (CXX): this, to keep the original Autoconf semantics.
8093 Require 2.57.
8094 * data/lalr1.cc: Fix b4_copyright invocations.
8095 If YYDEBUG is not defined, don't depend upon name_ being defined.
8096 (location.hh): Include string and iostream.
8097 (Position::filename): New member.
8098 (Position::Position ()): New.
8099 (operator<< (Position)): New.
8100 (operator- (Position, int)): New.
8101 (Location::first, Location::last): Rename as...
8102 (Location::begin, Location::end): these, to mock the conventional
8103 iterator names.
8104 (operator<< (Location)): New.
8105 * tests/atlocal.in (CXX): New.
8106 * tests/testsuite.at (AT_COMPILE_CXX): New.
8107 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
8108 locations in a more synthetic way.
8109 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
8110 lalr1.cc is used.
8111 Adjust the C locations to match those from Emacs: first column is
8112 column 0.
8113 Change all the expected results.
8114 Conform to the GCS: simplify the locations when applicable.
8115 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
8116 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
8117 these CPP macros with the m4 macros new defined by...
8118 (AT_CHECK_PUSHDEFS): this, i.e.:
8119 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
8120 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
8121 New macros.
8122 (AT_CHECK_POPDEFS): Undefine them.
8123 (AT_CHECK_CALC_LALR1_CC): New.
8124 Use it for the first lalr1.cc test.
8125
81262003-02-04 Akim Demaille <akim@epita.fr>
8127
8128 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
8129 Location as is defined.
8130
81312003-02-04 Akim Demaille <akim@epita.fr>
8132
8133 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
8134 name_ being defined.
8135
81362003-02-03 Paul Eggert <eggert@twinsun.com>
8137
8138 * src/gram.h (start_symbol): Remove unused decl.
8139
8140 Use more-consistent naming conventions for local vars.
8141
8142 * src/derives.c (derives_compute): Change type of local var from
8143 int to rule_number.
8144 * src/gram.c (grammar_rules_partial_print): Likewise.
8145 * src/print.c (print_core): Likewise.
8146 * src/reduce.c (reduce_grammar_tables): Likewise.
8147
8148 * src/gram.c (grammar_dump): Change name of item_number *
8149 local var from r to rp.
8150 * src/nullable.c (nullable_compute): Likewise.
8151
8152 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
8153
8154 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
8155 for symbol or symbol_number var.
8156 * src/reader.c (grammar_start_symbol_set): Likewise.
8157 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
8158 Likewise.
8159 * src/state.c (transitions_to): Likewise.
8160 * src/state.h: Likewise.
8161 * src/tables.c (symbol_number_to_vector_number): Likewise.
8162
8163 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
8164 char * var.
8165
8166 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
8167 var.
8168
8169 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
8170 var.
8171
8172 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
8173 Use str, not s, for char * var. Use ch, not c, for character var.
8174 Use size for size var.
8175
8176 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
8177 char * var.
8178 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
8179 uniqstr var.
8180 * src/uniqstr.h: Likewise.
8181
8182 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8183 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8184 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
8185 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
8186 param to have same name as that of enum, so that we don't use
8187 "s" to stand for a non-state.
8188
81892003-02-02 Akim Demaille <akim@epita.fr>
8190
8191 * src/scan-skel.l: Scan more than one inert character per yylex
8192 invocation.
8193
81942003-02-01 Paul Eggert <eggert@twinsun.com>
8195
8196 Version 1.875a.
8197
8198 * po/LINGUAS: Add ms.
8199
82002003-01-30 Akim Demaille <akim@epita.fr>
8201
8202 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
8203
82042003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8205
8206 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
8207 of $1.
8208
8209 Changes in response to error report by S. Eken: GLR mode does not
8210 handle negative $ indices or $ indices in embedded rules correctly.
8211 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
8212
8213 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
8214 (b4_rhs_location): Ditto.
8215 (yyfill): New function to copy from stack tree into array
8216 incrementally.
8217 (yyuserAction): Modify to allow incremental move of semantic values
8218 to rhs array when in GLR mode.
8219 Define YYFILL to use in user-defined actions to fill semantic array
8220 as needed.
8221 Remove dummy use of yystack, as there is now a guaranteed use.
8222 (yydoAction): Modify to allow incremental move of semantic values
8223 to rhs array when in GLR mode.
8224 (yyresolveAction): Ditto.
8225 (yyglrShiftDefer): Update comment.
8226 (yyresolveStates): Use X == NULL for pointers, not !X.
8227 (yyglrReduce): Ditto.
8228 (yydoAction): Ditto
8229
8230 * tests/glr-regr1.at: Rename to ...
8231 * tests/glr-regression.at: Add new regression test for the problems
8232 described above (adapted from S. Eken).
8233 Update copyright notice.
8234 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
8235 * tests/Makefile.am: Ditto.
8236
82372003-01-28 Paul Eggert <eggert@twinsun.com>
8238
8239 * data/lalr1.cc: Do not use @output_header_name@ unless
8240 b4_defines_flag is set. This fixes two bugs reported by
8241 Tim Van Holder in
8242 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
8243 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
8244
82452003-01-21 Paul Eggert <eggert@twinsun.com>
8246
8247 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
8248 we don't need to worry about yyerrlab1 being reported as an
8249 "unused label" by non-GCC C compilers. The downside is that if
8250 locations are used then a couple of statements are duplicated each
8251 time YYERROR is invoked, but the upside is that the warnings
8252 should vanish.
8253 (yyerrlab1): Move code to YERROR.
8254 (yyerrlab2): Remove. Change uses back to yyerrlab1.
8255 This reverts some of the 2002-12-27 change.
8256
82572003-01-17 Paul Eggert <eggert@twinsun.com>
8258
8259 * src/output.c (symbol_printers_output): Fix typo that led
8260 to core dump. Problem reported by Antonio Rus in
8261 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
8262
82632003-01-13 Akim Demaille <akim@epita.fr>,
8264 Quoc Peyrot <chojin@lrde.epita.fr>,
8265 Robert Anisko <anisko_r@lrde.epita.fr>
8266
8267 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
8268 when the stacks contain one element, as the loop would otherwise
8269 free the last state, and then use the top state (the one we just
8270 popped). This means that the initial elements will not be freed
8271 explicitly, as is the case in yacc.c; it is not a problem, as
8272 these elements have fake values.
8273
82742003-01-11 Paul Eggert <eggert@twinsun.com>
8275
8276 * NEWS: %expect-violations are now just warnings, reverting
8277 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
8278 bootstrapping problem reported by Matthias Klose; see
8279 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
8280 * src/conflicts.c (conflicts_print): Likewise.
8281 * tests/conflicts.at (%expect not enough, %expect too much,
8282 %expect with reduce conflicts): Likewise.
8283 * doc/bison.texinfo (Expect Decl): Document this. Also mention
8284 that the warning is enabled if the number of conflicts changes
8285 (not necessarily increases).
8286
8287 * src/getargs.c (version): Update copyright year.
8288
82892003-01-09 Akim Demaille <akim@epita.fr>
8290
8291 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
8292
82932003-01-08 Paul Eggert <eggert@twinsun.com>
8294
8295 * Makefile.maint (WGETFLAGS):
8296 New macro, containing "-C off" to disable proxy caches.
8297 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
8298 (rel-check): Use $(WGET) instead of wget.
8299
83002003-01-06 Paul Eggert <eggert@twinsun.com>
8301
8302 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
8303 the GLR paper of Scott, Johnstone and Hussain.
8304
83052003-01-04 Paul Eggert <eggert@twinsun.com>
8306
8307 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
8308 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
8309 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
8310 (EXTRA_LIBRARIES): New var, for liby.a.
8311 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
8312 (EXTRA_SCRIPTS): New var, for yacc.
8313
8314 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
8315 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
8316 Problem reported by Nelson H. F. Beebe.
8317
83182003-01-03 Paul Eggert <eggert@twinsun.com>
8319
8320 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
8321 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8322 when compiling Bison 1.875's `bitset bset = obstack_alloc
8323 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8324
8325 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
8326 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
8327 grow to a huge size with typical invocation.
8328
8329 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
8330 Use the pattern recommended by Autoconf 2.57, except also protect
8331 against double-definition.
8332 * src/system.h: Likewise.
8333 Portability issues reported by Nelson H. F. Beebe.
8334
8335 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
8336 All uses changed. Provide a definition in both C and C++.
8337 (yytrue, yyfalse): Define even if defined (__cplusplus).
8338
8339 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
8340 Reported by Nelson H. F. Beebe.
8341
8342 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
8343
83442003-01-02 Paul Eggert <eggert@twinsun.com>
8345
8346 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
8347 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
8348 Bug reported by Nelson H. F. Beebe.
8349
83502003-01-01 Paul Eggert <eggert@twinsun.com>
8351
8352 * Version 1.875.
8353
83542002-12-30 Paul Eggert <eggert@twinsun.com>
8355
8356 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
8357 Moved here from...
8358 (<INITIAL>","): Here. This causes stray "," to be treated
8359 more uniformly.
8360
8361 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
8362 last brace in braced code when not in Yacc mode, for compatibility
8363 with Bison 1.35. This resurrects the 2001-12-15 patch to
8364 src/reader.c.
8365
8366 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
8367 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
8368
83692002-12-28 Paul Eggert <eggert@twinsun.com>
8370
8371 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
8372 that of SYM's type. This fixes Debian bug 168069, reported by
8373 Thomas Olsson.
8374
83752002-12-28 Paul Eggert <eggert@twinsun.com>
8376
8377 Version 1.75f.
8378
8379 Switch back to the Yacc style of conflict reports, undoing some
8380 of the 2002-07-30 change.
8381 * doc/bison.texinfo (Understanding): Use Yacc style for
8382 conflict reports. Also, use new way of locating rules.
8383 * src/conflicts.c (conflict_report):
8384 Renamed from conflict_report_yacc, removing the old
8385 'conflict_report'. Translate the entire conflict report at once,
8386 so that we don't assume that "," has the same interpretation in
8387 all languages.
8388 (conflicts_output): Use Yacc-style conflict report for each state,
8389 instead of our more-complicated style.
8390 (conflicts_print): Use Yacc-style conflict report, except print
8391 the input file name when not emulating Yacc.
8392 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
8393 Conflicted Reduction, %expect not enough, %expect too much,
8394 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
8395 * tests/existing.at (GNU Cim Grammar): Likewise.
8396 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
8397
8398 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
8399 fatal): Don't invoke fflush; it's not needed and it might even be
8400 harmful for stdout, as stdout might not be open.
8401 * src/reduce.c (reduce_print): Likewise.
8402
84032002-12-27 Paul Eggert <eggert@twinsun.com>
8404
8405 Fix a bug where error locations were not being recorded correctly.
8406 This problem was originally reported by Paul Hilfinger in
8407 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
8408
8409 * data/yacc.c (yyparse): New local var yylerrsp, to record the
8410 top of the location stack's error locations.
8411 (yyerrlab): Set it. When discarding a token, push its location
8412 onto yylerrsp so that we don't lose track of the error's end.
8413 (yyerrlab1): Now is only the target of YYERROR, so that we can
8414 properly record the location of the action that failed. For GCC
8415 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
8416 GCC warning about yyerrlab1 being unused if YYERROR is unused.
8417 (yyerrlab2): New label, which yyerrlab now falls through to.
8418 Compute the error's location by applying YYLLOC_DEFAULT to
8419 the locations of all the symbols that went into the error.
8420 * doc/bison.texinfo (Location Default Action): Mention that
8421 YYLLOC_DEFAULT is also invoked for syntax errors.
8422 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8423 Error locations include the locations of all the tokens that were
8424 discarded, not just the last token.
8425
84262002-12-26 Paul Eggert <eggert@twinsun.com>
8427
8428 * src/files.c: Include quote.h.
8429 (compute_output_file_names): Warn if we detect conflicting
8430 outputs to the same file. This should catch the misunderstanding
8431 exemplified by Debian Bug 165349, reported by Bruce Stephens..
8432
8433 * src/conflicts.c (conflicts_print): If the user specifies
8434 "%expect N", report an error if there are any reduce/reduce
8435 conflicts. This is what the manual says should happen.
8436 This fixes Debian bug 130890, reported by Anthony DeRobertis.
8437 * tests/conflicts.at (%expect with reduce conflicts): New test.
8438
8439 Don't use m4_include on relative file names, as it doesn't work as
8440 desired if there happens to be a file with that name under ".".
8441
8442 * m4sugar/version.m4: Remove; it was included but it wasn't used.
8443 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
8444 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
8445 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
8446 * src/output.c (output_skeleton): Use full path names when
8447 specifying a file to include; don't rely on include path, as
8448 it's unreliable when the working file contains a file with
8449 that name.
8450
84512002-12-25 Paul Eggert <eggert@twinsun.com>
8452
8453 Remove obsolete references to bison.simple and bison.hairy.
8454 Problem mentioned by Aubin Mahe in
8455 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
8456 * data/glr.c: Comment fix.
8457 * doc/bison.1: Remove references. Also, mention "yacc".
8458
8459 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
8460 with -g option.
8461
8462 * src/parse-gram.y (declaration): Use enum "report_states" rather
8463 than its numeric value 1.
8464
8465 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
8466 opening a new one. This fixes Debian bug 165349, reported by
8467 Bruce Stephens.
8468
84692002-12-24 Paul Eggert <eggert@twinsun.com>
8470
8471 Version 1.75e.
8472
8473 * Makefile.maint (cvs-update): Don't assume that the shell
8474 supports $(...), as Solaris sh doesn't.
8475
8476 * src/parse-gram.y (lloc_default): Remove test for empty
8477 nonterminals at the end, since it didn't change the result.
8478
84792002-12-24 Paul Eggert <eggert@twinsun.com>
8480
8481 If the user does not define YYSTYPE as a macro, Bison now declares it
8482 using typedef instead of defining it as a macro. POSIX requires this.
8483 For consistency, YYLTYPE is also declared instead of defined.
8484
8485 %union directives can now have a tag before the `{', e.g., the
8486 directive `%union foo {...}' now generates the C code
8487 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
8488 The default union tag is `YYSTYPE', for compatibility with Solaris 9
8489 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
8490 instead of `yyltype'.
8491
8492 `yystype' and `yyltype' are now obsolescent macros instead of being
8493 typedefs or tags; they are no longer documented and will be
8494 withdrawn in a future release.
8495
8496 * data/glr.c (b4_location_type): Remove.
8497 (YYSTYPE): Renamed from yystype.
8498 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
8499 (struct YYLTYPE): Renamed from struct yyltype.
8500 (YYLTYPE): Renamed from yyltype.
8501 (yyltype, yystype): New (and obsolescent) macros,
8502 for backward compatibility.
8503 * data/yacc.c: Likewise.
8504
8505 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
8506 does not specify a union tag. This is for compatibility with
8507 Solaris 9 yacc.
8508
8509 * src/parse-gram.y (add_param): 2nd arg is now char * not char
8510 const *, since it is now modified by stripping surrounding { }.
8511 (current_braced_code): Remove.
8512 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
8513 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
8514 trailing " {...}". Now of type <chars>.
8515 (grammar_declaration): Adjust to bundled tokens.
8516 (code_content): Remove; stripping is now done by add_param.
8517 (print_token_value): Print contents of bundled tokens.
8518 (token_name): New function.
8519
8520 * src/reader.h (braced_code, current_braced_code): Remove.
8521 (token_name): New decl.
8522
8523 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
8524 token_type, not braced_code code_kind. All uses changed.
8525 (SC_PRE_CODE): New state, for scanning after a keyword that
8526 has (or usually has) an immediately-following braced code.
8527 (token_type): New local var, to keep track of which token type
8528 to return when scanning braced code.
8529 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
8530 <INITIAL>"%parse-param", <INITIAL>"%printer",
8531 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
8532 instead of returning a token type immediately.
8533 (<INITIAL>"{"): Set token type.
8534 (<SC_BRACED_CODE>"}"): Use it.
8535 (handle_action_dollar, handle_action_at): Now returns bool
8536 indicating success. Fail if ! current_rule; this prevents a core dump.
8537 (handle_symbol_code_dollar, handle_symbol_code_at):
8538 Remove; merge body into caller.
8539 (handle_dollar, handle_at): Complain in invalid contexts.
8540
8541 * NEWS, doc/bison.texinfo: Document the above.
8542 * NEWS: Fix years and program names in copyright notice.
8543
85442002-12-17 Paul Eggert <eggert@twinsun.com>
8545
8546 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
8547 Reporting, Table of Symbols): Omit mentions of %lex-param and
8548 %parse-param from the documentation for now.
8549
85502002-12-15 Paul Eggert <eggert@twinsun.com>
8551
8552 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
8553 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
8554 lookahead symbol, and which sets yychar in parser actions) and it
8555 disagreed with the Bison documentation. Bug
8556 reported by Andrew Walrond.
8557
8558 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
8559 as the caller now does that.
8560 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
8561 (YYEMPTY): Parenthesize right hand side, since others use it.
8562 (yyparse): Don't assume that our generated code is the only code
8563 that sets yychar.
8564
85652002-12-13 Paul Eggert <eggert@twinsun.com>
8566
8567 Version 1.75d.
8568
8569 POSIX requires a "yacc" command.
8570 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
8571 (MOSTLYCLEANFILES): Add yacc.
8572 (yacc): New rule.
8573 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
8574 as an alias for bison y.
8575
8576 * po/LINGUAS: Add da.
8577
8578 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
8579 problem with latest <getopt.h>.
8580 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
8581
8582 * doc/fdl.texi: Upgrade to 1.2.
8583 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
8584 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
8585 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
8586 gnulib.
8587 * config/install-sh: Sync with autotools.
8588
8589 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
8590 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8591 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
8592 locations are requested.
8593 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
8594 locations are requested.
8595
85962002-12-12 Paul Eggert <eggert@twinsun.com>
8597
8598 Remove unportable casts and storage allocation tricks.
8599 While we're at it, remove almost all casts, since they
8600 usually aren't needed and are a sign of trouble.
8601
8602 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
8603
8604 * src/derives.c (derives_compute): Do not subtract NTOKENS from
8605 the pointer DSET returned by malloc; this isn't portable.
8606 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
8607 Similarly for DERIVES.
8608 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
8609 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
8610 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
8611
8612 * src/derives.c (derives_compute): Do not bother invoking
8613 int_of_rule_number, since rule numbers are integers.
8614
8615 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
8616 rather than XMALLOC (char, N).
8617
8618 * src/files.c (filename_split): Rewrite to avoid cast.
8619
8620 * src/gram.h (symbol_number_as_item_number,
8621 item_number_as_symbol_number, rule_number_as_item_number,
8622 item_number_as_rule_number):
8623 Now inline functions rather than macros, to avoid casts.
8624 * src/state.h (state_number_as_int): Likewise.
8625 * src/tables.c (state_number_to_vector_number,
8626 symbol_number_to_vector_number): Likewise.
8627
8628 * src/gram.h (int_of_rule_number): Remove; no longer used.
8629
8630 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
8631 since the resulting storage is always stored into.
8632
8633 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
8634 where it's needed.
8635
8636 * src/muscle_tab.c (muscle_m4_output):
8637 Now inline. Return bool, not int.
8638 * src/state.c (state_compare): Likewise.
8639 * src/symtab.c (symbol_check_defined,
8640 symbol_check_alias_consistency, symbol_pack, symbol_translation,
8641 hash_compare_symbol, hash_symbol):
8642 Likewise.
8643 * src/uniqstr.c (uniqstr_print): Likewise.
8644 * src/muscle_tab.c (muscle_m4_output_processor):
8645 New function, to avoid casts.
8646 * src/state.c (state_comparator, stage_hasher): Likewise.
8647 * src/symtab.c (symbol_check_defined_processor,
8648 symbol_check_alias_consistency_processor, symbol_pack_processor,
8649 symbol_translation_processor, hash_symbol_comparator,
8650 hash_symbol_hasher): Likewise.
8651 * src/uniqstr.c (uniqstr_print_processor): Likewise.
8652 * src/muscle_tab.c (muscles_m4_output):
8653 Use new functions instead of casting old functions unportably.
8654 * src/state.c (state_hash_new): Likewise.
8655 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
8656 symbols_token_translations_init):
8657 Likewise.
8658 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
8659
8660 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
8661 var instead of casting to long, to avoid casts.
8662 (prepare_states): Use MALLOC rather than alloca, so that we don't
8663 have to worry about alloca.
8664 * src/state.c (state_hash_lookup): Likewise.
8665
8666 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
8667 local var instead of casting to unsigned char, to avoid casts.
8668
8669 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
8670 STATE_ALLOC): Remove.
8671 (transitions_new, errs_new, reductions_new, state_new): Use malloc
8672 rather than calloc, and use offsetof to avoid allocating slightly
8673 too much storage.
8674 (state_new): Initialize all members.
8675
8676 * src/state.c (state_hash): Use unsigned accumulator, not signed.
8677
8678 * src/symtab.c (symbol_free): Remove; unused.
8679 (symbol_get): Remove cast in lhs of assignment.
8680 (symbols_do): Now static. Accept generic arguments, not
8681 hashing-related ones.
8682
8683 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
8684 (symbol_processor): Remove.
8685 (symbols_do): Remove decl; now static.
8686
8687 * src/system.h (alloca): Remove; decl no longer needed.
8688 (<stddef.h>): Include, for offsetof.
8689 (<inttypes.>, <stdint.h>): Include if available.
8690 (uintptr_t): New type, if system lacks it.
8691 (CALLOC, MALLOC, REALLOC): New macros.
8692 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
8693 new macros.
8694
8695 * src/tables.c (table_size): Now int, to pacify GCC.
8696 (table_grow, table_ninf_remap): Use signed table size.
8697 (save_row): Don't bother initializing locals when not needed.
8698 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
8699 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
8700
8701 * src/vcg.h: Correct misspellings.
8702
8703 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
8704
8705
8706 * src/getargs.c (getargs): Don't assume EOF == -1.
8707
87082002-12-09 Paul Eggert <eggert@twinsun.com>
8709
8710 Change identifier spellings to avoid collisions with names
8711 that are reserved by POSIX.
8712
8713 Don't use names ending in _t, since POSIX reserves them.
8714 For consistency, remove _e and _s endings -- they're weren't
8715 needed to remove ambiguity. All uses changed.
8716 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
8717 turn was just renamed from struniq_t.
8718 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
8719 which in turn was just renamed from struniq_processor_t.
8720 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
8721 in turn was renamed from hash_compare_struniq_t.
8722 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
8723 (state_list): Renamed from state_list_t.
8724 * src/assoc.h (assoc): Renamed from assoc_t.
8725 * src/conflicts.c (enum conflict_resolution): Renamed from
8726 enum conflict_resolution_e.
8727 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
8728 (rule_list): Renamed from rule_list_t.
8729 * src/getargs.h (enum trace): Renamed from enum trace_e.
8730 (enum report): Renamed from enum report_e.
8731 * src/gram.h (item_number): Renamed from item_number_t.
8732 (rule_number): Renamed from rule_number_t.
8733 (struct rule_s): Remove the "rule_s" part; not used.
8734 (rule): Renamed from rule_t.
8735 (rule_filter): Renamed from rule_filter_t.
8736 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
8737 (goto_list): Renamed from goto_list_t.
8738 * src/lalr.h (goto_number): Renamed from goto_number_t.
8739 * src/location.h (location): Renamed from location_t.
8740 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
8741 and moved here from:
8742 * src/muscle_tab.h (muscle_entry_t): here.
8743 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
8744 (rule_list): Renamed from rule_list_t.
8745 * src/print_graph.c (static_graph): Renamed from graph.
8746 * src/reader.h (braced_code): Renamed from braced_code_t.
8747 Remove brace_code_e tag.
8748 * src/relation.h (relation_node): Renamed from relation_node_t.
8749 (relation_nodes): Renamed from relation_nodes_t.
8750 (relation): Renamed from relation_t.
8751 * src/state.h (state_number): Renamed from state_number_t.
8752 (struct state): Renamed from struct state_s.
8753 (state): Renamed from state_t.
8754 (transitions): Renamed from transitions_t. Unused (and
8755 misspelled) transtion_s tag removed.
8756 (errs): Renamed from errs_t. Unused errs_s tag removed.
8757 (reductions): Renamed from reductions_t. Unused tag
8758 reductions_s removed.
8759 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
8760 (struct symbol_list): Renamed from struct symbol_list_s.
8761 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
8762 (struct symbol): Renamed from struct symbol_s.
8763 (symbol): Renamed from symbol_t.
8764 * src/tables.c (vector_number): Renamed from vector_number_t.
8765 (action_number): Renamed from action_t.
8766 * src/tables.h (base_number): Renamed from base_t.
8767 * src/vcg.h (enum color): Renamed from enum color_e.
8768 (enum textmode): Renamed from enum textmode_e.
8769 (enum shape): Renamed from enum shape_e.
8770 (struct colorentry): Renamed from struct colorentry_s.
8771 (struct classname): Renamed from struct classname_s.
8772 (struct infoname): Renamed from struct infoname_s.
8773 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
8774 (enum decision): Renamed from enum decision_e.
8775 (enum orientation): Renamed from enum orientation_e.
8776 (enum alignment): Renamed from enum alignment_e.
8777 (enum arrow_mode): Renamed from enum arrow_mode_e.
8778 (enum crossing_type): Renamed from enum crossing_type_e.
8779 (enum view): Renamed from enum view_e.
8780 (struct node): Renamed from struct node_s.
8781 (node): Renamed from node_t.
8782 (enum linestyle): Renamed from enum linestyle_e.
8783 (enum arrowstyle): Renamed from enum arrowstyle_e.
8784 (struct edge): Renamed from struct edge.
8785 (edge): Renamed from edge_t.
8786 (struct graph): Renamed from struct graph_s.
8787 (graph): Renamed from graph_t.
8788 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
8789 Rename value_t -> value.
8790 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
8791 value_t_as_yystype -> value_as_yystype.
8792
8793 Don't include <errno.h> in the mainstream code, since it
8794 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
8795 * lib/get-errno.c, lib/get-errno.h: New files.
8796 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
8797 get-errno.c.
8798 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
8799 * src/output.c (output_skeleton): Likewise.
8800 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
8801 instead of errno.
8802 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
8803 Likewise.
8804 (handle_action_dollar, handle_action_at): Likewise.
8805 * src/system.h: Do not include <errno.h>.
8806 (TAB_EXT): Renamed from EXT_TAB.
8807 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
8808
8809 Avoid str[a-z]*, since <string.h> reserves that name space.
8810 Change all instances of "struniq" in names to "uniqstr", and
8811 likewise for "STRUNIQ" and "UNIQSTR".
8812 * src/uniqstr.c: Renamed from src/struniq.c.
8813 * src/uniqstr.h: Renamed from src/struniq.h.
8814 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
8815 * src/files.c (strsuffix): Remove; unused.
8816 (concat2): Renamed from stringappend. Now static.
8817 * src/files.h (strsuffix, stringappend): Remove; unused.
8818 * src/parse-gram.y (<chars>): Renamed from <string>.
8819 (<uniqstr>): Renamed from <struniq>.
8820 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
8821 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
8822 (struct graph_s.expand): Renamed from struct graph_s.stretch.
8823 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
8824 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
8825 (N_EXPAND): Renamed from N_STRETCH.
8826
8827 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
8828 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
8829 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
8830 Remove; unused.
8831 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
8832 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
8833 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
8834 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
8835 (BASE_MAXIMUM): Renamed from BASE_MAX.
8836 (BASE_MINIMUM): Renamed from BASE_MIN.
8837 (ACTION_MAX): Remove; unused.
8838 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
8839 Unnecessary casts removed from above defines.
8840
8841
8842 Fix misspelling in names.
8843 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
8844 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
8845 G_NODE_ALIGNEMENT.
8846
8847
8848 * lib/timevar.c (timevar_report): Renamed from time_report,
8849 for consistency with other names.
8850 * lib/timevar.h (timevar_report): New decl.
8851 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
8852
8853
8854 Sort include-file uses.
8855
8856 Reorder all include files under src to be in the order "system.h".
8857 then the ../lib include files in angle brackets (alphabetized),
8858 then the . include files in double-quotes (alphabetized). Fix
8859 dependency breakages encountered in this process, as follows:
8860 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
8861 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
8862 * src/state.h: Include "symtab.h".
8863
88642002-12-08 Paul Eggert <eggert@twinsun.com>
8865
8866 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
8867 since this causes problems when __file__ contains character
8868 sequences like "@" that are treated specially by src/scan-skel.l.
8869 Instead, just use the file's basename. This fixes the bug
8870 reported by Martin Mokrejs in
8871 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
8872
88732002-12-06 Paul Eggert <eggert@twinsun.com>
8874
8875 Add support for rules that do not have trailing semicolons, as
8876 POSIX requires. Improve the quality of locations in Bison
8877 diagnostics.
8878
8879 * src/location.c: Include <quotearg.h>.
8880 (empty_location): Now const.
8881 (location_print): New function. Follow the recommendation of the
8882 GNU Coding Standards for locations that span file boundaries.
8883 * src/location.h: Do not include <quotearg.h>; no longer needed.
8884 (boundary): New type.
8885 (location_t): Use it. This allows locations to span file boundaries.
8886 All member uses changed: file -> start.file or end.file (as needed),
8887 first_line -> start.line, first_column -> start.column,
8888 last_line -> end.line, last_column -> end.column.
8889 (equal_boundaries): New function.
8890 (LOCATION_RESET, LOCATION_STEP): Remove.
8891 (LOCATION_PRINT): Remove. All callers changed to use location_print.
8892 (empty_location): Now const.
8893 (location_print): New decl.
8894 * src/parse-gram.y (lloc_default): New function, which handles
8895 empty locations more accurately.
8896 (YYLLOC_DEFAULT): Use it.
8897 (%token COLON): Remove.
8898 (%token ID_COLON): New token.
8899 (rules): Use it.
8900 (declarations, rules): Remove trailing semicolon.
8901 (declaration, rules_or_grammar_declaration):
8902 Allow empty (";") declaration.
8903 (symbol_def): Remove empty actions; no longer needed.
8904 (rules_or_grammar_declaration): Remove trailing semicolon.
8905 (semi_colon.opt): Remove.
8906 * src/reader.h: Include location.h.
8907 (scanner_cursor): New decl.
8908 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
8909 rolling our own.
8910 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
8911 of *loc.
8912 (STEP): Remove. No longer needed, now that adjust_location does
8913 the work. All uses removed.
8914 (scanner_cursor): New var.
8915 (adjust_location): Renamed from extend_location. It now sets
8916 *loc and adjusts the scanner cursor. All uses changed.
8917 Don't bother testing for CR.
8918 (handle_syncline): Remove location arg; now updates scanner cursor.
8919 All callers changed.
8920 (unexpected_end_of_file): Now accepts start boundary of token or
8921 comment, not location. All callers changed. Update scanner cursor,
8922 not the location.
8923 (SC_AFTER_IDENTIFIER): New state.
8924 (context_state): Renamed from c_context. All uses changed.
8925 (id_loc, code_start, token_start): New local vars.
8926 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
8927 processing of Yacc white space and equivalents here.
8928 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
8929 instead of returning ID immediately, since we need to search for
8930 a subsequent colon.
8931 (<INITIAL>"'", "\""): Save token_start.
8932 (<INITIAL>"%{", "{", "%%"): Save code_start.
8933 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
8934 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
8935 BEGIN context_state at end, not INITIAL.
8936 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
8937 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
8938 Return correct token start.
8939 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
8940 the start of a character, string or multiline comment is found.
8941 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
8942 Reduction): Adjust reported locations to match the more-precise
8943 results now expected.
8944 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
8945 * tests/reduce.at (Useless Rules, Reduced Automaton,
8946 Underivable Rules): Likewise.
8947 * tests/regression.at (Invalid inputs): No longer `expecting ";"
8948 or "|"' now that so many other tokens are allowed by the new grammar.
8949
8950 * src/complain.h (current_file): Remove duplicate decl;
8951 current_file is now owned by files.h.
8952 * src/complain.c, src/scan-gram.l: Include files.h.
8953
89542002-12-06 Paul Eggert <eggert@twinsun.com>
8955
8956 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
8957 promotes to int; it might be unsigned int.
8958 * data/yacc.c (yy_reduce_print): Likewise.
8959
8960 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
8961 be #defined in the prologue, not in the Bison declarations.
8962 This fixes Debian Bug 102878, reported by Shaul Karl.
8963
89642002-12-02 Paul Eggert <eggert@twinsun.com>
8965
8966 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
8967 * lib/strtoul.c: New file, from gnulib.
8968 This fixes a porting bug reported by Peter Klein in
8969 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
8970
89712002-11-30 Paul Eggert <eggert@twinsun.com>
8972
8973 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
8974 and put only a forward declaration in the prologue. This is for
8975 consistency with the other scanner helper functions.
8976
8977 Type clashes now generate warnings, not errors, since it
8978 appears that POSIX may allow some grammars with type clashes.
8979 * src/reader.c (grammar_current_rule_check): Warn about
8980 type clashes instead of complaining.
8981 * tests/input.at (Type Clashes): Expect warnings, not complaints.
8982
8983 Add Yacc library, since POSIX requires it.
8984 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
8985 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
8986 * lib/main.c, lib/yyerror.c: New files.
8987
8988 gram_error can be static; it need not be extern.
8989 * src/reader.h (gram_error): Remove decl.
8990 * src/parse-gram.y (gram_error): Now static. Add static decl.
8991 (print_token_value): Omit parameter names from forward decl,
8992 for consistency.
8993
89942002-11-29 Paul Eggert <eggert@twinsun.com>
8995
8996 * doc/bison.texinfo: Emphasize that yylex and yyerror must
8997 be declared before being used. E.g., one should typically
8998 declare them in the prologue. Use GNU coding style in examples.
8999 Put "const" consistently after the type it modifies. Mention
9000 that C99 supports "inline". Mention that yyerror traditionally
9001 returns "int".
9002
9003 %parse-param and %lex-param now take just one argument, the
9004 declaration; the argument name is deduced from the declaration.
9005
9006 * doc/bison.texinfo (Parser Function, Pure Calling, Error
9007 Reporting, Table of Symbols): Document this.
9008 * src/parse-gram.y (add_param): New function.
9009 (COMMA): Remove.
9010 (declaration): Implement new rule for %parse-param and %lex-param.
9011 * src/scan-gram.l: "," now elicits a warning, rather than being
9012 a token; this is more compatible with byacc.
9013 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
9014
90152002-11-27 Paul Eggert <eggert@twinsun.com>
9016
9017 Rename identifiers to avoid real and potential collisions.
9018
9019 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
9020 to avoid collision with lex macro described by Bruce Lilly in
9021 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
9022 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9023 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
9024 * src/parse-gram.y (print_token_value): Renamed from yyprint.
9025 All uses changed.
9026 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
9027 The name "yycontrol" violates the name space rules, and this stuff
9028 wasn't being used anyway.
9029 (input): Remove action; this stuff wasn't being used.
9030 (gram_error): Rename local variable yylloc -> loc.
9031 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
9032 (YY_DECL): Don't use "yy" at start of local variables.
9033 All uses changed, e.g., yylloc -> loc.
9034 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
9035 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
9036 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
9037 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
9038
9039 * src/parse-gram.y (gram_error): loc is now const *.
9040 * src/reader.h (gram_error): Likewise.
9041
90422002-11-24 Paul Eggert <eggert@twinsun.com>
9043
9044 Version 1.75c.
9045
9046 * tests/actions.at (Actions after errors): Use an output format
9047 more similar to that of the Printers and Destructors test.
9048 Test the position of the ';' token too.
9049 (Printers and Destructors): Likewise.
9050 (Printers and Destructors: %glr-parser): Remove for now, to avoid
9051 unnecessarily alarming people when the test fails.
9052
9053 * data/yacc.c (yyerrlab1): Move this label down, so that the
9054 parser does not discard the lookahead token if the user code
9055 invokes YYERROR. This change is required for POSIX conformance.
9056
9057 * lib/error.c: Sync with gnulib.
9058
90592002-11-22 Paul Eggert <eggert@twinsun.com>
9060
9061 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
9062 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
9063 * lib/xmalloc.c: Likewise.
9064
90652002-11-20 Paul Eggert <eggert@twinsun.com>
9066
9067 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
9068
90692002-11-20 Paul Eggert <eggert@twinsun.com>
9070
9071 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
9072 should use `if (! x) abort ();' rather than `assert (x);', and
9073 anyway it's one less thing to worry about configuring.
9074
9075 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
9076 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
9077 and replace all instances of assert with abort.
9078 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9079 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
9080
9081 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
9082 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
9083 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
9084 hash_find_entry, hash_rehash, hash_insert): Likewise.
9085 * src/conflicts.c (resolve_sr_conflict): Likewise.
9086 * src/lalr.c (set_goto_map, map_goto): Likewise.
9087 * src/nullable.c (nullable_compute): Likewise.
9088 * src/output.c (prepare_rules, token_definitions_output): Likewise.
9089 * src/reader.c (packgram, reader): Likewise.
9090 * src/state.c (state_new, state_free, state_transitions_set,
9091 state_reduction_find): Likewise.
9092 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
9093 symbol_pack): Likewise.
9094 * src/tables.c (conflict_row, pack_vector): Likewise.
9095 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9096 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9097 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
9098 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
9099
9100 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
9101 (ARGMATCH_CONSTRAINT): New macro.
9102 (ARGMATCH_ASSERT): Use it.
9103
9104 * src/system.h (verify): New macro.
9105 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
9106 rather than assert.
9107 * src/tables.c (tables_generate): Likewise.
9108
9109 * src/struniq.c (struniq_assert): Now returns void, and aborts
9110 if the assertion is false.
9111 (struniq_assert_p): Remove.
9112 * src/struniq.h: Likewise.
9113
91142002-11-18 Paul Eggert <eggert@twinsun.com>
9115
9116 * data/glr.c (yygetLRActions): Replace `yyindex' with
9117 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
9118 This fixes the regression with Sun ONE Studio 7 cc that I reported in
9119 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
9120
91212002-11-18 Akim Demaille <akim@epita.fr>
9122
9123 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
9124 space.
9125 From Tim Van Holder.
9126
91272002-11-17 Paul Eggert <eggert@twinsun.com>
9128
9129 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
9130 to "SyntaxError" for consistency with my 2002-11-15 change.
9131
9132 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
9133 not define to {}, since this breaks the common use of `YYDPRINTF
9134 ((...));' if a single statement is desired (e.g. before `else').
9135 Work around GCC warnings by surrounding corresponding calls with
9136 {} if needed.
9137 (yyhasResolvedValue): Remove unused function.
9138 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
9139 loop body.
9140 (yyreportSyntaxError): Renamed from yyreportParseError.
9141 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
9142 All uses changed.
9143 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
9144 extern when possible. Remove unused initializations.
9145
91462002-11-16 Akim Demaille <akim@epita.fr>
9147
9148 Augment the similarity between GLR and LALR traces.
9149
9150 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
9151 (YY_REDUCE_PRINT): New.
9152 (yyparse): Use them.
9153 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
9154 YYDPRINT here.
9155 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
9156 state reached after the reduction/recovery, since...
9157 (yyparse, yyprocessOneStack): Report the state we are entering in.
9158
91592002-11-16 Akim Demaille <akim@epita.fr>
9160
9161 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
9162 Add support for --trace=skeleton.
9163 * src/scan-skel.l: %option debug.
9164 Scan strings of non-@ or \n instead of character by character.
9165 (scan_skel): Handle trace_skeleton.
9166 (QPUTS): New.
9167 (@output_parser_name@, @output_header_name@): ``Restore'' their
9168 support (used to be M4 macros).
9169 * data/yacc.c: Quote larger chunks, a la glr.c.
9170 * data/lalr1.cc: Likewise.
9171 The header guards are no longer available, so use some other
9172 string than `YYLSP_NEEDED'.
9173
91742002-11-16 Akim Demaille <akim@epita.fr>
9175
9176 Make the ``Printers and Destructors'' test more verbose, taking
9177 `yacc.c''s behavior as (possibly wrong) reference.
9178
9179 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
9180 instead of fprint on stdout.
9181 Set and report the last_line of the symbols.
9182 Consistently display values and locations.
9183
91842002-11-16 Paul Eggert <eggert@twinsun.com>
9185
9186 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
9187
91882002-11-15 Paul Eggert <eggert@twinsun.com>
9189
9190 * tests/actions.at (Actions after errors): New test case.
9191
9192 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
9193 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
9194 tests/action.at, tests/calc.at, tests/conflicts.at,
9195 tests/cxx-type.at, tests/regression.at:
9196 "parse error" -> "syntax error" for POSIX compatibility.
9197 "parsing stack overflow..." -> "parser stack overflow" so
9198 that code matches Bison documentation.
9199
92002002-11-15 Akim Demaille <akim@epita.fr>
9201
9202 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
9203 take two BRACED_CODE, not two string_content.
9204 Free the scanner's obstack when we are done.
9205 (code_content): New.
9206 * tests/calc.at: Adjust.
9207 * doc/bison.texinfo: Adjust.
9208 Also, make sure to include the `,' for these declarations.
9209
92102002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
9211
9212 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
9213 definition; avoids potential autoreconf problems.
9214
92152002-11-15 Akim Demaille <akim@epita.fr>
9216
9217 Always check the value returned by yyparse.
9218
9219 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
9220 returned by yyparse.
9221 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
9222 Adjust calls.
9223 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
9224 returned by yyparse.
9225
92262002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9227
9228 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
9229 on input.at test.
9230
92312002-11-14 Paul Eggert <eggert@twinsun.com>
9232
9233 * src/output.c (output_skeleton): Call xfopen instead of
9234 duplicating xfopen's body.
9235
9236 Fix bugs reported by Nelson H. F. Beebe in
9237 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
9238
9239 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
9240 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
9241 Group compiler. Instead, use "$CC -E bar.c". Include the .h
9242 file twice in the grammar, as an extra check.
9243
9244 * tests/input.at (Torturing the Scanner): Surround the
9245 backslash-newline tests with "#if 0", to make it less likely that
9246 we'll run into compiler bugs. Bring back solitary \ inside
9247 comment, but add a closing comment to work around HP C bug. Don't
9248 test backslash-newline in C character constant.
9249
92502002-11-14 Akim Demaille <akim@epita.fr>
9251
9252 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
9253 status of the compiler.
9254 Calling `exit 1' is no longer needed.
9255 Reported by Nelson H. F. Beebe.
9256
92572002-11-14 Akim Demaille <akim@epita.fr>
9258
9259 * tests/atlocal.in (CPPFLAGS): We have config.h.
9260 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
9261 New.
9262 * tests/actions.at, tests/calc.at, tests/conflicts.at,
9263 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
9264 * tests/regression.at, tests/torture.at: Use them for all the
9265 grammars that are to be compiled.
9266 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
9267 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
9268 * doc/bison.texinfo (GLR Parsers): Document `inline'.
9269
92702002-11-14 Akim Demaille <akim@epita.fr>
9271
9272 * doc/bison.texinfo: Various formatting changes (alignments in
9273 samples, additional @group/@end group, GCS in samples.
9274 Use @deffn instead of simple @table to define the directives,
9275 macros, variables etc.
9276
92772002-11-13 Paul Eggert <eggert@twinsun.com>
9278
9279 Fix some bugs reported by Albert Chin-A-Young in
9280 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
9281
9282 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
9283 -o c"; the HP C compiler chatters during compilation.
9284 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
9285 * tests/headers.at (export YYLTYPE): Likewise.
9286
9287 * tests/input.at (Torturing the Scanner): Remove lines containing
9288 solitary backslashes, as they tickle a bug in the HP C compiler.
9289
9290 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
9291 comments, since they're not portable. Use GNU coding style.
9292
92932002-11-13 Akim Demaille <akim@epita.fr>
9294
9295 * data/yacc.c: Leave bigger chunks of quoted text.
9296 (YYDSYMPRINTF): New.
9297 Use it to report symbol activities.
9298 * data/glr.c (YYDSYMPRINTF): New.
9299 Use it.
9300
93012002-11-12 Paul Eggert <eggert@twinsun.com>
9302
9303 Version 1.75b.
9304
9305 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
9306 (yyglrReduce): Return yyok, not 0.
9307 This should avoid the enumerated-type warnings reported
9308 by Nelson H. F. Beebe in
9309 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
9310
9311 * lib/bbitset.h (BITSET_INLINE): Remove.
9312 * lib/bitset.h [! BITSET_INLINE]: Remove.
9313 (bitset_set, bitset_reset, bitset_test): Rename local vars
9314 to avoid shadowing warnings by GCC.
9315
9316 * data/glr.c (inline): Remove #define. It's the user's
9317 responsibility to #define it away, just like 'const'.
9318 This fixes one of the bugs reported by Nelson H. F. Beebe in
9319 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
9320
9321 * Makefile.maint (po-check): Scan .l and .y files instead of the
9322 .c and the .h files that they generate. This fixes the bug
9323 reported by Tim Van Holder in:
9324 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
9325 Look for N_ as well as for _. Try to avoid matching #define for
9326 N_ and _.
9327 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
9328 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
9329 * src/scan-gram.l: Revamp regular expressions so that " and '
9330 do not confuse xgettext.
9331
9332 * src/struniq.h (struniq_new): Do not declare the return type
9333 to be 'const'; this violates the C standard.
9334 * src/struniq.c (struniq_new): Likewise.
9335
93362002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
9337
9338 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
9339 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
9340 linker.
9341
93422002-11-12 Akim Demaille <akim@epita.fr>
9343
9344 * Makefile.maint: Sync with Autoconf:
9345 (local_updates): New.
9346
93472002-11-12 Akim Demaille <akim@epita.fr>
9348
9349 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
9350
93512002-11-12 Akim Demaille <akim@epita.fr>
9352
9353 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
9354 locations.
9355
93562002-11-12 Akim Demaille <akim@epita.fr>
9357
9358 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
9359 not yyvalue.
9360
93612002-11-12 Akim Demaille <akim@epita.fr>
9362
9363 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
9364 Use it to test the GLR parser.
9365
93662002-11-12 Akim Demaille <akim@epita.fr>
9367
9368 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
9369 defines it.
9370 * data/glr.c (yystos): New.
9371 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
9372 (YYDSYMPRINT): New.
9373 (yyval): Don't define it, it is handled via M4.
9374 (yyrecoverParseError): Free verbosely the discarded symbols.
9375 * data/yacc.c (yysymprint): Remove, rather...
9376 (b4_yysymprint_generate): invoke.
9377 * data/c.m4 (b4_yysymprint_generate): New.
9378 Accept pointers as arguments, as opposed to the version from
9379 yacc.c.
9380 (b4_yydestruct_generate): Likewise.
9381 * tests/cations.at (Printers and Destructors): Use Bison directives
9382 instead of CPP macros.
9383 Don't rely on internal details.
9384
93852002-11-12 Akim Demaille <akim@epita.fr>
9386
9387 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
9388 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
9389 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
9390 it against YYEMPTY and so forth), work on yytoken (i.e., set
9391 it to YYEMPTY etc.).
9392 (yydestruct): Replace with a b4_yydestruct_generate invocation.
9393 (b4_symbol_actions): Remove.
9394 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
9395 for 0, end-of-input.
9396
93972002-11-12 Akim Demaille <akim@epita.fr>
9398
9399 * doc/bison.texinfo (Destructor Decl): New.
9400
94012002-11-12 Akim Demaille <akim@epita.fr>
9402
9403 * src/tables.c (tables_generate): Use free for pointers that
9404 cannot be NULL, not XFREE.
9405 (pack_vector): Use assert, not fatal, for bound violations.
9406 * src/state.c (state_new): Likewise.
9407 * src/reader.c (reader): Likewise.
9408 * src/lalr.c (set_goto_map): Likewise.
9409 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
9410 the file name.
9411
94122002-11-12 Akim Demaille <akim@epita.fr>
9413
9414 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
9415 Restore.
9416 * src/scan-gram.l (last_string): Is global to the file, not to
9417 yylex.
9418 * src/parse-gram.y (input): Don't append the epilogue here,
9419 (epilogue.opt): do it here, and free the scanner's obstack.
9420 * src/reader.c (epilogue_set): Rename as...
9421 (epilogue_augment): this.
9422 * data/c.m4 (b4_epilogue): Defaults to empty.
9423
94242002-11-12 Akim Demaille <akim@epita.fr>
9425
9426 * src/getargs.c (long_options): Remove duplicates.
9427 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
9428 Remove.
9429 * doc/bison.rnh: Remove.
9430 * doc/bison.texinfo (VMS Invocation): Remove.
9431
94322002-11-12 Akim Demaille <akim@epita.fr>
9433
9434 * src/struniq.h, src/struniq.c (struniq_t): Is const.
9435 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
9436
9437 Use struniq for symbols.
9438
9439 * src/symtab.h (symbol_t): The tag member is a struniq.
9440 (symbol_type_set): Adjust.
9441 * src/symtab.c (symbol_new): Takes a struniq.
9442 (symbol_free): Don't free the tag member.
9443 (hash_compare_symbol_t, hash_symbol_t): Rename as...
9444 (hash_compare_symbol, hash_symbol): these.
9445 Use the fact that tags as struniqs.
9446 (symbol_get): Use struniq_new.
9447 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
9448 Returns a strniq.
9449 * src/reader.h (merger_list, grammar_currentmerge_set): The name
9450 and type members are struniqs.
9451 * src/reader.c (get_merge_function)
9452 (grammar_current_rule_merge_set): Adjust.
9453 (TYPE, current_type): Are struniq.
9454
9455 Use struniq for file names.
9456
9457 * src/files.h, src/files.c (infile): Split into...
9458 (grammar_file, current_file): these.
9459 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
9460 * src/reduce.c (reduce_print): Likewise.
9461 * src/getargs.c (getargs): Likewise.
9462 * src/complain.h, src/complain.c: Likewise.
9463 * src/main.c (main): Call struniqs_new early enough to use it for
9464 file names.
9465 Don't free the input file name.
9466
94672002-11-12 Akim Demaille <akim@epita.fr>
9468
9469 * src/symtab.c (symbol_free): Remove dead deactivated code:
9470 type_name are properly removed.
9471 Don't use XFREE to free items that cannot be NULL.
9472 * src/struniq.h, src/struniq.c: New.
9473 * src/main.c (main): Initialize/free struniqs.
9474 * src/parse-gram.y (%union): Add astruniq member.
9475 (yyprint): Adjust.
9476 * src/scan-gram.l (<{tag}>): Return a struniq.
9477 Free the obstack bit that used to store it.
9478 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
9479
94802002-11-11 Paul Eggert <eggert@twinsun.com>
9481
9482 Revamp to fix many (but not all) of the C- and M4-related quoting
9483 problems. Among other things, this fixes the Bison bug reported
9484 by Jan Hubicka when processing the Bash grammar; see:
9485 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
9486
9487 Use new @ escapes consistently. Represent brackets with @{ and @}
9488 rather than @<:@ and @:>@, since this works a bit better with dumb
9489 editors like vi. Represent @ with @@, since @ is now consistently
9490 an escape. Use @oline@ and @ofile@ rather than __oline__ and
9491 __ofile__, to avoid unexpected expansions. Similarly, use @output
9492 rather than #output.
9493
9494 * data/c.m4 (b4_copyright): Omit file name from comment, since
9495 the file name could contain "*/".
9496 (b4_synclines_flag): Don't quote the 2nd argument; it should already
9497 be quoted. All uses changed.
9498
9499 * data/glr.c: Use new @ escapes consistently.
9500 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
9501 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
9502 Remove, since they couldn't handle arbitrary characters in file
9503 names.
9504 * data/lalr1.cc: Likewise.
9505 * data/yacc.c: Likewise.
9506
9507 * src/files.c (output_infix): Remove; all uses removed.
9508 * src/files.h: Likewise.
9509
9510 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
9511 mishandled funny characters in file names, and anyway it isn't
9512 needed any more.
9513 * data/yacc.c: Likewise.
9514 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
9515
9516 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
9517 * data/yacc.c: Likewise.
9518
9519 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
9520 strings now.
9521 (muscle_init): Quote filename as a C string.
9522 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
9523 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
9524 * src/output.c (escaped_file_name_output): New function.
9525 (prepare_symbols): Quote tokens for M4.
9526 (prepare): Don't insert output_infix, output_prefix,
9527 output_parser_name, output_header_name; this is now down by scan-skel.
9528 Insert skeleton as a C string.
9529
9530 * src/output.c (user_actions_output, symbol_destructors_output,
9531 symbol_printers_output): Quote filenames for C and M4.
9532 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9533
9534 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
9535 escapes other than \\ and \'; this simplifies the code.
9536 (<SC_STRING>): Likewise, for \\ and \".
9537 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
9538 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
9539 Use new escapes @{ and @} for [ and ].
9540
9541 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
9542 them with auto vars.
9543 Switch to new escape scheme, where @ is the escape character uniformly.
9544 Abort if a stray escape character is found. Avoid unbounded input
9545 buffer when parsing non-escaped text.
9546
9547 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
9548 __oline__, #output, $@, and @{ do not have unintended meanings.
9549
95502002-11-09 Paul Eggert <eggert@twinsun.com>
9551
9552 Fix the test failure due to GCC warnings described in
9553 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
9554 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
9555 evaluate to 0 if it's impossible for NINF to be in the respective
9556 table.
9557 (yygetLRActions, yyrecoverParseError): Use them.
9558
9559 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
9560 counted in the token inserted at end of file. Now takes
9561 location_t *, not location_t, so that the location can be
9562 adjusted. All uses changed.
9563
9564 * tests/regression.at (Invalid inputs): Adjust wording in
9565 diagnostic to match the new behavior.
9566
9567 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
9568 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
9569 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
9570 abort ();'. This reduces the runtime of the "Many lookaheads"
9571 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
9572 GCC 3.2.
9573
95742002-11-07 Paul Eggert <eggert@twinsun.com>
9575
9576 * src/parse-gram.y (CHARACTER): Remove unused token.
9577 All uses removed.
9578
9579 * src/scan-gram.l: Remove stack option. We no longer use the
9580 stack, since the stack was never deeper than 1; instead, use the
9581 new auto var c_context to record the stacked value.
9582
9583 Remove nounput option. At an unexpected end of file, we now unput
9584 the minimal input necessary to end cleanly; this simplifies the
9585 code.
9586
9587 Avoid unbounded token sizes where this is easy.
9588
9589 (unexpected_end_of_file): New function.
9590 Use it to systematize the error message on unexpected EOF.
9591 (last-string): Now auto, not static.
9592 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
9593 (scanner_last_string_free): Remove; not used.
9594 (percent_percent_count): Move decl to just before use.
9595 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
9596 not the (never otherwised-used) CHARACTER.
9597
95982002-11-07 Akim Demaille <akim@epita.fr>
9599
9600 Let yyerror always receive the msg as last argument, so that
9601 yyerror can be variadic.
9602
9603 * data/yacc.c (b4_yyerror_args): New.
9604 Use it when calling yyerror.
9605 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
9606 Use it when calling yyerror.
9607 * doc/bison.texinfo (Error Reporting): Adjust.
9608 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
9609 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
9610
96112002-11-06 Akim Demaille <akim@epita.fr>
9612
9613 #line should have quoted strings.
9614 Ideally, this should be done by m4_quotearg.
9615
9616 * src/scan-skel.l: Include quotearg.h.
9617 Quote __ofile__.
9618 * src/output.c (symbol_printers_output)
9619 (symbol_destructors_output): Quote the file name.
9620
96212002-11-06 Akim Demaille <akim@epita.fr>
9622
9623 * tests/regression.at (Invalid inputs): Adjust to the recent
9624 messages.
9625
96262002-11-06 Akim Demaille <akim@epita.fr>
9627
9628 Restore --no-lines.
9629 Reported by Jim Kent.
9630
9631 * data/c.m4 (b4_syncline): New.
9632 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
9633 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
9634 * src/output.c (user_actions_output): Likewise.
9635 (prepare): Define 'b4_synclines_flag'.
9636 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
9637
96382002-11-06 Akim Demaille <akim@epita.fr>
9639
9640 * src/main.c (main): Free `infile'.
9641 * src/scan-gram.l (handle_syncline): New.
9642 Recognize `#line'.
9643 * src/output.c (user_actions_output, symbol_destructors_output)
9644 (symbol_printers_output): Use the location's file name, not
9645 infile.
9646 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9647
96482002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9649
9650 * src/tables.c (matching_state): Don't allow states to match if
9651 either has GLR conflict entries.
9652
96532002-11-05 Paul Eggert <eggert@twinsun.com>
9654
9655 * src/scan-gram.l: Use more accurate diagnostics, e.g.
9656 "integer out of range" rather than "invalid value".
9657 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
9658 accordingly.
9659
9660 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
9661 Also, remove one static variable in the scanner.
9662
9663 * src/scan-gram.l (braces_level): Now auto, not static.
9664 Initialize to zero if the compiler is being picky.
9665 (INITIAL): Clear braces_level instead of incrementing it.
9666 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
9667 as POSIX 1003.1-2001 requires.
9668 * src/system.h (IF_LINT): New macro, taken from coreutils.
9669 * configure.ac: Define "lint" if --enable-gcc-warnings.
9670
96712002-11-05 Akim Demaille <akim@epita.fr>
9672
9673 * src/scan-gram.l: When it starts with `%', complain about the
9674 whole directive, not just that `invalid character: %'.
9675
96762002-11-04 Akim Demaille <akim@epita.fr>
9677
9678 * Makefile.maint: Update from Autoconf.
9679 (update, cvs-update, po-update, do-po-update): New.
9680
96812002-11-04 Akim Demaille <akim@epita.fr>
9682
9683 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
9684 and yyerror.
9685 Have yyerror `use' its arguments.
9686 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
9687 returns true when location & yacc & pure & parse-param.
9688 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
9689
96902002-11-04 Akim Demaille <akim@epita.fr>
9691
9692 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
9693 clashes.
9694 * src/scan-gram.l: Use [\'] instead of ['] to pacify
9695 font-lock-mode.
9696 Use complain_at.
9697 Use quote, not quote_n since LOCATION_PRINT no longer uses the
9698 slot 0.
9699
97002002-11-03 Paul Eggert <eggert@twinsun.com>
9701
9702 * src/reader.c (get_merge_function, grammar_current_rule_check):
9703 Use consistent diagnostics for reporting type name clashes.
9704 Quote the types with <>, for consistency with Yacc.
9705 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
9706
97072002-11-03 Akim Demaille <akim@epita.fr>
9708
9709 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
9710 New.
9711 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
9712 (b4_parse_param): Remove.
9713 Use b4_identification.
9714 Propagate b4_pure_args where needed to pass them to yyerror.
9715 * data/glr.m4 (b4_parse_param): Remove.
9716 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
9717 (b4_lpure_formals): New.
9718 Use b4_identification.
9719 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
9720 b4_user_formals and b4_user_args.
9721 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
9722 (yyreportAmbiguity): When using a pure parser, also need
9723 the location, and the parse-params.
9724 Adjust callers.
9725 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
9726 When using a pure parser, also need the parse-params.
9727 Adjust callers.
9728 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
9729 (%pure-parser + %parse-param) LALR and GLR parsers.
9730 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
9731 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
9732 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
9733 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
9734 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
9735 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
9736 * doc/bison.texinfo: Untabify the whole file.
9737 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
9738 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
9739 (Error Reporting): Adjust to these new directives.
9740 Document %error-verbose, deprecate YYERROR_VERBOSE.
9741
97422002-11-03 Akim Demaille <akim@epita.fr>
9743
9744 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
9745 AT_CHECK_CALC_GLR invocations to use % directives, instead of
9746 command line options.
9747 * tests/cxx-type.at: Formatting changes.
9748
97492002-11-03 Paul Eggert <eggert@twinsun.com>
9750
9751 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
9752 to count columns correctly, and to check for invalid inputs.
9753
9754 Use mbsnwidth to count columns correctly. Account for tabs, too.
9755 Include mbswidth.h.
9756 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
9757 (extend_location): New function.
9758 (YY_LINES): Remove.
9759
9760 Handle CRLF in C code rather than in Lex code.
9761 (YY_INPUT): New macro.
9762 (no_cr_read): New function.
9763
9764 Scan UCNs, even though we don't fully handle them yet.
9765 (convert_ucn_to_byte): New function.
9766
9767 Handle backslash-newline correctly in C code.
9768 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
9769 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
9770 all uses changed.
9771 (tag, splice): New EREs. Do not allow NUL or newline in tags.
9772 Use {splice} wherever C allows backslash-newline.
9773 YY_STEP after space, newline, vertical-tab.
9774 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9775
9776 (letter, id): Don't assume ASCII; e.g., spell out a-z.
9777
9778 ({int}, handle_action_dollar, handle_action_at): Check for integer
9779 overflow.
9780
9781 (YY_STEP): Omit trailing semicolon, so that it's more like C.
9782
9783 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
9784 as well as \000. Check for UCHAR_MAX, not 255.
9785 Allow \x with an arbitrary positive number of digits, as in C.
9786 Check for overflow here.
9787 Allow \? and UCNs, for compatibility with C.
9788
9789 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
9790 with quote slot used by complain_at.
9791
9792 * tests/input.at: Add tests for backslash-newline, m4 quotes
9793 in symbols, long literals, and funny escapes in strings.
9794
9795 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
9796 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
9797 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
9798 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
9799 * m4/mbswidth.m4: New file, from GNU coreutils.
9800
9801 * doc/bison.texinfo (Grammar Outline): Document // comments.
9802 (Symbols): Document that trigraphs have no special meaning in Bison,
9803 nor is backslash-newline allowed.
9804 (Actions): Document that trigraphs have no special meaning.
9805
9806 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
9807 no longer used.
9808
98092002-11-02 Paul Eggert <eggert@twinsun.com>
9810
9811 * src/reader.c: Don't include quote.h; not needed.
9812 (get_merge_function): Reword warning to be consistent with
9813 type clash diagnostic in grammar_current_rule_check.
9814
9815 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
9816 bug in trigraph handling.
9817
9818 * src/output.c (prepare_symbols): When printing token names,
9819 escape "[" as "@<:@" and likewise for "]".
9820
9821 * src/system.h (errno): Remove declaration, as we are now
9822 assuming C89 or better, and C89 guarantees errno.
9823
98242002-10-30 Paul Eggert <eggert@twinsun.com>
9825
9826 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
9827 Check for close failures.
9828 * src/files.h (xfclose): Return void, not int, since it always
9829 returned zero.
9830 * src/files.c (xfclose): Likewise. Report I/O error if ferror
9831 indicates one.
9832 * src/output.c (output_skeleton): Use xfclose rather than fclose
9833 and ferror. xfclose now checks ferror.
9834
9835 * data/glr.c (YYLEFTMOST_STATE): Remove.
9836 (yyreportTree): Use a stack-based leftmost state. This avoids
9837 our continuing battles with bogus warnings about initializers.
9838
98392002-10-30 Akim Demaille <akim@epita.fr>
9840
9841 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
9842 #if.
9843
98442002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9845
9846 * tests/glr-regr1.at: New test for reported regressions.
9847 * tests/testsuite.at: Add glr-regr1.at test.
9848 * tests/Makefile.am: Add glr-regr1.at test.
9849
98502002-10-24 Paul Eggert <eggert@twinsun.com>
9851
9852 Version 1.75a.
9853
9854 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
9855 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
9856 we use malloc. Don't assume 'A' through 'Z' are contiguous.
9857 Don't assume strdup exists; POSIX says its an XSI extension.
9858 Check for buffer overflow on input.
9859
98602002-10-24 Akim Demaille <akim@epita.fr>
9861
9862 * src/output.c (output_skeleton): Don't disable M4sugar comments
9863 too soon: it results in comments being expanded.
9864 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
9865 first output.
9866
98672002-10-24 Akim Demaille <akim@epita.fr>
9868
9869 * data/yacc.c (m4_int_type): New.
9870 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
9871 char' as only yacc.c wants K&R portability.
9872 * data/glr.c (yysigned_char): Remove.
9873 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
9874 Reported by Quoc Peyrot.
9875
98762002-10-23 Paul Eggert <eggert@twinsun.com>
9877
9878 * src/main.c (main): With --trace=time, report times even if a
9879 non-fatal error occurs. Formerly, the times were reported in some
9880 such cases but not in others.
9881 * src/reader.c (reader): Just return if a complaint has been issued,
9882 instead of exiting, so that 'main' can report times.
9883
98842002-10-22 Akim Demaille <akim@epita.fr>
9885
9886 * src/system.h: Include sys/types.
9887 Reported by Bert Deknuydt.
9888
98892002-10-23 Paul Eggert <eggert@twinsun.com>
9890
9891 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
9892 Suggested by Art Haas.
9893
98942002-10-22 Paul Eggert <eggert@twinsun.com>
9895
9896 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
9897 decl; not needed any more.
9898 * src/main.c (main): Use return to exit, undoing yesterday's change.
9899 The last OS that we could find where this wouldn't work is
9900 SunOS 3.5, and that's too old to worry about now.
9901
9902 * data/glr.c (struct yyltype): Define members even when not
9903 doing locations. This is more consistent with yacc.c, and it
9904 works around the following bug reports:
9905 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
9906 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
9907
9908 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
9909 @acronym consistently. Standardize on "Yacc" instead of "YACC",
9910 "Algol" instead of "ALGOL". Give a bit more history about BNF.
9911
99122002-10-22 Akim Demaille <akim@epita.fr>
9913
9914 * data/README: New.
9915
99162002-10-21 Paul Eggert <eggert@twinsun.com>
9917
9918 Be consistent about 'bool'; the old code used an enum in one
9919 module and an int in another, and this violates the C standard.
9920 * m4/stdbool.m4: New file, from coreutils 4.5.3.
9921 * configure.ac (AC_HEADER_STDBOOL): Add.
9922 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
9923 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
9924 * src/symtab.c (hash_compare_symbol_t): Likewise.
9925 * src/system.h (bool, false, true): Use a definition consistent
9926 with ../lib/hash.c. All uses changed.
9927
9928 * src/complain.c (warning_issued): Renamed from warn_message_count,
9929 so that we needn't worry about integer overflow (!).
9930 Now of type bool. All uses changed.
9931 (complaint_issued): Renamed from complain_message_count; likewise.
9932
9933 * src/main.c (main): Use exit to exit with failure.
9934
9935 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
9936 rather than 1 and 0.
9937 * src/main.c (main): Likewise.
9938 * src/getargs.c (getargs): Likewise.
9939 * src/reader.c (reader): Likewise.
9940
9941 * src/getarg.c (getargs): Remove duplicate code for
9942 "Try `bison --help'".
9943
9944 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
9945 What was that "2" for?
9946
9947 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
9948 * src/getargs.c (usage): Likewise.
9949
9950 * src/getargs.c (getargs): When there are too few operands, report
9951 the last one. When there are too many, report the first extra
9952 one. This is how diffutils does it.
9953
99542002-10-20 Paul Eggert <eggert@twinsun.com>
9955
9956 Remove K&R vestiges.
9957 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
9958 * src/complain.c (VA_START): Remove. Assume prototypes.
9959 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
9960 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
9961 fatal): Assume prototypes.
9962 * src/complain.h: Assume prototypes.
9963 * src/system.h (PARAMS): Remove.
9964 Include <limits.h> unconditionally, since it's guaranteeed even
9965 for a freestanding C89 compiler.
9966 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
9967 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
9968
99692002-10-20 Akim Demaille <akim@epita.fr>
9970
9971 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
9972 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
9973 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
9974 (yyresolveStates, yyresolveAction, yyresolveStack)
9975 (yyprocessOneStack): Use them.
9976 (yy_reduce_print): New.
9977 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
9978
99792002-10-20 Akim Demaille <akim@epita.fr>
9980
9981 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
9982 arguments and output `void'.
9983 (b4_c_function): Rename as...
9984 (b4_c_function_def): this.
9985 (b4_c_function_decl, b4_c_ansi_function_def)
9986 (b4_c_ansi_function_decl): New.
9987 Change the interpretation of the arguments: before `int, foo', now
9988 `int foo, foo'.
9989 * data/yacc.c (yyparse): Prototype and define thanks to these.
9990 Adjust b4_c_function_def uses.
9991 * data/glr.c (yyparse): Likewise, but ANSI only.
9992
99932002-10-20 Akim Demaille <akim@epita.fr>
9994
9995 * src/output.c (prepare): Move the definition of `tokens_number',
9996 `nterms_number', `undef_token_number', `user_token_number_max'
9997 to...
9998 (prepare_tokens): Here.
9999 (prepare_tokens): Rename as...
10000 (prepare_symbols): this.
10001 (prepare): Move the definition of `rules_number' to...
10002 (prepare_rules): here.
10003 (prepare): Move the definition of `last', `final_state_number',
10004 `states_number' to...
10005 (prepare_states): here.
10006 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
10007
100082002-10-20 Akim Demaille <akim@epita.fr>
10009
10010 * src/tables.h, src/tables.c, src/output.c: Comment changes.
10011
100122002-10-20 Akim Demaille <akim@epita.fr>
10013
10014 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
10015 * data/c.m4: here.
10016
100172002-10-20 Akim Demaille <akim@epita.fr>
10018
10019 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
10020 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
10021 `pair'.
10022 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
10023 `name' to...
10024 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
10025 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
10026 These.
10027
100282002-10-19 Paul Eggert <eggert@twinsun.com>
10029
10030 Do not create a temporary file, as that involves security and
10031 cleanup headaches. Instead, use a pair of pipes.
10032 Derived from a suggestion by Florian Krohm.
10033 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
10034 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
10035 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
10036 (BISON_PREREQ_SUBPIPE): Add.
10037 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
10038 Add subpipe.h, subpipe.c.
10039 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
10040 * po/POTFILES.in: Add lib/subpipe.c.
10041 * src/output.c: Include "subpipe.h".
10042 (m4_invoke): Remove decl.
10043 (scan_skel): New decl.
10044 (output_skeleton): Use pipe rather than temporary file for m4 input.
10045 Check that m4sugar.m4 is readable, to avoid deadlock.
10046 Check for pipe I/O error.
10047 * src/scan-skel.l (readpipe): Remove decl.
10048 (scan_skel): New function, to be used in place of m4_invoke.
10049 Read from stream rather than file.
10050
10051 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
10052 float, as this generates a warning on Solaris 8 + GCC 3.2 with
10053 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
10054 this generates a more-accurate value anyway.
10055
10056 * lib/timevar.c (timervar_accumulate): Rename locals to
10057 avoid confusion with similarly-named more-global.
10058 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
10059
10060 * src/output.c (prepare): Use xstrdup to convert char const *
10061 to char *, to avoid GCC warning.
10062
100632002-10-19 Akim Demaille <akim@epita.fr>
10064
10065 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
10066 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
10067 Use them to have `calc.y' ready for %pure-parser.
10068 * data/yacc.c (YYLEX): Pass a yylex return type to
10069 b4_c_function_call.
10070
100712002-10-19 Akim Demaille <akim@epita.fr>
10072
10073 Prototype support of %lex-param and %parse-param.
10074
10075 * src/parse-gram.y: Add the definition of the %lex-param and
10076 %parse-param tokens, plus their rules.
10077 Drop the `_' version of %glr-parser.
10078 Add the "," token.
10079 * src/scan-gram.l (INITIAL): Scan them.
10080 * src/muscle_tab.c: Comment changes.
10081 (muscle_insert, muscle_find): Rename `pair' as `probe'.
10082 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
10083 (muscle_entry_s): The `value' member is no longer const.
10084 Adjust all dependencies.
10085 * src/muscle_tab.c (muscle_init): Adjust: use
10086 MUSCLE_INSERT_STRING.
10087 Initialize the obstack earlier.
10088 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
10089 (muscle_pair_list_grow): New.
10090 * data/c.m4 (b4_c_function_call, b4_c_args): New.
10091 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
10092 * tests/calc.at: Use %locations, not --locations.
10093 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
10094
100952002-10-19 Akim Demaille <akim@epita.fr>
10096
10097 * src/getargs.c (usage): Take status as argument and exit
10098 accordingly.
10099 Report the traditional `Try ... --help' message when status != 0.
10100 (usage, version): Don't take a FILE * as arg, it is pointless.
10101 (getargs): When there is an incorrect number of arguments, make it
10102 an error, and report it GNUlically thanks to `usage ()'.
10103
101042002-10-18 Paul Eggert <eggert@twinsun.com>
10105
10106 * data/glr.c (yyreportParseError): Don't assume that sprintf
10107 yields the length of the printed string, as this is not true
10108 on SunOS 4.1.4. Reported by Peter Klein.
10109
10110 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
10111 * tests/conflicts.at (%nonassoc and eof): Likewise.
10112 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
10113
101142002-10-17 Akim Demaille <akim@epita.fr>
10115
10116 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
10117 * src/getargs.c (trace_types, trace_args): Adjust.
10118 * src/reader.c (grammar_current_rule_prec_set)
10119 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
10120 Standardize error messages.
10121 And s/@prec/%prec/!
10122 (reader): Use trace_flag to enable scanner/parser debugging,
10123 instead of an adhoc scheme.
10124 * src/scan-gram.l: Remove trailing debugging code.
10125
101262002-10-16 Paul Eggert <eggert@twinsun.com>
10127
10128 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
10129 MUSCLE_TAB_H.
10130
10131 * NEWS: Officially drop support for building Bison with K&R C,
10132 since it didn't work anyway and it's not worth worrying about.
10133 * Makefile.maint (wget_files): Remove ansi2knr.c.
10134 (ansi2knr.c-url_prefix): Remove.
10135 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
10136 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10137 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10138
101392002-10-15 Paul Eggert <eggert@twinsun.com>
10140
10141 Stop using the "enum_" trick for K&R-style function definitions;
10142 it confused me, and I was the author! Instead, assume that people
10143 who want to use K&R C compilers (when using these modules in GCC,
10144 perhaps?) will run ansi2knr.
10145
10146 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
10147 All uses of "enum_" changed to "enum ".
10148 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10149 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10150
10151 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
10152 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
10153 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
10154 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
10155 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
10156 abitset_not, abitset_ones, abitset_or, abitset_or_and,
10157 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
10158 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
10159 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
10160 Use function prototypes; this removes the need for declaring
10161 static functions simply to provide their prototypes.
10162 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
10163 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
10164 bitset_count_, bitset_create, bitset_dump, bitset_first,
10165 bitset_free, bitset_init, bitset_last, bitset_next,
10166 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
10167 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
10168 bitset_print, bitset_release_memory, bitset_toggle_,
10169 bitset_type_choose, bitset_type_get, bitset_type_name_get,
10170 debug_bitset): Likewise.
10171 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
10172 * lib/bitset_stats.c (bitset_log_histogram_print,
10173 bitset_percent_histogram_print, bitset_stats_and,
10174 bitset_stats_and_cmp, bitset_stats_and_or,
10175 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
10176 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
10177 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
10178 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
10179 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
10180 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
10181 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
10182 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
10183 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
10184 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
10185 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
10186 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
10187 bitset_stats_zero): Likewise.
10188 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10189 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10190 bitsetv_dump, debug_bitsetv): Likewise.
10191 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
10192 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
10193 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
10194 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
10195 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
10196 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
10197 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
10198 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
10199 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
10200 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
10201 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
10202 Likewise.
10203 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
10204 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
10205 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
10206 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
10207 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
10208 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
10209 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
10210 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
10211 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
10212 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
10213 lbitset_xor_cmp, lbitset_zero): Likewise.
10214
102152002-10-14 Akim Demaille <akim@epita.fr>
10216
10217 Version 1.75.
10218
102192002-10-14 Akim Demaille <akim@epita.fr>
10220
10221 * tests/Makefile.am (maintainer-check-posix): New.
10222
102232002-10-14 Akim Demaille <akim@epita.fr>
10224
10225 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
10226 member.
10227
102282002-10-14 Akim Demaille <akim@epita.fr>
10229
10230 * src/tables.c (table_ninf_remap): base -> tab.
10231 Reported by Matt Rosing.
10232
102332002-10-14 Paul Eggert <eggert@twinsun.com>
10234
10235 * tests/action.at, tests/calc.at, tests/conflicts.at,
10236 tests/cxx-type.at, tests/headers.at, tests/input.at,
10237 tests/regression.at, tests/synclines.at, tests/torture.at:
10238 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
10239 so that the tests still work even if POSIXLY_CORRECT is set.
10240 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
10241
10242 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
10243 for portability to K&R hosts. Fix typo: signed char is guaranteed
10244 only to 127, not to 128.
10245 * data/glr.c (yysigned_char): New type.
10246 * data/yacc.c (yysigned_char): Likewise.
10247 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
10248
102492002-10-13 Paul Eggert <eggert@twinsun.com>
10250
10251 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
10252 true due to limited range of data type" warning from GCC.
10253
10254 * data/c.m4 (b4_token_defines): Protect against double-inclusion
10255 by wrapping enum yytokentype's definition inside #ifndef
10256 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
10257
102582002-10-13 Akim Demaille <akim@epita.fr>
10259
10260 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
10261 Un yy- yyrhs to avoid the name clash with the global YYRHS.
10262
102632002-10-13 Akim Demaille <akim@epita.fr>
10264
10265 * Makefile.maint: Update from Autoconf 2.54.
10266 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
10267
102682002-10-13 Akim Demaille <akim@epita.fr>
10269
10270 * src/print.c (print_state): Separate the list of solved conflicts
10271 from the other items.
10272 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
10273
102742002-10-13 Akim Demaille <akim@epita.fr>
10275
10276 Let nondeterministic skeletons be usable with deterministic
10277 tables.
10278
10279 With the patch, GAWK compiled by GCC without -O2 passes its test
10280 suite using a GLR parser driven by LALR tables. It fails with -O2
10281 because `struct stat' gives two different answers on my machine:
10282 88 (definition of an auto var) and later 96 (memset on this var).
10283 Hence the stack is badly corrumpted. The headers inclusion is to
10284 blame: if I move the awk.h inclusion before GLR's system header
10285 inclusion, the two struct stat have the same size.
10286
10287 * src/tables.c (pack_table): Always create conflict_table.
10288 (token_actions): Always create conflict_list.
10289 * data/glr.c (YYFLAG): Remove, unused.
10290
102912002-10-13 Akim Demaille <akim@epita.fr>
10292
10293 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
10294 (O0FLAGS): New.
10295 (VALGRIND, GXX): New.
10296 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
10297 * tests/bison.in: Run $PREBISON a pre-command.
10298 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
10299 (maintainer-check-g++): New.
10300 * Makefile.am (maintainer-check): New.
10301
103022002-10-13 Akim Demaille <akim@epita.fr>
10303
10304 * data/glr.c: Formatting changes.
10305 Tweak some trace messages to match yacc.c's.
10306
103072002-10-13 Akim Demaille <akim@epita.fr>
10308
10309 GLR parsers sometimes raise parse errors instead of performing the
10310 default reduction.
10311 Reported by Charles-Henry de Boysson.
10312
10313 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
10314 check the length of the traces when %glr.
10315 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
10316 GLR's traces.
10317 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
10318 Test GLR parsers.
10319 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
10320 (yyltype): Remove the yy prefix from the member names.
10321 (yytable): Complete its comment.
10322 (yygetLRActions): Map error action number from YYTABLE from
10323 YYTABLE_NINF to 0.
10324 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
10325 (which was a bug: it should have been YYTABEL_NINF, and yet it was
10326 not satisfying as we could compare an YYACTION computed from
10327 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
10328 only value for error actions.
10329 (yyreportParseError): In verbose parse error messages, don't issue
10330 `error' in the list of expected tokens.
10331 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
10332 next action to perform to match glr.c's decoding.
10333 (yytable): Complete its comment.
10334
103352002-10-13 Paul Eggert <eggert@twinsun.com>
10336
10337 Fix problem reported by Henrik Grubbstroem in
10338 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
10339 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
10340 because the Bison parser reads the second action before reducing
10341 the first one.
10342 * src/scan-gram.l (rule_length): New static var.
10343 Use it to keep track of the rule length in the scanner, since
10344 we can't expect the parser to be in lock-step sync with the scanner.
10345 (handle_action_dollar, handle_action_at): Use this var.
10346 * tests/actions.at (Exotic Dollars): Test for the problem.
10347
103482002-10-12 Paul Eggert <eggert@twinsun.com>
10349
10350 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
10351 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
10352 Include <sys/time.h> when checking for clock_t and struct tms.
10353 Use same include order as source.
10354 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
10355 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
10356
10357 * lib/timevar.c: Update copyright date and clarify comments.
10358 (get_time) [IN_GCC]: Keep the GCC version for reference.
10359
10360 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
10361 GCC version as of today, then merge Bison's changes.
10362 Change "GCC" to "Bison" in copyright notice. timevar.def's
10363 author is Akim, so change that too.
10364
10365 * src/reader.c (grammar_current_rule_check):
10366 Don't worry about the default action if $$ is untyped.
10367 Prevents bogus warnings reported by Jim Gifford in
10368 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
10369
10370 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
10371 * data/glr.c, data/lalr1.cc, data/yacc.c:
10372 Output token definitions before the first part of user declarations.
10373 Fixes compatibility problem reported by Jim Gifford for kbd in
10374 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
10375
103762002-10-11 Paul Eggert <eggert@twinsun.com>
10377
10378 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
10379 (yyparse): here. This undoes some of the 2002-07-25 change.
10380 Compatibility problem reported by Ralf S. Engelschall with
10381 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
10382
103832002-10-11 Akim Demaille <akim@epita.fr>
10384
10385 * tests/regression.at Characters Escapes): New.
10386 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
10387 characters.
10388 Reported by Jan Nieuwenhuizen.
10389
103902002-10-11 Akim Demaille <akim@epita.fr>
10391
10392 * po/id.po: New.
10393
103942002-10-10 Paul Eggert <eggert@twinsun.com>
10395
10396 Portability fixes for bitsets; this also avoids several GCC
10397 warnings.
10398
10399 * lib/abitset.c: Include <stddef.h>, for offsetof.
10400 * lib/lbitset.c: Likewise.
10401
10402 * lib/abitset.c (abitset_bytes): Return a size that is aligned
10403 properly for vectors of objects. Do not assume that adding a
10404 header size to a multiple of a word size yields a value that is
10405 properly aligned for the whole union.
10406 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10407
10408 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
10409 unique names for structures.
10410 * lib/ebitset.c (ebitset_bytes): Likewise.
10411 * lib/lbitset.c (lbitset_bytes): Likewise.
10412
10413 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
10414 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
10415 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
10416 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
10417 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
10418 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
10419 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
10420 to improve the type-checking that GCC can do.
10421 * lib/bitset.c (bitset_op4_cmp): Likewise.
10422 * lib/bitset_stats.c (bitset_stats_count,
10423 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
10424 bitset_stats_copy, bitset_stats_disjoint_p,
10425 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
10426 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
10427 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
10428 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
10429 bitset_stats_and_or_cmp, bitset_stats_andn_or,
10430 bitset_stats_andn_or_cmp, bitset_stats_or_and,
10431 bitset_stats_or_and_cmp): Likewise.
10432 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
10433 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
10434 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
10435 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
10436
10437 * lib/abitset.h: Include bitset.h, not bbitset.h.
10438 * lib/ebitset.h: Likewise.
10439 * lib/lbitset.h: Likewise.
10440
10441 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
10442 All instances of parameters of type enum bitset_opts are now of
10443 type enum_bitset_opts, to conform to the C Standard, and similarly
10444 for enum_bitset_type.
10445 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10446 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10447
10448 Do not use "struct bitset_struct" to mean different things in
10449 different modules. Not only is this confusing, it violates
10450 the C Standard, which requires that structure types in different
10451 modules must be compatible if one is to be passed to the other.
10452 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
10453 All instances of "struct bitset_struct *" replaced with "bitset".
10454 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
10455 (union bitset_union, struct abitset_struct, struct ebitset_struct,
10456 struct lbitset_struct, struct bitset_stats_struct): New types.
10457 All uses of struct bitset_struct changed to union bitset_union,
10458 etc.
10459 * lib/abitset.c (struct abitset_struct, abitset,
10460 struct bitset_struct): Remove.
10461 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
10462 struct bitset_struct): Remove.
10463 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
10464 bitset_struct): Remove.
10465 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
10466 Likewise.
10467
10468 Do not call a function of type T using a call that assumes the
10469 function is of a different type U. Standard C requires that a
10470 function must be called with a type that is compatible with its
10471 definition.
10472 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10473 New decls.
10474 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10475 New functions.
10476 * lib/ebitset.c (PFV): Remove.
10477 * lib/lbitset.c (PFV): Likewise.
10478 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
10479 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
10480 decls.
10481 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
10482 (ebitset_vtable): Use them.
10483 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
10484 lbitset_xor): New functions.
10485 (lbitset_vtable): Use them.
10486
10487 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
10488 Declare.
10489
10490 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
10491 GCC warning.
10492 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
10493 Use offsetof, for simplicity.
10494
104952002-10-06 Paul Eggert <eggert@twinsun.com>
10496
10497 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
10498 the same width as int. This reapplies a hunk of the 2002-08-12 patch
10499 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
10500 which was inadvertently undone by the 2002-09-30 patch.
10501 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
10502 the same width as int.
10503
105042002-10-04 Paul Eggert <eggert@twinsun.com>
10505
10506 Version 1.50.
10507
10508 * configure.ac (AC_INIT), NEWS: Increment version number.
10509
10510 * doc/bison.texinfo: Minor spelling, grammar, and white space
10511 fixes.
10512 (Symbols): Mention that any negative value returned from yylex
10513 signifies end-of-input. Warn about negative chars. Mention
10514 the portable Standard C character set.
10515
10516 The GNU coding standard says CFLAGS and YFLAGS are reserved
10517 for the installer to set.
10518 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
10519 * src/Makefile.am (AM_CFLAGS): Likewise.
10520 (AM_YFLAGS): Renamed from YFLAGS.
10521
10522 Fix some MAX and MIN problems.
10523 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
10524 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
10525 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
10526 * src/reader.c (reader): Use it.
10527
10528 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
10529 POSIX 1003.1-2001 has removed fgrep.
10530
105312002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
10532
10533 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
10534 interpreted as signed.
10535 * lib/ebitset.c (ebitset_list): Fix bug.
10536
105372002-10-01 Paul Eggert <eggert@twinsun.com>
10538
10539 More fixes for 64-bit hosts and large bitsets.
10540
10541 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
10542 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
10543 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
10544 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
10545 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
10546 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
10547 bitset_count_): Likewise.
10548 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
10549 bitset_first, bitset_last): Likewise.
10550 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
10551 bitset_stats_list_reverse, bitset_stats_size,
10552 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
10553 Likewise.
10554 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10555 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10556 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10557 bitsetv_reflexive_transitive_closure): Likewise.
10558 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
10559 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
10560 Likewise.
10561 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
10562 Likewise.
10563
10564 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
10565 Use size_t, not unsigned int, to count bytes.
10566 * lib/abitset.h (abitset_bytes): Likewise.
10567 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
10568 Likewise.
10569 * lib/bitset.h (bitset_bytes): Likewise.
10570 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
10571 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
10572 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10573 * lib/ebitset.c (ebitset_bytes): Likewise.
10574 * lib/ebitset.h (ebitset_bytes): Likewise.
10575 * lib/lbitset.c (lbitset_bytes): Likewise.
10576 * lib/lbitset.h (lbitset_bytes): Likewise.
10577
10578 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
10579 abitset_subset_p, abitset_disjoint_p, abitset_and,
10580 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
10581 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
10582 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
10583 abitset_or_and, abitset_or_and_cmp):
10584 Use bitset_windex instead of unsigned int.
10585 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10586 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
10587 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
10588 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
10589 Likewise.
10590 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
10591
10592 * lib/bitset.c (bitset_print):
10593 Use proper printf formats for widths of integer types.
10594 * lib/bitset_stats.c (bitset_percent_histogram_print,
10595 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
10596 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10597 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10598 * lib/lbitset.c (lbitset_bytes): Likewise.
10599
10600 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
10601 BITSET_SIZE_MAX): New macros.
10602 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
10603 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
10604 to BITSET_WINDEX_MAX.
10605
10606 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
10607 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
10608 since we now return the bitset_bindex type (not int).
10609
10610 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
10611 when computing sizes.
10612 * lib/ebitset.c (ebitset_elts_grow): Likewise.
10613
10614 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
10615 and avoid cast to unsigned.
10616
106172002-09-30 Akim Demaille <akim@epita.fr>
10618
10619 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10620 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
10621 Updates from Michael Hayes.
10622
106232002-09-30 Art Haas <ahaas@neosoft.com>
10624
10625 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
10626 invocations.
10627 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
10628 defined.
10629
106302002-09-27 Akim Demaille <akim@epita.fr>
10631
10632 Version 1.49c.
10633
106342002-09-27 Akim Demaille <akim@epita.fr>
10635
10636 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
10637 (Because of AC_LIBSOURCE).
10638
106392002-09-27 Akim Demaille <akim@epita.fr>
10640
10641 Playing with Autoscan.
10642
10643 * configure.ac: Remove the old LIBOBJ tweaks.
10644 (AC_REPLACE_FUNCS): Add strrchr and strtol.
10645 * lib/strrchr.c: New.
10646 * lib/strtol.c: New, from the Coreutils 4.5.1.
10647
106482002-09-27 Akim Demaille <akim@epita.fr>
10649
10650 Playing with Autoscan.
10651
10652 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
10653 * lib/Makefile.am (libbison_a_SOURCES): No longer include
10654 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
10655 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
10656 Coreutils 4.5.1.
10657
106582002-09-24 Akim Demaille <akim@epita.fr>
10659
10660 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
10661 (Frequently Asked Questions, Parser Stack Overflow): New.
10662
106632002-09-13 Akim Demaille <akim@epita.fr>
10664
10665 Playing with autoscan.
10666
10667 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
10668 * src/files.c (skeleton_find): Remove, unused.
10669 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
10670 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
10671
106722002-09-13 Akim Demaille <akim@epita.fr>
10673
10674 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
10675 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
10676
106772002-09-13 Akim Demaille <akim@epita.fr>
10678
10679 * configure.ac: Require 2.54.
10680 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
10681 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
10682 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
10683 Remove, provided by Autoconf macros.
10684
106852002-09-12 Akim Demaille <akim@epita.fr>
10686
10687 * m4/prereq.m4: Update, from Coreutils 4.5.1.
10688
106892002-09-12 Akim Demaille <akim@epita.fr>
10690
10691 * m4/prereq.m4: Update, from Fileutils 4.1.5.
10692 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
10693 Reported by Martin Mokrejs.
10694
106952002-09-10 Akim Demaille <akim@epita.fr>
10696
10697 * src/parse-gram.y: Associate a human readable string to each
10698 token type.
10699 * tests/regression.at (Invalid inputs): Adjust.
10700
107012002-09-10 Gary V. Vaughan <gary@gnu.org>
10702
10703 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
10704 with an Autoconf-2.5x style configure.ac.
10705
107062002-09-06 Paul Eggert <eggert@twinsun.com>
10707
10708 * doc/bison.texinfo (Conditions): Make explicit that the GPL
10709 exception applies only to yacc.c. This is a modification of a
10710 patch originally suggested by Akim Demaille.
10711
107122002-09-06 Akim Demaille <akim@epita.fr>
10713
10714 * data/c.m4 (b4_copyright): Move the GPL exception comment from
10715 here to...
10716 * data/yacc.c: here.
10717
10718 * data/lalr1.cc (struct yyltype): Don't define it, since we use
10719 LocationType.
10720 (b4_ltype): Default to yy::Location from location.hh.
10721
107222002-09-04 Jim Meyering <jim@meyering.net>
10723
10724 * data/yacc.c: Guard the declaration of yytoknum also with
10725 `#ifdef YYPRINT', so it is declared only when used.
10726
107272002-09-04 Akim Demaille <akim@epita.fr>
10728
10729 * configure.in: Rename as...
10730 * configure.ac: this.
10731 Bump to 1.49c.
10732
107332002-09-04 Akim Demaille <akim@epita.fr>
10734
10735 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
10736 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
10737 translate maintainer only messages.
10738
107392002-08-12 Paul Eggert <eggert@twinsun.com>
10740
10741 Version 1.49b.
10742
10743 * Makefile.am (SUBDIRS): Remove intl.
10744 (DISTCLEANFILES): Remove.
10745 * NEWS: Mention that GNU M4 is now required. Clarify what is
10746 meant by "larger grammars". Mention the pt_BR translation.
10747 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
10748 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
10749 Bump version from 0.11.2 to 0.11.5.
10750 (BISON_PREREQ_STAGE): Remove.
10751 (AM_GNU_GETTEXT): Use external gettext.
10752 (AC_OUTPUT): Remove intl/Makefile.
10753
10754 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
10755
10756 * data/glr.c: Include string.h, for strlen.
10757 (yyreportParseError): Use size_t for yysize.
10758 (yy_yypstack): No longer nested inside yypstates, as nested
10759 functions are not portable. Do not assume size_t is the
10760 same width as int.
10761 (yypstates): Do not assume that ptrdiff_t is the same width
10762 as int, and similarly for yyposn and YYINDEX.
10763
10764 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
10765
10766 * lib/Makefile.am (INCLUDES): Do not include from the intl
10767 directory, which has been removed.
10768 * src/Makefile.am (INCLUDES): Likewise.
10769
10770 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
10771 (bitsets_sources, additional_bitsets_sources, timevars_sources):
10772 New vars.
10773
10774 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
10775 * tests/Makefile.am (EXTRA_DIST): Likewise.
10776
10777 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
10778 Do not assume that bitset_windex is the same width as unsigned.
10779
10780 * lib/abitset.c (abitset_unused_clear): Do not assume that
10781 bitset_word is the same width as int.
10782 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
10783 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
10784 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
10785 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
10786 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
10787
10788 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
10789 portability to one's complement hosts!).
10790 * lib/ebitset.c (ebitset_op1): Likewise.
10791 * lib/lbitset.c (lbitset_op1): Likewise.
10792
10793 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
10794 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10795 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
10796 Sync with fileutils.
10797 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
10798 lib/gettext.h: Sync with diffutils.
10799
10800 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
10801 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
10802
10803 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
10804 PROTOTYPES to check for prototypes, and "defined __STDC__" to
10805 check for void *.
10806
10807 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
10808 size_t; the old version tried to do this but casted improperly.
10809 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
10810 (bitset_test): Now returns int, not unsigned long.
10811
10812 * lib/bitset_stats.c: Include "gettext.h".
10813 (_): New macro.
10814 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
10815 name locals "index", as it generates unnecessary warnings on some
10816 hosts that have an "index" function.
10817
10818 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
10819 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
10820 they need translation.
10821 * src/LR0.c (state_list_append, new_itemsets, get_state,
10822 append_states, generate_states): Likewise.
10823 * src/assoc.c (assoc_to_string): Likewise.
10824 * src/closure.c (print_closure, set_firsts, closure): Likewise.
10825 * src/gram.c (grammar_dump): Likewise.
10826 * src/injections.c (injections_compute): Likewise.
10827 * src/lalr.c (lookaheads_print): Likewise.
10828 * src/relation.c (relation_transpose): Likewise.
10829 * src/scan-gram.l: Likewise.
10830 * src/tables.c (table_grow, pack_vector): Likewise.
10831
10832 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
10833 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
10834 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
10835 * m4/mbstate_t.m4: Sync with fileutils.
10836 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
10837
10838 * po/LINGUAS: Add pt_BR.
10839 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
10840 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
10841 lib/timevar.c.
10842 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
10843 manual recommends.
10844 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
10845
10846 * src/complain.c (strerror_r): Remove decl; not needed.
10847 (strerror): Use same pattern as ../lib/error.c.
10848
10849 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
10850
10851 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
10852
10853 * src/main.c (main): Cast result of bindtextdomain and textdomain
10854 to void, to avoid a GCC warning when --disable-nls is in effect.
10855
10856 * src/scan-gram.l: Use strings rather than escapes when possible,
10857 to minimize the number of warnings from xgettext.
10858 (handle_action_dollar, handle_action_at): Don't use isdigit,
10859 as it mishandles negative chars and it may not work as expected
10860 outside the C locale.
10861
10862 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
10863 this is a GCC extension and is not portable to other compilers.
10864
10865 * src/system.h (alloca): Use same pattern as ../lib/error.c.
10866 Do not include <ctype.h>; no longer needed.
10867 Do not include <malloc.h>; no longer needed (and generates
10868 warnings on OpenBSD 3.0).
10869
10870 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
10871 it's not portable.
10872
10873 * tests/regression.at: Do not use 'cc -c input.c -o input';
10874 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
10875
10876 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
10877 exit status as failure, not just exit status 1. Sun C exits
10878 with status 2 sometimes.
10879
10880 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
10881 Use it for the two large tests.
10882
108832002-08-02 Akim Demaille <akim@epita.fr>
10884
10885 * src/conflicts.c (conflicts_output): Don't output rules never
10886 reduced here, since anyway that computation doesn't work.
10887 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
10888 (rule_useless_p, rule_never_reduced_p): New.
10889 (grammar_rules_partial_print): Use a filter instead of a range.
10890 Display the title only if needed.
10891 (grammar_rules_print): Adjust.
10892 (grammar_rules_never_reduced_report): New.
10893 * src/tables.c (action_row): Move the computation of rules never
10894 reduced to...
10895 (token_actions): here.
10896 * src/main.c (main): Make the parser before making the report, so
10897 that rules never reduced are computed.
10898 Call grammar_rules_never_reduced_report.
10899 * src/print.c (print_results): Report rules never reduced.
10900 * tests/conflicts.at, tests/reduce.at: Adjust.
10901
109022002-08-01 Akim Demaille <akim@epita.fr>
10903
10904 Instead of attaching lookaheads and duplicating the rules being
10905 reduced by a state, attach the lookaheads to the reductions.
10906
10907 * src/state.h (state_t): Remove the `lookaheads',
10908 `lookaheads_rule' member.
10909 (reductions_t): Add a `lookaheads' member.
10910 Use a regular array for the `rules'.
10911 * src/state.c (reductions_new): Initialize the lookaheads member
10912 to 0.
10913 (state_rule_lookaheads_print): Adjust.
10914 * src/state.h, src/state.c (state_reductions_find): New.
10915 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
10916 (count_rr_conflicts): Adjust.
10917 * src/lalr.c (LArule): Remove.
10918 (add_lookback_edge): Adjust.
10919 (state_lookaheads_count): New.
10920 (states_lookaheads_initialize): Merge into...
10921 (initialize_LA): this.
10922 (lalr_free): Adjust.
10923 * src/main.c (main): Don't free nullable and derives too early: it
10924 is used by --verbose.
10925 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
10926
109272002-08-01 Akim Demaille <akim@epita.fr>
10928
10929 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
10930 `rule_number_t**'.
10931 (set_derives, free_derives): Rename as...
10932 (derives_compute, derives_free): this.
10933 Adjust all dependencies.
10934 * src/nullable.c (set_nullable, free_nullable): Rename as...
10935 (nullable_compute, nullable_free): these.
10936 (rule_list_t): Store rule_t *, not rule_number_t.
10937 * src/state.c (state_rule_lookaheads_print): Directly compare rule
10938 pointers, instead of their numbers.
10939 * src/main.c (main): Call nullable_free, and derives_free earlier,
10940 as they were lo longer used.
10941
109422002-08-01 Akim Demaille <akim@epita.fr>
10943
10944 * lib/timevar.c (get_time): Include children time.
10945 * src/lalr.h (LA, LArule): Don't export them: used with the
10946 state_t.
10947 * src/lalr.c (LA, LArule): Static.
10948 * src/lalr.h, src/lalr.c (lalr_free): New.
10949 * src/main.c (main): Call it.
10950 * src/tables.c (pack_vector): Check whether loc is >= to the
10951 table_size, not >.
10952 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
10953 (tables_generate): do it, since that's also it which allocates
10954 them.
10955 Don't free LA and LArule, main does.
10956
109572002-07-31 Akim Demaille <akim@epita.fr>
10958
10959 Separate parser tables computation and output.
10960
10961 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
10962 (conflict_list, conflict_list_cnt, table, check, table_ninf)
10963 (yydefgoto, yydefact, high): Move to...
10964 * src/tables.h, src/tables.c: here.
10965 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10966 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10967 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
10968 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
10969 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
10970 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
10971 (action_row, save_row, token_actions, save_column, default_goto)
10972 (goto_actions, sort_actions, matching_state, pack_vector)
10973 (table_ninf_remap, pack_table, prepare_actions): Move to...
10974 * src/tables.c: here.
10975 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
10976 * src/output.c (token_actions, output_base, output_conflicts)
10977 (output_check): Merge into...
10978 (prepare_actions): this.
10979 (actions_output): Rename as...
10980 (user_actions_output): this.
10981 * src/main.c (main): Call tables_generate and tables_free.
10982
109832002-07-31 Akim Demaille <akim@epita.fr>
10984
10985 Steal GCC's --time-report support.
10986
10987 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
10988 stolen/adjusted from GCC.
10989 * m4/stage.m4: Remove time related checks.
10990 * m4/timevar.m4: New.
10991 * configure.in: Adjust.
10992 * src/system.h: Adjust to using timevar.h.
10993 * src/getargs.h, src/getargs.c: Support trace_time for
10994 --trace=time.
10995 * src/main.c (stage): Remove.
10996 (main): Replace `stage' invocations with timevar calls.
10997 * src/output.c: Insert pertinent timevar calls.
10998
109992002-07-31 Akim Demaille <akim@epita.fr>
11000
11001 Let --trace have arguments.
11002
11003 * src/getargs.h (enum trace_e): New.
11004 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
11005 (long_options, short_options): --trace/-T takes an optional
11006 argument.
11007 Change all the uses of trace_flag to reflect the new flags.
11008 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
11009
11010 Strengthen `stage' portability.
11011
11012 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
11013 * configure.in: Use it.
11014 Don't check for malloc.h and sys/times.h.
11015 * src/system.h: Include them when appropriate.
11016 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
11017 times and struct tms are available.
11018
110192002-07-30 Akim Demaille <akim@epita.fr>
11020
11021 In verbose parse error message, don't report `error' as an
11022 expected token.
11023 * tests/actions.at (Printers and Destructors): Adjust.
11024 * tests/calc.at (Calculator $1): Adjust.
11025 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
11026 error message, do not report the parser accepts the error token in
11027 that state.
11028
110292002-07-30 Akim Demaille <akim@epita.fr>
11030
11031 Normalize conflict related messages.
11032
11033 * src/complain.h, src/complain.c (warn, complain): New.
11034 * src/conflicts.c (conflicts_print): Use them.
11035 (conflict_report_yacc): New, extracted from...
11036 (conflicts_print): here.
11037 * tests/conflicts.at, tests/existing.at: Adjust.
11038
110392002-07-30 Akim Demaille <akim@epita.fr>
11040
11041 Report rules which are never reduced by the parser: those hidden
11042 by conflicts.
11043
11044 * src/LR0.c (save_reductions): Don't make the final state too
11045 different: save its reduction (accept) instead of having a state
11046 without any action (no shift or goto, no reduce).
11047 Note: the final state is now a ``regular'' state, i.e., the
11048 parsers now contain `reduce 0' as default reduction.
11049 Nevertheless, since they decide to `accept' when yystate =
11050 final_state, they still will not reduce rule 0.
11051 * src/print.c (print_actions, print_reduction): Adjust.
11052 * src/output.c (action_row): Track reduced rules.
11053 (token_actions): Report rules never reduced.
11054 * tests/conflicts.at, tests/regression.at: Adjust.
11055
110562002-07-30 Akim Demaille <akim@epita.fr>
11057
11058 `stage' was accidently included in a previous patch.
11059 Initiate its autoconfiscation.
11060
11061 * configure.in: Look for malloc.h and sys/times.h.
11062 * src/main.c (stage): Adjust.
11063 Report only when trace_flag.
11064
110652002-07-29 Akim Demaille <akim@epita.fr>
11066
11067 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
11068 state_number_t.
11069 (errs_t): symbol_t*, not symbol_number_t.
11070 (reductions_t): rule_t*, not rule_number_t.
11071 (FOR_EACH_SHIFT): New.
11072 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
11073 * src/print.c, src/print_graph.c: Adjust.
11074
110752002-07-29 Akim Demaille <akim@epita.fr>
11076
11077 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
11078
11079 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
11080 (endtoken, accept): these.
11081 * src/reader.c (reader): Set endtoken's default tag to "$end".
11082 Set undeftoken's tag to "$undefined" instead of "$undefined.".
11083 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
11084 Adjust.
11085
110862002-07-29 Akim Demaille <akim@epita.fr>
11087
11088 * src/reduce.c (reduce_grammar): When the language is empty,
11089 complain about the start symbol, not the axiom.
11090 Use its location.
11091 * tests/reduce.at (Empty Language): New.
11092
110932002-07-26 Akim Demaille <akim@epita.fr>
11094
11095 * src/reader.h, src/reader.c (gram_error): ... can't get
11096 yycontrol without making too strong assumptions on the parser
11097 itself.
11098 * src/output.c (prepare_tokens): Use the real 0th value of
11099 token_translations instead of `0'.
11100 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
11101 visible here.
11102 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
11103 for the time being: %locations ought to provide it to yyerror.
11104
111052002-07-25 Akim Demaille <akim@epita.fr>
11106
11107 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
11108 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
11109 * tests/regression.at (Web2c Actions): Adjust.
11110
111112002-07-25 Akim Demaille <akim@epita.fr>
11112
11113 Stop storing rules from 1 to nrules + 1.
11114
11115 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
11116 * src/nullable.c, src/output.c, src/print.c, src/reader.c
11117 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
11118 Iterate from 0 to nrules.
11119 Use rule_number_as_item_number and item_number_as_rule_number.
11120 Adjust to `derive' now containing possibly 0.
11121 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
11122 Handle the `- 1' part in rule numbers from/to item numbers.
11123 * src/conflicts.c (log_resolution): Fix the message which reversed
11124 shift and reduce.
11125 * src/output.c (action_row): Initialize default_rule to -1.
11126 (token_actions): Adjust.
11127 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
11128 expected output.
11129 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
11130
111312002-07-25 Akim Demaille <akim@epita.fr>
11132
11133 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
11134 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
11135 (b4_c_knr_arg_decl): New.
11136 * data/yacc.c: Use it to define yysymprint, yydestruct, and
11137 yyreport_parse_error.
11138
111392002-07-25 Akim Demaille <akim@epita.fr>
11140
11141 * data/yacc.c (yyreport_parse_error): New, extracted from...
11142 (yyparse): here.
11143 (yydestruct, yysymprint): Move above yyparse.
11144 Be K&R compliant.
11145
111462002-07-25 Akim Demaille <akim@epita.fr>
11147
11148 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
11149 replace...
11150 (b4_sint_type, b4_uint_type): these.
11151 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
11152 * tests/regression.at (Web2c Actions): Adjust.
11153
111542002-07-25 Akim Demaille <akim@epita.fr>
11155
11156 * src/gram.h (TIEM_NUMBER_MAX): New.
11157 (item_number_of_rule_number, rule_number_of_item_number): Rename
11158 as...
11159 (rule_number_as_item_number, item_number_as_rule_number): these.
11160 Adjust dependencies.
11161 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11162 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11163 (symbol_number_to_vector_number): New.
11164 (order): Of vector_number_t* type.
11165 (base_t, BASE_MAX, BASE_MIN): New.
11166 (froms, tos, width, pos, check): Of base_t type.
11167 (action_number_t, ACTION_MIN, ACTION_MAX): New.
11168 (actrow): Of action_number_t type.
11169 (conflrow): Of unsigned int type.
11170 (table_ninf, base_ninf): New.
11171 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
11172 (muscle_insert_int_table, muscle_insert_base_table)
11173 (muscle_insert_rule_number_table): New.
11174 (prepare_tokens): Output `toknum' as int_table.
11175 (action_row): Returns a rule_number_t.
11176 Use ACTION_MIN, not SHRT_MIN.
11177 (token_actions): yydefact is rule_number_t*.
11178 (table_ninf_remap): New.
11179 (pack_table): Use it for `base' and `table'.
11180 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
11181 replaced with...
11182 (YYPACT_NINF, YYTABLE_NINF): these.
11183 (yypact, yytable): Compute their types instead of hard-coded
11184 `short'.
11185 * tests/regression.at (Web2c Actions): Adjust.
11186
111872002-07-19 Akim Demaille <akim@epita.fr>
11188
11189 * src/scan-gram.l (id): Can start with an underscore.
11190
111912002-07-16 Akim Demaille <akim@epita.fr>
11192
11193 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
11194 Adjust all former `associativity' dependencies.
11195 * src/symtab.c (symbol_new): Default associativity is `undef', not
11196 `right'.
11197 (symbol_check_alias_consistence): Adjust.
11198
111992002-07-09 Akim Demaille <akim@epita.fr>
11200
11201 * doc/bison.texinfo: Properly set the ``header'' part.
11202 Use @dircategory ``GNU programming tools'' as per Texinfo's
11203 documentation.
11204 Use @copying.
11205
112062002-07-09 Akim Demaille <akim@epita.fr>
11207
11208 * lib/quotearg.h: Protect against multiple inclusions.
11209 * src/location.h (location_t): Add a `file' member.
11210 (LOCATION_RESET, LOCATION_PRINT): Adjust.
11211 * src/complain.c (warn_at, complain_at, fatal_at): Drop
11212 `error_one_per_line' support.
11213
112142002-07-09 Akim Demaille <akim@epita.fr>
11215
11216 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
11217 * src/reader.c (lineno): Remove.
11218 Adjust all dependencies.
11219 (get_merge_function): Take a location and use complain_at.
11220 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
11221 * tests/regression.at (Invalid inputs, Mixing %token styles):
11222 Adjust.
11223
112242002-07-09 Akim Demaille <akim@epita.fr>
11225
11226 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
11227 recovery rule, and forbid extensions when --yacc.
11228 (gram_error): Use complain_at.
11229 * src/reader.c (reader): Exit if there were parse errors.
11230
112312002-07-09 Akim Demaille <akim@epita.fr>
11232
11233 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
11234 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
11235 Reported by R Blake <blakers@mac.com>.
11236
112372002-07-09 Akim Demaille <akim@epita.fr>
11238
11239 * data/yacc.c: Output the copyright notive in the header.
11240
112412002-07-03 Akim Demaille <akim@epita.fr>
11242
11243 * src/output.c (froms, tos): Are state_number_t.
11244 (save_column): sp, sp1, and sp2 are state_number_t.
11245 (prepare): Rename `final' as `final_state_number', `nnts' as
11246 `nterms_number', `nrules' as `rules_number', `nstates' as
11247 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
11248 unused.
11249 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
11250 * data/lalr1.cc (nsym_): Remove, unused.
11251
112522002-07-03 Akim Demaille <akim@epita.fr>
11253
11254 * src/lalr.h, src/lalr.c (goto_number_t): New.
11255 * src/lalr.c (goto_list_t): New.
11256 Propagate them.
11257 * src/nullable.c (rule_list_t): New.
11258 Propagate.
11259 * src/types.h: Remove.
11260
112612002-07-03 Akim Demaille <akim@epita.fr>
11262
11263 * src/closure.c (print_fderives): Use rule_rhs_print.
11264 * src/derives.c (print_derives): Use rule_rhs_print.
11265 (rule_list_t): New, replaces `shorts'.
11266 (set_derives): Add comments.
11267 * tests/sets.at (Nullable, Firsts): Adjust.
11268
112692002-07-03 Akim Demaille <akim@epita.fr>
11270
11271 * src/output.c (prepare_actions): Free `tally' and `width'.
11272 (prepare_actions): Allocate and free `order'.
11273 * src/symtab.c (symbols_free): Free `symbols'.
11274 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
11275 * src/output.c (m4_invoke): Move to...
11276 * src/scan-skel.l: here.
11277 (<<EOF>>): Close yyout, and free its name.
11278
112792002-07-03 Akim Demaille <akim@epita.fr>
11280
11281 Fix some memory leaks, and fix a bug: state 0 was examined twice.
11282
11283 * src/LR0.c (new_state): Merge into...
11284 (state_list_append): this.
11285 (new_states): Merge into...
11286 (generate_states): here.
11287 (set_states): Don't ensure a proper `errs' state member here, do it...
11288 * src/conflicts.c (conflicts_solve): here.
11289 * src/state.h, src/state.c: Comment changes.
11290 (state_t): Rename member `shifts' as `transitions'.
11291 Adjust all dependencies.
11292 (errs_new): For consistency, also take the values as argument.
11293 (errs_dup): Remove.
11294 (state_errs_set): New.
11295 (state_reductions_set, state_transitions_set): Assert that no
11296 previous value was assigned.
11297 (state_free): New.
11298 (states_free): Use it.
11299 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
11300 temporary storage: use `errs' and `nerrs' as elsewhere.
11301 (set_conflicts): Allocate and free this `errs'.
11302
113032002-07-02 Akim Demaille <akim@epita.fr>
11304
11305 * lib/libiberty.h: New.
11306 * lib: Update the bitset implementation from upstream.
11307 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
11308 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
11309 * src/main.c: Adjust bitset stats calls.
11310
113112002-07-01 Paul Eggert <eggert@twinsun.com>
11312
11313 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
11314 char, so that negative chars don't collide with $.
11315
113162002-06-30 Akim Demaille <akim@epita.fr>
11317
11318 Have the GLR tests be `warning' checked, and fix the warnings.
11319
11320 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
11321 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
11322 (yyremoveDeletes): `yyi' and `yyj' are size_t.
11323 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
11324 (yyaddDeferredAction): static.
11325 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
11326 (yyreportParseError): yyprefix is const.
11327 yytokenp is used only when verbose.
11328 (yy__GNUC__): Replace with __GNUC__.
11329 (yypdumpstack): yyi is size_t.
11330 (yypreference): Un-yy local variables and arguments, to avoid
11331 clashes with `yyr1'. Anyway, we are not in the user name space.
11332 (yytname_size): be an int, as is compared with ints.
11333 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
11334 Use them.
11335 * tests/cxx-gram.at: Use quotation to protect $1.
11336 Use AT_COMPILE to enable warnings hunts.
11337 Prototype yylex and yyerror.
11338 `Use' argc.
11339 Include `string.h', not `strings.h'.
11340 Produce and prototype stmtMerge only when used.
11341 yylex takes a location.
11342
113432002-06-30 Akim Demaille <akim@epita.fr>
11344
11345 We spend a lot of time in quotearg, in particular when --verbose.
11346
11347 * src/symtab.c (symbol_get): Store a quoted version of the key.
11348 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
11349 Adjust all callers.
11350
113512002-06-30 Akim Demaille <akim@epita.fr>
11352
11353 * src/state.h (reductions_t): Rename member `nreds' as num.
11354 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
11355 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
11356
113572002-06-30 Akim Demaille <akim@epita.fr>
11358
11359 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
11360 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
11361 (shifts_to): Rename as...
11362 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
11363 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
11364 (TRANSITION_IS_DISABLED, transitions_to): these.
11365
113662002-06-30 Akim Demaille <akim@epita.fr>
11367
11368 * src/print.c (print_shifts, print_gotos): Merge into...
11369 (print_transitions): this.
11370 (print_transitions, print_errs, print_reductions): Align the
11371 lookaheads columns.
11372 (print_core, print_transitions, print_errs, print_state,
11373 print_grammar): Output empty lines separator before, not after.
11374 (state_default_rule_compute): Rename as...
11375 (state_default_rule): this.
11376 * tests/conflicts.at (Defaulted Conflicted Reduction),
11377 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
11378 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
11379
113802002-06-30 Akim Demaille <akim@epita.fr>
11381
11382 Display items as we display rules.
11383
11384 * src/gram.h, src/gram.c (rule_lhs_print): New.
11385 * src/gram.c (grammar_rules_partial_print): Use it.
11386 * src/print.c (print_core): Likewise.
11387 * tests/conflicts.at (Defaulted Conflicted Reduction),
11388 (Unresolved SR Conflicts): Adjust.
11389 (Unresolved SR Conflicts): Adjust and rename as...
11390 (Resolved SR Conflicts): this, as was meant.
11391 * tests/regression.at (Web2c Report): Adjust.
11392
113932002-06-30 Akim Demaille <akim@epita.fr>
11394
11395 * src/print.c (state_default_rule_compute): New, extracted from...
11396 (print_reductions): here.
11397 Pessimize, but clarify the code.
11398 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
11399
114002002-06-30 Akim Demaille <akim@epita.fr>
11401
11402 * src/output.c (action_row): Let default_rule be always a rule
11403 number.
11404
114052002-06-30 Akim Demaille <akim@epita.fr>
11406
11407 * src/closure.c (print_firsts, print_fderives, closure):
11408 Use BITSET_EXECUTE.
11409 * src/lalr.c (lookaheads_print): Likewise.
11410 * src/state.c (state_rule_lookaheads_print): Likewise.
11411 * src/print_graph.c (print_core): Likewise.
11412 * src/print.c (print_reductions): Likewise.
11413 * src/output.c (action_row): Likewise.
11414 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
11415
114162002-06-30 Akim Demaille <akim@epita.fr>
11417
11418 * src/print_graph.c: Use report_flag.
11419
114202002-06-30 Akim Demaille <akim@epita.fr>
11421
11422 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
11423 to...
11424 * src/relation.h, src/relation.c (traverse, relation_digraph)
11425 (relation_print, relation_transpose): New.
11426
114272002-06-30 Akim Demaille <akim@epita.fr>
11428
11429 * src/state.h, src/state.c (shifts_to): New.
11430 * src/lalr.c (build_relations): Use it.
11431
114322002-06-30 Akim Demaille <akim@epita.fr>
11433
11434 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
11435 (item_number_of_rule_number, rule_number_of_item_number): New.
11436 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
11437 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
11438 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
11439 Propagate their use.
11440 Much remains to be done, in particular wrt `shorts' from types.h.
11441
114422002-06-30 Akim Demaille <akim@epita.fr>
11443
11444 * src/symtab.c (symbol_new): Initialize the `printer' member.
11445
114462002-06-30 Akim Demaille <akim@epita.fr>
11447
11448 * src/LR0.c (save_reductions): Remove, replaced by...
11449 * src/state.h, src/state.c (state_reductions_set): New.
11450 (reductions, errs): Rename as...
11451 (reductions_t, errs_t): these.
11452 Adjust all dependencies.
11453
114542002-06-30 Akim Demaille <akim@epita.fr>
11455
11456 * src/LR0.c (state_list_t, state_list_append): New.
11457 (first_state, last_state): Now symbol_list_t.
11458 (this_state): Remove.
11459 (new_itemsets, append_states, save_reductions): Take a state_t as
11460 argument.
11461 (set_states, generate_states): Adjust.
11462 (save_shifts): Remove, replaced by...
11463 * src/state.h, src/state.c (state_shifts_set): New.
11464 (shifts): Rename as...
11465 (shifts_t): this.
11466 Adjust all dependencies.
11467 * src/state.h (state_t): Remove the `next' member.
11468
114692002-06-30 Akim Demaille <akim@epita.fr>
11470
11471 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
11472 escaped in slot 0.
11473
114742002-06-30 Akim Demaille <akim@epita.fr>
11475
11476 Use hash.h for the state hash table.
11477
11478 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
11479 (allocate_storage): Use state_hash_new.
11480 (free_storage): Use state_hash_free.
11481 (new_state, get_state): Adjust.
11482 * src/lalr.h, src/lalr.c (states): Move to...
11483 * src/states.h (state_t): Remove the `link' member, no longer
11484 used.
11485 * src/states.h, src/states.c: here.
11486 (state_hash_new, state_hash_free, state_hash_lookup)
11487 (state_hash_insert, states_free): New.
11488 * src/states.c (state_table, state_compare, state_hash): New.
11489 * src/output.c (output_actions): Do not free states now, since we
11490 still need to know the final_state number in `prepare', called
11491 afterwards. Do it...
11492 * src/main.c (main): here: call states_free after `output'.
11493
114942002-06-30 Akim Demaille <akim@epita.fr>
11495
11496 * src/state.h, src/state.c (state_new): New, extracted from...
11497 * src/LR0.c (new_state): here.
11498 * src/state.h (STATE_ALLOC): Move to...
11499 * src/state.c: here.
11500 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
11501 * src/state.h, src/state.c: here.
11502
115032002-06-30 Akim Demaille <akim@epita.fr>
11504
11505 * src/reader.c (gensym): Rename as...
11506 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
11507 (getsym): Rename as...
11508 (symbol_get): this.
11509
115102002-06-30 Akim Demaille <akim@epita.fr>
11511
11512 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
11513 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
11514 * src/output.c, src/print.c, src/print_graph.c: Propagate.
11515 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
11516
115172002-06-30 Akim Demaille <akim@epita.fr>
11518
11519 Make the test suite pass with warnings checked.
11520
11521 * tests/actions.at (Printers and Destructors): Improve.
11522 Avoid unsigned vs. signed issues.
11523 * tests/calc.at: Don't exercise the scanner here, do it...
11524 * tests/input.at (Torturing the Scanner): here.
11525
115262002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11527
11528 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
11529 reorganize first lines parallel to yacc.c.
11530
115312002-06-28 Akim Demaille <akim@epita.fr>
11532
11533 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
11534 (b4_token_enum, b4_token_defines): New, factored from...
11535 * data/lalr1.cc, data/yacc.c, glr.c: here.
11536
115372002-06-28 Akim Demaille <akim@epita.fr>
11538
11539 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
11540 unused variables.
11541 * src/output.c (merger_output): static.
11542
115432002-06-28 Akim Demaille <akim@epita.fr>
11544
11545 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
11546 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
11547 pacify GCC.
11548 * src/output.c (save_row): Initialize all the variables to pacify GCC.
11549
115502002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11551
11552 Accumulated changelog for new GLR parsing features.
11553
11554 * src/conflicts.c (count_total_conflicts): Change name to
11555 conflicts_total_count.
11556 * src/conflicts.h: Ditto.
11557 * src/output.c (token_actions): Use the new name.
11558 (output_conflicts): Change conflp => conflict_list_heads, and
11559 confl => conflict_list for better readability.
11560 * data/glr.c: Use the new names.
11561 * NEWS: Add self to GLR announcement.
11562
11563 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
11564
11565 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
11566 Akim Demaille.
11567
11568 * data/bison.glr: Change name to glr.c
11569 * data/glr.c: Renamed from bison.glr.
11570 * data/Makefile.am: Add glr.c
11571
11572 * src/getargs.c:
11573
11574 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
11575 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
11576
11577 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11578
11579 * data/bison.glr: Be sure to restore the
11580 current #line when returning to the skeleton contents after having
11581 exposed the input file's #line.
11582
11583 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11584
11585 * data/bison.glr: Bring up to date with changes to bison.simple.
11586
11587 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11588
11589 * data/bison.glr: Correct definitions that use b4_prefix.
11590 Various reformatting.
11591 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
11592 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
11593 yytokenp argument; now part of stack.
11594 (yychar): Define to behave as documented.
11595 (yyclearin): Ditto.
11596
11597 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11598
11599 * src/reader.h: Add declaration for free_merger_functions.
11600
11601 * src/reader.c (merge_functions): New variable.
11602 (get_merge_function): New function.
11603 (free_merger_functions): New function.
11604 (readgram): Check for %prec that is not followed by a symbol.
11605 Handle %dprec and %merge declarations.
11606 (packgram): Initialize dprec and merger fields in rules array.
11607
11608 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
11609 conflict_list_cnt, conflict_list_free): New variables.
11610 (table_grow): Also grow conflict_table.
11611 (prepare_rules): Output dprec and merger tables.
11612 (conflict_row): New function.
11613 (action_row): Output conflict lists for GLR parser. Don't use
11614 default reduction in conflicted states for GLR parser so that there
11615 are spaces for the conflict lists.
11616 (save_row): Also save conflict information.
11617 (token_actions): Allocate conflict list.
11618 (merger_output): New function.
11619 (pack_vector): Pack conflict table, too.
11620 (output_conflicts): New function to output yyconflp and yyconfl.
11621 (output_check): Allocate conflict_tos.
11622 (output_actions): Output conflict tables, also.
11623 (output_skeleton): Output b4_mergers definition.
11624 (prepare): Output b4_max_rhs_length definition.
11625 Use 'bison.glr' as default skeleton for GLR parsers.
11626
11627 * src/gram.c (glr_parser): New flag.
11628 (grammar_free): Call free_merger_functions.
11629
11630 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
11631 all pairs of conflicting reductions, rather than just all tokens
11632 causing conflicts. Needed to size conflict tables.
11633 (conflicts_output): Modify call to count_rr_conflicts for new
11634 interface.
11635 (conflicts_print): Ditto.
11636 (count_total_conflicts): New function.
11637
11638 * src/reader.h (merger_list): New type.
11639 (merge_functions): New variable.
11640
11641 * src/lex.h (tok_dprec, tok_merge): New token types.
11642
11643 * src/gram.h (rule_s): Add dprec and merger fields.
11644 (glr_parser): New flag.
11645
11646 * src/conflicts.h (count_total_conflicts): New function.
11647
11648 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
11649
11650 * doc/bison.texinfo (Generalized LR Parsing): New section.
11651 (GLR Parsers): New section.
11652 (Language and Grammar): Mention GLR parsing.
11653 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
11654 Correct typo ("tge" -> "the").
11655
11656 * data/bison.glr: New skeleton for GLR parsing.
11657
11658 * tests/cxx-gram.at: New tests for GLR parsing.
11659
11660 * tests/testsuite.at: Include cxx-gram.at.
11661
11662 * tests/Makefile.am: Add cxx-gram.at.
11663
11664 * src/parse-gram.y:
11665
11666 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
11667
11668 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
11669
116702002-06-27 Akim Demaille <akim@epita.fr>
11671
11672 * src/options.h, src/options.c: Remove.
11673 * src/getargs.c (short_options, long_options): New.
11674
116752002-06-27 Akim Demaille <akim@epita.fr>
11676
11677 * data/bison.simple, data/bison.c++: Rename as...
11678 * data/yacc.c, data/lalr1.cc: these.
11679 * doc/bison.texinfo (Environment Variables): Remove.
11680
116812002-06-25 Raja R Harinath <harinath@cs.umn.edu>
11682
11683 * src/getargs.c (report_argmatch): Initialize strtok().
11684
116852002-06-20 Akim Demaille <akim@epita.fr>
11686
11687 * data/bison.simple (b4_symbol_actions): New, replaces...
11688 (b4_symbol_destructor, b4_symbol_printer): these.
11689 (yysymprint): Be sure to call YYPRINT only for tokens, and using
11690 user token numbers.
11691
116922002-06-20 Akim Demaille <akim@epita.fr>
11693
11694 * data/bison.simple (yydestructor): Rename as...
11695 (yydestruct): this.
11696
116972002-06-20 Akim Demaille <akim@epita.fr>
11698
11699 * src/symtab.h, src/symtab.c (symbol_type_set)
11700 (symbol_destructor_set, symbol_precedence_set): The location is
11701 the last argument.
11702 Adjust all callers.
11703
117042002-06-20 Akim Demaille <akim@epita.fr>
11705
11706 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
11707 internals.
11708 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
11709 Takes a location.
11710 * src/symtab.h, src/symtab.c (symbol_class_set)
11711 (symbol_user_token_number_set): Likewise.
11712 Adjust all callers.
11713 Promote complain_at.
11714 * tests/input.at (Type Clashes): Adjust.
11715
117162002-06-20 Akim Demaille <akim@epita.fr>
11717
11718 * data/bison.simple (YYLEX): Fix the declaration when
11719 %pure-parser.
11720
117212002-06-20 Akim Demaille <akim@epita.fr>
11722
11723 * data/bison.simple (yysymprint): Don't print the token number,
11724 just its name.
11725 * tests/actions.at (Destructors): Rename as...
11726 (Printers and Destructors): this.
11727 Also exercise %printer.
11728
117292002-06-20 Akim Demaille <akim@epita.fr>
11730
11731 * data/bison.simple (YYDSYMPRINT): New.
11732 Use it to remove many of the #if YYDEBUG/if (yydebug).
11733
117342002-06-20 Akim Demaille <akim@epita.fr>
11735
11736 * src/symtab.h, src/symtab.c (symbol_t): printer and
11737 printer_location are new members.
11738 (symbol_printer_set): New.
11739 * src/parse-gram.y (PERCENT_PRINTER): New token.
11740 Handle its associated rule.
11741 * src/scan-gram.l: Adjust.
11742 (handle_destructor_at, handle_destructor_dollar): Rename as...
11743 (handle_symbol_code_at, handle_symbol_code_dollar): these.
11744 * src/output.c (symbol_printers_output): New.
11745 (output_skeleton): Call it.
11746 * data/bison.simple (yysymprint): New. Cannot be named yyprint
11747 since there are already many grammar files with a user `yyprint'.
11748 Replace the calls to YYPRINT to calls to yysymprint.
11749 * tests/calc.at: Adjust.
11750 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
11751 taking advantage of parser very internal details (stack size!).
11752
117532002-06-20 Akim Demaille <akim@epita.fr>
11754
11755 * src/scan-gram.l: Complete the scanner with the missing patterns
11756 to pacify Flex.
11757 Use `quote' and `symbol_tag_get' where appropriate.
11758
117592002-06-19 Akim Demaille <akim@epita.fr>
11760
11761 * tests/actions.at (Destructors): Augment to test locations.
11762 * data/bison.simple (yydestructor): Pass it the current location
11763 if locations are enabled.
11764 Prototype only when __STDC__ or C++.
11765 Change the argument names to move into the yy name space: there is
11766 user code here.
11767
117682002-06-19 Akim Demaille <akim@epita.fr>
11769
11770 * data/bison.simple (b4_pure_if): New.
11771 Use it instead of #ifdef YYPURE.
11772
117732002-06-19 Akim Demaille <akim@epita.fr>
11774
11775 * data/bison.simple (b4_location_if): New.
11776 Use it instead of #ifdef YYLSP_NEEDED.
11777
117782002-06-19 Akim Demaille <akim@epita.fr>
11779
11780 Prepare @$ in %destructor, but currently don't bind it in the
11781 skeleton, as %location use is not cleaned up yet.
11782
11783 * src/scan-gram.l (handle_dollar, handle_destructor_at)
11784 (handle_action_at): New.
11785 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
11786 a braced_code_t and a location as additional arguments.
11787 (handle_destructor_dollar): Instead of requiring `b4_eval', just
11788 unquote one when outputting `b4_dollar_dollar'.
11789 Adjust callers.
11790 * data/bison.simple (b4_eval): Remove.
11791 (b4_symbol_destructor): Adjust.
11792 * tests/input.at (Invalid @n): Adjust.
11793
117942002-06-19 Zack Weinberg <zack@codesourcery.com>
11795
11796 * doc/bison.texinfo: Document ability to have multiple
11797 prologue sections.
11798
117992002-06-18 Akim Demaille <akim@epita.fr>
11800
11801 * src/files.c (compute_base_names): When computing the output file
11802 names from the input file name, strip the directory part.
11803
118042002-06-18 Akim Demaille <akim@epita.fr>
11805
11806 * data/bison.simple.new: Comment changes.
11807 Reported by Andreas Schwab.
11808
118092002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
11810
11811 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
11812 there are no `label `yyoverflowlab' defined but not used' warnings
11813 when yyoverflow is defined.
11814
118152002-06-18 Akim Demaille <akim@epita.fr>
11816
11817 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
11818 new member.
11819 (symbol_destructor_set): Adjust.
11820 * src/output.c (symbol_destructors_output): Output the destructor
11821 locations.
11822 Output the symbol name.
11823 * data/bison.simple (b4_symbol_destructor): Adjust.
11824
118252002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
11826 and Akim Demaille <akim@epita.fr>
11827
11828 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
11829 what's left on the stack when the error recovery hits EOF.
11830 * tests/actions.at (Destructors): Complete to exercise this case.
11831
118322002-06-17 Akim Demaille <akim@epita.fr>
11833
11834 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
11835 arguments is really empty, not only equal to `[]'.
11836 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
11837 member.
11838 (symbol_destructor_set): New.
11839 * src/output.c (symbol_destructors_output): New.
11840 * src/reader.h (brace_code_t, current_braced_code): New.
11841 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
11842 (handle_dollar): Rename as...
11843 (handle_action_dollar): this.
11844 (handle_destructor_dollar): New.
11845 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
11846 (grammar_declaration): Use it.
11847 * data/bison.simple (yystos): Is always defined.
11848 (yydestructor): New.
11849 * tests/actions.at (Destructors): New.
11850 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
11851
118522002-06-17 Akim Demaille <akim@epita.fr>
11853
11854 * src/symlist.h, src/symlist.c (symbol_list_length): New.
11855 * src/scan-gram.l (handle_dollar, handle_at): Compute the
11856 rule_length only when needed.
11857 * src/output.c (actions_output, token_definitions_output): Output
11858 the full M4 block.
11859 * src/symtab.c: Don't access directly to the symbol tag, use
11860 symbol_tag_get.
11861 * src/parse-gram.y: Use symbol_list_free.
11862
118632002-06-17 Akim Demaille <akim@epita.fr>
11864
11865 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
11866 (symbol_list_prepend, get_type_name): Move to...
11867 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
11868 (symbol_list_prepend, symbol_list_n_type_name_get): here.
11869 Adjust all callers.
11870 (symbol_list_free): New.
11871 * src/scan-gram.l (handle_dollar): Takes a location.
11872 * tests/input.at (Invalid $n): Adjust.
11873
118742002-06-17 Akim Demaille <akim@epita.fr>
11875
11876 * src/reader.h, src/reader.c (symbol_list_new): Export it.
11877 (symbol_list_prepend): New.
11878 * src/parse-gram.y (%union): `list' is a new member.
11879 (symbols.1): New, replaces...
11880 (terms_to_prec.1, nterms_to_type.1): these.
11881 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
11882 Take a location as additional argument.
11883 Adjust all callers.
11884
118852002-06-15 Akim Demaille <akim@epita.fr>
11886
11887 * src/parse-gram.y: Move %token in the declaration section so that
11888 we don't depend upon CVS Bison.
11889
118902002-06-15 Akim Demaille <akim@epita.fr>
11891
11892 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
11893 * src/print.c (print_core): Use it.
11894
118952002-06-15 Akim Demaille <akim@epita.fr>
11896
11897 * src/conflicts.c (log_resolution): Accept the rule involved in
11898 the sr conflicts instead of the lookahead number that points to
11899 that rule.
11900 (flush_reduce): Accept the current lookahead vector as argument,
11901 instead of the index in LA.
11902 (resolve_sr_conflict): Accept the current number of lookahead
11903 bitset to consider for the STATE, instead of the index in LA.
11904 (set_conflicts): Adjust.
11905 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
11906
119072002-06-15 Akim Demaille <akim@epita.fr>
11908
11909 * src/state.h (state_t): Replace the `lookaheadsp' member, a
11910 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
11911 Adjust all dependencies.
11912 * src/lalr.c (initialize_lookaheads): Split into...
11913 (states_lookaheads_count, states_lookaheads_initialize): these.
11914 (lalr): Adjust.
11915
119162002-06-15 Akim Demaille <akim@epita.fr>
11917
11918 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
11919 out of...
11920 (grammar_rules_print): here.
11921 * src/reduce.c (reduce_output): Use it.
11922 * tests/reduce.at (Useless Rules, Reduced Automaton)
11923 (Underivable Rules): Adjust.
11924
119252002-06-15 Akim Demaille <akim@epita.fr>
11926
11927 Copy BYacc's nice way to report the grammar.
11928
11929 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
11930 New.
11931 Don't print the rules' location, it is confusing and useless.
11932 (rule_print): Use grammar_rhs_print.
11933 * src/print.c (print_grammar): Use grammar_rules_print.
11934
119352002-06-15 Akim Demaille <akim@epita.fr>
11936
11937 Complete and rationalize `useless thing' warnings.
11938
11939 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
11940 (symbol_tag_print): New.
11941 Use them everywhere in place of accessing directly the tag member.
11942 * src/gram.h, src/gram.c (rule_print): New.
11943 Use it where a rule used to be printed `by hand'.
11944 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
11945 (reduce_grammar_tables): Report the useless rules.
11946 (reduce_print): Useless things are a warning, not an error.
11947 Report it as such.
11948 * tests/reduce.at (Useless Nonterminals, Useless Rules):
11949 (Reduced Automaton, Underivable Rules): Adjust.
11950 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
11951 * tests/conflicts.at (Unresolved SR Conflicts)
11952 (Solved SR Conflicts): Adjust.
11953
119542002-06-15 Akim Demaille <akim@epita.fr>
11955
11956 Let symbols have a location.
11957
11958 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
11959 (getsym): Adjust.
11960 Adjust all callers.
11961 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
11962 Use location_t, not int.
11963 * src/symtab.c (symbol_check_defined): Take advantage of the
11964 location.
11965 * tests/regression.at (Invalid inputs): Adjust.
11966
119672002-06-15 Akim Demaille <akim@epita.fr>
11968
11969 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
11970 (input): Don't try to initialize yylloc here, do it in the
11971 scanner.
11972 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
11973 * src/gram.h (rule_t): Change line and action_line into location
11974 and action_location, of location_t type.
11975 Adjust all dependencies.
11976 * src/location.h, src/location.c (empty_location): New.
11977 * src/reader.h, src/reader.c (grammar_start_symbol_set)
11978 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
11979 (grammar_current_rule_symbol_append)
11980 (grammar_current_rule_action_append): Expect a location as argument.
11981 * src/reader.c (grammar_midrule_action): Adjust to attach an
11982 action's location as dummy symbol location.
11983 * src/symtab.h, src/symtab.c (startsymbol_location): New.
11984 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
11985 the line numbers.
11986
119872002-06-14 Akim Demaille <akim@epita.fr>
11988
11989 Grammar declarations may be found in the grammar section.
11990
11991 * src/parse-gram.y (rules_or_grammar_declaration): New.
11992 (declarations): Each declaration may end with a semicolon, not
11993 just...
11994 (grammar_declaration): `"%union"'.
11995 (grammar): Branch to rules_or_grammar_declaration.
11996
119972002-06-14 Akim Demaille <akim@epita.fr>
11998
11999 * src/main.c (main): Invoke scanner_free.
12000
120012002-06-14 Akim Demaille <akim@epita.fr>
12002
12003 * src/output.c (m4_invoke): Extracted from...
12004 (output_skeleton): here.
12005 Free tempfile.
12006
120072002-06-14 Akim Demaille <akim@epita.fr>
12008
12009 * src/parse-gram.y (directives, directive, gram)
12010 (grammar_directives, precedence_directives, precedence_directive):
12011 Rename as...
12012 (declarations, declaration, grammar, grammar_declaration)
12013 (precedence_declaration, precedence_declarator): these.
12014 (symbol_declaration): New.
12015
120162002-06-14 Akim Demaille <akim@epita.fr>
12017
12018 * src/files.c (action_obstack): Remove, unused.
12019 (output_obstack): Remove it, and all its dependencies, as it is no
12020 longer needed.
12021 * src/reader.c (epilogue_set): Build the epilogue in the
12022 muscle_obstack.
12023 * src/output.h, src/output.c (muscle_obstack): Move to...
12024 * src/muscle_tab.h, src/muscle_tab.h: here.
12025 (muscle_init): Initialize muscle_obstack.
12026 (muscle_free): New.
12027 * src/main.c (main): Call it.
12028
120292002-06-14 Akim Demaille <akim@epita.fr>
12030
12031 * src/location.h: New, extracted from...
12032 * src/reader.h: here.
12033 * src/Makefile.am (noinst_HEADERS): Merge into
12034 (bison_SOURCES): this.
12035 Add location.h.
12036 * src/parse-gram.y: Use location_t instead of Bison's.
12037 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
12038 Use location_t instead of ints.
12039
120402002-06-14 Akim Demaille <akim@epita.fr>
12041
12042 * data/bison.simple, data/bison.c++: Be sure to restore the
12043 current #line when returning to the skeleton contents after having
12044 exposed the input file's #line.
12045
120462002-06-12 Akim Demaille <akim@epita.fr>
12047
12048 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
12049 eager.
12050 * tests/actions.at (Exotic Dollars): New.
12051
120522002-06-12 Akim Demaille <akim@epita.fr>
12053
12054 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
12055 ['"/] too eagerly.
12056 * tests/input.at (Torturing the Scanner): New.
12057
120582002-06-11 Akim Demaille <akim@epita.fr>
12059
12060 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
12061 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
12062 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
12063 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
12064 * src/reader.c (reader): Use it.
12065
120662002-06-11 Akim Demaille <akim@epita.fr>
12067
12068 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
12069 Adjust all callers.
12070 (scanner_last_string_free): New.
12071
120722002-06-11 Akim Demaille <akim@epita.fr>
12073
12074 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
12075 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
12076 (last_string, YY_OBS_FREE): New.
12077 Use them when returning an ID.
12078
120792002-06-11 Akim Demaille <akim@epita.fr>
12080
12081 Have Bison grammars parsed by a Bison grammar.
12082
12083 * src/reader.c, src/reader.h (prologue_augment): New.
12084 * src/reader.c (copy_definition): Remove.
12085
12086 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
12087 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
12088 (grammar_current_rule_prec_set, grammar_current_rule_check)
12089 (grammar_current_rule_symbol_append)
12090 (grammar_current_rule_action_append): Export.
12091 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
12092 (symbol_list_action_append): Remove.
12093 Hook the routines from reader.
12094 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
12095 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
12096
12097 * src/reader.c (read_declarations): Remove, unused.
12098
12099 * src/parse-gram.y: Handle the epilogue.
12100 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
12101 (grammar_start_symbol_set): this.
12102 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
12103 * src/reader.c (readgram): Remove, unused.
12104 (reader): Adjust to insert eoftoken and axiom where appropriate.
12105
12106 * src/reader.c (copy_dollar): Replace with...
12107 * src/scan-gram.h (handle_dollar): this.
12108 * src/parse-gram.y: Remove `%thong'.
12109
12110 * src/reader.c (copy_at): Replace with...
12111 * src/scan-gram.h (handle_at): this.
12112
12113 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
12114 New.
12115
12116 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
12117 time being.
12118
12119 * src/reader.h, src/reader.c (grammar_rule_end): New.
12120
12121 * src/parse.y (current_type, current_class): New.
12122 Implement `%nterm', `%token' support.
12123 Merge `%term' into `%token'.
12124 (string_as_id): New.
12125 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
12126 type name.
12127
12128 * src/parse-gram.y: Be sure to handle properly the beginning of
12129 rules.
12130
12131 * src/parse-gram.y: Handle %type.
12132 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
12133
12134 * src/parse-gram.y: More directives support.
12135 * src/options.c: No longer handle source directives.
12136
12137 * src/parse-gram.y: Fix %output.
12138
12139 * src/parse-gram.y: Handle %union.
12140 Use the prologue locations.
12141 * src/reader.c (parse_union_decl): Remove.
12142
12143 * src/reader.h, src/reader.c (epilogue_set): New.
12144 * src/parse-gram.y: Use it.
12145
12146 * data/bison.simple, data/bison.c++: b4_stype is now either not
12147 defined, then default to int, or to the contents of %union,
12148 without `union' itself.
12149 Adjust.
12150 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
12151
12152 * src/output.c (actions_output): Don't output braces, as they are
12153 already handled by the scanner.
12154
12155 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
12156 characters to themselves.
12157
12158 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
12159 that the epilogue has a proper #line.
12160
12161 * src/parse-gram.y: Handle precedence/associativity.
12162
12163 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
12164 a terminal.
12165 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
12166 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
12167 at all to define terminals that cannot be emitted.
12168
12169 * src/scan-gram.l: Escape M4 characters.
12170
12171 * src/scan-gram.l: Working properly with escapes in user
12172 strings/characters.
12173
12174 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
12175 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
12176 grammar.
12177 Use more modest sizes, as for the time being the parser does not
12178 release memory, and therefore the process swallows a huge amount
12179 of memory.
12180
12181 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
12182 stricter %token grammar.
12183
12184 * src/symtab.h (associativity): Add `undef_assoc'.
12185 (symbol_precedence_set): Do nothing when passed an undef_assoc.
12186 * src/symtab.c (symbol_check_alias_consistence): Adjust.
12187
12188 * tests/regression.at (Invalid %directive): Remove, as it is now
12189 meaningless.
12190 (Invalid inputs): Adjust to the new error messages.
12191 (Token definitions): The new grammar doesn't allow too many
12192 eccentricities.
12193
12194 * src/lex.h, src/lex.c: Remove.
12195 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
12196 (copy_character, copy_string2, copy_string, copy_identifier)
12197 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
12198 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
12199 (parse_action): Remove.
12200 * po/POTFILES.in: Adjust.
12201
122022002-06-11 Akim Demaille <akim@epita.fr>
12203
12204 * src/reader.c (parse_action): Don't store directly into the
12205 rule's action member: return the action as a string.
12206 Don't require `rule_length' as an argument: compute it.
12207 (grammar_current_rule_symbol_append)
12208 (grammar_current_rule_action_append): New, eved out from
12209 (readgram): here.
12210 Remove `action_flag', `rulelength', unused now.
12211
122122002-06-11 Akim Demaille <akim@epita.fr>
12213
12214 * src/reader.c (grammar_current_rule_prec_set).
12215 (grammar_current_rule_check): New, eved out from...
12216 (readgram): here.
12217 Remove `xaction', `first_rhs': useless.
12218 * tests/input.at (Type clashes): New.
12219 * tests/existing.at (GNU Cim Grammar): Adjust.
12220
122212002-06-11 Akim Demaille <akim@epita.fr>
12222
12223 * src/reader.c (grammar_midrule_action): New, Eved out from
12224 (readgram): here.
12225
122262002-06-11 Akim Demaille <akim@epita.fr>
12227
12228 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
12229 New.
12230 (readgram): Use them as replacement of inlined code, crule and
12231 crule1.
12232
122332002-06-11 Akim Demaille <akim@epita.fr>
12234
12235 * src/reader.c (grammar_end, grammar_symbol_append): New.
12236 (readgram): Use them.
12237 Make the use of `p' as local as possible.
12238
122392002-06-10 Akim Demaille <akim@epita.fr>
12240
12241 GCJ's parser requires the tokens to be defined before the prologue.
12242
12243 * data/bison.simple: Output the token definition before the user's
12244 prologue.
12245 * tests/regression.at (Braces parsing, Duplicate string)
12246 (Mixing %token styles): Check the output from bison.
12247 (Early token definitions): New.
12248
122492002-06-10 Akim Demaille <akim@epita.fr>
12250
12251 * src/symtab.c (symbol_user_token_number_set): Don't complain when
12252 assigning twice the same user number to a token, so that we can
12253 use it in...
12254 * src/lex.c (lex): here.
12255 Also use `symbol_class_set' instead of hand written code.
12256 * src/reader.c (parse_assoc_decl): Likewise.
12257
122582002-06-10 Akim Demaille <akim@epita.fr>
12259
12260 * src/symtab.c, src/symtab.c (symbol_class_set)
12261 (symbol_user_token_number_set): New.
12262 * src/reader.c (parse_token_decl): Use them.
12263 Use a switch instead of ifs.
12264 Use a single argument.
12265
122662002-06-10 Akim Demaille <akim@epita.fr>
12267
12268 Remove `%thong' support as it is undocumented, unused, duplicates
12269 `%token's job, and creates useless e-mail traffic with people who
12270 want to know what it is, why it is undocumented, unused, and
12271 duplicates `%token's job.
12272
12273 * src/reader.c (parse_thong_decl): Remove.
12274 * src/options.c (option_table): Remove "thong".
12275 * src/lex.h (tok_thong): Remove.
12276
122772002-06-10 Akim Demaille <akim@epita.fr>
12278
12279 * src/symtab.c, src/symtab.c (symbol_type_set)
12280 (symbol_precedence_set): New.
12281 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
12282 (value_components_used): Remove, unused.
12283
122842002-06-09 Akim Demaille <akim@epita.fr>
12285
12286 Move symbols handling code out of the reader.
12287
12288 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
12289 (axiom): Move to...
12290 * src/symtab.h, src/symtab.c: here.
12291
12292 * src/gram.c (start_symbol): Remove: use startsymbol->number.
12293 * src/reader.c (startval): Rename as...
12294 * src/symtab.h, src/symtab.c (startsymbol): this.
12295 * src/reader.c: Adjust.
12296
12297 * src/reader.c (symbol_check_defined, symbol_make_alias)
12298 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12299 (token_translations_init)
12300 Move to...
12301 * src/symtab.c: here.
12302 * src/reader.c (packsymbols): Move to...
12303 * src/symtab.h, src/symtab.c (symbols_pack): here.
12304 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
12305 argument.
12306
123072002-06-03 Akim Demaille <akim@epita.fr>
12308
12309 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
12310 then statements.
12311
123122002-06-03 Akim Demaille <akim@epita.fr>
12313
12314 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
12315 structs with non literals.
12316 * src/scan-skel.l: never-interactive.
12317 * src/conflicts.c (enum conflict_resolution_e): No trailing
12318 comma.
12319 * src/getargs.c (usage): Split long literal strings.
12320 Reported by Hans Aberg.
12321
123222002-05-28 Akim Demaille <akim@epita.fr>
12323
12324 * data/bison.c++: Use C++ ostreams.
12325 (cdebug_): New member.
12326
123272002-05-28 Akim Demaille <akim@epita.fr>
12328
12329 * src/output.c (output_skeleton): Be sure to allocate enough room
12330 for `/' _and_ for `\0' in full_skeleton.
12331
123322002-05-28 Akim Demaille <akim@epita.fr>
12333
12334 * data/bison.c++: Catch up with bison.simple:
12335 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12336 and Paul Eggert <eggert@twinsun.com>: `error' handing.
12337 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
12338 and popping traces.
12339
123402002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12341
12342 * src/output.c (output_skeleton): Put an explicit path in front of
12343 the skeleton file name, rather than relying on the -I directory,
12344 to partially alleviate effects of having a skeleton file lying around
12345 in the current directory.
12346
123472002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12348
12349 * src/conflicts.c (log_resolution): Correct typo:
12350 obstack_printf should be obstack_fgrow1.
12351
123522002-05-26 Akim Demaille <akim@epita.fr>
12353
12354 * src/state.h (state_t): `solved_conflicts' is a new member.
12355 * src/LR0.c (new_state): Set it to 0.
12356 * src/conflicts.h, src/conflicts.c (print_conflicts)
12357 (free_conflicts, solve_conflicts): Rename as...
12358 (conflicts_print, conflicts_free, conflicts_solve): these.
12359 Adjust callers.
12360 * src/conflicts.c (enum conflict_resolution_e)
12361 (solved_conflicts_obstack): New, used by...
12362 (log_resolution): this.
12363 Adjust to attach the conflict resolution to each state.
12364 Complete the description with the precedence/associativity
12365 information.
12366 (resolve_sr_conflict): Adjust.
12367 * src/print.c (print_state): Output its solved_conflicts.
12368 * tests/conflicts.at (Unresolved SR Conflicts)
12369 (Solved SR Conflicts): Exercise --report=all.
12370
123712002-05-26 Akim Demaille <akim@epita.fr>
12372
12373 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12374 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12375 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
12376 (token_number_t, item_number_as_token_number)
12377 (token_number_as_item_number, muscle_insert_token_number_table):
12378 Rename as...
12379 (symbol_number_t, item_number_as_symbol_number)
12380 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
12381 these, since it is more appropriate.
12382
123832002-05-26 Akim Demaille <akim@epita.fr>
12384
12385 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
12386 `Error:' lines.
12387 * data/bison.simple (yystos) [YYDEBUG]: New.
12388 (yyparse) [YYDEBUG]: Display the symbols which are popped during
12389 error recovery.
12390 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
12391
123922002-05-25 Akim Demaille <akim@epita.fr>
12393
12394 * doc/bison.texinfo (Debugging): Split into...
12395 (Tracing): this new section, its former contents, and...
12396 (Understanding): this new section.
12397 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
12398 by...
12399 (report_flag): this.
12400 Adjust all dependencies.
12401 (report_args, report_types, report_argmatch): New.
12402 (usage, getargs): Report/support -r, --report.
12403 * src/options.h
12404 (struct option_table_struct): Rename as..,
12405 (struct option_table_s): this.
12406 Rename the `set_flag' member to `flag' to match with getopt_long's
12407 struct.
12408 * src/options.c (option_table): Split verbose into an entry for
12409 %verbose, and another for --verbose.
12410 Support --report/-r, so remove -r from the obsolete --raw.
12411 * src/print.c: Attach full item sets and lookaheads reports to
12412 report_flag instead of trace_flag.
12413 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
12414
124152002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12416 and Paul Eggert <eggert@twinsun.com>
12417
12418 * data/bison.simple (yyparse): Correct error handling to conform to
12419 POSIX and yacc. Specifically, after syntax error is discovered,
12420 do not reduce further before shifting the error token.
12421 Clean up the code a bit by removing the labels yyerrdefault,
12422 yyerrhandle, yyerrpop.
12423 * NEWS: Document the above.
12424
124252002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12426
12427 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
12428 type; it isn't always big enough, since it doesn't necessarily
12429 include non-terminals.
12430 (yytranslate): Expand definition of yy_token_number_type, so that
12431 the latter can be removed.
12432 (yy_token_number_type): Remove, only one use.
12433 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
12434 don't use TokenNumberType as element type.
12435
12436 * tests/regression.at: Modify expected output to agree with change
12437 to yyr1 and yytranslate.
12438
124392002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
12440
12441 * src/reader.c (parse_action): Use copy_character instead of
12442 obstack_1grow.
12443
124442002-05-13 Akim Demaille <akim@epita.fr>
12445
12446 * tests/regression.at (Token definitions): Prototype yylex and
12447 yyerror.
12448
124492002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12450
12451 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
12452 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
12453 32-bit arithmetic.
12454 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
12455
124562002-05-07 Akim Demaille <akim@epita.fr>
12457
12458 * tests/synclines.at: Be sure to prototype yylex and yyerror to
12459 avoid GCC warnings.
12460
124612002-05-07 Akim Demaille <akim@epita.fr>
12462
12463 Kill GCC warnings.
12464
12465 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
12466 over the RHS of each rule.
12467 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
12468 * src/state.h (state_t): Member `nitems' is unsigned short.
12469 * src/LR0.c (get_state): Adjust.
12470 * src/reader.c (packgram): Likewise.
12471 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
12472 `Type'.
12473 (muscle_insert_int_table): Remove, unused.
12474 (prepare_rules): Remove `max'.
12475
124762002-05-06 Akim Demaille <akim@epita.fr>
12477
12478 * src/closure.c (print_firsts): Display of the symbol tags.
12479 (bitmatrix_print): Move to...
12480 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
12481 here.
12482 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
12483
124842002-05-06 Akim Demaille <akim@epita.fr>
12485
12486 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
12487 hash_do_for_each.
12488
124892002-05-06 Akim Demaille <akim@epita.fr>
12490
12491 * src/LR0.c (new_state, get_state): Instead of using the global
12492 `kernel_size' and `kernel_base', have two new arguments:
12493 `core_size' and `core'.
12494 Adjust callers.
12495
124962002-05-06 Akim Demaille <akim@epita.fr>
12497
12498 * src/reader.c (packgram): No longer end `ritem' with a 0
12499 sentinel: it is not used.
12500
125012002-05-05 Akim Demaille <akim@epita.fr>
12502
12503 New experimental feature: display the lookaheads in the report and
12504 graph.
12505
12506 * src/print (print_core): When --trace-flag, display the rules
12507 lookaheads.
12508 * src/print_graph.c (print_core): Likewise.
12509 Swap the arguments.
12510 Adjust caller.
12511
125122002-05-05 Akim Demaille <akim@epita.fr>
12513
12514 * tests/torture.at (Many lookaheads): New test.
12515
125162002-05-05 Akim Demaille <akim@epita.fr>
12517
12518 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
12519 (GENERATE_MUSCLE_INSERT_TABLE): this.
12520 (output_int_table, output_unsigned_int_table, output_short_table)
12521 (output_token_number_table, output_item_number_table): Replace with...
12522 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
12523 (muscle_insert_short_table, muscle_insert_token_number_table)
12524 (muscle_insert_item_number_table): these.
12525 Adjust all callers.
12526 (prepare_tokens): Don't free `translations', since...
12527 * src/reader.h, src/reader.c (grammar_free): do it.
12528 Move to...
12529 * src/gram.h, src/gram.c (grammar_free): here.
12530 * data/bison.simple, data/bison.c++: b4_token_number_max is now
12531 b4_translate_max.
12532
125332002-05-05 Akim Demaille <akim@epita.fr>
12534
12535 * src/output.c (output_unsigned_int_table): New.
12536 (prepare_rules): `i' is unsigned.
12537 `prhs', `rline', `r2' are unsigned int.
12538 Rename muscle `rhs_number_max' as `rhs_max'.
12539 Output muscles `prhs_max', `rline_max', and `r2_max'.
12540 Free rline and r1.
12541 * data/bison.simple, data/bison.c++: Adjust to use these muscles
12542 to compute types instead of constant types.
12543 * tests/regression.at (Web2c Actions): Adjust.
12544
125452002-05-04 Akim Demaille <akim@epita.fr>
12546
12547 * src/symtab.h (SALIAS, SUNDEF): Rename as...
12548 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
12549 Adjust dependencies.
12550 * src/output.c (token_definitions_output): Be sure not to output a
12551 `#define 'a'' when fed with `%token 'a' "a"'.
12552 * tests/regression.at (Token definitions): New.
12553
125542002-05-03 Paul Eggert <eggert@twinsun.com>
12555
12556 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
12557 for K&R C.
12558
125592002-05-03 gettextize <bug-gnu-gettext@gnu.org>
12560
12561 * Makefile.am (SUBDIRS): Remove intl.
12562 (EXTRA_DIST): Add config/config.rpath.
12563
125642002-05-03 Akim Demaille <akim@epita.fr>
12565
12566 * data/bison.simple (m4_if): Don't output empty enums.
12567 And actually, output valid enum definitions :(.
12568
125692002-05-03 Akim Demaille <akim@epita.fr>
12570
12571 * configure.bat: Remove, completely obsolete.
12572 * Makefile.am (EXTRA_DIST): Adjust.
12573 Don't distribute config.rpath...
12574 * config/Makefile.am (EXTRA_DIST): Do it.
12575
125762002-05-03 Akim Demaille <akim@epita.fr>
12577
12578 * configure.in (GETTEXT_VERSION): New.
12579 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
12580
125812002-05-03 Akim Demaille <akim@epita.fr>
12582
12583 * data/bison.simple (b4_token_enum): New.
12584 (b4_token_defines): Use it to output tokens both as #define and
12585 enums.
12586 Suggested by Paul Eggert.
12587 * src/output.c (token_definitions_output): Don't output spurious
12588 white spaces.
12589
125902002-05-03 Akim Demaille <akim@epita.fr>
12591
12592 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12593
125942002-05-02 Robert Anisko <robert@lrde.epita.fr>
12595
12596 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
12597 Update the stack class, give a try to deque as the default container.
12598
125992002-05-02 Akim Demaille <akim@epita.fr>
12600
12601 * data/bison.simple (yyparse): Do not implement @$ = @1.
12602 (YYLLOC_DEFAULT): Adjust to do it.
12603 * doc/bison.texinfo (Location Default Action): Fix.
12604
126052002-05-02 Akim Demaille <akim@epita.fr>
12606
12607 * src/reader.c (parse_braces): Merge into...
12608 (parse_action): this.
12609
126102002-05-02 Akim Demaille <akim@epita.fr>
12611
12612 * configure.in (ALL_LINGUAS): Remove.
12613 * po/LINGUAS, hr.po: New.
12614
126152002-05-02 Akim Demaille <akim@epita.fr>
12616
12617 Remove the so called hairy (semantic) parsers.
12618
12619 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
12620 * src/gram.h, src/gram.c (semantic_parser): Remove.
12621 (rule_t): Remove the guard and guard_line members.
12622 * src/lex.h (token_t): remove tok_guard.
12623 * src/options.c (option_table): Remove %guard and %semantic_parser
12624 support.
12625 * src/output.c, src/output.h (guards_output): Remove.
12626 (prepare): Adjust.
12627 (token_definitions_output): Don't output the `T'
12628 tokens (???).
12629 (output_skeleton): Don't output the guards.
12630 * src/files.c, src/files.c (attrsfile): Remove.
12631 * src/reader.c (symbol_list): Remove the guard and guard_line
12632 members.
12633 Adjust dependencies.
12634 (parse_guard): Remove.
12635 * data/bison.hairy: Remove.
12636 * doc/bison.texinfo (Environment Variables): Remove occurrences of
12637 BISON_HAIRY.
12638
126392002-05-02 Akim Demaille <akim@epita.fr>
12640
12641 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
12642 (parse_guard): Rename the formal argument `stack_offset' as
12643 `rule_length', which is more readable.
12644 Adjust callers.
12645 (copy_at, copy_dollar): Instead of outputting the hard coded
12646 values of $$, $n and so forth, output invocation to b4_lhs_value,
12647 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
12648 Note: this patch partially drops `semantic-parser' support: it
12649 always does `rule_length - n', where semantic parsers ought to
12650 always use `-n'.
12651 * data/bison.simple, data/bison.c++ (b4_lhs_value)
12652 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12653
126542002-05-02 Akim Demaille <akim@epita.fr>
12655
12656 * configure.in (AC_INIT): Bump to 1.49b.
12657 (AM_INIT_AUTOMAKE): Short invocation.
12658
126592002-05-02 Akim Demaille <akim@epita.fr>
12660
12661 Version 1.49a.
12662
126632002-05-01 Akim Demaille <akim@epita.fr>
12664
12665 * src/skeleton.h: Remove.
12666
126672002-05-01 Akim Demaille <akim@epita.fr>
12668
12669 * src/skeleton.h: Fix the #endif.
12670 Reported by Magnus Fromreide.
12671
126722002-04-26 Paul Eggert <eggert@twinsun.com>
12673
12674 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
12675 Define if we define YYSTYPE and YYLTYPE, respectively.
12676 (YYCOPY): Fix [] quoting problem in the non-GCC case.
12677
126782002-04-25 Robert Anisko <robert@lrde.epita.fr>
12679
12680 * src/scan-skel.l: Postprocess quadrigraphs.
12681
12682 * src/reader.c (copy_character): New function, used to output
12683 single characters while replacing `[' and `]' with quadrigraphs, to
12684 avoid troubles with M4 quotes.
12685 (copy_comment): Output characters with copy_character.
12686 (read_additionnal_code): Likewise.
12687 (copy_string2): Likewise.
12688 (copy_definition): Likewise.
12689
12690 * tests/calc.at: Exercise M4 quoting.
12691
126922002-04-25 Akim Demaille <akim@epita.fr>
12693
12694 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
12695 between `!' and the command.
12696 Reported by Paul Eggert.
12697
126982002-04-24 Robert Anisko <robert@lrde.epita.fr>
12699
12700 * tests/calc.at: Exercise prologue splitting.
12701
12702 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
12703 `b4_post_prologue' instead of `b4_prologue'.
12704
12705 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
12706 muscles.
12707 (output): Free pre_prologue_obstack and post_prologue_obstack.
12708 * src/files.h, src/files.c (attrs_obstack): Remove.
12709 (pre_prologue_obstack, post_prologue_obstack): New.
12710 * src/reader.c (copy_definition): Add a parameter to specify the
12711 obstack to fill, instead of using attrs_obstack unconditionally.
12712 (read_declarations): Pass pre_prologue_obstack to copy_definition if
12713 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
12714
127152002-04-23 Paul Eggert <eggert@twinsun.com>
12716
12717 * data/bison.simple: Remove unnecessary commentary and white
12718 space differences from 1_29-branch.
12719 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
12720
12721 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
12722 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
12723 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
12724 constructors or destructors.
12725
12726 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
12727
127282002-04-23 Akim Demaille <akim@epita.fr>
12729
12730 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
12731 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
12732 location with columns.
12733 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
12734 All reported by Paul Eggert.
12735
127362002-04-22 Akim Demaille <akim@epita.fr>
12737
12738 * src/reduce.c (dump_grammar): Move to...
12739 * src/gram.h, src/gram.c (grammar_dump): here.
12740 Be sure to separate long item numbers.
12741 Don't read the members of a rule's prec if its nil.
12742
127432002-04-22 Akim Demaille <akim@epita.fr>
12744
12745 * src/output.c (table_size, table_grow): New.
12746 (MAXTABLE): Remove, replace uses with table_size.
12747 (pack_vector): Instead of dying when the table is too big, grow it.
12748
127492002-04-22 Akim Demaille <akim@epita.fr>
12750
12751 * data/bison.simple (yyr1): Its type is that of a token number.
12752 * data/bison.c++ (r1_): Likewise.
12753 * tests/regression.at (Web2c Actions): Adjust.
12754
127552002-04-22 Akim Demaille <akim@epita.fr>
12756
12757 * src/reader.c (token_translations_init): 256 is now the default
12758 value for the error token, i.e., it will be assigned another
12759 number if the user assigned 256 to one of her tokens.
12760 (reader): Don't force 256 to error.
12761 * doc/bison.texinfo (Symbols): Adjust.
12762 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
12763 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
12764 etc. instead of 10, 20, 30 (which was used to `jump' over error
12765 (256) and undefined (2)).
12766
127672002-04-22 Akim Demaille <akim@epita.fr>
12768
12769 Propagate more token_number_t.
12770
12771 * src/gram.h (token_number_as_item_number)
12772 (item_number_as_token_number): New.
12773 * src/output.c (GENERATE_OUTPUT_TABLE): New.
12774 Use it to create output_item_number_table and
12775 output_token_number_table.
12776 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12777 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
12778 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
12779 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
12780
127812002-04-22 Akim Demaille <akim@epita.fr>
12782
12783 * src/output.h, src/output.c (get_lines_number): Remove.
12784
127852002-04-19 Akim Demaille <akim@epita.fr>
12786
12787 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
12788 as Lex/Flex'.
12789 (Debugging): More details about enabling the debugging features.
12790 (Table of Symbols): Describe $$, $n, @$, and @n.
12791 Suggested by Tim Josling.
12792
127932002-04-19 Akim Demaille <akim@epita.fr>
12794
12795 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
12796
127972002-04-10 Akim Demaille <akim@epita.fr>
12798
12799 * src/system.h: Rely on HAVE_LIMITS_H.
12800 Suggested by Paul Eggert.
12801
128022002-04-09 Akim Demaille <akim@epita.fr>
12803
12804 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
12805 full stderr, and strip it according to the bison options, instead
12806 of composing the error message from different bits.
12807 This makes it easier to check for several error messages.
12808 Adjust all the invocations.
12809 Add an invocation exercising the error token.
12810 Add an invocation demonstrating a stupid error message.
12811 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
12812 Adjust the tests.
12813 Error message are for stderr, not stdout.
12814
128152002-04-09 Akim Demaille <akim@epita.fr>
12816
12817 * src/gram.h, src/gram.c (error_token_number): Remove, use
12818 errtoken->number.
12819 * src/reader.c (reader): Don't specify the user token number (2)
12820 for $undefined, as it uselessly prevents using it.
12821 * src/gram.h (token_number_t): Move to...
12822 * src/symtab.h: here.
12823 (state_t.number): Is a token_number_t.
12824 * src/print.c, src/reader.c: Use undeftoken->number instead of
12825 hard coded 2.
12826 (Even though this 2 is not the same as above: the number of the
12827 undeftoken remains being 2, it is its user token number which
12828 might not be 2).
12829 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
12830 `user_token_number_max'.
12831 Output `undef_token_number'.
12832 * data/bison.simple, data/bison.c++: Use them.
12833 Be sure to map invalid yylex return values to
12834 `undef_token_number'. This saves us from gratuitous SEGV.
12835
12836 * tests/conflicts.at (Solved SR Conflicts)
12837 (Unresolved SR Conflicts): Adjust.
12838 * tests/regression.at (Web2c Actions): Adjust.
12839
128402002-04-08 Akim Demaille <akim@epita.fr>
12841
12842 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
12843 Adding #line.
12844 Remove the duplicate `typedefs'.
12845 (RhsNumberType): Fix the declaration and various other typos.
12846 Use __ofile__.
12847 * data/bison.simple: Use __ofile__.
12848 * src/scan-skel.l: Handle __ofile__.
12849
128502002-04-08 Akim Demaille <akim@epita.fr>
12851
12852 * src/gram.h (item_number_t): New, the type of item numbers in
12853 RITEM. Note that it must be able to code symbol numbers as
12854 positive number, and the negation of rule numbers as negative
12855 numbers.
12856 Adjust all dependencies (pretty many).
12857 * src/reduce.c (rule): Remove this `short *' pointer: use
12858 item_number_t.
12859 * src/system.h (MINSHORT, MAXSHORT): Remove.
12860 Include `limits.h'.
12861 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
12862 (shortcpy): Remove.
12863 (MAXTABLE): Move to...
12864 * src/output.c (MAXTABLE): here.
12865 (prepare_rules): Use output_int_table to output rhs.
12866 * data/bison.simple, data/bison.c++: Adjust.
12867 * tests/torture.at (Big triangle): Move the limit from 254 to
12868 500.
12869 * tests/regression.at (Web2c Actions): Ajust.
12870
12871 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
12872 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
12873 passes, but produces negative #line number, once fixed, GCC is
12874 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
12875 C), it passes.
12876 * src/state.h (state_h): Code input lines on ints, not shorts.
12877
128782002-04-08 Akim Demaille <akim@epita.fr>
12879
12880 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
12881 and then the grammar.
12882
128832002-04-08 Akim Demaille <akim@epita.fr>
12884
12885 * src/system.h: No longer using strndup.
12886
128872002-04-07 Akim Demaille <akim@epita.fr>
12888
12889 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
12890 * src/output.c (output_table_data): Return the longest number.
12891 (prepare_tokens): Output `token_number_max').
12892 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
12893 New.
12894 Use them to define yy_token_number_type/TokenNumberType.
12895 Use this type for yytranslate.
12896 * tests/torture.at (Big triangle): Push the limit from 124 to
12897 253.
12898 * tests/regression.at (Web2c Actions): Adjust.
12899
129002002-04-07 Akim Demaille <akim@epita.fr>
12901
12902 * tests/torture.at (Big triangle): New.
12903 (GNU AWK Grammar, GNU Cim Grammar): Move to...
12904 * tests/existing.at: here.
12905
129062002-04-07 Akim Demaille <akim@epita.fr>
12907
12908 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
12909 nritems.
12910 Adjust dependencies.
12911
129122002-04-07 Akim Demaille <akim@epita.fr>
12913
12914 * src/reader.c: Normalize increments to prefix form.
12915
129162002-04-07 Akim Demaille <akim@epita.fr>
12917
12918 * src/reader.c, symtab.c: Remove debugging code.
12919
129202002-04-07 Akim Demaille <akim@epita.fr>
12921
12922 Rename all the `bucket's as `symbol_t'.
12923
12924 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
12925 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
12926 * src/symtab.c, src/symtab.h (bucket): Rename as...
12927 (symbol_t): this.
12928 (symbol_list_new, bucket_check_defined, bucket_make_alias)
12929 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
12930 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12931 (buckets_new, buckets_free, buckets_do): Rename as...
12932 (symbol_list_new, symbol_check_defined, symbol_make_alias)
12933 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12934 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
12935 (symbols_new, symbols_free, symbols_do): these.
12936
129372002-04-07 Akim Demaille <akim@epita.fr>
12938
12939 Use lib/hash for the symbol table.
12940
12941 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
12942 EOF.
12943 * src/lex.c (lex): Set the `number' member of new terminals.
12944 * src/reader.c (bucket_check_defined, bucket_make_alias)
12945 (bucket_check_alias_consistence, bucket_translation): New.
12946 (reader, grammar_free, readgram, token_translations_init)
12947 (packsymbols): Adjust.
12948 (reader): Number the predefined tokens.
12949 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
12950 for predefined tokens.
12951 * src/symtab.h (bucket): Remove all the hash table related
12952 members.
12953 * src/symtab.c (symtab): Replace by...
12954 (bucket_table): this.
12955 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12956 (buckets_new, buckets_do): New.
12957
129582002-04-07 Akim Demaille <akim@epita.fr>
12959
12960 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
12961 (start_symbol, max_user_token_number, semantic_parser)
12962 (error_token_number): Initialize.
12963 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
12964 Initialize.
12965 (reader): Don't.
12966 (errtoken, eoftoken, undeftoken, axiom): Extern.
12967
129682002-04-07 Akim Demaille <akim@epita.fr>
12969
12970 * src/gram.h (rule_s): prec and precsym are now pointers
12971 to the bucket giving the priority/associativity.
12972 Member `associativity' removed: useless.
12973 * src/reduce.c, src/conflicts.c: Adjust.
12974
129752002-04-07 Akim Demaille <akim@epita.fr>
12976
12977 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
12978 Properly escape the symbols' TAG when outputting them.
12979
129802002-04-07 Akim Demaille <akim@epita.fr>
12981
12982 * src/lalr.h (LA): Is a bitsetv, not bitset*.
12983
129842002-04-07 Akim Demaille <akim@epita.fr>
12985
12986 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
12987 (LArule): this, which is an array to rule_t*.
12988 * src/print.c, src/conflicts.c: Adjust.
12989
129902002-04-07 Akim Demaille <akim@epita.fr>
12991
12992 * src/gram.h (rule_t): Rename `number' as `user_number'.
12993 `number' is a new member.
12994 Adjust dependencies.
12995 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
12996
129972002-04-07 Akim Demaille <akim@epita.fr>
12998
12999 As a result of the previous patch, it is no longer needed
13000 to reorder ritem itself.
13001
13002 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
13003
130042002-04-07 Akim Demaille <akim@epita.fr>
13005
13006 Be sure never to walk through RITEMS, but use only data related to
13007 the rules themselves. RITEMS should be banished.
13008
13009 * src/output.c (output_token_translations): Rename as...
13010 (prepare_tokens): this.
13011 In addition to `translate', prepare the muscles `tname' and
13012 `toknum', which were handled by...
13013 (output_rule_data): this.
13014 Remove, and move the remainder of its outputs into...
13015 (prepare_rules): this new routines, which also merges content from
13016 (output_gram): this.
13017 (prepare_rules): Be sure never to walk through RITEMS.
13018 (output_stos): Rename as...
13019 (prepare_stos): this.
13020 (output): Always invoke prepare_states, after all, just don't use it
13021 in the output if you don't need it.
13022
130232002-04-07 Akim Demaille <akim@epita.fr>
13024
13025 * src/LR0.c (new_state): Display `nstates' as the name of the
13026 newly created state.
13027 Adjust to initialize first_state and last_state if needed.
13028 Be sure to distinguish the initial from the final state.
13029 (new_states): Create the itemset of the initial state, and use
13030 new_state.
13031 * src/closure.c (closure): Now that the initial state has its
13032 items properly set, there is no need for a special case when
13033 creating `ruleset'.
13034
13035 As a result, now the rule 0, reducing to $axiom, is visible in the
13036 outputs. Adjust the test suite.
13037
13038 * tests/conflicts.at (Solved SR Conflicts)
13039 (Unresolved SR Conflicts): Adjust.
13040 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
13041 * tests/conflicts.at (S/R in initial): New.
13042
130432002-04-07 Akim Demaille <akim@epita.fr>
13044
13045 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
13046 the RHS of the rules.
13047 * src/output.c (output_gram): Likewise.
13048
130492002-04-07 Akim Demaille <akim@epita.fr>
13050
13051 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
13052 bucket.
13053 Adjust all dependencies.
13054 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
13055 `number' of the buckets too.
13056 * src/gram.h: Include `symtab.h'.
13057 (associativity): Move to...
13058 * src/symtab.h: here.
13059 No longer include `gram.h'.
13060
130612002-04-07 Akim Demaille <akim@epita.fr>
13062
13063 * src/gram.h, src/gram.c (rules_rhs_length): New.
13064 (ritem_longest_rhs): Use it.
13065 * src/gram.h (rule_t): `number' is a new member.
13066 * src/reader.c (packgram): Set it.
13067 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
13068 the end of `rules', and count them out of `nrules'.
13069 (reduce_output, dump_grammar): Adjust.
13070 * src/print.c (print_grammar): It is no longer needed to check for
13071 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
13072 * tests/reduce.at (Reduced Automaton): New test.
13073
130742002-04-07 Akim Demaille <akim@epita.fr>
13075
13076 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
13077 lacking `+ 1' to nrules, Bison reported as useless a token if it
13078 was used solely to set the precedence of the last rule...
13079
130802002-04-07 Akim Demaille <akim@epita.fr>
13081
13082 * data/bison.c++, data/bison.simple: Don't output the current file
13083 name in #line, to avoid useless diffs between two identical
13084 outputs under different names.
13085
130862002-04-07 Akim Demaille <akim@epita.fr>
13087
13088 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
13089 Normalize loops to using `< nrules + 1', not `<= nrules'.
13090
130912002-04-07 Akim Demaille <akim@epita.fr>
13092
13093 * TODO: Update.
13094
130952002-04-07 Akim Demaille <akim@epita.fr>
13096
13097 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
13098 bucket.value as bucket.number.
13099
131002002-04-07 Akim Demaille <akim@epita.fr>
13101
13102 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
13103 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13104 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
13105 RHS, instead of being an index in RITEMS.
13106
131072002-04-04 Paul Eggert <eggert@twinsun.com>
13108
13109 * doc/bison.texinfo: Update copyright date.
13110 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
13111 (Symbols): Warn about running Bison in one character set,
13112 but compiling and/or running in an incompatible one.
13113 Warn about character code 256, too.
13114
131152002-04-03 Paul Eggert <eggert@twinsun.com>
13116
13117 * src/bison.data (YYSTACK_ALLOC): Depend on whether
13118 YYERROR_VERBOSE is nonzero, not whether it is defined.
13119
13120 Merge changes from bison-1_29-branch.
13121
131222002-03-20 Paul Eggert <eggert@twinsun.com>
13123
13124 Merge fixes from Debian bison_1.34-1.diff.
13125
13126 * configure.in (AC_PREREQ): 2.53.
13127
131282002-03-20 Akim Demaille <akim@epita.fr>
13129
13130 * src/conflicts.c (log_resolution): Argument `resolution' is const.
13131
131322002-03-19 Paul Eggert <eggert@twinsun.com>
13133
13134 * src/bison.simple (YYCOPY): New macro.
13135 (YYSTACK_RELOCATE): Use it.
13136 Remove Type arg; no longer needed. All callers changed.
13137 (yymemcpy): Remove; no longer needed.
13138
13139 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
13140 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13141
131422002-03-19 Akim Demaille <akim@epita.fr>
13143
13144 Test and fix the #line outputs.
13145
13146 * tests/atlocal.at (GCC): New.
13147 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
13148 (Prologue synch line, %union synch line, Postprologue synch line)
13149 (Action synch line, Epilogue synch line): New tests.
13150 * src/reader.c (parse_union_decl): Define the muscle stype_line.
13151 * data/bison.simple, data/bison.c++: Use it.
13152
131532002-03-19 Akim Demaille <akim@epita.fr>
13154
13155 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
13156 (Solved SR Conflicts, %expect not enough, %expect right)
13157 (%expect too much): Move to...
13158 * tests/conflicts.at: this new file.
13159
131602002-03-19 Akim Demaille <akim@epita.fr>
13161
13162 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13163 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
13164 that we can move to enums for instance.
13165 * src/output.c (token_definitions_output): Output a list of
13166 `token-name, token-number' instead of the #define.
13167 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
13168
131692002-03-14 Akim Demaille <akim@epita.fr>
13170
13171 Use Gettext 0.11.1.
13172
131732002-03-09 Robert Anisko <robert@lrde.epita.fr>
13174
13175 * data/bison.c++: Make the user able to add members to the generated
13176 parser by subclassing.
13177
131782002-03-05 Robert Anisko <robert@lrde.epita.fr>
13179
13180 * src/reader.c (read_additionnal_code): `c' should be an integer, not
13181 a character.
13182 Reported by Nicolas Tisserand and Nicolas Burrus.
13183
131842002-03-04 Robert Anisko <robert@lrde.epita.fr>
13185
13186 * src/reader.c: Warn about lacking semi-colons, do not complain.
13187
131882002-03-04 Robert Anisko <robert@lrde.epita.fr>
13189
13190 * data/bison.c++: Remove a debug line.
13191
131922002-03-04 Robert Anisko <robert@lrde.epita.fr>
13193
13194 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
13195 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
13196 provide a default implementation.
13197
131982002-03-04 Akim Demaille <akim@epita.fr>
13199
13200 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
13201 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
13202 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
13203 * tests/semantic.at (Parsing Guards): Similarly.
13204 * src/reader.at (readgram): Complain if the last rule is not ended
13205 with a semi-colon.
13206
132072002-03-04 Akim Demaille <akim@epita.fr>
13208
13209 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
13210 * src/closure.c: here.
13211 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
13212 RTC.
13213 * src/warshall.h, src/warshall.c: Remove.
13214 * tests/sets.at (Broken Closure): Adjust.
13215
132162002-03-04 Akim Demaille <akim@epita.fr>
13217
13218 * src/output.c (output_skeleton): tempdir is const.
13219 bytes_read is unused.
13220
132212002-03-04 Akim Demaille <akim@epita.fr>
13222
13223 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13224 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
13225 Update.
13226 From Michael Hayes.
13227
132282002-03-04 Akim Demaille <akim@epita.fr>
13229
13230 * src/closure.c (closure): `r' is unused.
13231
132322002-03-04 Akim Demaille <akim@epita.fr>
13233
13234 * tests/sets.at (Broken Closure): Add the ending `;'.
13235 * src/reader.at (readgram): Complain if a rule is not ended with a
13236 semi-colon.
13237
132382002-03-04 Akim Demaille <akim@epita.fr>
13239
13240 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
13241 (count_sr_conflicts): Use bitset_count.
13242 * src/reduce.c (inaccessable_symbols): Ditto.
13243 (bits_size): Remove.
13244 * src/warshall.h, src/warshall.c: Convert to bitsetv.
13245
132462002-03-04 Akim Demaille <akim@epita.fr>
13247
13248 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
13249 * src/reduce.c: Remove the `bitset_zero's following the
13250 `bitset_create's, as now it is performed by the latter.
13251
132522002-03-04 Akim Demaille <akim@epita.fr>
13253
13254 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
13255 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
13256 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
13257 latest sources from Michael.
13258
132592002-03-04 Akim Demaille <akim@epita.fr>
13260
13261 * src/output.c (output): Don't free the grammar.
13262 * src/reader.c (grammar_free): New.
13263 * src/main.c (main): Call it and don't free symtab here.
13264
132652002-03-04 Akim Demaille <akim@epita.fr>
13266
13267 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
13268 before returning.
13269 Reported by Benoit Perrot.
13270
132712002-03-04 Akim Demaille <akim@epita.fr>
13272
13273 Use bitset operations when possible, not loops over bits.
13274
13275 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
13276 bitset_or.
13277 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
13278 * src/reduce.c (useless_nonterminals): Formatting changes.
13279 * src/warshall.c (TC): Use bitset_or.
13280
132812002-03-04 Akim Demaille <akim@epita.fr>
13282
13283 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
13284 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
13285 Ditto.
13286
132872002-03-04 Akim Demaille <akim@epita.fr>
13288
13289 * src/lalr.c (F): Now a bitset*.
13290 Adjust all dependencies.
13291
132922002-03-04 Akim Demaille <akim@epita.fr>
13293
13294 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
13295 Adjust all dependencies.
13296
132972002-03-04 Akim Demaille <akim@epita.fr>
13298
13299 * src/L0.c, src/LR0.h (nstates): Be size_t.
13300 Adjust comparisons (signed vs unsigned).
13301 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
13302 bitset*.
13303 Adjust all dependencies.
13304
133052002-03-04 Akim Demaille <akim@epita.fr>
13306
13307 * src/closure.c (firsts): Now, also a bitset.
13308 Adjust all dependencies.
13309 (varsetsize): Remove, now unused.
13310 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
13311
133122002-03-04 Akim Demaille <akim@epita.fr>
13313
13314 * src/print.c: Convert to use bitset.h, not hand coded iterations
13315 over ints.
13316
133172002-03-04 Akim Demaille <akim@epita.fr>
13318
13319 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
13320
133212002-03-04 Akim Demaille <akim@epita.fr>
13322
13323 * src/closure.c (ruleset): Be a bitset.
13324 (rulesetsize): Remove.
13325
133262002-03-04 Akim Demaille <akim@epita.fr>
13327
13328 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13329 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
13330 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
13331 * src/closure.c (fderives): Be an array of bitsets.
13332
133332002-02-28 Robert Anisko <robert@lrde.epita.fr>
13334
13335 * data/bison.c++: Merge the two generated headers. Insert a copyright
13336 notice in each output file.
13337
133382002-02-28 Akim Demaille <akim@epita.fr>
13339
13340 * data/bison.c++: Copy the prologue of bison.simple to fetch
13341 useful M4 definitions, such as b4_header_guard.
13342
133432002-02-25 Akim Demaille <akim@epita.fr>
13344
13345 * src/getargs.c (version): Give the name of the authors, and use a
13346 translator friendly scheme for the bgr
13347 copyright notice.
13348
133492002-02-25 Akim Demaille <akim@epita.fr>
13350
13351 * src/output.c (header_output): Remove, now handled completely via
13352 M4.
13353
133542002-02-25 Akim Demaille <akim@epita.fr>
13355
13356 * m4/m4.m4: New, from CVS Autoconf.
13357 * configure.in: Invoke it.
13358 * src/output.c (output_skeleton): Use its result instead of the
13359 hard coded name.
13360
133612002-02-25 Akim Demaille <akim@epita.fr>
13362
13363 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
13364 Fileutils 4.1.5.
13365 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
13366 * src/output.c (output_skeleton): Use mkstemp to create a real
13367 temporary file.
13368 Move the filling of `skeleton' and its muscle to...
13369 (prepare): here.
13370 (output): Move the definition of the prologue muscle to...
13371 (prepare): here.
13372 * src/system.h (DEFAULT_TMPDIR): New.
13373
133742002-02-14 Paul Eggert <eggert@twinsun.com>
13375
13376 Remove the support for C++ namespace cleanliness; it was
13377 causing more problems than it was curing, since it didn't work
13378 properly on some nonstandard C++ compilers. This can wait
13379 for a proper C++ parser.
13380
13381 * NEWS: Document this.
13382 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
13383 of C++, as it's treated like C now.
13384 * src/bison.simple (YYSTD): Remove.
13385 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
13386 Treat C++ just like Standard C instead of trying to support
13387 namespace cleanliness.
13388
133892002-02-14 Akim Demaille <akim@epita.fr>
13390
13391 * tests/regression.at (else): Adjust to Andreas' change.
13392
133932002-02-14 Akim Demaille <akim@epita.fr>
13394
13395 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
13396
133972002-02-13 Andreas Schwab <schwab@suse.de>
13398
13399 * src/output.c (output_rule_data): Don't output NULL, it might
13400 not be defined yet.
13401
134022002-02-11 Robert Anisko <robert@lrde.epita.fr>
13403
13404 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
13405 (Copyright notice): Update.
13406
134072002-02-11 Akim Demaille <akim@epita.fr>
13408
13409 * tests/regression.at (%nonassoc and eof): Don't include
13410 nonportable headers.
13411
134122002-02-08 Robert Anisko <robert@lrde.epita.fr>
13413
13414 * data/bison.c++: Correct error recovery. Make the user able to
13415 initialize the starting location.
13416
134172002-02-07 Akim Demaille <akim@epita.fr>
13418
13419 * tests/input.at: New.
13420
134212002-02-07 Robert Anisko <robert@lrde.epita.fr>
13422
13423 * data/bison.c++: Replace some direct m4 expansions by constants. Be
13424 more consistent when naming methods and variables. Put preprocessor
13425 directives around tables only needed for debugging.
13426
134272002-02-07 Robert Anisko <robert@lrde.epita.fr>
13428
13429 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
13430 C++ parsers.
13431 (yy::b4_name::parse): Use print_.
13432
134332002-02-07 Robert Anisko <robert@lrde.epita.fr>
13434
13435 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
13436
134372002-02-07 Robert Anisko <robert@lrde.epita.fr>
13438
13439 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
13440 C++ parsers.
13441 (yy::b4_name::parse): Build verbose error messages, and use error_.
13442
134432002-02-06 Robert Anisko <robert@lrde.epita.fr>
13444
13445 * data/bison.c++: Fix m4 quoting in comments.
13446
134472002-02-06 Robert Anisko <robert@lrde.epita.fr>
13448
13449 * data/bison.c++: Adjust the parser code. Fix some muscles that were
13450 not expanded by m4.
13451
134522002-02-05 Akim Demaille <akim@epita.fr>
13453
13454 * data/bison.c++: Adjust to the M4 back end.
13455 More is certainly needed.
13456
134572002-02-05 Akim Demaille <akim@epita.fr>
13458
13459 Give a try to M4 as a back end.
13460
13461 * lib/readpipe.c: New, from wdiff.
13462 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
13463 BISON_HAIRY.
13464 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
13465 specific values. Now it is m4 that performs the lookup.
13466 * src/parse-skel.y: Remove.
13467 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
13468 * src/output.c (actions_output, guards_output)
13469 (token_definitions_output): No longer keeps track of the output
13470 line number, hence remove the second argument.
13471 (guards_output): Check against the guard member of a rule, not the
13472 action member.
13473 Adjust callers.
13474 (output_skeleton): Don't look for the skeleton location, let m4 do
13475 that.
13476 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
13477 file will be used.
13478 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
13479 (prepare): Given that for the time being changesyntax is not
13480 usable in M4, rename the muscles using `-' to `_'.
13481 Define `defines_flag', `output_parser_name' and `output_header_name'.
13482 * src/output.h (actions_output, guards_output)
13483 (token_definitions_output): Adjust prototypes.
13484 * src/scan-skel.l: Instead of scanning the skeletons, it now
13485 processes the output of m4: `__oline__' and `#output'.
13486 * data/bison.simple: Adjust to be used by M4(sugar).
13487 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
13488 to date.
13489 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
13490 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
13491 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
13492 shamelessly stolen from CVS Autoconf.
13493
134942002-02-05 Akim Demaille <akim@epita.fr>
13495
13496 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
13497 * configure.in: Check for the declarations of free and malloc.
13498 * src/muscle_tab.c: Adjust.
13499
135002002-02-05 Akim Demaille <akim@epita.fr>
13501
13502 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
13503 which have no values.
13504
135052002-02-05 Akim Demaille <akim@epita.fr>
13506
13507 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
13508 * data/: here.
13509
135102002-01-29 Paul Eggert <eggert@twinsun.com>
13511
13512 * src/bison.simple (YYSIZE_T): Do not define merely because
13513 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
13514 On some platforms, <alloca.h> does not declare YYSTD (size_t).
13515
135162002-01-27 Akim Demaille <akim@epita.fr>
13517
13518 Fix `%nonassoc and eof'.
13519
13520 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
13521 which were not properly copied! Replace
13522 memcpy (res->errs, src->errs, src->nerrs);
13523 with
13524 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
13525 !!!
13526 * tests/regression.at (%nonassoc and eof): Adjust to newest
13527 Autotest: `.' is not in the PATH.
13528
135292002-01-27 Akim Demaille <akim@epita.fr>
13530
13531 * tests/sets.at (AT_EXTRACT_SETS): New.
13532 (Nullable): Use it.
13533 (Firsts): New.
13534
135352002-01-26 Akim Demaille <akim@epita.fr>
13536
13537 * tests/actions.at, tests/calc.at, tests/headers.at,
13538 * tests/torture.at: Adjust to the newest Autotest which no longer
13539 forces `.' in the PATH.
13540
135412002-01-25 Akim Demaille <akim@epita.fr>
13542
13543 * tests/regression.at (%nonassoc and eof): New.
13544 Suggested by Robert Anisko.
13545
135462002-01-24 Akim Demaille <akim@epita.fr>
13547
13548 Bison dumps core when trying to complain about broken input files.
13549 Reported by Cris van Pelt.
13550
13551 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
13552 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
13553 into...
13554 (Invalid inputs): Strengthen: exercise parse_percent_token.
13555
135562002-01-24 Robert Anisko <robert.anisko@epita.fr>
13557
13558 * src/Makefile.am: Add bison.c++.
13559 * src/bison.c++: New skeleton.
13560
135612002-01-21 Paolo Bonzini <bonzini@gnu.org>
13562
13563 * po/it.po: New.
13564
135652002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
13566
13567 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
13568
135692002-01-20 Marc Autret <marc@gnu.org>
13570
13571 * src/files.c (compute_output_file_names): Fix
13572
135732002-01-20 Marc Autret <marc@gnu.org>
13574
13575 * tests/output.at: New test.
13576 * src/files.c (compute_base_names): Don't map extensions when
13577 the YACC flag is set, use defaults.
13578 Reported by Evgeny Stambulchik.
13579
135802002-01-20 Marc Autret <marc@gnu.org>
13581
13582 * src/system.h: Need to define __attribute__ away for non-GCC
13583 compilers as well (i.e., the vendor C compiler).
13584 Suggested by Albert Chin-A-Young.
13585
135862002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
13587
13588 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
13589 canonical definition.
13590 * src/system.h: Use the canonical definition for PARAMS (avoids
13591 a conflict with the macro from lib/hash.h).
13592
135932002-01-11 Akim Demaille <akim@epita.fr>
13594
13595 * configure.in: Use AC_FUNC_STRNLEN.
13596 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
13597
135982002-01-09 Akim Demaille <akim@epita.fr>
13599
13600 * src/files.c, src/files.h (output_infix): New.
13601 (tab_extension): Remove.
13602 (compute_base_names): Compute the former, drop the latter.
13603 * src/output.c (prepare): Insert the muscles `output-infix', and
13604 `output-suffix'.
13605 * src/parse-skel.y (string, string.1): New.
13606 (section.header): Use it.
13607 (section.yacc): Remove.
13608 (prefix): Remove too.
13609 * src/scan-skel.l: Adjust.
13610 * src/bison.simple, src/bison.hairy: Adjust.
13611
136122002-01-09 Akim Demaille <akim@epita.fr>
13613
13614 * configure.in (WERROR_CFLAGS): Compute it.
13615 * src/Makefile.am (CFLAGS): Pass it.
13616 * tests/atlocal.in (CFLAGS): Idem.
13617 * src/files.c: Fix a few warnings.
13618 (get_extension_index): Remove, unused.
13619
136202002-01-08 Akim Demaille <akim@epita.fr>
13621
13622 * src/getargs.c (AS_FILE_NAME): New.
13623 (getargs): Use it to convert DOSish file names.
13624 * src/files.c (base_name): Rename as full_base_name to avoid
13625 clashes with `base_name ()'.
13626 (filename_split): New.
13627 (compute_base_names): N-th rewrite, using filename_split.
13628
136292002-01-08 Akim Demaille <akim@epita.fr>
13630
13631 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
13632 New, stolen from the Fileutils 4.1.
13633 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13634 * configure.in: Check for the presence of memrchr, and of its
13635 prototype.
13636
136372002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
13638
13639 * lib/hash.h (__P): Added definition for this macro.
13640 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
13641 BUILT_SOURCES, to ensure they are generated first.
13642 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
13643 %error-verbose to allow bootstrapping with bison 1.30x.
13644
136452002-01-06 Akim Demaille <akim@epita.fr>
13646
13647 * src/reader.c (parse_braces): Don't fetch the next char, the
13648 convention is to fetch on entry.
13649 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
13650 'switch' without a following semicolon.
13651 * tests/regression.at (braces parsing): New.
13652
136532002-01-06 Akim Demaille <akim@epita.fr>
13654
13655 Bison is dead wrong in its RR conflict reports.
13656
13657 * tests/torture.at (GNU Cim Grammar): New.
13658 * src/conflicts.c (count_rr_conflicts): Fix.
13659
136602002-01-06 Akim Demaille <akim@epita.fr>
13661
13662 Creating package.m4 from configure.ac causes too many problems.
13663
13664 * tests/Makefile.am (package.m4): Create it by hand,
13665 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
13666
136672002-01-06 Akim Demaille <akim@epita.fr>
13668
13669 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
13670 skeleton.h.
13671
136722002-01-04 Paul Eggert <eggert@twinsun.com>
13673
13674 * doc/bison.texinfo (Debugging):
13675 Remove YYSTDERR; it's no longer defined or used.
13676 Also, s/cstdio.h/cstdio/.
13677
136782002-01-03 Akim Demaille <akim@epita.fr>
13679
13680 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
13681
136822002-01-03 Akim Demaille <akim@epita.fr>
13683
13684 * src/parse-skel.y (process_skeleton): Don't bind the parser's
13685 tracing code to --trace, wait for a better --trace option, with
13686 args.
13687
136882002-01-03 Akim Demaille <akim@epita.fr>
13689
13690 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
13691 The ISO C++ standard is extremely clear about it: stderr is
13692 considered a macro, not a regular symbol (see table 94 `Header
13693 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
13694 Therefore std:: does not apply to it. It still does with fprintf.
13695 Also, s/cstdio.h/cstdio/.
13696
136972002-01-03 Akim Demaille <akim@epita.fr>
13698
13699 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
13700 for non system headers.
13701
137022002-01-02 Akim Demaille <akim@epita.fr>
13703
13704 Equip the skeleton chain with location tracking, runtime trace,
13705 pure parser and scanner.
13706
13707 * src/parse-skel.y: Request a pure parser, locations, and prefix
13708 renaming.
13709 (%union): Having several members with the same type does not help
13710 type mismatches, simplify.
13711 (YYPRINT, yyprint): New.
13712 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
13713 (skel_error): this.
13714 Handle locations.
13715 * src/scan-skel.l: Adjust to these changes.
13716 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
13717 (LOCATION_PRINT, skel_control_t): New.
13718
137192001-12-30 Akim Demaille <akim@epita.fr>
13720
13721 * src/parse-skel.y: Get rid of the shift/reduce conflict:
13722 replace `gb' with BLANKS.
13723 * src/scan-skel.l: Adjust.
13724
137252001-12-30 Akim Demaille <akim@epita.fr>
13726
13727 * src/system.h: We don't need nor want bcopy.
13728 Throw away MS-DOS crap: we don't need getpid.
13729 * configure.in: We don't need strndup. It was even causing
13730 problems: because Flex includes the headers *before* us,
13731 _GNU_SOURCE is not defined by config.h, and therefore strndup was
13732 not visible.
13733 * lib/xstrndup.c: New.
13734 * src/scan-skel.l: Use it.
13735 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
13736 * src/parse-skel.y: Use %directives instead of #defines.
13737
137382001-12-30 Akim Demaille <akim@epita.fr>
13739
13740 * src/skeleton.h: New.
13741 * src/output.c (output_parser, output_master_parser): Remove, dead
13742 code.
13743 * src/output.h (get_lines_number, actions_output, guards_output)
13744 (token_definitions_output): Prototype them.
13745 * src/parse-skel.y: Add the license notice.
13746 Include output.h and skeleton.h.
13747 (process_skeleton): Returns void, and takes a single parameter.
13748 * src/scan-skel.l: Add the license notice.
13749 Include skeleton.h.
13750 Don't use %option yylineno: it seems that then Flex imagines
13751 REJECT has been used, and therefore it won't reallocate its
13752 buffers (which makes no other sense to me than a bug). It results
13753 in warnings for `unused: yy_flex_realloc'.
13754
137552001-12-30 Robert Anisko <robert.anisko@epita.fr>
13756
13757 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13758 (MUSCLE_INSERT_PREFIX): ...to there.
13759 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13760 (MUSCLE_INSERT_PREFIX): Move from here...
13761
13762 * src/bison.hairy: Add a section directive. Put braces around muscle
13763 names. This parser skeleton is still broken, but Bison should not
13764 choke on a bad muscle 'syntax'.
13765 * src/bison.simple: Add a section directive. Put braces around muscle
13766 names.
13767
13768 * src/files.h (strsuffix, stringappend): Add declarations.
13769 (tab_extension): Add declaration.
13770 (short_base_name): Add declaration.
13771
13772 * src/files.c (strsuffix, stringappend): No longer static. These
13773 functions are used in the skeleton parser.
13774 (tab_extension): New.
13775 (compute_base_names): Use the computations done in this function
13776 to guess if the generated parsers should have '.tab' in their
13777 names.
13778 (short_base_name): No longer static.
13779
13780 * src/output.c (output_skeleton): New.
13781 (output): Disable call to output_master_parser, and give a try to
13782 a new skeleton handling system.
13783 (guards_output, actions_output): No longer static.
13784 (token_definitions_output, get_lines_number): No longer static.
13785
13786 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
13787
13788 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
13789 parse-skel.y.
13790
13791 * src/parse-skel.y: New file.
13792 * src/scan-skel.l: New file.
13793
137942001-12-29 Akim Demaille <akim@epita.fr>
13795
13796 %name-prefix is broken.
13797
13798 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
13799 Adjust all dependencies.
13800 * tests/headers.at (export YYLTYPE): Strengthen this test: use
13801 %name-prefix.
13802
13803 Renaming yylval but not yylloc is not consistent. Now we do.
13804
13805 * src/bison.simple: Prefix yylloc if used.
13806 * doc/bison.texinfo (Decl Summary): Document that.
13807
138082001-12-29 Akim Demaille <akim@epita.fr>
13809
13810 * doc/bison.texinfo: Promote `%long-directive' over
13811 `%long_directive'.
13812 Remove all references to fixed-output-files, yacc is enough.
13813
138142001-12-29 Akim Demaille <akim@epita.fr>
13815
13816 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
13817 user prologue. These are defaults.
13818 * tests/actions.at (Mid-rule actions): Make sure the user can
13819 define YYDEBUG and YYERROR_VERBOSE.
13820
138212001-12-29 Akim Demaille <akim@epita.fr>
13822
13823 * src/output.c (header_output): Don't forget to export YYLTYPE and
13824 yylloc.
13825 * tests/headers.at (export YYLTYPE): New, make sure it does.
13826 * tests/regression.at (%union and --defines, Invalid CPP headers):
13827 Move to...
13828 * tests/headers.at: here.
13829
138302001-12-29 Akim Demaille <akim@epita.fr>
13831
13832 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
13833
138342001-12-29 Akim Demaille <akim@epita.fr>
13835
13836 * tests/actions.at (Mid-rule actions): Output on a single line
13837 instead of several.
13838
138392001-12-29 Akim Demaille <akim@epita.fr>
13840
13841 * doc/bison.texinfo: Formatting changes.
13842
138432001-12-29 Akim Demaille <akim@epita.fr>
13844
13845 Don't store the token defs in a muscle, just be ready to output it
13846 on command. Now possible via `symbols'. Fixes a memory leak.
13847
13848 * src/output.c (token_definitions_output): New.
13849 (output_parser, header_output): Use it.
13850 * src/reader.c (symbols_save): Remove.
13851
138522001-12-29 Akim Demaille <akim@epita.fr>
13853
13854 * src/bison.simple: Do not provide a default for YYSTYPE and
13855 YYLTYPE before the user's prologue. Otherwise it's hardly... a
13856 default.
13857
138582001-12-29 Akim Demaille <akim@epita.fr>
13859
13860 Mid-rule actions are simply... ignored!
13861
13862 * src/reader.c (readgram): Be sure to attach mid-rule actions to
13863 the empty-rule associated to the dummy symbol, not to the host
13864 rule.
13865 * tests/actions.at (Mid-rule actions): New.
13866
138672001-12-29 Akim Demaille <akim@epita.fr>
13868
13869 Memory leak.
13870
13871 * src/reader.c (reader): Free grammar.
13872
138732001-12-29 Akim Demaille <akim@epita.fr>
13874
13875 Memory leak.
13876
13877 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
13878 since it allocates it for each state, although only one is needed.
13879 (allocate_storage): Do it here.
13880
138812001-12-29 Akim Demaille <akim@epita.fr>
13882
13883 * src/options.h, src/options.c (create_long_option_table): Rename
13884 as...
13885 (long_option_table_new): this, with a clearer prototype.
13886 (percent_table): Remove, unused,
13887 * src/getargs.c (getargs): Adjust.
13888
138892001-12-29 Akim Demaille <akim@epita.fr>
13890
13891 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
13892 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
13893 as states.
13894
138952001-12-29 Akim Demaille <akim@epita.fr>
13896
13897 * src/lalr.c (build_relations): Rename `states' as `states1'.
13898 Sorry, I don't understand exactly what it is, no better name...
13899
139002001-12-29 Akim Demaille <akim@epita.fr>
13901
13902 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
13903 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
13904 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
13905 as rules.
13906
139072001-12-29 Akim Demaille <akim@epita.fr>
13908
13909 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
13910 ago.
13911
139122001-12-29 Akim Demaille <akim@epita.fr>
13913
13914 * src/reader.c, src/reader.h (user_toknums): Remove.
13915 Adjust all users to use symbols[i]->user_token_number.
13916
139172001-12-29 Akim Demaille <akim@epita.fr>
13918
13919 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
13920 Adjust all users to use symbols[i]->prec or ->assoc.
13921
139222001-12-29 Akim Demaille <akim@epita.fr>
13923
13924 * src/reader.c, src/reader.h (tags): Remove.
13925 Adjust all users to use symbols[i]->tag.
13926
139272001-12-29 Akim Demaille <akim@epita.fr>
13928
13929 * src/gram.h, src/gram.c (symbols): New, similar to state_table
13930 and rule_table.
13931 * src/reader.c (packsymbols): Fill this table.
13932 Drop sprec.
13933 * src/conflicts.c (resolve_sr_conflict): Adjust.
13934 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
13935 single table.
13936 Use symbols[i]->tag instead of tags[i].
13937
139382001-12-29 Akim Demaille <akim@epita.fr>
13939
13940 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
13941 In addition, put a comment in there, to replace...
13942 * tests/regression.at (%union and C comments): Remove.
13943
139442001-12-29 Akim Demaille <akim@epita.fr>
13945
13946 * tests/regression.at (Web2c Actions): Blindly move the actual
13947 output as expected output. The contents *seem* right to me, but I
13948 can't pretend reading perfectly parser tables... Nonetheless, all
13949 the other tests pass correctly, the table look OK, even though the
13950 presence of `$axiom' is to be noted: AFAICS it is useless (but
13951 harmless).
13952
139532001-12-29 Akim Demaille <akim@epita.fr>
13954
13955 * src/reader.c (readgram): Don't add the rule 0 if there were no
13956 rules read. In other words, add it _after_ having performed
13957 grammar sanity checks.
13958 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
13959
139602001-12-29 Akim Demaille <akim@epita.fr>
13961
13962 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
13963 visible, and some states have now a different number.
13964
139652001-12-29 Akim Demaille <akim@epita.fr>
13966
13967 * src/reader.c (readgram): Bind the initial rule's lineno to that
13968 of the first rule.
13969 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
13970 (Solved SR Conflicts): Adjust rule 0's line number.
13971
139722001-12-29 Akim Demaille <akim@epita.fr>
13973
13974 Fix the `GAWK Grammar' failure.
13975
13976 * src/LR0.c (final_state): Initialize to -1 so that we do compute
13977 the reductions of the first state which was mistakenly confused
13978 with the final state because precisely final_state was initialized
13979 to 0.
13980 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
13981 now noticed by Bison.
13982 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
13983 have a reduction on $default.
13984
139852001-12-29 Akim Demaille <akim@epita.fr>
13986
13987 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
13988 rule line numbers.
13989 * src/closure.c (print_closure): Likewise.
13990 * src/derives.c (print_derives): Likewise.
13991 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
13992 now.
13993
139942001-12-29 Akim Demaille <akim@epita.fr>
13995
13996 * src/lalr.c (lookaheads_print): New.
13997 (lalr): Call it when --trace-flag.
13998 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13999 are dumped.
14000
140012001-12-29 Akim Demaille <akim@epita.fr>
14002
14003 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
14004 when walking through ritem, even via rule->rhs.
14005 * src/reduce.c (dump_grammar, useful_production, reduce_output)
14006 (useful_production, useless_nonterminals): Likewise.
14007 (reduce_grammar_tables): Likewise, plus update nritems.
14008 * src/nullable.c (set_nullable): Likewise.
14009 * src/lalr.c (build_relations): Likewise.
14010 * tests/sets.at (Nullable): Adjust.
14011 Fortunately, now, the $axiom is no longer nullable.
14012
140132001-12-29 Akim Demaille <akim@epita.fr>
14014
14015 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
14016 the 0-sentinel.
14017 * src/gram.c (ritem_longest_rhs): Likewise.
14018 * src/reduce.c (nonterminals_reduce): Likewise.
14019 * src/print_graph.c (print_graph): Likewise.
14020 * src/output.c (output_rule_data): Likewise.
14021 * src/nullable.c (set_nullable): Likewise.
14022
140232001-12-29 Akim Demaille <akim@epita.fr>
14024
14025 * src/output.c: Comment changes.
14026
140272001-12-27 Paul Eggert <eggert@twinsun.com>
14028
14029 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
14030 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
14031 Sparc, as they were causing more porting problems than the
14032 (minor) performance improvement was worth.
14033
14034 Also, catch up with 1.31's YYSTD.
14035
140362001-12-27 Akim Demaille <akim@epita.fr>
14037
14038 * src/output.c (output_gram): Rely on nritems, not the
14039 0-sentinel. See below.
14040 Use -1 as separator, not 0.
14041 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
14042 Rely on -1 as separator in yyrhs, instead of 0.
14043 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
14044 twice `Now at end of input', therefore there are two lines less to
14045 expect.
14046
140472001-12-27 Akim Demaille <akim@epita.fr>
14048
14049 * tests/regression.at (Unresolved SR Conflicts):
14050 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
14051 below.
14052
140532001-12-27 Akim Demaille <akim@epita.fr>
14054
14055 * src/LR0.c (new_state): Recognize the final state by the fact it
14056 is reached by eoftoken.
14057 (insert_start_shifting_state, insert_eof_shifting_state)
14058 (insert_accepting_state, augment_automaton): Remove, since now
14059 these states are automatically computed from the initial state.
14060 (generate_states): Adjust.
14061 * src/print.c: When reporting a rule number to the user, substract
14062 1, so that the axiom rule is rule 0, and the first user rule is 1.
14063 * src/reduce.c: Likewise.
14064 * src/print_graph.c (print_core): For the time being, just as for
14065 the report, depend upon --trace-flags to dump the full set of
14066 items.
14067 * src/reader.c (readgram): Once the grammar read, insert the rule
14068 0: `$axiom: START-SYMBOL $'.
14069 * tests/set.at: Adjust: rule 0 is now displayed, and since the
14070 number of the states has changed (the final state is no longer
14071 necessarily the last), catch up.
14072
140732001-12-27 Akim Demaille <akim@epita.fr>
14074
14075 Try to make the use of the eoftoken valid. Given that its value
14076 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
14077 is used instead of > 0 where appropriate, (ii), depend upon nritems
14078 instead of the 0-sentinel.
14079
14080 * src/gram.h, src/gram.c (nritems): New.
14081 Expected to be duplication of nitems, but for the time being...
14082 * src/reader.c (packgram): Assert nritems and nitems are equal.
14083 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
14084 * src/closure.c (print_closure, print_fderives): Likewise.
14085 * src/gram.c (ritem_print): Likewise.
14086 * src/print.c (print_core, print_grammar): Likewise.
14087 * src/print_graph.c: Likewise.
14088
140892001-12-27 Akim Demaille <akim@epita.fr>
14090
14091 * src/main.c (main): If there are complains after grammar
14092 reductions, then output the report anyway if requested, then die.
14093 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
14094 * src/reader.c (eoftoken): New.
14095 (parse_token_decl): If the token being defined has value `0', it
14096 is the eoftoken.
14097 (packsymbols): No longer hack `tags' to insert `$' by hand.
14098 Be sure to preserve the value of the eoftoken.
14099 (reader): Make sure eoftoken is defined.
14100 Initialize nsyms to 0: now eoftoken is created just like the others.
14101 * src/print.c (print_grammar): Don't special case the eof token.
14102 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
14103 lie anyway, albeit pleasant.
14104 * tests/calc.at: Exercise error messages with eoftoken.
14105 Change the grammar so that empty input is invalid.
14106 Adjust expectations.
14107 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
14108
141092001-12-27 Akim Demaille <akim@epita.fr>
14110
14111 * configure.in: Check the protos of strchr ans strspn.
14112 Replace strchr if needed.
14113 * src/system.h: Provide the protos of strchr, strspn and memchr if
14114 missing.
14115 * lib/strchr.c: New.
14116 * src/reader.c (symbols_save): Use strchr.
14117
141182001-12-27 Akim Demaille <akim@epita.fr>
14119
14120 * src/print.c, src/print_graph.c (escape): New.
14121 Use it to quote the TAGS outputs.
14122 * src/print_graph.c (print_state): Now errors are in red, and
14123 reductions in green.
14124 Prefer high to wide: output the state number on a line of its own.
14125
141262001-12-27 Akim Demaille <akim@epita.fr>
14127
14128 * src/state.h, src/state.c (reductions_new): New.
14129 * src/LR0.c (set_state_table): Let all the states have a
14130 `reductions', even if reduced to 0.
14131 (save_reductions): Adjust.
14132 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
14133 * src/print.c (print_reductions, print_actions): Adjust.
14134 * src/output.c (action_row): Adjust.
14135
141362001-12-27 Akim Demaille <akim@epita.fr>
14137
14138 * src/state.h, src/state.c (errs_new, errs_dup): New.
14139 * src/LR0.c (set_state_table): Let all the states have an errs,
14140 even if reduced to 0.
14141 * src/print.c (print_errs, print_reductions): Adjust.
14142 * src/output.c (output_actions, action_row): Adjust.
14143 * src/conflicts.c (resolve_sr_conflict): Adjust.
14144
141452001-12-27 Akim Demaille <akim@epita.fr>
14146
14147 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
14148
141492001-12-27 Akim Demaille <akim@epita.fr>
14150
14151 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
14152 * src/print.c: here.
14153 (lookaheadset, shiftset): New, used as additional storage by
14154 print_reductions.
14155 (print_results): Adjust.
14156 (print_shifts, print_gotos, print_errs): New, extracted from...
14157 (print_actions): here.
14158 * src/print_graph.c (print_actions): Remove dead code.
14159
141602001-12-27 Akim Demaille <akim@epita.fr>
14161
14162 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
14163 `$n' and `@n'.
14164
141652001-12-27 Akim Demaille <akim@epita.fr>
14166
14167 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
14168 (build_relations): Adjust.
14169
141702001-12-27 Akim Demaille <akim@epita.fr>
14171
14172 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
14173 duplication.
14174
141752001-12-27 Akim Demaille <akim@epita.fr>
14176
14177 * src/reader.c (packgram): Catch nitems overflows.
14178
141792001-12-27 Akim Demaille <akim@epita.fr>
14180
14181 * src/files.c, src/files.h (guard_obstack): Remove.
14182 * src/output.c (output): Adjust.
14183 * src/reader.c (parse_braces): New, factoring...
14184 (copy_action, copy_guard): these two which are renamed as...
14185 (parse_action, parse_guard): these.
14186 As a voluntary consequence, using braces around guards is now
14187 mandatory.
14188
141892001-12-27 Akim Demaille <akim@epita.fr>
14190
14191 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
14192 * src/reader.c (symbol_list): `guard' and `guard_line' are new
14193 members.
14194 (symbol_list_new): Adjust.
14195 (copy_action): action_line is the first line, not the last.
14196 (copy_guard): Just as for actions, store the `action' only, not
14197 the switch/case/break flesh.
14198 Don't parse the user action that might follow the guard, let...
14199 (readgram): do it, i.e., now, there can be an action after a
14200 guard.
14201 In other words the guard is just explicitly optional.
14202 (packgram): Adjust.
14203 * src/output.c (guards_output): New.
14204 (output_parser): Call it when needed.
14205 (output): Also free the guard and attrs obstacks.
14206 * src/files.c, src/files.h (obstack_save): Remove.
14207 (output_files): Remove.
14208 As a result, if one needs the former `.act' file, using an
14209 appropriate skeleton which requires actions and guards is now
14210 required.
14211 * src/main.c (main): Adjust.
14212 * tests/semantic.at: New.
14213 * tests/regression.at: Use `input.y' as input file name.
14214 Avoid 8+3 problems by requiring input.c when the test needs the
14215 parser.
14216
142172001-12-27 Akim Demaille <akim@epita.fr>
14218
14219 * src/reader.c (symbol_list_new): Be sure to initialize all the
14220 fields.
14221
142222001-12-27 Akim Demaille <akim@epita.fr>
14223
14224 All the hacks using a final pseudo state are now useless.
14225
14226 * src/LR0.c (set_state_table): state_table holds exactly nstates.
14227 * src/lalr.c (nLA): New.
14228 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
14229 instead of lookaheadsp from the pseudo state (nstate + 1).
14230
142312001-12-27 Akim Demaille <akim@epita.fr>
14232
14233 * src/output.c (action_row, token_actions): Use a state_t instead
14234 of a integer, and nlookaheads instead of the following state's
14235 lookaheadsp.
14236
142372001-12-27 Akim Demaille <akim@epita.fr>
14238
14239 * src/conflicts.c (log_resolution, flush_shift)
14240 (resolve_sr_conflict, set_conflicts, solve_conflicts)
14241 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
14242 (conflicts_print, print_reductions): Use a state_t instead of an
14243 integer when referring to a state.
14244 As much as possible, depend upon nlookaheads, instead of the
14245 `lookaheadsp' member of the following state (since lookaheads of
14246 successive states are successive, the difference between state n + 1
14247 and n served as the number of lookaheads for state n).
14248 * src/lalr.c (add_lookback_edge): Likewise.
14249 * src/print.c (print_core, print_actions, print_state)
14250 (print_results): Likewise.
14251 * src/print_graph.c (print_core, print_actions, print_state)
14252 (print_graph): Likewise.
14253 * src/conflicts.h: Adjust.
14254
142552001-12-27 Akim Demaille <akim@epita.fr>
14256
14257 * src/bison.hairy: Formatting/comment changes.
14258 ANSIfy.
14259 Remove `register' indications.
14260 Add plenty of `static'.
14261
142622001-12-27 Akim Demaille <akim@epita.fr>
14263
14264 * src/output.c (prepare): Drop the muscle `ntbase' which
14265 duplicates ntokens.
14266 * src/bison.simple: Formatting/comment changes.
14267 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
14268 is an undocumented synonym.
14269
142702001-12-22 Akim Demaille <akim@epita.fr>
14271
14272 * src/output.c (output_table_data): Change the prototype to use
14273 `int' for array ranges: some invocations do pass an int, not a
14274 short.
14275 Reported by Wayne Green.
14276
142772001-12-22 Akim Demaille <akim@epita.fr>
14278
14279 Some actions of web2c.y are improperly triggered.
14280 Reported by Mike Castle.
14281
14282 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
14283 * tests/regression.at (Web2c): Rename as...
14284 (Web2c Report): this.
14285 (Web2c Actions): New.
14286
142872001-12-22 Akim Demaille <akim@epita.fr>
14288
14289 Reductions in web2c.y are improperly reported.
14290 Reported by Mike Castle.
14291
14292 * src/conflicts.c (print_reductions): Fix.
14293 * tests/regression.at (Web2c): New.
14294
142952001-12-18 Akim Demaille <akim@epita.fr>
14296
14297 Some host fail on `assert (!"foo")', which expands to
14298 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
14299 Reported by Nelson Beebee.
14300
14301 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
14302 `#define it_succeeded 0' and `assert (it_succeeded)'.
14303
143042001-12-17 Marc Autret <autret_m@epita.fr>
14305
14306 * src/bison.simple: Don't hard code the skeleton line and filename.
14307 * src/output.c (output_parser): Rename 'line' as 'output_line'.
14308 New line counter 'skeleton_line' (skeleton-line muscle).
14309
143102001-12-17 Paul Eggert <eggert@twinsun.com>
14311
14312 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
14313 YYDEBUG must be defined to a nonzero value.
14314
14315 * src/bison.simple (yytname): Do not assume that the user defines
14316 YYDEBUG to a properly parenthesized expression.
14317
143182001-12-17 Akim Demaille <akim@epita.fr>
14319
14320 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
14321 nlookaheads is a new member.
14322 Adjust all users.
14323 * src/lalr.h (nlookaheads): Remove this orphan declaration.
14324 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
14325 state.
14326
143272001-12-17 Akim Demaille <akim@epita.fr>
14328
14329 * src/files.h, src/files.c (open_files, close_files): Remove.
14330 * src/main.c (main): Don't open/close files, nor invoke lex_free,
14331 let...
14332 * src/reader.c (reader): Do it.
14333
143342001-12-17 Akim Demaille <akim@epita.fr>
14335
14336 * src/conflicts.c (print_reductions): Formatting changes.
14337
143382001-12-17 Akim Demaille <akim@epita.fr>
14339
14340 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
14341 (flush_reduce): New.
14342 (resolve_sr_conflict): Adjust.
14343
143442001-12-17 Akim Demaille <akim@epita.fr>
14345
14346 * src/output.c (output_obstack): Be static and rename as...
14347 (format_obstack): this, to avoid any confusion with files.c's
14348 output_obstack.
14349 * src/reader.h (muscle_obstack): Move to...
14350 * src/output.h: here, since it's defined in output.c.
14351
143522001-12-17 Akim Demaille <akim@epita.fr>
14353
14354 * src/output.c (action_row, save_column, default_goto)
14355 (sort_actions, matching_state, pack_vector): Better variable
14356 locality.
14357
143582001-12-17 Akim Demaille <akim@epita.fr>
14359
14360 * src/output.c: Various formatting changes.
14361
143622001-12-17 Akim Demaille <akim@epita.fr>
14363
14364 * src/files.c (output_files): Free the output_obstack.
14365 * src/main.c (main): Call print and print_graph conditionally.
14366 * src/print.c (print): Work unconditionally.
14367 * src/print_graph.c (print_graph): Work unconditionally.
14368 * src/conflicts.c (log_resolution): Output only if verbose_flag.
14369
143702001-12-16 Marc Autret <autret_m@epita.fr>
14371
14372 * src/output.c (actions_output): Fix. When we use %no-lines,
14373 there is one less line per action.
14374
143752001-12-16 Marc Autret <autret_m@epita.fr>
14376
14377 * src/bison.simple: Remove a useless #line directive.
14378 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
14379 * src/output.c (get_lines_number): New.
14380 (output_parser): Adjust, now takes care about the lines of a
14381 output muscles.
14382 Fix line numbering.
14383 (actions_output): Computes the number of lines taken by actions.
14384 (output_master_parser): Insert new skeleton which is the name of
14385 the output parser file name.
14386
143872001-12-15 Marc Autret <autret_m@epita.fr>
14388
14389 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
14390
143912001-12-15 Marc Autret <autret_m@epita.fr>
14392
14393 * src/output.c (output_gram): Keep track of the hairy one.
14394
143952001-12-15 Akim Demaille <akim@epita.fr>
14396
14397 Make `make distcheck' work.
14398
14399 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
14400 system.h which uses libgettext.h.
14401
144022001-12-15 Akim Demaille <akim@epita.fr>
14403
14404 * src/nullable.c (set_nullable): Useless rules must be skipped,
14405 otherwise, since we range over their symbols, we might look at a
14406 nonterminal which no longer ``exists'', i.e., it is not counted in
14407 `nvars', hence we overflow our arrays.
14408
144092001-12-15 Akim Demaille <akim@epita.fr>
14410
14411 The header can also be produced directly, without any obstack!
14412 Yahoo!
14413
14414 * src/files.c, src/files.h (defines_obstack): Remove.
14415 (compute_header_macro): Global.
14416 (defines_obstack_save): Remove.
14417 * src/reader.c (parse_union_decl): No longer output to
14418 defines_obstack: its content can be found in the `stype' muscle
14419 anyway.
14420 (output_token_translations): Merge into...
14421 (symbols_output): this.
14422 Rename as...
14423 (symbols_save): this.
14424 (reader): Adjust.
14425 * src/output.c (header_output): New.
14426 (output): Call it.
14427
144282001-12-15 Akim Demaille <akim@epita.fr>
14429
14430 * src/reader.c (parse_union_decl): Instead of handling two obstack
14431 simultaneously, use one to define the `stype' muscle, and use the
14432 value of the latter to fill defines_obstack.
14433 (copy_comment): Remove.
14434 (copy_comment2): Work for a single obstack.
14435 Rename as...
14436 (copy_comment): this.
14437
144382001-12-15 Akim Demaille <akim@epita.fr>
14439
14440 * src/lex.c, src/lex.h (xgetc): No longer static.
14441 * src/reader.c (parse_union_decl): Revamp.
14442
144432001-12-15 Akim Demaille <akim@epita.fr>
14444
14445 Still making progress in separating Bison into (i) input, (ii)
14446 process, (iii) output: now we can directly output the parser file
14447 without using table_obstack at all.
14448
14449 * src/files.c, src/files.h (table_obstack): Bye bye.
14450 (parser_file_name): New.
14451 * src/files.c (compute_output_file_names): Compute it.
14452 * src/output.c (actions_output, output_parser)
14453 (output_master_parser): To a file instead of an obstack.
14454
144552001-12-15 Akim Demaille <akim@epita.fr>
14456
14457 Attach actions to rules, instead of pre-outputting them to
14458 actions_obstack.
14459
14460 * src/gram.h (rule_t): action and action_line are new members.
14461 * src/reader.c (symbol_list): Likewise.
14462 (copy_action): Save the actions within the rule.
14463 (packgram): Save them in rule_table.
14464 * src/output.c (actions_output): New.
14465 (output_parser): Use it on `%%actions'.
14466 (output_rule_data): Don't free rule_table.
14467 (output): Do it.
14468 (prepare): Don't save the `action' muscle.
14469 * src/bison.simple: s/%%action/%%actions/.
14470
144712001-12-15 Akim Demaille <akim@epita.fr>
14472
14473 * src/reader.c (copy_action): When --yacc, don't append a `;'
14474 to the user action: let it fail if lacking.
14475 Suggested by Arnold Robbins and Tom Tromey.
14476
144772001-12-14 Akim Demaille <akim@epita.fr>
14478
14479 * src/lex.c (literalchar): Simply return the char you decoded, non
14480 longer mess around with obstacks and int pointers.
14481 Adjust all callers.
14482
144832001-12-14 Akim Demaille <akim@epita.fr>
14484
14485 * src/lex.c (literalchar): Don't escape the special characters,
14486 just decode them, and keep them as char (before, eol was output as
14487 the 2 char string `\n' etc.).
14488 * src/output.c (output_rule_data): Use quotearg to output the
14489 token strings.
14490
144912001-12-13 Paul Eggert <eggert@twinsun.com>
14492
14493 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
14494 Do not infringe on the global user namespace when using C++.
14495 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
14496 All uses of `fprintf' and `stderr' changed.
14497
14498 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
14499
145002001-12-13 Akim Demaille <akim@epita.fr>
14501
14502 The computation of nullable is broken: it doesn't handle empty
14503 RHS's properly.
14504
14505 * tests/torture.at (GNU AWK Grammar): New.
14506 * tests/sets.at (Nullable): New.
14507 * src/nullable.c (set_nullable): Instead of blindly looping over
14508 `ritems', loop over the rules, and then over their rhs's.
14509
14510 Work around Autotest bugs.
14511
14512 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
14513 frame, because Autotest understand lines starting with a `+' as
14514 traces from the shell. Then, they are not processed properly.
14515 Admittedly an Autotest bug, but we don't have time to wait for
14516 Autotest to catch up.
14517 * tests/regression.at (Broken Closure): Adjust to the new table
14518 frames.
14519 Move to...
14520 * tests/sets.at: here.
14521
145222001-12-13 Akim Demaille <akim@epita.fr>
14523
14524 * src/closure.c (closure): Use nrules instead of playing tricks
14525 with BITS_PER_WORD.
14526
145272001-12-13 Akim Demaille <akim@epita.fr>
14528
14529 * src/print.c (print_actions): Output the handling of `$' as the
14530 traces do: shifting the token EOF. Before EOF was treated as a
14531 nonterminal.
14532 * tests/regression.at: Adjust some tests.
14533 * src/print_graph.c (print_core): Complete the set of items via
14534 closure. The next-to-final and final states are still unsatisfying,
14535 but that's to be addressed elsewhere.
14536 No longer output the rule numbers, but do output the state number.
14537 A single loop for the shifts + gotos is enough, but picked a
14538 distinct color for each.
14539 (print_graph): Initialize and finalize closure.
14540
145412001-12-13 Akim Demaille <akim@epita.fr>
14542
14543 * src/reader.c (readgram): Remove dead code, an strip useless
14544 braces.
14545 (get_type): Remove, unused.
14546
145472001-12-12 Akim Demaille <akim@epita.fr>
14548
14549 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
14550 on that of lib/error.c.
14551
145522001-12-12 Akim Demaille <akim@epita.fr>
14553
14554 Some hosts don't like `/' in includes.
14555
14556 * src/system.h: Include libgettext.h without qualifying the path.
14557 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
14558 $(top_srcdir).
14559
145602001-12-11 Marc Autret <autret_m@epita.fr>
14561
14562 * src/output.c (output_parser): Remove useless muscle.
14563
145642001-12-11 Marc Autret <autret_m@epita.fr>
14565
14566 * src/bison.simple: Remove #line just before %%epilogue. It
14567 is now handled in ...
14568 * src/reader.c (read_additionnal_code): Add the output of a
14569 #line for the epilogue.
14570
145712001-12-10 Marc Autret <autret_m@epita.fr>
14572
14573 * src/reader.c (copy_definition): Re-use CPP-outed code which
14574 replace precedent remove.
14575 * src/bison.simple: Remove #line before %%prologue because
14576 %%input-line is wrong at this time.
14577
145782001-12-10 Marc Autret <autret_m@epita.fr>
14579
14580 * src/reader.c (symbols_output): Clean up.
14581 * src/output.c (output_gram, output): Clean up.
14582
145832001-12-10 Akim Demaille <akim@epita.fr>
14584
14585 * src/lalr.c (initialize_lookaheads): New. Extracted from...
14586 * src/LR0.c (set_state_table): here.
14587 * src/lalr.c (lalr): Call it.
14588
145892001-12-10 Akim Demaille <akim@epita.fr>
14590
14591 * src/state.h (shifts): Remove the `number' member: shifts are
14592 attached to state, hence no longer need to be labelled with a
14593 state number.
14594
145952001-12-10 Akim Demaille <akim@epita.fr>
14596
14597 Now that states have a complete set of members, the linked list of
14598 shifts is useless: just fill directly the state's shifts member.
14599
14600 * src/state.h (shifts): Remove the `next' member.
14601 * src/LR0.c (first_state, last_state): Remove.
14602 Adjust the callers.
14603 (augment_automaton): Don't look for the shifts that must be added
14604 a shift on EOF: it is those of the state we looked for! But now,
14605 since shifts are attached, it is no longer needed to looking
14606 merely by its id: its number.
14607
146082001-12-10 Akim Demaille <akim@epita.fr>
14609
14610 * src/LR0.c (augment_automaton): Better variable locality.
14611 Remove an impossible branch: if there is a state corresponding to
14612 the start symbol being shifted, then there is shift for the start
14613 symbol from the initial state.
14614
146152001-12-10 Akim Demaille <akim@epita.fr>
14616
14617 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
14618 only when appropriate: when insert_start_shifting_state' is not
14619 invoked.
14620 * tests/regression.at (Rule Line Numbers): Adjust.
14621
146222001-12-10 Akim Demaille <akim@epita.fr>
14623
14624 * src/LR0.c (augment_automaton): Now that all states have shifts,
14625 merge the two cases addition shifts to the initial state.
14626
146272001-12-10 Akim Demaille <akim@epita.fr>
14628
14629 * src/lalr.c (set_state_table): Move to...
14630 * src/LR0.c: here.
14631 * src/lalr.c (lalr): Don't call it...
14632 * src/LR0.c (generate_states): do it.
14633 * src/LR0.h (first_state): Remove, only the table is used.
14634
146352001-12-10 Akim Demaille <akim@epita.fr>
14636
14637 * src/LR0.h (first_shift, first_reduction): Remove.
14638 * src/lalr.c: Don't use first_shift: find shifts through the
14639 states.
14640
146412001-12-10 Akim Demaille <akim@epita.fr>
14642
14643 * src/LR0.c: Attach shifts to states as soon as they are
14644 computed.
14645 * src/lalr.c (set_state_table): Instead of assigning shifts to
14646 state, just assert that the mapping was properly done.
14647
146482001-12-10 Akim Demaille <akim@epita.fr>
14649
14650 * src/LR0.c (insert_start_shift): Rename as...
14651 (insert_start_shifting_state): this.
14652 (insert_eof_shifting_state, insert_accepting_state): New.
14653 (augment_automaton): Adjust.
14654 Better locality of the variables.
14655 When looking if the start_symbol is shifted from the initial
14656 state, using `while (... symbol != start_symbol ...)' sounds
14657 better than `while (... symbol < start_symbol ...)': If fail
14658 to see how the order between symbols could be relevant!
14659
146602001-12-10 Akim Demaille <akim@epita.fr>
14661
14662 * src/getargs.h: Don't declare `spec_name_prefix' and
14663 `spec_file_prefix', declared by src/files.h.
14664 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
14665 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
14666 * src/output.c (prepare): Adjust.
14667 * src/reader.c (symbols_output): Likewise.
14668 * src/vmsgetargs.c: Vaguely adjust, but who cares?
14669
146702001-12-10 Akim Demaille <akim@epita.fr>
14671
14672 * src/muscle_tab.c (muscle_init): NULL is a better default than
14673 `"0"'.
14674
146752001-12-10 Akim Demaille <akim@epita.fr>
14676
14677 * src/reader.c (reader): Calling symbols_output once is enough.
14678
146792001-12-10 Akim Demaille <akim@epita.fr>
14680
14681 Now that states have a complete set of members, the linked list of
14682 reductions is useless: just fill directly the state's reductions
14683 member.
14684
14685 * src/state.h (struct reductions): Remove member `number' and
14686 `next'.
14687 * src/LR0.c (first_reduction, last_reduction): Remove.
14688 (save_reductions): Don't link the new reductions, store them in
14689 this_state.
14690 * src/lalr.c (set_state_table): No need to attach reductions to
14691 states, it's already done.
14692 * src/output.c (output_actions): No longer free the shifts, then
14693 the reductions, then the states: free all the states and their
14694 members.
14695
146962001-12-10 Akim Demaille <akim@epita.fr>
14697
14698 * src/options.c (OPTN, DRTV, BOTH): New.
14699 (option_table): Use them.
14700
14701 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
14702 the job of system.h.
14703 * src/options.c: Don't include stdio.h and xalloc.h for the same
14704 reasons.
14705
147062001-12-10 Akim Demaille <akim@epita.fr>
14707
14708 * src/output.c (output, prepare): Make sure the values of the
14709 muscles `action' and `prologue' are 0-terminated.
14710
147112001-12-10 Akim Demaille <akim@epita.fr>
14712
14713 Clean up GCC warnings.
14714
14715 * src/reader.c (copy_action): `buf' is not used.
14716 (parse_skel_decl): Be static.
14717 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
14718 * src/options.h (create_long_option_table): Have a real prototype.
14719 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
14720 (hash_delete_at): Return const void *.
14721 Adjust casts to preserve the const.
14722
147232001-12-10 Akim Demaille <akim@epita.fr>
14724
14725 * configure.in: Require 2.52g.
14726 M4 is not needed, but AUTOM4TE is.
14727 * m4/m4.m4: Remove.
14728 * tests/Makefile.am: Adjust.
14729
147302001-12-10 Akim Demaille <akim@epita.fr>
14731
14732 One structure for states is enough, even though theoretically
14733 there are LR(0) states and LALR(1) states.
14734
14735 * src/lalr.h (state_t): Remove.
14736 (state_table): Be state_t **, not state_t *.
14737 * src/state.h (core, CORE_ALLOC): Rename as...
14738 (state_t, STATE_ALLOC): this.
14739 Add the LALR(1) members: shifts, reductions, errs.
14740 * src/LR0.c (state_table): Rename as...
14741 (state_hash): this, to avoid name clashes with the global
14742 `state_table'.
14743 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
14744 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
14745
147462001-12-10 Akim Demaille <akim@epita.fr>
14747
14748 Bison dumps core on bash.y.
14749 Reported by Pascal Bart.
14750
14751 * src/warshall.c (bitmatrix_print): New.
14752 (TC): Use it.
14753 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
14754 j must be the outer loop.
14755 * tests/regression.at (Broken Closure): New.
14756
147572001-12-05 Akim Demaille <akim@epita.fr>
14758
14759 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
14760 its argument.
14761 Reported by Peter Hamorsky.
14762
147632001-12-05 Akim Demaille <akim@epita.fr>
14764
14765 * src/conflicts.c (err_table): Remove.
14766 (resolve_sr_conflict): Adjust.
14767 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
14768 Rename as...
14769 (state_t.reductions, state_t.shifts): this.
14770
147712001-12-05 Akim Demaille <akim@epita.fr>
14772
14773 * src/reduce.c (reduce_grammar_tables): No longer disable the
14774 removal of useless rules via CPP but via `if (0)', so that the
14775 compiler still check the code is valid.
14776 For instance, it should have noticed `rline' no longer exists: use
14777 the `line' member of rule_t.
14778 * src/gram.c (dummy, rline): Remove, unused.
14779
147802001-12-05 Akim Demaille <akim@epita.fr>
14781
14782 * src/output.c (pack_vector): Use assert, not berror.
14783 * src/main.c (berror): Remove, unused.
14784
147852001-12-05 Akim Demaille <akim@epita.fr>
14786
14787 New experimental feature: if --verbose --trace output all the
14788 items of a state, not only its kernel.
14789
14790 * src/print.c (print_core): If `trace_flag', then invoke closure
14791 before outputting the items of the state (print_core is no longer
14792 a correct name them).
14793 (print_results): Invoke new_closure/free_closure if needed.
14794
147952001-12-05 Akim Demaille <akim@epita.fr>
14796
14797 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
14798 * src/closure.c, src/closure.h (itemsetsize): Rename as...
14799 (nitemset): for consistency with the rest of the project.
14800
148012001-12-05 Akim Demaille <akim@epita.fr>
14802
14803 * src/closure.c (print_closure): Improve.
14804 (closure): Use it for printing input and output.
14805
148062001-12-05 Akim Demaille <akim@epita.fr>
14807
14808 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
14809 indexed by nonterminals.
14810
148112001-12-05 Akim Demaille <akim@epita.fr>
14812
14813 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
14814 what it was!).
14815 * src/warshall.h: Remove accidental duplication of the content.
14816
148172001-12-05 Akim Demaille <akim@epita.fr>
14818
14819 * src/closure.c (set_fderives): De-obfuscate.
14820
148212001-12-05 Akim Demaille <akim@epita.fr>
14822
14823 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
14824
148252001-12-05 Akim Demaille <akim@epita.fr>
14826
14827 * src/closure.c (set_firsts): De-obfuscate.
14828
148292001-12-05 Akim Demaille <akim@epita.fr>
14830
14831 * src/output.c (action_row): De-obfuscate
14832 using the good o' techniques: arrays not pointers, variable
14833 locality, BITISSET, RESETBIT etc.
14834
148352001-12-05 Akim Demaille <akim@epita.fr>
14836
14837 Pessimize the code to simplify it: from now on, all the states
14838 have a valid SHIFTS, which NSHIFTS is possibly 0.
14839
14840 * src/LR0.c (shifts_new): Be global and move to..
14841 * src/state.c, src/state.h: here.
14842 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
14843 * src/print_graph: Adjust.
14844
148452001-12-05 Akim Demaille <akim@epita.fr>
14846
14847 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
14848 * src/conflicts.c: Use it.
14849 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
14850 incorrectly ``simplified''.
14851
148522001-12-05 Akim Demaille <akim@epita.fr>
14853
14854 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
14855 using the good o' techniques: arrays not pointers, variable
14856 locality, BITISSET, RESETBIT etc.
14857
148582001-12-05 Akim Demaille <akim@epita.fr>
14859
14860 * src/state.h (SHIFT_SYMBOL): New.
14861 * src/conflicts.c: Use it to deobfuscate.
14862
148632001-12-05 Akim Demaille <akim@epita.fr>
14864
14865 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
14866 (print_reductions): De-obfuscate using the good o' techniques:
14867 arrays not pointers, variable locality, BITISSET.
14868
148692001-12-05 Akim Demaille <akim@epita.fr>
14870
14871 * src/conflicts.c (print_reductions): Arrays, not pointers.
14872 Use BITISSET.
14873
148742001-12-05 Akim Demaille <akim@epita.fr>
14875
14876 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14877
148782001-12-05 Akim Demaille <akim@epita.fr>
14879
14880 * src/conflicts.c (print_reductions): Improve variable locality.
14881
148822001-12-05 Akim Demaille <akim@epita.fr>
14883
14884 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14885
148862001-12-05 Akim Demaille <akim@epita.fr>
14887
14888 * src/conflicts.c (print_reductions): Improve variable locality.
14889
148902001-12-05 Akim Demaille <akim@epita.fr>
14891
14892 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
14893 * src/lalr.c: Use them.
14894
148952001-12-05 Akim Demaille <akim@epita.fr>
14896
14897 * src/LR0.c (augment_automaton): Formatting changes.
14898 Better variable locality.
14899
149002001-12-05 Akim Demaille <akim@epita.fr>
14901
14902 * src/lalr.c (matrix_print): New.
14903 (transpose): Use it.
14904 Use arrays instead of pointers.
14905
149062001-12-05 Akim Demaille <akim@epita.fr>
14907
14908 * src/lalr.c (maxrhs): Move to...
14909 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
14910 * src/lalr.c (build_relations): Adjust.
14911
149122001-12-05 Akim Demaille <akim@epita.fr>
14913
14914 * src/lalr.c (transpose): Free the memory allocated to the
14915 argument, as it is replaced by the results by the unique caller.
14916 (build_relations): Merely invoke transpose: it handles the memory
14917 deallocation.
14918 Improve variable locality.
14919 Avoid variables used as mere abbreviations.
14920 (compute_lookaheads): Use arrays instead of pointers.
14921
149222001-12-05 Akim Demaille <akim@epita.fr>
14923
14924 * src/lalr.c (initialize_F): Improve variable locality.
14925 Avoid variables used as mere abbreviations.
14926
149272001-12-05 Akim Demaille <akim@epita.fr>
14928
14929 * src/derives.c (print_derives): Display the ruleno.
14930 * src/lalr.c (initialize_F, transpose): Better variable locality
14931 to improve readability.
14932 Avoid variables used as mere abbreviations.
14933
149342001-12-05 Akim Demaille <akim@epita.fr>
14935
14936 * src/lalr.c (traverse): Use arrays instead of pointers.
14937
149382001-12-05 Akim Demaille <akim@epita.fr>
14939
14940 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
14941 the handling of squeue.
14942 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14943
149442001-12-05 Akim Demaille <akim@epita.fr>
14945
14946 Because useless nonterminals are now kept alive (instead of being
14947 `destroyed'), we now sometimes examine them, and store information
14948 related to them. Hence we need to know their number, and adjust
14949 memory allocations.
14950
14951 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
14952 static.
14953 * src/LR0.c (allocate_itemsets): The memory allocated to
14954 `symbol_count' was used for two different purpose: once to count
14955 the number of occurrences of each symbol, and later reassigned to
14956 `shift_symbol', containing the symbol that can be shifted from a
14957 given state.
14958 Deobfuscate, i.e., allocate, use and free `symbol_count' here
14959 only, and...
14960 (new_itemsets): Allocate `shift_symbol' here.
14961 (allocate_itemsets): symbol_count includes useless nonterminals.
14962 Make room for them.
14963 (free_storage): Use `free', not `XFREE', for pointers that cannot
14964 be null.
14965
149662001-12-05 Akim Demaille <akim@epita.fr>
14967
14968 * src/nullable.c (set_nullable): Deobfuscate the handling of
14969 ritem.
14970 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14971
149722001-12-05 Akim Demaille <akim@epita.fr>
14973
14974 * src/gram.c, src/gram.h (ritem_print): New.
14975 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
14976 (This useless function was defined only to work around VMS linkers
14977 that can't handle compilation units with variables only).
14978 * src/reduce.c (dump_grammar): Use it to trace the construction of
14979 ritem.
14980
149812001-12-04 Paul Eggert <eggert@twinsun.com>
14982
14983 * src/bison.simple (union yyalloc): Change member names
14984 to be the same as the stack names.
14985 (yyparse): yyptr is now union yyalloc *, not char *.
14986 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
14987 and may generate better code on some machines.
14988 (yystpcpy): Use prototype if __STDC__ is defined, not just
14989 if __cplusplus is defined.
14990
149912001-11-30 Akim Demaille <akim@epita.fr>
14992
14993 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
14994 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
14995 Gettext doesn't compile cleanly, and dies with -Werror.
14996 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
14997 Include WARNING_CFLAGS here.
14998 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
14999 before being defined.
15000
150012001-11-27 Paul Eggert <eggert@twinsun.com>
15002
15003 * lib/quotearg.h (quotearg_n, quotearg_n_style):
15004 First arg is int, not unsigned.
15005 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
15006 (SIZE_MAX, UINT_MAX): New macros.
15007 (quotearg_n_options): Abort if N is negative.
15008 Avoid overflow check on hosts where size_t is 64 bits and int
15009 is 32 bits, as overflow is impossible there.
15010 Fix off-by-one typo that caused unnecessary reallocation.
15011
150122001-11-29 Paul Eggert <eggert@twinsun.com>
15013
15014 Name space cleanup in generated parser.
15015
15016 * doc/bison.texinfo (Bison Parser): Discuss system headers
15017 and their effect on the user name space.
15018
15019 * src/bison.simple:
15020 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
15021 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
15022 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
15023
15024 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
15025 on user names when possible.
15026
15027 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
15028 Simplify test for whather <alloca.h> exists.
15029
15030 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
15031
15032 (<stdio.h>): Include if YYDEBUG.
15033
15034 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
15035 ! defined (yyoverflow) && ! defined (yymemcpy).
15036
15037 (yymemcpy, yyparse): Rename local variables as needed so that
15038 they all begin with 'yy'.
15039
15040 (yystrlen, yystpcpy): New functions.
15041
15042 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
15043 All uses changed.
15044
15045 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
15046 instead of relying on string.h functions. Use YYSTACK_ALLOC
15047 and YYSTACK_FREE instead of malloc and free.
15048
150492001-11-30 Akim Demaille <akim@epita.fr>
15050
15051 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
15052 before their first uses.
15053 (YYBISON, YYPURE): Move to the top of the output.
15054
150552001-11-30 Akim Demaille <akim@epita.fr>
15056
15057 * tests/reduce.at (Useless Nonterminals): Fix.
15058
150592001-11-30 Akim Demaille <akim@epita.fr>
15060
15061 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
15062 if body instead of `;' to pacify GCC's warnings.
15063
150642001-11-30 Akim Demaille <akim@epita.fr>
15065
15066 Instead of mapping the LHS of unused rules to -1, keep the LHS
15067 valid, but flag the rules as invalid.
15068
15069 * src/gram.h (rule_t): `useful' is a new member.
15070 * src/print.c (print_grammar): Adjust.
15071 * src/derives.c (set_derives): Likewise.
15072 * src/reader.c (packgram, reduce_output): Likewise.
15073 * src/reduce.c (reduce_grammar_tables): Likewise.
15074 * tests/reduce.at (Underivable Rules, Useless Rules): New.
15075
150762001-11-30 Akim Demaille <akim@epita.fr>
15077
15078 * src/reduce.c (reduce_output): Formatting changes.
15079 * src/print.c (print_results, print_grammar): Likewise.
15080 * tests/regression.at (Rule Line Numbers)
15081 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
15082
150832001-11-30 Akim Demaille <akim@epita.fr>
15084
15085 * src/reduce.c (nonterminals_reduce): Instead of throwing away
15086 useless nonterminals, move them at the end of the symbol arrays.
15087 (reduce_output): Adjust.
15088 * tests/reduce.at (Useless Nonterminals): Adjust.
15089
150902001-11-30 Akim Demaille <akim@epita.fr>
15091
15092 * src/reduce.c: Various comment/formatting changes.
15093 (nonterminals_reduce): New, extracted from...
15094 (reduce_grammar_tables): here.
15095 (reduce_grammar): Call nonterminals_reduce.
15096
150972001-11-29 Paul Eggert <eggert@twinsun.com>
15098
15099 * src/bison.simple (YYSTACK_REALLOC): Remove.
15100 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
15101 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
15102 New macros.
15103 (union yyalloc): New type.
15104 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
15105 an arbitrary restriction on hosts where size_t is wider than int.
15106
15107 (yyparse): Don't dump core if alloca or malloc fails; instead, report
15108 a parser stack overflow. Allocate just one block of memory for all
15109 three stacks, instead of allocating three blocks; this typically is
15110 faster and reduces fragmentation.
15111
15112 Do not limit the number of items in the stack to a value that fits
15113 in 'int', as this is an arbitrary limit on hosts with 64-bit
15114 size_t and 32-bit int.
15115
151162001-11-29 Marc Autret <autret_m@epita.fr>
15117
15118 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
15119 of defining YYERROR_VERBOSE.
15120 [AT_DATA]: $4 is now out of C declarations in the prologue.
15121
151222001-11-28 Marc Autret <autret_m@epita.fr>
15123
15124 * src/reader.c (parse_dquoted_param): New.
15125 (parse_skel_decl): Use it.
15126 * src/lex.h: Add its prototype.
15127 * src/lex.c (literalchar): Become not static.
15128
151292001-11-28 Marc Autret <autret_m@epita.fr>
15130
15131 * src/output.h: And put its extern declaration here.
15132 * src/output.c (error_verbose): Define here.
15133 (prepare): Echo name modification.
15134 * src/getargs.h: Clean its extern declaration.
15135 * src/getargs.c (error_verbose_flag): Remove.
15136 (getargs): Remove case 'e'.
15137 * src/options.c (option_table): 'error-verbose' is now seen as simple
15138 percent option.
15139 Include output.h.
15140
15141 * src/reader.c (read_declarations): Remove case tok_include.
15142 (parse_include_decl): Remove.
15143 * src/lex.h (token_t): Remove tok_include.
15144 * src/options.c (option_table): 'include' is now a simple command line
15145 option.
15146
151472001-11-28 Marc Autret <autret_m@epita.fr>
15148
15149 * src/bison.simple: Adjust muscle names.
15150 * src/muscle_tab.c (muscle_init): Also rename the muscles.
15151 * src/output.c (prepare): s/_/-/ for the muscles names.
15152 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
15153
151542001-11-28 Marc Autret <autret_m@epita.fr>
15155
15156 * src/bison.simple: Fix debug.
15157 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
15158
151592001-11-28 Akim Demaille <akim@epita.fr>
15160
15161 * src/LR0.c (shifts_new): New.
15162 (save_shifts, insert_start_shift, augment_automaton): Use it.
15163
151642001-11-28 Akim Demaille <akim@epita.fr>
15165
15166 * src/closure.c (closure): `b' and `ruleno' denote the same value:
15167 keep ruleno only.
15168
151692001-11-28 Akim Demaille <akim@epita.fr>
15170
15171 * src/closure.c (closure): Instead of looping over word in array
15172 then bits in words, loop over bits in array.
15173
151742001-11-28 Akim Demaille <akim@epita.fr>
15175
15176 * src/closure.c (closure): No longer optimize the special case
15177 where all the bits of `ruleset[r]' are set to 0, to make the code
15178 clearer.
15179
151802001-11-28 Akim Demaille <akim@epita.fr>
15181
15182 * src/closure.c (closure): `r' and `c' are new variables, used to
15183 de-obfuscate accesses to RULESET and CORE.
15184
151852001-11-28 Akim Demaille <akim@epita.fr>
15186
15187 * src/reduce.c (reduce_print): Use ngettext.
15188 (dump_grammar): Improve the trace accuracy.
15189
151902001-11-28 Akim Demaille <akim@epita.fr>
15191
15192 * src/reduce.c (dump_grammar): Don't translate trace messages.
15193
151942001-11-28 Akim Demaille <akim@epita.fr>
15195
15196 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
15197 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
15198 as all tags are free'ed afterwards.
15199 From Enrico Scholz.
15200
152012001-11-27 Paul Eggert <eggert@twinsun.com>
15202
15203 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
15204 use alloca when we didn't want to, and vice versa.
15205
152062001-11-27 Marc Autret <autret_m@epita.fr>
15207
15208 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
15209 initialization.
15210 * src/output.c (prepare): Remove its update.
15211
152122001-11-27 Marc Autret <autret_m@epita.fr>
15213
15214 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
15215 Use %error-verbose.
15216
152172001-11-27 Marc Autret <autret_m@epita.fr>
15218
15219 * src/bison.simple: Remove YYERROR_VERBOSE using.
15220 Use %%error_verbose.
15221 (yyparse): Likewise.
15222 * src/output.c (prepare): Give its final value.
15223 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
15224 * src/getargs.h: Add its extern declaration.
15225 * src/getargs.c (error_verbose_flag): New int.
15226 (getargs): Update to catch new case.
15227 * src/options.c (option_table): 'error-verbose' is a new option.
15228 (shortopts): Update.
15229
152302001-11-27 Akim Demaille <akim@epita.fr>
15231
15232 * src/system.h: Use intl/libgettext.h.
15233 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
15234
152352001-11-27 Akim Demaille <akim@epita.fr>
15236
15237 * tests/torture.at (Exploding the Stack Size with Malloc):
15238 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
15239
152402001-11-27 Akim Demaille <akim@epita.fr>
15241
15242 * src/files.c: Include error.h.
15243 Reported by Hans Aberg.
15244
152452001-11-26 Marc Autret <autret_m@epita.fr>
15246
15247 * src/reader.c (parse_include_decl): New, not yet implemented.
15248 (read_declarations): Add case tok_include.
15249 * src/getargs.h (include): Add its extern definition.
15250 * src/getargs.c (include): New const char *.
15251 (getargs): Add case '-I'.
15252 * src/options.c (option_table): Add include as command line and
15253 percent option.
15254 * src/lex.h (token_t): Add tok_include.
15255
152562001-11-26 Akim Demaille <akim@epita.fr>
15257
15258 * src/reader.c (readgram): Make sure rules for mid-rule actions
15259 have a lineno equal to that of their host rule.
15260 Reported by Hans Aberg.
15261 * tests/regression.at (Rule Line Numbers): New.
15262
152632001-11-26 Akim Demaille <akim@epita.fr>
15264
15265 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
15266 size_ts.
15267
152682001-11-26 Akim Demaille <akim@epita.fr>
15269
15270 * src/complain.c, src/complain.h (error): Remove, provided by
15271 lib/error.[ch].
15272
152732001-11-26 Akim Demaille <akim@epita.fr>
15274
15275 * src/reader.c (read_declarations): Don't abort on tok_illegal,
15276 issue an error message.
15277 * tests/regression.at (Invalid %directive): New.
15278 Reported by Hans Aberg.
15279
152802001-11-26 Akim Demaille <akim@epita.fr>
15281
15282 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
15283 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15284
152852001-11-26 Akim Demaille <akim@epita.fr>
15286
15287 * src/conflicts.c (conflicts_print): Don't complain at all when
15288 there are no reduce/reduce conflicts, and as many shift/reduce
15289 conflicts as expected.
15290 * tests/regression.at (%expect right): Adjust.
15291
152922001-11-23 Akim Demaille <akim@epita.fr>
15293
15294 * lib/alloca.c: Update, from fileutils.
15295
152962001-11-23 Akim Demaille <akim@epita.fr>
15297
15298 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
15299
153002001-11-23 Akim Demaille <akim@epita.fr>
15301
15302 * src/system.h: Include alloca.h.
15303 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
15304
153052001-11-23 Akim Demaille <akim@epita.fr>
15306
15307 * src/print_graph.c (print_actions): Remove `rule', unused.
15308 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
15309 pacify GCC's signed < unsigned warnings.
15310 * src/closure.c (itemsetsize): Likewise.
15311 * src/reader.c (symbol_list_new): Static.
15312
153132001-11-23 Akim Demaille <akim@epita.fr>
15314
15315 Attaching lineno to buckets is stupid, since only one copy of each
15316 symbol is kept, only the line of the first occurrence is kept too.
15317
15318 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
15319 * src/reader.c (rline_allocated): Remove, unused.
15320 (symbol_list): Have a `line' member.
15321 (symbol_list_new): New.
15322 (readgram): Use it.
15323 * src/print.c (print_grammar): Output the rule line numbers.
15324 * tests/regression.at (Solved SR Conflicts)
15325 (Unresolved SR Conflicts): Adjust.
15326 Reported by Hans Aberg.
15327
153282001-11-22 Marc Autret <autret_m@epita.fr>
15329
15330 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
15331
153322001-11-22 Marc Autret <autret_m@epita.fr>
15333
15334 * src/muscle_tab.c (muscle_init): Remove initialization of
15335 skeleton muscle.
15336 * src/output.c (output_master_parser): Do it here.
15337
153382001-11-20 Akim Demaille <akim@epita.fr>
15339
15340 * po/sv.po: New.
15341 * configure.in (ALL_LINGUAS): Adjust.
15342 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
15343 longer contains strings to translate.
15344
153452001-11-19 Akim Demaille <akim@epita.fr>
15346
15347 * src/conflicts.c (conflicts_print): Add a missing \n.
15348
153492001-11-19 Akim Demaille <akim@epita.fr>
15350
15351 * src/nullable.c (nullable_print): New.
15352 (set_nullable): Call it when tracing.
15353 Better locality of variables.
15354
153552001-11-19 Akim Demaille <akim@epita.fr>
15356
15357 * src/print.c (print_actions): Better locality of variables.
15358
153592001-11-19 Akim Demaille <akim@epita.fr>
15360
15361 * src/derives.c (print_derives): Fix and enrich.
15362 * src/closure.c (print_fderives): Likewise.
15363
153642001-11-19 Akim Demaille <akim@epita.fr>
15365
15366 * src/closure.c (itemsetend): Remove, replaced with...
15367 (itemsetsize): new.
15368
153692001-11-19 Akim Demaille <akim@epita.fr>
15370
15371 * src/LR0.c (kernel_end): Remove, replaced with...
15372 (kernel_size): new.
15373
153742001-11-19 Akim Demaille <akim@epita.fr>
15375
15376 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
15377 to clarify.
15378
153792001-11-19 Akim Demaille <akim@epita.fr>
15380
15381 * src/closure.c (closure): Use arrays instead of pointers to clarify.
15382
153832001-11-19 Akim Demaille <akim@epita.fr>
15384
15385 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
15386 trace messages.
15387 * src/LR0.c: Likewise.
15388 (allocate_itemsets): Use arrays instead of pointers to clarify.
15389
153902001-11-19 Akim Demaille <akim@epita.fr>
15391
15392 * src/getargs.c (statistics_flag): Replace with...
15393 (trace_flag): New.
15394 (longopts): Accept --trace instead of --statistics.
15395 * src/getargs.h, src/options.c: Adjust.
15396 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
15397 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
15398
153992001-11-19 Akim Demaille <akim@epita.fr>
15400
15401 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
15402 pointers to clarify the code.
15403 (save_reductions, save_shifts): Factor common parts of alternatives.
15404
154052001-11-19 Akim Demaille <akim@epita.fr>
15406
15407 * src/LR0.c (new_state, get_state): Complete TRACE code.
15408 * src/closure.c: Include `reader.h' to get `tags', needed by the
15409 trace code.
15410 Rename the conditional DEBUG as TRACE.
15411 Output consistently TRACEs to stderr, not stdout.
15412 * src/derives.c: Likewise.
15413 * src/reduce.c: (inaccessable_symbols): Using if is better style
15414 than goto.
15415 Use `#if TRACE' instead of `#if 0' for tracing code.
15416
154172001-11-19 Akim Demaille <akim@epita.fr>
15418
15419 * src/system.h (LIST_FREE, shortcpy): New.
15420 * src/LR0.c: Use them.
15421 * src/output.c (free_itemsets, free_reductions, free_shifts):
15422 Remove, replaced by LIST_FREE.
15423
154242001-11-19 Akim Demaille <akim@epita.fr>
15425
15426 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
15427 (REDUCTIONS_ALLOC): New.
15428 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
15429 allocation.
15430
154312001-11-19 Akim Demaille <akim@epita.fr>
15432
15433 * src/LR0.c (new_state): Complete trace code.
15434 * src/nullable.c (set_nullable): Don't translate traces.
15435
154362001-11-19 Akim Demaille <akim@epita.fr>
15437
15438 * src/print_graph.c (print_core): Better locality of variables.
15439 * src/print.c (print_core): Likewise.
15440
154412001-11-19 Akim Demaille <akim@epita.fr>
15442
15443 * src/vcg.c: You do the output, so you are responsible of the
15444 handling of VCG syntax, in particular: use quotearg.
15445 * src/print_graph.c: Don't.
15446 (print_actions): Don't output the actions as part of the nodes,
15447 since that's the job of the edges.
15448 (print_state): Don't output by hand: fill the node description,
15449 and ask for its output.
15450
154512001-11-19 Akim Demaille <akim@epita.fr>
15452
15453 * src/bison.simple (yyparse): When verbosely reporting an error,
15454 no longer put additional quotes around token names.
15455 * tests/calc.at: Adjust.
15456
154572001-11-19 Akim Demaille <akim@epita.fr>
15458
15459 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
15460 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
15461 * src/output.c: Adjust.
15462
154632001-11-19 Akim Demaille <akim@epita.fr>
15464
15465 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
15466 (rule_t): this.
15467 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
15468
154692001-11-19 Akim Demaille <akim@epita.fr>
15470
15471 * src/gram.h (rule_t): New.
15472 (rule_table): New.
15473 (rrhs, rlhs): Remove, part of state_t.
15474 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
15475 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15476 * src/reader.c, src/reduce.c: Adjust.
15477
154782001-11-19 Akim Demaille <akim@epita.fr>
15479
15480 * src/reader.c (symbols_output): New, extracted from...
15481 (packsymbols): Here.
15482 (reader): Call it.
15483
154842001-11-19 Akim Demaille <akim@epita.fr>
15485
15486 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
15487 (maxrhs): this new function.
15488
154892001-11-19 Akim Demaille <akim@epita.fr>
15490
15491 * src/lalr.c (F): New macro to access the variable F.
15492 Adjust.
15493
154942001-11-19 Akim Demaille <akim@epita.fr>
15495
15496 * src/lalr.h (LA): New macro to access the variable LA.
15497 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15498 * src/lalr.c: Adjust.
15499
155002001-11-19 Akim Demaille <akim@epita.fr>
15501
15502 * src/lalr.c (initialize_LA): Only initialize LA. Let...
15503 (set_state_table): handle the `lookaheads' members.
15504
155052001-11-19 Akim Demaille <akim@epita.fr>
15506
15507 * src/lalr.h (lookaheads): Removed array, whose contents is now
15508 a member of...
15509 (state_t): this structure.
15510 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15511 Adjust.
15512
155132001-11-19 Akim Demaille <akim@epita.fr>
15514
15515 * src/lalr.h (consistent): Removed array, whose contents is now
15516 a member of...
15517 (state_t): this structure.
15518 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15519 Adjust.
15520
155212001-11-19 Akim Demaille <akim@epita.fr>
15522
15523 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
15524 contents are now members of...
15525 (state_t): this structure.
15526 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15527 Adjust.
15528
155292001-11-19 Akim Demaille <akim@epita.fr>
15530
15531 * src/lalr.h (state_t): New.
15532 (state_table): Be a state_t * instead of a core **.
15533 (accessing_symbol): Remove, part of state_t.
15534 * src/lalr.c: Adjust.
15535 (set_accessing_symbol): Merge into...
15536 (set_state_table): this.
15537 * src/print_graph.c, src/conflicts.c: Adjust.
15538
155392001-11-14 Akim Demaille <akim@epita.fr>
15540
15541 * tests/calc.at, tests/output.at, tests/regression.at,
15542 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
15543 now the tests are run in private dirs, therefore AC_CLEANUP and
15544 family can be simplified to 0-ary.
15545 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
15546 use abs. path to find config.h.
15547 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
15548 stderr, there can be way too much random noise.
15549 Instead pass -Werror to GCC and rely on the exit status.
15550 Reported by Wolfram Wagner.
15551
155522001-11-14 Akim Demaille <akim@epita.fr>
15553
15554 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
15555 defined only if yyoverflow is defined, to avoid `warning: unused
15556 variable `yyvs1''.
15557 Reported by The Test Suite.
15558
155592001-11-14 Akim Demaille <akim@epita.fr>
15560
15561 * src/print.c: Include reduce.h.
15562 Reported by Hans Aberg.
15563
155642001-11-14 Akim Demaille <akim@epita.fr>
15565
15566 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
15567 Revert a previous patch: these are really const.
15568 * src/conflicts.c (conflict_report): Additional useless pair of
15569 braces to pacify GCC's warnings for `if () if () {} else {}'.
15570 * src/lex.c (parse_percent_token): Replace equal_offset with
15571 arg_offset.
15572 arg is const.
15573 Be sure to strdup `arg' when used, since there is no reason for
15574 token_buffer not to change.
15575
155762001-11-14 Akim Demaille <akim@epita.fr>
15577
15578 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
15579 definition.
15580 * src/main.c (main): Use them.
15581 Suggested by Hans Aberg.
15582
155832001-11-12 Akim Demaille <akim@epita.fr>
15584
15585 * src/system.h (ngettext): Now that we use ngettext, be sure to
15586 provide a default definition when NLS are not used.
15587
155882001-11-12 Akim Demaille <akim@epita.fr>
15589
15590 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
15591 Use @kbd to denote user input.
15592 (Language and Grammar): ANSIfy the example.
15593 Adjust its layout for info/notinfo.
15594 (Location Tracking Calc): Output error messages to stderr.
15595 Output locations in a more GNUtically correct way.
15596 Fix a couple of Englishos.
15597 Adjust @group/@end group pairs.
15598
155992001-11-12 Akim Demaille <akim@epita.fr>
15600
15601 %expect was not functioning at all.
15602
15603 * src/conflicts.c (expected_conflicts): Set to -1.
15604 (conflict_report): Use ngettext.
15605 (conflicts_print): Check %expect and make its violation an error.
15606 * doc/bison.texinfo (Expect Decl): Adjust.
15607 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
15608 * tests/regression.at (%expect not enough, %expect right)
15609 (%expect too much): New.
15610
156112001-11-12 Akim Demaille <akim@epita.fr>
15612
15613 * tests/regression.at (Conflicts): Rename as...
15614 (Unresolved SR Conflicts): this.
15615 (Solved SR Conflicts): New.
15616
156172001-11-12 Akim Demaille <akim@epita.fr>
15618
15619 * src/reduce.c (print_results): Rename as...
15620 (reduce_output): This.
15621 Output to OUT, passed as argument, instead of output_obstack.
15622 (dump_grammar): Likewise.
15623 (reduce_free): New.
15624 Also free V1.
15625 (reduce_grammar): No longer call reduce_output, since...
15626 * src/print.c (print_results): do it.
15627 * src/main.c (main): Call reduce_free;
15628
156292001-11-12 Akim Demaille <akim@epita.fr>
15630
15631 * src/conflicts.c (print_reductions): Accept OUT as argument.
15632 Output to it, not to output_obstack.
15633 * src/print.c (print_actions): Adjust.
15634
156352001-11-12 Akim Demaille <akim@epita.fr>
15636
15637 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
15638 the result instead of using...
15639 (src_total, rrc_total, src_count, rrc_count): Remove.
15640 (any_conflicts): Remove.
15641 (print_conflicts): Split into...
15642 (conflicts_print, conflicts_output): New.
15643 * src/conflicts.h: Adjust.
15644 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
15645 * src/print.c (print_grammar): Issue `\n' between two rules.
15646 * tests/regression.at (Conflicts): New.
15647 Reported by Tom Lane.
15648
156492001-11-12 Akim Demaille <akim@epita.fr>
15650
15651 * tests/regression.at (Invalid input): Remove, duplicate with
15652 ``Invalid input: 1''.
15653
156542001-11-12 Akim Demaille <akim@epita.fr>
15655
15656 * tests/torture.at (AT_DATA_STACK_TORTURE)
15657 (Exploding the Stack Size with Alloca)
15658 (Exploding the Stack Size with Malloc): New.
15659
156602001-11-12 Akim Demaille <akim@epita.fr>
15661
15662 * src/bison.simple (YYSTACK_REALLOC): New.
15663 (yyparse) [!yyoverflow]: Use it and free the old stack.
15664 Reported by Per Allansson.
15665
156662001-11-12 Pascal Bart <pascal.bart@epita.fr>
15667
15668 * src/bison.simple: Define type yystype instead of YYSTYPE, and
15669 define CPP macro, which substitute YYSTYPE by yystype.
15670 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
15671 with yyltype/YYLTYPE. This allows inclusion of the generated
15672 header within the parser if the compiler, such as GGC, accepts
15673 multiple equivalent #defines.
15674 From Akim.
15675
156762001-11-05 Akim Demaille <akim@epita.fr>
15677
15678 * src/reader.c (symbols_output): New, extracted from...
15679 (packsymbols): here.
15680 (reader): Adjust.
15681
156822001-11-05 Akim Demaille <akim@epita.fr>
15683
15684 * src/lex.c (parse_percent_token): s/quotearg/quote/.
15685
156862001-11-05 Akim Demaille <akim@epita.fr>
15687
15688 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
15689 pattern.
15690
156912001-11-05 Akim Demaille <akim@epita.fr>
15692
15693 * src/options.h (struct option_table_struct): set_flags is void*.
15694 * src/options.c (longopts): Support `--output' and `%output'.
15695 (usage): Adjust.
15696 * src/lex.h (tok_setopt): Remove, replaced with...
15697 (tok_intopt, tok_stropt): these new guys.
15698 * src/lex.c (getopt.h): Not needed.
15699 (token_buffer, unlexed_token_buffer): Not const.
15700 (percent_table): Promote `-' over `_' in directive names.
15701 Active `%name-prefix', `file-prefix', and `output'.
15702 (parse_percent_token): Accept possible arguments to directives.
15703 Promote `-' over `_' in directive names.
15704
157052001-11-04 Akim Demaille <akim@epita.fr>
15706
15707 * doc/bison.texinfo (Decl Summary): Split the list into
15708 `directives for grammars' and `directives for bison'.
15709 Sort'em.
15710 Add description of `%name-prefix', `file-prefix', and `output'.
15711 Promote `-' over `_' in directive names.
15712 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
15713 Simplify the description of `--name-prefix'.
15714 Promote `-' over `_' in directive names.
15715 Promote `--output' over `--output-file'.
15716 Fix the description of `--defines'.
15717 * tests/output.at: Exercise %file-prefix and %output.
15718
157192001-11-02 Akim Demaille <akim@epita.fr>
15720
15721 * doc/refcard.tex: Update.
15722
157232001-11-02 Akim Demaille <akim@epita.fr>
15724
15725 * src/symtab.h (SUNDEF): New.
15726 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
15727 stand for `uninitialized', instead of 0.
15728 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
15729 * src/lex.c (lex): Adjust.
15730
15731 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
15732 Number it 0.
15733 Let yylex return it instead of a plain 0.
15734 Reported by Dick Streefland.
15735
157362001-11-02 Akim Demaille <akim@epita.fr>
15737
15738 * tests/regression.at (Mixing %token styles): New test.
15739
157402001-11-02 Akim Demaille <akim@epita.fr>
15741
15742 * src/reader.c (parse_thong_decl): Formatting changes.
15743 (token_translations_init): New, extracted from...
15744 (packsymbols): Here.
15745 Adjust.
15746
157472001-11-01 Akim Demaille <akim@epita.fr>
15748
15749 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
15750 Check that `9foo.y' produces correct cpp guards.
15751 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
15752 guards.
15753 Reported by Wwp.
15754
157552001-11-01 Akim Demaille <akim@epita.fr>
15756
15757 * tests/regression.at (Invalid input: 2): New.
15758 * src/lex.c (unlexed_token_buffer): New.
15759 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
15760 too.
15761 Reported by Wwp.
15762
157632001-11-01 Akim Demaille <akim@epita.fr>
15764
15765 * tests/calc.at: Catch up with 1.30.
15766 * configure.in: Bump to 1.49a.
15767 Adjust to newer Autotest.
15768
157692001-10-19 Pascal Bart <pascal.bart@epita.fr>
15770
15771 * src/conflicts.c: Move global variables rrc_total and src_total ...
15772 (print_conflicts): here.
15773 * src/output.c (output): Free global variable user_toknums.
15774 * src/lex.c (token_obstack): Become static.
15775
157762001-10-18 Akim Demaille <akim@epita.fr>
15777
15778 * tests/atlocal.in (GCC): Add.
15779 * tests/calc.at: s/m4_match/m4_bmatch/.
15780 s/m4_patsubst/m4_bpatsubst/.
15781 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
15782 * configure.in: AC_SUBST(GCC).
15783
157842001-10-14 Marc Autret <autret_m@epita.fr>
15785
15786 * src/options.c (create_long_option_table): Fix.
15787
157882001-10-10 Akim Demaille <akim@epita.fr>
15789
15790 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
15791
157922001-10-04 Akim Demaille <akim@epita.fr>
15793
15794 * src/reader.c (parse_union_decl): Push the caracters in
15795 union_obstack, not attrs_obstack.
15796
157972001-10-04 Akim Demaille <akim@epita.fr>
15798
15799 Merge in the branch 1.29.
15800
15801 * src/reader.c (packsymbols): Use a temporary obstack for
15802 `%%tokendef', since output_stack is already used elsewhere.
15803
15804 2001-10-02 Akim Demaille <akim@epita.fr>
15805
15806 Bump 1.29d.
15807
15808 2001-10-02 Akim Demaille <akim@epita.fr>
15809
15810 Version 1.29c.
15811
15812 2001-10-02 Akim Demaille <akim@epita.fr>
15813
15814 * tests/regression.at (Invalid CPP headers): New.
15815 From Alexander Belopolsky.
15816 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
15817
15818 2001-10-02 Akim Demaille <akim@epita.fr>
15819
15820 * tests/regression.at (Invalid input): New.
15821 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
15822 Reported by Shura.
15823
15824 2001-10-02 Akim Demaille <akim@epita.fr>
15825
15826 * tests/calc.at: Now that --debug works, the tests must be adjusted.
15827
15828 2001-10-02 Akim Demaille <akim@epita.fr>
15829
15830 * src/output.c (output_parser): Assert `skeleton'.
15831 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
15832 systems.
15833 From Shura.
15834
15835 2001-10-01 Marc Autret <autret_m@epita.fr>
15836
15837 * src/lex.h: Echo modifications.
15838 * src/lex.c (unlex): Parameter is now token_t.
15839 From Hans Aberg.
15840
15841 2001-10-01 Marc Autret <autret_m@epita.fr>
15842
15843 * src/main.c: Include lex.h.
15844 From Hans Aberg.
15845
15846 2001-09-29 Akim Demaille <akim@epita.fr>
15847
15848 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
15849
15850 2001-09-28 Akim Demaille <akim@epita.fr>
15851
15852 * tests/testsuite.at: Update to newer Autotest.
15853 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
15854
15855 2001-09-27 Akim Demaille <akim@epita.fr>
15856
15857 Position independent wrapper.
15858
15859 * tests/bison: Remove.
15860 * tests/bison.in: New.
15861 * configure.in: Adjust.
15862
15863 2001-09-27 Paul Eggert <eggert@twinsun.com>
15864
15865 Port quotearg fixes from tar 1.13.24.
15866
15867 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
15868 tm to be declared.
15869 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
15870 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
15871
15872 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
15873 * m4/mbrtowc.m4: New file.
15874 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
15875 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
15876
15877 2001-09-27 Akim Demaille <akim@epita.fr>
15878
15879 Bump to 1.29c.
15880
15881 2001-09-27 Akim Demaille <akim@epita.fr>
15882
15883 Version 1.29b.
15884
15885 2001-09-25 Akim Demaille <akim@epita.fr>
15886
15887 * src/system.h: Include `xalloc.h'.
15888 Remove it from the C files.
15889 * src/files.c (output_files): Free the obstacks.
15890 * src/lex.c (init_lex): Rename as...
15891 (lex_init): this.
15892 (lex_free): New.
15893 * src/main.c (main): Use it.
15894
15895 2001-09-24 Marc Autret <autret_m@epita.fr>
15896
15897 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
15898 to output informations in fout (FILE*).
15899 (open_graph, close_graph): Likewise.
15900 (output_graph, output_edge, output_node): Likewise.
15901 * src/vcg.h: Update function prototypes.
15902 * src/print_graph.c (print_graph): Open output graph file.
15903 (print_actions): Adjust.
15904 * src/files.h: Remove extern declaration.
15905 * src/files.c: Remove graph_obstack declaration.
15906 (open_files): Remove graph_obstack initialization.
15907 (output_files): Remove graph_obstack saving.
15908
15909 2001-09-24 Marc Autret <autret_m@epita.fr>
15910
15911 * src/files.c (compute_output_file_names): Fix.
15912
15913 2001-09-24 Marc Autret <autret_m@epita.fr>,
15914 Akim Demaille <akim@epita.fr>
15915
15916 * src/reader.c (reader): Remove call to free_symtab ().
15917 * src/main.c (main): Call it here.
15918 Include symtab.h.
15919 * src/conflicts.c (initialize_conflicts): Rename as...
15920 (solve_conflicts): this.
15921 * src/print.c (print_core, print_actions, print_state)
15922 (print_grammar): Dump to a file instead a `output_obstack'.
15923 (print_results): Dump `output_obstack', and then proceed with the
15924 FILE *.
15925 * src/files.c (compute_output_file_names, close_files): New.
15926 (output_files): Adjust.
15927 * src/main.c (main): Adjust.
15928
15929 2001-09-23 Marc Autret <autret_m@epita.fr>
15930
15931 * src/files.c (compute_header_macro): Computes header macro name
15932 from spec_defines_file when given.
15933
15934 2001-09-23 Marc Autret <autret_m@epita.fr>
15935
15936 * src/files.c (output_files): Add default extensions.
15937
15938 2001-09-22 Akim Demaille <akim@epita.fr>
15939
15940 * src/conflicts.c (finalize_conflicts): Rename as...
15941 (free_conflicts): this.
15942
15943 2001-09-22 Akim Demaille <akim@epita.fr>
15944
15945 * src/gram.c (gram_free): Rename back as...
15946 (dummy): this.
15947 (output_token_translations): Free `token_translations'.
15948 * src/symtab.c (free_symtab): Free the tag field.
15949
15950 2001-09-22 Akim Demaille <akim@epita.fr>
15951
15952 Remove `translations' as it is always set to true.
15953
15954 * src/gram.h: Adjust.
15955 * src/reader.c (packsymbols, parse_token_decl): Adjust
15956 * src/print.c (print_grammar): Adjust.
15957 * src/output.c (output_token_translations): Adjust.
15958 * src/lex.c (lex): Adjust.
15959 * src/gram.c: Be sure the set pointers to NULL.
15960 (dummy): Rename as...
15961 (gram_free): this.
15962
15963 2001-09-22 Akim Demaille <akim@epita.fr>
15964
15965 * configure.in: Invoke AM_LIB_DMALLOC.
15966 * src/system.h: Use dmalloc.
15967 * src/LR0.c: Be sure to have pointers initialized to NULL.
15968 (allocate_itemsets): Allocate kernel_items only if needed.
15969
15970 2001-09-22 Akim Demaille <akim@epita.fr>
15971
15972 * configure.in: Bump to 1.29b.
15973 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
15974 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
15975 need xmalloc.c in calc.y.
15976 From Pascal Bart.
15977
15978 2001-09-21 Akim Demaille <akim@epita.fr>
15979
15980 Version 1.29a.
15981 * Makefile.maint, config/config.guess, config/config.sub,
15982 * config/missing: Update from masters.
15983 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
15984 upon package.m4.
15985 * configure.in (ALL_LINGUAS): Add `tr'.
15986
15987 2001-09-21 Akim Demaille <akim@epita.fr>
15988
15989 * tests/Makefile.am (package.m4): Move to...
15990 ($(srcdir)/$(TESTSUITE)): here.
15991
15992 2001-09-20 Akim Demaille <akim@epita.fr>
15993
15994 * src/complain.c: No longer try to be standalone: use system.h.
15995 Don't assume __STDC__ is defined to 1. Just test if it is defined.
15996 * src/complain.h: Likewise.
15997 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
15998 Remove the unused variable `n'.
15999 From Albert Chin-A-Young.
16000
16001 2001-09-18 Marc Autret <autret_m@epita.fr>
16002
16003 * doc/bison.1: Update.
16004 * doc/bison.texinfo (Bison Options): Update --defines and --graph
16005 descriptions.
16006 (Option Cross Key): Update.
16007 Add --graph.
16008
16009 2001-09-18 Marc Autret <autret_m@epita.fr>
16010
16011 * tests/regression.at: New test (comment in %union).
16012
16013 2001-09-18 Marc Autret <autret_m@epita.fr>
16014
16015 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
16016 do that.
16017 Reported by Keith Browne.
16018
16019 2001-09-18 Marc Autret <autret_m@epita.fr>
16020
16021 * tests/output.at: Add tests for --defines and --graph.
16022
16023 2001-09-18 Marc Autret <autret_m@epita.fr>
16024
16025 * tests/output.at: Removes tests of %{header,src}_extension features.
16026
16027 2001-09-18 Akim Demaille <akim@epita.fr>
16028
16029 * tests/Makefile.am (package.m4): New.
16030 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
16031 (_AT_CHECK_CALC_ERROR): Likewise.
16032 Factor the `, ' part of verbose error messages.
16033
16034 2001-09-18 Marc Autret <autret_m@epita.fr>
16035
16036 * src/getargs.c (longopts): Declare --defines and --graph as options
16037 with optional arguments.
16038 * src/files.h: Add extern declarations.
16039 * src/files.c (spec_graph_file, spec_defines_file): New.
16040 (output_files): Update.
16041 Remove CPP-outed code.
16042
16043 2001-09-18 Marc Autret <autret_m@epita.fr>
16044
16045 Turn off %{source,header}_extension feature.
16046
16047 * src/files.c (compute_exts_from_gf): Update.
16048 (compute_exts_from_src): Update.
16049 (output_files): CPP-out useless code.
16050 * src/files.h: Remove {header,source}_extension extern declarations.
16051 * src/reader.c (parse_dquoted_param): CPP-out.
16052 (parse_header_extension_decl): Remove.
16053 (parse_source_extension_decl): Remove.
16054 (read_declarations): Remove cases tok_{hdrext,srcext}.
16055 * src/lex.c (percent_table): Remove {header,source}_extension entries.
16056 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
16057
16058 2001-09-10 Akim Demaille <akim@epita.fr>
16059
16060 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
16061 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
16062 (AT_CHECK_OUTPUT): this.
16063 Merely check ls' exit status, its output is useless.
16064
16065 2001-09-10 Akim Demaille <akim@epita.fr>
16066
16067 * tests/calc.at: Use m4_match.
16068 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
16069
16070 2001-09-10 Marc Autret <autret_m@epita.fr>,
16071 Akim Demaille <akim@epita.fr>
16072
16073 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
16074 enum color_e.
16075 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
16076 to `normal'.
16077 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
16078 * src/lex.h: Adjust prototype.
16079 (token_t): Add `tok_undef'.
16080 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
16081 (parse_percent_token): Now returns token_t.
16082 Add default statement in switch.
16083 (lex): Separate `c' as an input variable, from the token_t result
16084 part.
16085 (unlexed): Is a token_t.
16086
16087 2001-09-10 Akim Demaille <akim@epita.fr>
16088
16089 * configure.in: Bump to 1.29a.
16090
16091 2001-09-07 Akim Demaille <akim@epita.fr>
16092
16093 Version 1.29.
16094
16095 2001-08-30 Akim Demaille <akim@epita.fr>
16096
16097 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
16098 * m4/atconfig.m4: Remove.
16099 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
16100 * tests/bison: New.
16101 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
16102 m4_if, m4_patsubst, and m4_regexp.
16103 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
16104 `input' file instead of echo.
16105
16106 2001-08-29 Akim Demaille <akim@epita.fr>
16107
16108 Bump to 1.28e.
16109
16110 2001-08-29 Akim Demaille <akim@epita.fr>
16111
16112 Version 1.28d.
16113
16114 2001-08-29 Paul Eggert <eggert@twinsun.com>
16115
16116 * src/bison.simple (yyparse): Don't take the address of an
16117 item before the start of an array, as that doesn't conform to
16118 the C Standard.
16119
16120 2001-08-29 Robert Anisko <anisko_r@epita.fr>
16121
16122 * doc/bison.texinfo (Location Tracking Calc): New node.
16123
16124 2001-08-29 Paul Eggert <eggert@twinsun.com>
16125
16126 * src/output.c (output): Do not define const, as this now
16127 causes more problems than it cures.
16128
16129 2001-08-29 Akim Demaille <akim@epita.fr>
16130
16131 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
16132 the nodes.
16133 Be sure to tag the `detailmenu'.
16134
16135 2001-08-29 Akim Demaille <akim@epita.fr>
16136
16137 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
16138 download in a tmp dir.
16139
16140 2001-08-28 Marc Autret <autret_m@epita.fr>
16141
16142 * config/depcomp: New file.
16143
16144 2001-08-28 Marc Autret <autret_m@epita.fr>
16145
16146 * doc/bison.1 (mandoc): Adjust.
16147 From Juan Manuel Guerrero.
16148
16149 2001-08-28 Marc Autret <autret_m@epita.fr>
16150
16151 * src/print_graph.c (print_state): Fix.
16152
16153 2001-08-27 Marc Autret <autret_m@epita.fr>
16154
16155 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
16156 char * members.
16157 Echo modifications to the functions prototypes.
16158 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
16159
16160 2001-08-27 Marc Autret <autret_m@epita.fr>
16161
16162 * src/vcg.c: Include `xalloc.h'.
16163 (add_colorentry): New.
16164 (add_classname): New.
16165 (add_infoname): New.
16166 * src/vcg.h: Add new prototypes.
16167
16168 2001-08-27 Akim Demaille <akim@epita.fr>
16169
16170 * Makefile.maint: Sync. again with CVS Autoconf.
16171
16172 2001-08-27 Akim Demaille <akim@epita.fr>
16173
16174 * Makefile.maint: Formatting changes.
16175 (po-update, cvs-update, update): New targets.
16176 (AMTAR): Remove.
16177
16178 2001-08-27 Akim Demaille <akim@epita.fr>
16179
16180 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16181 * Makefile.maint: Sync. with CVS Autoconf.
16182
16183 2001-08-27 Marc Autret <autret_m@epita.fr>
16184
16185 * src/vcg.h (struct infoname_s): New.
16186 (struct colorentry_s): New.
16187 (graph_s): New fields {vertical,horizontal}_order in structure.
16188 Add `infoname' field.
16189 Add `colorentry' field;
16190 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
16191 (G_HORIZONTAL_ORDER): New.
16192 (G_INFONAME): New.
16193 (G_COLORENTRY): New.
16194 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
16195 Add output of `infoname'.
16196 Add output of `colorentry'.
16197
16198 2001-08-27 Marc Autret <autret_m@epita.fr>
16199
16200 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
16201 This one shadowed a global parameter.
16202
16203 2001-08-24 Marc Autret <autret_m@epita.fr>
16204
16205 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
16206 instead of `unsigned'.
16207 (print_state): Do not call obstack_object_size () in obstack_grow ()
16208 to avoid macro variables shadowing.
16209
16210 2001-08-23 Marc Autret <autret_m@epita.fr>
16211
16212 * src/lex.c (percent_table): Typo: s/naem/name/.
16213 Add graph option.
16214 Normalize new options declarations.
16215
16216 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
16217
16218 * tests/suite.at: Exercise %header_extension and %source_extension.
16219
16220 2001-08-16 Marc Autret <autret_m@epita.fr>
16221
16222 * src/reader.c (parse_dquoted_param): New.
16223 (parse_header_extension_decl): Use it.
16224 (parse_source_extension_decl): Likewise.
16225
16226 2001-08-16 Marc Autret <autret_m@epita.fr>
16227
16228 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
16229 (get_xxxx_str): Use assert () instead of complain ().
16230 Remove return invokations in default cases.
16231 (get_decision_str): Modify default behaviour. Remove second argument.
16232 Echo modifications on calls.
16233 (output_graph): Fix.
16234
16235 2001-08-16 Marc Autret <autret_m@epita.fr>
16236
16237 * src/getargs.c (usage): Update with ``-g, --graph''.
16238
16239 2001-08-16 Marc Autret <autret_m@epita.fr>
16240
16241 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
16242 (Option Cross Key): Likewise.
16243 * doc/bison.1: Update.
16244
162452001-09-25 Pascal Bart <pascal.bart@epita.fr>
16246
16247 * src/output.c (output_master_parser): Don't finish action_obstack.
16248 (output_parser): Don't care about the muscle action, here.
16249 (prepare): Copy the action_obstack in the action muscle.
16250 (output): Free action_obstack.
16251
162522001-09-23 Pascal Bart <pascal.bart@epita.fr>
16253
16254 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
16255 will contain `%union' declaration.
16256 (parse_union_decl): Delete #line directive output.
16257 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
16258 informations about %union.
16259 (parse_union_decl): Copy the union_obstack in the muscle stype.
16260 * src/bison.simple: Add new #line directive.
16261 Add typdef %%stype YYSTYPE.
16262
162632001-09-23 Pascal Bart <pascal.bart@epita.fr>
16264
16265 * src/bison.simple: Add new `#line' directive.
16266
162672001-09-22 Pascal Bart <pascal.bart@epita.fr>
16268
16269 * src/bison.simple: New `#line' directive.
16270 * src/output.c (output_parser): Support new dynamic muscle input_line.
16271
162722001-09-22 Marc Autret <autret_m@epita.fr>
16273
16274 * src/output.c (output_master_parser): New.
16275 (output_parser): Be more re-entrant.
16276
162772001-09-21 Marc Autret <autret_m@epita.fr>
16278
16279 * src/reader.c (copy_definition, parse_union_decl): Update and use
16280 `linef' muscle.
16281 (copy_action): Likewise.
16282 Use obstack_1grow ().
16283 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
16284
162852001-09-21 Marc Autret <autret_m@epita.fr>
16286
16287 * src/options.c (option_table): Adjust.
16288 * src/lex.c (parse_percent_token): Fix.
16289
162902001-09-20 Pascal Bart <pascal.bart@epita.fr>
16291
16292 * src/options.c (symtab.h): Include it, need by lex.h.
16293
162942001-09-20 Pascal Bart <pascal.bart@epita.fr>
16295
16296 * src/lex.c (parse_percent_token): Change type of variable `tx', which
16297 is now an option_table_struct*.
16298 (option_strcmp): New function option_strcmp.
16299 (parse_percent_token): Call option_strcmp.
16300 * src/getargs.c (xalloc.h, options.h): Include it.
16301 (getargs): Call create_long_option_table.
16302 (getargs): Free longopts at the end of the function.
16303 (shortopts): Move in options.c.
16304 * src/options.c (create_long_option_table): New function. Convert
16305 information from option_table to option structure.
16306 * src/reader.c (options.h): Include it.
16307
16308 * src/Makefile.am: Adjust.
16309 * src/options.c (option_table): Create from longopts and percent_table.
16310 * src/getargs.c (longopts): Delete.
16311 * src/lex.c (struct percent_table_struct): Delete.
16312 (percent_table): Delete.
16313 (options.h): Include it.
16314 * src/options.c: Create.
16315 * src/options.h: Create.
16316 Declare enum opt_access_e.
16317 Define struct option_table_struct.
16318
163192001-09-20 Marc Autret <autret_m@epita.fr>
16320
16321 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
16322 sections of Bison.
16323
163242001-09-19 Pascal Bart <pascal.bart@epita.fr>
16325
16326 * src/bison.simple: s/%%filename/%%skeleton.
16327 * src/muscle_tab.c (getargs.h): Include it.
16328 (muscle_init): Insert new muscle skeleton.
16329
163302001-09-18 Pascal Bart <pascal.bart@epita.fr>
16331
16332 * src/output.c (output_parser): Delete unused variable actions_dumped.
16333
163342001-09-07 Pascal Bart <pascal.bart@epita.fr>
16335
16336 * src/output.c (output): Delete call to reader_output_yylsp.
16337 * src/reader.c (reader): Likewise.
16338 * src/reader.h: Delete declaration of reader_output_yylsp.
16339
163402001-09-02 Marc Autret <autret_m@epita.fr>
16341
16342 * src/reader.c: Include muscle_tab.h.
16343 (parse_union_decl): Update.
16344 (parse_macro_decl): Rename parse_muscle_decl.
16345 Update to use renamed functions and variable.
16346 (read_declarations, copy_action, read_additionnal_code, : Updated
16347 with correct variables and functions names.
16348 (packsymbols, reader): Likewise.
16349
16350 * src/reader.h (muscle_obstack): Extern declaration update.
16351
16352 * src/output.c: Include muscle_tab.h
16353 In all functions using macro_insert, change by using muscle_insert ().
16354 (macro_obstack): Rename muscle_obstack.
16355 Echo modifications in the whole file.
16356 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
16357 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
16358 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
16359
16360 * src/muscle_tab.h: Update double inclusion macros.
16361 (macro_entry_s): Rename muscle_entry_s.
16362 Update prototypes.
16363
16364 * src/muscle_tab.c: Include muscle_tab.h.
16365 Rename macro_tabble to muscle_table.
16366 (mhash1, mhash2, mcmp): Use muscle_entry.
16367 (macro_init): Rename muscle_init. Update.
16368 (macro_insert): Rename muscle_insert. Update.
16369 (macro_find): Rename muscle_find. Update.
16370
16371 * src/main.c: Include muscle_tab.h.
16372 (main): Call muscle_init ().
16373 * src/Makefile.am (bison_SOURCES): Echo modifications.
16374
163752001-09-02 Marc Autret <autret_m@epita.fr>
16376
16377 Now the files macro_tab.[ch] are named muscle_tab.[ch].
16378
16379 * src/muscle_tab.c, src/muscle_tab.h: Add files.
16380
163812001-09-02 Marc Autret <autret_m@epita.fr>
16382
16383 * src/macrotab.c, src/macrotab.h: Remove.
16384
163852001-09-01 Pascal Bart <pascal.bart@epita.fr>
16386
16387 * src/reader.c (copy_guard): Use muscle to specify the `#line'
16388 filename.
16389
163902001-09-01 Marc Autret <autret_m@epita.fr>
16391
16392 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
16393 to an explicit value to activate the feature. We do it here.
16394
163952001-08-31 Pascal Bart <pascal.bart@epita.fr>
16396
16397 * src/output.c (prepare): Delete the `filename' muscule insertion.
16398 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
16399 (parse_union_decl): Likewise.
16400 * src/macrotab.c (macro_init): Initialize filename by infile.
16401
164022001-08-31 Marc Autret <autret_m@epita.fr>
16403
16404 * src/bison.simple (YYLSP_NEEDED): New definition.
16405 * src/output.c (prepare): Add macro insertion of `locations_flag'
16406
164072001-08-31 Pascal Bart <pascal.bart@epita.fr>
16408
16409 * src/output.c (prepare): Delete insertion of previous muscles,
16410 and insert the `prefix' muscles.
16411 * src/macrotab.c (macro_init): Likewise.
16412 (macro_init): Initialization prefix directive by `yy'.
16413 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
16414 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
16415 yylval, yydebug, yyerror, yynerrs and yyparse.
16416 New directive `#define' to substitute yydebug, ... with option
16417 name_prefix.
16418
164192001-08-31 Pascal Bart <pascal.bart@epita.fr>
16420
16421 * src/main.c (main): Standardize.
16422 * src/output.c (output_table_data, output_parser): Likewise.
16423 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
16424
164252001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
16426
16427 * src/reader.c (read_additionnal_code): Rename %%user_code to
16428 %%epilogue.
16429 * src/output.c (output): Rename %%declarations to %%prologue.
16430 * src/bison.simple: Echo modifications.
16431
164322001-08-31 Marc Autret <autret_m@epita.fr>
16433
16434 * src/reader.c (readgram): CleanUp.
16435 (output_token_defines): Likewise.
16436 (packsymbols): Likewise.
16437 (reader): Likewise.
16438 * src/output.c (output): CPP-out useless code.
16439
164402001-08-31 Pascal Bart <pascal.bart@epita.fr>
16441
16442 * src/reader.c (reader): Delete obsolete call to function
16443 output_trailers and output_headers.
16444 * src/output.h: Remove obsolete functions prototypes of output_headers
16445 and output_trailers.
16446
164472001-08-30 Pascal Bart <pascal.bart@epita.fr>
16448
16449 * src/main.c: Include macrotab.h.
16450 * src/macrotab.h (macro_entry_s): Constify fields.
16451 Adjust functions prototypes.
16452 * src/macrotab.c (macro_insert): Constify key and value.
16453 (macro_find): Constify key.
16454 (macro_insert): Include 'xalloc.h'
16455 (macro_insert): Use XMALLOC.
16456 (macro_find): Constify return value.
16457 * src/output.c (output_table_data): Rename table to table_data.
16458 (output_parser): Constify macro_key, macro_value.
16459
164602001-08-30 Marc Autret <autret_m@epita.fr>
16461
16462 * src/reader.c (parse_skel_decl): New.
16463 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
16464 * src/lex.h (token_t): New token `tok_skel'.
16465 * src/lex.c (percent_table): Add skeleton option entry.
16466 Standardize.
16467
164682001-08-29 Marc Autret <autret_m@epita.fr>
16469
16470 * src/bison.simple: Add %%user_code directive at the end.
16471 * src/reader.c (read_additionnal_code): New.
16472 (reader): Use it.
16473 * src/output.c (output_program): Remove.
16474 (output): Update.
16475
164762001-08-28 Marc Autret <autret_m@epita.fr>
16477
16478 * src/output.c (output_actions): Clean up.
16479 (output_gram): CPP-out useless code.
16480 * src/reader.c (reader): Clean up, CPP-out useless code.
16481
164822001-08-28 Pascal Bart <pascal.bart@epita.fr>
16483
16484 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
16485 directive.
16486 * src/bison.simple: Add `%%definitions'.
16487
164882001-08-28 Marc Autret <autret_m@epita.fr>
16489
16490 * config/depcomp: New file.
16491
164922001-08-27 Paul Eggert <eggert@twinsun.com>
16493
16494 * src/bison.simple (yyparse): Don't take the address of an
16495 item before the start of an array, as that doesn't conform to
16496 the C Standard.
16497
164982001-08-27 Robert Anisko <robert.anisko@epita.fr>
16499
16500 * src/output.c (output): Remove the initialization of the macro
16501 obstack. It was done too late here.
16502
16503 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
16504 completely wrong.
16505 (reader): Initialize the macro obstack here, since we need it to grow
16506 '%define' directives.
16507
16508 * src/reader.h: Declare the macro obstack as extern.
16509
165102001-08-27 Robert Anisko <robert.anisko@epita.fr>
16511
16512 * src/output.c (output_parser): Fix. Store single '%' characters in
16513 the output obstack instead of throwing them away.
16514
165152001-08-27 Akim Demaille <akim@epita.fr>
16516
16517 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16518
165192001-08-25 Robert Anisko <robert.anisko@epita.fr>
16520
16521 * lib/Makefile.am: Adjust.
16522
165232001-08-25 Robert Anisko <robert.anisko@epita.fr>
16524
16525 * src/bison.simple: Update and add '%%' directives.
16526
165272001-08-25 Robert Anisko <robert.anisko@epita.fr>
16528
16529 * src/reader.c (reader): Remove calls to 'output_headers' and
16530 'output_trailers'. Remove some C output.
16531 (readgram): Disable a piece of code that was writing a default
16532 definition for 'YYSTYPE'.
16533 (reader_output_yylsp): Remove.
16534 (packsymbols): Output token defintions to a macro.
16535 (copy_definition): Disable C output.
16536
16537 * src/reader.c (parse_macro_decl): New function used to parse macro
16538 declarations.
16539 (copy_string2): Put the body of copy_string into this new function.
16540 Add a parameter to let the caller choose whether he wants to copy the
16541 string delimiters or not.
16542 (copy_string): Be a simple call to copy_string2 with the last argument
16543 bound to true.
16544 (read_declarations): Add case for macro definition.
16545 (copy_identifier): New.
16546 (parse_macro_decl): Read macro identifiers using copy_identifier
16547 rather than lex.
16548
165492001-08-25 Robert Anisko <robert.anisko@epita.fr>
16550
16551 * src/output.c (prepare): Add prefixed names.
16552 (output_parser): Output semantic actions.
16553 (output_parser): Fix bug on '%%line' directives.
16554
16555 * src/output.c (output_headers): Remove. The C code printed by this
16556 function should now be in the skeletons.
16557 (output_trailers): Remove.
16558 (output): Disable call to 'reader_output_yylsp'.
16559 (output_rule_data): Do not output tables to the table obstack.
16560
16561 * src/output.c: Remove some C dedicated output.
16562 Improve the use of macro and output obstacks.
16563 (output_defines): Remove.
16564
16565 * src/output.c (output_token_translations): Associate 'translate'
16566 table with a macro. No output to the table obstack.
16567 (output_gram): Same for 'rhs' and 'prhs'.
16568 (output_stos): Same for 'stos'.
16569 (output_rule_data): Same for 'r1' and 'r2'.
16570 (token_actions): Same for 'defact'.
16571 (goto_actions): Same for 'defgoto'.
16572 (output_base): Same for 'pact' and 'pgoto'.
16573 (output_table): Same for 'table'.
16574 (output_check): Same for 'check'.
16575
16576 * src/output.c (output_table_data): New function.
16577 (output_short_table): Remove.
16578 (output_short_or_char_table): Remove.
16579
16580 * src/output.c (output_parser): Replace most of the skeleton copy code
16581 with something new. Skeletons are now processed character by character
16582 rather than line by line, and Bison looks for '%%' macros. This is the
16583 first step in making Bison's output process (a lot) more flexible.
16584 (output_parser): Use the macro table.
16585
165862001-08-25 Robert Anisko <robert.anisko@epita.fr>
16587
16588 * src/main.c (main): Initialize the macro table.
16589
165902001-08-25 Robert Anisko <robert.anisko@epita.fr>
16591
16592 * src/lex.c (percent_table): Add tok_define.
16593 * src/lex.h: Add tok_define.
16594
165952001-08-25 Robert Anisko <robert.anisko@epita.fr>
16596
16597 * src/macrotab.c: New file.
16598 * src/macrotab.h: New file.
16599 * src/Makefile.am: Update.
16600
166012001-08-25 Robert Anisko <robert.anisko@epita.fr>
16602
16603 * lib/hash.c: New file.
16604 * lib/hash.h: New file.
16605 * lib/Makefile.am: Update.
16606
166072001-08-15 Akim Demaille <akim@epita.fr>
16608
16609 Version 1.28c.
16610
166112001-08-15 Marc Autret <autret_m@epita.fr>
16612
16613 * src/reader.c (readgram): Indent output macro YYSTYPE.
16614 (packsymbols): Likewise.
16615 (output_token_defines): Likewise.
16616 * src/files.c: Standardize.
16617 (compute_header_macro): New.
16618 (defines_obstack_save): New. Use compute_header_macro.
16619 (output_files): Update. Use defines_obstack_save.
16620
166212001-08-15 Akim Demaille <akim@epita.fr>
16622
16623 * doc/bison.texinfo (Table of Symbols): Document
16624 YYSTACK_USE_ALLOCA.
16625
166262001-08-15 Akim Demaille <akim@epita.fr>
16627
16628 * missing: Update from CVS Automake.
16629 * config/config.guess, config/config.sub, config/texinfo.tex:
16630 Update from gnu.org.
16631
166322001-08-15 Akim Demaille <akim@epita.fr>
16633
16634 * Makefile.maint: Sync with CVS Autoconf.
16635
166362001-08-14 Pascal Bart <pascal.bart@epita.fr>
16637
16638 * doc/bison.texinfo: Include GNU Free Documentation License from
16639 `fdl.texi'.
16640 * doc/fdl.texi: Add to package.
16641
166422001-08-14 Marc Autret <autret_m@epita.fr>
16643
16644 Turn on %{source,header}_extension features.
16645
16646 * src/lex.c (percent_table): Un-CPP out header_extension and
16647 source_extension.
16648 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
16649 (compute_exts_from_src): Remove conditions. It restores priorities
16650 between options.
16651
166522001-08-14 Marc Autret <autret_m@epita.fr>
16653
16654 * src/files.c (compute_base_names): Add extensions computing when
16655 `--file-prefix' used.
16656 Standardize function calls.
16657
166582001-08-13 Marc Autret <autret_m@epita.fr>
16659
16660 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
16661 defining it (defined but null disables alloca).
16662
166632001-08-13 Marc Autret <autret_m@epita.fr>
16664
16665 * src/bison.simple (_yy_memcpy): CPP reformat.
16666
166672001-08-13 Pascal Bart <pascal.bart@epita.fr>
16668
16669 * tests/atconfig.in (CPPFLAGS): Fix.
16670
166712001-08-10 Pascal Bart <pascal.bart@epita.fr>
16672
16673 * doc/bison.texinfo: Include GNU General Public License from
16674 `gpl.texi'.
16675 * doc/gpl.texi: Add to package.
16676
166772001-08-10 Marc Autret <autret_m@epita.fr>
16678
16679 * src/print_graph.h: Fix.
16680 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
16681
166822001-08-10 Akim Demaille <akim@epita.fr>
16683
16684 * src/system.h: Provide default declarations for stpcpy, strndup,
16685 and strnlen.
16686
166872001-08-10 Robert Anisko <anisko_r@epita.fr>
16688
16689 * doc/bison.texinfo (Locations): Update @$ stuff.
16690
166912001-08-09 Robert Anisko <anisko_r@epita.fr>
16692
16693 * src/bison.simple (YYLLOC_DEFAULT): Update.
16694 (yyparse): Adjust.
16695
166962001-08-08 Marc Autret <autret_m@epita.fr>
16697
16698 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
16699 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
16700 Reported by Fabrice Bauzac.
16701
167022001-08-08 Marc Autret <autret_m@epita.fr>
16703
16704 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
16705 * src/vcg.c (output_node): Fix.
16706 * src/vcg.h: Cleanup.
16707 * src/print_graph.c: Add comments.
16708 (node_output_size): New global variable. Simplify the formatting of
16709 the VCG graph output.
16710 (print_actions): Unused code is now used. It notifies the final state
16711 and no action states in the VCG graph. It also give the reduce actions.
16712 The `shift and goto' edges are red and the `go to state' edges are
16713 blue.
16714 Get the current node name and node_obstack by argument.
16715 (node_obstack): New variable.
16716 (print_state): Manage node_obstack.
16717 (print_core): Use node_obstack given by argument.
16718 A node is not only computed here but in print_actions also.
16719 (print_graph): CPP out useless code instead of commenting it.
16720
167212001-08-07 Pascal Bart <pascal.bart@epita.fr>
16722
16723 * tests/atconfig.in (CPPFLAGS): Fix.
16724
167252001-08-07 Akim Demaille <akim@epita.fr>
16726
16727 * src/print_graph.c (quote): New.
16728 (print_core): Use it.
16729
167302001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
16731
16732 * src/vcg.c (complain.h): Include it.
16733 Unepitaize `return' invocations.
16734 [NDEBUG] (main): Remove.
16735 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
16736 * src/files.c (open_files): Initialize graph_obstack.
16737 * src/print_graph.c (print_actions): CPP out useless code.
16738 (print_core): Don't output the last `\n' in labels.
16739 Use `quote'.
16740 * src/files.c (output_files): Output the VCG file.
16741 * src/main.c (main): Invoke print_graph ();
16742
167432001-08-06 Marc Autret <autret_m@epita.fr>
16744
16745 Automaton VCG graph output.
16746 Using option ``-g'' or long option ``--graph'', you can generate
16747 a gram_filename.vcg file containing a VCG description of the LALR (1)
16748 automaton of your grammar.
16749
16750 * src/main.c: Call to print_graph() function.
16751 * src/getargs.h: Update.
16752 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
16753 (graph_flag): New flag.
16754 (longopts): Update.
16755 (getargs): Add case `g'.
16756 * src/files.c (graph_obstack): New obstack struct.
16757 (open_files): Initialize new obstack.
16758 (output_files): Saves graph_obstack if required.
16759 * src/files.h (graph_obstack): New extern declaration.
16760 * src/Makefile.am: Add new source files.
16761
167622001-08-06 Marc Autret <autret_m@epita.fr>
16763
16764 * src/print_graph.c, src/print_graph.h (graph): New.
16765 * src/vcg.h: New file.
16766 * src/vcg.c: New file, VCG graph handling.
16767
167682001-08-06 Marc Autret <autret_m@epita.fr>
16769
16770 Add of %source_extension and %header_extension which specify
16771 the source or/and the header output file extension.
16772
16773 * src/files.c (compute_base_names): Remove initialisation of
16774 src_extension and header_extension.
16775 (compute_exts_from_gf): Update.
16776 (compute_exts_from_src): Update.
16777 (output_files): Update.
16778 * src/reader.c (parse_header_extension_decl): New.
16779 (parse_source_extension_decl): New.
16780 (read_declarations): New case statements for the new tokens.
16781 * src/lex.c (percent_table): Add entries for %source_extension
16782 and %header_extension.
16783 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
16784
167852001-08-06 Marc Autret <autret_m@epita.fr>
16786
16787 * configure.in: Bump to 1.28c.
16788 * doc/bison.texinfo: Texinfo thingies.
16789
167902001-08-04 Pascal Bart <pascal.bart@epita.fr>
16791
16792 * tests/atconfig.in (CPPFLAGS): Add.
16793 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
16794
167952001-08-03 Akim Demaille <akim@epita.fr>
16796
16797 Version 1.28b.
16798
167992001-08-03 Akim Demaille <akim@epita.fr>
16800
16801 * tests/Makefile.am (check-local): Ship testsuite.
16802 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
16803 Include `string.h'.
16804
168052001-08-03 Akim Demaille <akim@epita.fr>
16806
16807 * configure.in: Try using -Wformat when compiling.
16808
168092001-08-03 Akim Demaille <akim@epita.fr>
16810
16811 * configure.in: Bump to 1.28b.
16812
168132001-08-03 Akim Demaille <akim@epita.fr>
16814
16815 * src/complain.c: Adjust strerror_r portability issues.
16816
168172001-08-03 Akim Demaille <akim@epita.fr>
16818
16819 Version 1.28a.
16820
168212001-08-03 Akim Demaille <akim@epita.fr>
16822
16823 * src/getargs.c, src/getarg.h (skeleton)): Constify.
16824 * src/lex.c (literalchar): Avoid name clashes on `buf'.
16825 * src/getargs.c: Include complain.h.
16826 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
16827 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
16828
168292001-08-03 Akim Demaille <akim@epita.fr>
16830
16831 * src/reader.c (readgram): Display hidden chars in error messages.
16832
168332001-08-03 Akim Demaille <akim@epita.fr>
16834
16835 Update to gettext 0.10.39.
16836
168372001-08-03 Akim Demaille <akim@epita.fr>
16838
16839 * lib/strspn.c: New.
16840
168412001-08-01 Marc Autret <autret_m@epita.fr>
16842
16843 * doc/bison.texinfo: Update.
16844 * doc/bison.1 (mandoc): Update.
16845 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
16846 * src/files.c: Support output files extensions computing.
16847 (src_extension): New static variable.
16848 (header_extension): New static variable.
16849 (tr): New function.
16850 (get_extension_index): New function, gets the index of an extension
16851 filename in a string.
16852 (compute_exts_from_gf): New function, computes extensions from the
16853 grammar file extension.
16854 (compute_exts_from_src): New functions, computes extensions from the
16855 C source file extension, file given by ``-o'' option.
16856 (compute_base_names): Update.
16857 (output_files): Update.
16858
168592001-08-01 Robert Anisko <anisko_r@epita.fr>
16860
16861 * doc/bison.texi: Document @$.
16862 (Locations): New section.
16863
168642001-07-18 Akim Demaille <akim@epita.fr>
16865
16866 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
16867 * config/prev-version.txt, config/move-if-change: New.
16868 * Makefile.am: Adjust.
16869
168702001-07-08 Pascal Bart <pascal.bart@epita.fr>
16871
16872 * src/bison.simple (yyparse): Suppress warning `comparaison
16873 between signed and unsigned'.
16874
168752001-07-05 Pascal Bart <pascal.bart@epita.fr>
16876
16877 * src/getargs.h (raw_flag): Remove.
16878 * src/getargs.c: Die on `-r'/`--raw'.
16879 * src/lex.c (parse_percent_token): Die on `%raw'.
16880 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
16881 * tests/calc.at: Suppress test with option `--raw'.
16882
168832001-07-14 Akim Demaille <akim@epita.fr>
16884
16885 * config/: New.
16886 * configure.in: Require Autoconf 2.50.
16887 Update to gettext 0.10.38.
16888
168892001-03-16 Akim Demaille <akim@epita.fr>
16890
16891 * doc/bison.texinfo: ANSIfy the examples.
16892
168932001-03-16 Akim Demaille <akim@epita.fr>
16894
16895 * getargs.c (skeleton): New variable.
16896 (longopts): --skeleton is a new option.
16897 (shortopts, getargs): -S is a new option.
16898 * getargs.h: Declare skeleton.
16899 * output.c (output_parser): Use it.
16900
169012001-03-16 Akim Demaille <akim@epita.fr>
16902
16903 * m4/strerror_r.m4: New.
16904 * m4/error.m4: Run AC_FUNC_STRERROR_R.
16905 * lib/error.h, lib/error.c: Update.
16906
169072001-03-16 Akim Demaille <akim@epita.fr>
16908
16909 * src/getargs.c (longopts): Clean up.
16910
169112001-02-21 Akim Demaille <akim@epita.fr>
16912
16913 * src/reader.c (gensym): `gensym_count' is your own.
16914 Use a static buf to create the symbol name, as token_buffer is no
16915 longer a buffer.
16916
169172001-02-08 Akim Demaille <akim@epita.fr>
16918
16919 * src/conflicts.c (conflict_report): Be sure not to append to res
16920 between two calls, which could happen if both first sprintf were
16921 skipped, but not the first cp += strlen.
16922
169232001-02-08 Akim Demaille <akim@epita.fr>
16924
16925 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
16926 New, from fileutils 4.0.37.
16927 * configure.in: Require Autoconf 2.49c. I took some time before
16928 making this decision. This is the only way out for portability
16929 issues in Bison, it would mean way too much duplicate effort to
16930 import in Bison features implemented in 2.49c since 2.13.
16931 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
16932
169332001-02-02 Akim Demaille <akim@epita.fr>
16934
16935 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
16936 * lib/xalloc.h, lib/xmalloc.c: Update.
16937
169382001-01-19 Akim Demaille <akim@epita.fr>
16939
16940 Get rid of the ad hoc handling of token_buffer in the scanner: use
16941 the obstacks.
16942
16943 * src/lex.c (token_obstack): New.
16944 (init_lex): Initialize it. No longer call...
16945 (grow_token_buffer): this. Remove it.
16946 Adjust all the places which used it to use the obstack.
16947
169482001-01-19 Akim Demaille <akim@epita.fr>
16949
16950 * src/lex.h: Rename all the tokens:
16951 s/\bENDFILE\b/tok_eof/g;
16952 s/\bIDENTIFIER\b/tok_identifier/g;
16953 etc.
16954 Let them be enums, not #define, to ease debugging.
16955 Adjust all the code.
16956
169572001-01-18 Akim Demaille <akim@epita.fr>
16958
16959 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
16960 * src/lex.c (maxtoken, grow_token_buffer): Static.
16961
169622001-01-18 Akim Demaille <akim@epita.fr>
16963
16964 Since we now use obstacks, more % directives can be enabled.
16965
16966 * src/lex.c (percent_table): Also accept `%yacc',
16967 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
16968 `%debug'.
16969 Handle the actions for `%semantic_parser' and `%pure_parser' here,
16970 instead of returning a token.
16971 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
16972 * src/reader.c (read_declarations): Adjust.
16973 * src/files.c (open_files): Don't call `compute_base_names', don't
16974 compute `attrsfile' since they depend upon data which might be
16975 *in* the input file now.
16976 (output_files): Do it here.
16977 * src/output.c (output_headers): Document the fact that this patch
16978 introduces a guaranteed SEGV for semantic parsers.
16979 * doc/bison.texinfo: Document them.
16980 * tests/suite.at: Exercise these %options.
16981
169822000-12-20 Akim Demaille <akim@epita.fr>
16983
16984 Also handle the output file (--verbose) with obstacks.
16985
16986 * files.c (foutput): Remove.
16987 (output_obstack): New.
16988 Adjust all dependencies.
16989 * src/conflicts.c: Return a string.
16990 * src/system.h (obstack_grow_string): Rename as...
16991 (obstack_sgrow): this. Be ready to work with non literals.
16992 (obstack_fgrow4): New.
16993
169942000-12-20 Akim Demaille <akim@epita.fr>
16995
16996 * src/files.c (open_files): Fix the computation of short_base_name
16997 in the case of `-o foo.tab.c'.
16998
169992000-12-20 Akim Demaille <akim@epita.fr>
17000
17001 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
17002 (copy_dollar): Now that everything uses obstacks, get rid of the
17003 FILE * parameters.
17004
170052000-12-20 Akim Demaille <akim@epita.fr>
17006
17007 * src/files.c (open_files): Actually the `.output' file is based
17008 on the short_base_name, not base_name.
17009 * tests/suite.at (Checking output file names): Adjust.
17010
170112000-12-20 Akim Demaille <akim@epita.fr>
17012
17013 * src/bison.s1: Remove, we now use directly...
17014 * src/bison.simple: this.
17015 * src/Makefile.am: Use pkgdata instead of data.
17016
170172000-12-20 Akim Demaille <akim@epita.fr>
17018
17019 * src/files.c (guard_obstack): New.
17020 (open_files): Initialize it.
17021 (output_files): Dump it...
17022 * src/files.h: Export it.
17023 * src/reader.c (copy_guard): Use it.
17024
170252000-12-19 Akim Demaille <akim@epita.fr>
17026
17027 * src/files.c (outfile, defsfile, actfile): Removed as global
17028 vars.
17029 (open_files): Don't compute them.
17030 (output_files): Adjust.
17031 (base_name, short_base_name): Be global.
17032 Adjust dependencies.
17033
170342000-12-19 Akim Demaille <akim@epita.fr>
17035
17036 * src/files.c (strsuffix): New.
17037 (stringappend): Be just like strcat but allocate.
17038 (base_names): Eve out from open_files.
17039 Try to simplify the rather hairy computation of base_name and
17040 short_base_name.
17041 (open_files): Use it.
17042 * tests/suite.at (Checking output file names): New test.
17043
170442000-12-19 Akim Demaille <akim@epita.fr>
17045
17046 * src/system.h (obstack_grow_literal_string): Rename as...
17047 (obstack_grow_string): this.
17048 * src/output.c (output_parser): Recognize `%% actions' instead of
17049 `$'.
17050 * src/bison.s1: s/$/%% actions/.
17051 * src/bison.hairy: Likewise.
17052
170532000-12-19 Akim Demaille <akim@epita.fr>
17054
17055 * src/output.c (output_parser): Compute the `#line' lines when
17056 there are.
17057 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
17058 Suggested by Hans Aberg.
17059
170602000-12-19 Akim Demaille <akim@epita.fr>
17061
17062 Let the handling of the skeleton files be local to the procedures
17063 that use it.
17064
17065 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
17066 longer static.
17067 (fparser, open_extra_files): Remove.
17068 (open_files, output_files): Don't take care of fparser.
17069 * src/files.h: Adjust.
17070 * src/output.c (output_parser): Open and close the file to the
17071 skeleton.
17072 * src/reader.c (read_declarations): When %semantic_parser, open
17073 fguard.
17074
170752000-12-19 Akim Demaille <akim@epita.fr>
17076
17077 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
17078 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
17079
170802000-12-19 Akim Demaille <akim@epita.fr>
17081
17082 * src/files.c (open_files): Yipee! We no longer need all the code
17083 looking for `/tmp' since we have no tmp file.
17084
170852000-12-19 Akim Demaille <akim@epita.fr>
17086
17087 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
17088 New macros.
17089 * src/files.c (open_files): Less dependency on MSDOS etc.
17090
170912000-12-14 Akim Demaille <akim@epita.fr>
17092
17093 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
17094 Provide a default definition.
17095 Use it when executing the default @ action.
17096 * src/reader.c (reader_output_yylsp): No longer include
17097 `timestamp' and `text' in the default YYLTYPE.
17098
170992000-12-12 Akim Demaille <akim@epita.fr>
17100
17101 * src/reader.c (copy_definition, parse_union_decl, copy_action)
17102 (copy_guard): Quote the file names.
17103 Reported by Laurent Mascherpa.
17104
171052000-12-12 Akim Demaille <akim@epita.fr>
17106
17107 * src/output.c (output_headers, output_program, output): Be sure
17108 to escape special characters when outputting filenames.
17109 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
17110 (output_headers): Don't depend on them, Use ACTSTR.
17111
171122000-11-17 Akim Demaille <akim@epita.fr>
17113
17114 * lib/obstack.h: Formatting changes.
17115 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
17116 prevents type checking.
17117 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
17118 cast the value to (void *): assigning a `foo *' to a `void *'
17119 variable is valid.
17120 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
17121 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
17122 append characters.
17123
171242000-11-17 Akim Demaille <akim@epita.fr>
17125
17126 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
17127 as...
17128 (suite.m4, regression.m4, calc.m4): these.
17129 * tests/atgeneral.m4: Update from CVS Autoconf.
17130
171312000-11-17 Akim Demaille <akim@epita.fr>
17132
17133 * tests/regression.m4 (%union and --defines): New test,
17134 demonstrating a current bug in the obstack implementation.
17135
171362000-11-17 Akim Demaille <akim@epita.fr>
17137
17138 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
17139 macros.
17140 Use them to declare the variables which are global or local to
17141 `yyparse'.
17142
171432000-11-17 Akim Demaille <akim@epita.fr>
17144
17145 * acconfig.h: Remove, no longer used.
17146
171472000-11-07 Akim Demaille <akim@epita.fr>
17148
17149 * src: s/Copyright (C)/Copyright/g.
17150
171512000-11-07 Akim Demaille <akim@epita.fr>
17152
17153 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
17154 defining.
17155 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
17156
171572000-11-07 Akim Demaille <akim@epita.fr>
17158
17159 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
17160 Merge in a single CPP if/else.
17161
171622000-11-07 Akim Demaille <akim@epita.fr>
17163
17164 * src/output.c (output): Remove useless variables.
17165 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
17166 argument `data' for consistency with the prototypes.
17167 Qualify it `const'.
17168 (obstack_copy, obstack_copy0): Rename the second argument as
17169 `address' for consistency. Qualify it `const'.
17170 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
17171 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
17172 `const' their input argument (`data' or `address').
17173 Adjust the corresponding macros to include `const' in casts.
17174
171752000-11-03 Akim Demaille <akim@epita.fr>
17176
17177 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
17178 s/PFILE1/BISON_HAIRY/.
17179 Adjust dependencies.
17180
171812000-11-03 Akim Demaille <akim@epita.fr>
17182
17183 For some reason, this was not applied.
17184
17185 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
17186 `unlink': it's no longer used.
17187
171882000-11-03 Akim Demaille <akim@epita.fr>
17189
17190 * src/files.c (skeleton_find): New function, eved out of...
17191 (open_files, open_extra_files): here.
17192
171932000-11-03 Akim Demaille <akim@epita.fr>
17194
17195 Don't use `atexit'.
17196
17197 * src/files.c (obstack_save): New function.
17198 (done): Rename as...
17199 (output_files): this.
17200 Use `obstack_save'.
17201 * src/main.c (main): Don't use `atexit' to register `done', since
17202 it no longer has to remove tmp files, just call `output_files'
17203 when there are no errors.
17204
172052000-11-02 Akim Demaille <akim@epita.fr>
17206
17207 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
17208 `unlink': it's no longer used.
17209 * src/files.h: Formatting changes.
17210
172112000-11-02 Akim Demaille <akim@epita.fr>
17212
17213 Remove the last uses of mktemp and unlink/delete.
17214
17215 * src/files.c (fdefines, ftable): Removed.
17216 (defines_ostack, table_obstack): New.
17217 Adjust dependencies of the former into uses of the latter.
17218 * src/output.c (output_short_or_char_table, output_short_table):
17219 Convert to using obstacks.
17220 * src/reader.c (copy_comment2): Accept one FILE * and two
17221 obstacks.
17222 (output_token_defines, reader_output_yylsp): Use obstacks.
17223 * src/system.h (obstack_fgrow3): New.
17224 * po/POTFILES.in: Adjust.
17225
172262000-11-01 Akim Demaille <akim@epita.fr>
17227
17228 Change each use of `fattrs' into a use of `attrs_obstack'.
17229
17230 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
17231 * src/files.c (fattrs): Remove.
17232 (attrs_obstack): New.
17233 Adjust all dependencies.
17234 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
17235
172362000-11-01 Akim Demaille <akim@epita.fr>
17237
17238 Introduce obstacks.
17239 Change each use of `faction' into a use of `action_obstack'.
17240
17241 * lib/obstack.h, lib/obstack.c: New files.
17242 * src/files.c (faction): Remove.
17243 (action_obstack): New.
17244 Adjust all dependencies.
17245
172462000-10-20 Akim Demaille <akim@epita.fr>
17247
17248 * lib/quote.h (PARAMS): New macro. Use it.
17249
172502000-10-16 Akim Demaille <akim@epita.fr>
17251
17252 * src/output.c (output_short_or_char_table): New function.
17253 (output_short_table, output_token_translations): Use it.
17254 (goto_actions): Use output_short_table.
17255
172562000-10-16 Akim Demaille <akim@epita.fr>
17257
17258 * src/symtab.c (bucket_new): New function.
17259 (getsym): Use it.
17260
17261 * src/output.c (output_short_table): New argument to display the
17262 comment associated with the table.
17263 Adjust dependencies.
17264 (output_gram): Use it.
17265 (output_rule_data): Nicer output layout for YYTNAME.
17266
172672000-10-16 Akim Demaille <akim@epita.fr>
17268
17269 * src/lex.c (read_typename): New function.
17270 (lex): Use it.
17271 * src/reader.c (copy_dollar): Likewise.
17272
172732000-10-16 Akim Demaille <akim@epita.fr>
17274
17275 * src/reader.c (copy_comment2): Expect the input stream to be on
17276 the `/' which is suspected to open a comment, instead of being
17277 called after `//' or `/*' was read.
17278 (copy_comment, copy_definition, parse_union_decl, copy_action)
17279 (copy_guard): Adjust.
17280
172812000-10-16 Akim Demaille <akim@epita.fr>
17282
17283 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
17284 `read_signed_integer'.
17285
172862000-10-16 Akim Demaille <akim@epita.fr>
17287
17288 * src/reader.c (copy_dollar): New function.
17289 (copy_guard, copy_action): Use it.
17290
172912000-10-16 Akim Demaille <akim@epita.fr>
17292
17293 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
17294 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
17295 New files, from Fileutils 4.0.27.
17296 * src/main.c (printable_version): Remove.
17297 * src/lex.c, src/reader.c: Use `quote'.
17298
172992000-10-04 Akim Demaille <akim@epita.fr>
17300
17301 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
17302
173032000-10-04 Akim Demaille <akim@epita.fr>
17304
17305 * doc/bison.texinfo: Various typos spotted by Neil Booth.
17306
173072000-10-04 Akim Demaille <akim@epita.fr>
17308
17309 When a literal string is used to define two different tokens,
17310 `bison -v' segfaults.
17311 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
17312
17313 * tests/regression.m4: New file.
17314 Include the core of the sample provided by Piotr Gackiewicz.
17315 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
17316 properly.
17317
173182000-10-04 Akim Demaille <akim@epita.fr>
17319
17320 * src/reader.c (parse_expect_decl): Keep `count' within the size
17321 of `buffer'.
17322 From Neil Booth.
17323
173242000-10-02 Paul Eggert <eggert@twinsun.com>
17325
17326 * bison.s1 (yyparse): Assign the default value
17327 unconditionally, to avoid a GCC warning and make the parser a
17328 tad smaller.
17329
173302000-10-02 Akim Demaille <akim@epita.fr>
17331
17332 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
17333 options.
17334
173352000-10-02 Akim Demaille <akim@epita.fr>
17336
17337 * src/derives.c, src/print.c, src/reduce.c: To ease the
17338 translation, move some `\n' out of the translated strings.
17339
173402000-10-02 Akim Demaille <akim@epita.fr>
17341
17342 The location tracking mechanism is precious for parse error
17343 messages. Nevertheless, it is enabled only when `@n' is used in
17344 the grammar, which is a different issue (you can use it in error
17345 message, but not in the grammar per se). Therefore, there should
17346 be another means to enable it.
17347
17348 * src/getargs.c (getargs): Support `--locations'.
17349 (usage): Report it.
17350 * src/getargs.h (locationsflag): Export it.
17351 * src/lex.c (percent_table): Support `%locations'.
17352 * src/reader.c (yylsp_needed): Remove this variable, now replaced
17353 with `locationsflag'.
17354 * doc/bison.texinfo: Document `--locations' and `%locations'.
17355 Sort the options.
17356 * tests/calc.m4: Test it.
17357
17358 For regularity of the names, replace each
17359 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
17360 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
17361 In addition replace each `flag' with `_flag'.
17362
173632000-10-02 Akim Demaille <akim@epita.fr>
17364
17365 Also test parse error messages, including with YYERROR_VERBOSE.
17366
17367 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
17368 associative).
17369 Use it to check the computations.
17370 Use it to check `nonassoc' is honored.
17371 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
17372 `--yyerror-verbose'.
17373 (_AT_CHECK_CALC): Adjust to this option.
17374 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
17375
173762000-10-02 Akim Demaille <akim@epita.fr>
17377
17378 Test also `--verbose', `--defines' and `--name-prefix'. Testing
17379 the latter demonstrates a flaw in the handling of non debugging
17380 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
17381 was used in order to simplify:
17382
17383 #if YYDEBUG
17384 if (yydebug)
17385 {
17386 ...
17387 }
17388 #endif
17389
17390 into
17391
17392 if (yydebug)
17393 {
17394 ...
17395 }
17396
17397 unfortunately this leads to a CPP conflict when
17398 `--name-prefix=foo' is used since it produces `#define yydebug
17399 foodebug'.
17400
17401 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
17402 (YYDPRINTF): New macro.
17403 Spread its use.
17404 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
17405 the bison options.
17406 Also test `--verbose', `--defines' and `--name-prefix'.
17407
174082000-10-02 Akim Demaille <akim@epita.fr>
17409
17410 Improve the readability of the produced parsers.
17411
17412 * src/bison.s1: Formatting changes.
17413 Improve the comment related to the `$' mark.
17414 (yydefault): Don't fall through to `yyresume': `goto' there.
17415 * src/output.c (output_parser): When the `$' is met, skip the end
17416 of its line.
17417 New variable, `number_of_dollar_signs', to check there's exactly
17418 one `$' in the parser skeleton.
17419
174202000-10-02 Akim Demaille <akim@epita.fr>
17421
17422 * lib/xstrdup.c: New file, from the fileutils.
17423 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
17424 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
17425 instead of strlen + xmalloc + strcpy.
17426 * src/symtab.c (copys): Remove, use xstrdup instead.
17427
174282000-10-02 Akim Demaille <akim@epita.fr>
17429
17430 * src/gram.h (associativity): New enum type which replaces the
17431 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
17432 `right_assoc', `left_assoc' and `non_assoc'.
17433 Adjust all dependencies.
17434 * src/reader.c: Formatting changes.
17435 (LTYPESTR): Don't define it, use it as a literal in
17436 `reader_output_yylsp'.
17437 * src/symtab.h (symbol_class): New enum type which replaces the
17438 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
17439 `sunknown', `stoken and `snterm'.
17440
174412000-10-02 Akim Demaille <akim@epita.fr>
17442
17443 * src/getargs.c (fixed_outfiles): Rename as...
17444 (yaccflag): for consistency and accuracy.
17445 Adjust dependencies.
17446
174472000-10-02 Akim Demaille <akim@epita.fr>
17448
17449 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
17450 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
17451 difficult and introduced a lot of core dump. It turns out that
17452 Bison used an implementation of `xmalloc' based on `calloc', and
17453 at various places it does depend upon the initialization to 0. I
17454 have not tried to isolate the pertinent places, and all the former
17455 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
17456 someone should address this issue.
17457
17458 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
17459 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
17460 files.
17461 Adjust dependencies.
17462 * src/warshall.h: New file.
17463 Propagate.
17464
174652000-10-02 Akim Demaille <akim@epita.fr>
17466
17467 Various anti-`extern in *.c' changes.
17468
17469 * src/system.h: Include `assert.h'.
17470
174712000-10-02 Akim Demaille <akim@epita.fr>
17472
17473 * src/state.h (nstates, final_state, first_state, first_shift)
17474 (first_reduction): Move their exportation from here...
17475 * src/LR0.h: to here.
17476 Adjust dependencies.
17477 * src/getargs.c (statisticsflag): New variable.
17478 Add support for `--statistics'.
17479 Adjust dependencies.
17480
17481 Remove a lot of now useless `extern' statements in most files.
17482
174832000-10-02 Akim Demaille <akim@epita.fr>
17484
17485 * src/LR0.h: New file.
17486 Propagate its use.
17487
174882000-10-02 Akim Demaille <akim@epita.fr>
17489
17490 * src/print.h: New file.
17491 Propagate its use.
17492 * src/print.c: Formatting and ordering changes.
17493 (verbose, terse): Replace with...
17494 (print_results): this new function.
17495 Adjust dependencies.
17496
174972000-10-02 Akim Demaille <akim@epita.fr>
17498
17499 * src/conflicts.c (conflict_report): New function.
17500 (conflict_log, verbose_conflict_log): Replace with...
17501 (print_conflicts): this function.
17502 Adjust dependencies.
17503 * src/conflicts.h: New file.
17504 Propagate its inclusion.
17505
175062000-10-02 Akim Demaille <akim@epita.fr>
17507
17508 * src/nullable.h: New file.
17509 Propagate its inclusion.
17510 * src/nullable.c: Formatting changes.
17511
175122000-10-02 Akim Demaille <akim@epita.fr>
17513
17514 * src/reduce.h: New file.
17515 Propagate its inclusion.
17516 * src/reduce.c: Topological sort and other formatting changes.
17517 (bool, TRUE, FALSE): Move their definition to...
17518 * src/system.h: here.
17519
175202000-10-02 Akim Demaille <akim@epita.fr>
17521
17522 * src/files.c: Formatting changes.
17523 (tryopen, tryclose, openfiles): Rename as...
17524 (xfopen, xfclose, open_files): this.
17525 (stringappend): static.
17526 * src/files.h: Complete the list of exported symbols.
17527 Propagate its use.
17528
175292000-10-02 Akim Demaille <akim@epita.fr>
17530
17531 * src/reader.h: New file.
17532 Propagate its use instead of tedious list of `extern' and
17533 prototypes.
17534 * src/reader.c: Formatting changes, topological sort,
17535 s/register//.
17536
175372000-10-02 Akim Demaille <akim@epita.fr>
17538
17539 * src/lex.h: Prototype `lex.c' exported functions.
17540 * src/reader.c: Adjust.
17541 * src/lex.c: Formatting changes.
17542 (safegetc): Rename as...
17543 (xgetc): this.
17544
175452000-10-02 Akim Demaille <akim@epita.fr>
17546
17547 * src/lalr.h: New file.
17548 Propagate its inclusion instead of prototypes and `extern'.
17549 * src/lalr.c: Formatting changes, topological sorting etc.
17550
175512000-10-02 Akim Demaille <akim@epita.fr>
17552
17553 * src/output.c (token_actions): Introduce a temporary array,
17554 YYDEFACT, that makes it possible for this function to use
17555 output_short_table.
17556
175572000-10-02 Akim Demaille <akim@epita.fr>
17558
17559 `user_toknums' is output as a `short[]' in `output.c', while it is
17560 defined as a `int[]' in `reader.c'. For consistency with the
17561 other output tables, `user_toknums' is now defined as a table of
17562 shorts.
17563
17564 * src/reader.c (user_toknums): Be a short table instead of an int
17565 table.
17566 Adjust dependencies.
17567
17568 Factor the short table outputs.
17569
17570 * src/output.c (output_short_table): New function.
17571 * src/output.c (output_gram, output_stos, output_rule_data)
17572 (output_base, output_table, output_check): Use it.
17573
175742000-10-02 Akim Demaille <akim@epita.fr>
17575
17576 * src/output.c (output): Topological sort of the functions, in
17577 order to get rid of the `static' prototypes.
17578 No longer use `register'.
17579 * src/output.h: New file.
17580 Propagate its inclusion in files explicitly prototyping functions
17581 from output.c.
17582
175832000-09-21 Akim Demaille <akim@epita.fr>
17584
17585 * src/atgeneral.m4: Update from Autoconf.
17586
175872000-09-21 Akim Demaille <akim@epita.fr>
17588
17589 * src/closure.h: New file.
17590 * src/closure.c: Formatting changes, topological sort over the
17591 functions, use of closure.h.
17592 (initialize_closure, finalize_closure): Rename as...
17593 (new_closure, free_closure): these. Adjust dependencies.
17594 * src/LR0.c: Formatting changes, topological sort, use of
17595 cloture.h.
17596 (initialize_states): Rename as...
17597 (new_states): this.
17598 * src/Makefile.am (noinst_HEADERS): Adjust.
17599
176002000-09-20 Akim Demaille <akim@epita.fr>
17601
17602 * src/acconfig.h: Don't protect config.h against multiple
17603 inclusion.
17604 Don't define PARAMS.
17605 * src/system.h: Define PARAMS.
17606 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
17607 purpose of config.h. system.h must not try to fix wrong
17608 definitions in config.h.
17609
176102000-09-20 Akim Demaille <akim@epita.fr>
17611
17612 * src/derives.h: New file.
17613 * src/main.c, src/derives.h: Use it.
17614 Formatting changes.
17615 * src/Makefile.am (noinst_HEADERS): Adjust.
17616
176172000-09-20 Akim Demaille <akim@epita.fr>
17618
17619 * tests/atgeneral.m4: Update from Autoconf.
17620 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
17621 (AT_CHECK_CALC): New macros.
17622 Use these macros to test bison with options `', `--raw',
17623 `--debug', `--yacc', `--yacc --debug'.
17624
176252000-09-19 Akim Demaille <akim@epita.fr>
17626
17627 * src/output.c: Formatting changes.
17628 * src/machine.h: Remove, leaving its contents in...
17629 * src/system.h: here.
17630 Include stdio.h.
17631 Adjust all dependencies on stdio.h and machine.h.
17632 * src/getargs.h: New file.
17633 Let all `extern' declarations about getargs.c be replaced with
17634 inclusion of `getargs.h'.
17635 * src/Makefile.am (noinst_HEADERS): Adjust.
17636
17637 * tests/calc.m4 (yyin): Be initialized in main, not on the global
17638 scope.
17639 (yyerror): Returns void, not int.
17640 * doc/bison.texinfo: Formatting changes.
17641
176422000-09-19 Akim Demaille <akim@epita.fr>
17643
17644 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
17645 portable.
17646
176472000-09-18 Akim Demaille <akim@epita.fr>
17648
17649 * configure.in: Append WARNING_CFLAGS to CFLAGS.
17650 * src/Makefile.am (INCLUDES): Don't.
17651 Be ready to fetch headers in lib/.
17652
176532000-09-18 Akim Demaille <akim@epita.fr>
17654
17655 * doc/bison.texinfo: Update the copyright.
17656 ANSIfy and GNUify the examples.
17657 Remove the old menu.
17658
176592000-09-18 Akim Demaille <akim@epita.fr>
17660
17661 First set of tests: use the `calc' example from the documentation.
17662
17663 * src/bison.s1 (yyparse): Condition the code using `yytname' which
17664 is defined only when YYDEBUG is.
17665 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
17666 * src/files.c (tryopen, tryclose): Formatting changes.
17667 Move to the top and be static.
17668 * src/reader.c (read_signed_integer): Likewise.
17669 * tests/calc.m4: New file.
17670 * Makefile.am, suite.m4: Adjust.
17671 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
17672
176732000-09-18 Akim Demaille <akim@epita.fr>
17674
17675 Add support for an Autotest test suite for Bison.
17676
17677 * m4/m4.m4, m4/atconfig.m4: New files.
17678 * m4/Makefile.am (EXTRA_DIST): Adjust.
17679 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
17680 files.
17681 * src/getargs.c: Display a more standard --version message.
17682 * src/reader.c (reader): Formatting changes.
17683 No longer depend upon VERSION_STRING.
17684 * configure.in: No longer use `dnl'.
17685 Set up the test suite and the new directory `tests/.
17686 (VERSION_STRING): Remove.
17687
176882000-04-14 Akim Demaille <akim@epita.fr>
17689
17690 * src/reader.c (copy_comment2): New function, same as former
17691 `copy_comment', but outputs into two FILE *.
17692 (copy_comment): Use it.
17693 (parse_union_decl): Use it.
17694 (get_type, parse_start_decl): Use the same `invalid' message.
17695 (parse_start_decl, parse_union_decl): Use the same `multiple'
17696 message.
17697 (parse_union_decl, copy_guard, copy_action): Use the same
17698 `unmatched' message.
17699 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
17700
177012000-03-31 Akim Demaille <akim@epita.fr>
17702
17703 * src/files.c (tryopen, tryclose): Move to the top.
17704 Be static.
17705
177062000-03-31 Akim Demaille <akim@epita.fr>
17707
17708 * src/main.c (main): Don't call `done', exit does it.
17709
177102000-03-31 Akim Demaille <akim@epita.fr>
17711
17712 * allocate.c: s/return (foo)/return foo/.
17713 * lalr.c: Likewise.
17714 * LR0.c: Likewise.
17715 * output.c: Likewise.
17716 * reader.c: Likewise.
17717 * symtab.c: Likewise.
17718 * vmsgetargs.c: Likewise.
17719
177202000-03-31 Akim Demaille <akim@epita.fr>
17721
17722 Clean up the error reporting functions.
17723
17724 * src/report.c: New file.
17725 * src/report.h: Likewise.
17726 * src/Makefile.am: Adjust.
17727 * m4/error.m4: New file.
17728 * m4/Makefile.am: Adjust.
17729 * configure.in (jm_PREREQ_ERROR): Call it.
17730 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
17731 Remove.
17732 (fatal, fatals): Remove. All callers use complain.c::fatal.
17733 (warn, warni, warns, warnss, warnss): Remove. All callers use
17734 complain.c::complain.
17735 (toomany): Remove, use fatal instead.
17736 * src/files.c (done): No argument, use complain_message_count.
17737 * src/main.c (main): Register `done' to `atexit'.
17738
17739 * src/getargs.c (usage): More `fputs', less `fprintf'.
17740
177412000-03-28 Akim Demaille <akim@epita.fr>
17742
17743 * lib/: New directory.
17744 * Makefile.am (SUBDIRS): Adjust.
17745 * configure.in: Adjust.
17746 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
17747 useless.
17748 * src/alloca.c: Moved to lib/.
17749 * src/getopt.c: Likewise.
17750 * src/getopt1.c: Likewise.
17751 * src/getopt.h: Likewise.
17752 * src/ansi2knr.c: Likewise.
17753 * src/ansi2knr.1: Likewise.
17754 * src/Makefile.am: Adjust.
17755 * lib/Makefile.am: New file.
17756
177572000-03-28 Akim Demaille <akim@epita.fr>
17758
17759 * src/getargs.c (usage): Refresh the help message.
17760
177612000-03-17 Akim Demaille <akim@epita.fr>
17762
17763 * src/getopt1.c: Updated from textutils 2.0e
17764 * src/getopt.c: Likewise.
17765 * src/getopt.h: Likewise.
17766
177672000-03-17 Akim Demaille <akim@epita.fr>
17768
17769 * src/Makefile.am (bison.simple): Fix the awk program: quote only
17770 the file name, not the whole `#line LINE FILE'.
17771
177722000-03-17 Akim Demaille <akim@epita.fr>
17773
17774 On syntax errors, report the token on which we choked.
17775
17776 * src/bison.s1 (yyparse): In the label yyerrlab, when
17777 YYERROR_VERBOSE, add yychar in msg.
17778
177792000-03-17 Akim Demaille <akim@epita.fr>
17780
17781 * src/reader.c (copy_at): New function.
17782 (copy_guard): Use it.
17783 (copy_action): Use it.
17784
177852000-03-17 Akim Demaille <akim@epita.fr>
17786
17787 Be kind to translators, save some useless translations.
17788
17789 * src/main.c (banner): New function.
17790 (fatal_banner): Use it.
17791 (warn_banner): Use it.
17792
177932000-03-17 Akim Demaille <akim@epita.fr>
17794
17795 * src/reader.c (copy_definition): Use copy_string and
17796 copy_comment. Removed now unused `match', `ended',
17797 `cplus_comment'.
17798 (copy_comment, copy_string): Moved, to be visible from
17799 copy_definition.
17800
178012000-03-17 Akim Demaille <akim@epita.fr>
17802
17803 * src/reader.c (copy_string): Declare `static inline'. No
17804 problems with inline, since it is checked by configure.
17805 (copy_comment): Likewise.
17806
178072000-03-17 Akim Demaille <akim@epita.fr>
17808
17809 * src/reader.c (packsymbols): Formatting changes.
17810
178112000-03-17 Akim Demaille <akim@epita.fr>
17812
17813 * src/reader.c (copy_comment): New function, factored out from:
17814 (copy_action): Use it. Removed now unused `match', `ended',
17815 `cplus_comment'.
17816 (copy_guard): Likewise.
17817
178182000-03-17 Akim Demaille <akim@epita.fr>
17819
17820 * src/reader.c (copy_string): New function, factored out from:
17821 (copy_action): Use it.
17822 (copy_guard): Likewise.
17823
178242000-03-17 Akim Demaille <akim@epita.fr>
17825
17826 Change the handling of @s so that they behave exactly like $s.
17827 There is now a pseudo variable @$ (readble and writable), location
17828 of the lhs of the rule (by default ranging from the location of
17829 the first symbol of the rhs, to the location of the last symbol,
17830 or, if the rhs is empty, YYLLOC).
17831
17832 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
17833 yyval.
17834 (yyparse): When providing a default semantic action, provide a
17835 default location action.
17836 (after the $): No longer change `*YYLSP', just stack YYLOC the
17837 same way you stack YYVAL.
17838 * src/reader.c (read_declarations): Use warns.
17839 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
17840 (copy_action, case '@'): Likewise.
17841 Use a standard error message, to save useless work from
17842 translators.
17843
178442000-03-17 Akim Demaille <akim@epita.fr>
17845
17846 * src/bison.s1: Formatting and cosmetics changes.
17847 * src/reader.c: Likewise.
17848 Update the Copyright notice.
17849
178502000-03-17 Akim Demaille <akim@epita.fr>
17851
17852 * src/bison.s1 (#line): All set to `#line' only, since the
17853 Makefile now handles them.
17854
178552000-03-16 Akim Demaille <akim@epita.fr>
17856
17857 * src/output.c (output_rule_data): Output the documentation of
17858 some of the tables.
17859 (Copyright notice): Update.
17860 Formatting changes.
17861
178622000-03-16 Akim Demaille <akim@epita.fr>
17863
17864 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
17865 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
17866 One `#if YYDEBUG' remains, since it uses variables which are
17867 defined only if `YYDEBUG != 0'.
17868
178692000-03-16 Akim Demaille <akim@epita.fr>
17870
17871 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
17872 and related variables so that the similarities are highlighted.
17873
178742000-03-16 Akim Demaille <akim@epita.fr>
17875
17876 * src/bison.s1: Properly indent CPP directives.
17877
178782000-03-16 Akim Demaille <akim@epita.fr>
17879
17880 * src/bison.s1: Properly indent the `alloca' CPP section.
17881
178822000-03-16 Akim Demaille <akim@epita.fr>
17883
17884 Do not hard code values of directories in `configure.in'.
17885 Update the `configure' tool chain.
17886
17887 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
17888 src/makefile.am.
17889 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
17890 (AC_OUTPUT): Add m4/Makefile.
17891 Bump to bison 1.28a, 1.29 has never been released.
17892 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
17893 handled via src/Makefile.am.
17894 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
17895 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
17896 autoheader.
17897 * Makefile.am (SUBDIRS): Add m4.
17898 (ACLOCAL_AM_FLAGS): New variable.
17899 (AUTOMAKE_OPTIONS): Add check-news.
17900 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
17901 the proper line number and file name.
17902 (DEFS): Propagate the location of bison library files and of the
17903 locale files.
17904 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
17905 builddir.
17906 * acinclude.m4: Remove, replaced by the directory m4.
17907 * m4/Makefile.am (EXTRA_DIST): New variable.
17908 * m4/gettext.m4: New file, from the fileutils.
17909 * m4/lcmessage.m4: Likewise
17910 * m4/progtest.m4: Likewise.
17911 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
17912
179132000-03-10 Akim Demaille <akim@epita.fr>
17914
17915 * src/closure.c:
17916 Formatting changes of various comments.
17917 Respect the GNU coding standards at various places.
17918 Don't use `_()' when no translation is needed.
17919
179201999-12-13 Jesse Thilo <jthilo@gnu.org>
17921
17922 * src/files.c:
17923 OS/2 honors TMPDIR environment variable.
17924
179251999-12-13 Jesse Thilo <jthilo@gnu.org>
17926
17927 * doc/bison.texinfo: Tweaked spelling and grammar.
17928 Updated ISBN.
17929 Removed reference to price of printed copy.
17930 Mention BISON_SIMPLE and BISON_HAIRY.
17931
179321999-12-13 Jesse Thilo <jthilo@gnu.org>
17933
17934 * configure.in, NEWS:
17935 Bison 1.29 released.
17936
179371999-10-27 Jesse Thilo <jthilo@gnu.org>
17938
17939 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
17940 Added reference card.
17941
179421999-07-26 Jesse Thilo <jthilo@gnu.org>
17943
17944 * po/ru.po: Added Russian translation.
17945
179461999-07-26 Jesse Thilo <jthilo@gnu.org>
17947
17948 * configure.in: Added Russian translation.
17949
179501999-07-06 Jesse Thilo <jthilo@gnu.org>
17951
17952 * configure.in, NEWS, README:
17953 Released version 1.28.
17954
179551999-06-14 Jesse Thilo <jthilo@gnu.org>
17956
17957 * src/system.h:
17958 Squashed redefinition warning on some systems.
17959
17960 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
17961 Have configure build version string instead of relying on ANSI string
17962 concatentation.
17963
179641999-06-14 Jesse Thilo <jthilo@gnu.org>
17965
17966 * po/POTFILES.in: Got rid of version.c.
17967
179681999-06-14 Jesse Thilo <jthilo@gnu.org>
17969
17970 * acconfig.h, configure.in:
17971 Have configure build version string instead of relying on ANSI string
17972 concatentation.
17973
179741999-06-08 Jesse Thilo <jthilo@gnu.org>
17975
17976 * doc/bison.1:
17977 Dropped mention of `+' for long-named options.
17978
179791999-05-30 Jesse Thilo <jthilo@gnu.org>
17980
17981 * src/files.c: Added <unistd.h> for unlink().
17982
17983 * src/Makefile.am, src/system.h:
17984 I18n fixes.
17985
179861999-05-30 Jesse Thilo <jthilo@gnu.org>
17987
17988 * README: Added a FAQ list.
17989
17990 * configure.in, acconfig.h:
17991 I18n fixes.
17992
179931999-05-30 Jesse Thilo <jthilo@gnu.org>
17994
17995 * doc/FAQ, doc/Makefile.am:
17996 Added a FAQ list.
17997
179981999-05-19 Jesse Thilo <jthilo@gnu.org>
17999
18000 * src/alloc.h, src/symtab.h, src/version.c:
18001 Protected inclusion of "config.h" with HAVE_CONFIG_H.
18002
180031999-04-18 Jesse Thilo <jthilo@gnu.org>
18004
18005 * src/.cvsignore, src/Makefile.am:
18006 Reorganized: sources in `src', documentation in `doc'.
18007
18008 * src/lex.c (literalchar):
18009 fixed the code for escaping double quotes (thanks
18010 Jonathan Czisny.)
18011
180121999-04-18 Jesse Thilo <jthilo@gnu.org>
18013
18014 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
18015 Adjusted paths to reflect directory reorganization.
18016
180171999-04-18 Jesse Thilo <jthilo@gnu.org>
18018
18019 * doc/.cvsignore, doc/Makefile.am:
18020 Reorganized: sources in `src', documentation in `doc'.
18021
180221999-04-18 Jesse Thilo <jthilo@gnu.org>
18023
18024 * configure.in:
18025 Updated AC_INIT file to reflect directory reorganization.
18026
18027 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
18028 Reorganized: sources in `src', documentation in `doc'.
18029
180301999-04-13 Jesse Thilo <jthilo@gnu.org>
18031
18032 * src/allocate.c:
18033 Don't declare calloc() and realloc() if not necessary.
18034
180351999-04-13 Jesse Thilo <jthilo@gnu.org>
18036
18037 * configure.in, acconfig.h, acinclude.m4:
18038 Don't declare calloc() and realloc() if not necessary.
18039
180401999-03-23 Jesse Thilo <jthilo@gnu.org>
18041
18042 * po/.cvsignore: Added i18n support.
18043
180441999-03-23 Jesse Thilo <jthilo@gnu.org>
18045
18046 * acconfig.h, configure.in, Makefile.am:
18047 Added i18n support.
18048
180491999-03-22 Jesse Thilo <jthilo@gnu.org>
18050
18051 * src/bison.s1: Fixed #line numbers.
18052
180531999-03-15 Jesse Thilo <jthilo@gnu.org>
18054
18055 * po/es.po, po/fr.po, po/nl.po, po/de.po:
18056 Added PO files from Translation Project.
18057
180581999-03-03 Jesse Thilo <jthilo@gnu.org>
18059
18060 * Makefile.am:
18061 Added support for non-ANSI compilers (ansi2knr).
18062
180631999-02-16 Jesse Thilo <jthilo@gnu.org>
18064
18065 * configure.in: Bumped version number to 1.27.
18066
18067 * Makefile.am:
18068 Added `bison.simple' to list of files removed by `make distclean'.
18069
180701999-02-12 Jesse Thilo <jthilo@gnu.org>
18071
18072 * src/files.c, src/files.h:
18073 Defined locations of parser files in config.h instead of Makefile.
18074
180751999-02-12 Jesse Thilo <jthilo@gnu.org>
18076
18077 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
18078 Defined locations of parser files in config.h instead of Makefile.
18079
180801999-02-09 Jesse Thilo <jthilo@gnu.org>
18081
18082 * Makefile.am:
18083 Removed inappropriate use of $< macro.
18084
180851999-02-05 Jesse Thilo <jthilo@gnu.org>
18086
18087 * po/Makefile.in.in, po/POTFILES.in:
18088 Add `po' directory skeleton.
18089
180901999-01-27 Jesse Thilo <jthilo@gnu.org>
18091
18092 * README: Document help-bison list.
18093
18094 * configure.in: Add check for mkstemp().
18095
180961999-01-20 Jesse Thilo <jthilo@gnu.org>
18097
18098 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
18099 Hush a few compiler warnings.
18100
18101 * src/files.c:
18102 Add tryclose(), which verifies that fclose was successful.
18103 Hush a couple of compiler warnings.
18104
181051999-01-20 Jesse Thilo <jthilo@gnu.org>
18106
18107 * Makefile.am, OChangeLog:
18108 ChangeLog is now automatically generated. Include the old version as
18109 OChangeLog.
18110
181111999-01-14 Jesse Thilo <jthilo@gnu.org>
18112
18113 * 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:
18114 Update FSF address.
18115
181161999-01-14 Jesse Thilo <jthilo@gnu.org>
18117
18118 * doc/bison.texinfo: Fix formatting glitch.
18119
18120 * doc/bison.texinfo: Update FSF address.
18121
181221999-01-14 Jesse Thilo <jthilo@gnu.org>
18123
18124 * acconfig.h: Update FSF address.
18125
181261999-01-08 Jesse Thilo <jthilo@gnu.org>
18127
18128 * src/system.h:
18129 Don't define PACKAGE here, since config.h defines it.
18130
181311998-12-30 Jesse Thilo <jthilo@gnu.org>
18132
18133 * src/reader.c: Update copyright date.
18134
18135 * src/main.c:
18136 Ditch sprintf to statically-sized buffers in fatal/warn functions in
18137 favor of output directly to stderr (avoids buffer overruns).
18138
18139 * src/reader.c: Some checks for premature EOF.
18140
18141 * 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:
18142 Use prototypes if the compiler understands them.
18143
18144 * src/files.c: Honor TMPDIR on Unix hosts.
18145 Use prototypes if the compiler understands them.
18146
18147 * src/reader.c:
18148 Fix a couple of buffer overrun bugs.
18149 Use prototypes if the compiler understands them.
18150
18151 * src/system.h: Include unistd.h and ctype.h.
18152 Use #ifdef instead of #if for NLS symbols.
18153
181541998-12-30 Jesse Thilo <jthilo@gnu.org>
18155
18156 * doc/bison.texinfo:
18157 Delete comment "consider using @set for edition number, etc..." since
18158 we now are doing so.
18159
181601998-12-30 Jesse Thilo <jthilo@gnu.org>
18161
18162 * configure.in:
18163 Use prototypes if the compiler understands them.
18164
18165 * NEWS: Document 1.26 highlights.
18166
18167 * Makefile.am: Require Automake 1.3 or later.
18168
18169 * acconfig.h:
18170 Use prototypes if the compiler understands them.
18171
181721998-12-29 Jesse Thilo <jthilo@gnu.org>
18173
18174 * src/version.c:
18175 Use VERSION symbol from automake for version number.
18176
181771998-12-29 Jesse Thilo <jthilo@gnu.org>
18178
18179 * acconfig.h, configure.in, version.cin:
18180 Use VERSION symbol from automake for version number.
18181
181821998-11-28 Jesse Thilo <jthilo@gnu.org>
18183
18184 * Makefile.am:
18185 Distribute original version of simple parser (bison.s1), not built
18186 version (bison.simple).
18187
181881998-11-28 Jesse Thilo <jthilo@gnu.org>
18189
18190 * doc/bison.texinfo: Add info dir entry.
18191
18192 * doc/bison.texinfo:
18193 Let automake put version number into documentation.
18194
181951998-11-26 Jesse Thilo <jthilo@gnu.org>
18196
18197 * src/bison.cld, src/build.com, src/vmshlp.mar:
18198 Add non-RCS files from /gd/gnu/bison.
18199
182001998-11-26 Jesse Thilo <jthilo@gnu.org>
18201
18202 * doc/bison.1:
18203 Document the BISON_HAIRY and BISON_SIMPLE variables.
18204
182051998-11-25 Jesse Thilo <jthilo@gnu.org>
18206
18207 * src/version.c: Build version.c automatically.
18208
18209 * src/reader.c:
18210 Fix token numbering (used to start at 258, not 257).
18211
18212 * src/system.h: Include config.h.
18213
18214 * src/getargs.c: Update bug report address.
18215
18216 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
18217 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
18218
182191998-11-25 Jesse Thilo <jthilo@gnu.org>
18220
18221 * Makefile.am:
18222 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
18223
18224 * configure.in, version.cin:
18225 Build version.c automatically.
18226
18227 * AUTHORS: Add AUTHORS file.
18228
18229 * README: Update bug report address.
18230
18231 * bison.simple:
18232 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
18233
18234 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
18235 Add automake stuff.
18236
182371998-11-25 Jesse Thilo <jthilo@gnu.org>
18238
18239 * doc/bison.texinfo: Clean up some formatting.
18240
182411998-05-05 Richard Stallman <rms@gnu.org>
18242
18243 * doc/bison.texinfo:
18244 Explain better why to make a pure parser.
18245
182461998-01-05 Richard Stallman <rms@gnu.org>
18247
18248 * src/files.c (openfiles):
18249 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
18250 find a temporary directory, if possible. Do not unlink files while
18251 they are open.
18252
182531997-08-25 Richard Stallman <rms@gnu.org>
18254
18255 * src/reader.c (stack_offset;):
18256 Change some warni to warns.
18257
18258 * src/lex.c (literalchar): Use warns, not warni.
18259
182601997-06-28 Richard Stallman <rms@gnu.org>
18261
18262 * src/bison.s1: Add a Bison version comment.
18263
18264 * src/main.c (fatal, warn, berror):
18265 Use program_name.
18266
182671997-06-28 Richard Stallman <rms@gnu.org>
18268
18269 * Makefile.in (bison_version): New variable.
18270 (dist): Use that variable.
18271 (bison.s1): Substitute the Bison version into bison.simple.
18272
18273 * bison.simple: Add a Bison version comment.
18274
182751997-06-18 Richard Stallman <rms@gnu.org>
18276
18277 * src/main.c (fatal, warn, berror):
18278 Make error messages standard.
18279 (toomany): Improve error message text.
18280
18281 * 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:
18282 new.h renamed to alloc.h.
18283
182841997-06-18 Richard Stallman <rms@gnu.org>
18285
18286 * Makefile.in: new.h renamed to alloc.h.
18287
182881997-05-24 Richard Stallman <rms@gnu.org>
18289
18290 * src/lex.c (literalchar):
18291 Fix the code for escaping \, " and '.
18292
18293 (lex): Avoid trouble when there are many chars
18294 to discard in a char literal with just several chars in it.
18295
182961997-05-17 Richard Stallman <rms@gnu.org>
18297
18298 * src/bison.s1:
18299 Use malloc, if using alloca is troublesome.
18300 (YYSTACK_USE_ALLOCA): New flag macro.
18301 Define it for some systems and compilers.
18302 (YYSTACK_ALLOC): New macro.
18303 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18304 If it was malloc'd, free it.
18305
183061997-05-17 Richard Stallman <rms@gnu.org>
18307
18308 * bison.simple:
18309 Use malloc, if using alloca is troublesome.
18310 (YYSTACK_USE_ALLOCA): New flag macro.
18311 Define it for some systems and compilers.
18312 (YYSTACK_ALLOC): New macro.
18313 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18314 If it was malloc'd, free it.
18315
183161997-04-23 Richard Stallman <rms@gnu.org>
18317
18318 * src/bison.s1:
18319 (alloca) [__hpux]: Always define as __builtin_alloca.
18320
183211997-04-23 Richard Stallman <rms@gnu.org>
18322
18323 * bison.simple:
18324 (alloca) [__hpux]: Always define as __builtin_alloca.
18325
183261997-04-22 Richard Stallman <rms@gnu.org>
18327
18328 * src/bison.s1:
18329 [__hpux]: Include alloca.h (right for HPUX 10)
18330 instead of declaring alloca (right for HPUX 9).
18331
18332 * src/bison.s1 (__yy_memcpy):
18333 Declare arg `count' as unsigned int.
18334 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18335
183361997-04-22 Richard Stallman <rms@gnu.org>
18337
18338 * bison.simple:
18339 [__hpux]: Include alloca.h (right for HPUX 10)
18340 instead of declaring alloca (right for HPUX 9).
18341
18342 * bison.simple (__yy_memcpy):
18343 Declare arg `count' as unsigned int.
18344 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18345
183461997-01-03 Richard Stallman <rms@gnu.org>
18347
18348 * src/allocate.c: [__STDC__ or _MSC_VER]:
18349 Declare calloc and realloc to return void *.
18350
183511997-01-02 Richard Stallman <rms@gnu.org>
18352
18353 * src/system.h:
18354 [_MSC_VER]: Include stdlib.h and process.h.
18355 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
18356
18357 * src/main.c (main): Return FAILURE as a value.
18358 (printable_version): Declare arg as int, not char.
18359
183601997-01-02 Richard Stallman <rms@gnu.org>
18361
18362 * Makefile.in (dist):
18363 Explicitly check for symlinks, and copy them.
18364
183651996-12-19 Richard Stallman <rms@gnu.org>
18366
18367 * src/files.c:
18368 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
18369
183701996-12-18 Paul Eggert <eggert@gnu.org>
18371
18372 * src/bison.s1 (yyparse):
18373 If __GNUC__ and YYPARSE_PARAM are both defined,
18374 declare yyparse to have a void * argument.
18375
183761996-12-18 Paul Eggert <eggert@gnu.org>
18377
18378 * bison.simple (yyparse):
18379 If __GNUC__ and YYPARSE_PARAM are both defined,
18380 declare yyparse to have a void * argument.
18381
183821996-12-17 Richard Stallman <rms@gnu.org>
18383
18384 * src/reduce.c (nbits): Add some casts.
18385
183861996-08-12 Richard Stallman <rms@gnu.org>
18387
18388 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
18389
183901996-08-12 Richard Stallman <rms@gnu.org>
18391
18392 * bison.simple: Test _MSDOS as well as _MSDOS_.
18393
183941996-07-31 Richard Stallman <rms@gnu.org>
18395
18396 * src/bison.s1:
18397 [__sun && __i386]: Include alloca.h.
18398
183991996-07-31 Richard Stallman <rms@gnu.org>
18400
18401 * bison.simple:
18402 [__sun && __i386]: Include alloca.h.
18403
184041996-07-30 Richard Stallman <rms@gnu.org>
18405
18406 * src/bison.s1: Comment change.
18407
18408 * src/bison.s1: Test _MSDOS_, not MSDOS.
18409
184101996-07-30 Richard Stallman <rms@gnu.org>
18411
18412 * bison.simple: Comment change.
18413
18414 * bison.simple: Test _MSDOS_, not MSDOS.
18415
184161996-06-01 Richard Stallman <rms@gnu.org>
18417
18418 * 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:
18419 Insert `_' macro around many string constants.
18420
18421 * src/main.c:
18422 Insert `_' macro around many string constants.
18423
18424 (main): Call setlocale, bindtextdomain and textdomain.
18425
18426 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
18427 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
18428 [ENABLE_NLS]: Include libintl.h.
18429 [ENABLE_NLS] (gettext): Define.
18430 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
18431 (N_, PACKAGE, LOCALEDIR): New macros.
18432
184331996-06-01 Richard Stallman <rms@gnu.org>
18434
18435 * POTFILES.in: New file.
18436
18437 * Makefile.in (allocate.o):
18438 Define target explicitly.
18439
18440 * Makefile.in (CFLAGS): Set to @CFLAGS@.
18441 (LDFLAGS): Set to @LDFLAGS@.
18442 (configure): Run autoconf only if preceding `cd' succeeds.
18443 (bison.s1): Redirect output to temporary file then move the
18444 temporary to the target, rather than redirecting directly to bison.s1.
18445 (clean): Remove config.status and config.log.
18446 (distclean): Don't remove config.status here.
18447
184481996-05-12 Richard Stallman <rms@gnu.org>
18449
18450 * src/bison.s1:
18451 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18452
184531996-05-12 Richard Stallman <rms@gnu.org>
18454
18455 * bison.simple:
18456 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18457
184581996-05-11 Richard Stallman <rms@gnu.org>
18459
18460 * src/bison.s1 (__yy_memcpy):
18461 Really reorder the args, as was supposedly done on Feb 14 1995.
18462 (yyparse): Calls changed accordingly.
18463
184641996-05-11 Richard Stallman <rms@gnu.org>
18465
18466 * Makefile.in (dist): Don't use $(srcdir).
18467
18468 * bison.simple (__yy_memcpy):
18469 Really reorder the args, as was supposedly done on Feb 14 1995.
18470 (yyparse): Calls changed accordingly.
18471
184721996-01-27 Richard Stallman <rms@gnu.org>
18473
18474 * src/output.c (output_rule_data):
18475 Test YYERROR_VERBOSE in the conditional
18476 around the definition of ttyname.
18477
184781995-12-29 Richard Stallman <rms@gnu.org>
18479
18480 * src/bison.s1:
18481 Fix line numbers in #line commands.
18482
184831995-12-29 Richard Stallman <rms@gnu.org>
18484
18485 * bison.simple:
18486 Fix line numbers in #line commands.
18487
184881995-12-27 Richard Stallman <rms@gnu.org>
18489
18490 * src/bison.s1 (YYPARSE_PARAM_DECL):
18491 In C++, make it always null.
18492 (YYPARSE_PARAM_ARG): New macro.
18493 (yyparse): Use YYPARSE_PARAM_ARG.
18494
184951995-12-27 Richard Stallman <rms@gnu.org>
18496
18497 * bison.simple (YYPARSE_PARAM_DECL):
18498 In C++, make it always null.
18499 (YYPARSE_PARAM_ARG): New macro.
18500 (yyparse): Use YYPARSE_PARAM_ARG.
18501
185021995-11-29 Richard Stallman <rms@gnu.org>
18503
18504 * doc/bison.texinfo:
18505 Describe literal string tokens, %raw, %no_lines, %token_table.
18506
185071995-11-29 Daniel Hagerty <hag@gnu.org>
18508
18509 * doc/bison.texinfo: Fixed update date
18510
185111995-10-16 Richard Stallman <rms@gnu.org>
18512
18513 * src/version.c: Version 1.25.
18514
185151995-10-16 Richard Stallman <rms@gnu.org>
18516
18517 * NEWS: *** empty log message ***
18518
185191995-10-16 Richard Stallman <rms@gnu.org>
18520
18521 * doc/bison.1, doc/bison.rnh:
18522 Add new options.
18523
185241995-10-15 Richard Stallman <rms@gnu.org>
18525
18526 * src/vmsgetargs.c, src/getargs.c:
18527 Added -n, -k, and -raw switches.
18528 (noparserflag, toknumflag, rawtoknumflag): New variables.
18529
18530 * src/symtab.h (SALIAS):
18531 New #define for adding aliases to %token.
18532 (struct bucket): Added `alias' field.
18533
18534 * src/reduce.c (reduce_grammar):
18535 Revise error message.
18536 (print_notices): Remove final `.' from error message.
18537
18538 * src/reader.c (reader_output_yylsp):
18539 New function.
18540 (readgram): Use `#if 0' around code that accepted %command
18541 inside grammar rules: The documentation doesn't allow it,
18542 and it will fail since the %command processors scan for the next %.
18543 (parse_token_decl): Extended the %token
18544 declaration to allow a multi-character symbol as an alias.
18545 (parse_thong_decl): New function.
18546 (read_declarations): Added %thong declarations.
18547 (read_declarations): Handle NOOP to deal with allowing
18548 % declarations as another means to specify the flags.
18549 (readgram): Allow %prec prior to semantics embedded in a rule.
18550 (skip_to_char, read_declarations, copy_definition)
18551 (parse_token_decl, parse_start_decl, parse_type_decl)
18552 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
18553 (get_type_name, copy_guard, copy_action, readgram)
18554 (get_type, packsymbols): Revised most error messages.
18555 Changed `fatal' to `warnxxx' to avoid aborting for error.
18556 Revised and use multiple warnxxx functions to avoid using VARARGS1.
18557 (read_declarations): Improve the error message for
18558 an invalid character. Do not abort.
18559 (read_declarations, copy_guard, copy_action): Use
18560 printable_version to avoid unprintable characters in printed output.
18561 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
18562 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
18563 Allow the type of a non-terminal can be given
18564 more than once, as long as all specifications give the same type.
18565
18566 * src/output.c:
18567 (output_headers, output_trailers, output, output_gram)
18568 (output_rule_data): Implement noparserflag variable.
18569 Implement toknumflag variable.
18570 (output): Call reader_output_yylsp to output LTYPESTR.
18571
18572 * src/main.c (main):
18573 If reader sees an error, don't process the grammar.
18574 (fatals): Updated to not use VARARGS1.
18575 (printable_version, int_to_string, warn, warni, warns, warnss)
18576 (warnsss): New error reporting functions. Avoid abort for error.
18577
18578 * src/lex.h:
18579 Added THONG and NOOP for alias processing.
18580 Added SETOPT for the new code that allows setting options with %flags.
18581
18582 * src/lex.c:
18583 Include getopt.h. Add some extern decls.
18584 (safegetc): New function to deal with EOF gracefully.
18585 (literalchar); new function to deal with reading \ escapes.
18586 (lex): Use literalchar.
18587 (lex): Implemented "..." tokens.
18588 (literalchar, lex, parse_percent_token): Made tokenbuffer
18589 always contain the token. This includes growing the token
18590 buffer while reading an integer.
18591 (parse_percent_token): Replaced if-else statement with percent_table.
18592 (parse_percent_token): Added % declarations as another
18593 way to specify the flags -n, -l, and -r. Also added hooks for
18594 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
18595 major changes to files.c.
18596 (lex) Retain in the incoming stream a character following
18597 an incorrect '/'.
18598 (skip_white_space, lex): Revised most error messages
18599 and changed fatal to warn to avoid aborting.
18600 (percent_table): Added %thong declarations.
18601
18602 * src/gram.h: Comment changes.
18603
18604 * src/files.c (openfiles, open_extra_files, done):
18605 Add faction flag
18606 and actfile file. Handle noparserflag. Both for -n switch.
18607
18608 * src/conflicts.c (resolve_sr_conflict):
18609 Remove use of alloca.
18610
186111995-06-01 Jim Meyering <meyering@gnu.org>
18612
18613 * doc/bison.texinfo: *** empty log message ***
18614
186151995-05-06 Richard Stallman <rms@gnu.org>
18616
18617 * src/bison.s1: Comment change.
18618
186191995-05-06 Richard Stallman <rms@gnu.org>
18620
18621 * bison.simple: Comment change.
18622
186231995-05-03 Richard Stallman <rms@gnu.org>
18624
18625 * src/version.c: Version now 1.24.
18626
18627 * src/bison.s1: Change distribution terms.
18628
18629 * src/version.c: Version now 1.23.
18630
186311995-05-03 Richard Stallman <rms@gnu.org>
18632
18633 * doc/bison.texinfo:
18634 Rewrite "Conditions for Using Bison".
18635 Update version to 1.24.
18636
186371995-05-03 Richard Stallman <rms@gnu.org>
18638
18639 * bison.simple: Change distribution terms.
18640
186411995-02-23 Richard Stallman <rms@gnu.org>
18642
18643 * src/files.c: Test __VMS_POSIX as well as VMS.
18644
186451995-02-14 Jim Meyering <meyering@gnu.org>
18646
18647 * src/bison.s1 (__yy_memcpy):
18648 Renamed from __yy_bcopy to avoid
18649 confusion. Reverse FROM and TO arguments to be consistent with
18650 those of memcpy.
18651
186521995-02-14 Jim Meyering <meyering@gnu.org>
18653
18654 * bison.simple (__yy_memcpy):
18655 Renamed from __yy_bcopy to avoid
18656 confusion. Reverse FROM and TO arguments to be consistent with
18657 those of memcpy.
18658
186591994-11-10 David J. MacKenzie <djm@gnu.org>
18660
18661 * NEWS: reformat
18662
18663 * NEWS: New file.
18664
18665 * Makefile.in (DISTFILES): Include NEWS.
18666
18667 * Makefile.in (DISTFILES):
18668 Include install-sh, not install.sh.
18669
18670 * configure.in: Update to Autoconf v2 macro names.
18671
186721994-10-05 David J. MacKenzie <djm@gnu.org>
18673
18674 * Makefile.in: fix typo
18675
18676 * Makefile.in (prefix, exec_prefix):
18677 Let configure set them.
18678
186791994-09-28 David J. MacKenzie <djm@gnu.org>
18680
18681 * Makefile.in: Set datadir to $(prefix)/share.
18682
186831994-09-15 Richard Stallman <rms@gnu.org>
18684
18685 * src/bison.s1:
18686 Update copyright notice and GPL version.
18687
186881994-09-15 Richard Stallman <rms@gnu.org>
18689
18690 * bison.simple:
18691 Update copyright notice and GPL version.
18692
186931994-07-12 Richard Stallman <rms@gnu.org>
18694
18695 * src/reduce.c, src/reader.c:
18696 entered into RCS
18697
186981994-05-05 David J. MacKenzie <djm@gnu.org>
18699
18700 * Makefile.in: entered into RCS
18701
187021994-03-26 Richard Stallman <rms@gnu.org>
18703
18704 * src/bison.s1: entered into RCS
18705
187061994-03-26 Richard Stallman <rms@gnu.org>
18707
18708 * bison.simple: entered into RCS
18709
187101994-03-25 Richard Stallman <rms@gnu.org>
18711
18712 * src/main.c: entered into RCS
18713
187141994-03-24 Richard Stallman <rms@gnu.org>
18715
18716 * src/conflicts.c: entered into RCS
18717
187181994-01-02 Richard Stallman <rms@gnu.org>
18719
18720 * Makefile.in: *** empty log message ***
18721
187221993-11-21 Richard Stallman <rms@gnu.org>
18723
18724 * src/bison.s1: *** empty log message ***
18725
187261993-11-21 Richard Stallman <rms@gnu.org>
18727
18728 * doc/bison.texinfo: entered into RCS
18729
18730 * doc/bison.texinfo: *** empty log message ***
18731
187321993-11-21 Richard Stallman <rms@gnu.org>
18733
18734 * bison.simple: *** empty log message ***
18735
187361993-10-25 David J. MacKenzie <djm@gnu.org>
18737
18738 * doc/bison.texinfo: *** empty log message ***
18739
187401993-10-19 Richard Stallman <rms@gnu.org>
18741
18742 * src/bison.s1: *** empty log message ***
18743
187441993-10-19 Richard Stallman <rms@gnu.org>
18745
18746 * bison.simple: *** empty log message ***
18747
187481993-10-14 Richard Stallman <rms@gnu.org>
18749
18750 * src/bison.s1: *** empty log message ***
18751
187521993-10-14 Richard Stallman <rms@gnu.org>
18753
18754 * bison.simple: *** empty log message ***
18755
187561993-09-14 David J. MacKenzie <djm@gnu.org>
18757
18758 * doc/bison.texinfo: *** empty log message ***
18759
187601993-09-13 Noah Friedman <friedman@gnu.org>
18761
18762 * Makefile.in: *** empty log message ***
18763
187641993-09-10 Richard Stallman <rms@gnu.org>
18765
18766 * src/conflicts.c: *** empty log message ***
18767
18768 * src/system.h: entered into RCS
18769
187701993-09-10 Richard Stallman <rms@gnu.org>
18771
18772 * doc/bison.1: entered into RCS
18773
187741993-09-06 Noah Friedman <friedman@gnu.org>
18775
18776 * src/version.c: entered into RCS
18777
187781993-09-06 Noah Friedman <friedman@gnu.org>
18779
18780 * Makefile.in: *** empty log message ***
18781
187821993-07-30 David J. MacKenzie <djm@gnu.org>
18783
18784 * Makefile.in: *** empty log message ***
18785
187861993-07-24 Richard Stallman <rms@gnu.org>
18787
18788 * src/bison.s1: *** empty log message ***
18789
187901993-07-24 Richard Stallman <rms@gnu.org>
18791
18792 * bison.simple: *** empty log message ***
18793
187941993-07-08 David J. MacKenzie <djm@gnu.org>
18795
18796 * Makefile.in: *** empty log message ***
18797
187981993-07-04 Richard Stallman <rms@gnu.org>
18799
18800 * src/bison.s1: *** empty log message ***
18801
188021993-07-04 Richard Stallman <rms@gnu.org>
18803
18804 * bison.simple: *** empty log message ***
18805
188061993-06-26 David J. MacKenzie <djm@gnu.org>
18807
18808 * src/getargs.c: entered into RCS
18809
188101993-06-26 David J. MacKenzie <djm@gnu.org>
18811
18812 * doc/bison.texinfo: *** empty log message ***
18813
18814 * doc/bison.1: New file.
18815
188161993-06-25 Richard Stallman <rms@gnu.org>
18817
18818 * src/getargs.c: New file.
18819
188201993-06-16 Richard Stallman <rms@gnu.org>
18821
18822 * src/bison.s1: *** empty log message ***
18823
188241993-06-16 Richard Stallman <rms@gnu.org>
18825
18826 * bison.simple: *** empty log message ***
18827
188281993-06-03 Richard Stallman <rms@gnu.org>
18829
18830 * src/bison.s1: New file.
18831
188321993-06-03 Richard Stallman <rms@gnu.org>
18833
18834 * doc/bison.texinfo: *** empty log message ***
18835
188361993-06-03 Richard Stallman <rms@gnu.org>
18837
18838 * bison.simple: New file.
18839
188401993-05-19 Richard Stallman <rms@gnu.org>
18841
18842 * doc/bison.texinfo: New file.
18843
188441993-05-07 Noah Friedman <friedman@gnu.org>
18845
18846 * Makefile.in: *** empty log message ***
18847
188481993-04-28 Noah Friedman <friedman@gnu.org>
18849
18850 * src/reader.c: *** empty log message ***
18851
188521993-04-23 Noah Friedman <friedman@gnu.org>
18853
18854 * src/alloc.h: entered into RCS
18855
188561993-04-20 David J. MacKenzie <djm@gnu.org>
18857
18858 * src/version.c: *** empty log message ***
18859
18860 * src/files.c, src/allocate.c:
18861 entered into RCS
18862
18863 * src/reader.c: *** empty log message ***
18864
18865 * src/lex.c: entered into RCS
18866
18867 * src/conflicts.c: New file.
18868
18869 * src/symtab.c: entered into RCS
18870
18871 * src/alloc.h: New file.
18872
18873 * src/LR0.c: entered into RCS
18874
188751993-04-18 Noah Friedman <friedman@gnu.org>
18876
18877 * src/reader.c: New file.
18878
18879 * src/version.c: *** empty log message ***
18880
188811993-04-18 Noah Friedman <friedman@gnu.org>
18882
18883 * Makefile.in: *** empty log message ***
18884
188851993-04-17 Noah Friedman <friedman@gnu.org>
18886
18887 * Makefile.in: *** empty log message ***
18888
188891993-04-15 Richard Stallman <rms@gnu.org>
18890
18891 * src/main.c, src/files.c:
18892 New file.
18893
188941993-04-15 Noah Friedman <friedman@gnu.org>
18895
18896 * configure.in: entered into RCS
18897
18898 * configure.in: *** empty log message ***
18899
18900 * configure.in: New file.
18901
189021993-04-14 Richard Stallman <rms@gnu.org>
18903
18904 * Makefile.in: New file.
18905
189061993-04-13 Richard Stallman <rms@gnu.org>
18907
18908 * src/version.c: New file.
18909
189101993-03-25 Richard Stallman <rms@gnu.org>
18911
18912 * src/output.c: entered into RCS
18913
189141992-09-25 Richard Stallman <rms@gnu.org>
18915
18916 * configure.bat: entered into RCS
18917
189181992-06-22 Richard Stallman <rms@gnu.org>
18919
18920 * src/vmsgetargs.c: entered into RCS
18921
189221992-06-22 Richard Stallman <rms@gnu.org>
18923
18924 * doc/bison.rnh: entered into RCS
18925
189261992-04-20 David J. MacKenzie <djm@gnu.org>
18927
18928 * README: entered into RCS
18929
189301992-01-22 Richard Stallman <rms@gnu.org>
18931
18932 * src/machine.h: entered into RCS
18933
189341991-12-21 Richard Stallman <rms@gnu.org>
18935
18936 * src/lalr.c, src/closure.c:
18937 entered into RCS
18938
189391991-12-20 Richard Stallman <rms@gnu.org>
18940
18941 * src/state.h: entered into RCS
18942
189431991-12-18 Richard Stallman <rms@gnu.org>
18944
18945 * src/print.c, src/nullable.c, src/derives.c:
18946 entered into RCS
18947
189481991-11-03 David J. MacKenzie <djm@gnu.org>
18949
18950 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
18951 entered into RCS
18952
189531988-09-09 Richard Stallman <rms@gnu.org>
18954
18955 * src/bison.hairy: entered into RCS
18956
189571987-12-16 Richard Stallman <rms@gnu.org>
18958
18959 * REFERENCES: entered into RCS
18960
18961
18962 -----
18963
18964 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
18965 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
18966 Free Software Foundation, Inc.
18967
18968 Copying and distribution of this file, with or without
18969 modification, are permitted provided the copyright notice and this
18970 notice are preserved.
18971
18972$Id$