]> git.saurik.com Git - bison.git/blob - ChangeLog
d42aa25471a1b2831e993d5aaf2ef42af0fdbdb2
[bison.git] / ChangeLog
1 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 * src/Makefile.am (yacc): Quote target action commands properly so
4 that the yacc script isn't corrupt. Reported by Hans Aberg at
5 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6
7 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
8
9 Extend the front-end API for %define variables to more completely
10 mirror the back-end. This will be useful in the future.
11 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
12 Update comments to mention the new front-end counterparts of these
13 macros.
14 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
15 for muscle_string_decode and muscle_location_decode.
16 (muscle_string_decode): New static function.
17 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
18 (muscle_percent_define_get, muscle_percent_define_ifdef): New
19 functions.
20 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
21 muscle_percent_define_get to mimic the b4_percent_define_flag_if
22 implementation more closely.
23 (muscle_percent_define_invalid_value): New function.
24 * src/muscle_tab.h (muscle_percent_define_get,
25 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
26 Prototype.
27
28 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
29
30 * NEWS (2.3a+): Mention yesterday's state-removal change.
31 (2.3a): Remove the %language entry, which was added after 2.3a.
32 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
33 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
34 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
35 tests/existing.at: Update copyright date.
36
37 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
38
39 If conflict resolution makes states unreachable, remove those states,
40 report rules that are then unused, and don't report conflicts in those
41 states.
42 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
43 New global function.
44 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
45 function.
46 * src/main.c (main): After conflict resolution, remove the unreachable
47 states and update all data structures that reference states by number.
48 * src/state.c (state_new): Initialize each state's reachable member to
49 false.
50 (state_mark_reachable_states): New static function.
51 (state_remove_unreachable_states): New global function.
52 * src/state.h (struct state): Add member bool reachable.
53 (state_remove_unreachable_states): Prototype.
54 * tests/conflicts.at (Unreachable States After Conflict Resolution):
55 New test case.
56 * tests/existing.at (GNU pic Grammar): Update test case output now that
57 an unused rule is discovered.
58
59 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
60
61 Minor code cleanup in parser table construction.
62 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
63 (new_itemsets, save_reductions): Update for rename to nitemset.
64 * src/closure.c (nritemset): Rename to...
65 (nitemset): ... this since the "r" appears to meaningless and isn't
66 used in the comments.
67 (closure): Update for rename.
68 * src/closure.h (nritemset): Update extern to...
69 (nitemset): ... this.
70 * src/lalr.c (LA): Fix a typo in comments.
71 * src/print.c (print_core): Update for rename to nitemset.
72 * src/print_graph.c (print_graph): Likewise.
73 * src/state.h: Fix some typos in header comments.
74
75 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
76
77 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
78 still sticks to ASCII. Sorry!
79
80 * README-hacking: New file, taken mostly from coreutils, with changes
81 for Bison. Contains much of the contents of:
82 * README-cvs: Remove.
83 * bootstrap: Sync from gnulib.
84 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
85 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
86
87 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
88
89 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
90 Setzer.
91 (Java Differences): Fix some typos.
92 * THANKS: Add Sebastian Setzer.
93
94 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
95
96 * data/java.m4 (b4_single_class_if): Remove.
97 (b4_abstract_if): Look at "%define abstract".
98 (b4_lexer_if): New.
99 (b4_union_name): Rename...
100 (b4_yystype): ... to this. Map to "%define stype".
101 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
102 b4_maybe_throws): Fix quoting.
103 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
104 * data/lalr1.java (Lexer interface): Always define.
105 (Lexer interface within parser class): Remove.
106 (YYLexer class): New, used when "%code lexer" is present.
107 (constructor): When "%code lexer" is used, pass %lex-param
108 to the lexer constructor.
109 (yylex, yyparse): Remove %lex-param from method invocations
110 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
111
112 * doc/bison.texinfo (Java Bison Interface): Mention "%define
113 abstract". Rename "%define union_name" to "%define stype".
114 Rename method names according to previous patch.
115 (Java Scanner Interface): Describe "%code lexer" instead of
116 "%pure-parser" and "%define single_class".
117 (Java Differences): Mention "%code lexer".
118
119 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
120 Include scanner here, using macros from tests/local.at.
121 (AT_DATA_CALC_Y): Remove final argument.
122 (_AT_CHECK_JAVA_CALC): Likewise.
123 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
124 of %locations and %error-verbose.
125 (main): Test with and without %lex-param.
126 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
127 (AT_BISON_OPTION_POPDEFS): Pop it.
128
129 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
130
131 DJGPP spefic issue. Inhibit the use of disallowed characters for
132 file name genertion on Win98, WinXP, etc. These are |<>":?*\
133 and concern testsuite case 46.
134 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
135 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
136 * djgpp/config.bat: Inhibit the use of disallowed characters.
137
138 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
139
140 Miscellaneous %define and %code cleanup.
141 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
142 values are interpreted.
143 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
144 documentation a little more.
145 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
146 muscle_percent_define_insert, muscle_percent_code_grow): New
147 functions/macros.
148 * src/muscle_tab.h (muscle_percent_define_insert,
149 muscle_percent_code_grow): Prototype.
150 * src/parse-gram.y (prologue_declaration): Use
151 muscle_percent_define_insert and muscle_percent_code_grow when parsing
152 %define and %code directives.
153
154 Make it easy to share %define boolean variables between the front-end
155 and back-end. Though not used yet, this will be useful in the future.
156 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
157 Bison uses of names rather than just skeleton uses of names.
158 (b4_percent_define_get, b4_percent_define_ifdef): Rename
159 b4_percent_define_skeleton_variables(VARIABLE) to
160 b4_percent_define_bison_variables(VARIABLE).
161 (b4_percent_code_get, b4_percent_code_ifdef): Rename
162 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
163 b4_percent_code_bison_qualifiers(QUALIFIER).
164 (b4_check_user_names_wrap): Update for renames.
165 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
166 muscle_percent_define_default): New functions mimicking
167 b4_percent_define_flag_if and b4_percent_define_default.
168
169 For %define variables, report locations for invalid values and
170 redefinitions.
171 * data/bison.m4 (b4_percent_define_flag_if): Read
172 b4_percent_define_loc(VARIABLE) to report the location of an invalid
173 value for VARIABLE.
174 (b4_percent_define_default): Save a special location in
175 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
176 must later be reported as invalid.
177 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
178 functions.
179 (muscle_percent_define_insert): Record the location of VARIABLE in
180 muscle percent_define_loc(VARIABLE), and use it to report the previous
181 location for a redefinition.
182 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
183 (muscle_percent_define_default): Update like b4_percent_define_default.
184 (muscle_grow_user_name_list): Rename to...
185 (muscle_user_name_list_grow): ... this for consistency and use
186 muscle_location_grow.
187 * src/muscle_tab.h (muscle_location_grow): Prototype.
188 * tests/input.at (%define errors): Update expected output.
189 * tests/skeletons.at (%define boolean variables: invalid skeleton
190 defaults): New test case.
191
192 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
193
194 * src/print.c (lookahead_set, state_default_rule): Remove.
195 (print_reductions): Replace state_default_rule invocation with
196 equivalent use of yydefact, which was computed in token_actions in
197 tables.c.
198 (print_results): Don't allocate lookahead_set.
199
200 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
201
202 * data/lalr1.java: Prefix all private members with yy.
203
204 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
205
206 Use YYFPRINTF instead of fprintf where appropriate. Reported by
207 Sebastien Fricker at
208 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
209 * THANKS: Add Sebastien Fricker.
210 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
211 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
212 accept a variable number of arguments.
213
214 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
215
216 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
217
218 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
219
220 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
221 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
222 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
223
224 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
225
226 Undo my 2007-02-07 change, switching back to the c-strcase module
227 introduced in the 2007-02-03 change. Bruno Haible reported that
228 the 2007-02-07 change would be dangerous in Turkish if we add a
229 language whose name contains "i", since "i" is not lowercase "I"
230 in Turkish.
231 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
232 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
233 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
234 * m4/.cvsignore: Remove strcase.m4.
235 * src/getargs.c: Revert 2007-02-07 change, as follows.
236 Include c-strcase.h.
237 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
238
239 2007-02-11 Bruno Haible <bruno@clisp.org>
240
241 Enable the Java related testsuite tests when the only Java compiler
242 found is a gcj < 4.3. Discussed at
243 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
244 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
245
246 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
247
248 * data/Makefile.am: Update copyright date.
249 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
250 yypstate_new returns NULL.
251 (yypstate_new): Return NULL if malloc does.
252 * src/reader.c (packgram): Move translation of rule actions from the
253 beginning of packgram to...
254 (check_and_convert_grammar): ... here right before packgram is invoked
255 so it's easier to write more complete comments, and remove redundant
256 code.
257
258 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
259
260 As in semantic actions, make @$ in %initial-action, %destructor, and
261 %printer imply %locations.
262 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
263 scanning @$.
264 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
265 (@$ in %initial-action implies %locations,
266 @$ in %destructor implies %locations,
267 @$ in %printer implies %locations): ... these new test cases.
268
269 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
270
271 Undo most of the 2007-02-03 change, switching to the strcase module
272 now that gnulib strcase has been fixed.
273 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
274 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
275 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
276 * m4/.cvsignore: Add strcase.m4.
277 * src/getargs.c: Revert 2007-02-03 change, as follows.
278 Don't include c-strcase.h.
279 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
280 strcasecmp has "unspecified behavior" outside the POSIX locale,
281 but it works fine in practice if at least one argument is ASCII,
282 as is the case in Bison.
283
284 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
285
286 * tests/java.at: Skip tests if only one of javac/java is present.
287 Reported by Joel E. Denny.
288 * tests/atlocal.in: Adjust copyright years.
289
290 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
291
292 * data/lalr1.java (Stack): Work around old verifiers that disallow
293 access to the private fields of an inner class, from the outer class.
294 We can make Stack's fields public because user code doesn't have access
295 to the instance of Stack used by parse(). Reported by Paul Eggert.
296
297 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
298
299 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
300 the right spot for these files?
301 * bootstrap.conf (gnulib_modules): Add c-strcase.
302 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
303 c-strncasecmp.c.
304 * src/getargs.c: Include c-strcase.h.
305 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
306 to avoid unspecified behavior.
307
308 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
309
310 * doc/bison.texinfo (Decl Summary): Correct typo.
311
312 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
313
314 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
315 Complain if the value does not match empty, "true" or "false".
316 * data/c++.m4: Adjust default definitions of %define variables.
317 * data/java.m4: Adjust default definitions of %define variables.
318 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
319 to above behavior.
320 * tests/input.at (Boolean %define variables): Test new behavior.
321
322 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
323
324 * NEWS: Mention java.
325 * TODO: Remove things that are done.
326 * bootstrap.conf: Add javacomp-script and javaexec-script.
327 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
328
329 * data/Makefile.am: Add new files.
330 * data/java-skel.m4: New.
331 * data/java.m4: New.
332 * data/lalr1.java: New.
333
334 * doc/bison.texinfo: Put "A Complete C++ Example" under
335 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
336 under Other Languages.
337
338 * src/getargs.c (valid_languages): Add Java.
339 * src/getargs.h (struct bison_language): Update size of string fields.
340
341 * tests/Makefile.am: Add java.at.
342 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
343 * tests/java.at: New.
344 * tests/testsuite.at: Include it.
345
346 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
347
348 Clean up.
349 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
350 at_directive_argv arguments so these no longer have to be global
351 variables. Also, update the implementation for the following changes.
352 (fail_for_at_directive_too_many_args,
353 fail_for_at_directive_too_few_args): Add at_directive_name argument.
354 (at_directive_name): Remove as at_directive_argv[0] will be used for
355 this now.
356 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
357 for the directive name.
358 (at_directive_argc, at_directive_argv): Make these local within
359 skel_lex instead of global.
360 (INITIAL): Update directive start action for above changes.
361 (SC_AT_DIRECTIVE_ARG): Rename to...
362 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
363 (SC_AT_DIRECTIVE_SKIP_WS): Update.
364 (scan_skel): Move yylex_destroy to...
365 (skel_scanner_free): ... here.
366 * tests/skeletons.at (installed skeleton file name): Rename to...
367 (installed skeleton file names): ... this.
368
369 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
370
371 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
372 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
373 Summary" not "Directives".
374 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
375 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
376 since the former is now the more complete one.
377 (Prologue Alternatives): Likewise and do the same for %defines.
378 (Table of Symbols): Add summary of %code, add summary of %define, and
379 move full %code documentation to...
380 (Decl Summary): ... here for consistency with other entries in these
381 sections.
382 Move %define entry in order to keep this list alphabetized.
383 Reword %define entry a little to put less emphasis on the skeleton
384 concept, which most users shouldn't have to think about.
385
386 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
387
388 Adjust to recent gnulib changes.
389 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
390 Add string.h, string_.h, unistd_.h, wchar_.h.
391 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
392 * src/system.h: Don't include <stpcpy.h>; this is now done by
393 <string.h>.
394
395 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
396
397 Simplify implementation of unqualified %code, implement macros for
398 uniform treatment of boolean %define flags. Document %define.
399 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
400 b4_percent_code_ifdef): New.
401 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
402 * data/c++.m4: Define default value for global_tokens_and_yystype.
403 * data/glr.cc: Likewise.
404 * data/location.cc: Use b4_percent_define_flag_if.
405
406 * doc/bison.texinfo (Decl Summary): Document %define.
407
408 * src/parse-gram.y (Unqualified %code): Change muscle name to
409 b4_percent_code().
410 (content.opt): Default to empty.
411
412 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
413
414 Implement support for relative and absolute skeleton file names.
415 Discussed starting at
416 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
417 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
418 (Bison Options): Document in --skeleton entry.
419 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
420 full_skeleton can't necessarily hold all of pkgdatadir.
421 If the specified skeleton file name contains a `/', don't prepend
422 pkgdatadir.
423 * src/parse-gram.y (prologue_declaration): If the specified skeleton
424 file name contains a `/', prepend the grammar file directory.
425 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
426 * skeletons.at: New file.
427 (relative skeleton file names): New test case.
428 (installed skeleton file names): New test case.
429 * tests/testsuite.at: Include skeletons.at.
430
431 * bootstrap: Update copyright to 2007.
432
433 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
434
435 * bootstrap: Remove occurrences of .#bootmp from the files.
436
437 2007-01-17 Akim Demaille <akim@epita.fr>
438
439 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
440 nonterminals.
441 Use per-type %printer.
442
443 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
444
445 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
446 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
447 djgpp/config.site, src/files.c, src/files.h, src/main.c,
448 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
449 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
450 tests/glr-regression.at, tests/input.at, tests/local.at,
451 tests/output.at, tests/torture.at: Update copyright to 2007.
452
453 2007-01-16 Akim Demaille <akim@epita.fr>
454
455 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
456 error code.
457 (Calc++ Scanner): Exit with failure if we can't open the input
458 file.
459 Accept "-" standing for stdin.
460 (Calc++ Top Level): Print the result only if the parsing was
461 successful.
462
463 2007-01-16 Akim Demaille <akim@epita.fr>
464
465 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
466
467 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
468 and Joel E. Denny <jdenny@ces.clemson.edu>
469
470 Clean up %define and %code implementation in M4 some. Most
471 importantly, rename all related macros to be in the b4_percent_define
472 and b4_percent_code namespaces. Also, complete support for `.' in
473 %define variable names and %code qualifiers.
474 * data/bison.m4 (b4_check_user_names): Check for special
475 "SKELETON-NAMESPACE(name)" macros instead of using two nested
476 m4_foreach loops.
477 (b4_get_percent_define, b4_get_percent_code): Rename to...
478 (b4_percent_define_get, b4_percent_code_get): ... these.
479 Extend documentation with examples.
480 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
481 b4_percent_define_skeleton_variables and
482 b4_percent_code_skeleton_qualifiers.
483 Expect any value for the %define variable `foo' to be stored in the
484 macro named `b4_percent_define(foo)'; expect any %code blocks for the
485 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
486 expect any unqualified %code blocks to be stored in a macro named
487 `b4_percent_code_unqualified'.
488 Use m4_indir so that %define variable names and %code qualifiers can
489 contain `.', which is allowed by the grammar parser.
490 (b4_percent_define_default): New macro to set a default value for a
491 %define variable.
492 (m4_wrap): Update wrapped code, and fix some underquoting.
493 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
494 Expect grammar uses of %define variables and %code qualifiers to be
495 defined in b4_percent_define_user_variables and
496 b4_percent_code_user_qualifiers.
497 * data/c++.m4: Use b4_percent_define_default rather than
498 m4_define_default. Fix some underquoting. Skeleton usage of %define
499 variable define_location_comparison now implies skeleton usage of
500 %define variable filename_type.
501 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
502 data/push.c, data/yacc.c: Update macro names.
503 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
504 muscle names.
505
506 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
507
508 DJGPP specific issues.
509
510 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
511 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
512
513 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
514
515 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
516 run parsers in all tests so that Valgrind is invoked during
517 maintainer-check-valgrind.
518 (Duplicate representation of merged trees): Free all semantic values.
519 (Duplicated user destructor for lookahead): Likewise.
520
521 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
522
523 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
524 command-line prefix.
525 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
526 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
527 miss Valgrind messages.
528 (Exploding the Stack Size with Malloc): Likewise.
529
530 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
531
532 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
533 locals. Reported by Juan Manuel Guerrero at
534 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
535 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
536 Fix some indentation also.
537 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
538 explaining this issue.
539
540 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
541 and Joel E. Denny <jdenny@ces.clemson.edu>
542
543 Simplify union and prologue handling, and escape union and lex/parse
544 params with digraphs.
545 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
546 values to the empty string since these are no longer guaranteed
547 initialized by the front-end.
548 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
549 braces around b4_user_stype since this is no longer done by the
550 front-end.
551 * src/files.c, src/files.h (pre_prologue_obstack,
552 post_prologue_obstack): Remove.
553 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
554 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
555 with digraphs. This fixes lex params and parse params.
556 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
557 * src/output.c (prepare): Remove muscle insertion of the prologues.
558 (output): Remove freeing of pre_prologue_obstack and
559 post_prologue_obstack.
560 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
561 than prologue_augment for prologue parsing so you don't need prologue
562 obstacks.
563 (grammar_declaration): For %union RHS, use `braceless' instead of
564 "{...}" so that braces are already stripped and code is escaped with
565 digraphs.
566 * src/reader.c (prologue_augment): Remove.
567 (reader): Remove initialization of pre_prologue_obstack and
568 post_prologue_obstack.
569 * src/reader.h (prologue_augment): Remove.
570
571 * data/c.m4: Remove stray parenthesis.
572
573 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
574
575 Remove quotes from variables names in %define directives and from
576 qualifiers in %code directives, and restrict the characters that are
577 allowed in them to M4-friendly ones. For %define, continue to support
578 the quoted form as a deprecated feature. Discussed starting at
579 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
580 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
581 %code.
582 * doc/bison.texinfo (Prologue Alternatives): Update.
583 (Bison Declaration Summary): In %defines entry, update mention of
584 `%code requires' and `%code provides'.
585 (C++ Location Values): Update %define uses.
586 (Calc++ Parser Interface): Likewise.
587 (Calc++ Parser): Likewise, and update `%code requires' uses.
588 (Table of Symbols): Update %code documentation.
589 * src/parse-gram.y (prologue_declaration): For %define variables, use
590 `variable' instead of `STRING'.
591 (grammar_declaration): For %code qualifiers, use `ID' instead of
592 `STRING'.
593 (variable): New nonterminal that takes an `ID' or a `STRING'.
594 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
595 and %define uses.
596 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
597 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
598 (%define errors): Update %define uses.
599
600 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
601
602 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
603 instead of muscle_insert for %define values so that M4-special
604 characters are replaced with digraphs.
605 * tests/input.at (%define errors): Extend to check weird values.
606
607 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
608
609 Instead of having skeletons declare all valid %define variables and
610 %code qualifiers, provide macros that retrieve the associated values
611 and build these lists automatically. Thus Bison will now warn when a
612 variable or qualifier is not used by the skeleton in the current
613 invocation regardless of whether it might sometimes be used by that
614 skeleton in other invocations. Also, move all %define value macros to
615 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
616 form, which is replaced by %code.
617 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
618 (b4_check_user_names): ... this, and change the series of valid name
619 arguments to a single list argument for names used in the skeleton
620 similar to the existing list argument for names used in the grammar.
621 Warn instead of complaining.
622 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
623 values and %code code, to format %code code properly, and to build
624 lists of all %define variables and %code qualifiers used in the
625 skeleton: b4_skeleton_percent_define_variables and
626 b4_skeleton_percent_code_qualifiers.
627 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
628 Remove, and...
629 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
630 the skeleton names lists can finish building first. In place of
631 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
632 expect the lists b4_user_percent_define_variables and
633 b4_user_percent_code_qualifiers.
634 * data/c++.m4: Where setting default values for b4_parser_class_name,
635 b4_location_type, b4_filename_type, b4_namespace, and
636 b4_define_location_comparison, update their names to the
637 b4_percent_define_ namespace.
638 * data/glr.c: Don't use b4_check_percent_define_variables and
639 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
640 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
641 (b4_parser_class_name, b4_namespace): Define these using
642 b4_get_percent_define for parser_class_name and namespace.
643 * data/location.cc: Use b4_get_percent_define.
644 * data/push.c: Don't use b4_check_percent_define_variables and
645 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
646 * data/yacc.c: Likewise, and don't call m4_exit in
647 b4_use_push_for_pull_if or m4_wrap code will never execute.
648 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
649 Rename to...
650 (muscle_grow_user_name_list): ... this for consistency with the
651 terminology used in bison.m4.
652 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
653 %define variable names, and rename muscle used_percent_define_variables
654 to user_percent_define_variables.
655 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
656 user_percent_code_qualifiers.
657 (content): Remove.
658 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
659 {CODE} form is no longer accepted.
660 * tests/input.at (Reject bad %code qualifiers): Rename to...
661 (Reject unused %code qualifiers): ... this, and update test output.
662 (%define error): Update test output.
663
664 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
665
666 Check for unrecognized %define variables similar to checking for
667 unrecognized %code qualifiers. Check for redefined %define variables.
668 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
669 generalizes...
670 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
671 (b4_check_percent_define_variables): New, also wraps it.
672 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
673 variables using b4_check_percent_define_variables.
674 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
675 all those exercised in the test suite and all those listed in the
676 `Default values' section of c++.m4. Are there others?
677 * data/push.c, data/yacc.c: Declare no valid %define variables.
678 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
679 similar to muscle_find, but it works even when the muscle stores a
680 const value.
681 (muscle_grow_used_name_list): New function for constructing the used
682 name list muscles that b4_check_for_unrecognized_names requires.
683 * src/parse-gram.y (prologue_declaration): Warn if a variable is
684 %define'd more than once. Define the b4_used_percent_define_variables
685 muscle with muscle_grow_used_name_list.
686 (grammar_declaration): Abbreviate %code code with
687 muscle_grow_used_name_list.
688 * tests/input.at (%define errors): New.
689
690 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
691
692 Provide warn_at, complain_at, and fatal_at function callbacks to the
693 skeletons, and use this for %code qualifier complaints.
694 * data/bison.m4 (b4_error_at): New, invoked by...
695 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
696 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
697 @fatal_at(...@) directives.
698 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
699 qualifiers in b4_used_percent_code_qualifiers and to use
700 b4_complain_at.
701 * src/location.c, src/location.h (boundary_set_from_string): New global
702 function.
703 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
704 function.
705 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
706 to b4_used_percent_code_qualifiers.
707 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
708 function.
709 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
710 (lineno): Rename to...
711 (out_lineno): ... this so I don't misunderstand it again.
712 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
713 here; these newlines are in the input but not the output file.
714 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
715 (at_directive_perform): ... this new static function, and add handling
716 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
717 directives.
718 * tests/input.at (Reject bad %code qualifiers): Update test output with
719 locations and extend.
720
721 * tests/output.at (Output file name: [, Output file name: ]): Remove
722 bogus comment about these tests failing.
723
724 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
725
726 Clean up b4_check_percent_code_qualifiers a little.
727 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
728 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
729 documentation and add examples.
730 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
731 qualifiers here.
732
733 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
734
735 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
736 unreliable -- especially when they're hidden inside another macro.
737 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
738 data/c.m4: Remove m4_divert(-1).
739 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
740 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
741 m4_divert_push(0) and m4_divert_pop(0).
742 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
743 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
744 pushed and popped by m4sugar, should be first on the stack.
745
746 Provide warn, complain, and fatal function callbacks to the skeletons.
747 This provides more flexibility than m4_fatal, improves the error
748 message format, and captures messages for translation. Discussed
749 starting at
750 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
751 * data/bison.m4 (b4_error): New, invoked by...
752 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
753 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
754 directives. Because these M4 macros might be called when the current
755 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
756 the previous removal of uses of m4_divert, which caused trouble.
757 (b4_check_percent_code_qualifiers): Use b4_complain instead of
758 m4_fatal to report unrecognized %code qualifiers.
759 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
760 push parser requests.
761 * data/glr.c: Use b4_complain instead of m4_fatal to report
762 non-deterministic push parser requests.
763 Update @output usage to @output(...@) form.
764 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
765 report missing %defines. Update @output usage to @output(...@) form.
766 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
767 @output(...@) form.
768 * src/main.c (main): Invoke skel_scanner_free.
769 * src/scan-skel.h (skel_scanner_free): Prototype new function.
770 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
771 obstack_for_string from flex-scanner.h.
772 (YY_DECL): Use to declare skel_lex static.
773 (decode_at_digraphs): Remove; now handled in the new
774 SC_AT_DIRECTIVE_ARG start condition.
775 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
776 functions.
777 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
778 at_directive_argv): New static globals.
779 (INITIAL): Use fail_for_invalid_at.
780 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
781 recognize the start of a generalized `@directive(...@)' form and
782 start...
783 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
784 directive args (using the new obstack_for_string), to decode the
785 contained @ diagraphs, and to perform the directive. It recognizes
786 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
787 @output(...@).
788 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
789 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
790 `@,'.
791 (scan_skel): Initialize obstack_for_string on the first call.
792 (skel_scanner_free): New function to free obstack_for_string.
793 * tests/input.at (Reject bad %code qualifiers): Update test output.
794
795 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
796
797 Consolidate the 4 prologue alternative directives (%code, %requires,
798 %provides, and %code-top) into a single %code directive with an
799 optional qualifier field. Discussed at
800 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
801 * NEWS (2.3a+): Rewrite the existing entry for the prologue
802 alternatives.
803 * doc/bison.texinfo (Prologue Alternatives): Update.
804 (Decl Summary): Update to %code "requires" and %code "provides".
805 (Calc++ Parser): Update to %code "requires".
806 (Table of Symbols): Remove entries for %requires, %provides, and
807 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
808 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
809 are replaced by b4_percent_code_provides and b4_percent_code_requires,
810 which are skeleton-specific.
811 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
812 declare what %code qualifiers it supports and to complain if any other
813 qualifiers were used in the grammar.
814 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
815 and b4_user_code([b4_percent_code_provides]) in place of
816 b4_user_requires and b4_user_provides.
817 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
818 Add b4_user_code([b4_percent_code_top]) and
819 b4_user_code([b4_percent_code]).
820 Invoke b4_check_percent_code_qualifiers.
821 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
822 PERCENT_REQUIRES): Remove.
823 (grammar_declaration): Remove RHS's for %code-top, %provides, and
824 %requires. Rewrite the %code RHS as the unqualified form defining the
825 muscle b4_percent_code. Add another RHS for the qualified %code form,
826 which defines muscles of the form b4_percent_code_QUALIFIER and the
827 b4_used_percent_code_qualifiers muscle.
828 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
829 PERCENT_REQUIRES): Remove.
830 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
831 %code "requires" and %code "provides".
832 * tests/input.at (Reject bad %code qualifiers): New.
833
834 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
835
836 Use the new code_props interface for destructors and printers.
837 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
838 printer_location members, and change the type of the destructor and
839 printer members to code_props.
840 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
841 symbol_printer_get, semantic_type_destructor_set,
842 semantic_type_printer_set, default_tagged_destructor_set,
843 default_tagless_destructor_set, default_tagged_printer_set,
844 default_tagless_printer_set): Use code_props in arguments and return
845 types in place of char const * and location.
846 (symbol_destructor_location_get, symbol_printer_location_get): Remove
847 since the locations are now contained in the return of
848 symbol_destructor_get and symbol_printer_get.
849 * src/output.c (symbol_destructors_output, symbol_printers_output):
850 Replace with...
851 (symbol_code_props_output): ... this to eliminate duplicate code.
852 (output_skeleton): Update to use symbol_code_props_output.
853 * src/reader.c (symbol_should_be_used): Update use of
854 symbol_destructor_get.
855 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
856 Update uses of the various _destructor_set and _printer_set functions.
857 * src/symtab.c: (default_tagged_destructor_location,
858 default_tagless_destructor_location, default_tagged_printer_location,
859 default_tagless_printer_location): Remove since we...
860 (default_tagged_destructor, default_tagless_destructor,
861 default_tagged_printer, default_tagless_printer): ... change the type
862 of these to code_props.
863 (symbol_new, semantic_type_new, symbol_destructor_set,
864 semantic_type_destructor_set, symbol_destructor_get,
865 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
866 symbol_check_alias_consistency, default_tagged_destructor_set,
867 default_tagless_destructor_set, default_tagged_printer_set,
868 default_tagless_printer_set): Update.
869 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
870 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
871 code_props members.
872 (symbol_print): Use SYMBOL_CODE_PRINT.
873
874 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
875
876 Use the new code_props interface for rule actions.
877 * src/symlist.h (symbol_list): Replace action, action_location, and
878 used members with a code_props action_props member.
879 * src/reader.c (symbol_should_be_used, grammar_rule_check,
880 grammar_midrule_action, grammar_current_rule_merge_set,
881 grammar_current_rule_symbol_append, packgram): Update.
882 * src/scan-code.h (translate_rule_action): Remove, no longer used.
883 * src/scan-code.l (handle_action_dollar): Update.
884 (translate_rule_action): Remove, no longer used.
885 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
886
887 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
888
889 Use the new code_props interface in parse-gram.y.
890 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
891 Update all uses of translate_* functions to use the new code_props
892 interface and to use gram_scanner_last_string_free and
893 code_scanner_last_string_free where possible.
894 (grammar_declaration): symbol_list_destructor_set and
895 symbol_list_printer_set now perform the translation, so don't do it
896 here. Use gram_scanner_last_string_free where possible.
897 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
898 translate_code): Remove, no longer used.
899 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
900 symbol_list_printer_set): Perform code translation here rather than
901 depending on the caller to do so.
902
903 * src/symlist.h (struct symbol_list): Correct some documentation typos.
904 * src/scan-gram.h (gram_last_string): Remove declaration.
905 * src/scan-gram.l (last_string): Declare it static.
906
907 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
908
909 Encapsulate code properties and related functionality for the various
910 destructors, printers, and actions into a code_props structure and
911 interface. This patch merely implements code_props in scan-code.h and
912 scan-code.l. Future patches will rewrite other modules to use it.
913 Discussed starting at
914 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
915 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
916 consistently initialize const structs that have an empty location
917 field.
918 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
919 to ensure consistency.
920 * src/scan-code.h (code_props): New structure.
921 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
922 function, macro, and const global variable for initializing a
923 code_props with no code.
924 (code_props_plain_init, code_props_symbol_action_init,
925 code_props_rule_action_init, code_props_translate_code): The rest of
926 the new code_props functional interface. Among other things, the init
927 functions set the code_props kind field so that
928 code_props_translate_code will know whether to behave like
929 translate_symbol_action, translate_rule_action, or translate_code.
930 These old translate functions must remain until all other modules are
931 updated to use the new code_props interface.
932 (code_scanner_last_string_free): New function similar to
933 gram_scanner_last_string_free.
934 (code_scanner_free): Add documentation.
935 * src/scan-code.l: Implement the new interface.
936 (code_lex): Make it static, add a code_props* argument, and remove the
937 rule argument.
938 (last_string): New static global similar to the one in scan-gram.l.
939 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
940 instead of rule.
941 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
942 code_props since Bison may one day use this information for destructors
943 and printers.
944 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
945 (handle_action_dollar): Use symbol_list_n_get and set used flag
946 directly since symbol_list_n_used_set is removed.
947 (translate_action): Add a code_props* argument and remove the rule,
948 action, and location arguments. Pass the code_props* on to code_lex.
949 (translate_rule_action, translate_symbol_action, translate_code):
950 Rewrite as wrappers around the new code_props interface.
951 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
952 it would eventually need to break the encapsulation of code_props.
953
954 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
955
956 * etc/.cvsignore: New.
957
958 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
959
960 Add maintainer-push-check to run maintainer-check using push parsing in
961 place of pull parsing where available.
962 * Makefile.am (maintainer-push-check): New.
963 * data/bison.m4 (b4_use_push_for_pull_if): New.
964 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
965 appropriately based on their existing values.
966 (yypush_parse): Don't print push-parser-specific diagnostics if push
967 parsing is being used in place of pull parsing.
968 * data/yacc.c: If push parsing should replace pull parsing, redirect to
969 push.c.
970 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
971 variable, and insert b4_use_push_for_pull_flag into muscles.
972 * tests/Makefile.am (maintainer-push-check): New.
973
974 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
975
976 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
977 (whether successful or failed) so that yypush_parse can be invoked
978 again to start a new parse using the same yypstate.
979 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
980 check multiple yypull_parse invocations on the same yypstate. For pull
981 mode, extend to check multiple yyparse invocations.
982 (Exploding the Stack Size with Alloca): Extend to try with
983 %push-pull-parser.
984 (Exploding the Stack Size with Malloc): Likewise.
985
986 * tests/calc.at (Simple LALR Calculator): Don't specify
987 %skeleton "push.c" since %push-pull-parser implies that now.
988 * tests/headers.at (export YYLTYPE): Don't check for the push
989 declarations. Otherwise, this test case can't be used to see if push
990 mode can truly emulate pull mode.
991 * tests/input.at (Torturing the Scanner): Likewise.
992 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
993 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
994 AT_YACC_IF, which now includes the case of push mode since %skeleton
995 need not be used for push mode. This will be more intuitive once
996 push.c is renamed to yacc.c.
997
998 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
999
1000 For push mode, convert yyparse from a macro to a function, invoke yylex
1001 instead of passing a yylexp argument to yypull_parse, and don't
1002 generate yypull_parse or yyparse unless %push-pull-parser is declared.
1003 Discussed starting at
1004 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
1005 * data/bison.m4 (b4_pull_if): New.
1006 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
1007 * data/push.c: Improve M4 quoting a little.
1008 (b4_generate_macro_args, b4_parenthesize): Remove.
1009 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
1010 any time a pull parser is requested.
1011 Don't #define this as a wrapper around yypull_parse. Instead, when
1012 both push and pull are requested, make it a function that does that
1013 same thing.
1014 (yypull_parse): If there's a b4_prefix, #define this to
1015 b4_prefix[pull_parse] when both push and pull are requested.
1016 Don't define this as a function unless both push and pull are
1017 requested.
1018 Remove the yylexp argument and hard-code yylex invocation instead.
1019 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
1020 %push-parser.
1021 * src/getargs.c (pull_parser): New global initialized to true.
1022 * getargs.h (pull_parser): extern it.
1023 * src/output.c (prepare): Insert pull_flag muscle.
1024 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
1025 (prologue_declaration): Set both push_parser and pull_parser = true for
1026 %push-pull-parser. Set push_parser = true and pull_parser = false for
1027 %push-parser.
1028 * src/scan-gram.l: Don't accept %push_parser as an alternative to
1029 %push-parser since there's no backward-compatibility concern here.
1030 Scan %push-pull-parser.
1031 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
1032 instead of %push-parser.
1033 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
1034 prototype it in the module that calls yyparse.
1035 * tests/input.at (Torturing the Scanner): Likewise.
1036 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
1037
1038 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
1039
1040 Update etc/bench.pl. Optimize push mode a little (the yyn change
1041 deserves most of the credit).
1042 * Makefile.am (SUBDIRS): Add etc subdirectory.
1043 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
1044 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
1045 yytoken, yyval, and yyloc declarations to...
1046 (yyparse or yypush_parse): ... here to improve performance. For
1047 yypush_parse invocations after the first, be sure to assign yyn its old
1048 value again.
1049 (yypstate_new): Don't bother initializing the yyresult field since the
1050 initial value isn't used.
1051 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
1052 remove the #define that, in push mode, set it to yyps->NAME.
1053 * etc/Makefile.am: New.
1054 * etc/bench.pl: Remove and build it instead from...
1055 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
1056 "tests/bison" from the build directory by default rather than just
1057 invoking "bison" from $PATH.
1058 (calc_grammar): Update push parser code: don't declare yylval globally,
1059 don't define yyparse_wrapper, and don't #define yyparse.
1060 (bench_grammar): Update to check all working combinations of yacc.c,
1061 push.c, impure, pure, pull, and push.
1062
1063 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1064
1065 For push mode, add pull wrappers around yypush_parse.
1066 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
1067 (yypull_parse): New function wrapping yypush_parse.
1068 (yyparse): New #define wrapping yypull_parse.
1069 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
1070 is declared.
1071 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
1072 prototype yylex in the module that calls yyparse, and don't prototype
1073 yyparse there. Otherwise, the yyparse expansion won't compile.
1074 * tests/input.at (Torturing the Scanner): Likewise.
1075
1076 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1077
1078 Enable push parsers to operate in impure mode. Thus, %push-parser no
1079 longer implies %pure-parser. The point of this change is to move
1080 towards being able to test the push parser code by running the entire
1081 test suite as if %push-parser had been declared.
1082 * data/push.c (yypush_parse): For impure mode, remove the
1083 yypushed_char, yypushed_val, and yypushed_loc arguments.
1084 Instead, declare these as local variables initialized to the global
1085 yychar, yylval, and yylloc.
1086 For the first yypush_parse invocation only, restore the initial values
1087 of these global variables when it's time to read a token since they
1088 have been overwritten.
1089 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
1090 %push-parser.
1091 * tests/calc.at (Simple LALR(1) Calculator): Always declare
1092 %pure-parser along with %push-parser since this test case was designed
1093 for pure push parsers.
1094 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
1095 (AT_YACC_OR_PUSH_IF): New.
1096 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
1097 add a note that it's still wrong for some cases (as it has been for a
1098 while).
1099 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
1100 %push-parser no longer implies %pure-parser.
1101
1102 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1103
1104 Remove some unnecessary differences between the pull parser code and
1105 the push parser code. This patch enables yynerrs in push mode.
1106 * data/push.c: Reformat M4 a little.
1107 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
1108 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
1109 because push mode is on. Instead, if pure mode is on, move yynerrs
1110 to...
1111 (b4_declare_parser_state_variables): ... here.
1112 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
1113 to yyps->NAME so it can be used in yypush_parse.
1114 (yypush_parse): Don't omit uses of yynerrs in push mode.
1115
1116 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1117
1118 Fix bug such that the first pushed token's value and location are
1119 sometimes overwritten (sometimes by %initial-action) before being used.
1120 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
1121 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
1122 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
1123 more closely mimic the pull parser logic.
1124 Don't copy the pushed token to yychar, yylval, and yylloc until it's
1125 time to read a token, which is after any initialization of yylval and
1126 yylloc.
1127 (gottoken): Rename label to...
1128 (yyread_pushed_token): ... for clarity and to avoid infringing on the
1129 user namespace.
1130
1131 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1132
1133 Rearrange initialization of the parser state variables so that the
1134 skeleton doesn't have to have a copy for pull mode and another for push
1135 mode. This patch also fixes at least a bug such that yylloc was not
1136 initialized (with b4_location_initial_line and
1137 b4_location_initial_column) upon calling yypush_parse. However, that
1138 initialization now overwrites the first token's location;
1139 %initial-action assigning @$ already did the same thing, and both bugs
1140 will be fixed in a later patch.
1141 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
1142 (b4_declare_parser_state_variables): Remove initialization of yytoken,
1143 yyss, yyvs, yyls, and yystacksize.
1144 (yypstate_new): Remove initialization of some yypstate fields: yystate,
1145 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
1146 yylsp.
1147 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
1148 yyps->NAME so it can be used in yypush_parse.
1149 (yyparse or yypush_parse): For yypush_parse, don't print the
1150 "Starting parse" diagnostic for invocations after the first.
1151 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
1152 yypush_parse, only do it for the first invocation.
1153 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
1154 initialization to occur in yypush_parse but only on the first
1155 invocation.
1156
1157 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1158
1159 * data/push.c: Add CPP guards around push parser declarations in both
1160 the header and the code file.
1161 In the code file, move the push parser declarations to the same place
1162 they appear in the header file.
1163 Clean up the M4 some, especially the inconsistent underquoting in
1164 some b4_c_function_def and b4_c_function_decl uses.
1165
1166 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1167
1168 Encapsulate the push parser state variables into an M4 macro so the
1169 push skeleton doesn't have to list them again for pull mode's yyparse.
1170 For push mode, remove yypush_parse's local equivalents of these
1171 variables to eliminate unnecessary copying between the two sets at
1172 run-time. This patch also fixes at least a bug related to multiple
1173 %initial-action invocations in push mode.
1174 * data/push.c (b4_declare_parser_variables): Rename to...
1175 (b4_declare_scanner_communication_variables): ... this for clarity and
1176 update both uses.
1177 (b4_declare_yyparse_variables): Remove and move its contents to the one
1178 spot where it was invoked.
1179 (b4_declare_parser_state_variables): New macro containing the parser
1180 state variables required by push mode.
1181 (struct yypstate): Replace all fields but yynew with
1182 b4_declare_parser_state_variables.
1183 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
1184 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
1185 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
1186 (yyparse or yypush_parse): For yyparse in pull mode, replace local
1187 parser state variable declarations with
1188 b4_declare_parser_state_variables.
1189 Don't initialize parser state variables when calling yypush_parse since
1190 yypstate_new already does that.
1191 Invoke the user's initial action only upon the first yypush_parse
1192 invocation.
1193 Remove all code that copies between the local parser state variables
1194 and the yypstate.
1195
1196 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1197
1198 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
1199 prevent a name collision in a future patch where these names will
1200 sometimes be #define'd.
1201 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
1202 since it no longer has the same name as the existing argument.
1203 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
1204
1205 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
1206 and Joel E. Denny <jdenny@ces.clemson.edu>
1207
1208 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1209 that the argument is case-insensitive, and there's no `=' here.
1210 For the %skeleton entry, mention that %language is better.
1211 (Bison Options): Likewise for --language and --skeleton. Move the
1212 --skeleton entry so that the `Tuning the parser' section is sorted
1213 alphabetically on long options.
1214 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
1215 %language directive in detail here; cross-reference the %language
1216 documentation instead.
1217 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
1218 `%require "2.3b"' so that the example is always up-to-date.
1219 (Table of Symbols): Add entries for %language and %skeleton.
1220 * examples/extexi (normalize): Instead of replacing every %require
1221 argument with the current Bison version, just substitute for
1222 `@value{VERSION}'. This guarantees that we're testing what actually
1223 appears in the documentation.
1224 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
1225 rather than `@VERSION@'.
1226
1227 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1228
1229 * NEWS: Reword the %language news a bit, and put it earlier.
1230
1231 * src/getargs.c (skeleton_arg): Last arg is now location const *.
1232 Rewrite to simplify the logic.
1233 (language_argmatch): Likewise.
1234 (program_name): We now own this var.
1235 * src/getargs.h (struct bison_language): Use char[] rather than
1236 const char *.
1237
1238 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
1239 Java is supported.
1240 * src/complain.c (program_name): Remove decl; no longer needed.
1241 * src/main.c (program_name): Remove; now belongs to getargs.
1242
1243 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
1244
1245 * NEWS: Document %language.
1246
1247 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
1248
1249 * data/c-skel.m4, data/c++-skel.m4: New files.
1250 * data/glr.c: Complain on push parsers.
1251
1252 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
1253 over %skeleton.
1254 (Decl Summary): Document %language and %skeleton.
1255 (Command line): Document -L.
1256
1257 * examples/extexi: Rewrite %require directive.
1258 * examples/calc++/Makefile.am: Pass VERSION to extexi.
1259
1260 * src/files.c (compute_exts_from_gc): Look in language structure
1261 for .y extension.
1262 (compute_file_name_parts): Check whether .tab should be added.
1263 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
1264 (language, skeleton_arg, language_argmatch): New.
1265 (long_options): Add --language.
1266 (getargs): Use skeleton_arg, add -L/--language.
1267 * src/getargs.h: Include location.h.
1268 (struct bison_language, language, skeleton_arg, language_argmatch): New.
1269 * src/output.c (prepare): Pick default skeleton from struct language.
1270 Don't dispatch C skeletons here.
1271 * src/parse-gram.y (PERCENT_LANGUAGE): New.
1272 (prologue_declaration): Add "%language" rule, use skeleton_arg.
1273 * src/scan-gram.l ("%language"): New rule.
1274
1275 * tests/calc.at: Test %skeleton and %language.
1276 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
1277 (AT_GLR_IF): Look for %skeleton "glr.cc".
1278 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
1279 (AT_YACC_IF): Reject %language.
1280
1281 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1282
1283 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
1284 since it wasn't used; only the typedef name 'semantic_type' is needed.
1285 Also, omit trailing white space.
1286
1287 * bootstrap: Sync from coreutils.
1288 (gnulib_extra_files): Add build-aux/announce.gen.
1289 (slurp): Adjust .gitignore files like .cvsignore files.
1290 * build-aux/announce-gen: Remove from CVS, since bootstrap
1291 now creates this.
1292
1293 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
1294
1295 Make %push-parser imply %pure-parser. This fixes several bugs; see
1296 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
1297 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
1298 pure_parser = true.
1299 * data/push.c: Don't bother testing b4_push_if when deciding whether
1300 to expand b4_declare_parser_variables globally.
1301 (yypush_parse): Likewise in here.
1302
1303 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
1304 (yy_reduce_print): Reformat M4 for readability.
1305
1306 2006-12-15 Bob Rossi <bob@brasko.net>
1307 and Joel Denny <jdenny@ces.clemson.edu>
1308
1309 * data/push.c (yypstate): Add typedef, and update all uses of
1310 struct yypstate to just yypstate.
1311 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
1312
1313 2006-12-14 Bob Rossi <bob@brasko.net>
1314
1315 * data/push.c (yypush_parse): Declare prototype regardless of
1316 %locations option.
1317
1318 2006-12-14 Bob Rossi <bob@brasko.net>
1319
1320 * data/push.c (yyparse): Remove the prototype and the #define when in
1321 push-parser mode.
1322
1323 2006-12-13 Bob Rossi <bob@brasko.net>
1324
1325 * data/push.c (yypstate_init): Rename to...
1326 (yypstate_new): ... this and use b4_c_function_def.
1327 (yypstate_delete): New.
1328 (yypush_parse): Change parameters yynval and yynlloc to be const.
1329 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
1330 yypstate_delete functions.
1331
1332 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
1333
1334 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
1335 strange test case titles. Reported by Bob Rossi.
1336
1337 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
1338
1339 * TODO: Add pointer to Sylvain Schmitz's work on static detection
1340 of potential ambiguities in GLR grammers.
1341
1342 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
1343
1344 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
1345 `bison ', use m4_index instead of m4_substr since chopping up a string
1346 containing M4-special characters causes problems here.
1347
1348 Fix a couple of bugs related to special characters in user-specified
1349 file names, and make it easier for skeletons to compute output file
1350 names with the same file name prefix as Bison-computed output file
1351 names.
1352 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
1353 b4_parser_file_name and b4_spec_defines_file instead of
1354 @output_parser_name@ and @output_header_name@, which are now redundant.
1355 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
1356 b4_parser_file_name, b4_spec_defines_file, and the new
1357 @basename(FILENAME@) instead of @output_parser_name@ and
1358 @output_header_name@, which inappropriately escaped the file names as
1359 C string literals.
1360 * src/files.c (all_but_ext): Remove static qualifier.
1361 (compute_output_file_names): Move `free (all_but_ext)' to...
1362 (output_file_names_free): ... here since all_but_ext is needed later.
1363 * src/files.h (all_but_ext): Extern.
1364 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
1365 exactly what MUSCLE_INSERT_STRING used to do.
1366 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
1367 characters are escaped properly.
1368 * src/output.c (prepare): Define muscle file_name_all_but_ext as
1369 all_but_ext.
1370 For pkgdatadir muscle, maintain previous functionality by using
1371 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
1372 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
1373 digraphs would never be expanded. Hopefully no one has M4-special
1374 characters in his Bison installation path.
1375 * src/scan-skel.l: Don't parse @output_header_name@ and
1376 @output_parser_name@ anymore since they're now redundant.
1377 In @output, use decode_at_digraphs.
1378 Parse a new @basename command that invokes last_component.
1379 (decode_at_digraphs): New.
1380 (BASE_QPUTS): Remove unused.
1381 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
1382 (Output file name): New tests.
1383
1384 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
1385
1386 Warn about output files that are generated by the skeletons and that
1387 conflict with other output files.
1388 * data/glr.c: Don't generate the header file here when glr.cc does.
1389 * src/files.c (file_names, file_names_count): New static globals.
1390 (compute_output_file_names): Invoke output_file_name_check for files
1391 not generated by the skeletons and remove existing checks.
1392 (output_file_name_check): New function that warns about conflicting
1393 output file names.
1394 (output_file_names_free): Free file_names.
1395 * src/files.h (output_file_name_check): Declare.
1396 * src/scan-skel.l: Invoke output_file_name_check for files generated by
1397 the skeletons.
1398 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
1399 (Conflicting output files): New tests.
1400
1401 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1402
1403 * doc/bison.texinfo: Fix a couple of typos.
1404
1405 2006-12-08 Bob Rossi <bob@brasko.net>
1406
1407 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
1408 Rename to...
1409 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
1410 update all uses.
1411 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
1412 (yypush_parse): Rename yypvars argument to yyps and remove redundant
1413 local pv.
1414 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
1415 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
1416
1417 2006-12-07 Bob Rossi <bob@brasko.net>
1418 and Joel Denny <jdenny@ces.clemson.edu>
1419
1420 * data/push.c (yypvarsinit): Change return type from void* to struct
1421 yypvars*. No longer cast to void* on return.
1422 (struct yypvars): Remove yylen since it need not be remembered between
1423 yypushparse invocations.
1424 (yypushparse): Don't copy between yylen and pv->yylen.
1425
1426 2006-12-05 Bob Rossi <bob@brasko.net>
1427
1428 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
1429 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
1430 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
1431 (struct yypvars): Remove b4_declare_parser_variables.
1432 (yypvarsinit): Remove init code for removed variables.
1433 (global scope): Do not declare b4_declare_parser_variables if
1434 push or pure mode.
1435 (yypushparse): Add b4_declare_parser_variables.
1436 Init new local variables, and remove init code for removed
1437 yypvars variables.
1438 (yyparse): Delete.
1439 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
1440 and yyparse for other modes.
1441 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
1442 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
1443 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
1444 (AT_PURE_LEX_IF): True if pure or push parser.
1445
1446 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
1447
1448 Document Yacc prologue alternatives and default %destructor's and
1449 %printer's as experimental. Don't mention Java yet. Discussed at
1450 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
1451 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
1452 (2.3a): Annotate this entry to say the old forms of these features were
1453 also experimental.
1454 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
1455 Table of Symbols): Say they're experimental. Comment out any mention
1456 of Java (we'll want this back eventually).
1457
1458 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1459
1460 Support a file name argument to %defines. Deprecate `=' in
1461 %file-prefix, %name-prefix, and %output. Discussed at
1462 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
1463 * NEWS (2.3a+): Mention.
1464 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
1465 form of %defines, and remove `=' from entries for %file-prefix,
1466 %name-prefix, and %output.
1467 * src/parse-gram.y (prologue_declaration): Implement.
1468 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
1469 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
1470 all but one occurrence of %name-prefix.
1471 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
1472 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
1473 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
1474 occurrence of each of %file-prefix and %output. Add check for %defines
1475 with argument.
1476 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
1477 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
1478 Remove the `=' from %output.
1479
1480 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
1481
1482 Don't escape $ in test case titles since Autoconf 2.61 now does that
1483 correctly.
1484 * tests/actions.at (Default %printer and %destructor are not for error
1485 or $undefined): Here.
1486 (Default %printer and %destructor are not for $accept): Here.
1487 * tests/input.at (Invalid $n and @n): Here.
1488
1489 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
1490
1491 Rename <!> to <>. Discussed starting at
1492 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
1493 * NEWS (2.3a+): Update.
1494 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
1495 Update.
1496 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
1497 * src/scan-gram.l (INITIAL): Implement.
1498 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
1499 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
1500 comment.
1501 * tests/actions.at (Default tagless %printer and %destructor,
1502 Default tagged and per-type %printer and %destructor,
1503 Default %printer and %destructor are not for error or $undefined,
1504 Default %printer and %destructor are not for $accept,
1505 Default %printer and %destructor for mid-rule values): Update.
1506 * tests/input.at (Default %printer and %destructor redeclared,
1507 Unused values with default %destructor): Update.
1508
1509 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1510
1511 Don't let %prec take a nonterminal.
1512 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
1513 token.
1514 * tests/input.at (%prec takes a token): New test checking that %prec
1515 won't take a nonterminal.
1516
1517 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1518
1519 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
1520 it was double-quoted.
1521 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
1522 grammar is maintained with Bison's highest standards.
1523 * src/getargs.c: Fix some typos in Doxygen comments.
1524
1525 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1526
1527 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
1528 later. Reported by Paul Eggert in
1529 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
1530 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
1531 * src/scan-code.l (translate_action): Don't bother invoking
1532 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
1533 (code_scanner_free): Instead of invoking
1534 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
1535 which frees more.
1536 * src/scan-gram.l (gram_scanner_free): Likewise.
1537 * src/scan-skel.l (scan_skel): Likewise.
1538
1539 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
1540
1541 * src/files.c (tr): Change return type to void.
1542 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
1543 has been called previously for the same key.
1544 (muscle_find): Return storage instead of value so that
1545 --enable-gcc-warnings doesn't produce warnings that the return discards
1546 const. aver that the value and storage are the same since storage
1547 could potentially be NULL when value is not.
1548 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
1549 same as 0.
1550
1551 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1552
1553 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
1554 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
1555 us a slightly cleaner distribution, and also works.
1556 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
1557 gnulib changes.
1558
1559 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
1560 and Paul Eggert <eggert@cs.ucla.edu>
1561
1562 Don't let Bison leak memory except when it complains.
1563 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
1564 (spec_defines_file, dir_prefix): Now char *, not const char *,
1565 since they are freed.
1566 * src/files.c: Likewise.
1567 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
1568 Likewise.
1569 (tr): Now operates in-place. All uses changed.
1570 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
1571 values.
1572 (compute_file_name_parts, compute_output_file_names): Don't store
1573 read-only data in variables that will be freed.
1574 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
1575 src_extension, and header_extension.
1576 (output_file_names_free): New public function to free
1577 spec_verbose_file, spec_graph_file, spec_defines_file,
1578 parser_file_name, and dir_prefix.
1579 * src/getargs.c (getargs): Don't store read-only data in variables that
1580 will be freed.
1581 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
1582 (which previously existed but was unused), and quotearg_free.
1583 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
1584 * src/muscle_tab.c: Likewise.
1585 (muscle_entry): Make the value char const *,
1586 and add a new storage member that is char * and can be freed.
1587 (muscle_entry_free): New private function.
1588 (muscle_init): Use it instead of free.
1589 (muscle_insert, muscle_grow): Update and use new storage member.
1590 (muscle_code_grow): Free the string passed to muscle_grow
1591 since it's not needed anymore.
1592 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
1593 add a new `char *code' member.
1594 ("{...}"): Declare semantic type as code.
1595 * src/scan-code.h (translate_rule_action):
1596 (translate_symbol_action, translate_code, translate_action): Return
1597 `char const *' rather than `char *' since external code should not free
1598 these strings.
1599 * src/scan-code.l: Likewise.
1600 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
1601 which is "{...}" in the parser.
1602 * tests/Makefile.am (maintainer-check-valgrind): Set
1603 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
1604 Valgrind.
1605 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
1606 complain.
1607 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
1608 expecting a non-zero exit status sets --leak-check=summary and
1609 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
1610 this case, and we don't want to hear about it.
1611
1612 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1613
1614 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
1615 instead of from the template, to simplify configuration a bit.
1616 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
1617 and m4/wint_t.m4, as they are needed with the latest gnulib.
1618
1619 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1620
1621 Disable unset/unused mid-rule value warnings by default, and recognize
1622 --warnings=midrule-values to enable them. Discussed starting at
1623 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
1624 * NEWS (2.3a+): Mention.
1625 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
1626 warnings): Add entry for midrule-values subargument.
1627 * src/reader.c (symbol_should_be_used): Don't return true just because
1628 the value is a set/used mid-rule value unless
1629 --warnings=midrule-values was specified.
1630 * tests/input.at (Unused values, Unused values before symbol
1631 declarations): Run tests with and without --warnings=midrule-values.
1632
1633 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
1634 than LIST_FREE directly.
1635
1636 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1637
1638 Finish implementing --warnings=error, which should not be implied by
1639 --warnings=all (or by its synonyms -W and --warnings without
1640 subarguments).
1641 * src/complain.c (set_warning_issued): New function to report that
1642 warnings are being treated as errors and to record an error if so.
1643 Invoke...
1644 (warn_at, warn): ... here.
1645 * src/getargs.c (warnings_args, warnings_types): Reorder so that
1646 "error - warnings are errors" does not appear above "all - all of the
1647 above".
1648 (getargs): For -W and --warnings without subarguments, don't let
1649 FLAGS_ARGMATCH set warnings_error in warnings_flag.
1650 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
1651
1652 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1653
1654 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
1655 empty subargument list. For example: `bison --warnings= parser.y'.
1656
1657 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1658
1659 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
1660 the parser header file so that gcc doesn't warn.
1661
1662 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1663
1664 Split the default %destructor/%printer into two kinds: <*> and <!>.
1665 Discussed starting at
1666 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
1667 * NEWS (2.3a+): Mention.
1668 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
1669 previous change today related to mid-rules.
1670 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
1671 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
1672 (TYPE_TAG_ANY): Add as <*>.
1673 (TYPE_TAG_NONE): Add as <!>.
1674 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
1675 for <*> and <!>.
1676 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
1677 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
1678 * src/symlist.c (symbol_list_default_new): Split into tagged and
1679 tagless versions.
1680 (symbol_list_destructor_set, symbol_list_printer_set): Split
1681 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
1682 SYMLIST_DEFAULT_TAGLESS.
1683 * src/symlist.h: Update symbol_list_default*_new prototypes.
1684 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
1685 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
1686 * src/symtab.c (default_destructor, default_destructor_location,
1687 default_printer, default_printer_location): Split each into tagged and
1688 tagless versions.
1689 (symbol_destructor_get, symbol_destructor_location_get,
1690 symbol_printer_get, symbol_printer_location_get): Implement tagged
1691 default and tagless default cases.
1692 (default_destructor_set, default_printer_set): Split each into tagged
1693 and tagless versions.
1694 * src/symtab.h: Update prototypes.
1695 * tests/actions.at (Default %printer and %destructor): Rename to...
1696 (Default tagless %printer and %destructor): ... this, and extend.
1697 (Per-type %printer and %destructor): Rename to...
1698 (Default tagged and per-type %printer and %destructor): ... this, and
1699 extend.
1700 (Default %printer and %destructor for user-defined end token): Extend.
1701 (Default %printer and %destructor are not for error or $undefined):
1702 Update.
1703 (Default %printer and %destructor are not for $accept): Update.
1704 (Default %printer and %destructor for mid-rule values): Extend.
1705 * tests/input.at (Default %printer and %destructor redeclared): Extend.
1706 (Unused values with default %destructor): Extend.
1707
1708 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1709
1710 Don't apply the default %destructor/%printer to an unreferenced midrule
1711 value. Mentioned at
1712 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
1713 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
1714 like $@n instead of just @n so that the default %destructor/%printer
1715 logic doesn't see them as user-defined symbols.
1716 (symbol_is_dummy): Check for both forms of the name.
1717 * src/reader.c (packgram): Remove the `$' from each midrule symbol
1718 name for which the midrule value is referenced in any action.
1719 * tests/actions.at (Default %printer and %destructor for mid-rule
1720 values): New test.
1721 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
1722 for change to dummy symbol names.
1723
1724 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1725
1726 Warn about unset midrule $$ if the corresponding $n is used.
1727 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
1728 $n usage.
1729 (packgram): Before invoking grammar_rule_check on any rule, make sure
1730 all actions have already been scanned in order to set `used' flags.
1731 Otherwise, checking that a midrule's $$ is set will not always work
1732 properly because the midrule check must forward-reference the midrule's
1733 parent rule.
1734 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
1735 warning.
1736
1737 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1738
1739 More improvements to the documentation of the prologue alternatives:
1740 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
1741 Bison manual.
1742 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
1743 some text to clarify the relative importance of the new directives and
1744 to show how these directives may be viewed as code labels.
1745
1746 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
1747
1748 Similar to the recently removed %before-header, add %code-top as the
1749 alternative to the pre-prologue. Mentioned at
1750 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
1751 Also, let the prologue alternatives appear in the grammar section.
1752 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
1753 (prologue_declaration): Move the existing prologue alternatives to...
1754 (grammar_declaration): ... here and add %code-top.
1755 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
1756
1757 Clean up and extend documentation for the prologue alternatives.
1758 * NEWS (2.3a+): Describe prologue alternatives.
1759 * doc/bison.texinfo (Prologue): Move discussion of prologue
1760 alternatives to...
1761 (Prologue Alternatives): ... this new section, and extend it to discuss
1762 all 4 directives in detail.
1763 (Table of Symbols): Clean up discussion of prologue alternatives and
1764 add %code-top.
1765
1766 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1767
1768 DJGPP specific issues.
1769
1770 * djgpp/config.bat: config.hin has been moved to lib. Adjust
1771 config.bat accordingly.
1772 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
1773 * djgpp/config.site: Likewise.
1774
1775 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
1776
1777 Replace %*-header with %provides, %requires, %code. See discussion at
1778 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
1779
1780 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
1781 (b4_user_start_header): Remove.
1782 * data/glr.c: Use new macros instead of b4_*start_header
1783 and b4_*end_header.
1784 * data/glr.cc: Likewise.
1785 * data/lalr1.cc: Likewise.
1786 * data/push.c: Likewise.
1787 * data/yacc.c: Likewise.
1788
1789 * doc/bison.texinfo: Remove %before-header, rename
1790 %{start,end,after}-header to %requires, %provides, %code.
1791
1792 * src/parse-gram.y: Likewise (also rename token names accordingly).
1793 * src/scan-gram.l: Likewise.
1794 * tests/actions.at: Likewise.
1795
1796 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
1797
1798 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
1799 Problem reported by Joel E. Denny.
1800
1801 2006-10-14 Jim Meyering <jim@meyering.net>
1802
1803 (Sync from coreutils.)
1804 Work also when the working directory (with e.g. coreutils sources)
1805 is version controlled with git, rather than CVS.
1806 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
1807 rather than CVS.
1808 In messages and comments, say e.g., "checked-out sources",
1809 rather than "CVS sources".
1810 (version_controlled_file): New function. Work for git as well as
1811 for CVS. Don't use grep's -q option.
1812 (slurp): Call it here, in place of CVS-specific code.
1813
1814 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
1815
1816 Fix testsuite for ./configure --enable-gcc-warnings:
1817 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
1818 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
1819 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
1820 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
1821 * test/regression.at (Diagnostic that expects two alternatives):
1822 Likewise.
1823
1824 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1825
1826 * bootstrap.conf (gnulib_modules): Add config-h.
1827 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
1828 worry about HAVE_CONFIG_H.
1829 * lib/abitset.c: Likewise.
1830 * lib/bitset.c: Likewise.
1831 * lib/bitset_stats.c: Likewise.
1832 * lib/bitsetv-print.c: Likewise.
1833 * lib/bitsetv.c: Likewise.
1834 * lib/ebitset.c: Likewise.
1835 * lib/get-errno.c: Likewise.
1836 * lib/lbitset.c: Likewise.
1837 * lib/subpipe.c: Likewise.
1838 * lib/timevar.c: Likewise.
1839 * lib/vbitset.c: Likewise.
1840 * lib/bitset.c: Include "bitset.h" first, to test interface.
1841 * lib/bitset_stats.c: Include "bitset_stats.h" first.
1842 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
1843 * lib/bitsetv.c: Include "bitsetv.h" first.
1844 * lib/get-errno.c: Include "get-errno.h" first.
1845 * m4/.cvsignore: Add config-h.m4.
1846 * tests/actions.at (Default %printer and %destructor for ...):
1847 Adjust expected line numbers in output to reflect removal of #if
1848 HAVE_CONFIG_H lines.
1849 * tests/glr-regression.at (Missed %merge type warnings when ...):
1850 Likewise.
1851 * tests/regression.at (Braced code in declaration in rules section):
1852 Likewise.
1853 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
1854 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
1855 Include <config.h> unconditionally.
1856
1857 * bootstrap: Sync from coreutils, as follows:
1858
1859 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1860
1861 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
1862 variable was sometimes used without being initialized. This
1863 messed up the installation of the INSTALL file in some cases.
1864
1865 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1866
1867 * bootstrap (usage, main program, symlink_to_gnulib): Add option
1868 --copy. Inspired by a suggestion from Bruno Haible.
1869
1870 2006-10-03 Jim Meyering <jim@meyering.net>
1871
1872 * bootstrap: Undo last change to this file, since now gnulib-tool
1873 sticks with the automake default in generating dependencies.
1874
1875 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1876
1877 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
1878 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
1879
1880 * doc/bison.1: Add copyright notice.
1881
1882 * data/glr.c: Don't include <stdarg.h>; not used.
1883
1884 * NEWS: The -g and --graph options now output graphs in Graphviz
1885 DOT format, not VCG format.
1886 * doc/bison.1: Likewise.
1887 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
1888 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
1889 of this change in
1890 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
1891 * TODO: Remove Graphviz entry.
1892 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
1893 remove vcg.c, vcg.h, vcg_defaults.h.
1894 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
1895 * src/graphviz.c, src/graphviz.h: New files.
1896 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
1897 * src/files.h: Make comment more generic.
1898 * src/main.c (main): Likewise.
1899 * src/print_graph.h: Likewise.
1900 * src/getargs.c (usage): Make usage description more generic.
1901 * src/print_graph.c: Include graphviz.h rather than vcg.h.
1902 (static_graph, fgraph): Remove. All uses changed to pass
1903 arguments instead of sharing a static var.
1904 (print_core, print_actions, print_state, print_graph):
1905 Output graphviz format rather than VCG format.
1906 * tests/.cvsignore: Remove *.vcg; add *.dot.
1907 * tests/output.at: Expect *.dot files, not *.vcg files.
1908
1909 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
1910 accommodates the 2006-10-08 change.
1911
1912 2006-10-11 Bob Rossi <bob@brasko.net>
1913
1914 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
1915 (b4_yyssa, b4_yyerror_range): New macros.
1916 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
1917 (yypvarsinit): Remove init of removed fields.
1918 (yypushparse): Remove use of removed fields; use new macros instead.
1919
1920 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1921
1922 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
1923 in a push parser. Reindent slightly to match yacc.c better.
1924
1925 2006-10-11 Bob Rossi <bob@brasko.net>
1926
1927 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
1928 yymsg_alloc fields.
1929 (yypvarsinit, yypushparse): Remove init of removed fields.
1930 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
1931
1932 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1933
1934 * THANKS: Add Paolo Bonzini and Bob Rossi.
1935
1936 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
1937
1938 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
1939 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
1940 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
1941 b4_define_user_cde and uses): Remove.
1942 (b4_comment, b4_prefix, b4_sync_start): New.
1943 * data/bison.m4: New file, with most of the content removed from c.m4.
1944 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
1945 * src/output.c (output_skeleton): Pass bison.m4.
1946 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
1947 only if specified.
1948
1949 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
1950
1951 Fix test failure reported by Tom Lane in
1952 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
1953 and try to make such failures easier to catch in the future.
1954 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
1955 that's now the caller's responsibility.
1956 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
1957 Set yychar = YYEOF if it's negative.
1958 * tests/actions.at (yylex): Abort if asked to read past EOF.
1959 * tests/conflicts.at (yylex): Likewise.
1960 * tests/cxx-type.at (yylex): Likewise.
1961 * tests/glr-regression.at (yylex): Likewise.
1962 * tests/input.at (yylex): Likewise.
1963 * tests/regression.at (yylex): Likewise.
1964 * tests/torture.at (yylex): Likewise.
1965
1966 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
1967
1968 Fix problems with translating English-language diagnostics.
1969 * bootstrap: Fix bug introduced in recent bootstrap changes, with
1970 respect to bison-runtime pot generation. The YY_ stuff
1971 wasn't being captured.
1972 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
1973 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
1974 * runtime-po/POTFILES.in: Add data/push.c.
1975
1976 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
1977
1978 Merge bootstrap changes from coreutils.
1979
1980 2006-09-28 Jim Meyering <jim@meyering.net>
1981
1982 Automatically generated dependencies are important even
1983 when all of the sources in a directory come from gnulib.
1984 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
1985 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
1986
1987 2006-09-23 Jim Meyering <jim@meyering.net>
1988
1989 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
1990
1991 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1992
1993 * bootstrap: Add support for --force.
1994 (usage): New function. Describe usage less tersely.
1995 (CVS_only_file): New var.
1996
1997 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
1998
1999 * data/push.c (YYPUSH_MORE): Make it an enum instead.
2000 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
2001 Adjust white space and comments to match GNU style better.
2002
2003 2006-09-20 Bob Rossi <bob@brasko.net>
2004
2005 * data/push.c (yyresult_get): Remove function.
2006 (YYPUSH_MORE): Add #define.
2007 (yypushparse): Modify return value.
2008
2009 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2010
2011 * stamp-h.in: Remove; no longer needed.
2012 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
2013 Remove config.h, config.hin, intl (no longer created).
2014 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
2015 stamp-h1.
2016
2017 Sync bootstrap from coreutils, as follows:
2018
2019 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
2020
2021 * bootstrap (symlink_to_gnulib): New function.
2022 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
2023 to copies-of-gnulib.
2024 (cp_mark_as_generated, slurp, gnulib_files):
2025 Avoid making a copy if it's the same as the old version.
2026 (gnulib_files): Add support for this variable (used by Bison).
2027
2028 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2029
2030 * src/getargs.c (usage): Rework to use conventions similar to
2031 coreutils, to make translation a bit easier and the code a bit
2032 smaller. Problem reported by Tim Van Holder.
2033
2034 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
2035
2036 Use some of gnulib's new modules, taken from coreutils.
2037
2038 * bootstrap: Sync from coreutils, except add support for gnulib_files.
2039 * bootstrap.conf: New file.
2040 (gnulib_modules): Add configmake, inttypes, unistd.
2041 (XGETTEXT_OPTIONS): Add complain, complain_at,
2042 fatal, fatal_at, warn, warn_at, unexpected_end.
2043 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
2044 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
2045 (gl_EARLY): Add.
2046 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
2047 (gl_INIT): Add
2048 (GNULIB_AUTOCONF_SNIPPET): Remove.
2049 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
2050 the pickiest.
2051 * lib/.cvsignore: Add inttypes_.h.
2052 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
2053 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
2054 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
2055 no-longer-necessary initializations.
2056 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
2057 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
2058 use the unistd module.
2059 * src/system.h: Likewise.
2060 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
2061 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
2062 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
2063 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
2064 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
2065 * src/system.h: Include inttypes.h unconditionally, now that we
2066 use the inttypes module. Don't bother to include stdint.h, since
2067 inttypes.h now does that for us.
2068 (LOCALEDIR): Remove, now that we use the configmake module.
2069 * src/getargs.c: Include configmake.h.
2070 * src/main.c: Likewise.
2071 * src/output.c: Likewise.
2072 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
2073 not from $abs_top_builddir, since config.h moved.
2074
2075
2076 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
2077 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
2078
2079 * src/parse-gram.y (symbol_declaration): Don't put statements
2080 before declarations; it's not portable to C89.
2081 * src/scan-code.l (handle_action_at): Likewise.
2082
2083 * src/scan-code.l: Always initialize braces_level; the old code
2084 left it uninitialized and therefore had undefined behavior.
2085
2086 Don't attempt to redefine 'assert', since it runs afoul of
2087 systems where standard headers (mistakenly) include <assert.h>.
2088 Instead, define and use our own alternative, called 'aver'.
2089 * src/reader.c: Don't include assert.h, since we no longer
2090 use assert.
2091 * src/scan-code.l: Likewise.
2092 * src/system.h (assert): Remove, replacing with....
2093 (aver): New function, taking a bool arg. All uses changed.
2094 * src/tables.c (pack_vector): Ensure that aver arg is bool,
2095 not merely an integer.
2096
2097 2006-09-15 Bob Rossi <bob@brasko.net>
2098
2099 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
2100 * data/c.m4 (YYPUSH): New.
2101 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
2102 * src/getargs.c (push_parser): New var.
2103 * src/getargs.h (push_parser): New declaration.
2104 * src/output.c (prepare): Add macro insertion of `push_flag'.
2105 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
2106 (prologue_declaration): Parse %push-parser.
2107 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
2108 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
2109 list of removed lines from the traces observed.
2110 (AT_CHECK_CALC_LALR): Added push parser tests.
2111
2112 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
2113
2114 * NEWS: Version 2.3a.
2115 * configure.ac (AC_INIT): Likewise.
2116
2117 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
2118 "#define YYSTYPE int" that caused "make maintainer-check" to fail
2119 due to header ordering dependencies. I don't know why the #define
2120 was there.
2121
2122 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
2123 runtime cost when YYDEBUG is not defined, and so that some tests
2124 that used to fail now work. Problem and initial suggestion by
2125 Paolo Bonzini.
2126 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
2127 * data/glr.cc (b4_parser_class_name):
2128 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
2129 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
2130 (yydebug_) [YYDEBUG]: New member.
2131 (yycdebug_): Now defined only if YYDEBUG.
2132 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
2133 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
2134 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
2135 if YYYDEBUG.
2136 (debug_stream, set_debug_stream, debug_level, set_debug_level):
2137 Define only if YYDEBUG.
2138 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
2139 set_debug_level.
2140 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
2141 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
2142 AT_CHECK_CALC_GLR_CC that are working now.
2143
2144 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
2145
2146 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
2147 We don't need them in glr.cc, and glr.c defines them.
2148 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
2149 assumes that defining it to anything is the same as defining
2150 it to 1. Problem reported by Paolo Bonzini.
2151
2152 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2153
2154 * data/c.m4 (b4_null, b4_case): Define.
2155 * src/output.c (prepare_symbols): Use b4_null.
2156 (user_actions_output): Use b4_case.
2157
2158 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
2159
2160 * data/glr.c (b4_shared_declarations): Put start-header first,
2161 before any #includes that we generate, so that feature-test
2162 macros work. Problem reported by Michael Deutschmann in
2163 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
2164 * data/lalr1.cc: Likewise.
2165 * doc/bison.texinfo (Prologue): Document that feature-test macros
2166 should be defined before any Bison declarations.
2167 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
2168 that depend on location.hh after, not before, Bison decls, since
2169 we now include location.hh after the first user prologue.
2170
2171 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
2172 Sander Brandenburg in
2173 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
2174 Also, fix minor white space and comment issues.
2175 (Prologue): Mention that it's better to define feature-test macros
2176 before Bison declarations. Problem reported by Michael Deutschmann.
2177
2178 * README-cvs: Fix typo: "&" should be "&&". Problem reported
2179 by Jim Meyering.
2180 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
2181 This adjusts to recent gnulib changes.
2182
2183 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2184
2185 Finish implementation of per-type %destructor/%printer. Discussed
2186 starting at
2187 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
2188 and
2189 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
2190 * NEWS (2.3+): Add a description of this feature to the default
2191 %destructor/%printer description.
2192 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
2193 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2194 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
2195 list node contains a semantic type.
2196 * src/symtab.c, src/symtab.h: Extend with a table that associates
2197 semantic types with their %destructor's and %printer's.
2198 (semantic_type_from_uniqstr, semantic_type_get,
2199 semantic_type_destructor_set, semantic_type_printer_set): New functions
2200 composing the public interface of that table.
2201 (symbol_destructor_get, symbol_destructor_location_get,
2202 symbol_printer_get, symbol_printer_location_get): If there's no
2203 per-symbol %destructor/%printer, look up the per-type before trying
2204 the default.
2205 * tests/actions.at (Per-type %printer and %destructor): New test case.
2206 * tests/input.at (Default %printer and %destructor redeclared):
2207 Extend to check that multiple occurrences of %symbol-default in a
2208 single %destructor/%printer declaration is an error.
2209 (Per-type %printer and %destructor redeclared, Unused values with
2210 per-type %destructor): New test cases.
2211
2212 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2213
2214 Require default %destructor/%printer to be declared using
2215 %symbol-default instead of an empty symbol list, and start working on
2216 new per-type %destructor/%printer. Discussed at
2217 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
2218 * NEWS (2.3+): Add %symbol-default to example.
2219 * bison.texinfo (Freeing Discarded Symbols): Likewise.
2220 (Table of Symbols): Add entry for %symbol-default.
2221 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
2222 (generic_symlist, generic_symlist_item): New nonterminals for creating
2223 a list in which each item is a symbol, semantic type, or
2224 %symbol-default.
2225 (grammar_declaration): Use generic_symlist in %destructor and %printer
2226 declarations instead of symbols.1 or an empty list.
2227 (symbol_declaration, precedence_declaration, symbols.1): Update actions
2228 for changes to symbol_list.
2229 * src/reader.c: Update for changes to symbol_list.
2230 * src/scan-code.l: Likewise.
2231 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
2232 * src/symlist.c, src/symlist.h: Extend such that a list node may
2233 represent a semantic type or a %symbol-default in addition to just an
2234 ordinary symbol. Add switched functions for setting %destructor's and
2235 %printer's.
2236 * tests/actions.at, tests/input.at: Add %symbol-default to all default
2237 %destructor/%printer declarations.
2238
2239 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
2240
2241 Whether the default %destructor/%printer applies to a particular symbol
2242 isn't a question of whether the user *declares* that symbol (in %token,
2243 for example). It's a question of whether the user by any means
2244 *defines* the symbol at all (by simply using a char token, for
2245 example). $end is defined by Bison whereas any other token with token
2246 number 0 is defined by the user. The error token is always defined by
2247 Bison regardless of whether the user declares it with %token, but we
2248 may one day let the user define error as a nonterminal instead.
2249 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
2250 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
2251 the meaning of "user-defined".
2252 * tests/actions.at (Default %printer and %destructor for user-declared
2253 end token): Rename to...
2254 (Default %printer and %destructor for user-defined end token): ...
2255 this.
2256
2257 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
2258 computation of whether to apply the default, don't maintain a list of
2259 every Bison-defined symbol. Instead, just check for a first character
2260 of '$', which a user symbol cannot have, and check for the error token.
2261
2262 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
2263
2264 Don't apply the default %destructor or %printer to the error token,
2265 $undefined, or $accept. This change fits the general rule that the
2266 default %destructor and %printer are only for user-declared symbols,
2267 and it solves several difficulties that are described in the new test
2268 cases listed below.
2269 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
2270 * tests/actions.at (Default %printer and %destructor are not for error
2271 or $undefined, Default %printer and %destructor are not for $accept):
2272 New test cases.
2273
2274 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
2275
2276 Allow %start after the first rule.
2277 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
2278 when parsing the first rule.
2279 (check_and_convert_grammar): Search for it here after all grammar
2280 declarations have been parsed. Skip midrules, which have dummy LHS
2281 nonterminals.
2282 * src/symtab.c (symbol_is_dummy): New function.
2283 * src/symtab.h (symbol_is_dummy): Declare it.
2284 * tests/input.at (%start after first rule): New test.
2285
2286 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2287
2288 Redo some of the previous commit: add back the ability to use
2289 non-aliased/undeclared string literals since it might be useful to
2290 those declaring %token-table.
2291 * src/reader.c (check_and_convert_grammar): Undo changes in previous
2292 commit: don't worry about complaints from symbols_pack.
2293 * src/symtab.c (symbol_new, symbol_class_set,
2294 symbol_check_alias_consistency): Undo changes in previous commit: count
2295 each string literal as a new symbol and token, assign it a symbol
2296 number, and don't complain about non-aliased string literals.
2297 (symbols_pack): Since symbol_make_alias still does not decrement symbol
2298 and token counts but does still set aliased tokens to the same number,
2299 symbol_pack_processor now leaves empty slots in the symbols array.
2300 Remove those slots.
2301 * tests/regression.at (Undeclared string literal): Remove test case
2302 added in previous commit since non-aliased string literals are allowed
2303 again.
2304 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
2305 remove unnecessary string literal declarations.
2306 * tests/sets.at (Firsts): Likewise.
2307
2308 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2309
2310 Don't allow an undeclared string literal, but allow a string literal to
2311 be used before its declaration.
2312 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
2313 symbols_pack complained.
2314 * src/symtab.c (symbol_new): Don't count a string literal as a new
2315 symbol.
2316 (symbol_class_set): Don't count a string literal as a new token, and
2317 don't assign it a symbol number since symbol_make_alias does that.
2318 (symbol_make_alias): It's not necessary to decrement the symbol and
2319 token counts anymore. Don't assume that an alias declaration occurs
2320 before any uses of the identifier or string, and thus don't assert that
2321 one of them has the highest symbol number so far.
2322 (symbol_check_alias_consistency): Complain if there's a string literal
2323 that wasn't declared as an alias.
2324 (symbols_pack): Bail if symbol_check_alias_consistency failed since
2325 symbol_pack asserts that every token has been assigned a symbol number
2326 although undeclared string literals have not.
2327 * tests/regression.at (String alias declared after use, Undeclared
2328 string literal): New test cases.
2329 (Characters Escapes, Web2c Actions): Declare string literals as
2330 aliases.
2331 * tests/sets.at (Firsts): Likewise.
2332
2333 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
2334
2335 In the grammar scanner, STRING_FINISH unclosed constructs and return
2336 them to the parser in order to improve error messages.
2337 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
2338 SC_BRACED_CODE, SC_PROLOGUE): Implement.
2339 * tests/input.at (Unclosed constructs): New test case.
2340 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
2341 seen.
2342
2343 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
2344 unused global.
2345
2346 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
2347
2348 Handle string aliases for character tokens correctly.
2349 * src/symtab.c (symbol_user_token_number_set): If the token has an
2350 alias, check and set its alias's user token number instead of its own,
2351 which is set to indicate the alias. Previously, every occurrence of
2352 the character token in the grammar overwrote that alias indicator with
2353 the character code.
2354 * tests/input.at (String aliases for character tokens): New test.
2355
2356 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
2357
2358 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
2359
2360 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
2361
2362 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
2363 to prevent failures when building on older platforms.
2364 Check for autopoint failure.
2365 Set XGETTEXT_OPTIONS to values that check for C format strings,
2366 so that translators are warned about them (this also helps
2367 prevent core dumps).
2368
2369 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
2370 function, since it simplifies our code a bit.
2371
2372 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
2373 rather than -W, so we don't get bogus warnings about sign comparisons.
2374 Add -Wpointer-arith, since that warning is useful (it reports code
2375 that does not conform to C89 and that some compilers reject).
2376 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
2377 since it's no longer needed.
2378
2379 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
2380
2381 Clean up scanners a bit.
2382 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
2383 definitions so gcc won't warn when obstack_for_string is unused.
2384 * src/scan-code.l: config.h and system.h are already #include'd by
2385 scan-code-c.c, so get rid of them here.
2386 * src/scan-gram.l: Likewise.
2387 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
2388 definitions rather than duplicating the rest of it.
2389 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
2390
2391 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
2392
2393 Suppress signed/unsigned comparison warnings for yycheck.
2394 * data/c.m4 (b4_safest_int_type): New macro.
2395 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
2396 a signed int type, cast it to b4_safest_int_type first.
2397 * data/yacc.c: Likewise.
2398 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
2399 also overwritten.
2400
2401 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2402
2403 * doc/bison.texinfo: Fix some typos.
2404
2405 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
2406
2407 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
2408 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
2409
2410 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
2411 the latest gnulib does this a different way.
2412 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
2413 translation was patched, so stop omitting it.
2414
2415 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2416
2417 Enable declaration of default %printer/%destructor. Make the parser
2418 use these for all user-declared grammar symbols for which the user does
2419 not declare a specific %printer/%destructor. Thus, the parser uses it
2420 for token 0 if the user declares it but not if Bison generates it as
2421 $end. Discussed starting at
2422 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
2423 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
2424 and
2425 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
2426 * NEWS (2.3+): Mention.
2427 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
2428 declare a %destructor for a mid-rule's semantic value. It's just
2429 impossible to declare one specific to it.
2430 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
2431 code. Describe default %destructor form.
2432 * src/parse-gram.y (grammar_declaration): Parse default
2433 %printer/%destructor declarations.
2434 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
2435 and symbol_destructor_location_get rather than accessing the destructor
2436 and destructor_location members of struct symbol.
2437 (symbol_printers_output): Likewise but for %printer's.
2438 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
2439 again.
2440 * src/symtab.c (default_destructor, default_destructor_location,
2441 default_printer, default_printer_location): New static global
2442 variables to record the default %destructor and %printer.
2443 (symbol_destructor_get, symbol_destructor_location_get,
2444 symbol_printer_get, symbol_printer_location_get): New functions to
2445 compute the appropriate %destructor and %printer for a symbol.
2446 (default_destructor_set, default_printer_set): New functions to set the
2447 default %destructor and %printer.
2448 * src/symtab.h: Prototype all those new functions.
2449 * tests/actions.at (Default %printer and %destructor): New test to
2450 check that the right %printer and %destructor are called, that they're
2451 not called for $end, and that $$ and @$ work correctly.
2452 (Default %printer and %destructor for user-declared end token): New
2453 test to check that the default %printer and %destructor are called for
2454 a user-declared end token.
2455 * tests/input.at (Default %printer and %destructor redeclared, Unused
2456 values with default %destructor): New tests to check related grammar
2457 warnings and errors.
2458
2459 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2460
2461 Clean up handling of %destructor for the end token (token 0).
2462 Discussed starting at
2463 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
2464 and
2465 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
2466
2467 Make the skeletons consistent in how they pop the end token and invoke
2468 its %destructor.
2469 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
2470 state, which has token number 0, since this would invoke the
2471 %destructor for the end token.
2472 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
2473 until after shifting the end token, or else it won't be popped.
2474 * data/yacc.c (yyparse): Likewise.
2475
2476 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
2477 it's the end token. Upon termination, destroy an unshifted lookahead
2478 even when it's the end token.
2479 * data/lalr1.cc (yy::parser::parse): Likewise.
2480 * data/yacc.c (yyparse): Likewise.
2481
2482 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
2483 value warnings for the end token when the user gives the end token a
2484 %destructor.
2485
2486 * tests/actions.at (Printers and Destructors): Test all the above.
2487
2488 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
2489
2490 Update to latest gnulib and gettext versions.
2491 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
2492 Add fopen-safer.
2493 (gnulib_files): Add m4/warning.m4. Don't worry about files
2494 overwritten by autopoint.
2495 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
2496 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
2497 rejects them.
2498 Don't use autoreconf; instead, invoke autopoint etc. by hand,
2499 so that we can remove the intl files at a better time.
2500 (intl_files_to_remove): Remove aclocal.m4, since it gets
2501 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
2502 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
2503 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
2504 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
2505 Remove datarootdir hack; no longer needed.
2506 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
2507 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
2508 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
2509 strdup.h.
2510 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
2511 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
2512
2513 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
2514
2515 * bootstrap: Adjust to today's change to gnulib-tool by invoking
2516 it with --assume-autoconf='latest-stable'.
2517
2518 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
2519
2520 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
2521 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
2522 YYSTYPE' and `{'.
2523 * src/muscle_tab.h (muscle_grow): Replace the header comments with
2524 those from muscle_tab.c since the old ones are misleading.
2525
2526 2006-07-13 Akim Demaille <akim@epita.fr>
2527
2528 Support %define "KEY" {VALUE}.
2529 * src/scan-code.h, src/scan-code.l (translate_action)
2530 (translate_rule_action, translate_symbol_action, translate_code):
2531 Return char *, not const char *.
2532 * src/parse-gram.y (declaration): Rename as...
2533 (prologue_declaration): this.
2534 (string_content): Remove this nonterminal, use STRING.
2535 (braceless, content, content.opt): New nonterminal.
2536 Use them.
2537 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
2538 as value.
2539 * src/scan-gram.l (getargs.h): Don't include it.
2540
2541 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
2542
2543 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
2544 rather than a for-loop that declares a local bool variable. This
2545 should work around a compatibility problem with a Cray x1e C++
2546 compiler reported by Hung Nguyen in
2547 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
2548 The for-loop was introduced in the 2004-11-17 change but I don't
2549 know why it was needed.
2550
2551 2006-07-12 Akim Demaille <akim@epita.fr>
2552
2553 * data/c.m4: Comment changes.
2554
2555 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
2556
2557 * src/complain.c (error_message, ERROR_MESSAGE): New.
2558 To factor...
2559 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
2560 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
2561
2562 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2563
2564 * NEWS: Instead of %union, you can define and use your own union type
2565 YYSTYPE if your grammar contains at least one <type> tag.
2566 Your YYSTYPE need not be a macro; it can be a typedef.
2567 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
2568 (Union Decl, Decl Summary): Document this.
2569 * data/glr.c (YYSTYPE): Implement this.
2570 * data/glr.cc (YYSTYPE): Likewise.
2571 * data/lalr1.cc (YYSTYPE): Likewise.
2572 * data/yacc.c (YYSTYPE): Likewise.
2573 * src/output.c (prepare): Output tag_seen_flag.
2574 * src/parse-gram.y (declaration, grammar_declaration):
2575 Use 'union_seen' rather than 'typed' to determine whether
2576 %union has been seen, since grammars can now be typed without
2577 %union.
2578 (symbol_declaration, type.opt, symbol_def):
2579 Keep track of whether a tag has been seen.
2580 * src/reader.c (union_seen, tag_seen): New vars.
2581 (typed): remove.
2582 * src/reader.h (union_seen, tag_seen, typed): Likewise.
2583 * src/scan-code.l (untyped_var_seen): New variable.
2584 (handle_action_dollar): Adjust to above changes.
2585 (handle_action_dollar, handle_action_at):
2586 Improve overflow checking for outlandish numbers.
2587 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
2588 avoid new diagnostics generated by above changes.
2589 * tests/regression.at (YYSTYPE typedef): Add test to check
2590 for type tags without %union.
2591
2592 * src/symlist.c (symbol_list_length): Return int, not unsigned
2593 int, since callers expect int. This may need to get revisited
2594 once we have proper integer overflow checking.
2595
2596 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
2597 object is now static.
2598
2599 * src/getargs.c (flags_argmatch): Return void, not int,
2600 to pacify ./configure --enable-gcc-warnings.
2601
2602 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
2603 since last_string is already defined to FLEX_PREFIX (last_string).
2604
2605 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
2606
2607 Implement --warnings/-W.
2608 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
2609 replaced by...
2610 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
2611 Adjust callers.
2612 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
2613 (warnings_args, warnings_types): New.
2614 (getargs, short_options, long_options): Accept -W/--warnings.
2615 Sort the options by alphabetical order, upper case letter right
2616 before its lower case.
2617
2618 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2619
2620 Change %merge result type clash warnings to errors. Discussed at
2621 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
2622 * src/reader.c (record_merge_function_type): Use complain_at.
2623 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2624 declared later): Update test case results.
2625
2626 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
2627
2628 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
2629 to be in alphabetical order.
2630 (trace_args): Spelling fixes.
2631
2632 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2633
2634 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
2635 so they don't collide with user-defined macros.
2636 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
2637 this was never guaranteed, and now that we're using gnulib stdint,
2638 which defines int_fast16_t to long int, the problem is exposed.
2639
2640 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
2641
2642 * data/c.m4 (b4_basename): Simplify a bit, since we don't
2643 need the full POSIX semantics (and weren't implementing them
2644 anyway).
2645
2646 Adjust to Autoconf 2.60 and today's gnulib.
2647 * bootstrap (gnulib_modules): Add stdint.
2648 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
2649 no longer copies it.
2650 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
2651 since stdint needs the former and wcwidth (which is now required
2652 by mbswidth) needs the latter.
2653 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
2654 work around a compatibility glitch between gettext 0.14.6 and
2655 Autoconf 2.60.
2656 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
2657 Do not check for uintptr_t, since new stdint module does the right
2658 thing.
2659 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
2660 Add stdint.h, stdint_.h, wcwidth.h.
2661 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
2662 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
2663 stdint.m4, wchar_t.m4, wcwidth.m4.
2664 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
2665 usual order for ../lib/*.h files.
2666 (file_name_split): Use last_component, not base_name, to adjust
2667 to gnulib changes.
2668 * src/parse-gram.h: Include <strverscmp.h> in the usual order
2669 for ../lib/*.h files.
2670 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
2671 Define unconditionally, since we now assume the stdint module.
2672 * src/scan-skel.l: Include <dirname.h>.
2673 (BASE_QPUTS): Use last_component, not base_name.
2674 * src/system.h: Include <unlocked-io.h> in the usual order
2675 for ../lib/*.h files. Include <stdint.h> unconditionally,
2676 since we now use the stdint module.
2677 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
2678 HAVE_UINTPTR_T, since we now use the stdint module.
2679 (base_name): Remove decl, since files now include <dirname.h>
2680 to get the decl.
2681
2682 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
2683
2684 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
2685 New, default to 1.
2686 * data/yacc.c, data/glr.c, data/location.cc: Use them.
2687 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
2688 default.
2689 * tests/calc.at: Adjust.
2690
2691 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
2692
2693 * data/c.m4 (b4_basename): New.
2694 (b4_syncline): Also output the location of its invocation (from
2695 the skeleton).
2696 (b4_user_action, b4_define_user_action, b4_user_actions)
2697 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
2698 (b4_user_stype): New.
2699 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
2700
2701 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2702
2703 In the grammar file, the first column is 1 not 0 on the first line as
2704 on every other line.
2705 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
2706 * tests/input.at (Torturing the Scanner): Update output.
2707
2708 * src/scan-gram.l (scanner_cursor): Declare it static.
2709
2710 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2711
2712 In warnings, say "previous declaration" rather than "first
2713 declaration".
2714 * src/symtab.c (redeclaration): Do that here.
2715 * src/reader.c (record_merge_function_type): In the case of a result
2716 type clash, report the previous declaration rather than the very first
2717 one in the grammar file.
2718 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2719 declared later): Add a third declaration to check this behavior.
2720 * tests/input.at (Incompatible Aliases): Update output.
2721
2722 2006-06-27 Akim Demaille <akim@epita.fr>
2723
2724 * doc/Doxyfile.in: New.
2725 * doc/Makefile.am: Use it.
2726 * src/lalr.h, src/symtab.h: Initial doxygenation.
2727
2728 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2729
2730 Don't miss %merge result type warnings just because the LHS types are
2731 declared after the %merge. This continues the effort of the previous
2732 patch.
2733 * src/reader.c (get_merge_function): Don't set the merger type yet.
2734 (record_merge_function_type): New function for setting the merger type
2735 and checking for clashes.
2736 (grammar_current_rule_merge_set): Set the location of the %merge for
2737 the current rule.
2738 (packgram): Invoke record_merge_function_type for each rule now that
2739 all symbol type declarations have been parsed.
2740 * src/reader.h (merger_list.type_declaration_location): New member
2741 storing the location of the first %merge from which the type for this
2742 merging function was derived.
2743 * src/symlist.h (symbol_list.merger_declaration_location): New member
2744 storing the location of a rule's %merge, if any.
2745 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2746 declared later): New test to catch the error fixed by the above patch.
2747
2748 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2749
2750 Get action warnings (grammar_rule_check) right even when symbol
2751 declarations appear after the rules. Discussed at
2752 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
2753 and
2754 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
2755 Don't mistake the type of $$ in a midrule to be that of its parent
2756 rule's $$.
2757 * src/reader.c (grammar_current_rule_end): Don't invoke
2758 grammar_rule_check yet since not all symbol declarations may have been
2759 parsed yet.
2760 (grammar_midrule_action): Likewise.
2761 Don't record whether the midrule's $$ has been used yet since actions
2762 haven't been translated yet.
2763 Record the midrule's parent rule and its RHS index within the parent
2764 rule.
2765 (grammar_current_rule_action_append): Don't translate the action yet
2766 since not all symbol declarations may have been parsed yet and, thus,
2767 warnings about types for $$, $n, @$, and @n can't be reported yet.
2768 (packgram): Translate the action and invoke grammar_rule_check now that
2769 all symbol declarations have been parsed.
2770 * src/scan-code.l (handle_action_dollar): Now that this is invoked
2771 after parsing the entire grammar file, the symbol list here in the case
2772 of a midrule is actually the midrule's empty RHS, so reference its
2773 parent rule's RHS where necessary.
2774 On the other hand, now that you can already know it's a midrule, you
2775 aren't forced to think $$ has the same type as its parent rule's $$.
2776 (handle_action_at): In the case of a midrule, reference the parent rule
2777 where necessary.
2778 * src/symlist.c (symbol_list_new): Initialize new midrule-related
2779 members.
2780 (symbol_list_length): Now that this is invoked after all rules have
2781 been parsed, a NULL symbol (rather than a NULL symbol list node)
2782 terminates a rule. symbol_list_print already does this correctly.
2783 * src/symlist.h (symbol_list.midrule_parent_rule,
2784 symbol_list.midrule_parent_rhs_index): New members so that midrules can
2785 remember their relationships with their parents.
2786 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
2787 fixed by the above patch.
2788 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
2789 implementing...
2790 (Unused values): ... this old test case and...
2791 (Unused values before symbol declarations): ... this new test case.
2792 This one is the same as `Unused values' except that all symbol
2793 declarations appear after the rules in order to catch the rest of the
2794 errors fixed by the above patch.
2795
2796 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2797
2798 More cleanup.
2799 * src/reader.c (current_rule): Declare it static since it's no longer
2800 used outside this file.
2801 (grammar_current_rule_action_append): Remove redundant arguments from
2802 translate_rule_action invocation.
2803 * src/reader.h (current_rule): Remove this unused extern.
2804 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
2805 * src/scan-code.l (translate_rule_action): Likewise.
2806
2807 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
2808
2809 Clean up yesterday's patch.
2810 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
2811 to...
2812 * src/reader.c (grammar_current_rule_action_append): ... here for
2813 consistency with grammar_current_rule_symbol_append.
2814 * tests/regression.at (Braced code in declaration in rules section):
2815 Make yyerror and yylex static as usual.
2816
2817 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
2818
2819 Fix bug that mistakes braced code in a declaration in the rules section
2820 to be a rule action. Mentioned at
2821 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
2822 * src/scan-gram.l: Move midrule action detection from the start of the
2823 scanning of any braced code to...
2824 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
2825 action. For readability, use $2 and @2 rather than the equivalent
2826 global variables.
2827 * tests/regression.at (Braced code in declaration in rules section):
2828 New test to catch the error fixed by the above patch.
2829
2830 Work on code readability some.
2831 * src/scan-code.l (current_rule): Get rid of this misleading and
2832 redundant declaration: it's actually extern'ed in reader.h.
2833 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
2834 translate_action): Add a rule argument and use it instead of the global
2835 current_rule.
2836 (translate_rule_action): This already receives current_rule through an
2837 argument, so pass it on to translate_action instead of assigning
2838 current_rule to current_rule.
2839 (translate_symbol_action, translate_code): Pass rule = NULL to
2840 translate_action.
2841
2842 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
2843
2844 Rename %before-definitions to %start-header and %after-definitions to
2845 %end-header. Don't use these declarations to separate pre-prologue
2846 blocks from post-prologue blocks. Add new order-independent
2847 declarations %before-header and %after-header as alternatives to the
2848 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
2849 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
2850 * NEWS (2.3+): Update for these changes.
2851 * data/glr.c (b4_before_definitions): Update to...
2852 (b4_start_header): ... this.
2853 (b4_after_definitions): Update to...
2854 (b4_end_header): ... this.
2855 * data/glr.cc: Likewise.
2856 * data/lalr1.cc: Likewise.
2857 * data/yacc.c: Likewise.
2858 * doc/bison.texinfo (The prologue): Update names, and replace remaining
2859 prologue blocks with %*-header declarations.
2860 (Calc++ Parser): Likewise.
2861 (Bison Declaration Summary): Update names.
2862 (Table of Symbols): Update description.
2863 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
2864 (PERCENT_END_HEADER): ... this.
2865 (PERCENT_BEFORE_DEFINITIONS): Update to...
2866 (PERCENT_START_HEADER): ... this.
2867 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2868 (declaration): Update token names and m4 macro names.
2869 When parsing %end-header and %start-header, invoke translate_code
2870 before muscle_code_grow, and no longer set global booleans to remember
2871 whether these declarations have been seen.
2872 Parse new %after-header and %before-header.
2873 * src/reader.c (before_definitions, after_definitions): Remove.
2874 (prologue_augment): Accept a new bool argument to specify whether to
2875 augment the pre-prologue or post-prologue.
2876 * src/reader.h (before_definitions, after_definitions): Remove these
2877 extern's.
2878 (prologue_augment): Add new bool argument.
2879 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
2880 (PERCENT_END_HEADER): ... this.
2881 (PERCENT_BEFORE_DEFINITIONS): Update to...
2882 (PERCENT_START_HEADER): ... this.
2883 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2884 * tests/actions.at (Printers and Destructors): Update names.
2885
2886 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
2887
2888 Add comparison operators for C++ location classes. Discussed at
2889 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
2890 * data/c++.m4 (b4_define_location_comparison): New boolean %define
2891 declaration indicating whether filename_type has an operator==. If
2892 filename_type is `std::string', it defaults to `1', `0' otherwise.
2893 * data/location.cc: Iff b4_define_location_comparison is `1', add
2894 operator== and operator!= for class position and for class location.
2895
2896 Some minor fixes.
2897 * src/scan-action.l: Remove unused file.
2898 * src/symtab.c (symbol_printer_set): Use printer_location not
2899 destructor_location.
2900 * src/symtab.h (struct symbol): Replace incorrect source comment for
2901 printer members.
2902 * tests/input.at (Incompatible Aliases): Update output with correct
2903 printer location.
2904
2905 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
2906
2907 Don't put the pre-prologue in the header file. For the yacc.c code
2908 file and the glr.c header and code files, move the pre-prologue before
2909 the token definitions. Add new %before-definitions and
2910 %after-definitions to declare code that will go in both the header file
2911 and code file. Discussed at
2912 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
2913 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
2914 and
2915 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
2916 * NEWS (2.3+): Describe these changes.
2917 * data/glr.c (b4_pre_prologue): Move from within to before...
2918 (b4_shared_declarations): ... this.
2919 Add new b4_before_definitions before b4_token_enums.
2920 Add new b4_after_definitions at the end.
2921 * data/glr.cc (b4_pre_prologue): Replace with...
2922 (b4_before_definitions): ... this in the header file.
2923 (b4_after_definitions): New near the end of the header file.
2924 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
2925 code file right before including the header file.
2926 (b4_before_definitions): New in the previous position of
2927 b4_pre_prologue in the header file.
2928 (b4_after_definitions): New near the end of the header file.
2929 * data/yacc.c: Clean up some m4 quoting especially in the header file.
2930 (b4_token_enums_defines): In the code file, move to right before
2931 YYSTYPE for consistency with the header file.
2932 (b4_before_definitions): New right before b4_token_enums_defines in
2933 both the header and code file.
2934 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
2935 header and code file.
2936 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
2937 of prologues for %union dependencies.
2938 (Bison Declaration Summary): In %defines description, mention the
2939 effect of %before-definitions and %after-definitions on the header
2940 file.
2941 (Calc++ Parser): Forward declare driver in a %before-definitions rather
2942 than in the pre-prologue so that make check succeeds.
2943 (Table of Symbols): Add entries for %before-definitions and
2944 %after-definitions.
2945 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
2946 %before-definitions.
2947 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
2948 (declaration): Parse those declarations and append to
2949 b4_before_definitions and b4_after_definitions, respectively.
2950 * src/reader.c (before_definitions, after_definitions): New bools to
2951 track whether those declarations have been seen.
2952 (prologue_augment): Add to the post-prologue if %union,
2953 %before-definitions, or %after-definitions has been seen.
2954 * src/reader.h (before_definitions, after_definitions): New extern's.
2955 * src/scan-gram.l: Scan the new declarations.
2956 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
2957 prologue block in a %before-definitions or a %after-definitions based
2958 on whether the %union is declared.
2959 * tests/regression.at (Early token definitions with --yacc, Early token
2960 definitions without --yacc): Move tests for token definitions into the
2961 post-prologue since token names are no longer defined in the
2962 pre-prologue.
2963
2964 2006-06-20 Akim Demaille <akim@epita.fr>
2965
2966 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
2967 (symbol_get): Use it.
2968 * src/parse-gram.y: Use it.
2969
2970 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
2971
2972 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
2973 build succeeds when configured with --enable-gcc-warnings.
2974
2975 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
2976
2977 * src/parse-gram.y (char_name): New function.
2978 (CHAR, STRING, string_content): For %printer, properly escape.
2979 (ID): Prefer fputs to fprintf.
2980 (id): Reindent to be consistent with other rules.
2981 Properly quote char.
2982
2983 The Translation Project changed its way of publishing translations
2984 to maintainers. I haven't received any responses to my request
2985 for supporting the old way, or for documenting the new way. I
2986 have modified 'bootstrap' to use screen scraping
2987 (in this case, HTML scraping). This is unreliable and inelegant,
2988 but I don't see any better way. Yuck.
2989 * bootstrap (TP_URL, WGET_COMMAND): New vars.
2990 (get_translations): New function, which uses HTML scraping to
2991 deduce locations of latest translations.
2992 Use this function to grab both bison and bison-runtime .po files.
2993 Don't bother priming the pump for the runtime-po domain any more,
2994 as it's now translated better than bison is.
2995
2996 2006-06-19 Akim Demaille <akim@epita.fr>
2997
2998 * src/scan-gram.l: No longer "parse" things after `%union' until
2999 `{'. Rather, return a single "%union" token.
3000 No longer make symbols: return strings, and leave the conversion
3001 to symbols to the parser.
3002 (SC_PRE_CODE, token_type): Remove.
3003 * src/parse-gram.y (%union): New field `character'.
3004 Sort tokens.
3005 (CHAR): New token.
3006 (ID, ID_COLON): Now that the scanner no longer makes them
3007 identifiers, adjust all uses to invoke symbol_get.
3008 (id_colon): New, wraps the conversion from string to symbol.
3009 (%union): Accept a possible union_name.
3010 (symbol): Now can be a char.
3011 * data/c.m4 (b4_union_name): Leave a default value.
3012 * data/glr.c, data/yacc.c: Use it.
3013
3014 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
3015
3016 For associating token numbers with token names for "yacc.c", don't use
3017 #define statements unless `--yacc' is specified; always use enum
3018 yytokentype. Most important discussions start at:
3019 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
3020 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
3021 and
3022 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
3023 * NEWS (2.3+): Mention.
3024 * data/c.m4 (b4_yacc_if): New.
3025 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
3026 token #define's.
3027 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
3028 on token name definitions.
3029 * src/getargs.c (usage): Capitalize `Yacc' in English.
3030 * src/output.c (prepare): Define b4_yacc_flag.
3031 * tests/regression.at (Early token definitions): Test that tokens names
3032 are defined before the pre-prologue not just before the post-prologue.
3033 Remove this test case and copy to...
3034 (Early token definitions with --yacc): ... this to test #define's.
3035 (Early token definitions without --yacc): ... and this to test enums.
3036
3037 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
3038
3039 * NEWS: Reword the post-2.3 change to not be so optimistic about
3040 removing the old "look-ahead" spelling.
3041 Update previous look-ahead/lookahead change reports.
3042 * REFERENCES: look-ahead -> lookahead (since that's
3043 what he actually wrote).
3044 * doc/refcard.tex: look ahead -> lookahead,
3045 look-ahead -> lookahead
3046
3047 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
3048
3049 For consistency, use `lookahead' instead of `look-ahead' or
3050 `look_ahead'. Discussed starting at
3051 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
3052 and then at
3053 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
3054 * NEWS: For the next release, note the change to `--report'.
3055 * TODO, doc/bison.1: Update English.
3056 * doc/bison.texinfo: Update English.
3057 (Understanding Your Parser, Bison Options): Document as
3058 `--report=lookahead' rather than `--report=look-ahead'.
3059 * src/conflicts.c: Update English in comments.
3060 (lookahead_set): Rename from look_ahead_set.
3061 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
3062 (resolve_sr_conflict): Rename local look_ahead_tokens to
3063 lookahead_tokens, and update other uses.
3064 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
3065 count_rr_conflicts, conflicts_free): Update uses.
3066 * src/getargs.c (report_args): Move "lookahead" before alternate
3067 spellings.
3068 (report_types): Update uses.
3069 (usage): For `--report' usage description, state `lookahead' spelling
3070 rather than `look-ahead'.
3071 * src/getargs.h (report.report_lookahead_tokens): Rename from
3072 report_look_ahead_tokens.
3073 * src/lalr.c: Update English in comments.
3074 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
3075 (state_lookahead_tokens_count): Rename from
3076 state_look_ahead_tokens_count.
3077 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3078 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
3079 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3080 Update other uses.
3081 Update English in output.
3082 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
3083 * src/print.c: Update English in comments.
3084 (lookahead_set): Rename from look_ahead_set.
3085 (print_reduction): Rename argument lookahead_token from
3086 look_ahead_token.
3087 (print_core, state_default_rule, print_reductions, print_results):
3088 Update uses.
3089 * src/print_graph.c: Update English in comments.
3090 (print_core): Update uses.
3091 * src/state.c: Update English in comments.
3092 (reductions_new): Update uses.
3093 (state_rule_lookahead_tokens_print): Rename from
3094 state_rule_look_ahead_tokens_print, and update other uses.
3095 * src/state.h: Update English in comments.
3096 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
3097 (state_rule_lookahead_tokens_print): Rename from
3098 state_rule_look_ahead_tokens_print.
3099 * src/tables.c: Update English in comments.
3100 (conflict_row, action_row): Update uses.
3101 * tests/glr-regression.at
3102 (Incorrect lookahead during deterministic GLR,
3103 Incorrect lookahead during nondeterministic GLR): Rename
3104 print_look_ahead to print_lookahead.
3105 * tests/torture.at: Update English in comments.
3106 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
3107 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
3108 (Many lookahead tokens): Update uses.
3109 * data/glr.c: Update English in comments.
3110 * lalr1.cc: Likewise.
3111 * yacc.c: Likewise.
3112 * src/conflicts.h: Likewise.
3113 * src/lalr.h: Likewise.
3114 * src/main.c: Likewise.
3115 * src/output.c: Likewise.
3116 * src/parse-gram.c: Likewise.
3117 * src/tables.h: Likewise.
3118 * tests/calc.at: Likewise.
3119
3120 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
3121
3122 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
3123
3124 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
3125
3126 * TODO: Add request from Nelson H. F. Beebe to be able to install
3127 Bison without installing the yacc script.
3128
3129 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3130
3131 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
3132 and yytext if they're already #define'd.
3133 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
3134 * src/scan-code-c.c: ... here.
3135 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
3136 <config.h>.
3137
3138 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3139
3140 Get Bison to build again when configured with --enable-gcc-warnings.
3141 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
3142 missing #include's.
3143 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
3144 loc argument as it shadows a global.
3145 * src/scan-gram.l: Remove stray comma that prevents boundary_set
3146 invocation.
3147
3148 * src/.cvsignore: Add scan-code.c.
3149
3150 2006-06-07 Akim Demaille <akim@epita.fr>
3151
3152 * src/scan-gram.l: Move the "add a trailing ; to actions" code
3153 to...
3154 * src/scan-code.l: here.
3155 * tests/input.at (Torturing the Scanner): Fix another location
3156 error.
3157
3158 2006-06-07 Akim Demaille <akim@epita.fr>
3159
3160 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
3161
3162 2006-06-06 Akim Demaille <akim@epita.fr>
3163
3164 Extract the parsing of user actions from the grammar scanner.
3165 As a consequence, the relation between the grammar scanner and
3166 parser is much simpler. We can also split "composite tokens" back
3167 into simple tokens.
3168 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
3169 * src/scan-gram.l (add_column_width, adjust_location): Move to and
3170 rename as...
3171 * src/location.h, src/location.c (add_column_width)
3172 (location_compute): these.
3173 Fix the column count: the initial column is 0.
3174 (location_print): Be robust to ending column being 0.
3175 * src/location.h (boundary_set): New.
3176 * src/main.c: Adjust to scanner_free being renamed as
3177 gram_scanner_free.
3178 * src/output.c: Include scan-code.h.
3179 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
3180 Use boundary_set.
3181 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
3182 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
3183 which is now, again, a separate token.
3184 Adjust all dependencies.
3185 Whereever actions with $ and @ are used, use translate_code.
3186 (action): Remove this nonterminal which is now useless.
3187 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
3188 (grammar_current_rule_action_append): Use translate_code.
3189 (packgram): Bound check ruleno, itemno, and rule_length.
3190 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
3191 (last_string, last_braced_code_loc, max_left_semantic_context)
3192 (scanner_initialize, scanner_free, scanner_last_string_free)
3193 (gram_out, gram_lineno, YY_DECL_): Move to...
3194 * src/scan-gram.h: this new file.
3195 (YY_DECL): Rename as...
3196 (GRAM_DECL): this.
3197 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
3198 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3199 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3200 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3201 Move these declarations, and...
3202 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
3203 these to...
3204 * src/flex-scanner.h: this new file.
3205 * src/scan-gram.l (rule_length, rule_length_overflow)
3206 (increment_rule_length): Remove.
3207 (last_braced_code_loc): Rename as...
3208 (gram_last_braced_code_loc): this.
3209 Adjust to the changes of the parser.
3210 Move all the handling of $ and @ into...
3211 * src/scan-code.l: here.
3212 * src/scan-gram.l (handle_dollar, handle_at): Remove.
3213 (handle_action_dollar, handle_action_at): Move to...
3214 * src/scan-code.l: here.
3215 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
3216 scan-code.h, scan-code-c.c, scan-gram.h.
3217 (EXTRA_bison_SOURCES): Add scan-code.l.
3218 (BUILT_SOURCES): Add scan-code.c.
3219 (yacc): Be robust to white spaces.
3220
3221 * tests/conflicts.at, tests/input.at, tests/reduce.at,
3222 * tests/regression.at: Adjust the column numbers.
3223 * tests/regression.at: Adjust the error message.
3224
3225 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3226
3227 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3228 Use Akim's wording from
3229 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
3230
3231 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3232
3233 Between Bison releases, manually append `+' to the previous Bison
3234 release number, and use that as a signal to automatically print the
3235 ChangeLog's CVS Id keyword from --version. Discussed starting at
3236 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
3237 * ChangeLog: Add Id header.
3238 * configure.ac (AC_INIT): Append `+' to `2.3'.
3239 * src/.cvsignore: Add revision.c.
3240 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
3241 (BUILT_SOURCES): Add revision.c.
3242 (revision.c): New target rule. This file defines a new global variable
3243 named revision. It initializes it with either the Id from ChangeLog
3244 or, if VERSION doesn't contain `+', with the empty string.
3245 * src/getargs.c (version): Print the value of revision.
3246 * src/revision.h: Extern revision.
3247
3248 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
3249
3250 * NEWS: Version 2.3.
3251 * configure.ac (AC_INIT): Likewise.
3252
3253 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
3254
3255 * data/glr.c (YYRECOVERING): Define to be a function-like macro
3256 with no arguments, not as an object-like macro. This is for
3257 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
3258 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
3259 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
3260 Document this.
3261
3262 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
3263
3264 * src/getargs.c (usage): Back out yesterday's modification of the
3265 --help output so that we don't have to wait for translation before
3266 releasing 2.3.
3267
3268 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
3269
3270 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
3271 Problem reported by Akim Demaille.
3272
3273 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3274
3275 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3276
3277 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
3278
3279 * data/yacc.c (yy_reduce_print): Omit trailing white space in
3280 generated source code. Problem reported by Frans Englich in
3281 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
3282
3283 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
3284
3285 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
3286 shell, not within 'make', so that 'make' by an ordinary builder
3287 (using GNU make) does not worry about configuring gzip. This also
3288 works around a bug reported independently by Keith Thompson and by
3289 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
3290 stderr rather than stdout, messing up the build logs.
3291
3292 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3293
3294 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
3295 to make sure that YYID will never be unused. This fixes a 'make
3296 maintainer-check' failure caused by the recent changes to the 'Trivial
3297 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
3298 not used.
3299 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
3300
3301 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3302
3303 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
3304 state before an empty RHS is always resolved here. Only the location
3305 of that state is guaranteed to be resolved, and that's enough. This
3306 fixes the remaining bug reported by Derek M. Jones in
3307 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3308 * tests/glr-regression.at (Uninitialized location when reporting
3309 ambiguity): Test the above case.
3310 Also, the embedded comments in this test case claim it checks the case
3311 of an empty RHS that has inherited the initial location. However, the
3312 corresponding LHS was already resolved, so yyresolveLocations didn't
3313 actually have reason to modify it. Fix this by forcing
3314 nondeterministic operation at the beginning of the parse.
3315
3316 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
3317
3318 * data/c.m4 (b4_yy_symbol_print_generate):
3319 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
3320 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
3321 of the bugs reported today by Derek M Jones in
3322 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3323 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
3324 defined to be a type name without parens or brackets.
3325 (Location Type): Similarly for YYLTYPE.
3326 * tests/regression.at (Trivial grammars): Put in a test for this
3327 bug that will be caught by 'make maintainer-check' (though not,
3328 alas, by 'make check' unless your compiler is picky).
3329
3330 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
3331
3332 * NEWS: Version 2.2.
3333 * configure.ac (AC_INIT): Likewise.
3334
3335 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
3336
3337 * data/glr.c (yyreportTree): Make room in yystates for the state
3338 preceding the RHS. This fixes the segmentation fault reported by Derek
3339 M. Jones in
3340 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
3341 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
3342 to the user. Reported for yyreportTree by Derek M. Jones later in the
3343 same thread.
3344 * THANKS: Add Derek M. Jones.
3345 Update my email address.
3346 Fix typo in Steve Murphy's name.
3347
3348 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
3349
3350 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
3351 checking against YYLAST that caused the parser to miss a potential
3352 alternative in its diagnostic.
3353 Problem reported by Maria Jose Moron Fernandez in
3354 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
3355 * data/lalr1.cc (yysyntax_error_): Likewise.
3356 * data/yacc.c (yysyntax_error): Likewise.
3357 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
3358 tokens, in case we run into an older C compiler.
3359 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
3360 Use them to check for the off-by-one error fixed above.
3361
3362 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
3363 YYSIZE_T, not size_t.
3364 * tests/regression.at (Trivial grammars): New test, to catch
3365 the error fixed by the above patch.
3366
3367 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3368
3369 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
3370 scheme.
3371 Reported by Steve Murphy.
3372
3373 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3374
3375 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
3376 * data/glr.cc: b4_location_flag is now b4_locations_flag.
3377
3378 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3379
3380 Implement --trace=m4.
3381 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
3382 * src/output.c (output_skeleton): When set, pass -dV to m4.
3383
3384 Factor the handling of flags in m4.
3385 * src/output.c (prepare): Rename the muscle names debug, defines,
3386 error_verbose to debug_flag, defines_flag, error_verbose_flag.
3387 * data/c.m4: Adjust.
3388 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
3389 Use b4_define_flag_if to define other b4_FLAG_if macros.
3390 (b4_location_if): As a consequence, rename as...
3391 (b4_locations_if): this, for consistency.
3392 Adjust all the skeletons.
3393
3394 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3395
3396 * etc/bench.pm: Shorten bench names.
3397
3398 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
3399
3400 * src/output.h, src/output.c (error_verbose): Move to...
3401 * src/getargs.h, src/getargs.c: here.
3402 Sort the flags.
3403 Adjust dependencies.
3404
3405 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
3406
3407 * data/c.m4 (b4_copyright): Put the special exception for Bison
3408 skeletons here, so we don't have to put it in each skeleton. All
3409 uses changed. Suggested by Akim Demaille. Also, wrap the
3410 copyright notice, in case it is longer than 80 columns. Replace
3411 comma by newline after title.
3412
3413 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
3414
3415 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
3416 incompatibility, not a bug. Mention that it wasn't fixed as of
3417 flex 2.5.33.
3418
3419 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
3420
3421 * examples/extexi: Enforce the precedence of concatenation over
3422 >>.
3423 Reported by Tommy Nordgren.
3424
3425 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
3426
3427 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
3428 with the member "token".
3429 Reported by Martin Nylin.
3430
3431 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
3432
3433 * data/glr.c: Switch to Bison 2.2 special-exception language in
3434 the copyright notice. Use more-regular format for titles and
3435 copyright notices.
3436 * data/glr.cc: Likewise.
3437 * data/location.cc: Likewise.
3438 * data/yacc.cc: Likewise.
3439 * doc/bison.texinfo (Conditions): Document this.
3440 * NEWS: likewise. Upgrade version to 2.2.
3441
3442 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
3443
3444 * data/glr.cc: Remove dead code.
3445
3446 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
3447
3448 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
3449 that variable and the line breaks the bootstrap. Problem reported
3450 by Juan M. Guerrero.
3451
3452 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
3453
3454 * doc/bison.texinfo (Multiple start-symbols): New.
3455
3456 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
3457
3458 * etc/README, etc/bench.pl: New.
3459
3460 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
3461
3462 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
3463 rule.
3464 Reported by Mickael Labau.
3465 * tests/input.at (Torturing the Scanner): Test it.
3466
3467 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
3468
3469 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
3470 Problem reported by Bob Rossi.
3471
3472 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
3473
3474 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
3475 and didn't really work.
3476 For the index, use @ifnotinfo, not @iftex.
3477 Minor cleanups of spacing and terminology.
3478
3479 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
3480
3481 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
3482 of AT_NAME_PREFIX when %name-prefix is not used.
3483
3484 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
3485
3486 Apply --prefix to C++ skeletons too: they change the namespace.
3487 The test suite already exercize these cases.
3488 * data/c++.m4 (b4_namespace): New.
3489 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
3490 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
3491 * data/yacc.c, data/glr.c: Remove a useless `[]'.
3492 * doc/bison.texinfo: Document it.
3493 (Option Cross Key): Use @multitable in all formats. It looks
3494 nicer, even in TeX outputs.
3495 (Rules): Use the same code whatever the output type is.
3496 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
3497 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
3498 * tests/calc.at: Use it, instead of hard coding `yy'.
3499
3500 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
3501
3502 * TODO: Remove dead items.
3503
3504 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
3505
3506 * doc/FAQ: Remove, merged into...
3507 * doc/bison.texinfo (FAQ): this.
3508 * doc/Makefile.am (EXTRA_DIST): Adjust.
3509
3510 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
3511
3512 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
3513 even if empty.
3514 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
3515 * doc/bison.texinfo (Calc++ Scanner): Use it.
3516
3517 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
3518
3519 Fix two nits reported by twlevo, plus one more that I discovered.
3520
3521 * src/assoc.h (assoc_to_string): Give a name to the arg, as
3522 this is the usual Bison style.
3523 * src/location.h (location_print): Likewise.
3524
3525 * src/reader.h (token_name): Likewise.
3526
3527 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
3528
3529 Fix some nits reported by twlevo.
3530 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
3531 and "POSIX". Use more-modern syntax for URLs. Mention C++
3532 and ask for Java. Don't hardwire OS version numbers. Add
3533 copyright notice.
3534 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
3535 * src/conflicts.c (solved_conflicts_obstack): Now static.
3536
3537 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3538
3539 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
3540 page. Say "you can use it" not "you may use it" as on the web page;
3541 we're describing capabilities not granting permission.
3542
3543 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
3544
3545 * data/glr.c (yyresolveLocations): Rename local variables to avoid
3546 shadowing warnings. Use usual patter for iterating through RHS.
3547 * tests/glr-regression.at
3548 (Uninitialized location when reporting ambiguity):
3549 Modify yylex so that it uses its argument, rather than trying
3550 to rely on ARGSUSED (which doesn't work for gcc with warnings).
3551 const char -> char const.
3552
3553 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
3554 Don't use tabs inside commands; it messes up 'ps'.
3555 Problem reported by twlevo.
3556
3557 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
3558
3559 * tests/glr-regression.at (Uninitialized location when reporting
3560 ambiguity): New test case.
3561 * data/glr.c (yyresolveLocations): New function, which uses
3562 YYLLOC_DEFAULT.
3563 (yyresolveValue): Invoke yyresolveLocations before reporting an
3564 ambiguity.
3565 * doc/bison.texinfo (Default Action for Locations): Note
3566 YYLLOC_DEFAULT's usage for ambiguity locations.
3567 (GLR Semantic Actions): Cross-reference those notes.
3568
3569 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
3570
3571 * tests/glr-regression.at (Leaked semantic values when reporting
3572 ambiguity): Remove unnecessary union and type declarations.
3573 (Leaked lookahead after nondeterministic parse syntax error): New test
3574 case.
3575 * data/glr.c (yyparse): Check for zero stacks remaining before
3576 attempting to shift the lookahead so that you don't lose it.
3577
3578 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3579
3580 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
3581 * tests/glr-regression.at (Leaked semantic values when reporting
3582 ambiguity): New test case.
3583 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
3584 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
3585 now unnecessary yystackp parameter.
3586 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
3587 destructors can be called.
3588
3589 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
3590 in existing testcases.
3591
3592 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3593
3594 Don't leak semantic values for parent RHS when a user action cuts the
3595 parser, and clean up related code a bit.
3596 * tests/glr-regression.at (Leaked merged semantic value if user action
3597 cuts parse): Rename to...
3598 (Leaked semantic values if user action cuts parse): ... this. Add check
3599 for leaked parent RHS values.
3600 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
3601 between an unresolved state (non-empty chain of semantic options) and
3602 an incomplete one (signaled by an empty chain).
3603 (yyresolveStates): Document the interface. Move all manipulation of a
3604 successfully or unsuccessfully resolved yyGLRState to...
3605 (yyresolveValue): ... here so that yyresolveValue always leaves a
3606 yyGLRState with consistent data and thus is easier to understand.
3607 Remove the yyvalp and yylocp parameters since they are always just
3608 taken from the yys parameter. When reporting a discarded merged value
3609 in debugging output, note that it is incompletely merged. Document the
3610 interface.
3611 (yyresolveAction): If resolving any of the RHS states fails, destroy
3612 them all rather than leaking them. Thus, as long as user actions are
3613 written to clean up the RHS correctly, yyresolveAction always cleans up
3614 the RHS of a semantic option. Document the interface.
3615
3616 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
3617
3618 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
3619 led to a segmentation fault in GNU Pascal. Problem reported
3620 by Waldek Hebisch.
3621
3622 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
3623
3624 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
3625 mid-rule action inside a nonterminal symbol in order to declare a
3626 destructor for its semantic value.
3627
3628 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
3629
3630 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
3631 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
3632 __cplusplus && ! defined _STDLIB_H && !
3633 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
3634 defined free))]: Include <stdlib.h> rather than rolling our own
3635 declarations of malloc and free, to avoid problems with
3636 incompatible declarations (using 'throw') C++'s stdlib.h. This
3637 should fix Debian bug 340012
3638 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
3639 reported by Guillaume Melquiond.
3640
3641 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3642
3643 * NEWS: Clarify symbols versus types in unused-value warnings.
3644
3645 * configure.ac (AC_INIT): Bump version number.
3646
3647 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3648
3649 * NEWS: Version 2.1a.
3650 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
3651 since C99 requires this.
3652
3653 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
3654
3655 * m4/c-working.m4: New file.
3656 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
3657
3658 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
3659
3660 * Makefile.maint: Merge from coreutils.
3661
3662 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
3663
3664 More portability fixes for problems summarized by Nelson H. F. Beebe.
3665
3666 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
3667 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
3668 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
3669 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
3670 messes up because C++ code is compiled in 32-bit mode but linked
3671 in 64-bit mode.
3672
3673 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
3674
3675 More portability fixes for problems summarized by Nelson H. F. Beebe.
3676
3677 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
3678 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
3679
3680 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
3681 nodist_PROGRAMS, since we don't need to actually compile the
3682 example if we're just doing a plain 'make'. This avoids bothering
3683 the installer unnecessarily about problems due to weird C++
3684 compilers.
3685
3686 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
3687
3688 More portability fixes for problems summarized by Nelson H. F. Beebe.
3689
3690 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
3691 than #include "...", and compile with -I'.'. The old method was
3692 not portable, according to Posix and the C standard, and it does
3693 not work with Sun C 5.7, where previous #line directives affect
3694 the working directory used in later #include "..." directives.
3695
3696 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3697
3698 Various DJGGP specific issues in /djgpp
3699
3700 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
3701
3702 More portability fixes for problems summarized by Nelson H. F. Beebe.
3703
3704 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
3705 '#include <map>' works and that you can apply ++ to iterators.
3706
3707 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
3708
3709 Work around portability problems summarized by Nelson H. F. Beebe in
3710 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
3711
3712 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3713 that '#include <string>' works.
3714
3715 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
3716 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
3717 "warning: sorry: semantics of inline function static data `const
3718 unsigned char translate_table[262]' are wrong (you'll wind up with
3719 multiple copies)".
3720
3721 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
3722 or, xor to not_, and_, or_, and xor_, respectively. This works
3723 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
3724 random system header somewhere that includes the equivalent of
3725 <iso646.h>.
3726
3727 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
3728 -E" works; it apparently doesn't work with PathScale EKO Compiler
3729 Suite Version 2.0.
3730
3731 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
3732
3733 During deterministic GLR operation, user actions should be able to
3734 influence the parse by changing yychar. To make this easier to fix and
3735 to make glr.c easier to evolve in general, don't maintain yytoken in
3736 parallel with yychar; just compute yytoken when needed.
3737 * tests/glr-regression.at (Incorrect lookahead during deterministic
3738 GLR): Check that setting yychar in a user action has the intended
3739 effect.
3740 * data/glr.c (yyGLRStack): Remove yytokenp member.
3741 (yyclearin): Don't set *yytokenp.
3742 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
3743 yychar rather than *yytokenp to determine the current lookahead.
3744 Compute yytoken locally when needed.
3745 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
3746 point to.
3747
3748 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
3749 after `--report' documentation.
3750
3751 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
3752
3753 * src/parse-gram.y (grammar_declaration): Location of printer
3754 symbol is @1, not list->location. Bug reported by twlevo.
3755 * tests/input.at (Incompatible Aliases): Adjust to above change.
3756
3757 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
3758
3759 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
3760 all the test at once. This makes the output easier to read in the
3761 normal case.
3762
3763 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
3764 got from <http://bro-ids.org/download.html>. The bug is that
3765 when two actions appeared in succession, the second one was
3766 scanned before the first one was added to the grammar rule
3767 as a midrule action. Bison then output the incorrect warning
3768 "parse.y:905.17-906.36: warning: unused value: $3".
3769 * src/parse-gram.y (BRACED_CODE, action): These are no longer
3770 associated with a value.
3771 (rhs): Don't invoke grammar_current_rule_action_append.
3772 (action): Invoke it here instead.
3773 * src/reader.c (grammar_midrule_action): Now extern.
3774 (grammar_current_rule_action_append): Don't invoke
3775 grammar_midrule_action; that is now the scanner's job.
3776 * src/reader.h (last_string, last_braced_code_loc):
3777 (grammar_midrule_action): New decls.
3778 * src/scan-gram.l (last_string): Now extern, sigh.
3779 (last_braced_code_loc): New extern variable.
3780 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
3781 rule already has an action.
3782 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
3783 * tests/input.at (AT_CHECK_UNUSED_VALUES):
3784 Add some tests to check that the above changes fixed the bug.
3785
3786 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
3787
3788 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
3789 All used changed. Check whether the symbol has a destructor,
3790 not whether it is typed.
3791 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
3792 that the values are still reported as unused. All line numbers
3793 adjusted.
3794
3795 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
3796
3797 Work around a bug in bro 0.8, which underparenthesizes its
3798 definition of YYLLOC_DEFAULT.
3799 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
3800 their arguments.
3801 * data/lalr1.cc: Likewise.
3802 * data/yacc.cc: Likewise.
3803
3804 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
3805
3806 Work around a bug in Pike 7.0, and give the Pike folks a
3807 better way to override the usual int widths.
3808 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
3809 user can override the types.
3810 (short): #undef, to work around a bug in Pike 7.0.
3811 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
3812 (union yyalloc.yyss): Use yytype_int16 rather than short.
3813 All uses changed.
3814 (yysigned_char): Remove.
3815 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
3816 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
3817 * tests/regression.at (Web2c Actions): Adjust to above changes.
3818
3819 * src/reader.c (check_and_convert_grammar): New function.
3820 (reader): Close the input file even if something went wrong during
3821 parsing. Minor file descriptor leak reported by twlevo.
3822
3823 * src/assoc.c (assoc_to_string): Use a default: abort (); case
3824 to pacify gcc -Wswitch-default.
3825 * src/scan-gram.l (adjust_location): Use a default: break; case
3826 to pacify gcc -Wswitch-default.
3827 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
3828 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3829 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3830 Move these decls to scan-skel.l, since they don't need to be
3831 visible elsewhere.
3832 * src/scan-skel.l: Accept the above decls.
3833 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
3834 is used.
3835
3836 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
3837
3838 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
3839 since we don't want to insist on a version number at the start
3840 of the changelog every time.
3841 * Makefile.maint: Sync from coreutils a bit better.
3842 (sc_trailing_blank): Renamed from sc_trailing_space.
3843 All uses changed.
3844 (sc_no_if_have_config_h, sc_require_config_h):
3845 (sc_prohibit_assert_without_use): New rules.
3846 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
3847 (sc_dd_max_sym_length): Fix leading spaces in rule.
3848 (sc_system_h_headers): Prefix with @.
3849 (sc_useless_cpp_parens, m4-check): Output line numbers.
3850 (changelog-check): Allow version only in head.
3851 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
3852 satisfy new Makefile.maint rule.
3853 * data/glr.c: Likewise.
3854 * data/glr.cc: Likewise.
3855 * data/lalr1.cc: Likewise.
3856 * data/yacc.c: Likewise.
3857 * lib/ebitsetv.c: Likewise.
3858 * lib/lbitset.c: Likewise.
3859 * lib/subpipe.c: Likewise.
3860 * lib/timevar.c: Likewise.
3861 * src/system.h: Likewise.
3862 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
3863 * djgpp/Makefile.maint: Add copyright notice.
3864 * djgpp/README.in: Likewise.
3865 * djgpp/config.bat: Likewise.
3866 * djgpp/config.site: Likewise.
3867 * djgpp/config_h.sed: Likewise.
3868 * djgpp/djunpack.bat: Likewise.
3869 * djgpp/config.sed: Fix copyright notice to match standard format.
3870 * djgpp/subpipe.h: Likewise.
3871 * lib/bitsetv-print.c: Likewise.
3872 * lib/bitsetv.c: Likewise.
3873 * lib/subpipe.h: Likewise.
3874 * lib/timevar.c: Likewise.
3875 * lib/timevar.h: Likewise.
3876 * djgpp/subpipe.c: Use standard recipe for config.h.
3877 * lib/abitset.c: Likewise.
3878 * lib/bitset.c: Likewise.
3879 * lib/bitset_stats.c: Likewise.
3880 * lib/bitsetv-print.c: Likewise.
3881 * lib/bitsetv.c: Likewise.
3882 * lib/ebitsetv.c: Likewise.
3883 * lib/get-errno.c: Likewise.
3884 * lib/lbitset.c: Likewise.
3885 * lib/subpipe.c: Likewise.
3886 * lib/timevar.c: Likewise.
3887 * lib/vbitset.c: Likewise.
3888 * tests/local.at: Likewise.
3889 * src/scan-gram.l: Don't include verify.h, since system.h does
3890 that for us.
3891 * .x-sc_require_config_h: New file.
3892 * .x-sc_unmarked_diagnostics: New file.
3893
3894 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
3895
3896 Be a bit more systematic about using 'abort'.
3897 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
3898 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
3899 Put 'default: abort ();' before some other case, to satisfy older
3900 pedantic compilers.
3901 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3902 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
3903 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
3904 * src/conflicts.c (resolve_sr_conflict): Likewise.
3905 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
3906 (get_decision_str, get_orientation_str, get_node_alignment_str):
3907 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
3908 (get_linestyle_str, get_arrowstyle_str): Likewise.
3909 * src/conflicts.c (resolve_sr_conflict):
3910 Use a default case rather than one for the one remaining enum
3911 value, to catch invalid enum values as well.
3912 * src/lalr.c (set_goto_map, map_goto):
3913 Prefer "assert (FOO);" to "if (!FOO) abort ();".
3914 * src/nullable.c (nullable_compute, token_definitions_output):
3915 Likewise.
3916 * src/reader.c (packgram, reader): Likewise.
3917 * src/state.c (transitions_to, state_new, state_reduction_find):
3918 Likewise.
3919 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
3920 (symbol_pack): Likewise.
3921 * src/tables.c (conflict_row, pack_vector): Likewise.
3922 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
3923 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
3924 * src/system.h: Don't include <assert.h>.
3925 (assert): New macro.
3926
3927 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
3928 (Destructor Decl, Parser Function, Pure Calling):
3929 Describe rules for braces inside C code more carefully.
3930
3931 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
3932
3933 Fix some porting glitches found by Nelson H. F. Beebe.
3934 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
3935 compilers that don't understand that abort () does not return.
3936 * src/state.c (transitions_to): Likewise.
3937 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3938 that '#include <cstdlib>' works.
3939 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
3940 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
3941 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
3942 for the benefit of some pre-C99 compilers.
3943
3944 * bootstrap: Undo changes to gnulib files that autoreconf made.
3945
3946 Minor fixups to get 'make maintainer-check' to work.
3947 * configure.ac: Don't use -Wnested-externs, as it's incompatible
3948 with the new verify.h implementation.
3949 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
3950 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
3951 * data/yacc.c (YYUSE): Likewise.
3952 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
3953 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
3954 * src/parse-gram.y (declaration): Don't pass a string constant
3955 to a function that expects char *, since GCC might complain
3956 about the constant value.
3957 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
3958 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
3959 before #defining them.
3960 * tests/glr-regression.at
3961 (Incorrectly initialized location for empty right-hand side in GLR):
3962 In yyerror, use the msg arg.
3963 (Corrupted semantic options if user action cuts parse):
3964 (Incorrect lookahead during deterministic GLR):
3965 (Incorrect lookahead during nondeterministic GLR):
3966 Don't name a local var 'index'; it shadows string.h's 'index'.
3967
3968 2006-01-19 Akim Demaille <akim@epita.fr>
3969
3970 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
3971 location, not just parts of it.
3972
3973 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
3974
3975 * NEWS: Document the fact that multiple %unions are now allowed.
3976 * doc/bison.texinfo (Union Decl): Likewise.
3977 * TODO: This feature is now implemented, so remove it from
3978 the wishlist.
3979
3980 * Makefile.maint: Merge with coreutils Makefile.maint.
3981 (CVS_LIST): Use build-aux version if available.
3982 (VERSION_REGEXP): New macro.
3983 (syntax-check-rules): Add sc_no_if_have_config_h,
3984 sc_prohibit_assert_without_use, sc_require_config_h,
3985 sc_useless_cpp_parens.
3986 (sc_obsolete_symbols): Check for O_NDELAY.
3987 (sc_dd_max_sym_length): Track coreutils.
3988 (sc_unmarked_diagnostics): Look in all files, not just *.c.
3989 (sc_useless_cpp_parens): New rule.
3990 (news-date-check): Look for version or today's date.
3991 (changelog-check): Don't require version number near head.
3992 (copyright-check): Use current year instead of hardwiring 2005.
3993 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
3994 (announcement): Add --gpg-key-ID.
3995
3996 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
3997 with "file system".
3998
3999 Avoid undefined behavior that addressed just before the start of an
4000 array. Problem reported by twlevo.
4001 * src/reader.c (packgram): Prepend a new sentinel before ritem.
4002 * src/lalr.c (build_relations): Rely on new sentinel.
4003 * src/gram.c (gram_free): Adjust to new sentinel.
4004
4005 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
4006
4007 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
4008 yylookaheadNeeds. All uses updated.
4009 (yysplitStack): Rename local yynewLookaheadStatuses to
4010 yynewLookaheadNeeds.
4011 * data/glr-regression.at (Incorrect lookahead during nondeterministic
4012 GLR): In comments, change `lookahead status' to `lookahead need'.
4013
4014 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4015
4016 * data/glr.c (yysplitStack): A little stylistic rewrite.
4017
4018 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4019
4020 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
4021
4022 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
4023
4024 * doc/bison.texinfo: Fix some typos.
4025 (GLR Semantic Actions): New subsection discussing special
4026 considerations because GLR semantic actions might be deferred.
4027 (Actions): Mention look-ahead usage of yylval.
4028 (Actions and Locations): Mention look-ahead usage of yylloc.
4029 (Special Features for Use in Actions): Add YYEOF entry and mention it
4030 in the yychar entry.
4031 In the yychar entry, remove mention of the local yychar case (pure
4032 parser) since this is irrelevant information when writing semantic
4033 actions and since it's already discussed in `Table of Symbols' where
4034 yychar is otherwise described as an external variable.
4035 In the yychar entry, don't call it the `current' look-ahead since it
4036 isn't when semantic actions are deferred.
4037 In the yychar and yyclearin entries, add note about deferred semantic
4038 actions.
4039 Add yylloc and yylval entries discussing look-ahead usage.
4040 (Look-Ahead Tokens): When discussing yychar, don't call it the
4041 `current' look-ahead, and do mention yylval and yylloc.
4042 (Error Recovery): Cross-reference `Action Features' when mentioning
4043 yyclearin.
4044 (Table of Symbols): In the yychar entry, don't call it the `current'
4045 look-ahead.
4046 In the yylloc and yylval entries, mention look-ahead usage.
4047
4048 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4049
4050 * tests/glr-regression.at: Update copyright year to 2006.
4051
4052 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4053
4054 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
4055 use during nondeterministic operation to track which stacks have
4056 actually needed the current lookahead.
4057 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
4058 Allocate, deallocate, resize, and otherwise shuffle space for
4059 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
4060 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
4061 appropriately during nondeterministic operation.
4062 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
4063 members to store the current lookahead to be used by the deferred
4064 user action.
4065 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
4066 from which the RHS is taken. Set the lookahead members of the new
4067 yySemanticOption according to the lookahead status for stack yyk.
4068 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
4069 yyaddDeferredAction.
4070 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
4071 members of yySemanticOption before invoking yyuserAction, and then set
4072 them back to their current values afterward.
4073 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
4074 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
4075 * tests/glr-regression.at: Remove `.' from the ends of recent test case
4076 titles for consistency.
4077 (Leaked merged semantic value if user action cuts parse): In order to
4078 suppress lint warnings, use arguments in merge function, and assign
4079 char value < 128 in main.
4080 (Incorrect lookahead during deterministic GLR): New test case.
4081 (Incorrect lookahead during nondeterministic GLR): New test case.
4082
4083 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4084
4085 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
4086 !yyvaluep as signal that no semantic value is available to print.
4087 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
4088 to print a semantic value.
4089
4090 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4091
4092 * tests/glr-regression.at: For consistency with my newer test cases,
4093 don't thank myself.
4094
4095 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4096
4097 * data/glr.c (yyresolveValue): When merging semantic options, if at
4098 least one user action succeeds but a later one cuts the parse, then
4099 destroy the semantic value before returning rather than leaking it.
4100 (yyresolveStates): If a user action cuts the parse and thus
4101 yyresolveValue fails, ignore the (unset) semantic value rather than
4102 corrupting the yyGLRState, and empty the semantic options list since
4103 the user actions should have called all necessary destructors.
4104 Simplify code with YYCHK.
4105 * tests/glr-regression.at (Corrupted semantic options if user action
4106 cuts parse): New test case.
4107 (Undesirable destructors if user action cuts parse): New test case.
4108 Before applying any of this patch, this test case never actually failed
4109 for me... but only because the corrupted semantic options usually
4110 masked this bug.
4111 (Leaked merged semantic value if user action cuts parse): New test
4112 case.
4113
4114 2006-01-05 Akim Demaille <akim@epita.fr>
4115
4116 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
4117
4118 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
4119
4120 * data/c.m4 (b4_c_modern): New macro, with a new provision for
4121 _MSC_VER. Problem reported by Cenzato Marco.
4122 (b4_c_function_def): Use it.
4123 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
4124 b4_c_modern.
4125 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
4126 than rolling our own.
4127
4128 2006-01-04 Akim Demaille <akim@epita.fr>
4129
4130 Also warn about non-used mid-rule values.
4131 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
4132 member.
4133 (symbol_list_new): Adjust.
4134 * src/reader.c (symbol_typed_p): New.
4135 (grammar_rule_check): Use it.
4136 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
4137 Check its rule.
4138 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
4139 Use it.
4140 * tests/actions.at (Exotic Dollars): Adjust.
4141
4142 2006-01-04 Akim Demaille <akim@epita.fr>
4143
4144 * src/reader.c (grammar_midrule_action): If $$ is set in a
4145 mid-rule, move the `used' bit to its lhs.
4146 * tests/input.at (Unused values): New.
4147 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
4148
4149 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
4150
4151 * doc/bison.texinfo (Bison Options): Say more accurately what
4152 --yacc does.
4153 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
4154 about declarations in the grammar when in Yacc mode, as POSIX does
4155 not require a diagnostic when the grammar uses extensions.
4156
4157 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
4158
4159 Warn about dubious constructions like "%token T T".
4160 Reported by twlevo.
4161 * src/symtab.h (struct symbol.declared): New member.
4162 * src/symtab.c (symbol_new): Initialize it to false.
4163 (symbol_class_set): New arg DECLARING, specifying whether
4164 this is a declaration that we want to warn about, if there
4165 is more than one of them. All uses changed.
4166
4167 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
4168 Allow multiple %union directives, whose contents concatenate.
4169 * src/parse-gram.y (grammar_declaration): Likewise.
4170 Use muscle_code_grow, so that we don't need stype_line any more.
4171 All uses changed.
4172
4173 * src/muscle_tab.c (muscle_grow): Fix comment.
4174
4175 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
4176 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
4177 Update copyright year to 2006.
4178
4179 2006-01-03 Akim Demaille <akim@epita.fr>
4180
4181 Have glr.cc pass (some of) the calc.at tests.
4182 * data/glr.cc (b4_parse_param_orig): New.
4183 (b4_parse_param): Improve its definition, and bound it more
4184 clearly in the skeleton.
4185 (b4_epilogue): Append, instead of prepending, in order to keep
4186 #line consistency.
4187 Simplify the generation of auxiliary functions: locations and
4188 purity are mandated.
4189 (b4_global_tokens_and_yystype): Honor it.
4190 * data/location.cc (c++.m4): Don't include it.
4191 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
4192 and AT_SKEL_CC_IF.
4193 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
4194 AT_LALR1_CC_IF.
4195 Be sure to initialize the first position's filename.
4196 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
4197 mandated anyway.
4198 (AT_CHECK_CALC_GLR_CC): New.
4199 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
4200
4201 2006-01-02 Akim Demaille <akim@epita.fr>
4202
4203 * src/output.c (output_skeleton): Don't hard wire the inclusion of
4204 c.m4.
4205 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
4206 * data/glr.cc: Do not include stack.hh.
4207
4208 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4209
4210 * data/glr.c: Reformat whitespace with tabs.
4211 (b4_lpure_formals): Remove this unused m4 macro.
4212 * tests/cxx-type.at: Reformat whitespace with tabs.
4213 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
4214 since it's a member. Rename type to isNterm for clarity.
4215
4216 2005-12-29 Akim <akim@sulaco.local>
4217
4218 Let glr.cc catch up with symbol_value_print.
4219 * data/glr.cc (b4_yysymprint_generate): Replace by...
4220 (b4_yy_symbol_print_generate): this.
4221 (yy_symbol_print, yy_symbol_value_print): Declare them.
4222
4223 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
4224
4225 * src/location.h (boundary): Note that a line or column equal
4226 to INT_MAX indicates an overflow.
4227 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
4228 (rule_length_overflow, increment_rule_length, add_column_width):
4229 New functions.
4230 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
4231 (<SC_BRACED_CODE>"}"):
4232 Use increment_rule_length rather than incrementing it by hand.
4233 (adjust_location, handle_syncline): Diagnose overflow.
4234 (handle_action_dollar, handle_action_at):
4235 Fix bug with monstrosities like $-2147483648.
4236 Remove now-unnecessary checks.
4237 (scan_integer): Verify assumptions and remove now-unnecessary checks.
4238 (convert_ucn_to_byte): Verify assumptions.
4239 (handle_syncline): New arg LOC. All callers changed.
4240 Don't store through a value derived from char const * pointer.
4241
4242 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
4243 GCC warnings.
4244
4245 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
4246
4247 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
4248 Remove unnecessary forward static decls.
4249
4250 2005-12-27 Akim Demaille <akim@epita.fr>
4251
4252 * src/reader.c (grammar_current_rule_check): Also check that $$
4253 is used.
4254 Take the rule to check as argument, hence rename as...
4255 (grammar_rule_check): this.
4256 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
4257 Rename as...
4258 (grammar_rule_begin, grammar_rule_end): these, for consistency.
4259 (grammar_midrule_action, grammar_symbol_append): Now static.
4260 * tests/torture.at (input): Don't rely on the default action
4261 being always performed.
4262 * tests/calc.at: "Set" $$ even when the action is "cut" with
4263 YYERROR or other.
4264 * tests/actions.at (Exotic Dollars): Instead of using unused
4265 values, check that the warning is issued.
4266
4267 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
4268
4269 * NEWS: Improve wording for unused-value warnings.
4270
4271 2005-12-22 Akim Demaille <akim@epita.fr>
4272
4273 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
4274 (b4_yysymprint_generate): Rename as...
4275 (b4_yy_symbol_print_generate): this.
4276 Generate yy_symbol_print instead of yysymprint.
4277 Generate also yy_symbol_value_print, and use it.
4278
4279 2005-12-22 Akim Demaille <akim@epita.fr>
4280
4281 * NEWS: Warn about unused values.
4282 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
4283 a `used' member.
4284 (symbol_list_n_get, symbol_list_n_used_set): New.
4285 (symbol_list_n_type_name_get): Use symbol_list_n_get.
4286 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
4287 * src/reader.c (grammar_current_rule_check): Check that values are
4288 used.
4289 * src/symtab.c (symbol_print): Accept 0.
4290 * tests/existing.at: Remove the type information.
4291 Empty the actions.
4292 Remove useless actions (beware of mid-rule actions: perl -000
4293 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
4294 * tests/actions.at (Exotic Dollars): Use unused values.
4295 * tests/calc.at: Likewise.
4296 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4297 Likewise.
4298
4299 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
4300 rule_useful_p.
4301
4302 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
4303
4304 Undo 2005-12-01 tentative license wording change. The wording is
4305 still being reviewed by the lawyers, and we don't want to wait for
4306 them before publishing a test release. For now, revert to the
4307 previous wording.
4308 * NEWS: Undo 2005-12-01 change.
4309 * data/glr.c: Revert to previous license wording.
4310 * data/glr.cc: Likewise.
4311 * data/lalr1.cc: Likewise.
4312 * data/location.cc: Likewise.
4313 * data/yacc.c: Likewise.
4314
4315 * NEWS: Reword %destructor vs YYABORT etc.
4316 * data/glr.c: Use American spacing, for consistency.
4317 * data/glr.cc: Likewise.
4318 * data/lalr1.cc: Likewise.
4319 * data/yacc.c: Likewise.
4320 * data/yacc.c: Reformat comments slightly.
4321 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
4322 for consistency. Fix some spelling errors and reword recently-included
4323 text slightly.
4324 * tests/cxx-type.at: Cast results of malloc, for C++.
4325
4326 2005-12-21 Joel E. Denny <address@hidden>
4327
4328 * tests/cxx-type.at: Construct a tree, count the parents of shared
4329 nodes, and free each node once and only once. Previously, the memory
4330 for semantic values was leaked instead.
4331
4332 2005-12-21 Joel E. Denny <address@hidden>
4333
4334 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
4335 (yylval, yylloc): If pure, #define to yystackp->yyval and
4336 yystackp->yyloc similar to yychar and yynerrs.
4337 (yyparse): If pure, remove local yylval and yylloc. Add local
4338 yystackp to accommodate pure definitions of yylval and yylloc.
4339 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
4340 yylvalp and yyllocp to &yylval and &yylloc.
4341 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
4342 namespace. Previously, nerrs and char were missing, but lval and lloc
4343 weren't necessary.
4344 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
4345 yylvalp and yyllocp parameters since, if pure, these are now always
4346 accessible through yystackp. If not pure, they are still accessible
4347 globally.
4348 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
4349 `if (YYID (N))' to pacify lint.
4350
4351 2005-12-21 Akim Demaille <akim@epita.fr>
4352
4353 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
4354 destroy the RHS symbols of a rule.
4355 * data/yacc.c (yylen): Initialize to 0.
4356 Keep its value to the number of items to possibly shift.
4357 In particular, a regular successful parse that ends on YYFINAL by
4358 a (internal) YYACCEPT must not have yylen != 0.
4359 (yyerrorlab, yyreturn): Pop the RHS.
4360 Reorder a bit to emphasize the `shifting' bits of code.
4361 (YYPOPSTACK): Now accept a number of items to pop.
4362 * data/lalr1.cc: Likewise.
4363 * data/glr.c: Formatting changes.
4364 Use goto instead of fall through.
4365 * doc/bison.texinfo (Destructor Decl): Complete.
4366
4367 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4368
4369 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4370 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
4371 * djgpp/config.bat: Replace every occurence of the file name
4372 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4373 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4374 * djgpp/config.sed: Replace every occurence of the file name
4375 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4376 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4377 * djgpp/djunpack.bat: DJGPP specific file.
4378 * djgpp/fnchange.lst: DJGPP specific file.
4379 * djgpp/README.in: Add new information about how to unpack the bison
4380 source on MSDOS and other systems which have 8.3 file name restrictions
4381 using djunpack.bat and fnchange.lst.
4382
4383 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
4384
4385 * bootstrap (build_cvs_prefix): Remove; unused.
4386 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
4387 when getting gnulib.
4388
4389 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
4390
4391 * data/glr.c: Reorder typedef declarations for structs to match order
4392 of struct declarations.
4393 Rename yystack everywhere to yystackp except in yyparse where it's not
4394 a pointer.
4395 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
4396 consistency.
4397 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
4398 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
4399 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
4400 lint.
4401
4402 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
4403
4404 * tests/sets.at (Accept): Fix typos in regular expression used to
4405 sed out the final state number.
4406
4407 Work around portability problem on Solaris 10: flex-generated
4408 files include <stdio.h> before <config.h>, which messes up
4409 because the latter defines __EXTENSIONS__. Address the problem
4410 by creating two new little files that include <config.h> first,
4411 then include the flex-generated files. Rewrite everyone else
4412 to include <config.h> first, as well.
4413 * lib/timevar.c: Always include "config.h".
4414 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
4415 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
4416 (EXTRA_bison_SOURCES): New macro.
4417 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
4418 * src/system.h: Don't include config.h.
4419 * src/LR0.c: Include <config.h> first.
4420 * src/assoc.c: Likewise.
4421 * src/closure.c: Likewise.
4422 * src/complain.c: Likewise.
4423 * src/conflicts.c: Likewise.
4424 * src/derives.c: Likewise.
4425 * src/files.c: Likewise.
4426 * src/getargs.c: Likewise.
4427 * src/gram.c: Likewise.
4428 * src/lalr.c: Likewise.
4429 * src/location.c: Likewise.
4430 * src/main.c: Likewise.
4431 * src/muscle_tab.c: Likewise.
4432 * src/nullable.c: Likewise.
4433 * src/output.c: Likewise.
4434 * src/parse-gram.y: Likewise.
4435 * src/print.c: Likewise.
4436 * src/print_graph.c: Likewise.
4437 * src/reader.c: Likewise.
4438 * src/reduce.c: Likewise.
4439 * src/relation.c: Likewise.
4440 * src/state.c: Likewise.
4441 * src/symlist.c: Likewise.
4442 * src/symtab.c: Likewise.
4443 * src/tables.c: Likewise.
4444 * src/uniqstr.c: Likewise.
4445 * src/vcg.c: Likewise.
4446
4447 * src/parse-gram.y: Fix minor problems uncovered by lint.
4448 (current_lhs, current_lhs_location): Now static.
4449 (current_assoc): Remove unused variable.
4450
4451 Cleanups so that Bison-generated parsers have less lint.
4452 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
4453 Prepend /*ARGSUSED*/, for lint's sake.
4454 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
4455 definition if 'lint' is defined.
4456 (YYID): New macro (or function, if lint).
4457 All uses of /*CONSTCOND*/0 replaced by YYID(0).
4458 * data/yacc.c: Likewise.
4459 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
4460 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
4461 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
4462 is C++ only.
4463 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
4464 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
4465 Use YYID(0) rather than 0, for lint.
4466 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
4467 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
4468
4469 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
4470
4471 * tests/glr-regression.at
4472 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4473 Close memory leak reported by twlevo.
4474
4475 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
4476
4477 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
4478 all stacks.
4479 (yyparse): Iterate another stack in order to call user destructors.
4480 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4481 New test case.
4482 (Duplicated user destructor for lookahead): This test now is expected
4483 to succeed.
4484
4485 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
4486
4487 * NEWS: Document the following change.
4488 * data/yacc.c: Say "parser skeleton" rather than "file", since
4489 it's no longer just a file.
4490 * data/glr.c: Grant a special exception for C GLR parsers, that
4491 reads like the already-existing exception for C LALR(1) parsers.
4492 * data/glr.cc: Likewise.
4493 * data/lalr1.cc: Likewise.
4494 * data/location.cc: Likewise.
4495 * data/yacc.c: Reword the "written by" statement to clarify that
4496 it was the parser skeleton, not the entire output file.
4497 * data/glr.c: Written by Paul Hilfinger.
4498 * data/glr.cc: Written by Akim Demaille.
4499 * data/lalr1.cc: Likewise.
4500
4501 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
4502
4503 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
4504 Fix typos in previous change that broke 'make check'.
4505 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
4506 supported in C.
4507 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
4508 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
4509 We can revert this once things settle down.
4510
4511 * src/conflicts.c (conflicts_print): Don't print file name twice
4512 when %expect fails because there were no conflicts.
4513 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
4514 change.
4515 * tests/conflicts.at (%expect not enough, %expect too much):
4516 (%expect with reduce conflicts): Adjust to new behavior.
4517
4518 2005-11-18 Akim Demaille <akim@epita.fr>
4519
4520 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
4521 errors.
4522 * NEWS: Document this.
4523 * doc/bison.texinfo (Expect Decl): Likewise.
4524
4525 2005-11-16 Akim Demaille <akim@epita.fr>
4526
4527 Generalize the display of semantic values and locations in traces.
4528 * data/glr.c (yy_reduce_print): Fix indices (again).
4529 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
4530 literal integers.
4531 * data/lalr1.cc (yyreduce_print): Rename as...
4532 (yy_reduce_print): this.
4533 Display values and locations.
4534 * data/yacc.c (yy_reduce_print): Likewise.
4535 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
4536 (yysymprint): Move higher to be visible from yy_reduce_print).
4537 (yyparse): Adjust.
4538 * tests/calc.at: Adjust the expected length of the traces.
4539
4540 2005-11-14 Akim Demaille <akim@epita.fr>
4541
4542 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
4543 from 1 to N, while values and location start at 0.
4544 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
4545
4546 2005-11-14 Akim Demaille <akim@epita.fr>
4547
4548 * data/glr.c (yy_reduce_print): Fix the $ number.
4549
4550 2005-11-14 Akim Demaille <akim@epita.fr>
4551
4552 "Use" parse parameters.
4553 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
4554 * data/glr.c, data/glr.cc: Use them.
4555 * data/glr.c (YYUSE): Have a C++ definition that supports
4556 non-pointer types.
4557
4558 2005-11-14 Akim Demaille <akim@epita.fr>
4559
4560 * data/glr.c (yyexpandGLRStack): Declare only if defined.
4561
4562 2005-11-14 Akim Demaille <akim@epita.fr>
4563
4564 * data/glr.cc: New.
4565 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
4566
4567 2005-11-12 Akim Demaille <akim@epita.fr>
4568
4569 Let position and location be PODs.
4570 * data/location.cc (position::initialize, location::initialize): New.
4571 (position::position, location::location): Define only if
4572 b4_location_constructors is defined.
4573 * data/lalr1.cc (b4_location_constructors): Define it for backward
4574 compatibility.
4575 * doc/bison.texinfo (Initial Action Decl): Use initialize.
4576
4577 2005-11-12 Akim Demaille <akim@epita.fr>
4578
4579 * data/lalr1.cc: Move the body of the ctor and dtor into the
4580 parser file (instead of the header).
4581 Wrap the implementations in a "namespace yy".
4582
4583 2005-11-12 Akim Demaille <akim@epita.fr>
4584
4585 Have glr.c include its header file when created.
4586 * data/glr.c (b4_shared_declarations): New.
4587 Output them verbatim in the parser if !%defines, otherwise
4588 output then in the header file, and include it instead.
4589
4590 2005-11-11 Akim Demaille <akim@epita.fr>
4591
4592 * data/glr.c: Comment changes.
4593
4594 2005-11-11 Akim Demaille <akim@epita.fr>
4595
4596 When yydebug, report semantic and location values for reductions.
4597 * data/glr.c (yy_reduce_print): Report the semantic values and the
4598 locations.
4599 (YY_REDUCE_PRINT): Adjust.
4600 (yyglrReduce): Use them.
4601 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
4602 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
4603 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
4604 traces.
4605
4606 2005-11-10 Akim Demaille <akim@epita.fr>
4607
4608 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
4609 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
4610 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
4611
4612 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
4613
4614 * m4/cxx.m4, examples/Makefile.am: Don't build
4615 examples/calc++ if no C++ compiler is available. (trivial change)
4616
4617 2005-11-09 Akim Demaille <akim@epita.fr>
4618
4619 * src/scan-skel.l: Use a couple of asserts.
4620
4621 2005-11-03 Akim Demaille <akim@epita.fr>
4622
4623 In some (weird) cases, the final state number is incorrect.
4624 Reported by Alexandre Duret-Lutz.
4625 * src/LR0.c (state_list_append): Remove the computation of
4626 final_state.
4627 (save_reductions): Do it here.
4628 (get_state): Alpha conversion.
4629 (generate_states): Use a for loop.
4630 * src/gram.h (item_number_is_rule_number)
4631 (item_number_is_symbol_number): New.
4632 * src/state.c: Use assert.
4633 * src/system.h: Include assert.h.
4634 * tests/sets.at (Accept): New.
4635
4636 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4637
4638 * data/glr.c (yyfill): Adjust comment.
4639 (yyresolveAction): Initialize default location properly
4640 for empty right-hand sides.
4641 (yydoAction): Ditto.
4642 Add comment explaining apparently dead code.
4643 * tests/glr-regression.at
4644 (Incorrectly initialized location for empty right-hand side in GLR):
4645 New test.
4646
4647 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
4648
4649 * bootstrap (cleanup_gnulib): New function. Use it to clean up
4650 gnulib when interrupted. This fixes some race conditions and
4651 works around some portability problems (one noted by Paul
4652 Hilfinger).
4653
4654 2005-10-22 Akim <akim@epita.fr>
4655
4656 * Makefile.cfg: Adjust to config -> build-aux.
4657 Reported by twledo.
4658
4659 2005-10-21 Akim Demaille <akim@epita.fr>
4660
4661 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
4662 the %parse-params.
4663 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
4664 * data/yacc.c (b4_Pure_if): Rename as...
4665 (b4_yacc_pure_if): this.
4666 (YY_SYMBOL_PRINT, yyparse): Adjust.
4667 * doc/bison.texinfo: Formatting changes.
4668
4669 2005-10-21 Akim Demaille <akim@epita.fr>
4670
4671 Finish the transition config -> build-aux.
4672 * configure.ac, Makefile.am: Use build-aux.
4673 * config/prev-version, config/announce-gen, config/Makefile.am:
4674 Move to...
4675 * build-aux/prev-version, build-aux/announce-gen,
4676 * build-aux/Makefile.am: here.
4677
4678 2005-10-14 Akim Demaille <akim@epita.fr>
4679
4680 * examples/calc++/test: Use set -x only when VERBOSE.
4681
4682 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
4683
4684 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
4685 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
4686
4687 2005-10-13 Akim Demaille <akim@epita.fr>
4688
4689 * src/scan-skel.l: Output the base name parts of the parser and
4690 header file names.
4691 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
4692 additional checks.
4693 Use this to exercise C++ outputs in subdirs.
4694 Reported by Oleg Smolsky.
4695
4696 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
4697
4698 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
4699 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
4700 Problem reported by John P. Hartmann.
4701 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
4702 already defined it.
4703
4704 2005-10-12 Akim Demaille <akim@epita.fr>
4705
4706 * src/parse-gram.y (version_check): Exit 63 to please missing
4707 (stands for "version mismatch).
4708 * tests/input.at, doc/bison.texinfo: Adjust.
4709
4710 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
4711
4712 Work around portability problems with Visual Age C compiler
4713 (xlc and xlC_r) reported by John P. Hartmann.
4714 * data/location.cc (initial_column, initial_line): Remove.
4715 All uses replaced by 0 and 1.
4716 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
4717 that xlc complains about.
4718 * src/scan-skel.l (skel_wrap): Likewise.
4719 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
4720 as __STDC__.
4721 * data/yacc.c (YYMODERN_C): New macro, which also looks at
4722 __STDC_VERSION__. Use it everywhere instead of looking at
4723 __STDC__ and __cplusplus.
4724
4725 2005-10-10 Akim Demaille <akim@epita.fr>
4726
4727 * examples/calc++/test: Be quiet unless VERBOSE.
4728
4729 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
4730
4731 * data/c.m4 (yydestruct, yysymprint):
4732 Use YYUSE instead of casting to void.
4733 * data/glr.c (YYUSE): New macro.
4734 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4735 Use it instead of rolling our own.
4736 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4737 (YYCHK1):
4738 Use /*CONSTCOND*/ to suppress lint warnings.
4739 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4740 (YY_STACK_PRINT): Use 'false' not '0'.
4741 (YYUSE): New macro.
4742 (yysymprint_, yydestruct_): Use it instead of rolling our own.
4743 * data/yacc.c (YYUSE): New macro.
4744 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
4745 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
4746 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
4747
4748
4749 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
4750 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
4751
4752 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
4753
4754 Undo the parts of the unlocked-I/O change that substituted
4755 putc or puts for printf. This might hurt performance a bit,
4756 but some people prefer the printf style.
4757 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
4758 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
4759 All uses replaced by YYFPRINTF and YYDPRINTF.
4760 * data/yacc.c: Likewise.
4761 * lib/bitset.c (bitset_print): Likewise.
4762 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
4763 putc and puts.
4764 * lib/lbitset.c (debug_lbitset): Likewise.
4765 * src/closure.c (print_firsts, print_fderives): Likewise.
4766 * src/gram.c (grammar_dump): Likewise.
4767 * src/lalr.c (look_ahead_tokens_print): Likewise.
4768 * src/output.c (escaped_output): Likewise.
4769 (user_actions_output): Break apart two printfs.
4770 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
4771 * src/reduce.c (reduce_print): Likewise.
4772 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4773 * src/system.h: Include unlocked-io.h rathe than stdio.h.
4774
4775 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4776 Use assignments rather than casts-to-void to suppress
4777 unused-variable warnings. This pacifies 'lint'.
4778 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
4779 unused-variable warnings.
4780
4781 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4782
4783 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4784
4785 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
4786
4787 Use unlocked I/O for a minor performance improvement on hosts like
4788 GNU/Linux and Solaris that support unlocked I/O. The basic idea
4789 is to use the gnlib unlocked-io module, and to prefer putc and
4790 puts to printf when either will work (since the latter doesn't
4791 come in an unlocked flavor).
4792 * bootstrap (gnulib_modules): Add unlocked-io.
4793 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
4794 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
4795 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
4796 and similarly for puts and putc and printf.
4797 * data/yacc.c: Likewise.
4798 * lib/bitset.c (bitset_print): Likewise.
4799 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
4800 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
4801 to printf.
4802 * lib/lbitset.c (debug_lbitset): Likewise.
4803 * src/closure.c (print_firsts, print_fderives): Likewise.
4804 * src/gram.c (grammar_dump): Likewise.
4805 * src/lalr.c (look_ahead_tokens_print): Likewise.
4806 * src/output.c (escaped_output): Likewise.
4807 (user_actions_output): Coalesce two printfs.
4808 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
4809 * src/reduce.c (reduce_print): Likewise.
4810 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4811 * src/system.h: Include unlocked-io.h rather than stdio.h.
4812
4813 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
4814 this confuses xgettext.
4815
4816 2005-10-02 Akim Demaille <akim@epita.fr>
4817
4818 * bootstrap (gnulib_modules): Add strverscmp.
4819 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
4820 * m4/.cvsignore: Add strverscmp.m4.
4821 * src/parse-gram.y (%require): New token, new rule.
4822 (version_check): New.
4823 * src/scan-gram.l (%require): Adjust.
4824 * tests/input.at (AT_REQUIRE): New.
4825 Use it.
4826 * doc/bison.texinfo (Require Decl): New.
4827 (Calc++ Parser): Use %require.
4828
4829 2005-10-02 Akim Demaille <akim@epita.fr>
4830
4831 * data/location.cc: New.
4832
4833 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
4834 Akim Demaille <akim@epita.fr>
4835
4836 Make sure -odir/foo.cc creates dir/location.hh etc.
4837 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
4838 (spec_file_prefix, spec_verbose_file, spec_graph_file)
4839 (spec_defines_file): Now const.
4840 (dir_prefix): New.
4841 (short_base_name): Remove.
4842 * src/files.c: Adjust.
4843 (dirname.h): Include.
4844 (base_name): Don't prototype it.
4845 (finput): Remove, duplicates gram_in.
4846 (full_base_name, short_base_name): Replace by...
4847 (all_but_ext, all_but_tab_ext): these.
4848 (compute_base_names): Rename as...
4849 (compute_file_name_parts): this.
4850 Update to compute the new variables, including dir_prefix.
4851 Adjust dependencies.
4852 * src/output.c (prepare): Output them.
4853 * src/reader.c: Adjust to use gram_in, not finput.
4854 * src/scan-skel.l (@dir_prefix@): New.
4855
4856 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4857
4858 * lib/subpipe.c: New function end_of_output_subpipe() added
4859 to allow support for non-posix systems. This is a no-op function
4860 for posix systems.
4861
4862 * lib/subpipe.h: New function end_of_output_subpipe() added
4863 to allow support for non-posix systems. This is a no-op function
4864 for posix systems.
4865
4866 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
4867 handle the lack of pipe/fork functionality on non-posix systems.
4868
4869 * djgpp/Makefile.maint: DJGPP specific file.
4870
4871 * djgpp/README.in: DJGPP specific file.
4872
4873 * djgpp/config.bat: DJGPP specific configuration file.
4874
4875 * djgpp/config.sed: DJGPP specific configuration file.
4876
4877 * djgpp/config.site: DJGPP specific configuration file.
4878
4879 * djgpp/config_h.sed: DJGPP specific configuration file.
4880
4881 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
4882
4883 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
4884
4885 2005-10-02 Akim Demaille <akim@epita.fr>
4886
4887 * data/location.cc: New, extract from...
4888 * data/lalr1.cc: here.
4889 (location.hh): Include it after the user prologue, in case the
4890 filename type is defined by the user.
4891 Forward declation location and position before the pre-prologue.
4892 (yyresult_): Rename as...
4893 (yyresult): this, it's a local variable, not an attribute.
4894 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
4895
4896 2005-10-01 Akim Demaille <akim@epita.fr>
4897
4898 * examples/extexi: Restore the #line generation.
4899
4900 2005-09-30 Akim Demaille <akim@epita.fr>,
4901 Alexandre Duret-Lutz <adl@gnu.org>
4902
4903 Move the token type and YYSTYPE in the parser class.
4904 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
4905 (parser::token): New, from the moved free definition of tokens.
4906 (parser::semantic_value): Now a full definition instead of an
4907 indirection to YYSTYPE.
4908 (b4_post_prologue): No longer included in the header file, but
4909 in the implementation file.
4910 * doc/bison.texi (C+ Language Interface): Update.
4911 * src/parse-gram.y: Support unary %define.
4912 * tests/actions.at: Define global_tokens_and_yystype for backward
4913 compatibility until we update the tests.
4914 * tests/calc.at: Idem.
4915 (first_line, first_column, last_line, last_column): Define for lalr1.cc
4916 to simplify the code.
4917
4918 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
4919
4920 Port to SunOS 4.1.4, which lacks strtoul and strerror.
4921 Ah, the good old days! Problem reported by Peter Klein.
4922 * bootstrap (gnulib_modules): Add strerror, strtoul.
4923 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
4924 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
4925
4926 2005-09-29 Akim Demaille <akim@epita.fr>
4927
4928 * data/c.m4 (b4_error_verbose_if): New.
4929 * data/lalr1.cc: Use it.
4930 (YYERROR_VERBOSE_IF): Remove.
4931 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
4932 parser members, replaced by...
4933 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
4934 local variables.
4935 (yysyntax_error_): Takes the state number as argument.
4936 (yyreduce_print_): Use the argument yyrule, not the former
4937 attribute yyn_.
4938
4939 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
4940
4941 * bootstrap (gnulib_modules): Add verify.
4942 * lib/.cvsignore: Add verify.h.
4943 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
4944 * src/system.h (verify): Remove.
4945 Include verify.h instead.
4946 * src/tables.c (tables_generate): Use new API for 'verify'.
4947
4948 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
4949
4950 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
4951 local variables whose names begin with 'yy'.
4952 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4953 Trivial changes from Joel E. Denny.
4954
4955 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
4956 it itself.
4957 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
4958 don't use alloca any more.
4959
4960 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
4961 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
4962 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
4963 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
4964 to match yacc.c, to test more hosts.
4965
4966 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
4967
4968 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
4969 doesn't affect behavior.
4970 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
4971 Solaris, AIX, MSC.
4972 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
4973 This works a bit better with glibc, if user code has already included
4974 stdlib.h.
4975 * doc/bison.texinfo (Bison Parser): Document that users can't
4976 arbitrarily use malloc and free for other purposes. Document
4977 that <alloca.h> and <malloc.h> might be included.
4978 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
4979 user must declare alloca.
4980
4981 * HACKING (release): Forwarn the Translation Project about
4982 stable releses.
4983
4984 2005-09-20 Akim Demaille <akim@epita.fr>
4985
4986 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
4987
4988 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
4989
4990 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
4991 (YYSTACK_ALLOC_MAXIMUM): Use it.
4992 (yysyntax_error): New function.
4993 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
4994 multiple syntax errors are reported, and alloca is being used.
4995 Instead, reallocate buffers twice as big each time, so that
4996 we waste at most half the allocated memory. Start with a small
4997 (128-byte) buffer that will suffice in most cases anyway.
4998 Use yysyntax_error to do most of the work.
4999
5000 * doc/bison.texinfo (Error Reporting, Table of Symbols):
5001 yynerrs is the number of errors reported, not the number of
5002 errors encountered.
5003
5004 * tests/glr-regression.at (Duplicated user destructor for lookahead):
5005 Mark it as expected to fail.
5006 Cast result of malloc; problem reported by twlevo@xs4all.nl.
5007 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
5008 Don't start user-code symbols with "yy", to avoid name space problems.
5009
5010 2005-09-19 Akim Demaille <akim@epita.fr>
5011
5012 Remove the traits, failed experiment.
5013 It never proved useful, and anyway because of the current
5014 definition, it was not possible to have several specialization of
5015 this traits, making it useless.
5016 * data/lalr1.cc (yy:traits): Remove.
5017 Inline its definitions in the parser class.
5018
5019 2005-09-19 Akim Demaille <akim@epita.fr>
5020
5021 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
5022 least Mac OSX with a /usr/local install of gettext.
5023
5024 2005-09-19 Akim Demaille <akim@epita.fr>
5025
5026 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
5027 and yytoken for similarity with the other skeletons.
5028
5029 2005-09-19 Akim Demaille <akim@epita.fr>
5030
5031 * NEWS, configure.ac: update version number to 2.1a.
5032
5033 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
5034
5035 * NEWS: Version 2.1.
5036
5037 * NEWS: Remove notice of yytname change, since it was never in an
5038 official release.
5039 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
5040 diagnostic.
5041 * src/output.c (prepare): Likewise.
5042 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
5043 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
5044 is not defined. This is an awful hack, but it's enough for now.
5045 All callers changed.
5046 * tests/glr-regression-at (make_value): Args are const pointers now,
5047 to avoid GCC warning.
5048 (Duplicated user destructor for lookahead): New test. Currently
5049 skipped. It fails on my host but I'm not sure it'll always fail.
5050
5051 2005-09-16 Akim Demaille <akim@epita.fr>
5052
5053 * src/symtab.h (struct symbol): Declare the printer and destructor
5054 as const, to avoid accidental calls to free.
5055 (symbol_destructor_set, symbol_printer_set): Adjust.
5056 * src/symtab.c: Adjust.
5057
5058 2005-09-16 Akim Demaille <akim@epita.fr>
5059
5060 * data/c.m4 (b4_token_enums): New.
5061 (b4_token_defines): Rename as...
5062 (b4_token_enums_defines): this.
5063 (b4_token_defines): New, output only the #defines.
5064 * data/yacc.c, data/glr.c: Adjust.
5065 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
5066 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
5067 as default values.
5068
5069 2005-09-16 Akim Demaille <akim@epita.fr>
5070
5071 * data/lalr1.cc (yylex_): Remove, inline its code.
5072 (yyreport_syntax_error_): Remove, replaced by...
5073 (yysyntax_error_): this which returns a string and leaves to the
5074 caller the call to the users' error function.
5075 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
5076 Move from members of the parser object...
5077 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
5078 to local variables of the parse function.
5079
5080 2005-09-16 Akim Demaille <akim@epita.fr>
5081
5082 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
5083 since it's in Bison's name space.
5084
5085 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
5086
5087 * data/glr.c (yyresolveValue): Add default case to pacify
5088 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
5089
5090 * NEWS: Document when yyparse started to return 2.
5091 * doc/bison.texinfo (Parser Function): Document when yyparse
5092 returns 2.
5093
5094 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
5095 (b4_filename_type): Renamed back from b4_file_name_type. All uses
5096 changed.
5097 (class position): file_name -> filename (reverting). All uses changed.
5098
5099 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
5100
5101 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
5102 do anything if $@ exists. This reverts part of the 2005-07-07
5103 patch.
5104
5105 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
5106
5107 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
5108 contains obsolete information and isn't worth distributing as a
5109 separate file anyway.
5110 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
5111 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
5112 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
5113 (yyparse): Abort if user code uses longjmp to throw an unexpected
5114 value.
5115
5116 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
5117
5118 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
5119 Suggested by twlevo@xs4all.nl.
5120
5121 * data/glr.c (YYCHK1): Do not assume YYE is in range.
5122 This avoids a diagnostic from gcc -Wswitch-enum.
5123 Problem reported by twlevo@xs4all.nl.
5124
5125 * doc/bison.texinfo: Don't use "filename", as per GNU coding
5126 standards. Use "file name" or "file" or "name", depending on
5127 the context.
5128 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
5129 not to hack/foo.tab.c.
5130 (Calc++ Top Level): 2nd arg of main is not const.
5131 * data/glr.c: b4_filename -> b4_file_name.
5132 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
5133 All uses changed.
5134 (class position): filename -> file_name. All uses changed.
5135 * data/yacc.c: b4_filename -> b4_file_name.
5136 * lib/bitset.h: filename -> file_name in local vars.
5137 * lib/bitset_stats.c: Likewise.
5138 * src/files.c: Likewise.
5139 * src/scan-skel.l ("@output ".*\n): Likewise.
5140 * src/files.c (file_name_split): Renamed from filename_split.
5141 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
5142
5143 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
5144
5145 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
5146 to accommodate latest gnulib.
5147
5148 * tests/glr-regression.at (Duplicate representation of merged trees):
5149 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
5150
5151 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
5152 needed.
5153
5154 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
5155
5156 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
5157 All uses changed. Invoke user destructor after an error during a
5158 split parse (trivial change from Joel E. Denny).
5159
5160 * tests/glr-regression.at
5161 (User destructor after an error during a split parse): New test case.
5162 Problem reported by Joel E. Denny in:
5163 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
5164
5165 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
5166
5167 * README-cvs: Give URLs for recommended tools.
5168 Mention Gzip version problem, and bootstrapping issues.
5169 Remove troubleshooting section, as it's somewhat obsolete.
5170
5171 * bootstrap (no_cache): New var, to accommodate different wget
5172 variants. Use it instead of '-C off'. Problem reported by
5173 twlevo@xs4all.nl.
5174
5175 * data/glr.c (yydestroyStackItem): New function.
5176 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
5177 debugging information. Problem reported by Joel E. Denny.
5178
5179 2005-08-25 Akim Demaille <akim@epita.fr>
5180
5181 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
5182
5183 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
5184
5185 * data/glr.c (yyrecoverSyntaxError, yyreturn):
5186 Don't invoke destructor on unresolved entries.
5187 * tests/glr-regression.at
5188 (User destructor for unresolved GLR semantic value): New test case.
5189 Problem reported by Joel E. Denny in:
5190 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
5191
5192 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
5193
5194 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
5195 Add strnlen.c.
5196 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
5197 lib-prefix.m4, po.m4.
5198
5199 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
5200 in yydestruct diagnostic, since it might not be an error.
5201 Problem reported by Joel Denny near end of
5202 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5203 * data/lalr1.cc (yyerturn): Likewise.
5204 * data/yacc.c (yyreturn): Likewise.
5205 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
5206
5207 * src/files.c: Remove obsolete FIXME comment.
5208
5209 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
5210 with the other templates, and to fix bogus run-on messages such
5211 as the one reported at the end of
5212 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5213 All callers changed to avoid the newline.
5214 (yyprocessOneStack): Output two lines rather than one, to accommodate
5215 the above change. This changes the debug output format slightly.
5216
5217 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
5218 reported by Joel E. Denny in
5219 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
5220 (trivial change).
5221 * tests/glr-regression.at (Duplicate representation of merged trees):
5222 New test, from Joel E. Denny in:
5223 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
5224 * THANKS: Add Joel E. Denny.
5225
5226 * configure.ac (AC_INIT): Bump to 2.0c.
5227
5228 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
5229
5230 * NEWS: Version 2.0b.
5231
5232 * Makefile.am (SUBDIRS): Put examples before tests, so that
5233 "make check" doesn't finish with "All 1 tests passed".
5234
5235 * tests/regression.at (Token definitions): Don't rely on
5236 AT_PARSER_CHECK for data that contains backslashes. It currently
5237 uses 'echo', and 'echo' isn't portable if its argument contains
5238 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
5239 that the byte '\0xff' is not printable in the C locale; it is,
5240 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
5241 not printable, so use '\0x81' to test.
5242
5243 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
5244 version of GCC, since the macro is used with non-GCC compilers.
5245
5246 Fix core dump reported by Pablo De Napoli in
5247 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
5248 * tests/regression.at (Invalid inputs with {}): New test.
5249 * src/parse-gram.y (token_name): Translate type before using
5250 it as an index.
5251
5252 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
5253 the user's name space. All uses changed to __attribute__
5254 ((__unused__)).
5255 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
5256 Add __attribute__ ((__noreturn__)).
5257
5258 * etc/clcommit: Remove. We weren't using it, and it failed
5259 "make maintainer-distcheck".
5260 * Makefile.maint: Merge from coreutils.
5261 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
5262 (syntax-check-rules): Change list of rules as described below.
5263 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
5264 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
5265 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
5266 (sc_trailing_space): New rules.
5267 (sc_xalloc_h_in_src): Remove.
5268 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
5269 (sc_space_tab, sc_error_exit_success, sc_changelog):
5270 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
5271 (makefile-check, po-check, author_mark_check):
5272 (makefile_path_separator_check, copyright-check):
5273 Use grep -n, to make it easier to find violations.
5274 Use CVS_LIST and CVS_LIST_EXCEPT.
5275 (header_regexp, h_re): Remove.
5276 (dd_c): New macro.
5277 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
5278 (my-distcheck): Use more-modern GCC flags.
5279 (signatures, %.asc): Remove.
5280 (rel-files, announcement): Remove signatures.
5281 Restore old updating code, even though we don't use it, so
5282 that we're the same as coreutils.
5283 (alpha, beta, major): Depend on news-date-check.
5284 Make the upload commands.
5285
5286 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
5287 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
5288 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
5289 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
5290 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
5291 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
5292 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
5293 * tests/sets.at: Likewise.
5294
5295 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
5296 we comment out the Autoconf version number.
5297 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
5298 it's error-prone and "make maintainer-distcheck" rejects it.
5299
5300 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
5301 Indent calls to "error" to pacify "make maintainer-distcheck",
5302 when the calls are not intended to be translated.
5303 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
5304
5305 * src/Makefile.am (DEFS): Use +=, to pacify
5306 "make maintainer-distcheck".
5307 (bison_SOURCES): Add scan-skel.h.
5308 (sc_tight_scope): New rule, from coreutils.
5309
5310 * src/files.c (src_extension, header_extension):
5311 Now static, not extern.
5312 * src/getargs.c (short_options): Likewise.
5313 * src/muscle_tab.c (muscle_table): Likewise.
5314 * src/parse-gram.y (current_class, current_type, current_prec):
5315 Likewise.
5316 * src/reader.c (grammar_end, previous_rule_end): Likewise.
5317 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
5318 * src/main.c (main): Cast bindtextdomain and textdomain calls to
5319 void, to avoid warning when NLS is disabled.
5320 * src/output.c: Include scan-skel.h.
5321 (scan_skel): Remove decl, since scan-skel.h does this.
5322 (output_skeleton):
5323 Indent calls to "error" to pacify "make maintainer-distcheck".
5324 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
5325 * src/reader.h (gram_end, gram_lineno): New decls to pacify
5326 "make maintainer-distcheck".
5327 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
5328 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
5329 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
5330 (skel_lex_destroy, scan_skel): Move these decls to...
5331 * src/scan-skel.h: New file.
5332 * src/uniqstr.c (uniqstr_assert):
5333 Indent calls to "error" to pacify "make maintainer-distcheck".
5334
5335 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
5336 not @VAR@.
5337
5338 * tests/torture.at: Revamp to avoid misuse of atoi that
5339 "make maintainer-distcheck" complained about.
5340
5341 * examples/extexi (message): Don't print a message more than once,
5342 and omit line-number decoration that makes Emacs compile think
5343 that informative messages are worth worrying about.
5344
5345 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
5346
5347 * configure.ac: Update version number.
5348
5349 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
5350 accidentally.
5351 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
5352 autogenerated by the maintainer.
5353 * examples/calc++/.cvsignore: Add *.yy.
5354
5355 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
5356 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5357 * lib/bitsetv.c (bitsetv_alloc): Likewise.
5358
5359 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
5360
5361 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
5362 from maintainer-distcheck about casting the argument of 'free'.
5363
5364 * NEWS: Mention recent yytname changes.
5365 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
5366
5367 * bootstrap: For translations that have not yet been upgraded to
5368 the new runtime-po domain, prime the pump by extracting the
5369 relevant strings from the obsolete translations. This code can be
5370 removed once the bison-runtime domain has been translated by each
5371 team.
5372
5373 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
5374 now that token names are already quoted.
5375
5376 Fix problem reported by Anthony Heading.
5377 * data/glr.c (YYTOKEN_TABLE): New macro.
5378 (yytname): Define if YYTOKEN_TABLE.
5379 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
5380 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
5381 (YYERROR_VERBOSE): Define the same way the other skeletons do.
5382 * src/output.c (prepare_symbols): Output token_table_flag.
5383
5384 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
5385
5386 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
5387 again if the first call fails.
5388
5389 * data/glr.c (yytnamerr): New function.
5390 (yyreportSyntaxError): Use it to dequote most string literals.
5391 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
5392 with other skeletons. All uses changed.
5393 (yytnameerr_): New function.
5394 (yyreport_syntax_error): Use it to dequote most string literals.
5395 * data/yacc.c (yytnamerr): New function.
5396 (yyerrlab): Use it to decode most string literals.
5397 * doc/bison.texinfo (Decl Summary, Calling Convention):
5398 Clarify quoting convention of yytname.
5399 * src/output.c (prepare_symbols): Quote all names. This undoes
5400 the 2005-04-17 change, which is now accomplished (mostly) via
5401 changes in the parsers as described above.
5402 * tests/regression.at (Token definitions, Web2c Actions):
5403 Undo most 2005-04-17 change here, too.
5404
5405 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
5406
5407 Fix more problems reported by twlevo@xs4all.nl.
5408 * tests/cxx-type.at: Don't pipe output of ./types through sed to
5409 remove trailing spaces. This loses the exit status of ./types,
5410 and isn't needed since ./types shouldn't be emitting trailing
5411 spaces.
5412 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
5413 as the stack isn't valid in that case.
5414
5415 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5416 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5417 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5418 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
5419 is used.
5420 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
5421 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5422 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5423 Likewise.
5424
5425 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
5426 overly-picky compilers that reject 'char *foo = "bar";'.
5427
5428 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
5429 to FILE * parameter, not to stderr. This fixes a typo introduced
5430 in the 2005-07-12 change.
5431
5432 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
5433 warnings from GCC 4.
5434
5435 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
5436 (yyglrShiftDefer, yysplitStack):
5437 Remove unused parameters b4_pure_formals. All uses changed.
5438 (yyglrShift): Remove unused parameters b4_user_formals.
5439 All uses changed.
5440 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
5441
5442 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
5443
5444 Destructor cleanups and regularization among the three skeletons.
5445 * NEWS: Document the behavior changes.
5446 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
5447 stack before failing, as the cleanup code will do it for us now.
5448 * data/lalr1.cc (yyerrlab): Likewise.
5449 * data/glr.c (yyparse): Pop everything off the stack before
5450 freeing it, so that destructors get called properly.
5451 * data/lalr1.cc (yyreturn): Likewise.
5452 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
5453 This is more consistent.
5454 * doc/bison.texinfo (Destructor Decl): Mention more reasons
5455 why destructors might be called. 1.875 -> 2.1.
5456 (Destructor Decl, Decl Summary, Table of Symbols):
5457 Some English-language cleanups for %destructor.
5458 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5459 Add output line for destructor of start symbol.
5460 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
5461 because of that same extra output line.
5462
5463 * NEWS: Document minor wording changes in diagnostics of
5464 Bison-generated parsers.
5465 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
5466 Remove unused formals. All uses changed.
5467 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
5468 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
5469 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
5470 Rename yyoverflowab to yyexhaustedlab.
5471 When memory exhaustion occurs during syntax-error reporting,
5472 report it separately rather than in a single diagnostic; this
5473 eases translation.
5474 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
5475 (Memory Exhausted): Renamed from Parser Stack Overflow.
5476 Revamp wording slightly to prefer "memory exhaustion".
5477 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
5478
5479 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
5480
5481 Add i18n support to the GLR skeleton. Partially fix the C++
5482 skeleton; a C++ expert needs to finish this. Remove debugging
5483 msgids; there's little point to having them translated, since they
5484 can be understood only by someone who can read the
5485 (English-language) source code.
5486
5487 Generate runtime-po/bison-runtime.pot automatically, so that we
5488 don't have to worry about garbage getting in that file. We'll
5489 make sure after the next official release that old msgids don't
5490 get lost. See
5491 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
5492
5493 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
5494 Now auto-generated.
5495 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
5496 Fix typos in explanations of the runtime file.
5497 * bootstrap: Change gettext keyword from YYI18N to YY_.
5498 Use standard Makefile.in.in in runtime-po, since we'll arrange
5499 for backward-compatible bison-runtime.po files in a different way.
5500 * data/glr.c (YY_): New macro, from yacc.c.
5501 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
5502 Translate messages intended for users.
5503 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
5504 the wording in the other skeletons. We don't know that the memory
5505 is virtual.
5506 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
5507 Use same method that yacc.c uses.
5508 Don't translate debugging messages.
5509 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
5510 it doesn't work (yet), and requires C++ expertise to fix.
5511 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
5512 Move defn to a more logical place, to be consistent with other
5513 skeletons.
5514 Don't translate debugging messages.
5515 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
5516 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
5517 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
5518 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
5519
5520 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
5521 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
5522 void, not int.
5523 * tests/glr-regression.at (Badly Collapsed GLR States):
5524 Likewise.
5525 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5526 yylex should return 0 at EOF rather than aborting.
5527
5528 Improve tests for stack overflow in GLR parser.
5529 Problem reported by twlevo@xs4all.nl.
5530 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
5531 All uses removed.
5532 (yyStackOverflow): Just longjmp, but with value 2 so that caller
5533 can handle the problem.
5534 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
5535 (yyparse): New local variable yyresult to record the result.
5536 Use result of setjmp to set it, rather than storing itinto
5537 struct.
5538 (yyDone): Remove label.
5539 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
5540 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
5541 if YYABORT is used).
5542 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
5543 yyparse status; put status > 1 into diagnostic.
5544 Check that status==2 works.
5545 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
5546 Use exit status 3 for failure to open (which shouldn't happen).
5547
5548 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
5549
5550 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
5551 1 on syntax error; just let yyparse do its thing.
5552 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
5553 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
5554 (Exploding the Stack Size with Alloca):
5555 (Exploding the Stack Size with Malloc):
5556 Expect exit status 2, not 1, since the parser is supposed to blow
5557 its stack. Problem reported by twlevo@xs4all.nl.
5558
5559 * data/glr.c (yyparse): Don't assume that the initial calls
5560 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
5561 Print a stack-overflow message and fail instead.
5562 Initialize the line-number information before creating the stack,
5563 so that the stack-overflow message can report line zero safely.
5564
5565 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
5566
5567 Fix problems reported by twlevo@xs4all.nl.
5568 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
5569 (yyuserMerge): Provide a default case if b4_mergers is empty.
5570 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
5571 * tests/glr-regression.at
5572 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5573 Add casts to pacify C++ compilers.
5574 * tests/glr-regression.at (Improper merging of GLR delayed action
5575 sets): Declare yylex before using it.
5576 * tests/Makefile.am (maintainer-check-g++): Fix a stray
5577 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
5578 test for valgrind; valgrind is independent of g++.
5579 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
5580 for compatibility with POSIX 1003.1-2001 (if running coreutils).
5581 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
5582 Use a destructor, so that we can expand the stack. Change
5583 YYSTYPE to char * so that we can free it. Cast result of malloc.
5584
5585 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5586
5587 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
5588 a valgrind failure. Problem reported by twlevo@xs4all.nl.
5589
5590 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
5591
5592 * PACKAGING: New file, suggested by Bruno Haible and taken from
5593 similar wording in gettext's PACKAGING file.
5594 * NEWS: Mention PACKAGING.
5595 * Makefile.am (EXTRA_DIST): Add PACKAGING.
5596
5597 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
5598
5599 * NEWS: Document recent i18n improvements.
5600 * bootstrap: Get runtime translations into runtime-po.
5601 Create runtime-po files automatically, if possible.
5602 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
5603 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
5604 does not infringe on the user's name space.
5605 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
5606 * doc/bison.texinfo (Internationalization): Revamp the English
5607 and Texinfo syntax a bit, to try to make it clearer.
5608 (Bison Options, Option Cross Key): Mention --print-localedir.
5609 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
5610 YYENABLE_NLS. Quote a bit more.
5611 * runtime-po/.cvsignore: New file.
5612 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
5613 * runtime-po/Rules-quot: Remove; now created by bootstrap.
5614 * runtime-po/quot.sed: Likewise.
5615 * runtime-po/boldquot.sed: Likewise.
5616 * runtime-po/en@quot.header: Likewise.
5617 * runtime-po/en@boldquot.header: Likewise.
5618 * runtime-po/insert-header.sin: Likewise.
5619 * runtime-po/remove-potcdate.sin: Likewise.
5620 * runtime-po/Makevars: Likewise.
5621 * runtime-po/LINGUAS: Likewise.
5622 * runtime-po/de.po: Likewise; we will rely on the translation project
5623 to maintain this, so "bootstrap" should get it.
5624 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
5625 its value.
5626 * src/main.c (main): Bind the bison-runtime domain, too.
5627
5628 2005-07-12 Bruno Haible <bruno@clisp.org>
5629
5630 * data/yacc.c: Include <libintl.h> when NLS is enabled.
5631 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
5632 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
5633 * runtime-po: New directory.
5634 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
5635 $(DOMAIN).pot-update rule, so that old messages are never dropped.
5636 * runtime-po/Rules-quot: New file, copied from po/.
5637 * runtime-po/quot.sed: Likewise.
5638 * runtime-po/boldquot.sed: Likewise.
5639 * runtime-po/en@quot.header: Likewise.
5640 * runtime-po/en@boldquot.header: Likewise.
5641 * runtime-po/insert-header.sin: Likewise.
5642 * runtime-po/remove-potcdate.sin: Likewise.
5643 * runtime-po/Makevars: New file.
5644 * runtime-po/POTFILES.in: New file.
5645 * runtime-po/LINGUAS: New file.
5646 * runtime-po/bison-runtime.pot: New file.
5647 * runtime-po/de.po: New file.
5648 * m4/bison.m4: New file.
5649 * Makefile.am (SUBDIRS): Add runtime-po.
5650 (aclocaldir, aclocal_DATA): New variables.
5651 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
5652 Define aclocaldir.
5653 * src/getargs.c (usage): Document --print-localedir option.
5654 (PRINT_LOCALEDIR_OPTION): New enum item.
5655 (long_options): Add --print-localedir option.
5656 (getargs): Handle --print-localedir option.
5657 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
5658 (Internationalization): New section.
5659
5660 2005-07-12 Akim Demaille <akim@epita.fr>
5661
5662 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
5663 for consistency with the rest of the code.
5664 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
5665 Add separators.
5666
5667 2005-07-12 Akim Demaille <akim@epita.fr>
5668
5669 * src/parse-gram.y: Use %printer instead of YYPRINT.
5670
5671 2005-07-12 Akim Demaille <akim@epita.fr>
5672
5673 * src/symtab.h, src/symtab.c (symbol_print): New.
5674 * src/symlist.h, src/symlist.c (symbol_list_print): New.
5675 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
5676
5677 2005-07-12 Akim Demaille <akim@epita.fr>
5678
5679 * data/glr.c (b4_syncline): Fix (swap) the definitions of
5680 b4_at_dollar and b4_dollar_dollar.
5681
5682 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
5683
5684 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
5685 and Pennello's paper.
5686
5687 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
5688
5689 * data/yacc.c (yyparse): Undo previous patch. Instead,
5690 set yylsp[0] and yyvsp[0] only if the initial action
5691 sets yylloc and yylval, respectively.
5692
5693 * data/yacc.c (yyparse): In the initial action, set
5694 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
5695 This avoids the use of undefined variables if the initial
5696 action does not set yylloc and/or yylval.
5697
5698 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5699
5700 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
5701 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
5702 Remove from CVS. These files are automatically generated.
5703 * examples/extexi: Clarify that this file is now part of Bison,
5704 not GNU M4, and that it works with any POSIX-compatible Awk.
5705 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
5706 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
5707 so that we also get calc++-parser.yy. Geneate it.
5708 Use $(AWK), not gawk, since any conforming Awk will do.
5709 Put comment before action, since older 'make' can't handle comment
5710 in action.
5711 $(BUILT_SOURCES): List all built sources, not just some of them.
5712 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
5713 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
5714 $($(calc_sources_generated)): Remove unnecessary test for existence
5715 of target. (This had a shell syntax error anyway; a stray "x".)
5716 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
5717 calc++-parser.yy.
5718 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
5719
5720 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
5721 implied by the other modules.
5722
5723 2005-07-06 Akim Demaille <akim@epita.fr>
5724
5725 Bind examples/calc++ to the package.
5726 * examples/calc++/Makefile: Remove, replaced by...
5727 * examples/calc++/Makefile.am: ... this new file.
5728 * examples/calc++/test: Remove input.
5729 * examples/calc++/compile: Remove.
5730 * examples/Makefile.am: New.
5731 * configure.ac, Makefile.am: Adjust.
5732 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
5733
5734 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
5735
5736 * data/glr.c (yyFail): Drastically simplify; since the format argument
5737 never had any % directives, we can simply pass it to yyerror.
5738 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
5739 be modified later, as that is the usual style in glr.c.
5740 Problems reported by Paul Hilfinger.
5741
5742 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
5743 and size overflow errors.
5744 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
5745 in case the user prolog sets feature-test macros like _GNU_SOURCE.
5746 (YYSIZEMAX): New macro.
5747 (yystpcpy): New function, taken from yacc.c.
5748 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
5749 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
5750 so that we don't have to maintain their signatures.
5751 (yyFail): Check for buffer overflow, by using vsnprintf rather
5752 than vsprintf. Allocate a bigger buffer if possible.
5753 Report an error if buffer allocation fails.
5754 (yyStackOverflow): New function.
5755 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
5756 the initialization was successful. It might fail if storage was
5757 exhausted.
5758 (yyexpandGLRStack): Add more checks for storage allocation failure.
5759 Use yyStackOverflow to report failures.
5760 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
5761 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
5762 Don't assume stack number fits in int.
5763 (yysplitStack): Check for storage allocation failure.
5764 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
5765 can print diagnostics on storage allocation failure. All callers
5766 changed.
5767 (yyresolveValue): Use yybool for boolean.
5768 (yyreportSyntaxError): Check for size-calculation overflow.
5769 This code is taken from yacc.c.
5770 (yyparse): Check for storage allocation errors when allocating
5771 the initial stack.
5772
5773 2005-07-05 Akim Demaille <akim@epita.fr>
5774
5775 Extract calc++ from the documentation.
5776 * doc/bison.texinfo (Calc++): Add the extraction marks.
5777 * examples/extexi: New, from the aborted GNU Programming 2E.
5778 Separate the different paragraph of a file with empty lines.
5779 * examples/Makefile: Use it to extract the whole calc++ example.
5780
5781 2005-06-24 Akim Demaille <akim@epita.fr>
5782
5783 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
5784 class typedefs.
5785
5786 2005-06-22 Akim Demaille <akim@epita.fr>
5787
5788 * doc/bison.texinfo (C++ Language Interface): First stab.
5789 (C++ Parsers): Remove.
5790
5791 2005-06-22 Akim Demaille <akim@epita.fr>
5792
5793 * data/lalr1.cc (yylex_): Honor %lex-param.
5794
5795 2005-06-22 Akim Demaille <akim@epita.fr>
5796
5797 Start a set of simple examples.
5798 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
5799 * examples/calc++/calc++-driver.hh,
5800 * examples/calc++/calc++-parser.yy,
5801 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
5802 * examples/calc++/compile, examples/calc++/test: New.
5803
5804 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
5805
5806 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
5807 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
5808 which stems from the 2005-05-27 patch.
5809
5810 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5811
5812 * data/glr.c: Modify treatment of unused parameters to permit use
5813 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
5814
5815 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
5816
5817 Fix infringement on user name space reported by Janos Zoltan Szabo.
5818 * data/yacc.c (yyparse): strlen -> yystrlen.
5819
5820 2005-05-30 Akim Demaille <akim@epita.fr>
5821
5822 * data/lalr1.cc (_): New.
5823 Translate the various messages.
5824
5825 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
5826
5827 Fix infringement on user name space reported by Bruno Haible.
5828 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
5829 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
5830 the user's name space.
5831 (alloca): Include <stdlib.h> to get it, if it's not built in.
5832 (YYMALLOC, YYFREE): Define only if needed.
5833 (malloc, free): Declare, but only if needed, as this infringes on
5834 the user name space.
5835
5836 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
5837
5838 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
5839 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
5840 with %d format.
5841 * lib/ebitset.c (min, max): Undef before defining.
5842 * lib/vbitset.c (min, max): Likewise.
5843 * lib/subpipe.c (create_subpipe): Save local variables in case
5844 vfork clobbers them.
5845
5846 2005-05-24 Bruno Haible <bruno@clisp.org>
5847
5848 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
5849 error message syntax used by gcc-4.0.
5850
5851 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
5852
5853 * README: Mention m4 1.4.3. Remove obsolete advice about
5854 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
5855
5856 * bootstrap: Remove workaround for problem I encountered with
5857 gettext 0.14.1; it seems to be fixed now.
5858
5859 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
5860
5861 * NEWS: Version 2.0a.
5862
5863 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
5864 the previous change.
5865
5866 Various maintainer cleanups.
5867 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
5868 conftest*, for benefit of CVS commands run at the same time as
5869 "configure". Add build-aux, since "bootstrap" now creates it and
5870 its subfiles.
5871 * Makefile.cfg (move_if_change): Remove.
5872 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
5873 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
5874 (po_repo, do-po-update, po-update, wget_files, get-targets):
5875 (config.guess-url_prefix, config.sub-url_prefix):
5876 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
5877 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
5878 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
5879 Remove.
5880 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
5881 this is now the recommended name.
5882 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
5883 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
5884 ylwrap. These files now go into build-aux.
5885 * config/move-if-change: Remove.
5886 * config/prev-version.txt: Bump from 1.75 to 2.0.
5887
5888 * bootstrap: Add stdio-safer, unistd-safer modules.
5889 Remove m4/glibc2.m4 (introduced by latest gnulib, but
5890 we don't need it).
5891 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
5892 fopen-safer.c, stdio-safer.h, unistd-safer.h.
5893 * lib/subpipe.c: Include "unistd-safer.h".
5894 (create_subpipe): Make sure all the newly-created
5895 file descriptors are > 2, so that diagnostics don't
5896 get sent down them (which might cause Bison to hang, in theory).
5897 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
5898 * src/files.c (xfopen): Use fopen_safer, not fopen.
5899
5900 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
5901 yesterday's yacc.c fix.
5902
5903 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
5904
5905 * data/glr.c, data/lalr1.cc: Update copyright date.
5906
5907 Fix a destructor bug reported by Wolfgang Spraul in
5908 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
5909 * data/yacc.c (yyabortlab): Don't call destructor, and
5910 don't set yychar to EMPTY.
5911 (yyoverflowlab): Don't call destructor.
5912 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
5913 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
5914 since we no longer output the message "discarding lookahead token
5915 end of input ()".
5916
5917 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5918
5919 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
5920 fix a small glitch in debugging output.
5921 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
5922 after YY_SYMBOL_PRINT where needed.
5923
5924 (struct yyGLRState): Add some comments.
5925 (struct yySemanticOption): Add some comments.
5926 (union yyGLRStackItem): Add comment.
5927
5928 (yymergeOptionSets): Correct this to properly perform the union,
5929 avoiding infinite reported by Michael Rosien.
5930 Update comment.
5931
5932 * tests/glr-regression.at: Add test for GLR merging error reported
5933 by M. Rosien.
5934
5935 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
5936
5937 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
5938 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
5939 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
5940 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
5941 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
5942 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
5943 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
5944 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
5945 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
5946 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
5947 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
5948 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
5949 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
5950 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
5951 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
5952 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
5953 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
5954 src/derives.h, src/files.c, src/files.h, src/getargs.c,
5955 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
5956 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
5957 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
5958 src/output.h, src/parse-gram.c, src/parse-gram.h,
5959 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
5960 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
5961 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
5962 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
5963 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
5964 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
5965 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
5966 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
5967 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
5968 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
5969 tests/reduce.at, tests/regression.at, tests/sets.at,
5970 tests/synclines.at, tests/testsuite.at, tests/torture.at:
5971 Update FSF postal mail address.
5972
5973 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
5974
5975 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
5976 Problem reported by Ralf Menzel.
5977
5978 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
5979
5980 * tests/actions.at: Test that stack overflow invokes destructors.
5981 From Marcus Holland-Moritz.
5982 * data/yacc.c (yyerrlab): Move the code that destroys the stack
5983 from here....
5984 (yyreturn): to here. That way, destructors are called properly
5985 even if the stack overflows, or the user calls YYACCEPT or
5986 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
5987 (yyoverflowlab): Destroy the lookahead.
5988
5989 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
5990
5991 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
5992
5993 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
5994
5995 * NEWS: Bison-generated C parsers no longer quote literal strings
5996 associated with tokens.
5997 * src/output.c (prepare_symbols): Don't escape strings,
5998 since users don't want to see C escapes.
5999 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
6000 in diagnostics.
6001 * tests/input.at (Torturing the Scanner): Likewise.
6002 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
6003
6004 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
6005
6006 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
6007 the data size is known to be too small and we can't increase it.
6008 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
6009
6010 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
6011
6012 * src/parse-gram.y: Include quotearg.h.
6013 (string_as_id): Quote $1 before using it as a key, since the
6014 lexer no longer quotes it for us.
6015 (string_content): Don't strip quotes, since lexer no longer
6016 quotes it for us.
6017 * src/scan-gram.l: Include quotearg.h.
6018 ("\""): Omit quote.
6019 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
6020 a key, since the rest of the lexer doesn't quote it.
6021 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
6022 * tests/regression.at (Token definitions): Check for backslashes
6023 in token strings.
6024
6025 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
6026 (YYSIZE_T): Define to unsigned long int when using an older compiler.
6027 (yyparse): Revamp code to generate long syntax error message, to
6028 make it easier to translate, and to avoid problems with arithmetic
6029 overflow. Change "virtual memory" to "memory" in diagnostic, since
6030 we don't know whether the memory is virtual.
6031
6032 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
6033
6034 * NEWS: Bison-generated C parsers now use the _ macro to
6035 translate strings.
6036 * data/yacc.c (_) [!defined _]: New macro.
6037 All English strings wrapped inside this macro.
6038 * doc/bison.texinfo (Bison Parser): Document _.
6039 * po/POTFILES.in: Include src/parse-gram.c, since it now
6040 includes translateable strings that parse-gram.y doesn't.
6041
6042 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
6043
6044 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
6045 reverting the 2004-10-11 change to this function.
6046 (symbol_check_alias_consistency): Don't call symbol_type_set
6047 if the type name is already correct.
6048 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
6049
6050 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
6051
6052 * tests/regression.at (Token definitions): Don't use a token named
6053 c, as that generates a "#define c ..." that runs afoul of buggy
6054 stdlib.h that uses the identifier c as a member of struct
6055 drand48_data. Problem reported by Horst Wente.
6056
6057 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
6058
6059 * bootstrap: Change translation URL from
6060 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
6061 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
6062 redirection glitches. Problem reported by twlevo@xs4all.nl.
6063
6064 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
6065
6066 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
6067 after operands; POSIX says this isn't portable for the c99 command.
6068
6069 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
6070
6071 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
6072 immediately if a data overrun has occurred; this may help us track
6073 down what may be a spurious failure on MacOS.
6074
6075 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
6076
6077 Respond to problems reported by twlevo@xs4all.nl.
6078
6079 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
6080
6081 * src/vcg.h: Comment fix.
6082 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
6083 (G_CMAX): Change to -1 instead of INT_MAX.
6084
6085 * data/yacc.c (yyparse): Omit spaces before #line.
6086
6087 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
6088
6089 * src/tables.c (state_number_to_vector_number): Put it inside an
6090 "#if 0", since it's not currently used. Problem reported by
6091 Roland McGrath.
6092
6093 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
6094
6095 * src/output.c (escaped_output): Renamed from
6096 escaped_file_name_output, since we now use it for symbol tags as
6097 well. All uses changed.
6098 (symbol_destructors_output, symbol_printers_output):
6099 Escape symbol tags too.
6100 Problem reported by Matyas Forstner in
6101 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
6102
6103 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
6104 not needed.
6105 * src/output.c (user_actions_output, token_definitions_output,
6106 symbol_destructors_output, symbol_printers_output): Likewise.
6107 * src/reader.c (prologue_augment): Likewise.
6108 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
6109
6110 * src/vcg.c (output_edge): Don't quote linestyle arg.
6111 Problem reported by twlevo@xs4all.nl.
6112
6113 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
6114
6115 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
6116 example, reported by Derek M Jones. Also, make the example even
6117 more outrageous, to better illustrate how bad the problem is.
6118
6119 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
6120
6121 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
6122 putsym. Typo reported by Sebastian Piping.
6123
6124 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
6125
6126 * doc/bison.texinfo (Language and Grammar): some -> same
6127 (Epilogue): int he -> in the
6128 Typos reported by Sebastian Piping via Justin Pence.
6129
6130 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
6131
6132 * tests/glr-regression.at (Improper handling of embedded actions
6133 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
6134 embedded actions and $-N in GLR parsers", work around an Autoconf bug
6135 with dollar signs in test names.
6136 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
6137 for a similar reason.
6138
6139 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
6140
6141 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
6142 wants to redefine G_VIEW.
6143
6144 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
6145
6146 * src/vcg.c (get_view_str): Remove case for normal_view.
6147 Problem reported by twlevo@xs4all.nl.
6148
6149 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
6150
6151 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
6152 Problem reported by twlevo@xs4all.nl.
6153
6154 * doc/bison.texinfo: Change @dircategory from "GNU programming
6155 tools" to "Software development". Requested by Richard Stallman
6156 via Karl Berry.
6157
6158 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
6159
6160 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
6161 Problem reported by twlevo@xs4all.nl.
6162
6163 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
6164
6165 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
6166 keyword; it's not needed with modern compilers, and it doesn't
6167 affect correctness with older compilers. Suggested by
6168 twlevo@xs4all.nl.
6169
6170 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
6171
6172 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
6173 gcc -Wswitch-default.
6174 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6175 * data/yacc.c (yyparse): Likewise.
6176
6177 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
6178
6179 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
6180 already. Let config.h define any nonstandard values.
6181
6182 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
6183
6184 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
6185 for the benefit of slower hosts. Problem reported by
6186 Nelson H. F. Beebe.
6187
6188 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
6189
6190 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
6191 being defined and not used.
6192 * data/lalr1.cc (yyparse): Likewise.
6193 Use "if (false)" rather than "if (0)".
6194
6195 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
6196
6197 * TODO: Mention that we should allow NUL bytes in tokens.
6198
6199 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
6200
6201 * src/scan-skel.l (<<EOF>>): Don't close standard output.
6202 Problem reported by Hans Aberg.
6203
6204 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
6205
6206 * src/getargs.c (version): Happy new year; update overall
6207 program copyright date from 2004 to 2005.
6208
6209 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
6210 Problem reported by Hans Aberg.
6211 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
6212 (Output file names.): Add a test for the case when standard output
6213 is closed.
6214
6215 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
6216
6217 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
6218 to fix an oversight in the Bison 2.0 manual.
6219
6220 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
6221
6222 * NEWS: Version 2.0. Reformat the existing news items since
6223 1.875, so that related items are grouped together.
6224 * configure.ac (AC_INIT): Bump version to 2.0.
6225 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
6226
6227 * tests/torture.at (Exploding the Stack Size with Alloca): Set
6228 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
6229 otherwise, we're not testing alloca. Unfortunately there's no
6230 simple way to consult HAVE_ALLOCA here.
6231
6232 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
6233 for yymsg, too.
6234
6235 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
6236 hand. This avoids a warning about comparing int to size_t when
6237 GCC warnings are enabled.
6238
6239 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
6240
6241 * NEWS: Bison-generated parsers no longer default to using the
6242 alloca function (when available) to extend the parser stack, due
6243 to widespread problems in unchecked stack-overflow detection.
6244 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
6245 responsibility to set it to a positive value. This lets the user
6246 specify a value that is not a preprocessor constant.
6247 * data/yacc.c (YYMAXDEPTH): Likewise.
6248 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
6249 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
6250 to be a compile-time constant. However, explain the constraints on it.
6251 Also, explain the constraints on YYINITDEPTH.
6252 (Table of Symbols): Explain that alloca is no longer the default.
6253 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
6254 to 1.
6255
6256 * doc/bison.texinfo (Location Default Action): Mention that n must
6257 be zero when k is zero. Suggested by Frank Heckenbach.
6258
6259 2004-12-22 Akim Demaille <akim@epita.fr>
6260
6261 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
6262 (parser::state_type, parser::semantic_type, parser::location_type):
6263 Private, not public.
6264 (parser::parse): Return ints, not bool.
6265 Returning a bool introduces a problem: 0 corresponds to false, and
6266 it seems weird to return false on success. Returning true changes
6267 the conventions for yyparse.
6268 Alternatively we could return void and send an exception.
6269 There is no clear consensus (yet?).
6270 (state_stack, semantic_stack, location_stack): Rename as...
6271 (state_stack_type, semantic_stack_type, location_stack_type): these.
6272 Private, not public.
6273 * tests/c++.at: New.
6274 * tests/testsuite.at, tests/Makefile.am: Adjust.
6275
6276 2004-12-21 Akim Demaille <akim@epita.fr>
6277
6278 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
6279
6280 2004-12-21 Akim Demaille <akim@epita.fr>
6281
6282 Don't impose std::string for filenames.
6283
6284 * data/lalr1.cc (b4_filename_type): New.
6285 (position::filename): Use it.
6286 (parser.hh): Move the inclusion of stack.hh and location.hh below
6287 the user code, so that needed headers for the filename type can be
6288 included first.
6289 Forward declare them before the user code.
6290 * tests/Makefile.am (check-local, installcheck-local): Pass
6291 TESTSUITEFLAGS to the TESTSUITE.
6292
6293 2004-12-20 Akim Demaille <akim@epita.fr>
6294
6295 Use more STL like names: my_class instead of MyClass.
6296
6297 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
6298 (SemanticStack, SemanticType, StateStack, StateType)
6299 (TokenNumberType, Stack, Slice, Traits, Parser::location)
6300 (Parser::value): Rename as...
6301 (location_stack, location_type, rhs_number_type, semantic_stack)
6302 (semantic_type, state_stack, state_type, token_number_type, stack)
6303 (slice, traits, parser::yylloc, parser::yylval): these.
6304
6305 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
6306
6307 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
6308
6309 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
6310 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6311
6312 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
6313
6314 Remove uses of 'short int' and 'unsigned short int'. This raises
6315 some arbitrary limits. It uses more memory but nowadays that's
6316 not much of an issue.
6317
6318 This change does not affect the generated parsers; that's a different
6319 task, as some users will want to conserve memory there.
6320
6321 Ideally we should use size_t to represent all object counts, and
6322 something like ptrdiff_t to represent signed differences of object
6323 counts; but that will require more code-cleanup than I have the
6324 time to do right now.
6325
6326 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
6327 Use size_t, not int or short int, to count objects.
6328 * src/closure.c (nritemset, closure): Likewise.
6329 * src/closure.h (nritemset, closure): Likewise.
6330 * src/nullable.c (nullable_compute): Likewise.
6331 * src/print.c (print_core): Likewise.
6332 * src/print_graph.c (print_core): Likewise.
6333 * src/state.c (state_compare, state_hash): Likewise.
6334 * src/state.h (struct state): Likewise.
6335 * src/tables.c (default_goto, goto_actions): Likewise.
6336
6337 * src/gram.h (rule_number, rule): Use int, not short int.
6338 * src/output.c (prepare_rules): Likewise.
6339 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
6340 errs, reductions): Likewise.
6341 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
6342 Likewise.
6343 * src/tables.c (vector_number, tally, action_number,
6344 ACTION_NUMBER_MINIMUM): Likewise.
6345 * src/output.c (muscle_insert_short_int_table): Remove.
6346
6347 2004-12-17 Akim Demaille <akim@epita.fr>
6348
6349 * data/lalr1.cc: Extensive Doxygenation.
6350 (error_): Rename as...
6351 (error): this, since it is visible to the user.
6352 Adjust callers.
6353 (Parser::message): Now an automatic variable from...
6354 (Parser::yyreport_syntax_error_): here.
6355 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
6356 Parser::error.
6357 * tests/input.at: Escape $.
6358
6359 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
6360
6361 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
6362 Parenthesize rhs to avoid obscure problems with mistakes like
6363 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
6364 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6365 b4_rhs_location): Likewise.
6366 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6367 b4_rhs_location): Likewise.
6368
6369 2004-12-16 Akim Demaille <akim@epita.fr>
6370
6371 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
6372 yacc.c: be sure to stay within yycheck_.
6373 * tests/actions.at: Re-enable C++ tests.
6374
6375 2004-12-16 Akim Demaille <akim@epita.fr>
6376
6377 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
6378 real.
6379
6380 2004-12-16 Akim Demaille <akim@epita.fr>
6381
6382 Use #define to handle the %name-prefix.
6383
6384 * data/glr.c, data/yacc.c: Comment changes.
6385 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
6386 so that one can refer to yylex in the parser file, and have it
6387 renamed, as is the case with other skeletons.
6388
6389 2004-12-16 Akim Demaille <akim@epita.fr>
6390
6391 Move lalr1.cc internals into yy*.
6392
6393 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
6394 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
6395 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
6396 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
6397 (empty_, final_, terror_, errcode_, ntokens_)
6398 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
6399 (looka_, ilooka_, error_range_, nerrs_):
6400 Rename as...
6401 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
6402 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
6403 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
6404 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
6405 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
6406 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
6407 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
6408 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
6409 these.
6410
6411 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
6412
6413 Fix some problems reported by twlevo at xs4all.
6414 * src/symtab.c (symbol_new): Report an error if the input grammar
6415 contains too many symbols. This is better than calling abort() later.
6416 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
6417 (struct node, struct graph):
6418 Rename member expand to stretch. All uses changed.
6419 (struct graph): Remove member layoutalgorithm. All uses removed.
6420 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
6421 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
6422 All uses changed.
6423 (N_STRETCH): Rename from N_EXPAND. All uses changed.
6424
6425 2004-12-15 Akim Demaille <akim@epita.fr>
6426
6427 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
6428 Add more Doxygen comments.
6429 (symprint_, stack_print_, reduce_print_, destruct_, pop)
6430 (report_syntax_error_, translate_): Rename as...
6431 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
6432 (yypop_, yyreport_syntax_error_, yytranslate_): this.
6433
6434 2004-12-15 Akim Demaille <akim@epita.fr>
6435
6436 * data/lalr1.cc (lex_): Rename as...
6437 (yylex_): this.
6438 Move the trace here.
6439 Take the %name-prefix into account.
6440 Reported by Alexandre Duret-Lutz.
6441
6442 2004-12-15 Akim Demaille <akim@epita.fr>
6443
6444 Simplify the C++ parser constructor.
6445
6446 * data/lalr1.cc (debug_): Rename as...
6447 (yydebug_): so that the parser's internals are always in the yy*
6448 pseudo namespace.
6449 Adjust uses.
6450 (b4_parse_param_decl): Remove the leading comma as it is now only
6451 called as unique argument list.
6452 (Parser::Parser): Remove the constructor accepting a location and
6453 an initial debugging level.
6454 Remove from the other ctor the argument for the debugging level.
6455 (debug_level_type, debug_level, set_debug_level): New.
6456
6457 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
6458 constructor calls.
6459
6460 2004-12-15 Akim Demaille <akim@epita.fr>
6461
6462 Remove b4_root related material: failure experiment
6463 (which goal was to allow to derive from a class).
6464
6465 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
6466 definitions and uses.
6467
6468 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
6469
6470 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
6471 not 2, since it's not portable to subtract 1 from the start of an
6472 array. The new item 0 is never set or used. All uses changed.
6473
6474 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
6475 the default definition of YYLLOC_DEFAULT. Problem reported
6476 by Frank Heckenbach.
6477
6478 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
6479
6480 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
6481 the normal case and one for the error case. Just use the
6482 first one uniformly. Problem reported by Frank Heckenbach.
6483 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
6484 use exactly the same macro in both places.
6485 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
6486 so that the normal-case YYRHSLOC works for the error case too.
6487 All uses changed.
6488 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
6489 (YYLLOC_DEFAULT): Use the same macro as glr.c.
6490 * doc/bison.texinfo (Location Default Action): Don't claim that
6491 we have an array of locations. Use the same macro for both glr
6492 and lalr parsers. Mention YYRHSLOC. Mention what happens when
6493 the index is 0.
6494
6495 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
6496
6497 * HACKING: Update email addresses to send announcements to.
6498
6499 * configure.ac (AC_INIT): Bump version to 1.875f.
6500
6501 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
6502
6503 * NEWS: Version 1.875e.
6504 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
6505
6506 * src/scan-skel.l: Include "complain.h", for "fatal".
6507
6508 * src/relation.h (relation_print, relation_digraph):
6509 Relation sizes are of type relation_node, not size_t (this is
6510 merely a doc fix, since the two types are equivalent).
6511 (relation_transpose): Relation sizes are of type relation_node,
6512 not int.
6513 * src/relation.c: Likewise.
6514 (top, infinity): Now of type relation_node, not int.
6515 (traverse, relation_transpose): Use relation_node, not int.
6516
6517 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
6518 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
6519 (yyparse): Remove unused local introduced in 2004-10-25 patch.
6520
6521 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
6522 specifying whether the test should be skipped. Use it tp
6523 specify that the [%defines %skeleton "lalr1.cc"] tests currently
6524 fail on some hosts, and should be skipped.
6525
6526 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
6527
6528 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
6529 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
6530 unless otherwise specified below.
6531
6532 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
6533 to allocate kernel_base, kernel_items, kernel_size, since
6534 they needn't be initialized to 0.
6535 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
6536 * src/closure.c (new_closure): Likewise, for itemset.
6537 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
6538 * src/lalr.c (set_goto_map): Likewise, for temp_map.
6539 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
6540 (build_relations): Likewise for edge, states1, includes.
6541 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
6542 * src/reader.c (packgram): Likewise, for ritem, rules.
6543 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
6544 * src/relation.c (relation_digraph): Likewise for VERTICES.
6545 (relation_transpose): Likewise for new_R, end_R.
6546 * src/symtab.c (symbols_token_translations_init): Likewise for
6547 token_translations.
6548 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
6549 (token_actions): Likewise for yydefact, actrow, conflrow,
6550 conflict_list.
6551 (save_column): Likewise for froms[symno], tos[symno].
6552 (goto_actions): Likewise for state_count.
6553 (pack_table): Likewise for base, pos, check.
6554 (tables_generate): Likewise for width.
6555
6556 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
6557 for initial core. Just have a separate core, so we needn't worry
6558 about whether kernel_size and kernel_base are initialized.
6559
6560 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
6561 kernel_size, kernel_items): Remove unnecessary initialization.
6562 * src/conflicts.c (conflicts): Likewise.
6563 * src/derives.c (derives): Likewise.
6564 * src/muscle_tablc (muscle_insert): Likewise.
6565 * src/relation.c (relation_digraph): Likewise.
6566 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
6567 conflrow, conflict_table, conflict_list, table, check):
6568 Likewise.
6569
6570 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
6571 This is because all callers pass unsigned int.
6572 * src/closure.h (new_closure): Likewise.
6573
6574 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
6575 (build_relations): Initialize includes[i] in all cases.
6576 * src/reader.c (packgram): Always initialize rules[ruleno].prec
6577 and rules[ruleno].precsym. Initialize members in order.
6578 * src/relation.c (relation_transpose): Always initialize new_R[i]
6579 and end_R[i].
6580 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
6581
6582 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
6583 conflict_list[0] was always 0, but now it isn't initialized.
6584
6585 * src/table.c (table_grow): When conflict_table grew, the grown
6586 area wasn't cleared. Fix this.
6587
6588 * lib/.cvsignore: Add strdup.c, strdup.h.
6589 * m4/.cvsignore: Add strdup.m4.
6590
6591 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
6592
6593 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
6594 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
6595 GOTO_NUMBER_MAXIMUM, since we occasionally compute
6596 ngotos + 1 without checking for overflow.
6597 (build_relations): Use END_NODE, not -1, to denote end of edges.
6598 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
6599 build_relations): Use goto_number, not int, for goto numbers.
6600 * src/tables.c (save_column, default_goto): Likewise.
6601
6602 2004-11-23 Akim Demaille <akim@epita.fr>
6603
6604 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
6605 of #defining from yystype.
6606 Don't typedef yystype, C++ does not need it.
6607 This lets it possible to forward declare it as union.
6608
6609 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
6610
6611 * bootstrap (gnulib_modules): Add extensions.
6612 Problem reported by Jim Meyering.
6613
6614 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
6615
6616 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
6617 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
6618 src/system.h, src/tables.c: XFREE -> free, to accommodate
6619 recent change to gnulib xalloc.h.
6620 Problem reported by Jim Meyering.
6621
6622 2004-11-17 Akim Demaille <akim@epita.fr>
6623
6624 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
6625
6626 2004-11-17 Akim Demaille <akim@epita.fr>,
6627 Alexandre Duret-Lutz <adl@gnu.org>
6628
6629 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
6630 changes.
6631 (YYCDEBUG): Adjust.
6632 Use it instead of cdebug_.
6633 (Parser::debug_stream, Parser::set_debug_stream): New.
6634 (Parser::symprint_): Define cdebug_ for temporary backward
6635 compatibility.
6636 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
6637 debug_stream ().
6638
6639 2004-11-17 Akim Demaille <akim@epita.fr>
6640
6641 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
6642 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
6643 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
6644 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
6645
6646 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
6647
6648 * data/glr.c (yyloc_default): Remove; not used.
6649 Problem reported by Frank Heckenbach.
6650
6651 2004-10-25 Akim Demaille <akim@epita.fr>
6652
6653 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
6654 Introduce another definition to address simple location arrays.
6655 (yyGLRStack): New member: yyerror_range.
6656 (yyrecoverSyntaxError, yyparse): Update it.
6657 (yyrecoverSyntaxError): Use it when shifting the error token to
6658 have an accurate range, equivalent to the one computed by both
6659 yacc.c and lalr1.cc.
6660 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
6661 that column numbers start at column 0, as per GNU Coding
6662 Standards, the others tests, and the doc.
6663 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
6664 Adjust to the above change (first column is 0).
6665 And adjust the location of the "<error>", now covering the whole
6666 line.
6667
6668 2004-10-22 Akim Demaille <akim@epita.fr>
6669 and Paul Eggert <eggert@cs.ucla.edu>
6670
6671 Remove some arbitrary limits on goto numbers and relations.
6672 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
6673 initial values, since they're never used.
6674 (set_goto_map): ngotos is now unsigned, so test for overflow
6675 by seeing whether it wraps around to zero.
6676 * src/lalr.h (goto_number): Now size_t, not short int.
6677 (GOTO_NUMBER_MAXIMUM): Remove.
6678 * src/relation.c (relation_print, traverse, relation_transpose):
6679 Check for END_NODE rather than looking at sign.
6680 * src/relation.h (END_NODE): New macro.
6681 (relation_node): Now size_t, not short int.
6682
6683 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
6684
6685 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
6686 keyword, not an identifier. Problem reported by Baron Schwartz in
6687 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
6688
6689 2004-10-11 Akim Demaille <akim@epita.fr>
6690
6691 * src/symtab.c (symbol_check_alias_consistency): Also check
6692 type names, destructors, and printers.
6693 Reported by Alexandre Duret-Lutz.
6694 Recode the handling of associativity and precedence in terms
6695 of symbol_precedence_set.
6696 Accept no redeclaration at all, not even equal to the previous
6697 value.
6698 (redeclaration): New.
6699 Use it to factor redeclaration complaints.
6700 (symbol_make_alias): Don't set the type of the alias, let
6701 symbol_check_alias_consistency do it as for other features.
6702 * src/symtab.h (symbol): Add new member prec_location, and
6703 type_location.
6704 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
6705 * tests/input.at (Incompatible Aliases): New.
6706
6707 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
6708
6709 .cvsignore fixes to accommodate gnulib changes,
6710 and the practice of naming build directories "_build".
6711 * .cvsignore: Add "_*". Sort.
6712 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
6713 * m4/.cvsignore: Add "*_gl.m4".
6714
6715 2004-10-06 Akim Demaille <akim@epita.fr>
6716
6717 * src/parse-gram.y (add_param): Fix the truncation of trailing
6718 spaces.
6719
6720 2004-10-05 Akim Demaille <akim@epita.fr>
6721
6722 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
6723 whether the reducion was empty or not. This leaves room to
6724 improve the use of YYLLOC_DEFAULT in such a case.
6725 lalr1.cc is still experimental, so changing this is acceptable.
6726 And finally, there are probably not many users who changed the
6727 handling of locations in GLR, so changing is admissible too.
6728
6729 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
6730 empty reduction, set @$ to an empty location ending the previously
6731 stacked symbol.
6732 Adjust uses to make sure the code is triggered on empty
6733 reductions.
6734 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
6735 expected output: empty reductions have empty locations.
6736
6737 2004-09-29 Akim Demaille <akim@epita.fr>
6738
6739 * data/lalr1.cc: Move towards a more standard C++ coding style
6740 for templates: Class < T > -> Class<T>.
6741
6742 2004-09-29 Akim Demaille <akim@epita.fr>
6743
6744 * data/lalr1.cc: Reinstall the former ctor, for sake of
6745 compatibility, but warn it will be removed.
6746 Move towards a more standard C++ coding style (i.e., type *var ->
6747 type* var).
6748
6749 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
6750
6751 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
6752 since it's less likely to work if NULs are involved in the future.
6753
6754 2004-09-27 Akim Demaille <akim@epita.fr>
6755
6756 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
6757
6758 2004-09-27 Akim Demaille <akim@epita.fr>
6759
6760 * data/lalr1.cc (b4_parse_param_decl_1): New.
6761 (b4_parse_param_decl): Use it to have different names between attribute
6762 and argument names.
6763 (b4_cc_constructor_call): Likewise.
6764
6765 2004-09-24 Akim Demaille <akim@epita.fr>
6766
6767 * src/parse-gram.y (add_param): Strip the leading and trailing
6768 blanks from a formal argument declaration.
6769 (YY_LOCATION_PRINT): New.
6770
6771 2004-09-24 Akim Demaille <akim@epita.fr>
6772
6773 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
6774 after the location.
6775
6776 2004-09-24 Akim Demaille <akim@epita.fr>
6777
6778 * doc/bison.texinfo (Table of Symbols): Sort.
6779
6780 2004-09-21 Akim Demaille <akim@epita.fr>
6781
6782 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
6783 the useless parentheses.
6784 Suggested by Paul Eggert.
6785
6786 2004-09-20 Akim Demaille <akim@epita.fr>
6787
6788 Let the initial-action act on the look-ahead, and use it for the
6789 "initial push" (corresponding to an hypothetical beginning-of-file).
6790 And let lalr1.cc honor %initial-action.
6791
6792 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
6793 example.
6794 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
6795 (Parser::Parser): Remove the ctor that used to initialize it.
6796 (Parser::parse): Like in the other skeletons, issue the "starting
6797 parse" message before any action.
6798 Honor %initial-action.
6799 Initialize the stacks with the lookahead.
6800 * data/yacc.c: Let $$ and @$ in %initial-action designate the
6801 look-ahead.
6802 Push them in the stacks.
6803 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
6804
6805 2004-09-20 Akim Demaille <akim@epita.fr>
6806
6807 * doc/bison.texinfo (Initial Action Decl): New.
6808
6809 2004-09-20 Akim Demaille <akim@epita.fr>
6810
6811 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
6812 clearer criterion to define it.
6813 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
6814 When reducing on an empty RHS, use the latest stacked location as
6815 location.
6816 yylloc is not always available.
6817 * data/glr.c: Likewise.
6818 Also, honor initial-actions.
6819
6820 2004-09-20 Akim Demaille <akim@epita.fr>
6821
6822 * data/yacc.c (YY_LOCATION_PRINT): New.
6823 Define when we know YYLTYPE's structure, i.e., when the default
6824 YYLLOC_DEFAULT is used.
6825 * data/c.m4 (b4_yysymprint_generate): Use it.
6826 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
6827 value of the result.
6828 (error_start_): Replace with...
6829 (error_range_): this location array.
6830 This allows to replace code relying on the implementation of
6831 locations by portable code.
6832 * data/yacc.c (yylerrsp): Replace with...
6833 (yyerror_range): this.
6834 Every time a token is popped, update yyerror_range[0], to have an
6835 accurate location for the error token.
6836 * data/glr.c (YY_LOCATION_PRINT): New.
6837 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
6838 deference a pointer.
6839 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
6840 report the location in %printers.
6841
6842 * src/scan-skel.l: Instead of abort, report error messages to ease
6843 understanding skeleton scanning failures.
6844
6845 2004-09-16 Akim Demaille <akim@epita.fr>
6846
6847 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
6848 (iterator, const_iterator): these, to be more in the C++ spirit.
6849 Also, return reverse iterators so that when displaying the stack
6850 we display its bottom first.
6851 (Parser::stack_print_, Parser::reduce_print_): Match the messages
6852 from yacc.c.
6853 We should probably use vector here though.
6854
6855 2004-09-16 Akim Demaille <akim@epita.fr>
6856
6857 Have more complete shift traces.
6858
6859 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
6860 to report Shifts instead of ad hoc YYDPRINTF invocations,
6861 including for the error token.
6862 * data/lalr1.cc (symprint_): Output the location.
6863 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
6864 output the location within the %printer.
6865 Activate GLR tests, at least to make sure they compile properly.
6866 They still don't pass though.
6867 * tests/calc.at: Adjust expect verbose output, since now "Entering
6868 state..." is on a different line than the "Shifting" message.
6869
6870 2004-09-08 Akim Demaille <akim@epita.fr>
6871
6872 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
6873 Bison directive from the Bison file to the invocation of this
6874 macro, so that these directives are passed to
6875 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
6876 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
6877 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
6878 the extra Bison directives instead of the whole series.
6879 Change the grammar so that there are recoverable errors, and
6880 unrecoverable errors. Now we can have the parser give up before
6881 consuming the whole input. As a result we now can observe that
6882 the lookahead is freed when needed.
6883 Change the parser source to parse argv[1] instead of a hard coded
6884 string.
6885 Simplify yylex, and give a value and location to EOF.
6886 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
6887 passed directives already coded in the file.
6888 Add some tests to check the location of "error".
6889 For some tests, the C++ parser is correct, and not yacc.c.
6890 For other tests, they provide different, but unsatisfying, values,
6891 so keep the C++ value so that at least one parser is "correct"
6892 according to the test suite.
6893 (Actions after errors): Remove, this is subsumed by the
6894 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
6895
6896 2004-09-06 Akim Demaille <akim@epita.fr>
6897
6898 * data/lalr1.cc: Adjust the indentation of the labels.
6899 (Parser::pop): New.
6900 Use it.
6901
6902 2004-09-06 Akim Demaille <akim@epita.fr>
6903
6904 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
6905 argument, an informative message.
6906 Call YY_SYMBOL_PRINT.
6907 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
6908 * data/lalr1.cc (destruct_): Likewise.
6909 In addition, no longer depend on b4_yysymprint_generate and
6910 b4_yydestruct_generate to generate these functions, do it "by
6911 hand".
6912
6913 2004-09-03 Akim Demaille <akim@epita.fr>
6914
6915 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
6916 invoked, yydestruct the lookahead.
6917 * tests/calc.at (Calculator $1): Update the expected lengths of
6918 traces: there is an added line for the discarded lookahead.
6919 * doc/bison.texinfo (Destructor Decl): Some rewording.
6920 Define "discarded" symbols.
6921
6922 2004-09-02 Akim Demaille <akim@epita.fr>
6923
6924 * data/lalr1.cc (translate_, destruct_): No reason to be static.
6925
6926 2004-09-02 Akim Demaille <akim@epita.fr>
6927
6928 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
6929 (YYDSYMPRINTF): Rename as...
6930 (YY_SYMBOL_PRINT): this.
6931 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
6932 two.
6933 Use it instead of direct symprint_ calls.
6934 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
6935 one.
6936
6937 2004-09-02 Akim Demaille <akim@epita.fr>
6938
6939 * data/lalr1.cc (b4_yysymprint_generate): New.
6940 (symprint_): New member function, defined when YYDEBUG.
6941 Use it consistently instead of token/nterm debugging output by
6942 hand.
6943 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
6944 %printer calls to use cdebug_ when using lalr1.cc.
6945
6946 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
6947
6948 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
6949 with #ifdef YYDEBUG.
6950
6951 2004-08-26 Akim Demaille <akim@epita.fr>
6952
6953 * doc/bison.texinfo (Implementing Loops): Rename as...
6954 (Implementing Gotos/Loops): this.
6955
6956 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
6957
6958 Adjust to latest gnulib.
6959 * bootstrap (gnulib_modules): Add xalloc-die.
6960 Set LC_ALL=C so that file names sort consistently.
6961 Prefer the gnulib copies of gettext.m4, glibc21.m4,
6962 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
6963 uintmax_t.m4, ulonglong.m4.
6964 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
6965 po.m4 since we are now using _gl.m4 instead.
6966
6967 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
6968
6969 * src/scan-action.l: Remove. Scanning of semantic actions is
6970 handled in scan-gram.l.
6971
6972 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
6973
6974 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
6975
6976 * src/location.h (struct): The file member is a uniqstr.
6977 (equal_boundaries): Use UNIQSTR_EQ for comparison.
6978
6979 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
6980
6981 Fix bug with non-%union parsers that have printers or destructors,
6982 which led to a Bison core dump. Reported by Peter Fales in
6983 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
6984
6985 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
6986 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
6987 not to our own type.
6988 * src/output.c (symbol_destructors_output, symbol_printers_output):
6989 Don't assume %union.
6990 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
6991 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
6992 UNION-FLAG. All callers changed.
6993 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
6994 Use type char, not unsigned int, when declaring an array of char;
6995 this lets us remove a cast.
6996 (Printers and Destructors): Add non-%union test cases.
6997
6998 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6999
7000 * doc/bison.texinfo: Minor editorial changes, mostly to the new
7001 GLR writeups. E.g., avoid frenchspacing and the future tense,
7002 change "lookahead" to "look-ahead", and change "wrt" to "with
7003 respect to".
7004
7005 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7006
7007 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
7008 New sections, split off from the GLR Parsers section. Put the new
7009 Simple GLR Parser near the start of the GLR section, for clarity.
7010 Rewrite connective text.
7011
7012 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
7013
7014 * doc/bison.texinfo (Simple GLR Parsers): New section.
7015
7016 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7017
7018 * NEWS, TODO, doc/bison.texinfo:
7019 Use "look-ahead" instead of "lookahead", to be consistent.
7020 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
7021 while we're fixing "look-ahead".
7022 * src/conflicts.c (shift_set): Renamed from shiftset.
7023 (look_ahead_set): Renamed from lookaheadset.
7024 * src/print.c: Likewise.
7025 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
7026 name for "lookahead".
7027 (report_types, usage): Likewise.
7028 * src/getargs.h (report_look_ahead_tokens): Renamed from
7029 report_lookaheads.
7030 * src/lalr.c (compute_look_ahead_tokens): Renamed from
7031 compute_lookaheads.
7032 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
7033 (look_ahead_tokens_print): Renamed from lookaheads_print.
7034 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
7035 state_rule_lookaheads_print.
7036 * src/state.h: Likewise.
7037 (reductions.look_ahead_tokens): Renamed from lookaheads.
7038 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
7039 AT_DATA_LOOKAHEADS_GRAMMAR.
7040
7041 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
7042
7043 * README: Update location of patched M4 distribution.
7044
7045 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
7046
7047 Don't assume the C++ compiler takes the same arguments as the C compiler
7048 (trivial change).
7049 * configure.ac (O0CXXFLAGS): New var.
7050 * tests/atlocal.in (CXXFLAGS): Use it.
7051
7052 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
7053
7054 Fix some "make check" problems with C++ reported by
7055 Albert Chin-A-Young for Tru64 C++ in this thread:
7056 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
7057
7058 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
7059 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7060 Output to a .cc file for C++, not to a .c file.
7061 * tests/calc.at (AT_CHECK_CALC): Likewise.
7062 * tests/regression.at (AT_CHECK_DANCER): Likewise.
7063 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
7064
7065 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
7066
7067 * tests/calc.at, tests/actions.at: Workaround for SGI
7068 C++ compiler. (trivial change)
7069
7070 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
7071
7072 Spent a few hours checking out which prerequisite versions the
7073 current sources actually require. I went all the way back to
7074 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
7075 a seemingly endless set of combinations of versions more recent
7076 than that. The bottom line is that the current sources require
7077 fairly recent versions of the build tools, and it'll be some work
7078 to change this.
7079 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
7080 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
7081 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
7082 Add comments explaining why those particular versions are
7083 currently needed.
7084
7085 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
7086 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
7087 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
7088
7089 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
7090 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
7091
7092 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
7093
7094 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
7095 0.11.5. Suggested by Bruno Haible.
7096 * bootstrap: Remove gettext version checking.
7097
7098 * doc/bison.texinfo (Decl Summary): Also mention that %union
7099 can depend on prerequisite types. Problem reported by Tim
7100 Van Holder.
7101
7102 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
7103
7104 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
7105 * README-alpha: Don't tell people not to package this.
7106
7107 * bootstrap: Don't assume $(...) works; use `...` instead.
7108 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
7109 gettext better.
7110
7111 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
7112 put into the -d output file, and mention what to do if YYSTYPE is
7113 defined as a macro.
7114
7115 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
7116
7117 Undo change made earlier today: it caused autopoint to not bring
7118 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
7119 autopoint's.
7120
7121 * bootstrap: Check that gettext version matches what's in
7122 configure.ac. Warn users to ignore robots.txt ERROR 404.
7123 * bootstrap: Undo today's earlier change (logged below).
7124 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
7125
7126 The gettext version checking is causing more trouble than it's
7127 curing; remove it. Problem reported by Paul Hilfinger.
7128
7129 * bootstrap: Issue a warning that one can expect a message
7130 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
7131 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
7132
7133 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
7134
7135 Ensure that the C++ compiler used for testing actually works on a
7136 simple test program; if not, skip the C++-related tests. Problem
7137 reported by Vin Shelton in:
7138 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
7139
7140 * m4/cxx.m4: New file.
7141 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
7142 * tests/atlocal.in (BISON_CXX_WORKS): Add.
7143 * tests/local.at (AT_COMPILE_CXX): Use it.
7144
7145 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7146
7147 * data/glr.c (yylloc): Output this macro even if locations are not
7148 being generated, as the GLR parser needs it even in that case.
7149 Problem reported by Troy A. Johnson
7150 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
7151
7152 * configure.ac (AC_INIT): Update to 1.875e.
7153
7154 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7155
7156 * NEWS: Version 1.875d.
7157 * configure.ac (AC_INIT): Likewise.
7158 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
7159
7160 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
7161 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
7162 lalr1.cc runs afoul of the first, and the last two are no longer
7163 supported by GCC 3.4.0.
7164 * README: Mention GNU m4 1.4 or later; mention m4 patches.
7165 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
7166
7167 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
7168
7169 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
7170 unsigned int, for compatibility with latest gnulib hash module.
7171 * src/state.c (state_hash, state_hasher): Likewise.
7172 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
7173 * src/uniqstr.c (hash_uniqstr): Likewise.
7174
7175 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
7176
7177 * NEWS: Unescaped newlines are no longer allowed in char & strings.
7178
7179 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
7180 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
7181 character and string literals.
7182 (unexpected_end): New function.
7183 (unexpected_eof): Use it.
7184 (unexpected_newline): New function.
7185 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
7186 actions.
7187
7188 * NEWS: Document %expect-rr.
7189
7190 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
7191 Fix typo by replacing $1 with $option.
7192 Remove more 'intl'-related files.
7193 Don't DEFUN AM_INTL_SUBDIR twice.
7194
7195 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
7196 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
7197 strtoul.c.
7198 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
7199 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
7200 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
7201 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
7202 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
7203 * src/.cvsignore: Add *.output.
7204
7205 * src/parse-gram.y: Put copyright notice inside %{ %} so it
7206 gets copied to the output file.
7207
7208 2004-04-28 Paul Eggert <eggert@twinsun.com>
7209
7210 Get files from the gnulib and po repositories, instead of relying
7211 on them being in our CVS. Upgrade to latest versions of gnulib
7212 and Automake.
7213
7214 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
7215 * bootstrap: Bootstrap from gnulib and po repositories.
7216 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
7217 * README-cvs: Document these changes. Remove version numbers from
7218 mentions of build tools, since they change so often. Mention Flex.
7219
7220 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
7221 (gl_USE_SYSTEM_EXTENSIONS): Add.
7222 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
7223 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
7224 does this for us.
7225 (AC_ISC_POSIX): Remove; we no longer support this
7226 ancient OS, as it gets in the way of latest Autoconf & gnulib.
7227 (AC_HEADER_STDC): Remove: we now assume C89 or better.
7228 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
7229 Do not check for C89 headers, except for locale.h which is used
7230 by the Yacc library and must port to K&R hosts.
7231 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
7232 Do not check for C89 functions, except for setlocale which is
7233 used by the Yacc library.
7234 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
7235 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
7236 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
7237 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
7238 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
7239 AM_GNU_GETTEXT): Remove; now done by:
7240 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
7241 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
7242 for us.
7243
7244 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
7245 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
7246 Define to empty, as gnulib.mk will do the rest for us.
7247 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
7248 for us.
7249 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
7250 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
7251
7252 * src/files.c: Include gnulib's xstrndup.h.
7253
7254 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
7255 (REALLOC): Use xnrealloc, for likewise.
7256 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
7257 (strnlen, memrchr): Remove decls; functions no longer used.
7258 Include <stpcpy.h>.
7259
7260 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
7261 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7262 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
7263 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
7264 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
7265 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
7266 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
7267 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
7268 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
7269 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
7270 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
7271 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7272 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
7273 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
7274 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
7275 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
7276 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
7277 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
7278 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
7279 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
7280 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
7281 Remove, as these files are now generated automatically
7282 by bootstrap or automake.
7283
7284 * po/ChangeLog: Remove: all but one entry was a duplicate
7285 of this file, and I moved that 2000-11-02 entry here.
7286
7287 * config/.cvsignore: Add Makefile, depcomp, install-sh.
7288 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
7289 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
7290 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
7291 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
7292 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
7293 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
7294 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
7295 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
7296 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
7297 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
7298 xstrndup.h.
7299 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
7300 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
7301 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
7302 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
7303 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
7304 * src/.cvsignore: Remove *_.c.
7305
7306
7307 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
7308 support it. (The latest stable gzip doesn't.)
7309
7310 2004-04-27 Paul Eggert <eggert@twinsun.com>
7311
7312 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
7313 case, as stos_ is now used by destructors due to the 2004-02-09
7314 change.
7315
7316 Remove more K&R C support.
7317 * lib/libiberty.y (PARAMS): Remove. All uses removed.
7318 * lib/subpipe.c (errno): Remove decl.
7319 Include <stdlib.h> unconditionally.
7320 (EXIT_FAILURE): Remove macro.
7321 * src/complain.c (vfprintf, strerror): Remove.
7322 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
7323 unconditionally.
7324 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
7325 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
7326 (strchr, strspn, memchr): Remove decls.
7327 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
7328 unconditionally. Do not declare perror.
7329 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
7330 unconditionally.
7331
7332 * src/complain.c (_): Remove useless defn, as system.h defines this.
7333
7334 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
7335 with latest obstack.h.
7336 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
7337 to procedure types, as obstack.h now does that for us.
7338 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
7339
7340 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
7341 so that this include file can stand alone.
7342 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
7343 does this now. Include subpipe.h first after config.h, to
7344 test whether it can stand alone.
7345
7346 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
7347 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
7348 unused declaration.
7349
7350 * tests/synclines.at (%union synch line): Put a dummy member in
7351 the union, because empty unions aren't allowed in C. Caught
7352 by GCC 3.4.0.
7353
7354 2004-04-13 Jim Meyering <jim@meyering.net>
7355
7356 * src/conflicts.c (conflicts_print): Correct format string typo:
7357 use `%%' to produce literal `%'. (trivial change)
7358
7359 2004-03-30 Paul Eggert <eggert@twinsun.com>
7360
7361 * src/getargs.c (version): Update copyright year to 2004.
7362
7363 * data/c.m4 (b4_int_type): Use 'short int' rather than
7364 'short', and similarly for 'long', 'unsigned', etc.
7365 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
7366 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
7367 yy_yypstack, yydumpstack): Likewise.
7368 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
7369 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
7370 Likewise.
7371 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
7372 yy_stack_print, yyparse): Likewise.
7373 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
7374 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
7375 * lib/bitset.c (bitset_print): Likewise.
7376 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
7377 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7378 * lib/bitsetv.c (bitsetv_dump): Likewise.
7379 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
7380 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
7381 Likewise.
7382 * src/LR0.c (allocate_itemsets): Likewise.
7383 * src/gram.h (rule_number, rule): Likewise.
7384 * src/lalr.h (goto_number): Likewise.
7385 * src/nullable.c (nullable_compute): Likewise.
7386 * src/output.c (prepare_rules): Likewise.
7387 * src/relation.c (relation_print, relation_digraph): Likewise.
7388 * src/relation.h (relation_node): Likewise.
7389 * src/state.h (state_number, transitions, errs, reductions,
7390 struct state): Likewise.
7391 * src/symtab.h (symbol_number, struct symbol): Likewise.
7392 * src/tables.c (vector_number, tally, action_number,
7393 default_goto, goto_actions): Likewise.
7394 * tests/existing.at (GNU Cim Grammar): Likewise.
7395 * tests/regression.at (Web2c Actions): Likewise.
7396
7397 * src/output.c (muscle_insert_short_int_table): Renamed from
7398 muscle_insert_short_table. All uses changed.
7399
7400 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7401
7402 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
7403 (declaration): Replace expected_conflicts with expected_sr_conflicts.
7404 Add %expect-rr rule.
7405
7406 * src/scan-gram.l: Recognize %expect-rr.
7407
7408 * src/conflicts.h (expected_sr_conflicts): Rename from
7409 expected_conflicts.
7410 (expected_rr_conflicts): Declare.
7411
7412 * src/conflicts.c (expected_sr_conflicts): Rename from
7413 expected_conflicts.
7414 (expected_rr_conflicts): Define.
7415 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
7416 for GLR parsers.
7417 Use expected_sr_conflicts in place of expected_conflicts.
7418 Warn if expected_rr_conflicts used in non-GLR parser.
7419
7420 * doc/bison.texinfo: Add documentation for %expect-rr.
7421
7422 2004-03-08 Paul Eggert <eggert@gnu.org>
7423
7424 Add support for hex token numbers. Suggested by Odd Arild Olsen in
7425 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
7426
7427 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
7428 in lalr1.cc.
7429 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
7430 * src/scan-gram.l (scan_integer): New function.
7431 ({int}): Use it.
7432 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
7433 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
7434 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
7435 Say "long int", not "long", for uniformity with GNU style.
7436
7437 2004-02-25 Paul Eggert <eggert@twinsun.com>
7438
7439 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
7440 compilers. This fixes a problem with Intel's C++ compiler being
7441 chatty, reported by Guido Trentalancia in
7442 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
7443
7444 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
7445
7446 Support %destructor and merge error locations in lalr1.cc.
7447
7448 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
7449 (Parser::stos_): Define unconditionally.
7450 (Parser::destruct_): New method. Generate its body with
7451 b4_yydestruct_generate.
7452 (Parser::error_start_): New attribute.
7453 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
7454 token which are discarded.
7455 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
7456 error_start_ when erroneous token are discarded.
7457 (Parser::parse) <yyerrlab1>: Compute the location of the error
7458 token so that it covers all the discarded tokens.
7459 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
7460 it can be called with `%skeleton "lalr1.cc"', and do that.
7461
7462 2004-02-02 Paul Eggert <eggert@twinsun.com>
7463
7464 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
7465 $(top_srcdir)/lib and ../lib. This fixes a bug reported
7466 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
7467 There's no need to mention top_builddir since Automake does that
7468 for us.
7469 (INCLUDES): Remove, as Automake says it's obsolescent.
7470 Contents migrated into AM_CPPFLAGS as described above.
7471 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
7472
7473 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7474
7475 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
7476 (yyreportSyntaxError): Handle case where lookahead token is
7477 YYEMPTY.
7478
7479 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7480
7481 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
7482 resulting parsers are compilable with C++.
7483
7484 2003-12-23 Paul Eggert <eggert@twinsun.com>
7485
7486 * config/depcomp, config/install-sh: Sync with Automake 1.8.
7487 * src/output.c (output_skeleton): Rename local var.
7488 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
7489 Bison tokens, as this runs afoul of the 2003-10-07 change that
7490 disallowed NUL bytes in character constants or string literals.
7491
7492 * tests/local.at: Require Autoconf 2.59's Autotest.
7493 * tests/testsuite.at: Don't include local.at, since we now assume
7494 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
7495 including it.
7496 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
7497 multiple inclusion warnings.
7498
7499 2003-12-02 Akim Demaille <akim@epita.fr>
7500
7501 * doc/bison.texinfo (How Can I Reset the Parser): More about start
7502 conditions.
7503 From Bruno Haible.
7504
7505 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
7506
7507 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
7508
7509 2003-10-07 Paul Eggert <eggert@twinsun.com>
7510
7511 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
7512 if testsuite doesn't exist.
7513
7514 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
7515 literals, unfortunately.
7516 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
7517 Complain about NUL bytes in character constants or string literals.
7518
7519 2003-10-05 Paul Eggert <eggert@twinsun.com>
7520
7521 * NEWS: Don't document %no-default-prec, as it's still
7522 too experimental.
7523 * doc/bison.texinfo: Document %no-default-prec only if
7524 the defaultprec flag is set. Normally it's not.
7525
7526 2003-10-04 Paul Eggert <eggert@twinsun.com>
7527
7528 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
7529 non-modifiable lvalue, instead of a modifiable one.
7530 * doc/bison.texinfo (Actions): Document that $$ can
7531 be assigned to. Do not claim that $$ and $N are
7532 array element references: user code should not rely on this.
7533
7534 2003-10-01 Paul Eggert <eggert@twinsun.com>
7535
7536 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
7537 (grammar_declaration): Use it.
7538 * src/scan-gram.l: New token %no-default-prec.
7539 * tests/conflicts.at: Revamp tests to use %no-default-prec.
7540 * NEWS, doc/bison.texinfo: Document the above.
7541
7542 2003-10-01 Akim Demaille <akim@epita.fr>
7543
7544 VCG no longer supports long_straight_phase.
7545
7546 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
7547 * src/print_graph.c (print_graph): Adjust.
7548
7549 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
7550 and Paul Eggert <eggert@twinsun.com>
7551
7552 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
7553 Table of Symbols): Document %default-prec.
7554 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
7555 (grammar_declaration): Set default_prec on %default-prec.
7556 * src/scan-gram.l (%default-prec): New token.
7557 * src/reader.h (default_prec): New flag.
7558 * src/reader.c: Likewise.
7559 (packgram): Handle it.
7560 * tests/conflicts.at (%default-prec without %prec,
7561 %default-prec with %prec, %default-prec 1): New tests.
7562
7563 2003-09-30 Paul Eggert <eggert@twinsun.com>
7564
7565 * tests/testsuite.at: Include local.at, not input.at, fixing
7566 a typo in the 2003-08-25 patch.
7567
7568 2003-08-27 Akim Demaille <akim@epita.fr>
7569
7570 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
7571 GCC warnings.
7572
7573 2003-08-26 Akim Demaille <akim@epita.fr>
7574
7575 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
7576 "<\#" to avoid magic from Gnus when posting parts of this script.
7577
7578 2003-08-26 Akim Demaille <akim@epita.fr>
7579
7580 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
7581 (Parser::parse): here.
7582 Adjust: nerrs and errstatus is now replaced by...
7583 (Parser::nerrs_, Parser::errstatus_): New.
7584
7585 2003-08-25 Akim Demaille <akim@epita.fr>
7586
7587 * config/announce-gen, Makefile.cfg: New.
7588 * Makefile.am: Adjust.
7589 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
7590 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
7591
7592 2003-08-25 Akim Demaille <akim@epita.fr>
7593
7594 When reducing initial empty rules, Bison parser read an initial
7595 location that is not defined. This results in garbage, and that
7596 affects Bison's own parser. Therefore we need (i) to extend Bison
7597 to support a means to initialize this location, and (ii) to use
7598 this CVS Bison to fix CVS Bison's parser.
7599
7600 * src/reader.h, reader.c (epilogue_augment): Remove, replace
7601 with...
7602 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
7603 * src/parse-gram.y: Adjust.
7604 (%initial-action): New.
7605 (%error-verbose): Since we require CVS Bison, there is no reason
7606 not to use it.
7607 * src/scan-gram.l: Adjust.
7608 * src/Makefile.am (YACC): New, to make sure we use our own parser.
7609 * data/yacc.c (yyparse): Use b4_initial_action.
7610
7611 2003-08-25 Akim Demaille <akim@epita.fr>
7612
7613 * doc/bison.texinfo: Don't promote stdout for error messages.
7614
7615 2003-08-25 Akim Demaille <akim@epita.fr>
7616
7617 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
7618 From Alexandre Duret-Lutz.
7619
7620 2003-08-25 Akim Demaille <akim@epita.fr>
7621
7622 Version 1.875c.
7623
7624 2003-08-25 Akim Demaille <akim@epita.fr>
7625
7626 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
7627 Use them.
7628
7629 2003-08-25 Akim Demaille <akim@epita.fr>
7630
7631 * data/lalr1.cc (Parser::reduce_print_): New.
7632 Use it.
7633
7634 2003-08-25 Akim Demaille <akim@epita.fr>
7635
7636 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
7637 error recovery loops. This patch is based on
7638 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
7639 Also, augment the similarity between lalr1.cc and yacc.c.
7640 Note: the locations of error recovery rules are not correct yet.
7641
7642 * data/lalr1.cc: Comment changes to augment the similarity between
7643 lalr1.cc and yacc.c.
7644 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
7645 (yyerrlab1): Remove, but where it used to be (now the bottom part of
7646 yyerrlab), when hitting EOF, pop the whole stack here instead of
7647 merely falling thru the default error handling mechanism.
7648 (yyerrorlab): New label, with the old contents of YYERROR,
7649 plus the following change: pop the stack of rhs corresponding
7650 to the production that invoked YYERROR. That is how Yacc
7651 behaves (required by POSIX).
7652 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
7653 fail.
7654
7655 2003-08-25 Akim Demaille <akim@epita.fr>
7656
7657 Tune local.at so that people can "autom4te -l autotest calc.at -o
7658 calc" for instance, to extract a sub test suite.
7659
7660 * tests/testsuite.at: Move the initialization, Autotest version
7661 requirement, and AT_TESTED invocation into...
7662 * tests/local.at: here.
7663 * tests/testsuite.at: Include it for compatibility with Autoconf
7664 2.57.
7665 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
7666 be ignore.
7667
7668 2003-08-04 Paul Eggert <eggert@twinsun.com>
7669
7670 Rework code slightly to avoid gcc -Wtraditional warnings.
7671 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
7672 The returned value is now stored in *YY0. All callers changed.
7673 * src/output.c (merge_output): Adjust to the above change.
7674
7675 2003-07-26 Paul Eggert <eggert@twinsun.com>
7676
7677 * data/glr.c (YYASSERT): New macro.
7678 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
7679 yyresolveStates, yyprocessOneStack):
7680 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
7681 Derived from a suggestion by Frank Heckenbach.
7682
7683 2003-07-25 Paul Eggert <eggert@twinsun.com>
7684
7685 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
7686 for portability to K&R C (after ansi2knr, presumably). See
7687 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
7688 by Frank Heckenbach, though I have omitted the structure-initialization
7689 part of his glr-knr.diff patch since I recall that the Portable
7690 C Compiler didn't require that change.
7691
7692 Let the user specify how to allocate and free memory.
7693 Derived from a suggestion by Frank Heckenbach in
7694 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
7695 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
7696 All uses of free, malloc, realloc changed to use these macros,
7697 and unnecessary casts removed.
7698 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
7699
7700 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
7701
7702 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
7703 use s.empty() rather than s == "" to test for empty string; see
7704 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
7705 (trivial change)
7706
7707 2003-06-25 Akim Demaille <akim@epita.fr>
7708
7709 * config/depcomp, config/install-sh: Update from masters.
7710
7711 2003-06-20 Paul Eggert <eggert@twinsun.com>
7712
7713 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
7714 and return properly parenthesized result.
7715 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
7716 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7717 Remove unnecessary parentheses from uses.
7718 * doc/bison.texinfo (Location Default Action): Describe the
7719 conventions for parentheses.
7720
7721 2003-06-19 Paul Eggert <eggert@twinsun.com>
7722
7723 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
7724 yyreportTree): Do not assume that size_t is the same width as int,
7725 when printing sizes. Print sizes using an unsigned format.
7726 Problem reported by Frank Heckenbach in
7727 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
7728
7729 Port to Forte Developer 7 C compiler.
7730 * data/glr.c (struct YYLTYPE): If locations are not being used,
7731 declare a single dummy member, as empty structs do not conform
7732 to the C standard.
7733 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
7734 the Forte Developer 7 C compiler complains that end-of-loop
7735 code is not reached.
7736
7737 2003-06-17 Paul Eggert <eggert@twinsun.com>
7738
7739 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
7740 avoid warnings from picky compilers about redefinition of PARAMS.
7741
7742 2003-06-17 Paul Eggert <eggert@twinsun.com>
7743
7744 Version 1.875b.
7745
7746 * NEWS: Document 1.875b.
7747
7748 * lib/bbitset.h: Do not include config.h; that's the includer's job.
7749 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
7750 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
7751 Don't use 'index' in comments, as it's a builtin fn on some hosts.
7752 * lib/bitset_stats.c: Include gettext.h unconditionally, as
7753 per recent gettext manual's suggestion.
7754 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
7755 Use prototypes, not old-style definitions.
7756 * lib/lbitset.c (lbitset_unused_clear): Likewise.
7757 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
7758 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
7759 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
7760 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
7761 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
7762 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
7763 vbitset_or_and_cmp, vbitset_copy): Likewise.
7764
7765 * lib/libiberty.h: Do not include config.h; that's the includer's job.
7766 Do not include <stdlib.h>.
7767 (PARAMS): Define unconditionally for C89.
7768 (ATTRIBUTE_NORETURN): Remove.
7769 (ATTRIBUTE_UNUSED): Define unconditionally.
7770
7771 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
7772 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
7773 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
7774 * lib/vbitset.c, lib/vbitset.h: New files.
7775 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
7776 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
7777 from libbitset.
7778
7779 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
7780 `How Can I Reset @code{yyparse}', since texinfo does not allow
7781 arbitrary @ in node names.
7782
7783 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
7784 shouldn't be needed according to the gettext 0.12.1 documentation
7785 but which seem to be needed anyway: codeset.m4 glibc21.m4
7786 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
7787 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
7788 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
7789
7790 * lib/.cvsignore: Add stdbool.h.
7791 * m4/.cvsignore: Add nls.m4, po.m4.
7792
7793 Upgrade to CVS gnulib.
7794 * stdbool_.h: File renamed from stdbool.h.in.
7795 * configure.ac (AM_STDBOOL_H): Invoke this instead of
7796 AC_HEADER_STDBOOL.
7797 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
7798 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
7799 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
7800 (MOSTLYCLEANFILES): New var.
7801 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
7802 (stdbool.h): New rule.
7803 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
7804 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
7805 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
7806 m4/quote.m4: Upgrade to today's gnulib.
7807
7808 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
7809 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
7810 the tests right now.
7811 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
7812 yyerror are declared before use; C99 requires this.
7813
7814 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7815
7816 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
7817 first.
7818 (yyrecoverSyntaxError): Correct the logic for setting and testing
7819 yyerrState.
7820 Correct comment on handling EOF.
7821 Allow states with only a default reduction, rather than failing
7822 (I can't quite reconstruct why these were not allowed before).
7823
7824 Fixes to avoid problem that $-N rules in GLR parsers can cause
7825 buffer overruns, corrupting state.
7826
7827 * src/output.c (prepare_rules): Output max_left_semantic_context
7828 definition.
7829 * src/reader.h (max_left_semantic_context): New variable declaration.
7830 * src/scan-gram.l (max_left_semantic_context): Define.
7831 (handle_action_dollar): Update max_left_semantic_context.
7832 * data/glr.c (YYMAXLEFT): New definition.
7833 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
7834 (yyresolveAction): Ditto.
7835
7836 Fixes to problems with location handling in GLR parsers reported by
7837 Frank Heckenbach (2003/06/05).
7838
7839 * data/glr.c (YYLTYPE): Make trivial if locations not used.
7840 (YYRHSLOC): Add parentheses, and define only if locations used.
7841 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
7842 locations not used.
7843 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
7844 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
7845
7846 * tests/cxx-type.at: Exercise location information; update tests
7847 to differentiate output with and without locations.
7848 Remove forward declarations of yylex and yyerror---caused errors
7849 because default YYLTYPE not yet defined.
7850 Change semantic actions to compute strings, rather than printing
7851 them directly (to test proper passing of semantics values). Change
7852 output to prefix notation and update test data and expected results.
7853 (yylex): Track locations.
7854 (stmtMerge): Return value rather than printing, and include arguments
7855 in value.
7856
7857 2003-06-03 Paul Eggert <eggert@twinsun.com>
7858
7859 Avoid warnings generated by GCC 2.95.4 when Bison is
7860 configured with --enable-gcc-warnings.
7861 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
7862 yy::]b4_parser_class_name[::translate_,
7863 yy::Stack::operator[] (unsigned),
7864 yy::Stack::operator[] (unsigned) const,
7865 yy::Slice::operator[] (unsigned),
7866 yy::Slice::operator[] (unsigned) const):
7867 Rename local vars to avoid warnings.
7868 * tests/glr-regression.at (Improper handling of embedded actions
7869 and $-N in GLR parsers): Remove unused local variable from yylex.
7870 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
7871 (void) as arg when not pure, since we now assume C89 when building
7872 Bison. Pacify GCC by using parameter.
7873
7874 2003-06-02 Paul Eggert <eggert@twinsun.com>
7875
7876 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
7877 yy::Location::lines, yy::Location::columns): Rename arguments
7878 to avoid shadowing; this removes a warning generated by GCC 3.3.
7879
7880 2003-06-01 Paul Eggert <eggert@twinsun.com>
7881
7882 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
7883 to g++, as GCC 3.3 complains if you do it.
7884 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
7885 everything that WARNING_CFLAGS has, except omit warnings
7886 not suitable for C++.
7887 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
7888 * tests/atlocal.in (CXXFLAGS): New var.
7889 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
7890
7891 Fix a GLR parser bug I reported in February; see
7892 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
7893 The problem was that GLR parsers did not conform to the C standard,
7894 because actions like { $1 = $2 + $3; } expanded to expressions
7895 that invoked YYFILL in separate subexpressions, and YYFILL assigned
7896 to a local variable. The C standard says that expressions
7897 like (var = f ()) + (var = f ()) have undefined behavior.
7898 Another problem was that GCC sometimes issues warnings that
7899 yyfill and its parameters are unused.
7900
7901 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
7902 as possibly unused.
7903 (yyfill): New function.
7904 (YYFILL): Use it.
7905 (yyuserAction): Change type of yynormal to bool, so that it matches
7906 the new yyfill signature. Mark it as possibly unused.
7907
7908
7909 Follow up on a bug I reported in February, where a Bison-generated
7910 parser can loop. Provide a test case and a fix for yacc.c. I
7911 don't have a fix for lalr1.cc or for glr.c, unfortunately.
7912 The original bug report is in:
7913 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
7914
7915 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
7916 macro's size was becoming unwieldy.
7917 (yyerrlab): Do not discard an empty lookahead symbol, as this
7918 might destroy garbage.
7919 (yyerrorlab): New label, with the old contents of YYERROR,
7920 plus the following change: pop the stack of rhs corresponding
7921 to the production that invoked YYERROR. That is how Yacc
7922 behaves, and POSIX requires this behavior.
7923 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
7924 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
7925 Define 'alarm' to do nothing if unistd.h is not available.
7926 Add a new rule "exp: '-' error;" to test the above change to
7927 data/yacc.c. Use 'alarm' to abort any test taking longer than
7928 10 seconds, as it's probably looping.
7929 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
7930 Also, the new yacc.c generates two fewer diagnostics for an
7931 existing test.
7932
7933 2003-05-24 Paul Eggert <eggert@twinsun.com>
7934
7935 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
7936 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
7937 This fixes a problem reported by John Bowman when the Compaq/HP
7938 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
7939 -ansi -Wall -gall).
7940 * data/yacc.c (union yyalloc): Likewise.
7941 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
7942
7943 Switch from 'int' to 'bool' where that makes sense.
7944
7945 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
7946 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
7947 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
7948 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
7949 Return or accept bool, not int. All callers changed.
7950 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
7951 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
7952 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
7953 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
7954 bitset_or_and_cmp_): Likewise.
7955 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
7956 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
7957 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
7958 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
7959 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
7960 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
7961 bitset_stats_or_and_cmp): Likewise.
7962 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
7963 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
7964 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
7965 ebitset_xor_cmp): Likewise.
7966 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
7967 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
7968 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
7969 lbitset_xor_cmp): Likewise.
7970 * lib/bbitset.h: Include <stdbool.h>.
7971 (struct bitset_vtable): The following members now return bool, not
7972 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
7973 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
7974 or_and_cmp).
7975 * src/conflicts.c (count_rr_conflicts): Likewise.
7976 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
7977 All uses changed.
7978 * lib/ebitset.c (ebitset_obstack_init): Likewise.
7979 * lib/lbitset.c (lbitset_obstack_init): Likewise.
7980 * src/getargs.c (debug_flag, defines_flag, locations_flag,
7981 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7982 graph_flag): Likewise.
7983 * src/getargs.h (debug_flag, defines_flag, locations_flag,
7984 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7985 graph_flag): Likewise.
7986 * src/output.c (error_verbose): Likewise.
7987 * src/output.h (error_verbose): Likewise.
7988 * src/reader.c (start_flag, typed): Likewise.
7989 * src/reader.h (typed): Likewise.
7990 * src/getargs.c (LOCATIONS_OPTION): New constant.
7991 (long_options, getargs): Use it.
7992 * src/lalr.c (build_relations): Use bool, not int.
7993 * src/nullable.c (nullable_compute): Likewise.
7994 * src/print.c (print_reductions): Likewise.
7995 * src/tables.c (action_row, pack_vector): Likewise.
7996 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
7997 * src/output.c (prepare): Use it.
7998 * src/output.c (token_definitions_output,
7999 symbol_destructors_output, symbol_destructors_output): Use string,
8000 not boolean integer, to keep track of whether to output separator.
8001 * src/print_graph.c (print_core): Likewise.
8002 * src/state.c (state_rule_lookaheads_print): Likewise.
8003
8004 * config/install-sh: Sync from automake 1.7.5.
8005
8006 2003-05-14 Paul Eggert <eggert@twinsun.com>
8007
8008 * src/parse-gram.y (rules_or_grammar_declaration): Require a
8009 semicolon after a grammar declaration, in the interest of possible
8010 future changes to the Bison input language.
8011 Do not allow a stray semicolon at the start of the grammar.
8012 (rhses.1): Allow one or more semicolons after any rule, including
8013 just before "|" as required by POSIX.
8014 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
8015 grammar.
8016
8017 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
8018
8019 %parse-param support for lalr1.cc.
8020
8021 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
8022 b4_cc_constructor_calls, b4_cc_constructor_call,
8023 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
8024 definitions.
8025 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
8026 parse-param arguments.
8027 (yy::b4_parser_class_name): Declare instance variables to
8028 hold parse-param arguments.
8029 * tests/calc.at: s/value/semantic_value/ because value clashes
8030 with a member of yy::b4_parser_class_name. Adjust C++ code
8031 to handle %parse-param. Enable %parse-param test in C++.
8032
8033 2003-05-12 Paul Eggert <eggert@twinsun.com>
8034
8035 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
8036 English a bit. Fix fclose typo. Change "const char" to "char
8037 const", and use ANSI C rather than K&R for "main". Suggest
8038 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
8039 and suggest yy_switch_to_buffer.
8040
8041 2003-05-05 Paul Eggert <eggert@twinsun.com>
8042
8043 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
8044 C89. This avoids a diagnostic on compilers that define __STDC__
8045 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
8046 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
8047
8048 2003-05-03 Paul Eggert <eggert@twinsun.com>
8049
8050 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
8051 Do not overrun array bounds.
8052 This should fix a bug reported today by Olatunji Oluwabukunmi in
8053 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
8054
8055 2003-04-29 Akim Demaille <akim@epita.fr>
8056
8057 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
8058 * src/getargs.c, src/getargs.h: here, as bool, not int.
8059 (nondeterministic_parser): New.
8060 * src/parse-gram.y, src/scan-gram.l: Support
8061 %nondeterministic-parser.
8062 * src/output.c (prepare): Use nondeterministic_parser instead
8063 of glr_parser where appropriate.
8064 * src/tables.c (conflict_row, action_row, save_row)
8065 (token_actions, token_actions, pack_vector): Ditto.
8066
8067 2003-04-29 Akim Demaille <akim@epita.fr>
8068
8069 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
8070
8071 2003-04-29 Akim Demaille <akim@epita.fr>
8072
8073 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
8074 with %pure-parser and %locations to exercise the patch from Yakov
8075 Markovitch below.
8076
8077 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
8078
8079 * data/yacc.c: (b4_lex_param): Corrected for the case where
8080 %lex-param is provided and %pure-parser isn't.
8081
8082 2003-04-27 Paul Eggert <eggert@twinsun.com>
8083
8084 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
8085 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
8086 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
8087 if it is not defined.
8088 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
8089
8090 2003-04-26 Paul Eggert <eggert@twinsun.com>
8091
8092 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
8093 Declare to be of type suitable for the ninf value itself, not of
8094 type suitable for the corresponding table, since the latter might
8095 be unsigned but the ninf value might be negative. This fixes a
8096 bug reported by Alexandre Duret-Lutz in
8097 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
8098
8099 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
8100 invokes it. We shouldn't invoke it twice because it will attempt
8101 to put error.o in the archive twice. This fixes a glitch reported
8102 by Martin Mokrejs in
8103 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
8104
8105 2003-04-21 Paul Eggert <eggert@twinsun.com>
8106
8107 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
8108 to gnulib.
8109
8110 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
8111
8112 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
8113 Fix obvious typo that results in uncompilable GLR parsers
8114 when both %pure-parser and %locations are used. (trivial change)
8115
8116 2003-04-17 Paul Eggert <eggert@twinsun.com>
8117
8118 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
8119 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
8120 Do not insert the expected token via unput, as this runs afoul
8121 of a POSIX-compatibility bug in flex 2.5.31.
8122 All uses changed to BEGIN the parent state,
8123 since we no longer insert the expected token via unput.
8124 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
8125 that is no longer emitted after the above change.
8126
8127 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
8128 the first one. This change is from Paul Hilfinger, and it fixes
8129 regression reported by Werner Lemberg in
8130 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
8131
8132 (resolve_sr_conflict): Don't invoke state_errs_set
8133 unless one or more tokens have been explicitly made errors.
8134 Otherwise, the above change causes Bison to abort.
8135
8136 * tests/existing.at (GNU pic Grammar): New test case, taken from
8137 Lemberg's email.
8138
8139 2003-03-31 Akim Demaille <akim@epita.fr>
8140
8141 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
8142
8143 2003-03-31 Akim Demaille <akim@epita.fr>
8144
8145 * src/output.c (prepare_symbols): Avoid trailing spaces in the
8146 output.
8147
8148 2003-03-31 Akim Demaille <akim@epita.fr>
8149
8150 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
8151 From Paul Hilfinger.
8152
8153 2003-03-29 Akim Demaille <akim@epita.fr>
8154
8155 * m4/error.m4: Do not put under dynamic conditions some code which
8156 expansion is under static control.
8157
8158 2003-03-29 Akim Demaille <akim@epita.fr>
8159
8160 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
8161
8162 2003-03-29 Akim Demaille <akim@epita.fr>
8163
8164 * doc/bison.texinfo (Strings are Destroyed): New.
8165
8166 2003-03-13 Paul Eggert <eggert@twinsun.com>
8167
8168 * .cvsignore: Add configure.lineno.
8169 * src/.cvsignore: Add yacc.
8170 * tests/.cvsignore: Add testsuite.log.
8171 * doc/fdl.texi: Sync with latest FSF version.
8172
8173 2003-03-12 Paul Eggert <eggert@twinsun.com>
8174
8175 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
8176 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
8177 cursor, instead of leaving it undefined. This fixes a bug
8178 reported by Tim Van Holder in
8179 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
8180 * tests/input.at (Torturing the Scanner): Test the scanner on
8181 an empty input file, which was Tim Van Holder's test case.
8182
8183 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
8184 <sys/resource.h> can be included, include sys/time.h and
8185 sys/times.h first, if available. This works around the SunOS
8186 4.1.4 porting bug reported by Bruce Becker in
8187 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
8188
8189 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
8190 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
8191 AC_HEADER_SYS_WAIT.
8192
8193 Merge changes from gnulib. This was prompted because the CVS
8194 snapshot didn't build on Solaris 7 due to strnlen problems.
8195
8196 These changes need to be merged back into gnulib:
8197 * lib/hash.c: Include <stdbool.h> unconditionally.
8198 * m4/onceonly.m4 (m4_quote): New macro.
8199 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
8200 Quote AC_FOREACH variable-expansions properly.
8201 The 2003-01-03 obstack.h change also needs merging.
8202 {end of changes requiring merging}
8203
8204 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8205 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
8206 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
8207 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
8208 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
8209 New files, imported from gnulib.
8210 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
8211 above.
8212
8213 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
8214 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
8215 gnulib sources.
8216
8217 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
8218 Add.
8219 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
8220 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
8221 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
8222 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
8223 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
8224 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
8225 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
8226 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
8227 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
8228 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
8229 (jm_PREREQ_ARGMATCH): Remove.
8230 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
8231 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
8232
8233 * src/system.h: Include <stdbool.h> unconditionally.
8234
8235 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
8236 assuming at least C89 in the bitset code for some time now.
8237
8238 2003-03-03 Akim Demaille <akim@epita.fr>
8239
8240 * ro.po: New.
8241
8242 2003-03-02 Akim Demaille <akim@epita.fr>
8243
8244 * doc/bison.texinfo (Table of Symbols): Reactivate the
8245 documentation for %lex-param, and %parse-param.
8246
8247 2003-03-02 Akim Demaille <akim@epita.fr>
8248
8249 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
8250 generate verbose error messages.
8251 Use the number of tokens as an upper bound in yytname, as it
8252 cannot be a non terminal.
8253
8254 2003-03-02 Akim Demaille <akim@epita.fr>
8255
8256 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
8257 message.
8258
8259 2003-03-02 Akim Demaille <akim@epita.fr>
8260
8261 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
8262 Use them to exercise yycheck overrun.
8263 Based on Andrew Suffield's grammar.
8264
8265 2003-03-02 Akim Demaille <akim@epita.fr>
8266
8267 Create tests/local.at for Bison generic testing macros.
8268
8269 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
8270 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
8271 This new file.
8272 * tests/calc.at (AT_CHECK_CALC): Adjust.
8273 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
8274 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
8275 * tests/local.at: here.
8276 (AT_COMPILE_CXX): Tags the tests using it as c++.
8277 Ignore the test if CXX is not functional.
8278
8279 2003-03-01 Paul Eggert <eggert@twinsun.com>
8280
8281 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
8282 not loc->end, since loc->end might contain garbage and this leads
8283 to undefined behavior on some platforms.
8284 (id_loc, token_start): Use (IF_LINTed) initial values that do not
8285 depend on *loc, so that the reader doesn't give the the false
8286 impression that *loc is initialized.
8287 (<INITIAL>"%%"): Do not bother setting code_start, since its value
8288 does not survive the return.
8289
8290 2003-03-01 Akim Demaille <akim@epita.fr>
8291
8292 * src/scan-gram.l (code_start): Always initialize it when entering
8293 into yylex, as SC_EPILOGUE is activated *before* the corresponding
8294 yylex invocation. An alternative would be making it static, but
8295 then it starts with the second %%'s beginning, instead of its end.
8296
8297 2003-02-28 Paul Eggert <eggert@twinsun.com>
8298
8299 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
8300 around a UnixWare 7.1.1 porting bug reported by John Hughes in
8301 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
8302
8303 2003-02-26 Paul Eggert <eggert@twinsun.com>
8304
8305 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
8306 Remove Sequent/Pyramid discussion (nobody uses them any more).
8307 Merge VMS and MS-DOS discussion; these ports may well be dead
8308 but let's keep mentioning them for now. Put <> around email
8309 addresses. Add copyright notice.
8310
8311 2003-02-24 Paul Eggert <eggert@twinsun.com>
8312
8313 * data/glr.c (yy_reduce_print): yylineno -> yylno,
8314 to avoid collision with flex use of yylineno.
8315 Problem reported by Bruce Lilly in
8316 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
8317 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8318 * data/yacc.c (yy_reduce_print): Likewise.
8319
8320 * config/depcomp: Sync with Automake 1.7.3.
8321
8322 2003-02-21 Akim Demaille <akim@epita.fr>
8323
8324 * data/lalr1.cc: Use temporary variables instead of casts to
8325 change integer types.
8326 Suggested by Paul Eggert.
8327
8328 2003-02-21 Akim Demaille <akim@epita.fr>
8329
8330 * doc/bison.texinfo: Use "location" consistently to refer to @n,
8331 to avoid confusions with lalr1.cc's notion of Position.
8332 Suggested by Paul Eggert.
8333
8334 2003-02-20 Akim Demaille <akim@epita.fr>
8335
8336 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
8337 before initial_columns.
8338 (location.hh): Use consistent variable names when defining the
8339 operator<<.
8340 Use "last" so that we subtract from Positions, not from unsigned.
8341
8342 2003-02-20 Akim Demaille <akim@epita.fr>
8343
8344 * data/lalr1.cc (position.hh): New subfile, including the extended
8345 and Doxygen'ed documentation of class Position.
8346 (location.hh): Use it.
8347 Document a` la Doxygen.
8348 With the help of Benoit Perrot.
8349
8350 2003-02-20 Akim Demaille <akim@epita.fr>
8351
8352 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
8353 AT_YACC_IF.
8354 Redefine AT_YYERROR_SEES_LOC_IF using it.
8355 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
8356 not defined.
8357 Don't use the location in yy::Parser::error_ and
8358 yy::Parser::print_ when not %locations.
8359 Activate more lalr1.cc tests.
8360
8361 2003-02-19 Akim Demaille <akim@epita.fr>
8362
8363 * data/lalr1.cc: When displaying a line number, be sure to make it
8364 an int.
8365
8366 2003-02-19 Akim Demaille <akim@epita.fr>
8367
8368 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
8369 Remove, useless.
8370 (YYABORT, YYACCEPT, YYERROR): New.
8371 * tests/calc.at: Renable the lalr1.cc test.
8372
8373 2003-02-19 Akim Demaille <akim@epita.fr>
8374
8375 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
8376 error recovery, mixing with/without pops and discarding of the
8377 lookahead.
8378 Exercise YYERROR.
8379 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
8380
8381 2003-02-17 Paul Eggert <eggert@twinsun.com>
8382
8383 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
8384 * tests/testsuite.at (AT_COMPILE): Use them.
8385 This fixes the testsuite problem reported by Robert Lentz in
8386 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
8387
8388 2003-02-12 Paul Eggert <eggert@twinsun.com>
8389
8390 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
8391 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
8392 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
8393 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
8394 Check for malloc failure, for consistency with yacc.c.
8395 (yytname_size): Remove, for consistency with yacc.c.
8396
8397 The bug still remains in data/lalr1.cc, as I didn't have time
8398 to fix it there.
8399
8400 2003-02-06 Akim Demaille <akim@epita.fr>
8401
8402 * configure.ac (GXX): Rename as...
8403 (CXX): this, to keep the original Autoconf semantics.
8404 Require 2.57.
8405 * data/lalr1.cc: Fix b4_copyright invocations.
8406 If YYDEBUG is not defined, don't depend upon name_ being defined.
8407 (location.hh): Include string and iostream.
8408 (Position::filename): New member.
8409 (Position::Position ()): New.
8410 (operator<< (Position)): New.
8411 (operator- (Position, int)): New.
8412 (Location::first, Location::last): Rename as...
8413 (Location::begin, Location::end): these, to mock the conventional
8414 iterator names.
8415 (operator<< (Location)): New.
8416 * tests/atlocal.in (CXX): New.
8417 * tests/testsuite.at (AT_COMPILE_CXX): New.
8418 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
8419 locations in a more synthetic way.
8420 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
8421 lalr1.cc is used.
8422 Adjust the C locations to match those from Emacs: first column is
8423 column 0.
8424 Change all the expected results.
8425 Conform to the GCS: simplify the locations when applicable.
8426 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
8427 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
8428 these CPP macros with the m4 macros new defined by...
8429 (AT_CHECK_PUSHDEFS): this, i.e.:
8430 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
8431 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
8432 New macros.
8433 (AT_CHECK_POPDEFS): Undefine them.
8434 (AT_CHECK_CALC_LALR1_CC): New.
8435 Use it for the first lalr1.cc test.
8436
8437 2003-02-04 Akim Demaille <akim@epita.fr>
8438
8439 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
8440 Location as is defined.
8441
8442 2003-02-04 Akim Demaille <akim@epita.fr>
8443
8444 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
8445 name_ being defined.
8446
8447 2003-02-03 Paul Eggert <eggert@twinsun.com>
8448
8449 * src/gram.h (start_symbol): Remove unused decl.
8450
8451 Use more-consistent naming conventions for local vars.
8452
8453 * src/derives.c (derives_compute): Change type of local var from
8454 int to rule_number.
8455 * src/gram.c (grammar_rules_partial_print): Likewise.
8456 * src/print.c (print_core): Likewise.
8457 * src/reduce.c (reduce_grammar_tables): Likewise.
8458
8459 * src/gram.c (grammar_dump): Change name of item_number *
8460 local var from r to rp.
8461 * src/nullable.c (nullable_compute): Likewise.
8462
8463 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
8464
8465 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
8466 for symbol or symbol_number var.
8467 * src/reader.c (grammar_start_symbol_set): Likewise.
8468 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
8469 Likewise.
8470 * src/state.c (transitions_to): Likewise.
8471 * src/state.h: Likewise.
8472 * src/tables.c (symbol_number_to_vector_number): Likewise.
8473
8474 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
8475 char * var.
8476
8477 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
8478 var.
8479
8480 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
8481 var.
8482
8483 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
8484 Use str, not s, for char * var. Use ch, not c, for character var.
8485 Use size for size var.
8486
8487 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
8488 char * var.
8489 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
8490 uniqstr var.
8491 * src/uniqstr.h: Likewise.
8492
8493 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8494 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8495 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
8496 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
8497 param to have same name as that of enum, so that we don't use
8498 "s" to stand for a non-state.
8499
8500 2003-02-02 Akim Demaille <akim@epita.fr>
8501
8502 * src/scan-skel.l: Scan more than one inert character per yylex
8503 invocation.
8504
8505 2003-02-01 Paul Eggert <eggert@twinsun.com>
8506
8507 Version 1.875a.
8508
8509 * po/LINGUAS: Add ms.
8510
8511 2003-01-30 Akim Demaille <akim@epita.fr>
8512
8513 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
8514
8515 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8516
8517 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
8518 of $1.
8519
8520 Changes in response to error report by S. Eken: GLR mode does not
8521 handle negative $ indices or $ indices in embedded rules correctly.
8522 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
8523
8524 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
8525 (b4_rhs_location): Ditto.
8526 (yyfill): New function to copy from stack tree into array
8527 incrementally.
8528 (yyuserAction): Modify to allow incremental move of semantic values
8529 to rhs array when in GLR mode.
8530 Define YYFILL to use in user-defined actions to fill semantic array
8531 as needed.
8532 Remove dummy use of yystack, as there is now a guaranteed use.
8533 (yydoAction): Modify to allow incremental move of semantic values
8534 to rhs array when in GLR mode.
8535 (yyresolveAction): Ditto.
8536 (yyglrShiftDefer): Update comment.
8537 (yyresolveStates): Use X == NULL for pointers, not !X.
8538 (yyglrReduce): Ditto.
8539 (yydoAction): Ditto
8540
8541 * tests/glr-regr1.at: Rename to ...
8542 * tests/glr-regression.at: Add new regression test for the problems
8543 described above (adapted from S. Eken).
8544 Update copyright notice.
8545 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
8546 * tests/Makefile.am: Ditto.
8547
8548 2003-01-28 Paul Eggert <eggert@twinsun.com>
8549
8550 * data/lalr1.cc: Do not use @output_header_name@ unless
8551 b4_defines_flag is set. This fixes two bugs reported by
8552 Tim Van Holder in
8553 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
8554 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
8555
8556 2003-01-21 Paul Eggert <eggert@twinsun.com>
8557
8558 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
8559 we don't need to worry about yyerrlab1 being reported as an
8560 "unused label" by non-GCC C compilers. The downside is that if
8561 locations are used then a couple of statements are duplicated each
8562 time YYERROR is invoked, but the upside is that the warnings
8563 should vanish.
8564 (yyerrlab1): Move code to YERROR.
8565 (yyerrlab2): Remove. Change uses back to yyerrlab1.
8566 This reverts some of the 2002-12-27 change.
8567
8568 2003-01-17 Paul Eggert <eggert@twinsun.com>
8569
8570 * src/output.c (symbol_printers_output): Fix typo that led
8571 to core dump. Problem reported by Antonio Rus in
8572 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
8573
8574 2003-01-13 Akim Demaille <akim@epita.fr>,
8575 Quoc Peyrot <chojin@lrde.epita.fr>,
8576 Robert Anisko <anisko_r@lrde.epita.fr>
8577
8578 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
8579 when the stacks contain one element, as the loop would otherwise
8580 free the last state, and then use the top state (the one we just
8581 popped). This means that the initial elements will not be freed
8582 explicitly, as is the case in yacc.c; it is not a problem, as
8583 these elements have fake values.
8584
8585 2003-01-11 Paul Eggert <eggert@twinsun.com>
8586
8587 * NEWS: %expect-violations are now just warnings, reverting
8588 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
8589 bootstrapping problem reported by Matthias Klose; see
8590 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
8591 * src/conflicts.c (conflicts_print): Likewise.
8592 * tests/conflicts.at (%expect not enough, %expect too much,
8593 %expect with reduce conflicts): Likewise.
8594 * doc/bison.texinfo (Expect Decl): Document this. Also mention
8595 that the warning is enabled if the number of conflicts changes
8596 (not necessarily increases).
8597
8598 * src/getargs.c (version): Update copyright year.
8599
8600 2003-01-09 Akim Demaille <akim@epita.fr>
8601
8602 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
8603
8604 2003-01-08 Paul Eggert <eggert@twinsun.com>
8605
8606 * Makefile.maint (WGETFLAGS):
8607 New macro, containing "-C off" to disable proxy caches.
8608 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
8609 (rel-check): Use $(WGET) instead of wget.
8610
8611 2003-01-06 Paul Eggert <eggert@twinsun.com>
8612
8613 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
8614 the GLR paper of Scott, Johnstone and Hussain.
8615
8616 2003-01-04 Paul Eggert <eggert@twinsun.com>
8617
8618 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
8619 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
8620 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
8621 (EXTRA_LIBRARIES): New var, for liby.a.
8622 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
8623 (EXTRA_SCRIPTS): New var, for yacc.
8624
8625 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
8626 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
8627 Problem reported by Nelson H. F. Beebe.
8628
8629 2003-01-03 Paul Eggert <eggert@twinsun.com>
8630
8631 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
8632 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8633 when compiling Bison 1.875's `bitset bset = obstack_alloc
8634 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8635
8636 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
8637 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
8638 grow to a huge size with typical invocation.
8639
8640 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
8641 Use the pattern recommended by Autoconf 2.57, except also protect
8642 against double-definition.
8643 * src/system.h: Likewise.
8644 Portability issues reported by Nelson H. F. Beebe.
8645
8646 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
8647 All uses changed. Provide a definition in both C and C++.
8648 (yytrue, yyfalse): Define even if defined (__cplusplus).
8649
8650 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
8651 Reported by Nelson H. F. Beebe.
8652
8653 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
8654
8655 2003-01-02 Paul Eggert <eggert@twinsun.com>
8656
8657 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
8658 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
8659 Bug reported by Nelson H. F. Beebe.
8660
8661 2003-01-01 Paul Eggert <eggert@twinsun.com>
8662
8663 * Version 1.875.
8664
8665 2002-12-30 Paul Eggert <eggert@twinsun.com>
8666
8667 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
8668 Moved here from...
8669 (<INITIAL>","): Here. This causes stray "," to be treated
8670 more uniformly.
8671
8672 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
8673 last brace in braced code when not in Yacc mode, for compatibility
8674 with Bison 1.35. This resurrects the 2001-12-15 patch to
8675 src/reader.c.
8676
8677 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
8678 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
8679
8680 2002-12-28 Paul Eggert <eggert@twinsun.com>
8681
8682 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
8683 that of SYM's type. This fixes Debian bug 168069, reported by
8684 Thomas Olsson.
8685
8686 2002-12-28 Paul Eggert <eggert@twinsun.com>
8687
8688 Version 1.75f.
8689
8690 Switch back to the Yacc style of conflict reports, undoing some
8691 of the 2002-07-30 change.
8692 * doc/bison.texinfo (Understanding): Use Yacc style for
8693 conflict reports. Also, use new way of locating rules.
8694 * src/conflicts.c (conflict_report):
8695 Renamed from conflict_report_yacc, removing the old
8696 'conflict_report'. Translate the entire conflict report at once,
8697 so that we don't assume that "," has the same interpretation in
8698 all languages.
8699 (conflicts_output): Use Yacc-style conflict report for each state,
8700 instead of our more-complicated style.
8701 (conflicts_print): Use Yacc-style conflict report, except print
8702 the input file name when not emulating Yacc.
8703 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
8704 Conflicted Reduction, %expect not enough, %expect too much,
8705 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
8706 * tests/existing.at (GNU Cim Grammar): Likewise.
8707 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
8708
8709 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
8710 fatal): Don't invoke fflush; it's not needed and it might even be
8711 harmful for stdout, as stdout might not be open.
8712 * src/reduce.c (reduce_print): Likewise.
8713
8714 2002-12-27 Paul Eggert <eggert@twinsun.com>
8715
8716 Fix a bug where error locations were not being recorded correctly.
8717 This problem was originally reported by Paul Hilfinger in
8718 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
8719
8720 * data/yacc.c (yyparse): New local var yylerrsp, to record the
8721 top of the location stack's error locations.
8722 (yyerrlab): Set it. When discarding a token, push its location
8723 onto yylerrsp so that we don't lose track of the error's end.
8724 (yyerrlab1): Now is only the target of YYERROR, so that we can
8725 properly record the location of the action that failed. For GCC
8726 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
8727 GCC warning about yyerrlab1 being unused if YYERROR is unused.
8728 (yyerrlab2): New label, which yyerrlab now falls through to.
8729 Compute the error's location by applying YYLLOC_DEFAULT to
8730 the locations of all the symbols that went into the error.
8731 * doc/bison.texinfo (Location Default Action): Mention that
8732 YYLLOC_DEFAULT is also invoked for syntax errors.
8733 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8734 Error locations include the locations of all the tokens that were
8735 discarded, not just the last token.
8736
8737 2002-12-26 Paul Eggert <eggert@twinsun.com>
8738
8739 * src/files.c: Include quote.h.
8740 (compute_output_file_names): Warn if we detect conflicting
8741 outputs to the same file. This should catch the misunderstanding
8742 exemplified by Debian Bug 165349, reported by Bruce Stephens..
8743
8744 * src/conflicts.c (conflicts_print): If the user specifies
8745 "%expect N", report an error if there are any reduce/reduce
8746 conflicts. This is what the manual says should happen.
8747 This fixes Debian bug 130890, reported by Anthony DeRobertis.
8748 * tests/conflicts.at (%expect with reduce conflicts): New test.
8749
8750 Don't use m4_include on relative file names, as it doesn't work as
8751 desired if there happens to be a file with that name under ".".
8752
8753 * m4sugar/version.m4: Remove; it was included but it wasn't used.
8754 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
8755 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
8756 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
8757 * src/output.c (output_skeleton): Use full path names when
8758 specifying a file to include; don't rely on include path, as
8759 it's unreliable when the working file contains a file with
8760 that name.
8761
8762 2002-12-25 Paul Eggert <eggert@twinsun.com>
8763
8764 Remove obsolete references to bison.simple and bison.hairy.
8765 Problem mentioned by Aubin Mahe in
8766 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
8767 * data/glr.c: Comment fix.
8768 * doc/bison.1: Remove references. Also, mention "yacc".
8769
8770 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
8771 with -g option.
8772
8773 * src/parse-gram.y (declaration): Use enum "report_states" rather
8774 than its numeric value 1.
8775
8776 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
8777 opening a new one. This fixes Debian bug 165349, reported by
8778 Bruce Stephens.
8779
8780 2002-12-24 Paul Eggert <eggert@twinsun.com>
8781
8782 Version 1.75e.
8783
8784 * Makefile.maint (cvs-update): Don't assume that the shell
8785 supports $(...), as Solaris sh doesn't.
8786
8787 * src/parse-gram.y (lloc_default): Remove test for empty
8788 nonterminals at the end, since it didn't change the result.
8789
8790 2002-12-24 Paul Eggert <eggert@twinsun.com>
8791
8792 If the user does not define YYSTYPE as a macro, Bison now declares it
8793 using typedef instead of defining it as a macro. POSIX requires this.
8794 For consistency, YYLTYPE is also declared instead of defined.
8795
8796 %union directives can now have a tag before the `{', e.g., the
8797 directive `%union foo {...}' now generates the C code
8798 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
8799 The default union tag is `YYSTYPE', for compatibility with Solaris 9
8800 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
8801 instead of `yyltype'.
8802
8803 `yystype' and `yyltype' are now obsolescent macros instead of being
8804 typedefs or tags; they are no longer documented and will be
8805 withdrawn in a future release.
8806
8807 * data/glr.c (b4_location_type): Remove.
8808 (YYSTYPE): Renamed from yystype.
8809 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
8810 (struct YYLTYPE): Renamed from struct yyltype.
8811 (YYLTYPE): Renamed from yyltype.
8812 (yyltype, yystype): New (and obsolescent) macros,
8813 for backward compatibility.
8814 * data/yacc.c: Likewise.
8815
8816 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
8817 does not specify a union tag. This is for compatibility with
8818 Solaris 9 yacc.
8819
8820 * src/parse-gram.y (add_param): 2nd arg is now char * not char
8821 const *, since it is now modified by stripping surrounding { }.
8822 (current_braced_code): Remove.
8823 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
8824 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
8825 trailing " {...}". Now of type <chars>.
8826 (grammar_declaration): Adjust to bundled tokens.
8827 (code_content): Remove; stripping is now done by add_param.
8828 (print_token_value): Print contents of bundled tokens.
8829 (token_name): New function.
8830
8831 * src/reader.h (braced_code, current_braced_code): Remove.
8832 (token_name): New decl.
8833
8834 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
8835 token_type, not braced_code code_kind. All uses changed.
8836 (SC_PRE_CODE): New state, for scanning after a keyword that
8837 has (or usually has) an immediately-following braced code.
8838 (token_type): New local var, to keep track of which token type
8839 to return when scanning braced code.
8840 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
8841 <INITIAL>"%parse-param", <INITIAL>"%printer",
8842 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
8843 instead of returning a token type immediately.
8844 (<INITIAL>"{"): Set token type.
8845 (<SC_BRACED_CODE>"}"): Use it.
8846 (handle_action_dollar, handle_action_at): Now returns bool
8847 indicating success. Fail if ! current_rule; this prevents a core dump.
8848 (handle_symbol_code_dollar, handle_symbol_code_at):
8849 Remove; merge body into caller.
8850 (handle_dollar, handle_at): Complain in invalid contexts.
8851
8852 * NEWS, doc/bison.texinfo: Document the above.
8853 * NEWS: Fix years and program names in copyright notice.
8854
8855 2002-12-17 Paul Eggert <eggert@twinsun.com>
8856
8857 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
8858 Reporting, Table of Symbols): Omit mentions of %lex-param and
8859 %parse-param from the documentation for now.
8860
8861 2002-12-15 Paul Eggert <eggert@twinsun.com>
8862
8863 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
8864 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
8865 lookahead symbol, and which sets yychar in parser actions) and it
8866 disagreed with the Bison documentation. Bug
8867 reported by Andrew Walrond.
8868
8869 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
8870 as the caller now does that.
8871 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
8872 (YYEMPTY): Parenthesize right hand side, since others use it.
8873 (yyparse): Don't assume that our generated code is the only code
8874 that sets yychar.
8875
8876 2002-12-13 Paul Eggert <eggert@twinsun.com>
8877
8878 Version 1.75d.
8879
8880 POSIX requires a "yacc" command.
8881 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
8882 (MOSTLYCLEANFILES): Add yacc.
8883 (yacc): New rule.
8884 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
8885 as an alias for bison y.
8886
8887 * po/LINGUAS: Add da.
8888
8889 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
8890 problem with latest <getopt.h>.
8891 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
8892
8893 * doc/fdl.texi: Upgrade to 1.2.
8894 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
8895 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
8896 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
8897 gnulib.
8898 * config/install-sh: Sync with autotools.
8899
8900 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
8901 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8902 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
8903 locations are requested.
8904 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
8905 locations are requested.
8906
8907 2002-12-12 Paul Eggert <eggert@twinsun.com>
8908
8909 Remove unportable casts and storage allocation tricks.
8910 While we're at it, remove almost all casts, since they
8911 usually aren't needed and are a sign of trouble.
8912
8913 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
8914
8915 * src/derives.c (derives_compute): Do not subtract NTOKENS from
8916 the pointer DSET returned by malloc; this isn't portable.
8917 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
8918 Similarly for DERIVES.
8919 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
8920 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
8921 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
8922
8923 * src/derives.c (derives_compute): Do not bother invoking
8924 int_of_rule_number, since rule numbers are integers.
8925
8926 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
8927 rather than XMALLOC (char, N).
8928
8929 * src/files.c (filename_split): Rewrite to avoid cast.
8930
8931 * src/gram.h (symbol_number_as_item_number,
8932 item_number_as_symbol_number, rule_number_as_item_number,
8933 item_number_as_rule_number):
8934 Now inline functions rather than macros, to avoid casts.
8935 * src/state.h (state_number_as_int): Likewise.
8936 * src/tables.c (state_number_to_vector_number,
8937 symbol_number_to_vector_number): Likewise.
8938
8939 * src/gram.h (int_of_rule_number): Remove; no longer used.
8940
8941 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
8942 since the resulting storage is always stored into.
8943
8944 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
8945 where it's needed.
8946
8947 * src/muscle_tab.c (muscle_m4_output):
8948 Now inline. Return bool, not int.
8949 * src/state.c (state_compare): Likewise.
8950 * src/symtab.c (symbol_check_defined,
8951 symbol_check_alias_consistency, symbol_pack, symbol_translation,
8952 hash_compare_symbol, hash_symbol):
8953 Likewise.
8954 * src/uniqstr.c (uniqstr_print): Likewise.
8955 * src/muscle_tab.c (muscle_m4_output_processor):
8956 New function, to avoid casts.
8957 * src/state.c (state_comparator, stage_hasher): Likewise.
8958 * src/symtab.c (symbol_check_defined_processor,
8959 symbol_check_alias_consistency_processor, symbol_pack_processor,
8960 symbol_translation_processor, hash_symbol_comparator,
8961 hash_symbol_hasher): Likewise.
8962 * src/uniqstr.c (uniqstr_print_processor): Likewise.
8963 * src/muscle_tab.c (muscles_m4_output):
8964 Use new functions instead of casting old functions unportably.
8965 * src/state.c (state_hash_new): Likewise.
8966 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
8967 symbols_token_translations_init):
8968 Likewise.
8969 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
8970
8971 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
8972 var instead of casting to long, to avoid casts.
8973 (prepare_states): Use MALLOC rather than alloca, so that we don't
8974 have to worry about alloca.
8975 * src/state.c (state_hash_lookup): Likewise.
8976
8977 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
8978 local var instead of casting to unsigned char, to avoid casts.
8979
8980 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
8981 STATE_ALLOC): Remove.
8982 (transitions_new, errs_new, reductions_new, state_new): Use malloc
8983 rather than calloc, and use offsetof to avoid allocating slightly
8984 too much storage.
8985 (state_new): Initialize all members.
8986
8987 * src/state.c (state_hash): Use unsigned accumulator, not signed.
8988
8989 * src/symtab.c (symbol_free): Remove; unused.
8990 (symbol_get): Remove cast in lhs of assignment.
8991 (symbols_do): Now static. Accept generic arguments, not
8992 hashing-related ones.
8993
8994 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
8995 (symbol_processor): Remove.
8996 (symbols_do): Remove decl; now static.
8997
8998 * src/system.h (alloca): Remove; decl no longer needed.
8999 (<stddef.h>): Include, for offsetof.
9000 (<inttypes.>, <stdint.h>): Include if available.
9001 (uintptr_t): New type, if system lacks it.
9002 (CALLOC, MALLOC, REALLOC): New macros.
9003 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
9004 new macros.
9005
9006 * src/tables.c (table_size): Now int, to pacify GCC.
9007 (table_grow, table_ninf_remap): Use signed table size.
9008 (save_row): Don't bother initializing locals when not needed.
9009 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
9010 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
9011
9012 * src/vcg.h: Correct misspellings.
9013
9014 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
9015
9016
9017 * src/getargs.c (getargs): Don't assume EOF == -1.
9018
9019 2002-12-09 Paul Eggert <eggert@twinsun.com>
9020
9021 Change identifier spellings to avoid collisions with names
9022 that are reserved by POSIX.
9023
9024 Don't use names ending in _t, since POSIX reserves them.
9025 For consistency, remove _e and _s endings -- they're weren't
9026 needed to remove ambiguity. All uses changed.
9027 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
9028 turn was just renamed from struniq_t.
9029 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
9030 which in turn was just renamed from struniq_processor_t.
9031 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
9032 in turn was renamed from hash_compare_struniq_t.
9033 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
9034 (state_list): Renamed from state_list_t.
9035 * src/assoc.h (assoc): Renamed from assoc_t.
9036 * src/conflicts.c (enum conflict_resolution): Renamed from
9037 enum conflict_resolution_e.
9038 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
9039 (rule_list): Renamed from rule_list_t.
9040 * src/getargs.h (enum trace): Renamed from enum trace_e.
9041 (enum report): Renamed from enum report_e.
9042 * src/gram.h (item_number): Renamed from item_number_t.
9043 (rule_number): Renamed from rule_number_t.
9044 (struct rule_s): Remove the "rule_s" part; not used.
9045 (rule): Renamed from rule_t.
9046 (rule_filter): Renamed from rule_filter_t.
9047 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
9048 (goto_list): Renamed from goto_list_t.
9049 * src/lalr.h (goto_number): Renamed from goto_number_t.
9050 * src/location.h (location): Renamed from location_t.
9051 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
9052 and moved here from:
9053 * src/muscle_tab.h (muscle_entry_t): here.
9054 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
9055 (rule_list): Renamed from rule_list_t.
9056 * src/print_graph.c (static_graph): Renamed from graph.
9057 * src/reader.h (braced_code): Renamed from braced_code_t.
9058 Remove brace_code_e tag.
9059 * src/relation.h (relation_node): Renamed from relation_node_t.
9060 (relation_nodes): Renamed from relation_nodes_t.
9061 (relation): Renamed from relation_t.
9062 * src/state.h (state_number): Renamed from state_number_t.
9063 (struct state): Renamed from struct state_s.
9064 (state): Renamed from state_t.
9065 (transitions): Renamed from transitions_t. Unused (and
9066 misspelled) transtion_s tag removed.
9067 (errs): Renamed from errs_t. Unused errs_s tag removed.
9068 (reductions): Renamed from reductions_t. Unused tag
9069 reductions_s removed.
9070 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
9071 (struct symbol_list): Renamed from struct symbol_list_s.
9072 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
9073 (struct symbol): Renamed from struct symbol_s.
9074 (symbol): Renamed from symbol_t.
9075 * src/tables.c (vector_number): Renamed from vector_number_t.
9076 (action_number): Renamed from action_t.
9077 * src/tables.h (base_number): Renamed from base_t.
9078 * src/vcg.h (enum color): Renamed from enum color_e.
9079 (enum textmode): Renamed from enum textmode_e.
9080 (enum shape): Renamed from enum shape_e.
9081 (struct colorentry): Renamed from struct colorentry_s.
9082 (struct classname): Renamed from struct classname_s.
9083 (struct infoname): Renamed from struct infoname_s.
9084 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
9085 (enum decision): Renamed from enum decision_e.
9086 (enum orientation): Renamed from enum orientation_e.
9087 (enum alignment): Renamed from enum alignment_e.
9088 (enum arrow_mode): Renamed from enum arrow_mode_e.
9089 (enum crossing_type): Renamed from enum crossing_type_e.
9090 (enum view): Renamed from enum view_e.
9091 (struct node): Renamed from struct node_s.
9092 (node): Renamed from node_t.
9093 (enum linestyle): Renamed from enum linestyle_e.
9094 (enum arrowstyle): Renamed from enum arrowstyle_e.
9095 (struct edge): Renamed from struct edge.
9096 (edge): Renamed from edge_t.
9097 (struct graph): Renamed from struct graph_s.
9098 (graph): Renamed from graph_t.
9099 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
9100 Rename value_t -> value.
9101 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
9102 value_t_as_yystype -> value_as_yystype.
9103
9104 Don't include <errno.h> in the mainstream code, since it
9105 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
9106 * lib/get-errno.c, lib/get-errno.h: New files.
9107 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
9108 get-errno.c.
9109 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
9110 * src/output.c (output_skeleton): Likewise.
9111 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
9112 instead of errno.
9113 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
9114 Likewise.
9115 (handle_action_dollar, handle_action_at): Likewise.
9116 * src/system.h: Do not include <errno.h>.
9117 (TAB_EXT): Renamed from EXT_TAB.
9118 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
9119
9120 Avoid str[a-z]*, since <string.h> reserves that name space.
9121 Change all instances of "struniq" in names to "uniqstr", and
9122 likewise for "STRUNIQ" and "UNIQSTR".
9123 * src/uniqstr.c: Renamed from src/struniq.c.
9124 * src/uniqstr.h: Renamed from src/struniq.h.
9125 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
9126 * src/files.c (strsuffix): Remove; unused.
9127 (concat2): Renamed from stringappend. Now static.
9128 * src/files.h (strsuffix, stringappend): Remove; unused.
9129 * src/parse-gram.y (<chars>): Renamed from <string>.
9130 (<uniqstr>): Renamed from <struniq>.
9131 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
9132 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
9133 (struct graph_s.expand): Renamed from struct graph_s.stretch.
9134 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
9135 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
9136 (N_EXPAND): Renamed from N_STRETCH.
9137
9138 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
9139 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
9140 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
9141 Remove; unused.
9142 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
9143 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
9144 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
9145 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
9146 (BASE_MAXIMUM): Renamed from BASE_MAX.
9147 (BASE_MINIMUM): Renamed from BASE_MIN.
9148 (ACTION_MAX): Remove; unused.
9149 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
9150 Unnecessary casts removed from above defines.
9151
9152
9153 Fix misspelling in names.
9154 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
9155 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
9156 G_NODE_ALIGNEMENT.
9157
9158
9159 * lib/timevar.c (timevar_report): Renamed from time_report,
9160 for consistency with other names.
9161 * lib/timevar.h (timevar_report): New decl.
9162 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
9163
9164
9165 Sort include-file uses.
9166
9167 Reorder all include files under src to be in the order "system.h".
9168 then the ../lib include files in angle brackets (alphabetized),
9169 then the . include files in double-quotes (alphabetized). Fix
9170 dependency breakages encountered in this process, as follows:
9171 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
9172 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
9173 * src/state.h: Include "symtab.h".
9174
9175 2002-12-08 Paul Eggert <eggert@twinsun.com>
9176
9177 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
9178 since this causes problems when __file__ contains character
9179 sequences like "@" that are treated specially by src/scan-skel.l.
9180 Instead, just use the file's basename. This fixes the bug
9181 reported by Martin Mokrejs in
9182 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
9183
9184 2002-12-06 Paul Eggert <eggert@twinsun.com>
9185
9186 Add support for rules that do not have trailing semicolons, as
9187 POSIX requires. Improve the quality of locations in Bison
9188 diagnostics.
9189
9190 * src/location.c: Include <quotearg.h>.
9191 (empty_location): Now const.
9192 (location_print): New function. Follow the recommendation of the
9193 GNU Coding Standards for locations that span file boundaries.
9194 * src/location.h: Do not include <quotearg.h>; no longer needed.
9195 (boundary): New type.
9196 (location_t): Use it. This allows locations to span file boundaries.
9197 All member uses changed: file -> start.file or end.file (as needed),
9198 first_line -> start.line, first_column -> start.column,
9199 last_line -> end.line, last_column -> end.column.
9200 (equal_boundaries): New function.
9201 (LOCATION_RESET, LOCATION_STEP): Remove.
9202 (LOCATION_PRINT): Remove. All callers changed to use location_print.
9203 (empty_location): Now const.
9204 (location_print): New decl.
9205 * src/parse-gram.y (lloc_default): New function, which handles
9206 empty locations more accurately.
9207 (YYLLOC_DEFAULT): Use it.
9208 (%token COLON): Remove.
9209 (%token ID_COLON): New token.
9210 (rules): Use it.
9211 (declarations, rules): Remove trailing semicolon.
9212 (declaration, rules_or_grammar_declaration):
9213 Allow empty (";") declaration.
9214 (symbol_def): Remove empty actions; no longer needed.
9215 (rules_or_grammar_declaration): Remove trailing semicolon.
9216 (semi_colon.opt): Remove.
9217 * src/reader.h: Include location.h.
9218 (scanner_cursor): New decl.
9219 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
9220 rolling our own.
9221 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
9222 of *loc.
9223 (STEP): Remove. No longer needed, now that adjust_location does
9224 the work. All uses removed.
9225 (scanner_cursor): New var.
9226 (adjust_location): Renamed from extend_location. It now sets
9227 *loc and adjusts the scanner cursor. All uses changed.
9228 Don't bother testing for CR.
9229 (handle_syncline): Remove location arg; now updates scanner cursor.
9230 All callers changed.
9231 (unexpected_end_of_file): Now accepts start boundary of token or
9232 comment, not location. All callers changed. Update scanner cursor,
9233 not the location.
9234 (SC_AFTER_IDENTIFIER): New state.
9235 (context_state): Renamed from c_context. All uses changed.
9236 (id_loc, code_start, token_start): New local vars.
9237 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
9238 processing of Yacc white space and equivalents here.
9239 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
9240 instead of returning ID immediately, since we need to search for
9241 a subsequent colon.
9242 (<INITIAL>"'", "\""): Save token_start.
9243 (<INITIAL>"%{", "{", "%%"): Save code_start.
9244 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
9245 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
9246 BEGIN context_state at end, not INITIAL.
9247 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
9248 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
9249 Return correct token start.
9250 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
9251 the start of a character, string or multiline comment is found.
9252 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
9253 Reduction): Adjust reported locations to match the more-precise
9254 results now expected.
9255 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
9256 * tests/reduce.at (Useless Rules, Reduced Automaton,
9257 Underivable Rules): Likewise.
9258 * tests/regression.at (Invalid inputs): No longer `expecting ";"
9259 or "|"' now that so many other tokens are allowed by the new grammar.
9260
9261 * src/complain.h (current_file): Remove duplicate decl;
9262 current_file is now owned by files.h.
9263 * src/complain.c, src/scan-gram.l: Include files.h.
9264
9265 2002-12-06 Paul Eggert <eggert@twinsun.com>
9266
9267 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
9268 promotes to int; it might be unsigned int.
9269 * data/yacc.c (yy_reduce_print): Likewise.
9270
9271 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
9272 be #defined in the prologue, not in the Bison declarations.
9273 This fixes Debian Bug 102878, reported by Shaul Karl.
9274
9275 2002-12-02 Paul Eggert <eggert@twinsun.com>
9276
9277 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
9278 * lib/strtoul.c: New file, from gnulib.
9279 This fixes a porting bug reported by Peter Klein in
9280 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
9281
9282 2002-11-30 Paul Eggert <eggert@twinsun.com>
9283
9284 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
9285 and put only a forward declaration in the prologue. This is for
9286 consistency with the other scanner helper functions.
9287
9288 Type clashes now generate warnings, not errors, since it
9289 appears that POSIX may allow some grammars with type clashes.
9290 * src/reader.c (grammar_current_rule_check): Warn about
9291 type clashes instead of complaining.
9292 * tests/input.at (Type Clashes): Expect warnings, not complaints.
9293
9294 Add Yacc library, since POSIX requires it.
9295 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
9296 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
9297 * lib/main.c, lib/yyerror.c: New files.
9298
9299 gram_error can be static; it need not be extern.
9300 * src/reader.h (gram_error): Remove decl.
9301 * src/parse-gram.y (gram_error): Now static. Add static decl.
9302 (print_token_value): Omit parameter names from forward decl,
9303 for consistency.
9304
9305 2002-11-29 Paul Eggert <eggert@twinsun.com>
9306
9307 * doc/bison.texinfo: Emphasize that yylex and yyerror must
9308 be declared before being used. E.g., one should typically
9309 declare them in the prologue. Use GNU coding style in examples.
9310 Put "const" consistently after the type it modifies. Mention
9311 that C99 supports "inline". Mention that yyerror traditionally
9312 returns "int".
9313
9314 %parse-param and %lex-param now take just one argument, the
9315 declaration; the argument name is deduced from the declaration.
9316
9317 * doc/bison.texinfo (Parser Function, Pure Calling, Error
9318 Reporting, Table of Symbols): Document this.
9319 * src/parse-gram.y (add_param): New function.
9320 (COMMA): Remove.
9321 (declaration): Implement new rule for %parse-param and %lex-param.
9322 * src/scan-gram.l: "," now elicits a warning, rather than being
9323 a token; this is more compatible with byacc.
9324 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
9325
9326 2002-11-27 Paul Eggert <eggert@twinsun.com>
9327
9328 Rename identifiers to avoid real and potential collisions.
9329
9330 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
9331 to avoid collision with lex macro described by Bruce Lilly in
9332 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
9333 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9334 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
9335 * src/parse-gram.y (print_token_value): Renamed from yyprint.
9336 All uses changed.
9337 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
9338 The name "yycontrol" violates the name space rules, and this stuff
9339 wasn't being used anyway.
9340 (input): Remove action; this stuff wasn't being used.
9341 (gram_error): Rename local variable yylloc -> loc.
9342 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
9343 (YY_DECL): Don't use "yy" at start of local variables.
9344 All uses changed, e.g., yylloc -> loc.
9345 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
9346 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
9347 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
9348 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
9349
9350 * src/parse-gram.y (gram_error): loc is now const *.
9351 * src/reader.h (gram_error): Likewise.
9352
9353 2002-11-24 Paul Eggert <eggert@twinsun.com>
9354
9355 Version 1.75c.
9356
9357 * tests/actions.at (Actions after errors): Use an output format
9358 more similar to that of the Printers and Destructors test.
9359 Test the position of the ';' token too.
9360 (Printers and Destructors): Likewise.
9361 (Printers and Destructors: %glr-parser): Remove for now, to avoid
9362 unnecessarily alarming people when the test fails.
9363
9364 * data/yacc.c (yyerrlab1): Move this label down, so that the
9365 parser does not discard the lookahead token if the user code
9366 invokes YYERROR. This change is required for POSIX conformance.
9367
9368 * lib/error.c: Sync with gnulib.
9369
9370 2002-11-22 Paul Eggert <eggert@twinsun.com>
9371
9372 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
9373 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
9374 * lib/xmalloc.c: Likewise.
9375
9376 2002-11-20 Paul Eggert <eggert@twinsun.com>
9377
9378 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
9379
9380 2002-11-20 Paul Eggert <eggert@twinsun.com>
9381
9382 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
9383 should use `if (! x) abort ();' rather than `assert (x);', and
9384 anyway it's one less thing to worry about configuring.
9385
9386 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
9387 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
9388 and replace all instances of assert with abort.
9389 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9390 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
9391
9392 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
9393 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
9394 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
9395 hash_find_entry, hash_rehash, hash_insert): Likewise.
9396 * src/conflicts.c (resolve_sr_conflict): Likewise.
9397 * src/lalr.c (set_goto_map, map_goto): Likewise.
9398 * src/nullable.c (nullable_compute): Likewise.
9399 * src/output.c (prepare_rules, token_definitions_output): Likewise.
9400 * src/reader.c (packgram, reader): Likewise.
9401 * src/state.c (state_new, state_free, state_transitions_set,
9402 state_reduction_find): Likewise.
9403 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
9404 symbol_pack): Likewise.
9405 * src/tables.c (conflict_row, pack_vector): Likewise.
9406 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9407 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9408 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
9409 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
9410
9411 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
9412 (ARGMATCH_CONSTRAINT): New macro.
9413 (ARGMATCH_ASSERT): Use it.
9414
9415 * src/system.h (verify): New macro.
9416 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
9417 rather than assert.
9418 * src/tables.c (tables_generate): Likewise.
9419
9420 * src/struniq.c (struniq_assert): Now returns void, and aborts
9421 if the assertion is false.
9422 (struniq_assert_p): Remove.
9423 * src/struniq.h: Likewise.
9424
9425 2002-11-18 Paul Eggert <eggert@twinsun.com>
9426
9427 * data/glr.c (yygetLRActions): Replace `yyindex' with
9428 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
9429 This fixes the regression with Sun ONE Studio 7 cc that I reported in
9430 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
9431
9432 2002-11-18 Akim Demaille <akim@epita.fr>
9433
9434 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
9435 space.
9436 From Tim Van Holder.
9437
9438 2002-11-17 Paul Eggert <eggert@twinsun.com>
9439
9440 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
9441 to "SyntaxError" for consistency with my 2002-11-15 change.
9442
9443 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
9444 not define to {}, since this breaks the common use of `YYDPRINTF
9445 ((...));' if a single statement is desired (e.g. before `else').
9446 Work around GCC warnings by surrounding corresponding calls with
9447 {} if needed.
9448 (yyhasResolvedValue): Remove unused function.
9449 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
9450 loop body.
9451 (yyreportSyntaxError): Renamed from yyreportParseError.
9452 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
9453 All uses changed.
9454 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
9455 extern when possible. Remove unused initializations.
9456
9457 2002-11-16 Akim Demaille <akim@epita.fr>
9458
9459 Augment the similarity between GLR and LALR traces.
9460
9461 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
9462 (YY_REDUCE_PRINT): New.
9463 (yyparse): Use them.
9464 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
9465 YYDPRINT here.
9466 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
9467 state reached after the reduction/recovery, since...
9468 (yyparse, yyprocessOneStack): Report the state we are entering in.
9469
9470 2002-11-16 Akim Demaille <akim@epita.fr>
9471
9472 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
9473 Add support for --trace=skeleton.
9474 * src/scan-skel.l: %option debug.
9475 Scan strings of non-@ or \n instead of character by character.
9476 (scan_skel): Handle trace_skeleton.
9477 (QPUTS): New.
9478 (@output_parser_name@, @output_header_name@): ``Restore'' their
9479 support (used to be M4 macros).
9480 * data/yacc.c: Quote larger chunks, a la glr.c.
9481 * data/lalr1.cc: Likewise.
9482 The header guards are no longer available, so use some other
9483 string than `YYLSP_NEEDED'.
9484
9485 2002-11-16 Akim Demaille <akim@epita.fr>
9486
9487 Make the ``Printers and Destructors'' test more verbose, taking
9488 `yacc.c''s behavior as (possibly wrong) reference.
9489
9490 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
9491 instead of fprint on stdout.
9492 Set and report the last_line of the symbols.
9493 Consistently display values and locations.
9494
9495 2002-11-16 Paul Eggert <eggert@twinsun.com>
9496
9497 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
9498
9499 2002-11-15 Paul Eggert <eggert@twinsun.com>
9500
9501 * tests/actions.at (Actions after errors): New test case.
9502
9503 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
9504 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
9505 tests/action.at, tests/calc.at, tests/conflicts.at,
9506 tests/cxx-type.at, tests/regression.at:
9507 "parse error" -> "syntax error" for POSIX compatibility.
9508 "parsing stack overflow..." -> "parser stack overflow" so
9509 that code matches Bison documentation.
9510
9511 2002-11-15 Akim Demaille <akim@epita.fr>
9512
9513 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
9514 take two BRACED_CODE, not two string_content.
9515 Free the scanner's obstack when we are done.
9516 (code_content): New.
9517 * tests/calc.at: Adjust.
9518 * doc/bison.texinfo: Adjust.
9519 Also, make sure to include the `,' for these declarations.
9520
9521 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
9522
9523 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
9524 definition; avoids potential autoreconf problems.
9525
9526 2002-11-15 Akim Demaille <akim@epita.fr>
9527
9528 Always check the value returned by yyparse.
9529
9530 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
9531 returned by yyparse.
9532 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
9533 Adjust calls.
9534 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
9535 returned by yyparse.
9536
9537 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9538
9539 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
9540 on input.at test.
9541
9542 2002-11-14 Paul Eggert <eggert@twinsun.com>
9543
9544 * src/output.c (output_skeleton): Call xfopen instead of
9545 duplicating xfopen's body.
9546
9547 Fix bugs reported by Nelson H. F. Beebe in
9548 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
9549
9550 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
9551 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
9552 Group compiler. Instead, use "$CC -E bar.c". Include the .h
9553 file twice in the grammar, as an extra check.
9554
9555 * tests/input.at (Torturing the Scanner): Surround the
9556 backslash-newline tests with "#if 0", to make it less likely that
9557 we'll run into compiler bugs. Bring back solitary \ inside
9558 comment, but add a closing comment to work around HP C bug. Don't
9559 test backslash-newline in C character constant.
9560
9561 2002-11-14 Akim Demaille <akim@epita.fr>
9562
9563 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
9564 status of the compiler.
9565 Calling `exit 1' is no longer needed.
9566 Reported by Nelson H. F. Beebe.
9567
9568 2002-11-14 Akim Demaille <akim@epita.fr>
9569
9570 * tests/atlocal.in (CPPFLAGS): We have config.h.
9571 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
9572 New.
9573 * tests/actions.at, tests/calc.at, tests/conflicts.at,
9574 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
9575 * tests/regression.at, tests/torture.at: Use them for all the
9576 grammars that are to be compiled.
9577 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
9578 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
9579 * doc/bison.texinfo (GLR Parsers): Document `inline'.
9580
9581 2002-11-14 Akim Demaille <akim@epita.fr>
9582
9583 * doc/bison.texinfo: Various formatting changes (alignments in
9584 samples, additional @group/@end group, GCS in samples.
9585 Use @deffn instead of simple @table to define the directives,
9586 macros, variables etc.
9587
9588 2002-11-13 Paul Eggert <eggert@twinsun.com>
9589
9590 Fix some bugs reported by Albert Chin-A-Young in
9591 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
9592
9593 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
9594 -o c"; the HP C compiler chatters during compilation.
9595 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
9596 * tests/headers.at (export YYLTYPE): Likewise.
9597
9598 * tests/input.at (Torturing the Scanner): Remove lines containing
9599 solitary backslashes, as they tickle a bug in the HP C compiler.
9600
9601 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
9602 comments, since they're not portable. Use GNU coding style.
9603
9604 2002-11-13 Akim Demaille <akim@epita.fr>
9605
9606 * data/yacc.c: Leave bigger chunks of quoted text.
9607 (YYDSYMPRINTF): New.
9608 Use it to report symbol activities.
9609 * data/glr.c (YYDSYMPRINTF): New.
9610 Use it.
9611
9612 2002-11-12 Paul Eggert <eggert@twinsun.com>
9613
9614 Version 1.75b.
9615
9616 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
9617 (yyglrReduce): Return yyok, not 0.
9618 This should avoid the enumerated-type warnings reported
9619 by Nelson H. F. Beebe in
9620 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
9621
9622 * lib/bbitset.h (BITSET_INLINE): Remove.
9623 * lib/bitset.h [! BITSET_INLINE]: Remove.
9624 (bitset_set, bitset_reset, bitset_test): Rename local vars
9625 to avoid shadowing warnings by GCC.
9626
9627 * data/glr.c (inline): Remove #define. It's the user's
9628 responsibility to #define it away, just like 'const'.
9629 This fixes one of the bugs reported by Nelson H. F. Beebe in
9630 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
9631
9632 * Makefile.maint (po-check): Scan .l and .y files instead of the
9633 .c and the .h files that they generate. This fixes the bug
9634 reported by Tim Van Holder in:
9635 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
9636 Look for N_ as well as for _. Try to avoid matching #define for
9637 N_ and _.
9638 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
9639 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
9640 * src/scan-gram.l: Revamp regular expressions so that " and '
9641 do not confuse xgettext.
9642
9643 * src/struniq.h (struniq_new): Do not declare the return type
9644 to be 'const'; this violates the C standard.
9645 * src/struniq.c (struniq_new): Likewise.
9646
9647 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
9648
9649 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
9650 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
9651 linker.
9652
9653 2002-11-12 Akim Demaille <akim@epita.fr>
9654
9655 * Makefile.maint: Sync with Autoconf:
9656 (local_updates): New.
9657
9658 2002-11-12 Akim Demaille <akim@epita.fr>
9659
9660 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
9661
9662 2002-11-12 Akim Demaille <akim@epita.fr>
9663
9664 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
9665 locations.
9666
9667 2002-11-12 Akim Demaille <akim@epita.fr>
9668
9669 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
9670 not yyvalue.
9671
9672 2002-11-12 Akim Demaille <akim@epita.fr>
9673
9674 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
9675 Use it to test the GLR parser.
9676
9677 2002-11-12 Akim Demaille <akim@epita.fr>
9678
9679 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
9680 defines it.
9681 * data/glr.c (yystos): New.
9682 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
9683 (YYDSYMPRINT): New.
9684 (yyval): Don't define it, it is handled via M4.
9685 (yyrecoverParseError): Free verbosely the discarded symbols.
9686 * data/yacc.c (yysymprint): Remove, rather...
9687 (b4_yysymprint_generate): invoke.
9688 * data/c.m4 (b4_yysymprint_generate): New.
9689 Accept pointers as arguments, as opposed to the version from
9690 yacc.c.
9691 (b4_yydestruct_generate): Likewise.
9692 * tests/cations.at (Printers and Destructors): Use Bison directives
9693 instead of CPP macros.
9694 Don't rely on internal details.
9695
9696 2002-11-12 Akim Demaille <akim@epita.fr>
9697
9698 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
9699 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
9700 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
9701 it against YYEMPTY and so forth), work on yytoken (i.e., set
9702 it to YYEMPTY etc.).
9703 (yydestruct): Replace with a b4_yydestruct_generate invocation.
9704 (b4_symbol_actions): Remove.
9705 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
9706 for 0, end-of-input.
9707
9708 2002-11-12 Akim Demaille <akim@epita.fr>
9709
9710 * doc/bison.texinfo (Destructor Decl): New.
9711
9712 2002-11-12 Akim Demaille <akim@epita.fr>
9713
9714 * src/tables.c (tables_generate): Use free for pointers that
9715 cannot be NULL, not XFREE.
9716 (pack_vector): Use assert, not fatal, for bound violations.
9717 * src/state.c (state_new): Likewise.
9718 * src/reader.c (reader): Likewise.
9719 * src/lalr.c (set_goto_map): Likewise.
9720 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
9721 the file name.
9722
9723 2002-11-12 Akim Demaille <akim@epita.fr>
9724
9725 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
9726 Restore.
9727 * src/scan-gram.l (last_string): Is global to the file, not to
9728 yylex.
9729 * src/parse-gram.y (input): Don't append the epilogue here,
9730 (epilogue.opt): do it here, and free the scanner's obstack.
9731 * src/reader.c (epilogue_set): Rename as...
9732 (epilogue_augment): this.
9733 * data/c.m4 (b4_epilogue): Defaults to empty.
9734
9735 2002-11-12 Akim Demaille <akim@epita.fr>
9736
9737 * src/getargs.c (long_options): Remove duplicates.
9738 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
9739 Remove.
9740 * doc/bison.rnh: Remove.
9741 * doc/bison.texinfo (VMS Invocation): Remove.
9742
9743 2002-11-12 Akim Demaille <akim@epita.fr>
9744
9745 * src/struniq.h, src/struniq.c (struniq_t): Is const.
9746 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
9747
9748 Use struniq for symbols.
9749
9750 * src/symtab.h (symbol_t): The tag member is a struniq.
9751 (symbol_type_set): Adjust.
9752 * src/symtab.c (symbol_new): Takes a struniq.
9753 (symbol_free): Don't free the tag member.
9754 (hash_compare_symbol_t, hash_symbol_t): Rename as...
9755 (hash_compare_symbol, hash_symbol): these.
9756 Use the fact that tags as struniqs.
9757 (symbol_get): Use struniq_new.
9758 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
9759 Returns a strniq.
9760 * src/reader.h (merger_list, grammar_currentmerge_set): The name
9761 and type members are struniqs.
9762 * src/reader.c (get_merge_function)
9763 (grammar_current_rule_merge_set): Adjust.
9764 (TYPE, current_type): Are struniq.
9765
9766 Use struniq for file names.
9767
9768 * src/files.h, src/files.c (infile): Split into...
9769 (grammar_file, current_file): these.
9770 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
9771 * src/reduce.c (reduce_print): Likewise.
9772 * src/getargs.c (getargs): Likewise.
9773 * src/complain.h, src/complain.c: Likewise.
9774 * src/main.c (main): Call struniqs_new early enough to use it for
9775 file names.
9776 Don't free the input file name.
9777
9778 2002-11-12 Akim Demaille <akim@epita.fr>
9779
9780 * src/symtab.c (symbol_free): Remove dead deactivated code:
9781 type_name are properly removed.
9782 Don't use XFREE to free items that cannot be NULL.
9783 * src/struniq.h, src/struniq.c: New.
9784 * src/main.c (main): Initialize/free struniqs.
9785 * src/parse-gram.y (%union): Add astruniq member.
9786 (yyprint): Adjust.
9787 * src/scan-gram.l (<{tag}>): Return a struniq.
9788 Free the obstack bit that used to store it.
9789 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
9790
9791 2002-11-11 Paul Eggert <eggert@twinsun.com>
9792
9793 Revamp to fix many (but not all) of the C- and M4-related quoting
9794 problems. Among other things, this fixes the Bison bug reported
9795 by Jan Hubicka when processing the Bash grammar; see:
9796 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
9797
9798 Use new @ escapes consistently. Represent brackets with @{ and @}
9799 rather than @<:@ and @:>@, since this works a bit better with dumb
9800 editors like vi. Represent @ with @@, since @ is now consistently
9801 an escape. Use @oline@ and @ofile@ rather than __oline__ and
9802 __ofile__, to avoid unexpected expansions. Similarly, use @output
9803 rather than #output.
9804
9805 * data/c.m4 (b4_copyright): Omit file name from comment, since
9806 the file name could contain "*/".
9807 (b4_synclines_flag): Don't quote the 2nd argument; it should already
9808 be quoted. All uses changed.
9809
9810 * data/glr.c: Use new @ escapes consistently.
9811 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
9812 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
9813 Remove, since they couldn't handle arbitrary characters in file
9814 names.
9815 * data/lalr1.cc: Likewise.
9816 * data/yacc.c: Likewise.
9817
9818 * src/files.c (output_infix): Remove; all uses removed.
9819 * src/files.h: Likewise.
9820
9821 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
9822 mishandled funny characters in file names, and anyway it isn't
9823 needed any more.
9824 * data/yacc.c: Likewise.
9825 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
9826
9827 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
9828 * data/yacc.c: Likewise.
9829
9830 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
9831 strings now.
9832 (muscle_init): Quote filename as a C string.
9833 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
9834 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
9835 * src/output.c (escaped_file_name_output): New function.
9836 (prepare_symbols): Quote tokens for M4.
9837 (prepare): Don't insert output_infix, output_prefix,
9838 output_parser_name, output_header_name; this is now down by scan-skel.
9839 Insert skeleton as a C string.
9840
9841 * src/output.c (user_actions_output, symbol_destructors_output,
9842 symbol_printers_output): Quote filenames for C and M4.
9843 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9844
9845 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
9846 escapes other than \\ and \'; this simplifies the code.
9847 (<SC_STRING>): Likewise, for \\ and \".
9848 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
9849 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
9850 Use new escapes @{ and @} for [ and ].
9851
9852 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
9853 them with auto vars.
9854 Switch to new escape scheme, where @ is the escape character uniformly.
9855 Abort if a stray escape character is found. Avoid unbounded input
9856 buffer when parsing non-escaped text.
9857
9858 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
9859 __oline__, #output, $@, and @{ do not have unintended meanings.
9860
9861 2002-11-09 Paul Eggert <eggert@twinsun.com>
9862
9863 Fix the test failure due to GCC warnings described in
9864 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
9865 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
9866 evaluate to 0 if it's impossible for NINF to be in the respective
9867 table.
9868 (yygetLRActions, yyrecoverParseError): Use them.
9869
9870 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
9871 counted in the token inserted at end of file. Now takes
9872 location_t *, not location_t, so that the location can be
9873 adjusted. All uses changed.
9874
9875 * tests/regression.at (Invalid inputs): Adjust wording in
9876 diagnostic to match the new behavior.
9877
9878 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
9879 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
9880 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
9881 abort ();'. This reduces the runtime of the "Many lookaheads"
9882 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
9883 GCC 3.2.
9884
9885 2002-11-07 Paul Eggert <eggert@twinsun.com>
9886
9887 * src/parse-gram.y (CHARACTER): Remove unused token.
9888 All uses removed.
9889
9890 * src/scan-gram.l: Remove stack option. We no longer use the
9891 stack, since the stack was never deeper than 1; instead, use the
9892 new auto var c_context to record the stacked value.
9893
9894 Remove nounput option. At an unexpected end of file, we now unput
9895 the minimal input necessary to end cleanly; this simplifies the
9896 code.
9897
9898 Avoid unbounded token sizes where this is easy.
9899
9900 (unexpected_end_of_file): New function.
9901 Use it to systematize the error message on unexpected EOF.
9902 (last-string): Now auto, not static.
9903 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
9904 (scanner_last_string_free): Remove; not used.
9905 (percent_percent_count): Move decl to just before use.
9906 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
9907 not the (never otherwised-used) CHARACTER.
9908
9909 2002-11-07 Akim Demaille <akim@epita.fr>
9910
9911 Let yyerror always receive the msg as last argument, so that
9912 yyerror can be variadic.
9913
9914 * data/yacc.c (b4_yyerror_args): New.
9915 Use it when calling yyerror.
9916 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
9917 Use it when calling yyerror.
9918 * doc/bison.texinfo (Error Reporting): Adjust.
9919 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
9920 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
9921
9922 2002-11-06 Akim Demaille <akim@epita.fr>
9923
9924 #line should have quoted strings.
9925 Ideally, this should be done by m4_quotearg.
9926
9927 * src/scan-skel.l: Include quotearg.h.
9928 Quote __ofile__.
9929 * src/output.c (symbol_printers_output)
9930 (symbol_destructors_output): Quote the file name.
9931
9932 2002-11-06 Akim Demaille <akim@epita.fr>
9933
9934 * tests/regression.at (Invalid inputs): Adjust to the recent
9935 messages.
9936
9937 2002-11-06 Akim Demaille <akim@epita.fr>
9938
9939 Restore --no-lines.
9940 Reported by Jim Kent.
9941
9942 * data/c.m4 (b4_syncline): New.
9943 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
9944 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
9945 * src/output.c (user_actions_output): Likewise.
9946 (prepare): Define 'b4_synclines_flag'.
9947 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
9948
9949 2002-11-06 Akim Demaille <akim@epita.fr>
9950
9951 * src/main.c (main): Free `infile'.
9952 * src/scan-gram.l (handle_syncline): New.
9953 Recognize `#line'.
9954 * src/output.c (user_actions_output, symbol_destructors_output)
9955 (symbol_printers_output): Use the location's file name, not
9956 infile.
9957 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9958
9959 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9960
9961 * src/tables.c (matching_state): Don't allow states to match if
9962 either has GLR conflict entries.
9963
9964 2002-11-05 Paul Eggert <eggert@twinsun.com>
9965
9966 * src/scan-gram.l: Use more accurate diagnostics, e.g.
9967 "integer out of range" rather than "invalid value".
9968 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
9969 accordingly.
9970
9971 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
9972 Also, remove one static variable in the scanner.
9973
9974 * src/scan-gram.l (braces_level): Now auto, not static.
9975 Initialize to zero if the compiler is being picky.
9976 (INITIAL): Clear braces_level instead of incrementing it.
9977 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
9978 as POSIX 1003.1-2001 requires.
9979 * src/system.h (IF_LINT): New macro, taken from coreutils.
9980 * configure.ac: Define "lint" if --enable-gcc-warnings.
9981
9982 2002-11-05 Akim Demaille <akim@epita.fr>
9983
9984 * src/scan-gram.l: When it starts with `%', complain about the
9985 whole directive, not just that `invalid character: %'.
9986
9987 2002-11-04 Akim Demaille <akim@epita.fr>
9988
9989 * Makefile.maint: Update from Autoconf.
9990 (update, cvs-update, po-update, do-po-update): New.
9991
9992 2002-11-04 Akim Demaille <akim@epita.fr>
9993
9994 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
9995 and yyerror.
9996 Have yyerror `use' its arguments.
9997 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
9998 returns true when location & yacc & pure & parse-param.
9999 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
10000
10001 2002-11-04 Akim Demaille <akim@epita.fr>
10002
10003 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
10004 clashes.
10005 * src/scan-gram.l: Use [\'] instead of ['] to pacify
10006 font-lock-mode.
10007 Use complain_at.
10008 Use quote, not quote_n since LOCATION_PRINT no longer uses the
10009 slot 0.
10010
10011 2002-11-03 Paul Eggert <eggert@twinsun.com>
10012
10013 * src/reader.c (get_merge_function, grammar_current_rule_check):
10014 Use consistent diagnostics for reporting type name clashes.
10015 Quote the types with <>, for consistency with Yacc.
10016 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
10017
10018 2002-11-03 Akim Demaille <akim@epita.fr>
10019
10020 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
10021 New.
10022 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
10023 (b4_parse_param): Remove.
10024 Use b4_identification.
10025 Propagate b4_pure_args where needed to pass them to yyerror.
10026 * data/glr.m4 (b4_parse_param): Remove.
10027 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
10028 (b4_lpure_formals): New.
10029 Use b4_identification.
10030 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
10031 b4_user_formals and b4_user_args.
10032 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
10033 (yyreportAmbiguity): When using a pure parser, also need
10034 the location, and the parse-params.
10035 Adjust callers.
10036 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
10037 When using a pure parser, also need the parse-params.
10038 Adjust callers.
10039 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
10040 (%pure-parser + %parse-param) LALR and GLR parsers.
10041 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
10042 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
10043 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
10044 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
10045 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
10046 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
10047 * doc/bison.texinfo: Untabify the whole file.
10048 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
10049 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
10050 (Error Reporting): Adjust to these new directives.
10051 Document %error-verbose, deprecate YYERROR_VERBOSE.
10052
10053 2002-11-03 Akim Demaille <akim@epita.fr>
10054
10055 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
10056 AT_CHECK_CALC_GLR invocations to use % directives, instead of
10057 command line options.
10058 * tests/cxx-type.at: Formatting changes.
10059
10060 2002-11-03 Paul Eggert <eggert@twinsun.com>
10061
10062 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
10063 to count columns correctly, and to check for invalid inputs.
10064
10065 Use mbsnwidth to count columns correctly. Account for tabs, too.
10066 Include mbswidth.h.
10067 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
10068 (extend_location): New function.
10069 (YY_LINES): Remove.
10070
10071 Handle CRLF in C code rather than in Lex code.
10072 (YY_INPUT): New macro.
10073 (no_cr_read): New function.
10074
10075 Scan UCNs, even though we don't fully handle them yet.
10076 (convert_ucn_to_byte): New function.
10077
10078 Handle backslash-newline correctly in C code.
10079 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
10080 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
10081 all uses changed.
10082 (tag, splice): New EREs. Do not allow NUL or newline in tags.
10083 Use {splice} wherever C allows backslash-newline.
10084 YY_STEP after space, newline, vertical-tab.
10085 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
10086
10087 (letter, id): Don't assume ASCII; e.g., spell out a-z.
10088
10089 ({int}, handle_action_dollar, handle_action_at): Check for integer
10090 overflow.
10091
10092 (YY_STEP): Omit trailing semicolon, so that it's more like C.
10093
10094 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
10095 as well as \000. Check for UCHAR_MAX, not 255.
10096 Allow \x with an arbitrary positive number of digits, as in C.
10097 Check for overflow here.
10098 Allow \? and UCNs, for compatibility with C.
10099
10100 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
10101 with quote slot used by complain_at.
10102
10103 * tests/input.at: Add tests for backslash-newline, m4 quotes
10104 in symbols, long literals, and funny escapes in strings.
10105
10106 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
10107 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
10108 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
10109 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
10110 * m4/mbswidth.m4: New file, from GNU coreutils.
10111
10112 * doc/bison.texinfo (Grammar Outline): Document // comments.
10113 (Symbols): Document that trigraphs have no special meaning in Bison,
10114 nor is backslash-newline allowed.
10115 (Actions): Document that trigraphs have no special meaning.
10116
10117 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
10118 no longer used.
10119
10120 2002-11-02 Paul Eggert <eggert@twinsun.com>
10121
10122 * src/reader.c: Don't include quote.h; not needed.
10123 (get_merge_function): Reword warning to be consistent with
10124 type clash diagnostic in grammar_current_rule_check.
10125
10126 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
10127 bug in trigraph handling.
10128
10129 * src/output.c (prepare_symbols): When printing token names,
10130 escape "[" as "@<:@" and likewise for "]".
10131
10132 * src/system.h (errno): Remove declaration, as we are now
10133 assuming C89 or better, and C89 guarantees errno.
10134
10135 2002-10-30 Paul Eggert <eggert@twinsun.com>
10136
10137 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
10138 Check for close failures.
10139 * src/files.h (xfclose): Return void, not int, since it always
10140 returned zero.
10141 * src/files.c (xfclose): Likewise. Report I/O error if ferror
10142 indicates one.
10143 * src/output.c (output_skeleton): Use xfclose rather than fclose
10144 and ferror. xfclose now checks ferror.
10145
10146 * data/glr.c (YYLEFTMOST_STATE): Remove.
10147 (yyreportTree): Use a stack-based leftmost state. This avoids
10148 our continuing battles with bogus warnings about initializers.
10149
10150 2002-10-30 Akim Demaille <akim@epita.fr>
10151
10152 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
10153 #if.
10154
10155 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10156
10157 * tests/glr-regr1.at: New test for reported regressions.
10158 * tests/testsuite.at: Add glr-regr1.at test.
10159 * tests/Makefile.am: Add glr-regr1.at test.
10160
10161 2002-10-24 Paul Eggert <eggert@twinsun.com>
10162
10163 Version 1.75a.
10164
10165 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
10166 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
10167 we use malloc. Don't assume 'A' through 'Z' are contiguous.
10168 Don't assume strdup exists; POSIX says its an XSI extension.
10169 Check for buffer overflow on input.
10170
10171 2002-10-24 Akim Demaille <akim@epita.fr>
10172
10173 * src/output.c (output_skeleton): Don't disable M4sugar comments
10174 too soon: it results in comments being expanded.
10175 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
10176 first output.
10177
10178 2002-10-24 Akim Demaille <akim@epita.fr>
10179
10180 * data/yacc.c (m4_int_type): New.
10181 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
10182 char' as only yacc.c wants K&R portability.
10183 * data/glr.c (yysigned_char): Remove.
10184 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
10185 Reported by Quoc Peyrot.
10186
10187 2002-10-23 Paul Eggert <eggert@twinsun.com>
10188
10189 * src/main.c (main): With --trace=time, report times even if a
10190 non-fatal error occurs. Formerly, the times were reported in some
10191 such cases but not in others.
10192 * src/reader.c (reader): Just return if a complaint has been issued,
10193 instead of exiting, so that 'main' can report times.
10194
10195 2002-10-22 Akim Demaille <akim@epita.fr>
10196
10197 * src/system.h: Include sys/types.
10198 Reported by Bert Deknuydt.
10199
10200 2002-10-23 Paul Eggert <eggert@twinsun.com>
10201
10202 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
10203 Suggested by Art Haas.
10204
10205 2002-10-22 Paul Eggert <eggert@twinsun.com>
10206
10207 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
10208 decl; not needed any more.
10209 * src/main.c (main): Use return to exit, undoing yesterday's change.
10210 The last OS that we could find where this wouldn't work is
10211 SunOS 3.5, and that's too old to worry about now.
10212
10213 * data/glr.c (struct yyltype): Define members even when not
10214 doing locations. This is more consistent with yacc.c, and it
10215 works around the following bug reports:
10216 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
10217 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
10218
10219 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
10220 @acronym consistently. Standardize on "Yacc" instead of "YACC",
10221 "Algol" instead of "ALGOL". Give a bit more history about BNF.
10222
10223 2002-10-22 Akim Demaille <akim@epita.fr>
10224
10225 * data/README: New.
10226
10227 2002-10-21 Paul Eggert <eggert@twinsun.com>
10228
10229 Be consistent about 'bool'; the old code used an enum in one
10230 module and an int in another, and this violates the C standard.
10231 * m4/stdbool.m4: New file, from coreutils 4.5.3.
10232 * configure.ac (AC_HEADER_STDBOOL): Add.
10233 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
10234 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
10235 * src/symtab.c (hash_compare_symbol_t): Likewise.
10236 * src/system.h (bool, false, true): Use a definition consistent
10237 with ../lib/hash.c. All uses changed.
10238
10239 * src/complain.c (warning_issued): Renamed from warn_message_count,
10240 so that we needn't worry about integer overflow (!).
10241 Now of type bool. All uses changed.
10242 (complaint_issued): Renamed from complain_message_count; likewise.
10243
10244 * src/main.c (main): Use exit to exit with failure.
10245
10246 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
10247 rather than 1 and 0.
10248 * src/main.c (main): Likewise.
10249 * src/getargs.c (getargs): Likewise.
10250 * src/reader.c (reader): Likewise.
10251
10252 * src/getarg.c (getargs): Remove duplicate code for
10253 "Try `bison --help'".
10254
10255 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
10256 What was that "2" for?
10257
10258 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
10259 * src/getargs.c (usage): Likewise.
10260
10261 * src/getargs.c (getargs): When there are too few operands, report
10262 the last one. When there are too many, report the first extra
10263 one. This is how diffutils does it.
10264
10265 2002-10-20 Paul Eggert <eggert@twinsun.com>
10266
10267 Remove K&R vestiges.
10268 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
10269 * src/complain.c (VA_START): Remove. Assume prototypes.
10270 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
10271 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
10272 fatal): Assume prototypes.
10273 * src/complain.h: Assume prototypes.
10274 * src/system.h (PARAMS): Remove.
10275 Include <limits.h> unconditionally, since it's guaranteeed even
10276 for a freestanding C89 compiler.
10277 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
10278 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
10279
10280 2002-10-20 Akim Demaille <akim@epita.fr>
10281
10282 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
10283 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
10284 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
10285 (yyresolveStates, yyresolveAction, yyresolveStack)
10286 (yyprocessOneStack): Use them.
10287 (yy_reduce_print): New.
10288 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
10289
10290 2002-10-20 Akim Demaille <akim@epita.fr>
10291
10292 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
10293 arguments and output `void'.
10294 (b4_c_function): Rename as...
10295 (b4_c_function_def): this.
10296 (b4_c_function_decl, b4_c_ansi_function_def)
10297 (b4_c_ansi_function_decl): New.
10298 Change the interpretation of the arguments: before `int, foo', now
10299 `int foo, foo'.
10300 * data/yacc.c (yyparse): Prototype and define thanks to these.
10301 Adjust b4_c_function_def uses.
10302 * data/glr.c (yyparse): Likewise, but ANSI only.
10303
10304 2002-10-20 Akim Demaille <akim@epita.fr>
10305
10306 * src/output.c (prepare): Move the definition of `tokens_number',
10307 `nterms_number', `undef_token_number', `user_token_number_max'
10308 to...
10309 (prepare_tokens): Here.
10310 (prepare_tokens): Rename as...
10311 (prepare_symbols): this.
10312 (prepare): Move the definition of `rules_number' to...
10313 (prepare_rules): here.
10314 (prepare): Move the definition of `last', `final_state_number',
10315 `states_number' to...
10316 (prepare_states): here.
10317 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
10318
10319 2002-10-20 Akim Demaille <akim@epita.fr>
10320
10321 * src/tables.h, src/tables.c, src/output.c: Comment changes.
10322
10323 2002-10-20 Akim Demaille <akim@epita.fr>
10324
10325 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
10326 * data/c.m4: here.
10327
10328 2002-10-20 Akim Demaille <akim@epita.fr>
10329
10330 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
10331 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
10332 `pair'.
10333 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
10334 `name' to...
10335 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
10336 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
10337 These.
10338
10339 2002-10-19 Paul Eggert <eggert@twinsun.com>
10340
10341 Do not create a temporary file, as that involves security and
10342 cleanup headaches. Instead, use a pair of pipes.
10343 Derived from a suggestion by Florian Krohm.
10344 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
10345 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
10346 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
10347 (BISON_PREREQ_SUBPIPE): Add.
10348 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
10349 Add subpipe.h, subpipe.c.
10350 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
10351 * po/POTFILES.in: Add lib/subpipe.c.
10352 * src/output.c: Include "subpipe.h".
10353 (m4_invoke): Remove decl.
10354 (scan_skel): New decl.
10355 (output_skeleton): Use pipe rather than temporary file for m4 input.
10356 Check that m4sugar.m4 is readable, to avoid deadlock.
10357 Check for pipe I/O error.
10358 * src/scan-skel.l (readpipe): Remove decl.
10359 (scan_skel): New function, to be used in place of m4_invoke.
10360 Read from stream rather than file.
10361
10362 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
10363 float, as this generates a warning on Solaris 8 + GCC 3.2 with
10364 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
10365 this generates a more-accurate value anyway.
10366
10367 * lib/timevar.c (timervar_accumulate): Rename locals to
10368 avoid confusion with similarly-named more-global.
10369 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
10370
10371 * src/output.c (prepare): Use xstrdup to convert char const *
10372 to char *, to avoid GCC warning.
10373
10374 2002-10-19 Akim Demaille <akim@epita.fr>
10375
10376 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
10377 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
10378 Use them to have `calc.y' ready for %pure-parser.
10379 * data/yacc.c (YYLEX): Pass a yylex return type to
10380 b4_c_function_call.
10381
10382 2002-10-19 Akim Demaille <akim@epita.fr>
10383
10384 Prototype support of %lex-param and %parse-param.
10385
10386 * src/parse-gram.y: Add the definition of the %lex-param and
10387 %parse-param tokens, plus their rules.
10388 Drop the `_' version of %glr-parser.
10389 Add the "," token.
10390 * src/scan-gram.l (INITIAL): Scan them.
10391 * src/muscle_tab.c: Comment changes.
10392 (muscle_insert, muscle_find): Rename `pair' as `probe'.
10393 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
10394 (muscle_entry_s): The `value' member is no longer const.
10395 Adjust all dependencies.
10396 * src/muscle_tab.c (muscle_init): Adjust: use
10397 MUSCLE_INSERT_STRING.
10398 Initialize the obstack earlier.
10399 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
10400 (muscle_pair_list_grow): New.
10401 * data/c.m4 (b4_c_function_call, b4_c_args): New.
10402 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
10403 * tests/calc.at: Use %locations, not --locations.
10404 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
10405
10406 2002-10-19 Akim Demaille <akim@epita.fr>
10407
10408 * src/getargs.c (usage): Take status as argument and exit
10409 accordingly.
10410 Report the traditional `Try ... --help' message when status != 0.
10411 (usage, version): Don't take a FILE * as arg, it is pointless.
10412 (getargs): When there is an incorrect number of arguments, make it
10413 an error, and report it GNUlically thanks to `usage ()'.
10414
10415 2002-10-18 Paul Eggert <eggert@twinsun.com>
10416
10417 * data/glr.c (yyreportParseError): Don't assume that sprintf
10418 yields the length of the printed string, as this is not true
10419 on SunOS 4.1.4. Reported by Peter Klein.
10420
10421 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
10422 * tests/conflicts.at (%nonassoc and eof): Likewise.
10423 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
10424
10425 2002-10-17 Akim Demaille <akim@epita.fr>
10426
10427 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
10428 * src/getargs.c (trace_types, trace_args): Adjust.
10429 * src/reader.c (grammar_current_rule_prec_set)
10430 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
10431 Standardize error messages.
10432 And s/@prec/%prec/!
10433 (reader): Use trace_flag to enable scanner/parser debugging,
10434 instead of an adhoc scheme.
10435 * src/scan-gram.l: Remove trailing debugging code.
10436
10437 2002-10-16 Paul Eggert <eggert@twinsun.com>
10438
10439 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
10440 MUSCLE_TAB_H.
10441
10442 * NEWS: Officially drop support for building Bison with K&R C,
10443 since it didn't work anyway and it's not worth worrying about.
10444 * Makefile.maint (wget_files): Remove ansi2knr.c.
10445 (ansi2knr.c-url_prefix): Remove.
10446 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
10447 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10448 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10449
10450 2002-10-15 Paul Eggert <eggert@twinsun.com>
10451
10452 Stop using the "enum_" trick for K&R-style function definitions;
10453 it confused me, and I was the author! Instead, assume that people
10454 who want to use K&R C compilers (when using these modules in GCC,
10455 perhaps?) will run ansi2knr.
10456
10457 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
10458 All uses of "enum_" changed to "enum ".
10459 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10460 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10461
10462 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
10463 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
10464 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
10465 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
10466 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
10467 abitset_not, abitset_ones, abitset_or, abitset_or_and,
10468 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
10469 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
10470 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
10471 Use function prototypes; this removes the need for declaring
10472 static functions simply to provide their prototypes.
10473 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
10474 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
10475 bitset_count_, bitset_create, bitset_dump, bitset_first,
10476 bitset_free, bitset_init, bitset_last, bitset_next,
10477 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
10478 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
10479 bitset_print, bitset_release_memory, bitset_toggle_,
10480 bitset_type_choose, bitset_type_get, bitset_type_name_get,
10481 debug_bitset): Likewise.
10482 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
10483 * lib/bitset_stats.c (bitset_log_histogram_print,
10484 bitset_percent_histogram_print, bitset_stats_and,
10485 bitset_stats_and_cmp, bitset_stats_and_or,
10486 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
10487 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
10488 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
10489 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
10490 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
10491 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
10492 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
10493 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
10494 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
10495 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
10496 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
10497 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
10498 bitset_stats_zero): Likewise.
10499 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10500 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10501 bitsetv_dump, debug_bitsetv): Likewise.
10502 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
10503 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
10504 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
10505 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
10506 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
10507 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
10508 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
10509 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
10510 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
10511 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
10512 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
10513 Likewise.
10514 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
10515 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
10516 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
10517 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
10518 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
10519 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
10520 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
10521 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
10522 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
10523 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
10524 lbitset_xor_cmp, lbitset_zero): Likewise.
10525
10526 2002-10-14 Akim Demaille <akim@epita.fr>
10527
10528 Version 1.75.
10529
10530 2002-10-14 Akim Demaille <akim@epita.fr>
10531
10532 * tests/Makefile.am (maintainer-check-posix): New.
10533
10534 2002-10-14 Akim Demaille <akim@epita.fr>
10535
10536 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
10537 member.
10538
10539 2002-10-14 Akim Demaille <akim@epita.fr>
10540
10541 * src/tables.c (table_ninf_remap): base -> tab.
10542 Reported by Matt Rosing.
10543
10544 2002-10-14 Paul Eggert <eggert@twinsun.com>
10545
10546 * tests/action.at, tests/calc.at, tests/conflicts.at,
10547 tests/cxx-type.at, tests/headers.at, tests/input.at,
10548 tests/regression.at, tests/synclines.at, tests/torture.at:
10549 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
10550 so that the tests still work even if POSIXLY_CORRECT is set.
10551 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
10552
10553 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
10554 for portability to K&R hosts. Fix typo: signed char is guaranteed
10555 only to 127, not to 128.
10556 * data/glr.c (yysigned_char): New type.
10557 * data/yacc.c (yysigned_char): Likewise.
10558 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
10559
10560 2002-10-13 Paul Eggert <eggert@twinsun.com>
10561
10562 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
10563 true due to limited range of data type" warning from GCC.
10564
10565 * data/c.m4 (b4_token_defines): Protect against double-inclusion
10566 by wrapping enum yytokentype's definition inside #ifndef
10567 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
10568
10569 2002-10-13 Akim Demaille <akim@epita.fr>
10570
10571 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
10572 Un yy- yyrhs to avoid the name clash with the global YYRHS.
10573
10574 2002-10-13 Akim Demaille <akim@epita.fr>
10575
10576 * Makefile.maint: Update from Autoconf 2.54.
10577 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
10578
10579 2002-10-13 Akim Demaille <akim@epita.fr>
10580
10581 * src/print.c (print_state): Separate the list of solved conflicts
10582 from the other items.
10583 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
10584
10585 2002-10-13 Akim Demaille <akim@epita.fr>
10586
10587 Let nondeterministic skeletons be usable with deterministic
10588 tables.
10589
10590 With the patch, GAWK compiled by GCC without -O2 passes its test
10591 suite using a GLR parser driven by LALR tables. It fails with -O2
10592 because `struct stat' gives two different answers on my machine:
10593 88 (definition of an auto var) and later 96 (memset on this var).
10594 Hence the stack is badly corrumpted. The headers inclusion is to
10595 blame: if I move the awk.h inclusion before GLR's system header
10596 inclusion, the two struct stat have the same size.
10597
10598 * src/tables.c (pack_table): Always create conflict_table.
10599 (token_actions): Always create conflict_list.
10600 * data/glr.c (YYFLAG): Remove, unused.
10601
10602 2002-10-13 Akim Demaille <akim@epita.fr>
10603
10604 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
10605 (O0FLAGS): New.
10606 (VALGRIND, GXX): New.
10607 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
10608 * tests/bison.in: Run $PREBISON a pre-command.
10609 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
10610 (maintainer-check-g++): New.
10611 * Makefile.am (maintainer-check): New.
10612
10613 2002-10-13 Akim Demaille <akim@epita.fr>
10614
10615 * data/glr.c: Formatting changes.
10616 Tweak some trace messages to match yacc.c's.
10617
10618 2002-10-13 Akim Demaille <akim@epita.fr>
10619
10620 GLR parsers sometimes raise parse errors instead of performing the
10621 default reduction.
10622 Reported by Charles-Henry de Boysson.
10623
10624 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
10625 check the length of the traces when %glr.
10626 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
10627 GLR's traces.
10628 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
10629 Test GLR parsers.
10630 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
10631 (yyltype): Remove the yy prefix from the member names.
10632 (yytable): Complete its comment.
10633 (yygetLRActions): Map error action number from YYTABLE from
10634 YYTABLE_NINF to 0.
10635 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
10636 (which was a bug: it should have been YYTABEL_NINF, and yet it was
10637 not satisfying as we could compare an YYACTION computed from
10638 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
10639 only value for error actions.
10640 (yyreportParseError): In verbose parse error messages, don't issue
10641 `error' in the list of expected tokens.
10642 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
10643 next action to perform to match glr.c's decoding.
10644 (yytable): Complete its comment.
10645
10646 2002-10-13 Paul Eggert <eggert@twinsun.com>
10647
10648 Fix problem reported by Henrik Grubbstroem in
10649 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
10650 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
10651 because the Bison parser reads the second action before reducing
10652 the first one.
10653 * src/scan-gram.l (rule_length): New static var.
10654 Use it to keep track of the rule length in the scanner, since
10655 we can't expect the parser to be in lock-step sync with the scanner.
10656 (handle_action_dollar, handle_action_at): Use this var.
10657 * tests/actions.at (Exotic Dollars): Test for the problem.
10658
10659 2002-10-12 Paul Eggert <eggert@twinsun.com>
10660
10661 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
10662 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
10663 Include <sys/time.h> when checking for clock_t and struct tms.
10664 Use same include order as source.
10665 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
10666 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
10667
10668 * lib/timevar.c: Update copyright date and clarify comments.
10669 (get_time) [IN_GCC]: Keep the GCC version for reference.
10670
10671 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
10672 GCC version as of today, then merge Bison's changes.
10673 Change "GCC" to "Bison" in copyright notice. timevar.def's
10674 author is Akim, so change that too.
10675
10676 * src/reader.c (grammar_current_rule_check):
10677 Don't worry about the default action if $$ is untyped.
10678 Prevents bogus warnings reported by Jim Gifford in
10679 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
10680
10681 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
10682 * data/glr.c, data/lalr1.cc, data/yacc.c:
10683 Output token definitions before the first part of user declarations.
10684 Fixes compatibility problem reported by Jim Gifford for kbd in
10685 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
10686
10687 2002-10-11 Paul Eggert <eggert@twinsun.com>
10688
10689 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
10690 (yyparse): here. This undoes some of the 2002-07-25 change.
10691 Compatibility problem reported by Ralf S. Engelschall with
10692 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
10693
10694 2002-10-11 Akim Demaille <akim@epita.fr>
10695
10696 * tests/regression.at Characters Escapes): New.
10697 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
10698 characters.
10699 Reported by Jan Nieuwenhuizen.
10700
10701 2002-10-11 Akim Demaille <akim@epita.fr>
10702
10703 * po/id.po: New.
10704
10705 2002-10-10 Paul Eggert <eggert@twinsun.com>
10706
10707 Portability fixes for bitsets; this also avoids several GCC
10708 warnings.
10709
10710 * lib/abitset.c: Include <stddef.h>, for offsetof.
10711 * lib/lbitset.c: Likewise.
10712
10713 * lib/abitset.c (abitset_bytes): Return a size that is aligned
10714 properly for vectors of objects. Do not assume that adding a
10715 header size to a multiple of a word size yields a value that is
10716 properly aligned for the whole union.
10717 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10718
10719 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
10720 unique names for structures.
10721 * lib/ebitset.c (ebitset_bytes): Likewise.
10722 * lib/lbitset.c (lbitset_bytes): Likewise.
10723
10724 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
10725 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
10726 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
10727 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
10728 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
10729 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
10730 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
10731 to improve the type-checking that GCC can do.
10732 * lib/bitset.c (bitset_op4_cmp): Likewise.
10733 * lib/bitset_stats.c (bitset_stats_count,
10734 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
10735 bitset_stats_copy, bitset_stats_disjoint_p,
10736 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
10737 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
10738 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
10739 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
10740 bitset_stats_and_or_cmp, bitset_stats_andn_or,
10741 bitset_stats_andn_or_cmp, bitset_stats_or_and,
10742 bitset_stats_or_and_cmp): Likewise.
10743 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
10744 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
10745 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
10746 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
10747
10748 * lib/abitset.h: Include bitset.h, not bbitset.h.
10749 * lib/ebitset.h: Likewise.
10750 * lib/lbitset.h: Likewise.
10751
10752 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
10753 All instances of parameters of type enum bitset_opts are now of
10754 type enum_bitset_opts, to conform to the C Standard, and similarly
10755 for enum_bitset_type.
10756 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10757 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10758
10759 Do not use "struct bitset_struct" to mean different things in
10760 different modules. Not only is this confusing, it violates
10761 the C Standard, which requires that structure types in different
10762 modules must be compatible if one is to be passed to the other.
10763 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
10764 All instances of "struct bitset_struct *" replaced with "bitset".
10765 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
10766 (union bitset_union, struct abitset_struct, struct ebitset_struct,
10767 struct lbitset_struct, struct bitset_stats_struct): New types.
10768 All uses of struct bitset_struct changed to union bitset_union,
10769 etc.
10770 * lib/abitset.c (struct abitset_struct, abitset,
10771 struct bitset_struct): Remove.
10772 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
10773 struct bitset_struct): Remove.
10774 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
10775 bitset_struct): Remove.
10776 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
10777 Likewise.
10778
10779 Do not call a function of type T using a call that assumes the
10780 function is of a different type U. Standard C requires that a
10781 function must be called with a type that is compatible with its
10782 definition.
10783 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10784 New decls.
10785 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10786 New functions.
10787 * lib/ebitset.c (PFV): Remove.
10788 * lib/lbitset.c (PFV): Likewise.
10789 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
10790 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
10791 decls.
10792 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
10793 (ebitset_vtable): Use them.
10794 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
10795 lbitset_xor): New functions.
10796 (lbitset_vtable): Use them.
10797
10798 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
10799 Declare.
10800
10801 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
10802 GCC warning.
10803 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
10804 Use offsetof, for simplicity.
10805
10806 2002-10-06 Paul Eggert <eggert@twinsun.com>
10807
10808 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
10809 the same width as int. This reapplies a hunk of the 2002-08-12 patch
10810 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
10811 which was inadvertently undone by the 2002-09-30 patch.
10812 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
10813 the same width as int.
10814
10815 2002-10-04 Paul Eggert <eggert@twinsun.com>
10816
10817 Version 1.50.
10818
10819 * configure.ac (AC_INIT), NEWS: Increment version number.
10820
10821 * doc/bison.texinfo: Minor spelling, grammar, and white space
10822 fixes.
10823 (Symbols): Mention that any negative value returned from yylex
10824 signifies end-of-input. Warn about negative chars. Mention
10825 the portable Standard C character set.
10826
10827 The GNU coding standard says CFLAGS and YFLAGS are reserved
10828 for the installer to set.
10829 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
10830 * src/Makefile.am (AM_CFLAGS): Likewise.
10831 (AM_YFLAGS): Renamed from YFLAGS.
10832
10833 Fix some MAX and MIN problems.
10834 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
10835 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
10836 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
10837 * src/reader.c (reader): Use it.
10838
10839 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
10840 POSIX 1003.1-2001 has removed fgrep.
10841
10842 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
10843
10844 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
10845 interpreted as signed.
10846 * lib/ebitset.c (ebitset_list): Fix bug.
10847
10848 2002-10-01 Paul Eggert <eggert@twinsun.com>
10849
10850 More fixes for 64-bit hosts and large bitsets.
10851
10852 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
10853 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
10854 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
10855 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
10856 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
10857 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
10858 bitset_count_): Likewise.
10859 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
10860 bitset_first, bitset_last): Likewise.
10861 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
10862 bitset_stats_list_reverse, bitset_stats_size,
10863 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
10864 Likewise.
10865 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10866 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10867 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10868 bitsetv_reflexive_transitive_closure): Likewise.
10869 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
10870 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
10871 Likewise.
10872 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
10873 Likewise.
10874
10875 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
10876 Use size_t, not unsigned int, to count bytes.
10877 * lib/abitset.h (abitset_bytes): Likewise.
10878 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
10879 Likewise.
10880 * lib/bitset.h (bitset_bytes): Likewise.
10881 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
10882 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
10883 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10884 * lib/ebitset.c (ebitset_bytes): Likewise.
10885 * lib/ebitset.h (ebitset_bytes): Likewise.
10886 * lib/lbitset.c (lbitset_bytes): Likewise.
10887 * lib/lbitset.h (lbitset_bytes): Likewise.
10888
10889 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
10890 abitset_subset_p, abitset_disjoint_p, abitset_and,
10891 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
10892 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
10893 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
10894 abitset_or_and, abitset_or_and_cmp):
10895 Use bitset_windex instead of unsigned int.
10896 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10897 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
10898 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
10899 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
10900 Likewise.
10901 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
10902
10903 * lib/bitset.c (bitset_print):
10904 Use proper printf formats for widths of integer types.
10905 * lib/bitset_stats.c (bitset_percent_histogram_print,
10906 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
10907 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10908 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10909 * lib/lbitset.c (lbitset_bytes): Likewise.
10910
10911 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
10912 BITSET_SIZE_MAX): New macros.
10913 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
10914 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
10915 to BITSET_WINDEX_MAX.
10916
10917 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
10918 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
10919 since we now return the bitset_bindex type (not int).
10920
10921 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
10922 when computing sizes.
10923 * lib/ebitset.c (ebitset_elts_grow): Likewise.
10924
10925 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
10926 and avoid cast to unsigned.
10927
10928 2002-09-30 Akim Demaille <akim@epita.fr>
10929
10930 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10931 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
10932 Updates from Michael Hayes.
10933
10934 2002-09-30 Art Haas <ahaas@neosoft.com>
10935
10936 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
10937 invocations.
10938 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
10939 defined.
10940
10941 2002-09-27 Akim Demaille <akim@epita.fr>
10942
10943 Version 1.49c.
10944
10945 2002-09-27 Akim Demaille <akim@epita.fr>
10946
10947 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
10948 (Because of AC_LIBSOURCE).
10949
10950 2002-09-27 Akim Demaille <akim@epita.fr>
10951
10952 Playing with Autoscan.
10953
10954 * configure.ac: Remove the old LIBOBJ tweaks.
10955 (AC_REPLACE_FUNCS): Add strrchr and strtol.
10956 * lib/strrchr.c: New.
10957 * lib/strtol.c: New, from the Coreutils 4.5.1.
10958
10959 2002-09-27 Akim Demaille <akim@epita.fr>
10960
10961 Playing with Autoscan.
10962
10963 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
10964 * lib/Makefile.am (libbison_a_SOURCES): No longer include
10965 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
10966 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
10967 Coreutils 4.5.1.
10968
10969 2002-09-24 Akim Demaille <akim@epita.fr>
10970
10971 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
10972 (Frequently Asked Questions, Parser Stack Overflow): New.
10973
10974 2002-09-13 Akim Demaille <akim@epita.fr>
10975
10976 Playing with autoscan.
10977
10978 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
10979 * src/files.c (skeleton_find): Remove, unused.
10980 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
10981 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
10982
10983 2002-09-13 Akim Demaille <akim@epita.fr>
10984
10985 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
10986 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
10987
10988 2002-09-13 Akim Demaille <akim@epita.fr>
10989
10990 * configure.ac: Require 2.54.
10991 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
10992 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
10993 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
10994 Remove, provided by Autoconf macros.
10995
10996 2002-09-12 Akim Demaille <akim@epita.fr>
10997
10998 * m4/prereq.m4: Update, from Coreutils 4.5.1.
10999
11000 2002-09-12 Akim Demaille <akim@epita.fr>
11001
11002 * m4/prereq.m4: Update, from Fileutils 4.1.5.
11003 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
11004 Reported by Martin Mokrejs.
11005
11006 2002-09-10 Akim Demaille <akim@epita.fr>
11007
11008 * src/parse-gram.y: Associate a human readable string to each
11009 token type.
11010 * tests/regression.at (Invalid inputs): Adjust.
11011
11012 2002-09-10 Gary V. Vaughan <gary@gnu.org>
11013
11014 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
11015 with an Autoconf-2.5x style configure.ac.
11016
11017 2002-09-06 Paul Eggert <eggert@twinsun.com>
11018
11019 * doc/bison.texinfo (Conditions): Make explicit that the GPL
11020 exception applies only to yacc.c. This is a modification of a
11021 patch originally suggested by Akim Demaille.
11022
11023 2002-09-06 Akim Demaille <akim@epita.fr>
11024
11025 * data/c.m4 (b4_copyright): Move the GPL exception comment from
11026 here to...
11027 * data/yacc.c: here.
11028
11029 * data/lalr1.cc (struct yyltype): Don't define it, since we use
11030 LocationType.
11031 (b4_ltype): Default to yy::Location from location.hh.
11032
11033 2002-09-04 Jim Meyering <jim@meyering.net>
11034
11035 * data/yacc.c: Guard the declaration of yytoknum also with
11036 `#ifdef YYPRINT', so it is declared only when used.
11037
11038 2002-09-04 Akim Demaille <akim@epita.fr>
11039
11040 * configure.in: Rename as...
11041 * configure.ac: this.
11042 Bump to 1.49c.
11043
11044 2002-09-04 Akim Demaille <akim@epita.fr>
11045
11046 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
11047 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
11048 translate maintainer only messages.
11049
11050 2002-08-12 Paul Eggert <eggert@twinsun.com>
11051
11052 Version 1.49b.
11053
11054 * Makefile.am (SUBDIRS): Remove intl.
11055 (DISTCLEANFILES): Remove.
11056 * NEWS: Mention that GNU M4 is now required. Clarify what is
11057 meant by "larger grammars". Mention the pt_BR translation.
11058 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
11059 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
11060 Bump version from 0.11.2 to 0.11.5.
11061 (BISON_PREREQ_STAGE): Remove.
11062 (AM_GNU_GETTEXT): Use external gettext.
11063 (AC_OUTPUT): Remove intl/Makefile.
11064
11065 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
11066
11067 * data/glr.c: Include string.h, for strlen.
11068 (yyreportParseError): Use size_t for yysize.
11069 (yy_yypstack): No longer nested inside yypstates, as nested
11070 functions are not portable. Do not assume size_t is the
11071 same width as int.
11072 (yypstates): Do not assume that ptrdiff_t is the same width
11073 as int, and similarly for yyposn and YYINDEX.
11074
11075 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
11076
11077 * lib/Makefile.am (INCLUDES): Do not include from the intl
11078 directory, which has been removed.
11079 * src/Makefile.am (INCLUDES): Likewise.
11080
11081 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
11082 (bitsets_sources, additional_bitsets_sources, timevars_sources):
11083 New vars.
11084
11085 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
11086 * tests/Makefile.am (EXTRA_DIST): Likewise.
11087
11088 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
11089 Do not assume that bitset_windex is the same width as unsigned.
11090
11091 * lib/abitset.c (abitset_unused_clear): Do not assume that
11092 bitset_word is the same width as int.
11093 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
11094 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
11095 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
11096 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
11097 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
11098
11099 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
11100 portability to one's complement hosts!).
11101 * lib/ebitset.c (ebitset_op1): Likewise.
11102 * lib/lbitset.c (lbitset_op1): Likewise.
11103
11104 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
11105 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11106 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
11107 Sync with fileutils.
11108 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
11109 lib/gettext.h: Sync with diffutils.
11110
11111 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
11112 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
11113
11114 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
11115 PROTOTYPES to check for prototypes, and "defined __STDC__" to
11116 check for void *.
11117
11118 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
11119 size_t; the old version tried to do this but casted improperly.
11120 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
11121 (bitset_test): Now returns int, not unsigned long.
11122
11123 * lib/bitset_stats.c: Include "gettext.h".
11124 (_): New macro.
11125 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
11126 name locals "index", as it generates unnecessary warnings on some
11127 hosts that have an "index" function.
11128
11129 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
11130 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
11131 they need translation.
11132 * src/LR0.c (state_list_append, new_itemsets, get_state,
11133 append_states, generate_states): Likewise.
11134 * src/assoc.c (assoc_to_string): Likewise.
11135 * src/closure.c (print_closure, set_firsts, closure): Likewise.
11136 * src/gram.c (grammar_dump): Likewise.
11137 * src/injections.c (injections_compute): Likewise.
11138 * src/lalr.c (lookaheads_print): Likewise.
11139 * src/relation.c (relation_transpose): Likewise.
11140 * src/scan-gram.l: Likewise.
11141 * src/tables.c (table_grow, pack_vector): Likewise.
11142
11143 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
11144 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
11145 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
11146 * m4/mbstate_t.m4: Sync with fileutils.
11147 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
11148
11149 * po/LINGUAS: Add pt_BR.
11150 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
11151 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
11152 lib/timevar.c.
11153 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
11154 manual recommends.
11155 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
11156
11157 * src/complain.c (strerror_r): Remove decl; not needed.
11158 (strerror): Use same pattern as ../lib/error.c.
11159
11160 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
11161
11162 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
11163
11164 * src/main.c (main): Cast result of bindtextdomain and textdomain
11165 to void, to avoid a GCC warning when --disable-nls is in effect.
11166
11167 * src/scan-gram.l: Use strings rather than escapes when possible,
11168 to minimize the number of warnings from xgettext.
11169 (handle_action_dollar, handle_action_at): Don't use isdigit,
11170 as it mishandles negative chars and it may not work as expected
11171 outside the C locale.
11172
11173 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
11174 this is a GCC extension and is not portable to other compilers.
11175
11176 * src/system.h (alloca): Use same pattern as ../lib/error.c.
11177 Do not include <ctype.h>; no longer needed.
11178 Do not include <malloc.h>; no longer needed (and generates
11179 warnings on OpenBSD 3.0).
11180
11181 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
11182 it's not portable.
11183
11184 * tests/regression.at: Do not use 'cc -c input.c -o input';
11185 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
11186
11187 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
11188 exit status as failure, not just exit status 1. Sun C exits
11189 with status 2 sometimes.
11190
11191 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
11192 Use it for the two large tests.
11193
11194 2002-08-02 Akim Demaille <akim@epita.fr>
11195
11196 * src/conflicts.c (conflicts_output): Don't output rules never
11197 reduced here, since anyway that computation doesn't work.
11198 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
11199 (rule_useless_p, rule_never_reduced_p): New.
11200 (grammar_rules_partial_print): Use a filter instead of a range.
11201 Display the title only if needed.
11202 (grammar_rules_print): Adjust.
11203 (grammar_rules_never_reduced_report): New.
11204 * src/tables.c (action_row): Move the computation of rules never
11205 reduced to...
11206 (token_actions): here.
11207 * src/main.c (main): Make the parser before making the report, so
11208 that rules never reduced are computed.
11209 Call grammar_rules_never_reduced_report.
11210 * src/print.c (print_results): Report rules never reduced.
11211 * tests/conflicts.at, tests/reduce.at: Adjust.
11212
11213 2002-08-01 Akim Demaille <akim@epita.fr>
11214
11215 Instead of attaching lookaheads and duplicating the rules being
11216 reduced by a state, attach the lookaheads to the reductions.
11217
11218 * src/state.h (state_t): Remove the `lookaheads',
11219 `lookaheads_rule' member.
11220 (reductions_t): Add a `lookaheads' member.
11221 Use a regular array for the `rules'.
11222 * src/state.c (reductions_new): Initialize the lookaheads member
11223 to 0.
11224 (state_rule_lookaheads_print): Adjust.
11225 * src/state.h, src/state.c (state_reductions_find): New.
11226 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
11227 (count_rr_conflicts): Adjust.
11228 * src/lalr.c (LArule): Remove.
11229 (add_lookback_edge): Adjust.
11230 (state_lookaheads_count): New.
11231 (states_lookaheads_initialize): Merge into...
11232 (initialize_LA): this.
11233 (lalr_free): Adjust.
11234 * src/main.c (main): Don't free nullable and derives too early: it
11235 is used by --verbose.
11236 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
11237
11238 2002-08-01 Akim Demaille <akim@epita.fr>
11239
11240 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
11241 `rule_number_t**'.
11242 (set_derives, free_derives): Rename as...
11243 (derives_compute, derives_free): this.
11244 Adjust all dependencies.
11245 * src/nullable.c (set_nullable, free_nullable): Rename as...
11246 (nullable_compute, nullable_free): these.
11247 (rule_list_t): Store rule_t *, not rule_number_t.
11248 * src/state.c (state_rule_lookaheads_print): Directly compare rule
11249 pointers, instead of their numbers.
11250 * src/main.c (main): Call nullable_free, and derives_free earlier,
11251 as they were lo longer used.
11252
11253 2002-08-01 Akim Demaille <akim@epita.fr>
11254
11255 * lib/timevar.c (get_time): Include children time.
11256 * src/lalr.h (LA, LArule): Don't export them: used with the
11257 state_t.
11258 * src/lalr.c (LA, LArule): Static.
11259 * src/lalr.h, src/lalr.c (lalr_free): New.
11260 * src/main.c (main): Call it.
11261 * src/tables.c (pack_vector): Check whether loc is >= to the
11262 table_size, not >.
11263 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
11264 (tables_generate): do it, since that's also it which allocates
11265 them.
11266 Don't free LA and LArule, main does.
11267
11268 2002-07-31 Akim Demaille <akim@epita.fr>
11269
11270 Separate parser tables computation and output.
11271
11272 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
11273 (conflict_list, conflict_list_cnt, table, check, table_ninf)
11274 (yydefgoto, yydefact, high): Move to...
11275 * src/tables.h, src/tables.c: here.
11276 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11277 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11278 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
11279 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
11280 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
11281 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
11282 (action_row, save_row, token_actions, save_column, default_goto)
11283 (goto_actions, sort_actions, matching_state, pack_vector)
11284 (table_ninf_remap, pack_table, prepare_actions): Move to...
11285 * src/tables.c: here.
11286 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
11287 * src/output.c (token_actions, output_base, output_conflicts)
11288 (output_check): Merge into...
11289 (prepare_actions): this.
11290 (actions_output): Rename as...
11291 (user_actions_output): this.
11292 * src/main.c (main): Call tables_generate and tables_free.
11293
11294 2002-07-31 Akim Demaille <akim@epita.fr>
11295
11296 Steal GCC's --time-report support.
11297
11298 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
11299 stolen/adjusted from GCC.
11300 * m4/stage.m4: Remove time related checks.
11301 * m4/timevar.m4: New.
11302 * configure.in: Adjust.
11303 * src/system.h: Adjust to using timevar.h.
11304 * src/getargs.h, src/getargs.c: Support trace_time for
11305 --trace=time.
11306 * src/main.c (stage): Remove.
11307 (main): Replace `stage' invocations with timevar calls.
11308 * src/output.c: Insert pertinent timevar calls.
11309
11310 2002-07-31 Akim Demaille <akim@epita.fr>
11311
11312 Let --trace have arguments.
11313
11314 * src/getargs.h (enum trace_e): New.
11315 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
11316 (long_options, short_options): --trace/-T takes an optional
11317 argument.
11318 Change all the uses of trace_flag to reflect the new flags.
11319 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
11320
11321 Strengthen `stage' portability.
11322
11323 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
11324 * configure.in: Use it.
11325 Don't check for malloc.h and sys/times.h.
11326 * src/system.h: Include them when appropriate.
11327 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
11328 times and struct tms are available.
11329
11330 2002-07-30 Akim Demaille <akim@epita.fr>
11331
11332 In verbose parse error message, don't report `error' as an
11333 expected token.
11334 * tests/actions.at (Printers and Destructors): Adjust.
11335 * tests/calc.at (Calculator $1): Adjust.
11336 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
11337 error message, do not report the parser accepts the error token in
11338 that state.
11339
11340 2002-07-30 Akim Demaille <akim@epita.fr>
11341
11342 Normalize conflict related messages.
11343
11344 * src/complain.h, src/complain.c (warn, complain): New.
11345 * src/conflicts.c (conflicts_print): Use them.
11346 (conflict_report_yacc): New, extracted from...
11347 (conflicts_print): here.
11348 * tests/conflicts.at, tests/existing.at: Adjust.
11349
11350 2002-07-30 Akim Demaille <akim@epita.fr>
11351
11352 Report rules which are never reduced by the parser: those hidden
11353 by conflicts.
11354
11355 * src/LR0.c (save_reductions): Don't make the final state too
11356 different: save its reduction (accept) instead of having a state
11357 without any action (no shift or goto, no reduce).
11358 Note: the final state is now a ``regular'' state, i.e., the
11359 parsers now contain `reduce 0' as default reduction.
11360 Nevertheless, since they decide to `accept' when yystate =
11361 final_state, they still will not reduce rule 0.
11362 * src/print.c (print_actions, print_reduction): Adjust.
11363 * src/output.c (action_row): Track reduced rules.
11364 (token_actions): Report rules never reduced.
11365 * tests/conflicts.at, tests/regression.at: Adjust.
11366
11367 2002-07-30 Akim Demaille <akim@epita.fr>
11368
11369 `stage' was accidently included in a previous patch.
11370 Initiate its autoconfiscation.
11371
11372 * configure.in: Look for malloc.h and sys/times.h.
11373 * src/main.c (stage): Adjust.
11374 Report only when trace_flag.
11375
11376 2002-07-29 Akim Demaille <akim@epita.fr>
11377
11378 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
11379 state_number_t.
11380 (errs_t): symbol_t*, not symbol_number_t.
11381 (reductions_t): rule_t*, not rule_number_t.
11382 (FOR_EACH_SHIFT): New.
11383 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
11384 * src/print.c, src/print_graph.c: Adjust.
11385
11386 2002-07-29 Akim Demaille <akim@epita.fr>
11387
11388 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
11389
11390 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
11391 (endtoken, accept): these.
11392 * src/reader.c (reader): Set endtoken's default tag to "$end".
11393 Set undeftoken's tag to "$undefined" instead of "$undefined.".
11394 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
11395 Adjust.
11396
11397 2002-07-29 Akim Demaille <akim@epita.fr>
11398
11399 * src/reduce.c (reduce_grammar): When the language is empty,
11400 complain about the start symbol, not the axiom.
11401 Use its location.
11402 * tests/reduce.at (Empty Language): New.
11403
11404 2002-07-26 Akim Demaille <akim@epita.fr>
11405
11406 * src/reader.h, src/reader.c (gram_error): ... can't get
11407 yycontrol without making too strong assumptions on the parser
11408 itself.
11409 * src/output.c (prepare_tokens): Use the real 0th value of
11410 token_translations instead of `0'.
11411 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
11412 visible here.
11413 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
11414 for the time being: %locations ought to provide it to yyerror.
11415
11416 2002-07-25 Akim Demaille <akim@epita.fr>
11417
11418 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
11419 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
11420 * tests/regression.at (Web2c Actions): Adjust.
11421
11422 2002-07-25 Akim Demaille <akim@epita.fr>
11423
11424 Stop storing rules from 1 to nrules + 1.
11425
11426 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
11427 * src/nullable.c, src/output.c, src/print.c, src/reader.c
11428 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
11429 Iterate from 0 to nrules.
11430 Use rule_number_as_item_number and item_number_as_rule_number.
11431 Adjust to `derive' now containing possibly 0.
11432 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
11433 Handle the `- 1' part in rule numbers from/to item numbers.
11434 * src/conflicts.c (log_resolution): Fix the message which reversed
11435 shift and reduce.
11436 * src/output.c (action_row): Initialize default_rule to -1.
11437 (token_actions): Adjust.
11438 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
11439 expected output.
11440 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
11441
11442 2002-07-25 Akim Demaille <akim@epita.fr>
11443
11444 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
11445 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
11446 (b4_c_knr_arg_decl): New.
11447 * data/yacc.c: Use it to define yysymprint, yydestruct, and
11448 yyreport_parse_error.
11449
11450 2002-07-25 Akim Demaille <akim@epita.fr>
11451
11452 * data/yacc.c (yyreport_parse_error): New, extracted from...
11453 (yyparse): here.
11454 (yydestruct, yysymprint): Move above yyparse.
11455 Be K&R compliant.
11456
11457 2002-07-25 Akim Demaille <akim@epita.fr>
11458
11459 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
11460 replace...
11461 (b4_sint_type, b4_uint_type): these.
11462 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
11463 * tests/regression.at (Web2c Actions): Adjust.
11464
11465 2002-07-25 Akim Demaille <akim@epita.fr>
11466
11467 * src/gram.h (TIEM_NUMBER_MAX): New.
11468 (item_number_of_rule_number, rule_number_of_item_number): Rename
11469 as...
11470 (rule_number_as_item_number, item_number_as_rule_number): these.
11471 Adjust dependencies.
11472 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11473 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11474 (symbol_number_to_vector_number): New.
11475 (order): Of vector_number_t* type.
11476 (base_t, BASE_MAX, BASE_MIN): New.
11477 (froms, tos, width, pos, check): Of base_t type.
11478 (action_number_t, ACTION_MIN, ACTION_MAX): New.
11479 (actrow): Of action_number_t type.
11480 (conflrow): Of unsigned int type.
11481 (table_ninf, base_ninf): New.
11482 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
11483 (muscle_insert_int_table, muscle_insert_base_table)
11484 (muscle_insert_rule_number_table): New.
11485 (prepare_tokens): Output `toknum' as int_table.
11486 (action_row): Returns a rule_number_t.
11487 Use ACTION_MIN, not SHRT_MIN.
11488 (token_actions): yydefact is rule_number_t*.
11489 (table_ninf_remap): New.
11490 (pack_table): Use it for `base' and `table'.
11491 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
11492 replaced with...
11493 (YYPACT_NINF, YYTABLE_NINF): these.
11494 (yypact, yytable): Compute their types instead of hard-coded
11495 `short'.
11496 * tests/regression.at (Web2c Actions): Adjust.
11497
11498 2002-07-19 Akim Demaille <akim@epita.fr>
11499
11500 * src/scan-gram.l (id): Can start with an underscore.
11501
11502 2002-07-16 Akim Demaille <akim@epita.fr>
11503
11504 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
11505 Adjust all former `associativity' dependencies.
11506 * src/symtab.c (symbol_new): Default associativity is `undef', not
11507 `right'.
11508 (symbol_check_alias_consistence): Adjust.
11509
11510 2002-07-09 Akim Demaille <akim@epita.fr>
11511
11512 * doc/bison.texinfo: Properly set the ``header'' part.
11513 Use @dircategory ``GNU programming tools'' as per Texinfo's
11514 documentation.
11515 Use @copying.
11516
11517 2002-07-09 Akim Demaille <akim@epita.fr>
11518
11519 * lib/quotearg.h: Protect against multiple inclusions.
11520 * src/location.h (location_t): Add a `file' member.
11521 (LOCATION_RESET, LOCATION_PRINT): Adjust.
11522 * src/complain.c (warn_at, complain_at, fatal_at): Drop
11523 `error_one_per_line' support.
11524
11525 2002-07-09 Akim Demaille <akim@epita.fr>
11526
11527 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
11528 * src/reader.c (lineno): Remove.
11529 Adjust all dependencies.
11530 (get_merge_function): Take a location and use complain_at.
11531 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
11532 * tests/regression.at (Invalid inputs, Mixing %token styles):
11533 Adjust.
11534
11535 2002-07-09 Akim Demaille <akim@epita.fr>
11536
11537 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
11538 recovery rule, and forbid extensions when --yacc.
11539 (gram_error): Use complain_at.
11540 * src/reader.c (reader): Exit if there were parse errors.
11541
11542 2002-07-09 Akim Demaille <akim@epita.fr>
11543
11544 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
11545 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
11546 Reported by R Blake <blakers@mac.com>.
11547
11548 2002-07-09 Akim Demaille <akim@epita.fr>
11549
11550 * data/yacc.c: Output the copyright notive in the header.
11551
11552 2002-07-03 Akim Demaille <akim@epita.fr>
11553
11554 * src/output.c (froms, tos): Are state_number_t.
11555 (save_column): sp, sp1, and sp2 are state_number_t.
11556 (prepare): Rename `final' as `final_state_number', `nnts' as
11557 `nterms_number', `nrules' as `rules_number', `nstates' as
11558 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
11559 unused.
11560 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
11561 * data/lalr1.cc (nsym_): Remove, unused.
11562
11563 2002-07-03 Akim Demaille <akim@epita.fr>
11564
11565 * src/lalr.h, src/lalr.c (goto_number_t): New.
11566 * src/lalr.c (goto_list_t): New.
11567 Propagate them.
11568 * src/nullable.c (rule_list_t): New.
11569 Propagate.
11570 * src/types.h: Remove.
11571
11572 2002-07-03 Akim Demaille <akim@epita.fr>
11573
11574 * src/closure.c (print_fderives): Use rule_rhs_print.
11575 * src/derives.c (print_derives): Use rule_rhs_print.
11576 (rule_list_t): New, replaces `shorts'.
11577 (set_derives): Add comments.
11578 * tests/sets.at (Nullable, Firsts): Adjust.
11579
11580 2002-07-03 Akim Demaille <akim@epita.fr>
11581
11582 * src/output.c (prepare_actions): Free `tally' and `width'.
11583 (prepare_actions): Allocate and free `order'.
11584 * src/symtab.c (symbols_free): Free `symbols'.
11585 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
11586 * src/output.c (m4_invoke): Move to...
11587 * src/scan-skel.l: here.
11588 (<<EOF>>): Close yyout, and free its name.
11589
11590 2002-07-03 Akim Demaille <akim@epita.fr>
11591
11592 Fix some memory leaks, and fix a bug: state 0 was examined twice.
11593
11594 * src/LR0.c (new_state): Merge into...
11595 (state_list_append): this.
11596 (new_states): Merge into...
11597 (generate_states): here.
11598 (set_states): Don't ensure a proper `errs' state member here, do it...
11599 * src/conflicts.c (conflicts_solve): here.
11600 * src/state.h, src/state.c: Comment changes.
11601 (state_t): Rename member `shifts' as `transitions'.
11602 Adjust all dependencies.
11603 (errs_new): For consistency, also take the values as argument.
11604 (errs_dup): Remove.
11605 (state_errs_set): New.
11606 (state_reductions_set, state_transitions_set): Assert that no
11607 previous value was assigned.
11608 (state_free): New.
11609 (states_free): Use it.
11610 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
11611 temporary storage: use `errs' and `nerrs' as elsewhere.
11612 (set_conflicts): Allocate and free this `errs'.
11613
11614 2002-07-02 Akim Demaille <akim@epita.fr>
11615
11616 * lib/libiberty.h: New.
11617 * lib: Update the bitset implementation from upstream.
11618 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
11619 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
11620 * src/main.c: Adjust bitset stats calls.
11621
11622 2002-07-01 Paul Eggert <eggert@twinsun.com>
11623
11624 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
11625 char, so that negative chars don't collide with $.
11626
11627 2002-06-30 Akim Demaille <akim@epita.fr>
11628
11629 Have the GLR tests be `warning' checked, and fix the warnings.
11630
11631 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
11632 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
11633 (yyremoveDeletes): `yyi' and `yyj' are size_t.
11634 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
11635 (yyaddDeferredAction): static.
11636 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
11637 (yyreportParseError): yyprefix is const.
11638 yytokenp is used only when verbose.
11639 (yy__GNUC__): Replace with __GNUC__.
11640 (yypdumpstack): yyi is size_t.
11641 (yypreference): Un-yy local variables and arguments, to avoid
11642 clashes with `yyr1'. Anyway, we are not in the user name space.
11643 (yytname_size): be an int, as is compared with ints.
11644 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
11645 Use them.
11646 * tests/cxx-gram.at: Use quotation to protect $1.
11647 Use AT_COMPILE to enable warnings hunts.
11648 Prototype yylex and yyerror.
11649 `Use' argc.
11650 Include `string.h', not `strings.h'.
11651 Produce and prototype stmtMerge only when used.
11652 yylex takes a location.
11653
11654 2002-06-30 Akim Demaille <akim@epita.fr>
11655
11656 We spend a lot of time in quotearg, in particular when --verbose.
11657
11658 * src/symtab.c (symbol_get): Store a quoted version of the key.
11659 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
11660 Adjust all callers.
11661
11662 2002-06-30 Akim Demaille <akim@epita.fr>
11663
11664 * src/state.h (reductions_t): Rename member `nreds' as num.
11665 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
11666 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
11667
11668 2002-06-30 Akim Demaille <akim@epita.fr>
11669
11670 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
11671 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
11672 (shifts_to): Rename as...
11673 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
11674 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
11675 (TRANSITION_IS_DISABLED, transitions_to): these.
11676
11677 2002-06-30 Akim Demaille <akim@epita.fr>
11678
11679 * src/print.c (print_shifts, print_gotos): Merge into...
11680 (print_transitions): this.
11681 (print_transitions, print_errs, print_reductions): Align the
11682 lookaheads columns.
11683 (print_core, print_transitions, print_errs, print_state,
11684 print_grammar): Output empty lines separator before, not after.
11685 (state_default_rule_compute): Rename as...
11686 (state_default_rule): this.
11687 * tests/conflicts.at (Defaulted Conflicted Reduction),
11688 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
11689 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
11690
11691 2002-06-30 Akim Demaille <akim@epita.fr>
11692
11693 Display items as we display rules.
11694
11695 * src/gram.h, src/gram.c (rule_lhs_print): New.
11696 * src/gram.c (grammar_rules_partial_print): Use it.
11697 * src/print.c (print_core): Likewise.
11698 * tests/conflicts.at (Defaulted Conflicted Reduction),
11699 (Unresolved SR Conflicts): Adjust.
11700 (Unresolved SR Conflicts): Adjust and rename as...
11701 (Resolved SR Conflicts): this, as was meant.
11702 * tests/regression.at (Web2c Report): Adjust.
11703
11704 2002-06-30 Akim Demaille <akim@epita.fr>
11705
11706 * src/print.c (state_default_rule_compute): New, extracted from...
11707 (print_reductions): here.
11708 Pessimize, but clarify the code.
11709 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
11710
11711 2002-06-30 Akim Demaille <akim@epita.fr>
11712
11713 * src/output.c (action_row): Let default_rule be always a rule
11714 number.
11715
11716 2002-06-30 Akim Demaille <akim@epita.fr>
11717
11718 * src/closure.c (print_firsts, print_fderives, closure):
11719 Use BITSET_EXECUTE.
11720 * src/lalr.c (lookaheads_print): Likewise.
11721 * src/state.c (state_rule_lookaheads_print): Likewise.
11722 * src/print_graph.c (print_core): Likewise.
11723 * src/print.c (print_reductions): Likewise.
11724 * src/output.c (action_row): Likewise.
11725 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
11726
11727 2002-06-30 Akim Demaille <akim@epita.fr>
11728
11729 * src/print_graph.c: Use report_flag.
11730
11731 2002-06-30 Akim Demaille <akim@epita.fr>
11732
11733 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
11734 to...
11735 * src/relation.h, src/relation.c (traverse, relation_digraph)
11736 (relation_print, relation_transpose): New.
11737
11738 2002-06-30 Akim Demaille <akim@epita.fr>
11739
11740 * src/state.h, src/state.c (shifts_to): New.
11741 * src/lalr.c (build_relations): Use it.
11742
11743 2002-06-30 Akim Demaille <akim@epita.fr>
11744
11745 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
11746 (item_number_of_rule_number, rule_number_of_item_number): New.
11747 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
11748 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
11749 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
11750 Propagate their use.
11751 Much remains to be done, in particular wrt `shorts' from types.h.
11752
11753 2002-06-30 Akim Demaille <akim@epita.fr>
11754
11755 * src/symtab.c (symbol_new): Initialize the `printer' member.
11756
11757 2002-06-30 Akim Demaille <akim@epita.fr>
11758
11759 * src/LR0.c (save_reductions): Remove, replaced by...
11760 * src/state.h, src/state.c (state_reductions_set): New.
11761 (reductions, errs): Rename as...
11762 (reductions_t, errs_t): these.
11763 Adjust all dependencies.
11764
11765 2002-06-30 Akim Demaille <akim@epita.fr>
11766
11767 * src/LR0.c (state_list_t, state_list_append): New.
11768 (first_state, last_state): Now symbol_list_t.
11769 (this_state): Remove.
11770 (new_itemsets, append_states, save_reductions): Take a state_t as
11771 argument.
11772 (set_states, generate_states): Adjust.
11773 (save_shifts): Remove, replaced by...
11774 * src/state.h, src/state.c (state_shifts_set): New.
11775 (shifts): Rename as...
11776 (shifts_t): this.
11777 Adjust all dependencies.
11778 * src/state.h (state_t): Remove the `next' member.
11779
11780 2002-06-30 Akim Demaille <akim@epita.fr>
11781
11782 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
11783 escaped in slot 0.
11784
11785 2002-06-30 Akim Demaille <akim@epita.fr>
11786
11787 Use hash.h for the state hash table.
11788
11789 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
11790 (allocate_storage): Use state_hash_new.
11791 (free_storage): Use state_hash_free.
11792 (new_state, get_state): Adjust.
11793 * src/lalr.h, src/lalr.c (states): Move to...
11794 * src/states.h (state_t): Remove the `link' member, no longer
11795 used.
11796 * src/states.h, src/states.c: here.
11797 (state_hash_new, state_hash_free, state_hash_lookup)
11798 (state_hash_insert, states_free): New.
11799 * src/states.c (state_table, state_compare, state_hash): New.
11800 * src/output.c (output_actions): Do not free states now, since we
11801 still need to know the final_state number in `prepare', called
11802 afterwards. Do it...
11803 * src/main.c (main): here: call states_free after `output'.
11804
11805 2002-06-30 Akim Demaille <akim@epita.fr>
11806
11807 * src/state.h, src/state.c (state_new): New, extracted from...
11808 * src/LR0.c (new_state): here.
11809 * src/state.h (STATE_ALLOC): Move to...
11810 * src/state.c: here.
11811 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
11812 * src/state.h, src/state.c: here.
11813
11814 2002-06-30 Akim Demaille <akim@epita.fr>
11815
11816 * src/reader.c (gensym): Rename as...
11817 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
11818 (getsym): Rename as...
11819 (symbol_get): this.
11820
11821 2002-06-30 Akim Demaille <akim@epita.fr>
11822
11823 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
11824 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
11825 * src/output.c, src/print.c, src/print_graph.c: Propagate.
11826 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
11827
11828 2002-06-30 Akim Demaille <akim@epita.fr>
11829
11830 Make the test suite pass with warnings checked.
11831
11832 * tests/actions.at (Printers and Destructors): Improve.
11833 Avoid unsigned vs. signed issues.
11834 * tests/calc.at: Don't exercise the scanner here, do it...
11835 * tests/input.at (Torturing the Scanner): here.
11836
11837 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11838
11839 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
11840 reorganize first lines parallel to yacc.c.
11841
11842 2002-06-28 Akim Demaille <akim@epita.fr>
11843
11844 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
11845 (b4_token_enum, b4_token_defines): New, factored from...
11846 * data/lalr1.cc, data/yacc.c, glr.c: here.
11847
11848 2002-06-28 Akim Demaille <akim@epita.fr>
11849
11850 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
11851 unused variables.
11852 * src/output.c (merger_output): static.
11853
11854 2002-06-28 Akim Demaille <akim@epita.fr>
11855
11856 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
11857 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
11858 pacify GCC.
11859 * src/output.c (save_row): Initialize all the variables to pacify GCC.
11860
11861 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11862
11863 Accumulated changelog for new GLR parsing features.
11864
11865 * src/conflicts.c (count_total_conflicts): Change name to
11866 conflicts_total_count.
11867 * src/conflicts.h: Ditto.
11868 * src/output.c (token_actions): Use the new name.
11869 (output_conflicts): Change conflp => conflict_list_heads, and
11870 confl => conflict_list for better readability.
11871 * data/glr.c: Use the new names.
11872 * NEWS: Add self to GLR announcement.
11873
11874 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
11875
11876 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
11877 Akim Demaille.
11878
11879 * data/bison.glr: Change name to glr.c
11880 * data/glr.c: Renamed from bison.glr.
11881 * data/Makefile.am: Add glr.c
11882
11883 * src/getargs.c:
11884
11885 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
11886 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
11887
11888 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11889
11890 * data/bison.glr: Be sure to restore the
11891 current #line when returning to the skeleton contents after having
11892 exposed the input file's #line.
11893
11894 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11895
11896 * data/bison.glr: Bring up to date with changes to bison.simple.
11897
11898 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11899
11900 * data/bison.glr: Correct definitions that use b4_prefix.
11901 Various reformatting.
11902 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
11903 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
11904 yytokenp argument; now part of stack.
11905 (yychar): Define to behave as documented.
11906 (yyclearin): Ditto.
11907
11908 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11909
11910 * src/reader.h: Add declaration for free_merger_functions.
11911
11912 * src/reader.c (merge_functions): New variable.
11913 (get_merge_function): New function.
11914 (free_merger_functions): New function.
11915 (readgram): Check for %prec that is not followed by a symbol.
11916 Handle %dprec and %merge declarations.
11917 (packgram): Initialize dprec and merger fields in rules array.
11918
11919 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
11920 conflict_list_cnt, conflict_list_free): New variables.
11921 (table_grow): Also grow conflict_table.
11922 (prepare_rules): Output dprec and merger tables.
11923 (conflict_row): New function.
11924 (action_row): Output conflict lists for GLR parser. Don't use
11925 default reduction in conflicted states for GLR parser so that there
11926 are spaces for the conflict lists.
11927 (save_row): Also save conflict information.
11928 (token_actions): Allocate conflict list.
11929 (merger_output): New function.
11930 (pack_vector): Pack conflict table, too.
11931 (output_conflicts): New function to output yyconflp and yyconfl.
11932 (output_check): Allocate conflict_tos.
11933 (output_actions): Output conflict tables, also.
11934 (output_skeleton): Output b4_mergers definition.
11935 (prepare): Output b4_max_rhs_length definition.
11936 Use 'bison.glr' as default skeleton for GLR parsers.
11937
11938 * src/gram.c (glr_parser): New flag.
11939 (grammar_free): Call free_merger_functions.
11940
11941 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
11942 all pairs of conflicting reductions, rather than just all tokens
11943 causing conflicts. Needed to size conflict tables.
11944 (conflicts_output): Modify call to count_rr_conflicts for new
11945 interface.
11946 (conflicts_print): Ditto.
11947 (count_total_conflicts): New function.
11948
11949 * src/reader.h (merger_list): New type.
11950 (merge_functions): New variable.
11951
11952 * src/lex.h (tok_dprec, tok_merge): New token types.
11953
11954 * src/gram.h (rule_s): Add dprec and merger fields.
11955 (glr_parser): New flag.
11956
11957 * src/conflicts.h (count_total_conflicts): New function.
11958
11959 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
11960
11961 * doc/bison.texinfo (Generalized LR Parsing): New section.
11962 (GLR Parsers): New section.
11963 (Language and Grammar): Mention GLR parsing.
11964 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
11965 Correct typo ("tge" -> "the").
11966
11967 * data/bison.glr: New skeleton for GLR parsing.
11968
11969 * tests/cxx-gram.at: New tests for GLR parsing.
11970
11971 * tests/testsuite.at: Include cxx-gram.at.
11972
11973 * tests/Makefile.am: Add cxx-gram.at.
11974
11975 * src/parse-gram.y:
11976
11977 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
11978
11979 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
11980
11981 2002-06-27 Akim Demaille <akim@epita.fr>
11982
11983 * src/options.h, src/options.c: Remove.
11984 * src/getargs.c (short_options, long_options): New.
11985
11986 2002-06-27 Akim Demaille <akim@epita.fr>
11987
11988 * data/bison.simple, data/bison.c++: Rename as...
11989 * data/yacc.c, data/lalr1.cc: these.
11990 * doc/bison.texinfo (Environment Variables): Remove.
11991
11992 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
11993
11994 * src/getargs.c (report_argmatch): Initialize strtok().
11995
11996 2002-06-20 Akim Demaille <akim@epita.fr>
11997
11998 * data/bison.simple (b4_symbol_actions): New, replaces...
11999 (b4_symbol_destructor, b4_symbol_printer): these.
12000 (yysymprint): Be sure to call YYPRINT only for tokens, and using
12001 user token numbers.
12002
12003 2002-06-20 Akim Demaille <akim@epita.fr>
12004
12005 * data/bison.simple (yydestructor): Rename as...
12006 (yydestruct): this.
12007
12008 2002-06-20 Akim Demaille <akim@epita.fr>
12009
12010 * src/symtab.h, src/symtab.c (symbol_type_set)
12011 (symbol_destructor_set, symbol_precedence_set): The location is
12012 the last argument.
12013 Adjust all callers.
12014
12015 2002-06-20 Akim Demaille <akim@epita.fr>
12016
12017 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
12018 internals.
12019 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
12020 Takes a location.
12021 * src/symtab.h, src/symtab.c (symbol_class_set)
12022 (symbol_user_token_number_set): Likewise.
12023 Adjust all callers.
12024 Promote complain_at.
12025 * tests/input.at (Type Clashes): Adjust.
12026
12027 2002-06-20 Akim Demaille <akim@epita.fr>
12028
12029 * data/bison.simple (YYLEX): Fix the declaration when
12030 %pure-parser.
12031
12032 2002-06-20 Akim Demaille <akim@epita.fr>
12033
12034 * data/bison.simple (yysymprint): Don't print the token number,
12035 just its name.
12036 * tests/actions.at (Destructors): Rename as...
12037 (Printers and Destructors): this.
12038 Also exercise %printer.
12039
12040 2002-06-20 Akim Demaille <akim@epita.fr>
12041
12042 * data/bison.simple (YYDSYMPRINT): New.
12043 Use it to remove many of the #if YYDEBUG/if (yydebug).
12044
12045 2002-06-20 Akim Demaille <akim@epita.fr>
12046
12047 * src/symtab.h, src/symtab.c (symbol_t): printer and
12048 printer_location are new members.
12049 (symbol_printer_set): New.
12050 * src/parse-gram.y (PERCENT_PRINTER): New token.
12051 Handle its associated rule.
12052 * src/scan-gram.l: Adjust.
12053 (handle_destructor_at, handle_destructor_dollar): Rename as...
12054 (handle_symbol_code_at, handle_symbol_code_dollar): these.
12055 * src/output.c (symbol_printers_output): New.
12056 (output_skeleton): Call it.
12057 * data/bison.simple (yysymprint): New. Cannot be named yyprint
12058 since there are already many grammar files with a user `yyprint'.
12059 Replace the calls to YYPRINT to calls to yysymprint.
12060 * tests/calc.at: Adjust.
12061 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
12062 taking advantage of parser very internal details (stack size!).
12063
12064 2002-06-20 Akim Demaille <akim@epita.fr>
12065
12066 * src/scan-gram.l: Complete the scanner with the missing patterns
12067 to pacify Flex.
12068 Use `quote' and `symbol_tag_get' where appropriate.
12069
12070 2002-06-19 Akim Demaille <akim@epita.fr>
12071
12072 * tests/actions.at (Destructors): Augment to test locations.
12073 * data/bison.simple (yydestructor): Pass it the current location
12074 if locations are enabled.
12075 Prototype only when __STDC__ or C++.
12076 Change the argument names to move into the yy name space: there is
12077 user code here.
12078
12079 2002-06-19 Akim Demaille <akim@epita.fr>
12080
12081 * data/bison.simple (b4_pure_if): New.
12082 Use it instead of #ifdef YYPURE.
12083
12084 2002-06-19 Akim Demaille <akim@epita.fr>
12085
12086 * data/bison.simple (b4_location_if): New.
12087 Use it instead of #ifdef YYLSP_NEEDED.
12088
12089 2002-06-19 Akim Demaille <akim@epita.fr>
12090
12091 Prepare @$ in %destructor, but currently don't bind it in the
12092 skeleton, as %location use is not cleaned up yet.
12093
12094 * src/scan-gram.l (handle_dollar, handle_destructor_at)
12095 (handle_action_at): New.
12096 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
12097 a braced_code_t and a location as additional arguments.
12098 (handle_destructor_dollar): Instead of requiring `b4_eval', just
12099 unquote one when outputting `b4_dollar_dollar'.
12100 Adjust callers.
12101 * data/bison.simple (b4_eval): Remove.
12102 (b4_symbol_destructor): Adjust.
12103 * tests/input.at (Invalid @n): Adjust.
12104
12105 2002-06-19 Zack Weinberg <zack@codesourcery.com>
12106
12107 * doc/bison.texinfo: Document ability to have multiple
12108 prologue sections.
12109
12110 2002-06-18 Akim Demaille <akim@epita.fr>
12111
12112 * src/files.c (compute_base_names): When computing the output file
12113 names from the input file name, strip the directory part.
12114
12115 2002-06-18 Akim Demaille <akim@epita.fr>
12116
12117 * data/bison.simple.new: Comment changes.
12118 Reported by Andreas Schwab.
12119
12120 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
12121
12122 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
12123 there are no `label `yyoverflowlab' defined but not used' warnings
12124 when yyoverflow is defined.
12125
12126 2002-06-18 Akim Demaille <akim@epita.fr>
12127
12128 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
12129 new member.
12130 (symbol_destructor_set): Adjust.
12131 * src/output.c (symbol_destructors_output): Output the destructor
12132 locations.
12133 Output the symbol name.
12134 * data/bison.simple (b4_symbol_destructor): Adjust.
12135
12136 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
12137 and Akim Demaille <akim@epita.fr>
12138
12139 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
12140 what's left on the stack when the error recovery hits EOF.
12141 * tests/actions.at (Destructors): Complete to exercise this case.
12142
12143 2002-06-17 Akim Demaille <akim@epita.fr>
12144
12145 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
12146 arguments is really empty, not only equal to `[]'.
12147 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
12148 member.
12149 (symbol_destructor_set): New.
12150 * src/output.c (symbol_destructors_output): New.
12151 * src/reader.h (brace_code_t, current_braced_code): New.
12152 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
12153 (handle_dollar): Rename as...
12154 (handle_action_dollar): this.
12155 (handle_destructor_dollar): New.
12156 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
12157 (grammar_declaration): Use it.
12158 * data/bison.simple (yystos): Is always defined.
12159 (yydestructor): New.
12160 * tests/actions.at (Destructors): New.
12161 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
12162
12163 2002-06-17 Akim Demaille <akim@epita.fr>
12164
12165 * src/symlist.h, src/symlist.c (symbol_list_length): New.
12166 * src/scan-gram.l (handle_dollar, handle_at): Compute the
12167 rule_length only when needed.
12168 * src/output.c (actions_output, token_definitions_output): Output
12169 the full M4 block.
12170 * src/symtab.c: Don't access directly to the symbol tag, use
12171 symbol_tag_get.
12172 * src/parse-gram.y: Use symbol_list_free.
12173
12174 2002-06-17 Akim Demaille <akim@epita.fr>
12175
12176 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
12177 (symbol_list_prepend, get_type_name): Move to...
12178 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
12179 (symbol_list_prepend, symbol_list_n_type_name_get): here.
12180 Adjust all callers.
12181 (symbol_list_free): New.
12182 * src/scan-gram.l (handle_dollar): Takes a location.
12183 * tests/input.at (Invalid $n): Adjust.
12184
12185 2002-06-17 Akim Demaille <akim@epita.fr>
12186
12187 * src/reader.h, src/reader.c (symbol_list_new): Export it.
12188 (symbol_list_prepend): New.
12189 * src/parse-gram.y (%union): `list' is a new member.
12190 (symbols.1): New, replaces...
12191 (terms_to_prec.1, nterms_to_type.1): these.
12192 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
12193 Take a location as additional argument.
12194 Adjust all callers.
12195
12196 2002-06-15 Akim Demaille <akim@epita.fr>
12197
12198 * src/parse-gram.y: Move %token in the declaration section so that
12199 we don't depend upon CVS Bison.
12200
12201 2002-06-15 Akim Demaille <akim@epita.fr>
12202
12203 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
12204 * src/print.c (print_core): Use it.
12205
12206 2002-06-15 Akim Demaille <akim@epita.fr>
12207
12208 * src/conflicts.c (log_resolution): Accept the rule involved in
12209 the sr conflicts instead of the lookahead number that points to
12210 that rule.
12211 (flush_reduce): Accept the current lookahead vector as argument,
12212 instead of the index in LA.
12213 (resolve_sr_conflict): Accept the current number of lookahead
12214 bitset to consider for the STATE, instead of the index in LA.
12215 (set_conflicts): Adjust.
12216 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
12217
12218 2002-06-15 Akim Demaille <akim@epita.fr>
12219
12220 * src/state.h (state_t): Replace the `lookaheadsp' member, a
12221 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
12222 Adjust all dependencies.
12223 * src/lalr.c (initialize_lookaheads): Split into...
12224 (states_lookaheads_count, states_lookaheads_initialize): these.
12225 (lalr): Adjust.
12226
12227 2002-06-15 Akim Demaille <akim@epita.fr>
12228
12229 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
12230 out of...
12231 (grammar_rules_print): here.
12232 * src/reduce.c (reduce_output): Use it.
12233 * tests/reduce.at (Useless Rules, Reduced Automaton)
12234 (Underivable Rules): Adjust.
12235
12236 2002-06-15 Akim Demaille <akim@epita.fr>
12237
12238 Copy BYacc's nice way to report the grammar.
12239
12240 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
12241 New.
12242 Don't print the rules' location, it is confusing and useless.
12243 (rule_print): Use grammar_rhs_print.
12244 * src/print.c (print_grammar): Use grammar_rules_print.
12245
12246 2002-06-15 Akim Demaille <akim@epita.fr>
12247
12248 Complete and rationalize `useless thing' warnings.
12249
12250 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
12251 (symbol_tag_print): New.
12252 Use them everywhere in place of accessing directly the tag member.
12253 * src/gram.h, src/gram.c (rule_print): New.
12254 Use it where a rule used to be printed `by hand'.
12255 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
12256 (reduce_grammar_tables): Report the useless rules.
12257 (reduce_print): Useless things are a warning, not an error.
12258 Report it as such.
12259 * tests/reduce.at (Useless Nonterminals, Useless Rules):
12260 (Reduced Automaton, Underivable Rules): Adjust.
12261 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
12262 * tests/conflicts.at (Unresolved SR Conflicts)
12263 (Solved SR Conflicts): Adjust.
12264
12265 2002-06-15 Akim Demaille <akim@epita.fr>
12266
12267 Let symbols have a location.
12268
12269 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
12270 (getsym): Adjust.
12271 Adjust all callers.
12272 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
12273 Use location_t, not int.
12274 * src/symtab.c (symbol_check_defined): Take advantage of the
12275 location.
12276 * tests/regression.at (Invalid inputs): Adjust.
12277
12278 2002-06-15 Akim Demaille <akim@epita.fr>
12279
12280 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
12281 (input): Don't try to initialize yylloc here, do it in the
12282 scanner.
12283 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
12284 * src/gram.h (rule_t): Change line and action_line into location
12285 and action_location, of location_t type.
12286 Adjust all dependencies.
12287 * src/location.h, src/location.c (empty_location): New.
12288 * src/reader.h, src/reader.c (grammar_start_symbol_set)
12289 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
12290 (grammar_current_rule_symbol_append)
12291 (grammar_current_rule_action_append): Expect a location as argument.
12292 * src/reader.c (grammar_midrule_action): Adjust to attach an
12293 action's location as dummy symbol location.
12294 * src/symtab.h, src/symtab.c (startsymbol_location): New.
12295 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
12296 the line numbers.
12297
12298 2002-06-14 Akim Demaille <akim@epita.fr>
12299
12300 Grammar declarations may be found in the grammar section.
12301
12302 * src/parse-gram.y (rules_or_grammar_declaration): New.
12303 (declarations): Each declaration may end with a semicolon, not
12304 just...
12305 (grammar_declaration): `"%union"'.
12306 (grammar): Branch to rules_or_grammar_declaration.
12307
12308 2002-06-14 Akim Demaille <akim@epita.fr>
12309
12310 * src/main.c (main): Invoke scanner_free.
12311
12312 2002-06-14 Akim Demaille <akim@epita.fr>
12313
12314 * src/output.c (m4_invoke): Extracted from...
12315 (output_skeleton): here.
12316 Free tempfile.
12317
12318 2002-06-14 Akim Demaille <akim@epita.fr>
12319
12320 * src/parse-gram.y (directives, directive, gram)
12321 (grammar_directives, precedence_directives, precedence_directive):
12322 Rename as...
12323 (declarations, declaration, grammar, grammar_declaration)
12324 (precedence_declaration, precedence_declarator): these.
12325 (symbol_declaration): New.
12326
12327 2002-06-14 Akim Demaille <akim@epita.fr>
12328
12329 * src/files.c (action_obstack): Remove, unused.
12330 (output_obstack): Remove it, and all its dependencies, as it is no
12331 longer needed.
12332 * src/reader.c (epilogue_set): Build the epilogue in the
12333 muscle_obstack.
12334 * src/output.h, src/output.c (muscle_obstack): Move to...
12335 * src/muscle_tab.h, src/muscle_tab.h: here.
12336 (muscle_init): Initialize muscle_obstack.
12337 (muscle_free): New.
12338 * src/main.c (main): Call it.
12339
12340 2002-06-14 Akim Demaille <akim@epita.fr>
12341
12342 * src/location.h: New, extracted from...
12343 * src/reader.h: here.
12344 * src/Makefile.am (noinst_HEADERS): Merge into
12345 (bison_SOURCES): this.
12346 Add location.h.
12347 * src/parse-gram.y: Use location_t instead of Bison's.
12348 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
12349 Use location_t instead of ints.
12350
12351 2002-06-14 Akim Demaille <akim@epita.fr>
12352
12353 * data/bison.simple, data/bison.c++: Be sure to restore the
12354 current #line when returning to the skeleton contents after having
12355 exposed the input file's #line.
12356
12357 2002-06-12 Akim Demaille <akim@epita.fr>
12358
12359 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
12360 eager.
12361 * tests/actions.at (Exotic Dollars): New.
12362
12363 2002-06-12 Akim Demaille <akim@epita.fr>
12364
12365 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
12366 ['"/] too eagerly.
12367 * tests/input.at (Torturing the Scanner): New.
12368
12369 2002-06-11 Akim Demaille <akim@epita.fr>
12370
12371 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
12372 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
12373 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
12374 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
12375 * src/reader.c (reader): Use it.
12376
12377 2002-06-11 Akim Demaille <akim@epita.fr>
12378
12379 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
12380 Adjust all callers.
12381 (scanner_last_string_free): New.
12382
12383 2002-06-11 Akim Demaille <akim@epita.fr>
12384
12385 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
12386 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
12387 (last_string, YY_OBS_FREE): New.
12388 Use them when returning an ID.
12389
12390 2002-06-11 Akim Demaille <akim@epita.fr>
12391
12392 Have Bison grammars parsed by a Bison grammar.
12393
12394 * src/reader.c, src/reader.h (prologue_augment): New.
12395 * src/reader.c (copy_definition): Remove.
12396
12397 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
12398 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
12399 (grammar_current_rule_prec_set, grammar_current_rule_check)
12400 (grammar_current_rule_symbol_append)
12401 (grammar_current_rule_action_append): Export.
12402 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
12403 (symbol_list_action_append): Remove.
12404 Hook the routines from reader.
12405 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
12406 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
12407
12408 * src/reader.c (read_declarations): Remove, unused.
12409
12410 * src/parse-gram.y: Handle the epilogue.
12411 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
12412 (grammar_start_symbol_set): this.
12413 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
12414 * src/reader.c (readgram): Remove, unused.
12415 (reader): Adjust to insert eoftoken and axiom where appropriate.
12416
12417 * src/reader.c (copy_dollar): Replace with...
12418 * src/scan-gram.h (handle_dollar): this.
12419 * src/parse-gram.y: Remove `%thong'.
12420
12421 * src/reader.c (copy_at): Replace with...
12422 * src/scan-gram.h (handle_at): this.
12423
12424 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
12425 New.
12426
12427 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
12428 time being.
12429
12430 * src/reader.h, src/reader.c (grammar_rule_end): New.
12431
12432 * src/parse.y (current_type, current_class): New.
12433 Implement `%nterm', `%token' support.
12434 Merge `%term' into `%token'.
12435 (string_as_id): New.
12436 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
12437 type name.
12438
12439 * src/parse-gram.y: Be sure to handle properly the beginning of
12440 rules.
12441
12442 * src/parse-gram.y: Handle %type.
12443 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
12444
12445 * src/parse-gram.y: More directives support.
12446 * src/options.c: No longer handle source directives.
12447
12448 * src/parse-gram.y: Fix %output.
12449
12450 * src/parse-gram.y: Handle %union.
12451 Use the prologue locations.
12452 * src/reader.c (parse_union_decl): Remove.
12453
12454 * src/reader.h, src/reader.c (epilogue_set): New.
12455 * src/parse-gram.y: Use it.
12456
12457 * data/bison.simple, data/bison.c++: b4_stype is now either not
12458 defined, then default to int, or to the contents of %union,
12459 without `union' itself.
12460 Adjust.
12461 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
12462
12463 * src/output.c (actions_output): Don't output braces, as they are
12464 already handled by the scanner.
12465
12466 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
12467 characters to themselves.
12468
12469 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
12470 that the epilogue has a proper #line.
12471
12472 * src/parse-gram.y: Handle precedence/associativity.
12473
12474 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
12475 a terminal.
12476 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
12477 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
12478 at all to define terminals that cannot be emitted.
12479
12480 * src/scan-gram.l: Escape M4 characters.
12481
12482 * src/scan-gram.l: Working properly with escapes in user
12483 strings/characters.
12484
12485 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
12486 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
12487 grammar.
12488 Use more modest sizes, as for the time being the parser does not
12489 release memory, and therefore the process swallows a huge amount
12490 of memory.
12491
12492 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
12493 stricter %token grammar.
12494
12495 * src/symtab.h (associativity): Add `undef_assoc'.
12496 (symbol_precedence_set): Do nothing when passed an undef_assoc.
12497 * src/symtab.c (symbol_check_alias_consistence): Adjust.
12498
12499 * tests/regression.at (Invalid %directive): Remove, as it is now
12500 meaningless.
12501 (Invalid inputs): Adjust to the new error messages.
12502 (Token definitions): The new grammar doesn't allow too many
12503 eccentricities.
12504
12505 * src/lex.h, src/lex.c: Remove.
12506 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
12507 (copy_character, copy_string2, copy_string, copy_identifier)
12508 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
12509 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
12510 (parse_action): Remove.
12511 * po/POTFILES.in: Adjust.
12512
12513 2002-06-11 Akim Demaille <akim@epita.fr>
12514
12515 * src/reader.c (parse_action): Don't store directly into the
12516 rule's action member: return the action as a string.
12517 Don't require `rule_length' as an argument: compute it.
12518 (grammar_current_rule_symbol_append)
12519 (grammar_current_rule_action_append): New, eved out from
12520 (readgram): here.
12521 Remove `action_flag', `rulelength', unused now.
12522
12523 2002-06-11 Akim Demaille <akim@epita.fr>
12524
12525 * src/reader.c (grammar_current_rule_prec_set).
12526 (grammar_current_rule_check): New, eved out from...
12527 (readgram): here.
12528 Remove `xaction', `first_rhs': useless.
12529 * tests/input.at (Type clashes): New.
12530 * tests/existing.at (GNU Cim Grammar): Adjust.
12531
12532 2002-06-11 Akim Demaille <akim@epita.fr>
12533
12534 * src/reader.c (grammar_midrule_action): New, Eved out from
12535 (readgram): here.
12536
12537 2002-06-11 Akim Demaille <akim@epita.fr>
12538
12539 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
12540 New.
12541 (readgram): Use them as replacement of inlined code, crule and
12542 crule1.
12543
12544 2002-06-11 Akim Demaille <akim@epita.fr>
12545
12546 * src/reader.c (grammar_end, grammar_symbol_append): New.
12547 (readgram): Use them.
12548 Make the use of `p' as local as possible.
12549
12550 2002-06-10 Akim Demaille <akim@epita.fr>
12551
12552 GCJ's parser requires the tokens to be defined before the prologue.
12553
12554 * data/bison.simple: Output the token definition before the user's
12555 prologue.
12556 * tests/regression.at (Braces parsing, Duplicate string)
12557 (Mixing %token styles): Check the output from bison.
12558 (Early token definitions): New.
12559
12560 2002-06-10 Akim Demaille <akim@epita.fr>
12561
12562 * src/symtab.c (symbol_user_token_number_set): Don't complain when
12563 assigning twice the same user number to a token, so that we can
12564 use it in...
12565 * src/lex.c (lex): here.
12566 Also use `symbol_class_set' instead of hand written code.
12567 * src/reader.c (parse_assoc_decl): Likewise.
12568
12569 2002-06-10 Akim Demaille <akim@epita.fr>
12570
12571 * src/symtab.c, src/symtab.c (symbol_class_set)
12572 (symbol_user_token_number_set): New.
12573 * src/reader.c (parse_token_decl): Use them.
12574 Use a switch instead of ifs.
12575 Use a single argument.
12576
12577 2002-06-10 Akim Demaille <akim@epita.fr>
12578
12579 Remove `%thong' support as it is undocumented, unused, duplicates
12580 `%token's job, and creates useless e-mail traffic with people who
12581 want to know what it is, why it is undocumented, unused, and
12582 duplicates `%token's job.
12583
12584 * src/reader.c (parse_thong_decl): Remove.
12585 * src/options.c (option_table): Remove "thong".
12586 * src/lex.h (tok_thong): Remove.
12587
12588 2002-06-10 Akim Demaille <akim@epita.fr>
12589
12590 * src/symtab.c, src/symtab.c (symbol_type_set)
12591 (symbol_precedence_set): New.
12592 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
12593 (value_components_used): Remove, unused.
12594
12595 2002-06-09 Akim Demaille <akim@epita.fr>
12596
12597 Move symbols handling code out of the reader.
12598
12599 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
12600 (axiom): Move to...
12601 * src/symtab.h, src/symtab.c: here.
12602
12603 * src/gram.c (start_symbol): Remove: use startsymbol->number.
12604 * src/reader.c (startval): Rename as...
12605 * src/symtab.h, src/symtab.c (startsymbol): this.
12606 * src/reader.c: Adjust.
12607
12608 * src/reader.c (symbol_check_defined, symbol_make_alias)
12609 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12610 (token_translations_init)
12611 Move to...
12612 * src/symtab.c: here.
12613 * src/reader.c (packsymbols): Move to...
12614 * src/symtab.h, src/symtab.c (symbols_pack): here.
12615 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
12616 argument.
12617
12618 2002-06-03 Akim Demaille <akim@epita.fr>
12619
12620 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
12621 then statements.
12622
12623 2002-06-03 Akim Demaille <akim@epita.fr>
12624
12625 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
12626 structs with non literals.
12627 * src/scan-skel.l: never-interactive.
12628 * src/conflicts.c (enum conflict_resolution_e): No trailing
12629 comma.
12630 * src/getargs.c (usage): Split long literal strings.
12631 Reported by Hans Aberg.
12632
12633 2002-05-28 Akim Demaille <akim@epita.fr>
12634
12635 * data/bison.c++: Use C++ ostreams.
12636 (cdebug_): New member.
12637
12638 2002-05-28 Akim Demaille <akim@epita.fr>
12639
12640 * src/output.c (output_skeleton): Be sure to allocate enough room
12641 for `/' _and_ for `\0' in full_skeleton.
12642
12643 2002-05-28 Akim Demaille <akim@epita.fr>
12644
12645 * data/bison.c++: Catch up with bison.simple:
12646 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12647 and Paul Eggert <eggert@twinsun.com>: `error' handing.
12648 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
12649 and popping traces.
12650
12651 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12652
12653 * src/output.c (output_skeleton): Put an explicit path in front of
12654 the skeleton file name, rather than relying on the -I directory,
12655 to partially alleviate effects of having a skeleton file lying around
12656 in the current directory.
12657
12658 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12659
12660 * src/conflicts.c (log_resolution): Correct typo:
12661 obstack_printf should be obstack_fgrow1.
12662
12663 2002-05-26 Akim Demaille <akim@epita.fr>
12664
12665 * src/state.h (state_t): `solved_conflicts' is a new member.
12666 * src/LR0.c (new_state): Set it to 0.
12667 * src/conflicts.h, src/conflicts.c (print_conflicts)
12668 (free_conflicts, solve_conflicts): Rename as...
12669 (conflicts_print, conflicts_free, conflicts_solve): these.
12670 Adjust callers.
12671 * src/conflicts.c (enum conflict_resolution_e)
12672 (solved_conflicts_obstack): New, used by...
12673 (log_resolution): this.
12674 Adjust to attach the conflict resolution to each state.
12675 Complete the description with the precedence/associativity
12676 information.
12677 (resolve_sr_conflict): Adjust.
12678 * src/print.c (print_state): Output its solved_conflicts.
12679 * tests/conflicts.at (Unresolved SR Conflicts)
12680 (Solved SR Conflicts): Exercise --report=all.
12681
12682 2002-05-26 Akim Demaille <akim@epita.fr>
12683
12684 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12685 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12686 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
12687 (token_number_t, item_number_as_token_number)
12688 (token_number_as_item_number, muscle_insert_token_number_table):
12689 Rename as...
12690 (symbol_number_t, item_number_as_symbol_number)
12691 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
12692 these, since it is more appropriate.
12693
12694 2002-05-26 Akim Demaille <akim@epita.fr>
12695
12696 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
12697 `Error:' lines.
12698 * data/bison.simple (yystos) [YYDEBUG]: New.
12699 (yyparse) [YYDEBUG]: Display the symbols which are popped during
12700 error recovery.
12701 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
12702
12703 2002-05-25 Akim Demaille <akim@epita.fr>
12704
12705 * doc/bison.texinfo (Debugging): Split into...
12706 (Tracing): this new section, its former contents, and...
12707 (Understanding): this new section.
12708 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
12709 by...
12710 (report_flag): this.
12711 Adjust all dependencies.
12712 (report_args, report_types, report_argmatch): New.
12713 (usage, getargs): Report/support -r, --report.
12714 * src/options.h
12715 (struct option_table_struct): Rename as..,
12716 (struct option_table_s): this.
12717 Rename the `set_flag' member to `flag' to match with getopt_long's
12718 struct.
12719 * src/options.c (option_table): Split verbose into an entry for
12720 %verbose, and another for --verbose.
12721 Support --report/-r, so remove -r from the obsolete --raw.
12722 * src/print.c: Attach full item sets and lookaheads reports to
12723 report_flag instead of trace_flag.
12724 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
12725
12726 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12727 and Paul Eggert <eggert@twinsun.com>
12728
12729 * data/bison.simple (yyparse): Correct error handling to conform to
12730 POSIX and yacc. Specifically, after syntax error is discovered,
12731 do not reduce further before shifting the error token.
12732 Clean up the code a bit by removing the labels yyerrdefault,
12733 yyerrhandle, yyerrpop.
12734 * NEWS: Document the above.
12735
12736 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12737
12738 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
12739 type; it isn't always big enough, since it doesn't necessarily
12740 include non-terminals.
12741 (yytranslate): Expand definition of yy_token_number_type, so that
12742 the latter can be removed.
12743 (yy_token_number_type): Remove, only one use.
12744 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
12745 don't use TokenNumberType as element type.
12746
12747 * tests/regression.at: Modify expected output to agree with change
12748 to yyr1 and yytranslate.
12749
12750 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
12751
12752 * src/reader.c (parse_action): Use copy_character instead of
12753 obstack_1grow.
12754
12755 2002-05-13 Akim Demaille <akim@epita.fr>
12756
12757 * tests/regression.at (Token definitions): Prototype yylex and
12758 yyerror.
12759
12760 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12761
12762 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
12763 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
12764 32-bit arithmetic.
12765 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
12766
12767 2002-05-07 Akim Demaille <akim@epita.fr>
12768
12769 * tests/synclines.at: Be sure to prototype yylex and yyerror to
12770 avoid GCC warnings.
12771
12772 2002-05-07 Akim Demaille <akim@epita.fr>
12773
12774 Kill GCC warnings.
12775
12776 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
12777 over the RHS of each rule.
12778 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
12779 * src/state.h (state_t): Member `nitems' is unsigned short.
12780 * src/LR0.c (get_state): Adjust.
12781 * src/reader.c (packgram): Likewise.
12782 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
12783 `Type'.
12784 (muscle_insert_int_table): Remove, unused.
12785 (prepare_rules): Remove `max'.
12786
12787 2002-05-06 Akim Demaille <akim@epita.fr>
12788
12789 * src/closure.c (print_firsts): Display of the symbol tags.
12790 (bitmatrix_print): Move to...
12791 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
12792 here.
12793 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
12794
12795 2002-05-06 Akim Demaille <akim@epita.fr>
12796
12797 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
12798 hash_do_for_each.
12799
12800 2002-05-06 Akim Demaille <akim@epita.fr>
12801
12802 * src/LR0.c (new_state, get_state): Instead of using the global
12803 `kernel_size' and `kernel_base', have two new arguments:
12804 `core_size' and `core'.
12805 Adjust callers.
12806
12807 2002-05-06 Akim Demaille <akim@epita.fr>
12808
12809 * src/reader.c (packgram): No longer end `ritem' with a 0
12810 sentinel: it is not used.
12811
12812 2002-05-05 Akim Demaille <akim@epita.fr>
12813
12814 New experimental feature: display the lookaheads in the report and
12815 graph.
12816
12817 * src/print (print_core): When --trace-flag, display the rules
12818 lookaheads.
12819 * src/print_graph.c (print_core): Likewise.
12820 Swap the arguments.
12821 Adjust caller.
12822
12823 2002-05-05 Akim Demaille <akim@epita.fr>
12824
12825 * tests/torture.at (Many lookaheads): New test.
12826
12827 2002-05-05 Akim Demaille <akim@epita.fr>
12828
12829 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
12830 (GENERATE_MUSCLE_INSERT_TABLE): this.
12831 (output_int_table, output_unsigned_int_table, output_short_table)
12832 (output_token_number_table, output_item_number_table): Replace with...
12833 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
12834 (muscle_insert_short_table, muscle_insert_token_number_table)
12835 (muscle_insert_item_number_table): these.
12836 Adjust all callers.
12837 (prepare_tokens): Don't free `translations', since...
12838 * src/reader.h, src/reader.c (grammar_free): do it.
12839 Move to...
12840 * src/gram.h, src/gram.c (grammar_free): here.
12841 * data/bison.simple, data/bison.c++: b4_token_number_max is now
12842 b4_translate_max.
12843
12844 2002-05-05 Akim Demaille <akim@epita.fr>
12845
12846 * src/output.c (output_unsigned_int_table): New.
12847 (prepare_rules): `i' is unsigned.
12848 `prhs', `rline', `r2' are unsigned int.
12849 Rename muscle `rhs_number_max' as `rhs_max'.
12850 Output muscles `prhs_max', `rline_max', and `r2_max'.
12851 Free rline and r1.
12852 * data/bison.simple, data/bison.c++: Adjust to use these muscles
12853 to compute types instead of constant types.
12854 * tests/regression.at (Web2c Actions): Adjust.
12855
12856 2002-05-04 Akim Demaille <akim@epita.fr>
12857
12858 * src/symtab.h (SALIAS, SUNDEF): Rename as...
12859 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
12860 Adjust dependencies.
12861 * src/output.c (token_definitions_output): Be sure not to output a
12862 `#define 'a'' when fed with `%token 'a' "a"'.
12863 * tests/regression.at (Token definitions): New.
12864
12865 2002-05-03 Paul Eggert <eggert@twinsun.com>
12866
12867 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
12868 for K&R C.
12869
12870 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
12871
12872 * Makefile.am (SUBDIRS): Remove intl.
12873 (EXTRA_DIST): Add config/config.rpath.
12874
12875 2002-05-03 Akim Demaille <akim@epita.fr>
12876
12877 * data/bison.simple (m4_if): Don't output empty enums.
12878 And actually, output valid enum definitions :(.
12879
12880 2002-05-03 Akim Demaille <akim@epita.fr>
12881
12882 * configure.bat: Remove, completely obsolete.
12883 * Makefile.am (EXTRA_DIST): Adjust.
12884 Don't distribute config.rpath...
12885 * config/Makefile.am (EXTRA_DIST): Do it.
12886
12887 2002-05-03 Akim Demaille <akim@epita.fr>
12888
12889 * configure.in (GETTEXT_VERSION): New.
12890 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
12891
12892 2002-05-03 Akim Demaille <akim@epita.fr>
12893
12894 * data/bison.simple (b4_token_enum): New.
12895 (b4_token_defines): Use it to output tokens both as #define and
12896 enums.
12897 Suggested by Paul Eggert.
12898 * src/output.c (token_definitions_output): Don't output spurious
12899 white spaces.
12900
12901 2002-05-03 Akim Demaille <akim@epita.fr>
12902
12903 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12904
12905 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
12906
12907 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
12908 Update the stack class, give a try to deque as the default container.
12909
12910 2002-05-02 Akim Demaille <akim@epita.fr>
12911
12912 * data/bison.simple (yyparse): Do not implement @$ = @1.
12913 (YYLLOC_DEFAULT): Adjust to do it.
12914 * doc/bison.texinfo (Location Default Action): Fix.
12915
12916 2002-05-02 Akim Demaille <akim@epita.fr>
12917
12918 * src/reader.c (parse_braces): Merge into...
12919 (parse_action): this.
12920
12921 2002-05-02 Akim Demaille <akim@epita.fr>
12922
12923 * configure.in (ALL_LINGUAS): Remove.
12924 * po/LINGUAS, hr.po: New.
12925
12926 2002-05-02 Akim Demaille <akim@epita.fr>
12927
12928 Remove the so called hairy (semantic) parsers.
12929
12930 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
12931 * src/gram.h, src/gram.c (semantic_parser): Remove.
12932 (rule_t): Remove the guard and guard_line members.
12933 * src/lex.h (token_t): remove tok_guard.
12934 * src/options.c (option_table): Remove %guard and %semantic_parser
12935 support.
12936 * src/output.c, src/output.h (guards_output): Remove.
12937 (prepare): Adjust.
12938 (token_definitions_output): Don't output the `T'
12939 tokens (???).
12940 (output_skeleton): Don't output the guards.
12941 * src/files.c, src/files.c (attrsfile): Remove.
12942 * src/reader.c (symbol_list): Remove the guard and guard_line
12943 members.
12944 Adjust dependencies.
12945 (parse_guard): Remove.
12946 * data/bison.hairy: Remove.
12947 * doc/bison.texinfo (Environment Variables): Remove occurrences of
12948 BISON_HAIRY.
12949
12950 2002-05-02 Akim Demaille <akim@epita.fr>
12951
12952 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
12953 (parse_guard): Rename the formal argument `stack_offset' as
12954 `rule_length', which is more readable.
12955 Adjust callers.
12956 (copy_at, copy_dollar): Instead of outputting the hard coded
12957 values of $$, $n and so forth, output invocation to b4_lhs_value,
12958 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
12959 Note: this patch partially drops `semantic-parser' support: it
12960 always does `rule_length - n', where semantic parsers ought to
12961 always use `-n'.
12962 * data/bison.simple, data/bison.c++ (b4_lhs_value)
12963 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12964
12965 2002-05-02 Akim Demaille <akim@epita.fr>
12966
12967 * configure.in (AC_INIT): Bump to 1.49b.
12968 (AM_INIT_AUTOMAKE): Short invocation.
12969
12970 2002-05-02 Akim Demaille <akim@epita.fr>
12971
12972 Version 1.49a.
12973
12974 2002-05-01 Akim Demaille <akim@epita.fr>
12975
12976 * src/skeleton.h: Remove.
12977
12978 2002-05-01 Akim Demaille <akim@epita.fr>
12979
12980 * src/skeleton.h: Fix the #endif.
12981 Reported by Magnus Fromreide.
12982
12983 2002-04-26 Paul Eggert <eggert@twinsun.com>
12984
12985 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
12986 Define if we define YYSTYPE and YYLTYPE, respectively.
12987 (YYCOPY): Fix [] quoting problem in the non-GCC case.
12988
12989 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
12990
12991 * src/scan-skel.l: Postprocess quadrigraphs.
12992
12993 * src/reader.c (copy_character): New function, used to output
12994 single characters while replacing `[' and `]' with quadrigraphs, to
12995 avoid troubles with M4 quotes.
12996 (copy_comment): Output characters with copy_character.
12997 (read_additionnal_code): Likewise.
12998 (copy_string2): Likewise.
12999 (copy_definition): Likewise.
13000
13001 * tests/calc.at: Exercise M4 quoting.
13002
13003 2002-04-25 Akim Demaille <akim@epita.fr>
13004
13005 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
13006 between `!' and the command.
13007 Reported by Paul Eggert.
13008
13009 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
13010
13011 * tests/calc.at: Exercise prologue splitting.
13012
13013 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
13014 `b4_post_prologue' instead of `b4_prologue'.
13015
13016 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
13017 muscles.
13018 (output): Free pre_prologue_obstack and post_prologue_obstack.
13019 * src/files.h, src/files.c (attrs_obstack): Remove.
13020 (pre_prologue_obstack, post_prologue_obstack): New.
13021 * src/reader.c (copy_definition): Add a parameter to specify the
13022 obstack to fill, instead of using attrs_obstack unconditionally.
13023 (read_declarations): Pass pre_prologue_obstack to copy_definition if
13024 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
13025
13026 2002-04-23 Paul Eggert <eggert@twinsun.com>
13027
13028 * data/bison.simple: Remove unnecessary commentary and white
13029 space differences from 1_29-branch.
13030 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
13031
13032 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
13033 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
13034 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
13035 constructors or destructors.
13036
13037 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
13038
13039 2002-04-23 Akim Demaille <akim@epita.fr>
13040
13041 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
13042 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
13043 location with columns.
13044 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
13045 All reported by Paul Eggert.
13046
13047 2002-04-22 Akim Demaille <akim@epita.fr>
13048
13049 * src/reduce.c (dump_grammar): Move to...
13050 * src/gram.h, src/gram.c (grammar_dump): here.
13051 Be sure to separate long item numbers.
13052 Don't read the members of a rule's prec if its nil.
13053
13054 2002-04-22 Akim Demaille <akim@epita.fr>
13055
13056 * src/output.c (table_size, table_grow): New.
13057 (MAXTABLE): Remove, replace uses with table_size.
13058 (pack_vector): Instead of dying when the table is too big, grow it.
13059
13060 2002-04-22 Akim Demaille <akim@epita.fr>
13061
13062 * data/bison.simple (yyr1): Its type is that of a token number.
13063 * data/bison.c++ (r1_): Likewise.
13064 * tests/regression.at (Web2c Actions): Adjust.
13065
13066 2002-04-22 Akim Demaille <akim@epita.fr>
13067
13068 * src/reader.c (token_translations_init): 256 is now the default
13069 value for the error token, i.e., it will be assigned another
13070 number if the user assigned 256 to one of her tokens.
13071 (reader): Don't force 256 to error.
13072 * doc/bison.texinfo (Symbols): Adjust.
13073 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
13074 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
13075 etc. instead of 10, 20, 30 (which was used to `jump' over error
13076 (256) and undefined (2)).
13077
13078 2002-04-22 Akim Demaille <akim@epita.fr>
13079
13080 Propagate more token_number_t.
13081
13082 * src/gram.h (token_number_as_item_number)
13083 (item_number_as_token_number): New.
13084 * src/output.c (GENERATE_OUTPUT_TABLE): New.
13085 Use it to create output_item_number_table and
13086 output_token_number_table.
13087 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13088 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
13089 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
13090 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
13091
13092 2002-04-22 Akim Demaille <akim@epita.fr>
13093
13094 * src/output.h, src/output.c (get_lines_number): Remove.
13095
13096 2002-04-19 Akim Demaille <akim@epita.fr>
13097
13098 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
13099 as Lex/Flex'.
13100 (Debugging): More details about enabling the debugging features.
13101 (Table of Symbols): Describe $$, $n, @$, and @n.
13102 Suggested by Tim Josling.
13103
13104 2002-04-19 Akim Demaille <akim@epita.fr>
13105
13106 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
13107
13108 2002-04-10 Akim Demaille <akim@epita.fr>
13109
13110 * src/system.h: Rely on HAVE_LIMITS_H.
13111 Suggested by Paul Eggert.
13112
13113 2002-04-09 Akim Demaille <akim@epita.fr>
13114
13115 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
13116 full stderr, and strip it according to the bison options, instead
13117 of composing the error message from different bits.
13118 This makes it easier to check for several error messages.
13119 Adjust all the invocations.
13120 Add an invocation exercising the error token.
13121 Add an invocation demonstrating a stupid error message.
13122 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
13123 Adjust the tests.
13124 Error message are for stderr, not stdout.
13125
13126 2002-04-09 Akim Demaille <akim@epita.fr>
13127
13128 * src/gram.h, src/gram.c (error_token_number): Remove, use
13129 errtoken->number.
13130 * src/reader.c (reader): Don't specify the user token number (2)
13131 for $undefined, as it uselessly prevents using it.
13132 * src/gram.h (token_number_t): Move to...
13133 * src/symtab.h: here.
13134 (state_t.number): Is a token_number_t.
13135 * src/print.c, src/reader.c: Use undeftoken->number instead of
13136 hard coded 2.
13137 (Even though this 2 is not the same as above: the number of the
13138 undeftoken remains being 2, it is its user token number which
13139 might not be 2).
13140 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
13141 `user_token_number_max'.
13142 Output `undef_token_number'.
13143 * data/bison.simple, data/bison.c++: Use them.
13144 Be sure to map invalid yylex return values to
13145 `undef_token_number'. This saves us from gratuitous SEGV.
13146
13147 * tests/conflicts.at (Solved SR Conflicts)
13148 (Unresolved SR Conflicts): Adjust.
13149 * tests/regression.at (Web2c Actions): Adjust.
13150
13151 2002-04-08 Akim Demaille <akim@epita.fr>
13152
13153 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
13154 Adding #line.
13155 Remove the duplicate `typedefs'.
13156 (RhsNumberType): Fix the declaration and various other typos.
13157 Use __ofile__.
13158 * data/bison.simple: Use __ofile__.
13159 * src/scan-skel.l: Handle __ofile__.
13160
13161 2002-04-08 Akim Demaille <akim@epita.fr>
13162
13163 * src/gram.h (item_number_t): New, the type of item numbers in
13164 RITEM. Note that it must be able to code symbol numbers as
13165 positive number, and the negation of rule numbers as negative
13166 numbers.
13167 Adjust all dependencies (pretty many).
13168 * src/reduce.c (rule): Remove this `short *' pointer: use
13169 item_number_t.
13170 * src/system.h (MINSHORT, MAXSHORT): Remove.
13171 Include `limits.h'.
13172 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
13173 (shortcpy): Remove.
13174 (MAXTABLE): Move to...
13175 * src/output.c (MAXTABLE): here.
13176 (prepare_rules): Use output_int_table to output rhs.
13177 * data/bison.simple, data/bison.c++: Adjust.
13178 * tests/torture.at (Big triangle): Move the limit from 254 to
13179 500.
13180 * tests/regression.at (Web2c Actions): Ajust.
13181
13182 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
13183 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
13184 passes, but produces negative #line number, once fixed, GCC is
13185 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
13186 C), it passes.
13187 * src/state.h (state_h): Code input lines on ints, not shorts.
13188
13189 2002-04-08 Akim Demaille <akim@epita.fr>
13190
13191 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
13192 and then the grammar.
13193
13194 2002-04-08 Akim Demaille <akim@epita.fr>
13195
13196 * src/system.h: No longer using strndup.
13197
13198 2002-04-07 Akim Demaille <akim@epita.fr>
13199
13200 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
13201 * src/output.c (output_table_data): Return the longest number.
13202 (prepare_tokens): Output `token_number_max').
13203 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
13204 New.
13205 Use them to define yy_token_number_type/TokenNumberType.
13206 Use this type for yytranslate.
13207 * tests/torture.at (Big triangle): Push the limit from 124 to
13208 253.
13209 * tests/regression.at (Web2c Actions): Adjust.
13210
13211 2002-04-07 Akim Demaille <akim@epita.fr>
13212
13213 * tests/torture.at (Big triangle): New.
13214 (GNU AWK Grammar, GNU Cim Grammar): Move to...
13215 * tests/existing.at: here.
13216
13217 2002-04-07 Akim Demaille <akim@epita.fr>
13218
13219 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
13220 nritems.
13221 Adjust dependencies.
13222
13223 2002-04-07 Akim Demaille <akim@epita.fr>
13224
13225 * src/reader.c: Normalize increments to prefix form.
13226
13227 2002-04-07 Akim Demaille <akim@epita.fr>
13228
13229 * src/reader.c, symtab.c: Remove debugging code.
13230
13231 2002-04-07 Akim Demaille <akim@epita.fr>
13232
13233 Rename all the `bucket's as `symbol_t'.
13234
13235 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
13236 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
13237 * src/symtab.c, src/symtab.h (bucket): Rename as...
13238 (symbol_t): this.
13239 (symbol_list_new, bucket_check_defined, bucket_make_alias)
13240 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
13241 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13242 (buckets_new, buckets_free, buckets_do): Rename as...
13243 (symbol_list_new, symbol_check_defined, symbol_make_alias)
13244 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13245 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
13246 (symbols_new, symbols_free, symbols_do): these.
13247
13248 2002-04-07 Akim Demaille <akim@epita.fr>
13249
13250 Use lib/hash for the symbol table.
13251
13252 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
13253 EOF.
13254 * src/lex.c (lex): Set the `number' member of new terminals.
13255 * src/reader.c (bucket_check_defined, bucket_make_alias)
13256 (bucket_check_alias_consistence, bucket_translation): New.
13257 (reader, grammar_free, readgram, token_translations_init)
13258 (packsymbols): Adjust.
13259 (reader): Number the predefined tokens.
13260 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
13261 for predefined tokens.
13262 * src/symtab.h (bucket): Remove all the hash table related
13263 members.
13264 * src/symtab.c (symtab): Replace by...
13265 (bucket_table): this.
13266 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13267 (buckets_new, buckets_do): New.
13268
13269 2002-04-07 Akim Demaille <akim@epita.fr>
13270
13271 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
13272 (start_symbol, max_user_token_number, semantic_parser)
13273 (error_token_number): Initialize.
13274 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
13275 Initialize.
13276 (reader): Don't.
13277 (errtoken, eoftoken, undeftoken, axiom): Extern.
13278
13279 2002-04-07 Akim Demaille <akim@epita.fr>
13280
13281 * src/gram.h (rule_s): prec and precsym are now pointers
13282 to the bucket giving the priority/associativity.
13283 Member `associativity' removed: useless.
13284 * src/reduce.c, src/conflicts.c: Adjust.
13285
13286 2002-04-07 Akim Demaille <akim@epita.fr>
13287
13288 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
13289 Properly escape the symbols' TAG when outputting them.
13290
13291 2002-04-07 Akim Demaille <akim@epita.fr>
13292
13293 * src/lalr.h (LA): Is a bitsetv, not bitset*.
13294
13295 2002-04-07 Akim Demaille <akim@epita.fr>
13296
13297 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
13298 (LArule): this, which is an array to rule_t*.
13299 * src/print.c, src/conflicts.c: Adjust.
13300
13301 2002-04-07 Akim Demaille <akim@epita.fr>
13302
13303 * src/gram.h (rule_t): Rename `number' as `user_number'.
13304 `number' is a new member.
13305 Adjust dependencies.
13306 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
13307
13308 2002-04-07 Akim Demaille <akim@epita.fr>
13309
13310 As a result of the previous patch, it is no longer needed
13311 to reorder ritem itself.
13312
13313 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
13314
13315 2002-04-07 Akim Demaille <akim@epita.fr>
13316
13317 Be sure never to walk through RITEMS, but use only data related to
13318 the rules themselves. RITEMS should be banished.
13319
13320 * src/output.c (output_token_translations): Rename as...
13321 (prepare_tokens): this.
13322 In addition to `translate', prepare the muscles `tname' and
13323 `toknum', which were handled by...
13324 (output_rule_data): this.
13325 Remove, and move the remainder of its outputs into...
13326 (prepare_rules): this new routines, which also merges content from
13327 (output_gram): this.
13328 (prepare_rules): Be sure never to walk through RITEMS.
13329 (output_stos): Rename as...
13330 (prepare_stos): this.
13331 (output): Always invoke prepare_states, after all, just don't use it
13332 in the output if you don't need it.
13333
13334 2002-04-07 Akim Demaille <akim@epita.fr>
13335
13336 * src/LR0.c (new_state): Display `nstates' as the name of the
13337 newly created state.
13338 Adjust to initialize first_state and last_state if needed.
13339 Be sure to distinguish the initial from the final state.
13340 (new_states): Create the itemset of the initial state, and use
13341 new_state.
13342 * src/closure.c (closure): Now that the initial state has its
13343 items properly set, there is no need for a special case when
13344 creating `ruleset'.
13345
13346 As a result, now the rule 0, reducing to $axiom, is visible in the
13347 outputs. Adjust the test suite.
13348
13349 * tests/conflicts.at (Solved SR Conflicts)
13350 (Unresolved SR Conflicts): Adjust.
13351 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
13352 * tests/conflicts.at (S/R in initial): New.
13353
13354 2002-04-07 Akim Demaille <akim@epita.fr>
13355
13356 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
13357 the RHS of the rules.
13358 * src/output.c (output_gram): Likewise.
13359
13360 2002-04-07 Akim Demaille <akim@epita.fr>
13361
13362 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
13363 bucket.
13364 Adjust all dependencies.
13365 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
13366 `number' of the buckets too.
13367 * src/gram.h: Include `symtab.h'.
13368 (associativity): Move to...
13369 * src/symtab.h: here.
13370 No longer include `gram.h'.
13371
13372 2002-04-07 Akim Demaille <akim@epita.fr>
13373
13374 * src/gram.h, src/gram.c (rules_rhs_length): New.
13375 (ritem_longest_rhs): Use it.
13376 * src/gram.h (rule_t): `number' is a new member.
13377 * src/reader.c (packgram): Set it.
13378 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
13379 the end of `rules', and count them out of `nrules'.
13380 (reduce_output, dump_grammar): Adjust.
13381 * src/print.c (print_grammar): It is no longer needed to check for
13382 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
13383 * tests/reduce.at (Reduced Automaton): New test.
13384
13385 2002-04-07 Akim Demaille <akim@epita.fr>
13386
13387 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
13388 lacking `+ 1' to nrules, Bison reported as useless a token if it
13389 was used solely to set the precedence of the last rule...
13390
13391 2002-04-07 Akim Demaille <akim@epita.fr>
13392
13393 * data/bison.c++, data/bison.simple: Don't output the current file
13394 name in #line, to avoid useless diffs between two identical
13395 outputs under different names.
13396
13397 2002-04-07 Akim Demaille <akim@epita.fr>
13398
13399 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
13400 Normalize loops to using `< nrules + 1', not `<= nrules'.
13401
13402 2002-04-07 Akim Demaille <akim@epita.fr>
13403
13404 * TODO: Update.
13405
13406 2002-04-07 Akim Demaille <akim@epita.fr>
13407
13408 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
13409 bucket.value as bucket.number.
13410
13411 2002-04-07 Akim Demaille <akim@epita.fr>
13412
13413 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
13414 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13415 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
13416 RHS, instead of being an index in RITEMS.
13417
13418 2002-04-04 Paul Eggert <eggert@twinsun.com>
13419
13420 * doc/bison.texinfo: Update copyright date.
13421 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
13422 (Symbols): Warn about running Bison in one character set,
13423 but compiling and/or running in an incompatible one.
13424 Warn about character code 256, too.
13425
13426 2002-04-03 Paul Eggert <eggert@twinsun.com>
13427
13428 * src/bison.data (YYSTACK_ALLOC): Depend on whether
13429 YYERROR_VERBOSE is nonzero, not whether it is defined.
13430
13431 Merge changes from bison-1_29-branch.
13432
13433 2002-03-20 Paul Eggert <eggert@twinsun.com>
13434
13435 Merge fixes from Debian bison_1.34-1.diff.
13436
13437 * configure.in (AC_PREREQ): 2.53.
13438
13439 2002-03-20 Akim Demaille <akim@epita.fr>
13440
13441 * src/conflicts.c (log_resolution): Argument `resolution' is const.
13442
13443 2002-03-19 Paul Eggert <eggert@twinsun.com>
13444
13445 * src/bison.simple (YYCOPY): New macro.
13446 (YYSTACK_RELOCATE): Use it.
13447 Remove Type arg; no longer needed. All callers changed.
13448 (yymemcpy): Remove; no longer needed.
13449
13450 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
13451 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13452
13453 2002-03-19 Akim Demaille <akim@epita.fr>
13454
13455 Test and fix the #line outputs.
13456
13457 * tests/atlocal.at (GCC): New.
13458 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
13459 (Prologue synch line, %union synch line, Postprologue synch line)
13460 (Action synch line, Epilogue synch line): New tests.
13461 * src/reader.c (parse_union_decl): Define the muscle stype_line.
13462 * data/bison.simple, data/bison.c++: Use it.
13463
13464 2002-03-19 Akim Demaille <akim@epita.fr>
13465
13466 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
13467 (Solved SR Conflicts, %expect not enough, %expect right)
13468 (%expect too much): Move to...
13469 * tests/conflicts.at: this new file.
13470
13471 2002-03-19 Akim Demaille <akim@epita.fr>
13472
13473 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13474 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
13475 that we can move to enums for instance.
13476 * src/output.c (token_definitions_output): Output a list of
13477 `token-name, token-number' instead of the #define.
13478 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
13479
13480 2002-03-14 Akim Demaille <akim@epita.fr>
13481
13482 Use Gettext 0.11.1.
13483
13484 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
13485
13486 * data/bison.c++: Make the user able to add members to the generated
13487 parser by subclassing.
13488
13489 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
13490
13491 * src/reader.c (read_additionnal_code): `c' should be an integer, not
13492 a character.
13493 Reported by Nicolas Tisserand and Nicolas Burrus.
13494
13495 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
13496
13497 * src/reader.c: Warn about lacking semi-colons, do not complain.
13498
13499 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
13500
13501 * data/bison.c++: Remove a debug line.
13502
13503 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
13504
13505 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
13506 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
13507 provide a default implementation.
13508
13509 2002-03-04 Akim Demaille <akim@epita.fr>
13510
13511 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
13512 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
13513 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
13514 * tests/semantic.at (Parsing Guards): Similarly.
13515 * src/reader.at (readgram): Complain if the last rule is not ended
13516 with a semi-colon.
13517
13518 2002-03-04 Akim Demaille <akim@epita.fr>
13519
13520 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
13521 * src/closure.c: here.
13522 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
13523 RTC.
13524 * src/warshall.h, src/warshall.c: Remove.
13525 * tests/sets.at (Broken Closure): Adjust.
13526
13527 2002-03-04 Akim Demaille <akim@epita.fr>
13528
13529 * src/output.c (output_skeleton): tempdir is const.
13530 bytes_read is unused.
13531
13532 2002-03-04 Akim Demaille <akim@epita.fr>
13533
13534 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13535 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
13536 Update.
13537 From Michael Hayes.
13538
13539 2002-03-04 Akim Demaille <akim@epita.fr>
13540
13541 * src/closure.c (closure): `r' is unused.
13542
13543 2002-03-04 Akim Demaille <akim@epita.fr>
13544
13545 * tests/sets.at (Broken Closure): Add the ending `;'.
13546 * src/reader.at (readgram): Complain if a rule is not ended with a
13547 semi-colon.
13548
13549 2002-03-04 Akim Demaille <akim@epita.fr>
13550
13551 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
13552 (count_sr_conflicts): Use bitset_count.
13553 * src/reduce.c (inaccessable_symbols): Ditto.
13554 (bits_size): Remove.
13555 * src/warshall.h, src/warshall.c: Convert to bitsetv.
13556
13557 2002-03-04 Akim Demaille <akim@epita.fr>
13558
13559 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
13560 * src/reduce.c: Remove the `bitset_zero's following the
13561 `bitset_create's, as now it is performed by the latter.
13562
13563 2002-03-04 Akim Demaille <akim@epita.fr>
13564
13565 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
13566 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
13567 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
13568 latest sources from Michael.
13569
13570 2002-03-04 Akim Demaille <akim@epita.fr>
13571
13572 * src/output.c (output): Don't free the grammar.
13573 * src/reader.c (grammar_free): New.
13574 * src/main.c (main): Call it and don't free symtab here.
13575
13576 2002-03-04 Akim Demaille <akim@epita.fr>
13577
13578 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
13579 before returning.
13580 Reported by Benoit Perrot.
13581
13582 2002-03-04 Akim Demaille <akim@epita.fr>
13583
13584 Use bitset operations when possible, not loops over bits.
13585
13586 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
13587 bitset_or.
13588 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
13589 * src/reduce.c (useless_nonterminals): Formatting changes.
13590 * src/warshall.c (TC): Use bitset_or.
13591
13592 2002-03-04 Akim Demaille <akim@epita.fr>
13593
13594 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
13595 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
13596 Ditto.
13597
13598 2002-03-04 Akim Demaille <akim@epita.fr>
13599
13600 * src/lalr.c (F): Now a bitset*.
13601 Adjust all dependencies.
13602
13603 2002-03-04 Akim Demaille <akim@epita.fr>
13604
13605 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
13606 Adjust all dependencies.
13607
13608 2002-03-04 Akim Demaille <akim@epita.fr>
13609
13610 * src/L0.c, src/LR0.h (nstates): Be size_t.
13611 Adjust comparisons (signed vs unsigned).
13612 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
13613 bitset*.
13614 Adjust all dependencies.
13615
13616 2002-03-04 Akim Demaille <akim@epita.fr>
13617
13618 * src/closure.c (firsts): Now, also a bitset.
13619 Adjust all dependencies.
13620 (varsetsize): Remove, now unused.
13621 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
13622
13623 2002-03-04 Akim Demaille <akim@epita.fr>
13624
13625 * src/print.c: Convert to use bitset.h, not hand coded iterations
13626 over ints.
13627
13628 2002-03-04 Akim Demaille <akim@epita.fr>
13629
13630 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
13631
13632 2002-03-04 Akim Demaille <akim@epita.fr>
13633
13634 * src/closure.c (ruleset): Be a bitset.
13635 (rulesetsize): Remove.
13636
13637 2002-03-04 Akim Demaille <akim@epita.fr>
13638
13639 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13640 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
13641 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
13642 * src/closure.c (fderives): Be an array of bitsets.
13643
13644 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
13645
13646 * data/bison.c++: Merge the two generated headers. Insert a copyright
13647 notice in each output file.
13648
13649 2002-02-28 Akim Demaille <akim@epita.fr>
13650
13651 * data/bison.c++: Copy the prologue of bison.simple to fetch
13652 useful M4 definitions, such as b4_header_guard.
13653
13654 2002-02-25 Akim Demaille <akim@epita.fr>
13655
13656 * src/getargs.c (version): Give the name of the authors, and use a
13657 translator friendly scheme for the bgr
13658 copyright notice.
13659
13660 2002-02-25 Akim Demaille <akim@epita.fr>
13661
13662 * src/output.c (header_output): Remove, now handled completely via
13663 M4.
13664
13665 2002-02-25 Akim Demaille <akim@epita.fr>
13666
13667 * m4/m4.m4: New, from CVS Autoconf.
13668 * configure.in: Invoke it.
13669 * src/output.c (output_skeleton): Use its result instead of the
13670 hard coded name.
13671
13672 2002-02-25 Akim Demaille <akim@epita.fr>
13673
13674 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
13675 Fileutils 4.1.5.
13676 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
13677 * src/output.c (output_skeleton): Use mkstemp to create a real
13678 temporary file.
13679 Move the filling of `skeleton' and its muscle to...
13680 (prepare): here.
13681 (output): Move the definition of the prologue muscle to...
13682 (prepare): here.
13683 * src/system.h (DEFAULT_TMPDIR): New.
13684
13685 2002-02-14 Paul Eggert <eggert@twinsun.com>
13686
13687 Remove the support for C++ namespace cleanliness; it was
13688 causing more problems than it was curing, since it didn't work
13689 properly on some nonstandard C++ compilers. This can wait
13690 for a proper C++ parser.
13691
13692 * NEWS: Document this.
13693 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
13694 of C++, as it's treated like C now.
13695 * src/bison.simple (YYSTD): Remove.
13696 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
13697 Treat C++ just like Standard C instead of trying to support
13698 namespace cleanliness.
13699
13700 2002-02-14 Akim Demaille <akim@epita.fr>
13701
13702 * tests/regression.at (else): Adjust to Andreas' change.
13703
13704 2002-02-14 Akim Demaille <akim@epita.fr>
13705
13706 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
13707
13708 2002-02-13 Andreas Schwab <schwab@suse.de>
13709
13710 * src/output.c (output_rule_data): Don't output NULL, it might
13711 not be defined yet.
13712
13713 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
13714
13715 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
13716 (Copyright notice): Update.
13717
13718 2002-02-11 Akim Demaille <akim@epita.fr>
13719
13720 * tests/regression.at (%nonassoc and eof): Don't include
13721 nonportable headers.
13722
13723 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
13724
13725 * data/bison.c++: Correct error recovery. Make the user able to
13726 initialize the starting location.
13727
13728 2002-02-07 Akim Demaille <akim@epita.fr>
13729
13730 * tests/input.at: New.
13731
13732 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13733
13734 * data/bison.c++: Replace some direct m4 expansions by constants. Be
13735 more consistent when naming methods and variables. Put preprocessor
13736 directives around tables only needed for debugging.
13737
13738 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13739
13740 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
13741 C++ parsers.
13742 (yy::b4_name::parse): Use print_.
13743
13744 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13745
13746 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
13747
13748 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13749
13750 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
13751 C++ parsers.
13752 (yy::b4_name::parse): Build verbose error messages, and use error_.
13753
13754 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
13755
13756 * data/bison.c++: Fix m4 quoting in comments.
13757
13758 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
13759
13760 * data/bison.c++: Adjust the parser code. Fix some muscles that were
13761 not expanded by m4.
13762
13763 2002-02-05 Akim Demaille <akim@epita.fr>
13764
13765 * data/bison.c++: Adjust to the M4 back end.
13766 More is certainly needed.
13767
13768 2002-02-05 Akim Demaille <akim@epita.fr>
13769
13770 Give a try to M4 as a back end.
13771
13772 * lib/readpipe.c: New, from wdiff.
13773 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
13774 BISON_HAIRY.
13775 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
13776 specific values. Now it is m4 that performs the lookup.
13777 * src/parse-skel.y: Remove.
13778 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
13779 * src/output.c (actions_output, guards_output)
13780 (token_definitions_output): No longer keeps track of the output
13781 line number, hence remove the second argument.
13782 (guards_output): Check against the guard member of a rule, not the
13783 action member.
13784 Adjust callers.
13785 (output_skeleton): Don't look for the skeleton location, let m4 do
13786 that.
13787 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
13788 file will be used.
13789 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
13790 (prepare): Given that for the time being changesyntax is not
13791 usable in M4, rename the muscles using `-' to `_'.
13792 Define `defines_flag', `output_parser_name' and `output_header_name'.
13793 * src/output.h (actions_output, guards_output)
13794 (token_definitions_output): Adjust prototypes.
13795 * src/scan-skel.l: Instead of scanning the skeletons, it now
13796 processes the output of m4: `__oline__' and `#output'.
13797 * data/bison.simple: Adjust to be used by M4(sugar).
13798 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
13799 to date.
13800 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
13801 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
13802 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
13803 shamelessly stolen from CVS Autoconf.
13804
13805 2002-02-05 Akim Demaille <akim@epita.fr>
13806
13807 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
13808 * configure.in: Check for the declarations of free and malloc.
13809 * src/muscle_tab.c: Adjust.
13810
13811 2002-02-05 Akim Demaille <akim@epita.fr>
13812
13813 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
13814 which have no values.
13815
13816 2002-02-05 Akim Demaille <akim@epita.fr>
13817
13818 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
13819 * data/: here.
13820
13821 2002-01-29 Paul Eggert <eggert@twinsun.com>
13822
13823 * src/bison.simple (YYSIZE_T): Do not define merely because
13824 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
13825 On some platforms, <alloca.h> does not declare YYSTD (size_t).
13826
13827 2002-01-27 Akim Demaille <akim@epita.fr>
13828
13829 Fix `%nonassoc and eof'.
13830
13831 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
13832 which were not properly copied! Replace
13833 memcpy (res->errs, src->errs, src->nerrs);
13834 with
13835 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
13836 !!!
13837 * tests/regression.at (%nonassoc and eof): Adjust to newest
13838 Autotest: `.' is not in the PATH.
13839
13840 2002-01-27 Akim Demaille <akim@epita.fr>
13841
13842 * tests/sets.at (AT_EXTRACT_SETS): New.
13843 (Nullable): Use it.
13844 (Firsts): New.
13845
13846 2002-01-26 Akim Demaille <akim@epita.fr>
13847
13848 * tests/actions.at, tests/calc.at, tests/headers.at,
13849 * tests/torture.at: Adjust to the newest Autotest which no longer
13850 forces `.' in the PATH.
13851
13852 2002-01-25 Akim Demaille <akim@epita.fr>
13853
13854 * tests/regression.at (%nonassoc and eof): New.
13855 Suggested by Robert Anisko.
13856
13857 2002-01-24 Akim Demaille <akim@epita.fr>
13858
13859 Bison dumps core when trying to complain about broken input files.
13860 Reported by Cris van Pelt.
13861
13862 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
13863 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
13864 into...
13865 (Invalid inputs): Strengthen: exercise parse_percent_token.
13866
13867 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
13868
13869 * src/Makefile.am: Add bison.c++.
13870 * src/bison.c++: New skeleton.
13871
13872 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
13873
13874 * po/it.po: New.
13875
13876 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
13877
13878 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
13879
13880 2002-01-20 Marc Autret <marc@gnu.org>
13881
13882 * src/files.c (compute_output_file_names): Fix
13883
13884 2002-01-20 Marc Autret <marc@gnu.org>
13885
13886 * tests/output.at: New test.
13887 * src/files.c (compute_base_names): Don't map extensions when
13888 the YACC flag is set, use defaults.
13889 Reported by Evgeny Stambulchik.
13890
13891 2002-01-20 Marc Autret <marc@gnu.org>
13892
13893 * src/system.h: Need to define __attribute__ away for non-GCC
13894 compilers as well (i.e., the vendor C compiler).
13895 Suggested by Albert Chin-A-Young.
13896
13897 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
13898
13899 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
13900 canonical definition.
13901 * src/system.h: Use the canonical definition for PARAMS (avoids
13902 a conflict with the macro from lib/hash.h).
13903
13904 2002-01-11 Akim Demaille <akim@epita.fr>
13905
13906 * configure.in: Use AC_FUNC_STRNLEN.
13907 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
13908
13909 2002-01-09 Akim Demaille <akim@epita.fr>
13910
13911 * src/files.c, src/files.h (output_infix): New.
13912 (tab_extension): Remove.
13913 (compute_base_names): Compute the former, drop the latter.
13914 * src/output.c (prepare): Insert the muscles `output-infix', and
13915 `output-suffix'.
13916 * src/parse-skel.y (string, string.1): New.
13917 (section.header): Use it.
13918 (section.yacc): Remove.
13919 (prefix): Remove too.
13920 * src/scan-skel.l: Adjust.
13921 * src/bison.simple, src/bison.hairy: Adjust.
13922
13923 2002-01-09 Akim Demaille <akim@epita.fr>
13924
13925 * configure.in (WERROR_CFLAGS): Compute it.
13926 * src/Makefile.am (CFLAGS): Pass it.
13927 * tests/atlocal.in (CFLAGS): Idem.
13928 * src/files.c: Fix a few warnings.
13929 (get_extension_index): Remove, unused.
13930
13931 2002-01-08 Akim Demaille <akim@epita.fr>
13932
13933 * src/getargs.c (AS_FILE_NAME): New.
13934 (getargs): Use it to convert DOSish file names.
13935 * src/files.c (base_name): Rename as full_base_name to avoid
13936 clashes with `base_name ()'.
13937 (filename_split): New.
13938 (compute_base_names): N-th rewrite, using filename_split.
13939
13940 2002-01-08 Akim Demaille <akim@epita.fr>
13941
13942 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
13943 New, stolen from the Fileutils 4.1.
13944 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13945 * configure.in: Check for the presence of memrchr, and of its
13946 prototype.
13947
13948 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
13949
13950 * lib/hash.h (__P): Added definition for this macro.
13951 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
13952 BUILT_SOURCES, to ensure they are generated first.
13953 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
13954 %error-verbose to allow bootstrapping with bison 1.30x.
13955
13956 2002-01-06 Akim Demaille <akim@epita.fr>
13957
13958 * src/reader.c (parse_braces): Don't fetch the next char, the
13959 convention is to fetch on entry.
13960 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
13961 'switch' without a following semicolon.
13962 * tests/regression.at (braces parsing): New.
13963
13964 2002-01-06 Akim Demaille <akim@epita.fr>
13965
13966 Bison is dead wrong in its RR conflict reports.
13967
13968 * tests/torture.at (GNU Cim Grammar): New.
13969 * src/conflicts.c (count_rr_conflicts): Fix.
13970
13971 2002-01-06 Akim Demaille <akim@epita.fr>
13972
13973 Creating package.m4 from configure.ac causes too many problems.
13974
13975 * tests/Makefile.am (package.m4): Create it by hand,
13976 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
13977
13978 2002-01-06 Akim Demaille <akim@epita.fr>
13979
13980 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
13981 skeleton.h.
13982
13983 2002-01-04 Paul Eggert <eggert@twinsun.com>
13984
13985 * doc/bison.texinfo (Debugging):
13986 Remove YYSTDERR; it's no longer defined or used.
13987 Also, s/cstdio.h/cstdio/.
13988
13989 2002-01-03 Akim Demaille <akim@epita.fr>
13990
13991 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
13992
13993 2002-01-03 Akim Demaille <akim@epita.fr>
13994
13995 * src/parse-skel.y (process_skeleton): Don't bind the parser's
13996 tracing code to --trace, wait for a better --trace option, with
13997 args.
13998
13999 2002-01-03 Akim Demaille <akim@epita.fr>
14000
14001 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
14002 The ISO C++ standard is extremely clear about it: stderr is
14003 considered a macro, not a regular symbol (see table 94 `Header
14004 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
14005 Therefore std:: does not apply to it. It still does with fprintf.
14006 Also, s/cstdio.h/cstdio/.
14007
14008 2002-01-03 Akim Demaille <akim@epita.fr>
14009
14010 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
14011 for non system headers.
14012
14013 2002-01-02 Akim Demaille <akim@epita.fr>
14014
14015 Equip the skeleton chain with location tracking, runtime trace,
14016 pure parser and scanner.
14017
14018 * src/parse-skel.y: Request a pure parser, locations, and prefix
14019 renaming.
14020 (%union): Having several members with the same type does not help
14021 type mismatches, simplify.
14022 (YYPRINT, yyprint): New.
14023 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
14024 (skel_error): this.
14025 Handle locations.
14026 * src/scan-skel.l: Adjust to these changes.
14027 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
14028 (LOCATION_PRINT, skel_control_t): New.
14029
14030 2001-12-30 Akim Demaille <akim@epita.fr>
14031
14032 * src/parse-skel.y: Get rid of the shift/reduce conflict:
14033 replace `gb' with BLANKS.
14034 * src/scan-skel.l: Adjust.
14035
14036 2001-12-30 Akim Demaille <akim@epita.fr>
14037
14038 * src/system.h: We don't need nor want bcopy.
14039 Throw away MS-DOS crap: we don't need getpid.
14040 * configure.in: We don't need strndup. It was even causing
14041 problems: because Flex includes the headers *before* us,
14042 _GNU_SOURCE is not defined by config.h, and therefore strndup was
14043 not visible.
14044 * lib/xstrndup.c: New.
14045 * src/scan-skel.l: Use it.
14046 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
14047 * src/parse-skel.y: Use %directives instead of #defines.
14048
14049 2001-12-30 Akim Demaille <akim@epita.fr>
14050
14051 * src/skeleton.h: New.
14052 * src/output.c (output_parser, output_master_parser): Remove, dead
14053 code.
14054 * src/output.h (get_lines_number, actions_output, guards_output)
14055 (token_definitions_output): Prototype them.
14056 * src/parse-skel.y: Add the license notice.
14057 Include output.h and skeleton.h.
14058 (process_skeleton): Returns void, and takes a single parameter.
14059 * src/scan-skel.l: Add the license notice.
14060 Include skeleton.h.
14061 Don't use %option yylineno: it seems that then Flex imagines
14062 REJECT has been used, and therefore it won't reallocate its
14063 buffers (which makes no other sense to me than a bug). It results
14064 in warnings for `unused: yy_flex_realloc'.
14065
14066 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
14067
14068 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14069 (MUSCLE_INSERT_PREFIX): ...to there.
14070 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14071 (MUSCLE_INSERT_PREFIX): Move from here...
14072
14073 * src/bison.hairy: Add a section directive. Put braces around muscle
14074 names. This parser skeleton is still broken, but Bison should not
14075 choke on a bad muscle 'syntax'.
14076 * src/bison.simple: Add a section directive. Put braces around muscle
14077 names.
14078
14079 * src/files.h (strsuffix, stringappend): Add declarations.
14080 (tab_extension): Add declaration.
14081 (short_base_name): Add declaration.
14082
14083 * src/files.c (strsuffix, stringappend): No longer static. These
14084 functions are used in the skeleton parser.
14085 (tab_extension): New.
14086 (compute_base_names): Use the computations done in this function
14087 to guess if the generated parsers should have '.tab' in their
14088 names.
14089 (short_base_name): No longer static.
14090
14091 * src/output.c (output_skeleton): New.
14092 (output): Disable call to output_master_parser, and give a try to
14093 a new skeleton handling system.
14094 (guards_output, actions_output): No longer static.
14095 (token_definitions_output, get_lines_number): No longer static.
14096
14097 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
14098
14099 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
14100 parse-skel.y.
14101
14102 * src/parse-skel.y: New file.
14103 * src/scan-skel.l: New file.
14104
14105 2001-12-29 Akim Demaille <akim@epita.fr>
14106
14107 %name-prefix is broken.
14108
14109 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
14110 Adjust all dependencies.
14111 * tests/headers.at (export YYLTYPE): Strengthen this test: use
14112 %name-prefix.
14113
14114 Renaming yylval but not yylloc is not consistent. Now we do.
14115
14116 * src/bison.simple: Prefix yylloc if used.
14117 * doc/bison.texinfo (Decl Summary): Document that.
14118
14119 2001-12-29 Akim Demaille <akim@epita.fr>
14120
14121 * doc/bison.texinfo: Promote `%long-directive' over
14122 `%long_directive'.
14123 Remove all references to fixed-output-files, yacc is enough.
14124
14125 2001-12-29 Akim Demaille <akim@epita.fr>
14126
14127 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
14128 user prologue. These are defaults.
14129 * tests/actions.at (Mid-rule actions): Make sure the user can
14130 define YYDEBUG and YYERROR_VERBOSE.
14131
14132 2001-12-29 Akim Demaille <akim@epita.fr>
14133
14134 * src/output.c (header_output): Don't forget to export YYLTYPE and
14135 yylloc.
14136 * tests/headers.at (export YYLTYPE): New, make sure it does.
14137 * tests/regression.at (%union and --defines, Invalid CPP headers):
14138 Move to...
14139 * tests/headers.at: here.
14140
14141 2001-12-29 Akim Demaille <akim@epita.fr>
14142
14143 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
14144
14145 2001-12-29 Akim Demaille <akim@epita.fr>
14146
14147 * tests/actions.at (Mid-rule actions): Output on a single line
14148 instead of several.
14149
14150 2001-12-29 Akim Demaille <akim@epita.fr>
14151
14152 * doc/bison.texinfo: Formatting changes.
14153
14154 2001-12-29 Akim Demaille <akim@epita.fr>
14155
14156 Don't store the token defs in a muscle, just be ready to output it
14157 on command. Now possible via `symbols'. Fixes a memory leak.
14158
14159 * src/output.c (token_definitions_output): New.
14160 (output_parser, header_output): Use it.
14161 * src/reader.c (symbols_save): Remove.
14162
14163 2001-12-29 Akim Demaille <akim@epita.fr>
14164
14165 * src/bison.simple: Do not provide a default for YYSTYPE and
14166 YYLTYPE before the user's prologue. Otherwise it's hardly... a
14167 default.
14168
14169 2001-12-29 Akim Demaille <akim@epita.fr>
14170
14171 Mid-rule actions are simply... ignored!
14172
14173 * src/reader.c (readgram): Be sure to attach mid-rule actions to
14174 the empty-rule associated to the dummy symbol, not to the host
14175 rule.
14176 * tests/actions.at (Mid-rule actions): New.
14177
14178 2001-12-29 Akim Demaille <akim@epita.fr>
14179
14180 Memory leak.
14181
14182 * src/reader.c (reader): Free grammar.
14183
14184 2001-12-29 Akim Demaille <akim@epita.fr>
14185
14186 Memory leak.
14187
14188 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
14189 since it allocates it for each state, although only one is needed.
14190 (allocate_storage): Do it here.
14191
14192 2001-12-29 Akim Demaille <akim@epita.fr>
14193
14194 * src/options.h, src/options.c (create_long_option_table): Rename
14195 as...
14196 (long_option_table_new): this, with a clearer prototype.
14197 (percent_table): Remove, unused,
14198 * src/getargs.c (getargs): Adjust.
14199
14200 2001-12-29 Akim Demaille <akim@epita.fr>
14201
14202 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
14203 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
14204 as states.
14205
14206 2001-12-29 Akim Demaille <akim@epita.fr>
14207
14208 * src/lalr.c (build_relations): Rename `states' as `states1'.
14209 Sorry, I don't understand exactly what it is, no better name...
14210
14211 2001-12-29 Akim Demaille <akim@epita.fr>
14212
14213 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
14214 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
14215 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
14216 as rules.
14217
14218 2001-12-29 Akim Demaille <akim@epita.fr>
14219
14220 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
14221 ago.
14222
14223 2001-12-29 Akim Demaille <akim@epita.fr>
14224
14225 * src/reader.c, src/reader.h (user_toknums): Remove.
14226 Adjust all users to use symbols[i]->user_token_number.
14227
14228 2001-12-29 Akim Demaille <akim@epita.fr>
14229
14230 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
14231 Adjust all users to use symbols[i]->prec or ->assoc.
14232
14233 2001-12-29 Akim Demaille <akim@epita.fr>
14234
14235 * src/reader.c, src/reader.h (tags): Remove.
14236 Adjust all users to use symbols[i]->tag.
14237
14238 2001-12-29 Akim Demaille <akim@epita.fr>
14239
14240 * src/gram.h, src/gram.c (symbols): New, similar to state_table
14241 and rule_table.
14242 * src/reader.c (packsymbols): Fill this table.
14243 Drop sprec.
14244 * src/conflicts.c (resolve_sr_conflict): Adjust.
14245 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
14246 single table.
14247 Use symbols[i]->tag instead of tags[i].
14248
14249 2001-12-29 Akim Demaille <akim@epita.fr>
14250
14251 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
14252 In addition, put a comment in there, to replace...
14253 * tests/regression.at (%union and C comments): Remove.
14254
14255 2001-12-29 Akim Demaille <akim@epita.fr>
14256
14257 * tests/regression.at (Web2c Actions): Blindly move the actual
14258 output as expected output. The contents *seem* right to me, but I
14259 can't pretend reading perfectly parser tables... Nonetheless, all
14260 the other tests pass correctly, the table look OK, even though the
14261 presence of `$axiom' is to be noted: AFAICS it is useless (but
14262 harmless).
14263
14264 2001-12-29 Akim Demaille <akim@epita.fr>
14265
14266 * src/reader.c (readgram): Don't add the rule 0 if there were no
14267 rules read. In other words, add it _after_ having performed
14268 grammar sanity checks.
14269 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
14270
14271 2001-12-29 Akim Demaille <akim@epita.fr>
14272
14273 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
14274 visible, and some states have now a different number.
14275
14276 2001-12-29 Akim Demaille <akim@epita.fr>
14277
14278 * src/reader.c (readgram): Bind the initial rule's lineno to that
14279 of the first rule.
14280 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
14281 (Solved SR Conflicts): Adjust rule 0's line number.
14282
14283 2001-12-29 Akim Demaille <akim@epita.fr>
14284
14285 Fix the `GAWK Grammar' failure.
14286
14287 * src/LR0.c (final_state): Initialize to -1 so that we do compute
14288 the reductions of the first state which was mistakenly confused
14289 with the final state because precisely final_state was initialized
14290 to 0.
14291 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
14292 now noticed by Bison.
14293 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
14294 have a reduction on $default.
14295
14296 2001-12-29 Akim Demaille <akim@epita.fr>
14297
14298 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
14299 rule line numbers.
14300 * src/closure.c (print_closure): Likewise.
14301 * src/derives.c (print_derives): Likewise.
14302 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
14303 now.
14304
14305 2001-12-29 Akim Demaille <akim@epita.fr>
14306
14307 * src/lalr.c (lookaheads_print): New.
14308 (lalr): Call it when --trace-flag.
14309 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
14310 are dumped.
14311
14312 2001-12-29 Akim Demaille <akim@epita.fr>
14313
14314 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
14315 when walking through ritem, even via rule->rhs.
14316 * src/reduce.c (dump_grammar, useful_production, reduce_output)
14317 (useful_production, useless_nonterminals): Likewise.
14318 (reduce_grammar_tables): Likewise, plus update nritems.
14319 * src/nullable.c (set_nullable): Likewise.
14320 * src/lalr.c (build_relations): Likewise.
14321 * tests/sets.at (Nullable): Adjust.
14322 Fortunately, now, the $axiom is no longer nullable.
14323
14324 2001-12-29 Akim Demaille <akim@epita.fr>
14325
14326 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
14327 the 0-sentinel.
14328 * src/gram.c (ritem_longest_rhs): Likewise.
14329 * src/reduce.c (nonterminals_reduce): Likewise.
14330 * src/print_graph.c (print_graph): Likewise.
14331 * src/output.c (output_rule_data): Likewise.
14332 * src/nullable.c (set_nullable): Likewise.
14333
14334 2001-12-29 Akim Demaille <akim@epita.fr>
14335
14336 * src/output.c: Comment changes.
14337
14338 2001-12-27 Paul Eggert <eggert@twinsun.com>
14339
14340 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
14341 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
14342 Sparc, as they were causing more porting problems than the
14343 (minor) performance improvement was worth.
14344
14345 Also, catch up with 1.31's YYSTD.
14346
14347 2001-12-27 Akim Demaille <akim@epita.fr>
14348
14349 * src/output.c (output_gram): Rely on nritems, not the
14350 0-sentinel. See below.
14351 Use -1 as separator, not 0.
14352 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
14353 Rely on -1 as separator in yyrhs, instead of 0.
14354 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
14355 twice `Now at end of input', therefore there are two lines less to
14356 expect.
14357
14358 2001-12-27 Akim Demaille <akim@epita.fr>
14359
14360 * tests/regression.at (Unresolved SR Conflicts):
14361 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
14362 below.
14363
14364 2001-12-27 Akim Demaille <akim@epita.fr>
14365
14366 * src/LR0.c (new_state): Recognize the final state by the fact it
14367 is reached by eoftoken.
14368 (insert_start_shifting_state, insert_eof_shifting_state)
14369 (insert_accepting_state, augment_automaton): Remove, since now
14370 these states are automatically computed from the initial state.
14371 (generate_states): Adjust.
14372 * src/print.c: When reporting a rule number to the user, substract
14373 1, so that the axiom rule is rule 0, and the first user rule is 1.
14374 * src/reduce.c: Likewise.
14375 * src/print_graph.c (print_core): For the time being, just as for
14376 the report, depend upon --trace-flags to dump the full set of
14377 items.
14378 * src/reader.c (readgram): Once the grammar read, insert the rule
14379 0: `$axiom: START-SYMBOL $'.
14380 * tests/set.at: Adjust: rule 0 is now displayed, and since the
14381 number of the states has changed (the final state is no longer
14382 necessarily the last), catch up.
14383
14384 2001-12-27 Akim Demaille <akim@epita.fr>
14385
14386 Try to make the use of the eoftoken valid. Given that its value
14387 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
14388 is used instead of > 0 where appropriate, (ii), depend upon nritems
14389 instead of the 0-sentinel.
14390
14391 * src/gram.h, src/gram.c (nritems): New.
14392 Expected to be duplication of nitems, but for the time being...
14393 * src/reader.c (packgram): Assert nritems and nitems are equal.
14394 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
14395 * src/closure.c (print_closure, print_fderives): Likewise.
14396 * src/gram.c (ritem_print): Likewise.
14397 * src/print.c (print_core, print_grammar): Likewise.
14398 * src/print_graph.c: Likewise.
14399
14400 2001-12-27 Akim Demaille <akim@epita.fr>
14401
14402 * src/main.c (main): If there are complains after grammar
14403 reductions, then output the report anyway if requested, then die.
14404 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
14405 * src/reader.c (eoftoken): New.
14406 (parse_token_decl): If the token being defined has value `0', it
14407 is the eoftoken.
14408 (packsymbols): No longer hack `tags' to insert `$' by hand.
14409 Be sure to preserve the value of the eoftoken.
14410 (reader): Make sure eoftoken is defined.
14411 Initialize nsyms to 0: now eoftoken is created just like the others.
14412 * src/print.c (print_grammar): Don't special case the eof token.
14413 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
14414 lie anyway, albeit pleasant.
14415 * tests/calc.at: Exercise error messages with eoftoken.
14416 Change the grammar so that empty input is invalid.
14417 Adjust expectations.
14418 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
14419
14420 2001-12-27 Akim Demaille <akim@epita.fr>
14421
14422 * configure.in: Check the protos of strchr ans strspn.
14423 Replace strchr if needed.
14424 * src/system.h: Provide the protos of strchr, strspn and memchr if
14425 missing.
14426 * lib/strchr.c: New.
14427 * src/reader.c (symbols_save): Use strchr.
14428
14429 2001-12-27 Akim Demaille <akim@epita.fr>
14430
14431 * src/print.c, src/print_graph.c (escape): New.
14432 Use it to quote the TAGS outputs.
14433 * src/print_graph.c (print_state): Now errors are in red, and
14434 reductions in green.
14435 Prefer high to wide: output the state number on a line of its own.
14436
14437 2001-12-27 Akim Demaille <akim@epita.fr>
14438
14439 * src/state.h, src/state.c (reductions_new): New.
14440 * src/LR0.c (set_state_table): Let all the states have a
14441 `reductions', even if reduced to 0.
14442 (save_reductions): Adjust.
14443 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
14444 * src/print.c (print_reductions, print_actions): Adjust.
14445 * src/output.c (action_row): Adjust.
14446
14447 2001-12-27 Akim Demaille <akim@epita.fr>
14448
14449 * src/state.h, src/state.c (errs_new, errs_dup): New.
14450 * src/LR0.c (set_state_table): Let all the states have an errs,
14451 even if reduced to 0.
14452 * src/print.c (print_errs, print_reductions): Adjust.
14453 * src/output.c (output_actions, action_row): Adjust.
14454 * src/conflicts.c (resolve_sr_conflict): Adjust.
14455
14456 2001-12-27 Akim Demaille <akim@epita.fr>
14457
14458 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
14459
14460 2001-12-27 Akim Demaille <akim@epita.fr>
14461
14462 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
14463 * src/print.c: here.
14464 (lookaheadset, shiftset): New, used as additional storage by
14465 print_reductions.
14466 (print_results): Adjust.
14467 (print_shifts, print_gotos, print_errs): New, extracted from...
14468 (print_actions): here.
14469 * src/print_graph.c (print_actions): Remove dead code.
14470
14471 2001-12-27 Akim Demaille <akim@epita.fr>
14472
14473 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
14474 `$n' and `@n'.
14475
14476 2001-12-27 Akim Demaille <akim@epita.fr>
14477
14478 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
14479 (build_relations): Adjust.
14480
14481 2001-12-27 Akim Demaille <akim@epita.fr>
14482
14483 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
14484 duplication.
14485
14486 2001-12-27 Akim Demaille <akim@epita.fr>
14487
14488 * src/reader.c (packgram): Catch nitems overflows.
14489
14490 2001-12-27 Akim Demaille <akim@epita.fr>
14491
14492 * src/files.c, src/files.h (guard_obstack): Remove.
14493 * src/output.c (output): Adjust.
14494 * src/reader.c (parse_braces): New, factoring...
14495 (copy_action, copy_guard): these two which are renamed as...
14496 (parse_action, parse_guard): these.
14497 As a voluntary consequence, using braces around guards is now
14498 mandatory.
14499
14500 2001-12-27 Akim Demaille <akim@epita.fr>
14501
14502 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
14503 * src/reader.c (symbol_list): `guard' and `guard_line' are new
14504 members.
14505 (symbol_list_new): Adjust.
14506 (copy_action): action_line is the first line, not the last.
14507 (copy_guard): Just as for actions, store the `action' only, not
14508 the switch/case/break flesh.
14509 Don't parse the user action that might follow the guard, let...
14510 (readgram): do it, i.e., now, there can be an action after a
14511 guard.
14512 In other words the guard is just explicitly optional.
14513 (packgram): Adjust.
14514 * src/output.c (guards_output): New.
14515 (output_parser): Call it when needed.
14516 (output): Also free the guard and attrs obstacks.
14517 * src/files.c, src/files.h (obstack_save): Remove.
14518 (output_files): Remove.
14519 As a result, if one needs the former `.act' file, using an
14520 appropriate skeleton which requires actions and guards is now
14521 required.
14522 * src/main.c (main): Adjust.
14523 * tests/semantic.at: New.
14524 * tests/regression.at: Use `input.y' as input file name.
14525 Avoid 8+3 problems by requiring input.c when the test needs the
14526 parser.
14527
14528 2001-12-27 Akim Demaille <akim@epita.fr>
14529
14530 * src/reader.c (symbol_list_new): Be sure to initialize all the
14531 fields.
14532
14533 2001-12-27 Akim Demaille <akim@epita.fr>
14534
14535 All the hacks using a final pseudo state are now useless.
14536
14537 * src/LR0.c (set_state_table): state_table holds exactly nstates.
14538 * src/lalr.c (nLA): New.
14539 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
14540 instead of lookaheadsp from the pseudo state (nstate + 1).
14541
14542 2001-12-27 Akim Demaille <akim@epita.fr>
14543
14544 * src/output.c (action_row, token_actions): Use a state_t instead
14545 of a integer, and nlookaheads instead of the following state's
14546 lookaheadsp.
14547
14548 2001-12-27 Akim Demaille <akim@epita.fr>
14549
14550 * src/conflicts.c (log_resolution, flush_shift)
14551 (resolve_sr_conflict, set_conflicts, solve_conflicts)
14552 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
14553 (conflicts_print, print_reductions): Use a state_t instead of an
14554 integer when referring to a state.
14555 As much as possible, depend upon nlookaheads, instead of the
14556 `lookaheadsp' member of the following state (since lookaheads of
14557 successive states are successive, the difference between state n + 1
14558 and n served as the number of lookaheads for state n).
14559 * src/lalr.c (add_lookback_edge): Likewise.
14560 * src/print.c (print_core, print_actions, print_state)
14561 (print_results): Likewise.
14562 * src/print_graph.c (print_core, print_actions, print_state)
14563 (print_graph): Likewise.
14564 * src/conflicts.h: Adjust.
14565
14566 2001-12-27 Akim Demaille <akim@epita.fr>
14567
14568 * src/bison.hairy: Formatting/comment changes.
14569 ANSIfy.
14570 Remove `register' indications.
14571 Add plenty of `static'.
14572
14573 2001-12-27 Akim Demaille <akim@epita.fr>
14574
14575 * src/output.c (prepare): Drop the muscle `ntbase' which
14576 duplicates ntokens.
14577 * src/bison.simple: Formatting/comment changes.
14578 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
14579 is an undocumented synonym.
14580
14581 2001-12-22 Akim Demaille <akim@epita.fr>
14582
14583 * src/output.c (output_table_data): Change the prototype to use
14584 `int' for array ranges: some invocations do pass an int, not a
14585 short.
14586 Reported by Wayne Green.
14587
14588 2001-12-22 Akim Demaille <akim@epita.fr>
14589
14590 Some actions of web2c.y are improperly triggered.
14591 Reported by Mike Castle.
14592
14593 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
14594 * tests/regression.at (Web2c): Rename as...
14595 (Web2c Report): this.
14596 (Web2c Actions): New.
14597
14598 2001-12-22 Akim Demaille <akim@epita.fr>
14599
14600 Reductions in web2c.y are improperly reported.
14601 Reported by Mike Castle.
14602
14603 * src/conflicts.c (print_reductions): Fix.
14604 * tests/regression.at (Web2c): New.
14605
14606 2001-12-18 Akim Demaille <akim@epita.fr>
14607
14608 Some host fail on `assert (!"foo")', which expands to
14609 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
14610 Reported by Nelson Beebee.
14611
14612 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
14613 `#define it_succeeded 0' and `assert (it_succeeded)'.
14614
14615 2001-12-17 Marc Autret <autret_m@epita.fr>
14616
14617 * src/bison.simple: Don't hard code the skeleton line and filename.
14618 * src/output.c (output_parser): Rename 'line' as 'output_line'.
14619 New line counter 'skeleton_line' (skeleton-line muscle).
14620
14621 2001-12-17 Paul Eggert <eggert@twinsun.com>
14622
14623 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
14624 YYDEBUG must be defined to a nonzero value.
14625
14626 * src/bison.simple (yytname): Do not assume that the user defines
14627 YYDEBUG to a properly parenthesized expression.
14628
14629 2001-12-17 Akim Demaille <akim@epita.fr>
14630
14631 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
14632 nlookaheads is a new member.
14633 Adjust all users.
14634 * src/lalr.h (nlookaheads): Remove this orphan declaration.
14635 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
14636 state.
14637
14638 2001-12-17 Akim Demaille <akim@epita.fr>
14639
14640 * src/files.h, src/files.c (open_files, close_files): Remove.
14641 * src/main.c (main): Don't open/close files, nor invoke lex_free,
14642 let...
14643 * src/reader.c (reader): Do it.
14644
14645 2001-12-17 Akim Demaille <akim@epita.fr>
14646
14647 * src/conflicts.c (print_reductions): Formatting changes.
14648
14649 2001-12-17 Akim Demaille <akim@epita.fr>
14650
14651 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
14652 (flush_reduce): New.
14653 (resolve_sr_conflict): Adjust.
14654
14655 2001-12-17 Akim Demaille <akim@epita.fr>
14656
14657 * src/output.c (output_obstack): Be static and rename as...
14658 (format_obstack): this, to avoid any confusion with files.c's
14659 output_obstack.
14660 * src/reader.h (muscle_obstack): Move to...
14661 * src/output.h: here, since it's defined in output.c.
14662
14663 2001-12-17 Akim Demaille <akim@epita.fr>
14664
14665 * src/output.c (action_row, save_column, default_goto)
14666 (sort_actions, matching_state, pack_vector): Better variable
14667 locality.
14668
14669 2001-12-17 Akim Demaille <akim@epita.fr>
14670
14671 * src/output.c: Various formatting changes.
14672
14673 2001-12-17 Akim Demaille <akim@epita.fr>
14674
14675 * src/files.c (output_files): Free the output_obstack.
14676 * src/main.c (main): Call print and print_graph conditionally.
14677 * src/print.c (print): Work unconditionally.
14678 * src/print_graph.c (print_graph): Work unconditionally.
14679 * src/conflicts.c (log_resolution): Output only if verbose_flag.
14680
14681 2001-12-16 Marc Autret <autret_m@epita.fr>
14682
14683 * src/output.c (actions_output): Fix. When we use %no-lines,
14684 there is one less line per action.
14685
14686 2001-12-16 Marc Autret <autret_m@epita.fr>
14687
14688 * src/bison.simple: Remove a useless #line directive.
14689 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
14690 * src/output.c (get_lines_number): New.
14691 (output_parser): Adjust, now takes care about the lines of a
14692 output muscles.
14693 Fix line numbering.
14694 (actions_output): Computes the number of lines taken by actions.
14695 (output_master_parser): Insert new skeleton which is the name of
14696 the output parser file name.
14697
14698 2001-12-15 Marc Autret <autret_m@epita.fr>
14699
14700 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
14701
14702 2001-12-15 Marc Autret <autret_m@epita.fr>
14703
14704 * src/output.c (output_gram): Keep track of the hairy one.
14705
14706 2001-12-15 Akim Demaille <akim@epita.fr>
14707
14708 Make `make distcheck' work.
14709
14710 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
14711 system.h which uses libgettext.h.
14712
14713 2001-12-15 Akim Demaille <akim@epita.fr>
14714
14715 * src/nullable.c (set_nullable): Useless rules must be skipped,
14716 otherwise, since we range over their symbols, we might look at a
14717 nonterminal which no longer ``exists'', i.e., it is not counted in
14718 `nvars', hence we overflow our arrays.
14719
14720 2001-12-15 Akim Demaille <akim@epita.fr>
14721
14722 The header can also be produced directly, without any obstack!
14723 Yahoo!
14724
14725 * src/files.c, src/files.h (defines_obstack): Remove.
14726 (compute_header_macro): Global.
14727 (defines_obstack_save): Remove.
14728 * src/reader.c (parse_union_decl): No longer output to
14729 defines_obstack: its content can be found in the `stype' muscle
14730 anyway.
14731 (output_token_translations): Merge into...
14732 (symbols_output): this.
14733 Rename as...
14734 (symbols_save): this.
14735 (reader): Adjust.
14736 * src/output.c (header_output): New.
14737 (output): Call it.
14738
14739 2001-12-15 Akim Demaille <akim@epita.fr>
14740
14741 * src/reader.c (parse_union_decl): Instead of handling two obstack
14742 simultaneously, use one to define the `stype' muscle, and use the
14743 value of the latter to fill defines_obstack.
14744 (copy_comment): Remove.
14745 (copy_comment2): Work for a single obstack.
14746 Rename as...
14747 (copy_comment): this.
14748
14749 2001-12-15 Akim Demaille <akim@epita.fr>
14750
14751 * src/lex.c, src/lex.h (xgetc): No longer static.
14752 * src/reader.c (parse_union_decl): Revamp.
14753
14754 2001-12-15 Akim Demaille <akim@epita.fr>
14755
14756 Still making progress in separating Bison into (i) input, (ii)
14757 process, (iii) output: now we can directly output the parser file
14758 without using table_obstack at all.
14759
14760 * src/files.c, src/files.h (table_obstack): Bye bye.
14761 (parser_file_name): New.
14762 * src/files.c (compute_output_file_names): Compute it.
14763 * src/output.c (actions_output, output_parser)
14764 (output_master_parser): To a file instead of an obstack.
14765
14766 2001-12-15 Akim Demaille <akim@epita.fr>
14767
14768 Attach actions to rules, instead of pre-outputting them to
14769 actions_obstack.
14770
14771 * src/gram.h (rule_t): action and action_line are new members.
14772 * src/reader.c (symbol_list): Likewise.
14773 (copy_action): Save the actions within the rule.
14774 (packgram): Save them in rule_table.
14775 * src/output.c (actions_output): New.
14776 (output_parser): Use it on `%%actions'.
14777 (output_rule_data): Don't free rule_table.
14778 (output): Do it.
14779 (prepare): Don't save the `action' muscle.
14780 * src/bison.simple: s/%%action/%%actions/.
14781
14782 2001-12-15 Akim Demaille <akim@epita.fr>
14783
14784 * src/reader.c (copy_action): When --yacc, don't append a `;'
14785 to the user action: let it fail if lacking.
14786 Suggested by Arnold Robbins and Tom Tromey.
14787
14788 2001-12-14 Akim Demaille <akim@epita.fr>
14789
14790 * src/lex.c (literalchar): Simply return the char you decoded, non
14791 longer mess around with obstacks and int pointers.
14792 Adjust all callers.
14793
14794 2001-12-14 Akim Demaille <akim@epita.fr>
14795
14796 * src/lex.c (literalchar): Don't escape the special characters,
14797 just decode them, and keep them as char (before, eol was output as
14798 the 2 char string `\n' etc.).
14799 * src/output.c (output_rule_data): Use quotearg to output the
14800 token strings.
14801
14802 2001-12-13 Paul Eggert <eggert@twinsun.com>
14803
14804 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
14805 Do not infringe on the global user namespace when using C++.
14806 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
14807 All uses of `fprintf' and `stderr' changed.
14808
14809 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
14810
14811 2001-12-13 Akim Demaille <akim@epita.fr>
14812
14813 The computation of nullable is broken: it doesn't handle empty
14814 RHS's properly.
14815
14816 * tests/torture.at (GNU AWK Grammar): New.
14817 * tests/sets.at (Nullable): New.
14818 * src/nullable.c (set_nullable): Instead of blindly looping over
14819 `ritems', loop over the rules, and then over their rhs's.
14820
14821 Work around Autotest bugs.
14822
14823 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
14824 frame, because Autotest understand lines starting with a `+' as
14825 traces from the shell. Then, they are not processed properly.
14826 Admittedly an Autotest bug, but we don't have time to wait for
14827 Autotest to catch up.
14828 * tests/regression.at (Broken Closure): Adjust to the new table
14829 frames.
14830 Move to...
14831 * tests/sets.at: here.
14832
14833 2001-12-13 Akim Demaille <akim@epita.fr>
14834
14835 * src/closure.c (closure): Use nrules instead of playing tricks
14836 with BITS_PER_WORD.
14837
14838 2001-12-13 Akim Demaille <akim@epita.fr>
14839
14840 * src/print.c (print_actions): Output the handling of `$' as the
14841 traces do: shifting the token EOF. Before EOF was treated as a
14842 nonterminal.
14843 * tests/regression.at: Adjust some tests.
14844 * src/print_graph.c (print_core): Complete the set of items via
14845 closure. The next-to-final and final states are still unsatisfying,
14846 but that's to be addressed elsewhere.
14847 No longer output the rule numbers, but do output the state number.
14848 A single loop for the shifts + gotos is enough, but picked a
14849 distinct color for each.
14850 (print_graph): Initialize and finalize closure.
14851
14852 2001-12-13 Akim Demaille <akim@epita.fr>
14853
14854 * src/reader.c (readgram): Remove dead code, an strip useless
14855 braces.
14856 (get_type): Remove, unused.
14857
14858 2001-12-12 Akim Demaille <akim@epita.fr>
14859
14860 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
14861 on that of lib/error.c.
14862
14863 2001-12-12 Akim Demaille <akim@epita.fr>
14864
14865 Some hosts don't like `/' in includes.
14866
14867 * src/system.h: Include libgettext.h without qualifying the path.
14868 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
14869 $(top_srcdir).
14870
14871 2001-12-11 Marc Autret <autret_m@epita.fr>
14872
14873 * src/output.c (output_parser): Remove useless muscle.
14874
14875 2001-12-11 Marc Autret <autret_m@epita.fr>
14876
14877 * src/bison.simple: Remove #line just before %%epilogue. It
14878 is now handled in ...
14879 * src/reader.c (read_additionnal_code): Add the output of a
14880 #line for the epilogue.
14881
14882 2001-12-10 Marc Autret <autret_m@epita.fr>
14883
14884 * src/reader.c (copy_definition): Re-use CPP-outed code which
14885 replace precedent remove.
14886 * src/bison.simple: Remove #line before %%prologue because
14887 %%input-line is wrong at this time.
14888
14889 2001-12-10 Marc Autret <autret_m@epita.fr>
14890
14891 * src/reader.c (symbols_output): Clean up.
14892 * src/output.c (output_gram, output): Clean up.
14893
14894 2001-12-10 Akim Demaille <akim@epita.fr>
14895
14896 * src/lalr.c (initialize_lookaheads): New. Extracted from...
14897 * src/LR0.c (set_state_table): here.
14898 * src/lalr.c (lalr): Call it.
14899
14900 2001-12-10 Akim Demaille <akim@epita.fr>
14901
14902 * src/state.h (shifts): Remove the `number' member: shifts are
14903 attached to state, hence no longer need to be labelled with a
14904 state number.
14905
14906 2001-12-10 Akim Demaille <akim@epita.fr>
14907
14908 Now that states have a complete set of members, the linked list of
14909 shifts is useless: just fill directly the state's shifts member.
14910
14911 * src/state.h (shifts): Remove the `next' member.
14912 * src/LR0.c (first_state, last_state): Remove.
14913 Adjust the callers.
14914 (augment_automaton): Don't look for the shifts that must be added
14915 a shift on EOF: it is those of the state we looked for! But now,
14916 since shifts are attached, it is no longer needed to looking
14917 merely by its id: its number.
14918
14919 2001-12-10 Akim Demaille <akim@epita.fr>
14920
14921 * src/LR0.c (augment_automaton): Better variable locality.
14922 Remove an impossible branch: if there is a state corresponding to
14923 the start symbol being shifted, then there is shift for the start
14924 symbol from the initial state.
14925
14926 2001-12-10 Akim Demaille <akim@epita.fr>
14927
14928 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
14929 only when appropriate: when insert_start_shifting_state' is not
14930 invoked.
14931 * tests/regression.at (Rule Line Numbers): Adjust.
14932
14933 2001-12-10 Akim Demaille <akim@epita.fr>
14934
14935 * src/LR0.c (augment_automaton): Now that all states have shifts,
14936 merge the two cases addition shifts to the initial state.
14937
14938 2001-12-10 Akim Demaille <akim@epita.fr>
14939
14940 * src/lalr.c (set_state_table): Move to...
14941 * src/LR0.c: here.
14942 * src/lalr.c (lalr): Don't call it...
14943 * src/LR0.c (generate_states): do it.
14944 * src/LR0.h (first_state): Remove, only the table is used.
14945
14946 2001-12-10 Akim Demaille <akim@epita.fr>
14947
14948 * src/LR0.h (first_shift, first_reduction): Remove.
14949 * src/lalr.c: Don't use first_shift: find shifts through the
14950 states.
14951
14952 2001-12-10 Akim Demaille <akim@epita.fr>
14953
14954 * src/LR0.c: Attach shifts to states as soon as they are
14955 computed.
14956 * src/lalr.c (set_state_table): Instead of assigning shifts to
14957 state, just assert that the mapping was properly done.
14958
14959 2001-12-10 Akim Demaille <akim@epita.fr>
14960
14961 * src/LR0.c (insert_start_shift): Rename as...
14962 (insert_start_shifting_state): this.
14963 (insert_eof_shifting_state, insert_accepting_state): New.
14964 (augment_automaton): Adjust.
14965 Better locality of the variables.
14966 When looking if the start_symbol is shifted from the initial
14967 state, using `while (... symbol != start_symbol ...)' sounds
14968 better than `while (... symbol < start_symbol ...)': If fail
14969 to see how the order between symbols could be relevant!
14970
14971 2001-12-10 Akim Demaille <akim@epita.fr>
14972
14973 * src/getargs.h: Don't declare `spec_name_prefix' and
14974 `spec_file_prefix', declared by src/files.h.
14975 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
14976 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
14977 * src/output.c (prepare): Adjust.
14978 * src/reader.c (symbols_output): Likewise.
14979 * src/vmsgetargs.c: Vaguely adjust, but who cares?
14980
14981 2001-12-10 Akim Demaille <akim@epita.fr>
14982
14983 * src/muscle_tab.c (muscle_init): NULL is a better default than
14984 `"0"'.
14985
14986 2001-12-10 Akim Demaille <akim@epita.fr>
14987
14988 * src/reader.c (reader): Calling symbols_output once is enough.
14989
14990 2001-12-10 Akim Demaille <akim@epita.fr>
14991
14992 Now that states have a complete set of members, the linked list of
14993 reductions is useless: just fill directly the state's reductions
14994 member.
14995
14996 * src/state.h (struct reductions): Remove member `number' and
14997 `next'.
14998 * src/LR0.c (first_reduction, last_reduction): Remove.
14999 (save_reductions): Don't link the new reductions, store them in
15000 this_state.
15001 * src/lalr.c (set_state_table): No need to attach reductions to
15002 states, it's already done.
15003 * src/output.c (output_actions): No longer free the shifts, then
15004 the reductions, then the states: free all the states and their
15005 members.
15006
15007 2001-12-10 Akim Demaille <akim@epita.fr>
15008
15009 * src/options.c (OPTN, DRTV, BOTH): New.
15010 (option_table): Use them.
15011
15012 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
15013 the job of system.h.
15014 * src/options.c: Don't include stdio.h and xalloc.h for the same
15015 reasons.
15016
15017 2001-12-10 Akim Demaille <akim@epita.fr>
15018
15019 * src/output.c (output, prepare): Make sure the values of the
15020 muscles `action' and `prologue' are 0-terminated.
15021
15022 2001-12-10 Akim Demaille <akim@epita.fr>
15023
15024 Clean up GCC warnings.
15025
15026 * src/reader.c (copy_action): `buf' is not used.
15027 (parse_skel_decl): Be static.
15028 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
15029 * src/options.h (create_long_option_table): Have a real prototype.
15030 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
15031 (hash_delete_at): Return const void *.
15032 Adjust casts to preserve the const.
15033
15034 2001-12-10 Akim Demaille <akim@epita.fr>
15035
15036 * configure.in: Require 2.52g.
15037 M4 is not needed, but AUTOM4TE is.
15038 * m4/m4.m4: Remove.
15039 * tests/Makefile.am: Adjust.
15040
15041 2001-12-10 Akim Demaille <akim@epita.fr>
15042
15043 One structure for states is enough, even though theoretically
15044 there are LR(0) states and LALR(1) states.
15045
15046 * src/lalr.h (state_t): Remove.
15047 (state_table): Be state_t **, not state_t *.
15048 * src/state.h (core, CORE_ALLOC): Rename as...
15049 (state_t, STATE_ALLOC): this.
15050 Add the LALR(1) members: shifts, reductions, errs.
15051 * src/LR0.c (state_table): Rename as...
15052 (state_hash): this, to avoid name clashes with the global
15053 `state_table'.
15054 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
15055 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
15056
15057 2001-12-10 Akim Demaille <akim@epita.fr>
15058
15059 Bison dumps core on bash.y.
15060 Reported by Pascal Bart.
15061
15062 * src/warshall.c (bitmatrix_print): New.
15063 (TC): Use it.
15064 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
15065 j must be the outer loop.
15066 * tests/regression.at (Broken Closure): New.
15067
15068 2001-12-05 Akim Demaille <akim@epita.fr>
15069
15070 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
15071 its argument.
15072 Reported by Peter Hamorsky.
15073
15074 2001-12-05 Akim Demaille <akim@epita.fr>
15075
15076 * src/conflicts.c (err_table): Remove.
15077 (resolve_sr_conflict): Adjust.
15078 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
15079 Rename as...
15080 (state_t.reductions, state_t.shifts): this.
15081
15082 2001-12-05 Akim Demaille <akim@epita.fr>
15083
15084 * src/reduce.c (reduce_grammar_tables): No longer disable the
15085 removal of useless rules via CPP but via `if (0)', so that the
15086 compiler still check the code is valid.
15087 For instance, it should have noticed `rline' no longer exists: use
15088 the `line' member of rule_t.
15089 * src/gram.c (dummy, rline): Remove, unused.
15090
15091 2001-12-05 Akim Demaille <akim@epita.fr>
15092
15093 * src/output.c (pack_vector): Use assert, not berror.
15094 * src/main.c (berror): Remove, unused.
15095
15096 2001-12-05 Akim Demaille <akim@epita.fr>
15097
15098 New experimental feature: if --verbose --trace output all the
15099 items of a state, not only its kernel.
15100
15101 * src/print.c (print_core): If `trace_flag', then invoke closure
15102 before outputting the items of the state (print_core is no longer
15103 a correct name them).
15104 (print_results): Invoke new_closure/free_closure if needed.
15105
15106 2001-12-05 Akim Demaille <akim@epita.fr>
15107
15108 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
15109 * src/closure.c, src/closure.h (itemsetsize): Rename as...
15110 (nitemset): for consistency with the rest of the project.
15111
15112 2001-12-05 Akim Demaille <akim@epita.fr>
15113
15114 * src/closure.c (print_closure): Improve.
15115 (closure): Use it for printing input and output.
15116
15117 2001-12-05 Akim Demaille <akim@epita.fr>
15118
15119 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
15120 indexed by nonterminals.
15121
15122 2001-12-05 Akim Demaille <akim@epita.fr>
15123
15124 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
15125 what it was!).
15126 * src/warshall.h: Remove accidental duplication of the content.
15127
15128 2001-12-05 Akim Demaille <akim@epita.fr>
15129
15130 * src/closure.c (set_fderives): De-obfuscate.
15131
15132 2001-12-05 Akim Demaille <akim@epita.fr>
15133
15134 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
15135
15136 2001-12-05 Akim Demaille <akim@epita.fr>
15137
15138 * src/closure.c (set_firsts): De-obfuscate.
15139
15140 2001-12-05 Akim Demaille <akim@epita.fr>
15141
15142 * src/output.c (action_row): De-obfuscate
15143 using the good o' techniques: arrays not pointers, variable
15144 locality, BITISSET, RESETBIT etc.
15145
15146 2001-12-05 Akim Demaille <akim@epita.fr>
15147
15148 Pessimize the code to simplify it: from now on, all the states
15149 have a valid SHIFTS, which NSHIFTS is possibly 0.
15150
15151 * src/LR0.c (shifts_new): Be global and move to..
15152 * src/state.c, src/state.h: here.
15153 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
15154 * src/print_graph: Adjust.
15155
15156 2001-12-05 Akim Demaille <akim@epita.fr>
15157
15158 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
15159 * src/conflicts.c: Use it.
15160 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
15161 incorrectly ``simplified''.
15162
15163 2001-12-05 Akim Demaille <akim@epita.fr>
15164
15165 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
15166 using the good o' techniques: arrays not pointers, variable
15167 locality, BITISSET, RESETBIT etc.
15168
15169 2001-12-05 Akim Demaille <akim@epita.fr>
15170
15171 * src/state.h (SHIFT_SYMBOL): New.
15172 * src/conflicts.c: Use it to deobfuscate.
15173
15174 2001-12-05 Akim Demaille <akim@epita.fr>
15175
15176 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
15177 (print_reductions): De-obfuscate using the good o' techniques:
15178 arrays not pointers, variable locality, BITISSET.
15179
15180 2001-12-05 Akim Demaille <akim@epita.fr>
15181
15182 * src/conflicts.c (print_reductions): Arrays, not pointers.
15183 Use BITISSET.
15184
15185 2001-12-05 Akim Demaille <akim@epita.fr>
15186
15187 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15188
15189 2001-12-05 Akim Demaille <akim@epita.fr>
15190
15191 * src/conflicts.c (print_reductions): Improve variable locality.
15192
15193 2001-12-05 Akim Demaille <akim@epita.fr>
15194
15195 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15196
15197 2001-12-05 Akim Demaille <akim@epita.fr>
15198
15199 * src/conflicts.c (print_reductions): Improve variable locality.
15200
15201 2001-12-05 Akim Demaille <akim@epita.fr>
15202
15203 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
15204 * src/lalr.c: Use them.
15205
15206 2001-12-05 Akim Demaille <akim@epita.fr>
15207
15208 * src/LR0.c (augment_automaton): Formatting changes.
15209 Better variable locality.
15210
15211 2001-12-05 Akim Demaille <akim@epita.fr>
15212
15213 * src/lalr.c (matrix_print): New.
15214 (transpose): Use it.
15215 Use arrays instead of pointers.
15216
15217 2001-12-05 Akim Demaille <akim@epita.fr>
15218
15219 * src/lalr.c (maxrhs): Move to...
15220 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
15221 * src/lalr.c (build_relations): Adjust.
15222
15223 2001-12-05 Akim Demaille <akim@epita.fr>
15224
15225 * src/lalr.c (transpose): Free the memory allocated to the
15226 argument, as it is replaced by the results by the unique caller.
15227 (build_relations): Merely invoke transpose: it handles the memory
15228 deallocation.
15229 Improve variable locality.
15230 Avoid variables used as mere abbreviations.
15231 (compute_lookaheads): Use arrays instead of pointers.
15232
15233 2001-12-05 Akim Demaille <akim@epita.fr>
15234
15235 * src/lalr.c (initialize_F): Improve variable locality.
15236 Avoid variables used as mere abbreviations.
15237
15238 2001-12-05 Akim Demaille <akim@epita.fr>
15239
15240 * src/derives.c (print_derives): Display the ruleno.
15241 * src/lalr.c (initialize_F, transpose): Better variable locality
15242 to improve readability.
15243 Avoid variables used as mere abbreviations.
15244
15245 2001-12-05 Akim Demaille <akim@epita.fr>
15246
15247 * src/lalr.c (traverse): Use arrays instead of pointers.
15248
15249 2001-12-05 Akim Demaille <akim@epita.fr>
15250
15251 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
15252 the handling of squeue.
15253 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15254
15255 2001-12-05 Akim Demaille <akim@epita.fr>
15256
15257 Because useless nonterminals are now kept alive (instead of being
15258 `destroyed'), we now sometimes examine them, and store information
15259 related to them. Hence we need to know their number, and adjust
15260 memory allocations.
15261
15262 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
15263 static.
15264 * src/LR0.c (allocate_itemsets): The memory allocated to
15265 `symbol_count' was used for two different purpose: once to count
15266 the number of occurrences of each symbol, and later reassigned to
15267 `shift_symbol', containing the symbol that can be shifted from a
15268 given state.
15269 Deobfuscate, i.e., allocate, use and free `symbol_count' here
15270 only, and...
15271 (new_itemsets): Allocate `shift_symbol' here.
15272 (allocate_itemsets): symbol_count includes useless nonterminals.
15273 Make room for them.
15274 (free_storage): Use `free', not `XFREE', for pointers that cannot
15275 be null.
15276
15277 2001-12-05 Akim Demaille <akim@epita.fr>
15278
15279 * src/nullable.c (set_nullable): Deobfuscate the handling of
15280 ritem.
15281 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15282
15283 2001-12-05 Akim Demaille <akim@epita.fr>
15284
15285 * src/gram.c, src/gram.h (ritem_print): New.
15286 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
15287 (This useless function was defined only to work around VMS linkers
15288 that can't handle compilation units with variables only).
15289 * src/reduce.c (dump_grammar): Use it to trace the construction of
15290 ritem.
15291
15292 2001-12-04 Paul Eggert <eggert@twinsun.com>
15293
15294 * src/bison.simple (union yyalloc): Change member names
15295 to be the same as the stack names.
15296 (yyparse): yyptr is now union yyalloc *, not char *.
15297 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
15298 and may generate better code on some machines.
15299 (yystpcpy): Use prototype if __STDC__ is defined, not just
15300 if __cplusplus is defined.
15301
15302 2001-11-30 Akim Demaille <akim@epita.fr>
15303
15304 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
15305 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
15306 Gettext doesn't compile cleanly, and dies with -Werror.
15307 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
15308 Include WARNING_CFLAGS here.
15309 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
15310 before being defined.
15311
15312 2001-11-27 Paul Eggert <eggert@twinsun.com>
15313
15314 * lib/quotearg.h (quotearg_n, quotearg_n_style):
15315 First arg is int, not unsigned.
15316 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
15317 (SIZE_MAX, UINT_MAX): New macros.
15318 (quotearg_n_options): Abort if N is negative.
15319 Avoid overflow check on hosts where size_t is 64 bits and int
15320 is 32 bits, as overflow is impossible there.
15321 Fix off-by-one typo that caused unnecessary reallocation.
15322
15323 2001-11-29 Paul Eggert <eggert@twinsun.com>
15324
15325 Name space cleanup in generated parser.
15326
15327 * doc/bison.texinfo (Bison Parser): Discuss system headers
15328 and their effect on the user name space.
15329
15330 * src/bison.simple:
15331 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
15332 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
15333 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
15334
15335 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
15336 on user names when possible.
15337
15338 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
15339 Simplify test for whather <alloca.h> exists.
15340
15341 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
15342
15343 (<stdio.h>): Include if YYDEBUG.
15344
15345 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
15346 ! defined (yyoverflow) && ! defined (yymemcpy).
15347
15348 (yymemcpy, yyparse): Rename local variables as needed so that
15349 they all begin with 'yy'.
15350
15351 (yystrlen, yystpcpy): New functions.
15352
15353 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
15354 All uses changed.
15355
15356 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
15357 instead of relying on string.h functions. Use YYSTACK_ALLOC
15358 and YYSTACK_FREE instead of malloc and free.
15359
15360 2001-11-30 Akim Demaille <akim@epita.fr>
15361
15362 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
15363 before their first uses.
15364 (YYBISON, YYPURE): Move to the top of the output.
15365
15366 2001-11-30 Akim Demaille <akim@epita.fr>
15367
15368 * tests/reduce.at (Useless Nonterminals): Fix.
15369
15370 2001-11-30 Akim Demaille <akim@epita.fr>
15371
15372 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
15373 if body instead of `;' to pacify GCC's warnings.
15374
15375 2001-11-30 Akim Demaille <akim@epita.fr>
15376
15377 Instead of mapping the LHS of unused rules to -1, keep the LHS
15378 valid, but flag the rules as invalid.
15379
15380 * src/gram.h (rule_t): `useful' is a new member.
15381 * src/print.c (print_grammar): Adjust.
15382 * src/derives.c (set_derives): Likewise.
15383 * src/reader.c (packgram, reduce_output): Likewise.
15384 * src/reduce.c (reduce_grammar_tables): Likewise.
15385 * tests/reduce.at (Underivable Rules, Useless Rules): New.
15386
15387 2001-11-30 Akim Demaille <akim@epita.fr>
15388
15389 * src/reduce.c (reduce_output): Formatting changes.
15390 * src/print.c (print_results, print_grammar): Likewise.
15391 * tests/regression.at (Rule Line Numbers)
15392 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
15393
15394 2001-11-30 Akim Demaille <akim@epita.fr>
15395
15396 * src/reduce.c (nonterminals_reduce): Instead of throwing away
15397 useless nonterminals, move them at the end of the symbol arrays.
15398 (reduce_output): Adjust.
15399 * tests/reduce.at (Useless Nonterminals): Adjust.
15400
15401 2001-11-30 Akim Demaille <akim@epita.fr>
15402
15403 * src/reduce.c: Various comment/formatting changes.
15404 (nonterminals_reduce): New, extracted from...
15405 (reduce_grammar_tables): here.
15406 (reduce_grammar): Call nonterminals_reduce.
15407
15408 2001-11-29 Paul Eggert <eggert@twinsun.com>
15409
15410 * src/bison.simple (YYSTACK_REALLOC): Remove.
15411 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
15412 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
15413 New macros.
15414 (union yyalloc): New type.
15415 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
15416 an arbitrary restriction on hosts where size_t is wider than int.
15417
15418 (yyparse): Don't dump core if alloca or malloc fails; instead, report
15419 a parser stack overflow. Allocate just one block of memory for all
15420 three stacks, instead of allocating three blocks; this typically is
15421 faster and reduces fragmentation.
15422
15423 Do not limit the number of items in the stack to a value that fits
15424 in 'int', as this is an arbitrary limit on hosts with 64-bit
15425 size_t and 32-bit int.
15426
15427 2001-11-29 Marc Autret <autret_m@epita.fr>
15428
15429 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
15430 of defining YYERROR_VERBOSE.
15431 [AT_DATA]: $4 is now out of C declarations in the prologue.
15432
15433 2001-11-28 Marc Autret <autret_m@epita.fr>
15434
15435 * src/reader.c (parse_dquoted_param): New.
15436 (parse_skel_decl): Use it.
15437 * src/lex.h: Add its prototype.
15438 * src/lex.c (literalchar): Become not static.
15439
15440 2001-11-28 Marc Autret <autret_m@epita.fr>
15441
15442 * src/output.h: And put its extern declaration here.
15443 * src/output.c (error_verbose): Define here.
15444 (prepare): Echo name modification.
15445 * src/getargs.h: Clean its extern declaration.
15446 * src/getargs.c (error_verbose_flag): Remove.
15447 (getargs): Remove case 'e'.
15448 * src/options.c (option_table): 'error-verbose' is now seen as simple
15449 percent option.
15450 Include output.h.
15451
15452 * src/reader.c (read_declarations): Remove case tok_include.
15453 (parse_include_decl): Remove.
15454 * src/lex.h (token_t): Remove tok_include.
15455 * src/options.c (option_table): 'include' is now a simple command line
15456 option.
15457
15458 2001-11-28 Marc Autret <autret_m@epita.fr>
15459
15460 * src/bison.simple: Adjust muscle names.
15461 * src/muscle_tab.c (muscle_init): Also rename the muscles.
15462 * src/output.c (prepare): s/_/-/ for the muscles names.
15463 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
15464
15465 2001-11-28 Marc Autret <autret_m@epita.fr>
15466
15467 * src/bison.simple: Fix debug.
15468 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
15469
15470 2001-11-28 Akim Demaille <akim@epita.fr>
15471
15472 * src/LR0.c (shifts_new): New.
15473 (save_shifts, insert_start_shift, augment_automaton): Use it.
15474
15475 2001-11-28 Akim Demaille <akim@epita.fr>
15476
15477 * src/closure.c (closure): `b' and `ruleno' denote the same value:
15478 keep ruleno only.
15479
15480 2001-11-28 Akim Demaille <akim@epita.fr>
15481
15482 * src/closure.c (closure): Instead of looping over word in array
15483 then bits in words, loop over bits in array.
15484
15485 2001-11-28 Akim Demaille <akim@epita.fr>
15486
15487 * src/closure.c (closure): No longer optimize the special case
15488 where all the bits of `ruleset[r]' are set to 0, to make the code
15489 clearer.
15490
15491 2001-11-28 Akim Demaille <akim@epita.fr>
15492
15493 * src/closure.c (closure): `r' and `c' are new variables, used to
15494 de-obfuscate accesses to RULESET and CORE.
15495
15496 2001-11-28 Akim Demaille <akim@epita.fr>
15497
15498 * src/reduce.c (reduce_print): Use ngettext.
15499 (dump_grammar): Improve the trace accuracy.
15500
15501 2001-11-28 Akim Demaille <akim@epita.fr>
15502
15503 * src/reduce.c (dump_grammar): Don't translate trace messages.
15504
15505 2001-11-28 Akim Demaille <akim@epita.fr>
15506
15507 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
15508 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
15509 as all tags are free'ed afterwards.
15510 From Enrico Scholz.
15511
15512 2001-11-27 Paul Eggert <eggert@twinsun.com>
15513
15514 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
15515 use alloca when we didn't want to, and vice versa.
15516
15517 2001-11-27 Marc Autret <autret_m@epita.fr>
15518
15519 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
15520 initialization.
15521 * src/output.c (prepare): Remove its update.
15522
15523 2001-11-27 Marc Autret <autret_m@epita.fr>
15524
15525 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
15526 Use %error-verbose.
15527
15528 2001-11-27 Marc Autret <autret_m@epita.fr>
15529
15530 * src/bison.simple: Remove YYERROR_VERBOSE using.
15531 Use %%error_verbose.
15532 (yyparse): Likewise.
15533 * src/output.c (prepare): Give its final value.
15534 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
15535 * src/getargs.h: Add its extern declaration.
15536 * src/getargs.c (error_verbose_flag): New int.
15537 (getargs): Update to catch new case.
15538 * src/options.c (option_table): 'error-verbose' is a new option.
15539 (shortopts): Update.
15540
15541 2001-11-27 Akim Demaille <akim@epita.fr>
15542
15543 * src/system.h: Use intl/libgettext.h.
15544 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
15545
15546 2001-11-27 Akim Demaille <akim@epita.fr>
15547
15548 * tests/torture.at (Exploding the Stack Size with Malloc):
15549 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
15550
15551 2001-11-27 Akim Demaille <akim@epita.fr>
15552
15553 * src/files.c: Include error.h.
15554 Reported by Hans Aberg.
15555
15556 2001-11-26 Marc Autret <autret_m@epita.fr>
15557
15558 * src/reader.c (parse_include_decl): New, not yet implemented.
15559 (read_declarations): Add case tok_include.
15560 * src/getargs.h (include): Add its extern definition.
15561 * src/getargs.c (include): New const char *.
15562 (getargs): Add case '-I'.
15563 * src/options.c (option_table): Add include as command line and
15564 percent option.
15565 * src/lex.h (token_t): Add tok_include.
15566
15567 2001-11-26 Akim Demaille <akim@epita.fr>
15568
15569 * src/reader.c (readgram): Make sure rules for mid-rule actions
15570 have a lineno equal to that of their host rule.
15571 Reported by Hans Aberg.
15572 * tests/regression.at (Rule Line Numbers): New.
15573
15574 2001-11-26 Akim Demaille <akim@epita.fr>
15575
15576 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
15577 size_ts.
15578
15579 2001-11-26 Akim Demaille <akim@epita.fr>
15580
15581 * src/complain.c, src/complain.h (error): Remove, provided by
15582 lib/error.[ch].
15583
15584 2001-11-26 Akim Demaille <akim@epita.fr>
15585
15586 * src/reader.c (read_declarations): Don't abort on tok_illegal,
15587 issue an error message.
15588 * tests/regression.at (Invalid %directive): New.
15589 Reported by Hans Aberg.
15590
15591 2001-11-26 Akim Demaille <akim@epita.fr>
15592
15593 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
15594 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15595
15596 2001-11-26 Akim Demaille <akim@epita.fr>
15597
15598 * src/conflicts.c (conflicts_print): Don't complain at all when
15599 there are no reduce/reduce conflicts, and as many shift/reduce
15600 conflicts as expected.
15601 * tests/regression.at (%expect right): Adjust.
15602
15603 2001-11-23 Akim Demaille <akim@epita.fr>
15604
15605 * lib/alloca.c: Update, from fileutils.
15606
15607 2001-11-23 Akim Demaille <akim@epita.fr>
15608
15609 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
15610
15611 2001-11-23 Akim Demaille <akim@epita.fr>
15612
15613 * src/system.h: Include alloca.h.
15614 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
15615
15616 2001-11-23 Akim Demaille <akim@epita.fr>
15617
15618 * src/print_graph.c (print_actions): Remove `rule', unused.
15619 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
15620 pacify GCC's signed < unsigned warnings.
15621 * src/closure.c (itemsetsize): Likewise.
15622 * src/reader.c (symbol_list_new): Static.
15623
15624 2001-11-23 Akim Demaille <akim@epita.fr>
15625
15626 Attaching lineno to buckets is stupid, since only one copy of each
15627 symbol is kept, only the line of the first occurrence is kept too.
15628
15629 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
15630 * src/reader.c (rline_allocated): Remove, unused.
15631 (symbol_list): Have a `line' member.
15632 (symbol_list_new): New.
15633 (readgram): Use it.
15634 * src/print.c (print_grammar): Output the rule line numbers.
15635 * tests/regression.at (Solved SR Conflicts)
15636 (Unresolved SR Conflicts): Adjust.
15637 Reported by Hans Aberg.
15638
15639 2001-11-22 Marc Autret <autret_m@epita.fr>
15640
15641 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
15642
15643 2001-11-22 Marc Autret <autret_m@epita.fr>
15644
15645 * src/muscle_tab.c (muscle_init): Remove initialization of
15646 skeleton muscle.
15647 * src/output.c (output_master_parser): Do it here.
15648
15649 2001-11-20 Akim Demaille <akim@epita.fr>
15650
15651 * po/sv.po: New.
15652 * configure.in (ALL_LINGUAS): Adjust.
15653 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
15654 longer contains strings to translate.
15655
15656 2001-11-19 Akim Demaille <akim@epita.fr>
15657
15658 * src/conflicts.c (conflicts_print): Add a missing \n.
15659
15660 2001-11-19 Akim Demaille <akim@epita.fr>
15661
15662 * src/nullable.c (nullable_print): New.
15663 (set_nullable): Call it when tracing.
15664 Better locality of variables.
15665
15666 2001-11-19 Akim Demaille <akim@epita.fr>
15667
15668 * src/print.c (print_actions): Better locality of variables.
15669
15670 2001-11-19 Akim Demaille <akim@epita.fr>
15671
15672 * src/derives.c (print_derives): Fix and enrich.
15673 * src/closure.c (print_fderives): Likewise.
15674
15675 2001-11-19 Akim Demaille <akim@epita.fr>
15676
15677 * src/closure.c (itemsetend): Remove, replaced with...
15678 (itemsetsize): new.
15679
15680 2001-11-19 Akim Demaille <akim@epita.fr>
15681
15682 * src/LR0.c (kernel_end): Remove, replaced with...
15683 (kernel_size): new.
15684
15685 2001-11-19 Akim Demaille <akim@epita.fr>
15686
15687 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
15688 to clarify.
15689
15690 2001-11-19 Akim Demaille <akim@epita.fr>
15691
15692 * src/closure.c (closure): Use arrays instead of pointers to clarify.
15693
15694 2001-11-19 Akim Demaille <akim@epita.fr>
15695
15696 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
15697 trace messages.
15698 * src/LR0.c: Likewise.
15699 (allocate_itemsets): Use arrays instead of pointers to clarify.
15700
15701 2001-11-19 Akim Demaille <akim@epita.fr>
15702
15703 * src/getargs.c (statistics_flag): Replace with...
15704 (trace_flag): New.
15705 (longopts): Accept --trace instead of --statistics.
15706 * src/getargs.h, src/options.c: Adjust.
15707 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
15708 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
15709
15710 2001-11-19 Akim Demaille <akim@epita.fr>
15711
15712 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
15713 pointers to clarify the code.
15714 (save_reductions, save_shifts): Factor common parts of alternatives.
15715
15716 2001-11-19 Akim Demaille <akim@epita.fr>
15717
15718 * src/LR0.c (new_state, get_state): Complete TRACE code.
15719 * src/closure.c: Include `reader.h' to get `tags', needed by the
15720 trace code.
15721 Rename the conditional DEBUG as TRACE.
15722 Output consistently TRACEs to stderr, not stdout.
15723 * src/derives.c: Likewise.
15724 * src/reduce.c: (inaccessable_symbols): Using if is better style
15725 than goto.
15726 Use `#if TRACE' instead of `#if 0' for tracing code.
15727
15728 2001-11-19 Akim Demaille <akim@epita.fr>
15729
15730 * src/system.h (LIST_FREE, shortcpy): New.
15731 * src/LR0.c: Use them.
15732 * src/output.c (free_itemsets, free_reductions, free_shifts):
15733 Remove, replaced by LIST_FREE.
15734
15735 2001-11-19 Akim Demaille <akim@epita.fr>
15736
15737 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
15738 (REDUCTIONS_ALLOC): New.
15739 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
15740 allocation.
15741
15742 2001-11-19 Akim Demaille <akim@epita.fr>
15743
15744 * src/LR0.c (new_state): Complete trace code.
15745 * src/nullable.c (set_nullable): Don't translate traces.
15746
15747 2001-11-19 Akim Demaille <akim@epita.fr>
15748
15749 * src/print_graph.c (print_core): Better locality of variables.
15750 * src/print.c (print_core): Likewise.
15751
15752 2001-11-19 Akim Demaille <akim@epita.fr>
15753
15754 * src/vcg.c: You do the output, so you are responsible of the
15755 handling of VCG syntax, in particular: use quotearg.
15756 * src/print_graph.c: Don't.
15757 (print_actions): Don't output the actions as part of the nodes,
15758 since that's the job of the edges.
15759 (print_state): Don't output by hand: fill the node description,
15760 and ask for its output.
15761
15762 2001-11-19 Akim Demaille <akim@epita.fr>
15763
15764 * src/bison.simple (yyparse): When verbosely reporting an error,
15765 no longer put additional quotes around token names.
15766 * tests/calc.at: Adjust.
15767
15768 2001-11-19 Akim Demaille <akim@epita.fr>
15769
15770 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
15771 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
15772 * src/output.c: Adjust.
15773
15774 2001-11-19 Akim Demaille <akim@epita.fr>
15775
15776 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
15777 (rule_t): this.
15778 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
15779
15780 2001-11-19 Akim Demaille <akim@epita.fr>
15781
15782 * src/gram.h (rule_t): New.
15783 (rule_table): New.
15784 (rrhs, rlhs): Remove, part of state_t.
15785 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
15786 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15787 * src/reader.c, src/reduce.c: Adjust.
15788
15789 2001-11-19 Akim Demaille <akim@epita.fr>
15790
15791 * src/reader.c (symbols_output): New, extracted from...
15792 (packsymbols): Here.
15793 (reader): Call it.
15794
15795 2001-11-19 Akim Demaille <akim@epita.fr>
15796
15797 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
15798 (maxrhs): this new function.
15799
15800 2001-11-19 Akim Demaille <akim@epita.fr>
15801
15802 * src/lalr.c (F): New macro to access the variable F.
15803 Adjust.
15804
15805 2001-11-19 Akim Demaille <akim@epita.fr>
15806
15807 * src/lalr.h (LA): New macro to access the variable LA.
15808 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15809 * src/lalr.c: Adjust.
15810
15811 2001-11-19 Akim Demaille <akim@epita.fr>
15812
15813 * src/lalr.c (initialize_LA): Only initialize LA. Let...
15814 (set_state_table): handle the `lookaheads' members.
15815
15816 2001-11-19 Akim Demaille <akim@epita.fr>
15817
15818 * src/lalr.h (lookaheads): Removed array, whose contents is now
15819 a member of...
15820 (state_t): this structure.
15821 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15822 Adjust.
15823
15824 2001-11-19 Akim Demaille <akim@epita.fr>
15825
15826 * src/lalr.h (consistent): Removed array, whose contents is now
15827 a member of...
15828 (state_t): this structure.
15829 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15830 Adjust.
15831
15832 2001-11-19 Akim Demaille <akim@epita.fr>
15833
15834 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
15835 contents are now members of...
15836 (state_t): this structure.
15837 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15838 Adjust.
15839
15840 2001-11-19 Akim Demaille <akim@epita.fr>
15841
15842 * src/lalr.h (state_t): New.
15843 (state_table): Be a state_t * instead of a core **.
15844 (accessing_symbol): Remove, part of state_t.
15845 * src/lalr.c: Adjust.
15846 (set_accessing_symbol): Merge into...
15847 (set_state_table): this.
15848 * src/print_graph.c, src/conflicts.c: Adjust.
15849
15850 2001-11-14 Akim Demaille <akim@epita.fr>
15851
15852 * tests/calc.at, tests/output.at, tests/regression.at,
15853 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
15854 now the tests are run in private dirs, therefore AC_CLEANUP and
15855 family can be simplified to 0-ary.
15856 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
15857 use abs. path to find config.h.
15858 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
15859 stderr, there can be way too much random noise.
15860 Instead pass -Werror to GCC and rely on the exit status.
15861 Reported by Wolfram Wagner.
15862
15863 2001-11-14 Akim Demaille <akim@epita.fr>
15864
15865 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
15866 defined only if yyoverflow is defined, to avoid `warning: unused
15867 variable `yyvs1''.
15868 Reported by The Test Suite.
15869
15870 2001-11-14 Akim Demaille <akim@epita.fr>
15871
15872 * src/print.c: Include reduce.h.
15873 Reported by Hans Aberg.
15874
15875 2001-11-14 Akim Demaille <akim@epita.fr>
15876
15877 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
15878 Revert a previous patch: these are really const.
15879 * src/conflicts.c (conflict_report): Additional useless pair of
15880 braces to pacify GCC's warnings for `if () if () {} else {}'.
15881 * src/lex.c (parse_percent_token): Replace equal_offset with
15882 arg_offset.
15883 arg is const.
15884 Be sure to strdup `arg' when used, since there is no reason for
15885 token_buffer not to change.
15886
15887 2001-11-14 Akim Demaille <akim@epita.fr>
15888
15889 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
15890 definition.
15891 * src/main.c (main): Use them.
15892 Suggested by Hans Aberg.
15893
15894 2001-11-12 Akim Demaille <akim@epita.fr>
15895
15896 * src/system.h (ngettext): Now that we use ngettext, be sure to
15897 provide a default definition when NLS are not used.
15898
15899 2001-11-12 Akim Demaille <akim@epita.fr>
15900
15901 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
15902 Use @kbd to denote user input.
15903 (Language and Grammar): ANSIfy the example.
15904 Adjust its layout for info/notinfo.
15905 (Location Tracking Calc): Output error messages to stderr.
15906 Output locations in a more GNUtically correct way.
15907 Fix a couple of Englishos.
15908 Adjust @group/@end group pairs.
15909
15910 2001-11-12 Akim Demaille <akim@epita.fr>
15911
15912 %expect was not functioning at all.
15913
15914 * src/conflicts.c (expected_conflicts): Set to -1.
15915 (conflict_report): Use ngettext.
15916 (conflicts_print): Check %expect and make its violation an error.
15917 * doc/bison.texinfo (Expect Decl): Adjust.
15918 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
15919 * tests/regression.at (%expect not enough, %expect right)
15920 (%expect too much): New.
15921
15922 2001-11-12 Akim Demaille <akim@epita.fr>
15923
15924 * tests/regression.at (Conflicts): Rename as...
15925 (Unresolved SR Conflicts): this.
15926 (Solved SR Conflicts): New.
15927
15928 2001-11-12 Akim Demaille <akim@epita.fr>
15929
15930 * src/reduce.c (print_results): Rename as...
15931 (reduce_output): This.
15932 Output to OUT, passed as argument, instead of output_obstack.
15933 (dump_grammar): Likewise.
15934 (reduce_free): New.
15935 Also free V1.
15936 (reduce_grammar): No longer call reduce_output, since...
15937 * src/print.c (print_results): do it.
15938 * src/main.c (main): Call reduce_free;
15939
15940 2001-11-12 Akim Demaille <akim@epita.fr>
15941
15942 * src/conflicts.c (print_reductions): Accept OUT as argument.
15943 Output to it, not to output_obstack.
15944 * src/print.c (print_actions): Adjust.
15945
15946 2001-11-12 Akim Demaille <akim@epita.fr>
15947
15948 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
15949 the result instead of using...
15950 (src_total, rrc_total, src_count, rrc_count): Remove.
15951 (any_conflicts): Remove.
15952 (print_conflicts): Split into...
15953 (conflicts_print, conflicts_output): New.
15954 * src/conflicts.h: Adjust.
15955 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
15956 * src/print.c (print_grammar): Issue `\n' between two rules.
15957 * tests/regression.at (Conflicts): New.
15958 Reported by Tom Lane.
15959
15960 2001-11-12 Akim Demaille <akim@epita.fr>
15961
15962 * tests/regression.at (Invalid input): Remove, duplicate with
15963 ``Invalid input: 1''.
15964
15965 2001-11-12 Akim Demaille <akim@epita.fr>
15966
15967 * tests/torture.at (AT_DATA_STACK_TORTURE)
15968 (Exploding the Stack Size with Alloca)
15969 (Exploding the Stack Size with Malloc): New.
15970
15971 2001-11-12 Akim Demaille <akim@epita.fr>
15972
15973 * src/bison.simple (YYSTACK_REALLOC): New.
15974 (yyparse) [!yyoverflow]: Use it and free the old stack.
15975 Reported by Per Allansson.
15976
15977 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
15978
15979 * src/bison.simple: Define type yystype instead of YYSTYPE, and
15980 define CPP macro, which substitute YYSTYPE by yystype.
15981 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
15982 with yyltype/YYLTYPE. This allows inclusion of the generated
15983 header within the parser if the compiler, such as GGC, accepts
15984 multiple equivalent #defines.
15985 From Akim.
15986
15987 2001-11-05 Akim Demaille <akim@epita.fr>
15988
15989 * src/reader.c (symbols_output): New, extracted from...
15990 (packsymbols): here.
15991 (reader): Adjust.
15992
15993 2001-11-05 Akim Demaille <akim@epita.fr>
15994
15995 * src/lex.c (parse_percent_token): s/quotearg/quote/.
15996
15997 2001-11-05 Akim Demaille <akim@epita.fr>
15998
15999 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
16000 pattern.
16001
16002 2001-11-05 Akim Demaille <akim@epita.fr>
16003
16004 * src/options.h (struct option_table_struct): set_flags is void*.
16005 * src/options.c (longopts): Support `--output' and `%output'.
16006 (usage): Adjust.
16007 * src/lex.h (tok_setopt): Remove, replaced with...
16008 (tok_intopt, tok_stropt): these new guys.
16009 * src/lex.c (getopt.h): Not needed.
16010 (token_buffer, unlexed_token_buffer): Not const.
16011 (percent_table): Promote `-' over `_' in directive names.
16012 Active `%name-prefix', `file-prefix', and `output'.
16013 (parse_percent_token): Accept possible arguments to directives.
16014 Promote `-' over `_' in directive names.
16015
16016 2001-11-04 Akim Demaille <akim@epita.fr>
16017
16018 * doc/bison.texinfo (Decl Summary): Split the list into
16019 `directives for grammars' and `directives for bison'.
16020 Sort'em.
16021 Add description of `%name-prefix', `file-prefix', and `output'.
16022 Promote `-' over `_' in directive names.
16023 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
16024 Simplify the description of `--name-prefix'.
16025 Promote `-' over `_' in directive names.
16026 Promote `--output' over `--output-file'.
16027 Fix the description of `--defines'.
16028 * tests/output.at: Exercise %file-prefix and %output.
16029
16030 2001-11-02 Akim Demaille <akim@epita.fr>
16031
16032 * doc/refcard.tex: Update.
16033
16034 2001-11-02 Akim Demaille <akim@epita.fr>
16035
16036 * src/symtab.h (SUNDEF): New.
16037 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
16038 stand for `uninitialized', instead of 0.
16039 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
16040 * src/lex.c (lex): Adjust.
16041
16042 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
16043 Number it 0.
16044 Let yylex return it instead of a plain 0.
16045 Reported by Dick Streefland.
16046
16047 2001-11-02 Akim Demaille <akim@epita.fr>
16048
16049 * tests/regression.at (Mixing %token styles): New test.
16050
16051 2001-11-02 Akim Demaille <akim@epita.fr>
16052
16053 * src/reader.c (parse_thong_decl): Formatting changes.
16054 (token_translations_init): New, extracted from...
16055 (packsymbols): Here.
16056 Adjust.
16057
16058 2001-11-01 Akim Demaille <akim@epita.fr>
16059
16060 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
16061 Check that `9foo.y' produces correct cpp guards.
16062 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
16063 guards.
16064 Reported by Wwp.
16065
16066 2001-11-01 Akim Demaille <akim@epita.fr>
16067
16068 * tests/regression.at (Invalid input: 2): New.
16069 * src/lex.c (unlexed_token_buffer): New.
16070 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
16071 too.
16072 Reported by Wwp.
16073
16074 2001-11-01 Akim Demaille <akim@epita.fr>
16075
16076 * tests/calc.at: Catch up with 1.30.
16077 * configure.in: Bump to 1.49a.
16078 Adjust to newer Autotest.
16079
16080 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
16081
16082 * src/conflicts.c: Move global variables rrc_total and src_total ...
16083 (print_conflicts): here.
16084 * src/output.c (output): Free global variable user_toknums.
16085 * src/lex.c (token_obstack): Become static.
16086
16087 2001-10-18 Akim Demaille <akim@epita.fr>
16088
16089 * tests/atlocal.in (GCC): Add.
16090 * tests/calc.at: s/m4_match/m4_bmatch/.
16091 s/m4_patsubst/m4_bpatsubst/.
16092 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
16093 * configure.in: AC_SUBST(GCC).
16094
16095 2001-10-14 Marc Autret <autret_m@epita.fr>
16096
16097 * src/options.c (create_long_option_table): Fix.
16098
16099 2001-10-10 Akim Demaille <akim@epita.fr>
16100
16101 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
16102
16103 2001-10-04 Akim Demaille <akim@epita.fr>
16104
16105 * src/reader.c (parse_union_decl): Push the caracters in
16106 union_obstack, not attrs_obstack.
16107
16108 2001-10-04 Akim Demaille <akim@epita.fr>
16109
16110 Merge in the branch 1.29.
16111
16112 * src/reader.c (packsymbols): Use a temporary obstack for
16113 `%%tokendef', since output_stack is already used elsewhere.
16114
16115 2001-10-02 Akim Demaille <akim@epita.fr>
16116
16117 Bump 1.29d.
16118
16119 2001-10-02 Akim Demaille <akim@epita.fr>
16120
16121 Version 1.29c.
16122
16123 2001-10-02 Akim Demaille <akim@epita.fr>
16124
16125 * tests/regression.at (Invalid CPP headers): New.
16126 From Alexander Belopolsky.
16127 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
16128
16129 2001-10-02 Akim Demaille <akim@epita.fr>
16130
16131 * tests/regression.at (Invalid input): New.
16132 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
16133 Reported by Shura.
16134
16135 2001-10-02 Akim Demaille <akim@epita.fr>
16136
16137 * tests/calc.at: Now that --debug works, the tests must be adjusted.
16138
16139 2001-10-02 Akim Demaille <akim@epita.fr>
16140
16141 * src/output.c (output_parser): Assert `skeleton'.
16142 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
16143 systems.
16144 From Shura.
16145
16146 2001-10-01 Marc Autret <autret_m@epita.fr>
16147
16148 * src/lex.h: Echo modifications.
16149 * src/lex.c (unlex): Parameter is now token_t.
16150 From Hans Aberg.
16151
16152 2001-10-01 Marc Autret <autret_m@epita.fr>
16153
16154 * src/main.c: Include lex.h.
16155 From Hans Aberg.
16156
16157 2001-09-29 Akim Demaille <akim@epita.fr>
16158
16159 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
16160
16161 2001-09-28 Akim Demaille <akim@epita.fr>
16162
16163 * tests/testsuite.at: Update to newer Autotest.
16164 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
16165
16166 2001-09-27 Akim Demaille <akim@epita.fr>
16167
16168 Position independent wrapper.
16169
16170 * tests/bison: Remove.
16171 * tests/bison.in: New.
16172 * configure.in: Adjust.
16173
16174 2001-09-27 Paul Eggert <eggert@twinsun.com>
16175
16176 Port quotearg fixes from tar 1.13.24.
16177
16178 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
16179 tm to be declared.
16180 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
16181 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
16182
16183 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
16184 * m4/mbrtowc.m4: New file.
16185 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
16186 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
16187
16188 2001-09-27 Akim Demaille <akim@epita.fr>
16189
16190 Bump to 1.29c.
16191
16192 2001-09-27 Akim Demaille <akim@epita.fr>
16193
16194 Version 1.29b.
16195
16196 2001-09-25 Akim Demaille <akim@epita.fr>
16197
16198 * src/system.h: Include `xalloc.h'.
16199 Remove it from the C files.
16200 * src/files.c (output_files): Free the obstacks.
16201 * src/lex.c (init_lex): Rename as...
16202 (lex_init): this.
16203 (lex_free): New.
16204 * src/main.c (main): Use it.
16205
16206 2001-09-24 Marc Autret <autret_m@epita.fr>
16207
16208 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
16209 to output informations in fout (FILE*).
16210 (open_graph, close_graph): Likewise.
16211 (output_graph, output_edge, output_node): Likewise.
16212 * src/vcg.h: Update function prototypes.
16213 * src/print_graph.c (print_graph): Open output graph file.
16214 (print_actions): Adjust.
16215 * src/files.h: Remove extern declaration.
16216 * src/files.c: Remove graph_obstack declaration.
16217 (open_files): Remove graph_obstack initialization.
16218 (output_files): Remove graph_obstack saving.
16219
16220 2001-09-24 Marc Autret <autret_m@epita.fr>
16221
16222 * src/files.c (compute_output_file_names): Fix.
16223
16224 2001-09-24 Marc Autret <autret_m@epita.fr>,
16225 Akim Demaille <akim@epita.fr>
16226
16227 * src/reader.c (reader): Remove call to free_symtab ().
16228 * src/main.c (main): Call it here.
16229 Include symtab.h.
16230 * src/conflicts.c (initialize_conflicts): Rename as...
16231 (solve_conflicts): this.
16232 * src/print.c (print_core, print_actions, print_state)
16233 (print_grammar): Dump to a file instead a `output_obstack'.
16234 (print_results): Dump `output_obstack', and then proceed with the
16235 FILE *.
16236 * src/files.c (compute_output_file_names, close_files): New.
16237 (output_files): Adjust.
16238 * src/main.c (main): Adjust.
16239
16240 2001-09-23 Marc Autret <autret_m@epita.fr>
16241
16242 * src/files.c (compute_header_macro): Computes header macro name
16243 from spec_defines_file when given.
16244
16245 2001-09-23 Marc Autret <autret_m@epita.fr>
16246
16247 * src/files.c (output_files): Add default extensions.
16248
16249 2001-09-22 Akim Demaille <akim@epita.fr>
16250
16251 * src/conflicts.c (finalize_conflicts): Rename as...
16252 (free_conflicts): this.
16253
16254 2001-09-22 Akim Demaille <akim@epita.fr>
16255
16256 * src/gram.c (gram_free): Rename back as...
16257 (dummy): this.
16258 (output_token_translations): Free `token_translations'.
16259 * src/symtab.c (free_symtab): Free the tag field.
16260
16261 2001-09-22 Akim Demaille <akim@epita.fr>
16262
16263 Remove `translations' as it is always set to true.
16264
16265 * src/gram.h: Adjust.
16266 * src/reader.c (packsymbols, parse_token_decl): Adjust
16267 * src/print.c (print_grammar): Adjust.
16268 * src/output.c (output_token_translations): Adjust.
16269 * src/lex.c (lex): Adjust.
16270 * src/gram.c: Be sure the set pointers to NULL.
16271 (dummy): Rename as...
16272 (gram_free): this.
16273
16274 2001-09-22 Akim Demaille <akim@epita.fr>
16275
16276 * configure.in: Invoke AM_LIB_DMALLOC.
16277 * src/system.h: Use dmalloc.
16278 * src/LR0.c: Be sure to have pointers initialized to NULL.
16279 (allocate_itemsets): Allocate kernel_items only if needed.
16280
16281 2001-09-22 Akim Demaille <akim@epita.fr>
16282
16283 * configure.in: Bump to 1.29b.
16284 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
16285 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
16286 need xmalloc.c in calc.y.
16287 From Pascal Bart.
16288
16289 2001-09-21 Akim Demaille <akim@epita.fr>
16290
16291 Version 1.29a.
16292 * Makefile.maint, config/config.guess, config/config.sub,
16293 * config/missing: Update from masters.
16294 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
16295 upon package.m4.
16296 * configure.in (ALL_LINGUAS): Add `tr'.
16297
16298 2001-09-21 Akim Demaille <akim@epita.fr>
16299
16300 * tests/Makefile.am (package.m4): Move to...
16301 ($(srcdir)/$(TESTSUITE)): here.
16302
16303 2001-09-20 Akim Demaille <akim@epita.fr>
16304
16305 * src/complain.c: No longer try to be standalone: use system.h.
16306 Don't assume __STDC__ is defined to 1. Just test if it is defined.
16307 * src/complain.h: Likewise.
16308 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
16309 Remove the unused variable `n'.
16310 From Albert Chin-A-Young.
16311
16312 2001-09-18 Marc Autret <autret_m@epita.fr>
16313
16314 * doc/bison.1: Update.
16315 * doc/bison.texinfo (Bison Options): Update --defines and --graph
16316 descriptions.
16317 (Option Cross Key): Update.
16318 Add --graph.
16319
16320 2001-09-18 Marc Autret <autret_m@epita.fr>
16321
16322 * tests/regression.at: New test (comment in %union).
16323
16324 2001-09-18 Marc Autret <autret_m@epita.fr>
16325
16326 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
16327 do that.
16328 Reported by Keith Browne.
16329
16330 2001-09-18 Marc Autret <autret_m@epita.fr>
16331
16332 * tests/output.at: Add tests for --defines and --graph.
16333
16334 2001-09-18 Marc Autret <autret_m@epita.fr>
16335
16336 * tests/output.at: Removes tests of %{header,src}_extension features.
16337
16338 2001-09-18 Akim Demaille <akim@epita.fr>
16339
16340 * tests/Makefile.am (package.m4): New.
16341 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
16342 (_AT_CHECK_CALC_ERROR): Likewise.
16343 Factor the `, ' part of verbose error messages.
16344
16345 2001-09-18 Marc Autret <autret_m@epita.fr>
16346
16347 * src/getargs.c (longopts): Declare --defines and --graph as options
16348 with optional arguments.
16349 * src/files.h: Add extern declarations.
16350 * src/files.c (spec_graph_file, spec_defines_file): New.
16351 (output_files): Update.
16352 Remove CPP-outed code.
16353
16354 2001-09-18 Marc Autret <autret_m@epita.fr>
16355
16356 Turn off %{source,header}_extension feature.
16357
16358 * src/files.c (compute_exts_from_gf): Update.
16359 (compute_exts_from_src): Update.
16360 (output_files): CPP-out useless code.
16361 * src/files.h: Remove {header,source}_extension extern declarations.
16362 * src/reader.c (parse_dquoted_param): CPP-out.
16363 (parse_header_extension_decl): Remove.
16364 (parse_source_extension_decl): Remove.
16365 (read_declarations): Remove cases tok_{hdrext,srcext}.
16366 * src/lex.c (percent_table): Remove {header,source}_extension entries.
16367 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
16368
16369 2001-09-10 Akim Demaille <akim@epita.fr>
16370
16371 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
16372 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
16373 (AT_CHECK_OUTPUT): this.
16374 Merely check ls' exit status, its output is useless.
16375
16376 2001-09-10 Akim Demaille <akim@epita.fr>
16377
16378 * tests/calc.at: Use m4_match.
16379 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
16380
16381 2001-09-10 Marc Autret <autret_m@epita.fr>,
16382 Akim Demaille <akim@epita.fr>
16383
16384 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
16385 enum color_e.
16386 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
16387 to `normal'.
16388 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
16389 * src/lex.h: Adjust prototype.
16390 (token_t): Add `tok_undef'.
16391 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
16392 (parse_percent_token): Now returns token_t.
16393 Add default statement in switch.
16394 (lex): Separate `c' as an input variable, from the token_t result
16395 part.
16396 (unlexed): Is a token_t.
16397
16398 2001-09-10 Akim Demaille <akim@epita.fr>
16399
16400 * configure.in: Bump to 1.29a.
16401
16402 2001-09-07 Akim Demaille <akim@epita.fr>
16403
16404 Version 1.29.
16405
16406 2001-08-30 Akim Demaille <akim@epita.fr>
16407
16408 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
16409 * m4/atconfig.m4: Remove.
16410 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
16411 * tests/bison: New.
16412 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
16413 m4_if, m4_patsubst, and m4_regexp.
16414 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
16415 `input' file instead of echo.
16416
16417 2001-08-29 Akim Demaille <akim@epita.fr>
16418
16419 Bump to 1.28e.
16420
16421 2001-08-29 Akim Demaille <akim@epita.fr>
16422
16423 Version 1.28d.
16424
16425 2001-08-29 Paul Eggert <eggert@twinsun.com>
16426
16427 * src/bison.simple (yyparse): Don't take the address of an
16428 item before the start of an array, as that doesn't conform to
16429 the C Standard.
16430
16431 2001-08-29 Robert Anisko <anisko_r@epita.fr>
16432
16433 * doc/bison.texinfo (Location Tracking Calc): New node.
16434
16435 2001-08-29 Paul Eggert <eggert@twinsun.com>
16436
16437 * src/output.c (output): Do not define const, as this now
16438 causes more problems than it cures.
16439
16440 2001-08-29 Akim Demaille <akim@epita.fr>
16441
16442 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
16443 the nodes.
16444 Be sure to tag the `detailmenu'.
16445
16446 2001-08-29 Akim Demaille <akim@epita.fr>
16447
16448 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
16449 download in a tmp dir.
16450
16451 2001-08-28 Marc Autret <autret_m@epita.fr>
16452
16453 * config/depcomp: New file.
16454
16455 2001-08-28 Marc Autret <autret_m@epita.fr>
16456
16457 * doc/bison.1 (mandoc): Adjust.
16458 From Juan Manuel Guerrero.
16459
16460 2001-08-28 Marc Autret <autret_m@epita.fr>
16461
16462 * src/print_graph.c (print_state): Fix.
16463
16464 2001-08-27 Marc Autret <autret_m@epita.fr>
16465
16466 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
16467 char * members.
16468 Echo modifications to the functions prototypes.
16469 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
16470
16471 2001-08-27 Marc Autret <autret_m@epita.fr>
16472
16473 * src/vcg.c: Include `xalloc.h'.
16474 (add_colorentry): New.
16475 (add_classname): New.
16476 (add_infoname): New.
16477 * src/vcg.h: Add new prototypes.
16478
16479 2001-08-27 Akim Demaille <akim@epita.fr>
16480
16481 * Makefile.maint: Sync. again with CVS Autoconf.
16482
16483 2001-08-27 Akim Demaille <akim@epita.fr>
16484
16485 * Makefile.maint: Formatting changes.
16486 (po-update, cvs-update, update): New targets.
16487 (AMTAR): Remove.
16488
16489 2001-08-27 Akim Demaille <akim@epita.fr>
16490
16491 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16492 * Makefile.maint: Sync. with CVS Autoconf.
16493
16494 2001-08-27 Marc Autret <autret_m@epita.fr>
16495
16496 * src/vcg.h (struct infoname_s): New.
16497 (struct colorentry_s): New.
16498 (graph_s): New fields {vertical,horizontal}_order in structure.
16499 Add `infoname' field.
16500 Add `colorentry' field;
16501 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
16502 (G_HORIZONTAL_ORDER): New.
16503 (G_INFONAME): New.
16504 (G_COLORENTRY): New.
16505 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
16506 Add output of `infoname'.
16507 Add output of `colorentry'.
16508
16509 2001-08-27 Marc Autret <autret_m@epita.fr>
16510
16511 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
16512 This one shadowed a global parameter.
16513
16514 2001-08-24 Marc Autret <autret_m@epita.fr>
16515
16516 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
16517 instead of `unsigned'.
16518 (print_state): Do not call obstack_object_size () in obstack_grow ()
16519 to avoid macro variables shadowing.
16520
16521 2001-08-23 Marc Autret <autret_m@epita.fr>
16522
16523 * src/lex.c (percent_table): Typo: s/naem/name/.
16524 Add graph option.
16525 Normalize new options declarations.
16526
16527 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
16528
16529 * tests/suite.at: Exercise %header_extension and %source_extension.
16530
16531 2001-08-16 Marc Autret <autret_m@epita.fr>
16532
16533 * src/reader.c (parse_dquoted_param): New.
16534 (parse_header_extension_decl): Use it.
16535 (parse_source_extension_decl): Likewise.
16536
16537 2001-08-16 Marc Autret <autret_m@epita.fr>
16538
16539 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
16540 (get_xxxx_str): Use assert () instead of complain ().
16541 Remove return invokations in default cases.
16542 (get_decision_str): Modify default behaviour. Remove second argument.
16543 Echo modifications on calls.
16544 (output_graph): Fix.
16545
16546 2001-08-16 Marc Autret <autret_m@epita.fr>
16547
16548 * src/getargs.c (usage): Update with ``-g, --graph''.
16549
16550 2001-08-16 Marc Autret <autret_m@epita.fr>
16551
16552 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
16553 (Option Cross Key): Likewise.
16554 * doc/bison.1: Update.
16555
16556 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
16557
16558 * src/output.c (output_master_parser): Don't finish action_obstack.
16559 (output_parser): Don't care about the muscle action, here.
16560 (prepare): Copy the action_obstack in the action muscle.
16561 (output): Free action_obstack.
16562
16563 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
16564
16565 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
16566 will contain `%union' declaration.
16567 (parse_union_decl): Delete #line directive output.
16568 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
16569 informations about %union.
16570 (parse_union_decl): Copy the union_obstack in the muscle stype.
16571 * src/bison.simple: Add new #line directive.
16572 Add typdef %%stype YYSTYPE.
16573
16574 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
16575
16576 * src/bison.simple: Add new `#line' directive.
16577
16578 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
16579
16580 * src/bison.simple: New `#line' directive.
16581 * src/output.c (output_parser): Support new dynamic muscle input_line.
16582
16583 2001-09-22 Marc Autret <autret_m@epita.fr>
16584
16585 * src/output.c (output_master_parser): New.
16586 (output_parser): Be more re-entrant.
16587
16588 2001-09-21 Marc Autret <autret_m@epita.fr>
16589
16590 * src/reader.c (copy_definition, parse_union_decl): Update and use
16591 `linef' muscle.
16592 (copy_action): Likewise.
16593 Use obstack_1grow ().
16594 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
16595
16596 2001-09-21 Marc Autret <autret_m@epita.fr>
16597
16598 * src/options.c (option_table): Adjust.
16599 * src/lex.c (parse_percent_token): Fix.
16600
16601 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
16602
16603 * src/options.c (symtab.h): Include it, need by lex.h.
16604
16605 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
16606
16607 * src/lex.c (parse_percent_token): Change type of variable `tx', which
16608 is now an option_table_struct*.
16609 (option_strcmp): New function option_strcmp.
16610 (parse_percent_token): Call option_strcmp.
16611 * src/getargs.c (xalloc.h, options.h): Include it.
16612 (getargs): Call create_long_option_table.
16613 (getargs): Free longopts at the end of the function.
16614 (shortopts): Move in options.c.
16615 * src/options.c (create_long_option_table): New function. Convert
16616 information from option_table to option structure.
16617 * src/reader.c (options.h): Include it.
16618
16619 * src/Makefile.am: Adjust.
16620 * src/options.c (option_table): Create from longopts and percent_table.
16621 * src/getargs.c (longopts): Delete.
16622 * src/lex.c (struct percent_table_struct): Delete.
16623 (percent_table): Delete.
16624 (options.h): Include it.
16625 * src/options.c: Create.
16626 * src/options.h: Create.
16627 Declare enum opt_access_e.
16628 Define struct option_table_struct.
16629
16630 2001-09-20 Marc Autret <autret_m@epita.fr>
16631
16632 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
16633 sections of Bison.
16634
16635 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
16636
16637 * src/bison.simple: s/%%filename/%%skeleton.
16638 * src/muscle_tab.c (getargs.h): Include it.
16639 (muscle_init): Insert new muscle skeleton.
16640
16641 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
16642
16643 * src/output.c (output_parser): Delete unused variable actions_dumped.
16644
16645 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
16646
16647 * src/output.c (output): Delete call to reader_output_yylsp.
16648 * src/reader.c (reader): Likewise.
16649 * src/reader.h: Delete declaration of reader_output_yylsp.
16650
16651 2001-09-02 Marc Autret <autret_m@epita.fr>
16652
16653 * src/reader.c: Include muscle_tab.h.
16654 (parse_union_decl): Update.
16655 (parse_macro_decl): Rename parse_muscle_decl.
16656 Update to use renamed functions and variable.
16657 (read_declarations, copy_action, read_additionnal_code, : Updated
16658 with correct variables and functions names.
16659 (packsymbols, reader): Likewise.
16660
16661 * src/reader.h (muscle_obstack): Extern declaration update.
16662
16663 * src/output.c: Include muscle_tab.h
16664 In all functions using macro_insert, change by using muscle_insert ().
16665 (macro_obstack): Rename muscle_obstack.
16666 Echo modifications in the whole file.
16667 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
16668 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
16669 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
16670
16671 * src/muscle_tab.h: Update double inclusion macros.
16672 (macro_entry_s): Rename muscle_entry_s.
16673 Update prototypes.
16674
16675 * src/muscle_tab.c: Include muscle_tab.h.
16676 Rename macro_tabble to muscle_table.
16677 (mhash1, mhash2, mcmp): Use muscle_entry.
16678 (macro_init): Rename muscle_init. Update.
16679 (macro_insert): Rename muscle_insert. Update.
16680 (macro_find): Rename muscle_find. Update.
16681
16682 * src/main.c: Include muscle_tab.h.
16683 (main): Call muscle_init ().
16684 * src/Makefile.am (bison_SOURCES): Echo modifications.
16685
16686 2001-09-02 Marc Autret <autret_m@epita.fr>
16687
16688 Now the files macro_tab.[ch] are named muscle_tab.[ch].
16689
16690 * src/muscle_tab.c, src/muscle_tab.h: Add files.
16691
16692 2001-09-02 Marc Autret <autret_m@epita.fr>
16693
16694 * src/macrotab.c, src/macrotab.h: Remove.
16695
16696 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
16697
16698 * src/reader.c (copy_guard): Use muscle to specify the `#line'
16699 filename.
16700
16701 2001-09-01 Marc Autret <autret_m@epita.fr>
16702
16703 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
16704 to an explicit value to activate the feature. We do it here.
16705
16706 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16707
16708 * src/output.c (prepare): Delete the `filename' muscule insertion.
16709 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
16710 (parse_union_decl): Likewise.
16711 * src/macrotab.c (macro_init): Initialize filename by infile.
16712
16713 2001-08-31 Marc Autret <autret_m@epita.fr>
16714
16715 * src/bison.simple (YYLSP_NEEDED): New definition.
16716 * src/output.c (prepare): Add macro insertion of `locations_flag'
16717
16718 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16719
16720 * src/output.c (prepare): Delete insertion of previous muscles,
16721 and insert the `prefix' muscles.
16722 * src/macrotab.c (macro_init): Likewise.
16723 (macro_init): Initialization prefix directive by `yy'.
16724 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
16725 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
16726 yylval, yydebug, yyerror, yynerrs and yyparse.
16727 New directive `#define' to substitute yydebug, ... with option
16728 name_prefix.
16729
16730 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16731
16732 * src/main.c (main): Standardize.
16733 * src/output.c (output_table_data, output_parser): Likewise.
16734 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
16735
16736 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
16737
16738 * src/reader.c (read_additionnal_code): Rename %%user_code to
16739 %%epilogue.
16740 * src/output.c (output): Rename %%declarations to %%prologue.
16741 * src/bison.simple: Echo modifications.
16742
16743 2001-08-31 Marc Autret <autret_m@epita.fr>
16744
16745 * src/reader.c (readgram): CleanUp.
16746 (output_token_defines): Likewise.
16747 (packsymbols): Likewise.
16748 (reader): Likewise.
16749 * src/output.c (output): CPP-out useless code.
16750
16751 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16752
16753 * src/reader.c (reader): Delete obsolete call to function
16754 output_trailers and output_headers.
16755 * src/output.h: Remove obsolete functions prototypes of output_headers
16756 and output_trailers.
16757
16758 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
16759
16760 * src/main.c: Include macrotab.h.
16761 * src/macrotab.h (macro_entry_s): Constify fields.
16762 Adjust functions prototypes.
16763 * src/macrotab.c (macro_insert): Constify key and value.
16764 (macro_find): Constify key.
16765 (macro_insert): Include 'xalloc.h'
16766 (macro_insert): Use XMALLOC.
16767 (macro_find): Constify return value.
16768 * src/output.c (output_table_data): Rename table to table_data.
16769 (output_parser): Constify macro_key, macro_value.
16770
16771 2001-08-30 Marc Autret <autret_m@epita.fr>
16772
16773 * src/reader.c (parse_skel_decl): New.
16774 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
16775 * src/lex.h (token_t): New token `tok_skel'.
16776 * src/lex.c (percent_table): Add skeleton option entry.
16777 Standardize.
16778
16779 2001-08-29 Marc Autret <autret_m@epita.fr>
16780
16781 * src/bison.simple: Add %%user_code directive at the end.
16782 * src/reader.c (read_additionnal_code): New.
16783 (reader): Use it.
16784 * src/output.c (output_program): Remove.
16785 (output): Update.
16786
16787 2001-08-28 Marc Autret <autret_m@epita.fr>
16788
16789 * src/output.c (output_actions): Clean up.
16790 (output_gram): CPP-out useless code.
16791 * src/reader.c (reader): Clean up, CPP-out useless code.
16792
16793 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
16794
16795 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
16796 directive.
16797 * src/bison.simple: Add `%%definitions'.
16798
16799 2001-08-28 Marc Autret <autret_m@epita.fr>
16800
16801 * config/depcomp: New file.
16802
16803 2001-08-27 Paul Eggert <eggert@twinsun.com>
16804
16805 * src/bison.simple (yyparse): Don't take the address of an
16806 item before the start of an array, as that doesn't conform to
16807 the C Standard.
16808
16809 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
16810
16811 * src/output.c (output): Remove the initialization of the macro
16812 obstack. It was done too late here.
16813
16814 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
16815 completely wrong.
16816 (reader): Initialize the macro obstack here, since we need it to grow
16817 '%define' directives.
16818
16819 * src/reader.h: Declare the macro obstack as extern.
16820
16821 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
16822
16823 * src/output.c (output_parser): Fix. Store single '%' characters in
16824 the output obstack instead of throwing them away.
16825
16826 2001-08-27 Akim Demaille <akim@epita.fr>
16827
16828 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16829
16830 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16831
16832 * lib/Makefile.am: Adjust.
16833
16834 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16835
16836 * src/bison.simple: Update and add '%%' directives.
16837
16838 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16839
16840 * src/reader.c (reader): Remove calls to 'output_headers' and
16841 'output_trailers'. Remove some C output.
16842 (readgram): Disable a piece of code that was writing a default
16843 definition for 'YYSTYPE'.
16844 (reader_output_yylsp): Remove.
16845 (packsymbols): Output token defintions to a macro.
16846 (copy_definition): Disable C output.
16847
16848 * src/reader.c (parse_macro_decl): New function used to parse macro
16849 declarations.
16850 (copy_string2): Put the body of copy_string into this new function.
16851 Add a parameter to let the caller choose whether he wants to copy the
16852 string delimiters or not.
16853 (copy_string): Be a simple call to copy_string2 with the last argument
16854 bound to true.
16855 (read_declarations): Add case for macro definition.
16856 (copy_identifier): New.
16857 (parse_macro_decl): Read macro identifiers using copy_identifier
16858 rather than lex.
16859
16860 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16861
16862 * src/output.c (prepare): Add prefixed names.
16863 (output_parser): Output semantic actions.
16864 (output_parser): Fix bug on '%%line' directives.
16865
16866 * src/output.c (output_headers): Remove. The C code printed by this
16867 function should now be in the skeletons.
16868 (output_trailers): Remove.
16869 (output): Disable call to 'reader_output_yylsp'.
16870 (output_rule_data): Do not output tables to the table obstack.
16871
16872 * src/output.c: Remove some C dedicated output.
16873 Improve the use of macro and output obstacks.
16874 (output_defines): Remove.
16875
16876 * src/output.c (output_token_translations): Associate 'translate'
16877 table with a macro. No output to the table obstack.
16878 (output_gram): Same for 'rhs' and 'prhs'.
16879 (output_stos): Same for 'stos'.
16880 (output_rule_data): Same for 'r1' and 'r2'.
16881 (token_actions): Same for 'defact'.
16882 (goto_actions): Same for 'defgoto'.
16883 (output_base): Same for 'pact' and 'pgoto'.
16884 (output_table): Same for 'table'.
16885 (output_check): Same for 'check'.
16886
16887 * src/output.c (output_table_data): New function.
16888 (output_short_table): Remove.
16889 (output_short_or_char_table): Remove.
16890
16891 * src/output.c (output_parser): Replace most of the skeleton copy code
16892 with something new. Skeletons are now processed character by character
16893 rather than line by line, and Bison looks for '%%' macros. This is the
16894 first step in making Bison's output process (a lot) more flexible.
16895 (output_parser): Use the macro table.
16896
16897 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16898
16899 * src/main.c (main): Initialize the macro table.
16900
16901 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16902
16903 * src/lex.c (percent_table): Add tok_define.
16904 * src/lex.h: Add tok_define.
16905
16906 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16907
16908 * src/macrotab.c: New file.
16909 * src/macrotab.h: New file.
16910 * src/Makefile.am: Update.
16911
16912 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16913
16914 * lib/hash.c: New file.
16915 * lib/hash.h: New file.
16916 * lib/Makefile.am: Update.
16917
16918 2001-08-15 Akim Demaille <akim@epita.fr>
16919
16920 Version 1.28c.
16921
16922 2001-08-15 Marc Autret <autret_m@epita.fr>
16923
16924 * src/reader.c (readgram): Indent output macro YYSTYPE.
16925 (packsymbols): Likewise.
16926 (output_token_defines): Likewise.
16927 * src/files.c: Standardize.
16928 (compute_header_macro): New.
16929 (defines_obstack_save): New. Use compute_header_macro.
16930 (output_files): Update. Use defines_obstack_save.
16931
16932 2001-08-15 Akim Demaille <akim@epita.fr>
16933
16934 * doc/bison.texinfo (Table of Symbols): Document
16935 YYSTACK_USE_ALLOCA.
16936
16937 2001-08-15 Akim Demaille <akim@epita.fr>
16938
16939 * missing: Update from CVS Automake.
16940 * config/config.guess, config/config.sub, config/texinfo.tex:
16941 Update from gnu.org.
16942
16943 2001-08-15 Akim Demaille <akim@epita.fr>
16944
16945 * Makefile.maint: Sync with CVS Autoconf.
16946
16947 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
16948
16949 * doc/bison.texinfo: Include GNU Free Documentation License from
16950 `fdl.texi'.
16951 * doc/fdl.texi: Add to package.
16952
16953 2001-08-14 Marc Autret <autret_m@epita.fr>
16954
16955 Turn on %{source,header}_extension features.
16956
16957 * src/lex.c (percent_table): Un-CPP out header_extension and
16958 source_extension.
16959 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
16960 (compute_exts_from_src): Remove conditions. It restores priorities
16961 between options.
16962
16963 2001-08-14 Marc Autret <autret_m@epita.fr>
16964
16965 * src/files.c (compute_base_names): Add extensions computing when
16966 `--file-prefix' used.
16967 Standardize function calls.
16968
16969 2001-08-13 Marc Autret <autret_m@epita.fr>
16970
16971 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
16972 defining it (defined but null disables alloca).
16973
16974 2001-08-13 Marc Autret <autret_m@epita.fr>
16975
16976 * src/bison.simple (_yy_memcpy): CPP reformat.
16977
16978 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
16979
16980 * tests/atconfig.in (CPPFLAGS): Fix.
16981
16982 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
16983
16984 * doc/bison.texinfo: Include GNU General Public License from
16985 `gpl.texi'.
16986 * doc/gpl.texi: Add to package.
16987
16988 2001-08-10 Marc Autret <autret_m@epita.fr>
16989
16990 * src/print_graph.h: Fix.
16991 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
16992
16993 2001-08-10 Akim Demaille <akim@epita.fr>
16994
16995 * src/system.h: Provide default declarations for stpcpy, strndup,
16996 and strnlen.
16997
16998 2001-08-10 Robert Anisko <anisko_r@epita.fr>
16999
17000 * doc/bison.texinfo (Locations): Update @$ stuff.
17001
17002 2001-08-09 Robert Anisko <anisko_r@epita.fr>
17003
17004 * src/bison.simple (YYLLOC_DEFAULT): Update.
17005 (yyparse): Adjust.
17006
17007 2001-08-08 Marc Autret <autret_m@epita.fr>
17008
17009 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
17010 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
17011 Reported by Fabrice Bauzac.
17012
17013 2001-08-08 Marc Autret <autret_m@epita.fr>
17014
17015 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
17016 * src/vcg.c (output_node): Fix.
17017 * src/vcg.h: Cleanup.
17018 * src/print_graph.c: Add comments.
17019 (node_output_size): New global variable. Simplify the formatting of
17020 the VCG graph output.
17021 (print_actions): Unused code is now used. It notifies the final state
17022 and no action states in the VCG graph. It also give the reduce actions.
17023 The `shift and goto' edges are red and the `go to state' edges are
17024 blue.
17025 Get the current node name and node_obstack by argument.
17026 (node_obstack): New variable.
17027 (print_state): Manage node_obstack.
17028 (print_core): Use node_obstack given by argument.
17029 A node is not only computed here but in print_actions also.
17030 (print_graph): CPP out useless code instead of commenting it.
17031
17032 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
17033
17034 * tests/atconfig.in (CPPFLAGS): Fix.
17035
17036 2001-08-07 Akim Demaille <akim@epita.fr>
17037
17038 * src/print_graph.c (quote): New.
17039 (print_core): Use it.
17040
17041 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
17042
17043 * src/vcg.c (complain.h): Include it.
17044 Unepitaize `return' invocations.
17045 [NDEBUG] (main): Remove.
17046 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
17047 * src/files.c (open_files): Initialize graph_obstack.
17048 * src/print_graph.c (print_actions): CPP out useless code.
17049 (print_core): Don't output the last `\n' in labels.
17050 Use `quote'.
17051 * src/files.c (output_files): Output the VCG file.
17052 * src/main.c (main): Invoke print_graph ();
17053
17054 2001-08-06 Marc Autret <autret_m@epita.fr>
17055
17056 Automaton VCG graph output.
17057 Using option ``-g'' or long option ``--graph'', you can generate
17058 a gram_filename.vcg file containing a VCG description of the LALR (1)
17059 automaton of your grammar.
17060
17061 * src/main.c: Call to print_graph() function.
17062 * src/getargs.h: Update.
17063 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
17064 (graph_flag): New flag.
17065 (longopts): Update.
17066 (getargs): Add case `g'.
17067 * src/files.c (graph_obstack): New obstack struct.
17068 (open_files): Initialize new obstack.
17069 (output_files): Saves graph_obstack if required.
17070 * src/files.h (graph_obstack): New extern declaration.
17071 * src/Makefile.am: Add new source files.
17072
17073 2001-08-06 Marc Autret <autret_m@epita.fr>
17074
17075 * src/print_graph.c, src/print_graph.h (graph): New.
17076 * src/vcg.h: New file.
17077 * src/vcg.c: New file, VCG graph handling.
17078
17079 2001-08-06 Marc Autret <autret_m@epita.fr>
17080
17081 Add of %source_extension and %header_extension which specify
17082 the source or/and the header output file extension.
17083
17084 * src/files.c (compute_base_names): Remove initialisation of
17085 src_extension and header_extension.
17086 (compute_exts_from_gf): Update.
17087 (compute_exts_from_src): Update.
17088 (output_files): Update.
17089 * src/reader.c (parse_header_extension_decl): New.
17090 (parse_source_extension_decl): New.
17091 (read_declarations): New case statements for the new tokens.
17092 * src/lex.c (percent_table): Add entries for %source_extension
17093 and %header_extension.
17094 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
17095
17096 2001-08-06 Marc Autret <autret_m@epita.fr>
17097
17098 * configure.in: Bump to 1.28c.
17099 * doc/bison.texinfo: Texinfo thingies.
17100
17101 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
17102
17103 * tests/atconfig.in (CPPFLAGS): Add.
17104 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
17105
17106 2001-08-03 Akim Demaille <akim@epita.fr>
17107
17108 Version 1.28b.
17109
17110 2001-08-03 Akim Demaille <akim@epita.fr>
17111
17112 * tests/Makefile.am (check-local): Ship testsuite.
17113 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
17114 Include `string.h'.
17115
17116 2001-08-03 Akim Demaille <akim@epita.fr>
17117
17118 * configure.in: Try using -Wformat when compiling.
17119
17120 2001-08-03 Akim Demaille <akim@epita.fr>
17121
17122 * configure.in: Bump to 1.28b.
17123
17124 2001-08-03 Akim Demaille <akim@epita.fr>
17125
17126 * src/complain.c: Adjust strerror_r portability issues.
17127
17128 2001-08-03 Akim Demaille <akim@epita.fr>
17129
17130 Version 1.28a.
17131
17132 2001-08-03 Akim Demaille <akim@epita.fr>
17133
17134 * src/getargs.c, src/getarg.h (skeleton)): Constify.
17135 * src/lex.c (literalchar): Avoid name clashes on `buf'.
17136 * src/getargs.c: Include complain.h.
17137 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
17138 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
17139
17140 2001-08-03 Akim Demaille <akim@epita.fr>
17141
17142 * src/reader.c (readgram): Display hidden chars in error messages.
17143
17144 2001-08-03 Akim Demaille <akim@epita.fr>
17145
17146 Update to gettext 0.10.39.
17147
17148 2001-08-03 Akim Demaille <akim@epita.fr>
17149
17150 * lib/strspn.c: New.
17151
17152 2001-08-01 Marc Autret <autret_m@epita.fr>
17153
17154 * doc/bison.texinfo: Update.
17155 * doc/bison.1 (mandoc): Update.
17156 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
17157 * src/files.c: Support output files extensions computing.
17158 (src_extension): New static variable.
17159 (header_extension): New static variable.
17160 (tr): New function.
17161 (get_extension_index): New function, gets the index of an extension
17162 filename in a string.
17163 (compute_exts_from_gf): New function, computes extensions from the
17164 grammar file extension.
17165 (compute_exts_from_src): New functions, computes extensions from the
17166 C source file extension, file given by ``-o'' option.
17167 (compute_base_names): Update.
17168 (output_files): Update.
17169
17170 2001-08-01 Robert Anisko <anisko_r@epita.fr>
17171
17172 * doc/bison.texi: Document @$.
17173 (Locations): New section.
17174
17175 2001-07-18 Akim Demaille <akim@epita.fr>
17176
17177 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
17178 * config/prev-version.txt, config/move-if-change: New.
17179 * Makefile.am: Adjust.
17180
17181 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
17182
17183 * src/bison.simple (yyparse): Suppress warning `comparaison
17184 between signed and unsigned'.
17185
17186 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
17187
17188 * src/getargs.h (raw_flag): Remove.
17189 * src/getargs.c: Die on `-r'/`--raw'.
17190 * src/lex.c (parse_percent_token): Die on `%raw'.
17191 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
17192 * tests/calc.at: Suppress test with option `--raw'.
17193
17194 2001-07-14 Akim Demaille <akim@epita.fr>
17195
17196 * config/: New.
17197 * configure.in: Require Autoconf 2.50.
17198 Update to gettext 0.10.38.
17199
17200 2001-03-16 Akim Demaille <akim@epita.fr>
17201
17202 * doc/bison.texinfo: ANSIfy the examples.
17203
17204 2001-03-16 Akim Demaille <akim@epita.fr>
17205
17206 * getargs.c (skeleton): New variable.
17207 (longopts): --skeleton is a new option.
17208 (shortopts, getargs): -S is a new option.
17209 * getargs.h: Declare skeleton.
17210 * output.c (output_parser): Use it.
17211
17212 2001-03-16 Akim Demaille <akim@epita.fr>
17213
17214 * m4/strerror_r.m4: New.
17215 * m4/error.m4: Run AC_FUNC_STRERROR_R.
17216 * lib/error.h, lib/error.c: Update.
17217
17218 2001-03-16 Akim Demaille <akim@epita.fr>
17219
17220 * src/getargs.c (longopts): Clean up.
17221
17222 2001-02-21 Akim Demaille <akim@epita.fr>
17223
17224 * src/reader.c (gensym): `gensym_count' is your own.
17225 Use a static buf to create the symbol name, as token_buffer is no
17226 longer a buffer.
17227
17228 2001-02-08 Akim Demaille <akim@epita.fr>
17229
17230 * src/conflicts.c (conflict_report): Be sure not to append to res
17231 between two calls, which could happen if both first sprintf were
17232 skipped, but not the first cp += strlen.
17233
17234 2001-02-08 Akim Demaille <akim@epita.fr>
17235
17236 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
17237 New, from fileutils 4.0.37.
17238 * configure.in: Require Autoconf 2.49c. I took some time before
17239 making this decision. This is the only way out for portability
17240 issues in Bison, it would mean way too much duplicate effort to
17241 import in Bison features implemented in 2.49c since 2.13.
17242 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
17243
17244 2001-02-02 Akim Demaille <akim@epita.fr>
17245
17246 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
17247 * lib/xalloc.h, lib/xmalloc.c: Update.
17248
17249 2001-01-19 Akim Demaille <akim@epita.fr>
17250
17251 Get rid of the ad hoc handling of token_buffer in the scanner: use
17252 the obstacks.
17253
17254 * src/lex.c (token_obstack): New.
17255 (init_lex): Initialize it. No longer call...
17256 (grow_token_buffer): this. Remove it.
17257 Adjust all the places which used it to use the obstack.
17258
17259 2001-01-19 Akim Demaille <akim@epita.fr>
17260
17261 * src/lex.h: Rename all the tokens:
17262 s/\bENDFILE\b/tok_eof/g;
17263 s/\bIDENTIFIER\b/tok_identifier/g;
17264 etc.
17265 Let them be enums, not #define, to ease debugging.
17266 Adjust all the code.
17267
17268 2001-01-18 Akim Demaille <akim@epita.fr>
17269
17270 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
17271 * src/lex.c (maxtoken, grow_token_buffer): Static.
17272
17273 2001-01-18 Akim Demaille <akim@epita.fr>
17274
17275 Since we now use obstacks, more % directives can be enabled.
17276
17277 * src/lex.c (percent_table): Also accept `%yacc',
17278 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
17279 `%debug'.
17280 Handle the actions for `%semantic_parser' and `%pure_parser' here,
17281 instead of returning a token.
17282 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
17283 * src/reader.c (read_declarations): Adjust.
17284 * src/files.c (open_files): Don't call `compute_base_names', don't
17285 compute `attrsfile' since they depend upon data which might be
17286 *in* the input file now.
17287 (output_files): Do it here.
17288 * src/output.c (output_headers): Document the fact that this patch
17289 introduces a guaranteed SEGV for semantic parsers.
17290 * doc/bison.texinfo: Document them.
17291 * tests/suite.at: Exercise these %options.
17292
17293 2000-12-20 Akim Demaille <akim@epita.fr>
17294
17295 Also handle the output file (--verbose) with obstacks.
17296
17297 * files.c (foutput): Remove.
17298 (output_obstack): New.
17299 Adjust all dependencies.
17300 * src/conflicts.c: Return a string.
17301 * src/system.h (obstack_grow_string): Rename as...
17302 (obstack_sgrow): this. Be ready to work with non literals.
17303 (obstack_fgrow4): New.
17304
17305 2000-12-20 Akim Demaille <akim@epita.fr>
17306
17307 * src/files.c (open_files): Fix the computation of short_base_name
17308 in the case of `-o foo.tab.c'.
17309
17310 2000-12-20 Akim Demaille <akim@epita.fr>
17311
17312 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
17313 (copy_dollar): Now that everything uses obstacks, get rid of the
17314 FILE * parameters.
17315
17316 2000-12-20 Akim Demaille <akim@epita.fr>
17317
17318 * src/files.c (open_files): Actually the `.output' file is based
17319 on the short_base_name, not base_name.
17320 * tests/suite.at (Checking output file names): Adjust.
17321
17322 2000-12-20 Akim Demaille <akim@epita.fr>
17323
17324 * src/bison.s1: Remove, we now use directly...
17325 * src/bison.simple: this.
17326 * src/Makefile.am: Use pkgdata instead of data.
17327
17328 2000-12-20 Akim Demaille <akim@epita.fr>
17329
17330 * src/files.c (guard_obstack): New.
17331 (open_files): Initialize it.
17332 (output_files): Dump it...
17333 * src/files.h: Export it.
17334 * src/reader.c (copy_guard): Use it.
17335
17336 2000-12-19 Akim Demaille <akim@epita.fr>
17337
17338 * src/files.c (outfile, defsfile, actfile): Removed as global
17339 vars.
17340 (open_files): Don't compute them.
17341 (output_files): Adjust.
17342 (base_name, short_base_name): Be global.
17343 Adjust dependencies.
17344
17345 2000-12-19 Akim Demaille <akim@epita.fr>
17346
17347 * src/files.c (strsuffix): New.
17348 (stringappend): Be just like strcat but allocate.
17349 (base_names): Eve out from open_files.
17350 Try to simplify the rather hairy computation of base_name and
17351 short_base_name.
17352 (open_files): Use it.
17353 * tests/suite.at (Checking output file names): New test.
17354
17355 2000-12-19 Akim Demaille <akim@epita.fr>
17356
17357 * src/system.h (obstack_grow_literal_string): Rename as...
17358 (obstack_grow_string): this.
17359 * src/output.c (output_parser): Recognize `%% actions' instead of
17360 `$'.
17361 * src/bison.s1: s/$/%% actions/.
17362 * src/bison.hairy: Likewise.
17363
17364 2000-12-19 Akim Demaille <akim@epita.fr>
17365
17366 * src/output.c (output_parser): Compute the `#line' lines when
17367 there are.
17368 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
17369 Suggested by Hans Aberg.
17370
17371 2000-12-19 Akim Demaille <akim@epita.fr>
17372
17373 Let the handling of the skeleton files be local to the procedures
17374 that use it.
17375
17376 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
17377 longer static.
17378 (fparser, open_extra_files): Remove.
17379 (open_files, output_files): Don't take care of fparser.
17380 * src/files.h: Adjust.
17381 * src/output.c (output_parser): Open and close the file to the
17382 skeleton.
17383 * src/reader.c (read_declarations): When %semantic_parser, open
17384 fguard.
17385
17386 2000-12-19 Akim Demaille <akim@epita.fr>
17387
17388 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
17389 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
17390
17391 2000-12-19 Akim Demaille <akim@epita.fr>
17392
17393 * src/files.c (open_files): Yipee! We no longer need all the code
17394 looking for `/tmp' since we have no tmp file.
17395
17396 2000-12-19 Akim Demaille <akim@epita.fr>
17397
17398 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
17399 New macros.
17400 * src/files.c (open_files): Less dependency on MSDOS etc.
17401
17402 2000-12-14 Akim Demaille <akim@epita.fr>
17403
17404 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
17405 Provide a default definition.
17406 Use it when executing the default @ action.
17407 * src/reader.c (reader_output_yylsp): No longer include
17408 `timestamp' and `text' in the default YYLTYPE.
17409
17410 2000-12-12 Akim Demaille <akim@epita.fr>
17411
17412 * src/reader.c (copy_definition, parse_union_decl, copy_action)
17413 (copy_guard): Quote the file names.
17414 Reported by Laurent Mascherpa.
17415
17416 2000-12-12 Akim Demaille <akim@epita.fr>
17417
17418 * src/output.c (output_headers, output_program, output): Be sure
17419 to escape special characters when outputting filenames.
17420 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
17421 (output_headers): Don't depend on them, Use ACTSTR.
17422
17423 2000-11-17 Akim Demaille <akim@epita.fr>
17424
17425 * lib/obstack.h: Formatting changes.
17426 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
17427 prevents type checking.
17428 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
17429 cast the value to (void *): assigning a `foo *' to a `void *'
17430 variable is valid.
17431 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
17432 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
17433 append characters.
17434
17435 2000-11-17 Akim Demaille <akim@epita.fr>
17436
17437 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
17438 as...
17439 (suite.m4, regression.m4, calc.m4): these.
17440 * tests/atgeneral.m4: Update from CVS Autoconf.
17441
17442 2000-11-17 Akim Demaille <akim@epita.fr>
17443
17444 * tests/regression.m4 (%union and --defines): New test,
17445 demonstrating a current bug in the obstack implementation.
17446
17447 2000-11-17 Akim Demaille <akim@epita.fr>
17448
17449 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
17450 macros.
17451 Use them to declare the variables which are global or local to
17452 `yyparse'.
17453
17454 2000-11-17 Akim Demaille <akim@epita.fr>
17455
17456 * acconfig.h: Remove, no longer used.
17457
17458 2000-11-07 Akim Demaille <akim@epita.fr>
17459
17460 * src: s/Copyright (C)/Copyright/g.
17461
17462 2000-11-07 Akim Demaille <akim@epita.fr>
17463
17464 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
17465 defining.
17466 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
17467
17468 2000-11-07 Akim Demaille <akim@epita.fr>
17469
17470 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
17471 Merge in a single CPP if/else.
17472
17473 2000-11-07 Akim Demaille <akim@epita.fr>
17474
17475 * src/output.c (output): Remove useless variables.
17476 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
17477 argument `data' for consistency with the prototypes.
17478 Qualify it `const'.
17479 (obstack_copy, obstack_copy0): Rename the second argument as
17480 `address' for consistency. Qualify it `const'.
17481 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
17482 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
17483 `const' their input argument (`data' or `address').
17484 Adjust the corresponding macros to include `const' in casts.
17485
17486 2000-11-03 Akim Demaille <akim@epita.fr>
17487
17488 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
17489 s/PFILE1/BISON_HAIRY/.
17490 Adjust dependencies.
17491
17492 2000-11-03 Akim Demaille <akim@epita.fr>
17493
17494 For some reason, this was not applied.
17495
17496 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
17497 `unlink': it's no longer used.
17498
17499 2000-11-03 Akim Demaille <akim@epita.fr>
17500
17501 * src/files.c (skeleton_find): New function, eved out of...
17502 (open_files, open_extra_files): here.
17503
17504 2000-11-03 Akim Demaille <akim@epita.fr>
17505
17506 Don't use `atexit'.
17507
17508 * src/files.c (obstack_save): New function.
17509 (done): Rename as...
17510 (output_files): this.
17511 Use `obstack_save'.
17512 * src/main.c (main): Don't use `atexit' to register `done', since
17513 it no longer has to remove tmp files, just call `output_files'
17514 when there are no errors.
17515
17516 2000-11-02 Akim Demaille <akim@epita.fr>
17517
17518 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
17519 `unlink': it's no longer used.
17520 * src/files.h: Formatting changes.
17521
17522 2000-11-02 Akim Demaille <akim@epita.fr>
17523
17524 Remove the last uses of mktemp and unlink/delete.
17525
17526 * src/files.c (fdefines, ftable): Removed.
17527 (defines_ostack, table_obstack): New.
17528 Adjust dependencies of the former into uses of the latter.
17529 * src/output.c (output_short_or_char_table, output_short_table):
17530 Convert to using obstacks.
17531 * src/reader.c (copy_comment2): Accept one FILE * and two
17532 obstacks.
17533 (output_token_defines, reader_output_yylsp): Use obstacks.
17534 * src/system.h (obstack_fgrow3): New.
17535 * po/POTFILES.in: Adjust.
17536
17537 2000-11-01 Akim Demaille <akim@epita.fr>
17538
17539 Change each use of `fattrs' into a use of `attrs_obstack'.
17540
17541 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
17542 * src/files.c (fattrs): Remove.
17543 (attrs_obstack): New.
17544 Adjust all dependencies.
17545 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
17546
17547 2000-11-01 Akim Demaille <akim@epita.fr>
17548
17549 Introduce obstacks.
17550 Change each use of `faction' into a use of `action_obstack'.
17551
17552 * lib/obstack.h, lib/obstack.c: New files.
17553 * src/files.c (faction): Remove.
17554 (action_obstack): New.
17555 Adjust all dependencies.
17556
17557 2000-10-20 Akim Demaille <akim@epita.fr>
17558
17559 * lib/quote.h (PARAMS): New macro. Use it.
17560
17561 2000-10-16 Akim Demaille <akim@epita.fr>
17562
17563 * src/output.c (output_short_or_char_table): New function.
17564 (output_short_table, output_token_translations): Use it.
17565 (goto_actions): Use output_short_table.
17566
17567 2000-10-16 Akim Demaille <akim@epita.fr>
17568
17569 * src/symtab.c (bucket_new): New function.
17570 (getsym): Use it.
17571
17572 * src/output.c (output_short_table): New argument to display the
17573 comment associated with the table.
17574 Adjust dependencies.
17575 (output_gram): Use it.
17576 (output_rule_data): Nicer output layout for YYTNAME.
17577
17578 2000-10-16 Akim Demaille <akim@epita.fr>
17579
17580 * src/lex.c (read_typename): New function.
17581 (lex): Use it.
17582 * src/reader.c (copy_dollar): Likewise.
17583
17584 2000-10-16 Akim Demaille <akim@epita.fr>
17585
17586 * src/reader.c (copy_comment2): Expect the input stream to be on
17587 the `/' which is suspected to open a comment, instead of being
17588 called after `//' or `/*' was read.
17589 (copy_comment, copy_definition, parse_union_decl, copy_action)
17590 (copy_guard): Adjust.
17591
17592 2000-10-16 Akim Demaille <akim@epita.fr>
17593
17594 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
17595 `read_signed_integer'.
17596
17597 2000-10-16 Akim Demaille <akim@epita.fr>
17598
17599 * src/reader.c (copy_dollar): New function.
17600 (copy_guard, copy_action): Use it.
17601
17602 2000-10-16 Akim Demaille <akim@epita.fr>
17603
17604 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
17605 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
17606 New files, from Fileutils 4.0.27.
17607 * src/main.c (printable_version): Remove.
17608 * src/lex.c, src/reader.c: Use `quote'.
17609
17610 2000-10-04 Akim Demaille <akim@epita.fr>
17611
17612 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
17613
17614 2000-10-04 Akim Demaille <akim@epita.fr>
17615
17616 * doc/bison.texinfo: Various typos spotted by Neil Booth.
17617
17618 2000-10-04 Akim Demaille <akim@epita.fr>
17619
17620 When a literal string is used to define two different tokens,
17621 `bison -v' segfaults.
17622 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
17623
17624 * tests/regression.m4: New file.
17625 Include the core of the sample provided by Piotr Gackiewicz.
17626 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
17627 properly.
17628
17629 2000-10-04 Akim Demaille <akim@epita.fr>
17630
17631 * src/reader.c (parse_expect_decl): Keep `count' within the size
17632 of `buffer'.
17633 From Neil Booth.
17634
17635 2000-10-02 Paul Eggert <eggert@twinsun.com>
17636
17637 * bison.s1 (yyparse): Assign the default value
17638 unconditionally, to avoid a GCC warning and make the parser a
17639 tad smaller.
17640
17641 2000-10-02 Akim Demaille <akim@epita.fr>
17642
17643 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
17644 options.
17645
17646 2000-10-02 Akim Demaille <akim@epita.fr>
17647
17648 * src/derives.c, src/print.c, src/reduce.c: To ease the
17649 translation, move some `\n' out of the translated strings.
17650
17651 2000-10-02 Akim Demaille <akim@epita.fr>
17652
17653 The location tracking mechanism is precious for parse error
17654 messages. Nevertheless, it is enabled only when `@n' is used in
17655 the grammar, which is a different issue (you can use it in error
17656 message, but not in the grammar per se). Therefore, there should
17657 be another means to enable it.
17658
17659 * src/getargs.c (getargs): Support `--locations'.
17660 (usage): Report it.
17661 * src/getargs.h (locationsflag): Export it.
17662 * src/lex.c (percent_table): Support `%locations'.
17663 * src/reader.c (yylsp_needed): Remove this variable, now replaced
17664 with `locationsflag'.
17665 * doc/bison.texinfo: Document `--locations' and `%locations'.
17666 Sort the options.
17667 * tests/calc.m4: Test it.
17668
17669 For regularity of the names, replace each
17670 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
17671 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
17672 In addition replace each `flag' with `_flag'.
17673
17674 2000-10-02 Akim Demaille <akim@epita.fr>
17675
17676 Also test parse error messages, including with YYERROR_VERBOSE.
17677
17678 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
17679 associative).
17680 Use it to check the computations.
17681 Use it to check `nonassoc' is honored.
17682 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
17683 `--yyerror-verbose'.
17684 (_AT_CHECK_CALC): Adjust to this option.
17685 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
17686
17687 2000-10-02 Akim Demaille <akim@epita.fr>
17688
17689 Test also `--verbose', `--defines' and `--name-prefix'. Testing
17690 the latter demonstrates a flaw in the handling of non debugging
17691 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
17692 was used in order to simplify:
17693
17694 #if YYDEBUG
17695 if (yydebug)
17696 {
17697 ...
17698 }
17699 #endif
17700
17701 into
17702
17703 if (yydebug)
17704 {
17705 ...
17706 }
17707
17708 unfortunately this leads to a CPP conflict when
17709 `--name-prefix=foo' is used since it produces `#define yydebug
17710 foodebug'.
17711
17712 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
17713 (YYDPRINTF): New macro.
17714 Spread its use.
17715 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
17716 the bison options.
17717 Also test `--verbose', `--defines' and `--name-prefix'.
17718
17719 2000-10-02 Akim Demaille <akim@epita.fr>
17720
17721 Improve the readability of the produced parsers.
17722
17723 * src/bison.s1: Formatting changes.
17724 Improve the comment related to the `$' mark.
17725 (yydefault): Don't fall through to `yyresume': `goto' there.
17726 * src/output.c (output_parser): When the `$' is met, skip the end
17727 of its line.
17728 New variable, `number_of_dollar_signs', to check there's exactly
17729 one `$' in the parser skeleton.
17730
17731 2000-10-02 Akim Demaille <akim@epita.fr>
17732
17733 * lib/xstrdup.c: New file, from the fileutils.
17734 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
17735 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
17736 instead of strlen + xmalloc + strcpy.
17737 * src/symtab.c (copys): Remove, use xstrdup instead.
17738
17739 2000-10-02 Akim Demaille <akim@epita.fr>
17740
17741 * src/gram.h (associativity): New enum type which replaces the
17742 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
17743 `right_assoc', `left_assoc' and `non_assoc'.
17744 Adjust all dependencies.
17745 * src/reader.c: Formatting changes.
17746 (LTYPESTR): Don't define it, use it as a literal in
17747 `reader_output_yylsp'.
17748 * src/symtab.h (symbol_class): New enum type which replaces the
17749 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
17750 `sunknown', `stoken and `snterm'.
17751
17752 2000-10-02 Akim Demaille <akim@epita.fr>
17753
17754 * src/getargs.c (fixed_outfiles): Rename as...
17755 (yaccflag): for consistency and accuracy.
17756 Adjust dependencies.
17757
17758 2000-10-02 Akim Demaille <akim@epita.fr>
17759
17760 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
17761 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
17762 difficult and introduced a lot of core dump. It turns out that
17763 Bison used an implementation of `xmalloc' based on `calloc', and
17764 at various places it does depend upon the initialization to 0. I
17765 have not tried to isolate the pertinent places, and all the former
17766 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
17767 someone should address this issue.
17768
17769 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
17770 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
17771 files.
17772 Adjust dependencies.
17773 * src/warshall.h: New file.
17774 Propagate.
17775
17776 2000-10-02 Akim Demaille <akim@epita.fr>
17777
17778 Various anti-`extern in *.c' changes.
17779
17780 * src/system.h: Include `assert.h'.
17781
17782 2000-10-02 Akim Demaille <akim@epita.fr>
17783
17784 * src/state.h (nstates, final_state, first_state, first_shift)
17785 (first_reduction): Move their exportation from here...
17786 * src/LR0.h: to here.
17787 Adjust dependencies.
17788 * src/getargs.c (statisticsflag): New variable.
17789 Add support for `--statistics'.
17790 Adjust dependencies.
17791
17792 Remove a lot of now useless `extern' statements in most files.
17793
17794 2000-10-02 Akim Demaille <akim@epita.fr>
17795
17796 * src/LR0.h: New file.
17797 Propagate its use.
17798
17799 2000-10-02 Akim Demaille <akim@epita.fr>
17800
17801 * src/print.h: New file.
17802 Propagate its use.
17803 * src/print.c: Formatting and ordering changes.
17804 (verbose, terse): Replace with...
17805 (print_results): this new function.
17806 Adjust dependencies.
17807
17808 2000-10-02 Akim Demaille <akim@epita.fr>
17809
17810 * src/conflicts.c (conflict_report): New function.
17811 (conflict_log, verbose_conflict_log): Replace with...
17812 (print_conflicts): this function.
17813 Adjust dependencies.
17814 * src/conflicts.h: New file.
17815 Propagate its inclusion.
17816
17817 2000-10-02 Akim Demaille <akim@epita.fr>
17818
17819 * src/nullable.h: New file.
17820 Propagate its inclusion.
17821 * src/nullable.c: Formatting changes.
17822
17823 2000-10-02 Akim Demaille <akim@epita.fr>
17824
17825 * src/reduce.h: New file.
17826 Propagate its inclusion.
17827 * src/reduce.c: Topological sort and other formatting changes.
17828 (bool, TRUE, FALSE): Move their definition to...
17829 * src/system.h: here.
17830
17831 2000-10-02 Akim Demaille <akim@epita.fr>
17832
17833 * src/files.c: Formatting changes.
17834 (tryopen, tryclose, openfiles): Rename as...
17835 (xfopen, xfclose, open_files): this.
17836 (stringappend): static.
17837 * src/files.h: Complete the list of exported symbols.
17838 Propagate its use.
17839
17840 2000-10-02 Akim Demaille <akim@epita.fr>
17841
17842 * src/reader.h: New file.
17843 Propagate its use instead of tedious list of `extern' and
17844 prototypes.
17845 * src/reader.c: Formatting changes, topological sort,
17846 s/register//.
17847
17848 2000-10-02 Akim Demaille <akim@epita.fr>
17849
17850 * src/lex.h: Prototype `lex.c' exported functions.
17851 * src/reader.c: Adjust.
17852 * src/lex.c: Formatting changes.
17853 (safegetc): Rename as...
17854 (xgetc): this.
17855
17856 2000-10-02 Akim Demaille <akim@epita.fr>
17857
17858 * src/lalr.h: New file.
17859 Propagate its inclusion instead of prototypes and `extern'.
17860 * src/lalr.c: Formatting changes, topological sorting etc.
17861
17862 2000-10-02 Akim Demaille <akim@epita.fr>
17863
17864 * src/output.c (token_actions): Introduce a temporary array,
17865 YYDEFACT, that makes it possible for this function to use
17866 output_short_table.
17867
17868 2000-10-02 Akim Demaille <akim@epita.fr>
17869
17870 `user_toknums' is output as a `short[]' in `output.c', while it is
17871 defined as a `int[]' in `reader.c'. For consistency with the
17872 other output tables, `user_toknums' is now defined as a table of
17873 shorts.
17874
17875 * src/reader.c (user_toknums): Be a short table instead of an int
17876 table.
17877 Adjust dependencies.
17878
17879 Factor the short table outputs.
17880
17881 * src/output.c (output_short_table): New function.
17882 * src/output.c (output_gram, output_stos, output_rule_data)
17883 (output_base, output_table, output_check): Use it.
17884
17885 2000-10-02 Akim Demaille <akim@epita.fr>
17886
17887 * src/output.c (output): Topological sort of the functions, in
17888 order to get rid of the `static' prototypes.
17889 No longer use `register'.
17890 * src/output.h: New file.
17891 Propagate its inclusion in files explicitly prototyping functions
17892 from output.c.
17893
17894 2000-09-21 Akim Demaille <akim@epita.fr>
17895
17896 * src/atgeneral.m4: Update from Autoconf.
17897
17898 2000-09-21 Akim Demaille <akim@epita.fr>
17899
17900 * src/closure.h: New file.
17901 * src/closure.c: Formatting changes, topological sort over the
17902 functions, use of closure.h.
17903 (initialize_closure, finalize_closure): Rename as...
17904 (new_closure, free_closure): these. Adjust dependencies.
17905 * src/LR0.c: Formatting changes, topological sort, use of
17906 cloture.h.
17907 (initialize_states): Rename as...
17908 (new_states): this.
17909 * src/Makefile.am (noinst_HEADERS): Adjust.
17910
17911 2000-09-20 Akim Demaille <akim@epita.fr>
17912
17913 * src/acconfig.h: Don't protect config.h against multiple
17914 inclusion.
17915 Don't define PARAMS.
17916 * src/system.h: Define PARAMS.
17917 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
17918 purpose of config.h. system.h must not try to fix wrong
17919 definitions in config.h.
17920
17921 2000-09-20 Akim Demaille <akim@epita.fr>
17922
17923 * src/derives.h: New file.
17924 * src/main.c, src/derives.h: Use it.
17925 Formatting changes.
17926 * src/Makefile.am (noinst_HEADERS): Adjust.
17927
17928 2000-09-20 Akim Demaille <akim@epita.fr>
17929
17930 * tests/atgeneral.m4: Update from Autoconf.
17931 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
17932 (AT_CHECK_CALC): New macros.
17933 Use these macros to test bison with options `', `--raw',
17934 `--debug', `--yacc', `--yacc --debug'.
17935
17936 2000-09-19 Akim Demaille <akim@epita.fr>
17937
17938 * src/output.c: Formatting changes.
17939 * src/machine.h: Remove, leaving its contents in...
17940 * src/system.h: here.
17941 Include stdio.h.
17942 Adjust all dependencies on stdio.h and machine.h.
17943 * src/getargs.h: New file.
17944 Let all `extern' declarations about getargs.c be replaced with
17945 inclusion of `getargs.h'.
17946 * src/Makefile.am (noinst_HEADERS): Adjust.
17947
17948 * tests/calc.m4 (yyin): Be initialized in main, not on the global
17949 scope.
17950 (yyerror): Returns void, not int.
17951 * doc/bison.texinfo: Formatting changes.
17952
17953 2000-09-19 Akim Demaille <akim@epita.fr>
17954
17955 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
17956 portable.
17957
17958 2000-09-18 Akim Demaille <akim@epita.fr>
17959
17960 * configure.in: Append WARNING_CFLAGS to CFLAGS.
17961 * src/Makefile.am (INCLUDES): Don't.
17962 Be ready to fetch headers in lib/.
17963
17964 2000-09-18 Akim Demaille <akim@epita.fr>
17965
17966 * doc/bison.texinfo: Update the copyright.
17967 ANSIfy and GNUify the examples.
17968 Remove the old menu.
17969
17970 2000-09-18 Akim Demaille <akim@epita.fr>
17971
17972 First set of tests: use the `calc' example from the documentation.
17973
17974 * src/bison.s1 (yyparse): Condition the code using `yytname' which
17975 is defined only when YYDEBUG is.
17976 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
17977 * src/files.c (tryopen, tryclose): Formatting changes.
17978 Move to the top and be static.
17979 * src/reader.c (read_signed_integer): Likewise.
17980 * tests/calc.m4: New file.
17981 * Makefile.am, suite.m4: Adjust.
17982 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
17983
17984 2000-09-18 Akim Demaille <akim@epita.fr>
17985
17986 Add support for an Autotest test suite for Bison.
17987
17988 * m4/m4.m4, m4/atconfig.m4: New files.
17989 * m4/Makefile.am (EXTRA_DIST): Adjust.
17990 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
17991 files.
17992 * src/getargs.c: Display a more standard --version message.
17993 * src/reader.c (reader): Formatting changes.
17994 No longer depend upon VERSION_STRING.
17995 * configure.in: No longer use `dnl'.
17996 Set up the test suite and the new directory `tests/.
17997 (VERSION_STRING): Remove.
17998
17999 2000-04-14 Akim Demaille <akim@epita.fr>
18000
18001 * src/reader.c (copy_comment2): New function, same as former
18002 `copy_comment', but outputs into two FILE *.
18003 (copy_comment): Use it.
18004 (parse_union_decl): Use it.
18005 (get_type, parse_start_decl): Use the same `invalid' message.
18006 (parse_start_decl, parse_union_decl): Use the same `multiple'
18007 message.
18008 (parse_union_decl, copy_guard, copy_action): Use the same
18009 `unmatched' message.
18010 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
18011
18012 2000-03-31 Akim Demaille <akim@epita.fr>
18013
18014 * src/files.c (tryopen, tryclose): Move to the top.
18015 Be static.
18016
18017 2000-03-31 Akim Demaille <akim@epita.fr>
18018
18019 * src/main.c (main): Don't call `done', exit does it.
18020
18021 2000-03-31 Akim Demaille <akim@epita.fr>
18022
18023 * allocate.c: s/return (foo)/return foo/.
18024 * lalr.c: Likewise.
18025 * LR0.c: Likewise.
18026 * output.c: Likewise.
18027 * reader.c: Likewise.
18028 * symtab.c: Likewise.
18029 * vmsgetargs.c: Likewise.
18030
18031 2000-03-31 Akim Demaille <akim@epita.fr>
18032
18033 Clean up the error reporting functions.
18034
18035 * src/report.c: New file.
18036 * src/report.h: Likewise.
18037 * src/Makefile.am: Adjust.
18038 * m4/error.m4: New file.
18039 * m4/Makefile.am: Adjust.
18040 * configure.in (jm_PREREQ_ERROR): Call it.
18041 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
18042 Remove.
18043 (fatal, fatals): Remove. All callers use complain.c::fatal.
18044 (warn, warni, warns, warnss, warnss): Remove. All callers use
18045 complain.c::complain.
18046 (toomany): Remove, use fatal instead.
18047 * src/files.c (done): No argument, use complain_message_count.
18048 * src/main.c (main): Register `done' to `atexit'.
18049
18050 * src/getargs.c (usage): More `fputs', less `fprintf'.
18051
18052 2000-03-28 Akim Demaille <akim@epita.fr>
18053
18054 * lib/: New directory.
18055 * Makefile.am (SUBDIRS): Adjust.
18056 * configure.in: Adjust.
18057 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
18058 useless.
18059 * src/alloca.c: Moved to lib/.
18060 * src/getopt.c: Likewise.
18061 * src/getopt1.c: Likewise.
18062 * src/getopt.h: Likewise.
18063 * src/ansi2knr.c: Likewise.
18064 * src/ansi2knr.1: Likewise.
18065 * src/Makefile.am: Adjust.
18066 * lib/Makefile.am: New file.
18067
18068 2000-03-28 Akim Demaille <akim@epita.fr>
18069
18070 * src/getargs.c (usage): Refresh the help message.
18071
18072 2000-03-17 Akim Demaille <akim@epita.fr>
18073
18074 * src/getopt1.c: Updated from textutils 2.0e
18075 * src/getopt.c: Likewise.
18076 * src/getopt.h: Likewise.
18077
18078 2000-03-17 Akim Demaille <akim@epita.fr>
18079
18080 * src/Makefile.am (bison.simple): Fix the awk program: quote only
18081 the file name, not the whole `#line LINE FILE'.
18082
18083 2000-03-17 Akim Demaille <akim@epita.fr>
18084
18085 On syntax errors, report the token on which we choked.
18086
18087 * src/bison.s1 (yyparse): In the label yyerrlab, when
18088 YYERROR_VERBOSE, add yychar in msg.
18089
18090 2000-03-17 Akim Demaille <akim@epita.fr>
18091
18092 * src/reader.c (copy_at): New function.
18093 (copy_guard): Use it.
18094 (copy_action): Use it.
18095
18096 2000-03-17 Akim Demaille <akim@epita.fr>
18097
18098 Be kind to translators, save some useless translations.
18099
18100 * src/main.c (banner): New function.
18101 (fatal_banner): Use it.
18102 (warn_banner): Use it.
18103
18104 2000-03-17 Akim Demaille <akim@epita.fr>
18105
18106 * src/reader.c (copy_definition): Use copy_string and
18107 copy_comment. Removed now unused `match', `ended',
18108 `cplus_comment'.
18109 (copy_comment, copy_string): Moved, to be visible from
18110 copy_definition.
18111
18112 2000-03-17 Akim Demaille <akim@epita.fr>
18113
18114 * src/reader.c (copy_string): Declare `static inline'. No
18115 problems with inline, since it is checked by configure.
18116 (copy_comment): Likewise.
18117
18118 2000-03-17 Akim Demaille <akim@epita.fr>
18119
18120 * src/reader.c (packsymbols): Formatting changes.
18121
18122 2000-03-17 Akim Demaille <akim@epita.fr>
18123
18124 * src/reader.c (copy_comment): New function, factored out from:
18125 (copy_action): Use it. Removed now unused `match', `ended',
18126 `cplus_comment'.
18127 (copy_guard): Likewise.
18128
18129 2000-03-17 Akim Demaille <akim@epita.fr>
18130
18131 * src/reader.c (copy_string): New function, factored out from:
18132 (copy_action): Use it.
18133 (copy_guard): Likewise.
18134
18135 2000-03-17 Akim Demaille <akim@epita.fr>
18136
18137 Change the handling of @s so that they behave exactly like $s.
18138 There is now a pseudo variable @$ (readble and writable), location
18139 of the lhs of the rule (by default ranging from the location of
18140 the first symbol of the rhs, to the location of the last symbol,
18141 or, if the rhs is empty, YYLLOC).
18142
18143 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
18144 yyval.
18145 (yyparse): When providing a default semantic action, provide a
18146 default location action.
18147 (after the $): No longer change `*YYLSP', just stack YYLOC the
18148 same way you stack YYVAL.
18149 * src/reader.c (read_declarations): Use warns.
18150 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
18151 (copy_action, case '@'): Likewise.
18152 Use a standard error message, to save useless work from
18153 translators.
18154
18155 2000-03-17 Akim Demaille <akim@epita.fr>
18156
18157 * src/bison.s1: Formatting and cosmetics changes.
18158 * src/reader.c: Likewise.
18159 Update the Copyright notice.
18160
18161 2000-03-17 Akim Demaille <akim@epita.fr>
18162
18163 * src/bison.s1 (#line): All set to `#line' only, since the
18164 Makefile now handles them.
18165
18166 2000-03-16 Akim Demaille <akim@epita.fr>
18167
18168 * src/output.c (output_rule_data): Output the documentation of
18169 some of the tables.
18170 (Copyright notice): Update.
18171 Formatting changes.
18172
18173 2000-03-16 Akim Demaille <akim@epita.fr>
18174
18175 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
18176 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
18177 One `#if YYDEBUG' remains, since it uses variables which are
18178 defined only if `YYDEBUG != 0'.
18179
18180 2000-03-16 Akim Demaille <akim@epita.fr>
18181
18182 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
18183 and related variables so that the similarities are highlighted.
18184
18185 2000-03-16 Akim Demaille <akim@epita.fr>
18186
18187 * src/bison.s1: Properly indent CPP directives.
18188
18189 2000-03-16 Akim Demaille <akim@epita.fr>
18190
18191 * src/bison.s1: Properly indent the `alloca' CPP section.
18192
18193 2000-03-16 Akim Demaille <akim@epita.fr>
18194
18195 Do not hard code values of directories in `configure.in'.
18196 Update the `configure' tool chain.
18197
18198 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
18199 src/makefile.am.
18200 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
18201 (AC_OUTPUT): Add m4/Makefile.
18202 Bump to bison 1.28a, 1.29 has never been released.
18203 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
18204 handled via src/Makefile.am.
18205 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
18206 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
18207 autoheader.
18208 * Makefile.am (SUBDIRS): Add m4.
18209 (ACLOCAL_AM_FLAGS): New variable.
18210 (AUTOMAKE_OPTIONS): Add check-news.
18211 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
18212 the proper line number and file name.
18213 (DEFS): Propagate the location of bison library files and of the
18214 locale files.
18215 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
18216 builddir.
18217 * acinclude.m4: Remove, replaced by the directory m4.
18218 * m4/Makefile.am (EXTRA_DIST): New variable.
18219 * m4/gettext.m4: New file, from the fileutils.
18220 * m4/lcmessage.m4: Likewise
18221 * m4/progtest.m4: Likewise.
18222 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
18223
18224 2000-03-10 Akim Demaille <akim@epita.fr>
18225
18226 * src/closure.c:
18227 Formatting changes of various comments.
18228 Respect the GNU coding standards at various places.
18229 Don't use `_()' when no translation is needed.
18230
18231 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18232
18233 * src/files.c:
18234 OS/2 honors TMPDIR environment variable.
18235
18236 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18237
18238 * doc/bison.texinfo: Tweaked spelling and grammar.
18239 Updated ISBN.
18240 Removed reference to price of printed copy.
18241 Mention BISON_SIMPLE and BISON_HAIRY.
18242
18243 1999-12-13 Jesse Thilo <jthilo@gnu.org>
18244
18245 * configure.in, NEWS:
18246 Bison 1.29 released.
18247
18248 1999-10-27 Jesse Thilo <jthilo@gnu.org>
18249
18250 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
18251 Added reference card.
18252
18253 1999-07-26 Jesse Thilo <jthilo@gnu.org>
18254
18255 * po/ru.po: Added Russian translation.
18256
18257 1999-07-26 Jesse Thilo <jthilo@gnu.org>
18258
18259 * configure.in: Added Russian translation.
18260
18261 1999-07-06 Jesse Thilo <jthilo@gnu.org>
18262
18263 * configure.in, NEWS, README:
18264 Released version 1.28.
18265
18266 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18267
18268 * src/system.h:
18269 Squashed redefinition warning on some systems.
18270
18271 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
18272 Have configure build version string instead of relying on ANSI string
18273 concatentation.
18274
18275 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18276
18277 * po/POTFILES.in: Got rid of version.c.
18278
18279 1999-06-14 Jesse Thilo <jthilo@gnu.org>
18280
18281 * acconfig.h, configure.in:
18282 Have configure build version string instead of relying on ANSI string
18283 concatentation.
18284
18285 1999-06-08 Jesse Thilo <jthilo@gnu.org>
18286
18287 * doc/bison.1:
18288 Dropped mention of `+' for long-named options.
18289
18290 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18291
18292 * src/files.c: Added <unistd.h> for unlink().
18293
18294 * src/Makefile.am, src/system.h:
18295 I18n fixes.
18296
18297 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18298
18299 * README: Added a FAQ list.
18300
18301 * configure.in, acconfig.h:
18302 I18n fixes.
18303
18304 1999-05-30 Jesse Thilo <jthilo@gnu.org>
18305
18306 * doc/FAQ, doc/Makefile.am:
18307 Added a FAQ list.
18308
18309 1999-05-19 Jesse Thilo <jthilo@gnu.org>
18310
18311 * src/alloc.h, src/symtab.h, src/version.c:
18312 Protected inclusion of "config.h" with HAVE_CONFIG_H.
18313
18314 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18315
18316 * src/.cvsignore, src/Makefile.am:
18317 Reorganized: sources in `src', documentation in `doc'.
18318
18319 * src/lex.c (literalchar):
18320 fixed the code for escaping double quotes (thanks
18321 Jonathan Czisny.)
18322
18323 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18324
18325 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
18326 Adjusted paths to reflect directory reorganization.
18327
18328 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18329
18330 * doc/.cvsignore, doc/Makefile.am:
18331 Reorganized: sources in `src', documentation in `doc'.
18332
18333 1999-04-18 Jesse Thilo <jthilo@gnu.org>
18334
18335 * configure.in:
18336 Updated AC_INIT file to reflect directory reorganization.
18337
18338 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
18339 Reorganized: sources in `src', documentation in `doc'.
18340
18341 1999-04-13 Jesse Thilo <jthilo@gnu.org>
18342
18343 * src/allocate.c:
18344 Don't declare calloc() and realloc() if not necessary.
18345
18346 1999-04-13 Jesse Thilo <jthilo@gnu.org>
18347
18348 * configure.in, acconfig.h, acinclude.m4:
18349 Don't declare calloc() and realloc() if not necessary.
18350
18351 1999-03-23 Jesse Thilo <jthilo@gnu.org>
18352
18353 * po/.cvsignore: Added i18n support.
18354
18355 1999-03-23 Jesse Thilo <jthilo@gnu.org>
18356
18357 * acconfig.h, configure.in, Makefile.am:
18358 Added i18n support.
18359
18360 1999-03-22 Jesse Thilo <jthilo@gnu.org>
18361
18362 * src/bison.s1: Fixed #line numbers.
18363
18364 1999-03-15 Jesse Thilo <jthilo@gnu.org>
18365
18366 * po/es.po, po/fr.po, po/nl.po, po/de.po:
18367 Added PO files from Translation Project.
18368
18369 1999-03-03 Jesse Thilo <jthilo@gnu.org>
18370
18371 * Makefile.am:
18372 Added support for non-ANSI compilers (ansi2knr).
18373
18374 1999-02-16 Jesse Thilo <jthilo@gnu.org>
18375
18376 * configure.in: Bumped version number to 1.27.
18377
18378 * Makefile.am:
18379 Added `bison.simple' to list of files removed by `make distclean'.
18380
18381 1999-02-12 Jesse Thilo <jthilo@gnu.org>
18382
18383 * src/files.c, src/files.h:
18384 Defined locations of parser files in config.h instead of Makefile.
18385
18386 1999-02-12 Jesse Thilo <jthilo@gnu.org>
18387
18388 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
18389 Defined locations of parser files in config.h instead of Makefile.
18390
18391 1999-02-09 Jesse Thilo <jthilo@gnu.org>
18392
18393 * Makefile.am:
18394 Removed inappropriate use of $< macro.
18395
18396 1999-02-05 Jesse Thilo <jthilo@gnu.org>
18397
18398 * po/Makefile.in.in, po/POTFILES.in:
18399 Add `po' directory skeleton.
18400
18401 1999-01-27 Jesse Thilo <jthilo@gnu.org>
18402
18403 * README: Document help-bison list.
18404
18405 * configure.in: Add check for mkstemp().
18406
18407 1999-01-20 Jesse Thilo <jthilo@gnu.org>
18408
18409 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
18410 Hush a few compiler warnings.
18411
18412 * src/files.c:
18413 Add tryclose(), which verifies that fclose was successful.
18414 Hush a couple of compiler warnings.
18415
18416 1999-01-20 Jesse Thilo <jthilo@gnu.org>
18417
18418 * Makefile.am, OChangeLog:
18419 ChangeLog is now automatically generated. Include the old version as
18420 OChangeLog.
18421
18422 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18423
18424 * 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:
18425 Update FSF address.
18426
18427 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18428
18429 * doc/bison.texinfo: Fix formatting glitch.
18430
18431 * doc/bison.texinfo: Update FSF address.
18432
18433 1999-01-14 Jesse Thilo <jthilo@gnu.org>
18434
18435 * acconfig.h: Update FSF address.
18436
18437 1999-01-08 Jesse Thilo <jthilo@gnu.org>
18438
18439 * src/system.h:
18440 Don't define PACKAGE here, since config.h defines it.
18441
18442 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18443
18444 * src/reader.c: Update copyright date.
18445
18446 * src/main.c:
18447 Ditch sprintf to statically-sized buffers in fatal/warn functions in
18448 favor of output directly to stderr (avoids buffer overruns).
18449
18450 * src/reader.c: Some checks for premature EOF.
18451
18452 * 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:
18453 Use prototypes if the compiler understands them.
18454
18455 * src/files.c: Honor TMPDIR on Unix hosts.
18456 Use prototypes if the compiler understands them.
18457
18458 * src/reader.c:
18459 Fix a couple of buffer overrun bugs.
18460 Use prototypes if the compiler understands them.
18461
18462 * src/system.h: Include unistd.h and ctype.h.
18463 Use #ifdef instead of #if for NLS symbols.
18464
18465 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18466
18467 * doc/bison.texinfo:
18468 Delete comment "consider using @set for edition number, etc..." since
18469 we now are doing so.
18470
18471 1998-12-30 Jesse Thilo <jthilo@gnu.org>
18472
18473 * configure.in:
18474 Use prototypes if the compiler understands them.
18475
18476 * NEWS: Document 1.26 highlights.
18477
18478 * Makefile.am: Require Automake 1.3 or later.
18479
18480 * acconfig.h:
18481 Use prototypes if the compiler understands them.
18482
18483 1998-12-29 Jesse Thilo <jthilo@gnu.org>
18484
18485 * src/version.c:
18486 Use VERSION symbol from automake for version number.
18487
18488 1998-12-29 Jesse Thilo <jthilo@gnu.org>
18489
18490 * acconfig.h, configure.in, version.cin:
18491 Use VERSION symbol from automake for version number.
18492
18493 1998-11-28 Jesse Thilo <jthilo@gnu.org>
18494
18495 * Makefile.am:
18496 Distribute original version of simple parser (bison.s1), not built
18497 version (bison.simple).
18498
18499 1998-11-28 Jesse Thilo <jthilo@gnu.org>
18500
18501 * doc/bison.texinfo: Add info dir entry.
18502
18503 * doc/bison.texinfo:
18504 Let automake put version number into documentation.
18505
18506 1998-11-26 Jesse Thilo <jthilo@gnu.org>
18507
18508 * src/bison.cld, src/build.com, src/vmshlp.mar:
18509 Add non-RCS files from /gd/gnu/bison.
18510
18511 1998-11-26 Jesse Thilo <jthilo@gnu.org>
18512
18513 * doc/bison.1:
18514 Document the BISON_HAIRY and BISON_SIMPLE variables.
18515
18516 1998-11-25 Jesse Thilo <jthilo@gnu.org>
18517
18518 * src/version.c: Build version.c automatically.
18519
18520 * src/reader.c:
18521 Fix token numbering (used to start at 258, not 257).
18522
18523 * src/system.h: Include config.h.
18524
18525 * src/getargs.c: Update bug report address.
18526
18527 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
18528 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
18529
18530 1998-11-25 Jesse Thilo <jthilo@gnu.org>
18531
18532 * Makefile.am:
18533 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
18534
18535 * configure.in, version.cin:
18536 Build version.c automatically.
18537
18538 * AUTHORS: Add AUTHORS file.
18539
18540 * README: Update bug report address.
18541
18542 * bison.simple:
18543 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
18544
18545 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
18546 Add automake stuff.
18547
18548 1998-11-25 Jesse Thilo <jthilo@gnu.org>
18549
18550 * doc/bison.texinfo: Clean up some formatting.
18551
18552 1998-05-05 Richard Stallman <rms@gnu.org>
18553
18554 * doc/bison.texinfo:
18555 Explain better why to make a pure parser.
18556
18557 1998-01-05 Richard Stallman <rms@gnu.org>
18558
18559 * src/files.c (openfiles):
18560 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
18561 find a temporary directory, if possible. Do not unlink files while
18562 they are open.
18563
18564 1997-08-25 Richard Stallman <rms@gnu.org>
18565
18566 * src/reader.c (stack_offset;):
18567 Change some warni to warns.
18568
18569 * src/lex.c (literalchar): Use warns, not warni.
18570
18571 1997-06-28 Richard Stallman <rms@gnu.org>
18572
18573 * src/bison.s1: Add a Bison version comment.
18574
18575 * src/main.c (fatal, warn, berror):
18576 Use program_name.
18577
18578 1997-06-28 Richard Stallman <rms@gnu.org>
18579
18580 * Makefile.in (bison_version): New variable.
18581 (dist): Use that variable.
18582 (bison.s1): Substitute the Bison version into bison.simple.
18583
18584 * bison.simple: Add a Bison version comment.
18585
18586 1997-06-18 Richard Stallman <rms@gnu.org>
18587
18588 * src/main.c (fatal, warn, berror):
18589 Make error messages standard.
18590 (toomany): Improve error message text.
18591
18592 * 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:
18593 new.h renamed to alloc.h.
18594
18595 1997-06-18 Richard Stallman <rms@gnu.org>
18596
18597 * Makefile.in: new.h renamed to alloc.h.
18598
18599 1997-05-24 Richard Stallman <rms@gnu.org>
18600
18601 * src/lex.c (literalchar):
18602 Fix the code for escaping \, " and '.
18603
18604 (lex): Avoid trouble when there are many chars
18605 to discard in a char literal with just several chars in it.
18606
18607 1997-05-17 Richard Stallman <rms@gnu.org>
18608
18609 * src/bison.s1:
18610 Use malloc, if using alloca is troublesome.
18611 (YYSTACK_USE_ALLOCA): New flag macro.
18612 Define it for some systems and compilers.
18613 (YYSTACK_ALLOC): New macro.
18614 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18615 If it was malloc'd, free it.
18616
18617 1997-05-17 Richard Stallman <rms@gnu.org>
18618
18619 * bison.simple:
18620 Use malloc, if using alloca is troublesome.
18621 (YYSTACK_USE_ALLOCA): New flag macro.
18622 Define it for some systems and compilers.
18623 (YYSTACK_ALLOC): New macro.
18624 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18625 If it was malloc'd, free it.
18626
18627 1997-04-23 Richard Stallman <rms@gnu.org>
18628
18629 * src/bison.s1:
18630 (alloca) [__hpux]: Always define as __builtin_alloca.
18631
18632 1997-04-23 Richard Stallman <rms@gnu.org>
18633
18634 * bison.simple:
18635 (alloca) [__hpux]: Always define as __builtin_alloca.
18636
18637 1997-04-22 Richard Stallman <rms@gnu.org>
18638
18639 * src/bison.s1:
18640 [__hpux]: Include alloca.h (right for HPUX 10)
18641 instead of declaring alloca (right for HPUX 9).
18642
18643 * src/bison.s1 (__yy_memcpy):
18644 Declare arg `count' as unsigned int.
18645 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18646
18647 1997-04-22 Richard Stallman <rms@gnu.org>
18648
18649 * bison.simple:
18650 [__hpux]: Include alloca.h (right for HPUX 10)
18651 instead of declaring alloca (right for HPUX 9).
18652
18653 * bison.simple (__yy_memcpy):
18654 Declare arg `count' as unsigned int.
18655 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18656
18657 1997-01-03 Richard Stallman <rms@gnu.org>
18658
18659 * src/allocate.c: [__STDC__ or _MSC_VER]:
18660 Declare calloc and realloc to return void *.
18661
18662 1997-01-02 Richard Stallman <rms@gnu.org>
18663
18664 * src/system.h:
18665 [_MSC_VER]: Include stdlib.h and process.h.
18666 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
18667
18668 * src/main.c (main): Return FAILURE as a value.
18669 (printable_version): Declare arg as int, not char.
18670
18671 1997-01-02 Richard Stallman <rms@gnu.org>
18672
18673 * Makefile.in (dist):
18674 Explicitly check for symlinks, and copy them.
18675
18676 1996-12-19 Richard Stallman <rms@gnu.org>
18677
18678 * src/files.c:
18679 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
18680
18681 1996-12-18 Paul Eggert <eggert@gnu.org>
18682
18683 * src/bison.s1 (yyparse):
18684 If __GNUC__ and YYPARSE_PARAM are both defined,
18685 declare yyparse to have a void * argument.
18686
18687 1996-12-18 Paul Eggert <eggert@gnu.org>
18688
18689 * bison.simple (yyparse):
18690 If __GNUC__ and YYPARSE_PARAM are both defined,
18691 declare yyparse to have a void * argument.
18692
18693 1996-12-17 Richard Stallman <rms@gnu.org>
18694
18695 * src/reduce.c (nbits): Add some casts.
18696
18697 1996-08-12 Richard Stallman <rms@gnu.org>
18698
18699 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
18700
18701 1996-08-12 Richard Stallman <rms@gnu.org>
18702
18703 * bison.simple: Test _MSDOS as well as _MSDOS_.
18704
18705 1996-07-31 Richard Stallman <rms@gnu.org>
18706
18707 * src/bison.s1:
18708 [__sun && __i386]: Include alloca.h.
18709
18710 1996-07-31 Richard Stallman <rms@gnu.org>
18711
18712 * bison.simple:
18713 [__sun && __i386]: Include alloca.h.
18714
18715 1996-07-30 Richard Stallman <rms@gnu.org>
18716
18717 * src/bison.s1: Comment change.
18718
18719 * src/bison.s1: Test _MSDOS_, not MSDOS.
18720
18721 1996-07-30 Richard Stallman <rms@gnu.org>
18722
18723 * bison.simple: Comment change.
18724
18725 * bison.simple: Test _MSDOS_, not MSDOS.
18726
18727 1996-06-01 Richard Stallman <rms@gnu.org>
18728
18729 * 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:
18730 Insert `_' macro around many string constants.
18731
18732 * src/main.c:
18733 Insert `_' macro around many string constants.
18734
18735 (main): Call setlocale, bindtextdomain and textdomain.
18736
18737 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
18738 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
18739 [ENABLE_NLS]: Include libintl.h.
18740 [ENABLE_NLS] (gettext): Define.
18741 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
18742 (N_, PACKAGE, LOCALEDIR): New macros.
18743
18744 1996-06-01 Richard Stallman <rms@gnu.org>
18745
18746 * POTFILES.in: New file.
18747
18748 * Makefile.in (allocate.o):
18749 Define target explicitly.
18750
18751 * Makefile.in (CFLAGS): Set to @CFLAGS@.
18752 (LDFLAGS): Set to @LDFLAGS@.
18753 (configure): Run autoconf only if preceding `cd' succeeds.
18754 (bison.s1): Redirect output to temporary file then move the
18755 temporary to the target, rather than redirecting directly to bison.s1.
18756 (clean): Remove config.status and config.log.
18757 (distclean): Don't remove config.status here.
18758
18759 1996-05-12 Richard Stallman <rms@gnu.org>
18760
18761 * src/bison.s1:
18762 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18763
18764 1996-05-12 Richard Stallman <rms@gnu.org>
18765
18766 * bison.simple:
18767 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18768
18769 1996-05-11 Richard Stallman <rms@gnu.org>
18770
18771 * src/bison.s1 (__yy_memcpy):
18772 Really reorder the args, as was supposedly done on Feb 14 1995.
18773 (yyparse): Calls changed accordingly.
18774
18775 1996-05-11 Richard Stallman <rms@gnu.org>
18776
18777 * Makefile.in (dist): Don't use $(srcdir).
18778
18779 * bison.simple (__yy_memcpy):
18780 Really reorder the args, as was supposedly done on Feb 14 1995.
18781 (yyparse): Calls changed accordingly.
18782
18783 1996-01-27 Richard Stallman <rms@gnu.org>
18784
18785 * src/output.c (output_rule_data):
18786 Test YYERROR_VERBOSE in the conditional
18787 around the definition of ttyname.
18788
18789 1995-12-29 Richard Stallman <rms@gnu.org>
18790
18791 * src/bison.s1:
18792 Fix line numbers in #line commands.
18793
18794 1995-12-29 Richard Stallman <rms@gnu.org>
18795
18796 * bison.simple:
18797 Fix line numbers in #line commands.
18798
18799 1995-12-27 Richard Stallman <rms@gnu.org>
18800
18801 * src/bison.s1 (YYPARSE_PARAM_DECL):
18802 In C++, make it always null.
18803 (YYPARSE_PARAM_ARG): New macro.
18804 (yyparse): Use YYPARSE_PARAM_ARG.
18805
18806 1995-12-27 Richard Stallman <rms@gnu.org>
18807
18808 * bison.simple (YYPARSE_PARAM_DECL):
18809 In C++, make it always null.
18810 (YYPARSE_PARAM_ARG): New macro.
18811 (yyparse): Use YYPARSE_PARAM_ARG.
18812
18813 1995-11-29 Richard Stallman <rms@gnu.org>
18814
18815 * doc/bison.texinfo:
18816 Describe literal string tokens, %raw, %no_lines, %token_table.
18817
18818 1995-11-29 Daniel Hagerty <hag@gnu.org>
18819
18820 * doc/bison.texinfo: Fixed update date
18821
18822 1995-10-16 Richard Stallman <rms@gnu.org>
18823
18824 * src/version.c: Version 1.25.
18825
18826 1995-10-16 Richard Stallman <rms@gnu.org>
18827
18828 * NEWS: *** empty log message ***
18829
18830 1995-10-16 Richard Stallman <rms@gnu.org>
18831
18832 * doc/bison.1, doc/bison.rnh:
18833 Add new options.
18834
18835 1995-10-15 Richard Stallman <rms@gnu.org>
18836
18837 * src/vmsgetargs.c, src/getargs.c:
18838 Added -n, -k, and -raw switches.
18839 (noparserflag, toknumflag, rawtoknumflag): New variables.
18840
18841 * src/symtab.h (SALIAS):
18842 New #define for adding aliases to %token.
18843 (struct bucket): Added `alias' field.
18844
18845 * src/reduce.c (reduce_grammar):
18846 Revise error message.
18847 (print_notices): Remove final `.' from error message.
18848
18849 * src/reader.c (reader_output_yylsp):
18850 New function.
18851 (readgram): Use `#if 0' around code that accepted %command
18852 inside grammar rules: The documentation doesn't allow it,
18853 and it will fail since the %command processors scan for the next %.
18854 (parse_token_decl): Extended the %token
18855 declaration to allow a multi-character symbol as an alias.
18856 (parse_thong_decl): New function.
18857 (read_declarations): Added %thong declarations.
18858 (read_declarations): Handle NOOP to deal with allowing
18859 % declarations as another means to specify the flags.
18860 (readgram): Allow %prec prior to semantics embedded in a rule.
18861 (skip_to_char, read_declarations, copy_definition)
18862 (parse_token_decl, parse_start_decl, parse_type_decl)
18863 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
18864 (get_type_name, copy_guard, copy_action, readgram)
18865 (get_type, packsymbols): Revised most error messages.
18866 Changed `fatal' to `warnxxx' to avoid aborting for error.
18867 Revised and use multiple warnxxx functions to avoid using VARARGS1.
18868 (read_declarations): Improve the error message for
18869 an invalid character. Do not abort.
18870 (read_declarations, copy_guard, copy_action): Use
18871 printable_version to avoid unprintable characters in printed output.
18872 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
18873 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
18874 Allow the type of a non-terminal can be given
18875 more than once, as long as all specifications give the same type.
18876
18877 * src/output.c:
18878 (output_headers, output_trailers, output, output_gram)
18879 (output_rule_data): Implement noparserflag variable.
18880 Implement toknumflag variable.
18881 (output): Call reader_output_yylsp to output LTYPESTR.
18882
18883 * src/main.c (main):
18884 If reader sees an error, don't process the grammar.
18885 (fatals): Updated to not use VARARGS1.
18886 (printable_version, int_to_string, warn, warni, warns, warnss)
18887 (warnsss): New error reporting functions. Avoid abort for error.
18888
18889 * src/lex.h:
18890 Added THONG and NOOP for alias processing.
18891 Added SETOPT for the new code that allows setting options with %flags.
18892
18893 * src/lex.c:
18894 Include getopt.h. Add some extern decls.
18895 (safegetc): New function to deal with EOF gracefully.
18896 (literalchar); new function to deal with reading \ escapes.
18897 (lex): Use literalchar.
18898 (lex): Implemented "..." tokens.
18899 (literalchar, lex, parse_percent_token): Made tokenbuffer
18900 always contain the token. This includes growing the token
18901 buffer while reading an integer.
18902 (parse_percent_token): Replaced if-else statement with percent_table.
18903 (parse_percent_token): Added % declarations as another
18904 way to specify the flags -n, -l, and -r. Also added hooks for
18905 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
18906 major changes to files.c.
18907 (lex) Retain in the incoming stream a character following
18908 an incorrect '/'.
18909 (skip_white_space, lex): Revised most error messages
18910 and changed fatal to warn to avoid aborting.
18911 (percent_table): Added %thong declarations.
18912
18913 * src/gram.h: Comment changes.
18914
18915 * src/files.c (openfiles, open_extra_files, done):
18916 Add faction flag
18917 and actfile file. Handle noparserflag. Both for -n switch.
18918
18919 * src/conflicts.c (resolve_sr_conflict):
18920 Remove use of alloca.
18921
18922 1995-06-01 Jim Meyering <meyering@gnu.org>
18923
18924 * doc/bison.texinfo: *** empty log message ***
18925
18926 1995-05-06 Richard Stallman <rms@gnu.org>
18927
18928 * src/bison.s1: Comment change.
18929
18930 1995-05-06 Richard Stallman <rms@gnu.org>
18931
18932 * bison.simple: Comment change.
18933
18934 1995-05-03 Richard Stallman <rms@gnu.org>
18935
18936 * src/version.c: Version now 1.24.
18937
18938 * src/bison.s1: Change distribution terms.
18939
18940 * src/version.c: Version now 1.23.
18941
18942 1995-05-03 Richard Stallman <rms@gnu.org>
18943
18944 * doc/bison.texinfo:
18945 Rewrite "Conditions for Using Bison".
18946 Update version to 1.24.
18947
18948 1995-05-03 Richard Stallman <rms@gnu.org>
18949
18950 * bison.simple: Change distribution terms.
18951
18952 1995-02-23 Richard Stallman <rms@gnu.org>
18953
18954 * src/files.c: Test __VMS_POSIX as well as VMS.
18955
18956 1995-02-14 Jim Meyering <meyering@gnu.org>
18957
18958 * src/bison.s1 (__yy_memcpy):
18959 Renamed from __yy_bcopy to avoid
18960 confusion. Reverse FROM and TO arguments to be consistent with
18961 those of memcpy.
18962
18963 1995-02-14 Jim Meyering <meyering@gnu.org>
18964
18965 * bison.simple (__yy_memcpy):
18966 Renamed from __yy_bcopy to avoid
18967 confusion. Reverse FROM and TO arguments to be consistent with
18968 those of memcpy.
18969
18970 1994-11-10 David J. MacKenzie <djm@gnu.org>
18971
18972 * NEWS: reformat
18973
18974 * NEWS: New file.
18975
18976 * Makefile.in (DISTFILES): Include NEWS.
18977
18978 * Makefile.in (DISTFILES):
18979 Include install-sh, not install.sh.
18980
18981 * configure.in: Update to Autoconf v2 macro names.
18982
18983 1994-10-05 David J. MacKenzie <djm@gnu.org>
18984
18985 * Makefile.in: fix typo
18986
18987 * Makefile.in (prefix, exec_prefix):
18988 Let configure set them.
18989
18990 1994-09-28 David J. MacKenzie <djm@gnu.org>
18991
18992 * Makefile.in: Set datadir to $(prefix)/share.
18993
18994 1994-09-15 Richard Stallman <rms@gnu.org>
18995
18996 * src/bison.s1:
18997 Update copyright notice and GPL version.
18998
18999 1994-09-15 Richard Stallman <rms@gnu.org>
19000
19001 * bison.simple:
19002 Update copyright notice and GPL version.
19003
19004 1994-07-12 Richard Stallman <rms@gnu.org>
19005
19006 * src/reduce.c, src/reader.c:
19007 entered into RCS
19008
19009 1994-05-05 David J. MacKenzie <djm@gnu.org>
19010
19011 * Makefile.in: entered into RCS
19012
19013 1994-03-26 Richard Stallman <rms@gnu.org>
19014
19015 * src/bison.s1: entered into RCS
19016
19017 1994-03-26 Richard Stallman <rms@gnu.org>
19018
19019 * bison.simple: entered into RCS
19020
19021 1994-03-25 Richard Stallman <rms@gnu.org>
19022
19023 * src/main.c: entered into RCS
19024
19025 1994-03-24 Richard Stallman <rms@gnu.org>
19026
19027 * src/conflicts.c: entered into RCS
19028
19029 1994-01-02 Richard Stallman <rms@gnu.org>
19030
19031 * Makefile.in: *** empty log message ***
19032
19033 1993-11-21 Richard Stallman <rms@gnu.org>
19034
19035 * src/bison.s1: *** empty log message ***
19036
19037 1993-11-21 Richard Stallman <rms@gnu.org>
19038
19039 * doc/bison.texinfo: entered into RCS
19040
19041 * doc/bison.texinfo: *** empty log message ***
19042
19043 1993-11-21 Richard Stallman <rms@gnu.org>
19044
19045 * bison.simple: *** empty log message ***
19046
19047 1993-10-25 David J. MacKenzie <djm@gnu.org>
19048
19049 * doc/bison.texinfo: *** empty log message ***
19050
19051 1993-10-19 Richard Stallman <rms@gnu.org>
19052
19053 * src/bison.s1: *** empty log message ***
19054
19055 1993-10-19 Richard Stallman <rms@gnu.org>
19056
19057 * bison.simple: *** empty log message ***
19058
19059 1993-10-14 Richard Stallman <rms@gnu.org>
19060
19061 * src/bison.s1: *** empty log message ***
19062
19063 1993-10-14 Richard Stallman <rms@gnu.org>
19064
19065 * bison.simple: *** empty log message ***
19066
19067 1993-09-14 David J. MacKenzie <djm@gnu.org>
19068
19069 * doc/bison.texinfo: *** empty log message ***
19070
19071 1993-09-13 Noah Friedman <friedman@gnu.org>
19072
19073 * Makefile.in: *** empty log message ***
19074
19075 1993-09-10 Richard Stallman <rms@gnu.org>
19076
19077 * src/conflicts.c: *** empty log message ***
19078
19079 * src/system.h: entered into RCS
19080
19081 1993-09-10 Richard Stallman <rms@gnu.org>
19082
19083 * doc/bison.1: entered into RCS
19084
19085 1993-09-06 Noah Friedman <friedman@gnu.org>
19086
19087 * src/version.c: entered into RCS
19088
19089 1993-09-06 Noah Friedman <friedman@gnu.org>
19090
19091 * Makefile.in: *** empty log message ***
19092
19093 1993-07-30 David J. MacKenzie <djm@gnu.org>
19094
19095 * Makefile.in: *** empty log message ***
19096
19097 1993-07-24 Richard Stallman <rms@gnu.org>
19098
19099 * src/bison.s1: *** empty log message ***
19100
19101 1993-07-24 Richard Stallman <rms@gnu.org>
19102
19103 * bison.simple: *** empty log message ***
19104
19105 1993-07-08 David J. MacKenzie <djm@gnu.org>
19106
19107 * Makefile.in: *** empty log message ***
19108
19109 1993-07-04 Richard Stallman <rms@gnu.org>
19110
19111 * src/bison.s1: *** empty log message ***
19112
19113 1993-07-04 Richard Stallman <rms@gnu.org>
19114
19115 * bison.simple: *** empty log message ***
19116
19117 1993-06-26 David J. MacKenzie <djm@gnu.org>
19118
19119 * src/getargs.c: entered into RCS
19120
19121 1993-06-26 David J. MacKenzie <djm@gnu.org>
19122
19123 * doc/bison.texinfo: *** empty log message ***
19124
19125 * doc/bison.1: New file.
19126
19127 1993-06-25 Richard Stallman <rms@gnu.org>
19128
19129 * src/getargs.c: New file.
19130
19131 1993-06-16 Richard Stallman <rms@gnu.org>
19132
19133 * src/bison.s1: *** empty log message ***
19134
19135 1993-06-16 Richard Stallman <rms@gnu.org>
19136
19137 * bison.simple: *** empty log message ***
19138
19139 1993-06-03 Richard Stallman <rms@gnu.org>
19140
19141 * src/bison.s1: New file.
19142
19143 1993-06-03 Richard Stallman <rms@gnu.org>
19144
19145 * doc/bison.texinfo: *** empty log message ***
19146
19147 1993-06-03 Richard Stallman <rms@gnu.org>
19148
19149 * bison.simple: New file.
19150
19151 1993-05-19 Richard Stallman <rms@gnu.org>
19152
19153 * doc/bison.texinfo: New file.
19154
19155 1993-05-07 Noah Friedman <friedman@gnu.org>
19156
19157 * Makefile.in: *** empty log message ***
19158
19159 1993-04-28 Noah Friedman <friedman@gnu.org>
19160
19161 * src/reader.c: *** empty log message ***
19162
19163 1993-04-23 Noah Friedman <friedman@gnu.org>
19164
19165 * src/alloc.h: entered into RCS
19166
19167 1993-04-20 David J. MacKenzie <djm@gnu.org>
19168
19169 * src/version.c: *** empty log message ***
19170
19171 * src/files.c, src/allocate.c:
19172 entered into RCS
19173
19174 * src/reader.c: *** empty log message ***
19175
19176 * src/lex.c: entered into RCS
19177
19178 * src/conflicts.c: New file.
19179
19180 * src/symtab.c: entered into RCS
19181
19182 * src/alloc.h: New file.
19183
19184 * src/LR0.c: entered into RCS
19185
19186 1993-04-18 Noah Friedman <friedman@gnu.org>
19187
19188 * src/reader.c: New file.
19189
19190 * src/version.c: *** empty log message ***
19191
19192 1993-04-18 Noah Friedman <friedman@gnu.org>
19193
19194 * Makefile.in: *** empty log message ***
19195
19196 1993-04-17 Noah Friedman <friedman@gnu.org>
19197
19198 * Makefile.in: *** empty log message ***
19199
19200 1993-04-15 Richard Stallman <rms@gnu.org>
19201
19202 * src/main.c, src/files.c:
19203 New file.
19204
19205 1993-04-15 Noah Friedman <friedman@gnu.org>
19206
19207 * configure.in: entered into RCS
19208
19209 * configure.in: *** empty log message ***
19210
19211 * configure.in: New file.
19212
19213 1993-04-14 Richard Stallman <rms@gnu.org>
19214
19215 * Makefile.in: New file.
19216
19217 1993-04-13 Richard Stallman <rms@gnu.org>
19218
19219 * src/version.c: New file.
19220
19221 1993-03-25 Richard Stallman <rms@gnu.org>
19222
19223 * src/output.c: entered into RCS
19224
19225 1992-09-25 Richard Stallman <rms@gnu.org>
19226
19227 * configure.bat: entered into RCS
19228
19229 1992-06-22 Richard Stallman <rms@gnu.org>
19230
19231 * src/vmsgetargs.c: entered into RCS
19232
19233 1992-06-22 Richard Stallman <rms@gnu.org>
19234
19235 * doc/bison.rnh: entered into RCS
19236
19237 1992-04-20 David J. MacKenzie <djm@gnu.org>
19238
19239 * README: entered into RCS
19240
19241 1992-01-22 Richard Stallman <rms@gnu.org>
19242
19243 * src/machine.h: entered into RCS
19244
19245 1991-12-21 Richard Stallman <rms@gnu.org>
19246
19247 * src/lalr.c, src/closure.c:
19248 entered into RCS
19249
19250 1991-12-20 Richard Stallman <rms@gnu.org>
19251
19252 * src/state.h: entered into RCS
19253
19254 1991-12-18 Richard Stallman <rms@gnu.org>
19255
19256 * src/print.c, src/nullable.c, src/derives.c:
19257 entered into RCS
19258
19259 1991-11-03 David J. MacKenzie <djm@gnu.org>
19260
19261 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
19262 entered into RCS
19263
19264 1988-09-09 Richard Stallman <rms@gnu.org>
19265
19266 * src/bison.hairy: entered into RCS
19267
19268 1987-12-16 Richard Stallman <rms@gnu.org>
19269
19270 * REFERENCES: entered into RCS
19271
19272
19273 -----
19274
19275 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
19276 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
19277 Free Software Foundation, Inc.
19278
19279 Copying and distribution of this file, with or without
19280 modification, are permitted provided the copyright notice and this
19281 notice are preserved.
19282
19283 $Id$