1 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3 Use the new code_props interface for rule actions.
4 * src/symlist.h (symbol_list): Replace action, action_location, and
5 used members with a code_props action_props member.
6 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7 grammar_midrule_action, grammar_current_rule_merge_set,
8 grammar_current_rule_symbol_append, packgram): Update.
9 * src/scan-code.h (translate_rule_action): Remove, no longer used.
10 * src/scan-code.l (handle_action_dollar): Update.
11 (translate_rule_action): Remove, no longer used.
12 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
14 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
16 Use the new code_props interface in parse-gram.y.
17 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
18 Update all uses of translate_* functions to use the new code_props
19 interface and to use gram_scanner_last_string_free and
20 code_scanner_last_string_free where possible.
21 (grammar_declaration): symbol_list_destructor_set and
22 symbol_list_printer_set now perform the translation, so don't do it
23 here. Use gram_scanner_last_string_free where possible.
24 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
25 translate_code): Remove, no longer used.
26 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
27 symbol_list_printer_set): Perform code translation here rather than
28 depending on the caller to do so.
30 * src/symlist.h (struct symbol_list): Correct some documentation typos.
31 * src/scan-gram.h (gram_last_string): Remove declaration.
32 * src/scan-gram.l (last_string): Declare it static.
34 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
36 Encapsulate code properties and related functionality for the various
37 destructors, printers, and actions into a code_props structure and
38 interface. This patch merely implements code_props in scan-code.h and
39 scan-code.l. Future patches will rewrite other modules to use it.
41 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
42 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
43 consistently initialize const structs that have an empty location
45 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
46 to ensure consistency.
47 * src/scan-code.h (code_props): New structure.
48 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
49 function, macro, and const global variable for initializing a
50 code_props with no code.
51 (code_props_plain_init, code_props_symbol_action_init,
52 code_props_rule_action_init, code_props_translate_code): The rest of
53 the new code_props functional interface. Among other things, the init
54 functions set the code_props kind field so that
55 code_props_translate_code will know whether to behave like
56 translate_symbol_action, translate_rule_action, or translate_code.
57 These old translate functions must remain until all other modules are
58 updated to use the new code_props interface.
59 (code_scanner_last_string_free): New function similar to
60 gram_scanner_last_string_free.
61 (code_scanner_free): Add documentation.
62 * src/scan-code.l: Implement the new interface.
63 (code_lex): Make it static, add a code_props* argument, and remove the
65 (last_string): New static global similar to the one in scan-gram.l.
66 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
68 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
69 code_props since Bison may one day use this information for destructors
71 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
72 (handle_action_dollar): Use symbol_list_n_get and set used flag
73 directly since symbol_list_n_used_set is removed.
74 (translate_action): Add a code_props* argument and remove the rule,
75 action, and location arguments. Pass the code_props* on to code_lex.
76 (translate_rule_action, translate_symbol_action, translate_code):
77 Rewrite as wrappers around the new code_props interface.
78 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
79 it would eventually need to break the encapsulation of code_props.
81 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
83 * etc/.cvsignore: New.
85 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
87 Add maintainer-push-check to run maintainer-check using push parsing in
88 place of pull parsing where available.
89 * Makefile.am (maintainer-push-check): New.
90 * data/bison.m4 (b4_use_push_for_pull_if): New.
91 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
92 appropriately based on their existing values.
93 (yypush_parse): Don't print push-parser-specific diagnostics if push
94 parsing is being used in place of pull parsing.
95 * data/yacc.c: If push parsing should replace pull parsing, redirect to
97 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
98 variable, and insert b4_use_push_for_pull_flag into muscles.
99 * tests/Makefile.am (maintainer-push-check): New.
101 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
103 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
104 (whether successful or failed) so that yypush_parse can be invoked
105 again to start a new parse using the same yypstate.
106 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
107 check multiple yypull_parse invocations on the same yypstate. For pull
108 mode, extend to check multiple yyparse invocations.
109 (Exploding the Stack Size with Alloca): Extend to try with
111 (Exploding the Stack Size with Malloc): Likewise.
113 * tests/calc.at (Simple LALR Calculator): Don't specify
114 %skeleton "push.c" since %push-pull-parser implies that now.
115 * tests/headers.at (export YYLTYPE): Don't check for the push
116 declarations. Otherwise, this test case can't be used to see if push
117 mode can truly emulate pull mode.
118 * tests/input.at (Torturing the Scanner): Likewise.
119 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
120 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
121 AT_YACC_IF, which now includes the case of push mode since %skeleton
122 need not be used for push mode. This will be more intuitive once
123 push.c is renamed to yacc.c.
125 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
127 For push mode, convert yyparse from a macro to a function, invoke yylex
128 instead of passing a yylexp argument to yypull_parse, and don't
129 generate yypull_parse or yyparse unless %push-pull-parser is declared.
130 Discussed starting at
131 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
132 * data/bison.m4 (b4_pull_if): New.
133 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
134 * data/push.c: Improve M4 quoting a little.
135 (b4_generate_macro_args, b4_parenthesize): Remove.
136 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
137 any time a pull parser is requested.
138 Don't #define this as a wrapper around yypull_parse. Instead, when
139 both push and pull are requested, make it a function that does that
141 (yypull_parse): If there's a b4_prefix, #define this to
142 b4_prefix[pull_parse] when both push and pull are requested.
143 Don't define this as a function unless both push and pull are
145 Remove the yylexp argument and hard-code yylex invocation instead.
146 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
148 * src/getargs.c (pull_parser): New global initialized to true.
149 * getargs.h (pull_parser): extern it.
150 * src/output.c (prepare): Insert pull_flag muscle.
151 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
152 (prologue_declaration): Set both push_parser and pull_parser = true for
153 %push-pull-parser. Set push_parser = true and pull_parser = false for
155 * src/scan-gram.l: Don't accept %push_parser as an alternative to
156 %push-parser since there's no backward-compatibility concern here.
157 Scan %push-pull-parser.
158 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
159 instead of %push-parser.
160 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
161 prototype it in the module that calls yyparse.
162 * tests/input.at (Torturing the Scanner): Likewise.
163 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
165 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
167 Update etc/bench.pl. Optimize push mode a little (the yyn change
168 deserves most of the credit).
169 * Makefile.am (SUBDIRS): Add etc subdirectory.
170 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
171 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
172 yytoken, yyval, and yyloc declarations to...
173 (yyparse or yypush_parse): ... here to improve performance. For
174 yypush_parse invocations after the first, be sure to assign yyn its old
176 (yypstate_new): Don't bother initializing the yyresult field since the
177 initial value isn't used.
178 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
179 remove the #define that, in push mode, set it to yyps->NAME.
180 * etc/Makefile.am: New.
181 * etc/bench.pl: Remove and build it instead from...
182 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
183 "tests/bison" from the build directory by default rather than just
184 invoking "bison" from $PATH.
185 (calc_grammar): Update push parser code: don't declare yylval globally,
186 don't define yyparse_wrapper, and don't #define yyparse.
187 (bench_grammar): Update to check all working combinations of yacc.c,
188 push.c, impure, pure, pull, and push.
190 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
192 For push mode, add pull wrappers around yypush_parse.
193 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
194 (yypull_parse): New function wrapping yypush_parse.
195 (yyparse): New #define wrapping yypull_parse.
196 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
198 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
199 prototype yylex in the module that calls yyparse, and don't prototype
200 yyparse there. Otherwise, the yyparse expansion won't compile.
201 * tests/input.at (Torturing the Scanner): Likewise.
203 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
205 Enable push parsers to operate in impure mode. Thus, %push-parser no
206 longer implies %pure-parser. The point of this change is to move
207 towards being able to test the push parser code by running the entire
208 test suite as if %push-parser had been declared.
209 * data/push.c (yypush_parse): For impure mode, remove the
210 yypushed_char, yypushed_val, and yypushed_loc arguments.
211 Instead, declare these as local variables initialized to the global
212 yychar, yylval, and yylloc.
213 For the first yypush_parse invocation only, restore the initial values
214 of these global variables when it's time to read a token since they
215 have been overwritten.
216 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
218 * tests/calc.at (Simple LALR(1) Calculator): Always declare
219 %pure-parser along with %push-parser since this test case was designed
220 for pure push parsers.
221 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
222 (AT_YACC_OR_PUSH_IF): New.
223 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
224 add a note that it's still wrong for some cases (as it has been for a
226 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
227 %push-parser no longer implies %pure-parser.
229 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
231 Remove some unnecessary differences between the pull parser code and
232 the push parser code. This patch enables yynerrs in push mode.
233 * data/push.c: Reformat M4 a little.
234 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
235 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
236 because push mode is on. Instead, if pure mode is on, move yynerrs
238 (b4_declare_parser_state_variables): ... here.
239 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
240 to yyps->NAME so it can be used in yypush_parse.
241 (yypush_parse): Don't omit uses of yynerrs in push mode.
243 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
245 Fix bug such that the first pushed token's value and location are
246 sometimes overwritten (sometimes by %initial-action) before being used.
247 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
248 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
249 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
250 more closely mimic the pull parser logic.
251 Don't copy the pushed token to yychar, yylval, and yylloc until it's
252 time to read a token, which is after any initialization of yylval and
254 (gottoken): Rename label to...
255 (yyread_pushed_token): ... for clarity and to avoid infringing on the
258 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
260 Rearrange initialization of the parser state variables so that the
261 skeleton doesn't have to have a copy for pull mode and another for push
262 mode. This patch also fixes at least a bug such that yylloc was not
263 initialized (with b4_location_initial_line and
264 b4_location_initial_column) upon calling yypush_parse. However, that
265 initialization now overwrites the first token's location;
266 %initial-action assigning @$ already did the same thing, and both bugs
267 will be fixed in a later patch.
268 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
269 (b4_declare_parser_state_variables): Remove initialization of yytoken,
270 yyss, yyvs, yyls, and yystacksize.
271 (yypstate_new): Remove initialization of some yypstate fields: yystate,
272 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
274 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
275 yyps->NAME so it can be used in yypush_parse.
276 (yyparse or yypush_parse): For yypush_parse, don't print the
277 "Starting parse" diagnostic for invocations after the first.
278 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
279 yypush_parse, only do it for the first invocation.
280 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
281 initialization to occur in yypush_parse but only on the first
284 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
286 * data/push.c: Add CPP guards around push parser declarations in both
287 the header and the code file.
288 In the code file, move the push parser declarations to the same place
289 they appear in the header file.
290 Clean up the M4 some, especially the inconsistent underquoting in
291 some b4_c_function_def and b4_c_function_decl uses.
293 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
295 Encapsulate the push parser state variables into an M4 macro so the
296 push skeleton doesn't have to list them again for pull mode's yyparse.
297 For push mode, remove yypush_parse's local equivalents of these
298 variables to eliminate unnecessary copying between the two sets at
299 run-time. This patch also fixes at least a bug related to multiple
300 %initial-action invocations in push mode.
301 * data/push.c (b4_declare_parser_variables): Rename to...
302 (b4_declare_scanner_communication_variables): ... this for clarity and
304 (b4_declare_yyparse_variables): Remove and move its contents to the one
305 spot where it was invoked.
306 (b4_declare_parser_state_variables): New macro containing the parser
307 state variables required by push mode.
308 (struct yypstate): Replace all fields but yynew with
309 b4_declare_parser_state_variables.
310 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
311 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
312 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
313 (yyparse or yypush_parse): For yyparse in pull mode, replace local
314 parser state variable declarations with
315 b4_declare_parser_state_variables.
316 Don't initialize parser state variables when calling yypush_parse since
317 yypstate_new already does that.
318 Invoke the user's initial action only upon the first yypush_parse
320 Remove all code that copies between the local parser state variables
323 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
325 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
326 prevent a name collision in a future patch where these names will
327 sometimes be #define'd.
328 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
329 since it no longer has the same name as the existing argument.
330 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
332 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
333 and Joel E. Denny <jdenny@ces.clemson.edu>
335 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
336 that the argument is case-insensitive, and there's no `=' here.
337 For the %skeleton entry, mention that %language is better.
338 (Bison Options): Likewise for --language and --skeleton. Move the
339 --skeleton entry so that the `Tuning the parser' section is sorted
340 alphabetically on long options.
341 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
342 %language directive in detail here; cross-reference the %language
343 documentation instead.
344 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
345 `%require "2.3b"' so that the example is always up-to-date.
346 (Bison Symbols): Add entries for %language and %skeleton.
347 * examples/extexi (normalize): Instead of replacing every %require
348 argument with the current Bison version, just substitute for
349 `@value{VERSION}'. This guarantees that we're testing what actually
350 appears in the documentation.
351 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
352 rather than `@VERSION@'.
354 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
356 * NEWS: Reword the %language news a bit, and put it earlier.
358 * src/getargs.c (skeleton_arg): Last arg is now location const *.
359 Rewrite to simplify the logic.
360 (language_argmatch): Likewise.
361 (program_name): We now own this var.
362 * src/getargs.h (struct bison_language): Use char[] rather than
365 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
367 * src/complain.c (program_name): Remove decl; no longer needed.
368 * src/main.c (program_name): Remove; now belongs to getargs.
370 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
372 * NEWS: Document %language.
374 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
376 * data/c-skel.m4, data/c++-skel.m4: New files.
377 * data/glr.c: Complain on push parsers.
379 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
381 (Directives): Document %language and %skeleton.
382 (Command line): Document -L.
384 * examples/extexi: Rewrite %require directive.
385 * examples/calc++/Makefile.am: Pass VERSION to extexi.
387 * src/files.c (compute_exts_from_gc): Look in language structure
389 (compute_file_name_parts): Check whether .tab should be added.
390 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
391 (language, skeleton_arg, language_argmatch): New.
392 (long_options): Add --language.
393 (getargs): Use skeleton_arg, add -L/--language.
394 * src/getargs.h: Include location.h.
395 (struct bison_language, language, skeleton_arg, language_argmatch): New.
396 * src/output.c (prepare): Pick default skeleton from struct language.
397 Don't dispatch C skeletons here.
398 * src/parse-gram.y (PERCENT_LANGUAGE): New.
399 (prologue_declaration): Add "%language" rule, use skeleton_arg.
400 * src/scan-gram.l ("%language"): New rule.
402 * tests/calc.at: Test %skeleton and %language.
403 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
404 (AT_GLR_IF): Look for %skeleton "glr.cc".
405 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
406 (AT_YACC_IF): Reject %language.
408 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
410 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
411 since it wasn't used; only the typedef name 'semantic_type' is needed.
412 Also, omit trailing white space.
414 * bootstrap: Sync from coreutils.
415 (gnulib_extra_files): Add build-aux/announce.gen.
416 (slurp): Adjust .gitignore files like .cvsignore files.
417 * build-aux/announce-gen: Remove from CVS, since bootstrap
420 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
422 Make %push-parser imply %pure-parser. This fixes several bugs; see
423 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
424 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
426 * data/push.c: Don't bother testing b4_push_if when deciding whether
427 to expand b4_declare_parser_variables globally.
428 (yypush_parse): Likewise in here.
430 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
431 (yy_reduce_print): Reformat M4 for readability.
433 2006-12-15 Bob Rossi <bob@brasko.net>
434 and Joel Denny <jdenny@ces.clemson.edu>
436 * data/push.c (yypstate): Add typedef, and update all uses of
437 struct yypstate to just yypstate.
438 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
440 2006-12-14 Bob Rossi <bob@brasko.net>
442 * data/push.c (yypush_parse): Declare prototype regardless of
445 2006-12-14 Bob Rossi <bob@brasko.net>
447 * data/push.c (yyparse): Remove the prototype and the #define when in
450 2006-12-13 Bob Rossi <bob@brasko.net>
452 * data/push.c (yypstate_init): Rename to...
453 (yypstate_new): ... this and use b4_c_function_def.
454 (yypstate_delete): New.
455 (yypush_parse): Change parameters yynval and yynlloc to be const.
456 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
457 yypstate_delete functions.
459 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
461 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
462 strange test case titles. Reported by Bob Rossi.
464 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
466 * TODO: Add pointer to Sylvain Schmitz's work on static detection
467 of potential ambiguities in GLR grammers.
469 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
471 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
472 `bison ', use m4_index instead of m4_substr since chopping up a string
473 containing M4-special characters causes problems here.
475 Fix a couple of bugs related to special characters in user-specified
476 file names, and make it easier for skeletons to compute output file
477 names with the same file name prefix as Bison-computed output file
479 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
480 b4_parser_file_name and b4_spec_defines_file instead of
481 @output_parser_name@ and @output_header_name@, which are now redundant.
482 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
483 b4_parser_file_name, b4_spec_defines_file, and the new
484 @basename(FILENAME@) instead of @output_parser_name@ and
485 @output_header_name@, which inappropriately escaped the file names as
487 * src/files.c (all_but_ext): Remove static qualifier.
488 (compute_output_file_names): Move `free (all_but_ext)' to...
489 (output_file_names_free): ... here since all_but_ext is needed later.
490 * src/files.h (all_but_ext): Extern.
491 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
492 exactly what MUSCLE_INSERT_STRING used to do.
493 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
494 characters are escaped properly.
495 * src/output.c (prepare): Define muscle file_name_all_but_ext as
497 For pkgdatadir muscle, maintain previous functionality by using
498 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
499 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
500 digraphs would never be expanded. Hopefully no one has M4-special
501 characters in his Bison installation path.
502 * src/scan-skel.l: Don't parse @output_header_name@ and
503 @output_parser_name@ anymore since they're now redundant.
504 In @output, use decode_at_digraphs.
505 Parse a new @basename command that invokes last_component.
506 (decode_at_digraphs): New.
507 (BASE_QPUTS): Remove unused.
508 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
509 (Output file name): New tests.
511 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
513 Warn about output files that are generated by the skeletons and that
514 conflict with other output files.
515 * data/glr.c: Don't generate the header file here when glr.cc does.
516 * src/files.c (file_names, file_names_count): New static globals.
517 (compute_output_file_names): Invoke output_file_name_check for files
518 not generated by the skeletons and remove existing checks.
519 (output_file_name_check): New function that warns about conflicting
521 (output_file_names_free): Free file_names.
522 * src/files.h (output_file_name_check): Declare.
523 * src/scan-skel.l: Invoke output_file_name_check for files generated by
525 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
526 (Conflicting output files): New tests.
528 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
530 * doc/bison.texinfo: Fix a couple of typos.
532 2006-12-08 Bob Rossi <bob@brasko.net>
534 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
536 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
538 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
539 (yypush_parse): Rename yypvars argument to yyps and remove redundant
541 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
542 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
544 2006-12-07 Bob Rossi <bob@brasko.net>
545 and Joel Denny <jdenny@ces.clemson.edu>
547 * data/push.c (yypvarsinit): Change return type from void* to struct
548 yypvars*. No longer cast to void* on return.
549 (struct yypvars): Remove yylen since it need not be remembered between
550 yypushparse invocations.
551 (yypushparse): Don't copy between yylen and pv->yylen.
553 2006-12-05 Bob Rossi <bob@brasko.net>
555 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
556 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
557 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
558 (struct yypvars): Remove b4_declare_parser_variables.
559 (yypvarsinit): Remove init code for removed variables.
560 (global scope): Do not declare b4_declare_parser_variables if
562 (yypushparse): Add b4_declare_parser_variables.
563 Init new local variables, and remove init code for removed
566 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
567 and yyparse for other modes.
568 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
569 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
570 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
571 (AT_PURE_LEX_IF): True if pure or push parser.
573 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
575 Document Yacc prologue alternatives and default %destructor's and
576 %printer's as experimental. Don't mention Java yet. Discussed at
577 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
578 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
579 (2.3a): Annotate this entry to say the old forms of these features were
581 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
582 Bison Symbols): Say they're experimental. Comment out any mention
583 of Java (we'll want this back eventually).
585 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
587 Support a file name argument to %defines. Deprecate `=' in
588 %file-prefix, %name-prefix, and %output. Discussed at
589 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
590 * NEWS (2.3a+): Mention.
591 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
592 form of %defines, and remove `=' from entries for %file-prefix,
593 %name-prefix, and %output.
594 * src/parse-gram.y (prologue_declaration): Implement.
595 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
596 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
597 all but one occurrence of %name-prefix.
598 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
599 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
600 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
601 occurrence of each of %file-prefix and %output. Add check for %defines
603 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
604 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
605 Remove the `=' from %output.
607 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
609 Don't escape $ in test case titles since Autoconf 2.61 now does that
611 * tests/actions.at (Default %printer and %destructor are not for error
612 or $undefined): Here.
613 (Default %printer and %destructor are not for $accept): Here.
614 * tests/input.at (Invalid $n and @n): Here.
616 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
618 Rename <!> to <>. Discussed starting at
619 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
620 * NEWS (2.3a+): Update.
621 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
623 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
624 * src/scan-gram.l (INITIAL): Implement.
625 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
626 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
628 * tests/actions.at (Default tagless %printer and %destructor,
629 Default tagged and per-type %printer and %destructor,
630 Default %printer and %destructor are not for error or $undefined,
631 Default %printer and %destructor are not for $accept,
632 Default %printer and %destructor for mid-rule values): Update.
633 * tests/input.at (Default %printer and %destructor redeclared,
634 Unused values with default %destructor): Update.
636 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
638 Don't let %prec take a nonterminal.
639 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
641 * tests/input.at (%prec takes a token): New test checking that %prec
642 won't take a nonterminal.
644 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
646 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
647 it was double-quoted.
648 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
649 grammar is maintained with Bison's highest standards.
650 * src/getargs.c: Fix some typos in Doxygen comments.
652 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
654 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
655 later. Reported by Paul Eggert in
656 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
657 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
658 * src/scan-code.l (translate_action): Don't bother invoking
659 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
660 (code_scanner_free): Instead of invoking
661 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
663 * src/scan-gram.l (gram_scanner_free): Likewise.
664 * src/scan-skel.l (scan_skel): Likewise.
666 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
668 * src/files.c (tr): Change return type to void.
669 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
670 has been called previously for the same key.
671 (muscle_find): Return storage instead of value so that
672 --enable-gcc-warnings doesn't produce warnings that the return discards
673 const. aver that the value and storage are the same since storage
674 could potentially be NULL when value is not.
675 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
678 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
680 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
681 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
682 us a slightly cleaner distribution, and also works.
683 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
686 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
687 and Paul Eggert <eggert@cs.ucla.edu>
689 Don't let Bison leak memory except when it complains.
690 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
691 (spec_defines_file, dir_prefix): Now char *, not const char *,
692 since they are freed.
693 * src/files.c: Likewise.
694 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
696 (tr): Now operates in-place. All uses changed.
697 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
699 (compute_file_name_parts, compute_output_file_names): Don't store
700 read-only data in variables that will be freed.
701 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
702 src_extension, and header_extension.
703 (output_file_names_free): New public function to free
704 spec_verbose_file, spec_graph_file, spec_defines_file,
705 parser_file_name, and dir_prefix.
706 * src/getargs.c (getargs): Don't store read-only data in variables that
708 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
709 (which previously existed but was unused), and quotearg_free.
710 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
711 * src/muscle_tab.c: Likewise.
712 (muscle_entry): Make the value char const *,
713 and add a new storage member that is char * and can be freed.
714 (muscle_entry_free): New private function.
715 (muscle_init): Use it instead of free.
716 (muscle_insert, muscle_grow): Update and use new storage member.
717 (muscle_code_grow): Free the string passed to muscle_grow
718 since it's not needed anymore.
719 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
720 add a new `char *code' member.
721 ("{...}"): Declare semantic type as code.
722 * src/scan-code.h (translate_rule_action):
723 (translate_symbol_action, translate_code, translate_action): Return
724 `char const *' rather than `char *' since external code should not free
726 * src/scan-code.l: Likewise.
727 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
728 which is "{...}" in the parser.
729 * tests/Makefile.am (maintainer-check-valgrind): Set
730 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
732 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
734 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
735 expecting a non-zero exit status sets --leak-check=summary and
736 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
737 this case, and we don't want to hear about it.
739 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
741 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
742 instead of from the template, to simplify configuration a bit.
743 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
744 and m4/wint_t.m4, as they are needed with the latest gnulib.
746 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
748 Disable unset/unused mid-rule value warnings by default, and recognize
749 --warnings=midrule-values to enable them. Discussed starting at
750 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
751 * NEWS (2.3a+): Mention.
752 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
753 warnings): Add entry for midrule-values subargument.
754 * src/reader.c (symbol_should_be_used): Don't return true just because
755 the value is a set/used mid-rule value unless
756 --warnings=midrule-values was specified.
757 * tests/input.at (Unused values, Unused values before symbol
758 declarations): Run tests with and without --warnings=midrule-values.
760 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
761 than LIST_FREE directly.
763 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
765 Finish implementing --warnings=error, which should not be implied by
766 --warnings=all (or by its synonyms -W and --warnings without
768 * src/complain.c (set_warning_issued): New function to report that
769 warnings are being treated as errors and to record an error if so.
771 (warn_at, warn): ... here.
772 * src/getargs.c (warnings_args, warnings_types): Reorder so that
773 "error - warnings are errors" does not appear above "all - all of the
775 (getargs): For -W and --warnings without subarguments, don't let
776 FLAGS_ARGMATCH set warnings_error in warnings_flag.
777 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
779 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
781 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
782 empty subargument list. For example: `bison --warnings= parser.y'.
784 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
786 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
787 the parser header file so that gcc doesn't warn.
789 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
791 Split the default %destructor/%printer into two kinds: <*> and <!>.
792 Discussed starting at
793 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
794 * NEWS (2.3a+): Mention.
795 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
796 previous change today related to mid-rules.
797 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
798 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
799 (TYPE_TAG_ANY): Add as <*>.
800 (TYPE_TAG_NONE): Add as <!>.
801 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
803 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
804 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
805 * src/symlist.c (symbol_list_default_new): Split into tagged and
807 (symbol_list_destructor_set, symbol_list_printer_set): Split
808 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
809 SYMLIST_DEFAULT_TAGLESS.
810 * src/symlist.h: Update symbol_list_default*_new prototypes.
811 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
812 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
813 * src/symtab.c (default_destructor, default_destructor_location,
814 default_printer, default_printer_location): Split each into tagged and
816 (symbol_destructor_get, symbol_destructor_location_get,
817 symbol_printer_get, symbol_printer_location_get): Implement tagged
818 default and tagless default cases.
819 (default_destructor_set, default_printer_set): Split each into tagged
820 and tagless versions.
821 * src/symtab.h: Update prototypes.
822 * tests/actions.at (Default %printer and %destructor): Rename to...
823 (Default tagless %printer and %destructor): ... this, and extend.
824 (Per-type %printer and %destructor): Rename to...
825 (Default tagged and per-type %printer and %destructor): ... this, and
827 (Default %printer and %destructor for user-defined end token): Extend.
828 (Default %printer and %destructor are not for error or $undefined):
830 (Default %printer and %destructor are not for $accept): Update.
831 (Default %printer and %destructor for mid-rule values): Extend.
832 * tests/input.at (Default %printer and %destructor redeclared): Extend.
833 (Unused values with default %destructor): Extend.
835 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
837 Don't apply the default %destructor/%printer to an unreferenced midrule
839 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
840 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
841 like $@n instead of just @n so that the default %destructor/%printer
842 logic doesn't see them as user-defined symbols.
843 (symbol_is_dummy): Check for both forms of the name.
844 * src/reader.c (packgram): Remove the `$' from each midrule symbol
845 name for which the midrule value is referenced in any action.
846 * tests/actions.at (Default %printer and %destructor for mid-rule
848 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
849 for change to dummy symbol names.
851 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
853 Warn about unset midrule $$ if the corresponding $n is used.
854 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
856 (packgram): Before invoking grammar_rule_check on any rule, make sure
857 all actions have already been scanned in order to set `used' flags.
858 Otherwise, checking that a midrule's $$ is set will not always work
859 properly because the midrule check must forward-reference the midrule's
861 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
864 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
866 More improvements to the documentation of the prologue alternatives:
867 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
869 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
870 some text to clarify the relative importance of the new directives and
871 to show how these directives may be viewed as code labels.
873 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
875 Similar to the recently removed %before-header, add %code-top as the
876 alternative to the pre-prologue. Mentioned at
877 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
878 Also, let the prologue alternatives appear in the grammar section.
879 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
880 (prologue_declaration): Move the existing prologue alternatives to...
881 (grammar_declaration): ... here and add %code-top.
882 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
884 Clean up and extend documentation for the prologue alternatives.
885 * NEWS (2.3a+): Describe prologue alternatives.
886 * doc/bison.texinfo (Prologue): Move discussion of prologue
888 (Prologue Alternatives): ... this new section, and extend it to discuss
889 all 4 directives in detail.
890 (Bison Symbols): Clean up discussion of prologue alternatives and add
893 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
895 DJGPP specific issues.
897 * djgpp/config.bat: config.hin has been moved to lib. Adjust
898 config.bat accordingly.
899 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
900 * djgpp/config.site: Likewise.
902 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
904 Replace %*-header with %provides, %requires, %code. See discussion at
905 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
907 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
908 (b4_user_start_header): Remove.
909 * data/glr.c: Use new macros instead of b4_*start_header
911 * data/glr.cc: Likewise.
912 * data/lalr1.cc: Likewise.
913 * data/push.c: Likewise.
914 * data/yacc.c: Likewise.
916 * doc/bison.texinfo: Remove %before-header, rename
917 %{start,end,after}-header to %requires, %provides, %code.
919 * src/parse-gram.y: Likewise (also rename token names accordingly).
920 * src/scan-gram.l: Likewise.
921 * tests/actions.at: Likewise.
923 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
925 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
926 Problem reported by Joel E. Denny.
928 2006-10-14 Jim Meyering <jim@meyering.net>
930 (Sync from coreutils.)
931 Work also when the working directory (with e.g. coreutils sources)
932 is version controlled with git, rather than CVS.
933 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
935 In messages and comments, say e.g., "checked-out sources",
936 rather than "CVS sources".
937 (version_controlled_file): New function. Work for git as well as
938 for CVS. Don't use grep's -q option.
939 (slurp): Call it here, in place of CVS-specific code.
941 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
943 Fix testsuite for ./configure --enable-gcc-warnings:
944 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
945 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
946 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
947 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
948 * test/regression.at (Diagnostic that expects two alternatives):
951 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
953 * bootstrap.conf (gnulib_modules): Add config-h.
954 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
955 worry about HAVE_CONFIG_H.
956 * lib/abitset.c: Likewise.
957 * lib/bitset.c: Likewise.
958 * lib/bitset_stats.c: Likewise.
959 * lib/bitsetv-print.c: Likewise.
960 * lib/bitsetv.c: Likewise.
961 * lib/ebitset.c: Likewise.
962 * lib/get-errno.c: Likewise.
963 * lib/lbitset.c: Likewise.
964 * lib/subpipe.c: Likewise.
965 * lib/timevar.c: Likewise.
966 * lib/vbitset.c: Likewise.
967 * lib/bitset.c: Include "bitset.h" first, to test interface.
968 * lib/bitset_stats.c: Include "bitset_stats.h" first.
969 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
970 * lib/bitsetv.c: Include "bitsetv.h" first.
971 * lib/get-errno.c: Include "get-errno.h" first.
972 * m4/.cvsignore: Add config-h.m4.
973 * tests/actions.at (Default %printer and %destructor for ...):
974 Adjust expected line numbers in output to reflect removal of #if
976 * tests/glr-regression.at (Missed %merge type warnings when ...):
978 * tests/regression.at (Braced code in declaration in rules section):
980 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
981 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
982 Include <config.h> unconditionally.
984 * bootstrap: Sync from coreutils, as follows:
986 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
988 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
989 variable was sometimes used without being initialized. This
990 messed up the installation of the INSTALL file in some cases.
992 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
994 * bootstrap (usage, main program, symlink_to_gnulib): Add option
995 --copy. Inspired by a suggestion from Bruno Haible.
997 2006-10-03 Jim Meyering <jim@meyering.net>
999 * bootstrap: Undo last change to this file, since now gnulib-tool
1000 sticks with the automake default in generating dependencies.
1002 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1004 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
1005 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
1007 * doc/bison.1: Add copyright notice.
1009 * data/glr.c: Don't include <stdarg.h>; not used.
1011 * NEWS: The -g and --graph options now output graphs in Graphviz
1012 DOT format, not VCG format.
1013 * doc/bison.1: Likewise.
1014 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
1015 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
1017 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
1018 * TODO: Remove Graphviz entry.
1019 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
1020 remove vcg.c, vcg.h, vcg_defaults.h.
1021 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
1022 * src/graphviz.c, src/graphviz.h: New files.
1023 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
1024 * src/files.h: Make comment more generic.
1025 * src/main.c (main): Likewise.
1026 * src/print_graph.h: Likewise.
1027 * src/getargs.c (usage): Make usage description more generic.
1028 * src/print_graph.c: Include graphviz.h rather than vcg.h.
1029 (static_graph, fgraph): Remove. All uses changed to pass
1030 arguments instead of sharing a static var.
1031 (print_core, print_actions, print_state, print_graph):
1032 Output graphviz format rather than VCG format.
1033 * tests/.cvsignore: Remove *.vcg; add *.dot.
1034 * tests/output.at: Expect *.dot files, not *.vcg files.
1036 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
1037 accommodates the 2006-10-08 change.
1039 2006-10-11 Bob Rossi <bob@brasko.net>
1041 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
1042 (b4_yyssa, b4_yyerror_range): New macros.
1043 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
1044 (yypvarsinit): Remove init of removed fields.
1045 (yypushparse): Remove use of removed fields; use new macros instead.
1047 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1049 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
1050 in a push parser. Reindent slightly to match yacc.c better.
1052 2006-10-11 Bob Rossi <bob@brasko.net>
1054 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
1056 (yypvarsinit, yypushparse): Remove init of removed fields.
1057 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
1059 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1061 * THANKS: Add Paolo Bonzini and Bob Rossi.
1063 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
1065 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
1066 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
1067 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
1068 b4_define_user_cde and uses): Remove.
1069 (b4_comment, b4_prefix, b4_sync_start): New.
1070 * data/bison.m4: New file, with most of the content removed from c.m4.
1071 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
1072 * src/output.c (output_skeleton): Pass bison.m4.
1073 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
1076 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
1078 Fix test failure reported by Tom Lane in
1079 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
1080 and try to make such failures easier to catch in the future.
1081 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
1082 that's now the caller's responsibility.
1083 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
1084 Set yychar = YYEOF if it's negative.
1085 * tests/actions.at (yylex): Abort if asked to read past EOF.
1086 * tests/conflicts.at (yylex): Likewise.
1087 * tests/cxx-type.at (yylex): Likewise.
1088 * tests/glr-regression.at (yylex): Likewise.
1089 * tests/input.at (yylex): Likewise.
1090 * tests/regression.at (yylex): Likewise.
1091 * tests/torture.at (yylex): Likewise.
1093 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
1095 Fix problems with translating English-language diagnostics.
1096 * bootstrap: Fix bug introduced in recent bootstrap changes, with
1097 respect to bison-runtime pot generation. The YY_ stuff
1098 wasn't being captured.
1099 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
1100 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
1101 * runtime-po/POTFILES.in: Add data/push.c.
1103 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
1105 Merge bootstrap changes from coreutils.
1107 2006-09-28 Jim Meyering <jim@meyering.net>
1109 Automatically generated dependencies are important even
1110 when all of the sources in a directory come from gnulib.
1111 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
1112 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
1114 2006-09-23 Jim Meyering <jim@meyering.net>
1116 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
1118 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1120 * bootstrap: Add support for --force.
1121 (usage): New function. Describe usage less tersely.
1122 (CVS_only_file): New var.
1124 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
1126 * data/push.c (YYPUSH_MORE): Make it an enum instead.
1127 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
1128 Adjust white space and comments to match GNU style better.
1130 2006-09-20 Bob Rossi <bob@brasko.net>
1132 * data/push.c (yyresult_get): Remove function.
1133 (YYPUSH_MORE): Add #define.
1134 (yypushparse): Modify return value.
1136 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1138 * stamp-h.in: Remove; no longer needed.
1139 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
1140 Remove config.h, config.hin, intl (no longer created).
1141 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
1144 Sync bootstrap from coreutils, as follows:
1146 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
1148 * bootstrap (symlink_to_gnulib): New function.
1149 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
1150 to copies-of-gnulib.
1151 (cp_mark_as_generated, slurp, gnulib_files):
1152 Avoid making a copy if it's the same as the old version.
1153 (gnulib_files): Add support for this variable (used by Bison).
1155 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1157 * src/getargs.c (usage): Rework to use conventions similar to
1158 coreutils, to make translation a bit easier and the code a bit
1159 smaller. Problem reported by Tim Van Holder.
1161 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
1163 Use some of gnulib's new modules, taken from coreutils.
1165 * bootstrap: Sync from coreutils, except add support for gnulib_files.
1166 * bootstrap.conf: New file.
1167 (gnulib_modules): Add configmake, inttypes, unistd.
1168 (XGETTEXT_OPTIONS): Add complain, complain_at,
1169 fatal, fatal_at, warn, warn_at, unexpected_end.
1170 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
1171 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
1173 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
1175 (GNULIB_AUTOCONF_SNIPPET): Remove.
1176 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
1178 * lib/.cvsignore: Add inttypes_.h.
1179 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
1180 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
1181 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
1182 no-longer-necessary initializations.
1183 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
1184 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
1185 use the unistd module.
1186 * src/system.h: Likewise.
1187 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
1188 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
1189 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
1190 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
1191 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
1192 * src/system.h: Include inttypes.h unconditionally, now that we
1193 use the inttypes module. Don't bother to include stdint.h, since
1194 inttypes.h now does that for us.
1195 (LOCALEDIR): Remove, now that we use the configmake module.
1196 * src/getargs.c: Include configmake.h.
1197 * src/main.c: Likewise.
1198 * src/output.c: Likewise.
1199 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
1200 not from $abs_top_builddir, since config.h moved.
1203 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
1204 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
1206 * src/parse-gram.y (symbol_declaration): Don't put statements
1207 before declarations; it's not portable to C89.
1208 * src/scan-code.l (handle_action_at): Likewise.
1210 * src/scan-code.l: Always initialize braces_level; the old code
1211 left it uninitialized and therefore had undefined behavior.
1213 Don't attempt to redefine 'assert', since it runs afoul of
1214 systems where standard headers (mistakenly) include <assert.h>.
1215 Instead, define and use our own alternative, called 'aver'.
1216 * src/reader.c: Don't include assert.h, since we no longer
1218 * src/scan-code.l: Likewise.
1219 * src/system.h (assert): Remove, replacing with....
1220 (aver): New function, taking a bool arg. All uses changed.
1221 * src/tables.c (pack_vector): Ensure that aver arg is bool,
1222 not merely an integer.
1224 2006-09-15 Bob Rossi <bob@brasko.net>
1226 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
1227 * data/c.m4 (YYPUSH): New.
1228 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
1229 * src/getargs.c (push_parser): New var.
1230 * src/getargs.h (push_parser): New declaration.
1231 * src/output.c (prepare): Add macro insertion of `push_flag'.
1232 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
1233 (prologue_declaration): Parse %push-parser.
1234 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
1235 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
1236 list of removed lines from the traces observed.
1237 (AT_CHECK_CALC_LALR): Added push parser tests.
1239 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
1241 * NEWS: Version 2.3a.
1242 * configure.ac (AC_INIT): Likewise.
1244 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
1245 "#define YYSTYPE int" that caused "make maintainer-check" to fail
1246 due to header ordering dependencies. I don't know why the #define
1249 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
1250 runtime cost when YYDEBUG is not defined, and so that some tests
1251 that used to fail now work. Problem and initial suggestion by
1253 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
1254 * data/glr.cc (b4_parser_class_name):
1255 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
1256 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
1257 (yydebug_) [YYDEBUG]: New member.
1258 (yycdebug_): Now defined only if YYDEBUG.
1259 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
1260 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
1261 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
1263 (debug_stream, set_debug_stream, debug_level, set_debug_level):
1264 Define only if YYDEBUG.
1265 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
1267 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
1268 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
1269 AT_CHECK_CALC_GLR_CC that are working now.
1271 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
1273 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
1274 We don't need them in glr.cc, and glr.c defines them.
1275 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
1276 assumes that defining it to anything is the same as defining
1277 it to 1. Problem reported by Paolo Bonzini.
1279 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
1281 * data/c.m4 (b4_null, b4_case): Define.
1282 * src/output.c (prepare_symbols): Use b4_null.
1283 (user_actions_output): Use b4_case.
1285 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
1287 * data/glr.c (b4_shared_declarations): Put start-header first,
1288 before any #includes that we generate, so that feature-test
1289 macros work. Problem reported by Michael Deutschmann in
1290 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
1291 * data/lalr1.cc: Likewise.
1292 * doc/bison.texinfo (Prologue): Document that feature-test macros
1293 should be defined before any Bison declarations.
1294 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
1295 that depend on location.hh after, not before, Bison decls, since
1296 we now include location.hh after the first user prologue.
1298 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
1299 Sander Brandenburg in
1300 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
1301 Also, fix minor white space and comment issues.
1302 (Prologue): Mention that it's better to define feature-test macros
1303 before Bison declarations. Problem reported by Michael Deutschmann.
1305 * README-cvs: Fix typo: "&" should be "&&". Problem reported
1307 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
1308 This adjusts to recent gnulib changes.
1310 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1312 Finish implementation of per-type %destructor/%printer. Discussed
1314 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
1316 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
1317 * NEWS (2.3+): Add a description of this feature to the default
1318 %destructor/%printer description.
1319 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
1320 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1321 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
1322 list node contains a semantic type.
1323 * src/symtab.c, src/symtab.h: Extend with a table that associates
1324 semantic types with their %destructor's and %printer's.
1325 (semantic_type_from_uniqstr, semantic_type_get,
1326 semantic_type_destructor_set, semantic_type_printer_set): New functions
1327 composing the public interface of that table.
1328 (symbol_destructor_get, symbol_destructor_location_get,
1329 symbol_printer_get, symbol_printer_location_get): If there's no
1330 per-symbol %destructor/%printer, look up the per-type before trying
1332 * tests/actions.at (Per-type %printer and %destructor): New test case.
1333 * tests/input.at (Default %printer and %destructor redeclared):
1334 Extend to check that multiple occurrences of %symbol-default in a
1335 single %destructor/%printer declaration is an error.
1336 (Per-type %printer and %destructor redeclared, Unused values with
1337 per-type %destructor): New test cases.
1339 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1341 Require default %destructor/%printer to be declared using
1342 %symbol-default instead of an empty symbol list, and start working on
1343 new per-type %destructor/%printer. Discussed at
1344 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
1345 * NEWS (2.3+): Add %symbol-default to example.
1346 * bison.texinfo (Freeing Discarded Symbols): Likewise.
1347 (Bison Symbols): Add entry for %symbol-default.
1348 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
1349 (generic_symlist, generic_symlist_item): New nonterminals for creating
1350 a list in which each item is a symbol, semantic type, or
1352 (grammar_declaration): Use generic_symlist in %destructor and %printer
1353 declarations instead of symbols.1 or an empty list.
1354 (symbol_declaration, precedence_declaration, symbols.1): Update actions
1355 for changes to symbol_list.
1356 * src/reader.c: Update for changes to symbol_list.
1357 * src/scan-code.l: Likewise.
1358 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
1359 * src/symlist.c, src/symlist.h: Extend such that a list node may
1360 represent a semantic type or a %symbol-default in addition to just an
1361 ordinary symbol. Add switched functions for setting %destructor's and
1363 * tests/actions.at, tests/input.at: Add %symbol-default to all default
1364 %destructor/%printer declarations.
1366 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
1368 Whether the default %destructor/%printer applies to a particular symbol
1369 isn't a question of whether the user *declares* that symbol (in %token,
1370 for example). It's a question of whether the user by any means
1371 *defines* the symbol at all (by simply using a char token, for
1372 example). $end is defined by Bison whereas any other token with token
1373 number 0 is defined by the user. The error token is always defined by
1374 Bison regardless of whether the user declares it with %token, but we
1375 may one day let the user define error as a nonterminal instead.
1376 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
1377 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
1378 the meaning of "user-defined".
1379 * tests/actions.at (Default %printer and %destructor for user-declared
1380 end token): Rename to...
1381 (Default %printer and %destructor for user-defined end token): ...
1384 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
1385 computation of whether to apply the default, don't maintain a list of
1386 every Bison-defined symbol. Instead, just check for a first character
1387 of '$', which a user symbol cannot have, and check for the error token.
1389 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
1391 Don't apply the default %destructor or %printer to the error token,
1392 $undefined, or $accept. This change fits the general rule that the
1393 default %destructor and %printer are only for user-declared symbols,
1394 and it solves several difficulties that are described in the new test
1396 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
1397 * tests/actions.at (Default %printer and %destructor are not for error
1398 or $undefined, Default %printer and %destructor are not for $accept):
1401 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
1403 Allow %start after the first rule.
1404 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
1405 when parsing the first rule.
1406 (check_and_convert_grammar): Search for it here after all grammar
1407 declarations have been parsed. Skip midrules, which have dummy LHS
1409 * src/symtab.c (symbol_is_dummy): New function.
1410 * src/symtab.h (symbol_is_dummy): Declare it.
1411 * tests/input.at (%start after first rule): New test.
1413 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1415 Redo some of the previous commit: add back the ability to use
1416 non-aliased/undeclared string literals since it might be useful to
1417 those declaring %token-table.
1418 * src/reader.c (check_and_convert_grammar): Undo changes in previous
1419 commit: don't worry about complaints from symbols_pack.
1420 * src/symtab.c (symbol_new, symbol_class_set,
1421 symbol_check_alias_consistency): Undo changes in previous commit: count
1422 each string literal as a new symbol and token, assign it a symbol
1423 number, and don't complain about non-aliased string literals.
1424 (symbols_pack): Since symbol_make_alias still does not decrement symbol
1425 and token counts but does still set aliased tokens to the same number,
1426 symbol_pack_processor now leaves empty slots in the symbols array.
1428 * tests/regression.at (Undeclared string literal): Remove test case
1429 added in previous commit since non-aliased string literals are allowed
1431 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
1432 remove unnecessary string literal declarations.
1433 * tests/sets.at (Firsts): Likewise.
1435 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1437 Don't allow an undeclared string literal, but allow a string literal to
1438 be used before its declaration.
1439 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1440 symbols_pack complained.
1441 * src/symtab.c (symbol_new): Don't count a string literal as a new
1443 (symbol_class_set): Don't count a string literal as a new token, and
1444 don't assign it a symbol number since symbol_make_alias does that.
1445 (symbol_make_alias): It's not necessary to decrement the symbol and
1446 token counts anymore. Don't assume that an alias declaration occurs
1447 before any uses of the identifier or string, and thus don't assert that
1448 one of them has the highest symbol number so far.
1449 (symbol_check_alias_consistency): Complain if there's a string literal
1450 that wasn't declared as an alias.
1451 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1452 symbol_pack asserts that every token has been assigned a symbol number
1453 although undeclared string literals have not.
1454 * tests/regression.at (String alias declared after use, Undeclared
1455 string literal): New test cases.
1456 (Characters Escapes, Web2c Actions): Declare string literals as
1458 * tests/sets.at (Firsts): Likewise.
1460 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1462 In the grammar scanner, STRING_FINISH unclosed constructs and return
1463 them to the parser in order to improve error messages.
1464 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1465 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1466 * tests/input.at (Unclosed constructs): New test case.
1467 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1470 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1473 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1475 Handle string aliases for character tokens correctly.
1476 * src/symtab.c (symbol_user_token_number_set): If the token has an
1477 alias, check and set its alias's user token number instead of its own,
1478 which is set to indicate the alias. Previously, every occurrence of
1479 the character token in the grammar overwrote that alias indicator with
1481 * tests/input.at (String aliases for character tokens): New test.
1483 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1485 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1487 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1489 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1490 to prevent failures when building on older platforms.
1491 Check for autopoint failure.
1492 Set XGETTEXT_OPTIONS to values that check for C format strings,
1493 so that translators are warned about them (this also helps
1494 prevent core dumps).
1496 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1497 function, since it simplifies our code a bit.
1499 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1500 rather than -W, so we don't get bogus warnings about sign comparisons.
1501 Add -Wpointer-arith, since that warning is useful (it reports code
1502 that does not conform to C89 and that some compilers reject).
1503 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1504 since it's no longer needed.
1506 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1508 Clean up scanners a bit.
1509 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1510 definitions so gcc won't warn when obstack_for_string is unused.
1511 * src/scan-code.l: config.h and system.h are already #include'd by
1512 scan-code-c.c, so get rid of them here.
1513 * src/scan-gram.l: Likewise.
1514 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1515 definitions rather than duplicating the rest of it.
1516 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1518 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1520 Suppress signed/unsigned comparison warnings for yycheck.
1521 * data/c.m4 (b4_safest_int_type): New macro.
1522 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1523 a signed int type, cast it to b4_safest_int_type first.
1524 * data/yacc.c: Likewise.
1525 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1528 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1530 * doc/bison.texinfo: Fix some typos.
1532 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1534 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1535 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1537 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1538 the latest gnulib does this a different way.
1539 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1540 translation was patched, so stop omitting it.
1542 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1544 Enable declaration of default %printer/%destructor. Make the parser
1545 use these for all user-declared grammar symbols for which the user does
1546 not declare a specific %printer/%destructor. Thus, the parser uses it
1547 for token 0 if the user declares it but not if Bison generates it as
1548 $end. Discussed starting at
1549 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1550 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1552 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1553 * NEWS (2.3+): Mention.
1554 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1555 declare a %destructor for a mid-rule's semantic value. It's just
1556 impossible to declare one specific to it.
1557 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1558 code. Describe default %destructor form.
1559 * src/parse-gram.y (grammar_declaration): Parse default
1560 %printer/%destructor declarations.
1561 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1562 and symbol_destructor_location_get rather than accessing the destructor
1563 and destructor_location members of struct symbol.
1564 (symbol_printers_output): Likewise but for %printer's.
1565 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1567 * src/symtab.c (default_destructor, default_destructor_location,
1568 default_printer, default_printer_location): New static global
1569 variables to record the default %destructor and %printer.
1570 (symbol_destructor_get, symbol_destructor_location_get,
1571 symbol_printer_get, symbol_printer_location_get): New functions to
1572 compute the appropriate %destructor and %printer for a symbol.
1573 (default_destructor_set, default_printer_set): New functions to set the
1574 default %destructor and %printer.
1575 * src/symtab.h: Prototype all those new functions.
1576 * tests/actions.at (Default %printer and %destructor): New test to
1577 check that the right %printer and %destructor are called, that they're
1578 not called for $end, and that $$ and @$ work correctly.
1579 (Default %printer and %destructor for user-declared end token): New
1580 test to check that the default %printer and %destructor are called for
1581 a user-declared end token.
1582 * tests/input.at (Default %printer and %destructor redeclared, Unused
1583 values with default %destructor): New tests to check related grammar
1584 warnings and errors.
1586 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1588 Clean up handling of %destructor for the end token (token 0).
1589 Discussed starting at
1590 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1592 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1594 Make the skeletons consistent in how they pop the end token and invoke
1596 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1597 state, which has token number 0, since this would invoke the
1598 %destructor for the end token.
1599 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1600 until after shifting the end token, or else it won't be popped.
1601 * data/yacc.c (yyparse): Likewise.
1603 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1604 it's the end token. Upon termination, destroy an unshifted lookahead
1605 even when it's the end token.
1606 * data/lalr1.cc (yy::parser::parse): Likewise.
1607 * data/yacc.c (yyparse): Likewise.
1609 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1610 value warnings for the end token when the user gives the end token a
1613 * tests/actions.at (Printers and Destructors): Test all the above.
1615 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1617 Update to latest gnulib and gettext versions.
1618 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1620 (gnulib_files): Add m4/warning.m4. Don't worry about files
1621 overwritten by autopoint.
1622 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1623 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1625 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1626 so that we can remove the intl files at a better time.
1627 (intl_files_to_remove): Remove aclocal.m4, since it gets
1628 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1629 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1630 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1631 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1632 Remove datarootdir hack; no longer needed.
1633 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1634 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1635 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1637 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1638 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1640 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1642 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1643 it with --assume-autoconf='latest-stable'.
1645 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1647 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1648 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1650 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1651 those from muscle_tab.c since the old ones are misleading.
1653 2006-07-13 Akim Demaille <akim@epita.fr>
1655 Support %define "KEY" {VALUE}.
1656 * src/scan-code.h, src/scan-code.l (translate_action)
1657 (translate_rule_action, translate_symbol_action, translate_code):
1658 Return char *, not const char *.
1659 * src/parse-gram.y (declaration): Rename as...
1660 (prologue_declaration): this.
1661 (string_content): Remove this nonterminal, use STRING.
1662 (braceless, content, content.opt): New nonterminal.
1664 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1666 * src/scan-gram.l (getargs.h): Don't include it.
1668 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1670 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1671 rather than a for-loop that declares a local bool variable. This
1672 should work around a compatibility problem with a Cray x1e C++
1673 compiler reported by Hung Nguyen in
1674 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1675 The for-loop was introduced in the 2004-11-17 change but I don't
1676 know why it was needed.
1678 2006-07-12 Akim Demaille <akim@epita.fr>
1680 * data/c.m4: Comment changes.
1682 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
1684 * src/complain.c (error_message, ERROR_MESSAGE): New.
1686 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1687 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1689 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1691 * NEWS: Instead of %union, you can define and use your own union type
1692 YYSTYPE if your grammar contains at least one <type> tag.
1693 Your YYSTYPE need not be a macro; it can be a typedef.
1694 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1695 (Union Decl, Decl Summary): Document this.
1696 * data/glr.c (YYSTYPE): Implement this.
1697 * data/glr.cc (YYSTYPE): Likewise.
1698 * data/lalr1.cc (YYSTYPE): Likewise.
1699 * data/yacc.c (YYSTYPE): Likewise.
1700 * src/output.c (prepare): Output tag_seen_flag.
1701 * src/parse-gram.y (declaration, grammar_declaration):
1702 Use 'union_seen' rather than 'typed' to determine whether
1703 %union has been seen, since grammars can now be typed without
1705 (symbol_declaration, type.opt, symbol_def):
1706 Keep track of whether a tag has been seen.
1707 * src/reader.c (union_seen, tag_seen): New vars.
1709 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1710 * src/scan-code.l (untyped_var_seen): New variable.
1711 (handle_action_dollar): Adjust to above changes.
1712 (handle_action_dollar, handle_action_at):
1713 Improve overflow checking for outlandish numbers.
1714 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1715 avoid new diagnostics generated by above changes.
1716 * tests/regression.at (YYSTYPE typedef): Add test to check
1717 for type tags without %union.
1719 * src/symlist.c (symbol_list_length): Return int, not unsigned
1720 int, since callers expect int. This may need to get revisited
1721 once we have proper integer overflow checking.
1723 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1724 object is now static.
1726 * src/getargs.c (flags_argmatch): Return void, not int,
1727 to pacify ./configure --enable-gcc-warnings.
1729 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1730 since last_string is already defined to FLEX_PREFIX (last_string).
1732 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1734 Implement --warnings/-W.
1735 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1737 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1739 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1740 (warnings_args, warnings_types): New.
1741 (getargs, short_options, long_options): Accept -W/--warnings.
1742 Sort the options by alphabetical order, upper case letter right
1743 before its lower case.
1745 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1747 Change %merge result type clash warnings to errors. Discussed at
1748 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1749 * src/reader.c (record_merge_function_type): Use complain_at.
1750 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1751 declared later): Update test case results.
1753 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1755 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1756 to be in alphabetical order.
1757 (trace_args): Spelling fixes.
1759 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1761 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1762 so they don't collide with user-defined macros.
1763 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1764 this was never guaranteed, and now that we're using gnulib stdint,
1765 which defines int_fast16_t to long int, the problem is exposed.
1767 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1769 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1770 need the full POSIX semantics (and weren't implementing them
1773 Adjust to Autoconf 2.60 and today's gnulib.
1774 * bootstrap (gnulib_modules): Add stdint.
1775 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1776 no longer copies it.
1777 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1778 since stdint needs the former and wcwidth (which is now required
1779 by mbswidth) needs the latter.
1780 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1781 work around a compatibility glitch between gettext 0.14.6 and
1783 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1784 Do not check for uintptr_t, since new stdint module does the right
1786 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1787 Add stdint.h, stdint_.h, wcwidth.h.
1788 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1789 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1790 stdint.m4, wchar_t.m4, wcwidth.m4.
1791 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1792 usual order for ../lib/*.h files.
1793 (file_name_split): Use last_component, not base_name, to adjust
1795 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1796 for ../lib/*.h files.
1797 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1798 Define unconditionally, since we now assume the stdint module.
1799 * src/scan-skel.l: Include <dirname.h>.
1800 (BASE_QPUTS): Use last_component, not base_name.
1801 * src/system.h: Include <unlocked-io.h> in the usual order
1802 for ../lib/*.h files. Include <stdint.h> unconditionally,
1803 since we now use the stdint module.
1804 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1805 HAVE_UINTPTR_T, since we now use the stdint module.
1806 (base_name): Remove decl, since files now include <dirname.h>
1809 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1811 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1813 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1814 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1816 * tests/calc.at: Adjust.
1818 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1820 * data/c.m4 (b4_basename): New.
1821 (b4_syncline): Also output the location of its invocation (from
1823 (b4_user_action, b4_define_user_action, b4_user_actions)
1824 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1825 (b4_user_stype): New.
1826 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1828 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1830 In the grammar file, the first column is 1 not 0 on the first line as
1831 on every other line.
1832 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1833 * tests/input.at (Torturing the Scanner): Update output.
1835 * src/scan-gram.l (scanner_cursor): Declare it static.
1837 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1839 In warnings, say "previous declaration" rather than "first
1841 * src/symtab.c (redeclaration): Do that here.
1842 * src/reader.c (record_merge_function_type): In the case of a result
1843 type clash, report the previous declaration rather than the very first
1844 one in the grammar file.
1845 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1846 declared later): Add a third declaration to check this behavior.
1847 * tests/input.at (Incompatible Aliases): Update output.
1849 2006-06-27 Akim Demaille <akim@epita.fr>
1851 * doc/Doxyfile.in: New.
1852 * doc/Makefile.am: Use it.
1853 * src/lalr.h, src/symtab.h: Initial doxygenation.
1855 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1857 Don't miss %merge result type warnings just because the LHS types are
1858 declared after the %merge. This continues the effort of the previous
1860 * src/reader.c (get_merge_function): Don't set the merger type yet.
1861 (record_merge_function_type): New function for setting the merger type
1862 and checking for clashes.
1863 (grammar_current_rule_merge_set): Set the location of the %merge for
1865 (packgram): Invoke record_merge_function_type for each rule now that
1866 all symbol type declarations have been parsed.
1867 * src/reader.h (merger_list.type_declaration_location): New member
1868 storing the location of the first %merge from which the type for this
1869 merging function was derived.
1870 * src/symlist.h (symbol_list.merger_declaration_location): New member
1871 storing the location of a rule's %merge, if any.
1872 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1873 declared later): New test to catch the error fixed by the above patch.
1875 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1877 Get action warnings (grammar_rule_check) right even when symbol
1878 declarations appear after the rules. Discussed at
1879 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1881 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1882 Don't mistake the type of $$ in a midrule to be that of its parent
1884 * src/reader.c (grammar_current_rule_end): Don't invoke
1885 grammar_rule_check yet since not all symbol declarations may have been
1887 (grammar_midrule_action): Likewise.
1888 Don't record whether the midrule's $$ has been used yet since actions
1889 haven't been translated yet.
1890 Record the midrule's parent rule and its RHS index within the parent
1892 (grammar_current_rule_action_append): Don't translate the action yet
1893 since not all symbol declarations may have been parsed yet and, thus,
1894 warnings about types for $$, $n, @$, and @n can't be reported yet.
1895 (packgram): Translate the action and invoke grammar_rule_check now that
1896 all symbol declarations have been parsed.
1897 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1898 after parsing the entire grammar file, the symbol list here in the case
1899 of a midrule is actually the midrule's empty RHS, so reference its
1900 parent rule's RHS where necessary.
1901 On the other hand, now that you can already know it's a midrule, you
1902 aren't forced to think $$ has the same type as its parent rule's $$.
1903 (handle_action_at): In the case of a midrule, reference the parent rule
1905 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1907 (symbol_list_length): Now that this is invoked after all rules have
1908 been parsed, a NULL symbol (rather than a NULL symbol list node)
1909 terminates a rule. symbol_list_print already does this correctly.
1910 * src/symlist.h (symbol_list.midrule_parent_rule,
1911 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1912 remember their relationships with their parents.
1913 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1914 fixed by the above patch.
1915 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1917 (Unused values): ... this old test case and...
1918 (Unused values before symbol declarations): ... this new test case.
1919 This one is the same as `Unused values' except that all symbol
1920 declarations appear after the rules in order to catch the rest of the
1921 errors fixed by the above patch.
1923 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1926 * src/reader.c (current_rule): Declare it static since it's no longer
1927 used outside this file.
1928 (grammar_current_rule_action_append): Remove redundant arguments from
1929 translate_rule_action invocation.
1930 * src/reader.h (current_rule): Remove this unused extern.
1931 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1932 * src/scan-code.l (translate_rule_action): Likewise.
1934 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1936 Clean up yesterday's patch.
1937 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1939 * src/reader.c (grammar_current_rule_action_append): ... here for
1940 consistency with grammar_current_rule_symbol_append.
1941 * tests/regression.at (Braced code in declaration in rules section):
1942 Make yyerror and yylex static as usual.
1944 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1946 Fix bug that mistakes braced code in a declaration in the rules section
1947 to be a rule action. Mentioned at
1948 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1949 * src/scan-gram.l: Move midrule action detection from the start of the
1950 scanning of any braced code to...
1951 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1952 action. For readability, use $2 and @2 rather than the equivalent
1954 * tests/regression.at (Braced code in declaration in rules section):
1955 New test to catch the error fixed by the above patch.
1957 Work on code readability some.
1958 * src/scan-code.l (current_rule): Get rid of this misleading and
1959 redundant declaration: it's actually extern'ed in reader.h.
1960 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
1961 translate_action): Add a rule argument and use it instead of the global
1963 (translate_rule_action): This already receives current_rule through an
1964 argument, so pass it on to translate_action instead of assigning
1965 current_rule to current_rule.
1966 (translate_symbol_action, translate_code): Pass rule = NULL to
1969 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1971 Rename %before-definitions to %start-header and %after-definitions to
1972 %end-header. Don't use these declarations to separate pre-prologue
1973 blocks from post-prologue blocks. Add new order-independent
1974 declarations %before-header and %after-header as alternatives to the
1975 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
1976 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
1977 * NEWS (2.3+): Update for these changes.
1978 * data/glr.c (b4_before_definitions): Update to...
1979 (b4_start_header): ... this.
1980 (b4_after_definitions): Update to...
1981 (b4_end_header): ... this.
1982 * data/glr.cc: Likewise.
1983 * data/lalr1.cc: Likewise.
1984 * data/yacc.c: Likewise.
1985 * doc/bison.texinfo (The prologue): Update names, and replace remaining
1986 prologue blocks with %*-header declarations.
1987 (Calc++ Parser): Likewise.
1988 (Bison Declaration Summary): Update names.
1989 (Bison Symbols): Update description.
1990 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
1991 (PERCENT_END_HEADER): ... this.
1992 (PERCENT_BEFORE_DEFINITIONS): Update to...
1993 (PERCENT_START_HEADER): ... this.
1994 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1995 (declaration): Update token names and m4 macro names.
1996 When parsing %end-header and %start-header, invoke translate_code
1997 before muscle_code_grow, and no longer set global booleans to remember
1998 whether these declarations have been seen.
1999 Parse new %after-header and %before-header.
2000 * src/reader.c (before_definitions, after_definitions): Remove.
2001 (prologue_augment): Accept a new bool argument to specify whether to
2002 augment the pre-prologue or post-prologue.
2003 * src/reader.h (before_definitions, after_definitions): Remove these
2005 (prologue_augment): Add new bool argument.
2006 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
2007 (PERCENT_END_HEADER): ... this.
2008 (PERCENT_BEFORE_DEFINITIONS): Update to...
2009 (PERCENT_START_HEADER): ... this.
2010 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2011 * tests/actions.at (Printers and Destructors): Update names.
2013 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
2015 Add comparison operators for C++ location classes. Discussed at
2016 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
2017 * data/c++.m4 (b4_define_location_comparison): New boolean %define
2018 declaration indicating whether filename_type has an operator==. If
2019 filename_type is `std::string', it defaults to `1', `0' otherwise.
2020 * data/location.cc: Iff b4_define_location_comparison is `1', add
2021 operator== and operator!= for class position and for class location.
2024 * src/scan-action.l: Remove unused file.
2025 * src/symtab.c (symbol_printer_set): Use printer_location not
2026 destructor_location.
2027 * src/symtab.h (struct symbol): Replace incorrect source comment for
2029 * tests/input.at (Incompatible Aliases): Update output with correct
2032 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
2034 Don't put the pre-prologue in the header file. For the yacc.c code
2035 file and the glr.c header and code files, move the pre-prologue before
2036 the token definitions. Add new %before-definitions and
2037 %after-definitions to declare code that will go in both the header file
2038 and code file. Discussed at
2039 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
2040 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
2042 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
2043 * NEWS (2.3+): Describe these changes.
2044 * data/glr.c (b4_pre_prologue): Move from within to before...
2045 (b4_shared_declarations): ... this.
2046 Add new b4_before_definitions before b4_token_enums.
2047 Add new b4_after_definitions at the end.
2048 * data/glr.cc (b4_pre_prologue): Replace with...
2049 (b4_before_definitions): ... this in the header file.
2050 (b4_after_definitions): New near the end of the header file.
2051 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
2052 code file right before including the header file.
2053 (b4_before_definitions): New in the previous position of
2054 b4_pre_prologue in the header file.
2055 (b4_after_definitions): New near the end of the header file.
2056 * data/yacc.c: Clean up some m4 quoting especially in the header file.
2057 (b4_token_enums_defines): In the code file, move to right before
2058 YYSTYPE for consistency with the header file.
2059 (b4_before_definitions): New right before b4_token_enums_defines in
2060 both the header and code file.
2061 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
2062 header and code file.
2063 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
2064 of prologues for %union dependencies.
2065 (Bison Declaration Summary): In %defines description, mention the
2066 effect of %before-definitions and %after-definitions on the header
2068 (Calc++ Parser): Forward declare driver in a %before-definitions rather
2069 than in the pre-prologue so that make check succeeds.
2070 (Bison Symbols): Add entries for %before-definitions and
2072 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
2073 %before-definitions.
2074 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
2075 (declaration): Parse those declarations and append to
2076 b4_before_definitions and b4_after_definitions, respectively.
2077 * src/reader.c (before_definitions, after_definitions): New bools to
2078 track whether those declarations have been seen.
2079 (prologue_augment): Add to the post-prologue if %union,
2080 %before-definitions, or %after-definitions has been seen.
2081 * src/reader.h (before_definitions, after_definitions): New extern's.
2082 * src/scan-gram.l: Scan the new declarations.
2083 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
2084 prologue block in a %before-definitions or a %after-definitions based
2085 on whether the %union is declared.
2086 * tests/regression.at (Early token definitions with --yacc, Early token
2087 definitions without --yacc): Move tests for token definitions into the
2088 post-prologue since token names are no longer defined in the
2091 2006-06-20 Akim Demaille <akim@epita.fr>
2093 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
2094 (symbol_get): Use it.
2095 * src/parse-gram.y: Use it.
2097 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
2099 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
2100 build succeeds when configured with --enable-gcc-warnings.
2102 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
2104 * src/parse-gram.y (char_name): New function.
2105 (CHAR, STRING, string_content): For %printer, properly escape.
2106 (ID): Prefer fputs to fprintf.
2107 (id): Reindent to be consistent with other rules.
2108 Properly quote char.
2110 The Translation Project changed its way of publishing translations
2111 to maintainers. I haven't received any responses to my request
2112 for supporting the old way, or for documenting the new way. I
2113 have modified 'bootstrap' to use screen scraping
2114 (in this case, HTML scraping). This is unreliable and inelegant,
2115 but I don't see any better way. Yuck.
2116 * bootstrap (TP_URL, WGET_COMMAND): New vars.
2117 (get_translations): New function, which uses HTML scraping to
2118 deduce locations of latest translations.
2119 Use this function to grab both bison and bison-runtime .po files.
2120 Don't bother priming the pump for the runtime-po domain any more,
2121 as it's now translated better than bison is.
2123 2006-06-19 Akim Demaille <akim@epita.fr>
2125 * src/scan-gram.l: No longer "parse" things after `%union' until
2126 `{'. Rather, return a single "%union" token.
2127 No longer make symbols: return strings, and leave the conversion
2128 to symbols to the parser.
2129 (SC_PRE_CODE, token_type): Remove.
2130 * src/parse-gram.y (%union): New field `character'.
2133 (ID, ID_COLON): Now that the scanner no longer makes them
2134 identifiers, adjust all uses to invoke symbol_get.
2135 (id_colon): New, wraps the conversion from string to symbol.
2136 (%union): Accept a possible union_name.
2137 (symbol): Now can be a char.
2138 * data/c.m4 (b4_union_name): Leave a default value.
2139 * data/glr.c, data/yacc.c: Use it.
2141 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
2143 For associating token numbers with token names for "yacc.c", don't use
2144 #define statements unless `--yacc' is specified; always use enum
2145 yytokentype. Most important discussions start at:
2146 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
2147 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
2149 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
2150 * NEWS (2.3+): Mention.
2151 * data/c.m4 (b4_yacc_if): New.
2152 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
2154 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
2155 on token name definitions.
2156 * src/getargs.c (usage): Capitalize `Yacc' in English.
2157 * src/output.c (prepare): Define b4_yacc_flag.
2158 * tests/regression.at (Early token definitions): Test that tokens names
2159 are defined before the pre-prologue not just before the post-prologue.
2160 Remove this test case and copy to...
2161 (Early token definitions with --yacc): ... this to test #define's.
2162 (Early token definitions without --yacc): ... and this to test enums.
2164 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
2166 * NEWS: Reword the post-2.3 change to not be so optimistic about
2167 removing the old "look-ahead" spelling.
2168 Update previous look-ahead/lookahead change reports.
2169 * REFERENCES: look-ahead -> lookahead (since that's
2170 what he actually wrote).
2171 * doc/refcard.tex: look ahead -> lookahead,
2172 look-ahead -> lookahead
2174 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
2176 For consistency, use `lookahead' instead of `look-ahead' or
2177 `look_ahead'. Discussed starting at
2178 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
2180 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
2181 * NEWS: For the next release, note the change to `--report'.
2182 * TODO, doc/bison.1: Update English.
2183 * doc/bison.texinfo: Update English.
2184 (Understanding Your Parser, Bison Options): Document as
2185 `--report=lookahead' rather than `--report=look-ahead'.
2186 * src/conflicts.c: Update English in comments.
2187 (lookahead_set): Rename from look_ahead_set.
2188 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
2189 (resolve_sr_conflict): Rename local look_ahead_tokens to
2190 lookahead_tokens, and update other uses.
2191 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
2192 count_rr_conflicts, conflicts_free): Update uses.
2193 * src/getargs.c (report_args): Move "lookahead" before alternate
2195 (report_types): Update uses.
2196 (usage): For `--report' usage description, state `lookahead' spelling
2197 rather than `look-ahead'.
2198 * src/getargs.h (report.report_lookahead_tokens): Rename from
2199 report_look_ahead_tokens.
2200 * src/lalr.c: Update English in comments.
2201 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
2202 (state_lookahead_tokens_count): Rename from
2203 state_look_ahead_tokens_count.
2204 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2205 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
2206 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2208 Update English in output.
2209 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
2210 * src/print.c: Update English in comments.
2211 (lookahead_set): Rename from look_ahead_set.
2212 (print_reduction): Rename argument lookahead_token from
2214 (print_core, state_default_rule, print_reductions, print_results):
2216 * src/print_graph.c: Update English in comments.
2217 (print_core): Update uses.
2218 * src/state.c: Update English in comments.
2219 (reductions_new): Update uses.
2220 (state_rule_lookahead_tokens_print): Rename from
2221 state_rule_look_ahead_tokens_print, and update other uses.
2222 * src/state.h: Update English in comments.
2223 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
2224 (state_rule_lookahead_tokens_print): Rename from
2225 state_rule_look_ahead_tokens_print.
2226 * src/tables.c: Update English in comments.
2227 (conflict_row, action_row): Update uses.
2228 * tests/glr-regression.at
2229 (Incorrect lookahead during deterministic GLR,
2230 Incorrect lookahead during nondeterministic GLR): Rename
2231 print_look_ahead to print_lookahead.
2232 * tests/torture.at: Update English in comments.
2233 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
2234 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
2235 (Many lookahead tokens): Update uses.
2236 * data/glr.c: Update English in comments.
2237 * lalr1.cc: Likewise.
2239 * src/conflicts.h: Likewise.
2240 * src/lalr.h: Likewise.
2241 * src/main.c: Likewise.
2242 * src/output.c: Likewise.
2243 * src/parse-gram.c: Likewise.
2244 * src/tables.h: Likewise.
2245 * tests/calc.at: Likewise.
2247 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
2249 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
2251 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
2253 * TODO: Add request from Nelson H. F. Beebe to be able to install
2254 Bison without installing the yacc script.
2256 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2258 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
2259 and yytext if they're already #define'd.
2260 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
2261 * src/scan-code-c.c: ... here.
2262 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
2265 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2267 Get Bison to build again when configured with --enable-gcc-warnings.
2268 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
2270 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
2271 loc argument as it shadows a global.
2272 * src/scan-gram.l: Remove stray comma that prevents boundary_set
2275 * src/.cvsignore: Add scan-code.c.
2277 2006-06-07 Akim Demaille <akim@epita.fr>
2279 * src/scan-gram.l: Move the "add a trailing ; to actions" code
2281 * src/scan-code.l: here.
2282 * tests/input.at (Torturing the Scanner): Fix another location
2285 2006-06-07 Akim Demaille <akim@epita.fr>
2287 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
2289 2006-06-06 Akim Demaille <akim@epita.fr>
2291 Extract the parsing of user actions from the grammar scanner.
2292 As a consequence, the relation between the grammar scanner and
2293 parser is much simpler. We can also split "composite tokens" back
2295 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
2296 * src/scan-gram.l (add_column_width, adjust_location): Move to and
2298 * src/location.h, src/location.c (add_column_width)
2299 (location_compute): these.
2300 Fix the column count: the initial column is 0.
2301 (location_print): Be robust to ending column being 0.
2302 * src/location.h (boundary_set): New.
2303 * src/main.c: Adjust to scanner_free being renamed as
2305 * src/output.c: Include scan-code.h.
2306 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
2308 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
2309 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
2310 which is now, again, a separate token.
2311 Adjust all dependencies.
2312 Whereever actions with $ and @ are used, use translate_code.
2313 (action): Remove this nonterminal which is now useless.
2314 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
2315 (grammar_current_rule_action_append): Use translate_code.
2316 (packgram): Bound check ruleno, itemno, and rule_length.
2317 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
2318 (last_string, last_braced_code_loc, max_left_semantic_context)
2319 (scanner_initialize, scanner_free, scanner_last_string_free)
2320 (gram_out, gram_lineno, YY_DECL_): Move to...
2321 * src/scan-gram.h: this new file.
2322 (YY_DECL): Rename as...
2324 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
2325 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
2326 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
2327 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
2328 Move these declarations, and...
2329 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
2331 * src/flex-scanner.h: this new file.
2332 * src/scan-gram.l (rule_length, rule_length_overflow)
2333 (increment_rule_length): Remove.
2334 (last_braced_code_loc): Rename as...
2335 (gram_last_braced_code_loc): this.
2336 Adjust to the changes of the parser.
2337 Move all the handling of $ and @ into...
2338 * src/scan-code.l: here.
2339 * src/scan-gram.l (handle_dollar, handle_at): Remove.
2340 (handle_action_dollar, handle_action_at): Move to...
2341 * src/scan-code.l: here.
2342 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
2343 scan-code.h, scan-code-c.c, scan-gram.h.
2344 (EXTRA_bison_SOURCES): Add scan-code.l.
2345 (BUILT_SOURCES): Add scan-code.c.
2346 (yacc): Be robust to white spaces.
2348 * tests/conflicts.at, tests/input.at, tests/reduce.at,
2349 * tests/regression.at: Adjust the column numbers.
2350 * tests/regression.at: Adjust the error message.
2352 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2354 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2355 Use Akim's wording from
2356 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
2358 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2360 Between Bison releases, manually append `+' to the previous Bison
2361 release number, and use that as a signal to automatically print the
2362 ChangeLog's CVS Id keyword from --version. Discussed starting at
2363 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
2364 * ChangeLog: Add Id header.
2365 * configure.ac (AC_INIT): Append `+' to `2.3'.
2366 * src/.cvsignore: Add revision.c.
2367 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
2368 (BUILT_SOURCES): Add revision.c.
2369 (revision.c): New target rule. This file defines a new global variable
2370 named revision. It initializes it with either the Id from ChangeLog
2371 or, if VERSION doesn't contain `+', with the empty string.
2372 * src/getargs.c (version): Print the value of revision.
2373 * src/revision.h: Extern revision.
2375 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
2377 * NEWS: Version 2.3.
2378 * configure.ac (AC_INIT): Likewise.
2380 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
2382 * data/glr.c (YYRECOVERING): Define to be a function-like macro
2383 with no arguments, not as an object-like macro. This is for
2384 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
2385 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
2386 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
2389 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
2391 * src/getargs.c (usage): Back out yesterday's modification of the
2392 --help output so that we don't have to wait for translation before
2395 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
2397 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
2398 Problem reported by Akim Demaille.
2400 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2402 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2404 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
2406 * data/yacc.c (yy_reduce_print): Omit trailing white space in
2407 generated source code. Problem reported by Frans Englich in
2408 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
2410 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
2412 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
2413 shell, not within 'make', so that 'make' by an ordinary builder
2414 (using GNU make) does not worry about configuring gzip. This also
2415 works around a bug reported independently by Keith Thompson and by
2416 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
2417 stderr rather than stdout, messing up the build logs.
2419 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2421 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
2422 to make sure that YYID will never be unused. This fixes a 'make
2423 maintainer-check' failure caused by the recent changes to the 'Trivial
2424 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
2426 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
2428 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2430 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
2431 state before an empty RHS is always resolved here. Only the location
2432 of that state is guaranteed to be resolved, and that's enough. This
2433 fixes the remaining bug reported by Derek M. Jones in
2434 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2435 * tests/glr-regression.at (Uninitialized location when reporting
2436 ambiguity): Test the above case.
2437 Also, the embedded comments in this test case claim it checks the case
2438 of an empty RHS that has inherited the initial location. However, the
2439 corresponding LHS was already resolved, so yyresolveLocations didn't
2440 actually have reason to modify it. Fix this by forcing
2441 nondeterministic operation at the beginning of the parse.
2443 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2445 * data/c.m4 (b4_yy_symbol_print_generate):
2446 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2447 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2448 of the bugs reported today by Derek M Jones in
2449 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2450 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2451 defined to be a type name without parens or brackets.
2452 (Location Type): Similarly for YYLTYPE.
2453 * tests/regression.at (Trivial grammars): Put in a test for this
2454 bug that will be caught by 'make maintainer-check' (though not,
2455 alas, by 'make check' unless your compiler is picky).
2457 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2459 * NEWS: Version 2.2.
2460 * configure.ac (AC_INIT): Likewise.
2462 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2464 * data/glr.c (yyreportTree): Make room in yystates for the state
2465 preceding the RHS. This fixes the segmentation fault reported by Derek
2467 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2468 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2469 to the user. Reported for yyreportTree by Derek M. Jones later in the
2471 * THANKS: Add Derek M. Jones.
2472 Update my email address.
2473 Fix typo in Steve Murphy's name.
2475 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2477 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2478 checking against YYLAST that caused the parser to miss a potential
2479 alternative in its diagnostic.
2480 Problem reported by Maria Jose Moron Fernandez in
2481 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2482 * data/lalr1.cc (yysyntax_error_): Likewise.
2483 * data/yacc.c (yysyntax_error): Likewise.
2484 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2485 tokens, in case we run into an older C compiler.
2486 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2487 Use them to check for the off-by-one error fixed above.
2489 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2490 YYSIZE_T, not size_t.
2491 * tests/regression.at (Trivial grammars): New test, to catch
2492 the error fixed by the above patch.
2494 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2496 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2498 Reported by Steve Murphy.
2500 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2502 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2503 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2505 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2507 Implement --trace=m4.
2508 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2509 * src/output.c (output_skeleton): When set, pass -dV to m4.
2511 Factor the handling of flags in m4.
2512 * src/output.c (prepare): Rename the muscle names debug, defines,
2513 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2514 * data/c.m4: Adjust.
2515 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2516 Use b4_define_flag_if to define other b4_FLAG_if macros.
2517 (b4_location_if): As a consequence, rename as...
2518 (b4_locations_if): this, for consistency.
2519 Adjust all the skeletons.
2521 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2523 * etc/bench.pm: Shorten bench names.
2525 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2527 * src/output.h, src/output.c (error_verbose): Move to...
2528 * src/getargs.h, src/getargs.c: here.
2530 Adjust dependencies.
2532 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2534 * data/c.m4 (b4_copyright): Put the special exception for Bison
2535 skeletons here, so we don't have to put it in each skeleton. All
2536 uses changed. Suggested by Akim Demaille. Also, wrap the
2537 copyright notice, in case it is longer than 80 columns. Replace
2538 comma by newline after title.
2540 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2542 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2543 incompatibility, not a bug. Mention that it wasn't fixed as of
2546 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2548 * examples/extexi: Enforce the precedence of concatenation over
2550 Reported by Tommy Nordgren.
2552 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2554 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2555 with the member "token".
2556 Reported by Martin Nylin.
2558 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2560 * data/glr.c: Switch to Bison 2.2 special-exception language in
2561 the copyright notice. Use more-regular format for titles and
2563 * data/glr.cc: Likewise.
2564 * data/location.cc: Likewise.
2565 * data/yacc.cc: Likewise.
2566 * doc/bison.texinfo (Conditions): Document this.
2567 * NEWS: likewise. Upgrade version to 2.2.
2569 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
2571 * data/glr.cc: Remove dead code.
2573 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2575 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2576 that variable and the line breaks the bootstrap. Problem reported
2577 by Juan M. Guerrero.
2579 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2581 * doc/bison.texinfo (Multiple start-symbols): New.
2583 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2585 * etc/README, etc/bench.pl: New.
2587 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
2589 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2591 Reported by Mickael Labau.
2592 * tests/input.at (Torturing the Scanner): Test it.
2594 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2596 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2597 Problem reported by Bob Rossi.
2599 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2601 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2602 and didn't really work.
2603 For the index, use @ifnotinfo, not @iftex.
2604 Minor cleanups of spacing and terminology.
2606 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2608 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2609 of AT_NAME_PREFIX when %name-prefix is not used.
2611 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2613 Apply --prefix to C++ skeletons too: they change the namespace.
2614 The test suite already exercize these cases.
2615 * data/c++.m4 (b4_namespace): New.
2616 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2617 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2618 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2619 * doc/bison.texinfo: Document it.
2620 (Option Cross Key): Use @multitable in all formats. It looks
2621 nicer, even in TeX outputs.
2622 (Rules): Use the same code whatever the output type is.
2623 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2624 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2625 * tests/calc.at: Use it, instead of hard coding `yy'.
2627 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2629 * TODO: Remove dead items.
2631 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2633 * doc/FAQ: Remove, merged into...
2634 * doc/bison.texinfo (FAQ): this.
2635 * doc/Makefile.am (EXTRA_DIST): Adjust.
2637 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2639 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2641 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2642 * doc/bison.texinfo (Calc++ Scanner): Use it.
2644 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2646 Fix two nits reported by twlevo, plus one more that I discovered.
2648 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2649 this is the usual Bison style.
2650 * src/location.h (location_print): Likewise.
2652 * src/reader.h (token_name): Likewise.
2654 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2656 Fix some nits reported by twlevo.
2657 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2658 and "POSIX". Use more-modern syntax for URLs. Mention C++
2659 and ask for Java. Don't hardwire OS version numbers. Add
2661 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2662 * src/conflicts.c (solved_conflicts_obstack): Now static.
2664 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2666 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2667 page. Say "you can use it" not "you may use it" as on the web page;
2668 we're describing capabilities not granting permission.
2670 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2672 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2673 shadowing warnings. Use usual patter for iterating through RHS.
2674 * tests/glr-regression.at
2675 (Uninitialized location when reporting ambiguity):
2676 Modify yylex so that it uses its argument, rather than trying
2677 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2678 const char -> char const.
2680 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2681 Don't use tabs inside commands; it messes up 'ps'.
2682 Problem reported by twlevo.
2684 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2686 * tests/glr-regression.at (Uninitialized location when reporting
2687 ambiguity): New test case.
2688 * data/glr.c (yyresolveLocations): New function, which uses
2690 (yyresolveValue): Invoke yyresolveLocations before reporting an
2692 * doc/bison.texinfo (Default Action for Locations): Note
2693 YYLLOC_DEFAULT's usage for ambiguity locations.
2694 (GLR Semantic Actions): Cross-reference those notes.
2696 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2698 * tests/glr-regression.at (Leaked semantic values when reporting
2699 ambiguity): Remove unnecessary union and type declarations.
2700 (Leaked lookahead after nondeterministic parse syntax error): New test
2702 * data/glr.c (yyparse): Check for zero stacks remaining before
2703 attempting to shift the lookahead so that you don't lose it.
2705 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2707 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2708 * tests/glr-regression.at (Leaked semantic values when reporting
2709 ambiguity): New test case.
2710 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2711 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2712 now unnecessary yystackp parameter.
2713 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2714 destructors can be called.
2716 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2717 in existing testcases.
2719 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2721 Don't leak semantic values for parent RHS when a user action cuts the
2722 parser, and clean up related code a bit.
2723 * tests/glr-regression.at (Leaked merged semantic value if user action
2724 cuts parse): Rename to...
2725 (Leaked semantic values if user action cuts parse): ... this. Add check
2726 for leaked parent RHS values.
2727 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2728 between an unresolved state (non-empty chain of semantic options) and
2729 an incomplete one (signaled by an empty chain).
2730 (yyresolveStates): Document the interface. Move all manipulation of a
2731 successfully or unsuccessfully resolved yyGLRState to...
2732 (yyresolveValue): ... here so that yyresolveValue always leaves a
2733 yyGLRState with consistent data and thus is easier to understand.
2734 Remove the yyvalp and yylocp parameters since they are always just
2735 taken from the yys parameter. When reporting a discarded merged value
2736 in debugging output, note that it is incompletely merged. Document the
2738 (yyresolveAction): If resolving any of the RHS states fails, destroy
2739 them all rather than leaking them. Thus, as long as user actions are
2740 written to clean up the RHS correctly, yyresolveAction always cleans up
2741 the RHS of a semantic option. Document the interface.
2743 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2745 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2746 led to a segmentation fault in GNU Pascal. Problem reported
2749 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2751 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2752 mid-rule action inside a nonterminal symbol in order to declare a
2753 destructor for its semantic value.
2755 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2757 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2758 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2759 __cplusplus && ! defined _STDLIB_H && !
2760 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2761 defined free))]: Include <stdlib.h> rather than rolling our own
2762 declarations of malloc and free, to avoid problems with
2763 incompatible declarations (using 'throw') C++'s stdlib.h. This
2764 should fix Debian bug 340012
2765 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2766 reported by Guillaume Melquiond.
2768 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2770 * NEWS: Clarify symbols versus types in unused-value warnings.
2772 * configure.ac (AC_INIT): Bump version number.
2774 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2776 * NEWS: Version 2.1a.
2777 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2778 since C99 requires this.
2780 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2782 * m4/c-working.m4: New file.
2783 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2785 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2787 * Makefile.maint: Merge from coreutils.
2789 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2791 More portability fixes for problems summarized by Nelson H. F. Beebe.
2793 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2794 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2795 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2796 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2797 messes up because C++ code is compiled in 32-bit mode but linked
2800 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2802 More portability fixes for problems summarized by Nelson H. F. Beebe.
2804 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2805 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2807 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2808 nodist_PROGRAMS, since we don't need to actually compile the
2809 example if we're just doing a plain 'make'. This avoids bothering
2810 the installer unnecessarily about problems due to weird C++
2813 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2815 More portability fixes for problems summarized by Nelson H. F. Beebe.
2817 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2818 than #include "...", and compile with -I'.'. The old method was
2819 not portable, according to Posix and the C standard, and it does
2820 not work with Sun C 5.7, where previous #line directives affect
2821 the working directory used in later #include "..." directives.
2823 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2825 Various DJGGP specific issues in /djgpp
2827 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2829 More portability fixes for problems summarized by Nelson H. F. Beebe.
2831 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2832 '#include <map>' works and that you can apply ++ to iterators.
2834 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2836 Work around portability problems summarized by Nelson H. F. Beebe in
2837 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2839 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2840 that '#include <string>' works.
2842 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2843 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2844 "warning: sorry: semantics of inline function static data `const
2845 unsigned char translate_table[262]' are wrong (you'll wind up with
2848 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2849 or, xor to not_, and_, or_, and xor_, respectively. This works
2850 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2851 random system header somewhere that includes the equivalent of
2854 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2855 -E" works; it apparently doesn't work with PathScale EKO Compiler
2858 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2860 During deterministic GLR operation, user actions should be able to
2861 influence the parse by changing yychar. To make this easier to fix and
2862 to make glr.c easier to evolve in general, don't maintain yytoken in
2863 parallel with yychar; just compute yytoken when needed.
2864 * tests/glr-regression.at (Incorrect lookahead during deterministic
2865 GLR): Check that setting yychar in a user action has the intended
2867 * data/glr.c (yyGLRStack): Remove yytokenp member.
2868 (yyclearin): Don't set *yytokenp.
2869 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2870 yychar rather than *yytokenp to determine the current lookahead.
2871 Compute yytoken locally when needed.
2872 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2875 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2876 after `--report' documentation.
2878 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2880 * src/parse-gram.y (grammar_declaration): Location of printer
2881 symbol is @1, not list->location. Bug reported by twlevo.
2882 * tests/input.at (Incompatible Aliases): Adjust to above change.
2884 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2886 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2887 all the test at once. This makes the output easier to read in the
2890 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2891 got from <http://bro-ids.org/download.html>. The bug is that
2892 when two actions appeared in succession, the second one was
2893 scanned before the first one was added to the grammar rule
2894 as a midrule action. Bison then output the incorrect warning
2895 "parse.y:905.17-906.36: warning: unused value: $3".
2896 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2897 associated with a value.
2898 (rhs): Don't invoke grammar_current_rule_action_append.
2899 (action): Invoke it here instead.
2900 * src/reader.c (grammar_midrule_action): Now extern.
2901 (grammar_current_rule_action_append): Don't invoke
2902 grammar_midrule_action; that is now the scanner's job.
2903 * src/reader.h (last_string, last_braced_code_loc):
2904 (grammar_midrule_action): New decls.
2905 * src/scan-gram.l (last_string): Now extern, sigh.
2906 (last_braced_code_loc): New extern variable.
2907 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2908 rule already has an action.
2909 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2910 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2911 Add some tests to check that the above changes fixed the bug.
2913 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2915 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2916 All used changed. Check whether the symbol has a destructor,
2917 not whether it is typed.
2918 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2919 that the values are still reported as unused. All line numbers
2922 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2924 Work around a bug in bro 0.8, which underparenthesizes its
2925 definition of YYLLOC_DEFAULT.
2926 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2928 * data/lalr1.cc: Likewise.
2929 * data/yacc.cc: Likewise.
2931 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2933 Work around a bug in Pike 7.0, and give the Pike folks a
2934 better way to override the usual int widths.
2935 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2936 user can override the types.
2937 (short): #undef, to work around a bug in Pike 7.0.
2938 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2939 (union yyalloc.yyss): Use yytype_int16 rather than short.
2941 (yysigned_char): Remove.
2942 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2943 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2944 * tests/regression.at (Web2c Actions): Adjust to above changes.
2946 * src/reader.c (check_and_convert_grammar): New function.
2947 (reader): Close the input file even if something went wrong during
2948 parsing. Minor file descriptor leak reported by twlevo.
2950 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2951 to pacify gcc -Wswitch-default.
2952 * src/scan-gram.l (adjust_location): Use a default: break; case
2953 to pacify gcc -Wswitch-default.
2954 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2955 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2956 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2957 Move these decls to scan-skel.l, since they don't need to be
2959 * src/scan-skel.l: Accept the above decls.
2960 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2963 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2965 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
2966 since we don't want to insist on a version number at the start
2967 of the changelog every time.
2968 * Makefile.maint: Sync from coreutils a bit better.
2969 (sc_trailing_blank): Renamed from sc_trailing_space.
2971 (sc_no_if_have_config_h, sc_require_config_h):
2972 (sc_prohibit_assert_without_use): New rules.
2973 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
2974 (sc_dd_max_sym_length): Fix leading spaces in rule.
2975 (sc_system_h_headers): Prefix with @.
2976 (sc_useless_cpp_parens, m4-check): Output line numbers.
2977 (changelog-check): Allow version only in head.
2978 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
2979 satisfy new Makefile.maint rule.
2980 * data/glr.c: Likewise.
2981 * data/glr.cc: Likewise.
2982 * data/lalr1.cc: Likewise.
2983 * data/yacc.c: Likewise.
2984 * lib/ebitsetv.c: Likewise.
2985 * lib/lbitset.c: Likewise.
2986 * lib/subpipe.c: Likewise.
2987 * lib/timevar.c: Likewise.
2988 * src/system.h: Likewise.
2989 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
2990 * djgpp/Makefile.maint: Add copyright notice.
2991 * djgpp/README.in: Likewise.
2992 * djgpp/config.bat: Likewise.
2993 * djgpp/config.site: Likewise.
2994 * djgpp/config_h.sed: Likewise.
2995 * djgpp/djunpack.bat: Likewise.
2996 * djgpp/config.sed: Fix copyright notice to match standard format.
2997 * djgpp/subpipe.h: Likewise.
2998 * lib/bitsetv-print.c: Likewise.
2999 * lib/bitsetv.c: Likewise.
3000 * lib/subpipe.h: Likewise.
3001 * lib/timevar.c: Likewise.
3002 * lib/timevar.h: Likewise.
3003 * djgpp/subpipe.c: Use standard recipe for config.h.
3004 * lib/abitset.c: Likewise.
3005 * lib/bitset.c: Likewise.
3006 * lib/bitset_stats.c: Likewise.
3007 * lib/bitsetv-print.c: Likewise.
3008 * lib/bitsetv.c: Likewise.
3009 * lib/ebitsetv.c: Likewise.
3010 * lib/get-errno.c: Likewise.
3011 * lib/lbitset.c: Likewise.
3012 * lib/subpipe.c: Likewise.
3013 * lib/timevar.c: Likewise.
3014 * lib/vbitset.c: Likewise.
3015 * tests/local.at: Likewise.
3016 * src/scan-gram.l: Don't include verify.h, since system.h does
3018 * .x-sc_require_config_h: New file.
3019 * .x-sc_unmarked_diagnostics: New file.
3021 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
3023 Be a bit more systematic about using 'abort'.
3024 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
3025 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
3026 Put 'default: abort ();' before some other case, to satisfy older
3028 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3029 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
3030 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
3031 * src/conflicts.c (resolve_sr_conflict): Likewise.
3032 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
3033 (get_decision_str, get_orientation_str, get_node_alignment_str):
3034 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
3035 (get_linestyle_str, get_arrowstyle_str): Likewise.
3036 * src/conflicts.c (resolve_sr_conflict):
3037 Use a default case rather than one for the one remaining enum
3038 value, to catch invalid enum values as well.
3039 * src/lalr.c (set_goto_map, map_goto):
3040 Prefer "assert (FOO);" to "if (!FOO) abort ();".
3041 * src/nullable.c (nullable_compute, token_definitions_output):
3043 * src/reader.c (packgram, reader): Likewise.
3044 * src/state.c (transitions_to, state_new, state_reduction_find):
3046 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
3047 (symbol_pack): Likewise.
3048 * src/tables.c (conflict_row, pack_vector): Likewise.
3049 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
3050 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
3051 * src/system.h: Don't include <assert.h>.
3052 (assert): New macro.
3054 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
3055 (Destructor Decl, Parser Function, Pure Calling):
3056 Describe rules for braces inside C code more carefully.
3058 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
3060 Fix some porting glitches found by Nelson H. F. Beebe.
3061 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
3062 compilers that don't understand that abort () does not return.
3063 * src/state.c (transitions_to): Likewise.
3064 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3065 that '#include <cstdlib>' works.
3066 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
3067 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
3068 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
3069 for the benefit of some pre-C99 compilers.
3071 * bootstrap: Undo changes to gnulib files that autoreconf made.
3073 Minor fixups to get 'make maintainer-check' to work.
3074 * configure.ac: Don't use -Wnested-externs, as it's incompatible
3075 with the new verify.h implementation.
3076 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
3077 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
3078 * data/yacc.c (YYUSE): Likewise.
3079 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
3080 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
3081 * src/parse-gram.y (declaration): Don't pass a string constant
3082 to a function that expects char *, since GCC might complain
3083 about the constant value.
3084 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
3085 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
3086 before #defining them.
3087 * tests/glr-regression.at
3088 (Incorrectly initialized location for empty right-hand side in GLR):
3089 In yyerror, use the msg arg.
3090 (Corrupted semantic options if user action cuts parse):
3091 (Incorrect lookahead during deterministic GLR):
3092 (Incorrect lookahead during nondeterministic GLR):
3093 Don't name a local var 'index'; it shadows string.h's 'index'.
3095 2006-01-19 Akim Demaille <akim@epita.fr>
3097 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
3098 location, not just parts of it.
3100 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
3102 * NEWS: Document the fact that multiple %unions are now allowed.
3103 * doc/bison.texinfo (Union Decl): Likewise.
3104 * TODO: This feature is now implemented, so remove it from
3107 * Makefile.maint: Merge with coreutils Makefile.maint.
3108 (CVS_LIST): Use build-aux version if available.
3109 (VERSION_REGEXP): New macro.
3110 (syntax-check-rules): Add sc_no_if_have_config_h,
3111 sc_prohibit_assert_without_use, sc_require_config_h,
3112 sc_useless_cpp_parens.
3113 (sc_obsolete_symbols): Check for O_NDELAY.
3114 (sc_dd_max_sym_length): Track coreutils.
3115 (sc_unmarked_diagnostics): Look in all files, not just *.c.
3116 (sc_useless_cpp_parens): New rule.
3117 (news-date-check): Look for version or today's date.
3118 (changelog-check): Don't require version number near head.
3119 (copyright-check): Use current year instead of hardwiring 2005.
3120 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
3121 (announcement): Add --gpg-key-ID.
3123 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
3126 Avoid undefined behavior that addressed just before the start of an
3127 array. Problem reported by twlevo.
3128 * src/reader.c (packgram): Prepend a new sentinel before ritem.
3129 * src/lalr.c (build_relations): Rely on new sentinel.
3130 * src/gram.c (gram_free): Adjust to new sentinel.
3132 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
3134 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
3135 yylookaheadNeeds. All uses updated.
3136 (yysplitStack): Rename local yynewLookaheadStatuses to
3137 yynewLookaheadNeeds.
3138 * data/glr-regression.at (Incorrect lookahead during nondeterministic
3139 GLR): In comments, change `lookahead status' to `lookahead need'.
3141 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3143 * data/glr.c (yysplitStack): A little stylistic rewrite.
3145 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3147 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
3149 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
3151 * doc/bison.texinfo: Fix some typos.
3152 (GLR Semantic Actions): New subsection discussing special
3153 considerations because GLR semantic actions might be deferred.
3154 (Actions): Mention look-ahead usage of yylval.
3155 (Actions and Locations): Mention look-ahead usage of yylloc.
3156 (Special Features for Use in Actions): Add YYEOF entry and mention it
3157 in the yychar entry.
3158 In the yychar entry, remove mention of the local yychar case (pure
3159 parser) since this is irrelevant information when writing semantic
3160 actions and since it's already discussed in `Bison Symbols' where
3161 yychar is otherwise described as an external variable.
3162 In the yychar entry, don't call it the `current' look-ahead since it
3163 isn't when semantic actions are deferred.
3164 In the yychar and yyclearin entries, add note about deferred semantic
3166 Add yylloc and yylval entries discussing look-ahead usage.
3167 (Look-Ahead Tokens): When discussing yychar, don't call it the
3168 `current' look-ahead, and do mention yylval and yylloc.
3169 (Error Recovery): Cross-reference `Action Features' when mentioning
3171 (Bison Symbols): In the yychar entry, don't call it the `current'
3173 In the yylloc and yylval entries, mention look-ahead usage.
3175 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3177 * tests/glr-regression.at: Update copyright year to 2006.
3179 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3181 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
3182 use during nondeterministic operation to track which stacks have
3183 actually needed the current lookahead.
3184 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
3185 Allocate, deallocate, resize, and otherwise shuffle space for
3186 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
3187 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
3188 appropriately during nondeterministic operation.
3189 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
3190 members to store the current lookahead to be used by the deferred
3192 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
3193 from which the RHS is taken. Set the lookahead members of the new
3194 yySemanticOption according to the lookahead status for stack yyk.
3195 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
3196 yyaddDeferredAction.
3197 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
3198 members of yySemanticOption before invoking yyuserAction, and then set
3199 them back to their current values afterward.
3200 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
3201 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
3202 * tests/glr-regression.at: Remove `.' from the ends of recent test case
3203 titles for consistency.
3204 (Leaked merged semantic value if user action cuts parse): In order to
3205 suppress lint warnings, use arguments in merge function, and assign
3206 char value < 128 in main.
3207 (Incorrect lookahead during deterministic GLR): New test case.
3208 (Incorrect lookahead during nondeterministic GLR): New test case.
3210 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3212 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
3213 !yyvaluep as signal that no semantic value is available to print.
3214 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
3215 to print a semantic value.
3217 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3219 * tests/glr-regression.at: For consistency with my newer test cases,
3222 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3224 * data/glr.c (yyresolveValue): When merging semantic options, if at
3225 least one user action succeeds but a later one cuts the parse, then
3226 destroy the semantic value before returning rather than leaking it.
3227 (yyresolveStates): If a user action cuts the parse and thus
3228 yyresolveValue fails, ignore the (unset) semantic value rather than
3229 corrupting the yyGLRState, and empty the semantic options list since
3230 the user actions should have called all necessary destructors.
3231 Simplify code with YYCHK.
3232 * tests/glr-regression.at (Corrupted semantic options if user action
3233 cuts parse): New test case.
3234 (Undesirable destructors if user action cuts parse): New test case.
3235 Before applying any of this patch, this test case never actually failed
3236 for me... but only because the corrupted semantic options usually
3238 (Leaked merged semantic value if user action cuts parse): New test
3241 2006-01-05 Akim Demaille <akim@epita.fr>
3243 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
3245 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
3247 * data/c.m4 (b4_c_modern): New macro, with a new provision for
3248 _MSC_VER. Problem reported by Cenzato Marco.
3249 (b4_c_function_def): Use it.
3250 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
3252 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
3253 than rolling our own.
3255 2006-01-04 Akim Demaille <akim@epita.fr>
3257 Also warn about non-used mid-rule values.
3258 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
3260 (symbol_list_new): Adjust.
3261 * src/reader.c (symbol_typed_p): New.
3262 (grammar_rule_check): Use it.
3263 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
3265 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
3267 * tests/actions.at (Exotic Dollars): Adjust.
3269 2006-01-04 Akim Demaille <akim@epita.fr>
3271 * src/reader.c (grammar_midrule_action): If $$ is set in a
3272 mid-rule, move the `used' bit to its lhs.
3273 * tests/input.at (Unused values): New.
3274 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
3276 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
3278 * doc/bison.texinfo (Bison Options): Say more accurately what
3280 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
3281 about declarations in the grammar when in Yacc mode, as POSIX does
3282 not require a diagnostic when the grammar uses extensions.
3284 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
3286 Warn about dubious constructions like "%token T T".
3288 * src/symtab.h (struct symbol.declared): New member.
3289 * src/symtab.c (symbol_new): Initialize it to false.
3290 (symbol_class_set): New arg DECLARING, specifying whether
3291 this is a declaration that we want to warn about, if there
3292 is more than one of them. All uses changed.
3294 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
3295 Allow multiple %union directives, whose contents concatenate.
3296 * src/parse-gram.y (grammar_declaration): Likewise.
3297 Use muscle_code_grow, so that we don't need stype_line any more.
3300 * src/muscle_tab.c (muscle_grow): Fix comment.
3302 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
3303 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
3304 Update copyright year to 2006.
3306 2006-01-03 Akim Demaille <akim@epita.fr>
3308 Have glr.cc pass (some of) the calc.at tests.
3309 * data/glr.cc (b4_parse_param_orig): New.
3310 (b4_parse_param): Improve its definition, and bound it more
3311 clearly in the skeleton.
3312 (b4_epilogue): Append, instead of prepending, in order to keep
3314 Simplify the generation of auxiliary functions: locations and
3315 purity are mandated.
3316 (b4_global_tokens_and_yystype): Honor it.
3317 * data/location.cc (c++.m4): Don't include it.
3318 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
3320 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
3322 Be sure to initialize the first position's filename.
3323 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
3325 (AT_CHECK_CALC_GLR_CC): New.
3326 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
3328 2006-01-02 Akim Demaille <akim@epita.fr>
3330 * src/output.c (output_skeleton): Don't hard wire the inclusion of
3332 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3333 * data/glr.cc: Do not include stack.hh.
3335 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3337 * data/glr.c: Reformat whitespace with tabs.
3338 (b4_lpure_formals): Remove this unused m4 macro.
3339 * tests/cxx-type.at: Reformat whitespace with tabs.
3340 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
3341 since it's a member. Rename type to isNterm for clarity.
3343 2005-12-29 Akim <akim@sulaco.local>
3345 Let glr.cc catch up with symbol_value_print.
3346 * data/glr.cc (b4_yysymprint_generate): Replace by...
3347 (b4_yy_symbol_print_generate): this.
3348 (yy_symbol_print, yy_symbol_value_print): Declare them.
3350 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
3352 * src/location.h (boundary): Note that a line or column equal
3353 to INT_MAX indicates an overflow.
3354 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
3355 (rule_length_overflow, increment_rule_length, add_column_width):
3357 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
3358 (<SC_BRACED_CODE>"}"):
3359 Use increment_rule_length rather than incrementing it by hand.
3360 (adjust_location, handle_syncline): Diagnose overflow.
3361 (handle_action_dollar, handle_action_at):
3362 Fix bug with monstrosities like $-2147483648.
3363 Remove now-unnecessary checks.
3364 (scan_integer): Verify assumptions and remove now-unnecessary checks.
3365 (convert_ucn_to_byte): Verify assumptions.
3366 (handle_syncline): New arg LOC. All callers changed.
3367 Don't store through a value derived from char const * pointer.
3369 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
3372 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
3374 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
3375 Remove unnecessary forward static decls.
3377 2005-12-27 Akim Demaille <akim@epita.fr>
3379 * src/reader.c (grammar_current_rule_check): Also check that $$
3381 Take the rule to check as argument, hence rename as...
3382 (grammar_rule_check): this.
3383 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
3385 (grammar_rule_begin, grammar_rule_end): these, for consistency.
3386 (grammar_midrule_action, grammar_symbol_append): Now static.
3387 * tests/torture.at (input): Don't rely on the default action
3388 being always performed.
3389 * tests/calc.at: "Set" $$ even when the action is "cut" with
3391 * tests/actions.at (Exotic Dollars): Instead of using unused
3392 values, check that the warning is issued.
3394 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
3396 * NEWS: Improve wording for unused-value warnings.
3398 2005-12-22 Akim Demaille <akim@epita.fr>
3400 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
3401 (b4_yysymprint_generate): Rename as...
3402 (b4_yy_symbol_print_generate): this.
3403 Generate yy_symbol_print instead of yysymprint.
3404 Generate also yy_symbol_value_print, and use it.
3406 2005-12-22 Akim Demaille <akim@epita.fr>
3408 * NEWS: Warn about unused values.
3409 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
3411 (symbol_list_n_get, symbol_list_n_used_set): New.
3412 (symbol_list_n_type_name_get): Use symbol_list_n_get.
3413 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
3414 * src/reader.c (grammar_current_rule_check): Check that values are
3416 * src/symtab.c (symbol_print): Accept 0.
3417 * tests/existing.at: Remove the type information.
3419 Remove useless actions (beware of mid-rule actions: perl -000
3420 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
3421 * tests/actions.at (Exotic Dollars): Use unused values.
3422 * tests/calc.at: Likewise.
3423 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3426 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
3429 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
3431 Undo 2005-12-01 tentative license wording change. The wording is
3432 still being reviewed by the lawyers, and we don't want to wait for
3433 them before publishing a test release. For now, revert to the
3435 * NEWS: Undo 2005-12-01 change.
3436 * data/glr.c: Revert to previous license wording.
3437 * data/glr.cc: Likewise.
3438 * data/lalr1.cc: Likewise.
3439 * data/location.cc: Likewise.
3440 * data/yacc.c: Likewise.
3442 * NEWS: Reword %destructor vs YYABORT etc.
3443 * data/glr.c: Use American spacing, for consistency.
3444 * data/glr.cc: Likewise.
3445 * data/lalr1.cc: Likewise.
3446 * data/yacc.c: Likewise.
3447 * data/yacc.c: Reformat comments slightly.
3448 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3449 for consistency. Fix some spelling errors and reword recently-included
3451 * tests/cxx-type.at: Cast results of malloc, for C++.
3453 2005-12-21 Joel E. Denny <address@hidden>
3455 * tests/cxx-type.at: Construct a tree, count the parents of shared
3456 nodes, and free each node once and only once. Previously, the memory
3457 for semantic values was leaked instead.
3459 2005-12-21 Joel E. Denny <address@hidden>
3461 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3462 (yylval, yylloc): If pure, #define to yystackp->yyval and
3463 yystackp->yyloc similar to yychar and yynerrs.
3464 (yyparse): If pure, remove local yylval and yylloc. Add local
3465 yystackp to accommodate pure definitions of yylval and yylloc.
3466 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3467 yylvalp and yyllocp to &yylval and &yylloc.
3468 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3469 namespace. Previously, nerrs and char were missing, but lval and lloc
3471 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3472 yylvalp and yyllocp parameters since, if pure, these are now always
3473 accessible through yystackp. If not pure, they are still accessible
3475 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3476 `if (YYID (N))' to pacify lint.
3478 2005-12-21 Akim Demaille <akim@epita.fr>
3480 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3481 destroy the RHS symbols of a rule.
3482 * data/yacc.c (yylen): Initialize to 0.
3483 Keep its value to the number of items to possibly shift.
3484 In particular, a regular successful parse that ends on YYFINAL by
3485 a (internal) YYACCEPT must not have yylen != 0.
3486 (yyerrorlab, yyreturn): Pop the RHS.
3487 Reorder a bit to emphasize the `shifting' bits of code.
3488 (YYPOPSTACK): Now accept a number of items to pop.
3489 * data/lalr1.cc: Likewise.
3490 * data/glr.c: Formatting changes.
3491 Use goto instead of fall through.
3492 * doc/bison.texinfo (Destructor Decl): Complete.
3494 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3496 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3497 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3498 * djgpp/config.bat: Replace every occurence of the file name
3499 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3500 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3501 * djgpp/config.sed: Replace every occurence of the file name
3502 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3503 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3504 * djgpp/djunpack.bat: DJGPP specific file.
3505 * djgpp/fnchange.lst: DJGPP specific file.
3506 * djgpp/README.in: Add new information about how to unpack the bison
3507 source on MSDOS and other systems which have 8.3 file name restrictions
3508 using djunpack.bat and fnchange.lst.
3510 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3512 * bootstrap (build_cvs_prefix): Remove; unused.
3513 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3514 when getting gnulib.
3516 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3518 * data/glr.c: Reorder typedef declarations for structs to match order
3519 of struct declarations.
3520 Rename yystack everywhere to yystackp except in yyparse where it's not
3522 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3524 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3525 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3526 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3529 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3531 * tests/sets.at (Accept): Fix typos in regular expression used to
3532 sed out the final state number.
3534 Work around portability problem on Solaris 10: flex-generated
3535 files include <stdio.h> before <config.h>, which messes up
3536 because the latter defines __EXTENSIONS__. Address the problem
3537 by creating two new little files that include <config.h> first,
3538 then include the flex-generated files. Rewrite everyone else
3539 to include <config.h> first, as well.
3540 * lib/timevar.c: Always include "config.h".
3541 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3542 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3543 (EXTRA_bison_SOURCES): New macro.
3544 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3545 * src/system.h: Don't include config.h.
3546 * src/LR0.c: Include <config.h> first.
3547 * src/assoc.c: Likewise.
3548 * src/closure.c: Likewise.
3549 * src/complain.c: Likewise.
3550 * src/conflicts.c: Likewise.
3551 * src/derives.c: Likewise.
3552 * src/files.c: Likewise.
3553 * src/getargs.c: Likewise.
3554 * src/gram.c: Likewise.
3555 * src/lalr.c: Likewise.
3556 * src/location.c: Likewise.
3557 * src/main.c: Likewise.
3558 * src/muscle_tab.c: Likewise.
3559 * src/nullable.c: Likewise.
3560 * src/output.c: Likewise.
3561 * src/parse-gram.y: Likewise.
3562 * src/print.c: Likewise.
3563 * src/print_graph.c: Likewise.
3564 * src/reader.c: Likewise.
3565 * src/reduce.c: Likewise.
3566 * src/relation.c: Likewise.
3567 * src/state.c: Likewise.
3568 * src/symlist.c: Likewise.
3569 * src/symtab.c: Likewise.
3570 * src/tables.c: Likewise.
3571 * src/uniqstr.c: Likewise.
3572 * src/vcg.c: Likewise.
3574 * src/parse-gram.y: Fix minor problems uncovered by lint.
3575 (current_lhs, current_lhs_location): Now static.
3576 (current_assoc): Remove unused variable.
3578 Cleanups so that Bison-generated parsers have less lint.
3579 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3580 Prepend /*ARGSUSED*/, for lint's sake.
3581 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3582 definition if 'lint' is defined.
3583 (YYID): New macro (or function, if lint).
3584 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3585 * data/yacc.c: Likewise.
3586 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3587 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3588 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3590 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3591 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3592 Use YYID(0) rather than 0, for lint.
3593 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3594 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3596 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3598 * tests/glr-regression.at
3599 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3600 Close memory leak reported by twlevo.
3602 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3604 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3606 (yyparse): Iterate another stack in order to call user destructors.
3607 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3609 (Duplicated user destructor for lookahead): This test now is expected
3612 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3614 * NEWS: Document the following change.
3615 * data/yacc.c: Say "parser skeleton" rather than "file", since
3616 it's no longer just a file.
3617 * data/glr.c: Grant a special exception for C GLR parsers, that
3618 reads like the already-existing exception for C LALR(1) parsers.
3619 * data/glr.cc: Likewise.
3620 * data/lalr1.cc: Likewise.
3621 * data/location.cc: Likewise.
3622 * data/yacc.c: Reword the "written by" statement to clarify that
3623 it was the parser skeleton, not the entire output file.
3624 * data/glr.c: Written by Paul Hilfinger.
3625 * data/glr.cc: Written by Akim Demaille.
3626 * data/lalr1.cc: Likewise.
3628 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3630 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3631 Fix typos in previous change that broke 'make check'.
3632 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3634 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3635 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3636 We can revert this once things settle down.
3638 * src/conflicts.c (conflicts_print): Don't print file name twice
3639 when %expect fails because there were no conflicts.
3640 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3642 * tests/conflicts.at (%expect not enough, %expect too much):
3643 (%expect with reduce conflicts): Adjust to new behavior.
3645 2005-11-18 Akim Demaille <akim@epita.fr>
3647 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3649 * NEWS: Document this.
3650 * doc/bison.texinfo (Expect Decl): Likewise.
3652 2005-11-16 Akim Demaille <akim@epita.fr>
3654 Generalize the display of semantic values and locations in traces.
3655 * data/glr.c (yy_reduce_print): Fix indices (again).
3656 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3658 * data/lalr1.cc (yyreduce_print): Rename as...
3659 (yy_reduce_print): this.
3660 Display values and locations.
3661 * data/yacc.c (yy_reduce_print): Likewise.
3662 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3663 (yysymprint): Move higher to be visible from yy_reduce_print).
3665 * tests/calc.at: Adjust the expected length of the traces.
3667 2005-11-14 Akim Demaille <akim@epita.fr>
3669 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3670 from 1 to N, while values and location start at 0.
3671 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3673 2005-11-14 Akim Demaille <akim@epita.fr>
3675 * data/glr.c (yy_reduce_print): Fix the $ number.
3677 2005-11-14 Akim Demaille <akim@epita.fr>
3679 "Use" parse parameters.
3680 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3681 * data/glr.c, data/glr.cc: Use them.
3682 * data/glr.c (YYUSE): Have a C++ definition that supports
3685 2005-11-14 Akim Demaille <akim@epita.fr>
3687 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3689 2005-11-14 Akim Demaille <akim@epita.fr>
3692 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
3694 2005-11-12 Akim Demaille <akim@epita.fr>
3696 Let position and location be PODs.
3697 * data/location.cc (position::initialize, location::initialize): New.
3698 (position::position, location::location): Define only if
3699 b4_location_constructors is defined.
3700 * data/lalr1.cc (b4_location_constructors): Define it for backward
3702 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3704 2005-11-12 Akim Demaille <akim@epita.fr>
3706 * data/lalr1.cc: Move the body of the ctor and dtor into the
3707 parser file (instead of the header).
3708 Wrap the implementations in a "namespace yy".
3710 2005-11-12 Akim Demaille <akim@epita.fr>
3712 Have glr.c include its header file when created.
3713 * data/glr.c (b4_shared_declarations): New.
3714 Output them verbatim in the parser if !%defines, otherwise
3715 output then in the header file, and include it instead.
3717 2005-11-11 Akim Demaille <akim@epita.fr>
3719 * data/glr.c: Comment changes.
3721 2005-11-11 Akim Demaille <akim@epita.fr>
3723 When yydebug, report semantic and location values for reductions.
3724 * data/glr.c (yy_reduce_print): Report the semantic values and the
3726 (YY_REDUCE_PRINT): Adjust.
3727 (yyglrReduce): Use them.
3728 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3729 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3730 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3733 2005-11-10 Akim Demaille <akim@epita.fr>
3735 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3736 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3737 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3739 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3741 * m4/cxx.m4, examples/Makefile.am: Don't build
3742 examples/calc++ if no C++ compiler is available. (trivial change)
3744 2005-11-09 Akim Demaille <akim@epita.fr>
3746 * src/scan-skel.l: Use a couple of asserts.
3748 2005-11-03 Akim Demaille <akim@epita.fr>
3750 In some (weird) cases, the final state number is incorrect.
3751 Reported by Alexandre Duret-Lutz.
3752 * src/LR0.c (state_list_append): Remove the computation of
3754 (save_reductions): Do it here.
3755 (get_state): Alpha conversion.
3756 (generate_states): Use a for loop.
3757 * src/gram.h (item_number_is_rule_number)
3758 (item_number_is_symbol_number): New.
3759 * src/state.c: Use assert.
3760 * src/system.h: Include assert.h.
3761 * tests/sets.at (Accept): New.
3763 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3765 * data/glr.c (yyfill): Adjust comment.
3766 (yyresolveAction): Initialize default location properly
3767 for empty right-hand sides.
3768 (yydoAction): Ditto.
3769 Add comment explaining apparently dead code.
3770 * tests/glr-regression.at
3771 (Incorrectly initialized location for empty right-hand side in GLR):
3774 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3776 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3777 gnulib when interrupted. This fixes some race conditions and
3778 works around some portability problems (one noted by Paul
3781 2005-10-22 Akim <akim@epita.fr>
3783 * Makefile.cfg: Adjust to config -> build-aux.
3786 2005-10-21 Akim Demaille <akim@epita.fr>
3788 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3790 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3791 * data/yacc.c (b4_Pure_if): Rename as...
3792 (b4_yacc_pure_if): this.
3793 (YY_SYMBOL_PRINT, yyparse): Adjust.
3794 * doc/bison.texinfo: Formatting changes.
3796 2005-10-21 Akim Demaille <akim@epita.fr>
3798 Finish the transition config -> build-aux.
3799 * configure.ac, Makefile.am: Use build-aux.
3800 * config/prev-version, config/announce-gen, config/Makefile.am:
3802 * build-aux/prev-version, build-aux/announce-gen,
3803 * build-aux/Makefile.am: here.
3805 2005-10-14 Akim Demaille <akim@epita.fr>
3807 * examples/calc++/test: Use set -x only when VERBOSE.
3809 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3811 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3812 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3814 2005-10-13 Akim Demaille <akim@epita.fr>
3816 * src/scan-skel.l: Output the base name parts of the parser and
3818 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
3820 Use this to exercise C++ outputs in subdirs.
3821 Reported by Oleg Smolsky.
3823 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3825 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3826 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3827 Problem reported by John P. Hartmann.
3828 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3831 2005-10-12 Akim Demaille <akim@epita.fr>
3833 * src/parse-gram.y (version_check): Exit 63 to please missing
3834 (stands for "version mismatch).
3835 * tests/input.at, doc/bison.texinfo: Adjust.
3837 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3839 Work around portability problems with Visual Age C compiler
3840 (xlc and xlC_r) reported by John P. Hartmann.
3841 * data/location.cc (initial_column, initial_line): Remove.
3842 All uses replaced by 0 and 1.
3843 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3844 that xlc complains about.
3845 * src/scan-skel.l (skel_wrap): Likewise.
3846 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
3848 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3849 __STDC_VERSION__. Use it everywhere instead of looking at
3850 __STDC__ and __cplusplus.
3852 2005-10-10 Akim Demaille <akim@epita.fr>
3854 * examples/calc++/test: Be quiet unless VERBOSE.
3856 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3858 * data/c.m4 (yydestruct, yysymprint):
3859 Use YYUSE instead of casting to void.
3860 * data/glr.c (YYUSE): New macro.
3861 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3862 Use it instead of rolling our own.
3863 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3865 Use /*CONSTCOND*/ to suppress lint warnings.
3866 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3867 (YY_STACK_PRINT): Use 'false' not '0'.
3869 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3870 * data/yacc.c (YYUSE): New macro.
3871 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3872 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3873 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3876 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3877 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3879 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3881 Undo the parts of the unlocked-I/O change that substituted
3882 putc or puts for printf. This might hurt performance a bit,
3883 but some people prefer the printf style.
3884 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3885 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3886 All uses replaced by YYFPRINTF and YYDPRINTF.
3887 * data/yacc.c: Likewise.
3888 * lib/bitset.c (bitset_print): Likewise.
3889 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3891 * lib/lbitset.c (debug_lbitset): Likewise.
3892 * src/closure.c (print_firsts, print_fderives): Likewise.
3893 * src/gram.c (grammar_dump): Likewise.
3894 * src/lalr.c (look_ahead_tokens_print): Likewise.
3895 * src/output.c (escaped_output): Likewise.
3896 (user_actions_output): Break apart two printfs.
3897 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3898 * src/reduce.c (reduce_print): Likewise.
3899 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3900 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3902 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3903 Use assignments rather than casts-to-void to suppress
3904 unused-variable warnings. This pacifies 'lint'.
3905 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3906 unused-variable warnings.
3908 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3910 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3912 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3914 Use unlocked I/O for a minor performance improvement on hosts like
3915 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3916 is to use the gnlib unlocked-io module, and to prefer putc and
3917 puts to printf when either will work (since the latter doesn't
3918 come in an unlocked flavor).
3919 * bootstrap (gnulib_modules): Add unlocked-io.
3920 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3921 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3922 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3923 and similarly for puts and putc and printf.
3924 * data/yacc.c: Likewise.
3925 * lib/bitset.c (bitset_print): Likewise.
3926 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3927 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3929 * lib/lbitset.c (debug_lbitset): Likewise.
3930 * src/closure.c (print_firsts, print_fderives): Likewise.
3931 * src/gram.c (grammar_dump): Likewise.
3932 * src/lalr.c (look_ahead_tokens_print): Likewise.
3933 * src/output.c (escaped_output): Likewise.
3934 (user_actions_output): Coalesce two printfs.
3935 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
3936 * src/reduce.c (reduce_print): Likewise.
3937 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3938 * src/system.h: Include unlocked-io.h rather than stdio.h.
3940 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3941 this confuses xgettext.
3943 2005-10-02 Akim Demaille <akim@epita.fr>
3945 * bootstrap (gnulib_modules): Add strverscmp.
3946 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3947 * m4/.cvsignore: Add strverscmp.m4.
3948 * src/parse-gram.y (%require): New token, new rule.
3949 (version_check): New.
3950 * src/scan-gram.l (%require): Adjust.
3951 * tests/input.at (AT_REQUIRE): New.
3953 * doc/bison.texinfo (Require Decl): New.
3954 (Calc++ Parser): Use %require.
3956 2005-10-02 Akim Demaille <akim@epita.fr>
3958 * data/location.cc: New.
3960 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3961 Akim Demaille <akim@epita.fr>
3963 Make sure -odir/foo.cc creates dir/location.hh etc.
3964 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
3965 (spec_file_prefix, spec_verbose_file, spec_graph_file)
3966 (spec_defines_file): Now const.
3968 (short_base_name): Remove.
3969 * src/files.c: Adjust.
3970 (dirname.h): Include.
3971 (base_name): Don't prototype it.
3972 (finput): Remove, duplicates gram_in.
3973 (full_base_name, short_base_name): Replace by...
3974 (all_but_ext, all_but_tab_ext): these.
3975 (compute_base_names): Rename as...
3976 (compute_file_name_parts): this.
3977 Update to compute the new variables, including dir_prefix.
3978 Adjust dependencies.
3979 * src/output.c (prepare): Output them.
3980 * src/reader.c: Adjust to use gram_in, not finput.
3981 * src/scan-skel.l (@dir_prefix@): New.
3983 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3985 * lib/subpipe.c: New function end_of_output_subpipe() added
3986 to allow support for non-posix systems. This is a no-op function
3989 * lib/subpipe.h: New function end_of_output_subpipe() added
3990 to allow support for non-posix systems. This is a no-op function
3993 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3994 handle the lack of pipe/fork functionality on non-posix systems.
3996 * djgpp/Makefile.maint: DJGPP specific file.
3998 * djgpp/README.in: DJGPP specific file.
4000 * djgpp/config.bat: DJGPP specific configuration file.
4002 * djgpp/config.sed: DJGPP specific configuration file.
4004 * djgpp/config.site: DJGPP specific configuration file.
4006 * djgpp/config_h.sed: DJGPP specific configuration file.
4008 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
4010 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
4012 2005-10-02 Akim Demaille <akim@epita.fr>
4014 * data/location.cc: New, extract from...
4015 * data/lalr1.cc: here.
4016 (location.hh): Include it after the user prologue, in case the
4017 filename type is defined by the user.
4018 Forward declation location and position before the pre-prologue.
4019 (yyresult_): Rename as...
4020 (yyresult): this, it's a local variable, not an attribute.
4021 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
4023 2005-10-01 Akim Demaille <akim@epita.fr>
4025 * examples/extexi: Restore the #line generation.
4027 2005-09-30 Akim Demaille <akim@epita.fr>,
4028 Alexandre Duret-Lutz <adl@gnu.org>
4030 Move the token type and YYSTYPE in the parser class.
4031 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
4032 (parser::token): New, from the moved free definition of tokens.
4033 (parser::semantic_value): Now a full definition instead of an
4034 indirection to YYSTYPE.
4035 (b4_post_prologue): No longer included in the header file, but
4036 in the implementation file.
4037 * doc/bison.texi (C+ Language Interface): Update.
4038 * src/parse-gram.y: Support unary %define.
4039 * tests/actions.at: Define global_tokens_and_yystype for backward
4040 compatibility until we update the tests.
4041 * tests/calc.at: Idem.
4042 (first_line, first_column, last_line, last_column): Define for lalr1.cc
4043 to simplify the code.
4045 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
4047 Port to SunOS 4.1.4, which lacks strtoul and strerror.
4048 Ah, the good old days! Problem reported by Peter Klein.
4049 * bootstrap (gnulib_modules): Add strerror, strtoul.
4050 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
4051 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
4053 2005-09-29 Akim Demaille <akim@epita.fr>
4055 * data/c.m4 (b4_error_verbose_if): New.
4056 * data/lalr1.cc: Use it.
4057 (YYERROR_VERBOSE_IF): Remove.
4058 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
4059 parser members, replaced by...
4060 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
4062 (yysyntax_error_): Takes the state number as argument.
4063 (yyreduce_print_): Use the argument yyrule, not the former
4066 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
4068 * bootstrap (gnulib_modules): Add verify.
4069 * lib/.cvsignore: Add verify.h.
4070 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
4071 * src/system.h (verify): Remove.
4072 Include verify.h instead.
4073 * src/tables.c (tables_generate): Use new API for 'verify'.
4075 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
4077 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
4078 local variables whose names begin with 'yy'.
4079 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4080 Trivial changes from Joel E. Denny.
4082 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
4084 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
4085 don't use alloca any more.
4087 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
4088 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
4089 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
4090 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
4091 to match yacc.c, to test more hosts.
4093 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
4095 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
4096 doesn't affect behavior.
4097 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
4099 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
4100 This works a bit better with glibc, if user code has already included
4102 * doc/bison.texinfo (Bison Parser): Document that users can't
4103 arbitrarily use malloc and free for other purposes. Document
4104 that <alloca.h> and <malloc.h> might be included.
4105 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
4106 user must declare alloca.
4108 * HACKING (release): Forwarn the Translation Project about
4111 2005-09-20 Akim Demaille <akim@epita.fr>
4113 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
4115 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
4117 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
4118 (YYSTACK_ALLOC_MAXIMUM): Use it.
4119 (yysyntax_error): New function.
4120 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
4121 multiple syntax errors are reported, and alloca is being used.
4122 Instead, reallocate buffers twice as big each time, so that
4123 we waste at most half the allocated memory. Start with a small
4124 (128-byte) buffer that will suffice in most cases anyway.
4125 Use yysyntax_error to do most of the work.
4127 * doc/bison.texinfo (Error Reporting, Table of Symbols):
4128 yynerrs is the number of errors reported, not the number of
4131 * tests/glr-regression.at (Duplicated user destructor for lookahead):
4132 Mark it as expected to fail.
4133 Cast result of malloc; problem reported by twlevo@xs4all.nl.
4134 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
4135 Don't start user-code symbols with "yy", to avoid name space problems.
4137 2005-09-19 Akim Demaille <akim@epita.fr>
4139 Remove the traits, failed experiment.
4140 It never proved useful, and anyway because of the current
4141 definition, it was not possible to have several specialization of
4142 this traits, making it useless.
4143 * data/lalr1.cc (yy:traits): Remove.
4144 Inline its definitions in the parser class.
4146 2005-09-19 Akim Demaille <akim@epita.fr>
4148 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
4149 least Mac OSX with a /usr/local install of gettext.
4151 2005-09-19 Akim Demaille <akim@epita.fr>
4153 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
4154 and yytoken for similarity with the other skeletons.
4156 2005-09-19 Akim Demaille <akim@epita.fr>
4158 * NEWS, configure.ac: update version number to 2.1a.
4160 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
4162 * NEWS: Version 2.1.
4164 * NEWS: Remove notice of yytname change, since it was never in an
4166 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
4168 * src/output.c (prepare): Likewise.
4169 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
4170 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
4171 is not defined. This is an awful hack, but it's enough for now.
4172 All callers changed.
4173 * tests/glr-regression-at (make_value): Args are const pointers now,
4174 to avoid GCC warning.
4175 (Duplicated user destructor for lookahead): New test. Currently
4176 skipped. It fails on my host but I'm not sure it'll always fail.
4178 2005-09-16 Akim Demaille <akim@epita.fr>
4180 * src/symtab.h (struct symbol): Declare the printer and destructor
4181 as const, to avoid accidental calls to free.
4182 (symbol_destructor_set, symbol_printer_set): Adjust.
4183 * src/symtab.c: Adjust.
4185 2005-09-16 Akim Demaille <akim@epita.fr>
4187 * data/c.m4 (b4_token_enums): New.
4188 (b4_token_defines): Rename as...
4189 (b4_token_enums_defines): this.
4190 (b4_token_defines): New, output only the #defines.
4191 * data/yacc.c, data/glr.c: Adjust.
4192 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
4193 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
4196 2005-09-16 Akim Demaille <akim@epita.fr>
4198 * data/lalr1.cc (yylex_): Remove, inline its code.
4199 (yyreport_syntax_error_): Remove, replaced by...
4200 (yysyntax_error_): this which returns a string and leaves to the
4201 caller the call to the users' error function.
4202 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
4203 Move from members of the parser object...
4204 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
4205 to local variables of the parse function.
4207 2005-09-16 Akim Demaille <akim@epita.fr>
4209 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
4210 since it's in Bison's name space.
4212 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
4214 * data/glr.c (yyresolveValue): Add default case to pacify
4215 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
4217 * NEWS: Document when yyparse started to return 2.
4218 * doc/bison.texinfo (Parser Function): Document when yyparse
4221 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
4222 (b4_filename_type): Renamed back from b4_file_name_type. All uses
4224 (class position): file_name -> filename (reverting). All uses changed.
4226 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
4228 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
4229 do anything if $@ exists. This reverts part of the 2005-07-07
4232 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
4234 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
4235 contains obsolete information and isn't worth distributing as a
4236 separate file anyway.
4237 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
4238 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
4239 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
4240 (yyparse): Abort if user code uses longjmp to throw an unexpected
4243 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
4245 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
4246 Suggested by twlevo@xs4all.nl.
4248 * data/glr.c (YYCHK1): Do not assume YYE is in range.
4249 This avoids a diagnostic from gcc -Wswitch-enum.
4250 Problem reported by twlevo@xs4all.nl.
4252 * doc/bison.texinfo: Don't use "filename", as per GNU coding
4253 standards. Use "file name" or "file" or "name", depending on
4255 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
4256 not to hack/foo.tab.c.
4257 (Calc++ Top Level): 2nd arg of main is not const.
4258 * data/glr.c: b4_filename -> b4_file_name.
4259 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
4261 (class position): filename -> file_name. All uses changed.
4262 * data/yacc.c: b4_filename -> b4_file_name.
4263 * lib/bitset.h: filename -> file_name in local vars.
4264 * lib/bitset_stats.c: Likewise.
4265 * src/files.c: Likewise.
4266 * src/scan-skel.l ("@output ".*\n): Likewise.
4267 * src/files.c (file_name_split): Renamed from filename_split.
4268 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
4270 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
4272 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
4273 to accommodate latest gnulib.
4275 * tests/glr-regression.at (Duplicate representation of merged trees):
4276 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
4278 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
4281 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
4283 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
4284 All uses changed. Invoke user destructor after an error during a
4285 split parse (trivial change from Joel E. Denny).
4287 * tests/glr-regression.at
4288 (User destructor after an error during a split parse): New test case.
4289 Problem reported by Joel E. Denny in:
4290 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
4292 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
4294 * README-cvs: Give URLs for recommended tools.
4295 Mention Gzip version problem, and bootstrapping issues.
4296 Remove troubleshooting section, as it's somewhat obsolete.
4298 * bootstrap (no_cache): New var, to accommodate different wget
4299 variants. Use it instead of '-C off'. Problem reported by
4302 * data/glr.c (yydestroyStackItem): New function.
4303 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
4304 debugging information. Problem reported by Joel E. Denny.
4306 2005-08-25 Akim Demaille <akim@epita.fr>
4308 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
4310 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
4312 * data/glr.c (yyrecoverSyntaxError, yyreturn):
4313 Don't invoke destructor on unresolved entries.
4314 * tests/glr-regression.at
4315 (User destructor for unresolved GLR semantic value): New test case.
4316 Problem reported by Joel E. Denny in:
4317 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
4319 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
4321 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
4323 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
4324 lib-prefix.m4, po.m4.
4326 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
4327 in yydestruct diagnostic, since it might not be an error.
4328 Problem reported by Joel Denny near end of
4329 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4330 * data/lalr1.cc (yyerturn): Likewise.
4331 * data/yacc.c (yyreturn): Likewise.
4332 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
4334 * src/files.c: Remove obsolete FIXME comment.
4336 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
4337 with the other templates, and to fix bogus run-on messages such
4338 as the one reported at the end of
4339 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4340 All callers changed to avoid the newline.
4341 (yyprocessOneStack): Output two lines rather than one, to accommodate
4342 the above change. This changes the debug output format slightly.
4344 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
4345 reported by Joel E. Denny in
4346 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
4348 * tests/glr-regression.at (Duplicate representation of merged trees):
4349 New test, from Joel E. Denny in:
4350 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
4351 * THANKS: Add Joel E. Denny.
4353 * configure.ac (AC_INIT): Bump to 2.0c.
4355 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
4357 * NEWS: Version 2.0b.
4359 * Makefile.am (SUBDIRS): Put examples before tests, so that
4360 "make check" doesn't finish with "All 1 tests passed".
4362 * tests/regression.at (Token definitions): Don't rely on
4363 AT_PARSER_CHECK for data that contains backslashes. It currently
4364 uses 'echo', and 'echo' isn't portable if its argument contains
4365 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
4366 that the byte '\0xff' is not printable in the C locale; it is,
4367 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
4368 not printable, so use '\0x81' to test.
4370 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
4371 version of GCC, since the macro is used with non-GCC compilers.
4373 Fix core dump reported by Pablo De Napoli in
4374 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
4375 * tests/regression.at (Invalid inputs with {}): New test.
4376 * src/parse-gram.y (token_name): Translate type before using
4379 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
4380 the user's name space. All uses changed to __attribute__
4382 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
4383 Add __attribute__ ((__noreturn__)).
4385 * etc/clcommit: Remove. We weren't using it, and it failed
4386 "make maintainer-distcheck".
4387 * Makefile.maint: Merge from coreutils.
4388 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
4389 (syntax-check-rules): Change list of rules as described below.
4390 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
4391 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
4392 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
4393 (sc_trailing_space): New rules.
4394 (sc_xalloc_h_in_src): Remove.
4395 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
4396 (sc_space_tab, sc_error_exit_success, sc_changelog):
4397 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
4398 (makefile-check, po-check, author_mark_check):
4399 (makefile_path_separator_check, copyright-check):
4400 Use grep -n, to make it easier to find violations.
4401 Use CVS_LIST and CVS_LIST_EXCEPT.
4402 (header_regexp, h_re): Remove.
4404 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
4405 (my-distcheck): Use more-modern GCC flags.
4406 (signatures, %.asc): Remove.
4407 (rel-files, announcement): Remove signatures.
4408 Restore old updating code, even though we don't use it, so
4409 that we're the same as coreutils.
4410 (alpha, beta, major): Depend on news-date-check.
4411 Make the upload commands.
4413 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
4414 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
4415 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
4416 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
4417 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
4418 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
4419 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
4420 * tests/sets.at: Likewise.
4422 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
4423 we comment out the Autoconf version number.
4424 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
4425 it's error-prone and "make maintainer-distcheck" rejects it.
4427 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
4428 Indent calls to "error" to pacify "make maintainer-distcheck",
4429 when the calls are not intended to be translated.
4430 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
4432 * src/Makefile.am (DEFS): Use +=, to pacify
4433 "make maintainer-distcheck".
4434 (bison_SOURCES): Add scan-skel.h.
4435 (sc_tight_scope): New rule, from coreutils.
4437 * src/files.c (src_extension, header_extension):
4438 Now static, not extern.
4439 * src/getargs.c (short_options): Likewise.
4440 * src/muscle_tab.c (muscle_table): Likewise.
4441 * src/parse-gram.y (current_class, current_type, current_prec):
4443 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4444 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4445 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4446 void, to avoid warning when NLS is disabled.
4447 * src/output.c: Include scan-skel.h.
4448 (scan_skel): Remove decl, since scan-skel.h does this.
4450 Indent calls to "error" to pacify "make maintainer-distcheck".
4451 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4452 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4453 "make maintainer-distcheck".
4454 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4455 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4456 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4457 (skel_lex_destroy, scan_skel): Move these decls to...
4458 * src/scan-skel.h: New file.
4459 * src/uniqstr.c (uniqstr_assert):
4460 Indent calls to "error" to pacify "make maintainer-distcheck".
4462 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4465 * tests/torture.at: Revamp to avoid misuse of atoi that
4466 "make maintainer-distcheck" complained about.
4468 * examples/extexi (message): Don't print a message more than once,
4469 and omit line-number decoration that makes Emacs compile think
4470 that informative messages are worth worrying about.
4472 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4474 * configure.ac: Update version number.
4476 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4478 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4479 autogenerated by the maintainer.
4480 * examples/calc++/.cvsignore: Add *.yy.
4482 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4483 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4484 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4486 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4488 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4489 from maintainer-distcheck about casting the argument of 'free'.
4491 * NEWS: Mention recent yytname changes.
4492 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4494 * bootstrap: For translations that have not yet been upgraded to
4495 the new runtime-po domain, prime the pump by extracting the
4496 relevant strings from the obsolete translations. This code can be
4497 removed once the bison-runtime domain has been translated by each
4500 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4501 now that token names are already quoted.
4503 Fix problem reported by Anthony Heading.
4504 * data/glr.c (YYTOKEN_TABLE): New macro.
4505 (yytname): Define if YYTOKEN_TABLE.
4506 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4507 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4508 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4509 * src/output.c (prepare_symbols): Output token_table_flag.
4511 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4513 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4514 again if the first call fails.
4516 * data/glr.c (yytnamerr): New function.
4517 (yyreportSyntaxError): Use it to dequote most string literals.
4518 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4519 with other skeletons. All uses changed.
4520 (yytnameerr_): New function.
4521 (yyreport_syntax_error): Use it to dequote most string literals.
4522 * data/yacc.c (yytnamerr): New function.
4523 (yyerrlab): Use it to decode most string literals.
4524 * doc/bison.texinfo (Decl Summary, Calling Convention):
4525 Clarify quoting convention of yytname.
4526 * src/output.c (prepare_symbols): Quote all names. This undoes
4527 the 2005-04-17 change, which is now accomplished (mostly) via
4528 changes in the parsers as described above.
4529 * tests/regression.at (Token definitions, Web2c Actions):
4530 Undo most 2005-04-17 change here, too.
4532 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4534 Fix more problems reported by twlevo@xs4all.nl.
4535 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4536 remove trailing spaces. This loses the exit status of ./types,
4537 and isn't needed since ./types shouldn't be emitting trailing
4539 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4540 as the stack isn't valid in that case.
4542 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4543 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4544 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4545 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4547 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4548 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4549 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4552 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4553 overly-picky compilers that reject 'char *foo = "bar";'.
4555 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4556 to FILE * parameter, not to stderr. This fixes a typo introduced
4557 in the 2005-07-12 change.
4559 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4560 warnings from GCC 4.
4562 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4563 (yyglrShiftDefer, yysplitStack):
4564 Remove unused parameters b4_pure_formals. All uses changed.
4565 (yyglrShift): Remove unused parameters b4_user_formals.
4567 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4569 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4571 Destructor cleanups and regularization among the three skeletons.
4572 * NEWS: Document the behavior changes.
4573 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4574 stack before failing, as the cleanup code will do it for us now.
4575 * data/lalr1.cc (yyerrlab): Likewise.
4576 * data/glr.c (yyparse): Pop everything off the stack before
4577 freeing it, so that destructors get called properly.
4578 * data/lalr1.cc (yyreturn): Likewise.
4579 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4580 This is more consistent.
4581 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4582 why destructors might be called. 1.875 -> 2.1.
4583 (Destructor Decl, Decl Summary, Table of Symbols):
4584 Some English-language cleanups for %destructor.
4585 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4586 Add output line for destructor of start symbol.
4587 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4588 because of that same extra output line.
4590 * NEWS: Document minor wording changes in diagnostics of
4591 Bison-generated parsers.
4592 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4593 Remove unused formals. All uses changed.
4594 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4595 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4596 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4597 Rename yyoverflowab to yyexhaustedlab.
4598 When memory exhaustion occurs during syntax-error reporting,
4599 report it separately rather than in a single diagnostic; this
4601 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4602 (Memory Exhausted): Renamed from Parser Stack Overflow.
4603 Revamp wording slightly to prefer "memory exhaustion".
4604 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4606 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4608 Add i18n support to the GLR skeleton. Partially fix the C++
4609 skeleton; a C++ expert needs to finish this. Remove debugging
4610 msgids; there's little point to having them translated, since they
4611 can be understood only by someone who can read the
4612 (English-language) source code.
4614 Generate runtime-po/bison-runtime.pot automatically, so that we
4615 don't have to worry about garbage getting in that file. We'll
4616 make sure after the next official release that old msgids don't
4618 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4620 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4622 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4623 Fix typos in explanations of the runtime file.
4624 * bootstrap: Change gettext keyword from YYI18N to YY_.
4625 Use standard Makefile.in.in in runtime-po, since we'll arrange
4626 for backward-compatible bison-runtime.po files in a different way.
4627 * data/glr.c (YY_): New macro, from yacc.c.
4628 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4629 Translate messages intended for users.
4630 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4631 the wording in the other skeletons. We don't know that the memory
4633 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4634 Use same method that yacc.c uses.
4635 Don't translate debugging messages.
4636 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4637 it doesn't work (yet), and requires C++ expertise to fix.
4638 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4639 Move defn to a more logical place, to be consistent with other
4641 Don't translate debugging messages.
4642 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4643 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4644 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4645 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4647 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4648 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4650 * tests/glr-regression.at (Badly Collapsed GLR States):
4652 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4653 yylex should return 0 at EOF rather than aborting.
4655 Improve tests for stack overflow in GLR parser.
4656 Problem reported by twlevo@xs4all.nl.
4657 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4659 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4660 can handle the problem.
4661 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4662 (yyparse): New local variable yyresult to record the result.
4663 Use result of setjmp to set it, rather than storing itinto
4665 (yyDone): Remove label.
4666 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4667 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4668 if YYABORT is used).
4669 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4670 yyparse status; put status > 1 into diagnostic.
4671 Check that status==2 works.
4672 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4673 Use exit status 3 for failure to open (which shouldn't happen).
4675 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4677 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4678 1 on syntax error; just let yyparse do its thing.
4679 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4680 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4681 (Exploding the Stack Size with Alloca):
4682 (Exploding the Stack Size with Malloc):
4683 Expect exit status 2, not 1, since the parser is supposed to blow
4684 its stack. Problem reported by twlevo@xs4all.nl.
4686 * data/glr.c (yyparse): Don't assume that the initial calls
4687 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4688 Print a stack-overflow message and fail instead.
4689 Initialize the line-number information before creating the stack,
4690 so that the stack-overflow message can report line zero safely.
4692 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4694 Fix problems reported by twlevo@xs4all.nl.
4695 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4696 (yyuserMerge): Provide a default case if b4_mergers is empty.
4697 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4698 * tests/glr-regression.at
4699 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4700 Add casts to pacify C++ compilers.
4701 * tests/glr-regression.at (Improper merging of GLR delayed action
4702 sets): Declare yylex before using it.
4703 * tests/Makefile.am (maintainer-check-g++): Fix a stray
4704 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4705 test for valgrind; valgrind is independent of g++.
4706 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4707 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4708 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4709 Use a destructor, so that we can expand the stack. Change
4710 YYSTYPE to char * so that we can free it. Cast result of malloc.
4712 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4714 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4715 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4717 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4719 * PACKAGING: New file, suggested by Bruno Haible and taken from
4720 similar wording in gettext's PACKAGING file.
4721 * NEWS: Mention PACKAGING.
4722 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4724 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4726 * NEWS: Document recent i18n improvements.
4727 * bootstrap: Get runtime translations into runtime-po.
4728 Create runtime-po files automatically, if possible.
4729 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4730 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4731 does not infringe on the user's name space.
4732 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4733 * doc/bison.texinfo (Internationalization): Revamp the English
4734 and Texinfo syntax a bit, to try to make it clearer.
4735 (Bison Options, Option Cross Key): Mention --print-localedir.
4736 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4737 YYENABLE_NLS. Quote a bit more.
4738 * runtime-po/.cvsignore: New file.
4739 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4740 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4741 * runtime-po/quot.sed: Likewise.
4742 * runtime-po/boldquot.sed: Likewise.
4743 * runtime-po/en@quot.header: Likewise.
4744 * runtime-po/en@boldquot.header: Likewise.
4745 * runtime-po/insert-header.sin: Likewise.
4746 * runtime-po/remove-potcdate.sin: Likewise.
4747 * runtime-po/Makevars: Likewise.
4748 * runtime-po/LINGUAS: Likewise.
4749 * runtime-po/de.po: Likewise; we will rely on the translation project
4750 to maintain this, so "bootstrap" should get it.
4751 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
4753 * src/main.c (main): Bind the bison-runtime domain, too.
4755 2005-07-12 Bruno Haible <bruno@clisp.org>
4757 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4758 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4759 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4760 * runtime-po: New directory.
4761 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4762 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4763 * runtime-po/Rules-quot: New file, copied from po/.
4764 * runtime-po/quot.sed: Likewise.
4765 * runtime-po/boldquot.sed: Likewise.
4766 * runtime-po/en@quot.header: Likewise.
4767 * runtime-po/en@boldquot.header: Likewise.
4768 * runtime-po/insert-header.sin: Likewise.
4769 * runtime-po/remove-potcdate.sin: Likewise.
4770 * runtime-po/Makevars: New file.
4771 * runtime-po/POTFILES.in: New file.
4772 * runtime-po/LINGUAS: New file.
4773 * runtime-po/bison-runtime.pot: New file.
4774 * runtime-po/de.po: New file.
4775 * m4/bison.m4: New file.
4776 * Makefile.am (SUBDIRS): Add runtime-po.
4777 (aclocaldir, aclocal_DATA): New variables.
4778 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4780 * src/getargs.c (usage): Document --print-localedir option.
4781 (PRINT_LOCALEDIR_OPTION): New enum item.
4782 (long_options): Add --print-localedir option.
4783 (getargs): Handle --print-localedir option.
4784 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4785 (Internationalization): New section.
4787 2005-07-12 Akim Demaille <akim@epita.fr>
4789 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4790 for consistency with the rest of the code.
4791 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4794 2005-07-12 Akim Demaille <akim@epita.fr>
4796 * src/parse-gram.y: Use %printer instead of YYPRINT.
4798 2005-07-12 Akim Demaille <akim@epita.fr>
4800 * src/symtab.h, src/symtab.c (symbol_print): New.
4801 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4802 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4804 2005-07-12 Akim Demaille <akim@epita.fr>
4806 * data/glr.c (b4_syncline): Fix (swap) the definitions of
4807 b4_at_dollar and b4_dollar_dollar.
4809 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4811 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4812 and Pennello's paper.
4814 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4816 * data/yacc.c (yyparse): Undo previous patch. Instead,
4817 set yylsp[0] and yyvsp[0] only if the initial action
4818 sets yylloc and yylval, respectively.
4820 * data/yacc.c (yyparse): In the initial action, set
4821 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4822 This avoids the use of undefined variables if the initial
4823 action does not set yylloc and/or yylval.
4825 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4827 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4828 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4829 Remove from CVS. These files are automatically generated.
4830 * examples/extexi: Clarify that this file is now part of Bison,
4831 not GNU M4, and that it works with any POSIX-compatible Awk.
4832 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4833 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4834 so that we also get calc++-parser.yy. Geneate it.
4835 Use $(AWK), not gawk, since any conforming Awk will do.
4836 Put comment before action, since older 'make' can't handle comment
4838 $(BUILT_SOURCES): List all built sources, not just some of them.
4839 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4840 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4841 $($(calc_sources_generated)): Remove unnecessary test for existence
4842 of target. (This had a shell syntax error anyway; a stray "x".)
4843 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4845 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4847 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4848 implied by the other modules.
4850 2005-07-06 Akim Demaille <akim@epita.fr>
4852 Bind examples/calc++ to the package.
4853 * examples/calc++/Makefile: Remove, replaced by...
4854 * examples/calc++/Makefile.am: ... this new file.
4855 * examples/calc++/test: Remove input.
4856 * examples/calc++/compile: Remove.
4857 * examples/Makefile.am: New.
4858 * configure.ac, Makefile.am: Adjust.
4859 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4861 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4863 * data/glr.c (yyFail): Drastically simplify; since the format argument
4864 never had any % directives, we can simply pass it to yyerror.
4865 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4866 be modified later, as that is the usual style in glr.c.
4867 Problems reported by Paul Hilfinger.
4869 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4870 and size overflow errors.
4871 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4872 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4873 (YYSIZEMAX): New macro.
4874 (yystpcpy): New function, taken from yacc.c.
4875 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4876 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4877 so that we don't have to maintain their signatures.
4878 (yyFail): Check for buffer overflow, by using vsnprintf rather
4879 than vsprintf. Allocate a bigger buffer if possible.
4880 Report an error if buffer allocation fails.
4881 (yyStackOverflow): New function.
4882 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4883 the initialization was successful. It might fail if storage was
4885 (yyexpandGLRStack): Add more checks for storage allocation failure.
4886 Use yyStackOverflow to report failures.
4887 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4888 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4889 Don't assume stack number fits in int.
4890 (yysplitStack): Check for storage allocation failure.
4891 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4892 can print diagnostics on storage allocation failure. All callers
4894 (yyresolveValue): Use yybool for boolean.
4895 (yyreportSyntaxError): Check for size-calculation overflow.
4896 This code is taken from yacc.c.
4897 (yyparse): Check for storage allocation errors when allocating
4900 2005-07-05 Akim Demaille <akim@epita.fr>
4902 Extract calc++ from the documentation.
4903 * doc/bison.texinfo (Calc++): Add the extraction marks.
4904 * examples/extexi: New, from the aborted GNU Programming 2E.
4905 Separate the different paragraph of a file with empty lines.
4906 * examples/Makefile: Use it to extract the whole calc++ example.
4908 2005-06-24 Akim Demaille <akim@epita.fr>
4910 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4913 2005-06-22 Akim Demaille <akim@epita.fr>
4915 * doc/bison.texinfo (C++ Language Interface): First stab.
4916 (C++ Parsers): Remove.
4918 2005-06-22 Akim Demaille <akim@epita.fr>
4920 * data/lalr1.cc (yylex_): Honor %lex-param.
4922 2005-06-22 Akim Demaille <akim@epita.fr>
4924 Start a set of simple examples.
4925 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4926 * examples/calc++/calc++-driver.hh,
4927 * examples/calc++/calc++-parser.yy,
4928 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4929 * examples/calc++/compile, examples/calc++/test: New.
4931 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4933 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4934 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4935 which stems from the 2005-05-27 patch.
4937 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4939 * data/glr.c: Modify treatment of unused parameters to permit use
4940 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4942 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4944 Fix infringement on user name space reported by Janos Zoltan Szabo.
4945 * data/yacc.c (yyparse): strlen -> yystrlen.
4947 2005-05-30 Akim Demaille <akim@epita.fr>
4949 * data/lalr1.cc (_): New.
4950 Translate the various messages.
4952 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4954 Fix infringement on user name space reported by Bruno Haible.
4955 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4956 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4957 the user's name space.
4958 (alloca): Include <stdlib.h> to get it, if it's not built in.
4959 (YYMALLOC, YYFREE): Define only if needed.
4960 (malloc, free): Declare, but only if needed, as this infringes on
4961 the user name space.
4963 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4965 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
4966 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
4968 * lib/ebitset.c (min, max): Undef before defining.
4969 * lib/vbitset.c (min, max): Likewise.
4970 * lib/subpipe.c (create_subpipe): Save local variables in case
4971 vfork clobbers them.
4973 2005-05-24 Bruno Haible <bruno@clisp.org>
4975 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4976 error message syntax used by gcc-4.0.
4978 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4980 * README: Mention m4 1.4.3. Remove obsolete advice about
4981 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4983 * bootstrap: Remove workaround for problem I encountered with
4984 gettext 0.14.1; it seems to be fixed now.
4986 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4988 * NEWS: Version 2.0a.
4990 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4991 the previous change.
4993 Various maintainer cleanups.
4994 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
4995 conftest*, for benefit of CVS commands run at the same time as
4996 "configure". Add build-aux, since "bootstrap" now creates it and
4998 * Makefile.cfg (move_if_change): Remove.
4999 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
5000 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
5001 (po_repo, do-po-update, po-update, wget_files, get-targets):
5002 (config.guess-url_prefix, config.sub-url_prefix):
5003 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
5004 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
5005 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
5007 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
5008 this is now the recommended name.
5009 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
5010 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
5011 ylwrap. These files now go into build-aux.
5012 * config/move-if-change: Remove.
5013 * config/prev-version.txt: Bump from 1.75 to 2.0.
5015 * bootstrap: Add stdio-safer, unistd-safer modules.
5016 Remove m4/glibc2.m4 (introduced by latest gnulib, but
5018 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
5019 fopen-safer.c, stdio-safer.h, unistd-safer.h.
5020 * lib/subpipe.c: Include "unistd-safer.h".
5021 (create_subpipe): Make sure all the newly-created
5022 file descriptors are > 2, so that diagnostics don't
5023 get sent down them (which might cause Bison to hang, in theory).
5024 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
5025 * src/files.c (xfopen): Use fopen_safer, not fopen.
5027 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
5028 yesterday's yacc.c fix.
5030 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
5032 * data/glr.c, data/lalr1.cc: Update copyright date.
5034 Fix a destructor bug reported by Wolfgang Spraul in
5035 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
5036 * data/yacc.c (yyabortlab): Don't call destructor, and
5037 don't set yychar to EMPTY.
5038 (yyoverflowlab): Don't call destructor.
5039 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
5040 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
5041 since we no longer output the message "discarding lookahead token
5044 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5046 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
5047 fix a small glitch in debugging output.
5048 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
5049 after YY_SYMBOL_PRINT where needed.
5051 (struct yyGLRState): Add some comments.
5052 (struct yySemanticOption): Add some comments.
5053 (union yyGLRStackItem): Add comment.
5055 (yymergeOptionSets): Correct this to properly perform the union,
5056 avoiding infinite reported by Michael Rosien.
5059 * tests/glr-regression.at: Add test for GLR merging error reported
5062 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
5064 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
5065 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
5066 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
5067 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
5068 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
5069 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
5070 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
5071 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
5072 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
5073 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
5074 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
5075 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
5076 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
5077 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
5078 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
5079 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
5080 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
5081 src/derives.h, src/files.c, src/files.h, src/getargs.c,
5082 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
5083 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
5084 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
5085 src/output.h, src/parse-gram.c, src/parse-gram.h,
5086 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
5087 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
5088 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
5089 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
5090 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
5091 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
5092 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
5093 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
5094 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
5095 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
5096 tests/reduce.at, tests/regression.at, tests/sets.at,
5097 tests/synclines.at, tests/testsuite.at, tests/torture.at:
5098 Update FSF postal mail address.
5100 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
5102 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
5103 Problem reported by Ralf Menzel.
5105 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
5107 * tests/actions.at: Test that stack overflow invokes destructors.
5108 From Marcus Holland-Moritz.
5109 * data/yacc.c (yyerrlab): Move the code that destroys the stack
5111 (yyreturn): to here. That way, destructors are called properly
5112 even if the stack overflows, or the user calls YYACCEPT or
5113 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
5114 (yyoverflowlab): Destroy the lookahead.
5116 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
5118 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
5120 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
5122 * NEWS: Bison-generated C parsers no longer quote literal strings
5123 associated with tokens.
5124 * src/output.c (prepare_symbols): Don't escape strings,
5125 since users don't want to see C escapes.
5126 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
5128 * tests/input.at (Torturing the Scanner): Likewise.
5129 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
5131 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
5133 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
5134 the data size is known to be too small and we can't increase it.
5135 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
5137 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
5139 * src/parse-gram.y: Include quotearg.h.
5140 (string_as_id): Quote $1 before using it as a key, since the
5141 lexer no longer quotes it for us.
5142 (string_content): Don't strip quotes, since lexer no longer
5144 * src/scan-gram.l: Include quotearg.h.
5146 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
5147 a key, since the rest of the lexer doesn't quote it.
5148 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
5149 * tests/regression.at (Token definitions): Check for backslashes
5152 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
5153 (YYSIZE_T): Define to unsigned long int when using an older compiler.
5154 (yyparse): Revamp code to generate long syntax error message, to
5155 make it easier to translate, and to avoid problems with arithmetic
5156 overflow. Change "virtual memory" to "memory" in diagnostic, since
5157 we don't know whether the memory is virtual.
5159 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
5161 * NEWS: Bison-generated C parsers now use the _ macro to
5163 * data/yacc.c (_) [!defined _]: New macro.
5164 All English strings wrapped inside this macro.
5165 * doc/bison.texinfo (Bison Parser): Document _.
5166 * po/POTFILES.in: Include src/parse-gram.c, since it now
5167 includes translateable strings that parse-gram.y doesn't.
5169 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
5171 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
5172 reverting the 2004-10-11 change to this function.
5173 (symbol_check_alias_consistency): Don't call symbol_type_set
5174 if the type name is already correct.
5175 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
5177 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
5179 * tests/regression.at (Token definitions): Don't use a token named
5180 c, as that generates a "#define c ..." that runs afoul of buggy
5181 stdlib.h that uses the identifier c as a member of struct
5182 drand48_data. Problem reported by Horst Wente.
5184 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
5186 * bootstrap: Change translation URL from
5187 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
5188 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
5189 redirection glitches. Problem reported by twlevo@xs4all.nl.
5191 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
5193 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
5194 after operands; POSIX says this isn't portable for the c99 command.
5196 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
5198 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
5199 immediately if a data overrun has occurred; this may help us track
5200 down what may be a spurious failure on MacOS.
5202 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
5204 Respond to problems reported by twlevo@xs4all.nl.
5206 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
5208 * src/vcg.h: Comment fix.
5209 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
5210 (G_CMAX): Change to -1 instead of INT_MAX.
5212 * data/yacc.c (yyparse): Omit spaces before #line.
5214 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
5216 * src/tables.c (state_number_to_vector_number): Put it inside an
5217 "#if 0", since it's not currently used. Problem reported by
5220 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
5222 * src/output.c (escaped_output): Renamed from
5223 escaped_file_name_output, since we now use it for symbol tags as
5224 well. All uses changed.
5225 (symbol_destructors_output, symbol_printers_output):
5226 Escape symbol tags too.
5227 Problem reported by Matyas Forstner in
5228 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
5230 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
5232 * src/output.c (user_actions_output, token_definitions_output,
5233 symbol_destructors_output, symbol_printers_output): Likewise.
5234 * src/reader.c (prologue_augment): Likewise.
5235 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
5237 * src/vcg.c (output_edge): Don't quote linestyle arg.
5238 Problem reported by twlevo@xs4all.nl.
5240 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
5242 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
5243 example, reported by Derek M Jones. Also, make the example even
5244 more outrageous, to better illustrate how bad the problem is.
5246 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
5248 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
5249 putsym. Typo reported by Sebastian Piping.
5251 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
5253 * doc/bison.texinfo (Language and Grammar): some -> same
5254 (Epilogue): int he -> in the
5255 Typos reported by Sebastian Piping via Justin Pence.
5257 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
5259 * tests/glr-regression.at (Improper handling of embedded actions
5260 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
5261 embedded actions and $-N in GLR parsers", work around an Autoconf bug
5262 with dollar signs in test names.
5263 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
5264 for a similar reason.
5266 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
5268 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
5269 wants to redefine G_VIEW.
5271 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
5273 * src/vcg.c (get_view_str): Remove case for normal_view.
5274 Problem reported by twlevo@xs4all.nl.
5276 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
5278 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
5279 Problem reported by twlevo@xs4all.nl.
5281 * doc/bison.texinfo: Change @dircategory from "GNU programming
5282 tools" to "Software development". Requested by Richard Stallman
5285 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
5287 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
5288 Problem reported by twlevo@xs4all.nl.
5290 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
5292 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
5293 keyword; it's not needed with modern compilers, and it doesn't
5294 affect correctness with older compilers. Suggested by
5297 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
5299 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
5300 gcc -Wswitch-default.
5301 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
5302 * data/yacc.c (yyparse): Likewise.
5304 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
5306 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
5307 already. Let config.h define any nonstandard values.
5309 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
5311 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
5312 for the benefit of slower hosts. Problem reported by
5315 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
5317 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
5318 being defined and not used.
5319 * data/lalr1.cc (yyparse): Likewise.
5320 Use "if (false)" rather than "if (0)".
5322 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
5324 * TODO: Mention that we should allow NUL bytes in tokens.
5326 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
5328 * src/scan-skel.l (<<EOF>>): Don't close standard output.
5329 Problem reported by Hans Aberg.
5331 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
5333 * src/getargs.c (version): Happy new year; update overall
5334 program copyright date from 2004 to 2005.
5336 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
5337 Problem reported by Hans Aberg.
5338 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
5339 (Output file names.): Add a test for the case when standard output
5342 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
5344 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
5345 to fix an oversight in the Bison 2.0 manual.
5347 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
5349 * NEWS: Version 2.0. Reformat the existing news items since
5350 1.875, so that related items are grouped together.
5351 * configure.ac (AC_INIT): Bump version to 2.0.
5352 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
5354 * tests/torture.at (Exploding the Stack Size with Alloca): Set
5355 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
5356 otherwise, we're not testing alloca. Unfortunately there's no
5357 simple way to consult HAVE_ALLOCA here.
5359 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
5362 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
5363 hand. This avoids a warning about comparing int to size_t when
5364 GCC warnings are enabled.
5366 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
5368 * NEWS: Bison-generated parsers no longer default to using the
5369 alloca function (when available) to extend the parser stack, due
5370 to widespread problems in unchecked stack-overflow detection.
5371 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
5372 responsibility to set it to a positive value. This lets the user
5373 specify a value that is not a preprocessor constant.
5374 * data/yacc.c (YYMAXDEPTH): Likewise.
5375 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
5376 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
5377 to be a compile-time constant. However, explain the constraints on it.
5378 Also, explain the constraints on YYINITDEPTH.
5379 (Table of Symbols): Explain that alloca is no longer the default.
5380 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
5383 * doc/bison.texinfo (Location Default Action): Mention that n must
5384 be zero when k is zero. Suggested by Frank Heckenbach.
5386 2004-12-22 Akim Demaille <akim@epita.fr>
5388 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
5389 (parser::state_type, parser::semantic_type, parser::location_type):
5390 Private, not public.
5391 (parser::parse): Return ints, not bool.
5392 Returning a bool introduces a problem: 0 corresponds to false, and
5393 it seems weird to return false on success. Returning true changes
5394 the conventions for yyparse.
5395 Alternatively we could return void and send an exception.
5396 There is no clear consensus (yet?).
5397 (state_stack, semantic_stack, location_stack): Rename as...
5398 (state_stack_type, semantic_stack_type, location_stack_type): these.
5399 Private, not public.
5400 * tests/c++.at: New.
5401 * tests/testsuite.at, tests/Makefile.am: Adjust.
5403 2004-12-21 Akim Demaille <akim@epita.fr>
5405 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
5407 2004-12-21 Akim Demaille <akim@epita.fr>
5409 Don't impose std::string for filenames.
5411 * data/lalr1.cc (b4_filename_type): New.
5412 (position::filename): Use it.
5413 (parser.hh): Move the inclusion of stack.hh and location.hh below
5414 the user code, so that needed headers for the filename type can be
5416 Forward declare them before the user code.
5417 * tests/Makefile.am (check-local, installcheck-local): Pass
5418 TESTSUITEFLAGS to the TESTSUITE.
5420 2004-12-20 Akim Demaille <akim@epita.fr>
5422 Use more STL like names: my_class instead of MyClass.
5424 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
5425 (SemanticStack, SemanticType, StateStack, StateType)
5426 (TokenNumberType, Stack, Slice, Traits, Parser::location)
5427 (Parser::value): Rename as...
5428 (location_stack, location_type, rhs_number_type, semantic_stack)
5429 (semantic_type, state_stack, state_type, token_number_type, stack)
5430 (slice, traits, parser::yylloc, parser::yylval): these.
5432 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
5434 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5436 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
5437 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5439 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5441 Remove uses of 'short int' and 'unsigned short int'. This raises
5442 some arbitrary limits. It uses more memory but nowadays that's
5443 not much of an issue.
5445 This change does not affect the generated parsers; that's a different
5446 task, as some users will want to conserve memory there.
5448 Ideally we should use size_t to represent all object counts, and
5449 something like ptrdiff_t to represent signed differences of object
5450 counts; but that will require more code-cleanup than I have the
5451 time to do right now.
5453 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5454 Use size_t, not int or short int, to count objects.
5455 * src/closure.c (nritemset, closure): Likewise.
5456 * src/closure.h (nritemset, closure): Likewise.
5457 * src/nullable.c (nullable_compute): Likewise.
5458 * src/print.c (print_core): Likewise.
5459 * src/print_graph.c (print_core): Likewise.
5460 * src/state.c (state_compare, state_hash): Likewise.
5461 * src/state.h (struct state): Likewise.
5462 * src/tables.c (default_goto, goto_actions): Likewise.
5464 * src/gram.h (rule_number, rule): Use int, not short int.
5465 * src/output.c (prepare_rules): Likewise.
5466 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5467 errs, reductions): Likewise.
5468 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5470 * src/tables.c (vector_number, tally, action_number,
5471 ACTION_NUMBER_MINIMUM): Likewise.
5472 * src/output.c (muscle_insert_short_int_table): Remove.
5474 2004-12-17 Akim Demaille <akim@epita.fr>
5476 * data/lalr1.cc: Extensive Doxygenation.
5477 (error_): Rename as...
5478 (error): this, since it is visible to the user.
5480 (Parser::message): Now an automatic variable from...
5481 (Parser::yyreport_syntax_error_): here.
5482 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5484 * tests/input.at: Escape $.
5486 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5488 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5489 Parenthesize rhs to avoid obscure problems with mistakes like
5490 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5491 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5492 b4_rhs_location): Likewise.
5493 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5494 b4_rhs_location): Likewise.
5496 2004-12-16 Akim Demaille <akim@epita.fr>
5498 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5499 yacc.c: be sure to stay within yycheck_.
5500 * tests/actions.at: Re-enable C++ tests.
5502 2004-12-16 Akim Demaille <akim@epita.fr>
5504 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5507 2004-12-16 Akim Demaille <akim@epita.fr>
5509 Use #define to handle the %name-prefix.
5511 * data/glr.c, data/yacc.c: Comment changes.
5512 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5513 so that one can refer to yylex in the parser file, and have it
5514 renamed, as is the case with other skeletons.
5516 2004-12-16 Akim Demaille <akim@epita.fr>
5518 Move lalr1.cc internals into yy*.
5520 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5521 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5522 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5523 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5524 (empty_, final_, terror_, errcode_, ntokens_)
5525 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5526 (looka_, ilooka_, error_range_, nerrs_):
5528 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5529 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5530 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5531 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5532 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5533 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5534 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5535 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5538 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5540 Fix some problems reported by twlevo at xs4all.
5541 * src/symtab.c (symbol_new): Report an error if the input grammar
5542 contains too many symbols. This is better than calling abort() later.
5543 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5544 (struct node, struct graph):
5545 Rename member expand to stretch. All uses changed.
5546 (struct graph): Remove member layoutalgorithm. All uses removed.
5547 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5548 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5550 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5552 2004-12-15 Akim Demaille <akim@epita.fr>
5554 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5555 Add more Doxygen comments.
5556 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5557 (report_syntax_error_, translate_): Rename as...
5558 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5559 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5561 2004-12-15 Akim Demaille <akim@epita.fr>
5563 * data/lalr1.cc (lex_): Rename as...
5565 Move the trace here.
5566 Take the %name-prefix into account.
5567 Reported by Alexandre Duret-Lutz.
5569 2004-12-15 Akim Demaille <akim@epita.fr>
5571 Simplify the C++ parser constructor.
5573 * data/lalr1.cc (debug_): Rename as...
5574 (yydebug_): so that the parser's internals are always in the yy*
5577 (b4_parse_param_decl): Remove the leading comma as it is now only
5578 called as unique argument list.
5579 (Parser::Parser): Remove the constructor accepting a location and
5580 an initial debugging level.
5581 Remove from the other ctor the argument for the debugging level.
5582 (debug_level_type, debug_level, set_debug_level): New.
5584 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5587 2004-12-15 Akim Demaille <akim@epita.fr>
5589 Remove b4_root related material: failure experiment
5590 (which goal was to allow to derive from a class).
5592 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5593 definitions and uses.
5595 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5597 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5598 not 2, since it's not portable to subtract 1 from the start of an
5599 array. The new item 0 is never set or used. All uses changed.
5601 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5602 the default definition of YYLLOC_DEFAULT. Problem reported
5603 by Frank Heckenbach.
5605 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5607 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5608 the normal case and one for the error case. Just use the
5609 first one uniformly. Problem reported by Frank Heckenbach.
5610 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5611 use exactly the same macro in both places.
5612 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5613 so that the normal-case YYRHSLOC works for the error case too.
5615 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5616 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5617 * doc/bison.texinfo (Location Default Action): Don't claim that
5618 we have an array of locations. Use the same macro for both glr
5619 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5622 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5624 * HACKING: Update email addresses to send announcements to.
5626 * configure.ac (AC_INIT): Bump version to 1.875f.
5628 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5630 * NEWS: Version 1.875e.
5631 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5633 * src/scan-skel.l: Include "complain.h", for "fatal".
5635 * src/relation.h (relation_print, relation_digraph):
5636 Relation sizes are of type relation_node, not size_t (this is
5637 merely a doc fix, since the two types are equivalent).
5638 (relation_transpose): Relation sizes are of type relation_node,
5640 * src/relation.c: Likewise.
5641 (top, infinity): Now of type relation_node, not int.
5642 (traverse, relation_transpose): Use relation_node, not int.
5644 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5645 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5646 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5648 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
5649 specifying whether the test should be skipped. Use it tp
5650 specify that the [%defines %skeleton "lalr1.cc"] tests currently
5651 fail on some hosts, and should be skipped.
5653 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5655 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5656 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5657 unless otherwise specified below.
5659 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5660 to allocate kernel_base, kernel_items, kernel_size, since
5661 they needn't be initialized to 0.
5662 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5663 * src/closure.c (new_closure): Likewise, for itemset.
5664 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5665 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5666 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5667 (build_relations): Likewise for edge, states1, includes.
5668 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5669 * src/reader.c (packgram): Likewise, for ritem, rules.
5670 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5671 * src/relation.c (relation_digraph): Likewise for VERTICES.
5672 (relation_transpose): Likewise for new_R, end_R.
5673 * src/symtab.c (symbols_token_translations_init): Likewise for
5675 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5676 (token_actions): Likewise for yydefact, actrow, conflrow,
5678 (save_column): Likewise for froms[symno], tos[symno].
5679 (goto_actions): Likewise for state_count.
5680 (pack_table): Likewise for base, pos, check.
5681 (tables_generate): Likewise for width.
5683 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5684 for initial core. Just have a separate core, so we needn't worry
5685 about whether kernel_size and kernel_base are initialized.
5687 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5688 kernel_size, kernel_items): Remove unnecessary initialization.
5689 * src/conflicts.c (conflicts): Likewise.
5690 * src/derives.c (derives): Likewise.
5691 * src/muscle_tablc (muscle_insert): Likewise.
5692 * src/relation.c (relation_digraph): Likewise.
5693 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5694 conflrow, conflict_table, conflict_list, table, check):
5697 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5698 This is because all callers pass unsigned int.
5699 * src/closure.h (new_closure): Likewise.
5701 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5702 (build_relations): Initialize includes[i] in all cases.
5703 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5704 and rules[ruleno].precsym. Initialize members in order.
5705 * src/relation.c (relation_transpose): Always initialize new_R[i]
5707 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5709 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5710 conflict_list[0] was always 0, but now it isn't initialized.
5712 * src/table.c (table_grow): When conflict_table grew, the grown
5713 area wasn't cleared. Fix this.
5715 * lib/.cvsignore: Add strdup.c, strdup.h.
5716 * m4/.cvsignore: Add strdup.m4.
5718 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5720 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5721 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5722 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5723 ngotos + 1 without checking for overflow.
5724 (build_relations): Use END_NODE, not -1, to denote end of edges.
5725 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5726 build_relations): Use goto_number, not int, for goto numbers.
5727 * src/tables.c (save_column, default_goto): Likewise.
5729 2004-11-23 Akim Demaille <akim@epita.fr>
5731 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5732 of #defining from yystype.
5733 Don't typedef yystype, C++ does not need it.
5734 This lets it possible to forward declare it as union.
5736 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5738 * bootstrap (gnulib_modules): Add extensions.
5739 Problem reported by Jim Meyering.
5741 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5743 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5744 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5745 src/system.h, src/tables.c: XFREE -> free, to accommodate
5746 recent change to gnulib xalloc.h.
5747 Problem reported by Jim Meyering.
5749 2004-11-17 Akim Demaille <akim@epita.fr>
5751 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5753 2004-11-17 Akim Demaille <akim@epita.fr>,
5754 Alexandre Duret-Lutz <adl@gnu.org>
5756 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5759 Use it instead of cdebug_.
5760 (Parser::debug_stream, Parser::set_debug_stream): New.
5761 (Parser::symprint_): Define cdebug_ for temporary backward
5763 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5766 2004-11-17 Akim Demaille <akim@epita.fr>
5768 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5769 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5770 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5771 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5773 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5775 * data/glr.c (yyloc_default): Remove; not used.
5776 Problem reported by Frank Heckenbach.
5778 2004-10-25 Akim Demaille <akim@epita.fr>
5780 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5781 Introduce another definition to address simple location arrays.
5782 (yyGLRStack): New member: yyerror_range.
5783 (yyrecoverSyntaxError, yyparse): Update it.
5784 (yyrecoverSyntaxError): Use it when shifting the error token to
5785 have an accurate range, equivalent to the one computed by both
5786 yacc.c and lalr1.cc.
5787 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5788 that column numbers start at column 0, as per GNU Coding
5789 Standards, the others tests, and the doc.
5790 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5791 Adjust to the above change (first column is 0).
5792 And adjust the location of the "<error>", now covering the whole
5795 2004-10-22 Akim Demaille <akim@epita.fr>
5796 and Paul Eggert <eggert@cs.ucla.edu>
5798 Remove some arbitrary limits on goto numbers and relations.
5799 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5800 initial values, since they're never used.
5801 (set_goto_map): ngotos is now unsigned, so test for overflow
5802 by seeing whether it wraps around to zero.
5803 * src/lalr.h (goto_number): Now size_t, not short int.
5804 (GOTO_NUMBER_MAXIMUM): Remove.
5805 * src/relation.c (relation_print, traverse, relation_transpose):
5806 Check for END_NODE rather than looking at sign.
5807 * src/relation.h (END_NODE): New macro.
5808 (relation_node): Now size_t, not short int.
5810 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5812 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5813 keyword, not an identifier. Problem reported by Baron Schwartz in
5814 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5816 2004-10-11 Akim Demaille <akim@epita.fr>
5818 * src/symtab.c (symbol_check_alias_consistency): Also check
5819 type names, destructors, and printers.
5820 Reported by Alexandre Duret-Lutz.
5821 Recode the handling of associativity and precedence in terms
5822 of symbol_precedence_set.
5823 Accept no redeclaration at all, not even equal to the previous
5825 (redeclaration): New.
5826 Use it to factor redeclaration complaints.
5827 (symbol_make_alias): Don't set the type of the alias, let
5828 symbol_check_alias_consistency do it as for other features.
5829 * src/symtab.h (symbol): Add new member prec_location, and
5831 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5832 * tests/input.at (Incompatible Aliases): New.
5834 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5836 .cvsignore fixes to accommodate gnulib changes,
5837 and the practice of naming build directories "_build".
5838 * .cvsignore: Add "_*". Sort.
5839 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5840 * m4/.cvsignore: Add "*_gl.m4".
5842 2004-10-06 Akim Demaille <akim@epita.fr>
5844 * src/parse-gram.y (add_param): Fix the truncation of trailing
5847 2004-10-05 Akim Demaille <akim@epita.fr>
5849 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5850 whether the reducion was empty or not. This leaves room to
5851 improve the use of YYLLOC_DEFAULT in such a case.
5852 lalr1.cc is still experimental, so changing this is acceptable.
5853 And finally, there are probably not many users who changed the
5854 handling of locations in GLR, so changing is admissible too.
5856 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5857 empty reduction, set @$ to an empty location ending the previously
5859 Adjust uses to make sure the code is triggered on empty
5861 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5862 expected output: empty reductions have empty locations.
5864 2004-09-29 Akim Demaille <akim@epita.fr>
5866 * data/lalr1.cc: Move towards a more standard C++ coding style
5867 for templates: Class < T > -> Class<T>.
5869 2004-09-29 Akim Demaille <akim@epita.fr>
5871 * data/lalr1.cc: Reinstall the former ctor, for sake of
5872 compatibility, but warn it will be removed.
5873 Move towards a more standard C++ coding style (i.e., type *var ->
5876 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5878 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5879 since it's less likely to work if NULs are involved in the future.
5881 2004-09-27 Akim Demaille <akim@epita.fr>
5883 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5885 2004-09-27 Akim Demaille <akim@epita.fr>
5887 * data/lalr1.cc (b4_parse_param_decl_1): New.
5888 (b4_parse_param_decl): Use it to have different names between attribute
5890 (b4_cc_constructor_call): Likewise.
5892 2004-09-24 Akim Demaille <akim@epita.fr>
5894 * src/parse-gram.y (add_param): Strip the leading and trailing
5895 blanks from a formal argument declaration.
5896 (YY_LOCATION_PRINT): New.
5898 2004-09-24 Akim Demaille <akim@epita.fr>
5900 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5903 2004-09-24 Akim Demaille <akim@epita.fr>
5905 * doc/bison.texinfo (Table of Symbols): Sort.
5907 2004-09-21 Akim Demaille <akim@epita.fr>
5909 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5910 the useless parentheses.
5911 Suggested by Paul Eggert.
5913 2004-09-20 Akim Demaille <akim@epita.fr>
5915 Let the initial-action act on the look-ahead, and use it for the
5916 "initial push" (corresponding to an hypothetical beginning-of-file).
5917 And let lalr1.cc honor %initial-action.
5919 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5921 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5922 (Parser::Parser): Remove the ctor that used to initialize it.
5923 (Parser::parse): Like in the other skeletons, issue the "starting
5924 parse" message before any action.
5925 Honor %initial-action.
5926 Initialize the stacks with the lookahead.
5927 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5929 Push them in the stacks.
5930 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5932 2004-09-20 Akim Demaille <akim@epita.fr>
5934 * doc/bison.texinfo (Initial Action Decl): New.
5936 2004-09-20 Akim Demaille <akim@epita.fr>
5938 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5939 clearer criterion to define it.
5940 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5941 When reducing on an empty RHS, use the latest stacked location as
5943 yylloc is not always available.
5944 * data/glr.c: Likewise.
5945 Also, honor initial-actions.
5947 2004-09-20 Akim Demaille <akim@epita.fr>
5949 * data/yacc.c (YY_LOCATION_PRINT): New.
5950 Define when we know YYLTYPE's structure, i.e., when the default
5951 YYLLOC_DEFAULT is used.
5952 * data/c.m4 (b4_yysymprint_generate): Use it.
5953 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5954 value of the result.
5955 (error_start_): Replace with...
5956 (error_range_): this location array.
5957 This allows to replace code relying on the implementation of
5958 locations by portable code.
5959 * data/yacc.c (yylerrsp): Replace with...
5960 (yyerror_range): this.
5961 Every time a token is popped, update yyerror_range[0], to have an
5962 accurate location for the error token.
5963 * data/glr.c (YY_LOCATION_PRINT): New.
5964 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
5965 deference a pointer.
5966 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
5967 report the location in %printers.
5969 * src/scan-skel.l: Instead of abort, report error messages to ease
5970 understanding skeleton scanning failures.
5972 2004-09-16 Akim Demaille <akim@epita.fr>
5974 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
5975 (iterator, const_iterator): these, to be more in the C++ spirit.
5976 Also, return reverse iterators so that when displaying the stack
5977 we display its bottom first.
5978 (Parser::stack_print_, Parser::reduce_print_): Match the messages
5980 We should probably use vector here though.
5982 2004-09-16 Akim Demaille <akim@epita.fr>
5984 Have more complete shift traces.
5986 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
5987 to report Shifts instead of ad hoc YYDPRINTF invocations,
5988 including for the error token.
5989 * data/lalr1.cc (symprint_): Output the location.
5990 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
5991 output the location within the %printer.
5992 Activate GLR tests, at least to make sure they compile properly.
5993 They still don't pass though.
5994 * tests/calc.at: Adjust expect verbose output, since now "Entering
5995 state..." is on a different line than the "Shifting" message.
5997 2004-09-08 Akim Demaille <akim@epita.fr>
5999 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
6000 Bison directive from the Bison file to the invocation of this
6001 macro, so that these directives are passed to
6002 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
6003 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
6004 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
6005 the extra Bison directives instead of the whole series.
6006 Change the grammar so that there are recoverable errors, and
6007 unrecoverable errors. Now we can have the parser give up before
6008 consuming the whole input. As a result we now can observe that
6009 the lookahead is freed when needed.
6010 Change the parser source to parse argv[1] instead of a hard coded
6012 Simplify yylex, and give a value and location to EOF.
6013 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
6014 passed directives already coded in the file.
6015 Add some tests to check the location of "error".
6016 For some tests, the C++ parser is correct, and not yacc.c.
6017 For other tests, they provide different, but unsatisfying, values,
6018 so keep the C++ value so that at least one parser is "correct"
6019 according to the test suite.
6020 (Actions after errors): Remove, this is subsumed by the
6021 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
6023 2004-09-06 Akim Demaille <akim@epita.fr>
6025 * data/lalr1.cc: Adjust the indentation of the labels.
6029 2004-09-06 Akim Demaille <akim@epita.fr>
6031 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
6032 argument, an informative message.
6033 Call YY_SYMBOL_PRINT.
6034 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
6035 * data/lalr1.cc (destruct_): Likewise.
6036 In addition, no longer depend on b4_yysymprint_generate and
6037 b4_yydestruct_generate to generate these functions, do it "by
6040 2004-09-03 Akim Demaille <akim@epita.fr>
6042 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
6043 invoked, yydestruct the lookahead.
6044 * tests/calc.at (Calculator $1): Update the expected lengths of
6045 traces: there is an added line for the discarded lookahead.
6046 * doc/bison.texinfo (Destructor Decl): Some rewording.
6047 Define "discarded" symbols.
6049 2004-09-02 Akim Demaille <akim@epita.fr>
6051 * data/lalr1.cc (translate_, destruct_): No reason to be static.
6053 2004-09-02 Akim Demaille <akim@epita.fr>
6055 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
6056 (YYDSYMPRINTF): Rename as...
6057 (YY_SYMBOL_PRINT): this.
6058 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
6060 Use it instead of direct symprint_ calls.
6061 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
6064 2004-09-02 Akim Demaille <akim@epita.fr>
6066 * data/lalr1.cc (b4_yysymprint_generate): New.
6067 (symprint_): New member function, defined when YYDEBUG.
6068 Use it consistently instead of token/nterm debugging output by
6070 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
6071 %printer calls to use cdebug_ when using lalr1.cc.
6073 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
6075 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
6076 with #ifdef YYDEBUG.
6078 2004-08-26 Akim Demaille <akim@epita.fr>
6080 * doc/bison.texinfo (Implementing Loops): Rename as...
6081 (Implementing Gotos/Loops): this.
6083 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
6085 Adjust to latest gnulib.
6086 * bootstrap (gnulib_modules): Add xalloc-die.
6087 Set LC_ALL=C so that file names sort consistently.
6088 Prefer the gnulib copies of gettext.m4, glibc21.m4,
6089 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
6090 uintmax_t.m4, ulonglong.m4.
6091 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
6092 po.m4 since we are now using _gl.m4 instead.
6094 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
6096 * src/scan-action.l: Remove. Scanning of semantic actions is
6097 handled in scan-gram.l.
6099 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
6101 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
6103 * src/location.h (struct): The file member is a uniqstr.
6104 (equal_boundaries): Use UNIQSTR_EQ for comparison.
6106 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
6108 Fix bug with non-%union parsers that have printers or destructors,
6109 which led to a Bison core dump. Reported by Peter Fales in
6110 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
6112 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
6113 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
6114 not to our own type.
6115 * src/output.c (symbol_destructors_output, symbol_printers_output):
6116 Don't assume %union.
6117 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
6118 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
6119 UNION-FLAG. All callers changed.
6120 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
6121 Use type char, not unsigned int, when declaring an array of char;
6122 this lets us remove a cast.
6123 (Printers and Destructors): Add non-%union test cases.
6125 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6127 * doc/bison.texinfo: Minor editorial changes, mostly to the new
6128 GLR writeups. E.g., avoid frenchspacing and the future tense,
6129 change "lookahead" to "look-ahead", and change "wrt" to "with
6132 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6134 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
6135 New sections, split off from the GLR Parsers section. Put the new
6136 Simple GLR Parser near the start of the GLR section, for clarity.
6137 Rewrite connective text.
6139 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
6141 * doc/bison.texinfo (Simple GLR Parsers): New section.
6143 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6145 * NEWS, TODO, doc/bison.texinfo:
6146 Use "look-ahead" instead of "lookahead", to be consistent.
6147 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
6148 while we're fixing "look-ahead".
6149 * src/conflicts.c (shift_set): Renamed from shiftset.
6150 (look_ahead_set): Renamed from lookaheadset.
6151 * src/print.c: Likewise.
6152 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
6153 name for "lookahead".
6154 (report_types, usage): Likewise.
6155 * src/getargs.h (report_look_ahead_tokens): Renamed from
6157 * src/lalr.c (compute_look_ahead_tokens): Renamed from
6159 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
6160 (look_ahead_tokens_print): Renamed from lookaheads_print.
6161 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
6162 state_rule_lookaheads_print.
6163 * src/state.h: Likewise.
6164 (reductions.look_ahead_tokens): Renamed from lookaheads.
6165 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
6166 AT_DATA_LOOKAHEADS_GRAMMAR.
6168 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
6170 * README: Update location of patched M4 distribution.
6172 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
6174 Don't assume the C++ compiler takes the same arguments as the C compiler
6176 * configure.ac (O0CXXFLAGS): New var.
6177 * tests/atlocal.in (CXXFLAGS): Use it.
6179 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
6181 Fix some "make check" problems with C++ reported by
6182 Albert Chin-A-Young for Tru64 C++ in this thread:
6183 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
6185 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
6186 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6187 Output to a .cc file for C++, not to a .c file.
6188 * tests/calc.at (AT_CHECK_CALC): Likewise.
6189 * tests/regression.at (AT_CHECK_DANCER): Likewise.
6190 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
6192 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
6194 * tests/calc.at, tests/actions.at: Workaround for SGI
6195 C++ compiler. (trivial change)
6197 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
6199 Spent a few hours checking out which prerequisite versions the
6200 current sources actually require. I went all the way back to
6201 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
6202 a seemingly endless set of combinations of versions more recent
6203 than that. The bottom line is that the current sources require
6204 fairly recent versions of the build tools, and it'll be some work
6206 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
6207 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
6208 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
6209 Add comments explaining why those particular versions are
6212 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
6213 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
6214 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
6216 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
6217 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
6219 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
6221 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
6222 0.11.5. Suggested by Bruno Haible.
6223 * bootstrap: Remove gettext version checking.
6225 * doc/bison.texinfo (Decl Summary): Also mention that %union
6226 can depend on prerequisite types. Problem reported by Tim
6229 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
6231 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
6232 * README-alpha: Don't tell people not to package this.
6234 * bootstrap: Don't assume $(...) works; use `...` instead.
6235 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
6238 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
6239 put into the -d output file, and mention what to do if YYSTYPE is
6242 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
6244 Undo change made earlier today: it caused autopoint to not bring
6245 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
6248 * bootstrap: Check that gettext version matches what's in
6249 configure.ac. Warn users to ignore robots.txt ERROR 404.
6250 * bootstrap: Undo today's earlier change (logged below).
6251 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
6253 The gettext version checking is causing more trouble than it's
6254 curing; remove it. Problem reported by Paul Hilfinger.
6256 * bootstrap: Issue a warning that one can expect a message
6257 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
6258 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
6260 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
6262 Ensure that the C++ compiler used for testing actually works on a
6263 simple test program; if not, skip the C++-related tests. Problem
6264 reported by Vin Shelton in:
6265 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
6267 * m4/cxx.m4: New file.
6268 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
6269 * tests/atlocal.in (BISON_CXX_WORKS): Add.
6270 * tests/local.at (AT_COMPILE_CXX): Use it.
6272 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6274 * data/glr.c (yylloc): Output this macro even if locations are not
6275 being generated, as the GLR parser needs it even in that case.
6276 Problem reported by Troy A. Johnson
6277 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
6279 * configure.ac (AC_INIT): Update to 1.875e.
6281 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6283 * NEWS: Version 1.875d.
6284 * configure.ac (AC_INIT): Likewise.
6285 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
6287 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
6288 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
6289 lalr1.cc runs afoul of the first, and the last two are no longer
6290 supported by GCC 3.4.0.
6291 * README: Mention GNU m4 1.4 or later; mention m4 patches.
6292 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
6294 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6296 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
6297 unsigned int, for compatibility with latest gnulib hash module.
6298 * src/state.c (state_hash, state_hasher): Likewise.
6299 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
6300 * src/uniqstr.c (hash_uniqstr): Likewise.
6302 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
6304 * NEWS: Unescaped newlines are no longer allowed in char & strings.
6306 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
6307 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
6308 character and string literals.
6309 (unexpected_end): New function.
6310 (unexpected_eof): Use it.
6311 (unexpected_newline): New function.
6312 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
6315 * NEWS: Document %expect-rr.
6317 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
6318 Fix typo by replacing $1 with $option.
6319 Remove more 'intl'-related files.
6320 Don't DEFUN AM_INTL_SUBDIR twice.
6322 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
6323 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
6325 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
6326 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
6327 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
6328 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
6329 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
6330 * src/.cvsignore: Add *.output.
6332 * src/parse-gram.y: Put copyright notice inside %{ %} so it
6333 gets copied to the output file.
6335 2004-04-28 Paul Eggert <eggert@twinsun.com>
6337 Get files from the gnulib and po repositories, instead of relying
6338 on them being in our CVS. Upgrade to latest versions of gnulib
6341 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
6342 * bootstrap: Bootstrap from gnulib and po repositories.
6343 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
6344 * README-cvs: Document these changes. Remove version numbers from
6345 mentions of build tools, since they change so often. Mention Flex.
6347 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
6348 (gl_USE_SYSTEM_EXTENSIONS): Add.
6349 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
6350 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
6352 (AC_ISC_POSIX): Remove; we no longer support this
6353 ancient OS, as it gets in the way of latest Autoconf & gnulib.
6354 (AC_HEADER_STDC): Remove: we now assume C89 or better.
6355 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
6356 Do not check for C89 headers, except for locale.h which is used
6357 by the Yacc library and must port to K&R hosts.
6358 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
6359 Do not check for C89 functions, except for setlocale which is
6360 used by the Yacc library.
6361 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
6362 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
6363 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
6364 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
6365 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
6366 AM_GNU_GETTEXT): Remove; now done by:
6367 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
6368 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
6371 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
6372 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
6373 Define to empty, as gnulib.mk will do the rest for us.
6374 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
6376 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
6377 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
6379 * src/files.c: Include gnulib's xstrndup.h.
6381 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
6382 (REALLOC): Use xnrealloc, for likewise.
6383 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
6384 (strnlen, memrchr): Remove decls; functions no longer used.
6387 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
6388 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
6389 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
6390 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
6391 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
6392 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
6393 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
6394 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
6395 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
6396 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
6397 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
6398 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6399 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
6400 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
6401 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
6402 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
6403 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
6404 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
6405 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
6406 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
6407 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
6408 Remove, as these files are now generated automatically
6409 by bootstrap or automake.
6411 * po/ChangeLog: Remove: all but one entry was a duplicate
6412 of this file, and I moved that 2000-11-02 entry here.
6414 * config/.cvsignore: Add Makefile, depcomp, install-sh.
6415 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
6416 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
6417 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
6418 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
6419 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
6420 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
6421 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
6422 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
6423 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
6424 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
6426 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
6427 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
6428 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
6429 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
6430 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
6431 * src/.cvsignore: Remove *_.c.
6434 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
6435 support it. (The latest stable gzip doesn't.)
6437 2004-04-27 Paul Eggert <eggert@twinsun.com>
6439 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6440 case, as stos_ is now used by destructors due to the 2004-02-09
6443 Remove more K&R C support.
6444 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6445 * lib/subpipe.c (errno): Remove decl.
6446 Include <stdlib.h> unconditionally.
6447 (EXIT_FAILURE): Remove macro.
6448 * src/complain.c (vfprintf, strerror): Remove.
6449 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6451 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6452 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6453 (strchr, strspn, memchr): Remove decls.
6454 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6455 unconditionally. Do not declare perror.
6456 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6459 * src/complain.c (_): Remove useless defn, as system.h defines this.
6461 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6462 with latest obstack.h.
6463 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6464 to procedure types, as obstack.h now does that for us.
6465 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6467 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6468 so that this include file can stand alone.
6469 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6470 does this now. Include subpipe.h first after config.h, to
6471 test whether it can stand alone.
6473 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6474 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6477 * tests/synclines.at (%union synch line): Put a dummy member in
6478 the union, because empty unions aren't allowed in C. Caught
6481 2004-04-13 Jim Meyering <jim@meyering.net>
6483 * src/conflicts.c (conflicts_print): Correct format string typo:
6484 use `%%' to produce literal `%'. (trivial change)
6486 2004-03-30 Paul Eggert <eggert@twinsun.com>
6488 * src/getargs.c (version): Update copyright year to 2004.
6490 * data/c.m4 (b4_int_type): Use 'short int' rather than
6491 'short', and similarly for 'long', 'unsigned', etc.
6492 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6493 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6494 yy_yypstack, yydumpstack): Likewise.
6495 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6496 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6498 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6499 yy_stack_print, yyparse): Likewise.
6500 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6501 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6502 * lib/bitset.c (bitset_print): Likewise.
6503 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6504 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6505 * lib/bitsetv.c (bitsetv_dump): Likewise.
6506 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6507 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6509 * src/LR0.c (allocate_itemsets): Likewise.
6510 * src/gram.h (rule_number, rule): Likewise.
6511 * src/lalr.h (goto_number): Likewise.
6512 * src/nullable.c (nullable_compute): Likewise.
6513 * src/output.c (prepare_rules): Likewise.
6514 * src/relation.c (relation_print, relation_digraph): Likewise.
6515 * src/relation.h (relation_node): Likewise.
6516 * src/state.h (state_number, transitions, errs, reductions,
6517 struct state): Likewise.
6518 * src/symtab.h (symbol_number, struct symbol): Likewise.
6519 * src/tables.c (vector_number, tally, action_number,
6520 default_goto, goto_actions): Likewise.
6521 * tests/existing.at (GNU Cim Grammar): Likewise.
6522 * tests/regression.at (Web2c Actions): Likewise.
6524 * src/output.c (muscle_insert_short_int_table): Renamed from
6525 muscle_insert_short_table. All uses changed.
6527 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6529 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6530 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6531 Add %expect-rr rule.
6533 * src/scan-gram.l: Recognize %expect-rr.
6535 * src/conflicts.h (expected_sr_conflicts): Rename from
6537 (expected_rr_conflicts): Declare.
6539 * src/conflicts.c (expected_sr_conflicts): Rename from
6541 (expected_rr_conflicts): Define.
6542 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6544 Use expected_sr_conflicts in place of expected_conflicts.
6545 Warn if expected_rr_conflicts used in non-GLR parser.
6547 * doc/bison.texinfo: Add documentation for %expect-rr.
6549 2004-03-08 Paul Eggert <eggert@gnu.org>
6551 Add support for hex token numbers. Suggested by Odd Arild Olsen in
6552 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
6554 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6556 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6557 * src/scan-gram.l (scan_integer): New function.
6559 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6560 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6561 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6562 Say "long int", not "long", for uniformity with GNU style.
6564 2004-02-25 Paul Eggert <eggert@twinsun.com>
6566 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6567 compilers. This fixes a problem with Intel's C++ compiler being
6568 chatty, reported by Guido Trentalancia in
6569 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
6571 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6573 Support %destructor and merge error locations in lalr1.cc.
6575 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6576 (Parser::stos_): Define unconditionally.
6577 (Parser::destruct_): New method. Generate its body with
6578 b4_yydestruct_generate.
6579 (Parser::error_start_): New attribute.
6580 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6581 token which are discarded.
6582 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6583 error_start_ when erroneous token are discarded.
6584 (Parser::parse) <yyerrlab1>: Compute the location of the error
6585 token so that it covers all the discarded tokens.
6586 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6587 it can be called with `%skeleton "lalr1.cc"', and do that.
6589 2004-02-02 Paul Eggert <eggert@twinsun.com>
6591 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6592 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6593 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6594 There's no need to mention top_builddir since Automake does that
6596 (INCLUDES): Remove, as Automake says it's obsolescent.
6597 Contents migrated into AM_CPPFLAGS as described above.
6598 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6600 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6602 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6603 (yyreportSyntaxError): Handle case where lookahead token is
6606 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6608 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6609 resulting parsers are compilable with C++.
6611 2003-12-23 Paul Eggert <eggert@twinsun.com>
6613 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6614 * src/output.c (output_skeleton): Rename local var.
6615 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6616 Bison tokens, as this runs afoul of the 2003-10-07 change that
6617 disallowed NUL bytes in character constants or string literals.
6619 * tests/local.at: Require Autoconf 2.59's Autotest.
6620 * tests/testsuite.at: Don't include local.at, since we now assume
6621 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6623 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6624 multiple inclusion warnings.
6626 2003-12-02 Akim Demaille <akim@epita.fr>
6628 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6632 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6634 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6636 2003-10-07 Paul Eggert <eggert@twinsun.com>
6638 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6639 if testsuite doesn't exist.
6641 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6642 literals, unfortunately.
6643 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6644 Complain about NUL bytes in character constants or string literals.
6646 2003-10-05 Paul Eggert <eggert@twinsun.com>
6648 * NEWS: Don't document %no-default-prec, as it's still
6650 * doc/bison.texinfo: Document %no-default-prec only if
6651 the defaultprec flag is set. Normally it's not.
6653 2003-10-04 Paul Eggert <eggert@twinsun.com>
6655 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6656 non-modifiable lvalue, instead of a modifiable one.
6657 * doc/bison.texinfo (Actions): Document that $$ can
6658 be assigned to. Do not claim that $$ and $N are
6659 array element references: user code should not rely on this.
6661 2003-10-01 Paul Eggert <eggert@twinsun.com>
6663 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6664 (grammar_declaration): Use it.
6665 * src/scan-gram.l: New token %no-default-prec.
6666 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6667 * NEWS, doc/bison.texinfo: Document the above.
6669 2003-10-01 Akim Demaille <akim@epita.fr>
6671 VCG no longer supports long_straight_phase.
6673 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6674 * src/print_graph.c (print_graph): Adjust.
6676 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
6677 and Paul Eggert <eggert@twinsun.com>
6679 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6680 Table of Symbols): Document %default-prec.
6681 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6682 (grammar_declaration): Set default_prec on %default-prec.
6683 * src/scan-gram.l (%default-prec): New token.
6684 * src/reader.h (default_prec): New flag.
6685 * src/reader.c: Likewise.
6686 (packgram): Handle it.
6687 * tests/conflicts.at (%default-prec without %prec,
6688 %default-prec with %prec, %default-prec 1): New tests.
6690 2003-09-30 Paul Eggert <eggert@twinsun.com>
6692 * tests/testsuite.at: Include local.at, not input.at, fixing
6693 a typo in the 2003-08-25 patch.
6695 2003-08-27 Akim Demaille <akim@epita.fr>
6697 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6700 2003-08-26 Akim Demaille <akim@epita.fr>
6702 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6703 "<\#" to avoid magic from Gnus when posting parts of this script.
6705 2003-08-26 Akim Demaille <akim@epita.fr>
6707 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6708 (Parser::parse): here.
6709 Adjust: nerrs and errstatus is now replaced by...
6710 (Parser::nerrs_, Parser::errstatus_): New.
6712 2003-08-25 Akim Demaille <akim@epita.fr>
6714 * config/announce-gen, Makefile.cfg: New.
6715 * Makefile.am: Adjust.
6716 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6717 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6719 2003-08-25 Akim Demaille <akim@epita.fr>
6721 When reducing initial empty rules, Bison parser read an initial
6722 location that is not defined. This results in garbage, and that
6723 affects Bison's own parser. Therefore we need (i) to extend Bison
6724 to support a means to initialize this location, and (ii) to use
6725 this CVS Bison to fix CVS Bison's parser.
6727 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6729 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6730 * src/parse-gram.y: Adjust.
6731 (%initial-action): New.
6732 (%error-verbose): Since we require CVS Bison, there is no reason
6734 * src/scan-gram.l: Adjust.
6735 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6736 * data/yacc.c (yyparse): Use b4_initial_action.
6738 2003-08-25 Akim Demaille <akim@epita.fr>
6740 * doc/bison.texinfo: Don't promote stdout for error messages.
6742 2003-08-25 Akim Demaille <akim@epita.fr>
6744 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6745 From Alexandre Duret-Lutz.
6747 2003-08-25 Akim Demaille <akim@epita.fr>
6751 2003-08-25 Akim Demaille <akim@epita.fr>
6753 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6756 2003-08-25 Akim Demaille <akim@epita.fr>
6758 * data/lalr1.cc (Parser::reduce_print_): New.
6761 2003-08-25 Akim Demaille <akim@epita.fr>
6763 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6764 error recovery loops. This patch is based on
6765 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
6766 Also, augment the similarity between lalr1.cc and yacc.c.
6767 Note: the locations of error recovery rules are not correct yet.
6769 * data/lalr1.cc: Comment changes to augment the similarity between
6770 lalr1.cc and yacc.c.
6771 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6772 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6773 yyerrlab), when hitting EOF, pop the whole stack here instead of
6774 merely falling thru the default error handling mechanism.
6775 (yyerrorlab): New label, with the old contents of YYERROR,
6776 plus the following change: pop the stack of rhs corresponding
6777 to the production that invoked YYERROR. That is how Yacc
6778 behaves (required by POSIX).
6779 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6782 2003-08-25 Akim Demaille <akim@epita.fr>
6784 Tune local.at so that people can "autom4te -l autotest calc.at -o
6785 calc" for instance, to extract a sub test suite.
6787 * tests/testsuite.at: Move the initialization, Autotest version
6788 requirement, and AT_TESTED invocation into...
6789 * tests/local.at: here.
6790 * tests/testsuite.at: Include it for compatibility with Autoconf
6792 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6795 2003-08-04 Paul Eggert <eggert@twinsun.com>
6797 Rework code slightly to avoid gcc -Wtraditional warnings.
6798 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6799 The returned value is now stored in *YY0. All callers changed.
6800 * src/output.c (merge_output): Adjust to the above change.
6802 2003-07-26 Paul Eggert <eggert@twinsun.com>
6804 * data/glr.c (YYASSERT): New macro.
6805 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6806 yyresolveStates, yyprocessOneStack):
6807 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6808 Derived from a suggestion by Frank Heckenbach.
6810 2003-07-25 Paul Eggert <eggert@twinsun.com>
6812 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6813 for portability to K&R C (after ansi2knr, presumably). See
6814 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
6815 by Frank Heckenbach, though I have omitted the structure-initialization
6816 part of his glr-knr.diff patch since I recall that the Portable
6817 C Compiler didn't require that change.
6819 Let the user specify how to allocate and free memory.
6820 Derived from a suggestion by Frank Heckenbach in
6821 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
6822 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6823 All uses of free, malloc, realloc changed to use these macros,
6824 and unnecessary casts removed.
6825 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6827 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6829 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6830 use s.empty() rather than s == "" to test for empty string; see
6831 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
6834 2003-06-25 Akim Demaille <akim@epita.fr>
6836 * config/depcomp, config/install-sh: Update from masters.
6838 2003-06-20 Paul Eggert <eggert@twinsun.com>
6840 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6841 and return properly parenthesized result.
6842 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6843 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6844 Remove unnecessary parentheses from uses.
6845 * doc/bison.texinfo (Location Default Action): Describe the
6846 conventions for parentheses.
6848 2003-06-19 Paul Eggert <eggert@twinsun.com>
6850 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6851 yyreportTree): Do not assume that size_t is the same width as int,
6852 when printing sizes. Print sizes using an unsigned format.
6853 Problem reported by Frank Heckenbach in
6854 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
6856 Port to Forte Developer 7 C compiler.
6857 * data/glr.c (struct YYLTYPE): If locations are not being used,
6858 declare a single dummy member, as empty structs do not conform
6860 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6861 the Forte Developer 7 C compiler complains that end-of-loop
6862 code is not reached.
6864 2003-06-17 Paul Eggert <eggert@twinsun.com>
6866 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6867 avoid warnings from picky compilers about redefinition of PARAMS.
6869 2003-06-17 Paul Eggert <eggert@twinsun.com>
6873 * NEWS: Document 1.875b.
6875 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6876 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6877 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6878 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6879 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6880 per recent gettext manual's suggestion.
6881 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6882 Use prototypes, not old-style definitions.
6883 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6884 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6885 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6886 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6887 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6888 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6889 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6890 vbitset_or_and_cmp, vbitset_copy): Likewise.
6892 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6893 Do not include <stdlib.h>.
6894 (PARAMS): Define unconditionally for C89.
6895 (ATTRIBUTE_NORETURN): Remove.
6896 (ATTRIBUTE_UNUSED): Define unconditionally.
6898 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
6899 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
6900 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6901 * lib/vbitset.c, lib/vbitset.h: New files.
6902 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6903 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6906 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6907 `How Can I Reset @code{yyparse}', since texinfo does not allow
6908 arbitrary @ in node names.
6910 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6911 shouldn't be needed according to the gettext 0.12.1 documentation
6912 but which seem to be needed anyway: codeset.m4 glibc21.m4
6913 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
6914 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
6915 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
6917 * lib/.cvsignore: Add stdbool.h.
6918 * m4/.cvsignore: Add nls.m4, po.m4.
6920 Upgrade to CVS gnulib.
6921 * stdbool_.h: File renamed from stdbool.h.in.
6922 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6924 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6925 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6926 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6927 (MOSTLYCLEANFILES): New var.
6928 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6929 (stdbool.h): New rule.
6930 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6931 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6932 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6933 m4/quote.m4: Upgrade to today's gnulib.
6935 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6936 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6937 the tests right now.
6938 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6939 yyerror are declared before use; C99 requires this.
6941 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6943 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6945 (yyrecoverSyntaxError): Correct the logic for setting and testing
6947 Correct comment on handling EOF.
6948 Allow states with only a default reduction, rather than failing
6949 (I can't quite reconstruct why these were not allowed before).
6951 Fixes to avoid problem that $-N rules in GLR parsers can cause
6952 buffer overruns, corrupting state.
6954 * src/output.c (prepare_rules): Output max_left_semantic_context
6956 * src/reader.h (max_left_semantic_context): New variable declaration.
6957 * src/scan-gram.l (max_left_semantic_context): Define.
6958 (handle_action_dollar): Update max_left_semantic_context.
6959 * data/glr.c (YYMAXLEFT): New definition.
6960 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
6961 (yyresolveAction): Ditto.
6963 Fixes to problems with location handling in GLR parsers reported by
6964 Frank Heckenbach (2003/06/05).
6966 * data/glr.c (YYLTYPE): Make trivial if locations not used.
6967 (YYRHSLOC): Add parentheses, and define only if locations used.
6968 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
6970 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6971 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
6973 * tests/cxx-type.at: Exercise location information; update tests
6974 to differentiate output with and without locations.
6975 Remove forward declarations of yylex and yyerror---caused errors
6976 because default YYLTYPE not yet defined.
6977 Change semantic actions to compute strings, rather than printing
6978 them directly (to test proper passing of semantics values). Change
6979 output to prefix notation and update test data and expected results.
6980 (yylex): Track locations.
6981 (stmtMerge): Return value rather than printing, and include arguments
6984 2003-06-03 Paul Eggert <eggert@twinsun.com>
6986 Avoid warnings generated by GCC 2.95.4 when Bison is
6987 configured with --enable-gcc-warnings.
6988 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
6989 yy::]b4_parser_class_name[::translate_,
6990 yy::Stack::operator[] (unsigned),
6991 yy::Stack::operator[] (unsigned) const,
6992 yy::Slice::operator[] (unsigned),
6993 yy::Slice::operator[] (unsigned) const):
6994 Rename local vars to avoid warnings.
6995 * tests/glr-regression.at (Improper handling of embedded actions
6996 and $-N in GLR parsers): Remove unused local variable from yylex.
6997 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
6998 (void) as arg when not pure, since we now assume C89 when building
6999 Bison. Pacify GCC by using parameter.
7001 2003-06-02 Paul Eggert <eggert@twinsun.com>
7003 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
7004 yy::Location::lines, yy::Location::columns): Rename arguments
7005 to avoid shadowing; this removes a warning generated by GCC 3.3.
7007 2003-06-01 Paul Eggert <eggert@twinsun.com>
7009 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
7010 to g++, as GCC 3.3 complains if you do it.
7011 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
7012 everything that WARNING_CFLAGS has, except omit warnings
7013 not suitable for C++.
7014 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
7015 * tests/atlocal.in (CXXFLAGS): New var.
7016 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
7018 Fix a GLR parser bug I reported in February; see
7019 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
7020 The problem was that GLR parsers did not conform to the C standard,
7021 because actions like { $1 = $2 + $3; } expanded to expressions
7022 that invoked YYFILL in separate subexpressions, and YYFILL assigned
7023 to a local variable. The C standard says that expressions
7024 like (var = f ()) + (var = f ()) have undefined behavior.
7025 Another problem was that GCC sometimes issues warnings that
7026 yyfill and its parameters are unused.
7028 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
7030 (yyfill): New function.
7032 (yyuserAction): Change type of yynormal to bool, so that it matches
7033 the new yyfill signature. Mark it as possibly unused.
7036 Follow up on a bug I reported in February, where a Bison-generated
7037 parser can loop. Provide a test case and a fix for yacc.c. I
7038 don't have a fix for lalr1.cc or for glr.c, unfortunately.
7039 The original bug report is in:
7040 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
7042 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
7043 macro's size was becoming unwieldy.
7044 (yyerrlab): Do not discard an empty lookahead symbol, as this
7045 might destroy garbage.
7046 (yyerrorlab): New label, with the old contents of YYERROR,
7047 plus the following change: pop the stack of rhs corresponding
7048 to the production that invoked YYERROR. That is how Yacc
7049 behaves, and POSIX requires this behavior.
7050 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
7051 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
7052 Define 'alarm' to do nothing if unistd.h is not available.
7053 Add a new rule "exp: '-' error;" to test the above change to
7054 data/yacc.c. Use 'alarm' to abort any test taking longer than
7055 10 seconds, as it's probably looping.
7056 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
7057 Also, the new yacc.c generates two fewer diagnostics for an
7060 2003-05-24 Paul Eggert <eggert@twinsun.com>
7062 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
7063 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
7064 This fixes a problem reported by John Bowman when the Compaq/HP
7065 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
7067 * data/yacc.c (union yyalloc): Likewise.
7068 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
7070 Switch from 'int' to 'bool' where that makes sense.
7072 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
7073 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
7074 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
7075 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
7076 Return or accept bool, not int. All callers changed.
7077 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
7078 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
7079 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
7080 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
7081 bitset_or_and_cmp_): Likewise.
7082 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
7083 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
7084 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
7085 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
7086 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
7087 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
7088 bitset_stats_or_and_cmp): Likewise.
7089 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
7090 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
7091 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
7092 ebitset_xor_cmp): Likewise.
7093 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
7094 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
7095 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
7096 lbitset_xor_cmp): Likewise.
7097 * lib/bbitset.h: Include <stdbool.h>.
7098 (struct bitset_vtable): The following members now return bool, not
7099 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
7100 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
7102 * src/conflicts.c (count_rr_conflicts): Likewise.
7103 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
7105 * lib/ebitset.c (ebitset_obstack_init): Likewise.
7106 * lib/lbitset.c (lbitset_obstack_init): Likewise.
7107 * src/getargs.c (debug_flag, defines_flag, locations_flag,
7108 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7109 graph_flag): Likewise.
7110 * src/getargs.h (debug_flag, defines_flag, locations_flag,
7111 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7112 graph_flag): Likewise.
7113 * src/output.c (error_verbose): Likewise.
7114 * src/output.h (error_verbose): Likewise.
7115 * src/reader.c (start_flag, typed): Likewise.
7116 * src/reader.h (typed): Likewise.
7117 * src/getargs.c (LOCATIONS_OPTION): New constant.
7118 (long_options, getargs): Use it.
7119 * src/lalr.c (build_relations): Use bool, not int.
7120 * src/nullable.c (nullable_compute): Likewise.
7121 * src/print.c (print_reductions): Likewise.
7122 * src/tables.c (action_row, pack_vector): Likewise.
7123 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
7124 * src/output.c (prepare): Use it.
7125 * src/output.c (token_definitions_output,
7126 symbol_destructors_output, symbol_destructors_output): Use string,
7127 not boolean integer, to keep track of whether to output separator.
7128 * src/print_graph.c (print_core): Likewise.
7129 * src/state.c (state_rule_lookaheads_print): Likewise.
7131 * config/install-sh: Sync from automake 1.7.5.
7133 2003-05-14 Paul Eggert <eggert@twinsun.com>
7135 * src/parse-gram.y (rules_or_grammar_declaration): Require a
7136 semicolon after a grammar declaration, in the interest of possible
7137 future changes to the Bison input language.
7138 Do not allow a stray semicolon at the start of the grammar.
7139 (rhses.1): Allow one or more semicolons after any rule, including
7140 just before "|" as required by POSIX.
7141 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
7144 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
7146 %parse-param support for lalr1.cc.
7148 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
7149 b4_cc_constructor_calls, b4_cc_constructor_call,
7150 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
7152 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
7153 parse-param arguments.
7154 (yy::b4_parser_class_name): Declare instance variables to
7155 hold parse-param arguments.
7156 * tests/calc.at: s/value/semantic_value/ because value clashes
7157 with a member of yy::b4_parser_class_name. Adjust C++ code
7158 to handle %parse-param. Enable %parse-param test in C++.
7160 2003-05-12 Paul Eggert <eggert@twinsun.com>
7162 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
7163 English a bit. Fix fclose typo. Change "const char" to "char
7164 const", and use ANSI C rather than K&R for "main". Suggest
7165 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
7166 and suggest yy_switch_to_buffer.
7168 2003-05-05 Paul Eggert <eggert@twinsun.com>
7170 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
7171 C89. This avoids a diagnostic on compilers that define __STDC__
7172 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
7173 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7175 2003-05-03 Paul Eggert <eggert@twinsun.com>
7177 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
7178 Do not overrun array bounds.
7179 This should fix a bug reported today by Olatunji Oluwabukunmi in
7180 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
7182 2003-04-29 Akim Demaille <akim@epita.fr>
7184 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
7185 * src/getargs.c, src/getargs.h: here, as bool, not int.
7186 (nondeterministic_parser): New.
7187 * src/parse-gram.y, src/scan-gram.l: Support
7188 %nondeterministic-parser.
7189 * src/output.c (prepare): Use nondeterministic_parser instead
7190 of glr_parser where appropriate.
7191 * src/tables.c (conflict_row, action_row, save_row)
7192 (token_actions, token_actions, pack_vector): Ditto.
7194 2003-04-29 Akim Demaille <akim@epita.fr>
7196 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
7198 2003-04-29 Akim Demaille <akim@epita.fr>
7200 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
7201 with %pure-parser and %locations to exercise the patch from Yakov
7204 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
7206 * data/yacc.c: (b4_lex_param): Corrected for the case where
7207 %lex-param is provided and %pure-parser isn't.
7209 2003-04-27 Paul Eggert <eggert@twinsun.com>
7211 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
7212 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
7213 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
7214 if it is not defined.
7215 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
7217 2003-04-26 Paul Eggert <eggert@twinsun.com>
7219 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
7220 Declare to be of type suitable for the ninf value itself, not of
7221 type suitable for the corresponding table, since the latter might
7222 be unsigned but the ninf value might be negative. This fixes a
7223 bug reported by Alexandre Duret-Lutz in
7224 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
7226 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
7227 invokes it. We shouldn't invoke it twice because it will attempt
7228 to put error.o in the archive twice. This fixes a glitch reported
7229 by Martin Mokrejs in
7230 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7232 2003-04-21 Paul Eggert <eggert@twinsun.com>
7234 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
7237 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
7239 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
7240 Fix obvious typo that results in uncompilable GLR parsers
7241 when both %pure-parser and %locations are used. (trivial change)
7243 2003-04-17 Paul Eggert <eggert@twinsun.com>
7245 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
7246 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
7247 Do not insert the expected token via unput, as this runs afoul
7248 of a POSIX-compatibility bug in flex 2.5.31.
7249 All uses changed to BEGIN the parent state,
7250 since we no longer insert the expected token via unput.
7251 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
7252 that is no longer emitted after the above change.
7254 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
7255 the first one. This change is from Paul Hilfinger, and it fixes
7256 regression reported by Werner Lemberg in
7257 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
7259 (resolve_sr_conflict): Don't invoke state_errs_set
7260 unless one or more tokens have been explicitly made errors.
7261 Otherwise, the above change causes Bison to abort.
7263 * tests/existing.at (GNU pic Grammar): New test case, taken from
7266 2003-03-31 Akim Demaille <akim@epita.fr>
7268 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
7270 2003-03-31 Akim Demaille <akim@epita.fr>
7272 * src/output.c (prepare_symbols): Avoid trailing spaces in the
7275 2003-03-31 Akim Demaille <akim@epita.fr>
7277 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
7278 From Paul Hilfinger.
7280 2003-03-29 Akim Demaille <akim@epita.fr>
7282 * m4/error.m4: Do not put under dynamic conditions some code which
7283 expansion is under static control.
7285 2003-03-29 Akim Demaille <akim@epita.fr>
7287 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
7289 2003-03-29 Akim Demaille <akim@epita.fr>
7291 * doc/bison.texinfo (Strings are Destroyed): New.
7293 2003-03-13 Paul Eggert <eggert@twinsun.com>
7295 * .cvsignore: Add configure.lineno.
7296 * src/.cvsignore: Add yacc.
7297 * tests/.cvsignore: Add testsuite.log.
7298 * doc/fdl.texi: Sync with latest FSF version.
7300 2003-03-12 Paul Eggert <eggert@twinsun.com>
7302 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
7303 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
7304 cursor, instead of leaving it undefined. This fixes a bug
7305 reported by Tim Van Holder in
7306 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
7307 * tests/input.at (Torturing the Scanner): Test the scanner on
7308 an empty input file, which was Tim Van Holder's test case.
7310 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
7311 <sys/resource.h> can be included, include sys/time.h and
7312 sys/times.h first, if available. This works around the SunOS
7313 4.1.4 porting bug reported by Bruce Becker in
7314 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
7316 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
7317 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
7320 Merge changes from gnulib. This was prompted because the CVS
7321 snapshot didn't build on Solaris 7 due to strnlen problems.
7323 These changes need to be merged back into gnulib:
7324 * lib/hash.c: Include <stdbool.h> unconditionally.
7325 * m4/onceonly.m4 (m4_quote): New macro.
7326 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
7327 Quote AC_FOREACH variable-expansions properly.
7328 The 2003-01-03 obstack.h change also needs merging.
7329 {end of changes requiring merging}
7331 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7332 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
7333 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
7334 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
7335 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
7336 New files, imported from gnulib.
7337 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
7340 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
7341 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
7344 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
7346 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
7347 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
7348 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
7349 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
7350 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
7351 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
7352 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
7353 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
7354 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
7355 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
7356 (jm_PREREQ_ARGMATCH): Remove.
7357 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
7358 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
7360 * src/system.h: Include <stdbool.h> unconditionally.
7362 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
7363 assuming at least C89 in the bitset code for some time now.
7365 2003-03-03 Akim Demaille <akim@epita.fr>
7369 2003-03-02 Akim Demaille <akim@epita.fr>
7371 * doc/bison.texinfo (Table of Symbols): Reactivate the
7372 documentation for %lex-param, and %parse-param.
7374 2003-03-02 Akim Demaille <akim@epita.fr>
7376 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
7377 generate verbose error messages.
7378 Use the number of tokens as an upper bound in yytname, as it
7379 cannot be a non terminal.
7381 2003-03-02 Akim Demaille <akim@epita.fr>
7383 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
7386 2003-03-02 Akim Demaille <akim@epita.fr>
7388 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
7389 Use them to exercise yycheck overrun.
7390 Based on Andrew Suffield's grammar.
7392 2003-03-02 Akim Demaille <akim@epita.fr>
7394 Create tests/local.at for Bison generic testing macros.
7396 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
7397 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
7399 * tests/calc.at (AT_CHECK_CALC): Adjust.
7400 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
7401 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
7402 * tests/local.at: here.
7403 (AT_COMPILE_CXX): Tags the tests using it as c++.
7404 Ignore the test if CXX is not functional.
7406 2003-03-01 Paul Eggert <eggert@twinsun.com>
7408 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
7409 not loc->end, since loc->end might contain garbage and this leads
7410 to undefined behavior on some platforms.
7411 (id_loc, token_start): Use (IF_LINTed) initial values that do not
7412 depend on *loc, so that the reader doesn't give the the false
7413 impression that *loc is initialized.
7414 (<INITIAL>"%%"): Do not bother setting code_start, since its value
7415 does not survive the return.
7417 2003-03-01 Akim Demaille <akim@epita.fr>
7419 * src/scan-gram.l (code_start): Always initialize it when entering
7420 into yylex, as SC_EPILOGUE is activated *before* the corresponding
7421 yylex invocation. An alternative would be making it static, but
7422 then it starts with the second %%'s beginning, instead of its end.
7424 2003-02-28 Paul Eggert <eggert@twinsun.com>
7426 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
7427 around a UnixWare 7.1.1 porting bug reported by John Hughes in
7428 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
7430 2003-02-26 Paul Eggert <eggert@twinsun.com>
7432 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
7433 Remove Sequent/Pyramid discussion (nobody uses them any more).
7434 Merge VMS and MS-DOS discussion; these ports may well be dead
7435 but let's keep mentioning them for now. Put <> around email
7436 addresses. Add copyright notice.
7438 2003-02-24 Paul Eggert <eggert@twinsun.com>
7440 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7441 to avoid collision with flex use of yylineno.
7442 Problem reported by Bruce Lilly in
7443 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
7444 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7445 * data/yacc.c (yy_reduce_print): Likewise.
7447 * config/depcomp: Sync with Automake 1.7.3.
7449 2003-02-21 Akim Demaille <akim@epita.fr>
7451 * data/lalr1.cc: Use temporary variables instead of casts to
7452 change integer types.
7453 Suggested by Paul Eggert.
7455 2003-02-21 Akim Demaille <akim@epita.fr>
7457 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7458 to avoid confusions with lalr1.cc's notion of Position.
7459 Suggested by Paul Eggert.
7461 2003-02-20 Akim Demaille <akim@epita.fr>
7463 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7464 before initial_columns.
7465 (location.hh): Use consistent variable names when defining the
7467 Use "last" so that we subtract from Positions, not from unsigned.
7469 2003-02-20 Akim Demaille <akim@epita.fr>
7471 * data/lalr1.cc (position.hh): New subfile, including the extended
7472 and Doxygen'ed documentation of class Position.
7473 (location.hh): Use it.
7474 Document a` la Doxygen.
7475 With the help of Benoit Perrot.
7477 2003-02-20 Akim Demaille <akim@epita.fr>
7479 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7481 Redefine AT_YYERROR_SEES_LOC_IF using it.
7482 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7484 Don't use the location in yy::Parser::error_ and
7485 yy::Parser::print_ when not %locations.
7486 Activate more lalr1.cc tests.
7488 2003-02-19 Akim Demaille <akim@epita.fr>
7490 * data/lalr1.cc: When displaying a line number, be sure to make it
7493 2003-02-19 Akim Demaille <akim@epita.fr>
7495 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7497 (YYABORT, YYACCEPT, YYERROR): New.
7498 * tests/calc.at: Renable the lalr1.cc test.
7500 2003-02-19 Akim Demaille <akim@epita.fr>
7502 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7503 error recovery, mixing with/without pops and discarding of the
7506 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7508 2003-02-17 Paul Eggert <eggert@twinsun.com>
7510 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7511 * tests/testsuite.at (AT_COMPILE): Use them.
7512 This fixes the testsuite problem reported by Robert Lentz in
7513 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
7515 2003-02-12 Paul Eggert <eggert@twinsun.com>
7517 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7518 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
7519 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
7520 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7521 Check for malloc failure, for consistency with yacc.c.
7522 (yytname_size): Remove, for consistency with yacc.c.
7524 The bug still remains in data/lalr1.cc, as I didn't have time
7527 2003-02-06 Akim Demaille <akim@epita.fr>
7529 * configure.ac (GXX): Rename as...
7530 (CXX): this, to keep the original Autoconf semantics.
7532 * data/lalr1.cc: Fix b4_copyright invocations.
7533 If YYDEBUG is not defined, don't depend upon name_ being defined.
7534 (location.hh): Include string and iostream.
7535 (Position::filename): New member.
7536 (Position::Position ()): New.
7537 (operator<< (Position)): New.
7538 (operator- (Position, int)): New.
7539 (Location::first, Location::last): Rename as...
7540 (Location::begin, Location::end): these, to mock the conventional
7542 (operator<< (Location)): New.
7543 * tests/atlocal.in (CXX): New.
7544 * tests/testsuite.at (AT_COMPILE_CXX): New.
7545 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7546 locations in a more synthetic way.
7547 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7549 Adjust the C locations to match those from Emacs: first column is
7551 Change all the expected results.
7552 Conform to the GCS: simplify the locations when applicable.
7553 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7554 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7555 these CPP macros with the m4 macros new defined by...
7556 (AT_CHECK_PUSHDEFS): this, i.e.:
7557 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
7558 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7560 (AT_CHECK_POPDEFS): Undefine them.
7561 (AT_CHECK_CALC_LALR1_CC): New.
7562 Use it for the first lalr1.cc test.
7564 2003-02-04 Akim Demaille <akim@epita.fr>
7566 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7567 Location as is defined.
7569 2003-02-04 Akim Demaille <akim@epita.fr>
7571 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7572 name_ being defined.
7574 2003-02-03 Paul Eggert <eggert@twinsun.com>
7576 * src/gram.h (start_symbol): Remove unused decl.
7578 Use more-consistent naming conventions for local vars.
7580 * src/derives.c (derives_compute): Change type of local var from
7582 * src/gram.c (grammar_rules_partial_print): Likewise.
7583 * src/print.c (print_core): Likewise.
7584 * src/reduce.c (reduce_grammar_tables): Likewise.
7586 * src/gram.c (grammar_dump): Change name of item_number *
7587 local var from r to rp.
7588 * src/nullable.c (nullable_compute): Likewise.
7590 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7592 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7593 for symbol or symbol_number var.
7594 * src/reader.c (grammar_start_symbol_set): Likewise.
7595 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7597 * src/state.c (transitions_to): Likewise.
7598 * src/state.h: Likewise.
7599 * src/tables.c (symbol_number_to_vector_number): Likewise.
7601 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7604 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7607 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7610 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7611 Use str, not s, for char * var. Use ch, not c, for character var.
7612 Use size for size var.
7614 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7616 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7618 * src/uniqstr.h: Likewise.
7620 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7621 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7622 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7623 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7624 param to have same name as that of enum, so that we don't use
7625 "s" to stand for a non-state.
7627 2003-02-02 Akim Demaille <akim@epita.fr>
7629 * src/scan-skel.l: Scan more than one inert character per yylex
7632 2003-02-01 Paul Eggert <eggert@twinsun.com>
7636 * po/LINGUAS: Add ms.
7638 2003-01-30 Akim Demaille <akim@epita.fr>
7640 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7642 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7644 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7647 Changes in response to error report by S. Eken: GLR mode does not
7648 handle negative $ indices or $ indices in embedded rules correctly.
7649 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
7651 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7652 (b4_rhs_location): Ditto.
7653 (yyfill): New function to copy from stack tree into array
7655 (yyuserAction): Modify to allow incremental move of semantic values
7656 to rhs array when in GLR mode.
7657 Define YYFILL to use in user-defined actions to fill semantic array
7659 Remove dummy use of yystack, as there is now a guaranteed use.
7660 (yydoAction): Modify to allow incremental move of semantic values
7661 to rhs array when in GLR mode.
7662 (yyresolveAction): Ditto.
7663 (yyglrShiftDefer): Update comment.
7664 (yyresolveStates): Use X == NULL for pointers, not !X.
7665 (yyglrReduce): Ditto.
7668 * tests/glr-regr1.at: Rename to ...
7669 * tests/glr-regression.at: Add new regression test for the problems
7670 described above (adapted from S. Eken).
7671 Update copyright notice.
7672 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7673 * tests/Makefile.am: Ditto.
7675 2003-01-28 Paul Eggert <eggert@twinsun.com>
7677 * data/lalr1.cc: Do not use @output_header_name@ unless
7678 b4_defines_flag is set. This fixes two bugs reported by
7680 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7681 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
7683 2003-01-21 Paul Eggert <eggert@twinsun.com>
7685 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7686 we don't need to worry about yyerrlab1 being reported as an
7687 "unused label" by non-GCC C compilers. The downside is that if
7688 locations are used then a couple of statements are duplicated each
7689 time YYERROR is invoked, but the upside is that the warnings
7691 (yyerrlab1): Move code to YERROR.
7692 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7693 This reverts some of the 2002-12-27 change.
7695 2003-01-17 Paul Eggert <eggert@twinsun.com>
7697 * src/output.c (symbol_printers_output): Fix typo that led
7698 to core dump. Problem reported by Antonio Rus in
7699 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
7701 2003-01-13 Akim Demaille <akim@epita.fr>,
7702 Quoc Peyrot <chojin@lrde.epita.fr>,
7703 Robert Anisko <anisko_r@lrde.epita.fr>
7705 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7706 when the stacks contain one element, as the loop would otherwise
7707 free the last state, and then use the top state (the one we just
7708 popped). This means that the initial elements will not be freed
7709 explicitly, as is the case in yacc.c; it is not a problem, as
7710 these elements have fake values.
7712 2003-01-11 Paul Eggert <eggert@twinsun.com>
7714 * NEWS: %expect-violations are now just warnings, reverting
7715 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7716 bootstrapping problem reported by Matthias Klose; see
7717 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
7718 * src/conflicts.c (conflicts_print): Likewise.
7719 * tests/conflicts.at (%expect not enough, %expect too much,
7720 %expect with reduce conflicts): Likewise.
7721 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7722 that the warning is enabled if the number of conflicts changes
7723 (not necessarily increases).
7725 * src/getargs.c (version): Update copyright year.
7727 2003-01-09 Akim Demaille <akim@epita.fr>
7729 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7731 2003-01-08 Paul Eggert <eggert@twinsun.com>
7733 * Makefile.maint (WGETFLAGS):
7734 New macro, containing "-C off" to disable proxy caches.
7735 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7736 (rel-check): Use $(WGET) instead of wget.
7738 2003-01-06 Paul Eggert <eggert@twinsun.com>
7740 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7741 the GLR paper of Scott, Johnstone and Hussain.
7743 2003-01-04 Paul Eggert <eggert@twinsun.com>
7745 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7746 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7747 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7748 (EXTRA_LIBRARIES): New var, for liby.a.
7749 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7750 (EXTRA_SCRIPTS): New var, for yacc.
7752 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7753 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7754 Problem reported by Nelson H. F. Beebe.
7756 2003-01-03 Paul Eggert <eggert@twinsun.com>
7758 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7759 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7760 when compiling Bison 1.875's `bitset bset = obstack_alloc
7761 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7763 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7764 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7765 grow to a huge size with typical invocation.
7767 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7768 Use the pattern recommended by Autoconf 2.57, except also protect
7769 against double-definition.
7770 * src/system.h: Likewise.
7771 Portability issues reported by Nelson H. F. Beebe.
7773 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7774 All uses changed. Provide a definition in both C and C++.
7775 (yytrue, yyfalse): Define even if defined (__cplusplus).
7777 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7778 Reported by Nelson H. F. Beebe.
7780 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7782 2003-01-02 Paul Eggert <eggert@twinsun.com>
7784 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7785 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7786 Bug reported by Nelson H. F. Beebe.
7788 2003-01-01 Paul Eggert <eggert@twinsun.com>
7792 2002-12-30 Paul Eggert <eggert@twinsun.com>
7794 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7796 (<INITIAL>","): Here. This causes stray "," to be treated
7799 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
7800 last brace in braced code when not in Yacc mode, for compatibility
7801 with Bison 1.35. This resurrects the 2001-12-15 patch to
7804 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7805 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7807 2002-12-28 Paul Eggert <eggert@twinsun.com>
7809 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7810 that of SYM's type. This fixes Debian bug 168069, reported by
7813 2002-12-28 Paul Eggert <eggert@twinsun.com>
7817 Switch back to the Yacc style of conflict reports, undoing some
7818 of the 2002-07-30 change.
7819 * doc/bison.texinfo (Understanding): Use Yacc style for
7820 conflict reports. Also, use new way of locating rules.
7821 * src/conflicts.c (conflict_report):
7822 Renamed from conflict_report_yacc, removing the old
7823 'conflict_report'. Translate the entire conflict report at once,
7824 so that we don't assume that "," has the same interpretation in
7826 (conflicts_output): Use Yacc-style conflict report for each state,
7827 instead of our more-complicated style.
7828 (conflicts_print): Use Yacc-style conflict report, except print
7829 the input file name when not emulating Yacc.
7830 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7831 Conflicted Reduction, %expect not enough, %expect too much,
7832 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7833 * tests/existing.at (GNU Cim Grammar): Likewise.
7834 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7836 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7837 fatal): Don't invoke fflush; it's not needed and it might even be
7838 harmful for stdout, as stdout might not be open.
7839 * src/reduce.c (reduce_print): Likewise.
7841 2002-12-27 Paul Eggert <eggert@twinsun.com>
7843 Fix a bug where error locations were not being recorded correctly.
7844 This problem was originally reported by Paul Hilfinger in
7845 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
7847 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7848 top of the location stack's error locations.
7849 (yyerrlab): Set it. When discarding a token, push its location
7850 onto yylerrsp so that we don't lose track of the error's end.
7851 (yyerrlab1): Now is only the target of YYERROR, so that we can
7852 properly record the location of the action that failed. For GCC
7853 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7854 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7855 (yyerrlab2): New label, which yyerrlab now falls through to.
7856 Compute the error's location by applying YYLLOC_DEFAULT to
7857 the locations of all the symbols that went into the error.
7858 * doc/bison.texinfo (Location Default Action): Mention that
7859 YYLLOC_DEFAULT is also invoked for syntax errors.
7860 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7861 Error locations include the locations of all the tokens that were
7862 discarded, not just the last token.
7864 2002-12-26 Paul Eggert <eggert@twinsun.com>
7866 * src/files.c: Include quote.h.
7867 (compute_output_file_names): Warn if we detect conflicting
7868 outputs to the same file. This should catch the misunderstanding
7869 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7871 * src/conflicts.c (conflicts_print): If the user specifies
7872 "%expect N", report an error if there are any reduce/reduce
7873 conflicts. This is what the manual says should happen.
7874 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7875 * tests/conflicts.at (%expect with reduce conflicts): New test.
7877 Don't use m4_include on relative file names, as it doesn't work as
7878 desired if there happens to be a file with that name under ".".
7880 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7881 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7882 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7883 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7884 * src/output.c (output_skeleton): Use full path names when
7885 specifying a file to include; don't rely on include path, as
7886 it's unreliable when the working file contains a file with
7889 2002-12-25 Paul Eggert <eggert@twinsun.com>
7891 Remove obsolete references to bison.simple and bison.hairy.
7892 Problem mentioned by Aubin Mahe in
7893 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
7894 * data/glr.c: Comment fix.
7895 * doc/bison.1: Remove references. Also, mention "yacc".
7897 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7900 * src/parse-gram.y (declaration): Use enum "report_states" rather
7901 than its numeric value 1.
7903 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7904 opening a new one. This fixes Debian bug 165349, reported by
7907 2002-12-24 Paul Eggert <eggert@twinsun.com>
7911 * Makefile.maint (cvs-update): Don't assume that the shell
7912 supports $(...), as Solaris sh doesn't.
7914 * src/parse-gram.y (lloc_default): Remove test for empty
7915 nonterminals at the end, since it didn't change the result.
7917 2002-12-24 Paul Eggert <eggert@twinsun.com>
7919 If the user does not define YYSTYPE as a macro, Bison now declares it
7920 using typedef instead of defining it as a macro. POSIX requires this.
7921 For consistency, YYLTYPE is also declared instead of defined.
7923 %union directives can now have a tag before the `{', e.g., the
7924 directive `%union foo {...}' now generates the C code
7925 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7926 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7927 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7928 instead of `yyltype'.
7930 `yystype' and `yyltype' are now obsolescent macros instead of being
7931 typedefs or tags; they are no longer documented and will be
7932 withdrawn in a future release.
7934 * data/glr.c (b4_location_type): Remove.
7935 (YYSTYPE): Renamed from yystype.
7936 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7937 (struct YYLTYPE): Renamed from struct yyltype.
7938 (YYLTYPE): Renamed from yyltype.
7939 (yyltype, yystype): New (and obsolescent) macros,
7940 for backward compatibility.
7941 * data/yacc.c: Likewise.
7943 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7944 does not specify a union tag. This is for compatibility with
7947 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7948 const *, since it is now modified by stripping surrounding { }.
7949 (current_braced_code): Remove.
7950 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7951 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7952 trailing " {...}". Now of type <chars>.
7953 (grammar_declaration): Adjust to bundled tokens.
7954 (code_content): Remove; stripping is now done by add_param.
7955 (print_token_value): Print contents of bundled tokens.
7956 (token_name): New function.
7958 * src/reader.h (braced_code, current_braced_code): Remove.
7959 (token_name): New decl.
7961 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
7962 token_type, not braced_code code_kind. All uses changed.
7963 (SC_PRE_CODE): New state, for scanning after a keyword that
7964 has (or usually has) an immediately-following braced code.
7965 (token_type): New local var, to keep track of which token type
7966 to return when scanning braced code.
7967 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
7968 <INITIAL>"%parse-param", <INITIAL>"%printer",
7969 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
7970 instead of returning a token type immediately.
7971 (<INITIAL>"{"): Set token type.
7972 (<SC_BRACED_CODE>"}"): Use it.
7973 (handle_action_dollar, handle_action_at): Now returns bool
7974 indicating success. Fail if ! current_rule; this prevents a core dump.
7975 (handle_symbol_code_dollar, handle_symbol_code_at):
7976 Remove; merge body into caller.
7977 (handle_dollar, handle_at): Complain in invalid contexts.
7979 * NEWS, doc/bison.texinfo: Document the above.
7980 * NEWS: Fix years and program names in copyright notice.
7982 2002-12-17 Paul Eggert <eggert@twinsun.com>
7984 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
7985 Reporting, Table of Symbols): Omit mentions of %lex-param and
7986 %parse-param from the documentation for now.
7988 2002-12-15 Paul Eggert <eggert@twinsun.com>
7990 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
7991 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
7992 lookahead symbol, and which sets yychar in parser actions) and it
7993 disagreed with the Bison documentation. Bug
7994 reported by Andrew Walrond.
7996 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
7997 as the caller now does that.
7998 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
7999 (YYEMPTY): Parenthesize right hand side, since others use it.
8000 (yyparse): Don't assume that our generated code is the only code
8003 2002-12-13 Paul Eggert <eggert@twinsun.com>
8007 POSIX requires a "yacc" command.
8008 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
8009 (MOSTLYCLEANFILES): Add yacc.
8011 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
8012 as an alias for bison y.
8014 * po/LINGUAS: Add da.
8016 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
8017 problem with latest <getopt.h>.
8018 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
8020 * doc/fdl.texi: Upgrade to 1.2.
8021 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
8022 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
8023 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
8025 * config/install-sh: Sync with autotools.
8027 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
8028 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8029 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
8030 locations are requested.
8031 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
8032 locations are requested.
8034 2002-12-12 Paul Eggert <eggert@twinsun.com>
8036 Remove unportable casts and storage allocation tricks.
8037 While we're at it, remove almost all casts, since they
8038 usually aren't needed and are a sign of trouble.
8040 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
8042 * src/derives.c (derives_compute): Do not subtract NTOKENS from
8043 the pointer DSET returned by malloc; this isn't portable.
8044 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
8045 Similarly for DERIVES.
8046 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
8047 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
8048 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
8050 * src/derives.c (derives_compute): Do not bother invoking
8051 int_of_rule_number, since rule numbers are integers.
8053 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
8054 rather than XMALLOC (char, N).
8056 * src/files.c (filename_split): Rewrite to avoid cast.
8058 * src/gram.h (symbol_number_as_item_number,
8059 item_number_as_symbol_number, rule_number_as_item_number,
8060 item_number_as_rule_number):
8061 Now inline functions rather than macros, to avoid casts.
8062 * src/state.h (state_number_as_int): Likewise.
8063 * src/tables.c (state_number_to_vector_number,
8064 symbol_number_to_vector_number): Likewise.
8066 * src/gram.h (int_of_rule_number): Remove; no longer used.
8068 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
8069 since the resulting storage is always stored into.
8071 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
8074 * src/muscle_tab.c (muscle_m4_output):
8075 Now inline. Return bool, not int.
8076 * src/state.c (state_compare): Likewise.
8077 * src/symtab.c (symbol_check_defined,
8078 symbol_check_alias_consistency, symbol_pack, symbol_translation,
8079 hash_compare_symbol, hash_symbol):
8081 * src/uniqstr.c (uniqstr_print): Likewise.
8082 * src/muscle_tab.c (muscle_m4_output_processor):
8083 New function, to avoid casts.
8084 * src/state.c (state_comparator, stage_hasher): Likewise.
8085 * src/symtab.c (symbol_check_defined_processor,
8086 symbol_check_alias_consistency_processor, symbol_pack_processor,
8087 symbol_translation_processor, hash_symbol_comparator,
8088 hash_symbol_hasher): Likewise.
8089 * src/uniqstr.c (uniqstr_print_processor): Likewise.
8090 * src/muscle_tab.c (muscles_m4_output):
8091 Use new functions instead of casting old functions unportably.
8092 * src/state.c (state_hash_new): Likewise.
8093 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
8094 symbols_token_translations_init):
8096 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
8098 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
8099 var instead of casting to long, to avoid casts.
8100 (prepare_states): Use MALLOC rather than alloca, so that we don't
8101 have to worry about alloca.
8102 * src/state.c (state_hash_lookup): Likewise.
8104 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
8105 local var instead of casting to unsigned char, to avoid casts.
8107 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
8108 STATE_ALLOC): Remove.
8109 (transitions_new, errs_new, reductions_new, state_new): Use malloc
8110 rather than calloc, and use offsetof to avoid allocating slightly
8112 (state_new): Initialize all members.
8114 * src/state.c (state_hash): Use unsigned accumulator, not signed.
8116 * src/symtab.c (symbol_free): Remove; unused.
8117 (symbol_get): Remove cast in lhs of assignment.
8118 (symbols_do): Now static. Accept generic arguments, not
8119 hashing-related ones.
8121 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
8122 (symbol_processor): Remove.
8123 (symbols_do): Remove decl; now static.
8125 * src/system.h (alloca): Remove; decl no longer needed.
8126 (<stddef.h>): Include, for offsetof.
8127 (<inttypes.>, <stdint.h>): Include if available.
8128 (uintptr_t): New type, if system lacks it.
8129 (CALLOC, MALLOC, REALLOC): New macros.
8130 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
8133 * src/tables.c (table_size): Now int, to pacify GCC.
8134 (table_grow, table_ninf_remap): Use signed table size.
8135 (save_row): Don't bother initializing locals when not needed.
8136 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
8137 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
8139 * src/vcg.h: Correct misspellings.
8141 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
8144 * src/getargs.c (getargs): Don't assume EOF == -1.
8146 2002-12-09 Paul Eggert <eggert@twinsun.com>
8148 Change identifier spellings to avoid collisions with names
8149 that are reserved by POSIX.
8151 Don't use names ending in _t, since POSIX reserves them.
8152 For consistency, remove _e and _s endings -- they're weren't
8153 needed to remove ambiguity. All uses changed.
8154 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
8155 turn was just renamed from struniq_t.
8156 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
8157 which in turn was just renamed from struniq_processor_t.
8158 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
8159 in turn was renamed from hash_compare_struniq_t.
8160 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
8161 (state_list): Renamed from state_list_t.
8162 * src/assoc.h (assoc): Renamed from assoc_t.
8163 * src/conflicts.c (enum conflict_resolution): Renamed from
8164 enum conflict_resolution_e.
8165 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
8166 (rule_list): Renamed from rule_list_t.
8167 * src/getargs.h (enum trace): Renamed from enum trace_e.
8168 (enum report): Renamed from enum report_e.
8169 * src/gram.h (item_number): Renamed from item_number_t.
8170 (rule_number): Renamed from rule_number_t.
8171 (struct rule_s): Remove the "rule_s" part; not used.
8172 (rule): Renamed from rule_t.
8173 (rule_filter): Renamed from rule_filter_t.
8174 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
8175 (goto_list): Renamed from goto_list_t.
8176 * src/lalr.h (goto_number): Renamed from goto_number_t.
8177 * src/location.h (location): Renamed from location_t.
8178 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
8179 and moved here from:
8180 * src/muscle_tab.h (muscle_entry_t): here.
8181 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
8182 (rule_list): Renamed from rule_list_t.
8183 * src/print_graph.c (static_graph): Renamed from graph.
8184 * src/reader.h (braced_code): Renamed from braced_code_t.
8185 Remove brace_code_e tag.
8186 * src/relation.h (relation_node): Renamed from relation_node_t.
8187 (relation_nodes): Renamed from relation_nodes_t.
8188 (relation): Renamed from relation_t.
8189 * src/state.h (state_number): Renamed from state_number_t.
8190 (struct state): Renamed from struct state_s.
8191 (state): Renamed from state_t.
8192 (transitions): Renamed from transitions_t. Unused (and
8193 misspelled) transtion_s tag removed.
8194 (errs): Renamed from errs_t. Unused errs_s tag removed.
8195 (reductions): Renamed from reductions_t. Unused tag
8196 reductions_s removed.
8197 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
8198 (struct symbol_list): Renamed from struct symbol_list_s.
8199 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
8200 (struct symbol): Renamed from struct symbol_s.
8201 (symbol): Renamed from symbol_t.
8202 * src/tables.c (vector_number): Renamed from vector_number_t.
8203 (action_number): Renamed from action_t.
8204 * src/tables.h (base_number): Renamed from base_t.
8205 * src/vcg.h (enum color): Renamed from enum color_e.
8206 (enum textmode): Renamed from enum textmode_e.
8207 (enum shape): Renamed from enum shape_e.
8208 (struct colorentry): Renamed from struct colorentry_s.
8209 (struct classname): Renamed from struct classname_s.
8210 (struct infoname): Renamed from struct infoname_s.
8211 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
8212 (enum decision): Renamed from enum decision_e.
8213 (enum orientation): Renamed from enum orientation_e.
8214 (enum alignment): Renamed from enum alignment_e.
8215 (enum arrow_mode): Renamed from enum arrow_mode_e.
8216 (enum crossing_type): Renamed from enum crossing_type_e.
8217 (enum view): Renamed from enum view_e.
8218 (struct node): Renamed from struct node_s.
8219 (node): Renamed from node_t.
8220 (enum linestyle): Renamed from enum linestyle_e.
8221 (enum arrowstyle): Renamed from enum arrowstyle_e.
8222 (struct edge): Renamed from struct edge.
8223 (edge): Renamed from edge_t.
8224 (struct graph): Renamed from struct graph_s.
8225 (graph): Renamed from graph_t.
8226 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
8227 Rename value_t -> value.
8228 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
8229 value_t_as_yystype -> value_as_yystype.
8231 Don't include <errno.h> in the mainstream code, since it
8232 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
8233 * lib/get-errno.c, lib/get-errno.h: New files.
8234 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
8236 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
8237 * src/output.c (output_skeleton): Likewise.
8238 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
8240 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
8242 (handle_action_dollar, handle_action_at): Likewise.
8243 * src/system.h: Do not include <errno.h>.
8244 (TAB_EXT): Renamed from EXT_TAB.
8245 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
8247 Avoid str[a-z]*, since <string.h> reserves that name space.
8248 Change all instances of "struniq" in names to "uniqstr", and
8249 likewise for "STRUNIQ" and "UNIQSTR".
8250 * src/uniqstr.c: Renamed from src/struniq.c.
8251 * src/uniqstr.h: Renamed from src/struniq.h.
8252 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
8253 * src/files.c (strsuffix): Remove; unused.
8254 (concat2): Renamed from stringappend. Now static.
8255 * src/files.h (strsuffix, stringappend): Remove; unused.
8256 * src/parse-gram.y (<chars>): Renamed from <string>.
8257 (<uniqstr>): Renamed from <struniq>.
8258 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
8259 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
8260 (struct graph_s.expand): Renamed from struct graph_s.stretch.
8261 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
8262 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
8263 (N_EXPAND): Renamed from N_STRETCH.
8265 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
8266 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
8267 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
8269 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
8270 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
8271 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
8272 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
8273 (BASE_MAXIMUM): Renamed from BASE_MAX.
8274 (BASE_MINIMUM): Renamed from BASE_MIN.
8275 (ACTION_MAX): Remove; unused.
8276 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
8277 Unnecessary casts removed from above defines.
8280 Fix misspelling in names.
8281 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
8282 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
8286 * lib/timevar.c (timevar_report): Renamed from time_report,
8287 for consistency with other names.
8288 * lib/timevar.h (timevar_report): New decl.
8289 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
8292 Sort include-file uses.
8294 Reorder all include files under src to be in the order "system.h".
8295 then the ../lib include files in angle brackets (alphabetized),
8296 then the . include files in double-quotes (alphabetized). Fix
8297 dependency breakages encountered in this process, as follows:
8298 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
8299 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
8300 * src/state.h: Include "symtab.h".
8302 2002-12-08 Paul Eggert <eggert@twinsun.com>
8304 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
8305 since this causes problems when __file__ contains character
8306 sequences like "@" that are treated specially by src/scan-skel.l.
8307 Instead, just use the file's basename. This fixes the bug
8308 reported by Martin Mokrejs in
8309 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
8311 2002-12-06 Paul Eggert <eggert@twinsun.com>
8313 Add support for rules that do not have trailing semicolons, as
8314 POSIX requires. Improve the quality of locations in Bison
8317 * src/location.c: Include <quotearg.h>.
8318 (empty_location): Now const.
8319 (location_print): New function. Follow the recommendation of the
8320 GNU Coding Standards for locations that span file boundaries.
8321 * src/location.h: Do not include <quotearg.h>; no longer needed.
8322 (boundary): New type.
8323 (location_t): Use it. This allows locations to span file boundaries.
8324 All member uses changed: file -> start.file or end.file (as needed),
8325 first_line -> start.line, first_column -> start.column,
8326 last_line -> end.line, last_column -> end.column.
8327 (equal_boundaries): New function.
8328 (LOCATION_RESET, LOCATION_STEP): Remove.
8329 (LOCATION_PRINT): Remove. All callers changed to use location_print.
8330 (empty_location): Now const.
8331 (location_print): New decl.
8332 * src/parse-gram.y (lloc_default): New function, which handles
8333 empty locations more accurately.
8334 (YYLLOC_DEFAULT): Use it.
8335 (%token COLON): Remove.
8336 (%token ID_COLON): New token.
8338 (declarations, rules): Remove trailing semicolon.
8339 (declaration, rules_or_grammar_declaration):
8340 Allow empty (";") declaration.
8341 (symbol_def): Remove empty actions; no longer needed.
8342 (rules_or_grammar_declaration): Remove trailing semicolon.
8343 (semi_colon.opt): Remove.
8344 * src/reader.h: Include location.h.
8345 (scanner_cursor): New decl.
8346 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
8348 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
8350 (STEP): Remove. No longer needed, now that adjust_location does
8351 the work. All uses removed.
8352 (scanner_cursor): New var.
8353 (adjust_location): Renamed from extend_location. It now sets
8354 *loc and adjusts the scanner cursor. All uses changed.
8355 Don't bother testing for CR.
8356 (handle_syncline): Remove location arg; now updates scanner cursor.
8357 All callers changed.
8358 (unexpected_end_of_file): Now accepts start boundary of token or
8359 comment, not location. All callers changed. Update scanner cursor,
8361 (SC_AFTER_IDENTIFIER): New state.
8362 (context_state): Renamed from c_context. All uses changed.
8363 (id_loc, code_start, token_start): New local vars.
8364 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
8365 processing of Yacc white space and equivalents here.
8366 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
8367 instead of returning ID immediately, since we need to search for
8369 (<INITIAL>"'", "\""): Save token_start.
8370 (<INITIAL>"%{", "{", "%%"): Save code_start.
8371 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
8372 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
8373 BEGIN context_state at end, not INITIAL.
8374 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
8375 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
8376 Return correct token start.
8377 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
8378 the start of a character, string or multiline comment is found.
8379 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
8380 Reduction): Adjust reported locations to match the more-precise
8381 results now expected.
8382 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
8383 * tests/reduce.at (Useless Rules, Reduced Automaton,
8384 Underivable Rules): Likewise.
8385 * tests/regression.at (Invalid inputs): No longer `expecting ";"
8386 or "|"' now that so many other tokens are allowed by the new grammar.
8388 * src/complain.h (current_file): Remove duplicate decl;
8389 current_file is now owned by files.h.
8390 * src/complain.c, src/scan-gram.l: Include files.h.
8392 2002-12-06 Paul Eggert <eggert@twinsun.com>
8394 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
8395 promotes to int; it might be unsigned int.
8396 * data/yacc.c (yy_reduce_print): Likewise.
8398 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
8399 be #defined in the prologue, not in the Bison declarations.
8400 This fixes Debian Bug 102878, reported by Shaul Karl.
8402 2002-12-02 Paul Eggert <eggert@twinsun.com>
8404 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
8405 * lib/strtoul.c: New file, from gnulib.
8406 This fixes a porting bug reported by Peter Klein in
8407 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
8409 2002-11-30 Paul Eggert <eggert@twinsun.com>
8411 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
8412 and put only a forward declaration in the prologue. This is for
8413 consistency with the other scanner helper functions.
8415 Type clashes now generate warnings, not errors, since it
8416 appears that POSIX may allow some grammars with type clashes.
8417 * src/reader.c (grammar_current_rule_check): Warn about
8418 type clashes instead of complaining.
8419 * tests/input.at (Type Clashes): Expect warnings, not complaints.
8421 Add Yacc library, since POSIX requires it.
8422 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
8423 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
8424 * lib/main.c, lib/yyerror.c: New files.
8426 gram_error can be static; it need not be extern.
8427 * src/reader.h (gram_error): Remove decl.
8428 * src/parse-gram.y (gram_error): Now static. Add static decl.
8429 (print_token_value): Omit parameter names from forward decl,
8432 2002-11-29 Paul Eggert <eggert@twinsun.com>
8434 * doc/bison.texinfo: Emphasize that yylex and yyerror must
8435 be declared before being used. E.g., one should typically
8436 declare them in the prologue. Use GNU coding style in examples.
8437 Put "const" consistently after the type it modifies. Mention
8438 that C99 supports "inline". Mention that yyerror traditionally
8441 %parse-param and %lex-param now take just one argument, the
8442 declaration; the argument name is deduced from the declaration.
8444 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8445 Reporting, Table of Symbols): Document this.
8446 * src/parse-gram.y (add_param): New function.
8448 (declaration): Implement new rule for %parse-param and %lex-param.
8449 * src/scan-gram.l: "," now elicits a warning, rather than being
8450 a token; this is more compatible with byacc.
8451 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8453 2002-11-27 Paul Eggert <eggert@twinsun.com>
8455 Rename identifiers to avoid real and potential collisions.
8457 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8458 to avoid collision with lex macro described by Bruce Lilly in
8459 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8460 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8461 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8462 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8464 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8465 The name "yycontrol" violates the name space rules, and this stuff
8466 wasn't being used anyway.
8467 (input): Remove action; this stuff wasn't being used.
8468 (gram_error): Rename local variable yylloc -> loc.
8469 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8470 (YY_DECL): Don't use "yy" at start of local variables.
8471 All uses changed, e.g., yylloc -> loc.
8472 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8473 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8474 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8475 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8477 * src/parse-gram.y (gram_error): loc is now const *.
8478 * src/reader.h (gram_error): Likewise.
8480 2002-11-24 Paul Eggert <eggert@twinsun.com>
8484 * tests/actions.at (Actions after errors): Use an output format
8485 more similar to that of the Printers and Destructors test.
8486 Test the position of the ';' token too.
8487 (Printers and Destructors): Likewise.
8488 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8489 unnecessarily alarming people when the test fails.
8491 * data/yacc.c (yyerrlab1): Move this label down, so that the
8492 parser does not discard the lookahead token if the user code
8493 invokes YYERROR. This change is required for POSIX conformance.
8495 * lib/error.c: Sync with gnulib.
8497 2002-11-22 Paul Eggert <eggert@twinsun.com>
8499 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8500 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8501 * lib/xmalloc.c: Likewise.
8503 2002-11-20 Paul Eggert <eggert@twinsun.com>
8505 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8507 2002-11-20 Paul Eggert <eggert@twinsun.com>
8509 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8510 should use `if (! x) abort ();' rather than `assert (x);', and
8511 anyway it's one less thing to worry about configuring.
8513 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8514 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8515 and replace all instances of assert with abort.
8516 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8517 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8519 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8520 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8521 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8522 hash_find_entry, hash_rehash, hash_insert): Likewise.
8523 * src/conflicts.c (resolve_sr_conflict): Likewise.
8524 * src/lalr.c (set_goto_map, map_goto): Likewise.
8525 * src/nullable.c (nullable_compute): Likewise.
8526 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8527 * src/reader.c (packgram, reader): Likewise.
8528 * src/state.c (state_new, state_free, state_transitions_set,
8529 state_reduction_find): Likewise.
8530 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8531 symbol_pack): Likewise.
8532 * src/tables.c (conflict_row, pack_vector): Likewise.
8533 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8534 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8535 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8536 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8538 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8539 (ARGMATCH_CONSTRAINT): New macro.
8540 (ARGMATCH_ASSERT): Use it.
8542 * src/system.h (verify): New macro.
8543 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8545 * src/tables.c (tables_generate): Likewise.
8547 * src/struniq.c (struniq_assert): Now returns void, and aborts
8548 if the assertion is false.
8549 (struniq_assert_p): Remove.
8550 * src/struniq.h: Likewise.
8552 2002-11-18 Paul Eggert <eggert@twinsun.com>
8554 * data/glr.c (yygetLRActions): Replace `yyindex' with
8555 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8556 This fixes the regression with Sun ONE Studio 7 cc that I reported in
8557 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
8559 2002-11-18 Akim Demaille <akim@epita.fr>
8561 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8563 From Tim Van Holder.
8565 2002-11-17 Paul Eggert <eggert@twinsun.com>
8567 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8568 to "SyntaxError" for consistency with my 2002-11-15 change.
8570 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8571 not define to {}, since this breaks the common use of `YYDPRINTF
8572 ((...));' if a single statement is desired (e.g. before `else').
8573 Work around GCC warnings by surrounding corresponding calls with
8575 (yyhasResolvedValue): Remove unused function.
8576 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8578 (yyreportSyntaxError): Renamed from yyreportParseError.
8579 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8581 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8582 extern when possible. Remove unused initializations.
8584 2002-11-16 Akim Demaille <akim@epita.fr>
8586 Augment the similarity between GLR and LALR traces.
8588 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8589 (YY_REDUCE_PRINT): New.
8590 (yyparse): Use them.
8591 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8593 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8594 state reached after the reduction/recovery, since...
8595 (yyparse, yyprocessOneStack): Report the state we are entering in.
8597 2002-11-16 Akim Demaille <akim@epita.fr>
8599 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8600 Add support for --trace=skeleton.
8601 * src/scan-skel.l: %option debug.
8602 Scan strings of non-@ or \n instead of character by character.
8603 (scan_skel): Handle trace_skeleton.
8605 (@output_parser_name@, @output_header_name@): ``Restore'' their
8606 support (used to be M4 macros).
8607 * data/yacc.c: Quote larger chunks, a la glr.c.
8608 * data/lalr1.cc: Likewise.
8609 The header guards are no longer available, so use some other
8610 string than `YYLSP_NEEDED'.
8612 2002-11-16 Akim Demaille <akim@epita.fr>
8614 Make the ``Printers and Destructors'' test more verbose, taking
8615 `yacc.c''s behavior as (possibly wrong) reference.
8617 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8618 instead of fprint on stdout.
8619 Set and report the last_line of the symbols.
8620 Consistently display values and locations.
8622 2002-11-16 Paul Eggert <eggert@twinsun.com>
8624 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8626 2002-11-15 Paul Eggert <eggert@twinsun.com>
8628 * tests/actions.at (Actions after errors): New test case.
8630 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8631 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8632 tests/action.at, tests/calc.at, tests/conflicts.at,
8633 tests/cxx-type.at, tests/regression.at:
8634 "parse error" -> "syntax error" for POSIX compatibility.
8635 "parsing stack overflow..." -> "parser stack overflow" so
8636 that code matches Bison documentation.
8638 2002-11-15 Akim Demaille <akim@epita.fr>
8640 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8641 take two BRACED_CODE, not two string_content.
8642 Free the scanner's obstack when we are done.
8643 (code_content): New.
8644 * tests/calc.at: Adjust.
8645 * doc/bison.texinfo: Adjust.
8646 Also, make sure to include the `,' for these declarations.
8648 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8650 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8651 definition; avoids potential autoreconf problems.
8653 2002-11-15 Akim Demaille <akim@epita.fr>
8655 Always check the value returned by yyparse.
8657 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8658 returned by yyparse.
8659 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8661 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8662 returned by yyparse.
8664 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8666 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8669 2002-11-14 Paul Eggert <eggert@twinsun.com>
8671 * src/output.c (output_skeleton): Call xfopen instead of
8672 duplicating xfopen's body.
8674 Fix bugs reported by Nelson H. F. Beebe in
8675 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
8677 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8678 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8679 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8680 file twice in the grammar, as an extra check.
8682 * tests/input.at (Torturing the Scanner): Surround the
8683 backslash-newline tests with "#if 0", to make it less likely that
8684 we'll run into compiler bugs. Bring back solitary \ inside
8685 comment, but add a closing comment to work around HP C bug. Don't
8686 test backslash-newline in C character constant.
8688 2002-11-14 Akim Demaille <akim@epita.fr>
8690 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8691 status of the compiler.
8692 Calling `exit 1' is no longer needed.
8693 Reported by Nelson H. F. Beebe.
8695 2002-11-14 Akim Demaille <akim@epita.fr>
8697 * tests/atlocal.in (CPPFLAGS): We have config.h.
8698 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8700 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8701 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8702 * tests/regression.at, tests/torture.at: Use them for all the
8703 grammars that are to be compiled.
8704 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8705 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8706 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8708 2002-11-14 Akim Demaille <akim@epita.fr>
8710 * doc/bison.texinfo: Various formatting changes (alignments in
8711 samples, additional @group/@end group, GCS in samples.
8712 Use @deffn instead of simple @table to define the directives,
8713 macros, variables etc.
8715 2002-11-13 Paul Eggert <eggert@twinsun.com>
8717 Fix some bugs reported by Albert Chin-A-Young in
8718 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
8720 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8721 -o c"; the HP C compiler chatters during compilation.
8722 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8723 * tests/headers.at (export YYLTYPE): Likewise.
8725 * tests/input.at (Torturing the Scanner): Remove lines containing
8726 solitary backslashes, as they tickle a bug in the HP C compiler.
8728 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8729 comments, since they're not portable. Use GNU coding style.
8731 2002-11-13 Akim Demaille <akim@epita.fr>
8733 * data/yacc.c: Leave bigger chunks of quoted text.
8734 (YYDSYMPRINTF): New.
8735 Use it to report symbol activities.
8736 * data/glr.c (YYDSYMPRINTF): New.
8739 2002-11-12 Paul Eggert <eggert@twinsun.com>
8743 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8744 (yyglrReduce): Return yyok, not 0.
8745 This should avoid the enumerated-type warnings reported
8746 by Nelson H. F. Beebe in
8747 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
8749 * lib/bbitset.h (BITSET_INLINE): Remove.
8750 * lib/bitset.h [! BITSET_INLINE]: Remove.
8751 (bitset_set, bitset_reset, bitset_test): Rename local vars
8752 to avoid shadowing warnings by GCC.
8754 * data/glr.c (inline): Remove #define. It's the user's
8755 responsibility to #define it away, just like 'const'.
8756 This fixes one of the bugs reported by Nelson H. F. Beebe in
8757 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
8759 * Makefile.maint (po-check): Scan .l and .y files instead of the
8760 .c and the .h files that they generate. This fixes the bug
8761 reported by Tim Van Holder in:
8762 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
8763 Look for N_ as well as for _. Try to avoid matching #define for
8765 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8766 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8767 * src/scan-gram.l: Revamp regular expressions so that " and '
8768 do not confuse xgettext.
8770 * src/struniq.h (struniq_new): Do not declare the return type
8771 to be 'const'; this violates the C standard.
8772 * src/struniq.c (struniq_new): Likewise.
8774 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8776 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8777 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8780 2002-11-12 Akim Demaille <akim@epita.fr>
8782 * Makefile.maint: Sync with Autoconf:
8783 (local_updates): New.
8785 2002-11-12 Akim Demaille <akim@epita.fr>
8787 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8789 2002-11-12 Akim Demaille <akim@epita.fr>
8791 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8794 2002-11-12 Akim Demaille <akim@epita.fr>
8796 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8799 2002-11-12 Akim Demaille <akim@epita.fr>
8801 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8802 Use it to test the GLR parser.
8804 2002-11-12 Akim Demaille <akim@epita.fr>
8806 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8808 * data/glr.c (yystos): New.
8809 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8811 (yyval): Don't define it, it is handled via M4.
8812 (yyrecoverParseError): Free verbosely the discarded symbols.
8813 * data/yacc.c (yysymprint): Remove, rather...
8814 (b4_yysymprint_generate): invoke.
8815 * data/c.m4 (b4_yysymprint_generate): New.
8816 Accept pointers as arguments, as opposed to the version from
8818 (b4_yydestruct_generate): Likewise.
8819 * tests/cations.at (Printers and Destructors): Use Bison directives
8820 instead of CPP macros.
8821 Don't rely on internal details.
8823 2002-11-12 Akim Demaille <akim@epita.fr>
8825 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8826 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8827 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8828 it against YYEMPTY and so forth), work on yytoken (i.e., set
8829 it to YYEMPTY etc.).
8830 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8831 (b4_symbol_actions): Remove.
8832 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8833 for 0, end-of-input.
8835 2002-11-12 Akim Demaille <akim@epita.fr>
8837 * doc/bison.texinfo (Destructor Decl): New.
8839 2002-11-12 Akim Demaille <akim@epita.fr>
8841 * src/tables.c (tables_generate): Use free for pointers that
8842 cannot be NULL, not XFREE.
8843 (pack_vector): Use assert, not fatal, for bound violations.
8844 * src/state.c (state_new): Likewise.
8845 * src/reader.c (reader): Likewise.
8846 * src/lalr.c (set_goto_map): Likewise.
8847 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
8850 2002-11-12 Akim Demaille <akim@epita.fr>
8852 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8854 * src/scan-gram.l (last_string): Is global to the file, not to
8856 * src/parse-gram.y (input): Don't append the epilogue here,
8857 (epilogue.opt): do it here, and free the scanner's obstack.
8858 * src/reader.c (epilogue_set): Rename as...
8859 (epilogue_augment): this.
8860 * data/c.m4 (b4_epilogue): Defaults to empty.
8862 2002-11-12 Akim Demaille <akim@epita.fr>
8864 * src/getargs.c (long_options): Remove duplicates.
8865 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8867 * doc/bison.rnh: Remove.
8868 * doc/bison.texinfo (VMS Invocation): Remove.
8870 2002-11-12 Akim Demaille <akim@epita.fr>
8872 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8873 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8875 Use struniq for symbols.
8877 * src/symtab.h (symbol_t): The tag member is a struniq.
8878 (symbol_type_set): Adjust.
8879 * src/symtab.c (symbol_new): Takes a struniq.
8880 (symbol_free): Don't free the tag member.
8881 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8882 (hash_compare_symbol, hash_symbol): these.
8883 Use the fact that tags as struniqs.
8884 (symbol_get): Use struniq_new.
8885 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8887 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8888 and type members are struniqs.
8889 * src/reader.c (get_merge_function)
8890 (grammar_current_rule_merge_set): Adjust.
8891 (TYPE, current_type): Are struniq.
8893 Use struniq for file names.
8895 * src/files.h, src/files.c (infile): Split into...
8896 (grammar_file, current_file): these.
8897 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8898 * src/reduce.c (reduce_print): Likewise.
8899 * src/getargs.c (getargs): Likewise.
8900 * src/complain.h, src/complain.c: Likewise.
8901 * src/main.c (main): Call struniqs_new early enough to use it for
8903 Don't free the input file name.
8905 2002-11-12 Akim Demaille <akim@epita.fr>
8907 * src/symtab.c (symbol_free): Remove dead deactivated code:
8908 type_name are properly removed.
8909 Don't use XFREE to free items that cannot be NULL.
8910 * src/struniq.h, src/struniq.c: New.
8911 * src/main.c (main): Initialize/free struniqs.
8912 * src/parse-gram.y (%union): Add astruniq member.
8914 * src/scan-gram.l (<{tag}>): Return a struniq.
8915 Free the obstack bit that used to store it.
8916 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8918 2002-11-11 Paul Eggert <eggert@twinsun.com>
8920 Revamp to fix many (but not all) of the C- and M4-related quoting
8921 problems. Among other things, this fixes the Bison bug reported
8922 by Jan Hubicka when processing the Bash grammar; see:
8923 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
8925 Use new @ escapes consistently. Represent brackets with @{ and @}
8926 rather than @<:@ and @:>@, since this works a bit better with dumb
8927 editors like vi. Represent @ with @@, since @ is now consistently
8928 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8929 __ofile__, to avoid unexpected expansions. Similarly, use @output
8930 rather than #output.
8932 * data/c.m4 (b4_copyright): Omit file name from comment, since
8933 the file name could contain "*/".
8934 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8935 be quoted. All uses changed.
8937 * data/glr.c: Use new @ escapes consistently.
8938 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8939 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8940 Remove, since they couldn't handle arbitrary characters in file
8942 * data/lalr1.cc: Likewise.
8943 * data/yacc.c: Likewise.
8945 * src/files.c (output_infix): Remove; all uses removed.
8946 * src/files.h: Likewise.
8948 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8949 mishandled funny characters in file names, and anyway it isn't
8951 * data/yacc.c: Likewise.
8952 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8954 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8955 * data/yacc.c: Likewise.
8957 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8959 (muscle_init): Quote filename as a C string.
8960 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
8961 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
8962 * src/output.c (escaped_file_name_output): New function.
8963 (prepare_symbols): Quote tokens for M4.
8964 (prepare): Don't insert output_infix, output_prefix,
8965 output_parser_name, output_header_name; this is now down by scan-skel.
8966 Insert skeleton as a C string.
8968 * src/output.c (user_actions_output, symbol_destructors_output,
8969 symbol_printers_output): Quote filenames for C and M4.
8970 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8972 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
8973 escapes other than \\ and \'; this simplifies the code.
8974 (<SC_STRING>): Likewise, for \\ and \".
8975 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
8976 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
8977 Use new escapes @{ and @} for [ and ].
8979 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
8980 them with auto vars.
8981 Switch to new escape scheme, where @ is the escape character uniformly.
8982 Abort if a stray escape character is found. Avoid unbounded input
8983 buffer when parsing non-escaped text.
8985 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8986 __oline__, #output, $@, and @{ do not have unintended meanings.
8988 2002-11-09 Paul Eggert <eggert@twinsun.com>
8990 Fix the test failure due to GCC warnings described in
8991 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
8992 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
8993 evaluate to 0 if it's impossible for NINF to be in the respective
8995 (yygetLRActions, yyrecoverParseError): Use them.
8997 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
8998 counted in the token inserted at end of file. Now takes
8999 location_t *, not location_t, so that the location can be
9000 adjusted. All uses changed.
9002 * tests/regression.at (Invalid inputs): Adjust wording in
9003 diagnostic to match the new behavior.
9005 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
9006 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
9007 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
9008 abort ();'. This reduces the runtime of the "Many lookaheads"
9009 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
9012 2002-11-07 Paul Eggert <eggert@twinsun.com>
9014 * src/parse-gram.y (CHARACTER): Remove unused token.
9017 * src/scan-gram.l: Remove stack option. We no longer use the
9018 stack, since the stack was never deeper than 1; instead, use the
9019 new auto var c_context to record the stacked value.
9021 Remove nounput option. At an unexpected end of file, we now unput
9022 the minimal input necessary to end cleanly; this simplifies the
9025 Avoid unbounded token sizes where this is easy.
9027 (unexpected_end_of_file): New function.
9028 Use it to systematize the error message on unexpected EOF.
9029 (last-string): Now auto, not static.
9030 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
9031 (scanner_last_string_free): Remove; not used.
9032 (percent_percent_count): Move decl to just before use.
9033 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
9034 not the (never otherwised-used) CHARACTER.
9036 2002-11-07 Akim Demaille <akim@epita.fr>
9038 Let yyerror always receive the msg as last argument, so that
9039 yyerror can be variadic.
9041 * data/yacc.c (b4_yyerror_args): New.
9042 Use it when calling yyerror.
9043 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
9044 Use it when calling yyerror.
9045 * doc/bison.texinfo (Error Reporting): Adjust.
9046 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
9047 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
9049 2002-11-06 Akim Demaille <akim@epita.fr>
9051 #line should have quoted strings.
9052 Ideally, this should be done by m4_quotearg.
9054 * src/scan-skel.l: Include quotearg.h.
9056 * src/output.c (symbol_printers_output)
9057 (symbol_destructors_output): Quote the file name.
9059 2002-11-06 Akim Demaille <akim@epita.fr>
9061 * tests/regression.at (Invalid inputs): Adjust to the recent
9064 2002-11-06 Akim Demaille <akim@epita.fr>
9067 Reported by Jim Kent.
9069 * data/c.m4 (b4_syncline): New.
9070 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
9071 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
9072 * src/output.c (user_actions_output): Likewise.
9073 (prepare): Define 'b4_synclines_flag'.
9074 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
9076 2002-11-06 Akim Demaille <akim@epita.fr>
9078 * src/main.c (main): Free `infile'.
9079 * src/scan-gram.l (handle_syncline): New.
9081 * src/output.c (user_actions_output, symbol_destructors_output)
9082 (symbol_printers_output): Use the location's file name, not
9084 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9086 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9088 * src/tables.c (matching_state): Don't allow states to match if
9089 either has GLR conflict entries.
9091 2002-11-05 Paul Eggert <eggert@twinsun.com>
9093 * src/scan-gram.l: Use more accurate diagnostics, e.g.
9094 "integer out of range" rather than "invalid value".
9095 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
9098 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
9099 Also, remove one static variable in the scanner.
9101 * src/scan-gram.l (braces_level): Now auto, not static.
9102 Initialize to zero if the compiler is being picky.
9103 (INITIAL): Clear braces_level instead of incrementing it.
9104 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
9105 as POSIX 1003.1-2001 requires.
9106 * src/system.h (IF_LINT): New macro, taken from coreutils.
9107 * configure.ac: Define "lint" if --enable-gcc-warnings.
9109 2002-11-05 Akim Demaille <akim@epita.fr>
9111 * src/scan-gram.l: When it starts with `%', complain about the
9112 whole directive, not just that `invalid character: %'.
9114 2002-11-04 Akim Demaille <akim@epita.fr>
9116 * Makefile.maint: Update from Autoconf.
9117 (update, cvs-update, po-update, do-po-update): New.
9119 2002-11-04 Akim Demaille <akim@epita.fr>
9121 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
9123 Have yyerror `use' its arguments.
9124 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
9125 returns true when location & yacc & pure & parse-param.
9126 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
9128 2002-11-04 Akim Demaille <akim@epita.fr>
9130 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
9132 * src/scan-gram.l: Use [\'] instead of ['] to pacify
9135 Use quote, not quote_n since LOCATION_PRINT no longer uses the
9138 2002-11-03 Paul Eggert <eggert@twinsun.com>
9140 * src/reader.c (get_merge_function, grammar_current_rule_check):
9141 Use consistent diagnostics for reporting type name clashes.
9142 Quote the types with <>, for consistency with Yacc.
9143 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
9145 2002-11-03 Akim Demaille <akim@epita.fr>
9147 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
9149 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
9150 (b4_parse_param): Remove.
9151 Use b4_identification.
9152 Propagate b4_pure_args where needed to pass them to yyerror.
9153 * data/glr.m4 (b4_parse_param): Remove.
9154 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
9155 (b4_lpure_formals): New.
9156 Use b4_identification.
9157 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
9158 b4_user_formals and b4_user_args.
9159 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
9160 (yyreportAmbiguity): When using a pure parser, also need
9161 the location, and the parse-params.
9163 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
9164 When using a pure parser, also need the parse-params.
9166 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
9167 (%pure-parser + %parse-param) LALR and GLR parsers.
9168 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
9169 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
9170 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
9171 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
9172 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
9173 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
9174 * doc/bison.texinfo: Untabify the whole file.
9175 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
9176 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
9177 (Error Reporting): Adjust to these new directives.
9178 Document %error-verbose, deprecate YYERROR_VERBOSE.
9180 2002-11-03 Akim Demaille <akim@epita.fr>
9182 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
9183 AT_CHECK_CALC_GLR invocations to use % directives, instead of
9184 command line options.
9185 * tests/cxx-type.at: Formatting changes.
9187 2002-11-03 Paul Eggert <eggert@twinsun.com>
9189 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
9190 to count columns correctly, and to check for invalid inputs.
9192 Use mbsnwidth to count columns correctly. Account for tabs, too.
9194 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
9195 (extend_location): New function.
9198 Handle CRLF in C code rather than in Lex code.
9199 (YY_INPUT): New macro.
9200 (no_cr_read): New function.
9202 Scan UCNs, even though we don't fully handle them yet.
9203 (convert_ucn_to_byte): New function.
9205 Handle backslash-newline correctly in C code.
9206 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
9207 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
9209 (tag, splice): New EREs. Do not allow NUL or newline in tags.
9210 Use {splice} wherever C allows backslash-newline.
9211 YY_STEP after space, newline, vertical-tab.
9212 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9214 (letter, id): Don't assume ASCII; e.g., spell out a-z.
9216 ({int}, handle_action_dollar, handle_action_at): Check for integer
9219 (YY_STEP): Omit trailing semicolon, so that it's more like C.
9221 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
9222 as well as \000. Check for UCHAR_MAX, not 255.
9223 Allow \x with an arbitrary positive number of digits, as in C.
9224 Check for overflow here.
9225 Allow \? and UCNs, for compatibility with C.
9227 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
9228 with quote slot used by complain_at.
9230 * tests/input.at: Add tests for backslash-newline, m4 quotes
9231 in symbols, long literals, and funny escapes in strings.
9233 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
9234 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
9235 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
9236 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
9237 * m4/mbswidth.m4: New file, from GNU coreutils.
9239 * doc/bison.texinfo (Grammar Outline): Document // comments.
9240 (Symbols): Document that trigraphs have no special meaning in Bison,
9241 nor is backslash-newline allowed.
9242 (Actions): Document that trigraphs have no special meaning.
9244 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
9247 2002-11-02 Paul Eggert <eggert@twinsun.com>
9249 * src/reader.c: Don't include quote.h; not needed.
9250 (get_merge_function): Reword warning to be consistent with
9251 type clash diagnostic in grammar_current_rule_check.
9253 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
9254 bug in trigraph handling.
9256 * src/output.c (prepare_symbols): When printing token names,
9257 escape "[" as "@<:@" and likewise for "]".
9259 * src/system.h (errno): Remove declaration, as we are now
9260 assuming C89 or better, and C89 guarantees errno.
9262 2002-10-30 Paul Eggert <eggert@twinsun.com>
9264 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
9265 Check for close failures.
9266 * src/files.h (xfclose): Return void, not int, since it always
9268 * src/files.c (xfclose): Likewise. Report I/O error if ferror
9270 * src/output.c (output_skeleton): Use xfclose rather than fclose
9271 and ferror. xfclose now checks ferror.
9273 * data/glr.c (YYLEFTMOST_STATE): Remove.
9274 (yyreportTree): Use a stack-based leftmost state. This avoids
9275 our continuing battles with bogus warnings about initializers.
9277 2002-10-30 Akim Demaille <akim@epita.fr>
9279 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
9282 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9284 * tests/glr-regr1.at: New test for reported regressions.
9285 * tests/testsuite.at: Add glr-regr1.at test.
9286 * tests/Makefile.am: Add glr-regr1.at test.
9288 2002-10-24 Paul Eggert <eggert@twinsun.com>
9292 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
9293 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
9294 we use malloc. Don't assume 'A' through 'Z' are contiguous.
9295 Don't assume strdup exists; POSIX says its an XSI extension.
9296 Check for buffer overflow on input.
9298 2002-10-24 Akim Demaille <akim@epita.fr>
9300 * src/output.c (output_skeleton): Don't disable M4sugar comments
9301 too soon: it results in comments being expanded.
9302 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
9305 2002-10-24 Akim Demaille <akim@epita.fr>
9307 * data/yacc.c (m4_int_type): New.
9308 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
9309 char' as only yacc.c wants K&R portability.
9310 * data/glr.c (yysigned_char): Remove.
9311 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
9312 Reported by Quoc Peyrot.
9314 2002-10-23 Paul Eggert <eggert@twinsun.com>
9316 * src/main.c (main): With --trace=time, report times even if a
9317 non-fatal error occurs. Formerly, the times were reported in some
9318 such cases but not in others.
9319 * src/reader.c (reader): Just return if a complaint has been issued,
9320 instead of exiting, so that 'main' can report times.
9322 2002-10-22 Akim Demaille <akim@epita.fr>
9324 * src/system.h: Include sys/types.
9325 Reported by Bert Deknuydt.
9327 2002-10-23 Paul Eggert <eggert@twinsun.com>
9329 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
9330 Suggested by Art Haas.
9332 2002-10-22 Paul Eggert <eggert@twinsun.com>
9334 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
9335 decl; not needed any more.
9336 * src/main.c (main): Use return to exit, undoing yesterday's change.
9337 The last OS that we could find where this wouldn't work is
9338 SunOS 3.5, and that's too old to worry about now.
9340 * data/glr.c (struct yyltype): Define members even when not
9341 doing locations. This is more consistent with yacc.c, and it
9342 works around the following bug reports:
9343 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
9344 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
9346 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
9347 @acronym consistently. Standardize on "Yacc" instead of "YACC",
9348 "Algol" instead of "ALGOL". Give a bit more history about BNF.
9350 2002-10-22 Akim Demaille <akim@epita.fr>
9354 2002-10-21 Paul Eggert <eggert@twinsun.com>
9356 Be consistent about 'bool'; the old code used an enum in one
9357 module and an int in another, and this violates the C standard.
9358 * m4/stdbool.m4: New file, from coreutils 4.5.3.
9359 * configure.ac (AC_HEADER_STDBOOL): Add.
9360 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
9361 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
9362 * src/symtab.c (hash_compare_symbol_t): Likewise.
9363 * src/system.h (bool, false, true): Use a definition consistent
9364 with ../lib/hash.c. All uses changed.
9366 * src/complain.c (warning_issued): Renamed from warn_message_count,
9367 so that we needn't worry about integer overflow (!).
9368 Now of type bool. All uses changed.
9369 (complaint_issued): Renamed from complain_message_count; likewise.
9371 * src/main.c (main): Use exit to exit with failure.
9373 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
9374 rather than 1 and 0.
9375 * src/main.c (main): Likewise.
9376 * src/getargs.c (getargs): Likewise.
9377 * src/reader.c (reader): Likewise.
9379 * src/getarg.c (getargs): Remove duplicate code for
9380 "Try `bison --help'".
9382 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
9383 What was that "2" for?
9385 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
9386 * src/getargs.c (usage): Likewise.
9388 * src/getargs.c (getargs): When there are too few operands, report
9389 the last one. When there are too many, report the first extra
9390 one. This is how diffutils does it.
9392 2002-10-20 Paul Eggert <eggert@twinsun.com>
9394 Remove K&R vestiges.
9395 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
9396 * src/complain.c (VA_START): Remove. Assume prototypes.
9397 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
9398 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
9399 fatal): Assume prototypes.
9400 * src/complain.h: Assume prototypes.
9401 * src/system.h (PARAMS): Remove.
9402 Include <limits.h> unconditionally, since it's guaranteeed even
9403 for a freestanding C89 compiler.
9404 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
9405 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
9407 2002-10-20 Akim Demaille <akim@epita.fr>
9409 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
9410 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
9411 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
9412 (yyresolveStates, yyresolveAction, yyresolveStack)
9413 (yyprocessOneStack): Use them.
9414 (yy_reduce_print): New.
9415 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
9417 2002-10-20 Akim Demaille <akim@epita.fr>
9419 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
9420 arguments and output `void'.
9421 (b4_c_function): Rename as...
9422 (b4_c_function_def): this.
9423 (b4_c_function_decl, b4_c_ansi_function_def)
9424 (b4_c_ansi_function_decl): New.
9425 Change the interpretation of the arguments: before `int, foo', now
9427 * data/yacc.c (yyparse): Prototype and define thanks to these.
9428 Adjust b4_c_function_def uses.
9429 * data/glr.c (yyparse): Likewise, but ANSI only.
9431 2002-10-20 Akim Demaille <akim@epita.fr>
9433 * src/output.c (prepare): Move the definition of `tokens_number',
9434 `nterms_number', `undef_token_number', `user_token_number_max'
9436 (prepare_tokens): Here.
9437 (prepare_tokens): Rename as...
9438 (prepare_symbols): this.
9439 (prepare): Move the definition of `rules_number' to...
9440 (prepare_rules): here.
9441 (prepare): Move the definition of `last', `final_state_number',
9442 `states_number' to...
9443 (prepare_states): here.
9444 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9446 2002-10-20 Akim Demaille <akim@epita.fr>
9448 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9450 2002-10-20 Akim Demaille <akim@epita.fr>
9452 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9455 2002-10-20 Akim Demaille <akim@epita.fr>
9457 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9458 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9460 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9462 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9463 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9466 2002-10-19 Paul Eggert <eggert@twinsun.com>
9468 Do not create a temporary file, as that involves security and
9469 cleanup headaches. Instead, use a pair of pipes.
9470 Derived from a suggestion by Florian Krohm.
9471 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9472 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9473 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9474 (BISON_PREREQ_SUBPIPE): Add.
9475 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9476 Add subpipe.h, subpipe.c.
9477 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9478 * po/POTFILES.in: Add lib/subpipe.c.
9479 * src/output.c: Include "subpipe.h".
9480 (m4_invoke): Remove decl.
9481 (scan_skel): New decl.
9482 (output_skeleton): Use pipe rather than temporary file for m4 input.
9483 Check that m4sugar.m4 is readable, to avoid deadlock.
9484 Check for pipe I/O error.
9485 * src/scan-skel.l (readpipe): Remove decl.
9486 (scan_skel): New function, to be used in place of m4_invoke.
9487 Read from stream rather than file.
9489 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9490 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9491 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9492 this generates a more-accurate value anyway.
9494 * lib/timevar.c (timervar_accumulate): Rename locals to
9495 avoid confusion with similarly-named more-global.
9496 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9498 * src/output.c (prepare): Use xstrdup to convert char const *
9499 to char *, to avoid GCC warning.
9501 2002-10-19 Akim Demaille <akim@epita.fr>
9503 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9504 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9505 Use them to have `calc.y' ready for %pure-parser.
9506 * data/yacc.c (YYLEX): Pass a yylex return type to
9509 2002-10-19 Akim Demaille <akim@epita.fr>
9511 Prototype support of %lex-param and %parse-param.
9513 * src/parse-gram.y: Add the definition of the %lex-param and
9514 %parse-param tokens, plus their rules.
9515 Drop the `_' version of %glr-parser.
9517 * src/scan-gram.l (INITIAL): Scan them.
9518 * src/muscle_tab.c: Comment changes.
9519 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9520 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9521 (muscle_entry_s): The `value' member is no longer const.
9522 Adjust all dependencies.
9523 * src/muscle_tab.c (muscle_init): Adjust: use
9524 MUSCLE_INSERT_STRING.
9525 Initialize the obstack earlier.
9526 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9527 (muscle_pair_list_grow): New.
9528 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9529 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9530 * tests/calc.at: Use %locations, not --locations.
9531 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9533 2002-10-19 Akim Demaille <akim@epita.fr>
9535 * src/getargs.c (usage): Take status as argument and exit
9537 Report the traditional `Try ... --help' message when status != 0.
9538 (usage, version): Don't take a FILE * as arg, it is pointless.
9539 (getargs): When there is an incorrect number of arguments, make it
9540 an error, and report it GNUlically thanks to `usage ()'.
9542 2002-10-18 Paul Eggert <eggert@twinsun.com>
9544 * data/glr.c (yyreportParseError): Don't assume that sprintf
9545 yields the length of the printed string, as this is not true
9546 on SunOS 4.1.4. Reported by Peter Klein.
9548 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9549 * tests/conflicts.at (%nonassoc and eof): Likewise.
9550 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9552 2002-10-17 Akim Demaille <akim@epita.fr>
9554 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9555 * src/getargs.c (trace_types, trace_args): Adjust.
9556 * src/reader.c (grammar_current_rule_prec_set)
9557 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9558 Standardize error messages.
9560 (reader): Use trace_flag to enable scanner/parser debugging,
9561 instead of an adhoc scheme.
9562 * src/scan-gram.l: Remove trailing debugging code.
9564 2002-10-16 Paul Eggert <eggert@twinsun.com>
9566 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9569 * NEWS: Officially drop support for building Bison with K&R C,
9570 since it didn't work anyway and it's not worth worrying about.
9571 * Makefile.maint (wget_files): Remove ansi2knr.c.
9572 (ansi2knr.c-url_prefix): Remove.
9573 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9574 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9575 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9577 2002-10-15 Paul Eggert <eggert@twinsun.com>
9579 Stop using the "enum_" trick for K&R-style function definitions;
9580 it confused me, and I was the author! Instead, assume that people
9581 who want to use K&R C compilers (when using these modules in GCC,
9582 perhaps?) will run ansi2knr.
9584 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9585 All uses of "enum_" changed to "enum ".
9586 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9587 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9589 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9590 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9591 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9592 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9593 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9594 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9595 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9596 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9597 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9598 Use function prototypes; this removes the need for declaring
9599 static functions simply to provide their prototypes.
9600 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9601 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9602 bitset_count_, bitset_create, bitset_dump, bitset_first,
9603 bitset_free, bitset_init, bitset_last, bitset_next,
9604 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9605 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9606 bitset_print, bitset_release_memory, bitset_toggle_,
9607 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9608 debug_bitset): Likewise.
9609 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9610 * lib/bitset_stats.c (bitset_log_histogram_print,
9611 bitset_percent_histogram_print, bitset_stats_and,
9612 bitset_stats_and_cmp, bitset_stats_and_or,
9613 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9614 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9615 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9616 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9617 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9618 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9619 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9620 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9621 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9622 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9623 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9624 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9625 bitset_stats_zero): Likewise.
9626 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9627 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9628 bitsetv_dump, debug_bitsetv): Likewise.
9629 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9630 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9631 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9632 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9633 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9634 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9635 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9636 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9637 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9638 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9639 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9641 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9642 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9643 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9644 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9645 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9646 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9647 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9648 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9649 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9650 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9651 lbitset_xor_cmp, lbitset_zero): Likewise.
9653 2002-10-14 Akim Demaille <akim@epita.fr>
9657 2002-10-14 Akim Demaille <akim@epita.fr>
9659 * tests/Makefile.am (maintainer-check-posix): New.
9661 2002-10-14 Akim Demaille <akim@epita.fr>
9663 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9666 2002-10-14 Akim Demaille <akim@epita.fr>
9668 * src/tables.c (table_ninf_remap): base -> tab.
9669 Reported by Matt Rosing.
9671 2002-10-14 Paul Eggert <eggert@twinsun.com>
9673 * tests/action.at, tests/calc.at, tests/conflicts.at,
9674 tests/cxx-type.at, tests/headers.at, tests/input.at,
9675 tests/regression.at, tests/synclines.at, tests/torture.at:
9676 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9677 so that the tests still work even if POSIXLY_CORRECT is set.
9678 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
9680 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9681 for portability to K&R hosts. Fix typo: signed char is guaranteed
9682 only to 127, not to 128.
9683 * data/glr.c (yysigned_char): New type.
9684 * data/yacc.c (yysigned_char): Likewise.
9685 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9687 2002-10-13 Paul Eggert <eggert@twinsun.com>
9689 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9690 true due to limited range of data type" warning from GCC.
9692 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9693 by wrapping enum yytokentype's definition inside #ifndef
9694 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9696 2002-10-13 Akim Demaille <akim@epita.fr>
9698 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9699 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9701 2002-10-13 Akim Demaille <akim@epita.fr>
9703 * Makefile.maint: Update from Autoconf 2.54.
9704 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9706 2002-10-13 Akim Demaille <akim@epita.fr>
9708 * src/print.c (print_state): Separate the list of solved conflicts
9709 from the other items.
9710 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9712 2002-10-13 Akim Demaille <akim@epita.fr>
9714 Let nondeterministic skeletons be usable with deterministic
9717 With the patch, GAWK compiled by GCC without -O2 passes its test
9718 suite using a GLR parser driven by LALR tables. It fails with -O2
9719 because `struct stat' gives two different answers on my machine:
9720 88 (definition of an auto var) and later 96 (memset on this var).
9721 Hence the stack is badly corrumpted. The headers inclusion is to
9722 blame: if I move the awk.h inclusion before GLR's system header
9723 inclusion, the two struct stat have the same size.
9725 * src/tables.c (pack_table): Always create conflict_table.
9726 (token_actions): Always create conflict_list.
9727 * data/glr.c (YYFLAG): Remove, unused.
9729 2002-10-13 Akim Demaille <akim@epita.fr>
9731 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9733 (VALGRIND, GXX): New.
9734 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9735 * tests/bison.in: Run $PREBISON a pre-command.
9736 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9737 (maintainer-check-g++): New.
9738 * Makefile.am (maintainer-check): New.
9740 2002-10-13 Akim Demaille <akim@epita.fr>
9742 * data/glr.c: Formatting changes.
9743 Tweak some trace messages to match yacc.c's.
9745 2002-10-13 Akim Demaille <akim@epita.fr>
9747 GLR parsers sometimes raise parse errors instead of performing the
9749 Reported by Charles-Henry de Boysson.
9751 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
9752 check the length of the traces when %glr.
9753 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9755 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9757 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9758 (yyltype): Remove the yy prefix from the member names.
9759 (yytable): Complete its comment.
9760 (yygetLRActions): Map error action number from YYTABLE from
9762 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9763 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9764 not satisfying as we could compare an YYACTION computed from
9765 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9766 only value for error actions.
9767 (yyreportParseError): In verbose parse error messages, don't issue
9768 `error' in the list of expected tokens.
9769 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9770 next action to perform to match glr.c's decoding.
9771 (yytable): Complete its comment.
9773 2002-10-13 Paul Eggert <eggert@twinsun.com>
9775 Fix problem reported by Henrik Grubbstroem in
9776 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
9777 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9778 because the Bison parser reads the second action before reducing
9780 * src/scan-gram.l (rule_length): New static var.
9781 Use it to keep track of the rule length in the scanner, since
9782 we can't expect the parser to be in lock-step sync with the scanner.
9783 (handle_action_dollar, handle_action_at): Use this var.
9784 * tests/actions.at (Exotic Dollars): Test for the problem.
9786 2002-10-12 Paul Eggert <eggert@twinsun.com>
9788 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9789 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9790 Include <sys/time.h> when checking for clock_t and struct tms.
9791 Use same include order as source.
9792 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
9793 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
9795 * lib/timevar.c: Update copyright date and clarify comments.
9796 (get_time) [IN_GCC]: Keep the GCC version for reference.
9798 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9799 GCC version as of today, then merge Bison's changes.
9800 Change "GCC" to "Bison" in copyright notice. timevar.def's
9801 author is Akim, so change that too.
9803 * src/reader.c (grammar_current_rule_check):
9804 Don't worry about the default action if $$ is untyped.
9805 Prevents bogus warnings reported by Jim Gifford in
9806 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
9808 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9809 * data/glr.c, data/lalr1.cc, data/yacc.c:
9810 Output token definitions before the first part of user declarations.
9811 Fixes compatibility problem reported by Jim Gifford for kbd in
9812 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
9814 2002-10-11 Paul Eggert <eggert@twinsun.com>
9816 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9817 (yyparse): here. This undoes some of the 2002-07-25 change.
9818 Compatibility problem reported by Ralf S. Engelschall with
9819 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9821 2002-10-11 Akim Demaille <akim@epita.fr>
9823 * tests/regression.at Characters Escapes): New.
9824 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9826 Reported by Jan Nieuwenhuizen.
9828 2002-10-11 Akim Demaille <akim@epita.fr>
9832 2002-10-10 Paul Eggert <eggert@twinsun.com>
9834 Portability fixes for bitsets; this also avoids several GCC
9837 * lib/abitset.c: Include <stddef.h>, for offsetof.
9838 * lib/lbitset.c: Likewise.
9840 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9841 properly for vectors of objects. Do not assume that adding a
9842 header size to a multiple of a word size yields a value that is
9843 properly aligned for the whole union.
9844 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9846 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9847 unique names for structures.
9848 * lib/ebitset.c (ebitset_bytes): Likewise.
9849 * lib/lbitset.c (lbitset_bytes): Likewise.
9851 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9852 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9853 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9854 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9855 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9856 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9857 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9858 to improve the type-checking that GCC can do.
9859 * lib/bitset.c (bitset_op4_cmp): Likewise.
9860 * lib/bitset_stats.c (bitset_stats_count,
9861 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9862 bitset_stats_copy, bitset_stats_disjoint_p,
9863 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9864 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9865 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9866 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9867 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9868 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9869 bitset_stats_or_and_cmp): Likewise.
9870 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9871 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9872 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9873 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9875 * lib/abitset.h: Include bitset.h, not bbitset.h.
9876 * lib/ebitset.h: Likewise.
9877 * lib/lbitset.h: Likewise.
9879 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9880 All instances of parameters of type enum bitset_opts are now of
9881 type enum_bitset_opts, to conform to the C Standard, and similarly
9882 for enum_bitset_type.
9883 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9884 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9886 Do not use "struct bitset_struct" to mean different things in
9887 different modules. Not only is this confusing, it violates
9888 the C Standard, which requires that structure types in different
9889 modules must be compatible if one is to be passed to the other.
9890 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9891 All instances of "struct bitset_struct *" replaced with "bitset".
9892 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9893 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9894 struct lbitset_struct, struct bitset_stats_struct): New types.
9895 All uses of struct bitset_struct changed to union bitset_union,
9897 * lib/abitset.c (struct abitset_struct, abitset,
9898 struct bitset_struct): Remove.
9899 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9900 struct bitset_struct): Remove.
9901 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9902 bitset_struct): Remove.
9903 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9906 Do not call a function of type T using a call that assumes the
9907 function is of a different type U. Standard C requires that a
9908 function must be called with a type that is compatible with its
9910 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9912 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9914 * lib/ebitset.c (PFV): Remove.
9915 * lib/lbitset.c (PFV): Likewise.
9916 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9917 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9919 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9920 (ebitset_vtable): Use them.
9921 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9922 lbitset_xor): New functions.
9923 (lbitset_vtable): Use them.
9925 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9928 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9930 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9931 Use offsetof, for simplicity.
9933 2002-10-06 Paul Eggert <eggert@twinsun.com>
9935 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9936 the same width as int. This reapplies a hunk of the 2002-08-12 patch
9937 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
9938 which was inadvertently undone by the 2002-09-30 patch.
9939 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9940 the same width as int.
9942 2002-10-04 Paul Eggert <eggert@twinsun.com>
9946 * configure.ac (AC_INIT), NEWS: Increment version number.
9948 * doc/bison.texinfo: Minor spelling, grammar, and white space
9950 (Symbols): Mention that any negative value returned from yylex
9951 signifies end-of-input. Warn about negative chars. Mention
9952 the portable Standard C character set.
9954 The GNU coding standard says CFLAGS and YFLAGS are reserved
9955 for the installer to set.
9956 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9957 * src/Makefile.am (AM_CFLAGS): Likewise.
9958 (AM_YFLAGS): Renamed from YFLAGS.
9960 Fix some MAX and MIN problems.
9961 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
9962 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
9963 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
9964 * src/reader.c (reader): Use it.
9966 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9967 POSIX 1003.1-2001 has removed fgrep.
9969 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9971 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
9972 interpreted as signed.
9973 * lib/ebitset.c (ebitset_list): Fix bug.
9975 2002-10-01 Paul Eggert <eggert@twinsun.com>
9977 More fixes for 64-bit hosts and large bitsets.
9979 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
9980 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
9981 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
9982 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
9983 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
9984 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
9985 bitset_count_): Likewise.
9986 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
9987 bitset_first, bitset_last): Likewise.
9988 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
9989 bitset_stats_list_reverse, bitset_stats_size,
9990 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
9992 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9993 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9994 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9995 bitsetv_reflexive_transitive_closure): Likewise.
9996 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
9997 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
9999 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
10002 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
10003 Use size_t, not unsigned int, to count bytes.
10004 * lib/abitset.h (abitset_bytes): Likewise.
10005 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
10007 * lib/bitset.h (bitset_bytes): Likewise.
10008 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
10009 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
10010 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10011 * lib/ebitset.c (ebitset_bytes): Likewise.
10012 * lib/ebitset.h (ebitset_bytes): Likewise.
10013 * lib/lbitset.c (lbitset_bytes): Likewise.
10014 * lib/lbitset.h (lbitset_bytes): Likewise.
10016 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
10017 abitset_subset_p, abitset_disjoint_p, abitset_and,
10018 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
10019 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
10020 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
10021 abitset_or_and, abitset_or_and_cmp):
10022 Use bitset_windex instead of unsigned int.
10023 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10024 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
10025 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
10026 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
10028 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
10030 * lib/bitset.c (bitset_print):
10031 Use proper printf formats for widths of integer types.
10032 * lib/bitset_stats.c (bitset_percent_histogram_print,
10033 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
10034 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10035 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10036 * lib/lbitset.c (lbitset_bytes): Likewise.
10038 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
10039 BITSET_SIZE_MAX): New macros.
10040 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
10041 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
10042 to BITSET_WINDEX_MAX.
10044 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
10045 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
10046 since we now return the bitset_bindex type (not int).
10048 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
10049 when computing sizes.
10050 * lib/ebitset.c (ebitset_elts_grow): Likewise.
10052 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
10053 and avoid cast to unsigned.
10055 2002-09-30 Akim Demaille <akim@epita.fr>
10057 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10058 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
10059 Updates from Michael Hayes.
10061 2002-09-30 Art Haas <ahaas@neosoft.com>
10063 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
10065 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
10068 2002-09-27 Akim Demaille <akim@epita.fr>
10072 2002-09-27 Akim Demaille <akim@epita.fr>
10074 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
10075 (Because of AC_LIBSOURCE).
10077 2002-09-27 Akim Demaille <akim@epita.fr>
10079 Playing with Autoscan.
10081 * configure.ac: Remove the old LIBOBJ tweaks.
10082 (AC_REPLACE_FUNCS): Add strrchr and strtol.
10083 * lib/strrchr.c: New.
10084 * lib/strtol.c: New, from the Coreutils 4.5.1.
10086 2002-09-27 Akim Demaille <akim@epita.fr>
10088 Playing with Autoscan.
10090 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
10091 * lib/Makefile.am (libbison_a_SOURCES): No longer include
10092 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
10093 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
10096 2002-09-24 Akim Demaille <akim@epita.fr>
10098 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
10099 (Frequently Asked Questions, Parser Stack Overflow): New.
10101 2002-09-13 Akim Demaille <akim@epita.fr>
10103 Playing with autoscan.
10105 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
10106 * src/files.c (skeleton_find): Remove, unused.
10107 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
10108 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
10110 2002-09-13 Akim Demaille <akim@epita.fr>
10112 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
10113 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
10115 2002-09-13 Akim Demaille <akim@epita.fr>
10117 * configure.ac: Require 2.54.
10118 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
10119 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
10120 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
10121 Remove, provided by Autoconf macros.
10123 2002-09-12 Akim Demaille <akim@epita.fr>
10125 * m4/prereq.m4: Update, from Coreutils 4.5.1.
10127 2002-09-12 Akim Demaille <akim@epita.fr>
10129 * m4/prereq.m4: Update, from Fileutils 4.1.5.
10130 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
10131 Reported by Martin Mokrejs.
10133 2002-09-10 Akim Demaille <akim@epita.fr>
10135 * src/parse-gram.y: Associate a human readable string to each
10137 * tests/regression.at (Invalid inputs): Adjust.
10139 2002-09-10 Gary V. Vaughan <gary@gnu.org>
10141 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
10142 with an Autoconf-2.5x style configure.ac.
10144 2002-09-06 Paul Eggert <eggert@twinsun.com>
10146 * doc/bison.texinfo (Conditions): Make explicit that the GPL
10147 exception applies only to yacc.c. This is a modification of a
10148 patch originally suggested by Akim Demaille.
10150 2002-09-06 Akim Demaille <akim@epita.fr>
10152 * data/c.m4 (b4_copyright): Move the GPL exception comment from
10154 * data/yacc.c: here.
10156 * data/lalr1.cc (struct yyltype): Don't define it, since we use
10158 (b4_ltype): Default to yy::Location from location.hh.
10160 2002-09-04 Jim Meyering <jim@meyering.net>
10162 * data/yacc.c: Guard the declaration of yytoknum also with
10163 `#ifdef YYPRINT', so it is declared only when used.
10165 2002-09-04 Akim Demaille <akim@epita.fr>
10167 * configure.in: Rename as...
10168 * configure.ac: this.
10171 2002-09-04 Akim Demaille <akim@epita.fr>
10173 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
10174 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
10175 translate maintainer only messages.
10177 2002-08-12 Paul Eggert <eggert@twinsun.com>
10181 * Makefile.am (SUBDIRS): Remove intl.
10182 (DISTCLEANFILES): Remove.
10183 * NEWS: Mention that GNU M4 is now required. Clarify what is
10184 meant by "larger grammars". Mention the pt_BR translation.
10185 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
10186 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
10187 Bump version from 0.11.2 to 0.11.5.
10188 (BISON_PREREQ_STAGE): Remove.
10189 (AM_GNU_GETTEXT): Use external gettext.
10190 (AC_OUTPUT): Remove intl/Makefile.
10192 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
10194 * data/glr.c: Include string.h, for strlen.
10195 (yyreportParseError): Use size_t for yysize.
10196 (yy_yypstack): No longer nested inside yypstates, as nested
10197 functions are not portable. Do not assume size_t is the
10199 (yypstates): Do not assume that ptrdiff_t is the same width
10200 as int, and similarly for yyposn and YYINDEX.
10202 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
10204 * lib/Makefile.am (INCLUDES): Do not include from the intl
10205 directory, which has been removed.
10206 * src/Makefile.am (INCLUDES): Likewise.
10208 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
10209 (bitsets_sources, additional_bitsets_sources, timevars_sources):
10212 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
10213 * tests/Makefile.am (EXTRA_DIST): Likewise.
10215 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
10216 Do not assume that bitset_windex is the same width as unsigned.
10218 * lib/abitset.c (abitset_unused_clear): Do not assume that
10219 bitset_word is the same width as int.
10220 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
10221 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
10222 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
10223 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
10224 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
10226 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
10227 portability to one's complement hosts!).
10228 * lib/ebitset.c (ebitset_op1): Likewise.
10229 * lib/lbitset.c (lbitset_op1): Likewise.
10231 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
10232 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10233 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
10234 Sync with fileutils.
10235 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
10236 lib/gettext.h: Sync with diffutils.
10238 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
10239 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
10241 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
10242 PROTOTYPES to check for prototypes, and "defined __STDC__" to
10245 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
10246 size_t; the old version tried to do this but casted improperly.
10247 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
10248 (bitset_test): Now returns int, not unsigned long.
10250 * lib/bitset_stats.c: Include "gettext.h".
10252 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
10253 name locals "index", as it generates unnecessary warnings on some
10254 hosts that have an "index" function.
10256 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
10257 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
10258 they need translation.
10259 * src/LR0.c (state_list_append, new_itemsets, get_state,
10260 append_states, generate_states): Likewise.
10261 * src/assoc.c (assoc_to_string): Likewise.
10262 * src/closure.c (print_closure, set_firsts, closure): Likewise.
10263 * src/gram.c (grammar_dump): Likewise.
10264 * src/injections.c (injections_compute): Likewise.
10265 * src/lalr.c (lookaheads_print): Likewise.
10266 * src/relation.c (relation_transpose): Likewise.
10267 * src/scan-gram.l: Likewise.
10268 * src/tables.c (table_grow, pack_vector): Likewise.
10270 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
10271 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
10272 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
10273 * m4/mbstate_t.m4: Sync with fileutils.
10274 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
10276 * po/LINGUAS: Add pt_BR.
10277 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
10278 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
10280 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
10282 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
10284 * src/complain.c (strerror_r): Remove decl; not needed.
10285 (strerror): Use same pattern as ../lib/error.c.
10287 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
10289 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
10291 * src/main.c (main): Cast result of bindtextdomain and textdomain
10292 to void, to avoid a GCC warning when --disable-nls is in effect.
10294 * src/scan-gram.l: Use strings rather than escapes when possible,
10295 to minimize the number of warnings from xgettext.
10296 (handle_action_dollar, handle_action_at): Don't use isdigit,
10297 as it mishandles negative chars and it may not work as expected
10298 outside the C locale.
10300 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
10301 this is a GCC extension and is not portable to other compilers.
10303 * src/system.h (alloca): Use same pattern as ../lib/error.c.
10304 Do not include <ctype.h>; no longer needed.
10305 Do not include <malloc.h>; no longer needed (and generates
10306 warnings on OpenBSD 3.0).
10308 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
10311 * tests/regression.at: Do not use 'cc -c input.c -o input';
10312 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
10314 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
10315 exit status as failure, not just exit status 1. Sun C exits
10316 with status 2 sometimes.
10318 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
10319 Use it for the two large tests.
10321 2002-08-02 Akim Demaille <akim@epita.fr>
10323 * src/conflicts.c (conflicts_output): Don't output rules never
10324 reduced here, since anyway that computation doesn't work.
10325 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
10326 (rule_useless_p, rule_never_reduced_p): New.
10327 (grammar_rules_partial_print): Use a filter instead of a range.
10328 Display the title only if needed.
10329 (grammar_rules_print): Adjust.
10330 (grammar_rules_never_reduced_report): New.
10331 * src/tables.c (action_row): Move the computation of rules never
10333 (token_actions): here.
10334 * src/main.c (main): Make the parser before making the report, so
10335 that rules never reduced are computed.
10336 Call grammar_rules_never_reduced_report.
10337 * src/print.c (print_results): Report rules never reduced.
10338 * tests/conflicts.at, tests/reduce.at: Adjust.
10340 2002-08-01 Akim Demaille <akim@epita.fr>
10342 Instead of attaching lookaheads and duplicating the rules being
10343 reduced by a state, attach the lookaheads to the reductions.
10345 * src/state.h (state_t): Remove the `lookaheads',
10346 `lookaheads_rule' member.
10347 (reductions_t): Add a `lookaheads' member.
10348 Use a regular array for the `rules'.
10349 * src/state.c (reductions_new): Initialize the lookaheads member
10351 (state_rule_lookaheads_print): Adjust.
10352 * src/state.h, src/state.c (state_reductions_find): New.
10353 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
10354 (count_rr_conflicts): Adjust.
10355 * src/lalr.c (LArule): Remove.
10356 (add_lookback_edge): Adjust.
10357 (state_lookaheads_count): New.
10358 (states_lookaheads_initialize): Merge into...
10359 (initialize_LA): this.
10360 (lalr_free): Adjust.
10361 * src/main.c (main): Don't free nullable and derives too early: it
10362 is used by --verbose.
10363 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
10365 2002-08-01 Akim Demaille <akim@epita.fr>
10367 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
10369 (set_derives, free_derives): Rename as...
10370 (derives_compute, derives_free): this.
10371 Adjust all dependencies.
10372 * src/nullable.c (set_nullable, free_nullable): Rename as...
10373 (nullable_compute, nullable_free): these.
10374 (rule_list_t): Store rule_t *, not rule_number_t.
10375 * src/state.c (state_rule_lookaheads_print): Directly compare rule
10376 pointers, instead of their numbers.
10377 * src/main.c (main): Call nullable_free, and derives_free earlier,
10378 as they were lo longer used.
10380 2002-08-01 Akim Demaille <akim@epita.fr>
10382 * lib/timevar.c (get_time): Include children time.
10383 * src/lalr.h (LA, LArule): Don't export them: used with the
10385 * src/lalr.c (LA, LArule): Static.
10386 * src/lalr.h, src/lalr.c (lalr_free): New.
10387 * src/main.c (main): Call it.
10388 * src/tables.c (pack_vector): Check whether loc is >= to the
10390 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
10391 (tables_generate): do it, since that's also it which allocates
10393 Don't free LA and LArule, main does.
10395 2002-07-31 Akim Demaille <akim@epita.fr>
10397 Separate parser tables computation and output.
10399 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
10400 (conflict_list, conflict_list_cnt, table, check, table_ninf)
10401 (yydefgoto, yydefact, high): Move to...
10402 * src/tables.h, src/tables.c: here.
10403 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10404 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10405 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
10406 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
10407 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
10408 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
10409 (action_row, save_row, token_actions, save_column, default_goto)
10410 (goto_actions, sort_actions, matching_state, pack_vector)
10411 (table_ninf_remap, pack_table, prepare_actions): Move to...
10412 * src/tables.c: here.
10413 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
10414 * src/output.c (token_actions, output_base, output_conflicts)
10415 (output_check): Merge into...
10416 (prepare_actions): this.
10417 (actions_output): Rename as...
10418 (user_actions_output): this.
10419 * src/main.c (main): Call tables_generate and tables_free.
10421 2002-07-31 Akim Demaille <akim@epita.fr>
10423 Steal GCC's --time-report support.
10425 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
10426 stolen/adjusted from GCC.
10427 * m4/stage.m4: Remove time related checks.
10428 * m4/timevar.m4: New.
10429 * configure.in: Adjust.
10430 * src/system.h: Adjust to using timevar.h.
10431 * src/getargs.h, src/getargs.c: Support trace_time for
10433 * src/main.c (stage): Remove.
10434 (main): Replace `stage' invocations with timevar calls.
10435 * src/output.c: Insert pertinent timevar calls.
10437 2002-07-31 Akim Demaille <akim@epita.fr>
10439 Let --trace have arguments.
10441 * src/getargs.h (enum trace_e): New.
10442 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10443 (long_options, short_options): --trace/-T takes an optional
10445 Change all the uses of trace_flag to reflect the new flags.
10446 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10448 Strengthen `stage' portability.
10450 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10451 * configure.in: Use it.
10452 Don't check for malloc.h and sys/times.h.
10453 * src/system.h: Include them when appropriate.
10454 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10455 times and struct tms are available.
10457 2002-07-30 Akim Demaille <akim@epita.fr>
10459 In verbose parse error message, don't report `error' as an
10461 * tests/actions.at (Printers and Destructors): Adjust.
10462 * tests/calc.at (Calculator $1): Adjust.
10463 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10464 error message, do not report the parser accepts the error token in
10467 2002-07-30 Akim Demaille <akim@epita.fr>
10469 Normalize conflict related messages.
10471 * src/complain.h, src/complain.c (warn, complain): New.
10472 * src/conflicts.c (conflicts_print): Use them.
10473 (conflict_report_yacc): New, extracted from...
10474 (conflicts_print): here.
10475 * tests/conflicts.at, tests/existing.at: Adjust.
10477 2002-07-30 Akim Demaille <akim@epita.fr>
10479 Report rules which are never reduced by the parser: those hidden
10482 * src/LR0.c (save_reductions): Don't make the final state too
10483 different: save its reduction (accept) instead of having a state
10484 without any action (no shift or goto, no reduce).
10485 Note: the final state is now a ``regular'' state, i.e., the
10486 parsers now contain `reduce 0' as default reduction.
10487 Nevertheless, since they decide to `accept' when yystate =
10488 final_state, they still will not reduce rule 0.
10489 * src/print.c (print_actions, print_reduction): Adjust.
10490 * src/output.c (action_row): Track reduced rules.
10491 (token_actions): Report rules never reduced.
10492 * tests/conflicts.at, tests/regression.at: Adjust.
10494 2002-07-30 Akim Demaille <akim@epita.fr>
10496 `stage' was accidently included in a previous patch.
10497 Initiate its autoconfiscation.
10499 * configure.in: Look for malloc.h and sys/times.h.
10500 * src/main.c (stage): Adjust.
10501 Report only when trace_flag.
10503 2002-07-29 Akim Demaille <akim@epita.fr>
10505 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10507 (errs_t): symbol_t*, not symbol_number_t.
10508 (reductions_t): rule_t*, not rule_number_t.
10509 (FOR_EACH_SHIFT): New.
10510 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10511 * src/print.c, src/print_graph.c: Adjust.
10513 2002-07-29 Akim Demaille <akim@epita.fr>
10515 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10517 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10518 (endtoken, accept): these.
10519 * src/reader.c (reader): Set endtoken's default tag to "$end".
10520 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10521 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10524 2002-07-29 Akim Demaille <akim@epita.fr>
10526 * src/reduce.c (reduce_grammar): When the language is empty,
10527 complain about the start symbol, not the axiom.
10529 * tests/reduce.at (Empty Language): New.
10531 2002-07-26 Akim Demaille <akim@epita.fr>
10533 * src/reader.h, src/reader.c (gram_error): ... can't get
10534 yycontrol without making too strong assumptions on the parser
10536 * src/output.c (prepare_tokens): Use the real 0th value of
10537 token_translations instead of `0'.
10538 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10540 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10541 for the time being: %locations ought to provide it to yyerror.
10543 2002-07-25 Akim Demaille <akim@epita.fr>
10545 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10546 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10547 * tests/regression.at (Web2c Actions): Adjust.
10549 2002-07-25 Akim Demaille <akim@epita.fr>
10551 Stop storing rules from 1 to nrules + 1.
10553 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10554 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10555 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10556 Iterate from 0 to nrules.
10557 Use rule_number_as_item_number and item_number_as_rule_number.
10558 Adjust to `derive' now containing possibly 0.
10559 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10560 Handle the `- 1' part in rule numbers from/to item numbers.
10561 * src/conflicts.c (log_resolution): Fix the message which reversed
10563 * src/output.c (action_row): Initialize default_rule to -1.
10564 (token_actions): Adjust.
10565 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10567 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10569 2002-07-25 Akim Demaille <akim@epita.fr>
10571 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10572 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10573 (b4_c_knr_arg_decl): New.
10574 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10575 yyreport_parse_error.
10577 2002-07-25 Akim Demaille <akim@epita.fr>
10579 * data/yacc.c (yyreport_parse_error): New, extracted from...
10581 (yydestruct, yysymprint): Move above yyparse.
10584 2002-07-25 Akim Demaille <akim@epita.fr>
10586 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10588 (b4_sint_type, b4_uint_type): these.
10589 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10590 * tests/regression.at (Web2c Actions): Adjust.
10592 2002-07-25 Akim Demaille <akim@epita.fr>
10594 * src/gram.h (TIEM_NUMBER_MAX): New.
10595 (item_number_of_rule_number, rule_number_of_item_number): Rename
10597 (rule_number_as_item_number, item_number_as_rule_number): these.
10598 Adjust dependencies.
10599 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10600 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10601 (symbol_number_to_vector_number): New.
10602 (order): Of vector_number_t* type.
10603 (base_t, BASE_MAX, BASE_MIN): New.
10604 (froms, tos, width, pos, check): Of base_t type.
10605 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10606 (actrow): Of action_number_t type.
10607 (conflrow): Of unsigned int type.
10608 (table_ninf, base_ninf): New.
10609 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10610 (muscle_insert_int_table, muscle_insert_base_table)
10611 (muscle_insert_rule_number_table): New.
10612 (prepare_tokens): Output `toknum' as int_table.
10613 (action_row): Returns a rule_number_t.
10614 Use ACTION_MIN, not SHRT_MIN.
10615 (token_actions): yydefact is rule_number_t*.
10616 (table_ninf_remap): New.
10617 (pack_table): Use it for `base' and `table'.
10618 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10620 (YYPACT_NINF, YYTABLE_NINF): these.
10621 (yypact, yytable): Compute their types instead of hard-coded
10623 * tests/regression.at (Web2c Actions): Adjust.
10625 2002-07-19 Akim Demaille <akim@epita.fr>
10627 * src/scan-gram.l (id): Can start with an underscore.
10629 2002-07-16 Akim Demaille <akim@epita.fr>
10631 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10632 Adjust all former `associativity' dependencies.
10633 * src/symtab.c (symbol_new): Default associativity is `undef', not
10635 (symbol_check_alias_consistence): Adjust.
10637 2002-07-09 Akim Demaille <akim@epita.fr>
10639 * doc/bison.texinfo: Properly set the ``header'' part.
10640 Use @dircategory ``GNU programming tools'' as per Texinfo's
10644 2002-07-09 Akim Demaille <akim@epita.fr>
10646 * lib/quotearg.h: Protect against multiple inclusions.
10647 * src/location.h (location_t): Add a `file' member.
10648 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10649 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10650 `error_one_per_line' support.
10652 2002-07-09 Akim Demaille <akim@epita.fr>
10654 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10655 * src/reader.c (lineno): Remove.
10656 Adjust all dependencies.
10657 (get_merge_function): Take a location and use complain_at.
10658 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10659 * tests/regression.at (Invalid inputs, Mixing %token styles):
10662 2002-07-09 Akim Demaille <akim@epita.fr>
10664 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10665 recovery rule, and forbid extensions when --yacc.
10666 (gram_error): Use complain_at.
10667 * src/reader.c (reader): Exit if there were parse errors.
10669 2002-07-09 Akim Demaille <akim@epita.fr>
10671 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10672 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10673 Reported by R Blake <blakers@mac.com>.
10675 2002-07-09 Akim Demaille <akim@epita.fr>
10677 * data/yacc.c: Output the copyright notive in the header.
10679 2002-07-03 Akim Demaille <akim@epita.fr>
10681 * src/output.c (froms, tos): Are state_number_t.
10682 (save_column): sp, sp1, and sp2 are state_number_t.
10683 (prepare): Rename `final' as `final_state_number', `nnts' as
10684 `nterms_number', `nrules' as `rules_number', `nstates' as
10685 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10687 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10688 * data/lalr1.cc (nsym_): Remove, unused.
10690 2002-07-03 Akim Demaille <akim@epita.fr>
10692 * src/lalr.h, src/lalr.c (goto_number_t): New.
10693 * src/lalr.c (goto_list_t): New.
10695 * src/nullable.c (rule_list_t): New.
10697 * src/types.h: Remove.
10699 2002-07-03 Akim Demaille <akim@epita.fr>
10701 * src/closure.c (print_fderives): Use rule_rhs_print.
10702 * src/derives.c (print_derives): Use rule_rhs_print.
10703 (rule_list_t): New, replaces `shorts'.
10704 (set_derives): Add comments.
10705 * tests/sets.at (Nullable, Firsts): Adjust.
10707 2002-07-03 Akim Demaille <akim@epita.fr>
10709 * src/output.c (prepare_actions): Free `tally' and `width'.
10710 (prepare_actions): Allocate and free `order'.
10711 * src/symtab.c (symbols_free): Free `symbols'.
10712 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10713 * src/output.c (m4_invoke): Move to...
10714 * src/scan-skel.l: here.
10715 (<<EOF>>): Close yyout, and free its name.
10717 2002-07-03 Akim Demaille <akim@epita.fr>
10719 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10721 * src/LR0.c (new_state): Merge into...
10722 (state_list_append): this.
10723 (new_states): Merge into...
10724 (generate_states): here.
10725 (set_states): Don't ensure a proper `errs' state member here, do it...
10726 * src/conflicts.c (conflicts_solve): here.
10727 * src/state.h, src/state.c: Comment changes.
10728 (state_t): Rename member `shifts' as `transitions'.
10729 Adjust all dependencies.
10730 (errs_new): For consistency, also take the values as argument.
10731 (errs_dup): Remove.
10732 (state_errs_set): New.
10733 (state_reductions_set, state_transitions_set): Assert that no
10734 previous value was assigned.
10736 (states_free): Use it.
10737 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10738 temporary storage: use `errs' and `nerrs' as elsewhere.
10739 (set_conflicts): Allocate and free this `errs'.
10741 2002-07-02 Akim Demaille <akim@epita.fr>
10743 * lib/libiberty.h: New.
10744 * lib: Update the bitset implementation from upstream.
10745 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10746 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10747 * src/main.c: Adjust bitset stats calls.
10749 2002-07-01 Paul Eggert <eggert@twinsun.com>
10751 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10752 char, so that negative chars don't collide with $.
10754 2002-06-30 Akim Demaille <akim@epita.fr>
10756 Have the GLR tests be `warning' checked, and fix the warnings.
10758 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10759 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10760 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10761 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10762 (yyaddDeferredAction): static.
10763 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10764 (yyreportParseError): yyprefix is const.
10765 yytokenp is used only when verbose.
10766 (yy__GNUC__): Replace with __GNUC__.
10767 (yypdumpstack): yyi is size_t.
10768 (yypreference): Un-yy local variables and arguments, to avoid
10769 clashes with `yyr1'. Anyway, we are not in the user name space.
10770 (yytname_size): be an int, as is compared with ints.
10771 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10773 * tests/cxx-gram.at: Use quotation to protect $1.
10774 Use AT_COMPILE to enable warnings hunts.
10775 Prototype yylex and yyerror.
10777 Include `string.h', not `strings.h'.
10778 Produce and prototype stmtMerge only when used.
10779 yylex takes a location.
10781 2002-06-30 Akim Demaille <akim@epita.fr>
10783 We spend a lot of time in quotearg, in particular when --verbose.
10785 * src/symtab.c (symbol_get): Store a quoted version of the key.
10786 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10787 Adjust all callers.
10789 2002-06-30 Akim Demaille <akim@epita.fr>
10791 * src/state.h (reductions_t): Rename member `nreds' as num.
10792 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10793 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10795 2002-06-30 Akim Demaille <akim@epita.fr>
10797 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10798 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10799 (shifts_to): Rename as...
10800 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10801 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10802 (TRANSITION_IS_DISABLED, transitions_to): these.
10804 2002-06-30 Akim Demaille <akim@epita.fr>
10806 * src/print.c (print_shifts, print_gotos): Merge into...
10807 (print_transitions): this.
10808 (print_transitions, print_errs, print_reductions): Align the
10809 lookaheads columns.
10810 (print_core, print_transitions, print_errs, print_state,
10811 print_grammar): Output empty lines separator before, not after.
10812 (state_default_rule_compute): Rename as...
10813 (state_default_rule): this.
10814 * tests/conflicts.at (Defaulted Conflicted Reduction),
10815 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10816 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10818 2002-06-30 Akim Demaille <akim@epita.fr>
10820 Display items as we display rules.
10822 * src/gram.h, src/gram.c (rule_lhs_print): New.
10823 * src/gram.c (grammar_rules_partial_print): Use it.
10824 * src/print.c (print_core): Likewise.
10825 * tests/conflicts.at (Defaulted Conflicted Reduction),
10826 (Unresolved SR Conflicts): Adjust.
10827 (Unresolved SR Conflicts): Adjust and rename as...
10828 (Resolved SR Conflicts): this, as was meant.
10829 * tests/regression.at (Web2c Report): Adjust.
10831 2002-06-30 Akim Demaille <akim@epita.fr>
10833 * src/print.c (state_default_rule_compute): New, extracted from...
10834 (print_reductions): here.
10835 Pessimize, but clarify the code.
10836 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10838 2002-06-30 Akim Demaille <akim@epita.fr>
10840 * src/output.c (action_row): Let default_rule be always a rule
10843 2002-06-30 Akim Demaille <akim@epita.fr>
10845 * src/closure.c (print_firsts, print_fderives, closure):
10846 Use BITSET_EXECUTE.
10847 * src/lalr.c (lookaheads_print): Likewise.
10848 * src/state.c (state_rule_lookaheads_print): Likewise.
10849 * src/print_graph.c (print_core): Likewise.
10850 * src/print.c (print_reductions): Likewise.
10851 * src/output.c (action_row): Likewise.
10852 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10854 2002-06-30 Akim Demaille <akim@epita.fr>
10856 * src/print_graph.c: Use report_flag.
10858 2002-06-30 Akim Demaille <akim@epita.fr>
10860 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10862 * src/relation.h, src/relation.c (traverse, relation_digraph)
10863 (relation_print, relation_transpose): New.
10865 2002-06-30 Akim Demaille <akim@epita.fr>
10867 * src/state.h, src/state.c (shifts_to): New.
10868 * src/lalr.c (build_relations): Use it.
10870 2002-06-30 Akim Demaille <akim@epita.fr>
10872 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10873 (item_number_of_rule_number, rule_number_of_item_number): New.
10874 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10875 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10876 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10877 Propagate their use.
10878 Much remains to be done, in particular wrt `shorts' from types.h.
10880 2002-06-30 Akim Demaille <akim@epita.fr>
10882 * src/symtab.c (symbol_new): Initialize the `printer' member.
10884 2002-06-30 Akim Demaille <akim@epita.fr>
10886 * src/LR0.c (save_reductions): Remove, replaced by...
10887 * src/state.h, src/state.c (state_reductions_set): New.
10888 (reductions, errs): Rename as...
10889 (reductions_t, errs_t): these.
10890 Adjust all dependencies.
10892 2002-06-30 Akim Demaille <akim@epita.fr>
10894 * src/LR0.c (state_list_t, state_list_append): New.
10895 (first_state, last_state): Now symbol_list_t.
10896 (this_state): Remove.
10897 (new_itemsets, append_states, save_reductions): Take a state_t as
10899 (set_states, generate_states): Adjust.
10900 (save_shifts): Remove, replaced by...
10901 * src/state.h, src/state.c (state_shifts_set): New.
10902 (shifts): Rename as...
10904 Adjust all dependencies.
10905 * src/state.h (state_t): Remove the `next' member.
10907 2002-06-30 Akim Demaille <akim@epita.fr>
10909 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10912 2002-06-30 Akim Demaille <akim@epita.fr>
10914 Use hash.h for the state hash table.
10916 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10917 (allocate_storage): Use state_hash_new.
10918 (free_storage): Use state_hash_free.
10919 (new_state, get_state): Adjust.
10920 * src/lalr.h, src/lalr.c (states): Move to...
10921 * src/states.h (state_t): Remove the `link' member, no longer
10923 * src/states.h, src/states.c: here.
10924 (state_hash_new, state_hash_free, state_hash_lookup)
10925 (state_hash_insert, states_free): New.
10926 * src/states.c (state_table, state_compare, state_hash): New.
10927 * src/output.c (output_actions): Do not free states now, since we
10928 still need to know the final_state number in `prepare', called
10929 afterwards. Do it...
10930 * src/main.c (main): here: call states_free after `output'.
10932 2002-06-30 Akim Demaille <akim@epita.fr>
10934 * src/state.h, src/state.c (state_new): New, extracted from...
10935 * src/LR0.c (new_state): here.
10936 * src/state.h (STATE_ALLOC): Move to...
10937 * src/state.c: here.
10938 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10939 * src/state.h, src/state.c: here.
10941 2002-06-30 Akim Demaille <akim@epita.fr>
10943 * src/reader.c (gensym): Rename as...
10944 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10945 (getsym): Rename as...
10946 (symbol_get): this.
10948 2002-06-30 Akim Demaille <akim@epita.fr>
10950 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10951 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10952 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10953 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10955 2002-06-30 Akim Demaille <akim@epita.fr>
10957 Make the test suite pass with warnings checked.
10959 * tests/actions.at (Printers and Destructors): Improve.
10960 Avoid unsigned vs. signed issues.
10961 * tests/calc.at: Don't exercise the scanner here, do it...
10962 * tests/input.at (Torturing the Scanner): here.
10964 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10966 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
10967 reorganize first lines parallel to yacc.c.
10969 2002-06-28 Akim Demaille <akim@epita.fr>
10971 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
10972 (b4_token_enum, b4_token_defines): New, factored from...
10973 * data/lalr1.cc, data/yacc.c, glr.c: here.
10975 2002-06-28 Akim Demaille <akim@epita.fr>
10977 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10979 * src/output.c (merger_output): static.
10981 2002-06-28 Akim Demaille <akim@epita.fr>
10983 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
10984 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10986 * src/output.c (save_row): Initialize all the variables to pacify GCC.
10988 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10990 Accumulated changelog for new GLR parsing features.
10992 * src/conflicts.c (count_total_conflicts): Change name to
10993 conflicts_total_count.
10994 * src/conflicts.h: Ditto.
10995 * src/output.c (token_actions): Use the new name.
10996 (output_conflicts): Change conflp => conflict_list_heads, and
10997 confl => conflict_list for better readability.
10998 * data/glr.c: Use the new names.
10999 * NEWS: Add self to GLR announcement.
11001 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
11003 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
11006 * data/bison.glr: Change name to glr.c
11007 * data/glr.c: Renamed from bison.glr.
11008 * data/Makefile.am: Add glr.c
11012 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
11013 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
11015 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11017 * data/bison.glr: Be sure to restore the
11018 current #line when returning to the skeleton contents after having
11019 exposed the input file's #line.
11021 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11023 * data/bison.glr: Bring up to date with changes to bison.simple.
11025 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11027 * data/bison.glr: Correct definitions that use b4_prefix.
11028 Various reformatting.
11029 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
11030 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
11031 yytokenp argument; now part of stack.
11032 (yychar): Define to behave as documented.
11033 (yyclearin): Ditto.
11035 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11037 * src/reader.h: Add declaration for free_merger_functions.
11039 * src/reader.c (merge_functions): New variable.
11040 (get_merge_function): New function.
11041 (free_merger_functions): New function.
11042 (readgram): Check for %prec that is not followed by a symbol.
11043 Handle %dprec and %merge declarations.
11044 (packgram): Initialize dprec and merger fields in rules array.
11046 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
11047 conflict_list_cnt, conflict_list_free): New variables.
11048 (table_grow): Also grow conflict_table.
11049 (prepare_rules): Output dprec and merger tables.
11050 (conflict_row): New function.
11051 (action_row): Output conflict lists for GLR parser. Don't use
11052 default reduction in conflicted states for GLR parser so that there
11053 are spaces for the conflict lists.
11054 (save_row): Also save conflict information.
11055 (token_actions): Allocate conflict list.
11056 (merger_output): New function.
11057 (pack_vector): Pack conflict table, too.
11058 (output_conflicts): New function to output yyconflp and yyconfl.
11059 (output_check): Allocate conflict_tos.
11060 (output_actions): Output conflict tables, also.
11061 (output_skeleton): Output b4_mergers definition.
11062 (prepare): Output b4_max_rhs_length definition.
11063 Use 'bison.glr' as default skeleton for GLR parsers.
11065 * src/gram.c (glr_parser): New flag.
11066 (grammar_free): Call free_merger_functions.
11068 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
11069 all pairs of conflicting reductions, rather than just all tokens
11070 causing conflicts. Needed to size conflict tables.
11071 (conflicts_output): Modify call to count_rr_conflicts for new
11073 (conflicts_print): Ditto.
11074 (count_total_conflicts): New function.
11076 * src/reader.h (merger_list): New type.
11077 (merge_functions): New variable.
11079 * src/lex.h (tok_dprec, tok_merge): New token types.
11081 * src/gram.h (rule_s): Add dprec and merger fields.
11082 (glr_parser): New flag.
11084 * src/conflicts.h (count_total_conflicts): New function.
11086 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
11088 * doc/bison.texinfo (Generalized LR Parsing): New section.
11089 (GLR Parsers): New section.
11090 (Language and Grammar): Mention GLR parsing.
11091 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
11092 Correct typo ("tge" -> "the").
11094 * data/bison.glr: New skeleton for GLR parsing.
11096 * tests/cxx-gram.at: New tests for GLR parsing.
11098 * tests/testsuite.at: Include cxx-gram.at.
11100 * tests/Makefile.am: Add cxx-gram.at.
11102 * src/parse-gram.y:
11104 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
11106 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
11108 2002-06-27 Akim Demaille <akim@epita.fr>
11110 * src/options.h, src/options.c: Remove.
11111 * src/getargs.c (short_options, long_options): New.
11113 2002-06-27 Akim Demaille <akim@epita.fr>
11115 * data/bison.simple, data/bison.c++: Rename as...
11116 * data/yacc.c, data/lalr1.cc: these.
11117 * doc/bison.texinfo (Environment Variables): Remove.
11119 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
11121 * src/getargs.c (report_argmatch): Initialize strtok().
11123 2002-06-20 Akim Demaille <akim@epita.fr>
11125 * data/bison.simple (b4_symbol_actions): New, replaces...
11126 (b4_symbol_destructor, b4_symbol_printer): these.
11127 (yysymprint): Be sure to call YYPRINT only for tokens, and using
11128 user token numbers.
11130 2002-06-20 Akim Demaille <akim@epita.fr>
11132 * data/bison.simple (yydestructor): Rename as...
11133 (yydestruct): this.
11135 2002-06-20 Akim Demaille <akim@epita.fr>
11137 * src/symtab.h, src/symtab.c (symbol_type_set)
11138 (symbol_destructor_set, symbol_precedence_set): The location is
11140 Adjust all callers.
11142 2002-06-20 Akim Demaille <akim@epita.fr>
11144 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
11146 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
11148 * src/symtab.h, src/symtab.c (symbol_class_set)
11149 (symbol_user_token_number_set): Likewise.
11150 Adjust all callers.
11151 Promote complain_at.
11152 * tests/input.at (Type Clashes): Adjust.
11154 2002-06-20 Akim Demaille <akim@epita.fr>
11156 * data/bison.simple (YYLEX): Fix the declaration when
11159 2002-06-20 Akim Demaille <akim@epita.fr>
11161 * data/bison.simple (yysymprint): Don't print the token number,
11163 * tests/actions.at (Destructors): Rename as...
11164 (Printers and Destructors): this.
11165 Also exercise %printer.
11167 2002-06-20 Akim Demaille <akim@epita.fr>
11169 * data/bison.simple (YYDSYMPRINT): New.
11170 Use it to remove many of the #if YYDEBUG/if (yydebug).
11172 2002-06-20 Akim Demaille <akim@epita.fr>
11174 * src/symtab.h, src/symtab.c (symbol_t): printer and
11175 printer_location are new members.
11176 (symbol_printer_set): New.
11177 * src/parse-gram.y (PERCENT_PRINTER): New token.
11178 Handle its associated rule.
11179 * src/scan-gram.l: Adjust.
11180 (handle_destructor_at, handle_destructor_dollar): Rename as...
11181 (handle_symbol_code_at, handle_symbol_code_dollar): these.
11182 * src/output.c (symbol_printers_output): New.
11183 (output_skeleton): Call it.
11184 * data/bison.simple (yysymprint): New. Cannot be named yyprint
11185 since there are already many grammar files with a user `yyprint'.
11186 Replace the calls to YYPRINT to calls to yysymprint.
11187 * tests/calc.at: Adjust.
11188 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
11189 taking advantage of parser very internal details (stack size!).
11191 2002-06-20 Akim Demaille <akim@epita.fr>
11193 * src/scan-gram.l: Complete the scanner with the missing patterns
11195 Use `quote' and `symbol_tag_get' where appropriate.
11197 2002-06-19 Akim Demaille <akim@epita.fr>
11199 * tests/actions.at (Destructors): Augment to test locations.
11200 * data/bison.simple (yydestructor): Pass it the current location
11201 if locations are enabled.
11202 Prototype only when __STDC__ or C++.
11203 Change the argument names to move into the yy name space: there is
11206 2002-06-19 Akim Demaille <akim@epita.fr>
11208 * data/bison.simple (b4_pure_if): New.
11209 Use it instead of #ifdef YYPURE.
11211 2002-06-19 Akim Demaille <akim@epita.fr>
11213 * data/bison.simple (b4_location_if): New.
11214 Use it instead of #ifdef YYLSP_NEEDED.
11216 2002-06-19 Akim Demaille <akim@epita.fr>
11218 Prepare @$ in %destructor, but currently don't bind it in the
11219 skeleton, as %location use is not cleaned up yet.
11221 * src/scan-gram.l (handle_dollar, handle_destructor_at)
11222 (handle_action_at): New.
11223 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
11224 a braced_code_t and a location as additional arguments.
11225 (handle_destructor_dollar): Instead of requiring `b4_eval', just
11226 unquote one when outputting `b4_dollar_dollar'.
11228 * data/bison.simple (b4_eval): Remove.
11229 (b4_symbol_destructor): Adjust.
11230 * tests/input.at (Invalid @n): Adjust.
11232 2002-06-19 Zack Weinberg <zack@codesourcery.com>
11234 * doc/bison.texinfo: Document ability to have multiple
11237 2002-06-18 Akim Demaille <akim@epita.fr>
11239 * src/files.c (compute_base_names): When computing the output file
11240 names from the input file name, strip the directory part.
11242 2002-06-18 Akim Demaille <akim@epita.fr>
11244 * data/bison.simple.new: Comment changes.
11245 Reported by Andreas Schwab.
11247 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
11249 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
11250 there are no `label `yyoverflowlab' defined but not used' warnings
11251 when yyoverflow is defined.
11253 2002-06-18 Akim Demaille <akim@epita.fr>
11255 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
11257 (symbol_destructor_set): Adjust.
11258 * src/output.c (symbol_destructors_output): Output the destructor
11260 Output the symbol name.
11261 * data/bison.simple (b4_symbol_destructor): Adjust.
11263 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
11264 and Akim Demaille <akim@epita.fr>
11266 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
11267 what's left on the stack when the error recovery hits EOF.
11268 * tests/actions.at (Destructors): Complete to exercise this case.
11270 2002-06-17 Akim Demaille <akim@epita.fr>
11272 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
11273 arguments is really empty, not only equal to `[]'.
11274 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
11276 (symbol_destructor_set): New.
11277 * src/output.c (symbol_destructors_output): New.
11278 * src/reader.h (brace_code_t, current_braced_code): New.
11279 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
11280 (handle_dollar): Rename as...
11281 (handle_action_dollar): this.
11282 (handle_destructor_dollar): New.
11283 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
11284 (grammar_declaration): Use it.
11285 * data/bison.simple (yystos): Is always defined.
11286 (yydestructor): New.
11287 * tests/actions.at (Destructors): New.
11288 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
11290 2002-06-17 Akim Demaille <akim@epita.fr>
11292 * src/symlist.h, src/symlist.c (symbol_list_length): New.
11293 * src/scan-gram.l (handle_dollar, handle_at): Compute the
11294 rule_length only when needed.
11295 * src/output.c (actions_output, token_definitions_output): Output
11297 * src/symtab.c: Don't access directly to the symbol tag, use
11299 * src/parse-gram.y: Use symbol_list_free.
11301 2002-06-17 Akim Demaille <akim@epita.fr>
11303 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
11304 (symbol_list_prepend, get_type_name): Move to...
11305 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
11306 (symbol_list_prepend, symbol_list_n_type_name_get): here.
11307 Adjust all callers.
11308 (symbol_list_free): New.
11309 * src/scan-gram.l (handle_dollar): Takes a location.
11310 * tests/input.at (Invalid $n): Adjust.
11312 2002-06-17 Akim Demaille <akim@epita.fr>
11314 * src/reader.h, src/reader.c (symbol_list_new): Export it.
11315 (symbol_list_prepend): New.
11316 * src/parse-gram.y (%union): `list' is a new member.
11317 (symbols.1): New, replaces...
11318 (terms_to_prec.1, nterms_to_type.1): these.
11319 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
11320 Take a location as additional argument.
11321 Adjust all callers.
11323 2002-06-15 Akim Demaille <akim@epita.fr>
11325 * src/parse-gram.y: Move %token in the declaration section so that
11326 we don't depend upon CVS Bison.
11328 2002-06-15 Akim Demaille <akim@epita.fr>
11330 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
11331 * src/print.c (print_core): Use it.
11333 2002-06-15 Akim Demaille <akim@epita.fr>
11335 * src/conflicts.c (log_resolution): Accept the rule involved in
11336 the sr conflicts instead of the lookahead number that points to
11338 (flush_reduce): Accept the current lookahead vector as argument,
11339 instead of the index in LA.
11340 (resolve_sr_conflict): Accept the current number of lookahead
11341 bitset to consider for the STATE, instead of the index in LA.
11342 (set_conflicts): Adjust.
11343 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
11345 2002-06-15 Akim Demaille <akim@epita.fr>
11347 * src/state.h (state_t): Replace the `lookaheadsp' member, a
11348 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
11349 Adjust all dependencies.
11350 * src/lalr.c (initialize_lookaheads): Split into...
11351 (states_lookaheads_count, states_lookaheads_initialize): these.
11354 2002-06-15 Akim Demaille <akim@epita.fr>
11356 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
11358 (grammar_rules_print): here.
11359 * src/reduce.c (reduce_output): Use it.
11360 * tests/reduce.at (Useless Rules, Reduced Automaton)
11361 (Underivable Rules): Adjust.
11363 2002-06-15 Akim Demaille <akim@epita.fr>
11365 Copy BYacc's nice way to report the grammar.
11367 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
11369 Don't print the rules' location, it is confusing and useless.
11370 (rule_print): Use grammar_rhs_print.
11371 * src/print.c (print_grammar): Use grammar_rules_print.
11373 2002-06-15 Akim Demaille <akim@epita.fr>
11375 Complete and rationalize `useless thing' warnings.
11377 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
11378 (symbol_tag_print): New.
11379 Use them everywhere in place of accessing directly the tag member.
11380 * src/gram.h, src/gram.c (rule_print): New.
11381 Use it where a rule used to be printed `by hand'.
11382 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
11383 (reduce_grammar_tables): Report the useless rules.
11384 (reduce_print): Useless things are a warning, not an error.
11386 * tests/reduce.at (Useless Nonterminals, Useless Rules):
11387 (Reduced Automaton, Underivable Rules): Adjust.
11388 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
11389 * tests/conflicts.at (Unresolved SR Conflicts)
11390 (Solved SR Conflicts): Adjust.
11392 2002-06-15 Akim Demaille <akim@epita.fr>
11394 Let symbols have a location.
11396 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
11398 Adjust all callers.
11399 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
11400 Use location_t, not int.
11401 * src/symtab.c (symbol_check_defined): Take advantage of the
11403 * tests/regression.at (Invalid inputs): Adjust.
11405 2002-06-15 Akim Demaille <akim@epita.fr>
11407 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
11408 (input): Don't try to initialize yylloc here, do it in the
11410 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
11411 * src/gram.h (rule_t): Change line and action_line into location
11412 and action_location, of location_t type.
11413 Adjust all dependencies.
11414 * src/location.h, src/location.c (empty_location): New.
11415 * src/reader.h, src/reader.c (grammar_start_symbol_set)
11416 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
11417 (grammar_current_rule_symbol_append)
11418 (grammar_current_rule_action_append): Expect a location as argument.
11419 * src/reader.c (grammar_midrule_action): Adjust to attach an
11420 action's location as dummy symbol location.
11421 * src/symtab.h, src/symtab.c (startsymbol_location): New.
11422 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
11425 2002-06-14 Akim Demaille <akim@epita.fr>
11427 Grammar declarations may be found in the grammar section.
11429 * src/parse-gram.y (rules_or_grammar_declaration): New.
11430 (declarations): Each declaration may end with a semicolon, not
11432 (grammar_declaration): `"%union"'.
11433 (grammar): Branch to rules_or_grammar_declaration.
11435 2002-06-14 Akim Demaille <akim@epita.fr>
11437 * src/main.c (main): Invoke scanner_free.
11439 2002-06-14 Akim Demaille <akim@epita.fr>
11441 * src/output.c (m4_invoke): Extracted from...
11442 (output_skeleton): here.
11445 2002-06-14 Akim Demaille <akim@epita.fr>
11447 * src/parse-gram.y (directives, directive, gram)
11448 (grammar_directives, precedence_directives, precedence_directive):
11450 (declarations, declaration, grammar, grammar_declaration)
11451 (precedence_declaration, precedence_declarator): these.
11452 (symbol_declaration): New.
11454 2002-06-14 Akim Demaille <akim@epita.fr>
11456 * src/files.c (action_obstack): Remove, unused.
11457 (output_obstack): Remove it, and all its dependencies, as it is no
11459 * src/reader.c (epilogue_set): Build the epilogue in the
11461 * src/output.h, src/output.c (muscle_obstack): Move to...
11462 * src/muscle_tab.h, src/muscle_tab.h: here.
11463 (muscle_init): Initialize muscle_obstack.
11464 (muscle_free): New.
11465 * src/main.c (main): Call it.
11467 2002-06-14 Akim Demaille <akim@epita.fr>
11469 * src/location.h: New, extracted from...
11470 * src/reader.h: here.
11471 * src/Makefile.am (noinst_HEADERS): Merge into
11472 (bison_SOURCES): this.
11474 * src/parse-gram.y: Use location_t instead of Bison's.
11475 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11476 Use location_t instead of ints.
11478 2002-06-14 Akim Demaille <akim@epita.fr>
11480 * data/bison.simple, data/bison.c++: Be sure to restore the
11481 current #line when returning to the skeleton contents after having
11482 exposed the input file's #line.
11484 2002-06-12 Akim Demaille <akim@epita.fr>
11486 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11488 * tests/actions.at (Exotic Dollars): New.
11490 2002-06-12 Akim Demaille <akim@epita.fr>
11492 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11494 * tests/input.at (Torturing the Scanner): New.
11496 2002-06-11 Akim Demaille <akim@epita.fr>
11498 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11499 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11500 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11501 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11502 * src/reader.c (reader): Use it.
11504 2002-06-11 Akim Demaille <akim@epita.fr>
11506 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11507 Adjust all callers.
11508 (scanner_last_string_free): New.
11510 2002-06-11 Akim Demaille <akim@epita.fr>
11512 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11513 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11514 (last_string, YY_OBS_FREE): New.
11515 Use them when returning an ID.
11517 2002-06-11 Akim Demaille <akim@epita.fr>
11519 Have Bison grammars parsed by a Bison grammar.
11521 * src/reader.c, src/reader.h (prologue_augment): New.
11522 * src/reader.c (copy_definition): Remove.
11524 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11525 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11526 (grammar_current_rule_prec_set, grammar_current_rule_check)
11527 (grammar_current_rule_symbol_append)
11528 (grammar_current_rule_action_append): Export.
11529 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11530 (symbol_list_action_append): Remove.
11531 Hook the routines from reader.
11532 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11533 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11535 * src/reader.c (read_declarations): Remove, unused.
11537 * src/parse-gram.y: Handle the epilogue.
11538 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11539 (grammar_start_symbol_set): this.
11540 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11541 * src/reader.c (readgram): Remove, unused.
11542 (reader): Adjust to insert eoftoken and axiom where appropriate.
11544 * src/reader.c (copy_dollar): Replace with...
11545 * src/scan-gram.h (handle_dollar): this.
11546 * src/parse-gram.y: Remove `%thong'.
11548 * src/reader.c (copy_at): Replace with...
11549 * src/scan-gram.h (handle_at): this.
11551 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11554 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11557 * src/reader.h, src/reader.c (grammar_rule_end): New.
11559 * src/parse.y (current_type, current_class): New.
11560 Implement `%nterm', `%token' support.
11561 Merge `%term' into `%token'.
11562 (string_as_id): New.
11563 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11566 * src/parse-gram.y: Be sure to handle properly the beginning of
11569 * src/parse-gram.y: Handle %type.
11570 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11572 * src/parse-gram.y: More directives support.
11573 * src/options.c: No longer handle source directives.
11575 * src/parse-gram.y: Fix %output.
11577 * src/parse-gram.y: Handle %union.
11578 Use the prologue locations.
11579 * src/reader.c (parse_union_decl): Remove.
11581 * src/reader.h, src/reader.c (epilogue_set): New.
11582 * src/parse-gram.y: Use it.
11584 * data/bison.simple, data/bison.c++: b4_stype is now either not
11585 defined, then default to int, or to the contents of %union,
11586 without `union' itself.
11588 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11590 * src/output.c (actions_output): Don't output braces, as they are
11591 already handled by the scanner.
11593 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11594 characters to themselves.
11596 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11597 that the epilogue has a proper #line.
11599 * src/parse-gram.y: Handle precedence/associativity.
11601 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11603 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11604 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11605 at all to define terminals that cannot be emitted.
11607 * src/scan-gram.l: Escape M4 characters.
11609 * src/scan-gram.l: Working properly with escapes in user
11610 strings/characters.
11612 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11613 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11615 Use more modest sizes, as for the time being the parser does not
11616 release memory, and therefore the process swallows a huge amount
11619 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11620 stricter %token grammar.
11622 * src/symtab.h (associativity): Add `undef_assoc'.
11623 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11624 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11626 * tests/regression.at (Invalid %directive): Remove, as it is now
11628 (Invalid inputs): Adjust to the new error messages.
11629 (Token definitions): The new grammar doesn't allow too many
11632 * src/lex.h, src/lex.c: Remove.
11633 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11634 (copy_character, copy_string2, copy_string, copy_identifier)
11635 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11636 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11637 (parse_action): Remove.
11638 * po/POTFILES.in: Adjust.
11640 2002-06-11 Akim Demaille <akim@epita.fr>
11642 * src/reader.c (parse_action): Don't store directly into the
11643 rule's action member: return the action as a string.
11644 Don't require `rule_length' as an argument: compute it.
11645 (grammar_current_rule_symbol_append)
11646 (grammar_current_rule_action_append): New, eved out from
11648 Remove `action_flag', `rulelength', unused now.
11650 2002-06-11 Akim Demaille <akim@epita.fr>
11652 * src/reader.c (grammar_current_rule_prec_set).
11653 (grammar_current_rule_check): New, eved out from...
11655 Remove `xaction', `first_rhs': useless.
11656 * tests/input.at (Type clashes): New.
11657 * tests/existing.at (GNU Cim Grammar): Adjust.
11659 2002-06-11 Akim Demaille <akim@epita.fr>
11661 * src/reader.c (grammar_midrule_action): New, Eved out from
11664 2002-06-11 Akim Demaille <akim@epita.fr>
11666 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11668 (readgram): Use them as replacement of inlined code, crule and
11671 2002-06-11 Akim Demaille <akim@epita.fr>
11673 * src/reader.c (grammar_end, grammar_symbol_append): New.
11674 (readgram): Use them.
11675 Make the use of `p' as local as possible.
11677 2002-06-10 Akim Demaille <akim@epita.fr>
11679 GCJ's parser requires the tokens to be defined before the prologue.
11681 * data/bison.simple: Output the token definition before the user's
11683 * tests/regression.at (Braces parsing, Duplicate string)
11684 (Mixing %token styles): Check the output from bison.
11685 (Early token definitions): New.
11687 2002-06-10 Akim Demaille <akim@epita.fr>
11689 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11690 assigning twice the same user number to a token, so that we can
11692 * src/lex.c (lex): here.
11693 Also use `symbol_class_set' instead of hand written code.
11694 * src/reader.c (parse_assoc_decl): Likewise.
11696 2002-06-10 Akim Demaille <akim@epita.fr>
11698 * src/symtab.c, src/symtab.c (symbol_class_set)
11699 (symbol_user_token_number_set): New.
11700 * src/reader.c (parse_token_decl): Use them.
11701 Use a switch instead of ifs.
11702 Use a single argument.
11704 2002-06-10 Akim Demaille <akim@epita.fr>
11706 Remove `%thong' support as it is undocumented, unused, duplicates
11707 `%token's job, and creates useless e-mail traffic with people who
11708 want to know what it is, why it is undocumented, unused, and
11709 duplicates `%token's job.
11711 * src/reader.c (parse_thong_decl): Remove.
11712 * src/options.c (option_table): Remove "thong".
11713 * src/lex.h (tok_thong): Remove.
11715 2002-06-10 Akim Demaille <akim@epita.fr>
11717 * src/symtab.c, src/symtab.c (symbol_type_set)
11718 (symbol_precedence_set): New.
11719 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11720 (value_components_used): Remove, unused.
11722 2002-06-09 Akim Demaille <akim@epita.fr>
11724 Move symbols handling code out of the reader.
11726 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11727 (axiom): Move to...
11728 * src/symtab.h, src/symtab.c: here.
11730 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11731 * src/reader.c (startval): Rename as...
11732 * src/symtab.h, src/symtab.c (startsymbol): this.
11733 * src/reader.c: Adjust.
11735 * src/reader.c (symbol_check_defined, symbol_make_alias)
11736 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11737 (token_translations_init)
11739 * src/symtab.c: here.
11740 * src/reader.c (packsymbols): Move to...
11741 * src/symtab.h, src/symtab.c (symbols_pack): here.
11742 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11745 2002-06-03 Akim Demaille <akim@epita.fr>
11747 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11750 2002-06-03 Akim Demaille <akim@epita.fr>
11752 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11753 structs with non literals.
11754 * src/scan-skel.l: never-interactive.
11755 * src/conflicts.c (enum conflict_resolution_e): No trailing
11757 * src/getargs.c (usage): Split long literal strings.
11758 Reported by Hans Aberg.
11760 2002-05-28 Akim Demaille <akim@epita.fr>
11762 * data/bison.c++: Use C++ ostreams.
11763 (cdebug_): New member.
11765 2002-05-28 Akim Demaille <akim@epita.fr>
11767 * src/output.c (output_skeleton): Be sure to allocate enough room
11768 for `/' _and_ for `\0' in full_skeleton.
11770 2002-05-28 Akim Demaille <akim@epita.fr>
11772 * data/bison.c++: Catch up with bison.simple:
11773 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11774 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11775 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11776 and popping traces.
11778 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11780 * src/output.c (output_skeleton): Put an explicit path in front of
11781 the skeleton file name, rather than relying on the -I directory,
11782 to partially alleviate effects of having a skeleton file lying around
11783 in the current directory.
11785 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11787 * src/conflicts.c (log_resolution): Correct typo:
11788 obstack_printf should be obstack_fgrow1.
11790 2002-05-26 Akim Demaille <akim@epita.fr>
11792 * src/state.h (state_t): `solved_conflicts' is a new member.
11793 * src/LR0.c (new_state): Set it to 0.
11794 * src/conflicts.h, src/conflicts.c (print_conflicts)
11795 (free_conflicts, solve_conflicts): Rename as...
11796 (conflicts_print, conflicts_free, conflicts_solve): these.
11798 * src/conflicts.c (enum conflict_resolution_e)
11799 (solved_conflicts_obstack): New, used by...
11800 (log_resolution): this.
11801 Adjust to attach the conflict resolution to each state.
11802 Complete the description with the precedence/associativity
11804 (resolve_sr_conflict): Adjust.
11805 * src/print.c (print_state): Output its solved_conflicts.
11806 * tests/conflicts.at (Unresolved SR Conflicts)
11807 (Solved SR Conflicts): Exercise --report=all.
11809 2002-05-26 Akim Demaille <akim@epita.fr>
11811 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11812 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11813 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11814 (token_number_t, item_number_as_token_number)
11815 (token_number_as_item_number, muscle_insert_token_number_table):
11817 (symbol_number_t, item_number_as_symbol_number)
11818 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11819 these, since it is more appropriate.
11821 2002-05-26 Akim Demaille <akim@epita.fr>
11823 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11825 * data/bison.simple (yystos) [YYDEBUG]: New.
11826 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11828 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11830 2002-05-25 Akim Demaille <akim@epita.fr>
11832 * doc/bison.texinfo (Debugging): Split into...
11833 (Tracing): this new section, its former contents, and...
11834 (Understanding): this new section.
11835 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11837 (report_flag): this.
11838 Adjust all dependencies.
11839 (report_args, report_types, report_argmatch): New.
11840 (usage, getargs): Report/support -r, --report.
11842 (struct option_table_struct): Rename as..,
11843 (struct option_table_s): this.
11844 Rename the `set_flag' member to `flag' to match with getopt_long's
11846 * src/options.c (option_table): Split verbose into an entry for
11847 %verbose, and another for --verbose.
11848 Support --report/-r, so remove -r from the obsolete --raw.
11849 * src/print.c: Attach full item sets and lookaheads reports to
11850 report_flag instead of trace_flag.
11851 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11853 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11854 and Paul Eggert <eggert@twinsun.com>
11856 * data/bison.simple (yyparse): Correct error handling to conform to
11857 POSIX and yacc. Specifically, after syntax error is discovered,
11858 do not reduce further before shifting the error token.
11859 Clean up the code a bit by removing the labels yyerrdefault,
11860 yyerrhandle, yyerrpop.
11861 * NEWS: Document the above.
11863 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11865 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11866 type; it isn't always big enough, since it doesn't necessarily
11867 include non-terminals.
11868 (yytranslate): Expand definition of yy_token_number_type, so that
11869 the latter can be removed.
11870 (yy_token_number_type): Remove, only one use.
11871 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11872 don't use TokenNumberType as element type.
11874 * tests/regression.at: Modify expected output to agree with change
11875 to yyr1 and yytranslate.
11877 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11879 * src/reader.c (parse_action): Use copy_character instead of
11882 2002-05-13 Akim Demaille <akim@epita.fr>
11884 * tests/regression.at (Token definitions): Prototype yylex and
11887 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11889 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
11890 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11892 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11894 2002-05-07 Akim Demaille <akim@epita.fr>
11896 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11897 avoid GCC warnings.
11899 2002-05-07 Akim Demaille <akim@epita.fr>
11903 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11904 over the RHS of each rule.
11905 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11906 * src/state.h (state_t): Member `nitems' is unsigned short.
11907 * src/LR0.c (get_state): Adjust.
11908 * src/reader.c (packgram): Likewise.
11909 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11911 (muscle_insert_int_table): Remove, unused.
11912 (prepare_rules): Remove `max'.
11914 2002-05-06 Akim Demaille <akim@epita.fr>
11916 * src/closure.c (print_firsts): Display of the symbol tags.
11917 (bitmatrix_print): Move to...
11918 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11920 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11922 2002-05-06 Akim Demaille <akim@epita.fr>
11924 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11927 2002-05-06 Akim Demaille <akim@epita.fr>
11929 * src/LR0.c (new_state, get_state): Instead of using the global
11930 `kernel_size' and `kernel_base', have two new arguments:
11931 `core_size' and `core'.
11934 2002-05-06 Akim Demaille <akim@epita.fr>
11936 * src/reader.c (packgram): No longer end `ritem' with a 0
11937 sentinel: it is not used.
11939 2002-05-05 Akim Demaille <akim@epita.fr>
11941 New experimental feature: display the lookaheads in the report and
11944 * src/print (print_core): When --trace-flag, display the rules
11946 * src/print_graph.c (print_core): Likewise.
11947 Swap the arguments.
11950 2002-05-05 Akim Demaille <akim@epita.fr>
11952 * tests/torture.at (Many lookaheads): New test.
11954 2002-05-05 Akim Demaille <akim@epita.fr>
11956 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11957 (GENERATE_MUSCLE_INSERT_TABLE): this.
11958 (output_int_table, output_unsigned_int_table, output_short_table)
11959 (output_token_number_table, output_item_number_table): Replace with...
11960 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
11961 (muscle_insert_short_table, muscle_insert_token_number_table)
11962 (muscle_insert_item_number_table): these.
11963 Adjust all callers.
11964 (prepare_tokens): Don't free `translations', since...
11965 * src/reader.h, src/reader.c (grammar_free): do it.
11967 * src/gram.h, src/gram.c (grammar_free): here.
11968 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11971 2002-05-05 Akim Demaille <akim@epita.fr>
11973 * src/output.c (output_unsigned_int_table): New.
11974 (prepare_rules): `i' is unsigned.
11975 `prhs', `rline', `r2' are unsigned int.
11976 Rename muscle `rhs_number_max' as `rhs_max'.
11977 Output muscles `prhs_max', `rline_max', and `r2_max'.
11979 * data/bison.simple, data/bison.c++: Adjust to use these muscles
11980 to compute types instead of constant types.
11981 * tests/regression.at (Web2c Actions): Adjust.
11983 2002-05-04 Akim Demaille <akim@epita.fr>
11985 * src/symtab.h (SALIAS, SUNDEF): Rename as...
11986 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
11987 Adjust dependencies.
11988 * src/output.c (token_definitions_output): Be sure not to output a
11989 `#define 'a'' when fed with `%token 'a' "a"'.
11990 * tests/regression.at (Token definitions): New.
11992 2002-05-03 Paul Eggert <eggert@twinsun.com>
11994 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11997 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11999 * Makefile.am (SUBDIRS): Remove intl.
12000 (EXTRA_DIST): Add config/config.rpath.
12002 2002-05-03 Akim Demaille <akim@epita.fr>
12004 * data/bison.simple (m4_if): Don't output empty enums.
12005 And actually, output valid enum definitions :(.
12007 2002-05-03 Akim Demaille <akim@epita.fr>
12009 * configure.bat: Remove, completely obsolete.
12010 * Makefile.am (EXTRA_DIST): Adjust.
12011 Don't distribute config.rpath...
12012 * config/Makefile.am (EXTRA_DIST): Do it.
12014 2002-05-03 Akim Demaille <akim@epita.fr>
12016 * configure.in (GETTEXT_VERSION): New.
12017 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
12019 2002-05-03 Akim Demaille <akim@epita.fr>
12021 * data/bison.simple (b4_token_enum): New.
12022 (b4_token_defines): Use it to output tokens both as #define and
12024 Suggested by Paul Eggert.
12025 * src/output.c (token_definitions_output): Don't output spurious
12028 2002-05-03 Akim Demaille <akim@epita.fr>
12030 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12032 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
12034 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
12035 Update the stack class, give a try to deque as the default container.
12037 2002-05-02 Akim Demaille <akim@epita.fr>
12039 * data/bison.simple (yyparse): Do not implement @$ = @1.
12040 (YYLLOC_DEFAULT): Adjust to do it.
12041 * doc/bison.texinfo (Location Default Action): Fix.
12043 2002-05-02 Akim Demaille <akim@epita.fr>
12045 * src/reader.c (parse_braces): Merge into...
12046 (parse_action): this.
12048 2002-05-02 Akim Demaille <akim@epita.fr>
12050 * configure.in (ALL_LINGUAS): Remove.
12051 * po/LINGUAS, hr.po: New.
12053 2002-05-02 Akim Demaille <akim@epita.fr>
12055 Remove the so called hairy (semantic) parsers.
12057 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
12058 * src/gram.h, src/gram.c (semantic_parser): Remove.
12059 (rule_t): Remove the guard and guard_line members.
12060 * src/lex.h (token_t): remove tok_guard.
12061 * src/options.c (option_table): Remove %guard and %semantic_parser
12063 * src/output.c, src/output.h (guards_output): Remove.
12065 (token_definitions_output): Don't output the `T'
12067 (output_skeleton): Don't output the guards.
12068 * src/files.c, src/files.c (attrsfile): Remove.
12069 * src/reader.c (symbol_list): Remove the guard and guard_line
12071 Adjust dependencies.
12072 (parse_guard): Remove.
12073 * data/bison.hairy: Remove.
12074 * doc/bison.texinfo (Environment Variables): Remove occurrences of
12077 2002-05-02 Akim Demaille <akim@epita.fr>
12079 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
12080 (parse_guard): Rename the formal argument `stack_offset' as
12081 `rule_length', which is more readable.
12083 (copy_at, copy_dollar): Instead of outputting the hard coded
12084 values of $$, $n and so forth, output invocation to b4_lhs_value,
12085 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
12086 Note: this patch partially drops `semantic-parser' support: it
12087 always does `rule_length - n', where semantic parsers ought to
12089 * data/bison.simple, data/bison.c++ (b4_lhs_value)
12090 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12092 2002-05-02 Akim Demaille <akim@epita.fr>
12094 * configure.in (AC_INIT): Bump to 1.49b.
12095 (AM_INIT_AUTOMAKE): Short invocation.
12097 2002-05-02 Akim Demaille <akim@epita.fr>
12101 2002-05-01 Akim Demaille <akim@epita.fr>
12103 * src/skeleton.h: Remove.
12105 2002-05-01 Akim Demaille <akim@epita.fr>
12107 * src/skeleton.h: Fix the #endif.
12108 Reported by Magnus Fromreide.
12110 2002-04-26 Paul Eggert <eggert@twinsun.com>
12112 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
12113 Define if we define YYSTYPE and YYLTYPE, respectively.
12114 (YYCOPY): Fix [] quoting problem in the non-GCC case.
12116 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
12118 * src/scan-skel.l: Postprocess quadrigraphs.
12120 * src/reader.c (copy_character): New function, used to output
12121 single characters while replacing `[' and `]' with quadrigraphs, to
12122 avoid troubles with M4 quotes.
12123 (copy_comment): Output characters with copy_character.
12124 (read_additionnal_code): Likewise.
12125 (copy_string2): Likewise.
12126 (copy_definition): Likewise.
12128 * tests/calc.at: Exercise M4 quoting.
12130 2002-04-25 Akim Demaille <akim@epita.fr>
12132 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
12133 between `!' and the command.
12134 Reported by Paul Eggert.
12136 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
12138 * tests/calc.at: Exercise prologue splitting.
12140 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
12141 `b4_post_prologue' instead of `b4_prologue'.
12143 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
12145 (output): Free pre_prologue_obstack and post_prologue_obstack.
12146 * src/files.h, src/files.c (attrs_obstack): Remove.
12147 (pre_prologue_obstack, post_prologue_obstack): New.
12148 * src/reader.c (copy_definition): Add a parameter to specify the
12149 obstack to fill, instead of using attrs_obstack unconditionally.
12150 (read_declarations): Pass pre_prologue_obstack to copy_definition if
12151 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
12153 2002-04-23 Paul Eggert <eggert@twinsun.com>
12155 * data/bison.simple: Remove unnecessary commentary and white
12156 space differences from 1_29-branch.
12157 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
12159 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
12160 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
12161 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
12162 constructors or destructors.
12164 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
12166 2002-04-23 Akim Demaille <akim@epita.fr>
12168 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
12169 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
12170 location with columns.
12171 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
12172 All reported by Paul Eggert.
12174 2002-04-22 Akim Demaille <akim@epita.fr>
12176 * src/reduce.c (dump_grammar): Move to...
12177 * src/gram.h, src/gram.c (grammar_dump): here.
12178 Be sure to separate long item numbers.
12179 Don't read the members of a rule's prec if its nil.
12181 2002-04-22 Akim Demaille <akim@epita.fr>
12183 * src/output.c (table_size, table_grow): New.
12184 (MAXTABLE): Remove, replace uses with table_size.
12185 (pack_vector): Instead of dying when the table is too big, grow it.
12187 2002-04-22 Akim Demaille <akim@epita.fr>
12189 * data/bison.simple (yyr1): Its type is that of a token number.
12190 * data/bison.c++ (r1_): Likewise.
12191 * tests/regression.at (Web2c Actions): Adjust.
12193 2002-04-22 Akim Demaille <akim@epita.fr>
12195 * src/reader.c (token_translations_init): 256 is now the default
12196 value for the error token, i.e., it will be assigned another
12197 number if the user assigned 256 to one of her tokens.
12198 (reader): Don't force 256 to error.
12199 * doc/bison.texinfo (Symbols): Adjust.
12200 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
12201 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
12202 etc. instead of 10, 20, 30 (which was used to `jump' over error
12203 (256) and undefined (2)).
12205 2002-04-22 Akim Demaille <akim@epita.fr>
12207 Propagate more token_number_t.
12209 * src/gram.h (token_number_as_item_number)
12210 (item_number_as_token_number): New.
12211 * src/output.c (GENERATE_OUTPUT_TABLE): New.
12212 Use it to create output_item_number_table and
12213 output_token_number_table.
12214 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12215 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
12216 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
12217 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
12219 2002-04-22 Akim Demaille <akim@epita.fr>
12221 * src/output.h, src/output.c (get_lines_number): Remove.
12223 2002-04-19 Akim Demaille <akim@epita.fr>
12225 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
12227 (Debugging): More details about enabling the debugging features.
12228 (Table of Symbols): Describe $$, $n, @$, and @n.
12229 Suggested by Tim Josling.
12231 2002-04-19 Akim Demaille <akim@epita.fr>
12233 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
12235 2002-04-10 Akim Demaille <akim@epita.fr>
12237 * src/system.h: Rely on HAVE_LIMITS_H.
12238 Suggested by Paul Eggert.
12240 2002-04-09 Akim Demaille <akim@epita.fr>
12242 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
12243 full stderr, and strip it according to the bison options, instead
12244 of composing the error message from different bits.
12245 This makes it easier to check for several error messages.
12246 Adjust all the invocations.
12247 Add an invocation exercising the error token.
12248 Add an invocation demonstrating a stupid error message.
12249 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
12251 Error message are for stderr, not stdout.
12253 2002-04-09 Akim Demaille <akim@epita.fr>
12255 * src/gram.h, src/gram.c (error_token_number): Remove, use
12257 * src/reader.c (reader): Don't specify the user token number (2)
12258 for $undefined, as it uselessly prevents using it.
12259 * src/gram.h (token_number_t): Move to...
12260 * src/symtab.h: here.
12261 (state_t.number): Is a token_number_t.
12262 * src/print.c, src/reader.c: Use undeftoken->number instead of
12264 (Even though this 2 is not the same as above: the number of the
12265 undeftoken remains being 2, it is its user token number which
12267 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
12268 `user_token_number_max'.
12269 Output `undef_token_number'.
12270 * data/bison.simple, data/bison.c++: Use them.
12271 Be sure to map invalid yylex return values to
12272 `undef_token_number'. This saves us from gratuitous SEGV.
12274 * tests/conflicts.at (Solved SR Conflicts)
12275 (Unresolved SR Conflicts): Adjust.
12276 * tests/regression.at (Web2c Actions): Adjust.
12278 2002-04-08 Akim Demaille <akim@epita.fr>
12280 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
12282 Remove the duplicate `typedefs'.
12283 (RhsNumberType): Fix the declaration and various other typos.
12285 * data/bison.simple: Use __ofile__.
12286 * src/scan-skel.l: Handle __ofile__.
12288 2002-04-08 Akim Demaille <akim@epita.fr>
12290 * src/gram.h (item_number_t): New, the type of item numbers in
12291 RITEM. Note that it must be able to code symbol numbers as
12292 positive number, and the negation of rule numbers as negative
12294 Adjust all dependencies (pretty many).
12295 * src/reduce.c (rule): Remove this `short *' pointer: use
12297 * src/system.h (MINSHORT, MAXSHORT): Remove.
12298 Include `limits.h'.
12299 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
12300 (shortcpy): Remove.
12301 (MAXTABLE): Move to...
12302 * src/output.c (MAXTABLE): here.
12303 (prepare_rules): Use output_int_table to output rhs.
12304 * data/bison.simple, data/bison.c++: Adjust.
12305 * tests/torture.at (Big triangle): Move the limit from 254 to
12307 * tests/regression.at (Web2c Actions): Ajust.
12309 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
12310 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
12311 passes, but produces negative #line number, once fixed, GCC is
12312 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
12314 * src/state.h (state_h): Code input lines on ints, not shorts.
12316 2002-04-08 Akim Demaille <akim@epita.fr>
12318 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
12319 and then the grammar.
12321 2002-04-08 Akim Demaille <akim@epita.fr>
12323 * src/system.h: No longer using strndup.
12325 2002-04-07 Akim Demaille <akim@epita.fr>
12327 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
12328 * src/output.c (output_table_data): Return the longest number.
12329 (prepare_tokens): Output `token_number_max').
12330 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
12332 Use them to define yy_token_number_type/TokenNumberType.
12333 Use this type for yytranslate.
12334 * tests/torture.at (Big triangle): Push the limit from 124 to
12336 * tests/regression.at (Web2c Actions): Adjust.
12338 2002-04-07 Akim Demaille <akim@epita.fr>
12340 * tests/torture.at (Big triangle): New.
12341 (GNU AWK Grammar, GNU Cim Grammar): Move to...
12342 * tests/existing.at: here.
12344 2002-04-07 Akim Demaille <akim@epita.fr>
12346 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
12348 Adjust dependencies.
12350 2002-04-07 Akim Demaille <akim@epita.fr>
12352 * src/reader.c: Normalize increments to prefix form.
12354 2002-04-07 Akim Demaille <akim@epita.fr>
12356 * src/reader.c, symtab.c: Remove debugging code.
12358 2002-04-07 Akim Demaille <akim@epita.fr>
12360 Rename all the `bucket's as `symbol_t'.
12362 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
12363 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
12364 * src/symtab.c, src/symtab.h (bucket): Rename as...
12366 (symbol_list_new, bucket_check_defined, bucket_make_alias)
12367 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
12368 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12369 (buckets_new, buckets_free, buckets_do): Rename as...
12370 (symbol_list_new, symbol_check_defined, symbol_make_alias)
12371 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12372 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
12373 (symbols_new, symbols_free, symbols_do): these.
12375 2002-04-07 Akim Demaille <akim@epita.fr>
12377 Use lib/hash for the symbol table.
12379 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
12381 * src/lex.c (lex): Set the `number' member of new terminals.
12382 * src/reader.c (bucket_check_defined, bucket_make_alias)
12383 (bucket_check_alias_consistence, bucket_translation): New.
12384 (reader, grammar_free, readgram, token_translations_init)
12385 (packsymbols): Adjust.
12386 (reader): Number the predefined tokens.
12387 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
12388 for predefined tokens.
12389 * src/symtab.h (bucket): Remove all the hash table related
12391 * src/symtab.c (symtab): Replace by...
12392 (bucket_table): this.
12393 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12394 (buckets_new, buckets_do): New.
12396 2002-04-07 Akim Demaille <akim@epita.fr>
12398 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
12399 (start_symbol, max_user_token_number, semantic_parser)
12400 (error_token_number): Initialize.
12401 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
12404 (errtoken, eoftoken, undeftoken, axiom): Extern.
12406 2002-04-07 Akim Demaille <akim@epita.fr>
12408 * src/gram.h (rule_s): prec and precsym are now pointers
12409 to the bucket giving the priority/associativity.
12410 Member `associativity' removed: useless.
12411 * src/reduce.c, src/conflicts.c: Adjust.
12413 2002-04-07 Akim Demaille <akim@epita.fr>
12415 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
12416 Properly escape the symbols' TAG when outputting them.
12418 2002-04-07 Akim Demaille <akim@epita.fr>
12420 * src/lalr.h (LA): Is a bitsetv, not bitset*.
12422 2002-04-07 Akim Demaille <akim@epita.fr>
12424 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
12425 (LArule): this, which is an array to rule_t*.
12426 * src/print.c, src/conflicts.c: Adjust.
12428 2002-04-07 Akim Demaille <akim@epita.fr>
12430 * src/gram.h (rule_t): Rename `number' as `user_number'.
12431 `number' is a new member.
12432 Adjust dependencies.
12433 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
12435 2002-04-07 Akim Demaille <akim@epita.fr>
12437 As a result of the previous patch, it is no longer needed
12438 to reorder ritem itself.
12440 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12442 2002-04-07 Akim Demaille <akim@epita.fr>
12444 Be sure never to walk through RITEMS, but use only data related to
12445 the rules themselves. RITEMS should be banished.
12447 * src/output.c (output_token_translations): Rename as...
12448 (prepare_tokens): this.
12449 In addition to `translate', prepare the muscles `tname' and
12450 `toknum', which were handled by...
12451 (output_rule_data): this.
12452 Remove, and move the remainder of its outputs into...
12453 (prepare_rules): this new routines, which also merges content from
12454 (output_gram): this.
12455 (prepare_rules): Be sure never to walk through RITEMS.
12456 (output_stos): Rename as...
12457 (prepare_stos): this.
12458 (output): Always invoke prepare_states, after all, just don't use it
12459 in the output if you don't need it.
12461 2002-04-07 Akim Demaille <akim@epita.fr>
12463 * src/LR0.c (new_state): Display `nstates' as the name of the
12464 newly created state.
12465 Adjust to initialize first_state and last_state if needed.
12466 Be sure to distinguish the initial from the final state.
12467 (new_states): Create the itemset of the initial state, and use
12469 * src/closure.c (closure): Now that the initial state has its
12470 items properly set, there is no need for a special case when
12471 creating `ruleset'.
12473 As a result, now the rule 0, reducing to $axiom, is visible in the
12474 outputs. Adjust the test suite.
12476 * tests/conflicts.at (Solved SR Conflicts)
12477 (Unresolved SR Conflicts): Adjust.
12478 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12479 * tests/conflicts.at (S/R in initial): New.
12481 2002-04-07 Akim Demaille <akim@epita.fr>
12483 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12484 the RHS of the rules.
12485 * src/output.c (output_gram): Likewise.
12487 2002-04-07 Akim Demaille <akim@epita.fr>
12489 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12491 Adjust all dependencies.
12492 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12493 `number' of the buckets too.
12494 * src/gram.h: Include `symtab.h'.
12495 (associativity): Move to...
12496 * src/symtab.h: here.
12497 No longer include `gram.h'.
12499 2002-04-07 Akim Demaille <akim@epita.fr>
12501 * src/gram.h, src/gram.c (rules_rhs_length): New.
12502 (ritem_longest_rhs): Use it.
12503 * src/gram.h (rule_t): `number' is a new member.
12504 * src/reader.c (packgram): Set it.
12505 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12506 the end of `rules', and count them out of `nrules'.
12507 (reduce_output, dump_grammar): Adjust.
12508 * src/print.c (print_grammar): It is no longer needed to check for
12509 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12510 * tests/reduce.at (Reduced Automaton): New test.
12512 2002-04-07 Akim Demaille <akim@epita.fr>
12514 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12515 lacking `+ 1' to nrules, Bison reported as useless a token if it
12516 was used solely to set the precedence of the last rule...
12518 2002-04-07 Akim Demaille <akim@epita.fr>
12520 * data/bison.c++, data/bison.simple: Don't output the current file
12521 name in #line, to avoid useless diffs between two identical
12522 outputs under different names.
12524 2002-04-07 Akim Demaille <akim@epita.fr>
12526 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12527 Normalize loops to using `< nrules + 1', not `<= nrules'.
12529 2002-04-07 Akim Demaille <akim@epita.fr>
12533 2002-04-07 Akim Demaille <akim@epita.fr>
12535 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12536 bucket.value as bucket.number.
12538 2002-04-07 Akim Demaille <akim@epita.fr>
12540 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12541 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12542 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12543 RHS, instead of being an index in RITEMS.
12545 2002-04-04 Paul Eggert <eggert@twinsun.com>
12547 * doc/bison.texinfo: Update copyright date.
12548 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12549 (Symbols): Warn about running Bison in one character set,
12550 but compiling and/or running in an incompatible one.
12551 Warn about character code 256, too.
12553 2002-04-03 Paul Eggert <eggert@twinsun.com>
12555 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12556 YYERROR_VERBOSE is nonzero, not whether it is defined.
12558 Merge changes from bison-1_29-branch.
12560 2002-03-20 Paul Eggert <eggert@twinsun.com>
12562 Merge fixes from Debian bison_1.34-1.diff.
12564 * configure.in (AC_PREREQ): 2.53.
12566 2002-03-20 Akim Demaille <akim@epita.fr>
12568 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12570 2002-03-19 Paul Eggert <eggert@twinsun.com>
12572 * src/bison.simple (YYCOPY): New macro.
12573 (YYSTACK_RELOCATE): Use it.
12574 Remove Type arg; no longer needed. All callers changed.
12575 (yymemcpy): Remove; no longer needed.
12577 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12578 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12580 2002-03-19 Akim Demaille <akim@epita.fr>
12582 Test and fix the #line outputs.
12584 * tests/atlocal.at (GCC): New.
12585 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
12586 (Prologue synch line, %union synch line, Postprologue synch line)
12587 (Action synch line, Epilogue synch line): New tests.
12588 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12589 * data/bison.simple, data/bison.c++: Use it.
12591 2002-03-19 Akim Demaille <akim@epita.fr>
12593 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12594 (Solved SR Conflicts, %expect not enough, %expect right)
12595 (%expect too much): Move to...
12596 * tests/conflicts.at: this new file.
12598 2002-03-19 Akim Demaille <akim@epita.fr>
12600 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12601 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12602 that we can move to enums for instance.
12603 * src/output.c (token_definitions_output): Output a list of
12604 `token-name, token-number' instead of the #define.
12605 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12607 2002-03-14 Akim Demaille <akim@epita.fr>
12609 Use Gettext 0.11.1.
12611 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
12613 * data/bison.c++: Make the user able to add members to the generated
12614 parser by subclassing.
12616 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
12618 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12620 Reported by Nicolas Tisserand and Nicolas Burrus.
12622 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12624 * src/reader.c: Warn about lacking semi-colons, do not complain.
12626 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12628 * data/bison.c++: Remove a debug line.
12630 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12632 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12633 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12634 provide a default implementation.
12636 2002-03-04 Akim Demaille <akim@epita.fr>
12638 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12639 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12640 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12641 * tests/semantic.at (Parsing Guards): Similarly.
12642 * src/reader.at (readgram): Complain if the last rule is not ended
12645 2002-03-04 Akim Demaille <akim@epita.fr>
12647 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12648 * src/closure.c: here.
12649 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12651 * src/warshall.h, src/warshall.c: Remove.
12652 * tests/sets.at (Broken Closure): Adjust.
12654 2002-03-04 Akim Demaille <akim@epita.fr>
12656 * src/output.c (output_skeleton): tempdir is const.
12657 bytes_read is unused.
12659 2002-03-04 Akim Demaille <akim@epita.fr>
12661 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12662 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12664 From Michael Hayes.
12666 2002-03-04 Akim Demaille <akim@epita.fr>
12668 * src/closure.c (closure): `r' is unused.
12670 2002-03-04 Akim Demaille <akim@epita.fr>
12672 * tests/sets.at (Broken Closure): Add the ending `;'.
12673 * src/reader.at (readgram): Complain if a rule is not ended with a
12676 2002-03-04 Akim Demaille <akim@epita.fr>
12678 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12679 (count_sr_conflicts): Use bitset_count.
12680 * src/reduce.c (inaccessable_symbols): Ditto.
12681 (bits_size): Remove.
12682 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12684 2002-03-04 Akim Demaille <akim@epita.fr>
12686 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12687 * src/reduce.c: Remove the `bitset_zero's following the
12688 `bitset_create's, as now it is performed by the latter.
12690 2002-03-04 Akim Demaille <akim@epita.fr>
12692 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12693 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12694 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12695 latest sources from Michael.
12697 2002-03-04 Akim Demaille <akim@epita.fr>
12699 * src/output.c (output): Don't free the grammar.
12700 * src/reader.c (grammar_free): New.
12701 * src/main.c (main): Call it and don't free symtab here.
12703 2002-03-04 Akim Demaille <akim@epita.fr>
12705 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12707 Reported by Benoit Perrot.
12709 2002-03-04 Akim Demaille <akim@epita.fr>
12711 Use bitset operations when possible, not loops over bits.
12713 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12715 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12716 * src/reduce.c (useless_nonterminals): Formatting changes.
12717 * src/warshall.c (TC): Use bitset_or.
12719 2002-03-04 Akim Demaille <akim@epita.fr>
12721 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12722 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12725 2002-03-04 Akim Demaille <akim@epita.fr>
12727 * src/lalr.c (F): Now a bitset*.
12728 Adjust all dependencies.
12730 2002-03-04 Akim Demaille <akim@epita.fr>
12732 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12733 Adjust all dependencies.
12735 2002-03-04 Akim Demaille <akim@epita.fr>
12737 * src/L0.c, src/LR0.h (nstates): Be size_t.
12738 Adjust comparisons (signed vs unsigned).
12739 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12741 Adjust all dependencies.
12743 2002-03-04 Akim Demaille <akim@epita.fr>
12745 * src/closure.c (firsts): Now, also a bitset.
12746 Adjust all dependencies.
12747 (varsetsize): Remove, now unused.
12748 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12750 2002-03-04 Akim Demaille <akim@epita.fr>
12752 * src/print.c: Convert to use bitset.h, not hand coded iterations
12755 2002-03-04 Akim Demaille <akim@epita.fr>
12757 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12759 2002-03-04 Akim Demaille <akim@epita.fr>
12761 * src/closure.c (ruleset): Be a bitset.
12762 (rulesetsize): Remove.
12764 2002-03-04 Akim Demaille <akim@epita.fr>
12766 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12767 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12768 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12769 * src/closure.c (fderives): Be an array of bitsets.
12771 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
12773 * data/bison.c++: Merge the two generated headers. Insert a copyright
12774 notice in each output file.
12776 2002-02-28 Akim Demaille <akim@epita.fr>
12778 * data/bison.c++: Copy the prologue of bison.simple to fetch
12779 useful M4 definitions, such as b4_header_guard.
12781 2002-02-25 Akim Demaille <akim@epita.fr>
12783 * src/getargs.c (version): Give the name of the authors, and use a
12784 translator friendly scheme for the bgr
12787 2002-02-25 Akim Demaille <akim@epita.fr>
12789 * src/output.c (header_output): Remove, now handled completely via
12792 2002-02-25 Akim Demaille <akim@epita.fr>
12794 * m4/m4.m4: New, from CVS Autoconf.
12795 * configure.in: Invoke it.
12796 * src/output.c (output_skeleton): Use its result instead of the
12799 2002-02-25 Akim Demaille <akim@epita.fr>
12801 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12803 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12804 * src/output.c (output_skeleton): Use mkstemp to create a real
12806 Move the filling of `skeleton' and its muscle to...
12808 (output): Move the definition of the prologue muscle to...
12810 * src/system.h (DEFAULT_TMPDIR): New.
12812 2002-02-14 Paul Eggert <eggert@twinsun.com>
12814 Remove the support for C++ namespace cleanliness; it was
12815 causing more problems than it was curing, since it didn't work
12816 properly on some nonstandard C++ compilers. This can wait
12817 for a proper C++ parser.
12819 * NEWS: Document this.
12820 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12821 of C++, as it's treated like C now.
12822 * src/bison.simple (YYSTD): Remove.
12823 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12824 Treat C++ just like Standard C instead of trying to support
12825 namespace cleanliness.
12827 2002-02-14 Akim Demaille <akim@epita.fr>
12829 * tests/regression.at (else): Adjust to Andreas' change.
12831 2002-02-14 Akim Demaille <akim@epita.fr>
12833 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12835 2002-02-13 Andreas Schwab <schwab@suse.de>
12837 * src/output.c (output_rule_data): Don't output NULL, it might
12838 not be defined yet.
12840 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
12842 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12843 (Copyright notice): Update.
12845 2002-02-11 Akim Demaille <akim@epita.fr>
12847 * tests/regression.at (%nonassoc and eof): Don't include
12848 nonportable headers.
12850 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
12852 * data/bison.c++: Correct error recovery. Make the user able to
12853 initialize the starting location.
12855 2002-02-07 Akim Demaille <akim@epita.fr>
12857 * tests/input.at: New.
12859 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12861 * data/bison.c++: Replace some direct m4 expansions by constants. Be
12862 more consistent when naming methods and variables. Put preprocessor
12863 directives around tables only needed for debugging.
12865 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12867 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12869 (yy::b4_name::parse): Use print_.
12871 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12873 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12875 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12877 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12879 (yy::b4_name::parse): Build verbose error messages, and use error_.
12881 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12883 * data/bison.c++: Fix m4 quoting in comments.
12885 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12887 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12888 not expanded by m4.
12890 2002-02-05 Akim Demaille <akim@epita.fr>
12892 * data/bison.c++: Adjust to the M4 back end.
12893 More is certainly needed.
12895 2002-02-05 Akim Demaille <akim@epita.fr>
12897 Give a try to M4 as a back end.
12899 * lib/readpipe.c: New, from wdiff.
12900 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12902 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12903 specific values. Now it is m4 that performs the lookup.
12904 * src/parse-skel.y: Remove.
12905 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12906 * src/output.c (actions_output, guards_output)
12907 (token_definitions_output): No longer keeps track of the output
12908 line number, hence remove the second argument.
12909 (guards_output): Check against the guard member of a rule, not the
12912 (output_skeleton): Don't look for the skeleton location, let m4 do
12914 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12916 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12917 (prepare): Given that for the time being changesyntax is not
12918 usable in M4, rename the muscles using `-' to `_'.
12919 Define `defines_flag', `output_parser_name' and `output_header_name'.
12920 * src/output.h (actions_output, guards_output)
12921 (token_definitions_output): Adjust prototypes.
12922 * src/scan-skel.l: Instead of scanning the skeletons, it now
12923 processes the output of m4: `__oline__' and `#output'.
12924 * data/bison.simple: Adjust to be used by M4(sugar).
12925 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12927 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12928 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12929 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12930 shamelessly stolen from CVS Autoconf.
12932 2002-02-05 Akim Demaille <akim@epita.fr>
12934 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12935 * configure.in: Check for the declarations of free and malloc.
12936 * src/muscle_tab.c: Adjust.
12938 2002-02-05 Akim Demaille <akim@epita.fr>
12940 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12941 which have no values.
12943 2002-02-05 Akim Demaille <akim@epita.fr>
12945 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12948 2002-01-29 Paul Eggert <eggert@twinsun.com>
12950 * src/bison.simple (YYSIZE_T): Do not define merely because
12951 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12952 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12954 2002-01-27 Akim Demaille <akim@epita.fr>
12956 Fix `%nonassoc and eof'.
12958 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12959 which were not properly copied! Replace
12960 memcpy (res->errs, src->errs, src->nerrs);
12962 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12964 * tests/regression.at (%nonassoc and eof): Adjust to newest
12965 Autotest: `.' is not in the PATH.
12967 2002-01-27 Akim Demaille <akim@epita.fr>
12969 * tests/sets.at (AT_EXTRACT_SETS): New.
12970 (Nullable): Use it.
12973 2002-01-26 Akim Demaille <akim@epita.fr>
12975 * tests/actions.at, tests/calc.at, tests/headers.at,
12976 * tests/torture.at: Adjust to the newest Autotest which no longer
12977 forces `.' in the PATH.
12979 2002-01-25 Akim Demaille <akim@epita.fr>
12981 * tests/regression.at (%nonassoc and eof): New.
12982 Suggested by Robert Anisko.
12984 2002-01-24 Akim Demaille <akim@epita.fr>
12986 Bison dumps core when trying to complain about broken input files.
12987 Reported by Cris van Pelt.
12989 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12990 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12992 (Invalid inputs): Strengthen: exercise parse_percent_token.
12994 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
12996 * src/Makefile.am: Add bison.c++.
12997 * src/bison.c++: New skeleton.
12999 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
13003 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
13005 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
13007 2002-01-20 Marc Autret <marc@gnu.org>
13009 * src/files.c (compute_output_file_names): Fix
13011 2002-01-20 Marc Autret <marc@gnu.org>
13013 * tests/output.at: New test.
13014 * src/files.c (compute_base_names): Don't map extensions when
13015 the YACC flag is set, use defaults.
13016 Reported by Evgeny Stambulchik.
13018 2002-01-20 Marc Autret <marc@gnu.org>
13020 * src/system.h: Need to define __attribute__ away for non-GCC
13021 compilers as well (i.e., the vendor C compiler).
13022 Suggested by Albert Chin-A-Young.
13024 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
13026 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
13027 canonical definition.
13028 * src/system.h: Use the canonical definition for PARAMS (avoids
13029 a conflict with the macro from lib/hash.h).
13031 2002-01-11 Akim Demaille <akim@epita.fr>
13033 * configure.in: Use AC_FUNC_STRNLEN.
13034 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
13036 2002-01-09 Akim Demaille <akim@epita.fr>
13038 * src/files.c, src/files.h (output_infix): New.
13039 (tab_extension): Remove.
13040 (compute_base_names): Compute the former, drop the latter.
13041 * src/output.c (prepare): Insert the muscles `output-infix', and
13043 * src/parse-skel.y (string, string.1): New.
13044 (section.header): Use it.
13045 (section.yacc): Remove.
13046 (prefix): Remove too.
13047 * src/scan-skel.l: Adjust.
13048 * src/bison.simple, src/bison.hairy: Adjust.
13050 2002-01-09 Akim Demaille <akim@epita.fr>
13052 * configure.in (WERROR_CFLAGS): Compute it.
13053 * src/Makefile.am (CFLAGS): Pass it.
13054 * tests/atlocal.in (CFLAGS): Idem.
13055 * src/files.c: Fix a few warnings.
13056 (get_extension_index): Remove, unused.
13058 2002-01-08 Akim Demaille <akim@epita.fr>
13060 * src/getargs.c (AS_FILE_NAME): New.
13061 (getargs): Use it to convert DOSish file names.
13062 * src/files.c (base_name): Rename as full_base_name to avoid
13063 clashes with `base_name ()'.
13064 (filename_split): New.
13065 (compute_base_names): N-th rewrite, using filename_split.
13067 2002-01-08 Akim Demaille <akim@epita.fr>
13069 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
13070 New, stolen from the Fileutils 4.1.
13071 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13072 * configure.in: Check for the presence of memrchr, and of its
13075 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
13077 * lib/hash.h (__P): Added definition for this macro.
13078 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
13079 BUILT_SOURCES, to ensure they are generated first.
13080 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
13081 %error-verbose to allow bootstrapping with bison 1.30x.
13083 2002-01-06 Akim Demaille <akim@epita.fr>
13085 * src/reader.c (parse_braces): Don't fetch the next char, the
13086 convention is to fetch on entry.
13087 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
13088 'switch' without a following semicolon.
13089 * tests/regression.at (braces parsing): New.
13091 2002-01-06 Akim Demaille <akim@epita.fr>
13093 Bison is dead wrong in its RR conflict reports.
13095 * tests/torture.at (GNU Cim Grammar): New.
13096 * src/conflicts.c (count_rr_conflicts): Fix.
13098 2002-01-06 Akim Demaille <akim@epita.fr>
13100 Creating package.m4 from configure.ac causes too many problems.
13102 * tests/Makefile.am (package.m4): Create it by hand,
13103 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
13105 2002-01-06 Akim Demaille <akim@epita.fr>
13107 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
13110 2002-01-04 Paul Eggert <eggert@twinsun.com>
13112 * doc/bison.texinfo (Debugging):
13113 Remove YYSTDERR; it's no longer defined or used.
13114 Also, s/cstdio.h/cstdio/.
13116 2002-01-03 Akim Demaille <akim@epita.fr>
13118 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
13120 2002-01-03 Akim Demaille <akim@epita.fr>
13122 * src/parse-skel.y (process_skeleton): Don't bind the parser's
13123 tracing code to --trace, wait for a better --trace option, with
13126 2002-01-03 Akim Demaille <akim@epita.fr>
13128 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
13129 The ISO C++ standard is extremely clear about it: stderr is
13130 considered a macro, not a regular symbol (see table 94 `Header
13131 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
13132 Therefore std:: does not apply to it. It still does with fprintf.
13133 Also, s/cstdio.h/cstdio/.
13135 2002-01-03 Akim Demaille <akim@epita.fr>
13137 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
13138 for non system headers.
13140 2002-01-02 Akim Demaille <akim@epita.fr>
13142 Equip the skeleton chain with location tracking, runtime trace,
13143 pure parser and scanner.
13145 * src/parse-skel.y: Request a pure parser, locations, and prefix
13147 (%union): Having several members with the same type does not help
13148 type mismatches, simplify.
13149 (YYPRINT, yyprint): New.
13150 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
13151 (skel_error): this.
13153 * src/scan-skel.l: Adjust to these changes.
13154 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
13155 (LOCATION_PRINT, skel_control_t): New.
13157 2001-12-30 Akim Demaille <akim@epita.fr>
13159 * src/parse-skel.y: Get rid of the shift/reduce conflict:
13160 replace `gb' with BLANKS.
13161 * src/scan-skel.l: Adjust.
13163 2001-12-30 Akim Demaille <akim@epita.fr>
13165 * src/system.h: We don't need nor want bcopy.
13166 Throw away MS-DOS crap: we don't need getpid.
13167 * configure.in: We don't need strndup. It was even causing
13168 problems: because Flex includes the headers *before* us,
13169 _GNU_SOURCE is not defined by config.h, and therefore strndup was
13171 * lib/xstrndup.c: New.
13172 * src/scan-skel.l: Use it.
13173 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
13174 * src/parse-skel.y: Use %directives instead of #defines.
13176 2001-12-30 Akim Demaille <akim@epita.fr>
13178 * src/skeleton.h: New.
13179 * src/output.c (output_parser, output_master_parser): Remove, dead
13181 * src/output.h (get_lines_number, actions_output, guards_output)
13182 (token_definitions_output): Prototype them.
13183 * src/parse-skel.y: Add the license notice.
13184 Include output.h and skeleton.h.
13185 (process_skeleton): Returns void, and takes a single parameter.
13186 * src/scan-skel.l: Add the license notice.
13187 Include skeleton.h.
13188 Don't use %option yylineno: it seems that then Flex imagines
13189 REJECT has been used, and therefore it won't reallocate its
13190 buffers (which makes no other sense to me than a bug). It results
13191 in warnings for `unused: yy_flex_realloc'.
13193 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
13195 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13196 (MUSCLE_INSERT_PREFIX): ...to there.
13197 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13198 (MUSCLE_INSERT_PREFIX): Move from here...
13200 * src/bison.hairy: Add a section directive. Put braces around muscle
13201 names. This parser skeleton is still broken, but Bison should not
13202 choke on a bad muscle 'syntax'.
13203 * src/bison.simple: Add a section directive. Put braces around muscle
13206 * src/files.h (strsuffix, stringappend): Add declarations.
13207 (tab_extension): Add declaration.
13208 (short_base_name): Add declaration.
13210 * src/files.c (strsuffix, stringappend): No longer static. These
13211 functions are used in the skeleton parser.
13212 (tab_extension): New.
13213 (compute_base_names): Use the computations done in this function
13214 to guess if the generated parsers should have '.tab' in their
13216 (short_base_name): No longer static.
13218 * src/output.c (output_skeleton): New.
13219 (output): Disable call to output_master_parser, and give a try to
13220 a new skeleton handling system.
13221 (guards_output, actions_output): No longer static.
13222 (token_definitions_output, get_lines_number): No longer static.
13224 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
13226 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
13229 * src/parse-skel.y: New file.
13230 * src/scan-skel.l: New file.
13232 2001-12-29 Akim Demaille <akim@epita.fr>
13234 %name-prefix is broken.
13236 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
13237 Adjust all dependencies.
13238 * tests/headers.at (export YYLTYPE): Strengthen this test: use
13241 Renaming yylval but not yylloc is not consistent. Now we do.
13243 * src/bison.simple: Prefix yylloc if used.
13244 * doc/bison.texinfo (Decl Summary): Document that.
13246 2001-12-29 Akim Demaille <akim@epita.fr>
13248 * doc/bison.texinfo: Promote `%long-directive' over
13250 Remove all references to fixed-output-files, yacc is enough.
13252 2001-12-29 Akim Demaille <akim@epita.fr>
13254 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
13255 user prologue. These are defaults.
13256 * tests/actions.at (Mid-rule actions): Make sure the user can
13257 define YYDEBUG and YYERROR_VERBOSE.
13259 2001-12-29 Akim Demaille <akim@epita.fr>
13261 * src/output.c (header_output): Don't forget to export YYLTYPE and
13263 * tests/headers.at (export YYLTYPE): New, make sure it does.
13264 * tests/regression.at (%union and --defines, Invalid CPP headers):
13266 * tests/headers.at: here.
13268 2001-12-29 Akim Demaille <akim@epita.fr>
13270 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
13272 2001-12-29 Akim Demaille <akim@epita.fr>
13274 * tests/actions.at (Mid-rule actions): Output on a single line
13275 instead of several.
13277 2001-12-29 Akim Demaille <akim@epita.fr>
13279 * doc/bison.texinfo: Formatting changes.
13281 2001-12-29 Akim Demaille <akim@epita.fr>
13283 Don't store the token defs in a muscle, just be ready to output it
13284 on command. Now possible via `symbols'. Fixes a memory leak.
13286 * src/output.c (token_definitions_output): New.
13287 (output_parser, header_output): Use it.
13288 * src/reader.c (symbols_save): Remove.
13290 2001-12-29 Akim Demaille <akim@epita.fr>
13292 * src/bison.simple: Do not provide a default for YYSTYPE and
13293 YYLTYPE before the user's prologue. Otherwise it's hardly... a
13296 2001-12-29 Akim Demaille <akim@epita.fr>
13298 Mid-rule actions are simply... ignored!
13300 * src/reader.c (readgram): Be sure to attach mid-rule actions to
13301 the empty-rule associated to the dummy symbol, not to the host
13303 * tests/actions.at (Mid-rule actions): New.
13305 2001-12-29 Akim Demaille <akim@epita.fr>
13309 * src/reader.c (reader): Free grammar.
13311 2001-12-29 Akim Demaille <akim@epita.fr>
13315 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
13316 since it allocates it for each state, although only one is needed.
13317 (allocate_storage): Do it here.
13319 2001-12-29 Akim Demaille <akim@epita.fr>
13321 * src/options.h, src/options.c (create_long_option_table): Rename
13323 (long_option_table_new): this, with a clearer prototype.
13324 (percent_table): Remove, unused,
13325 * src/getargs.c (getargs): Adjust.
13327 2001-12-29 Akim Demaille <akim@epita.fr>
13329 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
13330 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
13333 2001-12-29 Akim Demaille <akim@epita.fr>
13335 * src/lalr.c (build_relations): Rename `states' as `states1'.
13336 Sorry, I don't understand exactly what it is, no better name...
13338 2001-12-29 Akim Demaille <akim@epita.fr>
13340 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
13341 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
13342 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
13345 2001-12-29 Akim Demaille <akim@epita.fr>
13347 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
13350 2001-12-29 Akim Demaille <akim@epita.fr>
13352 * src/reader.c, src/reader.h (user_toknums): Remove.
13353 Adjust all users to use symbols[i]->user_token_number.
13355 2001-12-29 Akim Demaille <akim@epita.fr>
13357 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
13358 Adjust all users to use symbols[i]->prec or ->assoc.
13360 2001-12-29 Akim Demaille <akim@epita.fr>
13362 * src/reader.c, src/reader.h (tags): Remove.
13363 Adjust all users to use symbols[i]->tag.
13365 2001-12-29 Akim Demaille <akim@epita.fr>
13367 * src/gram.h, src/gram.c (symbols): New, similar to state_table
13369 * src/reader.c (packsymbols): Fill this table.
13371 * src/conflicts.c (resolve_sr_conflict): Adjust.
13372 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
13374 Use symbols[i]->tag instead of tags[i].
13376 2001-12-29 Akim Demaille <akim@epita.fr>
13378 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
13379 In addition, put a comment in there, to replace...
13380 * tests/regression.at (%union and C comments): Remove.
13382 2001-12-29 Akim Demaille <akim@epita.fr>
13384 * tests/regression.at (Web2c Actions): Blindly move the actual
13385 output as expected output. The contents *seem* right to me, but I
13386 can't pretend reading perfectly parser tables... Nonetheless, all
13387 the other tests pass correctly, the table look OK, even though the
13388 presence of `$axiom' is to be noted: AFAICS it is useless (but
13391 2001-12-29 Akim Demaille <akim@epita.fr>
13393 * src/reader.c (readgram): Don't add the rule 0 if there were no
13394 rules read. In other words, add it _after_ having performed
13395 grammar sanity checks.
13396 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
13398 2001-12-29 Akim Demaille <akim@epita.fr>
13400 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
13401 visible, and some states have now a different number.
13403 2001-12-29 Akim Demaille <akim@epita.fr>
13405 * src/reader.c (readgram): Bind the initial rule's lineno to that
13407 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
13408 (Solved SR Conflicts): Adjust rule 0's line number.
13410 2001-12-29 Akim Demaille <akim@epita.fr>
13412 Fix the `GAWK Grammar' failure.
13414 * src/LR0.c (final_state): Initialize to -1 so that we do compute
13415 the reductions of the first state which was mistakenly confused
13416 with the final state because precisely final_state was initialized
13418 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
13419 now noticed by Bison.
13420 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
13421 have a reduction on $default.
13423 2001-12-29 Akim Demaille <akim@epita.fr>
13425 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
13427 * src/closure.c (print_closure): Likewise.
13428 * src/derives.c (print_derives): Likewise.
13429 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
13432 2001-12-29 Akim Demaille <akim@epita.fr>
13434 * src/lalr.c (lookaheads_print): New.
13435 (lalr): Call it when --trace-flag.
13436 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13439 2001-12-29 Akim Demaille <akim@epita.fr>
13441 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13442 when walking through ritem, even via rule->rhs.
13443 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13444 (useful_production, useless_nonterminals): Likewise.
13445 (reduce_grammar_tables): Likewise, plus update nritems.
13446 * src/nullable.c (set_nullable): Likewise.
13447 * src/lalr.c (build_relations): Likewise.
13448 * tests/sets.at (Nullable): Adjust.
13449 Fortunately, now, the $axiom is no longer nullable.
13451 2001-12-29 Akim Demaille <akim@epita.fr>
13453 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13455 * src/gram.c (ritem_longest_rhs): Likewise.
13456 * src/reduce.c (nonterminals_reduce): Likewise.
13457 * src/print_graph.c (print_graph): Likewise.
13458 * src/output.c (output_rule_data): Likewise.
13459 * src/nullable.c (set_nullable): Likewise.
13461 2001-12-29 Akim Demaille <akim@epita.fr>
13463 * src/output.c: Comment changes.
13465 2001-12-27 Paul Eggert <eggert@twinsun.com>
13467 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13468 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13469 Sparc, as they were causing more porting problems than the
13470 (minor) performance improvement was worth.
13472 Also, catch up with 1.31's YYSTD.
13474 2001-12-27 Akim Demaille <akim@epita.fr>
13476 * src/output.c (output_gram): Rely on nritems, not the
13477 0-sentinel. See below.
13478 Use -1 as separator, not 0.
13479 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13480 Rely on -1 as separator in yyrhs, instead of 0.
13481 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13482 twice `Now at end of input', therefore there are two lines less to
13485 2001-12-27 Akim Demaille <akim@epita.fr>
13487 * tests/regression.at (Unresolved SR Conflicts):
13488 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13491 2001-12-27 Akim Demaille <akim@epita.fr>
13493 * src/LR0.c (new_state): Recognize the final state by the fact it
13494 is reached by eoftoken.
13495 (insert_start_shifting_state, insert_eof_shifting_state)
13496 (insert_accepting_state, augment_automaton): Remove, since now
13497 these states are automatically computed from the initial state.
13498 (generate_states): Adjust.
13499 * src/print.c: When reporting a rule number to the user, substract
13500 1, so that the axiom rule is rule 0, and the first user rule is 1.
13501 * src/reduce.c: Likewise.
13502 * src/print_graph.c (print_core): For the time being, just as for
13503 the report, depend upon --trace-flags to dump the full set of
13505 * src/reader.c (readgram): Once the grammar read, insert the rule
13506 0: `$axiom: START-SYMBOL $'.
13507 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13508 number of the states has changed (the final state is no longer
13509 necessarily the last), catch up.
13511 2001-12-27 Akim Demaille <akim@epita.fr>
13513 Try to make the use of the eoftoken valid. Given that its value
13514 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13515 is used instead of > 0 where appropriate, (ii), depend upon nritems
13516 instead of the 0-sentinel.
13518 * src/gram.h, src/gram.c (nritems): New.
13519 Expected to be duplication of nitems, but for the time being...
13520 * src/reader.c (packgram): Assert nritems and nitems are equal.
13521 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13522 * src/closure.c (print_closure, print_fderives): Likewise.
13523 * src/gram.c (ritem_print): Likewise.
13524 * src/print.c (print_core, print_grammar): Likewise.
13525 * src/print_graph.c: Likewise.
13527 2001-12-27 Akim Demaille <akim@epita.fr>
13529 * src/main.c (main): If there are complains after grammar
13530 reductions, then output the report anyway if requested, then die.
13531 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13532 * src/reader.c (eoftoken): New.
13533 (parse_token_decl): If the token being defined has value `0', it
13535 (packsymbols): No longer hack `tags' to insert `$' by hand.
13536 Be sure to preserve the value of the eoftoken.
13537 (reader): Make sure eoftoken is defined.
13538 Initialize nsyms to 0: now eoftoken is created just like the others.
13539 * src/print.c (print_grammar): Don't special case the eof token.
13540 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13541 lie anyway, albeit pleasant.
13542 * tests/calc.at: Exercise error messages with eoftoken.
13543 Change the grammar so that empty input is invalid.
13544 Adjust expectations.
13545 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13547 2001-12-27 Akim Demaille <akim@epita.fr>
13549 * configure.in: Check the protos of strchr ans strspn.
13550 Replace strchr if needed.
13551 * src/system.h: Provide the protos of strchr, strspn and memchr if
13553 * lib/strchr.c: New.
13554 * src/reader.c (symbols_save): Use strchr.
13556 2001-12-27 Akim Demaille <akim@epita.fr>
13558 * src/print.c, src/print_graph.c (escape): New.
13559 Use it to quote the TAGS outputs.
13560 * src/print_graph.c (print_state): Now errors are in red, and
13561 reductions in green.
13562 Prefer high to wide: output the state number on a line of its own.
13564 2001-12-27 Akim Demaille <akim@epita.fr>
13566 * src/state.h, src/state.c (reductions_new): New.
13567 * src/LR0.c (set_state_table): Let all the states have a
13568 `reductions', even if reduced to 0.
13569 (save_reductions): Adjust.
13570 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13571 * src/print.c (print_reductions, print_actions): Adjust.
13572 * src/output.c (action_row): Adjust.
13574 2001-12-27 Akim Demaille <akim@epita.fr>
13576 * src/state.h, src/state.c (errs_new, errs_dup): New.
13577 * src/LR0.c (set_state_table): Let all the states have an errs,
13578 even if reduced to 0.
13579 * src/print.c (print_errs, print_reductions): Adjust.
13580 * src/output.c (output_actions, action_row): Adjust.
13581 * src/conflicts.c (resolve_sr_conflict): Adjust.
13583 2001-12-27 Akim Demaille <akim@epita.fr>
13585 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13587 2001-12-27 Akim Demaille <akim@epita.fr>
13589 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13590 * src/print.c: here.
13591 (lookaheadset, shiftset): New, used as additional storage by
13593 (print_results): Adjust.
13594 (print_shifts, print_gotos, print_errs): New, extracted from...
13595 (print_actions): here.
13596 * src/print_graph.c (print_actions): Remove dead code.
13598 2001-12-27 Akim Demaille <akim@epita.fr>
13600 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13603 2001-12-27 Akim Demaille <akim@epita.fr>
13605 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13606 (build_relations): Adjust.
13608 2001-12-27 Akim Demaille <akim@epita.fr>
13610 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13613 2001-12-27 Akim Demaille <akim@epita.fr>
13615 * src/reader.c (packgram): Catch nitems overflows.
13617 2001-12-27 Akim Demaille <akim@epita.fr>
13619 * src/files.c, src/files.h (guard_obstack): Remove.
13620 * src/output.c (output): Adjust.
13621 * src/reader.c (parse_braces): New, factoring...
13622 (copy_action, copy_guard): these two which are renamed as...
13623 (parse_action, parse_guard): these.
13624 As a voluntary consequence, using braces around guards is now
13627 2001-12-27 Akim Demaille <akim@epita.fr>
13629 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13630 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13632 (symbol_list_new): Adjust.
13633 (copy_action): action_line is the first line, not the last.
13634 (copy_guard): Just as for actions, store the `action' only, not
13635 the switch/case/break flesh.
13636 Don't parse the user action that might follow the guard, let...
13637 (readgram): do it, i.e., now, there can be an action after a
13639 In other words the guard is just explicitly optional.
13640 (packgram): Adjust.
13641 * src/output.c (guards_output): New.
13642 (output_parser): Call it when needed.
13643 (output): Also free the guard and attrs obstacks.
13644 * src/files.c, src/files.h (obstack_save): Remove.
13645 (output_files): Remove.
13646 As a result, if one needs the former `.act' file, using an
13647 appropriate skeleton which requires actions and guards is now
13649 * src/main.c (main): Adjust.
13650 * tests/semantic.at: New.
13651 * tests/regression.at: Use `input.y' as input file name.
13652 Avoid 8+3 problems by requiring input.c when the test needs the
13655 2001-12-27 Akim Demaille <akim@epita.fr>
13657 * src/reader.c (symbol_list_new): Be sure to initialize all the
13660 2001-12-27 Akim Demaille <akim@epita.fr>
13662 All the hacks using a final pseudo state are now useless.
13664 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13665 * src/lalr.c (nLA): New.
13666 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13667 instead of lookaheadsp from the pseudo state (nstate + 1).
13669 2001-12-27 Akim Demaille <akim@epita.fr>
13671 * src/output.c (action_row, token_actions): Use a state_t instead
13672 of a integer, and nlookaheads instead of the following state's
13675 2001-12-27 Akim Demaille <akim@epita.fr>
13677 * src/conflicts.c (log_resolution, flush_shift)
13678 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13679 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13680 (conflicts_print, print_reductions): Use a state_t instead of an
13681 integer when referring to a state.
13682 As much as possible, depend upon nlookaheads, instead of the
13683 `lookaheadsp' member of the following state (since lookaheads of
13684 successive states are successive, the difference between state n + 1
13685 and n served as the number of lookaheads for state n).
13686 * src/lalr.c (add_lookback_edge): Likewise.
13687 * src/print.c (print_core, print_actions, print_state)
13688 (print_results): Likewise.
13689 * src/print_graph.c (print_core, print_actions, print_state)
13690 (print_graph): Likewise.
13691 * src/conflicts.h: Adjust.
13693 2001-12-27 Akim Demaille <akim@epita.fr>
13695 * src/bison.hairy: Formatting/comment changes.
13697 Remove `register' indications.
13698 Add plenty of `static'.
13700 2001-12-27 Akim Demaille <akim@epita.fr>
13702 * src/output.c (prepare): Drop the muscle `ntbase' which
13703 duplicates ntokens.
13704 * src/bison.simple: Formatting/comment changes.
13705 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13706 is an undocumented synonym.
13708 2001-12-22 Akim Demaille <akim@epita.fr>
13710 * src/output.c (output_table_data): Change the prototype to use
13711 `int' for array ranges: some invocations do pass an int, not a
13713 Reported by Wayne Green.
13715 2001-12-22 Akim Demaille <akim@epita.fr>
13717 Some actions of web2c.y are improperly triggered.
13718 Reported by Mike Castle.
13720 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13721 * tests/regression.at (Web2c): Rename as...
13722 (Web2c Report): this.
13723 (Web2c Actions): New.
13725 2001-12-22 Akim Demaille <akim@epita.fr>
13727 Reductions in web2c.y are improperly reported.
13728 Reported by Mike Castle.
13730 * src/conflicts.c (print_reductions): Fix.
13731 * tests/regression.at (Web2c): New.
13733 2001-12-18 Akim Demaille <akim@epita.fr>
13735 Some host fail on `assert (!"foo")', which expands to
13736 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13737 Reported by Nelson Beebee.
13739 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13740 `#define it_succeeded 0' and `assert (it_succeeded)'.
13742 2001-12-17 Marc Autret <autret_m@epita.fr>
13744 * src/bison.simple: Don't hard code the skeleton line and filename.
13745 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13746 New line counter 'skeleton_line' (skeleton-line muscle).
13748 2001-12-17 Paul Eggert <eggert@twinsun.com>
13750 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13751 YYDEBUG must be defined to a nonzero value.
13753 * src/bison.simple (yytname): Do not assume that the user defines
13754 YYDEBUG to a properly parenthesized expression.
13756 2001-12-17 Akim Demaille <akim@epita.fr>
13758 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13759 nlookaheads is a new member.
13761 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13762 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13765 2001-12-17 Akim Demaille <akim@epita.fr>
13767 * src/files.h, src/files.c (open_files, close_files): Remove.
13768 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13770 * src/reader.c (reader): Do it.
13772 2001-12-17 Akim Demaille <akim@epita.fr>
13774 * src/conflicts.c (print_reductions): Formatting changes.
13776 2001-12-17 Akim Demaille <akim@epita.fr>
13778 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13779 (flush_reduce): New.
13780 (resolve_sr_conflict): Adjust.
13782 2001-12-17 Akim Demaille <akim@epita.fr>
13784 * src/output.c (output_obstack): Be static and rename as...
13785 (format_obstack): this, to avoid any confusion with files.c's
13787 * src/reader.h (muscle_obstack): Move to...
13788 * src/output.h: here, since it's defined in output.c.
13790 2001-12-17 Akim Demaille <akim@epita.fr>
13792 * src/output.c (action_row, save_column, default_goto)
13793 (sort_actions, matching_state, pack_vector): Better variable
13796 2001-12-17 Akim Demaille <akim@epita.fr>
13798 * src/output.c: Various formatting changes.
13800 2001-12-17 Akim Demaille <akim@epita.fr>
13802 * src/files.c (output_files): Free the output_obstack.
13803 * src/main.c (main): Call print and print_graph conditionally.
13804 * src/print.c (print): Work unconditionally.
13805 * src/print_graph.c (print_graph): Work unconditionally.
13806 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13808 2001-12-16 Marc Autret <autret_m@epita.fr>
13810 * src/output.c (actions_output): Fix. When we use %no-lines,
13811 there is one less line per action.
13813 2001-12-16 Marc Autret <autret_m@epita.fr>
13815 * src/bison.simple: Remove a useless #line directive.
13816 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13817 * src/output.c (get_lines_number): New.
13818 (output_parser): Adjust, now takes care about the lines of a
13820 Fix line numbering.
13821 (actions_output): Computes the number of lines taken by actions.
13822 (output_master_parser): Insert new skeleton which is the name of
13823 the output parser file name.
13825 2001-12-15 Marc Autret <autret_m@epita.fr>
13827 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13829 2001-12-15 Marc Autret <autret_m@epita.fr>
13831 * src/output.c (output_gram): Keep track of the hairy one.
13833 2001-12-15 Akim Demaille <akim@epita.fr>
13835 Make `make distcheck' work.
13837 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13838 system.h which uses libgettext.h.
13840 2001-12-15 Akim Demaille <akim@epita.fr>
13842 * src/nullable.c (set_nullable): Useless rules must be skipped,
13843 otherwise, since we range over their symbols, we might look at a
13844 nonterminal which no longer ``exists'', i.e., it is not counted in
13845 `nvars', hence we overflow our arrays.
13847 2001-12-15 Akim Demaille <akim@epita.fr>
13849 The header can also be produced directly, without any obstack!
13852 * src/files.c, src/files.h (defines_obstack): Remove.
13853 (compute_header_macro): Global.
13854 (defines_obstack_save): Remove.
13855 * src/reader.c (parse_union_decl): No longer output to
13856 defines_obstack: its content can be found in the `stype' muscle
13858 (output_token_translations): Merge into...
13859 (symbols_output): this.
13861 (symbols_save): this.
13863 * src/output.c (header_output): New.
13866 2001-12-15 Akim Demaille <akim@epita.fr>
13868 * src/reader.c (parse_union_decl): Instead of handling two obstack
13869 simultaneously, use one to define the `stype' muscle, and use the
13870 value of the latter to fill defines_obstack.
13871 (copy_comment): Remove.
13872 (copy_comment2): Work for a single obstack.
13874 (copy_comment): this.
13876 2001-12-15 Akim Demaille <akim@epita.fr>
13878 * src/lex.c, src/lex.h (xgetc): No longer static.
13879 * src/reader.c (parse_union_decl): Revamp.
13881 2001-12-15 Akim Demaille <akim@epita.fr>
13883 Still making progress in separating Bison into (i) input, (ii)
13884 process, (iii) output: now we can directly output the parser file
13885 without using table_obstack at all.
13887 * src/files.c, src/files.h (table_obstack): Bye bye.
13888 (parser_file_name): New.
13889 * src/files.c (compute_output_file_names): Compute it.
13890 * src/output.c (actions_output, output_parser)
13891 (output_master_parser): To a file instead of an obstack.
13893 2001-12-15 Akim Demaille <akim@epita.fr>
13895 Attach actions to rules, instead of pre-outputting them to
13898 * src/gram.h (rule_t): action and action_line are new members.
13899 * src/reader.c (symbol_list): Likewise.
13900 (copy_action): Save the actions within the rule.
13901 (packgram): Save them in rule_table.
13902 * src/output.c (actions_output): New.
13903 (output_parser): Use it on `%%actions'.
13904 (output_rule_data): Don't free rule_table.
13906 (prepare): Don't save the `action' muscle.
13907 * src/bison.simple: s/%%action/%%actions/.
13909 2001-12-15 Akim Demaille <akim@epita.fr>
13911 * src/reader.c (copy_action): When --yacc, don't append a `;'
13912 to the user action: let it fail if lacking.
13913 Suggested by Arnold Robbins and Tom Tromey.
13915 2001-12-14 Akim Demaille <akim@epita.fr>
13917 * src/lex.c (literalchar): Simply return the char you decoded, non
13918 longer mess around with obstacks and int pointers.
13919 Adjust all callers.
13921 2001-12-14 Akim Demaille <akim@epita.fr>
13923 * src/lex.c (literalchar): Don't escape the special characters,
13924 just decode them, and keep them as char (before, eol was output as
13925 the 2 char string `\n' etc.).
13926 * src/output.c (output_rule_data): Use quotearg to output the
13929 2001-12-13 Paul Eggert <eggert@twinsun.com>
13931 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13932 Do not infringe on the global user namespace when using C++.
13933 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13934 All uses of `fprintf' and `stderr' changed.
13936 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13938 2001-12-13 Akim Demaille <akim@epita.fr>
13940 The computation of nullable is broken: it doesn't handle empty
13943 * tests/torture.at (GNU AWK Grammar): New.
13944 * tests/sets.at (Nullable): New.
13945 * src/nullable.c (set_nullable): Instead of blindly looping over
13946 `ritems', loop over the rules, and then over their rhs's.
13948 Work around Autotest bugs.
13950 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13951 frame, because Autotest understand lines starting with a `+' as
13952 traces from the shell. Then, they are not processed properly.
13953 Admittedly an Autotest bug, but we don't have time to wait for
13954 Autotest to catch up.
13955 * tests/regression.at (Broken Closure): Adjust to the new table
13958 * tests/sets.at: here.
13960 2001-12-13 Akim Demaille <akim@epita.fr>
13962 * src/closure.c (closure): Use nrules instead of playing tricks
13963 with BITS_PER_WORD.
13965 2001-12-13 Akim Demaille <akim@epita.fr>
13967 * src/print.c (print_actions): Output the handling of `$' as the
13968 traces do: shifting the token EOF. Before EOF was treated as a
13970 * tests/regression.at: Adjust some tests.
13971 * src/print_graph.c (print_core): Complete the set of items via
13972 closure. The next-to-final and final states are still unsatisfying,
13973 but that's to be addressed elsewhere.
13974 No longer output the rule numbers, but do output the state number.
13975 A single loop for the shifts + gotos is enough, but picked a
13976 distinct color for each.
13977 (print_graph): Initialize and finalize closure.
13979 2001-12-13 Akim Demaille <akim@epita.fr>
13981 * src/reader.c (readgram): Remove dead code, an strip useless
13983 (get_type): Remove, unused.
13985 2001-12-12 Akim Demaille <akim@epita.fr>
13987 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13988 on that of lib/error.c.
13990 2001-12-12 Akim Demaille <akim@epita.fr>
13992 Some hosts don't like `/' in includes.
13994 * src/system.h: Include libgettext.h without qualifying the path.
13995 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13998 2001-12-11 Marc Autret <autret_m@epita.fr>
14000 * src/output.c (output_parser): Remove useless muscle.
14002 2001-12-11 Marc Autret <autret_m@epita.fr>
14004 * src/bison.simple: Remove #line just before %%epilogue. It
14005 is now handled in ...
14006 * src/reader.c (read_additionnal_code): Add the output of a
14007 #line for the epilogue.
14009 2001-12-10 Marc Autret <autret_m@epita.fr>
14011 * src/reader.c (copy_definition): Re-use CPP-outed code which
14012 replace precedent remove.
14013 * src/bison.simple: Remove #line before %%prologue because
14014 %%input-line is wrong at this time.
14016 2001-12-10 Marc Autret <autret_m@epita.fr>
14018 * src/reader.c (symbols_output): Clean up.
14019 * src/output.c (output_gram, output): Clean up.
14021 2001-12-10 Akim Demaille <akim@epita.fr>
14023 * src/lalr.c (initialize_lookaheads): New. Extracted from...
14024 * src/LR0.c (set_state_table): here.
14025 * src/lalr.c (lalr): Call it.
14027 2001-12-10 Akim Demaille <akim@epita.fr>
14029 * src/state.h (shifts): Remove the `number' member: shifts are
14030 attached to state, hence no longer need to be labelled with a
14033 2001-12-10 Akim Demaille <akim@epita.fr>
14035 Now that states have a complete set of members, the linked list of
14036 shifts is useless: just fill directly the state's shifts member.
14038 * src/state.h (shifts): Remove the `next' member.
14039 * src/LR0.c (first_state, last_state): Remove.
14040 Adjust the callers.
14041 (augment_automaton): Don't look for the shifts that must be added
14042 a shift on EOF: it is those of the state we looked for! But now,
14043 since shifts are attached, it is no longer needed to looking
14044 merely by its id: its number.
14046 2001-12-10 Akim Demaille <akim@epita.fr>
14048 * src/LR0.c (augment_automaton): Better variable locality.
14049 Remove an impossible branch: if there is a state corresponding to
14050 the start symbol being shifted, then there is shift for the start
14051 symbol from the initial state.
14053 2001-12-10 Akim Demaille <akim@epita.fr>
14055 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
14056 only when appropriate: when insert_start_shifting_state' is not
14058 * tests/regression.at (Rule Line Numbers): Adjust.
14060 2001-12-10 Akim Demaille <akim@epita.fr>
14062 * src/LR0.c (augment_automaton): Now that all states have shifts,
14063 merge the two cases addition shifts to the initial state.
14065 2001-12-10 Akim Demaille <akim@epita.fr>
14067 * src/lalr.c (set_state_table): Move to...
14069 * src/lalr.c (lalr): Don't call it...
14070 * src/LR0.c (generate_states): do it.
14071 * src/LR0.h (first_state): Remove, only the table is used.
14073 2001-12-10 Akim Demaille <akim@epita.fr>
14075 * src/LR0.h (first_shift, first_reduction): Remove.
14076 * src/lalr.c: Don't use first_shift: find shifts through the
14079 2001-12-10 Akim Demaille <akim@epita.fr>
14081 * src/LR0.c: Attach shifts to states as soon as they are
14083 * src/lalr.c (set_state_table): Instead of assigning shifts to
14084 state, just assert that the mapping was properly done.
14086 2001-12-10 Akim Demaille <akim@epita.fr>
14088 * src/LR0.c (insert_start_shift): Rename as...
14089 (insert_start_shifting_state): this.
14090 (insert_eof_shifting_state, insert_accepting_state): New.
14091 (augment_automaton): Adjust.
14092 Better locality of the variables.
14093 When looking if the start_symbol is shifted from the initial
14094 state, using `while (... symbol != start_symbol ...)' sounds
14095 better than `while (... symbol < start_symbol ...)': If fail
14096 to see how the order between symbols could be relevant!
14098 2001-12-10 Akim Demaille <akim@epita.fr>
14100 * src/getargs.h: Don't declare `spec_name_prefix' and
14101 `spec_file_prefix', declared by src/files.h.
14102 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
14103 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
14104 * src/output.c (prepare): Adjust.
14105 * src/reader.c (symbols_output): Likewise.
14106 * src/vmsgetargs.c: Vaguely adjust, but who cares?
14108 2001-12-10 Akim Demaille <akim@epita.fr>
14110 * src/muscle_tab.c (muscle_init): NULL is a better default than
14113 2001-12-10 Akim Demaille <akim@epita.fr>
14115 * src/reader.c (reader): Calling symbols_output once is enough.
14117 2001-12-10 Akim Demaille <akim@epita.fr>
14119 Now that states have a complete set of members, the linked list of
14120 reductions is useless: just fill directly the state's reductions
14123 * src/state.h (struct reductions): Remove member `number' and
14125 * src/LR0.c (first_reduction, last_reduction): Remove.
14126 (save_reductions): Don't link the new reductions, store them in
14128 * src/lalr.c (set_state_table): No need to attach reductions to
14129 states, it's already done.
14130 * src/output.c (output_actions): No longer free the shifts, then
14131 the reductions, then the states: free all the states and their
14134 2001-12-10 Akim Demaille <akim@epita.fr>
14136 * src/options.c (OPTN, DRTV, BOTH): New.
14137 (option_table): Use them.
14139 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
14140 the job of system.h.
14141 * src/options.c: Don't include stdio.h and xalloc.h for the same
14144 2001-12-10 Akim Demaille <akim@epita.fr>
14146 * src/output.c (output, prepare): Make sure the values of the
14147 muscles `action' and `prologue' are 0-terminated.
14149 2001-12-10 Akim Demaille <akim@epita.fr>
14151 Clean up GCC warnings.
14153 * src/reader.c (copy_action): `buf' is not used.
14154 (parse_skel_decl): Be static.
14155 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
14156 * src/options.h (create_long_option_table): Have a real prototype.
14157 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
14158 (hash_delete_at): Return const void *.
14159 Adjust casts to preserve the const.
14161 2001-12-10 Akim Demaille <akim@epita.fr>
14163 * configure.in: Require 2.52g.
14164 M4 is not needed, but AUTOM4TE is.
14165 * m4/m4.m4: Remove.
14166 * tests/Makefile.am: Adjust.
14168 2001-12-10 Akim Demaille <akim@epita.fr>
14170 One structure for states is enough, even though theoretically
14171 there are LR(0) states and LALR(1) states.
14173 * src/lalr.h (state_t): Remove.
14174 (state_table): Be state_t **, not state_t *.
14175 * src/state.h (core, CORE_ALLOC): Rename as...
14176 (state_t, STATE_ALLOC): this.
14177 Add the LALR(1) members: shifts, reductions, errs.
14178 * src/LR0.c (state_table): Rename as...
14179 (state_hash): this, to avoid name clashes with the global
14181 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
14182 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
14184 2001-12-10 Akim Demaille <akim@epita.fr>
14186 Bison dumps core on bash.y.
14187 Reported by Pascal Bart.
14189 * src/warshall.c (bitmatrix_print): New.
14191 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
14192 j must be the outer loop.
14193 * tests/regression.at (Broken Closure): New.
14195 2001-12-05 Akim Demaille <akim@epita.fr>
14197 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
14199 Reported by Peter Hamorsky.
14201 2001-12-05 Akim Demaille <akim@epita.fr>
14203 * src/conflicts.c (err_table): Remove.
14204 (resolve_sr_conflict): Adjust.
14205 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
14207 (state_t.reductions, state_t.shifts): this.
14209 2001-12-05 Akim Demaille <akim@epita.fr>
14211 * src/reduce.c (reduce_grammar_tables): No longer disable the
14212 removal of useless rules via CPP but via `if (0)', so that the
14213 compiler still check the code is valid.
14214 For instance, it should have noticed `rline' no longer exists: use
14215 the `line' member of rule_t.
14216 * src/gram.c (dummy, rline): Remove, unused.
14218 2001-12-05 Akim Demaille <akim@epita.fr>
14220 * src/output.c (pack_vector): Use assert, not berror.
14221 * src/main.c (berror): Remove, unused.
14223 2001-12-05 Akim Demaille <akim@epita.fr>
14225 New experimental feature: if --verbose --trace output all the
14226 items of a state, not only its kernel.
14228 * src/print.c (print_core): If `trace_flag', then invoke closure
14229 before outputting the items of the state (print_core is no longer
14230 a correct name them).
14231 (print_results): Invoke new_closure/free_closure if needed.
14233 2001-12-05 Akim Demaille <akim@epita.fr>
14235 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
14236 * src/closure.c, src/closure.h (itemsetsize): Rename as...
14237 (nitemset): for consistency with the rest of the project.
14239 2001-12-05 Akim Demaille <akim@epita.fr>
14241 * src/closure.c (print_closure): Improve.
14242 (closure): Use it for printing input and output.
14244 2001-12-05 Akim Demaille <akim@epita.fr>
14246 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
14247 indexed by nonterminals.
14249 2001-12-05 Akim Demaille <akim@epita.fr>
14251 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
14253 * src/warshall.h: Remove accidental duplication of the content.
14255 2001-12-05 Akim Demaille <akim@epita.fr>
14257 * src/closure.c (set_fderives): De-obfuscate.
14259 2001-12-05 Akim Demaille <akim@epita.fr>
14261 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
14263 2001-12-05 Akim Demaille <akim@epita.fr>
14265 * src/closure.c (set_firsts): De-obfuscate.
14267 2001-12-05 Akim Demaille <akim@epita.fr>
14269 * src/output.c (action_row): De-obfuscate
14270 using the good o' techniques: arrays not pointers, variable
14271 locality, BITISSET, RESETBIT etc.
14273 2001-12-05 Akim Demaille <akim@epita.fr>
14275 Pessimize the code to simplify it: from now on, all the states
14276 have a valid SHIFTS, which NSHIFTS is possibly 0.
14278 * src/LR0.c (shifts_new): Be global and move to..
14279 * src/state.c, src/state.h: here.
14280 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
14281 * src/print_graph: Adjust.
14283 2001-12-05 Akim Demaille <akim@epita.fr>
14285 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
14286 * src/conflicts.c: Use it.
14287 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
14288 incorrectly ``simplified''.
14290 2001-12-05 Akim Demaille <akim@epita.fr>
14292 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
14293 using the good o' techniques: arrays not pointers, variable
14294 locality, BITISSET, RESETBIT etc.
14296 2001-12-05 Akim Demaille <akim@epita.fr>
14298 * src/state.h (SHIFT_SYMBOL): New.
14299 * src/conflicts.c: Use it to deobfuscate.
14301 2001-12-05 Akim Demaille <akim@epita.fr>
14303 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
14304 (print_reductions): De-obfuscate using the good o' techniques:
14305 arrays not pointers, variable locality, BITISSET.
14307 2001-12-05 Akim Demaille <akim@epita.fr>
14309 * src/conflicts.c (print_reductions): Arrays, not pointers.
14312 2001-12-05 Akim Demaille <akim@epita.fr>
14314 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14316 2001-12-05 Akim Demaille <akim@epita.fr>
14318 * src/conflicts.c (print_reductions): Improve variable locality.
14320 2001-12-05 Akim Demaille <akim@epita.fr>
14322 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14324 2001-12-05 Akim Demaille <akim@epita.fr>
14326 * src/conflicts.c (print_reductions): Improve variable locality.
14328 2001-12-05 Akim Demaille <akim@epita.fr>
14330 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
14331 * src/lalr.c: Use them.
14333 2001-12-05 Akim Demaille <akim@epita.fr>
14335 * src/LR0.c (augment_automaton): Formatting changes.
14336 Better variable locality.
14338 2001-12-05 Akim Demaille <akim@epita.fr>
14340 * src/lalr.c (matrix_print): New.
14341 (transpose): Use it.
14342 Use arrays instead of pointers.
14344 2001-12-05 Akim Demaille <akim@epita.fr>
14346 * src/lalr.c (maxrhs): Move to...
14347 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
14348 * src/lalr.c (build_relations): Adjust.
14350 2001-12-05 Akim Demaille <akim@epita.fr>
14352 * src/lalr.c (transpose): Free the memory allocated to the
14353 argument, as it is replaced by the results by the unique caller.
14354 (build_relations): Merely invoke transpose: it handles the memory
14356 Improve variable locality.
14357 Avoid variables used as mere abbreviations.
14358 (compute_lookaheads): Use arrays instead of pointers.
14360 2001-12-05 Akim Demaille <akim@epita.fr>
14362 * src/lalr.c (initialize_F): Improve variable locality.
14363 Avoid variables used as mere abbreviations.
14365 2001-12-05 Akim Demaille <akim@epita.fr>
14367 * src/derives.c (print_derives): Display the ruleno.
14368 * src/lalr.c (initialize_F, transpose): Better variable locality
14369 to improve readability.
14370 Avoid variables used as mere abbreviations.
14372 2001-12-05 Akim Demaille <akim@epita.fr>
14374 * src/lalr.c (traverse): Use arrays instead of pointers.
14376 2001-12-05 Akim Demaille <akim@epita.fr>
14378 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
14379 the handling of squeue.
14380 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14382 2001-12-05 Akim Demaille <akim@epita.fr>
14384 Because useless nonterminals are now kept alive (instead of being
14385 `destroyed'), we now sometimes examine them, and store information
14386 related to them. Hence we need to know their number, and adjust
14387 memory allocations.
14389 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
14391 * src/LR0.c (allocate_itemsets): The memory allocated to
14392 `symbol_count' was used for two different purpose: once to count
14393 the number of occurrences of each symbol, and later reassigned to
14394 `shift_symbol', containing the symbol that can be shifted from a
14396 Deobfuscate, i.e., allocate, use and free `symbol_count' here
14398 (new_itemsets): Allocate `shift_symbol' here.
14399 (allocate_itemsets): symbol_count includes useless nonterminals.
14400 Make room for them.
14401 (free_storage): Use `free', not `XFREE', for pointers that cannot
14404 2001-12-05 Akim Demaille <akim@epita.fr>
14406 * src/nullable.c (set_nullable): Deobfuscate the handling of
14408 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14410 2001-12-05 Akim Demaille <akim@epita.fr>
14412 * src/gram.c, src/gram.h (ritem_print): New.
14413 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
14414 (This useless function was defined only to work around VMS linkers
14415 that can't handle compilation units with variables only).
14416 * src/reduce.c (dump_grammar): Use it to trace the construction of
14419 2001-12-04 Paul Eggert <eggert@twinsun.com>
14421 * src/bison.simple (union yyalloc): Change member names
14422 to be the same as the stack names.
14423 (yyparse): yyptr is now union yyalloc *, not char *.
14424 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
14425 and may generate better code on some machines.
14426 (yystpcpy): Use prototype if __STDC__ is defined, not just
14427 if __cplusplus is defined.
14429 2001-11-30 Akim Demaille <akim@epita.fr>
14431 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
14432 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
14433 Gettext doesn't compile cleanly, and dies with -Werror.
14434 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
14435 Include WARNING_CFLAGS here.
14436 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
14437 before being defined.
14439 2001-11-27 Paul Eggert <eggert@twinsun.com>
14441 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14442 First arg is int, not unsigned.
14443 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14444 (SIZE_MAX, UINT_MAX): New macros.
14445 (quotearg_n_options): Abort if N is negative.
14446 Avoid overflow check on hosts where size_t is 64 bits and int
14447 is 32 bits, as overflow is impossible there.
14448 Fix off-by-one typo that caused unnecessary reallocation.
14450 2001-11-29 Paul Eggert <eggert@twinsun.com>
14452 Name space cleanup in generated parser.
14454 * doc/bison.texinfo (Bison Parser): Discuss system headers
14455 and their effect on the user name space.
14457 * src/bison.simple:
14458 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14459 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14460 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14462 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14463 on user names when possible.
14465 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14466 Simplify test for whather <alloca.h> exists.
14468 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14470 (<stdio.h>): Include if YYDEBUG.
14472 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14473 ! defined (yyoverflow) && ! defined (yymemcpy).
14475 (yymemcpy, yyparse): Rename local variables as needed so that
14476 they all begin with 'yy'.
14478 (yystrlen, yystpcpy): New functions.
14480 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14483 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14484 instead of relying on string.h functions. Use YYSTACK_ALLOC
14485 and YYSTACK_FREE instead of malloc and free.
14487 2001-11-30 Akim Demaille <akim@epita.fr>
14489 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14490 before their first uses.
14491 (YYBISON, YYPURE): Move to the top of the output.
14493 2001-11-30 Akim Demaille <akim@epita.fr>
14495 * tests/reduce.at (Useless Nonterminals): Fix.
14497 2001-11-30 Akim Demaille <akim@epita.fr>
14499 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14500 if body instead of `;' to pacify GCC's warnings.
14502 2001-11-30 Akim Demaille <akim@epita.fr>
14504 Instead of mapping the LHS of unused rules to -1, keep the LHS
14505 valid, but flag the rules as invalid.
14507 * src/gram.h (rule_t): `useful' is a new member.
14508 * src/print.c (print_grammar): Adjust.
14509 * src/derives.c (set_derives): Likewise.
14510 * src/reader.c (packgram, reduce_output): Likewise.
14511 * src/reduce.c (reduce_grammar_tables): Likewise.
14512 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14514 2001-11-30 Akim Demaille <akim@epita.fr>
14516 * src/reduce.c (reduce_output): Formatting changes.
14517 * src/print.c (print_results, print_grammar): Likewise.
14518 * tests/regression.at (Rule Line Numbers)
14519 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14521 2001-11-30 Akim Demaille <akim@epita.fr>
14523 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14524 useless nonterminals, move them at the end of the symbol arrays.
14525 (reduce_output): Adjust.
14526 * tests/reduce.at (Useless Nonterminals): Adjust.
14528 2001-11-30 Akim Demaille <akim@epita.fr>
14530 * src/reduce.c: Various comment/formatting changes.
14531 (nonterminals_reduce): New, extracted from...
14532 (reduce_grammar_tables): here.
14533 (reduce_grammar): Call nonterminals_reduce.
14535 2001-11-29 Paul Eggert <eggert@twinsun.com>
14537 * src/bison.simple (YYSTACK_REALLOC): Remove.
14538 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14539 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14541 (union yyalloc): New type.
14542 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14543 an arbitrary restriction on hosts where size_t is wider than int.
14545 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14546 a parser stack overflow. Allocate just one block of memory for all
14547 three stacks, instead of allocating three blocks; this typically is
14548 faster and reduces fragmentation.
14550 Do not limit the number of items in the stack to a value that fits
14551 in 'int', as this is an arbitrary limit on hosts with 64-bit
14552 size_t and 32-bit int.
14554 2001-11-29 Marc Autret <autret_m@epita.fr>
14556 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14557 of defining YYERROR_VERBOSE.
14558 [AT_DATA]: $4 is now out of C declarations in the prologue.
14560 2001-11-28 Marc Autret <autret_m@epita.fr>
14562 * src/reader.c (parse_dquoted_param): New.
14563 (parse_skel_decl): Use it.
14564 * src/lex.h: Add its prototype.
14565 * src/lex.c (literalchar): Become not static.
14567 2001-11-28 Marc Autret <autret_m@epita.fr>
14569 * src/output.h: And put its extern declaration here.
14570 * src/output.c (error_verbose): Define here.
14571 (prepare): Echo name modification.
14572 * src/getargs.h: Clean its extern declaration.
14573 * src/getargs.c (error_verbose_flag): Remove.
14574 (getargs): Remove case 'e'.
14575 * src/options.c (option_table): 'error-verbose' is now seen as simple
14579 * src/reader.c (read_declarations): Remove case tok_include.
14580 (parse_include_decl): Remove.
14581 * src/lex.h (token_t): Remove tok_include.
14582 * src/options.c (option_table): 'include' is now a simple command line
14585 2001-11-28 Marc Autret <autret_m@epita.fr>
14587 * src/bison.simple: Adjust muscle names.
14588 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14589 * src/output.c (prepare): s/_/-/ for the muscles names.
14590 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14592 2001-11-28 Marc Autret <autret_m@epita.fr>
14594 * src/bison.simple: Fix debug.
14595 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14597 2001-11-28 Akim Demaille <akim@epita.fr>
14599 * src/LR0.c (shifts_new): New.
14600 (save_shifts, insert_start_shift, augment_automaton): Use it.
14602 2001-11-28 Akim Demaille <akim@epita.fr>
14604 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14607 2001-11-28 Akim Demaille <akim@epita.fr>
14609 * src/closure.c (closure): Instead of looping over word in array
14610 then bits in words, loop over bits in array.
14612 2001-11-28 Akim Demaille <akim@epita.fr>
14614 * src/closure.c (closure): No longer optimize the special case
14615 where all the bits of `ruleset[r]' are set to 0, to make the code
14618 2001-11-28 Akim Demaille <akim@epita.fr>
14620 * src/closure.c (closure): `r' and `c' are new variables, used to
14621 de-obfuscate accesses to RULESET and CORE.
14623 2001-11-28 Akim Demaille <akim@epita.fr>
14625 * src/reduce.c (reduce_print): Use ngettext.
14626 (dump_grammar): Improve the trace accuracy.
14628 2001-11-28 Akim Demaille <akim@epita.fr>
14630 * src/reduce.c (dump_grammar): Don't translate trace messages.
14632 2001-11-28 Akim Demaille <akim@epita.fr>
14634 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14635 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14636 as all tags are free'ed afterwards.
14637 From Enrico Scholz.
14639 2001-11-27 Paul Eggert <eggert@twinsun.com>
14641 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14642 use alloca when we didn't want to, and vice versa.
14644 2001-11-27 Marc Autret <autret_m@epita.fr>
14646 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14648 * src/output.c (prepare): Remove its update.
14650 2001-11-27 Marc Autret <autret_m@epita.fr>
14652 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14653 Use %error-verbose.
14655 2001-11-27 Marc Autret <autret_m@epita.fr>
14657 * src/bison.simple: Remove YYERROR_VERBOSE using.
14658 Use %%error_verbose.
14659 (yyparse): Likewise.
14660 * src/output.c (prepare): Give its final value.
14661 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14662 * src/getargs.h: Add its extern declaration.
14663 * src/getargs.c (error_verbose_flag): New int.
14664 (getargs): Update to catch new case.
14665 * src/options.c (option_table): 'error-verbose' is a new option.
14666 (shortopts): Update.
14668 2001-11-27 Akim Demaille <akim@epita.fr>
14670 * src/system.h: Use intl/libgettext.h.
14671 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14673 2001-11-27 Akim Demaille <akim@epita.fr>
14675 * tests/torture.at (Exploding the Stack Size with Malloc):
14676 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14678 2001-11-27 Akim Demaille <akim@epita.fr>
14680 * src/files.c: Include error.h.
14681 Reported by Hans Aberg.
14683 2001-11-26 Marc Autret <autret_m@epita.fr>
14685 * src/reader.c (parse_include_decl): New, not yet implemented.
14686 (read_declarations): Add case tok_include.
14687 * src/getargs.h (include): Add its extern definition.
14688 * src/getargs.c (include): New const char *.
14689 (getargs): Add case '-I'.
14690 * src/options.c (option_table): Add include as command line and
14692 * src/lex.h (token_t): Add tok_include.
14694 2001-11-26 Akim Demaille <akim@epita.fr>
14696 * src/reader.c (readgram): Make sure rules for mid-rule actions
14697 have a lineno equal to that of their host rule.
14698 Reported by Hans Aberg.
14699 * tests/regression.at (Rule Line Numbers): New.
14701 2001-11-26 Akim Demaille <akim@epita.fr>
14703 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14706 2001-11-26 Akim Demaille <akim@epita.fr>
14708 * src/complain.c, src/complain.h (error): Remove, provided by
14711 2001-11-26 Akim Demaille <akim@epita.fr>
14713 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14714 issue an error message.
14715 * tests/regression.at (Invalid %directive): New.
14716 Reported by Hans Aberg.
14718 2001-11-26 Akim Demaille <akim@epita.fr>
14720 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14721 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14723 2001-11-26 Akim Demaille <akim@epita.fr>
14725 * src/conflicts.c (conflicts_print): Don't complain at all when
14726 there are no reduce/reduce conflicts, and as many shift/reduce
14727 conflicts as expected.
14728 * tests/regression.at (%expect right): Adjust.
14730 2001-11-23 Akim Demaille <akim@epita.fr>
14732 * lib/alloca.c: Update, from fileutils.
14734 2001-11-23 Akim Demaille <akim@epita.fr>
14736 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14738 2001-11-23 Akim Demaille <akim@epita.fr>
14740 * src/system.h: Include alloca.h.
14741 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14743 2001-11-23 Akim Demaille <akim@epita.fr>
14745 * src/print_graph.c (print_actions): Remove `rule', unused.
14746 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14747 pacify GCC's signed < unsigned warnings.
14748 * src/closure.c (itemsetsize): Likewise.
14749 * src/reader.c (symbol_list_new): Static.
14751 2001-11-23 Akim Demaille <akim@epita.fr>
14753 Attaching lineno to buckets is stupid, since only one copy of each
14754 symbol is kept, only the line of the first occurrence is kept too.
14756 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14757 * src/reader.c (rline_allocated): Remove, unused.
14758 (symbol_list): Have a `line' member.
14759 (symbol_list_new): New.
14760 (readgram): Use it.
14761 * src/print.c (print_grammar): Output the rule line numbers.
14762 * tests/regression.at (Solved SR Conflicts)
14763 (Unresolved SR Conflicts): Adjust.
14764 Reported by Hans Aberg.
14766 2001-11-22 Marc Autret <autret_m@epita.fr>
14768 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14770 2001-11-22 Marc Autret <autret_m@epita.fr>
14772 * src/muscle_tab.c (muscle_init): Remove initialization of
14774 * src/output.c (output_master_parser): Do it here.
14776 2001-11-20 Akim Demaille <akim@epita.fr>
14779 * configure.in (ALL_LINGUAS): Adjust.
14780 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14781 longer contains strings to translate.
14783 2001-11-19 Akim Demaille <akim@epita.fr>
14785 * src/conflicts.c (conflicts_print): Add a missing \n.
14787 2001-11-19 Akim Demaille <akim@epita.fr>
14789 * src/nullable.c (nullable_print): New.
14790 (set_nullable): Call it when tracing.
14791 Better locality of variables.
14793 2001-11-19 Akim Demaille <akim@epita.fr>
14795 * src/print.c (print_actions): Better locality of variables.
14797 2001-11-19 Akim Demaille <akim@epita.fr>
14799 * src/derives.c (print_derives): Fix and enrich.
14800 * src/closure.c (print_fderives): Likewise.
14802 2001-11-19 Akim Demaille <akim@epita.fr>
14804 * src/closure.c (itemsetend): Remove, replaced with...
14805 (itemsetsize): new.
14807 2001-11-19 Akim Demaille <akim@epita.fr>
14809 * src/LR0.c (kernel_end): Remove, replaced with...
14810 (kernel_size): new.
14812 2001-11-19 Akim Demaille <akim@epita.fr>
14814 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14817 2001-11-19 Akim Demaille <akim@epita.fr>
14819 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14821 2001-11-19 Akim Demaille <akim@epita.fr>
14823 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14825 * src/LR0.c: Likewise.
14826 (allocate_itemsets): Use arrays instead of pointers to clarify.
14828 2001-11-19 Akim Demaille <akim@epita.fr>
14830 * src/getargs.c (statistics_flag): Replace with...
14832 (longopts): Accept --trace instead of --statistics.
14833 * src/getargs.h, src/options.c: Adjust.
14834 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14835 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14837 2001-11-19 Akim Demaille <akim@epita.fr>
14839 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
14840 pointers to clarify the code.
14841 (save_reductions, save_shifts): Factor common parts of alternatives.
14843 2001-11-19 Akim Demaille <akim@epita.fr>
14845 * src/LR0.c (new_state, get_state): Complete TRACE code.
14846 * src/closure.c: Include `reader.h' to get `tags', needed by the
14848 Rename the conditional DEBUG as TRACE.
14849 Output consistently TRACEs to stderr, not stdout.
14850 * src/derives.c: Likewise.
14851 * src/reduce.c: (inaccessable_symbols): Using if is better style
14853 Use `#if TRACE' instead of `#if 0' for tracing code.
14855 2001-11-19 Akim Demaille <akim@epita.fr>
14857 * src/system.h (LIST_FREE, shortcpy): New.
14858 * src/LR0.c: Use them.
14859 * src/output.c (free_itemsets, free_reductions, free_shifts):
14860 Remove, replaced by LIST_FREE.
14862 2001-11-19 Akim Demaille <akim@epita.fr>
14864 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14865 (REDUCTIONS_ALLOC): New.
14866 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14869 2001-11-19 Akim Demaille <akim@epita.fr>
14871 * src/LR0.c (new_state): Complete trace code.
14872 * src/nullable.c (set_nullable): Don't translate traces.
14874 2001-11-19 Akim Demaille <akim@epita.fr>
14876 * src/print_graph.c (print_core): Better locality of variables.
14877 * src/print.c (print_core): Likewise.
14879 2001-11-19 Akim Demaille <akim@epita.fr>
14881 * src/vcg.c: You do the output, so you are responsible of the
14882 handling of VCG syntax, in particular: use quotearg.
14883 * src/print_graph.c: Don't.
14884 (print_actions): Don't output the actions as part of the nodes,
14885 since that's the job of the edges.
14886 (print_state): Don't output by hand: fill the node description,
14887 and ask for its output.
14889 2001-11-19 Akim Demaille <akim@epita.fr>
14891 * src/bison.simple (yyparse): When verbosely reporting an error,
14892 no longer put additional quotes around token names.
14893 * tests/calc.at: Adjust.
14895 2001-11-19 Akim Demaille <akim@epita.fr>
14897 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14898 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14899 * src/output.c: Adjust.
14901 2001-11-19 Akim Demaille <akim@epita.fr>
14903 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14905 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14907 2001-11-19 Akim Demaille <akim@epita.fr>
14909 * src/gram.h (rule_t): New.
14911 (rrhs, rlhs): Remove, part of state_t.
14912 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14913 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14914 * src/reader.c, src/reduce.c: Adjust.
14916 2001-11-19 Akim Demaille <akim@epita.fr>
14918 * src/reader.c (symbols_output): New, extracted from...
14919 (packsymbols): Here.
14922 2001-11-19 Akim Demaille <akim@epita.fr>
14924 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14925 (maxrhs): this new function.
14927 2001-11-19 Akim Demaille <akim@epita.fr>
14929 * src/lalr.c (F): New macro to access the variable F.
14932 2001-11-19 Akim Demaille <akim@epita.fr>
14934 * src/lalr.h (LA): New macro to access the variable LA.
14935 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14936 * src/lalr.c: Adjust.
14938 2001-11-19 Akim Demaille <akim@epita.fr>
14940 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14941 (set_state_table): handle the `lookaheads' members.
14943 2001-11-19 Akim Demaille <akim@epita.fr>
14945 * src/lalr.h (lookaheads): Removed array, whose contents is now
14947 (state_t): this structure.
14948 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14951 2001-11-19 Akim Demaille <akim@epita.fr>
14953 * src/lalr.h (consistent): Removed array, whose contents is now
14955 (state_t): this structure.
14956 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14959 2001-11-19 Akim Demaille <akim@epita.fr>
14961 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
14962 contents are now members of...
14963 (state_t): this structure.
14964 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14967 2001-11-19 Akim Demaille <akim@epita.fr>
14969 * src/lalr.h (state_t): New.
14970 (state_table): Be a state_t * instead of a core **.
14971 (accessing_symbol): Remove, part of state_t.
14972 * src/lalr.c: Adjust.
14973 (set_accessing_symbol): Merge into...
14974 (set_state_table): this.
14975 * src/print_graph.c, src/conflicts.c: Adjust.
14977 2001-11-14 Akim Demaille <akim@epita.fr>
14979 * tests/calc.at, tests/output.at, tests/regression.at,
14980 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
14981 now the tests are run in private dirs, therefore AC_CLEANUP and
14982 family can be simplified to 0-ary.
14983 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
14984 use abs. path to find config.h.
14985 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
14986 stderr, there can be way too much random noise.
14987 Instead pass -Werror to GCC and rely on the exit status.
14988 Reported by Wolfram Wagner.
14990 2001-11-14 Akim Demaille <akim@epita.fr>
14992 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14993 defined only if yyoverflow is defined, to avoid `warning: unused
14995 Reported by The Test Suite.
14997 2001-11-14 Akim Demaille <akim@epita.fr>
14999 * src/print.c: Include reduce.h.
15000 Reported by Hans Aberg.
15002 2001-11-14 Akim Demaille <akim@epita.fr>
15004 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
15005 Revert a previous patch: these are really const.
15006 * src/conflicts.c (conflict_report): Additional useless pair of
15007 braces to pacify GCC's warnings for `if () if () {} else {}'.
15008 * src/lex.c (parse_percent_token): Replace equal_offset with
15011 Be sure to strdup `arg' when used, since there is no reason for
15012 token_buffer not to change.
15014 2001-11-14 Akim Demaille <akim@epita.fr>
15016 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
15018 * src/main.c (main): Use them.
15019 Suggested by Hans Aberg.
15021 2001-11-12 Akim Demaille <akim@epita.fr>
15023 * src/system.h (ngettext): Now that we use ngettext, be sure to
15024 provide a default definition when NLS are not used.
15026 2001-11-12 Akim Demaille <akim@epita.fr>
15028 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
15029 Use @kbd to denote user input.
15030 (Language and Grammar): ANSIfy the example.
15031 Adjust its layout for info/notinfo.
15032 (Location Tracking Calc): Output error messages to stderr.
15033 Output locations in a more GNUtically correct way.
15034 Fix a couple of Englishos.
15035 Adjust @group/@end group pairs.
15037 2001-11-12 Akim Demaille <akim@epita.fr>
15039 %expect was not functioning at all.
15041 * src/conflicts.c (expected_conflicts): Set to -1.
15042 (conflict_report): Use ngettext.
15043 (conflicts_print): Check %expect and make its violation an error.
15044 * doc/bison.texinfo (Expect Decl): Adjust.
15045 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
15046 * tests/regression.at (%expect not enough, %expect right)
15047 (%expect too much): New.
15049 2001-11-12 Akim Demaille <akim@epita.fr>
15051 * tests/regression.at (Conflicts): Rename as...
15052 (Unresolved SR Conflicts): this.
15053 (Solved SR Conflicts): New.
15055 2001-11-12 Akim Demaille <akim@epita.fr>
15057 * src/reduce.c (print_results): Rename as...
15058 (reduce_output): This.
15059 Output to OUT, passed as argument, instead of output_obstack.
15060 (dump_grammar): Likewise.
15061 (reduce_free): New.
15063 (reduce_grammar): No longer call reduce_output, since...
15064 * src/print.c (print_results): do it.
15065 * src/main.c (main): Call reduce_free;
15067 2001-11-12 Akim Demaille <akim@epita.fr>
15069 * src/conflicts.c (print_reductions): Accept OUT as argument.
15070 Output to it, not to output_obstack.
15071 * src/print.c (print_actions): Adjust.
15073 2001-11-12 Akim Demaille <akim@epita.fr>
15075 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
15076 the result instead of using...
15077 (src_total, rrc_total, src_count, rrc_count): Remove.
15078 (any_conflicts): Remove.
15079 (print_conflicts): Split into...
15080 (conflicts_print, conflicts_output): New.
15081 * src/conflicts.h: Adjust.
15082 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
15083 * src/print.c (print_grammar): Issue `\n' between two rules.
15084 * tests/regression.at (Conflicts): New.
15085 Reported by Tom Lane.
15087 2001-11-12 Akim Demaille <akim@epita.fr>
15089 * tests/regression.at (Invalid input): Remove, duplicate with
15090 ``Invalid input: 1''.
15092 2001-11-12 Akim Demaille <akim@epita.fr>
15094 * tests/torture.at (AT_DATA_STACK_TORTURE)
15095 (Exploding the Stack Size with Alloca)
15096 (Exploding the Stack Size with Malloc): New.
15098 2001-11-12 Akim Demaille <akim@epita.fr>
15100 * src/bison.simple (YYSTACK_REALLOC): New.
15101 (yyparse) [!yyoverflow]: Use it and free the old stack.
15102 Reported by Per Allansson.
15104 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
15106 * src/bison.simple: Define type yystype instead of YYSTYPE, and
15107 define CPP macro, which substitute YYSTYPE by yystype.
15108 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
15109 with yyltype/YYLTYPE. This allows inclusion of the generated
15110 header within the parser if the compiler, such as GGC, accepts
15111 multiple equivalent #defines.
15114 2001-11-05 Akim Demaille <akim@epita.fr>
15116 * src/reader.c (symbols_output): New, extracted from...
15117 (packsymbols): here.
15120 2001-11-05 Akim Demaille <akim@epita.fr>
15122 * src/lex.c (parse_percent_token): s/quotearg/quote/.
15124 2001-11-05 Akim Demaille <akim@epita.fr>
15126 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
15129 2001-11-05 Akim Demaille <akim@epita.fr>
15131 * src/options.h (struct option_table_struct): set_flags is void*.
15132 * src/options.c (longopts): Support `--output' and `%output'.
15134 * src/lex.h (tok_setopt): Remove, replaced with...
15135 (tok_intopt, tok_stropt): these new guys.
15136 * src/lex.c (getopt.h): Not needed.
15137 (token_buffer, unlexed_token_buffer): Not const.
15138 (percent_table): Promote `-' over `_' in directive names.
15139 Active `%name-prefix', `file-prefix', and `output'.
15140 (parse_percent_token): Accept possible arguments to directives.
15141 Promote `-' over `_' in directive names.
15143 2001-11-04 Akim Demaille <akim@epita.fr>
15145 * doc/bison.texinfo (Decl Summary): Split the list into
15146 `directives for grammars' and `directives for bison'.
15148 Add description of `%name-prefix', `file-prefix', and `output'.
15149 Promote `-' over `_' in directive names.
15150 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
15151 Simplify the description of `--name-prefix'.
15152 Promote `-' over `_' in directive names.
15153 Promote `--output' over `--output-file'.
15154 Fix the description of `--defines'.
15155 * tests/output.at: Exercise %file-prefix and %output.
15157 2001-11-02 Akim Demaille <akim@epita.fr>
15159 * doc/refcard.tex: Update.
15161 2001-11-02 Akim Demaille <akim@epita.fr>
15163 * src/symtab.h (SUNDEF): New.
15164 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
15165 stand for `uninitialized', instead of 0.
15166 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
15167 * src/lex.c (lex): Adjust.
15169 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
15171 Let yylex return it instead of a plain 0.
15172 Reported by Dick Streefland.
15174 2001-11-02 Akim Demaille <akim@epita.fr>
15176 * tests/regression.at (Mixing %token styles): New test.
15178 2001-11-02 Akim Demaille <akim@epita.fr>
15180 * src/reader.c (parse_thong_decl): Formatting changes.
15181 (token_translations_init): New, extracted from...
15182 (packsymbols): Here.
15185 2001-11-01 Akim Demaille <akim@epita.fr>
15187 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
15188 Check that `9foo.y' produces correct cpp guards.
15189 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
15193 2001-11-01 Akim Demaille <akim@epita.fr>
15195 * tests/regression.at (Invalid input: 2): New.
15196 * src/lex.c (unlexed_token_buffer): New.
15197 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
15201 2001-11-01 Akim Demaille <akim@epita.fr>
15203 * tests/calc.at: Catch up with 1.30.
15204 * configure.in: Bump to 1.49a.
15205 Adjust to newer Autotest.
15207 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
15209 * src/conflicts.c: Move global variables rrc_total and src_total ...
15210 (print_conflicts): here.
15211 * src/output.c (output): Free global variable user_toknums.
15212 * src/lex.c (token_obstack): Become static.
15214 2001-10-18 Akim Demaille <akim@epita.fr>
15216 * tests/atlocal.in (GCC): Add.
15217 * tests/calc.at: s/m4_match/m4_bmatch/.
15218 s/m4_patsubst/m4_bpatsubst/.
15219 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
15220 * configure.in: AC_SUBST(GCC).
15222 2001-10-14 Marc Autret <autret_m@epita.fr>
15224 * src/options.c (create_long_option_table): Fix.
15226 2001-10-10 Akim Demaille <akim@epita.fr>
15228 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
15230 2001-10-04 Akim Demaille <akim@epita.fr>
15232 * src/reader.c (parse_union_decl): Push the caracters in
15233 union_obstack, not attrs_obstack.
15235 2001-10-04 Akim Demaille <akim@epita.fr>
15237 Merge in the branch 1.29.
15239 * src/reader.c (packsymbols): Use a temporary obstack for
15240 `%%tokendef', since output_stack is already used elsewhere.
15242 2001-10-02 Akim Demaille <akim@epita.fr>
15246 2001-10-02 Akim Demaille <akim@epita.fr>
15250 2001-10-02 Akim Demaille <akim@epita.fr>
15252 * tests/regression.at (Invalid CPP headers): New.
15253 From Alexander Belopolsky.
15254 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
15256 2001-10-02 Akim Demaille <akim@epita.fr>
15258 * tests/regression.at (Invalid input): New.
15259 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
15262 2001-10-02 Akim Demaille <akim@epita.fr>
15264 * tests/calc.at: Now that --debug works, the tests must be adjusted.
15266 2001-10-02 Akim Demaille <akim@epita.fr>
15268 * src/output.c (output_parser): Assert `skeleton'.
15269 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
15273 2001-10-01 Marc Autret <autret_m@epita.fr>
15275 * src/lex.h: Echo modifications.
15276 * src/lex.c (unlex): Parameter is now token_t.
15279 2001-10-01 Marc Autret <autret_m@epita.fr>
15281 * src/main.c: Include lex.h.
15284 2001-09-29 Akim Demaille <akim@epita.fr>
15286 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
15288 2001-09-28 Akim Demaille <akim@epita.fr>
15290 * tests/testsuite.at: Update to newer Autotest.
15291 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
15293 2001-09-27 Akim Demaille <akim@epita.fr>
15295 Position independent wrapper.
15297 * tests/bison: Remove.
15298 * tests/bison.in: New.
15299 * configure.in: Adjust.
15301 2001-09-27 Paul Eggert <eggert@twinsun.com>
15303 Port quotearg fixes from tar 1.13.24.
15305 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
15307 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
15308 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
15310 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
15311 * m4/mbrtowc.m4: New file.
15312 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
15313 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
15315 2001-09-27 Akim Demaille <akim@epita.fr>
15319 2001-09-27 Akim Demaille <akim@epita.fr>
15323 2001-09-25 Akim Demaille <akim@epita.fr>
15325 * src/system.h: Include `xalloc.h'.
15326 Remove it from the C files.
15327 * src/files.c (output_files): Free the obstacks.
15328 * src/lex.c (init_lex): Rename as...
15331 * src/main.c (main): Use it.
15333 2001-09-24 Marc Autret <autret_m@epita.fr>
15335 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
15336 to output informations in fout (FILE*).
15337 (open_graph, close_graph): Likewise.
15338 (output_graph, output_edge, output_node): Likewise.
15339 * src/vcg.h: Update function prototypes.
15340 * src/print_graph.c (print_graph): Open output graph file.
15341 (print_actions): Adjust.
15342 * src/files.h: Remove extern declaration.
15343 * src/files.c: Remove graph_obstack declaration.
15344 (open_files): Remove graph_obstack initialization.
15345 (output_files): Remove graph_obstack saving.
15347 2001-09-24 Marc Autret <autret_m@epita.fr>
15349 * src/files.c (compute_output_file_names): Fix.
15351 2001-09-24 Marc Autret <autret_m@epita.fr>,
15352 Akim Demaille <akim@epita.fr>
15354 * src/reader.c (reader): Remove call to free_symtab ().
15355 * src/main.c (main): Call it here.
15357 * src/conflicts.c (initialize_conflicts): Rename as...
15358 (solve_conflicts): this.
15359 * src/print.c (print_core, print_actions, print_state)
15360 (print_grammar): Dump to a file instead a `output_obstack'.
15361 (print_results): Dump `output_obstack', and then proceed with the
15363 * src/files.c (compute_output_file_names, close_files): New.
15364 (output_files): Adjust.
15365 * src/main.c (main): Adjust.
15367 2001-09-23 Marc Autret <autret_m@epita.fr>
15369 * src/files.c (compute_header_macro): Computes header macro name
15370 from spec_defines_file when given.
15372 2001-09-23 Marc Autret <autret_m@epita.fr>
15374 * src/files.c (output_files): Add default extensions.
15376 2001-09-22 Akim Demaille <akim@epita.fr>
15378 * src/conflicts.c (finalize_conflicts): Rename as...
15379 (free_conflicts): this.
15381 2001-09-22 Akim Demaille <akim@epita.fr>
15383 * src/gram.c (gram_free): Rename back as...
15385 (output_token_translations): Free `token_translations'.
15386 * src/symtab.c (free_symtab): Free the tag field.
15388 2001-09-22 Akim Demaille <akim@epita.fr>
15390 Remove `translations' as it is always set to true.
15392 * src/gram.h: Adjust.
15393 * src/reader.c (packsymbols, parse_token_decl): Adjust
15394 * src/print.c (print_grammar): Adjust.
15395 * src/output.c (output_token_translations): Adjust.
15396 * src/lex.c (lex): Adjust.
15397 * src/gram.c: Be sure the set pointers to NULL.
15398 (dummy): Rename as...
15401 2001-09-22 Akim Demaille <akim@epita.fr>
15403 * configure.in: Invoke AM_LIB_DMALLOC.
15404 * src/system.h: Use dmalloc.
15405 * src/LR0.c: Be sure to have pointers initialized to NULL.
15406 (allocate_itemsets): Allocate kernel_items only if needed.
15408 2001-09-22 Akim Demaille <akim@epita.fr>
15410 * configure.in: Bump to 1.29b.
15411 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
15412 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
15413 need xmalloc.c in calc.y.
15416 2001-09-21 Akim Demaille <akim@epita.fr>
15419 * Makefile.maint, config/config.guess, config/config.sub,
15420 * config/missing: Update from masters.
15421 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
15423 * configure.in (ALL_LINGUAS): Add `tr'.
15425 2001-09-21 Akim Demaille <akim@epita.fr>
15427 * tests/Makefile.am (package.m4): Move to...
15428 ($(srcdir)/$(TESTSUITE)): here.
15430 2001-09-20 Akim Demaille <akim@epita.fr>
15432 * src/complain.c: No longer try to be standalone: use system.h.
15433 Don't assume __STDC__ is defined to 1. Just test if it is defined.
15434 * src/complain.h: Likewise.
15435 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
15436 Remove the unused variable `n'.
15437 From Albert Chin-A-Young.
15439 2001-09-18 Marc Autret <autret_m@epita.fr>
15441 * doc/bison.1: Update.
15442 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15444 (Option Cross Key): Update.
15447 2001-09-18 Marc Autret <autret_m@epita.fr>
15449 * tests/regression.at: New test (comment in %union).
15451 2001-09-18 Marc Autret <autret_m@epita.fr>
15453 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15455 Reported by Keith Browne.
15457 2001-09-18 Marc Autret <autret_m@epita.fr>
15459 * tests/output.at: Add tests for --defines and --graph.
15461 2001-09-18 Marc Autret <autret_m@epita.fr>
15463 * tests/output.at: Removes tests of %{header,src}_extension features.
15465 2001-09-18 Akim Demaille <akim@epita.fr>
15467 * tests/Makefile.am (package.m4): New.
15468 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15469 (_AT_CHECK_CALC_ERROR): Likewise.
15470 Factor the `, ' part of verbose error messages.
15472 2001-09-18 Marc Autret <autret_m@epita.fr>
15474 * src/getargs.c (longopts): Declare --defines and --graph as options
15475 with optional arguments.
15476 * src/files.h: Add extern declarations.
15477 * src/files.c (spec_graph_file, spec_defines_file): New.
15478 (output_files): Update.
15479 Remove CPP-outed code.
15481 2001-09-18 Marc Autret <autret_m@epita.fr>
15483 Turn off %{source,header}_extension feature.
15485 * src/files.c (compute_exts_from_gf): Update.
15486 (compute_exts_from_src): Update.
15487 (output_files): CPP-out useless code.
15488 * src/files.h: Remove {header,source}_extension extern declarations.
15489 * src/reader.c (parse_dquoted_param): CPP-out.
15490 (parse_header_extension_decl): Remove.
15491 (parse_source_extension_decl): Remove.
15492 (read_declarations): Remove cases tok_{hdrext,srcext}.
15493 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15494 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15496 2001-09-10 Akim Demaille <akim@epita.fr>
15498 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15499 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15500 (AT_CHECK_OUTPUT): this.
15501 Merely check ls' exit status, its output is useless.
15503 2001-09-10 Akim Demaille <akim@epita.fr>
15505 * tests/calc.at: Use m4_match.
15506 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15508 2001-09-10 Marc Autret <autret_m@epita.fr>,
15509 Akim Demaille <akim@epita.fr>
15511 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15513 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15515 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15516 * src/lex.h: Adjust prototype.
15517 (token_t): Add `tok_undef'.
15518 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15519 (parse_percent_token): Now returns token_t.
15520 Add default statement in switch.
15521 (lex): Separate `c' as an input variable, from the token_t result
15523 (unlexed): Is a token_t.
15525 2001-09-10 Akim Demaille <akim@epita.fr>
15527 * configure.in: Bump to 1.29a.
15529 2001-09-07 Akim Demaille <akim@epita.fr>
15533 2001-08-30 Akim Demaille <akim@epita.fr>
15535 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15536 * m4/atconfig.m4: Remove.
15537 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15538 * tests/bison: New.
15539 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15540 m4_if, m4_patsubst, and m4_regexp.
15541 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15542 `input' file instead of echo.
15544 2001-08-29 Akim Demaille <akim@epita.fr>
15548 2001-08-29 Akim Demaille <akim@epita.fr>
15552 2001-08-29 Paul Eggert <eggert@twinsun.com>
15554 * src/bison.simple (yyparse): Don't take the address of an
15555 item before the start of an array, as that doesn't conform to
15558 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15560 * doc/bison.texinfo (Location Tracking Calc): New node.
15562 2001-08-29 Paul Eggert <eggert@twinsun.com>
15564 * src/output.c (output): Do not define const, as this now
15565 causes more problems than it cures.
15567 2001-08-29 Akim Demaille <akim@epita.fr>
15569 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15571 Be sure to tag the `detailmenu'.
15573 2001-08-29 Akim Demaille <akim@epita.fr>
15575 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15576 download in a tmp dir.
15578 2001-08-28 Marc Autret <autret_m@epita.fr>
15580 * config/depcomp: New file.
15582 2001-08-28 Marc Autret <autret_m@epita.fr>
15584 * doc/bison.1 (mandoc): Adjust.
15585 From Juan Manuel Guerrero.
15587 2001-08-28 Marc Autret <autret_m@epita.fr>
15589 * src/print_graph.c (print_state): Fix.
15591 2001-08-27 Marc Autret <autret_m@epita.fr>
15593 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15595 Echo modifications to the functions prototypes.
15596 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15598 2001-08-27 Marc Autret <autret_m@epita.fr>
15600 * src/vcg.c: Include `xalloc.h'.
15601 (add_colorentry): New.
15602 (add_classname): New.
15603 (add_infoname): New.
15604 * src/vcg.h: Add new prototypes.
15606 2001-08-27 Akim Demaille <akim@epita.fr>
15608 * Makefile.maint: Sync. again with CVS Autoconf.
15610 2001-08-27 Akim Demaille <akim@epita.fr>
15612 * Makefile.maint: Formatting changes.
15613 (po-update, cvs-update, update): New targets.
15616 2001-08-27 Akim Demaille <akim@epita.fr>
15618 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15619 * Makefile.maint: Sync. with CVS Autoconf.
15621 2001-08-27 Marc Autret <autret_m@epita.fr>
15623 * src/vcg.h (struct infoname_s): New.
15624 (struct colorentry_s): New.
15625 (graph_s): New fields {vertical,horizontal}_order in structure.
15626 Add `infoname' field.
15627 Add `colorentry' field;
15628 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15629 (G_HORIZONTAL_ORDER): New.
15631 (G_COLORENTRY): New.
15632 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15633 Add output of `infoname'.
15634 Add output of `colorentry'.
15636 2001-08-27 Marc Autret <autret_m@epita.fr>
15638 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15639 This one shadowed a global parameter.
15641 2001-08-24 Marc Autret <autret_m@epita.fr>
15643 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15644 instead of `unsigned'.
15645 (print_state): Do not call obstack_object_size () in obstack_grow ()
15646 to avoid macro variables shadowing.
15648 2001-08-23 Marc Autret <autret_m@epita.fr>
15650 * src/lex.c (percent_table): Typo: s/naem/name/.
15652 Normalize new options declarations.
15654 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15656 * tests/suite.at: Exercise %header_extension and %source_extension.
15658 2001-08-16 Marc Autret <autret_m@epita.fr>
15660 * src/reader.c (parse_dquoted_param): New.
15661 (parse_header_extension_decl): Use it.
15662 (parse_source_extension_decl): Likewise.
15664 2001-08-16 Marc Autret <autret_m@epita.fr>
15666 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15667 (get_xxxx_str): Use assert () instead of complain ().
15668 Remove return invokations in default cases.
15669 (get_decision_str): Modify default behaviour. Remove second argument.
15670 Echo modifications on calls.
15671 (output_graph): Fix.
15673 2001-08-16 Marc Autret <autret_m@epita.fr>
15675 * src/getargs.c (usage): Update with ``-g, --graph''.
15677 2001-08-16 Marc Autret <autret_m@epita.fr>
15679 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15680 (Option Cross Key): Likewise.
15681 * doc/bison.1: Update.
15683 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
15685 * src/output.c (output_master_parser): Don't finish action_obstack.
15686 (output_parser): Don't care about the muscle action, here.
15687 (prepare): Copy the action_obstack in the action muscle.
15688 (output): Free action_obstack.
15690 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15692 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15693 will contain `%union' declaration.
15694 (parse_union_decl): Delete #line directive output.
15695 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15696 informations about %union.
15697 (parse_union_decl): Copy the union_obstack in the muscle stype.
15698 * src/bison.simple: Add new #line directive.
15699 Add typdef %%stype YYSTYPE.
15701 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15703 * src/bison.simple: Add new `#line' directive.
15705 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
15707 * src/bison.simple: New `#line' directive.
15708 * src/output.c (output_parser): Support new dynamic muscle input_line.
15710 2001-09-22 Marc Autret <autret_m@epita.fr>
15712 * src/output.c (output_master_parser): New.
15713 (output_parser): Be more re-entrant.
15715 2001-09-21 Marc Autret <autret_m@epita.fr>
15717 * src/reader.c (copy_definition, parse_union_decl): Update and use
15719 (copy_action): Likewise.
15720 Use obstack_1grow ().
15721 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15723 2001-09-21 Marc Autret <autret_m@epita.fr>
15725 * src/options.c (option_table): Adjust.
15726 * src/lex.c (parse_percent_token): Fix.
15728 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15730 * src/options.c (symtab.h): Include it, need by lex.h.
15732 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15734 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15735 is now an option_table_struct*.
15736 (option_strcmp): New function option_strcmp.
15737 (parse_percent_token): Call option_strcmp.
15738 * src/getargs.c (xalloc.h, options.h): Include it.
15739 (getargs): Call create_long_option_table.
15740 (getargs): Free longopts at the end of the function.
15741 (shortopts): Move in options.c.
15742 * src/options.c (create_long_option_table): New function. Convert
15743 information from option_table to option structure.
15744 * src/reader.c (options.h): Include it.
15746 * src/Makefile.am: Adjust.
15747 * src/options.c (option_table): Create from longopts and percent_table.
15748 * src/getargs.c (longopts): Delete.
15749 * src/lex.c (struct percent_table_struct): Delete.
15750 (percent_table): Delete.
15751 (options.h): Include it.
15752 * src/options.c: Create.
15753 * src/options.h: Create.
15754 Declare enum opt_access_e.
15755 Define struct option_table_struct.
15757 2001-09-20 Marc Autret <autret_m@epita.fr>
15759 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15762 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
15764 * src/bison.simple: s/%%filename/%%skeleton.
15765 * src/muscle_tab.c (getargs.h): Include it.
15766 (muscle_init): Insert new muscle skeleton.
15768 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
15770 * src/output.c (output_parser): Delete unused variable actions_dumped.
15772 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
15774 * src/output.c (output): Delete call to reader_output_yylsp.
15775 * src/reader.c (reader): Likewise.
15776 * src/reader.h: Delete declaration of reader_output_yylsp.
15778 2001-09-02 Marc Autret <autret_m@epita.fr>
15780 * src/reader.c: Include muscle_tab.h.
15781 (parse_union_decl): Update.
15782 (parse_macro_decl): Rename parse_muscle_decl.
15783 Update to use renamed functions and variable.
15784 (read_declarations, copy_action, read_additionnal_code, : Updated
15785 with correct variables and functions names.
15786 (packsymbols, reader): Likewise.
15788 * src/reader.h (muscle_obstack): Extern declaration update.
15790 * src/output.c: Include muscle_tab.h
15791 In all functions using macro_insert, change by using muscle_insert ().
15792 (macro_obstack): Rename muscle_obstack.
15793 Echo modifications in the whole file.
15794 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15795 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15796 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15798 * src/muscle_tab.h: Update double inclusion macros.
15799 (macro_entry_s): Rename muscle_entry_s.
15802 * src/muscle_tab.c: Include muscle_tab.h.
15803 Rename macro_tabble to muscle_table.
15804 (mhash1, mhash2, mcmp): Use muscle_entry.
15805 (macro_init): Rename muscle_init. Update.
15806 (macro_insert): Rename muscle_insert. Update.
15807 (macro_find): Rename muscle_find. Update.
15809 * src/main.c: Include muscle_tab.h.
15810 (main): Call muscle_init ().
15811 * src/Makefile.am (bison_SOURCES): Echo modifications.
15813 2001-09-02 Marc Autret <autret_m@epita.fr>
15815 Now the files macro_tab.[ch] are named muscle_tab.[ch].
15817 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15819 2001-09-02 Marc Autret <autret_m@epita.fr>
15821 * src/macrotab.c, src/macrotab.h: Remove.
15823 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
15825 * src/reader.c (copy_guard): Use muscle to specify the `#line'
15828 2001-09-01 Marc Autret <autret_m@epita.fr>
15830 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15831 to an explicit value to activate the feature. We do it here.
15833 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15835 * src/output.c (prepare): Delete the `filename' muscule insertion.
15836 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15837 (parse_union_decl): Likewise.
15838 * src/macrotab.c (macro_init): Initialize filename by infile.
15840 2001-08-31 Marc Autret <autret_m@epita.fr>
15842 * src/bison.simple (YYLSP_NEEDED): New definition.
15843 * src/output.c (prepare): Add macro insertion of `locations_flag'
15845 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15847 * src/output.c (prepare): Delete insertion of previous muscles,
15848 and insert the `prefix' muscles.
15849 * src/macrotab.c (macro_init): Likewise.
15850 (macro_init): Initialization prefix directive by `yy'.
15851 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
15852 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15853 yylval, yydebug, yyerror, yynerrs and yyparse.
15854 New directive `#define' to substitute yydebug, ... with option
15857 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15859 * src/main.c (main): Standardize.
15860 * src/output.c (output_table_data, output_parser): Likewise.
15861 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15863 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15865 * src/reader.c (read_additionnal_code): Rename %%user_code to
15867 * src/output.c (output): Rename %%declarations to %%prologue.
15868 * src/bison.simple: Echo modifications.
15870 2001-08-31 Marc Autret <autret_m@epita.fr>
15872 * src/reader.c (readgram): CleanUp.
15873 (output_token_defines): Likewise.
15874 (packsymbols): Likewise.
15875 (reader): Likewise.
15876 * src/output.c (output): CPP-out useless code.
15878 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15880 * src/reader.c (reader): Delete obsolete call to function
15881 output_trailers and output_headers.
15882 * src/output.h: Remove obsolete functions prototypes of output_headers
15883 and output_trailers.
15885 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
15887 * src/main.c: Include macrotab.h.
15888 * src/macrotab.h (macro_entry_s): Constify fields.
15889 Adjust functions prototypes.
15890 * src/macrotab.c (macro_insert): Constify key and value.
15891 (macro_find): Constify key.
15892 (macro_insert): Include 'xalloc.h'
15893 (macro_insert): Use XMALLOC.
15894 (macro_find): Constify return value.
15895 * src/output.c (output_table_data): Rename table to table_data.
15896 (output_parser): Constify macro_key, macro_value.
15898 2001-08-30 Marc Autret <autret_m@epita.fr>
15900 * src/reader.c (parse_skel_decl): New.
15901 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
15902 * src/lex.h (token_t): New token `tok_skel'.
15903 * src/lex.c (percent_table): Add skeleton option entry.
15906 2001-08-29 Marc Autret <autret_m@epita.fr>
15908 * src/bison.simple: Add %%user_code directive at the end.
15909 * src/reader.c (read_additionnal_code): New.
15911 * src/output.c (output_program): Remove.
15914 2001-08-28 Marc Autret <autret_m@epita.fr>
15916 * src/output.c (output_actions): Clean up.
15917 (output_gram): CPP-out useless code.
15918 * src/reader.c (reader): Clean up, CPP-out useless code.
15920 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
15922 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
15924 * src/bison.simple: Add `%%definitions'.
15926 2001-08-28 Marc Autret <autret_m@epita.fr>
15928 * config/depcomp: New file.
15930 2001-08-27 Paul Eggert <eggert@twinsun.com>
15932 * src/bison.simple (yyparse): Don't take the address of an
15933 item before the start of an array, as that doesn't conform to
15936 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15938 * src/output.c (output): Remove the initialization of the macro
15939 obstack. It was done too late here.
15941 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15943 (reader): Initialize the macro obstack here, since we need it to grow
15944 '%define' directives.
15946 * src/reader.h: Declare the macro obstack as extern.
15948 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15950 * src/output.c (output_parser): Fix. Store single '%' characters in
15951 the output obstack instead of throwing them away.
15953 2001-08-27 Akim Demaille <akim@epita.fr>
15955 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15957 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15959 * lib/Makefile.am: Adjust.
15961 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15963 * src/bison.simple: Update and add '%%' directives.
15965 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15967 * src/reader.c (reader): Remove calls to 'output_headers' and
15968 'output_trailers'. Remove some C output.
15969 (readgram): Disable a piece of code that was writing a default
15970 definition for 'YYSTYPE'.
15971 (reader_output_yylsp): Remove.
15972 (packsymbols): Output token defintions to a macro.
15973 (copy_definition): Disable C output.
15975 * src/reader.c (parse_macro_decl): New function used to parse macro
15977 (copy_string2): Put the body of copy_string into this new function.
15978 Add a parameter to let the caller choose whether he wants to copy the
15979 string delimiters or not.
15980 (copy_string): Be a simple call to copy_string2 with the last argument
15982 (read_declarations): Add case for macro definition.
15983 (copy_identifier): New.
15984 (parse_macro_decl): Read macro identifiers using copy_identifier
15987 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15989 * src/output.c (prepare): Add prefixed names.
15990 (output_parser): Output semantic actions.
15991 (output_parser): Fix bug on '%%line' directives.
15993 * src/output.c (output_headers): Remove. The C code printed by this
15994 function should now be in the skeletons.
15995 (output_trailers): Remove.
15996 (output): Disable call to 'reader_output_yylsp'.
15997 (output_rule_data): Do not output tables to the table obstack.
15999 * src/output.c: Remove some C dedicated output.
16000 Improve the use of macro and output obstacks.
16001 (output_defines): Remove.
16003 * src/output.c (output_token_translations): Associate 'translate'
16004 table with a macro. No output to the table obstack.
16005 (output_gram): Same for 'rhs' and 'prhs'.
16006 (output_stos): Same for 'stos'.
16007 (output_rule_data): Same for 'r1' and 'r2'.
16008 (token_actions): Same for 'defact'.
16009 (goto_actions): Same for 'defgoto'.
16010 (output_base): Same for 'pact' and 'pgoto'.
16011 (output_table): Same for 'table'.
16012 (output_check): Same for 'check'.
16014 * src/output.c (output_table_data): New function.
16015 (output_short_table): Remove.
16016 (output_short_or_char_table): Remove.
16018 * src/output.c (output_parser): Replace most of the skeleton copy code
16019 with something new. Skeletons are now processed character by character
16020 rather than line by line, and Bison looks for '%%' macros. This is the
16021 first step in making Bison's output process (a lot) more flexible.
16022 (output_parser): Use the macro table.
16024 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16026 * src/main.c (main): Initialize the macro table.
16028 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16030 * src/lex.c (percent_table): Add tok_define.
16031 * src/lex.h: Add tok_define.
16033 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16035 * src/macrotab.c: New file.
16036 * src/macrotab.h: New file.
16037 * src/Makefile.am: Update.
16039 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16041 * lib/hash.c: New file.
16042 * lib/hash.h: New file.
16043 * lib/Makefile.am: Update.
16045 2001-08-15 Akim Demaille <akim@epita.fr>
16049 2001-08-15 Marc Autret <autret_m@epita.fr>
16051 * src/reader.c (readgram): Indent output macro YYSTYPE.
16052 (packsymbols): Likewise.
16053 (output_token_defines): Likewise.
16054 * src/files.c: Standardize.
16055 (compute_header_macro): New.
16056 (defines_obstack_save): New. Use compute_header_macro.
16057 (output_files): Update. Use defines_obstack_save.
16059 2001-08-15 Akim Demaille <akim@epita.fr>
16061 * doc/bison.texinfo (Table of Symbols): Document
16062 YYSTACK_USE_ALLOCA.
16064 2001-08-15 Akim Demaille <akim@epita.fr>
16066 * missing: Update from CVS Automake.
16067 * config/config.guess, config/config.sub, config/texinfo.tex:
16068 Update from gnu.org.
16070 2001-08-15 Akim Demaille <akim@epita.fr>
16072 * Makefile.maint: Sync with CVS Autoconf.
16074 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
16076 * doc/bison.texinfo: Include GNU Free Documentation License from
16078 * doc/fdl.texi: Add to package.
16080 2001-08-14 Marc Autret <autret_m@epita.fr>
16082 Turn on %{source,header}_extension features.
16084 * src/lex.c (percent_table): Un-CPP out header_extension and
16086 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
16087 (compute_exts_from_src): Remove conditions. It restores priorities
16090 2001-08-14 Marc Autret <autret_m@epita.fr>
16092 * src/files.c (compute_base_names): Add extensions computing when
16093 `--file-prefix' used.
16094 Standardize function calls.
16096 2001-08-13 Marc Autret <autret_m@epita.fr>
16098 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
16099 defining it (defined but null disables alloca).
16101 2001-08-13 Marc Autret <autret_m@epita.fr>
16103 * src/bison.simple (_yy_memcpy): CPP reformat.
16105 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
16107 * tests/atconfig.in (CPPFLAGS): Fix.
16109 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
16111 * doc/bison.texinfo: Include GNU General Public License from
16113 * doc/gpl.texi: Add to package.
16115 2001-08-10 Marc Autret <autret_m@epita.fr>
16117 * src/print_graph.h: Fix.
16118 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
16120 2001-08-10 Akim Demaille <akim@epita.fr>
16122 * src/system.h: Provide default declarations for stpcpy, strndup,
16125 2001-08-10 Robert Anisko <anisko_r@epita.fr>
16127 * doc/bison.texinfo (Locations): Update @$ stuff.
16129 2001-08-09 Robert Anisko <anisko_r@epita.fr>
16131 * src/bison.simple (YYLLOC_DEFAULT): Update.
16134 2001-08-08 Marc Autret <autret_m@epita.fr>
16136 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
16137 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
16138 Reported by Fabrice Bauzac.
16140 2001-08-08 Marc Autret <autret_m@epita.fr>
16142 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
16143 * src/vcg.c (output_node): Fix.
16144 * src/vcg.h: Cleanup.
16145 * src/print_graph.c: Add comments.
16146 (node_output_size): New global variable. Simplify the formatting of
16147 the VCG graph output.
16148 (print_actions): Unused code is now used. It notifies the final state
16149 and no action states in the VCG graph. It also give the reduce actions.
16150 The `shift and goto' edges are red and the `go to state' edges are
16152 Get the current node name and node_obstack by argument.
16153 (node_obstack): New variable.
16154 (print_state): Manage node_obstack.
16155 (print_core): Use node_obstack given by argument.
16156 A node is not only computed here but in print_actions also.
16157 (print_graph): CPP out useless code instead of commenting it.
16159 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
16161 * tests/atconfig.in (CPPFLAGS): Fix.
16163 2001-08-07 Akim Demaille <akim@epita.fr>
16165 * src/print_graph.c (quote): New.
16166 (print_core): Use it.
16168 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
16170 * src/vcg.c (complain.h): Include it.
16171 Unepitaize `return' invocations.
16172 [NDEBUG] (main): Remove.
16173 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
16174 * src/files.c (open_files): Initialize graph_obstack.
16175 * src/print_graph.c (print_actions): CPP out useless code.
16176 (print_core): Don't output the last `\n' in labels.
16178 * src/files.c (output_files): Output the VCG file.
16179 * src/main.c (main): Invoke print_graph ();
16181 2001-08-06 Marc Autret <autret_m@epita.fr>
16183 Automaton VCG graph output.
16184 Using option ``-g'' or long option ``--graph'', you can generate
16185 a gram_filename.vcg file containing a VCG description of the LALR (1)
16186 automaton of your grammar.
16188 * src/main.c: Call to print_graph() function.
16189 * src/getargs.h: Update.
16190 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
16191 (graph_flag): New flag.
16192 (longopts): Update.
16193 (getargs): Add case `g'.
16194 * src/files.c (graph_obstack): New obstack struct.
16195 (open_files): Initialize new obstack.
16196 (output_files): Saves graph_obstack if required.
16197 * src/files.h (graph_obstack): New extern declaration.
16198 * src/Makefile.am: Add new source files.
16200 2001-08-06 Marc Autret <autret_m@epita.fr>
16202 * src/print_graph.c, src/print_graph.h (graph): New.
16203 * src/vcg.h: New file.
16204 * src/vcg.c: New file, VCG graph handling.
16206 2001-08-06 Marc Autret <autret_m@epita.fr>
16208 Add of %source_extension and %header_extension which specify
16209 the source or/and the header output file extension.
16211 * src/files.c (compute_base_names): Remove initialisation of
16212 src_extension and header_extension.
16213 (compute_exts_from_gf): Update.
16214 (compute_exts_from_src): Update.
16215 (output_files): Update.
16216 * src/reader.c (parse_header_extension_decl): New.
16217 (parse_source_extension_decl): New.
16218 (read_declarations): New case statements for the new tokens.
16219 * src/lex.c (percent_table): Add entries for %source_extension
16220 and %header_extension.
16221 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
16223 2001-08-06 Marc Autret <autret_m@epita.fr>
16225 * configure.in: Bump to 1.28c.
16226 * doc/bison.texinfo: Texinfo thingies.
16228 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
16230 * tests/atconfig.in (CPPFLAGS): Add.
16231 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
16233 2001-08-03 Akim Demaille <akim@epita.fr>
16237 2001-08-03 Akim Demaille <akim@epita.fr>
16239 * tests/Makefile.am (check-local): Ship testsuite.
16240 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
16241 Include `string.h'.
16243 2001-08-03 Akim Demaille <akim@epita.fr>
16245 * configure.in: Try using -Wformat when compiling.
16247 2001-08-03 Akim Demaille <akim@epita.fr>
16249 * configure.in: Bump to 1.28b.
16251 2001-08-03 Akim Demaille <akim@epita.fr>
16253 * src/complain.c: Adjust strerror_r portability issues.
16255 2001-08-03 Akim Demaille <akim@epita.fr>
16259 2001-08-03 Akim Demaille <akim@epita.fr>
16261 * src/getargs.c, src/getarg.h (skeleton)): Constify.
16262 * src/lex.c (literalchar): Avoid name clashes on `buf'.
16263 * src/getargs.c: Include complain.h.
16264 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
16265 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
16267 2001-08-03 Akim Demaille <akim@epita.fr>
16269 * src/reader.c (readgram): Display hidden chars in error messages.
16271 2001-08-03 Akim Demaille <akim@epita.fr>
16273 Update to gettext 0.10.39.
16275 2001-08-03 Akim Demaille <akim@epita.fr>
16277 * lib/strspn.c: New.
16279 2001-08-01 Marc Autret <autret_m@epita.fr>
16281 * doc/bison.texinfo: Update.
16282 * doc/bison.1 (mandoc): Update.
16283 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
16284 * src/files.c: Support output files extensions computing.
16285 (src_extension): New static variable.
16286 (header_extension): New static variable.
16287 (tr): New function.
16288 (get_extension_index): New function, gets the index of an extension
16289 filename in a string.
16290 (compute_exts_from_gf): New function, computes extensions from the
16291 grammar file extension.
16292 (compute_exts_from_src): New functions, computes extensions from the
16293 C source file extension, file given by ``-o'' option.
16294 (compute_base_names): Update.
16295 (output_files): Update.
16297 2001-08-01 Robert Anisko <anisko_r@epita.fr>
16299 * doc/bison.texi: Document @$.
16300 (Locations): New section.
16302 2001-07-18 Akim Demaille <akim@epita.fr>
16304 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
16305 * config/prev-version.txt, config/move-if-change: New.
16306 * Makefile.am: Adjust.
16308 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
16310 * src/bison.simple (yyparse): Suppress warning `comparaison
16311 between signed and unsigned'.
16313 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
16315 * src/getargs.h (raw_flag): Remove.
16316 * src/getargs.c: Die on `-r'/`--raw'.
16317 * src/lex.c (parse_percent_token): Die on `%raw'.
16318 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
16319 * tests/calc.at: Suppress test with option `--raw'.
16321 2001-07-14 Akim Demaille <akim@epita.fr>
16324 * configure.in: Require Autoconf 2.50.
16325 Update to gettext 0.10.38.
16327 2001-03-16 Akim Demaille <akim@epita.fr>
16329 * doc/bison.texinfo: ANSIfy the examples.
16331 2001-03-16 Akim Demaille <akim@epita.fr>
16333 * getargs.c (skeleton): New variable.
16334 (longopts): --skeleton is a new option.
16335 (shortopts, getargs): -S is a new option.
16336 * getargs.h: Declare skeleton.
16337 * output.c (output_parser): Use it.
16339 2001-03-16 Akim Demaille <akim@epita.fr>
16341 * m4/strerror_r.m4: New.
16342 * m4/error.m4: Run AC_FUNC_STRERROR_R.
16343 * lib/error.h, lib/error.c: Update.
16345 2001-03-16 Akim Demaille <akim@epita.fr>
16347 * src/getargs.c (longopts): Clean up.
16349 2001-02-21 Akim Demaille <akim@epita.fr>
16351 * src/reader.c (gensym): `gensym_count' is your own.
16352 Use a static buf to create the symbol name, as token_buffer is no
16355 2001-02-08 Akim Demaille <akim@epita.fr>
16357 * src/conflicts.c (conflict_report): Be sure not to append to res
16358 between two calls, which could happen if both first sprintf were
16359 skipped, but not the first cp += strlen.
16361 2001-02-08 Akim Demaille <akim@epita.fr>
16363 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
16364 New, from fileutils 4.0.37.
16365 * configure.in: Require Autoconf 2.49c. I took some time before
16366 making this decision. This is the only way out for portability
16367 issues in Bison, it would mean way too much duplicate effort to
16368 import in Bison features implemented in 2.49c since 2.13.
16369 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
16371 2001-02-02 Akim Demaille <akim@epita.fr>
16373 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
16374 * lib/xalloc.h, lib/xmalloc.c: Update.
16376 2001-01-19 Akim Demaille <akim@epita.fr>
16378 Get rid of the ad hoc handling of token_buffer in the scanner: use
16381 * src/lex.c (token_obstack): New.
16382 (init_lex): Initialize it. No longer call...
16383 (grow_token_buffer): this. Remove it.
16384 Adjust all the places which used it to use the obstack.
16386 2001-01-19 Akim Demaille <akim@epita.fr>
16388 * src/lex.h: Rename all the tokens:
16389 s/\bENDFILE\b/tok_eof/g;
16390 s/\bIDENTIFIER\b/tok_identifier/g;
16392 Let them be enums, not #define, to ease debugging.
16393 Adjust all the code.
16395 2001-01-18 Akim Demaille <akim@epita.fr>
16397 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
16398 * src/lex.c (maxtoken, grow_token_buffer): Static.
16400 2001-01-18 Akim Demaille <akim@epita.fr>
16402 Since we now use obstacks, more % directives can be enabled.
16404 * src/lex.c (percent_table): Also accept `%yacc',
16405 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
16407 Handle the actions for `%semantic_parser' and `%pure_parser' here,
16408 instead of returning a token.
16409 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
16410 * src/reader.c (read_declarations): Adjust.
16411 * src/files.c (open_files): Don't call `compute_base_names', don't
16412 compute `attrsfile' since they depend upon data which might be
16413 *in* the input file now.
16414 (output_files): Do it here.
16415 * src/output.c (output_headers): Document the fact that this patch
16416 introduces a guaranteed SEGV for semantic parsers.
16417 * doc/bison.texinfo: Document them.
16418 * tests/suite.at: Exercise these %options.
16420 2000-12-20 Akim Demaille <akim@epita.fr>
16422 Also handle the output file (--verbose) with obstacks.
16424 * files.c (foutput): Remove.
16425 (output_obstack): New.
16426 Adjust all dependencies.
16427 * src/conflicts.c: Return a string.
16428 * src/system.h (obstack_grow_string): Rename as...
16429 (obstack_sgrow): this. Be ready to work with non literals.
16430 (obstack_fgrow4): New.
16432 2000-12-20 Akim Demaille <akim@epita.fr>
16434 * src/files.c (open_files): Fix the computation of short_base_name
16435 in the case of `-o foo.tab.c'.
16437 2000-12-20 Akim Demaille <akim@epita.fr>
16439 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16440 (copy_dollar): Now that everything uses obstacks, get rid of the
16443 2000-12-20 Akim Demaille <akim@epita.fr>
16445 * src/files.c (open_files): Actually the `.output' file is based
16446 on the short_base_name, not base_name.
16447 * tests/suite.at (Checking output file names): Adjust.
16449 2000-12-20 Akim Demaille <akim@epita.fr>
16451 * src/bison.s1: Remove, we now use directly...
16452 * src/bison.simple: this.
16453 * src/Makefile.am: Use pkgdata instead of data.
16455 2000-12-20 Akim Demaille <akim@epita.fr>
16457 * src/files.c (guard_obstack): New.
16458 (open_files): Initialize it.
16459 (output_files): Dump it...
16460 * src/files.h: Export it.
16461 * src/reader.c (copy_guard): Use it.
16463 2000-12-19 Akim Demaille <akim@epita.fr>
16465 * src/files.c (outfile, defsfile, actfile): Removed as global
16467 (open_files): Don't compute them.
16468 (output_files): Adjust.
16469 (base_name, short_base_name): Be global.
16470 Adjust dependencies.
16472 2000-12-19 Akim Demaille <akim@epita.fr>
16474 * src/files.c (strsuffix): New.
16475 (stringappend): Be just like strcat but allocate.
16476 (base_names): Eve out from open_files.
16477 Try to simplify the rather hairy computation of base_name and
16479 (open_files): Use it.
16480 * tests/suite.at (Checking output file names): New test.
16482 2000-12-19 Akim Demaille <akim@epita.fr>
16484 * src/system.h (obstack_grow_literal_string): Rename as...
16485 (obstack_grow_string): this.
16486 * src/output.c (output_parser): Recognize `%% actions' instead of
16488 * src/bison.s1: s/$/%% actions/.
16489 * src/bison.hairy: Likewise.
16491 2000-12-19 Akim Demaille <akim@epita.fr>
16493 * src/output.c (output_parser): Compute the `#line' lines when
16495 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16496 Suggested by Hans Aberg.
16498 2000-12-19 Akim Demaille <akim@epita.fr>
16500 Let the handling of the skeleton files be local to the procedures
16503 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16505 (fparser, open_extra_files): Remove.
16506 (open_files, output_files): Don't take care of fparser.
16507 * src/files.h: Adjust.
16508 * src/output.c (output_parser): Open and close the file to the
16510 * src/reader.c (read_declarations): When %semantic_parser, open
16513 2000-12-19 Akim Demaille <akim@epita.fr>
16515 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16516 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16518 2000-12-19 Akim Demaille <akim@epita.fr>
16520 * src/files.c (open_files): Yipee! We no longer need all the code
16521 looking for `/tmp' since we have no tmp file.
16523 2000-12-19 Akim Demaille <akim@epita.fr>
16525 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16527 * src/files.c (open_files): Less dependency on MSDOS etc.
16529 2000-12-14 Akim Demaille <akim@epita.fr>
16531 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16532 Provide a default definition.
16533 Use it when executing the default @ action.
16534 * src/reader.c (reader_output_yylsp): No longer include
16535 `timestamp' and `text' in the default YYLTYPE.
16537 2000-12-12 Akim Demaille <akim@epita.fr>
16539 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16540 (copy_guard): Quote the file names.
16541 Reported by Laurent Mascherpa.
16543 2000-12-12 Akim Demaille <akim@epita.fr>
16545 * src/output.c (output_headers, output_program, output): Be sure
16546 to escape special characters when outputting filenames.
16547 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16548 (output_headers): Don't depend on them, Use ACTSTR.
16550 2000-11-17 Akim Demaille <akim@epita.fr>
16552 * lib/obstack.h: Formatting changes.
16553 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16554 prevents type checking.
16555 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16556 cast the value to (void *): assigning a `foo *' to a `void *'
16558 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16559 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16562 2000-11-17 Akim Demaille <akim@epita.fr>
16564 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16566 (suite.m4, regression.m4, calc.m4): these.
16567 * tests/atgeneral.m4: Update from CVS Autoconf.
16569 2000-11-17 Akim Demaille <akim@epita.fr>
16571 * tests/regression.m4 (%union and --defines): New test,
16572 demonstrating a current bug in the obstack implementation.
16574 2000-11-17 Akim Demaille <akim@epita.fr>
16576 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16578 Use them to declare the variables which are global or local to
16581 2000-11-17 Akim Demaille <akim@epita.fr>
16583 * acconfig.h: Remove, no longer used.
16585 2000-11-07 Akim Demaille <akim@epita.fr>
16587 * src: s/Copyright (C)/Copyright/g.
16589 2000-11-07 Akim Demaille <akim@epita.fr>
16591 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16593 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16595 2000-11-07 Akim Demaille <akim@epita.fr>
16597 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16598 Merge in a single CPP if/else.
16600 2000-11-07 Akim Demaille <akim@epita.fr>
16602 * src/output.c (output): Remove useless variables.
16603 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16604 argument `data' for consistency with the prototypes.
16605 Qualify it `const'.
16606 (obstack_copy, obstack_copy0): Rename the second argument as
16607 `address' for consistency. Qualify it `const'.
16608 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16609 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16610 `const' their input argument (`data' or `address').
16611 Adjust the corresponding macros to include `const' in casts.
16613 2000-11-03 Akim Demaille <akim@epita.fr>
16615 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16616 s/PFILE1/BISON_HAIRY/.
16617 Adjust dependencies.
16619 2000-11-03 Akim Demaille <akim@epita.fr>
16621 For some reason, this was not applied.
16623 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16624 `unlink': it's no longer used.
16626 2000-11-03 Akim Demaille <akim@epita.fr>
16628 * src/files.c (skeleton_find): New function, eved out of...
16629 (open_files, open_extra_files): here.
16631 2000-11-03 Akim Demaille <akim@epita.fr>
16633 Don't use `atexit'.
16635 * src/files.c (obstack_save): New function.
16636 (done): Rename as...
16637 (output_files): this.
16638 Use `obstack_save'.
16639 * src/main.c (main): Don't use `atexit' to register `done', since
16640 it no longer has to remove tmp files, just call `output_files'
16641 when there are no errors.
16643 2000-11-02 Akim Demaille <akim@epita.fr>
16645 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16646 `unlink': it's no longer used.
16647 * src/files.h: Formatting changes.
16649 2000-11-02 Akim Demaille <akim@epita.fr>
16651 Remove the last uses of mktemp and unlink/delete.
16653 * src/files.c (fdefines, ftable): Removed.
16654 (defines_ostack, table_obstack): New.
16655 Adjust dependencies of the former into uses of the latter.
16656 * src/output.c (output_short_or_char_table, output_short_table):
16657 Convert to using obstacks.
16658 * src/reader.c (copy_comment2): Accept one FILE * and two
16660 (output_token_defines, reader_output_yylsp): Use obstacks.
16661 * src/system.h (obstack_fgrow3): New.
16662 * po/POTFILES.in: Adjust.
16664 2000-11-01 Akim Demaille <akim@epita.fr>
16666 Change each use of `fattrs' into a use of `attrs_obstack'.
16668 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16669 * src/files.c (fattrs): Remove.
16670 (attrs_obstack): New.
16671 Adjust all dependencies.
16672 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16674 2000-11-01 Akim Demaille <akim@epita.fr>
16676 Introduce obstacks.
16677 Change each use of `faction' into a use of `action_obstack'.
16679 * lib/obstack.h, lib/obstack.c: New files.
16680 * src/files.c (faction): Remove.
16681 (action_obstack): New.
16682 Adjust all dependencies.
16684 2000-10-20 Akim Demaille <akim@epita.fr>
16686 * lib/quote.h (PARAMS): New macro. Use it.
16688 2000-10-16 Akim Demaille <akim@epita.fr>
16690 * src/output.c (output_short_or_char_table): New function.
16691 (output_short_table, output_token_translations): Use it.
16692 (goto_actions): Use output_short_table.
16694 2000-10-16 Akim Demaille <akim@epita.fr>
16696 * src/symtab.c (bucket_new): New function.
16699 * src/output.c (output_short_table): New argument to display the
16700 comment associated with the table.
16701 Adjust dependencies.
16702 (output_gram): Use it.
16703 (output_rule_data): Nicer output layout for YYTNAME.
16705 2000-10-16 Akim Demaille <akim@epita.fr>
16707 * src/lex.c (read_typename): New function.
16709 * src/reader.c (copy_dollar): Likewise.
16711 2000-10-16 Akim Demaille <akim@epita.fr>
16713 * src/reader.c (copy_comment2): Expect the input stream to be on
16714 the `/' which is suspected to open a comment, instead of being
16715 called after `//' or `/*' was read.
16716 (copy_comment, copy_definition, parse_union_decl, copy_action)
16717 (copy_guard): Adjust.
16719 2000-10-16 Akim Demaille <akim@epita.fr>
16721 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16722 `read_signed_integer'.
16724 2000-10-16 Akim Demaille <akim@epita.fr>
16726 * src/reader.c (copy_dollar): New function.
16727 (copy_guard, copy_action): Use it.
16729 2000-10-16 Akim Demaille <akim@epita.fr>
16731 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16732 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16733 New files, from Fileutils 4.0.27.
16734 * src/main.c (printable_version): Remove.
16735 * src/lex.c, src/reader.c: Use `quote'.
16737 2000-10-04 Akim Demaille <akim@epita.fr>
16739 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16741 2000-10-04 Akim Demaille <akim@epita.fr>
16743 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16745 2000-10-04 Akim Demaille <akim@epita.fr>
16747 When a literal string is used to define two different tokens,
16748 `bison -v' segfaults.
16749 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16751 * tests/regression.m4: New file.
16752 Include the core of the sample provided by Piotr Gackiewicz.
16753 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16756 2000-10-04 Akim Demaille <akim@epita.fr>
16758 * src/reader.c (parse_expect_decl): Keep `count' within the size
16762 2000-10-02 Paul Eggert <eggert@twinsun.com>
16764 * bison.s1 (yyparse): Assign the default value
16765 unconditionally, to avoid a GCC warning and make the parser a
16768 2000-10-02 Akim Demaille <akim@epita.fr>
16770 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16773 2000-10-02 Akim Demaille <akim@epita.fr>
16775 * src/derives.c, src/print.c, src/reduce.c: To ease the
16776 translation, move some `\n' out of the translated strings.
16778 2000-10-02 Akim Demaille <akim@epita.fr>
16780 The location tracking mechanism is precious for parse error
16781 messages. Nevertheless, it is enabled only when `@n' is used in
16782 the grammar, which is a different issue (you can use it in error
16783 message, but not in the grammar per se). Therefore, there should
16784 be another means to enable it.
16786 * src/getargs.c (getargs): Support `--locations'.
16787 (usage): Report it.
16788 * src/getargs.h (locationsflag): Export it.
16789 * src/lex.c (percent_table): Support `%locations'.
16790 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16791 with `locationsflag'.
16792 * doc/bison.texinfo: Document `--locations' and `%locations'.
16794 * tests/calc.m4: Test it.
16796 For regularity of the names, replace each
16797 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16798 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16799 In addition replace each `flag' with `_flag'.
16801 2000-10-02 Akim Demaille <akim@epita.fr>
16803 Also test parse error messages, including with YYERROR_VERBOSE.
16805 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16807 Use it to check the computations.
16808 Use it to check `nonassoc' is honored.
16809 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16810 `--yyerror-verbose'.
16811 (_AT_CHECK_CALC): Adjust to this option.
16812 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16814 2000-10-02 Akim Demaille <akim@epita.fr>
16816 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16817 the latter demonstrates a flaw in the handling of non debugging
16818 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16819 was used in order to simplify:
16835 unfortunately this leads to a CPP conflict when
16836 `--name-prefix=foo' is used since it produces `#define yydebug
16839 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16840 (YYDPRINTF): New macro.
16842 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16844 Also test `--verbose', `--defines' and `--name-prefix'.
16846 2000-10-02 Akim Demaille <akim@epita.fr>
16848 Improve the readability of the produced parsers.
16850 * src/bison.s1: Formatting changes.
16851 Improve the comment related to the `$' mark.
16852 (yydefault): Don't fall through to `yyresume': `goto' there.
16853 * src/output.c (output_parser): When the `$' is met, skip the end
16855 New variable, `number_of_dollar_signs', to check there's exactly
16856 one `$' in the parser skeleton.
16858 2000-10-02 Akim Demaille <akim@epita.fr>
16860 * lib/xstrdup.c: New file, from the fileutils.
16861 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16862 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16863 instead of strlen + xmalloc + strcpy.
16864 * src/symtab.c (copys): Remove, use xstrdup instead.
16866 2000-10-02 Akim Demaille <akim@epita.fr>
16868 * src/gram.h (associativity): New enum type which replaces the
16869 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16870 `right_assoc', `left_assoc' and `non_assoc'.
16871 Adjust all dependencies.
16872 * src/reader.c: Formatting changes.
16873 (LTYPESTR): Don't define it, use it as a literal in
16874 `reader_output_yylsp'.
16875 * src/symtab.h (symbol_class): New enum type which replaces the
16876 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16877 `sunknown', `stoken and `snterm'.
16879 2000-10-02 Akim Demaille <akim@epita.fr>
16881 * src/getargs.c (fixed_outfiles): Rename as...
16882 (yaccflag): for consistency and accuracy.
16883 Adjust dependencies.
16885 2000-10-02 Akim Demaille <akim@epita.fr>
16887 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16888 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16889 difficult and introduced a lot of core dump. It turns out that
16890 Bison used an implementation of `xmalloc' based on `calloc', and
16891 at various places it does depend upon the initialization to 0. I
16892 have not tried to isolate the pertinent places, and all the former
16893 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16894 someone should address this issue.
16896 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16897 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16899 Adjust dependencies.
16900 * src/warshall.h: New file.
16903 2000-10-02 Akim Demaille <akim@epita.fr>
16905 Various anti-`extern in *.c' changes.
16907 * src/system.h: Include `assert.h'.
16909 2000-10-02 Akim Demaille <akim@epita.fr>
16911 * src/state.h (nstates, final_state, first_state, first_shift)
16912 (first_reduction): Move their exportation from here...
16913 * src/LR0.h: to here.
16914 Adjust dependencies.
16915 * src/getargs.c (statisticsflag): New variable.
16916 Add support for `--statistics'.
16917 Adjust dependencies.
16919 Remove a lot of now useless `extern' statements in most files.
16921 2000-10-02 Akim Demaille <akim@epita.fr>
16923 * src/LR0.h: New file.
16926 2000-10-02 Akim Demaille <akim@epita.fr>
16928 * src/print.h: New file.
16930 * src/print.c: Formatting and ordering changes.
16931 (verbose, terse): Replace with...
16932 (print_results): this new function.
16933 Adjust dependencies.
16935 2000-10-02 Akim Demaille <akim@epita.fr>
16937 * src/conflicts.c (conflict_report): New function.
16938 (conflict_log, verbose_conflict_log): Replace with...
16939 (print_conflicts): this function.
16940 Adjust dependencies.
16941 * src/conflicts.h: New file.
16942 Propagate its inclusion.
16944 2000-10-02 Akim Demaille <akim@epita.fr>
16946 * src/nullable.h: New file.
16947 Propagate its inclusion.
16948 * src/nullable.c: Formatting changes.
16950 2000-10-02 Akim Demaille <akim@epita.fr>
16952 * src/reduce.h: New file.
16953 Propagate its inclusion.
16954 * src/reduce.c: Topological sort and other formatting changes.
16955 (bool, TRUE, FALSE): Move their definition to...
16956 * src/system.h: here.
16958 2000-10-02 Akim Demaille <akim@epita.fr>
16960 * src/files.c: Formatting changes.
16961 (tryopen, tryclose, openfiles): Rename as...
16962 (xfopen, xfclose, open_files): this.
16963 (stringappend): static.
16964 * src/files.h: Complete the list of exported symbols.
16967 2000-10-02 Akim Demaille <akim@epita.fr>
16969 * src/reader.h: New file.
16970 Propagate its use instead of tedious list of `extern' and
16972 * src/reader.c: Formatting changes, topological sort,
16975 2000-10-02 Akim Demaille <akim@epita.fr>
16977 * src/lex.h: Prototype `lex.c' exported functions.
16978 * src/reader.c: Adjust.
16979 * src/lex.c: Formatting changes.
16980 (safegetc): Rename as...
16983 2000-10-02 Akim Demaille <akim@epita.fr>
16985 * src/lalr.h: New file.
16986 Propagate its inclusion instead of prototypes and `extern'.
16987 * src/lalr.c: Formatting changes, topological sorting etc.
16989 2000-10-02 Akim Demaille <akim@epita.fr>
16991 * src/output.c (token_actions): Introduce a temporary array,
16992 YYDEFACT, that makes it possible for this function to use
16993 output_short_table.
16995 2000-10-02 Akim Demaille <akim@epita.fr>
16997 `user_toknums' is output as a `short[]' in `output.c', while it is
16998 defined as a `int[]' in `reader.c'. For consistency with the
16999 other output tables, `user_toknums' is now defined as a table of
17002 * src/reader.c (user_toknums): Be a short table instead of an int
17004 Adjust dependencies.
17006 Factor the short table outputs.
17008 * src/output.c (output_short_table): New function.
17009 * src/output.c (output_gram, output_stos, output_rule_data)
17010 (output_base, output_table, output_check): Use it.
17012 2000-10-02 Akim Demaille <akim@epita.fr>
17014 * src/output.c (output): Topological sort of the functions, in
17015 order to get rid of the `static' prototypes.
17016 No longer use `register'.
17017 * src/output.h: New file.
17018 Propagate its inclusion in files explicitly prototyping functions
17021 2000-09-21 Akim Demaille <akim@epita.fr>
17023 * src/atgeneral.m4: Update from Autoconf.
17025 2000-09-21 Akim Demaille <akim@epita.fr>
17027 * src/closure.h: New file.
17028 * src/closure.c: Formatting changes, topological sort over the
17029 functions, use of closure.h.
17030 (initialize_closure, finalize_closure): Rename as...
17031 (new_closure, free_closure): these. Adjust dependencies.
17032 * src/LR0.c: Formatting changes, topological sort, use of
17034 (initialize_states): Rename as...
17035 (new_states): this.
17036 * src/Makefile.am (noinst_HEADERS): Adjust.
17038 2000-09-20 Akim Demaille <akim@epita.fr>
17040 * src/acconfig.h: Don't protect config.h against multiple
17042 Don't define PARAMS.
17043 * src/system.h: Define PARAMS.
17044 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
17045 purpose of config.h. system.h must not try to fix wrong
17046 definitions in config.h.
17048 2000-09-20 Akim Demaille <akim@epita.fr>
17050 * src/derives.h: New file.
17051 * src/main.c, src/derives.h: Use it.
17052 Formatting changes.
17053 * src/Makefile.am (noinst_HEADERS): Adjust.
17055 2000-09-20 Akim Demaille <akim@epita.fr>
17057 * tests/atgeneral.m4: Update from Autoconf.
17058 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
17059 (AT_CHECK_CALC): New macros.
17060 Use these macros to test bison with options `', `--raw',
17061 `--debug', `--yacc', `--yacc --debug'.
17063 2000-09-19 Akim Demaille <akim@epita.fr>
17065 * src/output.c: Formatting changes.
17066 * src/machine.h: Remove, leaving its contents in...
17067 * src/system.h: here.
17069 Adjust all dependencies on stdio.h and machine.h.
17070 * src/getargs.h: New file.
17071 Let all `extern' declarations about getargs.c be replaced with
17072 inclusion of `getargs.h'.
17073 * src/Makefile.am (noinst_HEADERS): Adjust.
17075 * tests/calc.m4 (yyin): Be initialized in main, not on the global
17077 (yyerror): Returns void, not int.
17078 * doc/bison.texinfo: Formatting changes.
17080 2000-09-19 Akim Demaille <akim@epita.fr>
17082 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
17085 2000-09-18 Akim Demaille <akim@epita.fr>
17087 * configure.in: Append WARNING_CFLAGS to CFLAGS.
17088 * src/Makefile.am (INCLUDES): Don't.
17089 Be ready to fetch headers in lib/.
17091 2000-09-18 Akim Demaille <akim@epita.fr>
17093 * doc/bison.texinfo: Update the copyright.
17094 ANSIfy and GNUify the examples.
17095 Remove the old menu.
17097 2000-09-18 Akim Demaille <akim@epita.fr>
17099 First set of tests: use the `calc' example from the documentation.
17101 * src/bison.s1 (yyparse): Condition the code using `yytname' which
17102 is defined only when YYDEBUG is.
17103 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
17104 * src/files.c (tryopen, tryclose): Formatting changes.
17105 Move to the top and be static.
17106 * src/reader.c (read_signed_integer): Likewise.
17107 * tests/calc.m4: New file.
17108 * Makefile.am, suite.m4: Adjust.
17109 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
17111 2000-09-18 Akim Demaille <akim@epita.fr>
17113 Add support for an Autotest test suite for Bison.
17115 * m4/m4.m4, m4/atconfig.m4: New files.
17116 * m4/Makefile.am (EXTRA_DIST): Adjust.
17117 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
17119 * src/getargs.c: Display a more standard --version message.
17120 * src/reader.c (reader): Formatting changes.
17121 No longer depend upon VERSION_STRING.
17122 * configure.in: No longer use `dnl'.
17123 Set up the test suite and the new directory `tests/.
17124 (VERSION_STRING): Remove.
17126 2000-04-14 Akim Demaille <akim@epita.fr>
17128 * src/reader.c (copy_comment2): New function, same as former
17129 `copy_comment', but outputs into two FILE *.
17130 (copy_comment): Use it.
17131 (parse_union_decl): Use it.
17132 (get_type, parse_start_decl): Use the same `invalid' message.
17133 (parse_start_decl, parse_union_decl): Use the same `multiple'
17135 (parse_union_decl, copy_guard, copy_action): Use the same
17136 `unmatched' message.
17137 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
17139 2000-03-31 Akim Demaille <akim@epita.fr>
17141 * src/files.c (tryopen, tryclose): Move to the top.
17144 2000-03-31 Akim Demaille <akim@epita.fr>
17146 * src/main.c (main): Don't call `done', exit does it.
17148 2000-03-31 Akim Demaille <akim@epita.fr>
17150 * allocate.c: s/return (foo)/return foo/.
17151 * lalr.c: Likewise.
17153 * output.c: Likewise.
17154 * reader.c: Likewise.
17155 * symtab.c: Likewise.
17156 * vmsgetargs.c: Likewise.
17158 2000-03-31 Akim Demaille <akim@epita.fr>
17160 Clean up the error reporting functions.
17162 * src/report.c: New file.
17163 * src/report.h: Likewise.
17164 * src/Makefile.am: Adjust.
17165 * m4/error.m4: New file.
17166 * m4/Makefile.am: Adjust.
17167 * configure.in (jm_PREREQ_ERROR): Call it.
17168 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
17170 (fatal, fatals): Remove. All callers use complain.c::fatal.
17171 (warn, warni, warns, warnss, warnss): Remove. All callers use
17172 complain.c::complain.
17173 (toomany): Remove, use fatal instead.
17174 * src/files.c (done): No argument, use complain_message_count.
17175 * src/main.c (main): Register `done' to `atexit'.
17177 * src/getargs.c (usage): More `fputs', less `fprintf'.
17179 2000-03-28 Akim Demaille <akim@epita.fr>
17181 * lib/: New directory.
17182 * Makefile.am (SUBDIRS): Adjust.
17183 * configure.in: Adjust.
17184 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
17186 * src/alloca.c: Moved to lib/.
17187 * src/getopt.c: Likewise.
17188 * src/getopt1.c: Likewise.
17189 * src/getopt.h: Likewise.
17190 * src/ansi2knr.c: Likewise.
17191 * src/ansi2knr.1: Likewise.
17192 * src/Makefile.am: Adjust.
17193 * lib/Makefile.am: New file.
17195 2000-03-28 Akim Demaille <akim@epita.fr>
17197 * src/getargs.c (usage): Refresh the help message.
17199 2000-03-17 Akim Demaille <akim@epita.fr>
17201 * src/getopt1.c: Updated from textutils 2.0e
17202 * src/getopt.c: Likewise.
17203 * src/getopt.h: Likewise.
17205 2000-03-17 Akim Demaille <akim@epita.fr>
17207 * src/Makefile.am (bison.simple): Fix the awk program: quote only
17208 the file name, not the whole `#line LINE FILE'.
17210 2000-03-17 Akim Demaille <akim@epita.fr>
17212 On syntax errors, report the token on which we choked.
17214 * src/bison.s1 (yyparse): In the label yyerrlab, when
17215 YYERROR_VERBOSE, add yychar in msg.
17217 2000-03-17 Akim Demaille <akim@epita.fr>
17219 * src/reader.c (copy_at): New function.
17220 (copy_guard): Use it.
17221 (copy_action): Use it.
17223 2000-03-17 Akim Demaille <akim@epita.fr>
17225 Be kind to translators, save some useless translations.
17227 * src/main.c (banner): New function.
17228 (fatal_banner): Use it.
17229 (warn_banner): Use it.
17231 2000-03-17 Akim Demaille <akim@epita.fr>
17233 * src/reader.c (copy_definition): Use copy_string and
17234 copy_comment. Removed now unused `match', `ended',
17236 (copy_comment, copy_string): Moved, to be visible from
17239 2000-03-17 Akim Demaille <akim@epita.fr>
17241 * src/reader.c (copy_string): Declare `static inline'. No
17242 problems with inline, since it is checked by configure.
17243 (copy_comment): Likewise.
17245 2000-03-17 Akim Demaille <akim@epita.fr>
17247 * src/reader.c (packsymbols): Formatting changes.
17249 2000-03-17 Akim Demaille <akim@epita.fr>
17251 * src/reader.c (copy_comment): New function, factored out from:
17252 (copy_action): Use it. Removed now unused `match', `ended',
17254 (copy_guard): Likewise.
17256 2000-03-17 Akim Demaille <akim@epita.fr>
17258 * src/reader.c (copy_string): New function, factored out from:
17259 (copy_action): Use it.
17260 (copy_guard): Likewise.
17262 2000-03-17 Akim Demaille <akim@epita.fr>
17264 Change the handling of @s so that they behave exactly like $s.
17265 There is now a pseudo variable @$ (readble and writable), location
17266 of the lhs of the rule (by default ranging from the location of
17267 the first symbol of the rhs, to the location of the last symbol,
17268 or, if the rhs is empty, YYLLOC).
17270 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
17272 (yyparse): When providing a default semantic action, provide a
17273 default location action.
17274 (after the $): No longer change `*YYLSP', just stack YYLOC the
17275 same way you stack YYVAL.
17276 * src/reader.c (read_declarations): Use warns.
17277 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
17278 (copy_action, case '@'): Likewise.
17279 Use a standard error message, to save useless work from
17282 2000-03-17 Akim Demaille <akim@epita.fr>
17284 * src/bison.s1: Formatting and cosmetics changes.
17285 * src/reader.c: Likewise.
17286 Update the Copyright notice.
17288 2000-03-17 Akim Demaille <akim@epita.fr>
17290 * src/bison.s1 (#line): All set to `#line' only, since the
17291 Makefile now handles them.
17293 2000-03-16 Akim Demaille <akim@epita.fr>
17295 * src/output.c (output_rule_data): Output the documentation of
17296 some of the tables.
17297 (Copyright notice): Update.
17298 Formatting changes.
17300 2000-03-16 Akim Demaille <akim@epita.fr>
17302 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
17303 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
17304 One `#if YYDEBUG' remains, since it uses variables which are
17305 defined only if `YYDEBUG != 0'.
17307 2000-03-16 Akim Demaille <akim@epita.fr>
17309 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
17310 and related variables so that the similarities are highlighted.
17312 2000-03-16 Akim Demaille <akim@epita.fr>
17314 * src/bison.s1: Properly indent CPP directives.
17316 2000-03-16 Akim Demaille <akim@epita.fr>
17318 * src/bison.s1: Properly indent the `alloca' CPP section.
17320 2000-03-16 Akim Demaille <akim@epita.fr>
17322 Do not hard code values of directories in `configure.in'.
17323 Update the `configure' tool chain.
17325 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
17327 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
17328 (AC_OUTPUT): Add m4/Makefile.
17329 Bump to bison 1.28a, 1.29 has never been released.
17330 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
17331 handled via src/Makefile.am.
17332 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
17333 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
17335 * Makefile.am (SUBDIRS): Add m4.
17336 (ACLOCAL_AM_FLAGS): New variable.
17337 (AUTOMAKE_OPTIONS): Add check-news.
17338 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
17339 the proper line number and file name.
17340 (DEFS): Propagate the location of bison library files and of the
17342 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
17344 * acinclude.m4: Remove, replaced by the directory m4.
17345 * m4/Makefile.am (EXTRA_DIST): New variable.
17346 * m4/gettext.m4: New file, from the fileutils.
17347 * m4/lcmessage.m4: Likewise
17348 * m4/progtest.m4: Likewise.
17349 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
17351 2000-03-10 Akim Demaille <akim@epita.fr>
17354 Formatting changes of various comments.
17355 Respect the GNU coding standards at various places.
17356 Don't use `_()' when no translation is needed.
17358 1999-12-13 Jesse Thilo <jthilo@gnu.org>
17361 OS/2 honors TMPDIR environment variable.
17363 1999-12-13 Jesse Thilo <jthilo@gnu.org>
17365 * doc/bison.texinfo: Tweaked spelling and grammar.
17367 Removed reference to price of printed copy.
17368 Mention BISON_SIMPLE and BISON_HAIRY.
17370 1999-12-13 Jesse Thilo <jthilo@gnu.org>
17372 * configure.in, NEWS:
17373 Bison 1.29 released.
17375 1999-10-27 Jesse Thilo <jthilo@gnu.org>
17377 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
17378 Added reference card.
17380 1999-07-26 Jesse Thilo <jthilo@gnu.org>
17382 * po/ru.po: Added Russian translation.
17384 1999-07-26 Jesse Thilo <jthilo@gnu.org>
17386 * configure.in: Added Russian translation.
17388 1999-07-06 Jesse Thilo <jthilo@gnu.org>
17390 * configure.in, NEWS, README:
17391 Released version 1.28.
17393 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17396 Squashed redefinition warning on some systems.
17398 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
17399 Have configure build version string instead of relying on ANSI string
17402 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17404 * po/POTFILES.in: Got rid of version.c.
17406 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17408 * acconfig.h, configure.in:
17409 Have configure build version string instead of relying on ANSI string
17412 1999-06-08 Jesse Thilo <jthilo@gnu.org>
17415 Dropped mention of `+' for long-named options.
17417 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17419 * src/files.c: Added <unistd.h> for unlink().
17421 * src/Makefile.am, src/system.h:
17424 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17426 * README: Added a FAQ list.
17428 * configure.in, acconfig.h:
17431 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17433 * doc/FAQ, doc/Makefile.am:
17436 1999-05-19 Jesse Thilo <jthilo@gnu.org>
17438 * src/alloc.h, src/symtab.h, src/version.c:
17439 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17441 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17443 * src/.cvsignore, src/Makefile.am:
17444 Reorganized: sources in `src', documentation in `doc'.
17446 * src/lex.c (literalchar):
17447 fixed the code for escaping double quotes (thanks
17450 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17452 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17453 Adjusted paths to reflect directory reorganization.
17455 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17457 * doc/.cvsignore, doc/Makefile.am:
17458 Reorganized: sources in `src', documentation in `doc'.
17460 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17463 Updated AC_INIT file to reflect directory reorganization.
17465 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17466 Reorganized: sources in `src', documentation in `doc'.
17468 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17471 Don't declare calloc() and realloc() if not necessary.
17473 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17475 * configure.in, acconfig.h, acinclude.m4:
17476 Don't declare calloc() and realloc() if not necessary.
17478 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17480 * po/.cvsignore: Added i18n support.
17482 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17484 * acconfig.h, configure.in, Makefile.am:
17485 Added i18n support.
17487 1999-03-22 Jesse Thilo <jthilo@gnu.org>
17489 * src/bison.s1: Fixed #line numbers.
17491 1999-03-15 Jesse Thilo <jthilo@gnu.org>
17493 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17494 Added PO files from Translation Project.
17496 1999-03-03 Jesse Thilo <jthilo@gnu.org>
17499 Added support for non-ANSI compilers (ansi2knr).
17501 1999-02-16 Jesse Thilo <jthilo@gnu.org>
17503 * configure.in: Bumped version number to 1.27.
17506 Added `bison.simple' to list of files removed by `make distclean'.
17508 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17510 * src/files.c, src/files.h:
17511 Defined locations of parser files in config.h instead of Makefile.
17513 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17515 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17516 Defined locations of parser files in config.h instead of Makefile.
17518 1999-02-09 Jesse Thilo <jthilo@gnu.org>
17521 Removed inappropriate use of $< macro.
17523 1999-02-05 Jesse Thilo <jthilo@gnu.org>
17525 * po/Makefile.in.in, po/POTFILES.in:
17526 Add `po' directory skeleton.
17528 1999-01-27 Jesse Thilo <jthilo@gnu.org>
17530 * README: Document help-bison list.
17532 * configure.in: Add check for mkstemp().
17534 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17536 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17537 Hush a few compiler warnings.
17540 Add tryclose(), which verifies that fclose was successful.
17541 Hush a couple of compiler warnings.
17543 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17545 * Makefile.am, OChangeLog:
17546 ChangeLog is now automatically generated. Include the old version as
17549 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17551 * 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:
17552 Update FSF address.
17554 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17556 * doc/bison.texinfo: Fix formatting glitch.
17558 * doc/bison.texinfo: Update FSF address.
17560 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17562 * acconfig.h: Update FSF address.
17564 1999-01-08 Jesse Thilo <jthilo@gnu.org>
17567 Don't define PACKAGE here, since config.h defines it.
17569 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17571 * src/reader.c: Update copyright date.
17574 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17575 favor of output directly to stderr (avoids buffer overruns).
17577 * src/reader.c: Some checks for premature EOF.
17579 * 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:
17580 Use prototypes if the compiler understands them.
17582 * src/files.c: Honor TMPDIR on Unix hosts.
17583 Use prototypes if the compiler understands them.
17586 Fix a couple of buffer overrun bugs.
17587 Use prototypes if the compiler understands them.
17589 * src/system.h: Include unistd.h and ctype.h.
17590 Use #ifdef instead of #if for NLS symbols.
17592 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17594 * doc/bison.texinfo:
17595 Delete comment "consider using @set for edition number, etc..." since
17596 we now are doing so.
17598 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17601 Use prototypes if the compiler understands them.
17603 * NEWS: Document 1.26 highlights.
17605 * Makefile.am: Require Automake 1.3 or later.
17608 Use prototypes if the compiler understands them.
17610 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17613 Use VERSION symbol from automake for version number.
17615 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17617 * acconfig.h, configure.in, version.cin:
17618 Use VERSION symbol from automake for version number.
17620 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17623 Distribute original version of simple parser (bison.s1), not built
17624 version (bison.simple).
17626 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17628 * doc/bison.texinfo: Add info dir entry.
17630 * doc/bison.texinfo:
17631 Let automake put version number into documentation.
17633 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17635 * src/bison.cld, src/build.com, src/vmshlp.mar:
17636 Add non-RCS files from /gd/gnu/bison.
17638 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17641 Document the BISON_HAIRY and BISON_SIMPLE variables.
17643 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17645 * src/version.c: Build version.c automatically.
17648 Fix token numbering (used to start at 258, not 257).
17650 * src/system.h: Include config.h.
17652 * src/getargs.c: Update bug report address.
17654 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17655 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17657 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17660 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17662 * configure.in, version.cin:
17663 Build version.c automatically.
17665 * AUTHORS: Add AUTHORS file.
17667 * README: Update bug report address.
17670 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17672 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17673 Add automake stuff.
17675 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17677 * doc/bison.texinfo: Clean up some formatting.
17679 1998-05-05 Richard Stallman <rms@gnu.org>
17681 * doc/bison.texinfo:
17682 Explain better why to make a pure parser.
17684 1998-01-05 Richard Stallman <rms@gnu.org>
17686 * src/files.c (openfiles):
17687 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17688 find a temporary directory, if possible. Do not unlink files while
17691 1997-08-25 Richard Stallman <rms@gnu.org>
17693 * src/reader.c (stack_offset;):
17694 Change some warni to warns.
17696 * src/lex.c (literalchar): Use warns, not warni.
17698 1997-06-28 Richard Stallman <rms@gnu.org>
17700 * src/bison.s1: Add a Bison version comment.
17702 * src/main.c (fatal, warn, berror):
17705 1997-06-28 Richard Stallman <rms@gnu.org>
17707 * Makefile.in (bison_version): New variable.
17708 (dist): Use that variable.
17709 (bison.s1): Substitute the Bison version into bison.simple.
17711 * bison.simple: Add a Bison version comment.
17713 1997-06-18 Richard Stallman <rms@gnu.org>
17715 * src/main.c (fatal, warn, berror):
17716 Make error messages standard.
17717 (toomany): Improve error message text.
17719 * 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:
17720 new.h renamed to alloc.h.
17722 1997-06-18 Richard Stallman <rms@gnu.org>
17724 * Makefile.in: new.h renamed to alloc.h.
17726 1997-05-24 Richard Stallman <rms@gnu.org>
17728 * src/lex.c (literalchar):
17729 Fix the code for escaping \, " and '.
17731 (lex): Avoid trouble when there are many chars
17732 to discard in a char literal with just several chars in it.
17734 1997-05-17 Richard Stallman <rms@gnu.org>
17737 Use malloc, if using alloca is troublesome.
17738 (YYSTACK_USE_ALLOCA): New flag macro.
17739 Define it for some systems and compilers.
17740 (YYSTACK_ALLOC): New macro.
17741 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17742 If it was malloc'd, free it.
17744 1997-05-17 Richard Stallman <rms@gnu.org>
17747 Use malloc, if using alloca is troublesome.
17748 (YYSTACK_USE_ALLOCA): New flag macro.
17749 Define it for some systems and compilers.
17750 (YYSTACK_ALLOC): New macro.
17751 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17752 If it was malloc'd, free it.
17754 1997-04-23 Richard Stallman <rms@gnu.org>
17757 (alloca) [__hpux]: Always define as __builtin_alloca.
17759 1997-04-23 Richard Stallman <rms@gnu.org>
17762 (alloca) [__hpux]: Always define as __builtin_alloca.
17764 1997-04-22 Richard Stallman <rms@gnu.org>
17767 [__hpux]: Include alloca.h (right for HPUX 10)
17768 instead of declaring alloca (right for HPUX 9).
17770 * src/bison.s1 (__yy_memcpy):
17771 Declare arg `count' as unsigned int.
17772 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17774 1997-04-22 Richard Stallman <rms@gnu.org>
17777 [__hpux]: Include alloca.h (right for HPUX 10)
17778 instead of declaring alloca (right for HPUX 9).
17780 * bison.simple (__yy_memcpy):
17781 Declare arg `count' as unsigned int.
17782 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17784 1997-01-03 Richard Stallman <rms@gnu.org>
17786 * src/allocate.c: [__STDC__ or _MSC_VER]:
17787 Declare calloc and realloc to return void *.
17789 1997-01-02 Richard Stallman <rms@gnu.org>
17792 [_MSC_VER]: Include stdlib.h and process.h.
17793 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17795 * src/main.c (main): Return FAILURE as a value.
17796 (printable_version): Declare arg as int, not char.
17798 1997-01-02 Richard Stallman <rms@gnu.org>
17800 * Makefile.in (dist):
17801 Explicitly check for symlinks, and copy them.
17803 1996-12-19 Richard Stallman <rms@gnu.org>
17806 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17808 1996-12-18 Paul Eggert <eggert@gnu.org>
17810 * src/bison.s1 (yyparse):
17811 If __GNUC__ and YYPARSE_PARAM are both defined,
17812 declare yyparse to have a void * argument.
17814 1996-12-18 Paul Eggert <eggert@gnu.org>
17816 * bison.simple (yyparse):
17817 If __GNUC__ and YYPARSE_PARAM are both defined,
17818 declare yyparse to have a void * argument.
17820 1996-12-17 Richard Stallman <rms@gnu.org>
17822 * src/reduce.c (nbits): Add some casts.
17824 1996-08-12 Richard Stallman <rms@gnu.org>
17826 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17828 1996-08-12 Richard Stallman <rms@gnu.org>
17830 * bison.simple: Test _MSDOS as well as _MSDOS_.
17832 1996-07-31 Richard Stallman <rms@gnu.org>
17835 [__sun && __i386]: Include alloca.h.
17837 1996-07-31 Richard Stallman <rms@gnu.org>
17840 [__sun && __i386]: Include alloca.h.
17842 1996-07-30 Richard Stallman <rms@gnu.org>
17844 * src/bison.s1: Comment change.
17846 * src/bison.s1: Test _MSDOS_, not MSDOS.
17848 1996-07-30 Richard Stallman <rms@gnu.org>
17850 * bison.simple: Comment change.
17852 * bison.simple: Test _MSDOS_, not MSDOS.
17854 1996-06-01 Richard Stallman <rms@gnu.org>
17856 * 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:
17857 Insert `_' macro around many string constants.
17860 Insert `_' macro around many string constants.
17862 (main): Call setlocale, bindtextdomain and textdomain.
17864 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17865 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17866 [ENABLE_NLS]: Include libintl.h.
17867 [ENABLE_NLS] (gettext): Define.
17868 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17869 (N_, PACKAGE, LOCALEDIR): New macros.
17871 1996-06-01 Richard Stallman <rms@gnu.org>
17873 * POTFILES.in: New file.
17875 * Makefile.in (allocate.o):
17876 Define target explicitly.
17878 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17879 (LDFLAGS): Set to @LDFLAGS@.
17880 (configure): Run autoconf only if preceding `cd' succeeds.
17881 (bison.s1): Redirect output to temporary file then move the
17882 temporary to the target, rather than redirecting directly to bison.s1.
17883 (clean): Remove config.status and config.log.
17884 (distclean): Don't remove config.status here.
17886 1996-05-12 Richard Stallman <rms@gnu.org>
17889 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17891 1996-05-12 Richard Stallman <rms@gnu.org>
17894 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17896 1996-05-11 Richard Stallman <rms@gnu.org>
17898 * src/bison.s1 (__yy_memcpy):
17899 Really reorder the args, as was supposedly done on Feb 14 1995.
17900 (yyparse): Calls changed accordingly.
17902 1996-05-11 Richard Stallman <rms@gnu.org>
17904 * Makefile.in (dist): Don't use $(srcdir).
17906 * bison.simple (__yy_memcpy):
17907 Really reorder the args, as was supposedly done on Feb 14 1995.
17908 (yyparse): Calls changed accordingly.
17910 1996-01-27 Richard Stallman <rms@gnu.org>
17912 * src/output.c (output_rule_data):
17913 Test YYERROR_VERBOSE in the conditional
17914 around the definition of ttyname.
17916 1995-12-29 Richard Stallman <rms@gnu.org>
17919 Fix line numbers in #line commands.
17921 1995-12-29 Richard Stallman <rms@gnu.org>
17924 Fix line numbers in #line commands.
17926 1995-12-27 Richard Stallman <rms@gnu.org>
17928 * src/bison.s1 (YYPARSE_PARAM_DECL):
17929 In C++, make it always null.
17930 (YYPARSE_PARAM_ARG): New macro.
17931 (yyparse): Use YYPARSE_PARAM_ARG.
17933 1995-12-27 Richard Stallman <rms@gnu.org>
17935 * bison.simple (YYPARSE_PARAM_DECL):
17936 In C++, make it always null.
17937 (YYPARSE_PARAM_ARG): New macro.
17938 (yyparse): Use YYPARSE_PARAM_ARG.
17940 1995-11-29 Richard Stallman <rms@gnu.org>
17942 * doc/bison.texinfo:
17943 Describe literal string tokens, %raw, %no_lines, %token_table.
17945 1995-11-29 Daniel Hagerty <hag@gnu.org>
17947 * doc/bison.texinfo: Fixed update date
17949 1995-10-16 Richard Stallman <rms@gnu.org>
17951 * src/version.c: Version 1.25.
17953 1995-10-16 Richard Stallman <rms@gnu.org>
17955 * NEWS: *** empty log message ***
17957 1995-10-16 Richard Stallman <rms@gnu.org>
17959 * doc/bison.1, doc/bison.rnh:
17962 1995-10-15 Richard Stallman <rms@gnu.org>
17964 * src/vmsgetargs.c, src/getargs.c:
17965 Added -n, -k, and -raw switches.
17966 (noparserflag, toknumflag, rawtoknumflag): New variables.
17968 * src/symtab.h (SALIAS):
17969 New #define for adding aliases to %token.
17970 (struct bucket): Added `alias' field.
17972 * src/reduce.c (reduce_grammar):
17973 Revise error message.
17974 (print_notices): Remove final `.' from error message.
17976 * src/reader.c (reader_output_yylsp):
17978 (readgram): Use `#if 0' around code that accepted %command
17979 inside grammar rules: The documentation doesn't allow it,
17980 and it will fail since the %command processors scan for the next %.
17981 (parse_token_decl): Extended the %token
17982 declaration to allow a multi-character symbol as an alias.
17983 (parse_thong_decl): New function.
17984 (read_declarations): Added %thong declarations.
17985 (read_declarations): Handle NOOP to deal with allowing
17986 % declarations as another means to specify the flags.
17987 (readgram): Allow %prec prior to semantics embedded in a rule.
17988 (skip_to_char, read_declarations, copy_definition)
17989 (parse_token_decl, parse_start_decl, parse_type_decl)
17990 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
17991 (get_type_name, copy_guard, copy_action, readgram)
17992 (get_type, packsymbols): Revised most error messages.
17993 Changed `fatal' to `warnxxx' to avoid aborting for error.
17994 Revised and use multiple warnxxx functions to avoid using VARARGS1.
17995 (read_declarations): Improve the error message for
17996 an invalid character. Do not abort.
17997 (read_declarations, copy_guard, copy_action): Use
17998 printable_version to avoid unprintable characters in printed output.
17999 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
18000 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
18001 Allow the type of a non-terminal can be given
18002 more than once, as long as all specifications give the same type.
18005 (output_headers, output_trailers, output, output_gram)
18006 (output_rule_data): Implement noparserflag variable.
18007 Implement toknumflag variable.
18008 (output): Call reader_output_yylsp to output LTYPESTR.
18010 * src/main.c (main):
18011 If reader sees an error, don't process the grammar.
18012 (fatals): Updated to not use VARARGS1.
18013 (printable_version, int_to_string, warn, warni, warns, warnss)
18014 (warnsss): New error reporting functions. Avoid abort for error.
18017 Added THONG and NOOP for alias processing.
18018 Added SETOPT for the new code that allows setting options with %flags.
18021 Include getopt.h. Add some extern decls.
18022 (safegetc): New function to deal with EOF gracefully.
18023 (literalchar); new function to deal with reading \ escapes.
18024 (lex): Use literalchar.
18025 (lex): Implemented "..." tokens.
18026 (literalchar, lex, parse_percent_token): Made tokenbuffer
18027 always contain the token. This includes growing the token
18028 buffer while reading an integer.
18029 (parse_percent_token): Replaced if-else statement with percent_table.
18030 (parse_percent_token): Added % declarations as another
18031 way to specify the flags -n, -l, and -r. Also added hooks for
18032 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
18033 major changes to files.c.
18034 (lex) Retain in the incoming stream a character following
18036 (skip_white_space, lex): Revised most error messages
18037 and changed fatal to warn to avoid aborting.
18038 (percent_table): Added %thong declarations.
18040 * src/gram.h: Comment changes.
18042 * src/files.c (openfiles, open_extra_files, done):
18044 and actfile file. Handle noparserflag. Both for -n switch.
18046 * src/conflicts.c (resolve_sr_conflict):
18047 Remove use of alloca.
18049 1995-06-01 Jim Meyering <meyering@gnu.org>
18051 * doc/bison.texinfo: *** empty log message ***
18053 1995-05-06 Richard Stallman <rms@gnu.org>
18055 * src/bison.s1: Comment change.
18057 1995-05-06 Richard Stallman <rms@gnu.org>
18059 * bison.simple: Comment change.
18061 1995-05-03 Richard Stallman <rms@gnu.org>
18063 * src/version.c: Version now 1.24.
18065 * src/bison.s1: Change distribution terms.
18067 * src/version.c: Version now 1.23.
18069 1995-05-03 Richard Stallman <rms@gnu.org>
18071 * doc/bison.texinfo:
18072 Rewrite "Conditions for Using Bison".
18073 Update version to 1.24.
18075 1995-05-03 Richard Stallman <rms@gnu.org>
18077 * bison.simple: Change distribution terms.
18079 1995-02-23 Richard Stallman <rms@gnu.org>
18081 * src/files.c: Test __VMS_POSIX as well as VMS.
18083 1995-02-14 Jim Meyering <meyering@gnu.org>
18085 * src/bison.s1 (__yy_memcpy):
18086 Renamed from __yy_bcopy to avoid
18087 confusion. Reverse FROM and TO arguments to be consistent with
18090 1995-02-14 Jim Meyering <meyering@gnu.org>
18092 * bison.simple (__yy_memcpy):
18093 Renamed from __yy_bcopy to avoid
18094 confusion. Reverse FROM and TO arguments to be consistent with
18097 1994-11-10 David J. MacKenzie <djm@gnu.org>
18103 * Makefile.in (DISTFILES): Include NEWS.
18105 * Makefile.in (DISTFILES):
18106 Include install-sh, not install.sh.
18108 * configure.in: Update to Autoconf v2 macro names.
18110 1994-10-05 David J. MacKenzie <djm@gnu.org>
18112 * Makefile.in: fix typo
18114 * Makefile.in (prefix, exec_prefix):
18115 Let configure set them.
18117 1994-09-28 David J. MacKenzie <djm@gnu.org>
18119 * Makefile.in: Set datadir to $(prefix)/share.
18121 1994-09-15 Richard Stallman <rms@gnu.org>
18124 Update copyright notice and GPL version.
18126 1994-09-15 Richard Stallman <rms@gnu.org>
18129 Update copyright notice and GPL version.
18131 1994-07-12 Richard Stallman <rms@gnu.org>
18133 * src/reduce.c, src/reader.c:
18136 1994-05-05 David J. MacKenzie <djm@gnu.org>
18138 * Makefile.in: entered into RCS
18140 1994-03-26 Richard Stallman <rms@gnu.org>
18142 * src/bison.s1: entered into RCS
18144 1994-03-26 Richard Stallman <rms@gnu.org>
18146 * bison.simple: entered into RCS
18148 1994-03-25 Richard Stallman <rms@gnu.org>
18150 * src/main.c: entered into RCS
18152 1994-03-24 Richard Stallman <rms@gnu.org>
18154 * src/conflicts.c: entered into RCS
18156 1994-01-02 Richard Stallman <rms@gnu.org>
18158 * Makefile.in: *** empty log message ***
18160 1993-11-21 Richard Stallman <rms@gnu.org>
18162 * src/bison.s1: *** empty log message ***
18164 1993-11-21 Richard Stallman <rms@gnu.org>
18166 * doc/bison.texinfo: entered into RCS
18168 * doc/bison.texinfo: *** empty log message ***
18170 1993-11-21 Richard Stallman <rms@gnu.org>
18172 * bison.simple: *** empty log message ***
18174 1993-10-25 David J. MacKenzie <djm@gnu.org>
18176 * doc/bison.texinfo: *** empty log message ***
18178 1993-10-19 Richard Stallman <rms@gnu.org>
18180 * src/bison.s1: *** empty log message ***
18182 1993-10-19 Richard Stallman <rms@gnu.org>
18184 * bison.simple: *** empty log message ***
18186 1993-10-14 Richard Stallman <rms@gnu.org>
18188 * src/bison.s1: *** empty log message ***
18190 1993-10-14 Richard Stallman <rms@gnu.org>
18192 * bison.simple: *** empty log message ***
18194 1993-09-14 David J. MacKenzie <djm@gnu.org>
18196 * doc/bison.texinfo: *** empty log message ***
18198 1993-09-13 Noah Friedman <friedman@gnu.org>
18200 * Makefile.in: *** empty log message ***
18202 1993-09-10 Richard Stallman <rms@gnu.org>
18204 * src/conflicts.c: *** empty log message ***
18206 * src/system.h: entered into RCS
18208 1993-09-10 Richard Stallman <rms@gnu.org>
18210 * doc/bison.1: entered into RCS
18212 1993-09-06 Noah Friedman <friedman@gnu.org>
18214 * src/version.c: entered into RCS
18216 1993-09-06 Noah Friedman <friedman@gnu.org>
18218 * Makefile.in: *** empty log message ***
18220 1993-07-30 David J. MacKenzie <djm@gnu.org>
18222 * Makefile.in: *** empty log message ***
18224 1993-07-24 Richard Stallman <rms@gnu.org>
18226 * src/bison.s1: *** empty log message ***
18228 1993-07-24 Richard Stallman <rms@gnu.org>
18230 * bison.simple: *** empty log message ***
18232 1993-07-08 David J. MacKenzie <djm@gnu.org>
18234 * Makefile.in: *** empty log message ***
18236 1993-07-04 Richard Stallman <rms@gnu.org>
18238 * src/bison.s1: *** empty log message ***
18240 1993-07-04 Richard Stallman <rms@gnu.org>
18242 * bison.simple: *** empty log message ***
18244 1993-06-26 David J. MacKenzie <djm@gnu.org>
18246 * src/getargs.c: entered into RCS
18248 1993-06-26 David J. MacKenzie <djm@gnu.org>
18250 * doc/bison.texinfo: *** empty log message ***
18252 * doc/bison.1: New file.
18254 1993-06-25 Richard Stallman <rms@gnu.org>
18256 * src/getargs.c: New file.
18258 1993-06-16 Richard Stallman <rms@gnu.org>
18260 * src/bison.s1: *** empty log message ***
18262 1993-06-16 Richard Stallman <rms@gnu.org>
18264 * bison.simple: *** empty log message ***
18266 1993-06-03 Richard Stallman <rms@gnu.org>
18268 * src/bison.s1: New file.
18270 1993-06-03 Richard Stallman <rms@gnu.org>
18272 * doc/bison.texinfo: *** empty log message ***
18274 1993-06-03 Richard Stallman <rms@gnu.org>
18276 * bison.simple: New file.
18278 1993-05-19 Richard Stallman <rms@gnu.org>
18280 * doc/bison.texinfo: New file.
18282 1993-05-07 Noah Friedman <friedman@gnu.org>
18284 * Makefile.in: *** empty log message ***
18286 1993-04-28 Noah Friedman <friedman@gnu.org>
18288 * src/reader.c: *** empty log message ***
18290 1993-04-23 Noah Friedman <friedman@gnu.org>
18292 * src/alloc.h: entered into RCS
18294 1993-04-20 David J. MacKenzie <djm@gnu.org>
18296 * src/version.c: *** empty log message ***
18298 * src/files.c, src/allocate.c:
18301 * src/reader.c: *** empty log message ***
18303 * src/lex.c: entered into RCS
18305 * src/conflicts.c: New file.
18307 * src/symtab.c: entered into RCS
18309 * src/alloc.h: New file.
18311 * src/LR0.c: entered into RCS
18313 1993-04-18 Noah Friedman <friedman@gnu.org>
18315 * src/reader.c: New file.
18317 * src/version.c: *** empty log message ***
18319 1993-04-18 Noah Friedman <friedman@gnu.org>
18321 * Makefile.in: *** empty log message ***
18323 1993-04-17 Noah Friedman <friedman@gnu.org>
18325 * Makefile.in: *** empty log message ***
18327 1993-04-15 Richard Stallman <rms@gnu.org>
18329 * src/main.c, src/files.c:
18332 1993-04-15 Noah Friedman <friedman@gnu.org>
18334 * configure.in: entered into RCS
18336 * configure.in: *** empty log message ***
18338 * configure.in: New file.
18340 1993-04-14 Richard Stallman <rms@gnu.org>
18342 * Makefile.in: New file.
18344 1993-04-13 Richard Stallman <rms@gnu.org>
18346 * src/version.c: New file.
18348 1993-03-25 Richard Stallman <rms@gnu.org>
18350 * src/output.c: entered into RCS
18352 1992-09-25 Richard Stallman <rms@gnu.org>
18354 * configure.bat: entered into RCS
18356 1992-06-22 Richard Stallman <rms@gnu.org>
18358 * src/vmsgetargs.c: entered into RCS
18360 1992-06-22 Richard Stallman <rms@gnu.org>
18362 * doc/bison.rnh: entered into RCS
18364 1992-04-20 David J. MacKenzie <djm@gnu.org>
18366 * README: entered into RCS
18368 1992-01-22 Richard Stallman <rms@gnu.org>
18370 * src/machine.h: entered into RCS
18372 1991-12-21 Richard Stallman <rms@gnu.org>
18374 * src/lalr.c, src/closure.c:
18377 1991-12-20 Richard Stallman <rms@gnu.org>
18379 * src/state.h: entered into RCS
18381 1991-12-18 Richard Stallman <rms@gnu.org>
18383 * src/print.c, src/nullable.c, src/derives.c:
18386 1991-11-03 David J. MacKenzie <djm@gnu.org>
18388 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
18391 1988-09-09 Richard Stallman <rms@gnu.org>
18393 * src/bison.hairy: entered into RCS
18395 1987-12-16 Richard Stallman <rms@gnu.org>
18397 * REFERENCES: entered into RCS
18402 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
18403 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
18404 Software Foundation, Inc.
18406 Copying and distribution of this file, with or without
18407 modification, are permitted provided the copyright notice and this
18408 notice are preserved.