1 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3 Consolidate the 4 prologue alternative directives (%code, %requires,
4 %provides, and %code-top) into a single %code directive with an
5 optional qualifier field. Discussed at
6 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
7 * NEWS (2.3a+): Rewrite the existing entry for the prologue
9 * doc/bison.texinfo (Prologue Alternatives): Update.
10 (Decl Summary): Update to %code "requires" and %code "provides".
11 (Calc++ Parser): Update to %code "requires".
12 (Bison Symbols): Remove entries for %requires, %provides, and
13 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
14 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
15 are replaced by b4_percent_code_provides and b4_percent_code_requires,
16 which are skeleton-specific.
17 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
18 declare what %code qualifiers it supports and to complain if any other
19 qualifiers were used in the grammar.
20 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
21 and b4_user_code([b4_percent_code_provides]) in place of
22 b4_user_requires and b4_user_provides.
23 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
24 Add b4_user_code([b4_percent_code_top]) and
25 b4_user_code([b4_percent_code]).
26 Invoke b4_check_percent_code_qualifiers.
27 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
28 PERCENT_REQUIRES): Remove.
29 (grammar_declaration): Remove RHS's for %code-top, %provides, and
30 %requires. Rewrite the %code RHS as the unqualified form defining the
31 muscle b4_percent_code. Add another RHS for the qualified %code form,
32 which defines muscles of the form b4_percent_code_QUALIFIER and the
33 b4_used_percent_code_qualifiers muscle.
34 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
35 PERCENT_REQUIRES): Remove.
36 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
37 %code "requires" and %code "provides".
38 * tests/input.at (Reject bad %code qualifiers): New.
40 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
42 Use the new code_props interface for destructors and printers.
43 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
44 printer_location members, and change the type of the destructor and
45 printer members to code_props.
46 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
47 symbol_printer_get, semantic_type_destructor_set,
48 semantic_type_printer_set, default_tagged_destructor_set,
49 default_tagless_destructor_set, default_tagged_printer_set,
50 default_tagless_printer_set): Use code_props in arguments and return
51 types in place of char const * and location.
52 (symbol_destructor_location_get, symbol_printer_location_get): Remove
53 since the locations are now contained in the return of
54 symbol_destructor_get and symbol_printer_get.
55 * src/output.c (symbol_destructors_output, symbol_printers_output):
57 (symbol_code_props_output): ... this to eliminate duplicate code.
58 (output_skeleton): Update to use symbol_code_props_output.
59 * src/reader.c (symbol_should_be_used): Update use of
60 symbol_destructor_get.
61 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
62 Update uses of the various _destructor_set and _printer_set functions.
63 * src/symtab.c: (default_tagged_destructor_location,
64 default_tagless_destructor_location, default_tagged_printer_location,
65 default_tagless_printer_location): Remove since we...
66 (default_tagged_destructor, default_tagless_destructor,
67 default_tagged_printer, default_tagless_printer): ... change the type
68 of these to code_props.
69 (symbol_new, semantic_type_new, symbol_destructor_set,
70 semantic_type_destructor_set, symbol_destructor_get,
71 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
72 symbol_check_alias_consistency, default_tagged_destructor_set,
73 default_tagless_destructor_set, default_tagged_printer_set,
74 default_tagless_printer_set): Update.
75 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
76 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
78 (symbol_print): Use SYMBOL_CODE_PRINT.
80 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
82 Use the new code_props interface for rule actions.
83 * src/symlist.h (symbol_list): Replace action, action_location, and
84 used members with a code_props action_props member.
85 * src/reader.c (symbol_should_be_used, grammar_rule_check,
86 grammar_midrule_action, grammar_current_rule_merge_set,
87 grammar_current_rule_symbol_append, packgram): Update.
88 * src/scan-code.h (translate_rule_action): Remove, no longer used.
89 * src/scan-code.l (handle_action_dollar): Update.
90 (translate_rule_action): Remove, no longer used.
91 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
93 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
95 Use the new code_props interface in parse-gram.y.
96 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
97 Update all uses of translate_* functions to use the new code_props
98 interface and to use gram_scanner_last_string_free and
99 code_scanner_last_string_free where possible.
100 (grammar_declaration): symbol_list_destructor_set and
101 symbol_list_printer_set now perform the translation, so don't do it
102 here. Use gram_scanner_last_string_free where possible.
103 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
104 translate_code): Remove, no longer used.
105 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
106 symbol_list_printer_set): Perform code translation here rather than
107 depending on the caller to do so.
109 * src/symlist.h (struct symbol_list): Correct some documentation typos.
110 * src/scan-gram.h (gram_last_string): Remove declaration.
111 * src/scan-gram.l (last_string): Declare it static.
113 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
115 Encapsulate code properties and related functionality for the various
116 destructors, printers, and actions into a code_props structure and
117 interface. This patch merely implements code_props in scan-code.h and
118 scan-code.l. Future patches will rewrite other modules to use it.
119 Discussed starting at
120 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
121 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
122 consistently initialize const structs that have an empty location
124 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
125 to ensure consistency.
126 * src/scan-code.h (code_props): New structure.
127 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
128 function, macro, and const global variable for initializing a
129 code_props with no code.
130 (code_props_plain_init, code_props_symbol_action_init,
131 code_props_rule_action_init, code_props_translate_code): The rest of
132 the new code_props functional interface. Among other things, the init
133 functions set the code_props kind field so that
134 code_props_translate_code will know whether to behave like
135 translate_symbol_action, translate_rule_action, or translate_code.
136 These old translate functions must remain until all other modules are
137 updated to use the new code_props interface.
138 (code_scanner_last_string_free): New function similar to
139 gram_scanner_last_string_free.
140 (code_scanner_free): Add documentation.
141 * src/scan-code.l: Implement the new interface.
142 (code_lex): Make it static, add a code_props* argument, and remove the
144 (last_string): New static global similar to the one in scan-gram.l.
145 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
147 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
148 code_props since Bison may one day use this information for destructors
150 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
151 (handle_action_dollar): Use symbol_list_n_get and set used flag
152 directly since symbol_list_n_used_set is removed.
153 (translate_action): Add a code_props* argument and remove the rule,
154 action, and location arguments. Pass the code_props* on to code_lex.
155 (translate_rule_action, translate_symbol_action, translate_code):
156 Rewrite as wrappers around the new code_props interface.
157 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
158 it would eventually need to break the encapsulation of code_props.
160 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
162 * etc/.cvsignore: New.
164 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
166 Add maintainer-push-check to run maintainer-check using push parsing in
167 place of pull parsing where available.
168 * Makefile.am (maintainer-push-check): New.
169 * data/bison.m4 (b4_use_push_for_pull_if): New.
170 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
171 appropriately based on their existing values.
172 (yypush_parse): Don't print push-parser-specific diagnostics if push
173 parsing is being used in place of pull parsing.
174 * data/yacc.c: If push parsing should replace pull parsing, redirect to
176 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
177 variable, and insert b4_use_push_for_pull_flag into muscles.
178 * tests/Makefile.am (maintainer-push-check): New.
180 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
182 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
183 (whether successful or failed) so that yypush_parse can be invoked
184 again to start a new parse using the same yypstate.
185 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
186 check multiple yypull_parse invocations on the same yypstate. For pull
187 mode, extend to check multiple yyparse invocations.
188 (Exploding the Stack Size with Alloca): Extend to try with
190 (Exploding the Stack Size with Malloc): Likewise.
192 * tests/calc.at (Simple LALR Calculator): Don't specify
193 %skeleton "push.c" since %push-pull-parser implies that now.
194 * tests/headers.at (export YYLTYPE): Don't check for the push
195 declarations. Otherwise, this test case can't be used to see if push
196 mode can truly emulate pull mode.
197 * tests/input.at (Torturing the Scanner): Likewise.
198 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
199 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
200 AT_YACC_IF, which now includes the case of push mode since %skeleton
201 need not be used for push mode. This will be more intuitive once
202 push.c is renamed to yacc.c.
204 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
206 For push mode, convert yyparse from a macro to a function, invoke yylex
207 instead of passing a yylexp argument to yypull_parse, and don't
208 generate yypull_parse or yyparse unless %push-pull-parser is declared.
209 Discussed starting at
210 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
211 * data/bison.m4 (b4_pull_if): New.
212 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
213 * data/push.c: Improve M4 quoting a little.
214 (b4_generate_macro_args, b4_parenthesize): Remove.
215 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
216 any time a pull parser is requested.
217 Don't #define this as a wrapper around yypull_parse. Instead, when
218 both push and pull are requested, make it a function that does that
220 (yypull_parse): If there's a b4_prefix, #define this to
221 b4_prefix[pull_parse] when both push and pull are requested.
222 Don't define this as a function unless both push and pull are
224 Remove the yylexp argument and hard-code yylex invocation instead.
225 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
227 * src/getargs.c (pull_parser): New global initialized to true.
228 * getargs.h (pull_parser): extern it.
229 * src/output.c (prepare): Insert pull_flag muscle.
230 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
231 (prologue_declaration): Set both push_parser and pull_parser = true for
232 %push-pull-parser. Set push_parser = true and pull_parser = false for
234 * src/scan-gram.l: Don't accept %push_parser as an alternative to
235 %push-parser since there's no backward-compatibility concern here.
236 Scan %push-pull-parser.
237 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
238 instead of %push-parser.
239 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
240 prototype it in the module that calls yyparse.
241 * tests/input.at (Torturing the Scanner): Likewise.
242 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
244 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
246 Update etc/bench.pl. Optimize push mode a little (the yyn change
247 deserves most of the credit).
248 * Makefile.am (SUBDIRS): Add etc subdirectory.
249 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
250 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
251 yytoken, yyval, and yyloc declarations to...
252 (yyparse or yypush_parse): ... here to improve performance. For
253 yypush_parse invocations after the first, be sure to assign yyn its old
255 (yypstate_new): Don't bother initializing the yyresult field since the
256 initial value isn't used.
257 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
258 remove the #define that, in push mode, set it to yyps->NAME.
259 * etc/Makefile.am: New.
260 * etc/bench.pl: Remove and build it instead from...
261 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
262 "tests/bison" from the build directory by default rather than just
263 invoking "bison" from $PATH.
264 (calc_grammar): Update push parser code: don't declare yylval globally,
265 don't define yyparse_wrapper, and don't #define yyparse.
266 (bench_grammar): Update to check all working combinations of yacc.c,
267 push.c, impure, pure, pull, and push.
269 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
271 For push mode, add pull wrappers around yypush_parse.
272 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
273 (yypull_parse): New function wrapping yypush_parse.
274 (yyparse): New #define wrapping yypull_parse.
275 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
277 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
278 prototype yylex in the module that calls yyparse, and don't prototype
279 yyparse there. Otherwise, the yyparse expansion won't compile.
280 * tests/input.at (Torturing the Scanner): Likewise.
282 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
284 Enable push parsers to operate in impure mode. Thus, %push-parser no
285 longer implies %pure-parser. The point of this change is to move
286 towards being able to test the push parser code by running the entire
287 test suite as if %push-parser had been declared.
288 * data/push.c (yypush_parse): For impure mode, remove the
289 yypushed_char, yypushed_val, and yypushed_loc arguments.
290 Instead, declare these as local variables initialized to the global
291 yychar, yylval, and yylloc.
292 For the first yypush_parse invocation only, restore the initial values
293 of these global variables when it's time to read a token since they
294 have been overwritten.
295 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
297 * tests/calc.at (Simple LALR(1) Calculator): Always declare
298 %pure-parser along with %push-parser since this test case was designed
299 for pure push parsers.
300 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
301 (AT_YACC_OR_PUSH_IF): New.
302 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
303 add a note that it's still wrong for some cases (as it has been for a
305 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
306 %push-parser no longer implies %pure-parser.
308 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
310 Remove some unnecessary differences between the pull parser code and
311 the push parser code. This patch enables yynerrs in push mode.
312 * data/push.c: Reformat M4 a little.
313 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
314 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
315 because push mode is on. Instead, if pure mode is on, move yynerrs
317 (b4_declare_parser_state_variables): ... here.
318 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
319 to yyps->NAME so it can be used in yypush_parse.
320 (yypush_parse): Don't omit uses of yynerrs in push mode.
322 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
324 Fix bug such that the first pushed token's value and location are
325 sometimes overwritten (sometimes by %initial-action) before being used.
326 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
327 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
328 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
329 more closely mimic the pull parser logic.
330 Don't copy the pushed token to yychar, yylval, and yylloc until it's
331 time to read a token, which is after any initialization of yylval and
333 (gottoken): Rename label to...
334 (yyread_pushed_token): ... for clarity and to avoid infringing on the
337 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
339 Rearrange initialization of the parser state variables so that the
340 skeleton doesn't have to have a copy for pull mode and another for push
341 mode. This patch also fixes at least a bug such that yylloc was not
342 initialized (with b4_location_initial_line and
343 b4_location_initial_column) upon calling yypush_parse. However, that
344 initialization now overwrites the first token's location;
345 %initial-action assigning @$ already did the same thing, and both bugs
346 will be fixed in a later patch.
347 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
348 (b4_declare_parser_state_variables): Remove initialization of yytoken,
349 yyss, yyvs, yyls, and yystacksize.
350 (yypstate_new): Remove initialization of some yypstate fields: yystate,
351 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
353 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
354 yyps->NAME so it can be used in yypush_parse.
355 (yyparse or yypush_parse): For yypush_parse, don't print the
356 "Starting parse" diagnostic for invocations after the first.
357 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
358 yypush_parse, only do it for the first invocation.
359 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
360 initialization to occur in yypush_parse but only on the first
363 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
365 * data/push.c: Add CPP guards around push parser declarations in both
366 the header and the code file.
367 In the code file, move the push parser declarations to the same place
368 they appear in the header file.
369 Clean up the M4 some, especially the inconsistent underquoting in
370 some b4_c_function_def and b4_c_function_decl uses.
372 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
374 Encapsulate the push parser state variables into an M4 macro so the
375 push skeleton doesn't have to list them again for pull mode's yyparse.
376 For push mode, remove yypush_parse's local equivalents of these
377 variables to eliminate unnecessary copying between the two sets at
378 run-time. This patch also fixes at least a bug related to multiple
379 %initial-action invocations in push mode.
380 * data/push.c (b4_declare_parser_variables): Rename to...
381 (b4_declare_scanner_communication_variables): ... this for clarity and
383 (b4_declare_yyparse_variables): Remove and move its contents to the one
384 spot where it was invoked.
385 (b4_declare_parser_state_variables): New macro containing the parser
386 state variables required by push mode.
387 (struct yypstate): Replace all fields but yynew with
388 b4_declare_parser_state_variables.
389 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
390 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
391 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
392 (yyparse or yypush_parse): For yyparse in pull mode, replace local
393 parser state variable declarations with
394 b4_declare_parser_state_variables.
395 Don't initialize parser state variables when calling yypush_parse since
396 yypstate_new already does that.
397 Invoke the user's initial action only upon the first yypush_parse
399 Remove all code that copies between the local parser state variables
402 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
404 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
405 prevent a name collision in a future patch where these names will
406 sometimes be #define'd.
407 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
408 since it no longer has the same name as the existing argument.
409 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
411 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
412 and Joel E. Denny <jdenny@ces.clemson.edu>
414 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
415 that the argument is case-insensitive, and there's no `=' here.
416 For the %skeleton entry, mention that %language is better.
417 (Bison Options): Likewise for --language and --skeleton. Move the
418 --skeleton entry so that the `Tuning the parser' section is sorted
419 alphabetically on long options.
420 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
421 %language directive in detail here; cross-reference the %language
422 documentation instead.
423 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
424 `%require "2.3b"' so that the example is always up-to-date.
425 (Bison Symbols): Add entries for %language and %skeleton.
426 * examples/extexi (normalize): Instead of replacing every %require
427 argument with the current Bison version, just substitute for
428 `@value{VERSION}'. This guarantees that we're testing what actually
429 appears in the documentation.
430 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
431 rather than `@VERSION@'.
433 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
435 * NEWS: Reword the %language news a bit, and put it earlier.
437 * src/getargs.c (skeleton_arg): Last arg is now location const *.
438 Rewrite to simplify the logic.
439 (language_argmatch): Likewise.
440 (program_name): We now own this var.
441 * src/getargs.h (struct bison_language): Use char[] rather than
444 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
446 * src/complain.c (program_name): Remove decl; no longer needed.
447 * src/main.c (program_name): Remove; now belongs to getargs.
449 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
451 * NEWS: Document %language.
453 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
455 * data/c-skel.m4, data/c++-skel.m4: New files.
456 * data/glr.c: Complain on push parsers.
458 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
460 (Directives): Document %language and %skeleton.
461 (Command line): Document -L.
463 * examples/extexi: Rewrite %require directive.
464 * examples/calc++/Makefile.am: Pass VERSION to extexi.
466 * src/files.c (compute_exts_from_gc): Look in language structure
468 (compute_file_name_parts): Check whether .tab should be added.
469 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
470 (language, skeleton_arg, language_argmatch): New.
471 (long_options): Add --language.
472 (getargs): Use skeleton_arg, add -L/--language.
473 * src/getargs.h: Include location.h.
474 (struct bison_language, language, skeleton_arg, language_argmatch): New.
475 * src/output.c (prepare): Pick default skeleton from struct language.
476 Don't dispatch C skeletons here.
477 * src/parse-gram.y (PERCENT_LANGUAGE): New.
478 (prologue_declaration): Add "%language" rule, use skeleton_arg.
479 * src/scan-gram.l ("%language"): New rule.
481 * tests/calc.at: Test %skeleton and %language.
482 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
483 (AT_GLR_IF): Look for %skeleton "glr.cc".
484 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
485 (AT_YACC_IF): Reject %language.
487 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
489 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
490 since it wasn't used; only the typedef name 'semantic_type' is needed.
491 Also, omit trailing white space.
493 * bootstrap: Sync from coreutils.
494 (gnulib_extra_files): Add build-aux/announce.gen.
495 (slurp): Adjust .gitignore files like .cvsignore files.
496 * build-aux/announce-gen: Remove from CVS, since bootstrap
499 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
501 Make %push-parser imply %pure-parser. This fixes several bugs; see
502 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
503 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
505 * data/push.c: Don't bother testing b4_push_if when deciding whether
506 to expand b4_declare_parser_variables globally.
507 (yypush_parse): Likewise in here.
509 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
510 (yy_reduce_print): Reformat M4 for readability.
512 2006-12-15 Bob Rossi <bob@brasko.net>
513 and Joel Denny <jdenny@ces.clemson.edu>
515 * data/push.c (yypstate): Add typedef, and update all uses of
516 struct yypstate to just yypstate.
517 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
519 2006-12-14 Bob Rossi <bob@brasko.net>
521 * data/push.c (yypush_parse): Declare prototype regardless of
524 2006-12-14 Bob Rossi <bob@brasko.net>
526 * data/push.c (yyparse): Remove the prototype and the #define when in
529 2006-12-13 Bob Rossi <bob@brasko.net>
531 * data/push.c (yypstate_init): Rename to...
532 (yypstate_new): ... this and use b4_c_function_def.
533 (yypstate_delete): New.
534 (yypush_parse): Change parameters yynval and yynlloc to be const.
535 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
536 yypstate_delete functions.
538 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
540 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
541 strange test case titles. Reported by Bob Rossi.
543 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
545 * TODO: Add pointer to Sylvain Schmitz's work on static detection
546 of potential ambiguities in GLR grammers.
548 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
550 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
551 `bison ', use m4_index instead of m4_substr since chopping up a string
552 containing M4-special characters causes problems here.
554 Fix a couple of bugs related to special characters in user-specified
555 file names, and make it easier for skeletons to compute output file
556 names with the same file name prefix as Bison-computed output file
558 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
559 b4_parser_file_name and b4_spec_defines_file instead of
560 @output_parser_name@ and @output_header_name@, which are now redundant.
561 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
562 b4_parser_file_name, b4_spec_defines_file, and the new
563 @basename(FILENAME@) instead of @output_parser_name@ and
564 @output_header_name@, which inappropriately escaped the file names as
566 * src/files.c (all_but_ext): Remove static qualifier.
567 (compute_output_file_names): Move `free (all_but_ext)' to...
568 (output_file_names_free): ... here since all_but_ext is needed later.
569 * src/files.h (all_but_ext): Extern.
570 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
571 exactly what MUSCLE_INSERT_STRING used to do.
572 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
573 characters are escaped properly.
574 * src/output.c (prepare): Define muscle file_name_all_but_ext as
576 For pkgdatadir muscle, maintain previous functionality by using
577 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
578 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
579 digraphs would never be expanded. Hopefully no one has M4-special
580 characters in his Bison installation path.
581 * src/scan-skel.l: Don't parse @output_header_name@ and
582 @output_parser_name@ anymore since they're now redundant.
583 In @output, use decode_at_digraphs.
584 Parse a new @basename command that invokes last_component.
585 (decode_at_digraphs): New.
586 (BASE_QPUTS): Remove unused.
587 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
588 (Output file name): New tests.
590 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
592 Warn about output files that are generated by the skeletons and that
593 conflict with other output files.
594 * data/glr.c: Don't generate the header file here when glr.cc does.
595 * src/files.c (file_names, file_names_count): New static globals.
596 (compute_output_file_names): Invoke output_file_name_check for files
597 not generated by the skeletons and remove existing checks.
598 (output_file_name_check): New function that warns about conflicting
600 (output_file_names_free): Free file_names.
601 * src/files.h (output_file_name_check): Declare.
602 * src/scan-skel.l: Invoke output_file_name_check for files generated by
604 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
605 (Conflicting output files): New tests.
607 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
609 * doc/bison.texinfo: Fix a couple of typos.
611 2006-12-08 Bob Rossi <bob@brasko.net>
613 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
615 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
617 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
618 (yypush_parse): Rename yypvars argument to yyps and remove redundant
620 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
621 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
623 2006-12-07 Bob Rossi <bob@brasko.net>
624 and Joel Denny <jdenny@ces.clemson.edu>
626 * data/push.c (yypvarsinit): Change return type from void* to struct
627 yypvars*. No longer cast to void* on return.
628 (struct yypvars): Remove yylen since it need not be remembered between
629 yypushparse invocations.
630 (yypushparse): Don't copy between yylen and pv->yylen.
632 2006-12-05 Bob Rossi <bob@brasko.net>
634 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
635 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
636 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
637 (struct yypvars): Remove b4_declare_parser_variables.
638 (yypvarsinit): Remove init code for removed variables.
639 (global scope): Do not declare b4_declare_parser_variables if
641 (yypushparse): Add b4_declare_parser_variables.
642 Init new local variables, and remove init code for removed
645 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
646 and yyparse for other modes.
647 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
648 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
649 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
650 (AT_PURE_LEX_IF): True if pure or push parser.
652 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
654 Document Yacc prologue alternatives and default %destructor's and
655 %printer's as experimental. Don't mention Java yet. Discussed at
656 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
657 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
658 (2.3a): Annotate this entry to say the old forms of these features were
660 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
661 Bison Symbols): Say they're experimental. Comment out any mention
662 of Java (we'll want this back eventually).
664 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
666 Support a file name argument to %defines. Deprecate `=' in
667 %file-prefix, %name-prefix, and %output. Discussed at
668 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
669 * NEWS (2.3a+): Mention.
670 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
671 form of %defines, and remove `=' from entries for %file-prefix,
672 %name-prefix, and %output.
673 * src/parse-gram.y (prologue_declaration): Implement.
674 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
675 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
676 all but one occurrence of %name-prefix.
677 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
678 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
679 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
680 occurrence of each of %file-prefix and %output. Add check for %defines
682 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
683 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
684 Remove the `=' from %output.
686 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
688 Don't escape $ in test case titles since Autoconf 2.61 now does that
690 * tests/actions.at (Default %printer and %destructor are not for error
691 or $undefined): Here.
692 (Default %printer and %destructor are not for $accept): Here.
693 * tests/input.at (Invalid $n and @n): Here.
695 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
697 Rename <!> to <>. Discussed starting at
698 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
699 * NEWS (2.3a+): Update.
700 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
702 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
703 * src/scan-gram.l (INITIAL): Implement.
704 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
705 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
707 * tests/actions.at (Default tagless %printer and %destructor,
708 Default tagged and per-type %printer and %destructor,
709 Default %printer and %destructor are not for error or $undefined,
710 Default %printer and %destructor are not for $accept,
711 Default %printer and %destructor for mid-rule values): Update.
712 * tests/input.at (Default %printer and %destructor redeclared,
713 Unused values with default %destructor): Update.
715 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
717 Don't let %prec take a nonterminal.
718 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
720 * tests/input.at (%prec takes a token): New test checking that %prec
721 won't take a nonterminal.
723 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
725 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
726 it was double-quoted.
727 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
728 grammar is maintained with Bison's highest standards.
729 * src/getargs.c: Fix some typos in Doxygen comments.
731 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
733 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
734 later. Reported by Paul Eggert in
735 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
736 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
737 * src/scan-code.l (translate_action): Don't bother invoking
738 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
739 (code_scanner_free): Instead of invoking
740 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
742 * src/scan-gram.l (gram_scanner_free): Likewise.
743 * src/scan-skel.l (scan_skel): Likewise.
745 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
747 * src/files.c (tr): Change return type to void.
748 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
749 has been called previously for the same key.
750 (muscle_find): Return storage instead of value so that
751 --enable-gcc-warnings doesn't produce warnings that the return discards
752 const. aver that the value and storage are the same since storage
753 could potentially be NULL when value is not.
754 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
757 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
759 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
760 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
761 us a slightly cleaner distribution, and also works.
762 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
765 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
766 and Paul Eggert <eggert@cs.ucla.edu>
768 Don't let Bison leak memory except when it complains.
769 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
770 (spec_defines_file, dir_prefix): Now char *, not const char *,
771 since they are freed.
772 * src/files.c: Likewise.
773 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
775 (tr): Now operates in-place. All uses changed.
776 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
778 (compute_file_name_parts, compute_output_file_names): Don't store
779 read-only data in variables that will be freed.
780 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
781 src_extension, and header_extension.
782 (output_file_names_free): New public function to free
783 spec_verbose_file, spec_graph_file, spec_defines_file,
784 parser_file_name, and dir_prefix.
785 * src/getargs.c (getargs): Don't store read-only data in variables that
787 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
788 (which previously existed but was unused), and quotearg_free.
789 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
790 * src/muscle_tab.c: Likewise.
791 (muscle_entry): Make the value char const *,
792 and add a new storage member that is char * and can be freed.
793 (muscle_entry_free): New private function.
794 (muscle_init): Use it instead of free.
795 (muscle_insert, muscle_grow): Update and use new storage member.
796 (muscle_code_grow): Free the string passed to muscle_grow
797 since it's not needed anymore.
798 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
799 add a new `char *code' member.
800 ("{...}"): Declare semantic type as code.
801 * src/scan-code.h (translate_rule_action):
802 (translate_symbol_action, translate_code, translate_action): Return
803 `char const *' rather than `char *' since external code should not free
805 * src/scan-code.l: Likewise.
806 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
807 which is "{...}" in the parser.
808 * tests/Makefile.am (maintainer-check-valgrind): Set
809 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
811 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
813 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
814 expecting a non-zero exit status sets --leak-check=summary and
815 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
816 this case, and we don't want to hear about it.
818 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
820 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
821 instead of from the template, to simplify configuration a bit.
822 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
823 and m4/wint_t.m4, as they are needed with the latest gnulib.
825 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
827 Disable unset/unused mid-rule value warnings by default, and recognize
828 --warnings=midrule-values to enable them. Discussed starting at
829 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
830 * NEWS (2.3a+): Mention.
831 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
832 warnings): Add entry for midrule-values subargument.
833 * src/reader.c (symbol_should_be_used): Don't return true just because
834 the value is a set/used mid-rule value unless
835 --warnings=midrule-values was specified.
836 * tests/input.at (Unused values, Unused values before symbol
837 declarations): Run tests with and without --warnings=midrule-values.
839 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
840 than LIST_FREE directly.
842 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
844 Finish implementing --warnings=error, which should not be implied by
845 --warnings=all (or by its synonyms -W and --warnings without
847 * src/complain.c (set_warning_issued): New function to report that
848 warnings are being treated as errors and to record an error if so.
850 (warn_at, warn): ... here.
851 * src/getargs.c (warnings_args, warnings_types): Reorder so that
852 "error - warnings are errors" does not appear above "all - all of the
854 (getargs): For -W and --warnings without subarguments, don't let
855 FLAGS_ARGMATCH set warnings_error in warnings_flag.
856 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
858 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
860 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
861 empty subargument list. For example: `bison --warnings= parser.y'.
863 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
865 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
866 the parser header file so that gcc doesn't warn.
868 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
870 Split the default %destructor/%printer into two kinds: <*> and <!>.
871 Discussed starting at
872 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
873 * NEWS (2.3a+): Mention.
874 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
875 previous change today related to mid-rules.
876 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
877 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
878 (TYPE_TAG_ANY): Add as <*>.
879 (TYPE_TAG_NONE): Add as <!>.
880 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
882 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
883 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
884 * src/symlist.c (symbol_list_default_new): Split into tagged and
886 (symbol_list_destructor_set, symbol_list_printer_set): Split
887 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
888 SYMLIST_DEFAULT_TAGLESS.
889 * src/symlist.h: Update symbol_list_default*_new prototypes.
890 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
891 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
892 * src/symtab.c (default_destructor, default_destructor_location,
893 default_printer, default_printer_location): Split each into tagged and
895 (symbol_destructor_get, symbol_destructor_location_get,
896 symbol_printer_get, symbol_printer_location_get): Implement tagged
897 default and tagless default cases.
898 (default_destructor_set, default_printer_set): Split each into tagged
899 and tagless versions.
900 * src/symtab.h: Update prototypes.
901 * tests/actions.at (Default %printer and %destructor): Rename to...
902 (Default tagless %printer and %destructor): ... this, and extend.
903 (Per-type %printer and %destructor): Rename to...
904 (Default tagged and per-type %printer and %destructor): ... this, and
906 (Default %printer and %destructor for user-defined end token): Extend.
907 (Default %printer and %destructor are not for error or $undefined):
909 (Default %printer and %destructor are not for $accept): Update.
910 (Default %printer and %destructor for mid-rule values): Extend.
911 * tests/input.at (Default %printer and %destructor redeclared): Extend.
912 (Unused values with default %destructor): Extend.
914 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
916 Don't apply the default %destructor/%printer to an unreferenced midrule
918 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
919 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
920 like $@n instead of just @n so that the default %destructor/%printer
921 logic doesn't see them as user-defined symbols.
922 (symbol_is_dummy): Check for both forms of the name.
923 * src/reader.c (packgram): Remove the `$' from each midrule symbol
924 name for which the midrule value is referenced in any action.
925 * tests/actions.at (Default %printer and %destructor for mid-rule
927 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
928 for change to dummy symbol names.
930 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
932 Warn about unset midrule $$ if the corresponding $n is used.
933 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
935 (packgram): Before invoking grammar_rule_check on any rule, make sure
936 all actions have already been scanned in order to set `used' flags.
937 Otherwise, checking that a midrule's $$ is set will not always work
938 properly because the midrule check must forward-reference the midrule's
940 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
943 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
945 More improvements to the documentation of the prologue alternatives:
946 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
948 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
949 some text to clarify the relative importance of the new directives and
950 to show how these directives may be viewed as code labels.
952 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
954 Similar to the recently removed %before-header, add %code-top as the
955 alternative to the pre-prologue. Mentioned at
956 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
957 Also, let the prologue alternatives appear in the grammar section.
958 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
959 (prologue_declaration): Move the existing prologue alternatives to...
960 (grammar_declaration): ... here and add %code-top.
961 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
963 Clean up and extend documentation for the prologue alternatives.
964 * NEWS (2.3a+): Describe prologue alternatives.
965 * doc/bison.texinfo (Prologue): Move discussion of prologue
967 (Prologue Alternatives): ... this new section, and extend it to discuss
968 all 4 directives in detail.
969 (Bison Symbols): Clean up discussion of prologue alternatives and add
972 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
974 DJGPP specific issues.
976 * djgpp/config.bat: config.hin has been moved to lib. Adjust
977 config.bat accordingly.
978 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
979 * djgpp/config.site: Likewise.
981 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
983 Replace %*-header with %provides, %requires, %code. See discussion at
984 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
986 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
987 (b4_user_start_header): Remove.
988 * data/glr.c: Use new macros instead of b4_*start_header
990 * data/glr.cc: Likewise.
991 * data/lalr1.cc: Likewise.
992 * data/push.c: Likewise.
993 * data/yacc.c: Likewise.
995 * doc/bison.texinfo: Remove %before-header, rename
996 %{start,end,after}-header to %requires, %provides, %code.
998 * src/parse-gram.y: Likewise (also rename token names accordingly).
999 * src/scan-gram.l: Likewise.
1000 * tests/actions.at: Likewise.
1002 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
1004 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
1005 Problem reported by Joel E. Denny.
1007 2006-10-14 Jim Meyering <jim@meyering.net>
1009 (Sync from coreutils.)
1010 Work also when the working directory (with e.g. coreutils sources)
1011 is version controlled with git, rather than CVS.
1012 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
1014 In messages and comments, say e.g., "checked-out sources",
1015 rather than "CVS sources".
1016 (version_controlled_file): New function. Work for git as well as
1017 for CVS. Don't use grep's -q option.
1018 (slurp): Call it here, in place of CVS-specific code.
1020 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
1022 Fix testsuite for ./configure --enable-gcc-warnings:
1023 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
1024 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
1025 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
1026 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
1027 * test/regression.at (Diagnostic that expects two alternatives):
1030 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1032 * bootstrap.conf (gnulib_modules): Add config-h.
1033 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
1034 worry about HAVE_CONFIG_H.
1035 * lib/abitset.c: Likewise.
1036 * lib/bitset.c: Likewise.
1037 * lib/bitset_stats.c: Likewise.
1038 * lib/bitsetv-print.c: Likewise.
1039 * lib/bitsetv.c: Likewise.
1040 * lib/ebitset.c: Likewise.
1041 * lib/get-errno.c: Likewise.
1042 * lib/lbitset.c: Likewise.
1043 * lib/subpipe.c: Likewise.
1044 * lib/timevar.c: Likewise.
1045 * lib/vbitset.c: Likewise.
1046 * lib/bitset.c: Include "bitset.h" first, to test interface.
1047 * lib/bitset_stats.c: Include "bitset_stats.h" first.
1048 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
1049 * lib/bitsetv.c: Include "bitsetv.h" first.
1050 * lib/get-errno.c: Include "get-errno.h" first.
1051 * m4/.cvsignore: Add config-h.m4.
1052 * tests/actions.at (Default %printer and %destructor for ...):
1053 Adjust expected line numbers in output to reflect removal of #if
1054 HAVE_CONFIG_H lines.
1055 * tests/glr-regression.at (Missed %merge type warnings when ...):
1057 * tests/regression.at (Braced code in declaration in rules section):
1059 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
1060 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
1061 Include <config.h> unconditionally.
1063 * bootstrap: Sync from coreutils, as follows:
1065 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1067 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
1068 variable was sometimes used without being initialized. This
1069 messed up the installation of the INSTALL file in some cases.
1071 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1073 * bootstrap (usage, main program, symlink_to_gnulib): Add option
1074 --copy. Inspired by a suggestion from Bruno Haible.
1076 2006-10-03 Jim Meyering <jim@meyering.net>
1078 * bootstrap: Undo last change to this file, since now gnulib-tool
1079 sticks with the automake default in generating dependencies.
1081 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1083 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
1084 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
1086 * doc/bison.1: Add copyright notice.
1088 * data/glr.c: Don't include <stdarg.h>; not used.
1090 * NEWS: The -g and --graph options now output graphs in Graphviz
1091 DOT format, not VCG format.
1092 * doc/bison.1: Likewise.
1093 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
1094 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
1096 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
1097 * TODO: Remove Graphviz entry.
1098 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
1099 remove vcg.c, vcg.h, vcg_defaults.h.
1100 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
1101 * src/graphviz.c, src/graphviz.h: New files.
1102 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
1103 * src/files.h: Make comment more generic.
1104 * src/main.c (main): Likewise.
1105 * src/print_graph.h: Likewise.
1106 * src/getargs.c (usage): Make usage description more generic.
1107 * src/print_graph.c: Include graphviz.h rather than vcg.h.
1108 (static_graph, fgraph): Remove. All uses changed to pass
1109 arguments instead of sharing a static var.
1110 (print_core, print_actions, print_state, print_graph):
1111 Output graphviz format rather than VCG format.
1112 * tests/.cvsignore: Remove *.vcg; add *.dot.
1113 * tests/output.at: Expect *.dot files, not *.vcg files.
1115 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
1116 accommodates the 2006-10-08 change.
1118 2006-10-11 Bob Rossi <bob@brasko.net>
1120 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
1121 (b4_yyssa, b4_yyerror_range): New macros.
1122 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
1123 (yypvarsinit): Remove init of removed fields.
1124 (yypushparse): Remove use of removed fields; use new macros instead.
1126 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1128 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
1129 in a push parser. Reindent slightly to match yacc.c better.
1131 2006-10-11 Bob Rossi <bob@brasko.net>
1133 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
1135 (yypvarsinit, yypushparse): Remove init of removed fields.
1136 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
1138 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1140 * THANKS: Add Paolo Bonzini and Bob Rossi.
1142 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
1144 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
1145 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
1146 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
1147 b4_define_user_cde and uses): Remove.
1148 (b4_comment, b4_prefix, b4_sync_start): New.
1149 * data/bison.m4: New file, with most of the content removed from c.m4.
1150 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
1151 * src/output.c (output_skeleton): Pass bison.m4.
1152 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
1155 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
1157 Fix test failure reported by Tom Lane in
1158 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
1159 and try to make such failures easier to catch in the future.
1160 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
1161 that's now the caller's responsibility.
1162 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
1163 Set yychar = YYEOF if it's negative.
1164 * tests/actions.at (yylex): Abort if asked to read past EOF.
1165 * tests/conflicts.at (yylex): Likewise.
1166 * tests/cxx-type.at (yylex): Likewise.
1167 * tests/glr-regression.at (yylex): Likewise.
1168 * tests/input.at (yylex): Likewise.
1169 * tests/regression.at (yylex): Likewise.
1170 * tests/torture.at (yylex): Likewise.
1172 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
1174 Fix problems with translating English-language diagnostics.
1175 * bootstrap: Fix bug introduced in recent bootstrap changes, with
1176 respect to bison-runtime pot generation. The YY_ stuff
1177 wasn't being captured.
1178 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
1179 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
1180 * runtime-po/POTFILES.in: Add data/push.c.
1182 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
1184 Merge bootstrap changes from coreutils.
1186 2006-09-28 Jim Meyering <jim@meyering.net>
1188 Automatically generated dependencies are important even
1189 when all of the sources in a directory come from gnulib.
1190 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
1191 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
1193 2006-09-23 Jim Meyering <jim@meyering.net>
1195 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
1197 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1199 * bootstrap: Add support for --force.
1200 (usage): New function. Describe usage less tersely.
1201 (CVS_only_file): New var.
1203 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
1205 * data/push.c (YYPUSH_MORE): Make it an enum instead.
1206 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
1207 Adjust white space and comments to match GNU style better.
1209 2006-09-20 Bob Rossi <bob@brasko.net>
1211 * data/push.c (yyresult_get): Remove function.
1212 (YYPUSH_MORE): Add #define.
1213 (yypushparse): Modify return value.
1215 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1217 * stamp-h.in: Remove; no longer needed.
1218 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
1219 Remove config.h, config.hin, intl (no longer created).
1220 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
1223 Sync bootstrap from coreutils, as follows:
1225 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
1227 * bootstrap (symlink_to_gnulib): New function.
1228 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
1229 to copies-of-gnulib.
1230 (cp_mark_as_generated, slurp, gnulib_files):
1231 Avoid making a copy if it's the same as the old version.
1232 (gnulib_files): Add support for this variable (used by Bison).
1234 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1236 * src/getargs.c (usage): Rework to use conventions similar to
1237 coreutils, to make translation a bit easier and the code a bit
1238 smaller. Problem reported by Tim Van Holder.
1240 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
1242 Use some of gnulib's new modules, taken from coreutils.
1244 * bootstrap: Sync from coreutils, except add support for gnulib_files.
1245 * bootstrap.conf: New file.
1246 (gnulib_modules): Add configmake, inttypes, unistd.
1247 (XGETTEXT_OPTIONS): Add complain, complain_at,
1248 fatal, fatal_at, warn, warn_at, unexpected_end.
1249 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
1250 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
1252 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
1254 (GNULIB_AUTOCONF_SNIPPET): Remove.
1255 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
1257 * lib/.cvsignore: Add inttypes_.h.
1258 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
1259 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
1260 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
1261 no-longer-necessary initializations.
1262 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
1263 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
1264 use the unistd module.
1265 * src/system.h: Likewise.
1266 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
1267 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
1268 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
1269 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
1270 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
1271 * src/system.h: Include inttypes.h unconditionally, now that we
1272 use the inttypes module. Don't bother to include stdint.h, since
1273 inttypes.h now does that for us.
1274 (LOCALEDIR): Remove, now that we use the configmake module.
1275 * src/getargs.c: Include configmake.h.
1276 * src/main.c: Likewise.
1277 * src/output.c: Likewise.
1278 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
1279 not from $abs_top_builddir, since config.h moved.
1282 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
1283 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
1285 * src/parse-gram.y (symbol_declaration): Don't put statements
1286 before declarations; it's not portable to C89.
1287 * src/scan-code.l (handle_action_at): Likewise.
1289 * src/scan-code.l: Always initialize braces_level; the old code
1290 left it uninitialized and therefore had undefined behavior.
1292 Don't attempt to redefine 'assert', since it runs afoul of
1293 systems where standard headers (mistakenly) include <assert.h>.
1294 Instead, define and use our own alternative, called 'aver'.
1295 * src/reader.c: Don't include assert.h, since we no longer
1297 * src/scan-code.l: Likewise.
1298 * src/system.h (assert): Remove, replacing with....
1299 (aver): New function, taking a bool arg. All uses changed.
1300 * src/tables.c (pack_vector): Ensure that aver arg is bool,
1301 not merely an integer.
1303 2006-09-15 Bob Rossi <bob@brasko.net>
1305 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
1306 * data/c.m4 (YYPUSH): New.
1307 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
1308 * src/getargs.c (push_parser): New var.
1309 * src/getargs.h (push_parser): New declaration.
1310 * src/output.c (prepare): Add macro insertion of `push_flag'.
1311 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
1312 (prologue_declaration): Parse %push-parser.
1313 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
1314 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
1315 list of removed lines from the traces observed.
1316 (AT_CHECK_CALC_LALR): Added push parser tests.
1318 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
1320 * NEWS: Version 2.3a.
1321 * configure.ac (AC_INIT): Likewise.
1323 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
1324 "#define YYSTYPE int" that caused "make maintainer-check" to fail
1325 due to header ordering dependencies. I don't know why the #define
1328 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
1329 runtime cost when YYDEBUG is not defined, and so that some tests
1330 that used to fail now work. Problem and initial suggestion by
1332 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
1333 * data/glr.cc (b4_parser_class_name):
1334 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
1335 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
1336 (yydebug_) [YYDEBUG]: New member.
1337 (yycdebug_): Now defined only if YYDEBUG.
1338 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
1339 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
1340 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
1342 (debug_stream, set_debug_stream, debug_level, set_debug_level):
1343 Define only if YYDEBUG.
1344 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
1346 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
1347 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
1348 AT_CHECK_CALC_GLR_CC that are working now.
1350 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
1352 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
1353 We don't need them in glr.cc, and glr.c defines them.
1354 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
1355 assumes that defining it to anything is the same as defining
1356 it to 1. Problem reported by Paolo Bonzini.
1358 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
1360 * data/c.m4 (b4_null, b4_case): Define.
1361 * src/output.c (prepare_symbols): Use b4_null.
1362 (user_actions_output): Use b4_case.
1364 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
1366 * data/glr.c (b4_shared_declarations): Put start-header first,
1367 before any #includes that we generate, so that feature-test
1368 macros work. Problem reported by Michael Deutschmann in
1369 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
1370 * data/lalr1.cc: Likewise.
1371 * doc/bison.texinfo (Prologue): Document that feature-test macros
1372 should be defined before any Bison declarations.
1373 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
1374 that depend on location.hh after, not before, Bison decls, since
1375 we now include location.hh after the first user prologue.
1377 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
1378 Sander Brandenburg in
1379 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
1380 Also, fix minor white space and comment issues.
1381 (Prologue): Mention that it's better to define feature-test macros
1382 before Bison declarations. Problem reported by Michael Deutschmann.
1384 * README-cvs: Fix typo: "&" should be "&&". Problem reported
1386 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
1387 This adjusts to recent gnulib changes.
1389 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1391 Finish implementation of per-type %destructor/%printer. Discussed
1393 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
1395 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
1396 * NEWS (2.3+): Add a description of this feature to the default
1397 %destructor/%printer description.
1398 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
1399 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1400 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
1401 list node contains a semantic type.
1402 * src/symtab.c, src/symtab.h: Extend with a table that associates
1403 semantic types with their %destructor's and %printer's.
1404 (semantic_type_from_uniqstr, semantic_type_get,
1405 semantic_type_destructor_set, semantic_type_printer_set): New functions
1406 composing the public interface of that table.
1407 (symbol_destructor_get, symbol_destructor_location_get,
1408 symbol_printer_get, symbol_printer_location_get): If there's no
1409 per-symbol %destructor/%printer, look up the per-type before trying
1411 * tests/actions.at (Per-type %printer and %destructor): New test case.
1412 * tests/input.at (Default %printer and %destructor redeclared):
1413 Extend to check that multiple occurrences of %symbol-default in a
1414 single %destructor/%printer declaration is an error.
1415 (Per-type %printer and %destructor redeclared, Unused values with
1416 per-type %destructor): New test cases.
1418 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1420 Require default %destructor/%printer to be declared using
1421 %symbol-default instead of an empty symbol list, and start working on
1422 new per-type %destructor/%printer. Discussed at
1423 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
1424 * NEWS (2.3+): Add %symbol-default to example.
1425 * bison.texinfo (Freeing Discarded Symbols): Likewise.
1426 (Bison Symbols): Add entry for %symbol-default.
1427 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
1428 (generic_symlist, generic_symlist_item): New nonterminals for creating
1429 a list in which each item is a symbol, semantic type, or
1431 (grammar_declaration): Use generic_symlist in %destructor and %printer
1432 declarations instead of symbols.1 or an empty list.
1433 (symbol_declaration, precedence_declaration, symbols.1): Update actions
1434 for changes to symbol_list.
1435 * src/reader.c: Update for changes to symbol_list.
1436 * src/scan-code.l: Likewise.
1437 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
1438 * src/symlist.c, src/symlist.h: Extend such that a list node may
1439 represent a semantic type or a %symbol-default in addition to just an
1440 ordinary symbol. Add switched functions for setting %destructor's and
1442 * tests/actions.at, tests/input.at: Add %symbol-default to all default
1443 %destructor/%printer declarations.
1445 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
1447 Whether the default %destructor/%printer applies to a particular symbol
1448 isn't a question of whether the user *declares* that symbol (in %token,
1449 for example). It's a question of whether the user by any means
1450 *defines* the symbol at all (by simply using a char token, for
1451 example). $end is defined by Bison whereas any other token with token
1452 number 0 is defined by the user. The error token is always defined by
1453 Bison regardless of whether the user declares it with %token, but we
1454 may one day let the user define error as a nonterminal instead.
1455 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
1456 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
1457 the meaning of "user-defined".
1458 * tests/actions.at (Default %printer and %destructor for user-declared
1459 end token): Rename to...
1460 (Default %printer and %destructor for user-defined end token): ...
1463 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
1464 computation of whether to apply the default, don't maintain a list of
1465 every Bison-defined symbol. Instead, just check for a first character
1466 of '$', which a user symbol cannot have, and check for the error token.
1468 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
1470 Don't apply the default %destructor or %printer to the error token,
1471 $undefined, or $accept. This change fits the general rule that the
1472 default %destructor and %printer are only for user-declared symbols,
1473 and it solves several difficulties that are described in the new test
1475 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
1476 * tests/actions.at (Default %printer and %destructor are not for error
1477 or $undefined, Default %printer and %destructor are not for $accept):
1480 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
1482 Allow %start after the first rule.
1483 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
1484 when parsing the first rule.
1485 (check_and_convert_grammar): Search for it here after all grammar
1486 declarations have been parsed. Skip midrules, which have dummy LHS
1488 * src/symtab.c (symbol_is_dummy): New function.
1489 * src/symtab.h (symbol_is_dummy): Declare it.
1490 * tests/input.at (%start after first rule): New test.
1492 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1494 Redo some of the previous commit: add back the ability to use
1495 non-aliased/undeclared string literals since it might be useful to
1496 those declaring %token-table.
1497 * src/reader.c (check_and_convert_grammar): Undo changes in previous
1498 commit: don't worry about complaints from symbols_pack.
1499 * src/symtab.c (symbol_new, symbol_class_set,
1500 symbol_check_alias_consistency): Undo changes in previous commit: count
1501 each string literal as a new symbol and token, assign it a symbol
1502 number, and don't complain about non-aliased string literals.
1503 (symbols_pack): Since symbol_make_alias still does not decrement symbol
1504 and token counts but does still set aliased tokens to the same number,
1505 symbol_pack_processor now leaves empty slots in the symbols array.
1507 * tests/regression.at (Undeclared string literal): Remove test case
1508 added in previous commit since non-aliased string literals are allowed
1510 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
1511 remove unnecessary string literal declarations.
1512 * tests/sets.at (Firsts): Likewise.
1514 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1516 Don't allow an undeclared string literal, but allow a string literal to
1517 be used before its declaration.
1518 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1519 symbols_pack complained.
1520 * src/symtab.c (symbol_new): Don't count a string literal as a new
1522 (symbol_class_set): Don't count a string literal as a new token, and
1523 don't assign it a symbol number since symbol_make_alias does that.
1524 (symbol_make_alias): It's not necessary to decrement the symbol and
1525 token counts anymore. Don't assume that an alias declaration occurs
1526 before any uses of the identifier or string, and thus don't assert that
1527 one of them has the highest symbol number so far.
1528 (symbol_check_alias_consistency): Complain if there's a string literal
1529 that wasn't declared as an alias.
1530 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1531 symbol_pack asserts that every token has been assigned a symbol number
1532 although undeclared string literals have not.
1533 * tests/regression.at (String alias declared after use, Undeclared
1534 string literal): New test cases.
1535 (Characters Escapes, Web2c Actions): Declare string literals as
1537 * tests/sets.at (Firsts): Likewise.
1539 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1541 In the grammar scanner, STRING_FINISH unclosed constructs and return
1542 them to the parser in order to improve error messages.
1543 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1544 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1545 * tests/input.at (Unclosed constructs): New test case.
1546 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1549 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1552 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1554 Handle string aliases for character tokens correctly.
1555 * src/symtab.c (symbol_user_token_number_set): If the token has an
1556 alias, check and set its alias's user token number instead of its own,
1557 which is set to indicate the alias. Previously, every occurrence of
1558 the character token in the grammar overwrote that alias indicator with
1560 * tests/input.at (String aliases for character tokens): New test.
1562 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1564 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1566 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1568 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1569 to prevent failures when building on older platforms.
1570 Check for autopoint failure.
1571 Set XGETTEXT_OPTIONS to values that check for C format strings,
1572 so that translators are warned about them (this also helps
1573 prevent core dumps).
1575 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1576 function, since it simplifies our code a bit.
1578 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1579 rather than -W, so we don't get bogus warnings about sign comparisons.
1580 Add -Wpointer-arith, since that warning is useful (it reports code
1581 that does not conform to C89 and that some compilers reject).
1582 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1583 since it's no longer needed.
1585 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1587 Clean up scanners a bit.
1588 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1589 definitions so gcc won't warn when obstack_for_string is unused.
1590 * src/scan-code.l: config.h and system.h are already #include'd by
1591 scan-code-c.c, so get rid of them here.
1592 * src/scan-gram.l: Likewise.
1593 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1594 definitions rather than duplicating the rest of it.
1595 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1597 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1599 Suppress signed/unsigned comparison warnings for yycheck.
1600 * data/c.m4 (b4_safest_int_type): New macro.
1601 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1602 a signed int type, cast it to b4_safest_int_type first.
1603 * data/yacc.c: Likewise.
1604 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1607 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1609 * doc/bison.texinfo: Fix some typos.
1611 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1613 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1614 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1616 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1617 the latest gnulib does this a different way.
1618 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1619 translation was patched, so stop omitting it.
1621 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1623 Enable declaration of default %printer/%destructor. Make the parser
1624 use these for all user-declared grammar symbols for which the user does
1625 not declare a specific %printer/%destructor. Thus, the parser uses it
1626 for token 0 if the user declares it but not if Bison generates it as
1627 $end. Discussed starting at
1628 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1629 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1631 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1632 * NEWS (2.3+): Mention.
1633 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1634 declare a %destructor for a mid-rule's semantic value. It's just
1635 impossible to declare one specific to it.
1636 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1637 code. Describe default %destructor form.
1638 * src/parse-gram.y (grammar_declaration): Parse default
1639 %printer/%destructor declarations.
1640 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1641 and symbol_destructor_location_get rather than accessing the destructor
1642 and destructor_location members of struct symbol.
1643 (symbol_printers_output): Likewise but for %printer's.
1644 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1646 * src/symtab.c (default_destructor, default_destructor_location,
1647 default_printer, default_printer_location): New static global
1648 variables to record the default %destructor and %printer.
1649 (symbol_destructor_get, symbol_destructor_location_get,
1650 symbol_printer_get, symbol_printer_location_get): New functions to
1651 compute the appropriate %destructor and %printer for a symbol.
1652 (default_destructor_set, default_printer_set): New functions to set the
1653 default %destructor and %printer.
1654 * src/symtab.h: Prototype all those new functions.
1655 * tests/actions.at (Default %printer and %destructor): New test to
1656 check that the right %printer and %destructor are called, that they're
1657 not called for $end, and that $$ and @$ work correctly.
1658 (Default %printer and %destructor for user-declared end token): New
1659 test to check that the default %printer and %destructor are called for
1660 a user-declared end token.
1661 * tests/input.at (Default %printer and %destructor redeclared, Unused
1662 values with default %destructor): New tests to check related grammar
1663 warnings and errors.
1665 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1667 Clean up handling of %destructor for the end token (token 0).
1668 Discussed starting at
1669 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1671 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1673 Make the skeletons consistent in how they pop the end token and invoke
1675 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1676 state, which has token number 0, since this would invoke the
1677 %destructor for the end token.
1678 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1679 until after shifting the end token, or else it won't be popped.
1680 * data/yacc.c (yyparse): Likewise.
1682 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1683 it's the end token. Upon termination, destroy an unshifted lookahead
1684 even when it's the end token.
1685 * data/lalr1.cc (yy::parser::parse): Likewise.
1686 * data/yacc.c (yyparse): Likewise.
1688 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1689 value warnings for the end token when the user gives the end token a
1692 * tests/actions.at (Printers and Destructors): Test all the above.
1694 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1696 Update to latest gnulib and gettext versions.
1697 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1699 (gnulib_files): Add m4/warning.m4. Don't worry about files
1700 overwritten by autopoint.
1701 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1702 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1704 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1705 so that we can remove the intl files at a better time.
1706 (intl_files_to_remove): Remove aclocal.m4, since it gets
1707 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1708 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1709 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1710 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1711 Remove datarootdir hack; no longer needed.
1712 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1713 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1714 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1716 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1717 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1719 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1721 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1722 it with --assume-autoconf='latest-stable'.
1724 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1726 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1727 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1729 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1730 those from muscle_tab.c since the old ones are misleading.
1732 2006-07-13 Akim Demaille <akim@epita.fr>
1734 Support %define "KEY" {VALUE}.
1735 * src/scan-code.h, src/scan-code.l (translate_action)
1736 (translate_rule_action, translate_symbol_action, translate_code):
1737 Return char *, not const char *.
1738 * src/parse-gram.y (declaration): Rename as...
1739 (prologue_declaration): this.
1740 (string_content): Remove this nonterminal, use STRING.
1741 (braceless, content, content.opt): New nonterminal.
1743 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1745 * src/scan-gram.l (getargs.h): Don't include it.
1747 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1749 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1750 rather than a for-loop that declares a local bool variable. This
1751 should work around a compatibility problem with a Cray x1e C++
1752 compiler reported by Hung Nguyen in
1753 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1754 The for-loop was introduced in the 2004-11-17 change but I don't
1755 know why it was needed.
1757 2006-07-12 Akim Demaille <akim@epita.fr>
1759 * data/c.m4: Comment changes.
1761 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
1763 * src/complain.c (error_message, ERROR_MESSAGE): New.
1765 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1766 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1768 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1770 * NEWS: Instead of %union, you can define and use your own union type
1771 YYSTYPE if your grammar contains at least one <type> tag.
1772 Your YYSTYPE need not be a macro; it can be a typedef.
1773 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1774 (Union Decl, Decl Summary): Document this.
1775 * data/glr.c (YYSTYPE): Implement this.
1776 * data/glr.cc (YYSTYPE): Likewise.
1777 * data/lalr1.cc (YYSTYPE): Likewise.
1778 * data/yacc.c (YYSTYPE): Likewise.
1779 * src/output.c (prepare): Output tag_seen_flag.
1780 * src/parse-gram.y (declaration, grammar_declaration):
1781 Use 'union_seen' rather than 'typed' to determine whether
1782 %union has been seen, since grammars can now be typed without
1784 (symbol_declaration, type.opt, symbol_def):
1785 Keep track of whether a tag has been seen.
1786 * src/reader.c (union_seen, tag_seen): New vars.
1788 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1789 * src/scan-code.l (untyped_var_seen): New variable.
1790 (handle_action_dollar): Adjust to above changes.
1791 (handle_action_dollar, handle_action_at):
1792 Improve overflow checking for outlandish numbers.
1793 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1794 avoid new diagnostics generated by above changes.
1795 * tests/regression.at (YYSTYPE typedef): Add test to check
1796 for type tags without %union.
1798 * src/symlist.c (symbol_list_length): Return int, not unsigned
1799 int, since callers expect int. This may need to get revisited
1800 once we have proper integer overflow checking.
1802 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1803 object is now static.
1805 * src/getargs.c (flags_argmatch): Return void, not int,
1806 to pacify ./configure --enable-gcc-warnings.
1808 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1809 since last_string is already defined to FLEX_PREFIX (last_string).
1811 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1813 Implement --warnings/-W.
1814 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1816 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1818 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1819 (warnings_args, warnings_types): New.
1820 (getargs, short_options, long_options): Accept -W/--warnings.
1821 Sort the options by alphabetical order, upper case letter right
1822 before its lower case.
1824 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1826 Change %merge result type clash warnings to errors. Discussed at
1827 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1828 * src/reader.c (record_merge_function_type): Use complain_at.
1829 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1830 declared later): Update test case results.
1832 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1834 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1835 to be in alphabetical order.
1836 (trace_args): Spelling fixes.
1838 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1840 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1841 so they don't collide with user-defined macros.
1842 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1843 this was never guaranteed, and now that we're using gnulib stdint,
1844 which defines int_fast16_t to long int, the problem is exposed.
1846 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1848 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1849 need the full POSIX semantics (and weren't implementing them
1852 Adjust to Autoconf 2.60 and today's gnulib.
1853 * bootstrap (gnulib_modules): Add stdint.
1854 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1855 no longer copies it.
1856 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1857 since stdint needs the former and wcwidth (which is now required
1858 by mbswidth) needs the latter.
1859 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1860 work around a compatibility glitch between gettext 0.14.6 and
1862 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1863 Do not check for uintptr_t, since new stdint module does the right
1865 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1866 Add stdint.h, stdint_.h, wcwidth.h.
1867 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1868 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1869 stdint.m4, wchar_t.m4, wcwidth.m4.
1870 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1871 usual order for ../lib/*.h files.
1872 (file_name_split): Use last_component, not base_name, to adjust
1874 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1875 for ../lib/*.h files.
1876 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1877 Define unconditionally, since we now assume the stdint module.
1878 * src/scan-skel.l: Include <dirname.h>.
1879 (BASE_QPUTS): Use last_component, not base_name.
1880 * src/system.h: Include <unlocked-io.h> in the usual order
1881 for ../lib/*.h files. Include <stdint.h> unconditionally,
1882 since we now use the stdint module.
1883 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1884 HAVE_UINTPTR_T, since we now use the stdint module.
1885 (base_name): Remove decl, since files now include <dirname.h>
1888 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1890 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1892 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1893 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1895 * tests/calc.at: Adjust.
1897 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1899 * data/c.m4 (b4_basename): New.
1900 (b4_syncline): Also output the location of its invocation (from
1902 (b4_user_action, b4_define_user_action, b4_user_actions)
1903 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1904 (b4_user_stype): New.
1905 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1907 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1909 In the grammar file, the first column is 1 not 0 on the first line as
1910 on every other line.
1911 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1912 * tests/input.at (Torturing the Scanner): Update output.
1914 * src/scan-gram.l (scanner_cursor): Declare it static.
1916 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1918 In warnings, say "previous declaration" rather than "first
1920 * src/symtab.c (redeclaration): Do that here.
1921 * src/reader.c (record_merge_function_type): In the case of a result
1922 type clash, report the previous declaration rather than the very first
1923 one in the grammar file.
1924 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1925 declared later): Add a third declaration to check this behavior.
1926 * tests/input.at (Incompatible Aliases): Update output.
1928 2006-06-27 Akim Demaille <akim@epita.fr>
1930 * doc/Doxyfile.in: New.
1931 * doc/Makefile.am: Use it.
1932 * src/lalr.h, src/symtab.h: Initial doxygenation.
1934 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1936 Don't miss %merge result type warnings just because the LHS types are
1937 declared after the %merge. This continues the effort of the previous
1939 * src/reader.c (get_merge_function): Don't set the merger type yet.
1940 (record_merge_function_type): New function for setting the merger type
1941 and checking for clashes.
1942 (grammar_current_rule_merge_set): Set the location of the %merge for
1944 (packgram): Invoke record_merge_function_type for each rule now that
1945 all symbol type declarations have been parsed.
1946 * src/reader.h (merger_list.type_declaration_location): New member
1947 storing the location of the first %merge from which the type for this
1948 merging function was derived.
1949 * src/symlist.h (symbol_list.merger_declaration_location): New member
1950 storing the location of a rule's %merge, if any.
1951 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1952 declared later): New test to catch the error fixed by the above patch.
1954 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1956 Get action warnings (grammar_rule_check) right even when symbol
1957 declarations appear after the rules. Discussed at
1958 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1960 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1961 Don't mistake the type of $$ in a midrule to be that of its parent
1963 * src/reader.c (grammar_current_rule_end): Don't invoke
1964 grammar_rule_check yet since not all symbol declarations may have been
1966 (grammar_midrule_action): Likewise.
1967 Don't record whether the midrule's $$ has been used yet since actions
1968 haven't been translated yet.
1969 Record the midrule's parent rule and its RHS index within the parent
1971 (grammar_current_rule_action_append): Don't translate the action yet
1972 since not all symbol declarations may have been parsed yet and, thus,
1973 warnings about types for $$, $n, @$, and @n can't be reported yet.
1974 (packgram): Translate the action and invoke grammar_rule_check now that
1975 all symbol declarations have been parsed.
1976 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1977 after parsing the entire grammar file, the symbol list here in the case
1978 of a midrule is actually the midrule's empty RHS, so reference its
1979 parent rule's RHS where necessary.
1980 On the other hand, now that you can already know it's a midrule, you
1981 aren't forced to think $$ has the same type as its parent rule's $$.
1982 (handle_action_at): In the case of a midrule, reference the parent rule
1984 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1986 (symbol_list_length): Now that this is invoked after all rules have
1987 been parsed, a NULL symbol (rather than a NULL symbol list node)
1988 terminates a rule. symbol_list_print already does this correctly.
1989 * src/symlist.h (symbol_list.midrule_parent_rule,
1990 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1991 remember their relationships with their parents.
1992 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1993 fixed by the above patch.
1994 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1996 (Unused values): ... this old test case and...
1997 (Unused values before symbol declarations): ... this new test case.
1998 This one is the same as `Unused values' except that all symbol
1999 declarations appear after the rules in order to catch the rest of the
2000 errors fixed by the above patch.
2002 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2005 * src/reader.c (current_rule): Declare it static since it's no longer
2006 used outside this file.
2007 (grammar_current_rule_action_append): Remove redundant arguments from
2008 translate_rule_action invocation.
2009 * src/reader.h (current_rule): Remove this unused extern.
2010 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
2011 * src/scan-code.l (translate_rule_action): Likewise.
2013 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
2015 Clean up yesterday's patch.
2016 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
2018 * src/reader.c (grammar_current_rule_action_append): ... here for
2019 consistency with grammar_current_rule_symbol_append.
2020 * tests/regression.at (Braced code in declaration in rules section):
2021 Make yyerror and yylex static as usual.
2023 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
2025 Fix bug that mistakes braced code in a declaration in the rules section
2026 to be a rule action. Mentioned at
2027 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
2028 * src/scan-gram.l: Move midrule action detection from the start of the
2029 scanning of any braced code to...
2030 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
2031 action. For readability, use $2 and @2 rather than the equivalent
2033 * tests/regression.at (Braced code in declaration in rules section):
2034 New test to catch the error fixed by the above patch.
2036 Work on code readability some.
2037 * src/scan-code.l (current_rule): Get rid of this misleading and
2038 redundant declaration: it's actually extern'ed in reader.h.
2039 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
2040 translate_action): Add a rule argument and use it instead of the global
2042 (translate_rule_action): This already receives current_rule through an
2043 argument, so pass it on to translate_action instead of assigning
2044 current_rule to current_rule.
2045 (translate_symbol_action, translate_code): Pass rule = NULL to
2048 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
2050 Rename %before-definitions to %start-header and %after-definitions to
2051 %end-header. Don't use these declarations to separate pre-prologue
2052 blocks from post-prologue blocks. Add new order-independent
2053 declarations %before-header and %after-header as alternatives to the
2054 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
2055 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
2056 * NEWS (2.3+): Update for these changes.
2057 * data/glr.c (b4_before_definitions): Update to...
2058 (b4_start_header): ... this.
2059 (b4_after_definitions): Update to...
2060 (b4_end_header): ... this.
2061 * data/glr.cc: Likewise.
2062 * data/lalr1.cc: Likewise.
2063 * data/yacc.c: Likewise.
2064 * doc/bison.texinfo (The prologue): Update names, and replace remaining
2065 prologue blocks with %*-header declarations.
2066 (Calc++ Parser): Likewise.
2067 (Bison Declaration Summary): Update names.
2068 (Bison Symbols): Update description.
2069 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
2070 (PERCENT_END_HEADER): ... this.
2071 (PERCENT_BEFORE_DEFINITIONS): Update to...
2072 (PERCENT_START_HEADER): ... this.
2073 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2074 (declaration): Update token names and m4 macro names.
2075 When parsing %end-header and %start-header, invoke translate_code
2076 before muscle_code_grow, and no longer set global booleans to remember
2077 whether these declarations have been seen.
2078 Parse new %after-header and %before-header.
2079 * src/reader.c (before_definitions, after_definitions): Remove.
2080 (prologue_augment): Accept a new bool argument to specify whether to
2081 augment the pre-prologue or post-prologue.
2082 * src/reader.h (before_definitions, after_definitions): Remove these
2084 (prologue_augment): Add new bool argument.
2085 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
2086 (PERCENT_END_HEADER): ... this.
2087 (PERCENT_BEFORE_DEFINITIONS): Update to...
2088 (PERCENT_START_HEADER): ... this.
2089 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2090 * tests/actions.at (Printers and Destructors): Update names.
2092 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
2094 Add comparison operators for C++ location classes. Discussed at
2095 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
2096 * data/c++.m4 (b4_define_location_comparison): New boolean %define
2097 declaration indicating whether filename_type has an operator==. If
2098 filename_type is `std::string', it defaults to `1', `0' otherwise.
2099 * data/location.cc: Iff b4_define_location_comparison is `1', add
2100 operator== and operator!= for class position and for class location.
2103 * src/scan-action.l: Remove unused file.
2104 * src/symtab.c (symbol_printer_set): Use printer_location not
2105 destructor_location.
2106 * src/symtab.h (struct symbol): Replace incorrect source comment for
2108 * tests/input.at (Incompatible Aliases): Update output with correct
2111 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
2113 Don't put the pre-prologue in the header file. For the yacc.c code
2114 file and the glr.c header and code files, move the pre-prologue before
2115 the token definitions. Add new %before-definitions and
2116 %after-definitions to declare code that will go in both the header file
2117 and code file. Discussed at
2118 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
2119 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
2121 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
2122 * NEWS (2.3+): Describe these changes.
2123 * data/glr.c (b4_pre_prologue): Move from within to before...
2124 (b4_shared_declarations): ... this.
2125 Add new b4_before_definitions before b4_token_enums.
2126 Add new b4_after_definitions at the end.
2127 * data/glr.cc (b4_pre_prologue): Replace with...
2128 (b4_before_definitions): ... this in the header file.
2129 (b4_after_definitions): New near the end of the header file.
2130 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
2131 code file right before including the header file.
2132 (b4_before_definitions): New in the previous position of
2133 b4_pre_prologue in the header file.
2134 (b4_after_definitions): New near the end of the header file.
2135 * data/yacc.c: Clean up some m4 quoting especially in the header file.
2136 (b4_token_enums_defines): In the code file, move to right before
2137 YYSTYPE for consistency with the header file.
2138 (b4_before_definitions): New right before b4_token_enums_defines in
2139 both the header and code file.
2140 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
2141 header and code file.
2142 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
2143 of prologues for %union dependencies.
2144 (Bison Declaration Summary): In %defines description, mention the
2145 effect of %before-definitions and %after-definitions on the header
2147 (Calc++ Parser): Forward declare driver in a %before-definitions rather
2148 than in the pre-prologue so that make check succeeds.
2149 (Bison Symbols): Add entries for %before-definitions and
2151 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
2152 %before-definitions.
2153 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
2154 (declaration): Parse those declarations and append to
2155 b4_before_definitions and b4_after_definitions, respectively.
2156 * src/reader.c (before_definitions, after_definitions): New bools to
2157 track whether those declarations have been seen.
2158 (prologue_augment): Add to the post-prologue if %union,
2159 %before-definitions, or %after-definitions has been seen.
2160 * src/reader.h (before_definitions, after_definitions): New extern's.
2161 * src/scan-gram.l: Scan the new declarations.
2162 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
2163 prologue block in a %before-definitions or a %after-definitions based
2164 on whether the %union is declared.
2165 * tests/regression.at (Early token definitions with --yacc, Early token
2166 definitions without --yacc): Move tests for token definitions into the
2167 post-prologue since token names are no longer defined in the
2170 2006-06-20 Akim Demaille <akim@epita.fr>
2172 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
2173 (symbol_get): Use it.
2174 * src/parse-gram.y: Use it.
2176 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
2178 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
2179 build succeeds when configured with --enable-gcc-warnings.
2181 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
2183 * src/parse-gram.y (char_name): New function.
2184 (CHAR, STRING, string_content): For %printer, properly escape.
2185 (ID): Prefer fputs to fprintf.
2186 (id): Reindent to be consistent with other rules.
2187 Properly quote char.
2189 The Translation Project changed its way of publishing translations
2190 to maintainers. I haven't received any responses to my request
2191 for supporting the old way, or for documenting the new way. I
2192 have modified 'bootstrap' to use screen scraping
2193 (in this case, HTML scraping). This is unreliable and inelegant,
2194 but I don't see any better way. Yuck.
2195 * bootstrap (TP_URL, WGET_COMMAND): New vars.
2196 (get_translations): New function, which uses HTML scraping to
2197 deduce locations of latest translations.
2198 Use this function to grab both bison and bison-runtime .po files.
2199 Don't bother priming the pump for the runtime-po domain any more,
2200 as it's now translated better than bison is.
2202 2006-06-19 Akim Demaille <akim@epita.fr>
2204 * src/scan-gram.l: No longer "parse" things after `%union' until
2205 `{'. Rather, return a single "%union" token.
2206 No longer make symbols: return strings, and leave the conversion
2207 to symbols to the parser.
2208 (SC_PRE_CODE, token_type): Remove.
2209 * src/parse-gram.y (%union): New field `character'.
2212 (ID, ID_COLON): Now that the scanner no longer makes them
2213 identifiers, adjust all uses to invoke symbol_get.
2214 (id_colon): New, wraps the conversion from string to symbol.
2215 (%union): Accept a possible union_name.
2216 (symbol): Now can be a char.
2217 * data/c.m4 (b4_union_name): Leave a default value.
2218 * data/glr.c, data/yacc.c: Use it.
2220 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
2222 For associating token numbers with token names for "yacc.c", don't use
2223 #define statements unless `--yacc' is specified; always use enum
2224 yytokentype. Most important discussions start at:
2225 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
2226 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
2228 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
2229 * NEWS (2.3+): Mention.
2230 * data/c.m4 (b4_yacc_if): New.
2231 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
2233 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
2234 on token name definitions.
2235 * src/getargs.c (usage): Capitalize `Yacc' in English.
2236 * src/output.c (prepare): Define b4_yacc_flag.
2237 * tests/regression.at (Early token definitions): Test that tokens names
2238 are defined before the pre-prologue not just before the post-prologue.
2239 Remove this test case and copy to...
2240 (Early token definitions with --yacc): ... this to test #define's.
2241 (Early token definitions without --yacc): ... and this to test enums.
2243 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
2245 * NEWS: Reword the post-2.3 change to not be so optimistic about
2246 removing the old "look-ahead" spelling.
2247 Update previous look-ahead/lookahead change reports.
2248 * REFERENCES: look-ahead -> lookahead (since that's
2249 what he actually wrote).
2250 * doc/refcard.tex: look ahead -> lookahead,
2251 look-ahead -> lookahead
2253 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
2255 For consistency, use `lookahead' instead of `look-ahead' or
2256 `look_ahead'. Discussed starting at
2257 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
2259 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
2260 * NEWS: For the next release, note the change to `--report'.
2261 * TODO, doc/bison.1: Update English.
2262 * doc/bison.texinfo: Update English.
2263 (Understanding Your Parser, Bison Options): Document as
2264 `--report=lookahead' rather than `--report=look-ahead'.
2265 * src/conflicts.c: Update English in comments.
2266 (lookahead_set): Rename from look_ahead_set.
2267 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
2268 (resolve_sr_conflict): Rename local look_ahead_tokens to
2269 lookahead_tokens, and update other uses.
2270 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
2271 count_rr_conflicts, conflicts_free): Update uses.
2272 * src/getargs.c (report_args): Move "lookahead" before alternate
2274 (report_types): Update uses.
2275 (usage): For `--report' usage description, state `lookahead' spelling
2276 rather than `look-ahead'.
2277 * src/getargs.h (report.report_lookahead_tokens): Rename from
2278 report_look_ahead_tokens.
2279 * src/lalr.c: Update English in comments.
2280 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
2281 (state_lookahead_tokens_count): Rename from
2282 state_look_ahead_tokens_count.
2283 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2284 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
2285 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2287 Update English in output.
2288 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
2289 * src/print.c: Update English in comments.
2290 (lookahead_set): Rename from look_ahead_set.
2291 (print_reduction): Rename argument lookahead_token from
2293 (print_core, state_default_rule, print_reductions, print_results):
2295 * src/print_graph.c: Update English in comments.
2296 (print_core): Update uses.
2297 * src/state.c: Update English in comments.
2298 (reductions_new): Update uses.
2299 (state_rule_lookahead_tokens_print): Rename from
2300 state_rule_look_ahead_tokens_print, and update other uses.
2301 * src/state.h: Update English in comments.
2302 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
2303 (state_rule_lookahead_tokens_print): Rename from
2304 state_rule_look_ahead_tokens_print.
2305 * src/tables.c: Update English in comments.
2306 (conflict_row, action_row): Update uses.
2307 * tests/glr-regression.at
2308 (Incorrect lookahead during deterministic GLR,
2309 Incorrect lookahead during nondeterministic GLR): Rename
2310 print_look_ahead to print_lookahead.
2311 * tests/torture.at: Update English in comments.
2312 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
2313 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
2314 (Many lookahead tokens): Update uses.
2315 * data/glr.c: Update English in comments.
2316 * lalr1.cc: Likewise.
2318 * src/conflicts.h: Likewise.
2319 * src/lalr.h: Likewise.
2320 * src/main.c: Likewise.
2321 * src/output.c: Likewise.
2322 * src/parse-gram.c: Likewise.
2323 * src/tables.h: Likewise.
2324 * tests/calc.at: Likewise.
2326 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
2328 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
2330 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
2332 * TODO: Add request from Nelson H. F. Beebe to be able to install
2333 Bison without installing the yacc script.
2335 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2337 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
2338 and yytext if they're already #define'd.
2339 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
2340 * src/scan-code-c.c: ... here.
2341 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
2344 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2346 Get Bison to build again when configured with --enable-gcc-warnings.
2347 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
2349 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
2350 loc argument as it shadows a global.
2351 * src/scan-gram.l: Remove stray comma that prevents boundary_set
2354 * src/.cvsignore: Add scan-code.c.
2356 2006-06-07 Akim Demaille <akim@epita.fr>
2358 * src/scan-gram.l: Move the "add a trailing ; to actions" code
2360 * src/scan-code.l: here.
2361 * tests/input.at (Torturing the Scanner): Fix another location
2364 2006-06-07 Akim Demaille <akim@epita.fr>
2366 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
2368 2006-06-06 Akim Demaille <akim@epita.fr>
2370 Extract the parsing of user actions from the grammar scanner.
2371 As a consequence, the relation between the grammar scanner and
2372 parser is much simpler. We can also split "composite tokens" back
2374 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
2375 * src/scan-gram.l (add_column_width, adjust_location): Move to and
2377 * src/location.h, src/location.c (add_column_width)
2378 (location_compute): these.
2379 Fix the column count: the initial column is 0.
2380 (location_print): Be robust to ending column being 0.
2381 * src/location.h (boundary_set): New.
2382 * src/main.c: Adjust to scanner_free being renamed as
2384 * src/output.c: Include scan-code.h.
2385 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
2387 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
2388 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
2389 which is now, again, a separate token.
2390 Adjust all dependencies.
2391 Whereever actions with $ and @ are used, use translate_code.
2392 (action): Remove this nonterminal which is now useless.
2393 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
2394 (grammar_current_rule_action_append): Use translate_code.
2395 (packgram): Bound check ruleno, itemno, and rule_length.
2396 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
2397 (last_string, last_braced_code_loc, max_left_semantic_context)
2398 (scanner_initialize, scanner_free, scanner_last_string_free)
2399 (gram_out, gram_lineno, YY_DECL_): Move to...
2400 * src/scan-gram.h: this new file.
2401 (YY_DECL): Rename as...
2403 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
2404 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
2405 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
2406 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
2407 Move these declarations, and...
2408 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
2410 * src/flex-scanner.h: this new file.
2411 * src/scan-gram.l (rule_length, rule_length_overflow)
2412 (increment_rule_length): Remove.
2413 (last_braced_code_loc): Rename as...
2414 (gram_last_braced_code_loc): this.
2415 Adjust to the changes of the parser.
2416 Move all the handling of $ and @ into...
2417 * src/scan-code.l: here.
2418 * src/scan-gram.l (handle_dollar, handle_at): Remove.
2419 (handle_action_dollar, handle_action_at): Move to...
2420 * src/scan-code.l: here.
2421 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
2422 scan-code.h, scan-code-c.c, scan-gram.h.
2423 (EXTRA_bison_SOURCES): Add scan-code.l.
2424 (BUILT_SOURCES): Add scan-code.c.
2425 (yacc): Be robust to white spaces.
2427 * tests/conflicts.at, tests/input.at, tests/reduce.at,
2428 * tests/regression.at: Adjust the column numbers.
2429 * tests/regression.at: Adjust the error message.
2431 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2433 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2434 Use Akim's wording from
2435 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
2437 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2439 Between Bison releases, manually append `+' to the previous Bison
2440 release number, and use that as a signal to automatically print the
2441 ChangeLog's CVS Id keyword from --version. Discussed starting at
2442 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
2443 * ChangeLog: Add Id header.
2444 * configure.ac (AC_INIT): Append `+' to `2.3'.
2445 * src/.cvsignore: Add revision.c.
2446 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
2447 (BUILT_SOURCES): Add revision.c.
2448 (revision.c): New target rule. This file defines a new global variable
2449 named revision. It initializes it with either the Id from ChangeLog
2450 or, if VERSION doesn't contain `+', with the empty string.
2451 * src/getargs.c (version): Print the value of revision.
2452 * src/revision.h: Extern revision.
2454 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
2456 * NEWS: Version 2.3.
2457 * configure.ac (AC_INIT): Likewise.
2459 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
2461 * data/glr.c (YYRECOVERING): Define to be a function-like macro
2462 with no arguments, not as an object-like macro. This is for
2463 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
2464 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
2465 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
2468 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
2470 * src/getargs.c (usage): Back out yesterday's modification of the
2471 --help output so that we don't have to wait for translation before
2474 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
2476 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
2477 Problem reported by Akim Demaille.
2479 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2481 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2483 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
2485 * data/yacc.c (yy_reduce_print): Omit trailing white space in
2486 generated source code. Problem reported by Frans Englich in
2487 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
2489 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
2491 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
2492 shell, not within 'make', so that 'make' by an ordinary builder
2493 (using GNU make) does not worry about configuring gzip. This also
2494 works around a bug reported independently by Keith Thompson and by
2495 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
2496 stderr rather than stdout, messing up the build logs.
2498 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2500 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
2501 to make sure that YYID will never be unused. This fixes a 'make
2502 maintainer-check' failure caused by the recent changes to the 'Trivial
2503 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
2505 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
2507 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2509 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
2510 state before an empty RHS is always resolved here. Only the location
2511 of that state is guaranteed to be resolved, and that's enough. This
2512 fixes the remaining bug reported by Derek M. Jones in
2513 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2514 * tests/glr-regression.at (Uninitialized location when reporting
2515 ambiguity): Test the above case.
2516 Also, the embedded comments in this test case claim it checks the case
2517 of an empty RHS that has inherited the initial location. However, the
2518 corresponding LHS was already resolved, so yyresolveLocations didn't
2519 actually have reason to modify it. Fix this by forcing
2520 nondeterministic operation at the beginning of the parse.
2522 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2524 * data/c.m4 (b4_yy_symbol_print_generate):
2525 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2526 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2527 of the bugs reported today by Derek M Jones in
2528 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2529 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2530 defined to be a type name without parens or brackets.
2531 (Location Type): Similarly for YYLTYPE.
2532 * tests/regression.at (Trivial grammars): Put in a test for this
2533 bug that will be caught by 'make maintainer-check' (though not,
2534 alas, by 'make check' unless your compiler is picky).
2536 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2538 * NEWS: Version 2.2.
2539 * configure.ac (AC_INIT): Likewise.
2541 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2543 * data/glr.c (yyreportTree): Make room in yystates for the state
2544 preceding the RHS. This fixes the segmentation fault reported by Derek
2546 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2547 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2548 to the user. Reported for yyreportTree by Derek M. Jones later in the
2550 * THANKS: Add Derek M. Jones.
2551 Update my email address.
2552 Fix typo in Steve Murphy's name.
2554 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2556 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2557 checking against YYLAST that caused the parser to miss a potential
2558 alternative in its diagnostic.
2559 Problem reported by Maria Jose Moron Fernandez in
2560 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2561 * data/lalr1.cc (yysyntax_error_): Likewise.
2562 * data/yacc.c (yysyntax_error): Likewise.
2563 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2564 tokens, in case we run into an older C compiler.
2565 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2566 Use them to check for the off-by-one error fixed above.
2568 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2569 YYSIZE_T, not size_t.
2570 * tests/regression.at (Trivial grammars): New test, to catch
2571 the error fixed by the above patch.
2573 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2575 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2577 Reported by Steve Murphy.
2579 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2581 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2582 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2584 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2586 Implement --trace=m4.
2587 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2588 * src/output.c (output_skeleton): When set, pass -dV to m4.
2590 Factor the handling of flags in m4.
2591 * src/output.c (prepare): Rename the muscle names debug, defines,
2592 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2593 * data/c.m4: Adjust.
2594 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2595 Use b4_define_flag_if to define other b4_FLAG_if macros.
2596 (b4_location_if): As a consequence, rename as...
2597 (b4_locations_if): this, for consistency.
2598 Adjust all the skeletons.
2600 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2602 * etc/bench.pm: Shorten bench names.
2604 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2606 * src/output.h, src/output.c (error_verbose): Move to...
2607 * src/getargs.h, src/getargs.c: here.
2609 Adjust dependencies.
2611 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2613 * data/c.m4 (b4_copyright): Put the special exception for Bison
2614 skeletons here, so we don't have to put it in each skeleton. All
2615 uses changed. Suggested by Akim Demaille. Also, wrap the
2616 copyright notice, in case it is longer than 80 columns. Replace
2617 comma by newline after title.
2619 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2621 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2622 incompatibility, not a bug. Mention that it wasn't fixed as of
2625 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2627 * examples/extexi: Enforce the precedence of concatenation over
2629 Reported by Tommy Nordgren.
2631 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2633 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2634 with the member "token".
2635 Reported by Martin Nylin.
2637 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2639 * data/glr.c: Switch to Bison 2.2 special-exception language in
2640 the copyright notice. Use more-regular format for titles and
2642 * data/glr.cc: Likewise.
2643 * data/location.cc: Likewise.
2644 * data/yacc.cc: Likewise.
2645 * doc/bison.texinfo (Conditions): Document this.
2646 * NEWS: likewise. Upgrade version to 2.2.
2648 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
2650 * data/glr.cc: Remove dead code.
2652 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2654 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2655 that variable and the line breaks the bootstrap. Problem reported
2656 by Juan M. Guerrero.
2658 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2660 * doc/bison.texinfo (Multiple start-symbols): New.
2662 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2664 * etc/README, etc/bench.pl: New.
2666 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
2668 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2670 Reported by Mickael Labau.
2671 * tests/input.at (Torturing the Scanner): Test it.
2673 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2675 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2676 Problem reported by Bob Rossi.
2678 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2680 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2681 and didn't really work.
2682 For the index, use @ifnotinfo, not @iftex.
2683 Minor cleanups of spacing and terminology.
2685 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2687 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2688 of AT_NAME_PREFIX when %name-prefix is not used.
2690 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2692 Apply --prefix to C++ skeletons too: they change the namespace.
2693 The test suite already exercize these cases.
2694 * data/c++.m4 (b4_namespace): New.
2695 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2696 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2697 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2698 * doc/bison.texinfo: Document it.
2699 (Option Cross Key): Use @multitable in all formats. It looks
2700 nicer, even in TeX outputs.
2701 (Rules): Use the same code whatever the output type is.
2702 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2703 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2704 * tests/calc.at: Use it, instead of hard coding `yy'.
2706 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2708 * TODO: Remove dead items.
2710 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2712 * doc/FAQ: Remove, merged into...
2713 * doc/bison.texinfo (FAQ): this.
2714 * doc/Makefile.am (EXTRA_DIST): Adjust.
2716 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2718 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2720 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2721 * doc/bison.texinfo (Calc++ Scanner): Use it.
2723 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2725 Fix two nits reported by twlevo, plus one more that I discovered.
2727 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2728 this is the usual Bison style.
2729 * src/location.h (location_print): Likewise.
2731 * src/reader.h (token_name): Likewise.
2733 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2735 Fix some nits reported by twlevo.
2736 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2737 and "POSIX". Use more-modern syntax for URLs. Mention C++
2738 and ask for Java. Don't hardwire OS version numbers. Add
2740 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2741 * src/conflicts.c (solved_conflicts_obstack): Now static.
2743 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2745 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2746 page. Say "you can use it" not "you may use it" as on the web page;
2747 we're describing capabilities not granting permission.
2749 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2751 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2752 shadowing warnings. Use usual patter for iterating through RHS.
2753 * tests/glr-regression.at
2754 (Uninitialized location when reporting ambiguity):
2755 Modify yylex so that it uses its argument, rather than trying
2756 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2757 const char -> char const.
2759 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2760 Don't use tabs inside commands; it messes up 'ps'.
2761 Problem reported by twlevo.
2763 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2765 * tests/glr-regression.at (Uninitialized location when reporting
2766 ambiguity): New test case.
2767 * data/glr.c (yyresolveLocations): New function, which uses
2769 (yyresolveValue): Invoke yyresolveLocations before reporting an
2771 * doc/bison.texinfo (Default Action for Locations): Note
2772 YYLLOC_DEFAULT's usage for ambiguity locations.
2773 (GLR Semantic Actions): Cross-reference those notes.
2775 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2777 * tests/glr-regression.at (Leaked semantic values when reporting
2778 ambiguity): Remove unnecessary union and type declarations.
2779 (Leaked lookahead after nondeterministic parse syntax error): New test
2781 * data/glr.c (yyparse): Check for zero stacks remaining before
2782 attempting to shift the lookahead so that you don't lose it.
2784 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2786 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2787 * tests/glr-regression.at (Leaked semantic values when reporting
2788 ambiguity): New test case.
2789 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2790 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2791 now unnecessary yystackp parameter.
2792 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2793 destructors can be called.
2795 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2796 in existing testcases.
2798 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2800 Don't leak semantic values for parent RHS when a user action cuts the
2801 parser, and clean up related code a bit.
2802 * tests/glr-regression.at (Leaked merged semantic value if user action
2803 cuts parse): Rename to...
2804 (Leaked semantic values if user action cuts parse): ... this. Add check
2805 for leaked parent RHS values.
2806 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2807 between an unresolved state (non-empty chain of semantic options) and
2808 an incomplete one (signaled by an empty chain).
2809 (yyresolveStates): Document the interface. Move all manipulation of a
2810 successfully or unsuccessfully resolved yyGLRState to...
2811 (yyresolveValue): ... here so that yyresolveValue always leaves a
2812 yyGLRState with consistent data and thus is easier to understand.
2813 Remove the yyvalp and yylocp parameters since they are always just
2814 taken from the yys parameter. When reporting a discarded merged value
2815 in debugging output, note that it is incompletely merged. Document the
2817 (yyresolveAction): If resolving any of the RHS states fails, destroy
2818 them all rather than leaking them. Thus, as long as user actions are
2819 written to clean up the RHS correctly, yyresolveAction always cleans up
2820 the RHS of a semantic option. Document the interface.
2822 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2824 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2825 led to a segmentation fault in GNU Pascal. Problem reported
2828 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2830 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2831 mid-rule action inside a nonterminal symbol in order to declare a
2832 destructor for its semantic value.
2834 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2836 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2837 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2838 __cplusplus && ! defined _STDLIB_H && !
2839 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2840 defined free))]: Include <stdlib.h> rather than rolling our own
2841 declarations of malloc and free, to avoid problems with
2842 incompatible declarations (using 'throw') C++'s stdlib.h. This
2843 should fix Debian bug 340012
2844 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2845 reported by Guillaume Melquiond.
2847 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2849 * NEWS: Clarify symbols versus types in unused-value warnings.
2851 * configure.ac (AC_INIT): Bump version number.
2853 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2855 * NEWS: Version 2.1a.
2856 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2857 since C99 requires this.
2859 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2861 * m4/c-working.m4: New file.
2862 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2864 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2866 * Makefile.maint: Merge from coreutils.
2868 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2870 More portability fixes for problems summarized by Nelson H. F. Beebe.
2872 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2873 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2874 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2875 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2876 messes up because C++ code is compiled in 32-bit mode but linked
2879 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2881 More portability fixes for problems summarized by Nelson H. F. Beebe.
2883 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2884 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2886 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2887 nodist_PROGRAMS, since we don't need to actually compile the
2888 example if we're just doing a plain 'make'. This avoids bothering
2889 the installer unnecessarily about problems due to weird C++
2892 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2894 More portability fixes for problems summarized by Nelson H. F. Beebe.
2896 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2897 than #include "...", and compile with -I'.'. The old method was
2898 not portable, according to Posix and the C standard, and it does
2899 not work with Sun C 5.7, where previous #line directives affect
2900 the working directory used in later #include "..." directives.
2902 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2904 Various DJGGP specific issues in /djgpp
2906 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2908 More portability fixes for problems summarized by Nelson H. F. Beebe.
2910 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2911 '#include <map>' works and that you can apply ++ to iterators.
2913 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2915 Work around portability problems summarized by Nelson H. F. Beebe in
2916 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2918 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2919 that '#include <string>' works.
2921 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2922 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2923 "warning: sorry: semantics of inline function static data `const
2924 unsigned char translate_table[262]' are wrong (you'll wind up with
2927 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2928 or, xor to not_, and_, or_, and xor_, respectively. This works
2929 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2930 random system header somewhere that includes the equivalent of
2933 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2934 -E" works; it apparently doesn't work with PathScale EKO Compiler
2937 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2939 During deterministic GLR operation, user actions should be able to
2940 influence the parse by changing yychar. To make this easier to fix and
2941 to make glr.c easier to evolve in general, don't maintain yytoken in
2942 parallel with yychar; just compute yytoken when needed.
2943 * tests/glr-regression.at (Incorrect lookahead during deterministic
2944 GLR): Check that setting yychar in a user action has the intended
2946 * data/glr.c (yyGLRStack): Remove yytokenp member.
2947 (yyclearin): Don't set *yytokenp.
2948 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2949 yychar rather than *yytokenp to determine the current lookahead.
2950 Compute yytoken locally when needed.
2951 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2954 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2955 after `--report' documentation.
2957 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2959 * src/parse-gram.y (grammar_declaration): Location of printer
2960 symbol is @1, not list->location. Bug reported by twlevo.
2961 * tests/input.at (Incompatible Aliases): Adjust to above change.
2963 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2965 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2966 all the test at once. This makes the output easier to read in the
2969 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2970 got from <http://bro-ids.org/download.html>. The bug is that
2971 when two actions appeared in succession, the second one was
2972 scanned before the first one was added to the grammar rule
2973 as a midrule action. Bison then output the incorrect warning
2974 "parse.y:905.17-906.36: warning: unused value: $3".
2975 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2976 associated with a value.
2977 (rhs): Don't invoke grammar_current_rule_action_append.
2978 (action): Invoke it here instead.
2979 * src/reader.c (grammar_midrule_action): Now extern.
2980 (grammar_current_rule_action_append): Don't invoke
2981 grammar_midrule_action; that is now the scanner's job.
2982 * src/reader.h (last_string, last_braced_code_loc):
2983 (grammar_midrule_action): New decls.
2984 * src/scan-gram.l (last_string): Now extern, sigh.
2985 (last_braced_code_loc): New extern variable.
2986 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2987 rule already has an action.
2988 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2989 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2990 Add some tests to check that the above changes fixed the bug.
2992 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2994 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2995 All used changed. Check whether the symbol has a destructor,
2996 not whether it is typed.
2997 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2998 that the values are still reported as unused. All line numbers
3001 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
3003 Work around a bug in bro 0.8, which underparenthesizes its
3004 definition of YYLLOC_DEFAULT.
3005 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
3007 * data/lalr1.cc: Likewise.
3008 * data/yacc.cc: Likewise.
3010 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
3012 Work around a bug in Pike 7.0, and give the Pike folks a
3013 better way to override the usual int widths.
3014 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
3015 user can override the types.
3016 (short): #undef, to work around a bug in Pike 7.0.
3017 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
3018 (union yyalloc.yyss): Use yytype_int16 rather than short.
3020 (yysigned_char): Remove.
3021 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
3022 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
3023 * tests/regression.at (Web2c Actions): Adjust to above changes.
3025 * src/reader.c (check_and_convert_grammar): New function.
3026 (reader): Close the input file even if something went wrong during
3027 parsing. Minor file descriptor leak reported by twlevo.
3029 * src/assoc.c (assoc_to_string): Use a default: abort (); case
3030 to pacify gcc -Wswitch-default.
3031 * src/scan-gram.l (adjust_location): Use a default: break; case
3032 to pacify gcc -Wswitch-default.
3033 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
3034 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3035 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3036 Move these decls to scan-skel.l, since they don't need to be
3038 * src/scan-skel.l: Accept the above decls.
3039 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
3042 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
3044 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
3045 since we don't want to insist on a version number at the start
3046 of the changelog every time.
3047 * Makefile.maint: Sync from coreutils a bit better.
3048 (sc_trailing_blank): Renamed from sc_trailing_space.
3050 (sc_no_if_have_config_h, sc_require_config_h):
3051 (sc_prohibit_assert_without_use): New rules.
3052 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
3053 (sc_dd_max_sym_length): Fix leading spaces in rule.
3054 (sc_system_h_headers): Prefix with @.
3055 (sc_useless_cpp_parens, m4-check): Output line numbers.
3056 (changelog-check): Allow version only in head.
3057 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
3058 satisfy new Makefile.maint rule.
3059 * data/glr.c: Likewise.
3060 * data/glr.cc: Likewise.
3061 * data/lalr1.cc: Likewise.
3062 * data/yacc.c: Likewise.
3063 * lib/ebitsetv.c: Likewise.
3064 * lib/lbitset.c: Likewise.
3065 * lib/subpipe.c: Likewise.
3066 * lib/timevar.c: Likewise.
3067 * src/system.h: Likewise.
3068 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
3069 * djgpp/Makefile.maint: Add copyright notice.
3070 * djgpp/README.in: Likewise.
3071 * djgpp/config.bat: Likewise.
3072 * djgpp/config.site: Likewise.
3073 * djgpp/config_h.sed: Likewise.
3074 * djgpp/djunpack.bat: Likewise.
3075 * djgpp/config.sed: Fix copyright notice to match standard format.
3076 * djgpp/subpipe.h: Likewise.
3077 * lib/bitsetv-print.c: Likewise.
3078 * lib/bitsetv.c: Likewise.
3079 * lib/subpipe.h: Likewise.
3080 * lib/timevar.c: Likewise.
3081 * lib/timevar.h: Likewise.
3082 * djgpp/subpipe.c: Use standard recipe for config.h.
3083 * lib/abitset.c: Likewise.
3084 * lib/bitset.c: Likewise.
3085 * lib/bitset_stats.c: Likewise.
3086 * lib/bitsetv-print.c: Likewise.
3087 * lib/bitsetv.c: Likewise.
3088 * lib/ebitsetv.c: Likewise.
3089 * lib/get-errno.c: Likewise.
3090 * lib/lbitset.c: Likewise.
3091 * lib/subpipe.c: Likewise.
3092 * lib/timevar.c: Likewise.
3093 * lib/vbitset.c: Likewise.
3094 * tests/local.at: Likewise.
3095 * src/scan-gram.l: Don't include verify.h, since system.h does
3097 * .x-sc_require_config_h: New file.
3098 * .x-sc_unmarked_diagnostics: New file.
3100 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
3102 Be a bit more systematic about using 'abort'.
3103 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
3104 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
3105 Put 'default: abort ();' before some other case, to satisfy older
3107 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3108 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
3109 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
3110 * src/conflicts.c (resolve_sr_conflict): Likewise.
3111 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
3112 (get_decision_str, get_orientation_str, get_node_alignment_str):
3113 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
3114 (get_linestyle_str, get_arrowstyle_str): Likewise.
3115 * src/conflicts.c (resolve_sr_conflict):
3116 Use a default case rather than one for the one remaining enum
3117 value, to catch invalid enum values as well.
3118 * src/lalr.c (set_goto_map, map_goto):
3119 Prefer "assert (FOO);" to "if (!FOO) abort ();".
3120 * src/nullable.c (nullable_compute, token_definitions_output):
3122 * src/reader.c (packgram, reader): Likewise.
3123 * src/state.c (transitions_to, state_new, state_reduction_find):
3125 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
3126 (symbol_pack): Likewise.
3127 * src/tables.c (conflict_row, pack_vector): Likewise.
3128 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
3129 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
3130 * src/system.h: Don't include <assert.h>.
3131 (assert): New macro.
3133 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
3134 (Destructor Decl, Parser Function, Pure Calling):
3135 Describe rules for braces inside C code more carefully.
3137 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
3139 Fix some porting glitches found by Nelson H. F. Beebe.
3140 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
3141 compilers that don't understand that abort () does not return.
3142 * src/state.c (transitions_to): Likewise.
3143 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3144 that '#include <cstdlib>' works.
3145 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
3146 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
3147 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
3148 for the benefit of some pre-C99 compilers.
3150 * bootstrap: Undo changes to gnulib files that autoreconf made.
3152 Minor fixups to get 'make maintainer-check' to work.
3153 * configure.ac: Don't use -Wnested-externs, as it's incompatible
3154 with the new verify.h implementation.
3155 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
3156 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
3157 * data/yacc.c (YYUSE): Likewise.
3158 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
3159 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
3160 * src/parse-gram.y (declaration): Don't pass a string constant
3161 to a function that expects char *, since GCC might complain
3162 about the constant value.
3163 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
3164 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
3165 before #defining them.
3166 * tests/glr-regression.at
3167 (Incorrectly initialized location for empty right-hand side in GLR):
3168 In yyerror, use the msg arg.
3169 (Corrupted semantic options if user action cuts parse):
3170 (Incorrect lookahead during deterministic GLR):
3171 (Incorrect lookahead during nondeterministic GLR):
3172 Don't name a local var 'index'; it shadows string.h's 'index'.
3174 2006-01-19 Akim Demaille <akim@epita.fr>
3176 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
3177 location, not just parts of it.
3179 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
3181 * NEWS: Document the fact that multiple %unions are now allowed.
3182 * doc/bison.texinfo (Union Decl): Likewise.
3183 * TODO: This feature is now implemented, so remove it from
3186 * Makefile.maint: Merge with coreutils Makefile.maint.
3187 (CVS_LIST): Use build-aux version if available.
3188 (VERSION_REGEXP): New macro.
3189 (syntax-check-rules): Add sc_no_if_have_config_h,
3190 sc_prohibit_assert_without_use, sc_require_config_h,
3191 sc_useless_cpp_parens.
3192 (sc_obsolete_symbols): Check for O_NDELAY.
3193 (sc_dd_max_sym_length): Track coreutils.
3194 (sc_unmarked_diagnostics): Look in all files, not just *.c.
3195 (sc_useless_cpp_parens): New rule.
3196 (news-date-check): Look for version or today's date.
3197 (changelog-check): Don't require version number near head.
3198 (copyright-check): Use current year instead of hardwiring 2005.
3199 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
3200 (announcement): Add --gpg-key-ID.
3202 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
3205 Avoid undefined behavior that addressed just before the start of an
3206 array. Problem reported by twlevo.
3207 * src/reader.c (packgram): Prepend a new sentinel before ritem.
3208 * src/lalr.c (build_relations): Rely on new sentinel.
3209 * src/gram.c (gram_free): Adjust to new sentinel.
3211 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
3213 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
3214 yylookaheadNeeds. All uses updated.
3215 (yysplitStack): Rename local yynewLookaheadStatuses to
3216 yynewLookaheadNeeds.
3217 * data/glr-regression.at (Incorrect lookahead during nondeterministic
3218 GLR): In comments, change `lookahead status' to `lookahead need'.
3220 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3222 * data/glr.c (yysplitStack): A little stylistic rewrite.
3224 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3226 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
3228 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
3230 * doc/bison.texinfo: Fix some typos.
3231 (GLR Semantic Actions): New subsection discussing special
3232 considerations because GLR semantic actions might be deferred.
3233 (Actions): Mention look-ahead usage of yylval.
3234 (Actions and Locations): Mention look-ahead usage of yylloc.
3235 (Special Features for Use in Actions): Add YYEOF entry and mention it
3236 in the yychar entry.
3237 In the yychar entry, remove mention of the local yychar case (pure
3238 parser) since this is irrelevant information when writing semantic
3239 actions and since it's already discussed in `Bison Symbols' where
3240 yychar is otherwise described as an external variable.
3241 In the yychar entry, don't call it the `current' look-ahead since it
3242 isn't when semantic actions are deferred.
3243 In the yychar and yyclearin entries, add note about deferred semantic
3245 Add yylloc and yylval entries discussing look-ahead usage.
3246 (Look-Ahead Tokens): When discussing yychar, don't call it the
3247 `current' look-ahead, and do mention yylval and yylloc.
3248 (Error Recovery): Cross-reference `Action Features' when mentioning
3250 (Bison Symbols): In the yychar entry, don't call it the `current'
3252 In the yylloc and yylval entries, mention look-ahead usage.
3254 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3256 * tests/glr-regression.at: Update copyright year to 2006.
3258 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3260 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
3261 use during nondeterministic operation to track which stacks have
3262 actually needed the current lookahead.
3263 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
3264 Allocate, deallocate, resize, and otherwise shuffle space for
3265 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
3266 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
3267 appropriately during nondeterministic operation.
3268 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
3269 members to store the current lookahead to be used by the deferred
3271 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
3272 from which the RHS is taken. Set the lookahead members of the new
3273 yySemanticOption according to the lookahead status for stack yyk.
3274 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
3275 yyaddDeferredAction.
3276 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
3277 members of yySemanticOption before invoking yyuserAction, and then set
3278 them back to their current values afterward.
3279 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
3280 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
3281 * tests/glr-regression.at: Remove `.' from the ends of recent test case
3282 titles for consistency.
3283 (Leaked merged semantic value if user action cuts parse): In order to
3284 suppress lint warnings, use arguments in merge function, and assign
3285 char value < 128 in main.
3286 (Incorrect lookahead during deterministic GLR): New test case.
3287 (Incorrect lookahead during nondeterministic GLR): New test case.
3289 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3291 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
3292 !yyvaluep as signal that no semantic value is available to print.
3293 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
3294 to print a semantic value.
3296 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3298 * tests/glr-regression.at: For consistency with my newer test cases,
3301 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3303 * data/glr.c (yyresolveValue): When merging semantic options, if at
3304 least one user action succeeds but a later one cuts the parse, then
3305 destroy the semantic value before returning rather than leaking it.
3306 (yyresolveStates): If a user action cuts the parse and thus
3307 yyresolveValue fails, ignore the (unset) semantic value rather than
3308 corrupting the yyGLRState, and empty the semantic options list since
3309 the user actions should have called all necessary destructors.
3310 Simplify code with YYCHK.
3311 * tests/glr-regression.at (Corrupted semantic options if user action
3312 cuts parse): New test case.
3313 (Undesirable destructors if user action cuts parse): New test case.
3314 Before applying any of this patch, this test case never actually failed
3315 for me... but only because the corrupted semantic options usually
3317 (Leaked merged semantic value if user action cuts parse): New test
3320 2006-01-05 Akim Demaille <akim@epita.fr>
3322 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
3324 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
3326 * data/c.m4 (b4_c_modern): New macro, with a new provision for
3327 _MSC_VER. Problem reported by Cenzato Marco.
3328 (b4_c_function_def): Use it.
3329 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
3331 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
3332 than rolling our own.
3334 2006-01-04 Akim Demaille <akim@epita.fr>
3336 Also warn about non-used mid-rule values.
3337 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
3339 (symbol_list_new): Adjust.
3340 * src/reader.c (symbol_typed_p): New.
3341 (grammar_rule_check): Use it.
3342 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
3344 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
3346 * tests/actions.at (Exotic Dollars): Adjust.
3348 2006-01-04 Akim Demaille <akim@epita.fr>
3350 * src/reader.c (grammar_midrule_action): If $$ is set in a
3351 mid-rule, move the `used' bit to its lhs.
3352 * tests/input.at (Unused values): New.
3353 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
3355 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
3357 * doc/bison.texinfo (Bison Options): Say more accurately what
3359 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
3360 about declarations in the grammar when in Yacc mode, as POSIX does
3361 not require a diagnostic when the grammar uses extensions.
3363 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
3365 Warn about dubious constructions like "%token T T".
3367 * src/symtab.h (struct symbol.declared): New member.
3368 * src/symtab.c (symbol_new): Initialize it to false.
3369 (symbol_class_set): New arg DECLARING, specifying whether
3370 this is a declaration that we want to warn about, if there
3371 is more than one of them. All uses changed.
3373 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
3374 Allow multiple %union directives, whose contents concatenate.
3375 * src/parse-gram.y (grammar_declaration): Likewise.
3376 Use muscle_code_grow, so that we don't need stype_line any more.
3379 * src/muscle_tab.c (muscle_grow): Fix comment.
3381 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
3382 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
3383 Update copyright year to 2006.
3385 2006-01-03 Akim Demaille <akim@epita.fr>
3387 Have glr.cc pass (some of) the calc.at tests.
3388 * data/glr.cc (b4_parse_param_orig): New.
3389 (b4_parse_param): Improve its definition, and bound it more
3390 clearly in the skeleton.
3391 (b4_epilogue): Append, instead of prepending, in order to keep
3393 Simplify the generation of auxiliary functions: locations and
3394 purity are mandated.
3395 (b4_global_tokens_and_yystype): Honor it.
3396 * data/location.cc (c++.m4): Don't include it.
3397 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
3399 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
3401 Be sure to initialize the first position's filename.
3402 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
3404 (AT_CHECK_CALC_GLR_CC): New.
3405 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
3407 2006-01-02 Akim Demaille <akim@epita.fr>
3409 * src/output.c (output_skeleton): Don't hard wire the inclusion of
3411 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3412 * data/glr.cc: Do not include stack.hh.
3414 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3416 * data/glr.c: Reformat whitespace with tabs.
3417 (b4_lpure_formals): Remove this unused m4 macro.
3418 * tests/cxx-type.at: Reformat whitespace with tabs.
3419 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
3420 since it's a member. Rename type to isNterm for clarity.
3422 2005-12-29 Akim <akim@sulaco.local>
3424 Let glr.cc catch up with symbol_value_print.
3425 * data/glr.cc (b4_yysymprint_generate): Replace by...
3426 (b4_yy_symbol_print_generate): this.
3427 (yy_symbol_print, yy_symbol_value_print): Declare them.
3429 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
3431 * src/location.h (boundary): Note that a line or column equal
3432 to INT_MAX indicates an overflow.
3433 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
3434 (rule_length_overflow, increment_rule_length, add_column_width):
3436 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
3437 (<SC_BRACED_CODE>"}"):
3438 Use increment_rule_length rather than incrementing it by hand.
3439 (adjust_location, handle_syncline): Diagnose overflow.
3440 (handle_action_dollar, handle_action_at):
3441 Fix bug with monstrosities like $-2147483648.
3442 Remove now-unnecessary checks.
3443 (scan_integer): Verify assumptions and remove now-unnecessary checks.
3444 (convert_ucn_to_byte): Verify assumptions.
3445 (handle_syncline): New arg LOC. All callers changed.
3446 Don't store through a value derived from char const * pointer.
3448 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
3451 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
3453 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
3454 Remove unnecessary forward static decls.
3456 2005-12-27 Akim Demaille <akim@epita.fr>
3458 * src/reader.c (grammar_current_rule_check): Also check that $$
3460 Take the rule to check as argument, hence rename as...
3461 (grammar_rule_check): this.
3462 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
3464 (grammar_rule_begin, grammar_rule_end): these, for consistency.
3465 (grammar_midrule_action, grammar_symbol_append): Now static.
3466 * tests/torture.at (input): Don't rely on the default action
3467 being always performed.
3468 * tests/calc.at: "Set" $$ even when the action is "cut" with
3470 * tests/actions.at (Exotic Dollars): Instead of using unused
3471 values, check that the warning is issued.
3473 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
3475 * NEWS: Improve wording for unused-value warnings.
3477 2005-12-22 Akim Demaille <akim@epita.fr>
3479 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
3480 (b4_yysymprint_generate): Rename as...
3481 (b4_yy_symbol_print_generate): this.
3482 Generate yy_symbol_print instead of yysymprint.
3483 Generate also yy_symbol_value_print, and use it.
3485 2005-12-22 Akim Demaille <akim@epita.fr>
3487 * NEWS: Warn about unused values.
3488 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
3490 (symbol_list_n_get, symbol_list_n_used_set): New.
3491 (symbol_list_n_type_name_get): Use symbol_list_n_get.
3492 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
3493 * src/reader.c (grammar_current_rule_check): Check that values are
3495 * src/symtab.c (symbol_print): Accept 0.
3496 * tests/existing.at: Remove the type information.
3498 Remove useless actions (beware of mid-rule actions: perl -000
3499 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
3500 * tests/actions.at (Exotic Dollars): Use unused values.
3501 * tests/calc.at: Likewise.
3502 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3505 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
3508 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
3510 Undo 2005-12-01 tentative license wording change. The wording is
3511 still being reviewed by the lawyers, and we don't want to wait for
3512 them before publishing a test release. For now, revert to the
3514 * NEWS: Undo 2005-12-01 change.
3515 * data/glr.c: Revert to previous license wording.
3516 * data/glr.cc: Likewise.
3517 * data/lalr1.cc: Likewise.
3518 * data/location.cc: Likewise.
3519 * data/yacc.c: Likewise.
3521 * NEWS: Reword %destructor vs YYABORT etc.
3522 * data/glr.c: Use American spacing, for consistency.
3523 * data/glr.cc: Likewise.
3524 * data/lalr1.cc: Likewise.
3525 * data/yacc.c: Likewise.
3526 * data/yacc.c: Reformat comments slightly.
3527 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3528 for consistency. Fix some spelling errors and reword recently-included
3530 * tests/cxx-type.at: Cast results of malloc, for C++.
3532 2005-12-21 Joel E. Denny <address@hidden>
3534 * tests/cxx-type.at: Construct a tree, count the parents of shared
3535 nodes, and free each node once and only once. Previously, the memory
3536 for semantic values was leaked instead.
3538 2005-12-21 Joel E. Denny <address@hidden>
3540 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3541 (yylval, yylloc): If pure, #define to yystackp->yyval and
3542 yystackp->yyloc similar to yychar and yynerrs.
3543 (yyparse): If pure, remove local yylval and yylloc. Add local
3544 yystackp to accommodate pure definitions of yylval and yylloc.
3545 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3546 yylvalp and yyllocp to &yylval and &yylloc.
3547 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3548 namespace. Previously, nerrs and char were missing, but lval and lloc
3550 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3551 yylvalp and yyllocp parameters since, if pure, these are now always
3552 accessible through yystackp. If not pure, they are still accessible
3554 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3555 `if (YYID (N))' to pacify lint.
3557 2005-12-21 Akim Demaille <akim@epita.fr>
3559 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3560 destroy the RHS symbols of a rule.
3561 * data/yacc.c (yylen): Initialize to 0.
3562 Keep its value to the number of items to possibly shift.
3563 In particular, a regular successful parse that ends on YYFINAL by
3564 a (internal) YYACCEPT must not have yylen != 0.
3565 (yyerrorlab, yyreturn): Pop the RHS.
3566 Reorder a bit to emphasize the `shifting' bits of code.
3567 (YYPOPSTACK): Now accept a number of items to pop.
3568 * data/lalr1.cc: Likewise.
3569 * data/glr.c: Formatting changes.
3570 Use goto instead of fall through.
3571 * doc/bison.texinfo (Destructor Decl): Complete.
3573 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3575 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3576 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3577 * djgpp/config.bat: Replace every occurence of the file name
3578 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3579 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3580 * djgpp/config.sed: Replace every occurence of the file name
3581 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3582 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3583 * djgpp/djunpack.bat: DJGPP specific file.
3584 * djgpp/fnchange.lst: DJGPP specific file.
3585 * djgpp/README.in: Add new information about how to unpack the bison
3586 source on MSDOS and other systems which have 8.3 file name restrictions
3587 using djunpack.bat and fnchange.lst.
3589 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3591 * bootstrap (build_cvs_prefix): Remove; unused.
3592 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3593 when getting gnulib.
3595 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3597 * data/glr.c: Reorder typedef declarations for structs to match order
3598 of struct declarations.
3599 Rename yystack everywhere to yystackp except in yyparse where it's not
3601 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3603 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3604 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3605 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3608 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3610 * tests/sets.at (Accept): Fix typos in regular expression used to
3611 sed out the final state number.
3613 Work around portability problem on Solaris 10: flex-generated
3614 files include <stdio.h> before <config.h>, which messes up
3615 because the latter defines __EXTENSIONS__. Address the problem
3616 by creating two new little files that include <config.h> first,
3617 then include the flex-generated files. Rewrite everyone else
3618 to include <config.h> first, as well.
3619 * lib/timevar.c: Always include "config.h".
3620 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3621 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3622 (EXTRA_bison_SOURCES): New macro.
3623 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3624 * src/system.h: Don't include config.h.
3625 * src/LR0.c: Include <config.h> first.
3626 * src/assoc.c: Likewise.
3627 * src/closure.c: Likewise.
3628 * src/complain.c: Likewise.
3629 * src/conflicts.c: Likewise.
3630 * src/derives.c: Likewise.
3631 * src/files.c: Likewise.
3632 * src/getargs.c: Likewise.
3633 * src/gram.c: Likewise.
3634 * src/lalr.c: Likewise.
3635 * src/location.c: Likewise.
3636 * src/main.c: Likewise.
3637 * src/muscle_tab.c: Likewise.
3638 * src/nullable.c: Likewise.
3639 * src/output.c: Likewise.
3640 * src/parse-gram.y: Likewise.
3641 * src/print.c: Likewise.
3642 * src/print_graph.c: Likewise.
3643 * src/reader.c: Likewise.
3644 * src/reduce.c: Likewise.
3645 * src/relation.c: Likewise.
3646 * src/state.c: Likewise.
3647 * src/symlist.c: Likewise.
3648 * src/symtab.c: Likewise.
3649 * src/tables.c: Likewise.
3650 * src/uniqstr.c: Likewise.
3651 * src/vcg.c: Likewise.
3653 * src/parse-gram.y: Fix minor problems uncovered by lint.
3654 (current_lhs, current_lhs_location): Now static.
3655 (current_assoc): Remove unused variable.
3657 Cleanups so that Bison-generated parsers have less lint.
3658 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3659 Prepend /*ARGSUSED*/, for lint's sake.
3660 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3661 definition if 'lint' is defined.
3662 (YYID): New macro (or function, if lint).
3663 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3664 * data/yacc.c: Likewise.
3665 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3666 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3667 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3669 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3670 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3671 Use YYID(0) rather than 0, for lint.
3672 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3673 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3675 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3677 * tests/glr-regression.at
3678 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3679 Close memory leak reported by twlevo.
3681 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3683 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3685 (yyparse): Iterate another stack in order to call user destructors.
3686 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3688 (Duplicated user destructor for lookahead): This test now is expected
3691 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3693 * NEWS: Document the following change.
3694 * data/yacc.c: Say "parser skeleton" rather than "file", since
3695 it's no longer just a file.
3696 * data/glr.c: Grant a special exception for C GLR parsers, that
3697 reads like the already-existing exception for C LALR(1) parsers.
3698 * data/glr.cc: Likewise.
3699 * data/lalr1.cc: Likewise.
3700 * data/location.cc: Likewise.
3701 * data/yacc.c: Reword the "written by" statement to clarify that
3702 it was the parser skeleton, not the entire output file.
3703 * data/glr.c: Written by Paul Hilfinger.
3704 * data/glr.cc: Written by Akim Demaille.
3705 * data/lalr1.cc: Likewise.
3707 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3709 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3710 Fix typos in previous change that broke 'make check'.
3711 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3713 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3714 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3715 We can revert this once things settle down.
3717 * src/conflicts.c (conflicts_print): Don't print file name twice
3718 when %expect fails because there were no conflicts.
3719 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3721 * tests/conflicts.at (%expect not enough, %expect too much):
3722 (%expect with reduce conflicts): Adjust to new behavior.
3724 2005-11-18 Akim Demaille <akim@epita.fr>
3726 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3728 * NEWS: Document this.
3729 * doc/bison.texinfo (Expect Decl): Likewise.
3731 2005-11-16 Akim Demaille <akim@epita.fr>
3733 Generalize the display of semantic values and locations in traces.
3734 * data/glr.c (yy_reduce_print): Fix indices (again).
3735 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3737 * data/lalr1.cc (yyreduce_print): Rename as...
3738 (yy_reduce_print): this.
3739 Display values and locations.
3740 * data/yacc.c (yy_reduce_print): Likewise.
3741 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3742 (yysymprint): Move higher to be visible from yy_reduce_print).
3744 * tests/calc.at: Adjust the expected length of the traces.
3746 2005-11-14 Akim Demaille <akim@epita.fr>
3748 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3749 from 1 to N, while values and location start at 0.
3750 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3752 2005-11-14 Akim Demaille <akim@epita.fr>
3754 * data/glr.c (yy_reduce_print): Fix the $ number.
3756 2005-11-14 Akim Demaille <akim@epita.fr>
3758 "Use" parse parameters.
3759 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3760 * data/glr.c, data/glr.cc: Use them.
3761 * data/glr.c (YYUSE): Have a C++ definition that supports
3764 2005-11-14 Akim Demaille <akim@epita.fr>
3766 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3768 2005-11-14 Akim Demaille <akim@epita.fr>
3771 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
3773 2005-11-12 Akim Demaille <akim@epita.fr>
3775 Let position and location be PODs.
3776 * data/location.cc (position::initialize, location::initialize): New.
3777 (position::position, location::location): Define only if
3778 b4_location_constructors is defined.
3779 * data/lalr1.cc (b4_location_constructors): Define it for backward
3781 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3783 2005-11-12 Akim Demaille <akim@epita.fr>
3785 * data/lalr1.cc: Move the body of the ctor and dtor into the
3786 parser file (instead of the header).
3787 Wrap the implementations in a "namespace yy".
3789 2005-11-12 Akim Demaille <akim@epita.fr>
3791 Have glr.c include its header file when created.
3792 * data/glr.c (b4_shared_declarations): New.
3793 Output them verbatim in the parser if !%defines, otherwise
3794 output then in the header file, and include it instead.
3796 2005-11-11 Akim Demaille <akim@epita.fr>
3798 * data/glr.c: Comment changes.
3800 2005-11-11 Akim Demaille <akim@epita.fr>
3802 When yydebug, report semantic and location values for reductions.
3803 * data/glr.c (yy_reduce_print): Report the semantic values and the
3805 (YY_REDUCE_PRINT): Adjust.
3806 (yyglrReduce): Use them.
3807 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3808 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3809 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3812 2005-11-10 Akim Demaille <akim@epita.fr>
3814 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3815 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3816 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3818 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3820 * m4/cxx.m4, examples/Makefile.am: Don't build
3821 examples/calc++ if no C++ compiler is available. (trivial change)
3823 2005-11-09 Akim Demaille <akim@epita.fr>
3825 * src/scan-skel.l: Use a couple of asserts.
3827 2005-11-03 Akim Demaille <akim@epita.fr>
3829 In some (weird) cases, the final state number is incorrect.
3830 Reported by Alexandre Duret-Lutz.
3831 * src/LR0.c (state_list_append): Remove the computation of
3833 (save_reductions): Do it here.
3834 (get_state): Alpha conversion.
3835 (generate_states): Use a for loop.
3836 * src/gram.h (item_number_is_rule_number)
3837 (item_number_is_symbol_number): New.
3838 * src/state.c: Use assert.
3839 * src/system.h: Include assert.h.
3840 * tests/sets.at (Accept): New.
3842 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3844 * data/glr.c (yyfill): Adjust comment.
3845 (yyresolveAction): Initialize default location properly
3846 for empty right-hand sides.
3847 (yydoAction): Ditto.
3848 Add comment explaining apparently dead code.
3849 * tests/glr-regression.at
3850 (Incorrectly initialized location for empty right-hand side in GLR):
3853 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3855 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3856 gnulib when interrupted. This fixes some race conditions and
3857 works around some portability problems (one noted by Paul
3860 2005-10-22 Akim <akim@epita.fr>
3862 * Makefile.cfg: Adjust to config -> build-aux.
3865 2005-10-21 Akim Demaille <akim@epita.fr>
3867 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3869 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3870 * data/yacc.c (b4_Pure_if): Rename as...
3871 (b4_yacc_pure_if): this.
3872 (YY_SYMBOL_PRINT, yyparse): Adjust.
3873 * doc/bison.texinfo: Formatting changes.
3875 2005-10-21 Akim Demaille <akim@epita.fr>
3877 Finish the transition config -> build-aux.
3878 * configure.ac, Makefile.am: Use build-aux.
3879 * config/prev-version, config/announce-gen, config/Makefile.am:
3881 * build-aux/prev-version, build-aux/announce-gen,
3882 * build-aux/Makefile.am: here.
3884 2005-10-14 Akim Demaille <akim@epita.fr>
3886 * examples/calc++/test: Use set -x only when VERBOSE.
3888 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3890 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3891 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3893 2005-10-13 Akim Demaille <akim@epita.fr>
3895 * src/scan-skel.l: Output the base name parts of the parser and
3897 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
3899 Use this to exercise C++ outputs in subdirs.
3900 Reported by Oleg Smolsky.
3902 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3904 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3905 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3906 Problem reported by John P. Hartmann.
3907 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3910 2005-10-12 Akim Demaille <akim@epita.fr>
3912 * src/parse-gram.y (version_check): Exit 63 to please missing
3913 (stands for "version mismatch).
3914 * tests/input.at, doc/bison.texinfo: Adjust.
3916 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3918 Work around portability problems with Visual Age C compiler
3919 (xlc and xlC_r) reported by John P. Hartmann.
3920 * data/location.cc (initial_column, initial_line): Remove.
3921 All uses replaced by 0 and 1.
3922 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3923 that xlc complains about.
3924 * src/scan-skel.l (skel_wrap): Likewise.
3925 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
3927 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3928 __STDC_VERSION__. Use it everywhere instead of looking at
3929 __STDC__ and __cplusplus.
3931 2005-10-10 Akim Demaille <akim@epita.fr>
3933 * examples/calc++/test: Be quiet unless VERBOSE.
3935 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3937 * data/c.m4 (yydestruct, yysymprint):
3938 Use YYUSE instead of casting to void.
3939 * data/glr.c (YYUSE): New macro.
3940 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3941 Use it instead of rolling our own.
3942 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3944 Use /*CONSTCOND*/ to suppress lint warnings.
3945 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3946 (YY_STACK_PRINT): Use 'false' not '0'.
3948 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3949 * data/yacc.c (YYUSE): New macro.
3950 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3951 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3952 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3955 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3956 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3958 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3960 Undo the parts of the unlocked-I/O change that substituted
3961 putc or puts for printf. This might hurt performance a bit,
3962 but some people prefer the printf style.
3963 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3964 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3965 All uses replaced by YYFPRINTF and YYDPRINTF.
3966 * data/yacc.c: Likewise.
3967 * lib/bitset.c (bitset_print): Likewise.
3968 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3970 * lib/lbitset.c (debug_lbitset): Likewise.
3971 * src/closure.c (print_firsts, print_fderives): Likewise.
3972 * src/gram.c (grammar_dump): Likewise.
3973 * src/lalr.c (look_ahead_tokens_print): Likewise.
3974 * src/output.c (escaped_output): Likewise.
3975 (user_actions_output): Break apart two printfs.
3976 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3977 * src/reduce.c (reduce_print): Likewise.
3978 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3979 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3981 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3982 Use assignments rather than casts-to-void to suppress
3983 unused-variable warnings. This pacifies 'lint'.
3984 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3985 unused-variable warnings.
3987 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3989 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3991 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3993 Use unlocked I/O for a minor performance improvement on hosts like
3994 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3995 is to use the gnlib unlocked-io module, and to prefer putc and
3996 puts to printf when either will work (since the latter doesn't
3997 come in an unlocked flavor).
3998 * bootstrap (gnulib_modules): Add unlocked-io.
3999 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
4000 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
4001 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
4002 and similarly for puts and putc and printf.
4003 * data/yacc.c: Likewise.
4004 * lib/bitset.c (bitset_print): Likewise.
4005 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
4006 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
4008 * lib/lbitset.c (debug_lbitset): Likewise.
4009 * src/closure.c (print_firsts, print_fderives): Likewise.
4010 * src/gram.c (grammar_dump): Likewise.
4011 * src/lalr.c (look_ahead_tokens_print): Likewise.
4012 * src/output.c (escaped_output): Likewise.
4013 (user_actions_output): Coalesce two printfs.
4014 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
4015 * src/reduce.c (reduce_print): Likewise.
4016 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4017 * src/system.h: Include unlocked-io.h rather than stdio.h.
4019 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
4020 this confuses xgettext.
4022 2005-10-02 Akim Demaille <akim@epita.fr>
4024 * bootstrap (gnulib_modules): Add strverscmp.
4025 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
4026 * m4/.cvsignore: Add strverscmp.m4.
4027 * src/parse-gram.y (%require): New token, new rule.
4028 (version_check): New.
4029 * src/scan-gram.l (%require): Adjust.
4030 * tests/input.at (AT_REQUIRE): New.
4032 * doc/bison.texinfo (Require Decl): New.
4033 (Calc++ Parser): Use %require.
4035 2005-10-02 Akim Demaille <akim@epita.fr>
4037 * data/location.cc: New.
4039 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
4040 Akim Demaille <akim@epita.fr>
4042 Make sure -odir/foo.cc creates dir/location.hh etc.
4043 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
4044 (spec_file_prefix, spec_verbose_file, spec_graph_file)
4045 (spec_defines_file): Now const.
4047 (short_base_name): Remove.
4048 * src/files.c: Adjust.
4049 (dirname.h): Include.
4050 (base_name): Don't prototype it.
4051 (finput): Remove, duplicates gram_in.
4052 (full_base_name, short_base_name): Replace by...
4053 (all_but_ext, all_but_tab_ext): these.
4054 (compute_base_names): Rename as...
4055 (compute_file_name_parts): this.
4056 Update to compute the new variables, including dir_prefix.
4057 Adjust dependencies.
4058 * src/output.c (prepare): Output them.
4059 * src/reader.c: Adjust to use gram_in, not finput.
4060 * src/scan-skel.l (@dir_prefix@): New.
4062 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4064 * lib/subpipe.c: New function end_of_output_subpipe() added
4065 to allow support for non-posix systems. This is a no-op function
4068 * lib/subpipe.h: New function end_of_output_subpipe() added
4069 to allow support for non-posix systems. This is a no-op function
4072 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
4073 handle the lack of pipe/fork functionality on non-posix systems.
4075 * djgpp/Makefile.maint: DJGPP specific file.
4077 * djgpp/README.in: DJGPP specific file.
4079 * djgpp/config.bat: DJGPP specific configuration file.
4081 * djgpp/config.sed: DJGPP specific configuration file.
4083 * djgpp/config.site: DJGPP specific configuration file.
4085 * djgpp/config_h.sed: DJGPP specific configuration file.
4087 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
4089 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
4091 2005-10-02 Akim Demaille <akim@epita.fr>
4093 * data/location.cc: New, extract from...
4094 * data/lalr1.cc: here.
4095 (location.hh): Include it after the user prologue, in case the
4096 filename type is defined by the user.
4097 Forward declation location and position before the pre-prologue.
4098 (yyresult_): Rename as...
4099 (yyresult): this, it's a local variable, not an attribute.
4100 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
4102 2005-10-01 Akim Demaille <akim@epita.fr>
4104 * examples/extexi: Restore the #line generation.
4106 2005-09-30 Akim Demaille <akim@epita.fr>,
4107 Alexandre Duret-Lutz <adl@gnu.org>
4109 Move the token type and YYSTYPE in the parser class.
4110 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
4111 (parser::token): New, from the moved free definition of tokens.
4112 (parser::semantic_value): Now a full definition instead of an
4113 indirection to YYSTYPE.
4114 (b4_post_prologue): No longer included in the header file, but
4115 in the implementation file.
4116 * doc/bison.texi (C+ Language Interface): Update.
4117 * src/parse-gram.y: Support unary %define.
4118 * tests/actions.at: Define global_tokens_and_yystype for backward
4119 compatibility until we update the tests.
4120 * tests/calc.at: Idem.
4121 (first_line, first_column, last_line, last_column): Define for lalr1.cc
4122 to simplify the code.
4124 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
4126 Port to SunOS 4.1.4, which lacks strtoul and strerror.
4127 Ah, the good old days! Problem reported by Peter Klein.
4128 * bootstrap (gnulib_modules): Add strerror, strtoul.
4129 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
4130 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
4132 2005-09-29 Akim Demaille <akim@epita.fr>
4134 * data/c.m4 (b4_error_verbose_if): New.
4135 * data/lalr1.cc: Use it.
4136 (YYERROR_VERBOSE_IF): Remove.
4137 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
4138 parser members, replaced by...
4139 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
4141 (yysyntax_error_): Takes the state number as argument.
4142 (yyreduce_print_): Use the argument yyrule, not the former
4145 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
4147 * bootstrap (gnulib_modules): Add verify.
4148 * lib/.cvsignore: Add verify.h.
4149 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
4150 * src/system.h (verify): Remove.
4151 Include verify.h instead.
4152 * src/tables.c (tables_generate): Use new API for 'verify'.
4154 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
4156 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
4157 local variables whose names begin with 'yy'.
4158 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4159 Trivial changes from Joel E. Denny.
4161 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
4163 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
4164 don't use alloca any more.
4166 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
4167 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
4168 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
4169 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
4170 to match yacc.c, to test more hosts.
4172 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
4174 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
4175 doesn't affect behavior.
4176 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
4178 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
4179 This works a bit better with glibc, if user code has already included
4181 * doc/bison.texinfo (Bison Parser): Document that users can't
4182 arbitrarily use malloc and free for other purposes. Document
4183 that <alloca.h> and <malloc.h> might be included.
4184 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
4185 user must declare alloca.
4187 * HACKING (release): Forwarn the Translation Project about
4190 2005-09-20 Akim Demaille <akim@epita.fr>
4192 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
4194 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
4196 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
4197 (YYSTACK_ALLOC_MAXIMUM): Use it.
4198 (yysyntax_error): New function.
4199 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
4200 multiple syntax errors are reported, and alloca is being used.
4201 Instead, reallocate buffers twice as big each time, so that
4202 we waste at most half the allocated memory. Start with a small
4203 (128-byte) buffer that will suffice in most cases anyway.
4204 Use yysyntax_error to do most of the work.
4206 * doc/bison.texinfo (Error Reporting, Table of Symbols):
4207 yynerrs is the number of errors reported, not the number of
4210 * tests/glr-regression.at (Duplicated user destructor for lookahead):
4211 Mark it as expected to fail.
4212 Cast result of malloc; problem reported by twlevo@xs4all.nl.
4213 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
4214 Don't start user-code symbols with "yy", to avoid name space problems.
4216 2005-09-19 Akim Demaille <akim@epita.fr>
4218 Remove the traits, failed experiment.
4219 It never proved useful, and anyway because of the current
4220 definition, it was not possible to have several specialization of
4221 this traits, making it useless.
4222 * data/lalr1.cc (yy:traits): Remove.
4223 Inline its definitions in the parser class.
4225 2005-09-19 Akim Demaille <akim@epita.fr>
4227 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
4228 least Mac OSX with a /usr/local install of gettext.
4230 2005-09-19 Akim Demaille <akim@epita.fr>
4232 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
4233 and yytoken for similarity with the other skeletons.
4235 2005-09-19 Akim Demaille <akim@epita.fr>
4237 * NEWS, configure.ac: update version number to 2.1a.
4239 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
4241 * NEWS: Version 2.1.
4243 * NEWS: Remove notice of yytname change, since it was never in an
4245 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
4247 * src/output.c (prepare): Likewise.
4248 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
4249 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
4250 is not defined. This is an awful hack, but it's enough for now.
4251 All callers changed.
4252 * tests/glr-regression-at (make_value): Args are const pointers now,
4253 to avoid GCC warning.
4254 (Duplicated user destructor for lookahead): New test. Currently
4255 skipped. It fails on my host but I'm not sure it'll always fail.
4257 2005-09-16 Akim Demaille <akim@epita.fr>
4259 * src/symtab.h (struct symbol): Declare the printer and destructor
4260 as const, to avoid accidental calls to free.
4261 (symbol_destructor_set, symbol_printer_set): Adjust.
4262 * src/symtab.c: Adjust.
4264 2005-09-16 Akim Demaille <akim@epita.fr>
4266 * data/c.m4 (b4_token_enums): New.
4267 (b4_token_defines): Rename as...
4268 (b4_token_enums_defines): this.
4269 (b4_token_defines): New, output only the #defines.
4270 * data/yacc.c, data/glr.c: Adjust.
4271 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
4272 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
4275 2005-09-16 Akim Demaille <akim@epita.fr>
4277 * data/lalr1.cc (yylex_): Remove, inline its code.
4278 (yyreport_syntax_error_): Remove, replaced by...
4279 (yysyntax_error_): this which returns a string and leaves to the
4280 caller the call to the users' error function.
4281 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
4282 Move from members of the parser object...
4283 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
4284 to local variables of the parse function.
4286 2005-09-16 Akim Demaille <akim@epita.fr>
4288 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
4289 since it's in Bison's name space.
4291 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
4293 * data/glr.c (yyresolveValue): Add default case to pacify
4294 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
4296 * NEWS: Document when yyparse started to return 2.
4297 * doc/bison.texinfo (Parser Function): Document when yyparse
4300 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
4301 (b4_filename_type): Renamed back from b4_file_name_type. All uses
4303 (class position): file_name -> filename (reverting). All uses changed.
4305 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
4307 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
4308 do anything if $@ exists. This reverts part of the 2005-07-07
4311 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
4313 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
4314 contains obsolete information and isn't worth distributing as a
4315 separate file anyway.
4316 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
4317 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
4318 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
4319 (yyparse): Abort if user code uses longjmp to throw an unexpected
4322 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
4324 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
4325 Suggested by twlevo@xs4all.nl.
4327 * data/glr.c (YYCHK1): Do not assume YYE is in range.
4328 This avoids a diagnostic from gcc -Wswitch-enum.
4329 Problem reported by twlevo@xs4all.nl.
4331 * doc/bison.texinfo: Don't use "filename", as per GNU coding
4332 standards. Use "file name" or "file" or "name", depending on
4334 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
4335 not to hack/foo.tab.c.
4336 (Calc++ Top Level): 2nd arg of main is not const.
4337 * data/glr.c: b4_filename -> b4_file_name.
4338 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
4340 (class position): filename -> file_name. All uses changed.
4341 * data/yacc.c: b4_filename -> b4_file_name.
4342 * lib/bitset.h: filename -> file_name in local vars.
4343 * lib/bitset_stats.c: Likewise.
4344 * src/files.c: Likewise.
4345 * src/scan-skel.l ("@output ".*\n): Likewise.
4346 * src/files.c (file_name_split): Renamed from filename_split.
4347 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
4349 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
4351 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
4352 to accommodate latest gnulib.
4354 * tests/glr-regression.at (Duplicate representation of merged trees):
4355 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
4357 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
4360 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
4362 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
4363 All uses changed. Invoke user destructor after an error during a
4364 split parse (trivial change from Joel E. Denny).
4366 * tests/glr-regression.at
4367 (User destructor after an error during a split parse): New test case.
4368 Problem reported by Joel E. Denny in:
4369 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
4371 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
4373 * README-cvs: Give URLs for recommended tools.
4374 Mention Gzip version problem, and bootstrapping issues.
4375 Remove troubleshooting section, as it's somewhat obsolete.
4377 * bootstrap (no_cache): New var, to accommodate different wget
4378 variants. Use it instead of '-C off'. Problem reported by
4381 * data/glr.c (yydestroyStackItem): New function.
4382 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
4383 debugging information. Problem reported by Joel E. Denny.
4385 2005-08-25 Akim Demaille <akim@epita.fr>
4387 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
4389 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
4391 * data/glr.c (yyrecoverSyntaxError, yyreturn):
4392 Don't invoke destructor on unresolved entries.
4393 * tests/glr-regression.at
4394 (User destructor for unresolved GLR semantic value): New test case.
4395 Problem reported by Joel E. Denny in:
4396 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
4398 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
4400 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
4402 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
4403 lib-prefix.m4, po.m4.
4405 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
4406 in yydestruct diagnostic, since it might not be an error.
4407 Problem reported by Joel Denny near end of
4408 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4409 * data/lalr1.cc (yyerturn): Likewise.
4410 * data/yacc.c (yyreturn): Likewise.
4411 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
4413 * src/files.c: Remove obsolete FIXME comment.
4415 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
4416 with the other templates, and to fix bogus run-on messages such
4417 as the one reported at the end of
4418 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4419 All callers changed to avoid the newline.
4420 (yyprocessOneStack): Output two lines rather than one, to accommodate
4421 the above change. This changes the debug output format slightly.
4423 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
4424 reported by Joel E. Denny in
4425 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
4427 * tests/glr-regression.at (Duplicate representation of merged trees):
4428 New test, from Joel E. Denny in:
4429 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
4430 * THANKS: Add Joel E. Denny.
4432 * configure.ac (AC_INIT): Bump to 2.0c.
4434 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
4436 * NEWS: Version 2.0b.
4438 * Makefile.am (SUBDIRS): Put examples before tests, so that
4439 "make check" doesn't finish with "All 1 tests passed".
4441 * tests/regression.at (Token definitions): Don't rely on
4442 AT_PARSER_CHECK for data that contains backslashes. It currently
4443 uses 'echo', and 'echo' isn't portable if its argument contains
4444 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
4445 that the byte '\0xff' is not printable in the C locale; it is,
4446 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
4447 not printable, so use '\0x81' to test.
4449 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
4450 version of GCC, since the macro is used with non-GCC compilers.
4452 Fix core dump reported by Pablo De Napoli in
4453 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
4454 * tests/regression.at (Invalid inputs with {}): New test.
4455 * src/parse-gram.y (token_name): Translate type before using
4458 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
4459 the user's name space. All uses changed to __attribute__
4461 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
4462 Add __attribute__ ((__noreturn__)).
4464 * etc/clcommit: Remove. We weren't using it, and it failed
4465 "make maintainer-distcheck".
4466 * Makefile.maint: Merge from coreutils.
4467 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
4468 (syntax-check-rules): Change list of rules as described below.
4469 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
4470 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
4471 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
4472 (sc_trailing_space): New rules.
4473 (sc_xalloc_h_in_src): Remove.
4474 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
4475 (sc_space_tab, sc_error_exit_success, sc_changelog):
4476 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
4477 (makefile-check, po-check, author_mark_check):
4478 (makefile_path_separator_check, copyright-check):
4479 Use grep -n, to make it easier to find violations.
4480 Use CVS_LIST and CVS_LIST_EXCEPT.
4481 (header_regexp, h_re): Remove.
4483 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
4484 (my-distcheck): Use more-modern GCC flags.
4485 (signatures, %.asc): Remove.
4486 (rel-files, announcement): Remove signatures.
4487 Restore old updating code, even though we don't use it, so
4488 that we're the same as coreutils.
4489 (alpha, beta, major): Depend on news-date-check.
4490 Make the upload commands.
4492 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
4493 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
4494 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
4495 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
4496 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
4497 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
4498 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
4499 * tests/sets.at: Likewise.
4501 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
4502 we comment out the Autoconf version number.
4503 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
4504 it's error-prone and "make maintainer-distcheck" rejects it.
4506 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
4507 Indent calls to "error" to pacify "make maintainer-distcheck",
4508 when the calls are not intended to be translated.
4509 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
4511 * src/Makefile.am (DEFS): Use +=, to pacify
4512 "make maintainer-distcheck".
4513 (bison_SOURCES): Add scan-skel.h.
4514 (sc_tight_scope): New rule, from coreutils.
4516 * src/files.c (src_extension, header_extension):
4517 Now static, not extern.
4518 * src/getargs.c (short_options): Likewise.
4519 * src/muscle_tab.c (muscle_table): Likewise.
4520 * src/parse-gram.y (current_class, current_type, current_prec):
4522 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4523 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4524 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4525 void, to avoid warning when NLS is disabled.
4526 * src/output.c: Include scan-skel.h.
4527 (scan_skel): Remove decl, since scan-skel.h does this.
4529 Indent calls to "error" to pacify "make maintainer-distcheck".
4530 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4531 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4532 "make maintainer-distcheck".
4533 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4534 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4535 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4536 (skel_lex_destroy, scan_skel): Move these decls to...
4537 * src/scan-skel.h: New file.
4538 * src/uniqstr.c (uniqstr_assert):
4539 Indent calls to "error" to pacify "make maintainer-distcheck".
4541 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4544 * tests/torture.at: Revamp to avoid misuse of atoi that
4545 "make maintainer-distcheck" complained about.
4547 * examples/extexi (message): Don't print a message more than once,
4548 and omit line-number decoration that makes Emacs compile think
4549 that informative messages are worth worrying about.
4551 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4553 * configure.ac: Update version number.
4555 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4557 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4558 autogenerated by the maintainer.
4559 * examples/calc++/.cvsignore: Add *.yy.
4561 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4562 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4563 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4565 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4567 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4568 from maintainer-distcheck about casting the argument of 'free'.
4570 * NEWS: Mention recent yytname changes.
4571 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4573 * bootstrap: For translations that have not yet been upgraded to
4574 the new runtime-po domain, prime the pump by extracting the
4575 relevant strings from the obsolete translations. This code can be
4576 removed once the bison-runtime domain has been translated by each
4579 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4580 now that token names are already quoted.
4582 Fix problem reported by Anthony Heading.
4583 * data/glr.c (YYTOKEN_TABLE): New macro.
4584 (yytname): Define if YYTOKEN_TABLE.
4585 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4586 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4587 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4588 * src/output.c (prepare_symbols): Output token_table_flag.
4590 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4592 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4593 again if the first call fails.
4595 * data/glr.c (yytnamerr): New function.
4596 (yyreportSyntaxError): Use it to dequote most string literals.
4597 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4598 with other skeletons. All uses changed.
4599 (yytnameerr_): New function.
4600 (yyreport_syntax_error): Use it to dequote most string literals.
4601 * data/yacc.c (yytnamerr): New function.
4602 (yyerrlab): Use it to decode most string literals.
4603 * doc/bison.texinfo (Decl Summary, Calling Convention):
4604 Clarify quoting convention of yytname.
4605 * src/output.c (prepare_symbols): Quote all names. This undoes
4606 the 2005-04-17 change, which is now accomplished (mostly) via
4607 changes in the parsers as described above.
4608 * tests/regression.at (Token definitions, Web2c Actions):
4609 Undo most 2005-04-17 change here, too.
4611 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4613 Fix more problems reported by twlevo@xs4all.nl.
4614 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4615 remove trailing spaces. This loses the exit status of ./types,
4616 and isn't needed since ./types shouldn't be emitting trailing
4618 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4619 as the stack isn't valid in that case.
4621 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4622 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4623 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4624 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4626 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4627 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4628 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4631 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4632 overly-picky compilers that reject 'char *foo = "bar";'.
4634 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4635 to FILE * parameter, not to stderr. This fixes a typo introduced
4636 in the 2005-07-12 change.
4638 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4639 warnings from GCC 4.
4641 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4642 (yyglrShiftDefer, yysplitStack):
4643 Remove unused parameters b4_pure_formals. All uses changed.
4644 (yyglrShift): Remove unused parameters b4_user_formals.
4646 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4648 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4650 Destructor cleanups and regularization among the three skeletons.
4651 * NEWS: Document the behavior changes.
4652 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4653 stack before failing, as the cleanup code will do it for us now.
4654 * data/lalr1.cc (yyerrlab): Likewise.
4655 * data/glr.c (yyparse): Pop everything off the stack before
4656 freeing it, so that destructors get called properly.
4657 * data/lalr1.cc (yyreturn): Likewise.
4658 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4659 This is more consistent.
4660 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4661 why destructors might be called. 1.875 -> 2.1.
4662 (Destructor Decl, Decl Summary, Table of Symbols):
4663 Some English-language cleanups for %destructor.
4664 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4665 Add output line for destructor of start symbol.
4666 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4667 because of that same extra output line.
4669 * NEWS: Document minor wording changes in diagnostics of
4670 Bison-generated parsers.
4671 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4672 Remove unused formals. All uses changed.
4673 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4674 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4675 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4676 Rename yyoverflowab to yyexhaustedlab.
4677 When memory exhaustion occurs during syntax-error reporting,
4678 report it separately rather than in a single diagnostic; this
4680 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4681 (Memory Exhausted): Renamed from Parser Stack Overflow.
4682 Revamp wording slightly to prefer "memory exhaustion".
4683 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4685 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4687 Add i18n support to the GLR skeleton. Partially fix the C++
4688 skeleton; a C++ expert needs to finish this. Remove debugging
4689 msgids; there's little point to having them translated, since they
4690 can be understood only by someone who can read the
4691 (English-language) source code.
4693 Generate runtime-po/bison-runtime.pot automatically, so that we
4694 don't have to worry about garbage getting in that file. We'll
4695 make sure after the next official release that old msgids don't
4697 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4699 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4701 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4702 Fix typos in explanations of the runtime file.
4703 * bootstrap: Change gettext keyword from YYI18N to YY_.
4704 Use standard Makefile.in.in in runtime-po, since we'll arrange
4705 for backward-compatible bison-runtime.po files in a different way.
4706 * data/glr.c (YY_): New macro, from yacc.c.
4707 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4708 Translate messages intended for users.
4709 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4710 the wording in the other skeletons. We don't know that the memory
4712 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4713 Use same method that yacc.c uses.
4714 Don't translate debugging messages.
4715 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4716 it doesn't work (yet), and requires C++ expertise to fix.
4717 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4718 Move defn to a more logical place, to be consistent with other
4720 Don't translate debugging messages.
4721 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4722 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4723 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4724 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4726 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4727 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4729 * tests/glr-regression.at (Badly Collapsed GLR States):
4731 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4732 yylex should return 0 at EOF rather than aborting.
4734 Improve tests for stack overflow in GLR parser.
4735 Problem reported by twlevo@xs4all.nl.
4736 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4738 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4739 can handle the problem.
4740 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4741 (yyparse): New local variable yyresult to record the result.
4742 Use result of setjmp to set it, rather than storing itinto
4744 (yyDone): Remove label.
4745 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4746 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4747 if YYABORT is used).
4748 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4749 yyparse status; put status > 1 into diagnostic.
4750 Check that status==2 works.
4751 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4752 Use exit status 3 for failure to open (which shouldn't happen).
4754 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4756 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4757 1 on syntax error; just let yyparse do its thing.
4758 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4759 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4760 (Exploding the Stack Size with Alloca):
4761 (Exploding the Stack Size with Malloc):
4762 Expect exit status 2, not 1, since the parser is supposed to blow
4763 its stack. Problem reported by twlevo@xs4all.nl.
4765 * data/glr.c (yyparse): Don't assume that the initial calls
4766 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4767 Print a stack-overflow message and fail instead.
4768 Initialize the line-number information before creating the stack,
4769 so that the stack-overflow message can report line zero safely.
4771 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4773 Fix problems reported by twlevo@xs4all.nl.
4774 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4775 (yyuserMerge): Provide a default case if b4_mergers is empty.
4776 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4777 * tests/glr-regression.at
4778 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4779 Add casts to pacify C++ compilers.
4780 * tests/glr-regression.at (Improper merging of GLR delayed action
4781 sets): Declare yylex before using it.
4782 * tests/Makefile.am (maintainer-check-g++): Fix a stray
4783 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4784 test for valgrind; valgrind is independent of g++.
4785 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4786 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4787 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4788 Use a destructor, so that we can expand the stack. Change
4789 YYSTYPE to char * so that we can free it. Cast result of malloc.
4791 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4793 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4794 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4796 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4798 * PACKAGING: New file, suggested by Bruno Haible and taken from
4799 similar wording in gettext's PACKAGING file.
4800 * NEWS: Mention PACKAGING.
4801 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4803 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4805 * NEWS: Document recent i18n improvements.
4806 * bootstrap: Get runtime translations into runtime-po.
4807 Create runtime-po files automatically, if possible.
4808 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4809 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4810 does not infringe on the user's name space.
4811 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4812 * doc/bison.texinfo (Internationalization): Revamp the English
4813 and Texinfo syntax a bit, to try to make it clearer.
4814 (Bison Options, Option Cross Key): Mention --print-localedir.
4815 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4816 YYENABLE_NLS. Quote a bit more.
4817 * runtime-po/.cvsignore: New file.
4818 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4819 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4820 * runtime-po/quot.sed: Likewise.
4821 * runtime-po/boldquot.sed: Likewise.
4822 * runtime-po/en@quot.header: Likewise.
4823 * runtime-po/en@boldquot.header: Likewise.
4824 * runtime-po/insert-header.sin: Likewise.
4825 * runtime-po/remove-potcdate.sin: Likewise.
4826 * runtime-po/Makevars: Likewise.
4827 * runtime-po/LINGUAS: Likewise.
4828 * runtime-po/de.po: Likewise; we will rely on the translation project
4829 to maintain this, so "bootstrap" should get it.
4830 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
4832 * src/main.c (main): Bind the bison-runtime domain, too.
4834 2005-07-12 Bruno Haible <bruno@clisp.org>
4836 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4837 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4838 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4839 * runtime-po: New directory.
4840 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4841 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4842 * runtime-po/Rules-quot: New file, copied from po/.
4843 * runtime-po/quot.sed: Likewise.
4844 * runtime-po/boldquot.sed: Likewise.
4845 * runtime-po/en@quot.header: Likewise.
4846 * runtime-po/en@boldquot.header: Likewise.
4847 * runtime-po/insert-header.sin: Likewise.
4848 * runtime-po/remove-potcdate.sin: Likewise.
4849 * runtime-po/Makevars: New file.
4850 * runtime-po/POTFILES.in: New file.
4851 * runtime-po/LINGUAS: New file.
4852 * runtime-po/bison-runtime.pot: New file.
4853 * runtime-po/de.po: New file.
4854 * m4/bison.m4: New file.
4855 * Makefile.am (SUBDIRS): Add runtime-po.
4856 (aclocaldir, aclocal_DATA): New variables.
4857 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4859 * src/getargs.c (usage): Document --print-localedir option.
4860 (PRINT_LOCALEDIR_OPTION): New enum item.
4861 (long_options): Add --print-localedir option.
4862 (getargs): Handle --print-localedir option.
4863 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4864 (Internationalization): New section.
4866 2005-07-12 Akim Demaille <akim@epita.fr>
4868 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4869 for consistency with the rest of the code.
4870 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4873 2005-07-12 Akim Demaille <akim@epita.fr>
4875 * src/parse-gram.y: Use %printer instead of YYPRINT.
4877 2005-07-12 Akim Demaille <akim@epita.fr>
4879 * src/symtab.h, src/symtab.c (symbol_print): New.
4880 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4881 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4883 2005-07-12 Akim Demaille <akim@epita.fr>
4885 * data/glr.c (b4_syncline): Fix (swap) the definitions of
4886 b4_at_dollar and b4_dollar_dollar.
4888 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4890 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4891 and Pennello's paper.
4893 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4895 * data/yacc.c (yyparse): Undo previous patch. Instead,
4896 set yylsp[0] and yyvsp[0] only if the initial action
4897 sets yylloc and yylval, respectively.
4899 * data/yacc.c (yyparse): In the initial action, set
4900 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4901 This avoids the use of undefined variables if the initial
4902 action does not set yylloc and/or yylval.
4904 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4906 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4907 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4908 Remove from CVS. These files are automatically generated.
4909 * examples/extexi: Clarify that this file is now part of Bison,
4910 not GNU M4, and that it works with any POSIX-compatible Awk.
4911 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4912 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4913 so that we also get calc++-parser.yy. Geneate it.
4914 Use $(AWK), not gawk, since any conforming Awk will do.
4915 Put comment before action, since older 'make' can't handle comment
4917 $(BUILT_SOURCES): List all built sources, not just some of them.
4918 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4919 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4920 $($(calc_sources_generated)): Remove unnecessary test for existence
4921 of target. (This had a shell syntax error anyway; a stray "x".)
4922 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4924 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4926 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4927 implied by the other modules.
4929 2005-07-06 Akim Demaille <akim@epita.fr>
4931 Bind examples/calc++ to the package.
4932 * examples/calc++/Makefile: Remove, replaced by...
4933 * examples/calc++/Makefile.am: ... this new file.
4934 * examples/calc++/test: Remove input.
4935 * examples/calc++/compile: Remove.
4936 * examples/Makefile.am: New.
4937 * configure.ac, Makefile.am: Adjust.
4938 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4940 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4942 * data/glr.c (yyFail): Drastically simplify; since the format argument
4943 never had any % directives, we can simply pass it to yyerror.
4944 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4945 be modified later, as that is the usual style in glr.c.
4946 Problems reported by Paul Hilfinger.
4948 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4949 and size overflow errors.
4950 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4951 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4952 (YYSIZEMAX): New macro.
4953 (yystpcpy): New function, taken from yacc.c.
4954 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4955 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4956 so that we don't have to maintain their signatures.
4957 (yyFail): Check for buffer overflow, by using vsnprintf rather
4958 than vsprintf. Allocate a bigger buffer if possible.
4959 Report an error if buffer allocation fails.
4960 (yyStackOverflow): New function.
4961 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4962 the initialization was successful. It might fail if storage was
4964 (yyexpandGLRStack): Add more checks for storage allocation failure.
4965 Use yyStackOverflow to report failures.
4966 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4967 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4968 Don't assume stack number fits in int.
4969 (yysplitStack): Check for storage allocation failure.
4970 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4971 can print diagnostics on storage allocation failure. All callers
4973 (yyresolveValue): Use yybool for boolean.
4974 (yyreportSyntaxError): Check for size-calculation overflow.
4975 This code is taken from yacc.c.
4976 (yyparse): Check for storage allocation errors when allocating
4979 2005-07-05 Akim Demaille <akim@epita.fr>
4981 Extract calc++ from the documentation.
4982 * doc/bison.texinfo (Calc++): Add the extraction marks.
4983 * examples/extexi: New, from the aborted GNU Programming 2E.
4984 Separate the different paragraph of a file with empty lines.
4985 * examples/Makefile: Use it to extract the whole calc++ example.
4987 2005-06-24 Akim Demaille <akim@epita.fr>
4989 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4992 2005-06-22 Akim Demaille <akim@epita.fr>
4994 * doc/bison.texinfo (C++ Language Interface): First stab.
4995 (C++ Parsers): Remove.
4997 2005-06-22 Akim Demaille <akim@epita.fr>
4999 * data/lalr1.cc (yylex_): Honor %lex-param.
5001 2005-06-22 Akim Demaille <akim@epita.fr>
5003 Start a set of simple examples.
5004 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
5005 * examples/calc++/calc++-driver.hh,
5006 * examples/calc++/calc++-parser.yy,
5007 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
5008 * examples/calc++/compile, examples/calc++/test: New.
5010 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
5012 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
5013 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
5014 which stems from the 2005-05-27 patch.
5016 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5018 * data/glr.c: Modify treatment of unused parameters to permit use
5019 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
5021 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
5023 Fix infringement on user name space reported by Janos Zoltan Szabo.
5024 * data/yacc.c (yyparse): strlen -> yystrlen.
5026 2005-05-30 Akim Demaille <akim@epita.fr>
5028 * data/lalr1.cc (_): New.
5029 Translate the various messages.
5031 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
5033 Fix infringement on user name space reported by Bruno Haible.
5034 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
5035 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
5036 the user's name space.
5037 (alloca): Include <stdlib.h> to get it, if it's not built in.
5038 (YYMALLOC, YYFREE): Define only if needed.
5039 (malloc, free): Declare, but only if needed, as this infringes on
5040 the user name space.
5042 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
5044 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
5045 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
5047 * lib/ebitset.c (min, max): Undef before defining.
5048 * lib/vbitset.c (min, max): Likewise.
5049 * lib/subpipe.c (create_subpipe): Save local variables in case
5050 vfork clobbers them.
5052 2005-05-24 Bruno Haible <bruno@clisp.org>
5054 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
5055 error message syntax used by gcc-4.0.
5057 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
5059 * README: Mention m4 1.4.3. Remove obsolete advice about
5060 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
5062 * bootstrap: Remove workaround for problem I encountered with
5063 gettext 0.14.1; it seems to be fixed now.
5065 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
5067 * NEWS: Version 2.0a.
5069 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
5070 the previous change.
5072 Various maintainer cleanups.
5073 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
5074 conftest*, for benefit of CVS commands run at the same time as
5075 "configure". Add build-aux, since "bootstrap" now creates it and
5077 * Makefile.cfg (move_if_change): Remove.
5078 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
5079 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
5080 (po_repo, do-po-update, po-update, wget_files, get-targets):
5081 (config.guess-url_prefix, config.sub-url_prefix):
5082 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
5083 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
5084 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
5086 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
5087 this is now the recommended name.
5088 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
5089 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
5090 ylwrap. These files now go into build-aux.
5091 * config/move-if-change: Remove.
5092 * config/prev-version.txt: Bump from 1.75 to 2.0.
5094 * bootstrap: Add stdio-safer, unistd-safer modules.
5095 Remove m4/glibc2.m4 (introduced by latest gnulib, but
5097 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
5098 fopen-safer.c, stdio-safer.h, unistd-safer.h.
5099 * lib/subpipe.c: Include "unistd-safer.h".
5100 (create_subpipe): Make sure all the newly-created
5101 file descriptors are > 2, so that diagnostics don't
5102 get sent down them (which might cause Bison to hang, in theory).
5103 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
5104 * src/files.c (xfopen): Use fopen_safer, not fopen.
5106 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
5107 yesterday's yacc.c fix.
5109 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
5111 * data/glr.c, data/lalr1.cc: Update copyright date.
5113 Fix a destructor bug reported by Wolfgang Spraul in
5114 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
5115 * data/yacc.c (yyabortlab): Don't call destructor, and
5116 don't set yychar to EMPTY.
5117 (yyoverflowlab): Don't call destructor.
5118 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
5119 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
5120 since we no longer output the message "discarding lookahead token
5123 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5125 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
5126 fix a small glitch in debugging output.
5127 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
5128 after YY_SYMBOL_PRINT where needed.
5130 (struct yyGLRState): Add some comments.
5131 (struct yySemanticOption): Add some comments.
5132 (union yyGLRStackItem): Add comment.
5134 (yymergeOptionSets): Correct this to properly perform the union,
5135 avoiding infinite reported by Michael Rosien.
5138 * tests/glr-regression.at: Add test for GLR merging error reported
5141 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
5143 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
5144 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
5145 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
5146 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
5147 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
5148 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
5149 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
5150 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
5151 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
5152 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
5153 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
5154 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
5155 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
5156 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
5157 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
5158 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
5159 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
5160 src/derives.h, src/files.c, src/files.h, src/getargs.c,
5161 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
5162 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
5163 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
5164 src/output.h, src/parse-gram.c, src/parse-gram.h,
5165 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
5166 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
5167 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
5168 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
5169 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
5170 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
5171 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
5172 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
5173 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
5174 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
5175 tests/reduce.at, tests/regression.at, tests/sets.at,
5176 tests/synclines.at, tests/testsuite.at, tests/torture.at:
5177 Update FSF postal mail address.
5179 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
5181 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
5182 Problem reported by Ralf Menzel.
5184 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
5186 * tests/actions.at: Test that stack overflow invokes destructors.
5187 From Marcus Holland-Moritz.
5188 * data/yacc.c (yyerrlab): Move the code that destroys the stack
5190 (yyreturn): to here. That way, destructors are called properly
5191 even if the stack overflows, or the user calls YYACCEPT or
5192 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
5193 (yyoverflowlab): Destroy the lookahead.
5195 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
5197 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
5199 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
5201 * NEWS: Bison-generated C parsers no longer quote literal strings
5202 associated with tokens.
5203 * src/output.c (prepare_symbols): Don't escape strings,
5204 since users don't want to see C escapes.
5205 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
5207 * tests/input.at (Torturing the Scanner): Likewise.
5208 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
5210 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
5212 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
5213 the data size is known to be too small and we can't increase it.
5214 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
5216 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
5218 * src/parse-gram.y: Include quotearg.h.
5219 (string_as_id): Quote $1 before using it as a key, since the
5220 lexer no longer quotes it for us.
5221 (string_content): Don't strip quotes, since lexer no longer
5223 * src/scan-gram.l: Include quotearg.h.
5225 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
5226 a key, since the rest of the lexer doesn't quote it.
5227 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
5228 * tests/regression.at (Token definitions): Check for backslashes
5231 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
5232 (YYSIZE_T): Define to unsigned long int when using an older compiler.
5233 (yyparse): Revamp code to generate long syntax error message, to
5234 make it easier to translate, and to avoid problems with arithmetic
5235 overflow. Change "virtual memory" to "memory" in diagnostic, since
5236 we don't know whether the memory is virtual.
5238 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
5240 * NEWS: Bison-generated C parsers now use the _ macro to
5242 * data/yacc.c (_) [!defined _]: New macro.
5243 All English strings wrapped inside this macro.
5244 * doc/bison.texinfo (Bison Parser): Document _.
5245 * po/POTFILES.in: Include src/parse-gram.c, since it now
5246 includes translateable strings that parse-gram.y doesn't.
5248 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
5250 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
5251 reverting the 2004-10-11 change to this function.
5252 (symbol_check_alias_consistency): Don't call symbol_type_set
5253 if the type name is already correct.
5254 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
5256 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
5258 * tests/regression.at (Token definitions): Don't use a token named
5259 c, as that generates a "#define c ..." that runs afoul of buggy
5260 stdlib.h that uses the identifier c as a member of struct
5261 drand48_data. Problem reported by Horst Wente.
5263 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
5265 * bootstrap: Change translation URL from
5266 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
5267 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
5268 redirection glitches. Problem reported by twlevo@xs4all.nl.
5270 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
5272 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
5273 after operands; POSIX says this isn't portable for the c99 command.
5275 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
5277 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
5278 immediately if a data overrun has occurred; this may help us track
5279 down what may be a spurious failure on MacOS.
5281 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
5283 Respond to problems reported by twlevo@xs4all.nl.
5285 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
5287 * src/vcg.h: Comment fix.
5288 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
5289 (G_CMAX): Change to -1 instead of INT_MAX.
5291 * data/yacc.c (yyparse): Omit spaces before #line.
5293 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
5295 * src/tables.c (state_number_to_vector_number): Put it inside an
5296 "#if 0", since it's not currently used. Problem reported by
5299 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
5301 * src/output.c (escaped_output): Renamed from
5302 escaped_file_name_output, since we now use it for symbol tags as
5303 well. All uses changed.
5304 (symbol_destructors_output, symbol_printers_output):
5305 Escape symbol tags too.
5306 Problem reported by Matyas Forstner in
5307 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
5309 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
5311 * src/output.c (user_actions_output, token_definitions_output,
5312 symbol_destructors_output, symbol_printers_output): Likewise.
5313 * src/reader.c (prologue_augment): Likewise.
5314 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
5316 * src/vcg.c (output_edge): Don't quote linestyle arg.
5317 Problem reported by twlevo@xs4all.nl.
5319 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
5321 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
5322 example, reported by Derek M Jones. Also, make the example even
5323 more outrageous, to better illustrate how bad the problem is.
5325 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
5327 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
5328 putsym. Typo reported by Sebastian Piping.
5330 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
5332 * doc/bison.texinfo (Language and Grammar): some -> same
5333 (Epilogue): int he -> in the
5334 Typos reported by Sebastian Piping via Justin Pence.
5336 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
5338 * tests/glr-regression.at (Improper handling of embedded actions
5339 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
5340 embedded actions and $-N in GLR parsers", work around an Autoconf bug
5341 with dollar signs in test names.
5342 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
5343 for a similar reason.
5345 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
5347 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
5348 wants to redefine G_VIEW.
5350 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
5352 * src/vcg.c (get_view_str): Remove case for normal_view.
5353 Problem reported by twlevo@xs4all.nl.
5355 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
5357 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
5358 Problem reported by twlevo@xs4all.nl.
5360 * doc/bison.texinfo: Change @dircategory from "GNU programming
5361 tools" to "Software development". Requested by Richard Stallman
5364 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
5366 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
5367 Problem reported by twlevo@xs4all.nl.
5369 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
5371 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
5372 keyword; it's not needed with modern compilers, and it doesn't
5373 affect correctness with older compilers. Suggested by
5376 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
5378 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
5379 gcc -Wswitch-default.
5380 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
5381 * data/yacc.c (yyparse): Likewise.
5383 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
5385 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
5386 already. Let config.h define any nonstandard values.
5388 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
5390 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
5391 for the benefit of slower hosts. Problem reported by
5394 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
5396 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
5397 being defined and not used.
5398 * data/lalr1.cc (yyparse): Likewise.
5399 Use "if (false)" rather than "if (0)".
5401 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
5403 * TODO: Mention that we should allow NUL bytes in tokens.
5405 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
5407 * src/scan-skel.l (<<EOF>>): Don't close standard output.
5408 Problem reported by Hans Aberg.
5410 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
5412 * src/getargs.c (version): Happy new year; update overall
5413 program copyright date from 2004 to 2005.
5415 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
5416 Problem reported by Hans Aberg.
5417 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
5418 (Output file names.): Add a test for the case when standard output
5421 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
5423 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
5424 to fix an oversight in the Bison 2.0 manual.
5426 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
5428 * NEWS: Version 2.0. Reformat the existing news items since
5429 1.875, so that related items are grouped together.
5430 * configure.ac (AC_INIT): Bump version to 2.0.
5431 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
5433 * tests/torture.at (Exploding the Stack Size with Alloca): Set
5434 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
5435 otherwise, we're not testing alloca. Unfortunately there's no
5436 simple way to consult HAVE_ALLOCA here.
5438 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
5441 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
5442 hand. This avoids a warning about comparing int to size_t when
5443 GCC warnings are enabled.
5445 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
5447 * NEWS: Bison-generated parsers no longer default to using the
5448 alloca function (when available) to extend the parser stack, due
5449 to widespread problems in unchecked stack-overflow detection.
5450 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
5451 responsibility to set it to a positive value. This lets the user
5452 specify a value that is not a preprocessor constant.
5453 * data/yacc.c (YYMAXDEPTH): Likewise.
5454 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
5455 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
5456 to be a compile-time constant. However, explain the constraints on it.
5457 Also, explain the constraints on YYINITDEPTH.
5458 (Table of Symbols): Explain that alloca is no longer the default.
5459 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
5462 * doc/bison.texinfo (Location Default Action): Mention that n must
5463 be zero when k is zero. Suggested by Frank Heckenbach.
5465 2004-12-22 Akim Demaille <akim@epita.fr>
5467 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
5468 (parser::state_type, parser::semantic_type, parser::location_type):
5469 Private, not public.
5470 (parser::parse): Return ints, not bool.
5471 Returning a bool introduces a problem: 0 corresponds to false, and
5472 it seems weird to return false on success. Returning true changes
5473 the conventions for yyparse.
5474 Alternatively we could return void and send an exception.
5475 There is no clear consensus (yet?).
5476 (state_stack, semantic_stack, location_stack): Rename as...
5477 (state_stack_type, semantic_stack_type, location_stack_type): these.
5478 Private, not public.
5479 * tests/c++.at: New.
5480 * tests/testsuite.at, tests/Makefile.am: Adjust.
5482 2004-12-21 Akim Demaille <akim@epita.fr>
5484 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
5486 2004-12-21 Akim Demaille <akim@epita.fr>
5488 Don't impose std::string for filenames.
5490 * data/lalr1.cc (b4_filename_type): New.
5491 (position::filename): Use it.
5492 (parser.hh): Move the inclusion of stack.hh and location.hh below
5493 the user code, so that needed headers for the filename type can be
5495 Forward declare them before the user code.
5496 * tests/Makefile.am (check-local, installcheck-local): Pass
5497 TESTSUITEFLAGS to the TESTSUITE.
5499 2004-12-20 Akim Demaille <akim@epita.fr>
5501 Use more STL like names: my_class instead of MyClass.
5503 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
5504 (SemanticStack, SemanticType, StateStack, StateType)
5505 (TokenNumberType, Stack, Slice, Traits, Parser::location)
5506 (Parser::value): Rename as...
5507 (location_stack, location_type, rhs_number_type, semantic_stack)
5508 (semantic_type, state_stack, state_type, token_number_type, stack)
5509 (slice, traits, parser::yylloc, parser::yylval): these.
5511 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
5513 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5515 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
5516 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5518 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5520 Remove uses of 'short int' and 'unsigned short int'. This raises
5521 some arbitrary limits. It uses more memory but nowadays that's
5522 not much of an issue.
5524 This change does not affect the generated parsers; that's a different
5525 task, as some users will want to conserve memory there.
5527 Ideally we should use size_t to represent all object counts, and
5528 something like ptrdiff_t to represent signed differences of object
5529 counts; but that will require more code-cleanup than I have the
5530 time to do right now.
5532 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5533 Use size_t, not int or short int, to count objects.
5534 * src/closure.c (nritemset, closure): Likewise.
5535 * src/closure.h (nritemset, closure): Likewise.
5536 * src/nullable.c (nullable_compute): Likewise.
5537 * src/print.c (print_core): Likewise.
5538 * src/print_graph.c (print_core): Likewise.
5539 * src/state.c (state_compare, state_hash): Likewise.
5540 * src/state.h (struct state): Likewise.
5541 * src/tables.c (default_goto, goto_actions): Likewise.
5543 * src/gram.h (rule_number, rule): Use int, not short int.
5544 * src/output.c (prepare_rules): Likewise.
5545 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5546 errs, reductions): Likewise.
5547 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5549 * src/tables.c (vector_number, tally, action_number,
5550 ACTION_NUMBER_MINIMUM): Likewise.
5551 * src/output.c (muscle_insert_short_int_table): Remove.
5553 2004-12-17 Akim Demaille <akim@epita.fr>
5555 * data/lalr1.cc: Extensive Doxygenation.
5556 (error_): Rename as...
5557 (error): this, since it is visible to the user.
5559 (Parser::message): Now an automatic variable from...
5560 (Parser::yyreport_syntax_error_): here.
5561 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5563 * tests/input.at: Escape $.
5565 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5567 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5568 Parenthesize rhs to avoid obscure problems with mistakes like
5569 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5570 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5571 b4_rhs_location): Likewise.
5572 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5573 b4_rhs_location): Likewise.
5575 2004-12-16 Akim Demaille <akim@epita.fr>
5577 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5578 yacc.c: be sure to stay within yycheck_.
5579 * tests/actions.at: Re-enable C++ tests.
5581 2004-12-16 Akim Demaille <akim@epita.fr>
5583 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5586 2004-12-16 Akim Demaille <akim@epita.fr>
5588 Use #define to handle the %name-prefix.
5590 * data/glr.c, data/yacc.c: Comment changes.
5591 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5592 so that one can refer to yylex in the parser file, and have it
5593 renamed, as is the case with other skeletons.
5595 2004-12-16 Akim Demaille <akim@epita.fr>
5597 Move lalr1.cc internals into yy*.
5599 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5600 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5601 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5602 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5603 (empty_, final_, terror_, errcode_, ntokens_)
5604 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5605 (looka_, ilooka_, error_range_, nerrs_):
5607 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5608 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5609 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5610 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5611 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5612 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5613 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5614 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5617 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5619 Fix some problems reported by twlevo at xs4all.
5620 * src/symtab.c (symbol_new): Report an error if the input grammar
5621 contains too many symbols. This is better than calling abort() later.
5622 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5623 (struct node, struct graph):
5624 Rename member expand to stretch. All uses changed.
5625 (struct graph): Remove member layoutalgorithm. All uses removed.
5626 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5627 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5629 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5631 2004-12-15 Akim Demaille <akim@epita.fr>
5633 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5634 Add more Doxygen comments.
5635 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5636 (report_syntax_error_, translate_): Rename as...
5637 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5638 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5640 2004-12-15 Akim Demaille <akim@epita.fr>
5642 * data/lalr1.cc (lex_): Rename as...
5644 Move the trace here.
5645 Take the %name-prefix into account.
5646 Reported by Alexandre Duret-Lutz.
5648 2004-12-15 Akim Demaille <akim@epita.fr>
5650 Simplify the C++ parser constructor.
5652 * data/lalr1.cc (debug_): Rename as...
5653 (yydebug_): so that the parser's internals are always in the yy*
5656 (b4_parse_param_decl): Remove the leading comma as it is now only
5657 called as unique argument list.
5658 (Parser::Parser): Remove the constructor accepting a location and
5659 an initial debugging level.
5660 Remove from the other ctor the argument for the debugging level.
5661 (debug_level_type, debug_level, set_debug_level): New.
5663 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5666 2004-12-15 Akim Demaille <akim@epita.fr>
5668 Remove b4_root related material: failure experiment
5669 (which goal was to allow to derive from a class).
5671 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5672 definitions and uses.
5674 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5676 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5677 not 2, since it's not portable to subtract 1 from the start of an
5678 array. The new item 0 is never set or used. All uses changed.
5680 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5681 the default definition of YYLLOC_DEFAULT. Problem reported
5682 by Frank Heckenbach.
5684 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5686 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5687 the normal case and one for the error case. Just use the
5688 first one uniformly. Problem reported by Frank Heckenbach.
5689 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5690 use exactly the same macro in both places.
5691 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5692 so that the normal-case YYRHSLOC works for the error case too.
5694 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5695 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5696 * doc/bison.texinfo (Location Default Action): Don't claim that
5697 we have an array of locations. Use the same macro for both glr
5698 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5701 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5703 * HACKING: Update email addresses to send announcements to.
5705 * configure.ac (AC_INIT): Bump version to 1.875f.
5707 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5709 * NEWS: Version 1.875e.
5710 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5712 * src/scan-skel.l: Include "complain.h", for "fatal".
5714 * src/relation.h (relation_print, relation_digraph):
5715 Relation sizes are of type relation_node, not size_t (this is
5716 merely a doc fix, since the two types are equivalent).
5717 (relation_transpose): Relation sizes are of type relation_node,
5719 * src/relation.c: Likewise.
5720 (top, infinity): Now of type relation_node, not int.
5721 (traverse, relation_transpose): Use relation_node, not int.
5723 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5724 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5725 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5727 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
5728 specifying whether the test should be skipped. Use it tp
5729 specify that the [%defines %skeleton "lalr1.cc"] tests currently
5730 fail on some hosts, and should be skipped.
5732 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5734 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5735 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5736 unless otherwise specified below.
5738 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5739 to allocate kernel_base, kernel_items, kernel_size, since
5740 they needn't be initialized to 0.
5741 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5742 * src/closure.c (new_closure): Likewise, for itemset.
5743 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5744 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5745 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5746 (build_relations): Likewise for edge, states1, includes.
5747 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5748 * src/reader.c (packgram): Likewise, for ritem, rules.
5749 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5750 * src/relation.c (relation_digraph): Likewise for VERTICES.
5751 (relation_transpose): Likewise for new_R, end_R.
5752 * src/symtab.c (symbols_token_translations_init): Likewise for
5754 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5755 (token_actions): Likewise for yydefact, actrow, conflrow,
5757 (save_column): Likewise for froms[symno], tos[symno].
5758 (goto_actions): Likewise for state_count.
5759 (pack_table): Likewise for base, pos, check.
5760 (tables_generate): Likewise for width.
5762 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5763 for initial core. Just have a separate core, so we needn't worry
5764 about whether kernel_size and kernel_base are initialized.
5766 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5767 kernel_size, kernel_items): Remove unnecessary initialization.
5768 * src/conflicts.c (conflicts): Likewise.
5769 * src/derives.c (derives): Likewise.
5770 * src/muscle_tablc (muscle_insert): Likewise.
5771 * src/relation.c (relation_digraph): Likewise.
5772 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5773 conflrow, conflict_table, conflict_list, table, check):
5776 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5777 This is because all callers pass unsigned int.
5778 * src/closure.h (new_closure): Likewise.
5780 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5781 (build_relations): Initialize includes[i] in all cases.
5782 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5783 and rules[ruleno].precsym. Initialize members in order.
5784 * src/relation.c (relation_transpose): Always initialize new_R[i]
5786 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5788 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5789 conflict_list[0] was always 0, but now it isn't initialized.
5791 * src/table.c (table_grow): When conflict_table grew, the grown
5792 area wasn't cleared. Fix this.
5794 * lib/.cvsignore: Add strdup.c, strdup.h.
5795 * m4/.cvsignore: Add strdup.m4.
5797 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5799 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5800 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5801 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5802 ngotos + 1 without checking for overflow.
5803 (build_relations): Use END_NODE, not -1, to denote end of edges.
5804 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5805 build_relations): Use goto_number, not int, for goto numbers.
5806 * src/tables.c (save_column, default_goto): Likewise.
5808 2004-11-23 Akim Demaille <akim@epita.fr>
5810 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5811 of #defining from yystype.
5812 Don't typedef yystype, C++ does not need it.
5813 This lets it possible to forward declare it as union.
5815 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5817 * bootstrap (gnulib_modules): Add extensions.
5818 Problem reported by Jim Meyering.
5820 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5822 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5823 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5824 src/system.h, src/tables.c: XFREE -> free, to accommodate
5825 recent change to gnulib xalloc.h.
5826 Problem reported by Jim Meyering.
5828 2004-11-17 Akim Demaille <akim@epita.fr>
5830 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5832 2004-11-17 Akim Demaille <akim@epita.fr>,
5833 Alexandre Duret-Lutz <adl@gnu.org>
5835 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5838 Use it instead of cdebug_.
5839 (Parser::debug_stream, Parser::set_debug_stream): New.
5840 (Parser::symprint_): Define cdebug_ for temporary backward
5842 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5845 2004-11-17 Akim Demaille <akim@epita.fr>
5847 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5848 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5849 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5850 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5852 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5854 * data/glr.c (yyloc_default): Remove; not used.
5855 Problem reported by Frank Heckenbach.
5857 2004-10-25 Akim Demaille <akim@epita.fr>
5859 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5860 Introduce another definition to address simple location arrays.
5861 (yyGLRStack): New member: yyerror_range.
5862 (yyrecoverSyntaxError, yyparse): Update it.
5863 (yyrecoverSyntaxError): Use it when shifting the error token to
5864 have an accurate range, equivalent to the one computed by both
5865 yacc.c and lalr1.cc.
5866 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5867 that column numbers start at column 0, as per GNU Coding
5868 Standards, the others tests, and the doc.
5869 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5870 Adjust to the above change (first column is 0).
5871 And adjust the location of the "<error>", now covering the whole
5874 2004-10-22 Akim Demaille <akim@epita.fr>
5875 and Paul Eggert <eggert@cs.ucla.edu>
5877 Remove some arbitrary limits on goto numbers and relations.
5878 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5879 initial values, since they're never used.
5880 (set_goto_map): ngotos is now unsigned, so test for overflow
5881 by seeing whether it wraps around to zero.
5882 * src/lalr.h (goto_number): Now size_t, not short int.
5883 (GOTO_NUMBER_MAXIMUM): Remove.
5884 * src/relation.c (relation_print, traverse, relation_transpose):
5885 Check for END_NODE rather than looking at sign.
5886 * src/relation.h (END_NODE): New macro.
5887 (relation_node): Now size_t, not short int.
5889 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5891 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5892 keyword, not an identifier. Problem reported by Baron Schwartz in
5893 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5895 2004-10-11 Akim Demaille <akim@epita.fr>
5897 * src/symtab.c (symbol_check_alias_consistency): Also check
5898 type names, destructors, and printers.
5899 Reported by Alexandre Duret-Lutz.
5900 Recode the handling of associativity and precedence in terms
5901 of symbol_precedence_set.
5902 Accept no redeclaration at all, not even equal to the previous
5904 (redeclaration): New.
5905 Use it to factor redeclaration complaints.
5906 (symbol_make_alias): Don't set the type of the alias, let
5907 symbol_check_alias_consistency do it as for other features.
5908 * src/symtab.h (symbol): Add new member prec_location, and
5910 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5911 * tests/input.at (Incompatible Aliases): New.
5913 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5915 .cvsignore fixes to accommodate gnulib changes,
5916 and the practice of naming build directories "_build".
5917 * .cvsignore: Add "_*". Sort.
5918 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5919 * m4/.cvsignore: Add "*_gl.m4".
5921 2004-10-06 Akim Demaille <akim@epita.fr>
5923 * src/parse-gram.y (add_param): Fix the truncation of trailing
5926 2004-10-05 Akim Demaille <akim@epita.fr>
5928 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5929 whether the reducion was empty or not. This leaves room to
5930 improve the use of YYLLOC_DEFAULT in such a case.
5931 lalr1.cc is still experimental, so changing this is acceptable.
5932 And finally, there are probably not many users who changed the
5933 handling of locations in GLR, so changing is admissible too.
5935 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5936 empty reduction, set @$ to an empty location ending the previously
5938 Adjust uses to make sure the code is triggered on empty
5940 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5941 expected output: empty reductions have empty locations.
5943 2004-09-29 Akim Demaille <akim@epita.fr>
5945 * data/lalr1.cc: Move towards a more standard C++ coding style
5946 for templates: Class < T > -> Class<T>.
5948 2004-09-29 Akim Demaille <akim@epita.fr>
5950 * data/lalr1.cc: Reinstall the former ctor, for sake of
5951 compatibility, but warn it will be removed.
5952 Move towards a more standard C++ coding style (i.e., type *var ->
5955 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5957 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5958 since it's less likely to work if NULs are involved in the future.
5960 2004-09-27 Akim Demaille <akim@epita.fr>
5962 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5964 2004-09-27 Akim Demaille <akim@epita.fr>
5966 * data/lalr1.cc (b4_parse_param_decl_1): New.
5967 (b4_parse_param_decl): Use it to have different names between attribute
5969 (b4_cc_constructor_call): Likewise.
5971 2004-09-24 Akim Demaille <akim@epita.fr>
5973 * src/parse-gram.y (add_param): Strip the leading and trailing
5974 blanks from a formal argument declaration.
5975 (YY_LOCATION_PRINT): New.
5977 2004-09-24 Akim Demaille <akim@epita.fr>
5979 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5982 2004-09-24 Akim Demaille <akim@epita.fr>
5984 * doc/bison.texinfo (Table of Symbols): Sort.
5986 2004-09-21 Akim Demaille <akim@epita.fr>
5988 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5989 the useless parentheses.
5990 Suggested by Paul Eggert.
5992 2004-09-20 Akim Demaille <akim@epita.fr>
5994 Let the initial-action act on the look-ahead, and use it for the
5995 "initial push" (corresponding to an hypothetical beginning-of-file).
5996 And let lalr1.cc honor %initial-action.
5998 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
6000 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
6001 (Parser::Parser): Remove the ctor that used to initialize it.
6002 (Parser::parse): Like in the other skeletons, issue the "starting
6003 parse" message before any action.
6004 Honor %initial-action.
6005 Initialize the stacks with the lookahead.
6006 * data/yacc.c: Let $$ and @$ in %initial-action designate the
6008 Push them in the stacks.
6009 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
6011 2004-09-20 Akim Demaille <akim@epita.fr>
6013 * doc/bison.texinfo (Initial Action Decl): New.
6015 2004-09-20 Akim Demaille <akim@epita.fr>
6017 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
6018 clearer criterion to define it.
6019 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
6020 When reducing on an empty RHS, use the latest stacked location as
6022 yylloc is not always available.
6023 * data/glr.c: Likewise.
6024 Also, honor initial-actions.
6026 2004-09-20 Akim Demaille <akim@epita.fr>
6028 * data/yacc.c (YY_LOCATION_PRINT): New.
6029 Define when we know YYLTYPE's structure, i.e., when the default
6030 YYLLOC_DEFAULT is used.
6031 * data/c.m4 (b4_yysymprint_generate): Use it.
6032 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
6033 value of the result.
6034 (error_start_): Replace with...
6035 (error_range_): this location array.
6036 This allows to replace code relying on the implementation of
6037 locations by portable code.
6038 * data/yacc.c (yylerrsp): Replace with...
6039 (yyerror_range): this.
6040 Every time a token is popped, update yyerror_range[0], to have an
6041 accurate location for the error token.
6042 * data/glr.c (YY_LOCATION_PRINT): New.
6043 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
6044 deference a pointer.
6045 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
6046 report the location in %printers.
6048 * src/scan-skel.l: Instead of abort, report error messages to ease
6049 understanding skeleton scanning failures.
6051 2004-09-16 Akim Demaille <akim@epita.fr>
6053 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
6054 (iterator, const_iterator): these, to be more in the C++ spirit.
6055 Also, return reverse iterators so that when displaying the stack
6056 we display its bottom first.
6057 (Parser::stack_print_, Parser::reduce_print_): Match the messages
6059 We should probably use vector here though.
6061 2004-09-16 Akim Demaille <akim@epita.fr>
6063 Have more complete shift traces.
6065 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
6066 to report Shifts instead of ad hoc YYDPRINTF invocations,
6067 including for the error token.
6068 * data/lalr1.cc (symprint_): Output the location.
6069 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
6070 output the location within the %printer.
6071 Activate GLR tests, at least to make sure they compile properly.
6072 They still don't pass though.
6073 * tests/calc.at: Adjust expect verbose output, since now "Entering
6074 state..." is on a different line than the "Shifting" message.
6076 2004-09-08 Akim Demaille <akim@epita.fr>
6078 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
6079 Bison directive from the Bison file to the invocation of this
6080 macro, so that these directives are passed to
6081 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
6082 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
6083 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
6084 the extra Bison directives instead of the whole series.
6085 Change the grammar so that there are recoverable errors, and
6086 unrecoverable errors. Now we can have the parser give up before
6087 consuming the whole input. As a result we now can observe that
6088 the lookahead is freed when needed.
6089 Change the parser source to parse argv[1] instead of a hard coded
6091 Simplify yylex, and give a value and location to EOF.
6092 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
6093 passed directives already coded in the file.
6094 Add some tests to check the location of "error".
6095 For some tests, the C++ parser is correct, and not yacc.c.
6096 For other tests, they provide different, but unsatisfying, values,
6097 so keep the C++ value so that at least one parser is "correct"
6098 according to the test suite.
6099 (Actions after errors): Remove, this is subsumed by the
6100 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
6102 2004-09-06 Akim Demaille <akim@epita.fr>
6104 * data/lalr1.cc: Adjust the indentation of the labels.
6108 2004-09-06 Akim Demaille <akim@epita.fr>
6110 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
6111 argument, an informative message.
6112 Call YY_SYMBOL_PRINT.
6113 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
6114 * data/lalr1.cc (destruct_): Likewise.
6115 In addition, no longer depend on b4_yysymprint_generate and
6116 b4_yydestruct_generate to generate these functions, do it "by
6119 2004-09-03 Akim Demaille <akim@epita.fr>
6121 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
6122 invoked, yydestruct the lookahead.
6123 * tests/calc.at (Calculator $1): Update the expected lengths of
6124 traces: there is an added line for the discarded lookahead.
6125 * doc/bison.texinfo (Destructor Decl): Some rewording.
6126 Define "discarded" symbols.
6128 2004-09-02 Akim Demaille <akim@epita.fr>
6130 * data/lalr1.cc (translate_, destruct_): No reason to be static.
6132 2004-09-02 Akim Demaille <akim@epita.fr>
6134 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
6135 (YYDSYMPRINTF): Rename as...
6136 (YY_SYMBOL_PRINT): this.
6137 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
6139 Use it instead of direct symprint_ calls.
6140 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
6143 2004-09-02 Akim Demaille <akim@epita.fr>
6145 * data/lalr1.cc (b4_yysymprint_generate): New.
6146 (symprint_): New member function, defined when YYDEBUG.
6147 Use it consistently instead of token/nterm debugging output by
6149 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
6150 %printer calls to use cdebug_ when using lalr1.cc.
6152 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
6154 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
6155 with #ifdef YYDEBUG.
6157 2004-08-26 Akim Demaille <akim@epita.fr>
6159 * doc/bison.texinfo (Implementing Loops): Rename as...
6160 (Implementing Gotos/Loops): this.
6162 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
6164 Adjust to latest gnulib.
6165 * bootstrap (gnulib_modules): Add xalloc-die.
6166 Set LC_ALL=C so that file names sort consistently.
6167 Prefer the gnulib copies of gettext.m4, glibc21.m4,
6168 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
6169 uintmax_t.m4, ulonglong.m4.
6170 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
6171 po.m4 since we are now using _gl.m4 instead.
6173 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
6175 * src/scan-action.l: Remove. Scanning of semantic actions is
6176 handled in scan-gram.l.
6178 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
6180 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
6182 * src/location.h (struct): The file member is a uniqstr.
6183 (equal_boundaries): Use UNIQSTR_EQ for comparison.
6185 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
6187 Fix bug with non-%union parsers that have printers or destructors,
6188 which led to a Bison core dump. Reported by Peter Fales in
6189 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
6191 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
6192 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
6193 not to our own type.
6194 * src/output.c (symbol_destructors_output, symbol_printers_output):
6195 Don't assume %union.
6196 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
6197 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
6198 UNION-FLAG. All callers changed.
6199 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
6200 Use type char, not unsigned int, when declaring an array of char;
6201 this lets us remove a cast.
6202 (Printers and Destructors): Add non-%union test cases.
6204 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6206 * doc/bison.texinfo: Minor editorial changes, mostly to the new
6207 GLR writeups. E.g., avoid frenchspacing and the future tense,
6208 change "lookahead" to "look-ahead", and change "wrt" to "with
6211 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6213 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
6214 New sections, split off from the GLR Parsers section. Put the new
6215 Simple GLR Parser near the start of the GLR section, for clarity.
6216 Rewrite connective text.
6218 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
6220 * doc/bison.texinfo (Simple GLR Parsers): New section.
6222 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6224 * NEWS, TODO, doc/bison.texinfo:
6225 Use "look-ahead" instead of "lookahead", to be consistent.
6226 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
6227 while we're fixing "look-ahead".
6228 * src/conflicts.c (shift_set): Renamed from shiftset.
6229 (look_ahead_set): Renamed from lookaheadset.
6230 * src/print.c: Likewise.
6231 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
6232 name for "lookahead".
6233 (report_types, usage): Likewise.
6234 * src/getargs.h (report_look_ahead_tokens): Renamed from
6236 * src/lalr.c (compute_look_ahead_tokens): Renamed from
6238 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
6239 (look_ahead_tokens_print): Renamed from lookaheads_print.
6240 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
6241 state_rule_lookaheads_print.
6242 * src/state.h: Likewise.
6243 (reductions.look_ahead_tokens): Renamed from lookaheads.
6244 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
6245 AT_DATA_LOOKAHEADS_GRAMMAR.
6247 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
6249 * README: Update location of patched M4 distribution.
6251 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
6253 Don't assume the C++ compiler takes the same arguments as the C compiler
6255 * configure.ac (O0CXXFLAGS): New var.
6256 * tests/atlocal.in (CXXFLAGS): Use it.
6258 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
6260 Fix some "make check" problems with C++ reported by
6261 Albert Chin-A-Young for Tru64 C++ in this thread:
6262 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
6264 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
6265 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6266 Output to a .cc file for C++, not to a .c file.
6267 * tests/calc.at (AT_CHECK_CALC): Likewise.
6268 * tests/regression.at (AT_CHECK_DANCER): Likewise.
6269 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
6271 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
6273 * tests/calc.at, tests/actions.at: Workaround for SGI
6274 C++ compiler. (trivial change)
6276 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
6278 Spent a few hours checking out which prerequisite versions the
6279 current sources actually require. I went all the way back to
6280 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
6281 a seemingly endless set of combinations of versions more recent
6282 than that. The bottom line is that the current sources require
6283 fairly recent versions of the build tools, and it'll be some work
6285 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
6286 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
6287 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
6288 Add comments explaining why those particular versions are
6291 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
6292 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
6293 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
6295 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
6296 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
6298 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
6300 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
6301 0.11.5. Suggested by Bruno Haible.
6302 * bootstrap: Remove gettext version checking.
6304 * doc/bison.texinfo (Decl Summary): Also mention that %union
6305 can depend on prerequisite types. Problem reported by Tim
6308 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
6310 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
6311 * README-alpha: Don't tell people not to package this.
6313 * bootstrap: Don't assume $(...) works; use `...` instead.
6314 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
6317 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
6318 put into the -d output file, and mention what to do if YYSTYPE is
6321 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
6323 Undo change made earlier today: it caused autopoint to not bring
6324 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
6327 * bootstrap: Check that gettext version matches what's in
6328 configure.ac. Warn users to ignore robots.txt ERROR 404.
6329 * bootstrap: Undo today's earlier change (logged below).
6330 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
6332 The gettext version checking is causing more trouble than it's
6333 curing; remove it. Problem reported by Paul Hilfinger.
6335 * bootstrap: Issue a warning that one can expect a message
6336 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
6337 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
6339 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
6341 Ensure that the C++ compiler used for testing actually works on a
6342 simple test program; if not, skip the C++-related tests. Problem
6343 reported by Vin Shelton in:
6344 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
6346 * m4/cxx.m4: New file.
6347 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
6348 * tests/atlocal.in (BISON_CXX_WORKS): Add.
6349 * tests/local.at (AT_COMPILE_CXX): Use it.
6351 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6353 * data/glr.c (yylloc): Output this macro even if locations are not
6354 being generated, as the GLR parser needs it even in that case.
6355 Problem reported by Troy A. Johnson
6356 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
6358 * configure.ac (AC_INIT): Update to 1.875e.
6360 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6362 * NEWS: Version 1.875d.
6363 * configure.ac (AC_INIT): Likewise.
6364 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
6366 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
6367 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
6368 lalr1.cc runs afoul of the first, and the last two are no longer
6369 supported by GCC 3.4.0.
6370 * README: Mention GNU m4 1.4 or later; mention m4 patches.
6371 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
6373 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6375 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
6376 unsigned int, for compatibility with latest gnulib hash module.
6377 * src/state.c (state_hash, state_hasher): Likewise.
6378 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
6379 * src/uniqstr.c (hash_uniqstr): Likewise.
6381 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
6383 * NEWS: Unescaped newlines are no longer allowed in char & strings.
6385 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
6386 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
6387 character and string literals.
6388 (unexpected_end): New function.
6389 (unexpected_eof): Use it.
6390 (unexpected_newline): New function.
6391 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
6394 * NEWS: Document %expect-rr.
6396 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
6397 Fix typo by replacing $1 with $option.
6398 Remove more 'intl'-related files.
6399 Don't DEFUN AM_INTL_SUBDIR twice.
6401 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
6402 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
6404 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
6405 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
6406 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
6407 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
6408 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
6409 * src/.cvsignore: Add *.output.
6411 * src/parse-gram.y: Put copyright notice inside %{ %} so it
6412 gets copied to the output file.
6414 2004-04-28 Paul Eggert <eggert@twinsun.com>
6416 Get files from the gnulib and po repositories, instead of relying
6417 on them being in our CVS. Upgrade to latest versions of gnulib
6420 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
6421 * bootstrap: Bootstrap from gnulib and po repositories.
6422 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
6423 * README-cvs: Document these changes. Remove version numbers from
6424 mentions of build tools, since they change so often. Mention Flex.
6426 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
6427 (gl_USE_SYSTEM_EXTENSIONS): Add.
6428 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
6429 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
6431 (AC_ISC_POSIX): Remove; we no longer support this
6432 ancient OS, as it gets in the way of latest Autoconf & gnulib.
6433 (AC_HEADER_STDC): Remove: we now assume C89 or better.
6434 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
6435 Do not check for C89 headers, except for locale.h which is used
6436 by the Yacc library and must port to K&R hosts.
6437 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
6438 Do not check for C89 functions, except for setlocale which is
6439 used by the Yacc library.
6440 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
6441 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
6442 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
6443 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
6444 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
6445 AM_GNU_GETTEXT): Remove; now done by:
6446 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
6447 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
6450 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
6451 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
6452 Define to empty, as gnulib.mk will do the rest for us.
6453 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
6455 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
6456 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
6458 * src/files.c: Include gnulib's xstrndup.h.
6460 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
6461 (REALLOC): Use xnrealloc, for likewise.
6462 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
6463 (strnlen, memrchr): Remove decls; functions no longer used.
6466 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
6467 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
6468 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
6469 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
6470 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
6471 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
6472 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
6473 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
6474 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
6475 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
6476 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
6477 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6478 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
6479 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
6480 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
6481 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
6482 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
6483 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
6484 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
6485 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
6486 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
6487 Remove, as these files are now generated automatically
6488 by bootstrap or automake.
6490 * po/ChangeLog: Remove: all but one entry was a duplicate
6491 of this file, and I moved that 2000-11-02 entry here.
6493 * config/.cvsignore: Add Makefile, depcomp, install-sh.
6494 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
6495 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
6496 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
6497 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
6498 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
6499 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
6500 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
6501 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
6502 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
6503 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
6505 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
6506 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
6507 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
6508 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
6509 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
6510 * src/.cvsignore: Remove *_.c.
6513 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
6514 support it. (The latest stable gzip doesn't.)
6516 2004-04-27 Paul Eggert <eggert@twinsun.com>
6518 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6519 case, as stos_ is now used by destructors due to the 2004-02-09
6522 Remove more K&R C support.
6523 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6524 * lib/subpipe.c (errno): Remove decl.
6525 Include <stdlib.h> unconditionally.
6526 (EXIT_FAILURE): Remove macro.
6527 * src/complain.c (vfprintf, strerror): Remove.
6528 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6530 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6531 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6532 (strchr, strspn, memchr): Remove decls.
6533 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6534 unconditionally. Do not declare perror.
6535 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6538 * src/complain.c (_): Remove useless defn, as system.h defines this.
6540 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6541 with latest obstack.h.
6542 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6543 to procedure types, as obstack.h now does that for us.
6544 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6546 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6547 so that this include file can stand alone.
6548 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6549 does this now. Include subpipe.h first after config.h, to
6550 test whether it can stand alone.
6552 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6553 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6556 * tests/synclines.at (%union synch line): Put a dummy member in
6557 the union, because empty unions aren't allowed in C. Caught
6560 2004-04-13 Jim Meyering <jim@meyering.net>
6562 * src/conflicts.c (conflicts_print): Correct format string typo:
6563 use `%%' to produce literal `%'. (trivial change)
6565 2004-03-30 Paul Eggert <eggert@twinsun.com>
6567 * src/getargs.c (version): Update copyright year to 2004.
6569 * data/c.m4 (b4_int_type): Use 'short int' rather than
6570 'short', and similarly for 'long', 'unsigned', etc.
6571 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6572 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6573 yy_yypstack, yydumpstack): Likewise.
6574 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6575 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6577 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6578 yy_stack_print, yyparse): Likewise.
6579 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6580 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6581 * lib/bitset.c (bitset_print): Likewise.
6582 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6583 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6584 * lib/bitsetv.c (bitsetv_dump): Likewise.
6585 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6586 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6588 * src/LR0.c (allocate_itemsets): Likewise.
6589 * src/gram.h (rule_number, rule): Likewise.
6590 * src/lalr.h (goto_number): Likewise.
6591 * src/nullable.c (nullable_compute): Likewise.
6592 * src/output.c (prepare_rules): Likewise.
6593 * src/relation.c (relation_print, relation_digraph): Likewise.
6594 * src/relation.h (relation_node): Likewise.
6595 * src/state.h (state_number, transitions, errs, reductions,
6596 struct state): Likewise.
6597 * src/symtab.h (symbol_number, struct symbol): Likewise.
6598 * src/tables.c (vector_number, tally, action_number,
6599 default_goto, goto_actions): Likewise.
6600 * tests/existing.at (GNU Cim Grammar): Likewise.
6601 * tests/regression.at (Web2c Actions): Likewise.
6603 * src/output.c (muscle_insert_short_int_table): Renamed from
6604 muscle_insert_short_table. All uses changed.
6606 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6608 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6609 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6610 Add %expect-rr rule.
6612 * src/scan-gram.l: Recognize %expect-rr.
6614 * src/conflicts.h (expected_sr_conflicts): Rename from
6616 (expected_rr_conflicts): Declare.
6618 * src/conflicts.c (expected_sr_conflicts): Rename from
6620 (expected_rr_conflicts): Define.
6621 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6623 Use expected_sr_conflicts in place of expected_conflicts.
6624 Warn if expected_rr_conflicts used in non-GLR parser.
6626 * doc/bison.texinfo: Add documentation for %expect-rr.
6628 2004-03-08 Paul Eggert <eggert@gnu.org>
6630 Add support for hex token numbers. Suggested by Odd Arild Olsen in
6631 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
6633 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6635 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6636 * src/scan-gram.l (scan_integer): New function.
6638 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6639 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6640 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6641 Say "long int", not "long", for uniformity with GNU style.
6643 2004-02-25 Paul Eggert <eggert@twinsun.com>
6645 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6646 compilers. This fixes a problem with Intel's C++ compiler being
6647 chatty, reported by Guido Trentalancia in
6648 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
6650 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6652 Support %destructor and merge error locations in lalr1.cc.
6654 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6655 (Parser::stos_): Define unconditionally.
6656 (Parser::destruct_): New method. Generate its body with
6657 b4_yydestruct_generate.
6658 (Parser::error_start_): New attribute.
6659 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6660 token which are discarded.
6661 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6662 error_start_ when erroneous token are discarded.
6663 (Parser::parse) <yyerrlab1>: Compute the location of the error
6664 token so that it covers all the discarded tokens.
6665 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6666 it can be called with `%skeleton "lalr1.cc"', and do that.
6668 2004-02-02 Paul Eggert <eggert@twinsun.com>
6670 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6671 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6672 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6673 There's no need to mention top_builddir since Automake does that
6675 (INCLUDES): Remove, as Automake says it's obsolescent.
6676 Contents migrated into AM_CPPFLAGS as described above.
6677 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6679 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6681 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6682 (yyreportSyntaxError): Handle case where lookahead token is
6685 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6687 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6688 resulting parsers are compilable with C++.
6690 2003-12-23 Paul Eggert <eggert@twinsun.com>
6692 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6693 * src/output.c (output_skeleton): Rename local var.
6694 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6695 Bison tokens, as this runs afoul of the 2003-10-07 change that
6696 disallowed NUL bytes in character constants or string literals.
6698 * tests/local.at: Require Autoconf 2.59's Autotest.
6699 * tests/testsuite.at: Don't include local.at, since we now assume
6700 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6702 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6703 multiple inclusion warnings.
6705 2003-12-02 Akim Demaille <akim@epita.fr>
6707 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6711 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6713 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6715 2003-10-07 Paul Eggert <eggert@twinsun.com>
6717 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6718 if testsuite doesn't exist.
6720 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6721 literals, unfortunately.
6722 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6723 Complain about NUL bytes in character constants or string literals.
6725 2003-10-05 Paul Eggert <eggert@twinsun.com>
6727 * NEWS: Don't document %no-default-prec, as it's still
6729 * doc/bison.texinfo: Document %no-default-prec only if
6730 the defaultprec flag is set. Normally it's not.
6732 2003-10-04 Paul Eggert <eggert@twinsun.com>
6734 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6735 non-modifiable lvalue, instead of a modifiable one.
6736 * doc/bison.texinfo (Actions): Document that $$ can
6737 be assigned to. Do not claim that $$ and $N are
6738 array element references: user code should not rely on this.
6740 2003-10-01 Paul Eggert <eggert@twinsun.com>
6742 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6743 (grammar_declaration): Use it.
6744 * src/scan-gram.l: New token %no-default-prec.
6745 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6746 * NEWS, doc/bison.texinfo: Document the above.
6748 2003-10-01 Akim Demaille <akim@epita.fr>
6750 VCG no longer supports long_straight_phase.
6752 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6753 * src/print_graph.c (print_graph): Adjust.
6755 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
6756 and Paul Eggert <eggert@twinsun.com>
6758 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6759 Table of Symbols): Document %default-prec.
6760 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6761 (grammar_declaration): Set default_prec on %default-prec.
6762 * src/scan-gram.l (%default-prec): New token.
6763 * src/reader.h (default_prec): New flag.
6764 * src/reader.c: Likewise.
6765 (packgram): Handle it.
6766 * tests/conflicts.at (%default-prec without %prec,
6767 %default-prec with %prec, %default-prec 1): New tests.
6769 2003-09-30 Paul Eggert <eggert@twinsun.com>
6771 * tests/testsuite.at: Include local.at, not input.at, fixing
6772 a typo in the 2003-08-25 patch.
6774 2003-08-27 Akim Demaille <akim@epita.fr>
6776 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6779 2003-08-26 Akim Demaille <akim@epita.fr>
6781 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6782 "<\#" to avoid magic from Gnus when posting parts of this script.
6784 2003-08-26 Akim Demaille <akim@epita.fr>
6786 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6787 (Parser::parse): here.
6788 Adjust: nerrs and errstatus is now replaced by...
6789 (Parser::nerrs_, Parser::errstatus_): New.
6791 2003-08-25 Akim Demaille <akim@epita.fr>
6793 * config/announce-gen, Makefile.cfg: New.
6794 * Makefile.am: Adjust.
6795 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6796 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6798 2003-08-25 Akim Demaille <akim@epita.fr>
6800 When reducing initial empty rules, Bison parser read an initial
6801 location that is not defined. This results in garbage, and that
6802 affects Bison's own parser. Therefore we need (i) to extend Bison
6803 to support a means to initialize this location, and (ii) to use
6804 this CVS Bison to fix CVS Bison's parser.
6806 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6808 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6809 * src/parse-gram.y: Adjust.
6810 (%initial-action): New.
6811 (%error-verbose): Since we require CVS Bison, there is no reason
6813 * src/scan-gram.l: Adjust.
6814 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6815 * data/yacc.c (yyparse): Use b4_initial_action.
6817 2003-08-25 Akim Demaille <akim@epita.fr>
6819 * doc/bison.texinfo: Don't promote stdout for error messages.
6821 2003-08-25 Akim Demaille <akim@epita.fr>
6823 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6824 From Alexandre Duret-Lutz.
6826 2003-08-25 Akim Demaille <akim@epita.fr>
6830 2003-08-25 Akim Demaille <akim@epita.fr>
6832 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6835 2003-08-25 Akim Demaille <akim@epita.fr>
6837 * data/lalr1.cc (Parser::reduce_print_): New.
6840 2003-08-25 Akim Demaille <akim@epita.fr>
6842 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6843 error recovery loops. This patch is based on
6844 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
6845 Also, augment the similarity between lalr1.cc and yacc.c.
6846 Note: the locations of error recovery rules are not correct yet.
6848 * data/lalr1.cc: Comment changes to augment the similarity between
6849 lalr1.cc and yacc.c.
6850 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6851 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6852 yyerrlab), when hitting EOF, pop the whole stack here instead of
6853 merely falling thru the default error handling mechanism.
6854 (yyerrorlab): New label, with the old contents of YYERROR,
6855 plus the following change: pop the stack of rhs corresponding
6856 to the production that invoked YYERROR. That is how Yacc
6857 behaves (required by POSIX).
6858 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6861 2003-08-25 Akim Demaille <akim@epita.fr>
6863 Tune local.at so that people can "autom4te -l autotest calc.at -o
6864 calc" for instance, to extract a sub test suite.
6866 * tests/testsuite.at: Move the initialization, Autotest version
6867 requirement, and AT_TESTED invocation into...
6868 * tests/local.at: here.
6869 * tests/testsuite.at: Include it for compatibility with Autoconf
6871 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6874 2003-08-04 Paul Eggert <eggert@twinsun.com>
6876 Rework code slightly to avoid gcc -Wtraditional warnings.
6877 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6878 The returned value is now stored in *YY0. All callers changed.
6879 * src/output.c (merge_output): Adjust to the above change.
6881 2003-07-26 Paul Eggert <eggert@twinsun.com>
6883 * data/glr.c (YYASSERT): New macro.
6884 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6885 yyresolveStates, yyprocessOneStack):
6886 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6887 Derived from a suggestion by Frank Heckenbach.
6889 2003-07-25 Paul Eggert <eggert@twinsun.com>
6891 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6892 for portability to K&R C (after ansi2knr, presumably). See
6893 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
6894 by Frank Heckenbach, though I have omitted the structure-initialization
6895 part of his glr-knr.diff patch since I recall that the Portable
6896 C Compiler didn't require that change.
6898 Let the user specify how to allocate and free memory.
6899 Derived from a suggestion by Frank Heckenbach in
6900 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
6901 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6902 All uses of free, malloc, realloc changed to use these macros,
6903 and unnecessary casts removed.
6904 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6906 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6908 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6909 use s.empty() rather than s == "" to test for empty string; see
6910 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
6913 2003-06-25 Akim Demaille <akim@epita.fr>
6915 * config/depcomp, config/install-sh: Update from masters.
6917 2003-06-20 Paul Eggert <eggert@twinsun.com>
6919 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6920 and return properly parenthesized result.
6921 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6922 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6923 Remove unnecessary parentheses from uses.
6924 * doc/bison.texinfo (Location Default Action): Describe the
6925 conventions for parentheses.
6927 2003-06-19 Paul Eggert <eggert@twinsun.com>
6929 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6930 yyreportTree): Do not assume that size_t is the same width as int,
6931 when printing sizes. Print sizes using an unsigned format.
6932 Problem reported by Frank Heckenbach in
6933 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
6935 Port to Forte Developer 7 C compiler.
6936 * data/glr.c (struct YYLTYPE): If locations are not being used,
6937 declare a single dummy member, as empty structs do not conform
6939 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6940 the Forte Developer 7 C compiler complains that end-of-loop
6941 code is not reached.
6943 2003-06-17 Paul Eggert <eggert@twinsun.com>
6945 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6946 avoid warnings from picky compilers about redefinition of PARAMS.
6948 2003-06-17 Paul Eggert <eggert@twinsun.com>
6952 * NEWS: Document 1.875b.
6954 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6955 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6956 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6957 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6958 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6959 per recent gettext manual's suggestion.
6960 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6961 Use prototypes, not old-style definitions.
6962 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6963 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6964 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6965 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6966 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6967 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6968 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6969 vbitset_or_and_cmp, vbitset_copy): Likewise.
6971 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6972 Do not include <stdlib.h>.
6973 (PARAMS): Define unconditionally for C89.
6974 (ATTRIBUTE_NORETURN): Remove.
6975 (ATTRIBUTE_UNUSED): Define unconditionally.
6977 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
6978 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
6979 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6980 * lib/vbitset.c, lib/vbitset.h: New files.
6981 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6982 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6985 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6986 `How Can I Reset @code{yyparse}', since texinfo does not allow
6987 arbitrary @ in node names.
6989 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6990 shouldn't be needed according to the gettext 0.12.1 documentation
6991 but which seem to be needed anyway: codeset.m4 glibc21.m4
6992 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
6993 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
6994 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
6996 * lib/.cvsignore: Add stdbool.h.
6997 * m4/.cvsignore: Add nls.m4, po.m4.
6999 Upgrade to CVS gnulib.
7000 * stdbool_.h: File renamed from stdbool.h.in.
7001 * configure.ac (AM_STDBOOL_H): Invoke this instead of
7003 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
7004 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
7005 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
7006 (MOSTLYCLEANFILES): New var.
7007 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
7008 (stdbool.h): New rule.
7009 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
7010 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
7011 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
7012 m4/quote.m4: Upgrade to today's gnulib.
7014 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
7015 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
7016 the tests right now.
7017 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
7018 yyerror are declared before use; C99 requires this.
7020 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7022 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
7024 (yyrecoverSyntaxError): Correct the logic for setting and testing
7026 Correct comment on handling EOF.
7027 Allow states with only a default reduction, rather than failing
7028 (I can't quite reconstruct why these were not allowed before).
7030 Fixes to avoid problem that $-N rules in GLR parsers can cause
7031 buffer overruns, corrupting state.
7033 * src/output.c (prepare_rules): Output max_left_semantic_context
7035 * src/reader.h (max_left_semantic_context): New variable declaration.
7036 * src/scan-gram.l (max_left_semantic_context): Define.
7037 (handle_action_dollar): Update max_left_semantic_context.
7038 * data/glr.c (YYMAXLEFT): New definition.
7039 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
7040 (yyresolveAction): Ditto.
7042 Fixes to problems with location handling in GLR parsers reported by
7043 Frank Heckenbach (2003/06/05).
7045 * data/glr.c (YYLTYPE): Make trivial if locations not used.
7046 (YYRHSLOC): Add parentheses, and define only if locations used.
7047 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
7049 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
7050 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
7052 * tests/cxx-type.at: Exercise location information; update tests
7053 to differentiate output with and without locations.
7054 Remove forward declarations of yylex and yyerror---caused errors
7055 because default YYLTYPE not yet defined.
7056 Change semantic actions to compute strings, rather than printing
7057 them directly (to test proper passing of semantics values). Change
7058 output to prefix notation and update test data and expected results.
7059 (yylex): Track locations.
7060 (stmtMerge): Return value rather than printing, and include arguments
7063 2003-06-03 Paul Eggert <eggert@twinsun.com>
7065 Avoid warnings generated by GCC 2.95.4 when Bison is
7066 configured with --enable-gcc-warnings.
7067 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
7068 yy::]b4_parser_class_name[::translate_,
7069 yy::Stack::operator[] (unsigned),
7070 yy::Stack::operator[] (unsigned) const,
7071 yy::Slice::operator[] (unsigned),
7072 yy::Slice::operator[] (unsigned) const):
7073 Rename local vars to avoid warnings.
7074 * tests/glr-regression.at (Improper handling of embedded actions
7075 and $-N in GLR parsers): Remove unused local variable from yylex.
7076 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
7077 (void) as arg when not pure, since we now assume C89 when building
7078 Bison. Pacify GCC by using parameter.
7080 2003-06-02 Paul Eggert <eggert@twinsun.com>
7082 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
7083 yy::Location::lines, yy::Location::columns): Rename arguments
7084 to avoid shadowing; this removes a warning generated by GCC 3.3.
7086 2003-06-01 Paul Eggert <eggert@twinsun.com>
7088 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
7089 to g++, as GCC 3.3 complains if you do it.
7090 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
7091 everything that WARNING_CFLAGS has, except omit warnings
7092 not suitable for C++.
7093 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
7094 * tests/atlocal.in (CXXFLAGS): New var.
7095 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
7097 Fix a GLR parser bug I reported in February; see
7098 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
7099 The problem was that GLR parsers did not conform to the C standard,
7100 because actions like { $1 = $2 + $3; } expanded to expressions
7101 that invoked YYFILL in separate subexpressions, and YYFILL assigned
7102 to a local variable. The C standard says that expressions
7103 like (var = f ()) + (var = f ()) have undefined behavior.
7104 Another problem was that GCC sometimes issues warnings that
7105 yyfill and its parameters are unused.
7107 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
7109 (yyfill): New function.
7111 (yyuserAction): Change type of yynormal to bool, so that it matches
7112 the new yyfill signature. Mark it as possibly unused.
7115 Follow up on a bug I reported in February, where a Bison-generated
7116 parser can loop. Provide a test case and a fix for yacc.c. I
7117 don't have a fix for lalr1.cc or for glr.c, unfortunately.
7118 The original bug report is in:
7119 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
7121 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
7122 macro's size was becoming unwieldy.
7123 (yyerrlab): Do not discard an empty lookahead symbol, as this
7124 might destroy garbage.
7125 (yyerrorlab): New label, with the old contents of YYERROR,
7126 plus the following change: pop the stack of rhs corresponding
7127 to the production that invoked YYERROR. That is how Yacc
7128 behaves, and POSIX requires this behavior.
7129 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
7130 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
7131 Define 'alarm' to do nothing if unistd.h is not available.
7132 Add a new rule "exp: '-' error;" to test the above change to
7133 data/yacc.c. Use 'alarm' to abort any test taking longer than
7134 10 seconds, as it's probably looping.
7135 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
7136 Also, the new yacc.c generates two fewer diagnostics for an
7139 2003-05-24 Paul Eggert <eggert@twinsun.com>
7141 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
7142 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
7143 This fixes a problem reported by John Bowman when the Compaq/HP
7144 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
7146 * data/yacc.c (union yyalloc): Likewise.
7147 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
7149 Switch from 'int' to 'bool' where that makes sense.
7151 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
7152 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
7153 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
7154 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
7155 Return or accept bool, not int. All callers changed.
7156 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
7157 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
7158 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
7159 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
7160 bitset_or_and_cmp_): Likewise.
7161 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
7162 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
7163 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
7164 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
7165 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
7166 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
7167 bitset_stats_or_and_cmp): Likewise.
7168 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
7169 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
7170 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
7171 ebitset_xor_cmp): Likewise.
7172 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
7173 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
7174 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
7175 lbitset_xor_cmp): Likewise.
7176 * lib/bbitset.h: Include <stdbool.h>.
7177 (struct bitset_vtable): The following members now return bool, not
7178 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
7179 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
7181 * src/conflicts.c (count_rr_conflicts): Likewise.
7182 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
7184 * lib/ebitset.c (ebitset_obstack_init): Likewise.
7185 * lib/lbitset.c (lbitset_obstack_init): Likewise.
7186 * src/getargs.c (debug_flag, defines_flag, locations_flag,
7187 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7188 graph_flag): Likewise.
7189 * src/getargs.h (debug_flag, defines_flag, locations_flag,
7190 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7191 graph_flag): Likewise.
7192 * src/output.c (error_verbose): Likewise.
7193 * src/output.h (error_verbose): Likewise.
7194 * src/reader.c (start_flag, typed): Likewise.
7195 * src/reader.h (typed): Likewise.
7196 * src/getargs.c (LOCATIONS_OPTION): New constant.
7197 (long_options, getargs): Use it.
7198 * src/lalr.c (build_relations): Use bool, not int.
7199 * src/nullable.c (nullable_compute): Likewise.
7200 * src/print.c (print_reductions): Likewise.
7201 * src/tables.c (action_row, pack_vector): Likewise.
7202 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
7203 * src/output.c (prepare): Use it.
7204 * src/output.c (token_definitions_output,
7205 symbol_destructors_output, symbol_destructors_output): Use string,
7206 not boolean integer, to keep track of whether to output separator.
7207 * src/print_graph.c (print_core): Likewise.
7208 * src/state.c (state_rule_lookaheads_print): Likewise.
7210 * config/install-sh: Sync from automake 1.7.5.
7212 2003-05-14 Paul Eggert <eggert@twinsun.com>
7214 * src/parse-gram.y (rules_or_grammar_declaration): Require a
7215 semicolon after a grammar declaration, in the interest of possible
7216 future changes to the Bison input language.
7217 Do not allow a stray semicolon at the start of the grammar.
7218 (rhses.1): Allow one or more semicolons after any rule, including
7219 just before "|" as required by POSIX.
7220 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
7223 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
7225 %parse-param support for lalr1.cc.
7227 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
7228 b4_cc_constructor_calls, b4_cc_constructor_call,
7229 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
7231 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
7232 parse-param arguments.
7233 (yy::b4_parser_class_name): Declare instance variables to
7234 hold parse-param arguments.
7235 * tests/calc.at: s/value/semantic_value/ because value clashes
7236 with a member of yy::b4_parser_class_name. Adjust C++ code
7237 to handle %parse-param. Enable %parse-param test in C++.
7239 2003-05-12 Paul Eggert <eggert@twinsun.com>
7241 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
7242 English a bit. Fix fclose typo. Change "const char" to "char
7243 const", and use ANSI C rather than K&R for "main". Suggest
7244 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
7245 and suggest yy_switch_to_buffer.
7247 2003-05-05 Paul Eggert <eggert@twinsun.com>
7249 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
7250 C89. This avoids a diagnostic on compilers that define __STDC__
7251 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
7252 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7254 2003-05-03 Paul Eggert <eggert@twinsun.com>
7256 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
7257 Do not overrun array bounds.
7258 This should fix a bug reported today by Olatunji Oluwabukunmi in
7259 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
7261 2003-04-29 Akim Demaille <akim@epita.fr>
7263 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
7264 * src/getargs.c, src/getargs.h: here, as bool, not int.
7265 (nondeterministic_parser): New.
7266 * src/parse-gram.y, src/scan-gram.l: Support
7267 %nondeterministic-parser.
7268 * src/output.c (prepare): Use nondeterministic_parser instead
7269 of glr_parser where appropriate.
7270 * src/tables.c (conflict_row, action_row, save_row)
7271 (token_actions, token_actions, pack_vector): Ditto.
7273 2003-04-29 Akim Demaille <akim@epita.fr>
7275 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
7277 2003-04-29 Akim Demaille <akim@epita.fr>
7279 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
7280 with %pure-parser and %locations to exercise the patch from Yakov
7283 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
7285 * data/yacc.c: (b4_lex_param): Corrected for the case where
7286 %lex-param is provided and %pure-parser isn't.
7288 2003-04-27 Paul Eggert <eggert@twinsun.com>
7290 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
7291 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
7292 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
7293 if it is not defined.
7294 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
7296 2003-04-26 Paul Eggert <eggert@twinsun.com>
7298 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
7299 Declare to be of type suitable for the ninf value itself, not of
7300 type suitable for the corresponding table, since the latter might
7301 be unsigned but the ninf value might be negative. This fixes a
7302 bug reported by Alexandre Duret-Lutz in
7303 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
7305 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
7306 invokes it. We shouldn't invoke it twice because it will attempt
7307 to put error.o in the archive twice. This fixes a glitch reported
7308 by Martin Mokrejs in
7309 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7311 2003-04-21 Paul Eggert <eggert@twinsun.com>
7313 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
7316 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
7318 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
7319 Fix obvious typo that results in uncompilable GLR parsers
7320 when both %pure-parser and %locations are used. (trivial change)
7322 2003-04-17 Paul Eggert <eggert@twinsun.com>
7324 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
7325 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
7326 Do not insert the expected token via unput, as this runs afoul
7327 of a POSIX-compatibility bug in flex 2.5.31.
7328 All uses changed to BEGIN the parent state,
7329 since we no longer insert the expected token via unput.
7330 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
7331 that is no longer emitted after the above change.
7333 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
7334 the first one. This change is from Paul Hilfinger, and it fixes
7335 regression reported by Werner Lemberg in
7336 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
7338 (resolve_sr_conflict): Don't invoke state_errs_set
7339 unless one or more tokens have been explicitly made errors.
7340 Otherwise, the above change causes Bison to abort.
7342 * tests/existing.at (GNU pic Grammar): New test case, taken from
7345 2003-03-31 Akim Demaille <akim@epita.fr>
7347 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
7349 2003-03-31 Akim Demaille <akim@epita.fr>
7351 * src/output.c (prepare_symbols): Avoid trailing spaces in the
7354 2003-03-31 Akim Demaille <akim@epita.fr>
7356 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
7357 From Paul Hilfinger.
7359 2003-03-29 Akim Demaille <akim@epita.fr>
7361 * m4/error.m4: Do not put under dynamic conditions some code which
7362 expansion is under static control.
7364 2003-03-29 Akim Demaille <akim@epita.fr>
7366 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
7368 2003-03-29 Akim Demaille <akim@epita.fr>
7370 * doc/bison.texinfo (Strings are Destroyed): New.
7372 2003-03-13 Paul Eggert <eggert@twinsun.com>
7374 * .cvsignore: Add configure.lineno.
7375 * src/.cvsignore: Add yacc.
7376 * tests/.cvsignore: Add testsuite.log.
7377 * doc/fdl.texi: Sync with latest FSF version.
7379 2003-03-12 Paul Eggert <eggert@twinsun.com>
7381 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
7382 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
7383 cursor, instead of leaving it undefined. This fixes a bug
7384 reported by Tim Van Holder in
7385 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
7386 * tests/input.at (Torturing the Scanner): Test the scanner on
7387 an empty input file, which was Tim Van Holder's test case.
7389 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
7390 <sys/resource.h> can be included, include sys/time.h and
7391 sys/times.h first, if available. This works around the SunOS
7392 4.1.4 porting bug reported by Bruce Becker in
7393 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
7395 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
7396 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
7399 Merge changes from gnulib. This was prompted because the CVS
7400 snapshot didn't build on Solaris 7 due to strnlen problems.
7402 These changes need to be merged back into gnulib:
7403 * lib/hash.c: Include <stdbool.h> unconditionally.
7404 * m4/onceonly.m4 (m4_quote): New macro.
7405 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
7406 Quote AC_FOREACH variable-expansions properly.
7407 The 2003-01-03 obstack.h change also needs merging.
7408 {end of changes requiring merging}
7410 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7411 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
7412 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
7413 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
7414 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
7415 New files, imported from gnulib.
7416 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
7419 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
7420 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
7423 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
7425 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
7426 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
7427 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
7428 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
7429 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
7430 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
7431 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
7432 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
7433 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
7434 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
7435 (jm_PREREQ_ARGMATCH): Remove.
7436 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
7437 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
7439 * src/system.h: Include <stdbool.h> unconditionally.
7441 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
7442 assuming at least C89 in the bitset code for some time now.
7444 2003-03-03 Akim Demaille <akim@epita.fr>
7448 2003-03-02 Akim Demaille <akim@epita.fr>
7450 * doc/bison.texinfo (Table of Symbols): Reactivate the
7451 documentation for %lex-param, and %parse-param.
7453 2003-03-02 Akim Demaille <akim@epita.fr>
7455 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
7456 generate verbose error messages.
7457 Use the number of tokens as an upper bound in yytname, as it
7458 cannot be a non terminal.
7460 2003-03-02 Akim Demaille <akim@epita.fr>
7462 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
7465 2003-03-02 Akim Demaille <akim@epita.fr>
7467 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
7468 Use them to exercise yycheck overrun.
7469 Based on Andrew Suffield's grammar.
7471 2003-03-02 Akim Demaille <akim@epita.fr>
7473 Create tests/local.at for Bison generic testing macros.
7475 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
7476 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
7478 * tests/calc.at (AT_CHECK_CALC): Adjust.
7479 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
7480 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
7481 * tests/local.at: here.
7482 (AT_COMPILE_CXX): Tags the tests using it as c++.
7483 Ignore the test if CXX is not functional.
7485 2003-03-01 Paul Eggert <eggert@twinsun.com>
7487 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
7488 not loc->end, since loc->end might contain garbage and this leads
7489 to undefined behavior on some platforms.
7490 (id_loc, token_start): Use (IF_LINTed) initial values that do not
7491 depend on *loc, so that the reader doesn't give the the false
7492 impression that *loc is initialized.
7493 (<INITIAL>"%%"): Do not bother setting code_start, since its value
7494 does not survive the return.
7496 2003-03-01 Akim Demaille <akim@epita.fr>
7498 * src/scan-gram.l (code_start): Always initialize it when entering
7499 into yylex, as SC_EPILOGUE is activated *before* the corresponding
7500 yylex invocation. An alternative would be making it static, but
7501 then it starts with the second %%'s beginning, instead of its end.
7503 2003-02-28 Paul Eggert <eggert@twinsun.com>
7505 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
7506 around a UnixWare 7.1.1 porting bug reported by John Hughes in
7507 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
7509 2003-02-26 Paul Eggert <eggert@twinsun.com>
7511 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
7512 Remove Sequent/Pyramid discussion (nobody uses them any more).
7513 Merge VMS and MS-DOS discussion; these ports may well be dead
7514 but let's keep mentioning them for now. Put <> around email
7515 addresses. Add copyright notice.
7517 2003-02-24 Paul Eggert <eggert@twinsun.com>
7519 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7520 to avoid collision with flex use of yylineno.
7521 Problem reported by Bruce Lilly in
7522 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
7523 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7524 * data/yacc.c (yy_reduce_print): Likewise.
7526 * config/depcomp: Sync with Automake 1.7.3.
7528 2003-02-21 Akim Demaille <akim@epita.fr>
7530 * data/lalr1.cc: Use temporary variables instead of casts to
7531 change integer types.
7532 Suggested by Paul Eggert.
7534 2003-02-21 Akim Demaille <akim@epita.fr>
7536 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7537 to avoid confusions with lalr1.cc's notion of Position.
7538 Suggested by Paul Eggert.
7540 2003-02-20 Akim Demaille <akim@epita.fr>
7542 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7543 before initial_columns.
7544 (location.hh): Use consistent variable names when defining the
7546 Use "last" so that we subtract from Positions, not from unsigned.
7548 2003-02-20 Akim Demaille <akim@epita.fr>
7550 * data/lalr1.cc (position.hh): New subfile, including the extended
7551 and Doxygen'ed documentation of class Position.
7552 (location.hh): Use it.
7553 Document a` la Doxygen.
7554 With the help of Benoit Perrot.
7556 2003-02-20 Akim Demaille <akim@epita.fr>
7558 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7560 Redefine AT_YYERROR_SEES_LOC_IF using it.
7561 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7563 Don't use the location in yy::Parser::error_ and
7564 yy::Parser::print_ when not %locations.
7565 Activate more lalr1.cc tests.
7567 2003-02-19 Akim Demaille <akim@epita.fr>
7569 * data/lalr1.cc: When displaying a line number, be sure to make it
7572 2003-02-19 Akim Demaille <akim@epita.fr>
7574 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7576 (YYABORT, YYACCEPT, YYERROR): New.
7577 * tests/calc.at: Renable the lalr1.cc test.
7579 2003-02-19 Akim Demaille <akim@epita.fr>
7581 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7582 error recovery, mixing with/without pops and discarding of the
7585 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7587 2003-02-17 Paul Eggert <eggert@twinsun.com>
7589 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7590 * tests/testsuite.at (AT_COMPILE): Use them.
7591 This fixes the testsuite problem reported by Robert Lentz in
7592 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
7594 2003-02-12 Paul Eggert <eggert@twinsun.com>
7596 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7597 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
7598 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
7599 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7600 Check for malloc failure, for consistency with yacc.c.
7601 (yytname_size): Remove, for consistency with yacc.c.
7603 The bug still remains in data/lalr1.cc, as I didn't have time
7606 2003-02-06 Akim Demaille <akim@epita.fr>
7608 * configure.ac (GXX): Rename as...
7609 (CXX): this, to keep the original Autoconf semantics.
7611 * data/lalr1.cc: Fix b4_copyright invocations.
7612 If YYDEBUG is not defined, don't depend upon name_ being defined.
7613 (location.hh): Include string and iostream.
7614 (Position::filename): New member.
7615 (Position::Position ()): New.
7616 (operator<< (Position)): New.
7617 (operator- (Position, int)): New.
7618 (Location::first, Location::last): Rename as...
7619 (Location::begin, Location::end): these, to mock the conventional
7621 (operator<< (Location)): New.
7622 * tests/atlocal.in (CXX): New.
7623 * tests/testsuite.at (AT_COMPILE_CXX): New.
7624 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7625 locations in a more synthetic way.
7626 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7628 Adjust the C locations to match those from Emacs: first column is
7630 Change all the expected results.
7631 Conform to the GCS: simplify the locations when applicable.
7632 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7633 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7634 these CPP macros with the m4 macros new defined by...
7635 (AT_CHECK_PUSHDEFS): this, i.e.:
7636 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
7637 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7639 (AT_CHECK_POPDEFS): Undefine them.
7640 (AT_CHECK_CALC_LALR1_CC): New.
7641 Use it for the first lalr1.cc test.
7643 2003-02-04 Akim Demaille <akim@epita.fr>
7645 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7646 Location as is defined.
7648 2003-02-04 Akim Demaille <akim@epita.fr>
7650 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7651 name_ being defined.
7653 2003-02-03 Paul Eggert <eggert@twinsun.com>
7655 * src/gram.h (start_symbol): Remove unused decl.
7657 Use more-consistent naming conventions for local vars.
7659 * src/derives.c (derives_compute): Change type of local var from
7661 * src/gram.c (grammar_rules_partial_print): Likewise.
7662 * src/print.c (print_core): Likewise.
7663 * src/reduce.c (reduce_grammar_tables): Likewise.
7665 * src/gram.c (grammar_dump): Change name of item_number *
7666 local var from r to rp.
7667 * src/nullable.c (nullable_compute): Likewise.
7669 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7671 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7672 for symbol or symbol_number var.
7673 * src/reader.c (grammar_start_symbol_set): Likewise.
7674 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7676 * src/state.c (transitions_to): Likewise.
7677 * src/state.h: Likewise.
7678 * src/tables.c (symbol_number_to_vector_number): Likewise.
7680 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7683 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7686 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7689 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7690 Use str, not s, for char * var. Use ch, not c, for character var.
7691 Use size for size var.
7693 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7695 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7697 * src/uniqstr.h: Likewise.
7699 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7700 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7701 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7702 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7703 param to have same name as that of enum, so that we don't use
7704 "s" to stand for a non-state.
7706 2003-02-02 Akim Demaille <akim@epita.fr>
7708 * src/scan-skel.l: Scan more than one inert character per yylex
7711 2003-02-01 Paul Eggert <eggert@twinsun.com>
7715 * po/LINGUAS: Add ms.
7717 2003-01-30 Akim Demaille <akim@epita.fr>
7719 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7721 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7723 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7726 Changes in response to error report by S. Eken: GLR mode does not
7727 handle negative $ indices or $ indices in embedded rules correctly.
7728 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
7730 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7731 (b4_rhs_location): Ditto.
7732 (yyfill): New function to copy from stack tree into array
7734 (yyuserAction): Modify to allow incremental move of semantic values
7735 to rhs array when in GLR mode.
7736 Define YYFILL to use in user-defined actions to fill semantic array
7738 Remove dummy use of yystack, as there is now a guaranteed use.
7739 (yydoAction): Modify to allow incremental move of semantic values
7740 to rhs array when in GLR mode.
7741 (yyresolveAction): Ditto.
7742 (yyglrShiftDefer): Update comment.
7743 (yyresolveStates): Use X == NULL for pointers, not !X.
7744 (yyglrReduce): Ditto.
7747 * tests/glr-regr1.at: Rename to ...
7748 * tests/glr-regression.at: Add new regression test for the problems
7749 described above (adapted from S. Eken).
7750 Update copyright notice.
7751 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7752 * tests/Makefile.am: Ditto.
7754 2003-01-28 Paul Eggert <eggert@twinsun.com>
7756 * data/lalr1.cc: Do not use @output_header_name@ unless
7757 b4_defines_flag is set. This fixes two bugs reported by
7759 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7760 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
7762 2003-01-21 Paul Eggert <eggert@twinsun.com>
7764 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7765 we don't need to worry about yyerrlab1 being reported as an
7766 "unused label" by non-GCC C compilers. The downside is that if
7767 locations are used then a couple of statements are duplicated each
7768 time YYERROR is invoked, but the upside is that the warnings
7770 (yyerrlab1): Move code to YERROR.
7771 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7772 This reverts some of the 2002-12-27 change.
7774 2003-01-17 Paul Eggert <eggert@twinsun.com>
7776 * src/output.c (symbol_printers_output): Fix typo that led
7777 to core dump. Problem reported by Antonio Rus in
7778 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
7780 2003-01-13 Akim Demaille <akim@epita.fr>,
7781 Quoc Peyrot <chojin@lrde.epita.fr>,
7782 Robert Anisko <anisko_r@lrde.epita.fr>
7784 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7785 when the stacks contain one element, as the loop would otherwise
7786 free the last state, and then use the top state (the one we just
7787 popped). This means that the initial elements will not be freed
7788 explicitly, as is the case in yacc.c; it is not a problem, as
7789 these elements have fake values.
7791 2003-01-11 Paul Eggert <eggert@twinsun.com>
7793 * NEWS: %expect-violations are now just warnings, reverting
7794 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7795 bootstrapping problem reported by Matthias Klose; see
7796 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
7797 * src/conflicts.c (conflicts_print): Likewise.
7798 * tests/conflicts.at (%expect not enough, %expect too much,
7799 %expect with reduce conflicts): Likewise.
7800 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7801 that the warning is enabled if the number of conflicts changes
7802 (not necessarily increases).
7804 * src/getargs.c (version): Update copyright year.
7806 2003-01-09 Akim Demaille <akim@epita.fr>
7808 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7810 2003-01-08 Paul Eggert <eggert@twinsun.com>
7812 * Makefile.maint (WGETFLAGS):
7813 New macro, containing "-C off" to disable proxy caches.
7814 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7815 (rel-check): Use $(WGET) instead of wget.
7817 2003-01-06 Paul Eggert <eggert@twinsun.com>
7819 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7820 the GLR paper of Scott, Johnstone and Hussain.
7822 2003-01-04 Paul Eggert <eggert@twinsun.com>
7824 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7825 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7826 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7827 (EXTRA_LIBRARIES): New var, for liby.a.
7828 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7829 (EXTRA_SCRIPTS): New var, for yacc.
7831 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7832 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7833 Problem reported by Nelson H. F. Beebe.
7835 2003-01-03 Paul Eggert <eggert@twinsun.com>
7837 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7838 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7839 when compiling Bison 1.875's `bitset bset = obstack_alloc
7840 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7842 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7843 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7844 grow to a huge size with typical invocation.
7846 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7847 Use the pattern recommended by Autoconf 2.57, except also protect
7848 against double-definition.
7849 * src/system.h: Likewise.
7850 Portability issues reported by Nelson H. F. Beebe.
7852 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7853 All uses changed. Provide a definition in both C and C++.
7854 (yytrue, yyfalse): Define even if defined (__cplusplus).
7856 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7857 Reported by Nelson H. F. Beebe.
7859 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7861 2003-01-02 Paul Eggert <eggert@twinsun.com>
7863 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7864 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7865 Bug reported by Nelson H. F. Beebe.
7867 2003-01-01 Paul Eggert <eggert@twinsun.com>
7871 2002-12-30 Paul Eggert <eggert@twinsun.com>
7873 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7875 (<INITIAL>","): Here. This causes stray "," to be treated
7878 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
7879 last brace in braced code when not in Yacc mode, for compatibility
7880 with Bison 1.35. This resurrects the 2001-12-15 patch to
7883 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7884 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7886 2002-12-28 Paul Eggert <eggert@twinsun.com>
7888 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7889 that of SYM's type. This fixes Debian bug 168069, reported by
7892 2002-12-28 Paul Eggert <eggert@twinsun.com>
7896 Switch back to the Yacc style of conflict reports, undoing some
7897 of the 2002-07-30 change.
7898 * doc/bison.texinfo (Understanding): Use Yacc style for
7899 conflict reports. Also, use new way of locating rules.
7900 * src/conflicts.c (conflict_report):
7901 Renamed from conflict_report_yacc, removing the old
7902 'conflict_report'. Translate the entire conflict report at once,
7903 so that we don't assume that "," has the same interpretation in
7905 (conflicts_output): Use Yacc-style conflict report for each state,
7906 instead of our more-complicated style.
7907 (conflicts_print): Use Yacc-style conflict report, except print
7908 the input file name when not emulating Yacc.
7909 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7910 Conflicted Reduction, %expect not enough, %expect too much,
7911 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7912 * tests/existing.at (GNU Cim Grammar): Likewise.
7913 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7915 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7916 fatal): Don't invoke fflush; it's not needed and it might even be
7917 harmful for stdout, as stdout might not be open.
7918 * src/reduce.c (reduce_print): Likewise.
7920 2002-12-27 Paul Eggert <eggert@twinsun.com>
7922 Fix a bug where error locations were not being recorded correctly.
7923 This problem was originally reported by Paul Hilfinger in
7924 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
7926 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7927 top of the location stack's error locations.
7928 (yyerrlab): Set it. When discarding a token, push its location
7929 onto yylerrsp so that we don't lose track of the error's end.
7930 (yyerrlab1): Now is only the target of YYERROR, so that we can
7931 properly record the location of the action that failed. For GCC
7932 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7933 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7934 (yyerrlab2): New label, which yyerrlab now falls through to.
7935 Compute the error's location by applying YYLLOC_DEFAULT to
7936 the locations of all the symbols that went into the error.
7937 * doc/bison.texinfo (Location Default Action): Mention that
7938 YYLLOC_DEFAULT is also invoked for syntax errors.
7939 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7940 Error locations include the locations of all the tokens that were
7941 discarded, not just the last token.
7943 2002-12-26 Paul Eggert <eggert@twinsun.com>
7945 * src/files.c: Include quote.h.
7946 (compute_output_file_names): Warn if we detect conflicting
7947 outputs to the same file. This should catch the misunderstanding
7948 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7950 * src/conflicts.c (conflicts_print): If the user specifies
7951 "%expect N", report an error if there are any reduce/reduce
7952 conflicts. This is what the manual says should happen.
7953 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7954 * tests/conflicts.at (%expect with reduce conflicts): New test.
7956 Don't use m4_include on relative file names, as it doesn't work as
7957 desired if there happens to be a file with that name under ".".
7959 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7960 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7961 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7962 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7963 * src/output.c (output_skeleton): Use full path names when
7964 specifying a file to include; don't rely on include path, as
7965 it's unreliable when the working file contains a file with
7968 2002-12-25 Paul Eggert <eggert@twinsun.com>
7970 Remove obsolete references to bison.simple and bison.hairy.
7971 Problem mentioned by Aubin Mahe in
7972 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
7973 * data/glr.c: Comment fix.
7974 * doc/bison.1: Remove references. Also, mention "yacc".
7976 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7979 * src/parse-gram.y (declaration): Use enum "report_states" rather
7980 than its numeric value 1.
7982 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7983 opening a new one. This fixes Debian bug 165349, reported by
7986 2002-12-24 Paul Eggert <eggert@twinsun.com>
7990 * Makefile.maint (cvs-update): Don't assume that the shell
7991 supports $(...), as Solaris sh doesn't.
7993 * src/parse-gram.y (lloc_default): Remove test for empty
7994 nonterminals at the end, since it didn't change the result.
7996 2002-12-24 Paul Eggert <eggert@twinsun.com>
7998 If the user does not define YYSTYPE as a macro, Bison now declares it
7999 using typedef instead of defining it as a macro. POSIX requires this.
8000 For consistency, YYLTYPE is also declared instead of defined.
8002 %union directives can now have a tag before the `{', e.g., the
8003 directive `%union foo {...}' now generates the C code
8004 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
8005 The default union tag is `YYSTYPE', for compatibility with Solaris 9
8006 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
8007 instead of `yyltype'.
8009 `yystype' and `yyltype' are now obsolescent macros instead of being
8010 typedefs or tags; they are no longer documented and will be
8011 withdrawn in a future release.
8013 * data/glr.c (b4_location_type): Remove.
8014 (YYSTYPE): Renamed from yystype.
8015 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
8016 (struct YYLTYPE): Renamed from struct yyltype.
8017 (YYLTYPE): Renamed from yyltype.
8018 (yyltype, yystype): New (and obsolescent) macros,
8019 for backward compatibility.
8020 * data/yacc.c: Likewise.
8022 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
8023 does not specify a union tag. This is for compatibility with
8026 * src/parse-gram.y (add_param): 2nd arg is now char * not char
8027 const *, since it is now modified by stripping surrounding { }.
8028 (current_braced_code): Remove.
8029 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
8030 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
8031 trailing " {...}". Now of type <chars>.
8032 (grammar_declaration): Adjust to bundled tokens.
8033 (code_content): Remove; stripping is now done by add_param.
8034 (print_token_value): Print contents of bundled tokens.
8035 (token_name): New function.
8037 * src/reader.h (braced_code, current_braced_code): Remove.
8038 (token_name): New decl.
8040 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
8041 token_type, not braced_code code_kind. All uses changed.
8042 (SC_PRE_CODE): New state, for scanning after a keyword that
8043 has (or usually has) an immediately-following braced code.
8044 (token_type): New local var, to keep track of which token type
8045 to return when scanning braced code.
8046 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
8047 <INITIAL>"%parse-param", <INITIAL>"%printer",
8048 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
8049 instead of returning a token type immediately.
8050 (<INITIAL>"{"): Set token type.
8051 (<SC_BRACED_CODE>"}"): Use it.
8052 (handle_action_dollar, handle_action_at): Now returns bool
8053 indicating success. Fail if ! current_rule; this prevents a core dump.
8054 (handle_symbol_code_dollar, handle_symbol_code_at):
8055 Remove; merge body into caller.
8056 (handle_dollar, handle_at): Complain in invalid contexts.
8058 * NEWS, doc/bison.texinfo: Document the above.
8059 * NEWS: Fix years and program names in copyright notice.
8061 2002-12-17 Paul Eggert <eggert@twinsun.com>
8063 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
8064 Reporting, Table of Symbols): Omit mentions of %lex-param and
8065 %parse-param from the documentation for now.
8067 2002-12-15 Paul Eggert <eggert@twinsun.com>
8069 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
8070 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
8071 lookahead symbol, and which sets yychar in parser actions) and it
8072 disagreed with the Bison documentation. Bug
8073 reported by Andrew Walrond.
8075 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
8076 as the caller now does that.
8077 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
8078 (YYEMPTY): Parenthesize right hand side, since others use it.
8079 (yyparse): Don't assume that our generated code is the only code
8082 2002-12-13 Paul Eggert <eggert@twinsun.com>
8086 POSIX requires a "yacc" command.
8087 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
8088 (MOSTLYCLEANFILES): Add yacc.
8090 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
8091 as an alias for bison y.
8093 * po/LINGUAS: Add da.
8095 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
8096 problem with latest <getopt.h>.
8097 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
8099 * doc/fdl.texi: Upgrade to 1.2.
8100 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
8101 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
8102 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
8104 * config/install-sh: Sync with autotools.
8106 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
8107 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8108 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
8109 locations are requested.
8110 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
8111 locations are requested.
8113 2002-12-12 Paul Eggert <eggert@twinsun.com>
8115 Remove unportable casts and storage allocation tricks.
8116 While we're at it, remove almost all casts, since they
8117 usually aren't needed and are a sign of trouble.
8119 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
8121 * src/derives.c (derives_compute): Do not subtract NTOKENS from
8122 the pointer DSET returned by malloc; this isn't portable.
8123 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
8124 Similarly for DERIVES.
8125 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
8126 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
8127 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
8129 * src/derives.c (derives_compute): Do not bother invoking
8130 int_of_rule_number, since rule numbers are integers.
8132 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
8133 rather than XMALLOC (char, N).
8135 * src/files.c (filename_split): Rewrite to avoid cast.
8137 * src/gram.h (symbol_number_as_item_number,
8138 item_number_as_symbol_number, rule_number_as_item_number,
8139 item_number_as_rule_number):
8140 Now inline functions rather than macros, to avoid casts.
8141 * src/state.h (state_number_as_int): Likewise.
8142 * src/tables.c (state_number_to_vector_number,
8143 symbol_number_to_vector_number): Likewise.
8145 * src/gram.h (int_of_rule_number): Remove; no longer used.
8147 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
8148 since the resulting storage is always stored into.
8150 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
8153 * src/muscle_tab.c (muscle_m4_output):
8154 Now inline. Return bool, not int.
8155 * src/state.c (state_compare): Likewise.
8156 * src/symtab.c (symbol_check_defined,
8157 symbol_check_alias_consistency, symbol_pack, symbol_translation,
8158 hash_compare_symbol, hash_symbol):
8160 * src/uniqstr.c (uniqstr_print): Likewise.
8161 * src/muscle_tab.c (muscle_m4_output_processor):
8162 New function, to avoid casts.
8163 * src/state.c (state_comparator, stage_hasher): Likewise.
8164 * src/symtab.c (symbol_check_defined_processor,
8165 symbol_check_alias_consistency_processor, symbol_pack_processor,
8166 symbol_translation_processor, hash_symbol_comparator,
8167 hash_symbol_hasher): Likewise.
8168 * src/uniqstr.c (uniqstr_print_processor): Likewise.
8169 * src/muscle_tab.c (muscles_m4_output):
8170 Use new functions instead of casting old functions unportably.
8171 * src/state.c (state_hash_new): Likewise.
8172 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
8173 symbols_token_translations_init):
8175 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
8177 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
8178 var instead of casting to long, to avoid casts.
8179 (prepare_states): Use MALLOC rather than alloca, so that we don't
8180 have to worry about alloca.
8181 * src/state.c (state_hash_lookup): Likewise.
8183 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
8184 local var instead of casting to unsigned char, to avoid casts.
8186 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
8187 STATE_ALLOC): Remove.
8188 (transitions_new, errs_new, reductions_new, state_new): Use malloc
8189 rather than calloc, and use offsetof to avoid allocating slightly
8191 (state_new): Initialize all members.
8193 * src/state.c (state_hash): Use unsigned accumulator, not signed.
8195 * src/symtab.c (symbol_free): Remove; unused.
8196 (symbol_get): Remove cast in lhs of assignment.
8197 (symbols_do): Now static. Accept generic arguments, not
8198 hashing-related ones.
8200 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
8201 (symbol_processor): Remove.
8202 (symbols_do): Remove decl; now static.
8204 * src/system.h (alloca): Remove; decl no longer needed.
8205 (<stddef.h>): Include, for offsetof.
8206 (<inttypes.>, <stdint.h>): Include if available.
8207 (uintptr_t): New type, if system lacks it.
8208 (CALLOC, MALLOC, REALLOC): New macros.
8209 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
8212 * src/tables.c (table_size): Now int, to pacify GCC.
8213 (table_grow, table_ninf_remap): Use signed table size.
8214 (save_row): Don't bother initializing locals when not needed.
8215 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
8216 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
8218 * src/vcg.h: Correct misspellings.
8220 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
8223 * src/getargs.c (getargs): Don't assume EOF == -1.
8225 2002-12-09 Paul Eggert <eggert@twinsun.com>
8227 Change identifier spellings to avoid collisions with names
8228 that are reserved by POSIX.
8230 Don't use names ending in _t, since POSIX reserves them.
8231 For consistency, remove _e and _s endings -- they're weren't
8232 needed to remove ambiguity. All uses changed.
8233 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
8234 turn was just renamed from struniq_t.
8235 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
8236 which in turn was just renamed from struniq_processor_t.
8237 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
8238 in turn was renamed from hash_compare_struniq_t.
8239 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
8240 (state_list): Renamed from state_list_t.
8241 * src/assoc.h (assoc): Renamed from assoc_t.
8242 * src/conflicts.c (enum conflict_resolution): Renamed from
8243 enum conflict_resolution_e.
8244 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
8245 (rule_list): Renamed from rule_list_t.
8246 * src/getargs.h (enum trace): Renamed from enum trace_e.
8247 (enum report): Renamed from enum report_e.
8248 * src/gram.h (item_number): Renamed from item_number_t.
8249 (rule_number): Renamed from rule_number_t.
8250 (struct rule_s): Remove the "rule_s" part; not used.
8251 (rule): Renamed from rule_t.
8252 (rule_filter): Renamed from rule_filter_t.
8253 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
8254 (goto_list): Renamed from goto_list_t.
8255 * src/lalr.h (goto_number): Renamed from goto_number_t.
8256 * src/location.h (location): Renamed from location_t.
8257 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
8258 and moved here from:
8259 * src/muscle_tab.h (muscle_entry_t): here.
8260 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
8261 (rule_list): Renamed from rule_list_t.
8262 * src/print_graph.c (static_graph): Renamed from graph.
8263 * src/reader.h (braced_code): Renamed from braced_code_t.
8264 Remove brace_code_e tag.
8265 * src/relation.h (relation_node): Renamed from relation_node_t.
8266 (relation_nodes): Renamed from relation_nodes_t.
8267 (relation): Renamed from relation_t.
8268 * src/state.h (state_number): Renamed from state_number_t.
8269 (struct state): Renamed from struct state_s.
8270 (state): Renamed from state_t.
8271 (transitions): Renamed from transitions_t. Unused (and
8272 misspelled) transtion_s tag removed.
8273 (errs): Renamed from errs_t. Unused errs_s tag removed.
8274 (reductions): Renamed from reductions_t. Unused tag
8275 reductions_s removed.
8276 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
8277 (struct symbol_list): Renamed from struct symbol_list_s.
8278 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
8279 (struct symbol): Renamed from struct symbol_s.
8280 (symbol): Renamed from symbol_t.
8281 * src/tables.c (vector_number): Renamed from vector_number_t.
8282 (action_number): Renamed from action_t.
8283 * src/tables.h (base_number): Renamed from base_t.
8284 * src/vcg.h (enum color): Renamed from enum color_e.
8285 (enum textmode): Renamed from enum textmode_e.
8286 (enum shape): Renamed from enum shape_e.
8287 (struct colorentry): Renamed from struct colorentry_s.
8288 (struct classname): Renamed from struct classname_s.
8289 (struct infoname): Renamed from struct infoname_s.
8290 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
8291 (enum decision): Renamed from enum decision_e.
8292 (enum orientation): Renamed from enum orientation_e.
8293 (enum alignment): Renamed from enum alignment_e.
8294 (enum arrow_mode): Renamed from enum arrow_mode_e.
8295 (enum crossing_type): Renamed from enum crossing_type_e.
8296 (enum view): Renamed from enum view_e.
8297 (struct node): Renamed from struct node_s.
8298 (node): Renamed from node_t.
8299 (enum linestyle): Renamed from enum linestyle_e.
8300 (enum arrowstyle): Renamed from enum arrowstyle_e.
8301 (struct edge): Renamed from struct edge.
8302 (edge): Renamed from edge_t.
8303 (struct graph): Renamed from struct graph_s.
8304 (graph): Renamed from graph_t.
8305 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
8306 Rename value_t -> value.
8307 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
8308 value_t_as_yystype -> value_as_yystype.
8310 Don't include <errno.h> in the mainstream code, since it
8311 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
8312 * lib/get-errno.c, lib/get-errno.h: New files.
8313 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
8315 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
8316 * src/output.c (output_skeleton): Likewise.
8317 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
8319 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
8321 (handle_action_dollar, handle_action_at): Likewise.
8322 * src/system.h: Do not include <errno.h>.
8323 (TAB_EXT): Renamed from EXT_TAB.
8324 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
8326 Avoid str[a-z]*, since <string.h> reserves that name space.
8327 Change all instances of "struniq" in names to "uniqstr", and
8328 likewise for "STRUNIQ" and "UNIQSTR".
8329 * src/uniqstr.c: Renamed from src/struniq.c.
8330 * src/uniqstr.h: Renamed from src/struniq.h.
8331 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
8332 * src/files.c (strsuffix): Remove; unused.
8333 (concat2): Renamed from stringappend. Now static.
8334 * src/files.h (strsuffix, stringappend): Remove; unused.
8335 * src/parse-gram.y (<chars>): Renamed from <string>.
8336 (<uniqstr>): Renamed from <struniq>.
8337 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
8338 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
8339 (struct graph_s.expand): Renamed from struct graph_s.stretch.
8340 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
8341 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
8342 (N_EXPAND): Renamed from N_STRETCH.
8344 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
8345 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
8346 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
8348 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
8349 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
8350 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
8351 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
8352 (BASE_MAXIMUM): Renamed from BASE_MAX.
8353 (BASE_MINIMUM): Renamed from BASE_MIN.
8354 (ACTION_MAX): Remove; unused.
8355 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
8356 Unnecessary casts removed from above defines.
8359 Fix misspelling in names.
8360 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
8361 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
8365 * lib/timevar.c (timevar_report): Renamed from time_report,
8366 for consistency with other names.
8367 * lib/timevar.h (timevar_report): New decl.
8368 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
8371 Sort include-file uses.
8373 Reorder all include files under src to be in the order "system.h".
8374 then the ../lib include files in angle brackets (alphabetized),
8375 then the . include files in double-quotes (alphabetized). Fix
8376 dependency breakages encountered in this process, as follows:
8377 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
8378 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
8379 * src/state.h: Include "symtab.h".
8381 2002-12-08 Paul Eggert <eggert@twinsun.com>
8383 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
8384 since this causes problems when __file__ contains character
8385 sequences like "@" that are treated specially by src/scan-skel.l.
8386 Instead, just use the file's basename. This fixes the bug
8387 reported by Martin Mokrejs in
8388 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
8390 2002-12-06 Paul Eggert <eggert@twinsun.com>
8392 Add support for rules that do not have trailing semicolons, as
8393 POSIX requires. Improve the quality of locations in Bison
8396 * src/location.c: Include <quotearg.h>.
8397 (empty_location): Now const.
8398 (location_print): New function. Follow the recommendation of the
8399 GNU Coding Standards for locations that span file boundaries.
8400 * src/location.h: Do not include <quotearg.h>; no longer needed.
8401 (boundary): New type.
8402 (location_t): Use it. This allows locations to span file boundaries.
8403 All member uses changed: file -> start.file or end.file (as needed),
8404 first_line -> start.line, first_column -> start.column,
8405 last_line -> end.line, last_column -> end.column.
8406 (equal_boundaries): New function.
8407 (LOCATION_RESET, LOCATION_STEP): Remove.
8408 (LOCATION_PRINT): Remove. All callers changed to use location_print.
8409 (empty_location): Now const.
8410 (location_print): New decl.
8411 * src/parse-gram.y (lloc_default): New function, which handles
8412 empty locations more accurately.
8413 (YYLLOC_DEFAULT): Use it.
8414 (%token COLON): Remove.
8415 (%token ID_COLON): New token.
8417 (declarations, rules): Remove trailing semicolon.
8418 (declaration, rules_or_grammar_declaration):
8419 Allow empty (";") declaration.
8420 (symbol_def): Remove empty actions; no longer needed.
8421 (rules_or_grammar_declaration): Remove trailing semicolon.
8422 (semi_colon.opt): Remove.
8423 * src/reader.h: Include location.h.
8424 (scanner_cursor): New decl.
8425 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
8427 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
8429 (STEP): Remove. No longer needed, now that adjust_location does
8430 the work. All uses removed.
8431 (scanner_cursor): New var.
8432 (adjust_location): Renamed from extend_location. It now sets
8433 *loc and adjusts the scanner cursor. All uses changed.
8434 Don't bother testing for CR.
8435 (handle_syncline): Remove location arg; now updates scanner cursor.
8436 All callers changed.
8437 (unexpected_end_of_file): Now accepts start boundary of token or
8438 comment, not location. All callers changed. Update scanner cursor,
8440 (SC_AFTER_IDENTIFIER): New state.
8441 (context_state): Renamed from c_context. All uses changed.
8442 (id_loc, code_start, token_start): New local vars.
8443 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
8444 processing of Yacc white space and equivalents here.
8445 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
8446 instead of returning ID immediately, since we need to search for
8448 (<INITIAL>"'", "\""): Save token_start.
8449 (<INITIAL>"%{", "{", "%%"): Save code_start.
8450 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
8451 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
8452 BEGIN context_state at end, not INITIAL.
8453 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
8454 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
8455 Return correct token start.
8456 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
8457 the start of a character, string or multiline comment is found.
8458 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
8459 Reduction): Adjust reported locations to match the more-precise
8460 results now expected.
8461 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
8462 * tests/reduce.at (Useless Rules, Reduced Automaton,
8463 Underivable Rules): Likewise.
8464 * tests/regression.at (Invalid inputs): No longer `expecting ";"
8465 or "|"' now that so many other tokens are allowed by the new grammar.
8467 * src/complain.h (current_file): Remove duplicate decl;
8468 current_file is now owned by files.h.
8469 * src/complain.c, src/scan-gram.l: Include files.h.
8471 2002-12-06 Paul Eggert <eggert@twinsun.com>
8473 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
8474 promotes to int; it might be unsigned int.
8475 * data/yacc.c (yy_reduce_print): Likewise.
8477 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
8478 be #defined in the prologue, not in the Bison declarations.
8479 This fixes Debian Bug 102878, reported by Shaul Karl.
8481 2002-12-02 Paul Eggert <eggert@twinsun.com>
8483 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
8484 * lib/strtoul.c: New file, from gnulib.
8485 This fixes a porting bug reported by Peter Klein in
8486 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
8488 2002-11-30 Paul Eggert <eggert@twinsun.com>
8490 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
8491 and put only a forward declaration in the prologue. This is for
8492 consistency with the other scanner helper functions.
8494 Type clashes now generate warnings, not errors, since it
8495 appears that POSIX may allow some grammars with type clashes.
8496 * src/reader.c (grammar_current_rule_check): Warn about
8497 type clashes instead of complaining.
8498 * tests/input.at (Type Clashes): Expect warnings, not complaints.
8500 Add Yacc library, since POSIX requires it.
8501 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
8502 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
8503 * lib/main.c, lib/yyerror.c: New files.
8505 gram_error can be static; it need not be extern.
8506 * src/reader.h (gram_error): Remove decl.
8507 * src/parse-gram.y (gram_error): Now static. Add static decl.
8508 (print_token_value): Omit parameter names from forward decl,
8511 2002-11-29 Paul Eggert <eggert@twinsun.com>
8513 * doc/bison.texinfo: Emphasize that yylex and yyerror must
8514 be declared before being used. E.g., one should typically
8515 declare them in the prologue. Use GNU coding style in examples.
8516 Put "const" consistently after the type it modifies. Mention
8517 that C99 supports "inline". Mention that yyerror traditionally
8520 %parse-param and %lex-param now take just one argument, the
8521 declaration; the argument name is deduced from the declaration.
8523 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8524 Reporting, Table of Symbols): Document this.
8525 * src/parse-gram.y (add_param): New function.
8527 (declaration): Implement new rule for %parse-param and %lex-param.
8528 * src/scan-gram.l: "," now elicits a warning, rather than being
8529 a token; this is more compatible with byacc.
8530 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8532 2002-11-27 Paul Eggert <eggert@twinsun.com>
8534 Rename identifiers to avoid real and potential collisions.
8536 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8537 to avoid collision with lex macro described by Bruce Lilly in
8538 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8539 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8540 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8541 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8543 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8544 The name "yycontrol" violates the name space rules, and this stuff
8545 wasn't being used anyway.
8546 (input): Remove action; this stuff wasn't being used.
8547 (gram_error): Rename local variable yylloc -> loc.
8548 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8549 (YY_DECL): Don't use "yy" at start of local variables.
8550 All uses changed, e.g., yylloc -> loc.
8551 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8552 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8553 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8554 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8556 * src/parse-gram.y (gram_error): loc is now const *.
8557 * src/reader.h (gram_error): Likewise.
8559 2002-11-24 Paul Eggert <eggert@twinsun.com>
8563 * tests/actions.at (Actions after errors): Use an output format
8564 more similar to that of the Printers and Destructors test.
8565 Test the position of the ';' token too.
8566 (Printers and Destructors): Likewise.
8567 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8568 unnecessarily alarming people when the test fails.
8570 * data/yacc.c (yyerrlab1): Move this label down, so that the
8571 parser does not discard the lookahead token if the user code
8572 invokes YYERROR. This change is required for POSIX conformance.
8574 * lib/error.c: Sync with gnulib.
8576 2002-11-22 Paul Eggert <eggert@twinsun.com>
8578 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8579 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8580 * lib/xmalloc.c: Likewise.
8582 2002-11-20 Paul Eggert <eggert@twinsun.com>
8584 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8586 2002-11-20 Paul Eggert <eggert@twinsun.com>
8588 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8589 should use `if (! x) abort ();' rather than `assert (x);', and
8590 anyway it's one less thing to worry about configuring.
8592 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8593 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8594 and replace all instances of assert with abort.
8595 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8596 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8598 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8599 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8600 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8601 hash_find_entry, hash_rehash, hash_insert): Likewise.
8602 * src/conflicts.c (resolve_sr_conflict): Likewise.
8603 * src/lalr.c (set_goto_map, map_goto): Likewise.
8604 * src/nullable.c (nullable_compute): Likewise.
8605 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8606 * src/reader.c (packgram, reader): Likewise.
8607 * src/state.c (state_new, state_free, state_transitions_set,
8608 state_reduction_find): Likewise.
8609 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8610 symbol_pack): Likewise.
8611 * src/tables.c (conflict_row, pack_vector): Likewise.
8612 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8613 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8614 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8615 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8617 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8618 (ARGMATCH_CONSTRAINT): New macro.
8619 (ARGMATCH_ASSERT): Use it.
8621 * src/system.h (verify): New macro.
8622 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8624 * src/tables.c (tables_generate): Likewise.
8626 * src/struniq.c (struniq_assert): Now returns void, and aborts
8627 if the assertion is false.
8628 (struniq_assert_p): Remove.
8629 * src/struniq.h: Likewise.
8631 2002-11-18 Paul Eggert <eggert@twinsun.com>
8633 * data/glr.c (yygetLRActions): Replace `yyindex' with
8634 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8635 This fixes the regression with Sun ONE Studio 7 cc that I reported in
8636 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
8638 2002-11-18 Akim Demaille <akim@epita.fr>
8640 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8642 From Tim Van Holder.
8644 2002-11-17 Paul Eggert <eggert@twinsun.com>
8646 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8647 to "SyntaxError" for consistency with my 2002-11-15 change.
8649 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8650 not define to {}, since this breaks the common use of `YYDPRINTF
8651 ((...));' if a single statement is desired (e.g. before `else').
8652 Work around GCC warnings by surrounding corresponding calls with
8654 (yyhasResolvedValue): Remove unused function.
8655 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8657 (yyreportSyntaxError): Renamed from yyreportParseError.
8658 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8660 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8661 extern when possible. Remove unused initializations.
8663 2002-11-16 Akim Demaille <akim@epita.fr>
8665 Augment the similarity between GLR and LALR traces.
8667 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8668 (YY_REDUCE_PRINT): New.
8669 (yyparse): Use them.
8670 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8672 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8673 state reached after the reduction/recovery, since...
8674 (yyparse, yyprocessOneStack): Report the state we are entering in.
8676 2002-11-16 Akim Demaille <akim@epita.fr>
8678 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8679 Add support for --trace=skeleton.
8680 * src/scan-skel.l: %option debug.
8681 Scan strings of non-@ or \n instead of character by character.
8682 (scan_skel): Handle trace_skeleton.
8684 (@output_parser_name@, @output_header_name@): ``Restore'' their
8685 support (used to be M4 macros).
8686 * data/yacc.c: Quote larger chunks, a la glr.c.
8687 * data/lalr1.cc: Likewise.
8688 The header guards are no longer available, so use some other
8689 string than `YYLSP_NEEDED'.
8691 2002-11-16 Akim Demaille <akim@epita.fr>
8693 Make the ``Printers and Destructors'' test more verbose, taking
8694 `yacc.c''s behavior as (possibly wrong) reference.
8696 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8697 instead of fprint on stdout.
8698 Set and report the last_line of the symbols.
8699 Consistently display values and locations.
8701 2002-11-16 Paul Eggert <eggert@twinsun.com>
8703 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8705 2002-11-15 Paul Eggert <eggert@twinsun.com>
8707 * tests/actions.at (Actions after errors): New test case.
8709 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8710 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8711 tests/action.at, tests/calc.at, tests/conflicts.at,
8712 tests/cxx-type.at, tests/regression.at:
8713 "parse error" -> "syntax error" for POSIX compatibility.
8714 "parsing stack overflow..." -> "parser stack overflow" so
8715 that code matches Bison documentation.
8717 2002-11-15 Akim Demaille <akim@epita.fr>
8719 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8720 take two BRACED_CODE, not two string_content.
8721 Free the scanner's obstack when we are done.
8722 (code_content): New.
8723 * tests/calc.at: Adjust.
8724 * doc/bison.texinfo: Adjust.
8725 Also, make sure to include the `,' for these declarations.
8727 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8729 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8730 definition; avoids potential autoreconf problems.
8732 2002-11-15 Akim Demaille <akim@epita.fr>
8734 Always check the value returned by yyparse.
8736 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8737 returned by yyparse.
8738 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8740 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8741 returned by yyparse.
8743 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8745 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8748 2002-11-14 Paul Eggert <eggert@twinsun.com>
8750 * src/output.c (output_skeleton): Call xfopen instead of
8751 duplicating xfopen's body.
8753 Fix bugs reported by Nelson H. F. Beebe in
8754 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
8756 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8757 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8758 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8759 file twice in the grammar, as an extra check.
8761 * tests/input.at (Torturing the Scanner): Surround the
8762 backslash-newline tests with "#if 0", to make it less likely that
8763 we'll run into compiler bugs. Bring back solitary \ inside
8764 comment, but add a closing comment to work around HP C bug. Don't
8765 test backslash-newline in C character constant.
8767 2002-11-14 Akim Demaille <akim@epita.fr>
8769 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8770 status of the compiler.
8771 Calling `exit 1' is no longer needed.
8772 Reported by Nelson H. F. Beebe.
8774 2002-11-14 Akim Demaille <akim@epita.fr>
8776 * tests/atlocal.in (CPPFLAGS): We have config.h.
8777 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8779 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8780 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8781 * tests/regression.at, tests/torture.at: Use them for all the
8782 grammars that are to be compiled.
8783 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8784 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8785 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8787 2002-11-14 Akim Demaille <akim@epita.fr>
8789 * doc/bison.texinfo: Various formatting changes (alignments in
8790 samples, additional @group/@end group, GCS in samples.
8791 Use @deffn instead of simple @table to define the directives,
8792 macros, variables etc.
8794 2002-11-13 Paul Eggert <eggert@twinsun.com>
8796 Fix some bugs reported by Albert Chin-A-Young in
8797 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
8799 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8800 -o c"; the HP C compiler chatters during compilation.
8801 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8802 * tests/headers.at (export YYLTYPE): Likewise.
8804 * tests/input.at (Torturing the Scanner): Remove lines containing
8805 solitary backslashes, as they tickle a bug in the HP C compiler.
8807 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8808 comments, since they're not portable. Use GNU coding style.
8810 2002-11-13 Akim Demaille <akim@epita.fr>
8812 * data/yacc.c: Leave bigger chunks of quoted text.
8813 (YYDSYMPRINTF): New.
8814 Use it to report symbol activities.
8815 * data/glr.c (YYDSYMPRINTF): New.
8818 2002-11-12 Paul Eggert <eggert@twinsun.com>
8822 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8823 (yyglrReduce): Return yyok, not 0.
8824 This should avoid the enumerated-type warnings reported
8825 by Nelson H. F. Beebe in
8826 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
8828 * lib/bbitset.h (BITSET_INLINE): Remove.
8829 * lib/bitset.h [! BITSET_INLINE]: Remove.
8830 (bitset_set, bitset_reset, bitset_test): Rename local vars
8831 to avoid shadowing warnings by GCC.
8833 * data/glr.c (inline): Remove #define. It's the user's
8834 responsibility to #define it away, just like 'const'.
8835 This fixes one of the bugs reported by Nelson H. F. Beebe in
8836 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
8838 * Makefile.maint (po-check): Scan .l and .y files instead of the
8839 .c and the .h files that they generate. This fixes the bug
8840 reported by Tim Van Holder in:
8841 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
8842 Look for N_ as well as for _. Try to avoid matching #define for
8844 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8845 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8846 * src/scan-gram.l: Revamp regular expressions so that " and '
8847 do not confuse xgettext.
8849 * src/struniq.h (struniq_new): Do not declare the return type
8850 to be 'const'; this violates the C standard.
8851 * src/struniq.c (struniq_new): Likewise.
8853 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8855 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8856 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8859 2002-11-12 Akim Demaille <akim@epita.fr>
8861 * Makefile.maint: Sync with Autoconf:
8862 (local_updates): New.
8864 2002-11-12 Akim Demaille <akim@epita.fr>
8866 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8868 2002-11-12 Akim Demaille <akim@epita.fr>
8870 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8873 2002-11-12 Akim Demaille <akim@epita.fr>
8875 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8878 2002-11-12 Akim Demaille <akim@epita.fr>
8880 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8881 Use it to test the GLR parser.
8883 2002-11-12 Akim Demaille <akim@epita.fr>
8885 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8887 * data/glr.c (yystos): New.
8888 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8890 (yyval): Don't define it, it is handled via M4.
8891 (yyrecoverParseError): Free verbosely the discarded symbols.
8892 * data/yacc.c (yysymprint): Remove, rather...
8893 (b4_yysymprint_generate): invoke.
8894 * data/c.m4 (b4_yysymprint_generate): New.
8895 Accept pointers as arguments, as opposed to the version from
8897 (b4_yydestruct_generate): Likewise.
8898 * tests/cations.at (Printers and Destructors): Use Bison directives
8899 instead of CPP macros.
8900 Don't rely on internal details.
8902 2002-11-12 Akim Demaille <akim@epita.fr>
8904 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8905 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8906 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8907 it against YYEMPTY and so forth), work on yytoken (i.e., set
8908 it to YYEMPTY etc.).
8909 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8910 (b4_symbol_actions): Remove.
8911 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8912 for 0, end-of-input.
8914 2002-11-12 Akim Demaille <akim@epita.fr>
8916 * doc/bison.texinfo (Destructor Decl): New.
8918 2002-11-12 Akim Demaille <akim@epita.fr>
8920 * src/tables.c (tables_generate): Use free for pointers that
8921 cannot be NULL, not XFREE.
8922 (pack_vector): Use assert, not fatal, for bound violations.
8923 * src/state.c (state_new): Likewise.
8924 * src/reader.c (reader): Likewise.
8925 * src/lalr.c (set_goto_map): Likewise.
8926 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
8929 2002-11-12 Akim Demaille <akim@epita.fr>
8931 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8933 * src/scan-gram.l (last_string): Is global to the file, not to
8935 * src/parse-gram.y (input): Don't append the epilogue here,
8936 (epilogue.opt): do it here, and free the scanner's obstack.
8937 * src/reader.c (epilogue_set): Rename as...
8938 (epilogue_augment): this.
8939 * data/c.m4 (b4_epilogue): Defaults to empty.
8941 2002-11-12 Akim Demaille <akim@epita.fr>
8943 * src/getargs.c (long_options): Remove duplicates.
8944 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8946 * doc/bison.rnh: Remove.
8947 * doc/bison.texinfo (VMS Invocation): Remove.
8949 2002-11-12 Akim Demaille <akim@epita.fr>
8951 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8952 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8954 Use struniq for symbols.
8956 * src/symtab.h (symbol_t): The tag member is a struniq.
8957 (symbol_type_set): Adjust.
8958 * src/symtab.c (symbol_new): Takes a struniq.
8959 (symbol_free): Don't free the tag member.
8960 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8961 (hash_compare_symbol, hash_symbol): these.
8962 Use the fact that tags as struniqs.
8963 (symbol_get): Use struniq_new.
8964 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8966 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8967 and type members are struniqs.
8968 * src/reader.c (get_merge_function)
8969 (grammar_current_rule_merge_set): Adjust.
8970 (TYPE, current_type): Are struniq.
8972 Use struniq for file names.
8974 * src/files.h, src/files.c (infile): Split into...
8975 (grammar_file, current_file): these.
8976 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8977 * src/reduce.c (reduce_print): Likewise.
8978 * src/getargs.c (getargs): Likewise.
8979 * src/complain.h, src/complain.c: Likewise.
8980 * src/main.c (main): Call struniqs_new early enough to use it for
8982 Don't free the input file name.
8984 2002-11-12 Akim Demaille <akim@epita.fr>
8986 * src/symtab.c (symbol_free): Remove dead deactivated code:
8987 type_name are properly removed.
8988 Don't use XFREE to free items that cannot be NULL.
8989 * src/struniq.h, src/struniq.c: New.
8990 * src/main.c (main): Initialize/free struniqs.
8991 * src/parse-gram.y (%union): Add astruniq member.
8993 * src/scan-gram.l (<{tag}>): Return a struniq.
8994 Free the obstack bit that used to store it.
8995 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8997 2002-11-11 Paul Eggert <eggert@twinsun.com>
8999 Revamp to fix many (but not all) of the C- and M4-related quoting
9000 problems. Among other things, this fixes the Bison bug reported
9001 by Jan Hubicka when processing the Bash grammar; see:
9002 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
9004 Use new @ escapes consistently. Represent brackets with @{ and @}
9005 rather than @<:@ and @:>@, since this works a bit better with dumb
9006 editors like vi. Represent @ with @@, since @ is now consistently
9007 an escape. Use @oline@ and @ofile@ rather than __oline__ and
9008 __ofile__, to avoid unexpected expansions. Similarly, use @output
9009 rather than #output.
9011 * data/c.m4 (b4_copyright): Omit file name from comment, since
9012 the file name could contain "*/".
9013 (b4_synclines_flag): Don't quote the 2nd argument; it should already
9014 be quoted. All uses changed.
9016 * data/glr.c: Use new @ escapes consistently.
9017 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
9018 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
9019 Remove, since they couldn't handle arbitrary characters in file
9021 * data/lalr1.cc: Likewise.
9022 * data/yacc.c: Likewise.
9024 * src/files.c (output_infix): Remove; all uses removed.
9025 * src/files.h: Likewise.
9027 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
9028 mishandled funny characters in file names, and anyway it isn't
9030 * data/yacc.c: Likewise.
9031 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
9033 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
9034 * data/yacc.c: Likewise.
9036 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
9038 (muscle_init): Quote filename as a C string.
9039 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
9040 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
9041 * src/output.c (escaped_file_name_output): New function.
9042 (prepare_symbols): Quote tokens for M4.
9043 (prepare): Don't insert output_infix, output_prefix,
9044 output_parser_name, output_header_name; this is now down by scan-skel.
9045 Insert skeleton as a C string.
9047 * src/output.c (user_actions_output, symbol_destructors_output,
9048 symbol_printers_output): Quote filenames for C and M4.
9049 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9051 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
9052 escapes other than \\ and \'; this simplifies the code.
9053 (<SC_STRING>): Likewise, for \\ and \".
9054 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
9055 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
9056 Use new escapes @{ and @} for [ and ].
9058 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
9059 them with auto vars.
9060 Switch to new escape scheme, where @ is the escape character uniformly.
9061 Abort if a stray escape character is found. Avoid unbounded input
9062 buffer when parsing non-escaped text.
9064 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
9065 __oline__, #output, $@, and @{ do not have unintended meanings.
9067 2002-11-09 Paul Eggert <eggert@twinsun.com>
9069 Fix the test failure due to GCC warnings described in
9070 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
9071 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
9072 evaluate to 0 if it's impossible for NINF to be in the respective
9074 (yygetLRActions, yyrecoverParseError): Use them.
9076 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
9077 counted in the token inserted at end of file. Now takes
9078 location_t *, not location_t, so that the location can be
9079 adjusted. All uses changed.
9081 * tests/regression.at (Invalid inputs): Adjust wording in
9082 diagnostic to match the new behavior.
9084 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
9085 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
9086 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
9087 abort ();'. This reduces the runtime of the "Many lookaheads"
9088 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
9091 2002-11-07 Paul Eggert <eggert@twinsun.com>
9093 * src/parse-gram.y (CHARACTER): Remove unused token.
9096 * src/scan-gram.l: Remove stack option. We no longer use the
9097 stack, since the stack was never deeper than 1; instead, use the
9098 new auto var c_context to record the stacked value.
9100 Remove nounput option. At an unexpected end of file, we now unput
9101 the minimal input necessary to end cleanly; this simplifies the
9104 Avoid unbounded token sizes where this is easy.
9106 (unexpected_end_of_file): New function.
9107 Use it to systematize the error message on unexpected EOF.
9108 (last-string): Now auto, not static.
9109 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
9110 (scanner_last_string_free): Remove; not used.
9111 (percent_percent_count): Move decl to just before use.
9112 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
9113 not the (never otherwised-used) CHARACTER.
9115 2002-11-07 Akim Demaille <akim@epita.fr>
9117 Let yyerror always receive the msg as last argument, so that
9118 yyerror can be variadic.
9120 * data/yacc.c (b4_yyerror_args): New.
9121 Use it when calling yyerror.
9122 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
9123 Use it when calling yyerror.
9124 * doc/bison.texinfo (Error Reporting): Adjust.
9125 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
9126 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
9128 2002-11-06 Akim Demaille <akim@epita.fr>
9130 #line should have quoted strings.
9131 Ideally, this should be done by m4_quotearg.
9133 * src/scan-skel.l: Include quotearg.h.
9135 * src/output.c (symbol_printers_output)
9136 (symbol_destructors_output): Quote the file name.
9138 2002-11-06 Akim Demaille <akim@epita.fr>
9140 * tests/regression.at (Invalid inputs): Adjust to the recent
9143 2002-11-06 Akim Demaille <akim@epita.fr>
9146 Reported by Jim Kent.
9148 * data/c.m4 (b4_syncline): New.
9149 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
9150 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
9151 * src/output.c (user_actions_output): Likewise.
9152 (prepare): Define 'b4_synclines_flag'.
9153 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
9155 2002-11-06 Akim Demaille <akim@epita.fr>
9157 * src/main.c (main): Free `infile'.
9158 * src/scan-gram.l (handle_syncline): New.
9160 * src/output.c (user_actions_output, symbol_destructors_output)
9161 (symbol_printers_output): Use the location's file name, not
9163 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9165 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9167 * src/tables.c (matching_state): Don't allow states to match if
9168 either has GLR conflict entries.
9170 2002-11-05 Paul Eggert <eggert@twinsun.com>
9172 * src/scan-gram.l: Use more accurate diagnostics, e.g.
9173 "integer out of range" rather than "invalid value".
9174 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
9177 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
9178 Also, remove one static variable in the scanner.
9180 * src/scan-gram.l (braces_level): Now auto, not static.
9181 Initialize to zero if the compiler is being picky.
9182 (INITIAL): Clear braces_level instead of incrementing it.
9183 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
9184 as POSIX 1003.1-2001 requires.
9185 * src/system.h (IF_LINT): New macro, taken from coreutils.
9186 * configure.ac: Define "lint" if --enable-gcc-warnings.
9188 2002-11-05 Akim Demaille <akim@epita.fr>
9190 * src/scan-gram.l: When it starts with `%', complain about the
9191 whole directive, not just that `invalid character: %'.
9193 2002-11-04 Akim Demaille <akim@epita.fr>
9195 * Makefile.maint: Update from Autoconf.
9196 (update, cvs-update, po-update, do-po-update): New.
9198 2002-11-04 Akim Demaille <akim@epita.fr>
9200 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
9202 Have yyerror `use' its arguments.
9203 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
9204 returns true when location & yacc & pure & parse-param.
9205 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
9207 2002-11-04 Akim Demaille <akim@epita.fr>
9209 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
9211 * src/scan-gram.l: Use [\'] instead of ['] to pacify
9214 Use quote, not quote_n since LOCATION_PRINT no longer uses the
9217 2002-11-03 Paul Eggert <eggert@twinsun.com>
9219 * src/reader.c (get_merge_function, grammar_current_rule_check):
9220 Use consistent diagnostics for reporting type name clashes.
9221 Quote the types with <>, for consistency with Yacc.
9222 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
9224 2002-11-03 Akim Demaille <akim@epita.fr>
9226 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
9228 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
9229 (b4_parse_param): Remove.
9230 Use b4_identification.
9231 Propagate b4_pure_args where needed to pass them to yyerror.
9232 * data/glr.m4 (b4_parse_param): Remove.
9233 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
9234 (b4_lpure_formals): New.
9235 Use b4_identification.
9236 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
9237 b4_user_formals and b4_user_args.
9238 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
9239 (yyreportAmbiguity): When using a pure parser, also need
9240 the location, and the parse-params.
9242 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
9243 When using a pure parser, also need the parse-params.
9245 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
9246 (%pure-parser + %parse-param) LALR and GLR parsers.
9247 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
9248 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
9249 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
9250 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
9251 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
9252 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
9253 * doc/bison.texinfo: Untabify the whole file.
9254 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
9255 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
9256 (Error Reporting): Adjust to these new directives.
9257 Document %error-verbose, deprecate YYERROR_VERBOSE.
9259 2002-11-03 Akim Demaille <akim@epita.fr>
9261 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
9262 AT_CHECK_CALC_GLR invocations to use % directives, instead of
9263 command line options.
9264 * tests/cxx-type.at: Formatting changes.
9266 2002-11-03 Paul Eggert <eggert@twinsun.com>
9268 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
9269 to count columns correctly, and to check for invalid inputs.
9271 Use mbsnwidth to count columns correctly. Account for tabs, too.
9273 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
9274 (extend_location): New function.
9277 Handle CRLF in C code rather than in Lex code.
9278 (YY_INPUT): New macro.
9279 (no_cr_read): New function.
9281 Scan UCNs, even though we don't fully handle them yet.
9282 (convert_ucn_to_byte): New function.
9284 Handle backslash-newline correctly in C code.
9285 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
9286 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
9288 (tag, splice): New EREs. Do not allow NUL or newline in tags.
9289 Use {splice} wherever C allows backslash-newline.
9290 YY_STEP after space, newline, vertical-tab.
9291 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9293 (letter, id): Don't assume ASCII; e.g., spell out a-z.
9295 ({int}, handle_action_dollar, handle_action_at): Check for integer
9298 (YY_STEP): Omit trailing semicolon, so that it's more like C.
9300 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
9301 as well as \000. Check for UCHAR_MAX, not 255.
9302 Allow \x with an arbitrary positive number of digits, as in C.
9303 Check for overflow here.
9304 Allow \? and UCNs, for compatibility with C.
9306 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
9307 with quote slot used by complain_at.
9309 * tests/input.at: Add tests for backslash-newline, m4 quotes
9310 in symbols, long literals, and funny escapes in strings.
9312 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
9313 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
9314 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
9315 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
9316 * m4/mbswidth.m4: New file, from GNU coreutils.
9318 * doc/bison.texinfo (Grammar Outline): Document // comments.
9319 (Symbols): Document that trigraphs have no special meaning in Bison,
9320 nor is backslash-newline allowed.
9321 (Actions): Document that trigraphs have no special meaning.
9323 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
9326 2002-11-02 Paul Eggert <eggert@twinsun.com>
9328 * src/reader.c: Don't include quote.h; not needed.
9329 (get_merge_function): Reword warning to be consistent with
9330 type clash diagnostic in grammar_current_rule_check.
9332 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
9333 bug in trigraph handling.
9335 * src/output.c (prepare_symbols): When printing token names,
9336 escape "[" as "@<:@" and likewise for "]".
9338 * src/system.h (errno): Remove declaration, as we are now
9339 assuming C89 or better, and C89 guarantees errno.
9341 2002-10-30 Paul Eggert <eggert@twinsun.com>
9343 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
9344 Check for close failures.
9345 * src/files.h (xfclose): Return void, not int, since it always
9347 * src/files.c (xfclose): Likewise. Report I/O error if ferror
9349 * src/output.c (output_skeleton): Use xfclose rather than fclose
9350 and ferror. xfclose now checks ferror.
9352 * data/glr.c (YYLEFTMOST_STATE): Remove.
9353 (yyreportTree): Use a stack-based leftmost state. This avoids
9354 our continuing battles with bogus warnings about initializers.
9356 2002-10-30 Akim Demaille <akim@epita.fr>
9358 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
9361 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9363 * tests/glr-regr1.at: New test for reported regressions.
9364 * tests/testsuite.at: Add glr-regr1.at test.
9365 * tests/Makefile.am: Add glr-regr1.at test.
9367 2002-10-24 Paul Eggert <eggert@twinsun.com>
9371 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
9372 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
9373 we use malloc. Don't assume 'A' through 'Z' are contiguous.
9374 Don't assume strdup exists; POSIX says its an XSI extension.
9375 Check for buffer overflow on input.
9377 2002-10-24 Akim Demaille <akim@epita.fr>
9379 * src/output.c (output_skeleton): Don't disable M4sugar comments
9380 too soon: it results in comments being expanded.
9381 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
9384 2002-10-24 Akim Demaille <akim@epita.fr>
9386 * data/yacc.c (m4_int_type): New.
9387 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
9388 char' as only yacc.c wants K&R portability.
9389 * data/glr.c (yysigned_char): Remove.
9390 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
9391 Reported by Quoc Peyrot.
9393 2002-10-23 Paul Eggert <eggert@twinsun.com>
9395 * src/main.c (main): With --trace=time, report times even if a
9396 non-fatal error occurs. Formerly, the times were reported in some
9397 such cases but not in others.
9398 * src/reader.c (reader): Just return if a complaint has been issued,
9399 instead of exiting, so that 'main' can report times.
9401 2002-10-22 Akim Demaille <akim@epita.fr>
9403 * src/system.h: Include sys/types.
9404 Reported by Bert Deknuydt.
9406 2002-10-23 Paul Eggert <eggert@twinsun.com>
9408 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
9409 Suggested by Art Haas.
9411 2002-10-22 Paul Eggert <eggert@twinsun.com>
9413 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
9414 decl; not needed any more.
9415 * src/main.c (main): Use return to exit, undoing yesterday's change.
9416 The last OS that we could find where this wouldn't work is
9417 SunOS 3.5, and that's too old to worry about now.
9419 * data/glr.c (struct yyltype): Define members even when not
9420 doing locations. This is more consistent with yacc.c, and it
9421 works around the following bug reports:
9422 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
9423 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
9425 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
9426 @acronym consistently. Standardize on "Yacc" instead of "YACC",
9427 "Algol" instead of "ALGOL". Give a bit more history about BNF.
9429 2002-10-22 Akim Demaille <akim@epita.fr>
9433 2002-10-21 Paul Eggert <eggert@twinsun.com>
9435 Be consistent about 'bool'; the old code used an enum in one
9436 module and an int in another, and this violates the C standard.
9437 * m4/stdbool.m4: New file, from coreutils 4.5.3.
9438 * configure.ac (AC_HEADER_STDBOOL): Add.
9439 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
9440 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
9441 * src/symtab.c (hash_compare_symbol_t): Likewise.
9442 * src/system.h (bool, false, true): Use a definition consistent
9443 with ../lib/hash.c. All uses changed.
9445 * src/complain.c (warning_issued): Renamed from warn_message_count,
9446 so that we needn't worry about integer overflow (!).
9447 Now of type bool. All uses changed.
9448 (complaint_issued): Renamed from complain_message_count; likewise.
9450 * src/main.c (main): Use exit to exit with failure.
9452 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
9453 rather than 1 and 0.
9454 * src/main.c (main): Likewise.
9455 * src/getargs.c (getargs): Likewise.
9456 * src/reader.c (reader): Likewise.
9458 * src/getarg.c (getargs): Remove duplicate code for
9459 "Try `bison --help'".
9461 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
9462 What was that "2" for?
9464 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
9465 * src/getargs.c (usage): Likewise.
9467 * src/getargs.c (getargs): When there are too few operands, report
9468 the last one. When there are too many, report the first extra
9469 one. This is how diffutils does it.
9471 2002-10-20 Paul Eggert <eggert@twinsun.com>
9473 Remove K&R vestiges.
9474 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
9475 * src/complain.c (VA_START): Remove. Assume prototypes.
9476 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
9477 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
9478 fatal): Assume prototypes.
9479 * src/complain.h: Assume prototypes.
9480 * src/system.h (PARAMS): Remove.
9481 Include <limits.h> unconditionally, since it's guaranteeed even
9482 for a freestanding C89 compiler.
9483 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
9484 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
9486 2002-10-20 Akim Demaille <akim@epita.fr>
9488 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
9489 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
9490 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
9491 (yyresolveStates, yyresolveAction, yyresolveStack)
9492 (yyprocessOneStack): Use them.
9493 (yy_reduce_print): New.
9494 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
9496 2002-10-20 Akim Demaille <akim@epita.fr>
9498 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
9499 arguments and output `void'.
9500 (b4_c_function): Rename as...
9501 (b4_c_function_def): this.
9502 (b4_c_function_decl, b4_c_ansi_function_def)
9503 (b4_c_ansi_function_decl): New.
9504 Change the interpretation of the arguments: before `int, foo', now
9506 * data/yacc.c (yyparse): Prototype and define thanks to these.
9507 Adjust b4_c_function_def uses.
9508 * data/glr.c (yyparse): Likewise, but ANSI only.
9510 2002-10-20 Akim Demaille <akim@epita.fr>
9512 * src/output.c (prepare): Move the definition of `tokens_number',
9513 `nterms_number', `undef_token_number', `user_token_number_max'
9515 (prepare_tokens): Here.
9516 (prepare_tokens): Rename as...
9517 (prepare_symbols): this.
9518 (prepare): Move the definition of `rules_number' to...
9519 (prepare_rules): here.
9520 (prepare): Move the definition of `last', `final_state_number',
9521 `states_number' to...
9522 (prepare_states): here.
9523 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9525 2002-10-20 Akim Demaille <akim@epita.fr>
9527 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9529 2002-10-20 Akim Demaille <akim@epita.fr>
9531 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9534 2002-10-20 Akim Demaille <akim@epita.fr>
9536 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9537 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9539 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9541 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9542 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9545 2002-10-19 Paul Eggert <eggert@twinsun.com>
9547 Do not create a temporary file, as that involves security and
9548 cleanup headaches. Instead, use a pair of pipes.
9549 Derived from a suggestion by Florian Krohm.
9550 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9551 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9552 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9553 (BISON_PREREQ_SUBPIPE): Add.
9554 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9555 Add subpipe.h, subpipe.c.
9556 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9557 * po/POTFILES.in: Add lib/subpipe.c.
9558 * src/output.c: Include "subpipe.h".
9559 (m4_invoke): Remove decl.
9560 (scan_skel): New decl.
9561 (output_skeleton): Use pipe rather than temporary file for m4 input.
9562 Check that m4sugar.m4 is readable, to avoid deadlock.
9563 Check for pipe I/O error.
9564 * src/scan-skel.l (readpipe): Remove decl.
9565 (scan_skel): New function, to be used in place of m4_invoke.
9566 Read from stream rather than file.
9568 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9569 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9570 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9571 this generates a more-accurate value anyway.
9573 * lib/timevar.c (timervar_accumulate): Rename locals to
9574 avoid confusion with similarly-named more-global.
9575 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9577 * src/output.c (prepare): Use xstrdup to convert char const *
9578 to char *, to avoid GCC warning.
9580 2002-10-19 Akim Demaille <akim@epita.fr>
9582 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9583 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9584 Use them to have `calc.y' ready for %pure-parser.
9585 * data/yacc.c (YYLEX): Pass a yylex return type to
9588 2002-10-19 Akim Demaille <akim@epita.fr>
9590 Prototype support of %lex-param and %parse-param.
9592 * src/parse-gram.y: Add the definition of the %lex-param and
9593 %parse-param tokens, plus their rules.
9594 Drop the `_' version of %glr-parser.
9596 * src/scan-gram.l (INITIAL): Scan them.
9597 * src/muscle_tab.c: Comment changes.
9598 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9599 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9600 (muscle_entry_s): The `value' member is no longer const.
9601 Adjust all dependencies.
9602 * src/muscle_tab.c (muscle_init): Adjust: use
9603 MUSCLE_INSERT_STRING.
9604 Initialize the obstack earlier.
9605 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9606 (muscle_pair_list_grow): New.
9607 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9608 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9609 * tests/calc.at: Use %locations, not --locations.
9610 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9612 2002-10-19 Akim Demaille <akim@epita.fr>
9614 * src/getargs.c (usage): Take status as argument and exit
9616 Report the traditional `Try ... --help' message when status != 0.
9617 (usage, version): Don't take a FILE * as arg, it is pointless.
9618 (getargs): When there is an incorrect number of arguments, make it
9619 an error, and report it GNUlically thanks to `usage ()'.
9621 2002-10-18 Paul Eggert <eggert@twinsun.com>
9623 * data/glr.c (yyreportParseError): Don't assume that sprintf
9624 yields the length of the printed string, as this is not true
9625 on SunOS 4.1.4. Reported by Peter Klein.
9627 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9628 * tests/conflicts.at (%nonassoc and eof): Likewise.
9629 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9631 2002-10-17 Akim Demaille <akim@epita.fr>
9633 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9634 * src/getargs.c (trace_types, trace_args): Adjust.
9635 * src/reader.c (grammar_current_rule_prec_set)
9636 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9637 Standardize error messages.
9639 (reader): Use trace_flag to enable scanner/parser debugging,
9640 instead of an adhoc scheme.
9641 * src/scan-gram.l: Remove trailing debugging code.
9643 2002-10-16 Paul Eggert <eggert@twinsun.com>
9645 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9648 * NEWS: Officially drop support for building Bison with K&R C,
9649 since it didn't work anyway and it's not worth worrying about.
9650 * Makefile.maint (wget_files): Remove ansi2knr.c.
9651 (ansi2knr.c-url_prefix): Remove.
9652 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9653 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9654 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9656 2002-10-15 Paul Eggert <eggert@twinsun.com>
9658 Stop using the "enum_" trick for K&R-style function definitions;
9659 it confused me, and I was the author! Instead, assume that people
9660 who want to use K&R C compilers (when using these modules in GCC,
9661 perhaps?) will run ansi2knr.
9663 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9664 All uses of "enum_" changed to "enum ".
9665 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9666 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9668 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9669 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9670 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9671 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9672 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9673 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9674 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9675 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9676 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9677 Use function prototypes; this removes the need for declaring
9678 static functions simply to provide their prototypes.
9679 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9680 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9681 bitset_count_, bitset_create, bitset_dump, bitset_first,
9682 bitset_free, bitset_init, bitset_last, bitset_next,
9683 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9684 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9685 bitset_print, bitset_release_memory, bitset_toggle_,
9686 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9687 debug_bitset): Likewise.
9688 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9689 * lib/bitset_stats.c (bitset_log_histogram_print,
9690 bitset_percent_histogram_print, bitset_stats_and,
9691 bitset_stats_and_cmp, bitset_stats_and_or,
9692 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9693 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9694 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9695 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9696 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9697 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9698 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9699 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9700 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9701 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9702 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9703 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9704 bitset_stats_zero): Likewise.
9705 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9706 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9707 bitsetv_dump, debug_bitsetv): Likewise.
9708 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9709 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9710 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9711 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9712 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9713 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9714 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9715 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9716 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9717 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9718 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9720 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9721 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9722 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9723 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9724 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9725 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9726 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9727 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9728 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9729 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9730 lbitset_xor_cmp, lbitset_zero): Likewise.
9732 2002-10-14 Akim Demaille <akim@epita.fr>
9736 2002-10-14 Akim Demaille <akim@epita.fr>
9738 * tests/Makefile.am (maintainer-check-posix): New.
9740 2002-10-14 Akim Demaille <akim@epita.fr>
9742 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9745 2002-10-14 Akim Demaille <akim@epita.fr>
9747 * src/tables.c (table_ninf_remap): base -> tab.
9748 Reported by Matt Rosing.
9750 2002-10-14 Paul Eggert <eggert@twinsun.com>
9752 * tests/action.at, tests/calc.at, tests/conflicts.at,
9753 tests/cxx-type.at, tests/headers.at, tests/input.at,
9754 tests/regression.at, tests/synclines.at, tests/torture.at:
9755 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9756 so that the tests still work even if POSIXLY_CORRECT is set.
9757 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
9759 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9760 for portability to K&R hosts. Fix typo: signed char is guaranteed
9761 only to 127, not to 128.
9762 * data/glr.c (yysigned_char): New type.
9763 * data/yacc.c (yysigned_char): Likewise.
9764 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9766 2002-10-13 Paul Eggert <eggert@twinsun.com>
9768 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9769 true due to limited range of data type" warning from GCC.
9771 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9772 by wrapping enum yytokentype's definition inside #ifndef
9773 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9775 2002-10-13 Akim Demaille <akim@epita.fr>
9777 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9778 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9780 2002-10-13 Akim Demaille <akim@epita.fr>
9782 * Makefile.maint: Update from Autoconf 2.54.
9783 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9785 2002-10-13 Akim Demaille <akim@epita.fr>
9787 * src/print.c (print_state): Separate the list of solved conflicts
9788 from the other items.
9789 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9791 2002-10-13 Akim Demaille <akim@epita.fr>
9793 Let nondeterministic skeletons be usable with deterministic
9796 With the patch, GAWK compiled by GCC without -O2 passes its test
9797 suite using a GLR parser driven by LALR tables. It fails with -O2
9798 because `struct stat' gives two different answers on my machine:
9799 88 (definition of an auto var) and later 96 (memset on this var).
9800 Hence the stack is badly corrumpted. The headers inclusion is to
9801 blame: if I move the awk.h inclusion before GLR's system header
9802 inclusion, the two struct stat have the same size.
9804 * src/tables.c (pack_table): Always create conflict_table.
9805 (token_actions): Always create conflict_list.
9806 * data/glr.c (YYFLAG): Remove, unused.
9808 2002-10-13 Akim Demaille <akim@epita.fr>
9810 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9812 (VALGRIND, GXX): New.
9813 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9814 * tests/bison.in: Run $PREBISON a pre-command.
9815 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9816 (maintainer-check-g++): New.
9817 * Makefile.am (maintainer-check): New.
9819 2002-10-13 Akim Demaille <akim@epita.fr>
9821 * data/glr.c: Formatting changes.
9822 Tweak some trace messages to match yacc.c's.
9824 2002-10-13 Akim Demaille <akim@epita.fr>
9826 GLR parsers sometimes raise parse errors instead of performing the
9828 Reported by Charles-Henry de Boysson.
9830 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
9831 check the length of the traces when %glr.
9832 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9834 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9836 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9837 (yyltype): Remove the yy prefix from the member names.
9838 (yytable): Complete its comment.
9839 (yygetLRActions): Map error action number from YYTABLE from
9841 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9842 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9843 not satisfying as we could compare an YYACTION computed from
9844 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9845 only value for error actions.
9846 (yyreportParseError): In verbose parse error messages, don't issue
9847 `error' in the list of expected tokens.
9848 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9849 next action to perform to match glr.c's decoding.
9850 (yytable): Complete its comment.
9852 2002-10-13 Paul Eggert <eggert@twinsun.com>
9854 Fix problem reported by Henrik Grubbstroem in
9855 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
9856 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9857 because the Bison parser reads the second action before reducing
9859 * src/scan-gram.l (rule_length): New static var.
9860 Use it to keep track of the rule length in the scanner, since
9861 we can't expect the parser to be in lock-step sync with the scanner.
9862 (handle_action_dollar, handle_action_at): Use this var.
9863 * tests/actions.at (Exotic Dollars): Test for the problem.
9865 2002-10-12 Paul Eggert <eggert@twinsun.com>
9867 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9868 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9869 Include <sys/time.h> when checking for clock_t and struct tms.
9870 Use same include order as source.
9871 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
9872 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
9874 * lib/timevar.c: Update copyright date and clarify comments.
9875 (get_time) [IN_GCC]: Keep the GCC version for reference.
9877 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9878 GCC version as of today, then merge Bison's changes.
9879 Change "GCC" to "Bison" in copyright notice. timevar.def's
9880 author is Akim, so change that too.
9882 * src/reader.c (grammar_current_rule_check):
9883 Don't worry about the default action if $$ is untyped.
9884 Prevents bogus warnings reported by Jim Gifford in
9885 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
9887 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9888 * data/glr.c, data/lalr1.cc, data/yacc.c:
9889 Output token definitions before the first part of user declarations.
9890 Fixes compatibility problem reported by Jim Gifford for kbd in
9891 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
9893 2002-10-11 Paul Eggert <eggert@twinsun.com>
9895 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9896 (yyparse): here. This undoes some of the 2002-07-25 change.
9897 Compatibility problem reported by Ralf S. Engelschall with
9898 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9900 2002-10-11 Akim Demaille <akim@epita.fr>
9902 * tests/regression.at Characters Escapes): New.
9903 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9905 Reported by Jan Nieuwenhuizen.
9907 2002-10-11 Akim Demaille <akim@epita.fr>
9911 2002-10-10 Paul Eggert <eggert@twinsun.com>
9913 Portability fixes for bitsets; this also avoids several GCC
9916 * lib/abitset.c: Include <stddef.h>, for offsetof.
9917 * lib/lbitset.c: Likewise.
9919 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9920 properly for vectors of objects. Do not assume that adding a
9921 header size to a multiple of a word size yields a value that is
9922 properly aligned for the whole union.
9923 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9925 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9926 unique names for structures.
9927 * lib/ebitset.c (ebitset_bytes): Likewise.
9928 * lib/lbitset.c (lbitset_bytes): Likewise.
9930 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9931 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9932 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9933 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9934 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9935 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9936 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9937 to improve the type-checking that GCC can do.
9938 * lib/bitset.c (bitset_op4_cmp): Likewise.
9939 * lib/bitset_stats.c (bitset_stats_count,
9940 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9941 bitset_stats_copy, bitset_stats_disjoint_p,
9942 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9943 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9944 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9945 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9946 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9947 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9948 bitset_stats_or_and_cmp): Likewise.
9949 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9950 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9951 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9952 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9954 * lib/abitset.h: Include bitset.h, not bbitset.h.
9955 * lib/ebitset.h: Likewise.
9956 * lib/lbitset.h: Likewise.
9958 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9959 All instances of parameters of type enum bitset_opts are now of
9960 type enum_bitset_opts, to conform to the C Standard, and similarly
9961 for enum_bitset_type.
9962 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9963 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9965 Do not use "struct bitset_struct" to mean different things in
9966 different modules. Not only is this confusing, it violates
9967 the C Standard, which requires that structure types in different
9968 modules must be compatible if one is to be passed to the other.
9969 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9970 All instances of "struct bitset_struct *" replaced with "bitset".
9971 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9972 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9973 struct lbitset_struct, struct bitset_stats_struct): New types.
9974 All uses of struct bitset_struct changed to union bitset_union,
9976 * lib/abitset.c (struct abitset_struct, abitset,
9977 struct bitset_struct): Remove.
9978 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9979 struct bitset_struct): Remove.
9980 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9981 bitset_struct): Remove.
9982 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9985 Do not call a function of type T using a call that assumes the
9986 function is of a different type U. Standard C requires that a
9987 function must be called with a type that is compatible with its
9989 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9991 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9993 * lib/ebitset.c (PFV): Remove.
9994 * lib/lbitset.c (PFV): Likewise.
9995 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9996 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9998 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9999 (ebitset_vtable): Use them.
10000 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
10001 lbitset_xor): New functions.
10002 (lbitset_vtable): Use them.
10004 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
10007 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
10009 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
10010 Use offsetof, for simplicity.
10012 2002-10-06 Paul Eggert <eggert@twinsun.com>
10014 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
10015 the same width as int. This reapplies a hunk of the 2002-08-12 patch
10016 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
10017 which was inadvertently undone by the 2002-09-30 patch.
10018 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
10019 the same width as int.
10021 2002-10-04 Paul Eggert <eggert@twinsun.com>
10025 * configure.ac (AC_INIT), NEWS: Increment version number.
10027 * doc/bison.texinfo: Minor spelling, grammar, and white space
10029 (Symbols): Mention that any negative value returned from yylex
10030 signifies end-of-input. Warn about negative chars. Mention
10031 the portable Standard C character set.
10033 The GNU coding standard says CFLAGS and YFLAGS are reserved
10034 for the installer to set.
10035 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
10036 * src/Makefile.am (AM_CFLAGS): Likewise.
10037 (AM_YFLAGS): Renamed from YFLAGS.
10039 Fix some MAX and MIN problems.
10040 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
10041 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
10042 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
10043 * src/reader.c (reader): Use it.
10045 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
10046 POSIX 1003.1-2001 has removed fgrep.
10048 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
10050 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
10051 interpreted as signed.
10052 * lib/ebitset.c (ebitset_list): Fix bug.
10054 2002-10-01 Paul Eggert <eggert@twinsun.com>
10056 More fixes for 64-bit hosts and large bitsets.
10058 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
10059 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
10060 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
10061 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
10062 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
10063 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
10064 bitset_count_): Likewise.
10065 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
10066 bitset_first, bitset_last): Likewise.
10067 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
10068 bitset_stats_list_reverse, bitset_stats_size,
10069 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
10071 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10072 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10073 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10074 bitsetv_reflexive_transitive_closure): Likewise.
10075 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
10076 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
10078 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
10081 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
10082 Use size_t, not unsigned int, to count bytes.
10083 * lib/abitset.h (abitset_bytes): Likewise.
10084 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
10086 * lib/bitset.h (bitset_bytes): Likewise.
10087 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
10088 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
10089 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10090 * lib/ebitset.c (ebitset_bytes): Likewise.
10091 * lib/ebitset.h (ebitset_bytes): Likewise.
10092 * lib/lbitset.c (lbitset_bytes): Likewise.
10093 * lib/lbitset.h (lbitset_bytes): Likewise.
10095 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
10096 abitset_subset_p, abitset_disjoint_p, abitset_and,
10097 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
10098 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
10099 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
10100 abitset_or_and, abitset_or_and_cmp):
10101 Use bitset_windex instead of unsigned int.
10102 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10103 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
10104 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
10105 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
10107 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
10109 * lib/bitset.c (bitset_print):
10110 Use proper printf formats for widths of integer types.
10111 * lib/bitset_stats.c (bitset_percent_histogram_print,
10112 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
10113 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10114 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10115 * lib/lbitset.c (lbitset_bytes): Likewise.
10117 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
10118 BITSET_SIZE_MAX): New macros.
10119 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
10120 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
10121 to BITSET_WINDEX_MAX.
10123 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
10124 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
10125 since we now return the bitset_bindex type (not int).
10127 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
10128 when computing sizes.
10129 * lib/ebitset.c (ebitset_elts_grow): Likewise.
10131 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
10132 and avoid cast to unsigned.
10134 2002-09-30 Akim Demaille <akim@epita.fr>
10136 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10137 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
10138 Updates from Michael Hayes.
10140 2002-09-30 Art Haas <ahaas@neosoft.com>
10142 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
10144 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
10147 2002-09-27 Akim Demaille <akim@epita.fr>
10151 2002-09-27 Akim Demaille <akim@epita.fr>
10153 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
10154 (Because of AC_LIBSOURCE).
10156 2002-09-27 Akim Demaille <akim@epita.fr>
10158 Playing with Autoscan.
10160 * configure.ac: Remove the old LIBOBJ tweaks.
10161 (AC_REPLACE_FUNCS): Add strrchr and strtol.
10162 * lib/strrchr.c: New.
10163 * lib/strtol.c: New, from the Coreutils 4.5.1.
10165 2002-09-27 Akim Demaille <akim@epita.fr>
10167 Playing with Autoscan.
10169 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
10170 * lib/Makefile.am (libbison_a_SOURCES): No longer include
10171 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
10172 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
10175 2002-09-24 Akim Demaille <akim@epita.fr>
10177 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
10178 (Frequently Asked Questions, Parser Stack Overflow): New.
10180 2002-09-13 Akim Demaille <akim@epita.fr>
10182 Playing with autoscan.
10184 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
10185 * src/files.c (skeleton_find): Remove, unused.
10186 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
10187 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
10189 2002-09-13 Akim Demaille <akim@epita.fr>
10191 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
10192 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
10194 2002-09-13 Akim Demaille <akim@epita.fr>
10196 * configure.ac: Require 2.54.
10197 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
10198 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
10199 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
10200 Remove, provided by Autoconf macros.
10202 2002-09-12 Akim Demaille <akim@epita.fr>
10204 * m4/prereq.m4: Update, from Coreutils 4.5.1.
10206 2002-09-12 Akim Demaille <akim@epita.fr>
10208 * m4/prereq.m4: Update, from Fileutils 4.1.5.
10209 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
10210 Reported by Martin Mokrejs.
10212 2002-09-10 Akim Demaille <akim@epita.fr>
10214 * src/parse-gram.y: Associate a human readable string to each
10216 * tests/regression.at (Invalid inputs): Adjust.
10218 2002-09-10 Gary V. Vaughan <gary@gnu.org>
10220 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
10221 with an Autoconf-2.5x style configure.ac.
10223 2002-09-06 Paul Eggert <eggert@twinsun.com>
10225 * doc/bison.texinfo (Conditions): Make explicit that the GPL
10226 exception applies only to yacc.c. This is a modification of a
10227 patch originally suggested by Akim Demaille.
10229 2002-09-06 Akim Demaille <akim@epita.fr>
10231 * data/c.m4 (b4_copyright): Move the GPL exception comment from
10233 * data/yacc.c: here.
10235 * data/lalr1.cc (struct yyltype): Don't define it, since we use
10237 (b4_ltype): Default to yy::Location from location.hh.
10239 2002-09-04 Jim Meyering <jim@meyering.net>
10241 * data/yacc.c: Guard the declaration of yytoknum also with
10242 `#ifdef YYPRINT', so it is declared only when used.
10244 2002-09-04 Akim Demaille <akim@epita.fr>
10246 * configure.in: Rename as...
10247 * configure.ac: this.
10250 2002-09-04 Akim Demaille <akim@epita.fr>
10252 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
10253 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
10254 translate maintainer only messages.
10256 2002-08-12 Paul Eggert <eggert@twinsun.com>
10260 * Makefile.am (SUBDIRS): Remove intl.
10261 (DISTCLEANFILES): Remove.
10262 * NEWS: Mention that GNU M4 is now required. Clarify what is
10263 meant by "larger grammars". Mention the pt_BR translation.
10264 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
10265 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
10266 Bump version from 0.11.2 to 0.11.5.
10267 (BISON_PREREQ_STAGE): Remove.
10268 (AM_GNU_GETTEXT): Use external gettext.
10269 (AC_OUTPUT): Remove intl/Makefile.
10271 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
10273 * data/glr.c: Include string.h, for strlen.
10274 (yyreportParseError): Use size_t for yysize.
10275 (yy_yypstack): No longer nested inside yypstates, as nested
10276 functions are not portable. Do not assume size_t is the
10278 (yypstates): Do not assume that ptrdiff_t is the same width
10279 as int, and similarly for yyposn and YYINDEX.
10281 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
10283 * lib/Makefile.am (INCLUDES): Do not include from the intl
10284 directory, which has been removed.
10285 * src/Makefile.am (INCLUDES): Likewise.
10287 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
10288 (bitsets_sources, additional_bitsets_sources, timevars_sources):
10291 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
10292 * tests/Makefile.am (EXTRA_DIST): Likewise.
10294 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
10295 Do not assume that bitset_windex is the same width as unsigned.
10297 * lib/abitset.c (abitset_unused_clear): Do not assume that
10298 bitset_word is the same width as int.
10299 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
10300 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
10301 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
10302 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
10303 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
10305 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
10306 portability to one's complement hosts!).
10307 * lib/ebitset.c (ebitset_op1): Likewise.
10308 * lib/lbitset.c (lbitset_op1): Likewise.
10310 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
10311 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10312 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
10313 Sync with fileutils.
10314 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
10315 lib/gettext.h: Sync with diffutils.
10317 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
10318 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
10320 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
10321 PROTOTYPES to check for prototypes, and "defined __STDC__" to
10324 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
10325 size_t; the old version tried to do this but casted improperly.
10326 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
10327 (bitset_test): Now returns int, not unsigned long.
10329 * lib/bitset_stats.c: Include "gettext.h".
10331 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
10332 name locals "index", as it generates unnecessary warnings on some
10333 hosts that have an "index" function.
10335 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
10336 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
10337 they need translation.
10338 * src/LR0.c (state_list_append, new_itemsets, get_state,
10339 append_states, generate_states): Likewise.
10340 * src/assoc.c (assoc_to_string): Likewise.
10341 * src/closure.c (print_closure, set_firsts, closure): Likewise.
10342 * src/gram.c (grammar_dump): Likewise.
10343 * src/injections.c (injections_compute): Likewise.
10344 * src/lalr.c (lookaheads_print): Likewise.
10345 * src/relation.c (relation_transpose): Likewise.
10346 * src/scan-gram.l: Likewise.
10347 * src/tables.c (table_grow, pack_vector): Likewise.
10349 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
10350 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
10351 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
10352 * m4/mbstate_t.m4: Sync with fileutils.
10353 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
10355 * po/LINGUAS: Add pt_BR.
10356 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
10357 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
10359 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
10361 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
10363 * src/complain.c (strerror_r): Remove decl; not needed.
10364 (strerror): Use same pattern as ../lib/error.c.
10366 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
10368 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
10370 * src/main.c (main): Cast result of bindtextdomain and textdomain
10371 to void, to avoid a GCC warning when --disable-nls is in effect.
10373 * src/scan-gram.l: Use strings rather than escapes when possible,
10374 to minimize the number of warnings from xgettext.
10375 (handle_action_dollar, handle_action_at): Don't use isdigit,
10376 as it mishandles negative chars and it may not work as expected
10377 outside the C locale.
10379 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
10380 this is a GCC extension and is not portable to other compilers.
10382 * src/system.h (alloca): Use same pattern as ../lib/error.c.
10383 Do not include <ctype.h>; no longer needed.
10384 Do not include <malloc.h>; no longer needed (and generates
10385 warnings on OpenBSD 3.0).
10387 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
10390 * tests/regression.at: Do not use 'cc -c input.c -o input';
10391 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
10393 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
10394 exit status as failure, not just exit status 1. Sun C exits
10395 with status 2 sometimes.
10397 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
10398 Use it for the two large tests.
10400 2002-08-02 Akim Demaille <akim@epita.fr>
10402 * src/conflicts.c (conflicts_output): Don't output rules never
10403 reduced here, since anyway that computation doesn't work.
10404 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
10405 (rule_useless_p, rule_never_reduced_p): New.
10406 (grammar_rules_partial_print): Use a filter instead of a range.
10407 Display the title only if needed.
10408 (grammar_rules_print): Adjust.
10409 (grammar_rules_never_reduced_report): New.
10410 * src/tables.c (action_row): Move the computation of rules never
10412 (token_actions): here.
10413 * src/main.c (main): Make the parser before making the report, so
10414 that rules never reduced are computed.
10415 Call grammar_rules_never_reduced_report.
10416 * src/print.c (print_results): Report rules never reduced.
10417 * tests/conflicts.at, tests/reduce.at: Adjust.
10419 2002-08-01 Akim Demaille <akim@epita.fr>
10421 Instead of attaching lookaheads and duplicating the rules being
10422 reduced by a state, attach the lookaheads to the reductions.
10424 * src/state.h (state_t): Remove the `lookaheads',
10425 `lookaheads_rule' member.
10426 (reductions_t): Add a `lookaheads' member.
10427 Use a regular array for the `rules'.
10428 * src/state.c (reductions_new): Initialize the lookaheads member
10430 (state_rule_lookaheads_print): Adjust.
10431 * src/state.h, src/state.c (state_reductions_find): New.
10432 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
10433 (count_rr_conflicts): Adjust.
10434 * src/lalr.c (LArule): Remove.
10435 (add_lookback_edge): Adjust.
10436 (state_lookaheads_count): New.
10437 (states_lookaheads_initialize): Merge into...
10438 (initialize_LA): this.
10439 (lalr_free): Adjust.
10440 * src/main.c (main): Don't free nullable and derives too early: it
10441 is used by --verbose.
10442 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
10444 2002-08-01 Akim Demaille <akim@epita.fr>
10446 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
10448 (set_derives, free_derives): Rename as...
10449 (derives_compute, derives_free): this.
10450 Adjust all dependencies.
10451 * src/nullable.c (set_nullable, free_nullable): Rename as...
10452 (nullable_compute, nullable_free): these.
10453 (rule_list_t): Store rule_t *, not rule_number_t.
10454 * src/state.c (state_rule_lookaheads_print): Directly compare rule
10455 pointers, instead of their numbers.
10456 * src/main.c (main): Call nullable_free, and derives_free earlier,
10457 as they were lo longer used.
10459 2002-08-01 Akim Demaille <akim@epita.fr>
10461 * lib/timevar.c (get_time): Include children time.
10462 * src/lalr.h (LA, LArule): Don't export them: used with the
10464 * src/lalr.c (LA, LArule): Static.
10465 * src/lalr.h, src/lalr.c (lalr_free): New.
10466 * src/main.c (main): Call it.
10467 * src/tables.c (pack_vector): Check whether loc is >= to the
10469 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
10470 (tables_generate): do it, since that's also it which allocates
10472 Don't free LA and LArule, main does.
10474 2002-07-31 Akim Demaille <akim@epita.fr>
10476 Separate parser tables computation and output.
10478 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
10479 (conflict_list, conflict_list_cnt, table, check, table_ninf)
10480 (yydefgoto, yydefact, high): Move to...
10481 * src/tables.h, src/tables.c: here.
10482 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10483 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10484 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
10485 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
10486 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
10487 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
10488 (action_row, save_row, token_actions, save_column, default_goto)
10489 (goto_actions, sort_actions, matching_state, pack_vector)
10490 (table_ninf_remap, pack_table, prepare_actions): Move to...
10491 * src/tables.c: here.
10492 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
10493 * src/output.c (token_actions, output_base, output_conflicts)
10494 (output_check): Merge into...
10495 (prepare_actions): this.
10496 (actions_output): Rename as...
10497 (user_actions_output): this.
10498 * src/main.c (main): Call tables_generate and tables_free.
10500 2002-07-31 Akim Demaille <akim@epita.fr>
10502 Steal GCC's --time-report support.
10504 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
10505 stolen/adjusted from GCC.
10506 * m4/stage.m4: Remove time related checks.
10507 * m4/timevar.m4: New.
10508 * configure.in: Adjust.
10509 * src/system.h: Adjust to using timevar.h.
10510 * src/getargs.h, src/getargs.c: Support trace_time for
10512 * src/main.c (stage): Remove.
10513 (main): Replace `stage' invocations with timevar calls.
10514 * src/output.c: Insert pertinent timevar calls.
10516 2002-07-31 Akim Demaille <akim@epita.fr>
10518 Let --trace have arguments.
10520 * src/getargs.h (enum trace_e): New.
10521 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10522 (long_options, short_options): --trace/-T takes an optional
10524 Change all the uses of trace_flag to reflect the new flags.
10525 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10527 Strengthen `stage' portability.
10529 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10530 * configure.in: Use it.
10531 Don't check for malloc.h and sys/times.h.
10532 * src/system.h: Include them when appropriate.
10533 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10534 times and struct tms are available.
10536 2002-07-30 Akim Demaille <akim@epita.fr>
10538 In verbose parse error message, don't report `error' as an
10540 * tests/actions.at (Printers and Destructors): Adjust.
10541 * tests/calc.at (Calculator $1): Adjust.
10542 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10543 error message, do not report the parser accepts the error token in
10546 2002-07-30 Akim Demaille <akim@epita.fr>
10548 Normalize conflict related messages.
10550 * src/complain.h, src/complain.c (warn, complain): New.
10551 * src/conflicts.c (conflicts_print): Use them.
10552 (conflict_report_yacc): New, extracted from...
10553 (conflicts_print): here.
10554 * tests/conflicts.at, tests/existing.at: Adjust.
10556 2002-07-30 Akim Demaille <akim@epita.fr>
10558 Report rules which are never reduced by the parser: those hidden
10561 * src/LR0.c (save_reductions): Don't make the final state too
10562 different: save its reduction (accept) instead of having a state
10563 without any action (no shift or goto, no reduce).
10564 Note: the final state is now a ``regular'' state, i.e., the
10565 parsers now contain `reduce 0' as default reduction.
10566 Nevertheless, since they decide to `accept' when yystate =
10567 final_state, they still will not reduce rule 0.
10568 * src/print.c (print_actions, print_reduction): Adjust.
10569 * src/output.c (action_row): Track reduced rules.
10570 (token_actions): Report rules never reduced.
10571 * tests/conflicts.at, tests/regression.at: Adjust.
10573 2002-07-30 Akim Demaille <akim@epita.fr>
10575 `stage' was accidently included in a previous patch.
10576 Initiate its autoconfiscation.
10578 * configure.in: Look for malloc.h and sys/times.h.
10579 * src/main.c (stage): Adjust.
10580 Report only when trace_flag.
10582 2002-07-29 Akim Demaille <akim@epita.fr>
10584 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10586 (errs_t): symbol_t*, not symbol_number_t.
10587 (reductions_t): rule_t*, not rule_number_t.
10588 (FOR_EACH_SHIFT): New.
10589 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10590 * src/print.c, src/print_graph.c: Adjust.
10592 2002-07-29 Akim Demaille <akim@epita.fr>
10594 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10596 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10597 (endtoken, accept): these.
10598 * src/reader.c (reader): Set endtoken's default tag to "$end".
10599 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10600 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10603 2002-07-29 Akim Demaille <akim@epita.fr>
10605 * src/reduce.c (reduce_grammar): When the language is empty,
10606 complain about the start symbol, not the axiom.
10608 * tests/reduce.at (Empty Language): New.
10610 2002-07-26 Akim Demaille <akim@epita.fr>
10612 * src/reader.h, src/reader.c (gram_error): ... can't get
10613 yycontrol without making too strong assumptions on the parser
10615 * src/output.c (prepare_tokens): Use the real 0th value of
10616 token_translations instead of `0'.
10617 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10619 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10620 for the time being: %locations ought to provide it to yyerror.
10622 2002-07-25 Akim Demaille <akim@epita.fr>
10624 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10625 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10626 * tests/regression.at (Web2c Actions): Adjust.
10628 2002-07-25 Akim Demaille <akim@epita.fr>
10630 Stop storing rules from 1 to nrules + 1.
10632 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10633 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10634 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10635 Iterate from 0 to nrules.
10636 Use rule_number_as_item_number and item_number_as_rule_number.
10637 Adjust to `derive' now containing possibly 0.
10638 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10639 Handle the `- 1' part in rule numbers from/to item numbers.
10640 * src/conflicts.c (log_resolution): Fix the message which reversed
10642 * src/output.c (action_row): Initialize default_rule to -1.
10643 (token_actions): Adjust.
10644 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10646 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10648 2002-07-25 Akim Demaille <akim@epita.fr>
10650 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10651 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10652 (b4_c_knr_arg_decl): New.
10653 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10654 yyreport_parse_error.
10656 2002-07-25 Akim Demaille <akim@epita.fr>
10658 * data/yacc.c (yyreport_parse_error): New, extracted from...
10660 (yydestruct, yysymprint): Move above yyparse.
10663 2002-07-25 Akim Demaille <akim@epita.fr>
10665 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10667 (b4_sint_type, b4_uint_type): these.
10668 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10669 * tests/regression.at (Web2c Actions): Adjust.
10671 2002-07-25 Akim Demaille <akim@epita.fr>
10673 * src/gram.h (TIEM_NUMBER_MAX): New.
10674 (item_number_of_rule_number, rule_number_of_item_number): Rename
10676 (rule_number_as_item_number, item_number_as_rule_number): these.
10677 Adjust dependencies.
10678 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10679 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10680 (symbol_number_to_vector_number): New.
10681 (order): Of vector_number_t* type.
10682 (base_t, BASE_MAX, BASE_MIN): New.
10683 (froms, tos, width, pos, check): Of base_t type.
10684 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10685 (actrow): Of action_number_t type.
10686 (conflrow): Of unsigned int type.
10687 (table_ninf, base_ninf): New.
10688 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10689 (muscle_insert_int_table, muscle_insert_base_table)
10690 (muscle_insert_rule_number_table): New.
10691 (prepare_tokens): Output `toknum' as int_table.
10692 (action_row): Returns a rule_number_t.
10693 Use ACTION_MIN, not SHRT_MIN.
10694 (token_actions): yydefact is rule_number_t*.
10695 (table_ninf_remap): New.
10696 (pack_table): Use it for `base' and `table'.
10697 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10699 (YYPACT_NINF, YYTABLE_NINF): these.
10700 (yypact, yytable): Compute their types instead of hard-coded
10702 * tests/regression.at (Web2c Actions): Adjust.
10704 2002-07-19 Akim Demaille <akim@epita.fr>
10706 * src/scan-gram.l (id): Can start with an underscore.
10708 2002-07-16 Akim Demaille <akim@epita.fr>
10710 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10711 Adjust all former `associativity' dependencies.
10712 * src/symtab.c (symbol_new): Default associativity is `undef', not
10714 (symbol_check_alias_consistence): Adjust.
10716 2002-07-09 Akim Demaille <akim@epita.fr>
10718 * doc/bison.texinfo: Properly set the ``header'' part.
10719 Use @dircategory ``GNU programming tools'' as per Texinfo's
10723 2002-07-09 Akim Demaille <akim@epita.fr>
10725 * lib/quotearg.h: Protect against multiple inclusions.
10726 * src/location.h (location_t): Add a `file' member.
10727 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10728 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10729 `error_one_per_line' support.
10731 2002-07-09 Akim Demaille <akim@epita.fr>
10733 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10734 * src/reader.c (lineno): Remove.
10735 Adjust all dependencies.
10736 (get_merge_function): Take a location and use complain_at.
10737 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10738 * tests/regression.at (Invalid inputs, Mixing %token styles):
10741 2002-07-09 Akim Demaille <akim@epita.fr>
10743 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10744 recovery rule, and forbid extensions when --yacc.
10745 (gram_error): Use complain_at.
10746 * src/reader.c (reader): Exit if there were parse errors.
10748 2002-07-09 Akim Demaille <akim@epita.fr>
10750 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10751 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10752 Reported by R Blake <blakers@mac.com>.
10754 2002-07-09 Akim Demaille <akim@epita.fr>
10756 * data/yacc.c: Output the copyright notive in the header.
10758 2002-07-03 Akim Demaille <akim@epita.fr>
10760 * src/output.c (froms, tos): Are state_number_t.
10761 (save_column): sp, sp1, and sp2 are state_number_t.
10762 (prepare): Rename `final' as `final_state_number', `nnts' as
10763 `nterms_number', `nrules' as `rules_number', `nstates' as
10764 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10766 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10767 * data/lalr1.cc (nsym_): Remove, unused.
10769 2002-07-03 Akim Demaille <akim@epita.fr>
10771 * src/lalr.h, src/lalr.c (goto_number_t): New.
10772 * src/lalr.c (goto_list_t): New.
10774 * src/nullable.c (rule_list_t): New.
10776 * src/types.h: Remove.
10778 2002-07-03 Akim Demaille <akim@epita.fr>
10780 * src/closure.c (print_fderives): Use rule_rhs_print.
10781 * src/derives.c (print_derives): Use rule_rhs_print.
10782 (rule_list_t): New, replaces `shorts'.
10783 (set_derives): Add comments.
10784 * tests/sets.at (Nullable, Firsts): Adjust.
10786 2002-07-03 Akim Demaille <akim@epita.fr>
10788 * src/output.c (prepare_actions): Free `tally' and `width'.
10789 (prepare_actions): Allocate and free `order'.
10790 * src/symtab.c (symbols_free): Free `symbols'.
10791 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10792 * src/output.c (m4_invoke): Move to...
10793 * src/scan-skel.l: here.
10794 (<<EOF>>): Close yyout, and free its name.
10796 2002-07-03 Akim Demaille <akim@epita.fr>
10798 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10800 * src/LR0.c (new_state): Merge into...
10801 (state_list_append): this.
10802 (new_states): Merge into...
10803 (generate_states): here.
10804 (set_states): Don't ensure a proper `errs' state member here, do it...
10805 * src/conflicts.c (conflicts_solve): here.
10806 * src/state.h, src/state.c: Comment changes.
10807 (state_t): Rename member `shifts' as `transitions'.
10808 Adjust all dependencies.
10809 (errs_new): For consistency, also take the values as argument.
10810 (errs_dup): Remove.
10811 (state_errs_set): New.
10812 (state_reductions_set, state_transitions_set): Assert that no
10813 previous value was assigned.
10815 (states_free): Use it.
10816 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10817 temporary storage: use `errs' and `nerrs' as elsewhere.
10818 (set_conflicts): Allocate and free this `errs'.
10820 2002-07-02 Akim Demaille <akim@epita.fr>
10822 * lib/libiberty.h: New.
10823 * lib: Update the bitset implementation from upstream.
10824 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10825 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10826 * src/main.c: Adjust bitset stats calls.
10828 2002-07-01 Paul Eggert <eggert@twinsun.com>
10830 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10831 char, so that negative chars don't collide with $.
10833 2002-06-30 Akim Demaille <akim@epita.fr>
10835 Have the GLR tests be `warning' checked, and fix the warnings.
10837 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10838 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10839 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10840 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10841 (yyaddDeferredAction): static.
10842 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10843 (yyreportParseError): yyprefix is const.
10844 yytokenp is used only when verbose.
10845 (yy__GNUC__): Replace with __GNUC__.
10846 (yypdumpstack): yyi is size_t.
10847 (yypreference): Un-yy local variables and arguments, to avoid
10848 clashes with `yyr1'. Anyway, we are not in the user name space.
10849 (yytname_size): be an int, as is compared with ints.
10850 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10852 * tests/cxx-gram.at: Use quotation to protect $1.
10853 Use AT_COMPILE to enable warnings hunts.
10854 Prototype yylex and yyerror.
10856 Include `string.h', not `strings.h'.
10857 Produce and prototype stmtMerge only when used.
10858 yylex takes a location.
10860 2002-06-30 Akim Demaille <akim@epita.fr>
10862 We spend a lot of time in quotearg, in particular when --verbose.
10864 * src/symtab.c (symbol_get): Store a quoted version of the key.
10865 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10866 Adjust all callers.
10868 2002-06-30 Akim Demaille <akim@epita.fr>
10870 * src/state.h (reductions_t): Rename member `nreds' as num.
10871 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10872 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10874 2002-06-30 Akim Demaille <akim@epita.fr>
10876 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10877 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10878 (shifts_to): Rename as...
10879 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10880 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10881 (TRANSITION_IS_DISABLED, transitions_to): these.
10883 2002-06-30 Akim Demaille <akim@epita.fr>
10885 * src/print.c (print_shifts, print_gotos): Merge into...
10886 (print_transitions): this.
10887 (print_transitions, print_errs, print_reductions): Align the
10888 lookaheads columns.
10889 (print_core, print_transitions, print_errs, print_state,
10890 print_grammar): Output empty lines separator before, not after.
10891 (state_default_rule_compute): Rename as...
10892 (state_default_rule): this.
10893 * tests/conflicts.at (Defaulted Conflicted Reduction),
10894 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10895 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10897 2002-06-30 Akim Demaille <akim@epita.fr>
10899 Display items as we display rules.
10901 * src/gram.h, src/gram.c (rule_lhs_print): New.
10902 * src/gram.c (grammar_rules_partial_print): Use it.
10903 * src/print.c (print_core): Likewise.
10904 * tests/conflicts.at (Defaulted Conflicted Reduction),
10905 (Unresolved SR Conflicts): Adjust.
10906 (Unresolved SR Conflicts): Adjust and rename as...
10907 (Resolved SR Conflicts): this, as was meant.
10908 * tests/regression.at (Web2c Report): Adjust.
10910 2002-06-30 Akim Demaille <akim@epita.fr>
10912 * src/print.c (state_default_rule_compute): New, extracted from...
10913 (print_reductions): here.
10914 Pessimize, but clarify the code.
10915 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10917 2002-06-30 Akim Demaille <akim@epita.fr>
10919 * src/output.c (action_row): Let default_rule be always a rule
10922 2002-06-30 Akim Demaille <akim@epita.fr>
10924 * src/closure.c (print_firsts, print_fderives, closure):
10925 Use BITSET_EXECUTE.
10926 * src/lalr.c (lookaheads_print): Likewise.
10927 * src/state.c (state_rule_lookaheads_print): Likewise.
10928 * src/print_graph.c (print_core): Likewise.
10929 * src/print.c (print_reductions): Likewise.
10930 * src/output.c (action_row): Likewise.
10931 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10933 2002-06-30 Akim Demaille <akim@epita.fr>
10935 * src/print_graph.c: Use report_flag.
10937 2002-06-30 Akim Demaille <akim@epita.fr>
10939 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10941 * src/relation.h, src/relation.c (traverse, relation_digraph)
10942 (relation_print, relation_transpose): New.
10944 2002-06-30 Akim Demaille <akim@epita.fr>
10946 * src/state.h, src/state.c (shifts_to): New.
10947 * src/lalr.c (build_relations): Use it.
10949 2002-06-30 Akim Demaille <akim@epita.fr>
10951 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10952 (item_number_of_rule_number, rule_number_of_item_number): New.
10953 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10954 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10955 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10956 Propagate their use.
10957 Much remains to be done, in particular wrt `shorts' from types.h.
10959 2002-06-30 Akim Demaille <akim@epita.fr>
10961 * src/symtab.c (symbol_new): Initialize the `printer' member.
10963 2002-06-30 Akim Demaille <akim@epita.fr>
10965 * src/LR0.c (save_reductions): Remove, replaced by...
10966 * src/state.h, src/state.c (state_reductions_set): New.
10967 (reductions, errs): Rename as...
10968 (reductions_t, errs_t): these.
10969 Adjust all dependencies.
10971 2002-06-30 Akim Demaille <akim@epita.fr>
10973 * src/LR0.c (state_list_t, state_list_append): New.
10974 (first_state, last_state): Now symbol_list_t.
10975 (this_state): Remove.
10976 (new_itemsets, append_states, save_reductions): Take a state_t as
10978 (set_states, generate_states): Adjust.
10979 (save_shifts): Remove, replaced by...
10980 * src/state.h, src/state.c (state_shifts_set): New.
10981 (shifts): Rename as...
10983 Adjust all dependencies.
10984 * src/state.h (state_t): Remove the `next' member.
10986 2002-06-30 Akim Demaille <akim@epita.fr>
10988 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10991 2002-06-30 Akim Demaille <akim@epita.fr>
10993 Use hash.h for the state hash table.
10995 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10996 (allocate_storage): Use state_hash_new.
10997 (free_storage): Use state_hash_free.
10998 (new_state, get_state): Adjust.
10999 * src/lalr.h, src/lalr.c (states): Move to...
11000 * src/states.h (state_t): Remove the `link' member, no longer
11002 * src/states.h, src/states.c: here.
11003 (state_hash_new, state_hash_free, state_hash_lookup)
11004 (state_hash_insert, states_free): New.
11005 * src/states.c (state_table, state_compare, state_hash): New.
11006 * src/output.c (output_actions): Do not free states now, since we
11007 still need to know the final_state number in `prepare', called
11008 afterwards. Do it...
11009 * src/main.c (main): here: call states_free after `output'.
11011 2002-06-30 Akim Demaille <akim@epita.fr>
11013 * src/state.h, src/state.c (state_new): New, extracted from...
11014 * src/LR0.c (new_state): here.
11015 * src/state.h (STATE_ALLOC): Move to...
11016 * src/state.c: here.
11017 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
11018 * src/state.h, src/state.c: here.
11020 2002-06-30 Akim Demaille <akim@epita.fr>
11022 * src/reader.c (gensym): Rename as...
11023 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
11024 (getsym): Rename as...
11025 (symbol_get): this.
11027 2002-06-30 Akim Demaille <akim@epita.fr>
11029 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
11030 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
11031 * src/output.c, src/print.c, src/print_graph.c: Propagate.
11032 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
11034 2002-06-30 Akim Demaille <akim@epita.fr>
11036 Make the test suite pass with warnings checked.
11038 * tests/actions.at (Printers and Destructors): Improve.
11039 Avoid unsigned vs. signed issues.
11040 * tests/calc.at: Don't exercise the scanner here, do it...
11041 * tests/input.at (Torturing the Scanner): here.
11043 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11045 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
11046 reorganize first lines parallel to yacc.c.
11048 2002-06-28 Akim Demaille <akim@epita.fr>
11050 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
11051 (b4_token_enum, b4_token_defines): New, factored from...
11052 * data/lalr1.cc, data/yacc.c, glr.c: here.
11054 2002-06-28 Akim Demaille <akim@epita.fr>
11056 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
11058 * src/output.c (merger_output): static.
11060 2002-06-28 Akim Demaille <akim@epita.fr>
11062 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
11063 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
11065 * src/output.c (save_row): Initialize all the variables to pacify GCC.
11067 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11069 Accumulated changelog for new GLR parsing features.
11071 * src/conflicts.c (count_total_conflicts): Change name to
11072 conflicts_total_count.
11073 * src/conflicts.h: Ditto.
11074 * src/output.c (token_actions): Use the new name.
11075 (output_conflicts): Change conflp => conflict_list_heads, and
11076 confl => conflict_list for better readability.
11077 * data/glr.c: Use the new names.
11078 * NEWS: Add self to GLR announcement.
11080 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
11082 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
11085 * data/bison.glr: Change name to glr.c
11086 * data/glr.c: Renamed from bison.glr.
11087 * data/Makefile.am: Add glr.c
11091 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
11092 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
11094 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11096 * data/bison.glr: Be sure to restore the
11097 current #line when returning to the skeleton contents after having
11098 exposed the input file's #line.
11100 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11102 * data/bison.glr: Bring up to date with changes to bison.simple.
11104 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11106 * data/bison.glr: Correct definitions that use b4_prefix.
11107 Various reformatting.
11108 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
11109 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
11110 yytokenp argument; now part of stack.
11111 (yychar): Define to behave as documented.
11112 (yyclearin): Ditto.
11114 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11116 * src/reader.h: Add declaration for free_merger_functions.
11118 * src/reader.c (merge_functions): New variable.
11119 (get_merge_function): New function.
11120 (free_merger_functions): New function.
11121 (readgram): Check for %prec that is not followed by a symbol.
11122 Handle %dprec and %merge declarations.
11123 (packgram): Initialize dprec and merger fields in rules array.
11125 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
11126 conflict_list_cnt, conflict_list_free): New variables.
11127 (table_grow): Also grow conflict_table.
11128 (prepare_rules): Output dprec and merger tables.
11129 (conflict_row): New function.
11130 (action_row): Output conflict lists for GLR parser. Don't use
11131 default reduction in conflicted states for GLR parser so that there
11132 are spaces for the conflict lists.
11133 (save_row): Also save conflict information.
11134 (token_actions): Allocate conflict list.
11135 (merger_output): New function.
11136 (pack_vector): Pack conflict table, too.
11137 (output_conflicts): New function to output yyconflp and yyconfl.
11138 (output_check): Allocate conflict_tos.
11139 (output_actions): Output conflict tables, also.
11140 (output_skeleton): Output b4_mergers definition.
11141 (prepare): Output b4_max_rhs_length definition.
11142 Use 'bison.glr' as default skeleton for GLR parsers.
11144 * src/gram.c (glr_parser): New flag.
11145 (grammar_free): Call free_merger_functions.
11147 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
11148 all pairs of conflicting reductions, rather than just all tokens
11149 causing conflicts. Needed to size conflict tables.
11150 (conflicts_output): Modify call to count_rr_conflicts for new
11152 (conflicts_print): Ditto.
11153 (count_total_conflicts): New function.
11155 * src/reader.h (merger_list): New type.
11156 (merge_functions): New variable.
11158 * src/lex.h (tok_dprec, tok_merge): New token types.
11160 * src/gram.h (rule_s): Add dprec and merger fields.
11161 (glr_parser): New flag.
11163 * src/conflicts.h (count_total_conflicts): New function.
11165 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
11167 * doc/bison.texinfo (Generalized LR Parsing): New section.
11168 (GLR Parsers): New section.
11169 (Language and Grammar): Mention GLR parsing.
11170 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
11171 Correct typo ("tge" -> "the").
11173 * data/bison.glr: New skeleton for GLR parsing.
11175 * tests/cxx-gram.at: New tests for GLR parsing.
11177 * tests/testsuite.at: Include cxx-gram.at.
11179 * tests/Makefile.am: Add cxx-gram.at.
11181 * src/parse-gram.y:
11183 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
11185 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
11187 2002-06-27 Akim Demaille <akim@epita.fr>
11189 * src/options.h, src/options.c: Remove.
11190 * src/getargs.c (short_options, long_options): New.
11192 2002-06-27 Akim Demaille <akim@epita.fr>
11194 * data/bison.simple, data/bison.c++: Rename as...
11195 * data/yacc.c, data/lalr1.cc: these.
11196 * doc/bison.texinfo (Environment Variables): Remove.
11198 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
11200 * src/getargs.c (report_argmatch): Initialize strtok().
11202 2002-06-20 Akim Demaille <akim@epita.fr>
11204 * data/bison.simple (b4_symbol_actions): New, replaces...
11205 (b4_symbol_destructor, b4_symbol_printer): these.
11206 (yysymprint): Be sure to call YYPRINT only for tokens, and using
11207 user token numbers.
11209 2002-06-20 Akim Demaille <akim@epita.fr>
11211 * data/bison.simple (yydestructor): Rename as...
11212 (yydestruct): this.
11214 2002-06-20 Akim Demaille <akim@epita.fr>
11216 * src/symtab.h, src/symtab.c (symbol_type_set)
11217 (symbol_destructor_set, symbol_precedence_set): The location is
11219 Adjust all callers.
11221 2002-06-20 Akim Demaille <akim@epita.fr>
11223 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
11225 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
11227 * src/symtab.h, src/symtab.c (symbol_class_set)
11228 (symbol_user_token_number_set): Likewise.
11229 Adjust all callers.
11230 Promote complain_at.
11231 * tests/input.at (Type Clashes): Adjust.
11233 2002-06-20 Akim Demaille <akim@epita.fr>
11235 * data/bison.simple (YYLEX): Fix the declaration when
11238 2002-06-20 Akim Demaille <akim@epita.fr>
11240 * data/bison.simple (yysymprint): Don't print the token number,
11242 * tests/actions.at (Destructors): Rename as...
11243 (Printers and Destructors): this.
11244 Also exercise %printer.
11246 2002-06-20 Akim Demaille <akim@epita.fr>
11248 * data/bison.simple (YYDSYMPRINT): New.
11249 Use it to remove many of the #if YYDEBUG/if (yydebug).
11251 2002-06-20 Akim Demaille <akim@epita.fr>
11253 * src/symtab.h, src/symtab.c (symbol_t): printer and
11254 printer_location are new members.
11255 (symbol_printer_set): New.
11256 * src/parse-gram.y (PERCENT_PRINTER): New token.
11257 Handle its associated rule.
11258 * src/scan-gram.l: Adjust.
11259 (handle_destructor_at, handle_destructor_dollar): Rename as...
11260 (handle_symbol_code_at, handle_symbol_code_dollar): these.
11261 * src/output.c (symbol_printers_output): New.
11262 (output_skeleton): Call it.
11263 * data/bison.simple (yysymprint): New. Cannot be named yyprint
11264 since there are already many grammar files with a user `yyprint'.
11265 Replace the calls to YYPRINT to calls to yysymprint.
11266 * tests/calc.at: Adjust.
11267 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
11268 taking advantage of parser very internal details (stack size!).
11270 2002-06-20 Akim Demaille <akim@epita.fr>
11272 * src/scan-gram.l: Complete the scanner with the missing patterns
11274 Use `quote' and `symbol_tag_get' where appropriate.
11276 2002-06-19 Akim Demaille <akim@epita.fr>
11278 * tests/actions.at (Destructors): Augment to test locations.
11279 * data/bison.simple (yydestructor): Pass it the current location
11280 if locations are enabled.
11281 Prototype only when __STDC__ or C++.
11282 Change the argument names to move into the yy name space: there is
11285 2002-06-19 Akim Demaille <akim@epita.fr>
11287 * data/bison.simple (b4_pure_if): New.
11288 Use it instead of #ifdef YYPURE.
11290 2002-06-19 Akim Demaille <akim@epita.fr>
11292 * data/bison.simple (b4_location_if): New.
11293 Use it instead of #ifdef YYLSP_NEEDED.
11295 2002-06-19 Akim Demaille <akim@epita.fr>
11297 Prepare @$ in %destructor, but currently don't bind it in the
11298 skeleton, as %location use is not cleaned up yet.
11300 * src/scan-gram.l (handle_dollar, handle_destructor_at)
11301 (handle_action_at): New.
11302 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
11303 a braced_code_t and a location as additional arguments.
11304 (handle_destructor_dollar): Instead of requiring `b4_eval', just
11305 unquote one when outputting `b4_dollar_dollar'.
11307 * data/bison.simple (b4_eval): Remove.
11308 (b4_symbol_destructor): Adjust.
11309 * tests/input.at (Invalid @n): Adjust.
11311 2002-06-19 Zack Weinberg <zack@codesourcery.com>
11313 * doc/bison.texinfo: Document ability to have multiple
11316 2002-06-18 Akim Demaille <akim@epita.fr>
11318 * src/files.c (compute_base_names): When computing the output file
11319 names from the input file name, strip the directory part.
11321 2002-06-18 Akim Demaille <akim@epita.fr>
11323 * data/bison.simple.new: Comment changes.
11324 Reported by Andreas Schwab.
11326 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
11328 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
11329 there are no `label `yyoverflowlab' defined but not used' warnings
11330 when yyoverflow is defined.
11332 2002-06-18 Akim Demaille <akim@epita.fr>
11334 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
11336 (symbol_destructor_set): Adjust.
11337 * src/output.c (symbol_destructors_output): Output the destructor
11339 Output the symbol name.
11340 * data/bison.simple (b4_symbol_destructor): Adjust.
11342 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
11343 and Akim Demaille <akim@epita.fr>
11345 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
11346 what's left on the stack when the error recovery hits EOF.
11347 * tests/actions.at (Destructors): Complete to exercise this case.
11349 2002-06-17 Akim Demaille <akim@epita.fr>
11351 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
11352 arguments is really empty, not only equal to `[]'.
11353 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
11355 (symbol_destructor_set): New.
11356 * src/output.c (symbol_destructors_output): New.
11357 * src/reader.h (brace_code_t, current_braced_code): New.
11358 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
11359 (handle_dollar): Rename as...
11360 (handle_action_dollar): this.
11361 (handle_destructor_dollar): New.
11362 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
11363 (grammar_declaration): Use it.
11364 * data/bison.simple (yystos): Is always defined.
11365 (yydestructor): New.
11366 * tests/actions.at (Destructors): New.
11367 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
11369 2002-06-17 Akim Demaille <akim@epita.fr>
11371 * src/symlist.h, src/symlist.c (symbol_list_length): New.
11372 * src/scan-gram.l (handle_dollar, handle_at): Compute the
11373 rule_length only when needed.
11374 * src/output.c (actions_output, token_definitions_output): Output
11376 * src/symtab.c: Don't access directly to the symbol tag, use
11378 * src/parse-gram.y: Use symbol_list_free.
11380 2002-06-17 Akim Demaille <akim@epita.fr>
11382 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
11383 (symbol_list_prepend, get_type_name): Move to...
11384 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
11385 (symbol_list_prepend, symbol_list_n_type_name_get): here.
11386 Adjust all callers.
11387 (symbol_list_free): New.
11388 * src/scan-gram.l (handle_dollar): Takes a location.
11389 * tests/input.at (Invalid $n): Adjust.
11391 2002-06-17 Akim Demaille <akim@epita.fr>
11393 * src/reader.h, src/reader.c (symbol_list_new): Export it.
11394 (symbol_list_prepend): New.
11395 * src/parse-gram.y (%union): `list' is a new member.
11396 (symbols.1): New, replaces...
11397 (terms_to_prec.1, nterms_to_type.1): these.
11398 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
11399 Take a location as additional argument.
11400 Adjust all callers.
11402 2002-06-15 Akim Demaille <akim@epita.fr>
11404 * src/parse-gram.y: Move %token in the declaration section so that
11405 we don't depend upon CVS Bison.
11407 2002-06-15 Akim Demaille <akim@epita.fr>
11409 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
11410 * src/print.c (print_core): Use it.
11412 2002-06-15 Akim Demaille <akim@epita.fr>
11414 * src/conflicts.c (log_resolution): Accept the rule involved in
11415 the sr conflicts instead of the lookahead number that points to
11417 (flush_reduce): Accept the current lookahead vector as argument,
11418 instead of the index in LA.
11419 (resolve_sr_conflict): Accept the current number of lookahead
11420 bitset to consider for the STATE, instead of the index in LA.
11421 (set_conflicts): Adjust.
11422 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
11424 2002-06-15 Akim Demaille <akim@epita.fr>
11426 * src/state.h (state_t): Replace the `lookaheadsp' member, a
11427 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
11428 Adjust all dependencies.
11429 * src/lalr.c (initialize_lookaheads): Split into...
11430 (states_lookaheads_count, states_lookaheads_initialize): these.
11433 2002-06-15 Akim Demaille <akim@epita.fr>
11435 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
11437 (grammar_rules_print): here.
11438 * src/reduce.c (reduce_output): Use it.
11439 * tests/reduce.at (Useless Rules, Reduced Automaton)
11440 (Underivable Rules): Adjust.
11442 2002-06-15 Akim Demaille <akim@epita.fr>
11444 Copy BYacc's nice way to report the grammar.
11446 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
11448 Don't print the rules' location, it is confusing and useless.
11449 (rule_print): Use grammar_rhs_print.
11450 * src/print.c (print_grammar): Use grammar_rules_print.
11452 2002-06-15 Akim Demaille <akim@epita.fr>
11454 Complete and rationalize `useless thing' warnings.
11456 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
11457 (symbol_tag_print): New.
11458 Use them everywhere in place of accessing directly the tag member.
11459 * src/gram.h, src/gram.c (rule_print): New.
11460 Use it where a rule used to be printed `by hand'.
11461 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
11462 (reduce_grammar_tables): Report the useless rules.
11463 (reduce_print): Useless things are a warning, not an error.
11465 * tests/reduce.at (Useless Nonterminals, Useless Rules):
11466 (Reduced Automaton, Underivable Rules): Adjust.
11467 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
11468 * tests/conflicts.at (Unresolved SR Conflicts)
11469 (Solved SR Conflicts): Adjust.
11471 2002-06-15 Akim Demaille <akim@epita.fr>
11473 Let symbols have a location.
11475 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
11477 Adjust all callers.
11478 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
11479 Use location_t, not int.
11480 * src/symtab.c (symbol_check_defined): Take advantage of the
11482 * tests/regression.at (Invalid inputs): Adjust.
11484 2002-06-15 Akim Demaille <akim@epita.fr>
11486 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
11487 (input): Don't try to initialize yylloc here, do it in the
11489 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
11490 * src/gram.h (rule_t): Change line and action_line into location
11491 and action_location, of location_t type.
11492 Adjust all dependencies.
11493 * src/location.h, src/location.c (empty_location): New.
11494 * src/reader.h, src/reader.c (grammar_start_symbol_set)
11495 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
11496 (grammar_current_rule_symbol_append)
11497 (grammar_current_rule_action_append): Expect a location as argument.
11498 * src/reader.c (grammar_midrule_action): Adjust to attach an
11499 action's location as dummy symbol location.
11500 * src/symtab.h, src/symtab.c (startsymbol_location): New.
11501 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
11504 2002-06-14 Akim Demaille <akim@epita.fr>
11506 Grammar declarations may be found in the grammar section.
11508 * src/parse-gram.y (rules_or_grammar_declaration): New.
11509 (declarations): Each declaration may end with a semicolon, not
11511 (grammar_declaration): `"%union"'.
11512 (grammar): Branch to rules_or_grammar_declaration.
11514 2002-06-14 Akim Demaille <akim@epita.fr>
11516 * src/main.c (main): Invoke scanner_free.
11518 2002-06-14 Akim Demaille <akim@epita.fr>
11520 * src/output.c (m4_invoke): Extracted from...
11521 (output_skeleton): here.
11524 2002-06-14 Akim Demaille <akim@epita.fr>
11526 * src/parse-gram.y (directives, directive, gram)
11527 (grammar_directives, precedence_directives, precedence_directive):
11529 (declarations, declaration, grammar, grammar_declaration)
11530 (precedence_declaration, precedence_declarator): these.
11531 (symbol_declaration): New.
11533 2002-06-14 Akim Demaille <akim@epita.fr>
11535 * src/files.c (action_obstack): Remove, unused.
11536 (output_obstack): Remove it, and all its dependencies, as it is no
11538 * src/reader.c (epilogue_set): Build the epilogue in the
11540 * src/output.h, src/output.c (muscle_obstack): Move to...
11541 * src/muscle_tab.h, src/muscle_tab.h: here.
11542 (muscle_init): Initialize muscle_obstack.
11543 (muscle_free): New.
11544 * src/main.c (main): Call it.
11546 2002-06-14 Akim Demaille <akim@epita.fr>
11548 * src/location.h: New, extracted from...
11549 * src/reader.h: here.
11550 * src/Makefile.am (noinst_HEADERS): Merge into
11551 (bison_SOURCES): this.
11553 * src/parse-gram.y: Use location_t instead of Bison's.
11554 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11555 Use location_t instead of ints.
11557 2002-06-14 Akim Demaille <akim@epita.fr>
11559 * data/bison.simple, data/bison.c++: Be sure to restore the
11560 current #line when returning to the skeleton contents after having
11561 exposed the input file's #line.
11563 2002-06-12 Akim Demaille <akim@epita.fr>
11565 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11567 * tests/actions.at (Exotic Dollars): New.
11569 2002-06-12 Akim Demaille <akim@epita.fr>
11571 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11573 * tests/input.at (Torturing the Scanner): New.
11575 2002-06-11 Akim Demaille <akim@epita.fr>
11577 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11578 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11579 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11580 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11581 * src/reader.c (reader): Use it.
11583 2002-06-11 Akim Demaille <akim@epita.fr>
11585 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11586 Adjust all callers.
11587 (scanner_last_string_free): New.
11589 2002-06-11 Akim Demaille <akim@epita.fr>
11591 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11592 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11593 (last_string, YY_OBS_FREE): New.
11594 Use them when returning an ID.
11596 2002-06-11 Akim Demaille <akim@epita.fr>
11598 Have Bison grammars parsed by a Bison grammar.
11600 * src/reader.c, src/reader.h (prologue_augment): New.
11601 * src/reader.c (copy_definition): Remove.
11603 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11604 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11605 (grammar_current_rule_prec_set, grammar_current_rule_check)
11606 (grammar_current_rule_symbol_append)
11607 (grammar_current_rule_action_append): Export.
11608 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11609 (symbol_list_action_append): Remove.
11610 Hook the routines from reader.
11611 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11612 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11614 * src/reader.c (read_declarations): Remove, unused.
11616 * src/parse-gram.y: Handle the epilogue.
11617 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11618 (grammar_start_symbol_set): this.
11619 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11620 * src/reader.c (readgram): Remove, unused.
11621 (reader): Adjust to insert eoftoken and axiom where appropriate.
11623 * src/reader.c (copy_dollar): Replace with...
11624 * src/scan-gram.h (handle_dollar): this.
11625 * src/parse-gram.y: Remove `%thong'.
11627 * src/reader.c (copy_at): Replace with...
11628 * src/scan-gram.h (handle_at): this.
11630 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11633 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11636 * src/reader.h, src/reader.c (grammar_rule_end): New.
11638 * src/parse.y (current_type, current_class): New.
11639 Implement `%nterm', `%token' support.
11640 Merge `%term' into `%token'.
11641 (string_as_id): New.
11642 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11645 * src/parse-gram.y: Be sure to handle properly the beginning of
11648 * src/parse-gram.y: Handle %type.
11649 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11651 * src/parse-gram.y: More directives support.
11652 * src/options.c: No longer handle source directives.
11654 * src/parse-gram.y: Fix %output.
11656 * src/parse-gram.y: Handle %union.
11657 Use the prologue locations.
11658 * src/reader.c (parse_union_decl): Remove.
11660 * src/reader.h, src/reader.c (epilogue_set): New.
11661 * src/parse-gram.y: Use it.
11663 * data/bison.simple, data/bison.c++: b4_stype is now either not
11664 defined, then default to int, or to the contents of %union,
11665 without `union' itself.
11667 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11669 * src/output.c (actions_output): Don't output braces, as they are
11670 already handled by the scanner.
11672 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11673 characters to themselves.
11675 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11676 that the epilogue has a proper #line.
11678 * src/parse-gram.y: Handle precedence/associativity.
11680 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11682 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11683 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11684 at all to define terminals that cannot be emitted.
11686 * src/scan-gram.l: Escape M4 characters.
11688 * src/scan-gram.l: Working properly with escapes in user
11689 strings/characters.
11691 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11692 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11694 Use more modest sizes, as for the time being the parser does not
11695 release memory, and therefore the process swallows a huge amount
11698 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11699 stricter %token grammar.
11701 * src/symtab.h (associativity): Add `undef_assoc'.
11702 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11703 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11705 * tests/regression.at (Invalid %directive): Remove, as it is now
11707 (Invalid inputs): Adjust to the new error messages.
11708 (Token definitions): The new grammar doesn't allow too many
11711 * src/lex.h, src/lex.c: Remove.
11712 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11713 (copy_character, copy_string2, copy_string, copy_identifier)
11714 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11715 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11716 (parse_action): Remove.
11717 * po/POTFILES.in: Adjust.
11719 2002-06-11 Akim Demaille <akim@epita.fr>
11721 * src/reader.c (parse_action): Don't store directly into the
11722 rule's action member: return the action as a string.
11723 Don't require `rule_length' as an argument: compute it.
11724 (grammar_current_rule_symbol_append)
11725 (grammar_current_rule_action_append): New, eved out from
11727 Remove `action_flag', `rulelength', unused now.
11729 2002-06-11 Akim Demaille <akim@epita.fr>
11731 * src/reader.c (grammar_current_rule_prec_set).
11732 (grammar_current_rule_check): New, eved out from...
11734 Remove `xaction', `first_rhs': useless.
11735 * tests/input.at (Type clashes): New.
11736 * tests/existing.at (GNU Cim Grammar): Adjust.
11738 2002-06-11 Akim Demaille <akim@epita.fr>
11740 * src/reader.c (grammar_midrule_action): New, Eved out from
11743 2002-06-11 Akim Demaille <akim@epita.fr>
11745 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11747 (readgram): Use them as replacement of inlined code, crule and
11750 2002-06-11 Akim Demaille <akim@epita.fr>
11752 * src/reader.c (grammar_end, grammar_symbol_append): New.
11753 (readgram): Use them.
11754 Make the use of `p' as local as possible.
11756 2002-06-10 Akim Demaille <akim@epita.fr>
11758 GCJ's parser requires the tokens to be defined before the prologue.
11760 * data/bison.simple: Output the token definition before the user's
11762 * tests/regression.at (Braces parsing, Duplicate string)
11763 (Mixing %token styles): Check the output from bison.
11764 (Early token definitions): New.
11766 2002-06-10 Akim Demaille <akim@epita.fr>
11768 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11769 assigning twice the same user number to a token, so that we can
11771 * src/lex.c (lex): here.
11772 Also use `symbol_class_set' instead of hand written code.
11773 * src/reader.c (parse_assoc_decl): Likewise.
11775 2002-06-10 Akim Demaille <akim@epita.fr>
11777 * src/symtab.c, src/symtab.c (symbol_class_set)
11778 (symbol_user_token_number_set): New.
11779 * src/reader.c (parse_token_decl): Use them.
11780 Use a switch instead of ifs.
11781 Use a single argument.
11783 2002-06-10 Akim Demaille <akim@epita.fr>
11785 Remove `%thong' support as it is undocumented, unused, duplicates
11786 `%token's job, and creates useless e-mail traffic with people who
11787 want to know what it is, why it is undocumented, unused, and
11788 duplicates `%token's job.
11790 * src/reader.c (parse_thong_decl): Remove.
11791 * src/options.c (option_table): Remove "thong".
11792 * src/lex.h (tok_thong): Remove.
11794 2002-06-10 Akim Demaille <akim@epita.fr>
11796 * src/symtab.c, src/symtab.c (symbol_type_set)
11797 (symbol_precedence_set): New.
11798 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11799 (value_components_used): Remove, unused.
11801 2002-06-09 Akim Demaille <akim@epita.fr>
11803 Move symbols handling code out of the reader.
11805 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11806 (axiom): Move to...
11807 * src/symtab.h, src/symtab.c: here.
11809 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11810 * src/reader.c (startval): Rename as...
11811 * src/symtab.h, src/symtab.c (startsymbol): this.
11812 * src/reader.c: Adjust.
11814 * src/reader.c (symbol_check_defined, symbol_make_alias)
11815 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11816 (token_translations_init)
11818 * src/symtab.c: here.
11819 * src/reader.c (packsymbols): Move to...
11820 * src/symtab.h, src/symtab.c (symbols_pack): here.
11821 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11824 2002-06-03 Akim Demaille <akim@epita.fr>
11826 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11829 2002-06-03 Akim Demaille <akim@epita.fr>
11831 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11832 structs with non literals.
11833 * src/scan-skel.l: never-interactive.
11834 * src/conflicts.c (enum conflict_resolution_e): No trailing
11836 * src/getargs.c (usage): Split long literal strings.
11837 Reported by Hans Aberg.
11839 2002-05-28 Akim Demaille <akim@epita.fr>
11841 * data/bison.c++: Use C++ ostreams.
11842 (cdebug_): New member.
11844 2002-05-28 Akim Demaille <akim@epita.fr>
11846 * src/output.c (output_skeleton): Be sure to allocate enough room
11847 for `/' _and_ for `\0' in full_skeleton.
11849 2002-05-28 Akim Demaille <akim@epita.fr>
11851 * data/bison.c++: Catch up with bison.simple:
11852 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11853 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11854 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11855 and popping traces.
11857 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11859 * src/output.c (output_skeleton): Put an explicit path in front of
11860 the skeleton file name, rather than relying on the -I directory,
11861 to partially alleviate effects of having a skeleton file lying around
11862 in the current directory.
11864 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11866 * src/conflicts.c (log_resolution): Correct typo:
11867 obstack_printf should be obstack_fgrow1.
11869 2002-05-26 Akim Demaille <akim@epita.fr>
11871 * src/state.h (state_t): `solved_conflicts' is a new member.
11872 * src/LR0.c (new_state): Set it to 0.
11873 * src/conflicts.h, src/conflicts.c (print_conflicts)
11874 (free_conflicts, solve_conflicts): Rename as...
11875 (conflicts_print, conflicts_free, conflicts_solve): these.
11877 * src/conflicts.c (enum conflict_resolution_e)
11878 (solved_conflicts_obstack): New, used by...
11879 (log_resolution): this.
11880 Adjust to attach the conflict resolution to each state.
11881 Complete the description with the precedence/associativity
11883 (resolve_sr_conflict): Adjust.
11884 * src/print.c (print_state): Output its solved_conflicts.
11885 * tests/conflicts.at (Unresolved SR Conflicts)
11886 (Solved SR Conflicts): Exercise --report=all.
11888 2002-05-26 Akim Demaille <akim@epita.fr>
11890 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11891 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11892 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11893 (token_number_t, item_number_as_token_number)
11894 (token_number_as_item_number, muscle_insert_token_number_table):
11896 (symbol_number_t, item_number_as_symbol_number)
11897 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11898 these, since it is more appropriate.
11900 2002-05-26 Akim Demaille <akim@epita.fr>
11902 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11904 * data/bison.simple (yystos) [YYDEBUG]: New.
11905 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11907 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11909 2002-05-25 Akim Demaille <akim@epita.fr>
11911 * doc/bison.texinfo (Debugging): Split into...
11912 (Tracing): this new section, its former contents, and...
11913 (Understanding): this new section.
11914 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11916 (report_flag): this.
11917 Adjust all dependencies.
11918 (report_args, report_types, report_argmatch): New.
11919 (usage, getargs): Report/support -r, --report.
11921 (struct option_table_struct): Rename as..,
11922 (struct option_table_s): this.
11923 Rename the `set_flag' member to `flag' to match with getopt_long's
11925 * src/options.c (option_table): Split verbose into an entry for
11926 %verbose, and another for --verbose.
11927 Support --report/-r, so remove -r from the obsolete --raw.
11928 * src/print.c: Attach full item sets and lookaheads reports to
11929 report_flag instead of trace_flag.
11930 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11932 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11933 and Paul Eggert <eggert@twinsun.com>
11935 * data/bison.simple (yyparse): Correct error handling to conform to
11936 POSIX and yacc. Specifically, after syntax error is discovered,
11937 do not reduce further before shifting the error token.
11938 Clean up the code a bit by removing the labels yyerrdefault,
11939 yyerrhandle, yyerrpop.
11940 * NEWS: Document the above.
11942 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11944 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11945 type; it isn't always big enough, since it doesn't necessarily
11946 include non-terminals.
11947 (yytranslate): Expand definition of yy_token_number_type, so that
11948 the latter can be removed.
11949 (yy_token_number_type): Remove, only one use.
11950 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11951 don't use TokenNumberType as element type.
11953 * tests/regression.at: Modify expected output to agree with change
11954 to yyr1 and yytranslate.
11956 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11958 * src/reader.c (parse_action): Use copy_character instead of
11961 2002-05-13 Akim Demaille <akim@epita.fr>
11963 * tests/regression.at (Token definitions): Prototype yylex and
11966 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11968 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
11969 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11971 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11973 2002-05-07 Akim Demaille <akim@epita.fr>
11975 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11976 avoid GCC warnings.
11978 2002-05-07 Akim Demaille <akim@epita.fr>
11982 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11983 over the RHS of each rule.
11984 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11985 * src/state.h (state_t): Member `nitems' is unsigned short.
11986 * src/LR0.c (get_state): Adjust.
11987 * src/reader.c (packgram): Likewise.
11988 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11990 (muscle_insert_int_table): Remove, unused.
11991 (prepare_rules): Remove `max'.
11993 2002-05-06 Akim Demaille <akim@epita.fr>
11995 * src/closure.c (print_firsts): Display of the symbol tags.
11996 (bitmatrix_print): Move to...
11997 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11999 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
12001 2002-05-06 Akim Demaille <akim@epita.fr>
12003 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
12006 2002-05-06 Akim Demaille <akim@epita.fr>
12008 * src/LR0.c (new_state, get_state): Instead of using the global
12009 `kernel_size' and `kernel_base', have two new arguments:
12010 `core_size' and `core'.
12013 2002-05-06 Akim Demaille <akim@epita.fr>
12015 * src/reader.c (packgram): No longer end `ritem' with a 0
12016 sentinel: it is not used.
12018 2002-05-05 Akim Demaille <akim@epita.fr>
12020 New experimental feature: display the lookaheads in the report and
12023 * src/print (print_core): When --trace-flag, display the rules
12025 * src/print_graph.c (print_core): Likewise.
12026 Swap the arguments.
12029 2002-05-05 Akim Demaille <akim@epita.fr>
12031 * tests/torture.at (Many lookaheads): New test.
12033 2002-05-05 Akim Demaille <akim@epita.fr>
12035 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
12036 (GENERATE_MUSCLE_INSERT_TABLE): this.
12037 (output_int_table, output_unsigned_int_table, output_short_table)
12038 (output_token_number_table, output_item_number_table): Replace with...
12039 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
12040 (muscle_insert_short_table, muscle_insert_token_number_table)
12041 (muscle_insert_item_number_table): these.
12042 Adjust all callers.
12043 (prepare_tokens): Don't free `translations', since...
12044 * src/reader.h, src/reader.c (grammar_free): do it.
12046 * src/gram.h, src/gram.c (grammar_free): here.
12047 * data/bison.simple, data/bison.c++: b4_token_number_max is now
12050 2002-05-05 Akim Demaille <akim@epita.fr>
12052 * src/output.c (output_unsigned_int_table): New.
12053 (prepare_rules): `i' is unsigned.
12054 `prhs', `rline', `r2' are unsigned int.
12055 Rename muscle `rhs_number_max' as `rhs_max'.
12056 Output muscles `prhs_max', `rline_max', and `r2_max'.
12058 * data/bison.simple, data/bison.c++: Adjust to use these muscles
12059 to compute types instead of constant types.
12060 * tests/regression.at (Web2c Actions): Adjust.
12062 2002-05-04 Akim Demaille <akim@epita.fr>
12064 * src/symtab.h (SALIAS, SUNDEF): Rename as...
12065 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
12066 Adjust dependencies.
12067 * src/output.c (token_definitions_output): Be sure not to output a
12068 `#define 'a'' when fed with `%token 'a' "a"'.
12069 * tests/regression.at (Token definitions): New.
12071 2002-05-03 Paul Eggert <eggert@twinsun.com>
12073 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
12076 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
12078 * Makefile.am (SUBDIRS): Remove intl.
12079 (EXTRA_DIST): Add config/config.rpath.
12081 2002-05-03 Akim Demaille <akim@epita.fr>
12083 * data/bison.simple (m4_if): Don't output empty enums.
12084 And actually, output valid enum definitions :(.
12086 2002-05-03 Akim Demaille <akim@epita.fr>
12088 * configure.bat: Remove, completely obsolete.
12089 * Makefile.am (EXTRA_DIST): Adjust.
12090 Don't distribute config.rpath...
12091 * config/Makefile.am (EXTRA_DIST): Do it.
12093 2002-05-03 Akim Demaille <akim@epita.fr>
12095 * configure.in (GETTEXT_VERSION): New.
12096 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
12098 2002-05-03 Akim Demaille <akim@epita.fr>
12100 * data/bison.simple (b4_token_enum): New.
12101 (b4_token_defines): Use it to output tokens both as #define and
12103 Suggested by Paul Eggert.
12104 * src/output.c (token_definitions_output): Don't output spurious
12107 2002-05-03 Akim Demaille <akim@epita.fr>
12109 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12111 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
12113 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
12114 Update the stack class, give a try to deque as the default container.
12116 2002-05-02 Akim Demaille <akim@epita.fr>
12118 * data/bison.simple (yyparse): Do not implement @$ = @1.
12119 (YYLLOC_DEFAULT): Adjust to do it.
12120 * doc/bison.texinfo (Location Default Action): Fix.
12122 2002-05-02 Akim Demaille <akim@epita.fr>
12124 * src/reader.c (parse_braces): Merge into...
12125 (parse_action): this.
12127 2002-05-02 Akim Demaille <akim@epita.fr>
12129 * configure.in (ALL_LINGUAS): Remove.
12130 * po/LINGUAS, hr.po: New.
12132 2002-05-02 Akim Demaille <akim@epita.fr>
12134 Remove the so called hairy (semantic) parsers.
12136 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
12137 * src/gram.h, src/gram.c (semantic_parser): Remove.
12138 (rule_t): Remove the guard and guard_line members.
12139 * src/lex.h (token_t): remove tok_guard.
12140 * src/options.c (option_table): Remove %guard and %semantic_parser
12142 * src/output.c, src/output.h (guards_output): Remove.
12144 (token_definitions_output): Don't output the `T'
12146 (output_skeleton): Don't output the guards.
12147 * src/files.c, src/files.c (attrsfile): Remove.
12148 * src/reader.c (symbol_list): Remove the guard and guard_line
12150 Adjust dependencies.
12151 (parse_guard): Remove.
12152 * data/bison.hairy: Remove.
12153 * doc/bison.texinfo (Environment Variables): Remove occurrences of
12156 2002-05-02 Akim Demaille <akim@epita.fr>
12158 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
12159 (parse_guard): Rename the formal argument `stack_offset' as
12160 `rule_length', which is more readable.
12162 (copy_at, copy_dollar): Instead of outputting the hard coded
12163 values of $$, $n and so forth, output invocation to b4_lhs_value,
12164 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
12165 Note: this patch partially drops `semantic-parser' support: it
12166 always does `rule_length - n', where semantic parsers ought to
12168 * data/bison.simple, data/bison.c++ (b4_lhs_value)
12169 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12171 2002-05-02 Akim Demaille <akim@epita.fr>
12173 * configure.in (AC_INIT): Bump to 1.49b.
12174 (AM_INIT_AUTOMAKE): Short invocation.
12176 2002-05-02 Akim Demaille <akim@epita.fr>
12180 2002-05-01 Akim Demaille <akim@epita.fr>
12182 * src/skeleton.h: Remove.
12184 2002-05-01 Akim Demaille <akim@epita.fr>
12186 * src/skeleton.h: Fix the #endif.
12187 Reported by Magnus Fromreide.
12189 2002-04-26 Paul Eggert <eggert@twinsun.com>
12191 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
12192 Define if we define YYSTYPE and YYLTYPE, respectively.
12193 (YYCOPY): Fix [] quoting problem in the non-GCC case.
12195 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
12197 * src/scan-skel.l: Postprocess quadrigraphs.
12199 * src/reader.c (copy_character): New function, used to output
12200 single characters while replacing `[' and `]' with quadrigraphs, to
12201 avoid troubles with M4 quotes.
12202 (copy_comment): Output characters with copy_character.
12203 (read_additionnal_code): Likewise.
12204 (copy_string2): Likewise.
12205 (copy_definition): Likewise.
12207 * tests/calc.at: Exercise M4 quoting.
12209 2002-04-25 Akim Demaille <akim@epita.fr>
12211 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
12212 between `!' and the command.
12213 Reported by Paul Eggert.
12215 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
12217 * tests/calc.at: Exercise prologue splitting.
12219 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
12220 `b4_post_prologue' instead of `b4_prologue'.
12222 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
12224 (output): Free pre_prologue_obstack and post_prologue_obstack.
12225 * src/files.h, src/files.c (attrs_obstack): Remove.
12226 (pre_prologue_obstack, post_prologue_obstack): New.
12227 * src/reader.c (copy_definition): Add a parameter to specify the
12228 obstack to fill, instead of using attrs_obstack unconditionally.
12229 (read_declarations): Pass pre_prologue_obstack to copy_definition if
12230 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
12232 2002-04-23 Paul Eggert <eggert@twinsun.com>
12234 * data/bison.simple: Remove unnecessary commentary and white
12235 space differences from 1_29-branch.
12236 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
12238 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
12239 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
12240 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
12241 constructors or destructors.
12243 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
12245 2002-04-23 Akim Demaille <akim@epita.fr>
12247 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
12248 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
12249 location with columns.
12250 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
12251 All reported by Paul Eggert.
12253 2002-04-22 Akim Demaille <akim@epita.fr>
12255 * src/reduce.c (dump_grammar): Move to...
12256 * src/gram.h, src/gram.c (grammar_dump): here.
12257 Be sure to separate long item numbers.
12258 Don't read the members of a rule's prec if its nil.
12260 2002-04-22 Akim Demaille <akim@epita.fr>
12262 * src/output.c (table_size, table_grow): New.
12263 (MAXTABLE): Remove, replace uses with table_size.
12264 (pack_vector): Instead of dying when the table is too big, grow it.
12266 2002-04-22 Akim Demaille <akim@epita.fr>
12268 * data/bison.simple (yyr1): Its type is that of a token number.
12269 * data/bison.c++ (r1_): Likewise.
12270 * tests/regression.at (Web2c Actions): Adjust.
12272 2002-04-22 Akim Demaille <akim@epita.fr>
12274 * src/reader.c (token_translations_init): 256 is now the default
12275 value for the error token, i.e., it will be assigned another
12276 number if the user assigned 256 to one of her tokens.
12277 (reader): Don't force 256 to error.
12278 * doc/bison.texinfo (Symbols): Adjust.
12279 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
12280 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
12281 etc. instead of 10, 20, 30 (which was used to `jump' over error
12282 (256) and undefined (2)).
12284 2002-04-22 Akim Demaille <akim@epita.fr>
12286 Propagate more token_number_t.
12288 * src/gram.h (token_number_as_item_number)
12289 (item_number_as_token_number): New.
12290 * src/output.c (GENERATE_OUTPUT_TABLE): New.
12291 Use it to create output_item_number_table and
12292 output_token_number_table.
12293 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12294 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
12295 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
12296 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
12298 2002-04-22 Akim Demaille <akim@epita.fr>
12300 * src/output.h, src/output.c (get_lines_number): Remove.
12302 2002-04-19 Akim Demaille <akim@epita.fr>
12304 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
12306 (Debugging): More details about enabling the debugging features.
12307 (Table of Symbols): Describe $$, $n, @$, and @n.
12308 Suggested by Tim Josling.
12310 2002-04-19 Akim Demaille <akim@epita.fr>
12312 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
12314 2002-04-10 Akim Demaille <akim@epita.fr>
12316 * src/system.h: Rely on HAVE_LIMITS_H.
12317 Suggested by Paul Eggert.
12319 2002-04-09 Akim Demaille <akim@epita.fr>
12321 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
12322 full stderr, and strip it according to the bison options, instead
12323 of composing the error message from different bits.
12324 This makes it easier to check for several error messages.
12325 Adjust all the invocations.
12326 Add an invocation exercising the error token.
12327 Add an invocation demonstrating a stupid error message.
12328 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
12330 Error message are for stderr, not stdout.
12332 2002-04-09 Akim Demaille <akim@epita.fr>
12334 * src/gram.h, src/gram.c (error_token_number): Remove, use
12336 * src/reader.c (reader): Don't specify the user token number (2)
12337 for $undefined, as it uselessly prevents using it.
12338 * src/gram.h (token_number_t): Move to...
12339 * src/symtab.h: here.
12340 (state_t.number): Is a token_number_t.
12341 * src/print.c, src/reader.c: Use undeftoken->number instead of
12343 (Even though this 2 is not the same as above: the number of the
12344 undeftoken remains being 2, it is its user token number which
12346 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
12347 `user_token_number_max'.
12348 Output `undef_token_number'.
12349 * data/bison.simple, data/bison.c++: Use them.
12350 Be sure to map invalid yylex return values to
12351 `undef_token_number'. This saves us from gratuitous SEGV.
12353 * tests/conflicts.at (Solved SR Conflicts)
12354 (Unresolved SR Conflicts): Adjust.
12355 * tests/regression.at (Web2c Actions): Adjust.
12357 2002-04-08 Akim Demaille <akim@epita.fr>
12359 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
12361 Remove the duplicate `typedefs'.
12362 (RhsNumberType): Fix the declaration and various other typos.
12364 * data/bison.simple: Use __ofile__.
12365 * src/scan-skel.l: Handle __ofile__.
12367 2002-04-08 Akim Demaille <akim@epita.fr>
12369 * src/gram.h (item_number_t): New, the type of item numbers in
12370 RITEM. Note that it must be able to code symbol numbers as
12371 positive number, and the negation of rule numbers as negative
12373 Adjust all dependencies (pretty many).
12374 * src/reduce.c (rule): Remove this `short *' pointer: use
12376 * src/system.h (MINSHORT, MAXSHORT): Remove.
12377 Include `limits.h'.
12378 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
12379 (shortcpy): Remove.
12380 (MAXTABLE): Move to...
12381 * src/output.c (MAXTABLE): here.
12382 (prepare_rules): Use output_int_table to output rhs.
12383 * data/bison.simple, data/bison.c++: Adjust.
12384 * tests/torture.at (Big triangle): Move the limit from 254 to
12386 * tests/regression.at (Web2c Actions): Ajust.
12388 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
12389 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
12390 passes, but produces negative #line number, once fixed, GCC is
12391 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
12393 * src/state.h (state_h): Code input lines on ints, not shorts.
12395 2002-04-08 Akim Demaille <akim@epita.fr>
12397 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
12398 and then the grammar.
12400 2002-04-08 Akim Demaille <akim@epita.fr>
12402 * src/system.h: No longer using strndup.
12404 2002-04-07 Akim Demaille <akim@epita.fr>
12406 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
12407 * src/output.c (output_table_data): Return the longest number.
12408 (prepare_tokens): Output `token_number_max').
12409 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
12411 Use them to define yy_token_number_type/TokenNumberType.
12412 Use this type for yytranslate.
12413 * tests/torture.at (Big triangle): Push the limit from 124 to
12415 * tests/regression.at (Web2c Actions): Adjust.
12417 2002-04-07 Akim Demaille <akim@epita.fr>
12419 * tests/torture.at (Big triangle): New.
12420 (GNU AWK Grammar, GNU Cim Grammar): Move to...
12421 * tests/existing.at: here.
12423 2002-04-07 Akim Demaille <akim@epita.fr>
12425 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
12427 Adjust dependencies.
12429 2002-04-07 Akim Demaille <akim@epita.fr>
12431 * src/reader.c: Normalize increments to prefix form.
12433 2002-04-07 Akim Demaille <akim@epita.fr>
12435 * src/reader.c, symtab.c: Remove debugging code.
12437 2002-04-07 Akim Demaille <akim@epita.fr>
12439 Rename all the `bucket's as `symbol_t'.
12441 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
12442 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
12443 * src/symtab.c, src/symtab.h (bucket): Rename as...
12445 (symbol_list_new, bucket_check_defined, bucket_make_alias)
12446 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
12447 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12448 (buckets_new, buckets_free, buckets_do): Rename as...
12449 (symbol_list_new, symbol_check_defined, symbol_make_alias)
12450 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12451 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
12452 (symbols_new, symbols_free, symbols_do): these.
12454 2002-04-07 Akim Demaille <akim@epita.fr>
12456 Use lib/hash for the symbol table.
12458 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
12460 * src/lex.c (lex): Set the `number' member of new terminals.
12461 * src/reader.c (bucket_check_defined, bucket_make_alias)
12462 (bucket_check_alias_consistence, bucket_translation): New.
12463 (reader, grammar_free, readgram, token_translations_init)
12464 (packsymbols): Adjust.
12465 (reader): Number the predefined tokens.
12466 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
12467 for predefined tokens.
12468 * src/symtab.h (bucket): Remove all the hash table related
12470 * src/symtab.c (symtab): Replace by...
12471 (bucket_table): this.
12472 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12473 (buckets_new, buckets_do): New.
12475 2002-04-07 Akim Demaille <akim@epita.fr>
12477 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
12478 (start_symbol, max_user_token_number, semantic_parser)
12479 (error_token_number): Initialize.
12480 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
12483 (errtoken, eoftoken, undeftoken, axiom): Extern.
12485 2002-04-07 Akim Demaille <akim@epita.fr>
12487 * src/gram.h (rule_s): prec and precsym are now pointers
12488 to the bucket giving the priority/associativity.
12489 Member `associativity' removed: useless.
12490 * src/reduce.c, src/conflicts.c: Adjust.
12492 2002-04-07 Akim Demaille <akim@epita.fr>
12494 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
12495 Properly escape the symbols' TAG when outputting them.
12497 2002-04-07 Akim Demaille <akim@epita.fr>
12499 * src/lalr.h (LA): Is a bitsetv, not bitset*.
12501 2002-04-07 Akim Demaille <akim@epita.fr>
12503 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
12504 (LArule): this, which is an array to rule_t*.
12505 * src/print.c, src/conflicts.c: Adjust.
12507 2002-04-07 Akim Demaille <akim@epita.fr>
12509 * src/gram.h (rule_t): Rename `number' as `user_number'.
12510 `number' is a new member.
12511 Adjust dependencies.
12512 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
12514 2002-04-07 Akim Demaille <akim@epita.fr>
12516 As a result of the previous patch, it is no longer needed
12517 to reorder ritem itself.
12519 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12521 2002-04-07 Akim Demaille <akim@epita.fr>
12523 Be sure never to walk through RITEMS, but use only data related to
12524 the rules themselves. RITEMS should be banished.
12526 * src/output.c (output_token_translations): Rename as...
12527 (prepare_tokens): this.
12528 In addition to `translate', prepare the muscles `tname' and
12529 `toknum', which were handled by...
12530 (output_rule_data): this.
12531 Remove, and move the remainder of its outputs into...
12532 (prepare_rules): this new routines, which also merges content from
12533 (output_gram): this.
12534 (prepare_rules): Be sure never to walk through RITEMS.
12535 (output_stos): Rename as...
12536 (prepare_stos): this.
12537 (output): Always invoke prepare_states, after all, just don't use it
12538 in the output if you don't need it.
12540 2002-04-07 Akim Demaille <akim@epita.fr>
12542 * src/LR0.c (new_state): Display `nstates' as the name of the
12543 newly created state.
12544 Adjust to initialize first_state and last_state if needed.
12545 Be sure to distinguish the initial from the final state.
12546 (new_states): Create the itemset of the initial state, and use
12548 * src/closure.c (closure): Now that the initial state has its
12549 items properly set, there is no need for a special case when
12550 creating `ruleset'.
12552 As a result, now the rule 0, reducing to $axiom, is visible in the
12553 outputs. Adjust the test suite.
12555 * tests/conflicts.at (Solved SR Conflicts)
12556 (Unresolved SR Conflicts): Adjust.
12557 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12558 * tests/conflicts.at (S/R in initial): New.
12560 2002-04-07 Akim Demaille <akim@epita.fr>
12562 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12563 the RHS of the rules.
12564 * src/output.c (output_gram): Likewise.
12566 2002-04-07 Akim Demaille <akim@epita.fr>
12568 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12570 Adjust all dependencies.
12571 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12572 `number' of the buckets too.
12573 * src/gram.h: Include `symtab.h'.
12574 (associativity): Move to...
12575 * src/symtab.h: here.
12576 No longer include `gram.h'.
12578 2002-04-07 Akim Demaille <akim@epita.fr>
12580 * src/gram.h, src/gram.c (rules_rhs_length): New.
12581 (ritem_longest_rhs): Use it.
12582 * src/gram.h (rule_t): `number' is a new member.
12583 * src/reader.c (packgram): Set it.
12584 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12585 the end of `rules', and count them out of `nrules'.
12586 (reduce_output, dump_grammar): Adjust.
12587 * src/print.c (print_grammar): It is no longer needed to check for
12588 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12589 * tests/reduce.at (Reduced Automaton): New test.
12591 2002-04-07 Akim Demaille <akim@epita.fr>
12593 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12594 lacking `+ 1' to nrules, Bison reported as useless a token if it
12595 was used solely to set the precedence of the last rule...
12597 2002-04-07 Akim Demaille <akim@epita.fr>
12599 * data/bison.c++, data/bison.simple: Don't output the current file
12600 name in #line, to avoid useless diffs between two identical
12601 outputs under different names.
12603 2002-04-07 Akim Demaille <akim@epita.fr>
12605 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12606 Normalize loops to using `< nrules + 1', not `<= nrules'.
12608 2002-04-07 Akim Demaille <akim@epita.fr>
12612 2002-04-07 Akim Demaille <akim@epita.fr>
12614 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12615 bucket.value as bucket.number.
12617 2002-04-07 Akim Demaille <akim@epita.fr>
12619 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12620 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12621 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12622 RHS, instead of being an index in RITEMS.
12624 2002-04-04 Paul Eggert <eggert@twinsun.com>
12626 * doc/bison.texinfo: Update copyright date.
12627 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12628 (Symbols): Warn about running Bison in one character set,
12629 but compiling and/or running in an incompatible one.
12630 Warn about character code 256, too.
12632 2002-04-03 Paul Eggert <eggert@twinsun.com>
12634 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12635 YYERROR_VERBOSE is nonzero, not whether it is defined.
12637 Merge changes from bison-1_29-branch.
12639 2002-03-20 Paul Eggert <eggert@twinsun.com>
12641 Merge fixes from Debian bison_1.34-1.diff.
12643 * configure.in (AC_PREREQ): 2.53.
12645 2002-03-20 Akim Demaille <akim@epita.fr>
12647 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12649 2002-03-19 Paul Eggert <eggert@twinsun.com>
12651 * src/bison.simple (YYCOPY): New macro.
12652 (YYSTACK_RELOCATE): Use it.
12653 Remove Type arg; no longer needed. All callers changed.
12654 (yymemcpy): Remove; no longer needed.
12656 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12657 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12659 2002-03-19 Akim Demaille <akim@epita.fr>
12661 Test and fix the #line outputs.
12663 * tests/atlocal.at (GCC): New.
12664 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
12665 (Prologue synch line, %union synch line, Postprologue synch line)
12666 (Action synch line, Epilogue synch line): New tests.
12667 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12668 * data/bison.simple, data/bison.c++: Use it.
12670 2002-03-19 Akim Demaille <akim@epita.fr>
12672 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12673 (Solved SR Conflicts, %expect not enough, %expect right)
12674 (%expect too much): Move to...
12675 * tests/conflicts.at: this new file.
12677 2002-03-19 Akim Demaille <akim@epita.fr>
12679 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12680 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12681 that we can move to enums for instance.
12682 * src/output.c (token_definitions_output): Output a list of
12683 `token-name, token-number' instead of the #define.
12684 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12686 2002-03-14 Akim Demaille <akim@epita.fr>
12688 Use Gettext 0.11.1.
12690 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
12692 * data/bison.c++: Make the user able to add members to the generated
12693 parser by subclassing.
12695 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
12697 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12699 Reported by Nicolas Tisserand and Nicolas Burrus.
12701 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12703 * src/reader.c: Warn about lacking semi-colons, do not complain.
12705 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12707 * data/bison.c++: Remove a debug line.
12709 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12711 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12712 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12713 provide a default implementation.
12715 2002-03-04 Akim Demaille <akim@epita.fr>
12717 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12718 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12719 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12720 * tests/semantic.at (Parsing Guards): Similarly.
12721 * src/reader.at (readgram): Complain if the last rule is not ended
12724 2002-03-04 Akim Demaille <akim@epita.fr>
12726 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12727 * src/closure.c: here.
12728 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12730 * src/warshall.h, src/warshall.c: Remove.
12731 * tests/sets.at (Broken Closure): Adjust.
12733 2002-03-04 Akim Demaille <akim@epita.fr>
12735 * src/output.c (output_skeleton): tempdir is const.
12736 bytes_read is unused.
12738 2002-03-04 Akim Demaille <akim@epita.fr>
12740 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12741 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12743 From Michael Hayes.
12745 2002-03-04 Akim Demaille <akim@epita.fr>
12747 * src/closure.c (closure): `r' is unused.
12749 2002-03-04 Akim Demaille <akim@epita.fr>
12751 * tests/sets.at (Broken Closure): Add the ending `;'.
12752 * src/reader.at (readgram): Complain if a rule is not ended with a
12755 2002-03-04 Akim Demaille <akim@epita.fr>
12757 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12758 (count_sr_conflicts): Use bitset_count.
12759 * src/reduce.c (inaccessable_symbols): Ditto.
12760 (bits_size): Remove.
12761 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12763 2002-03-04 Akim Demaille <akim@epita.fr>
12765 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12766 * src/reduce.c: Remove the `bitset_zero's following the
12767 `bitset_create's, as now it is performed by the latter.
12769 2002-03-04 Akim Demaille <akim@epita.fr>
12771 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12772 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12773 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12774 latest sources from Michael.
12776 2002-03-04 Akim Demaille <akim@epita.fr>
12778 * src/output.c (output): Don't free the grammar.
12779 * src/reader.c (grammar_free): New.
12780 * src/main.c (main): Call it and don't free symtab here.
12782 2002-03-04 Akim Demaille <akim@epita.fr>
12784 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12786 Reported by Benoit Perrot.
12788 2002-03-04 Akim Demaille <akim@epita.fr>
12790 Use bitset operations when possible, not loops over bits.
12792 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12794 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12795 * src/reduce.c (useless_nonterminals): Formatting changes.
12796 * src/warshall.c (TC): Use bitset_or.
12798 2002-03-04 Akim Demaille <akim@epita.fr>
12800 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12801 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12804 2002-03-04 Akim Demaille <akim@epita.fr>
12806 * src/lalr.c (F): Now a bitset*.
12807 Adjust all dependencies.
12809 2002-03-04 Akim Demaille <akim@epita.fr>
12811 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12812 Adjust all dependencies.
12814 2002-03-04 Akim Demaille <akim@epita.fr>
12816 * src/L0.c, src/LR0.h (nstates): Be size_t.
12817 Adjust comparisons (signed vs unsigned).
12818 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12820 Adjust all dependencies.
12822 2002-03-04 Akim Demaille <akim@epita.fr>
12824 * src/closure.c (firsts): Now, also a bitset.
12825 Adjust all dependencies.
12826 (varsetsize): Remove, now unused.
12827 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12829 2002-03-04 Akim Demaille <akim@epita.fr>
12831 * src/print.c: Convert to use bitset.h, not hand coded iterations
12834 2002-03-04 Akim Demaille <akim@epita.fr>
12836 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12838 2002-03-04 Akim Demaille <akim@epita.fr>
12840 * src/closure.c (ruleset): Be a bitset.
12841 (rulesetsize): Remove.
12843 2002-03-04 Akim Demaille <akim@epita.fr>
12845 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12846 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12847 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12848 * src/closure.c (fderives): Be an array of bitsets.
12850 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
12852 * data/bison.c++: Merge the two generated headers. Insert a copyright
12853 notice in each output file.
12855 2002-02-28 Akim Demaille <akim@epita.fr>
12857 * data/bison.c++: Copy the prologue of bison.simple to fetch
12858 useful M4 definitions, such as b4_header_guard.
12860 2002-02-25 Akim Demaille <akim@epita.fr>
12862 * src/getargs.c (version): Give the name of the authors, and use a
12863 translator friendly scheme for the bgr
12866 2002-02-25 Akim Demaille <akim@epita.fr>
12868 * src/output.c (header_output): Remove, now handled completely via
12871 2002-02-25 Akim Demaille <akim@epita.fr>
12873 * m4/m4.m4: New, from CVS Autoconf.
12874 * configure.in: Invoke it.
12875 * src/output.c (output_skeleton): Use its result instead of the
12878 2002-02-25 Akim Demaille <akim@epita.fr>
12880 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12882 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12883 * src/output.c (output_skeleton): Use mkstemp to create a real
12885 Move the filling of `skeleton' and its muscle to...
12887 (output): Move the definition of the prologue muscle to...
12889 * src/system.h (DEFAULT_TMPDIR): New.
12891 2002-02-14 Paul Eggert <eggert@twinsun.com>
12893 Remove the support for C++ namespace cleanliness; it was
12894 causing more problems than it was curing, since it didn't work
12895 properly on some nonstandard C++ compilers. This can wait
12896 for a proper C++ parser.
12898 * NEWS: Document this.
12899 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12900 of C++, as it's treated like C now.
12901 * src/bison.simple (YYSTD): Remove.
12902 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12903 Treat C++ just like Standard C instead of trying to support
12904 namespace cleanliness.
12906 2002-02-14 Akim Demaille <akim@epita.fr>
12908 * tests/regression.at (else): Adjust to Andreas' change.
12910 2002-02-14 Akim Demaille <akim@epita.fr>
12912 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12914 2002-02-13 Andreas Schwab <schwab@suse.de>
12916 * src/output.c (output_rule_data): Don't output NULL, it might
12917 not be defined yet.
12919 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
12921 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12922 (Copyright notice): Update.
12924 2002-02-11 Akim Demaille <akim@epita.fr>
12926 * tests/regression.at (%nonassoc and eof): Don't include
12927 nonportable headers.
12929 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
12931 * data/bison.c++: Correct error recovery. Make the user able to
12932 initialize the starting location.
12934 2002-02-07 Akim Demaille <akim@epita.fr>
12936 * tests/input.at: New.
12938 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12940 * data/bison.c++: Replace some direct m4 expansions by constants. Be
12941 more consistent when naming methods and variables. Put preprocessor
12942 directives around tables only needed for debugging.
12944 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12946 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12948 (yy::b4_name::parse): Use print_.
12950 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12952 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12954 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12956 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12958 (yy::b4_name::parse): Build verbose error messages, and use error_.
12960 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12962 * data/bison.c++: Fix m4 quoting in comments.
12964 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12966 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12967 not expanded by m4.
12969 2002-02-05 Akim Demaille <akim@epita.fr>
12971 * data/bison.c++: Adjust to the M4 back end.
12972 More is certainly needed.
12974 2002-02-05 Akim Demaille <akim@epita.fr>
12976 Give a try to M4 as a back end.
12978 * lib/readpipe.c: New, from wdiff.
12979 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12981 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12982 specific values. Now it is m4 that performs the lookup.
12983 * src/parse-skel.y: Remove.
12984 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12985 * src/output.c (actions_output, guards_output)
12986 (token_definitions_output): No longer keeps track of the output
12987 line number, hence remove the second argument.
12988 (guards_output): Check against the guard member of a rule, not the
12991 (output_skeleton): Don't look for the skeleton location, let m4 do
12993 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12995 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12996 (prepare): Given that for the time being changesyntax is not
12997 usable in M4, rename the muscles using `-' to `_'.
12998 Define `defines_flag', `output_parser_name' and `output_header_name'.
12999 * src/output.h (actions_output, guards_output)
13000 (token_definitions_output): Adjust prototypes.
13001 * src/scan-skel.l: Instead of scanning the skeletons, it now
13002 processes the output of m4: `__oline__' and `#output'.
13003 * data/bison.simple: Adjust to be used by M4(sugar).
13004 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
13006 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
13007 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
13008 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
13009 shamelessly stolen from CVS Autoconf.
13011 2002-02-05 Akim Demaille <akim@epita.fr>
13013 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
13014 * configure.in: Check for the declarations of free and malloc.
13015 * src/muscle_tab.c: Adjust.
13017 2002-02-05 Akim Demaille <akim@epita.fr>
13019 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
13020 which have no values.
13022 2002-02-05 Akim Demaille <akim@epita.fr>
13024 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
13027 2002-01-29 Paul Eggert <eggert@twinsun.com>
13029 * src/bison.simple (YYSIZE_T): Do not define merely because
13030 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
13031 On some platforms, <alloca.h> does not declare YYSTD (size_t).
13033 2002-01-27 Akim Demaille <akim@epita.fr>
13035 Fix `%nonassoc and eof'.
13037 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
13038 which were not properly copied! Replace
13039 memcpy (res->errs, src->errs, src->nerrs);
13041 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
13043 * tests/regression.at (%nonassoc and eof): Adjust to newest
13044 Autotest: `.' is not in the PATH.
13046 2002-01-27 Akim Demaille <akim@epita.fr>
13048 * tests/sets.at (AT_EXTRACT_SETS): New.
13049 (Nullable): Use it.
13052 2002-01-26 Akim Demaille <akim@epita.fr>
13054 * tests/actions.at, tests/calc.at, tests/headers.at,
13055 * tests/torture.at: Adjust to the newest Autotest which no longer
13056 forces `.' in the PATH.
13058 2002-01-25 Akim Demaille <akim@epita.fr>
13060 * tests/regression.at (%nonassoc and eof): New.
13061 Suggested by Robert Anisko.
13063 2002-01-24 Akim Demaille <akim@epita.fr>
13065 Bison dumps core when trying to complain about broken input files.
13066 Reported by Cris van Pelt.
13068 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
13069 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
13071 (Invalid inputs): Strengthen: exercise parse_percent_token.
13073 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
13075 * src/Makefile.am: Add bison.c++.
13076 * src/bison.c++: New skeleton.
13078 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
13082 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
13084 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
13086 2002-01-20 Marc Autret <marc@gnu.org>
13088 * src/files.c (compute_output_file_names): Fix
13090 2002-01-20 Marc Autret <marc@gnu.org>
13092 * tests/output.at: New test.
13093 * src/files.c (compute_base_names): Don't map extensions when
13094 the YACC flag is set, use defaults.
13095 Reported by Evgeny Stambulchik.
13097 2002-01-20 Marc Autret <marc@gnu.org>
13099 * src/system.h: Need to define __attribute__ away for non-GCC
13100 compilers as well (i.e., the vendor C compiler).
13101 Suggested by Albert Chin-A-Young.
13103 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
13105 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
13106 canonical definition.
13107 * src/system.h: Use the canonical definition for PARAMS (avoids
13108 a conflict with the macro from lib/hash.h).
13110 2002-01-11 Akim Demaille <akim@epita.fr>
13112 * configure.in: Use AC_FUNC_STRNLEN.
13113 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
13115 2002-01-09 Akim Demaille <akim@epita.fr>
13117 * src/files.c, src/files.h (output_infix): New.
13118 (tab_extension): Remove.
13119 (compute_base_names): Compute the former, drop the latter.
13120 * src/output.c (prepare): Insert the muscles `output-infix', and
13122 * src/parse-skel.y (string, string.1): New.
13123 (section.header): Use it.
13124 (section.yacc): Remove.
13125 (prefix): Remove too.
13126 * src/scan-skel.l: Adjust.
13127 * src/bison.simple, src/bison.hairy: Adjust.
13129 2002-01-09 Akim Demaille <akim@epita.fr>
13131 * configure.in (WERROR_CFLAGS): Compute it.
13132 * src/Makefile.am (CFLAGS): Pass it.
13133 * tests/atlocal.in (CFLAGS): Idem.
13134 * src/files.c: Fix a few warnings.
13135 (get_extension_index): Remove, unused.
13137 2002-01-08 Akim Demaille <akim@epita.fr>
13139 * src/getargs.c (AS_FILE_NAME): New.
13140 (getargs): Use it to convert DOSish file names.
13141 * src/files.c (base_name): Rename as full_base_name to avoid
13142 clashes with `base_name ()'.
13143 (filename_split): New.
13144 (compute_base_names): N-th rewrite, using filename_split.
13146 2002-01-08 Akim Demaille <akim@epita.fr>
13148 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
13149 New, stolen from the Fileutils 4.1.
13150 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13151 * configure.in: Check for the presence of memrchr, and of its
13154 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
13156 * lib/hash.h (__P): Added definition for this macro.
13157 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
13158 BUILT_SOURCES, to ensure they are generated first.
13159 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
13160 %error-verbose to allow bootstrapping with bison 1.30x.
13162 2002-01-06 Akim Demaille <akim@epita.fr>
13164 * src/reader.c (parse_braces): Don't fetch the next char, the
13165 convention is to fetch on entry.
13166 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
13167 'switch' without a following semicolon.
13168 * tests/regression.at (braces parsing): New.
13170 2002-01-06 Akim Demaille <akim@epita.fr>
13172 Bison is dead wrong in its RR conflict reports.
13174 * tests/torture.at (GNU Cim Grammar): New.
13175 * src/conflicts.c (count_rr_conflicts): Fix.
13177 2002-01-06 Akim Demaille <akim@epita.fr>
13179 Creating package.m4 from configure.ac causes too many problems.
13181 * tests/Makefile.am (package.m4): Create it by hand,
13182 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
13184 2002-01-06 Akim Demaille <akim@epita.fr>
13186 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
13189 2002-01-04 Paul Eggert <eggert@twinsun.com>
13191 * doc/bison.texinfo (Debugging):
13192 Remove YYSTDERR; it's no longer defined or used.
13193 Also, s/cstdio.h/cstdio/.
13195 2002-01-03 Akim Demaille <akim@epita.fr>
13197 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
13199 2002-01-03 Akim Demaille <akim@epita.fr>
13201 * src/parse-skel.y (process_skeleton): Don't bind the parser's
13202 tracing code to --trace, wait for a better --trace option, with
13205 2002-01-03 Akim Demaille <akim@epita.fr>
13207 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
13208 The ISO C++ standard is extremely clear about it: stderr is
13209 considered a macro, not a regular symbol (see table 94 `Header
13210 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
13211 Therefore std:: does not apply to it. It still does with fprintf.
13212 Also, s/cstdio.h/cstdio/.
13214 2002-01-03 Akim Demaille <akim@epita.fr>
13216 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
13217 for non system headers.
13219 2002-01-02 Akim Demaille <akim@epita.fr>
13221 Equip the skeleton chain with location tracking, runtime trace,
13222 pure parser and scanner.
13224 * src/parse-skel.y: Request a pure parser, locations, and prefix
13226 (%union): Having several members with the same type does not help
13227 type mismatches, simplify.
13228 (YYPRINT, yyprint): New.
13229 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
13230 (skel_error): this.
13232 * src/scan-skel.l: Adjust to these changes.
13233 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
13234 (LOCATION_PRINT, skel_control_t): New.
13236 2001-12-30 Akim Demaille <akim@epita.fr>
13238 * src/parse-skel.y: Get rid of the shift/reduce conflict:
13239 replace `gb' with BLANKS.
13240 * src/scan-skel.l: Adjust.
13242 2001-12-30 Akim Demaille <akim@epita.fr>
13244 * src/system.h: We don't need nor want bcopy.
13245 Throw away MS-DOS crap: we don't need getpid.
13246 * configure.in: We don't need strndup. It was even causing
13247 problems: because Flex includes the headers *before* us,
13248 _GNU_SOURCE is not defined by config.h, and therefore strndup was
13250 * lib/xstrndup.c: New.
13251 * src/scan-skel.l: Use it.
13252 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
13253 * src/parse-skel.y: Use %directives instead of #defines.
13255 2001-12-30 Akim Demaille <akim@epita.fr>
13257 * src/skeleton.h: New.
13258 * src/output.c (output_parser, output_master_parser): Remove, dead
13260 * src/output.h (get_lines_number, actions_output, guards_output)
13261 (token_definitions_output): Prototype them.
13262 * src/parse-skel.y: Add the license notice.
13263 Include output.h and skeleton.h.
13264 (process_skeleton): Returns void, and takes a single parameter.
13265 * src/scan-skel.l: Add the license notice.
13266 Include skeleton.h.
13267 Don't use %option yylineno: it seems that then Flex imagines
13268 REJECT has been used, and therefore it won't reallocate its
13269 buffers (which makes no other sense to me than a bug). It results
13270 in warnings for `unused: yy_flex_realloc'.
13272 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
13274 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13275 (MUSCLE_INSERT_PREFIX): ...to there.
13276 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13277 (MUSCLE_INSERT_PREFIX): Move from here...
13279 * src/bison.hairy: Add a section directive. Put braces around muscle
13280 names. This parser skeleton is still broken, but Bison should not
13281 choke on a bad muscle 'syntax'.
13282 * src/bison.simple: Add a section directive. Put braces around muscle
13285 * src/files.h (strsuffix, stringappend): Add declarations.
13286 (tab_extension): Add declaration.
13287 (short_base_name): Add declaration.
13289 * src/files.c (strsuffix, stringappend): No longer static. These
13290 functions are used in the skeleton parser.
13291 (tab_extension): New.
13292 (compute_base_names): Use the computations done in this function
13293 to guess if the generated parsers should have '.tab' in their
13295 (short_base_name): No longer static.
13297 * src/output.c (output_skeleton): New.
13298 (output): Disable call to output_master_parser, and give a try to
13299 a new skeleton handling system.
13300 (guards_output, actions_output): No longer static.
13301 (token_definitions_output, get_lines_number): No longer static.
13303 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
13305 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
13308 * src/parse-skel.y: New file.
13309 * src/scan-skel.l: New file.
13311 2001-12-29 Akim Demaille <akim@epita.fr>
13313 %name-prefix is broken.
13315 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
13316 Adjust all dependencies.
13317 * tests/headers.at (export YYLTYPE): Strengthen this test: use
13320 Renaming yylval but not yylloc is not consistent. Now we do.
13322 * src/bison.simple: Prefix yylloc if used.
13323 * doc/bison.texinfo (Decl Summary): Document that.
13325 2001-12-29 Akim Demaille <akim@epita.fr>
13327 * doc/bison.texinfo: Promote `%long-directive' over
13329 Remove all references to fixed-output-files, yacc is enough.
13331 2001-12-29 Akim Demaille <akim@epita.fr>
13333 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
13334 user prologue. These are defaults.
13335 * tests/actions.at (Mid-rule actions): Make sure the user can
13336 define YYDEBUG and YYERROR_VERBOSE.
13338 2001-12-29 Akim Demaille <akim@epita.fr>
13340 * src/output.c (header_output): Don't forget to export YYLTYPE and
13342 * tests/headers.at (export YYLTYPE): New, make sure it does.
13343 * tests/regression.at (%union and --defines, Invalid CPP headers):
13345 * tests/headers.at: here.
13347 2001-12-29 Akim Demaille <akim@epita.fr>
13349 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
13351 2001-12-29 Akim Demaille <akim@epita.fr>
13353 * tests/actions.at (Mid-rule actions): Output on a single line
13354 instead of several.
13356 2001-12-29 Akim Demaille <akim@epita.fr>
13358 * doc/bison.texinfo: Formatting changes.
13360 2001-12-29 Akim Demaille <akim@epita.fr>
13362 Don't store the token defs in a muscle, just be ready to output it
13363 on command. Now possible via `symbols'. Fixes a memory leak.
13365 * src/output.c (token_definitions_output): New.
13366 (output_parser, header_output): Use it.
13367 * src/reader.c (symbols_save): Remove.
13369 2001-12-29 Akim Demaille <akim@epita.fr>
13371 * src/bison.simple: Do not provide a default for YYSTYPE and
13372 YYLTYPE before the user's prologue. Otherwise it's hardly... a
13375 2001-12-29 Akim Demaille <akim@epita.fr>
13377 Mid-rule actions are simply... ignored!
13379 * src/reader.c (readgram): Be sure to attach mid-rule actions to
13380 the empty-rule associated to the dummy symbol, not to the host
13382 * tests/actions.at (Mid-rule actions): New.
13384 2001-12-29 Akim Demaille <akim@epita.fr>
13388 * src/reader.c (reader): Free grammar.
13390 2001-12-29 Akim Demaille <akim@epita.fr>
13394 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
13395 since it allocates it for each state, although only one is needed.
13396 (allocate_storage): Do it here.
13398 2001-12-29 Akim Demaille <akim@epita.fr>
13400 * src/options.h, src/options.c (create_long_option_table): Rename
13402 (long_option_table_new): this, with a clearer prototype.
13403 (percent_table): Remove, unused,
13404 * src/getargs.c (getargs): Adjust.
13406 2001-12-29 Akim Demaille <akim@epita.fr>
13408 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
13409 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
13412 2001-12-29 Akim Demaille <akim@epita.fr>
13414 * src/lalr.c (build_relations): Rename `states' as `states1'.
13415 Sorry, I don't understand exactly what it is, no better name...
13417 2001-12-29 Akim Demaille <akim@epita.fr>
13419 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
13420 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
13421 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
13424 2001-12-29 Akim Demaille <akim@epita.fr>
13426 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
13429 2001-12-29 Akim Demaille <akim@epita.fr>
13431 * src/reader.c, src/reader.h (user_toknums): Remove.
13432 Adjust all users to use symbols[i]->user_token_number.
13434 2001-12-29 Akim Demaille <akim@epita.fr>
13436 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
13437 Adjust all users to use symbols[i]->prec or ->assoc.
13439 2001-12-29 Akim Demaille <akim@epita.fr>
13441 * src/reader.c, src/reader.h (tags): Remove.
13442 Adjust all users to use symbols[i]->tag.
13444 2001-12-29 Akim Demaille <akim@epita.fr>
13446 * src/gram.h, src/gram.c (symbols): New, similar to state_table
13448 * src/reader.c (packsymbols): Fill this table.
13450 * src/conflicts.c (resolve_sr_conflict): Adjust.
13451 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
13453 Use symbols[i]->tag instead of tags[i].
13455 2001-12-29 Akim Demaille <akim@epita.fr>
13457 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
13458 In addition, put a comment in there, to replace...
13459 * tests/regression.at (%union and C comments): Remove.
13461 2001-12-29 Akim Demaille <akim@epita.fr>
13463 * tests/regression.at (Web2c Actions): Blindly move the actual
13464 output as expected output. The contents *seem* right to me, but I
13465 can't pretend reading perfectly parser tables... Nonetheless, all
13466 the other tests pass correctly, the table look OK, even though the
13467 presence of `$axiom' is to be noted: AFAICS it is useless (but
13470 2001-12-29 Akim Demaille <akim@epita.fr>
13472 * src/reader.c (readgram): Don't add the rule 0 if there were no
13473 rules read. In other words, add it _after_ having performed
13474 grammar sanity checks.
13475 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
13477 2001-12-29 Akim Demaille <akim@epita.fr>
13479 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
13480 visible, and some states have now a different number.
13482 2001-12-29 Akim Demaille <akim@epita.fr>
13484 * src/reader.c (readgram): Bind the initial rule's lineno to that
13486 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
13487 (Solved SR Conflicts): Adjust rule 0's line number.
13489 2001-12-29 Akim Demaille <akim@epita.fr>
13491 Fix the `GAWK Grammar' failure.
13493 * src/LR0.c (final_state): Initialize to -1 so that we do compute
13494 the reductions of the first state which was mistakenly confused
13495 with the final state because precisely final_state was initialized
13497 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
13498 now noticed by Bison.
13499 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
13500 have a reduction on $default.
13502 2001-12-29 Akim Demaille <akim@epita.fr>
13504 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
13506 * src/closure.c (print_closure): Likewise.
13507 * src/derives.c (print_derives): Likewise.
13508 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
13511 2001-12-29 Akim Demaille <akim@epita.fr>
13513 * src/lalr.c (lookaheads_print): New.
13514 (lalr): Call it when --trace-flag.
13515 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13518 2001-12-29 Akim Demaille <akim@epita.fr>
13520 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13521 when walking through ritem, even via rule->rhs.
13522 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13523 (useful_production, useless_nonterminals): Likewise.
13524 (reduce_grammar_tables): Likewise, plus update nritems.
13525 * src/nullable.c (set_nullable): Likewise.
13526 * src/lalr.c (build_relations): Likewise.
13527 * tests/sets.at (Nullable): Adjust.
13528 Fortunately, now, the $axiom is no longer nullable.
13530 2001-12-29 Akim Demaille <akim@epita.fr>
13532 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13534 * src/gram.c (ritem_longest_rhs): Likewise.
13535 * src/reduce.c (nonterminals_reduce): Likewise.
13536 * src/print_graph.c (print_graph): Likewise.
13537 * src/output.c (output_rule_data): Likewise.
13538 * src/nullable.c (set_nullable): Likewise.
13540 2001-12-29 Akim Demaille <akim@epita.fr>
13542 * src/output.c: Comment changes.
13544 2001-12-27 Paul Eggert <eggert@twinsun.com>
13546 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13547 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13548 Sparc, as they were causing more porting problems than the
13549 (minor) performance improvement was worth.
13551 Also, catch up with 1.31's YYSTD.
13553 2001-12-27 Akim Demaille <akim@epita.fr>
13555 * src/output.c (output_gram): Rely on nritems, not the
13556 0-sentinel. See below.
13557 Use -1 as separator, not 0.
13558 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13559 Rely on -1 as separator in yyrhs, instead of 0.
13560 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13561 twice `Now at end of input', therefore there are two lines less to
13564 2001-12-27 Akim Demaille <akim@epita.fr>
13566 * tests/regression.at (Unresolved SR Conflicts):
13567 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13570 2001-12-27 Akim Demaille <akim@epita.fr>
13572 * src/LR0.c (new_state): Recognize the final state by the fact it
13573 is reached by eoftoken.
13574 (insert_start_shifting_state, insert_eof_shifting_state)
13575 (insert_accepting_state, augment_automaton): Remove, since now
13576 these states are automatically computed from the initial state.
13577 (generate_states): Adjust.
13578 * src/print.c: When reporting a rule number to the user, substract
13579 1, so that the axiom rule is rule 0, and the first user rule is 1.
13580 * src/reduce.c: Likewise.
13581 * src/print_graph.c (print_core): For the time being, just as for
13582 the report, depend upon --trace-flags to dump the full set of
13584 * src/reader.c (readgram): Once the grammar read, insert the rule
13585 0: `$axiom: START-SYMBOL $'.
13586 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13587 number of the states has changed (the final state is no longer
13588 necessarily the last), catch up.
13590 2001-12-27 Akim Demaille <akim@epita.fr>
13592 Try to make the use of the eoftoken valid. Given that its value
13593 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13594 is used instead of > 0 where appropriate, (ii), depend upon nritems
13595 instead of the 0-sentinel.
13597 * src/gram.h, src/gram.c (nritems): New.
13598 Expected to be duplication of nitems, but for the time being...
13599 * src/reader.c (packgram): Assert nritems and nitems are equal.
13600 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13601 * src/closure.c (print_closure, print_fderives): Likewise.
13602 * src/gram.c (ritem_print): Likewise.
13603 * src/print.c (print_core, print_grammar): Likewise.
13604 * src/print_graph.c: Likewise.
13606 2001-12-27 Akim Demaille <akim@epita.fr>
13608 * src/main.c (main): If there are complains after grammar
13609 reductions, then output the report anyway if requested, then die.
13610 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13611 * src/reader.c (eoftoken): New.
13612 (parse_token_decl): If the token being defined has value `0', it
13614 (packsymbols): No longer hack `tags' to insert `$' by hand.
13615 Be sure to preserve the value of the eoftoken.
13616 (reader): Make sure eoftoken is defined.
13617 Initialize nsyms to 0: now eoftoken is created just like the others.
13618 * src/print.c (print_grammar): Don't special case the eof token.
13619 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13620 lie anyway, albeit pleasant.
13621 * tests/calc.at: Exercise error messages with eoftoken.
13622 Change the grammar so that empty input is invalid.
13623 Adjust expectations.
13624 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13626 2001-12-27 Akim Demaille <akim@epita.fr>
13628 * configure.in: Check the protos of strchr ans strspn.
13629 Replace strchr if needed.
13630 * src/system.h: Provide the protos of strchr, strspn and memchr if
13632 * lib/strchr.c: New.
13633 * src/reader.c (symbols_save): Use strchr.
13635 2001-12-27 Akim Demaille <akim@epita.fr>
13637 * src/print.c, src/print_graph.c (escape): New.
13638 Use it to quote the TAGS outputs.
13639 * src/print_graph.c (print_state): Now errors are in red, and
13640 reductions in green.
13641 Prefer high to wide: output the state number on a line of its own.
13643 2001-12-27 Akim Demaille <akim@epita.fr>
13645 * src/state.h, src/state.c (reductions_new): New.
13646 * src/LR0.c (set_state_table): Let all the states have a
13647 `reductions', even if reduced to 0.
13648 (save_reductions): Adjust.
13649 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13650 * src/print.c (print_reductions, print_actions): Adjust.
13651 * src/output.c (action_row): Adjust.
13653 2001-12-27 Akim Demaille <akim@epita.fr>
13655 * src/state.h, src/state.c (errs_new, errs_dup): New.
13656 * src/LR0.c (set_state_table): Let all the states have an errs,
13657 even if reduced to 0.
13658 * src/print.c (print_errs, print_reductions): Adjust.
13659 * src/output.c (output_actions, action_row): Adjust.
13660 * src/conflicts.c (resolve_sr_conflict): Adjust.
13662 2001-12-27 Akim Demaille <akim@epita.fr>
13664 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13666 2001-12-27 Akim Demaille <akim@epita.fr>
13668 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13669 * src/print.c: here.
13670 (lookaheadset, shiftset): New, used as additional storage by
13672 (print_results): Adjust.
13673 (print_shifts, print_gotos, print_errs): New, extracted from...
13674 (print_actions): here.
13675 * src/print_graph.c (print_actions): Remove dead code.
13677 2001-12-27 Akim Demaille <akim@epita.fr>
13679 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13682 2001-12-27 Akim Demaille <akim@epita.fr>
13684 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13685 (build_relations): Adjust.
13687 2001-12-27 Akim Demaille <akim@epita.fr>
13689 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13692 2001-12-27 Akim Demaille <akim@epita.fr>
13694 * src/reader.c (packgram): Catch nitems overflows.
13696 2001-12-27 Akim Demaille <akim@epita.fr>
13698 * src/files.c, src/files.h (guard_obstack): Remove.
13699 * src/output.c (output): Adjust.
13700 * src/reader.c (parse_braces): New, factoring...
13701 (copy_action, copy_guard): these two which are renamed as...
13702 (parse_action, parse_guard): these.
13703 As a voluntary consequence, using braces around guards is now
13706 2001-12-27 Akim Demaille <akim@epita.fr>
13708 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13709 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13711 (symbol_list_new): Adjust.
13712 (copy_action): action_line is the first line, not the last.
13713 (copy_guard): Just as for actions, store the `action' only, not
13714 the switch/case/break flesh.
13715 Don't parse the user action that might follow the guard, let...
13716 (readgram): do it, i.e., now, there can be an action after a
13718 In other words the guard is just explicitly optional.
13719 (packgram): Adjust.
13720 * src/output.c (guards_output): New.
13721 (output_parser): Call it when needed.
13722 (output): Also free the guard and attrs obstacks.
13723 * src/files.c, src/files.h (obstack_save): Remove.
13724 (output_files): Remove.
13725 As a result, if one needs the former `.act' file, using an
13726 appropriate skeleton which requires actions and guards is now
13728 * src/main.c (main): Adjust.
13729 * tests/semantic.at: New.
13730 * tests/regression.at: Use `input.y' as input file name.
13731 Avoid 8+3 problems by requiring input.c when the test needs the
13734 2001-12-27 Akim Demaille <akim@epita.fr>
13736 * src/reader.c (symbol_list_new): Be sure to initialize all the
13739 2001-12-27 Akim Demaille <akim@epita.fr>
13741 All the hacks using a final pseudo state are now useless.
13743 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13744 * src/lalr.c (nLA): New.
13745 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13746 instead of lookaheadsp from the pseudo state (nstate + 1).
13748 2001-12-27 Akim Demaille <akim@epita.fr>
13750 * src/output.c (action_row, token_actions): Use a state_t instead
13751 of a integer, and nlookaheads instead of the following state's
13754 2001-12-27 Akim Demaille <akim@epita.fr>
13756 * src/conflicts.c (log_resolution, flush_shift)
13757 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13758 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13759 (conflicts_print, print_reductions): Use a state_t instead of an
13760 integer when referring to a state.
13761 As much as possible, depend upon nlookaheads, instead of the
13762 `lookaheadsp' member of the following state (since lookaheads of
13763 successive states are successive, the difference between state n + 1
13764 and n served as the number of lookaheads for state n).
13765 * src/lalr.c (add_lookback_edge): Likewise.
13766 * src/print.c (print_core, print_actions, print_state)
13767 (print_results): Likewise.
13768 * src/print_graph.c (print_core, print_actions, print_state)
13769 (print_graph): Likewise.
13770 * src/conflicts.h: Adjust.
13772 2001-12-27 Akim Demaille <akim@epita.fr>
13774 * src/bison.hairy: Formatting/comment changes.
13776 Remove `register' indications.
13777 Add plenty of `static'.
13779 2001-12-27 Akim Demaille <akim@epita.fr>
13781 * src/output.c (prepare): Drop the muscle `ntbase' which
13782 duplicates ntokens.
13783 * src/bison.simple: Formatting/comment changes.
13784 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13785 is an undocumented synonym.
13787 2001-12-22 Akim Demaille <akim@epita.fr>
13789 * src/output.c (output_table_data): Change the prototype to use
13790 `int' for array ranges: some invocations do pass an int, not a
13792 Reported by Wayne Green.
13794 2001-12-22 Akim Demaille <akim@epita.fr>
13796 Some actions of web2c.y are improperly triggered.
13797 Reported by Mike Castle.
13799 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13800 * tests/regression.at (Web2c): Rename as...
13801 (Web2c Report): this.
13802 (Web2c Actions): New.
13804 2001-12-22 Akim Demaille <akim@epita.fr>
13806 Reductions in web2c.y are improperly reported.
13807 Reported by Mike Castle.
13809 * src/conflicts.c (print_reductions): Fix.
13810 * tests/regression.at (Web2c): New.
13812 2001-12-18 Akim Demaille <akim@epita.fr>
13814 Some host fail on `assert (!"foo")', which expands to
13815 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13816 Reported by Nelson Beebee.
13818 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13819 `#define it_succeeded 0' and `assert (it_succeeded)'.
13821 2001-12-17 Marc Autret <autret_m@epita.fr>
13823 * src/bison.simple: Don't hard code the skeleton line and filename.
13824 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13825 New line counter 'skeleton_line' (skeleton-line muscle).
13827 2001-12-17 Paul Eggert <eggert@twinsun.com>
13829 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13830 YYDEBUG must be defined to a nonzero value.
13832 * src/bison.simple (yytname): Do not assume that the user defines
13833 YYDEBUG to a properly parenthesized expression.
13835 2001-12-17 Akim Demaille <akim@epita.fr>
13837 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13838 nlookaheads is a new member.
13840 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13841 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13844 2001-12-17 Akim Demaille <akim@epita.fr>
13846 * src/files.h, src/files.c (open_files, close_files): Remove.
13847 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13849 * src/reader.c (reader): Do it.
13851 2001-12-17 Akim Demaille <akim@epita.fr>
13853 * src/conflicts.c (print_reductions): Formatting changes.
13855 2001-12-17 Akim Demaille <akim@epita.fr>
13857 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13858 (flush_reduce): New.
13859 (resolve_sr_conflict): Adjust.
13861 2001-12-17 Akim Demaille <akim@epita.fr>
13863 * src/output.c (output_obstack): Be static and rename as...
13864 (format_obstack): this, to avoid any confusion with files.c's
13866 * src/reader.h (muscle_obstack): Move to...
13867 * src/output.h: here, since it's defined in output.c.
13869 2001-12-17 Akim Demaille <akim@epita.fr>
13871 * src/output.c (action_row, save_column, default_goto)
13872 (sort_actions, matching_state, pack_vector): Better variable
13875 2001-12-17 Akim Demaille <akim@epita.fr>
13877 * src/output.c: Various formatting changes.
13879 2001-12-17 Akim Demaille <akim@epita.fr>
13881 * src/files.c (output_files): Free the output_obstack.
13882 * src/main.c (main): Call print and print_graph conditionally.
13883 * src/print.c (print): Work unconditionally.
13884 * src/print_graph.c (print_graph): Work unconditionally.
13885 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13887 2001-12-16 Marc Autret <autret_m@epita.fr>
13889 * src/output.c (actions_output): Fix. When we use %no-lines,
13890 there is one less line per action.
13892 2001-12-16 Marc Autret <autret_m@epita.fr>
13894 * src/bison.simple: Remove a useless #line directive.
13895 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13896 * src/output.c (get_lines_number): New.
13897 (output_parser): Adjust, now takes care about the lines of a
13899 Fix line numbering.
13900 (actions_output): Computes the number of lines taken by actions.
13901 (output_master_parser): Insert new skeleton which is the name of
13902 the output parser file name.
13904 2001-12-15 Marc Autret <autret_m@epita.fr>
13906 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13908 2001-12-15 Marc Autret <autret_m@epita.fr>
13910 * src/output.c (output_gram): Keep track of the hairy one.
13912 2001-12-15 Akim Demaille <akim@epita.fr>
13914 Make `make distcheck' work.
13916 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13917 system.h which uses libgettext.h.
13919 2001-12-15 Akim Demaille <akim@epita.fr>
13921 * src/nullable.c (set_nullable): Useless rules must be skipped,
13922 otherwise, since we range over their symbols, we might look at a
13923 nonterminal which no longer ``exists'', i.e., it is not counted in
13924 `nvars', hence we overflow our arrays.
13926 2001-12-15 Akim Demaille <akim@epita.fr>
13928 The header can also be produced directly, without any obstack!
13931 * src/files.c, src/files.h (defines_obstack): Remove.
13932 (compute_header_macro): Global.
13933 (defines_obstack_save): Remove.
13934 * src/reader.c (parse_union_decl): No longer output to
13935 defines_obstack: its content can be found in the `stype' muscle
13937 (output_token_translations): Merge into...
13938 (symbols_output): this.
13940 (symbols_save): this.
13942 * src/output.c (header_output): New.
13945 2001-12-15 Akim Demaille <akim@epita.fr>
13947 * src/reader.c (parse_union_decl): Instead of handling two obstack
13948 simultaneously, use one to define the `stype' muscle, and use the
13949 value of the latter to fill defines_obstack.
13950 (copy_comment): Remove.
13951 (copy_comment2): Work for a single obstack.
13953 (copy_comment): this.
13955 2001-12-15 Akim Demaille <akim@epita.fr>
13957 * src/lex.c, src/lex.h (xgetc): No longer static.
13958 * src/reader.c (parse_union_decl): Revamp.
13960 2001-12-15 Akim Demaille <akim@epita.fr>
13962 Still making progress in separating Bison into (i) input, (ii)
13963 process, (iii) output: now we can directly output the parser file
13964 without using table_obstack at all.
13966 * src/files.c, src/files.h (table_obstack): Bye bye.
13967 (parser_file_name): New.
13968 * src/files.c (compute_output_file_names): Compute it.
13969 * src/output.c (actions_output, output_parser)
13970 (output_master_parser): To a file instead of an obstack.
13972 2001-12-15 Akim Demaille <akim@epita.fr>
13974 Attach actions to rules, instead of pre-outputting them to
13977 * src/gram.h (rule_t): action and action_line are new members.
13978 * src/reader.c (symbol_list): Likewise.
13979 (copy_action): Save the actions within the rule.
13980 (packgram): Save them in rule_table.
13981 * src/output.c (actions_output): New.
13982 (output_parser): Use it on `%%actions'.
13983 (output_rule_data): Don't free rule_table.
13985 (prepare): Don't save the `action' muscle.
13986 * src/bison.simple: s/%%action/%%actions/.
13988 2001-12-15 Akim Demaille <akim@epita.fr>
13990 * src/reader.c (copy_action): When --yacc, don't append a `;'
13991 to the user action: let it fail if lacking.
13992 Suggested by Arnold Robbins and Tom Tromey.
13994 2001-12-14 Akim Demaille <akim@epita.fr>
13996 * src/lex.c (literalchar): Simply return the char you decoded, non
13997 longer mess around with obstacks and int pointers.
13998 Adjust all callers.
14000 2001-12-14 Akim Demaille <akim@epita.fr>
14002 * src/lex.c (literalchar): Don't escape the special characters,
14003 just decode them, and keep them as char (before, eol was output as
14004 the 2 char string `\n' etc.).
14005 * src/output.c (output_rule_data): Use quotearg to output the
14008 2001-12-13 Paul Eggert <eggert@twinsun.com>
14010 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
14011 Do not infringe on the global user namespace when using C++.
14012 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
14013 All uses of `fprintf' and `stderr' changed.
14015 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
14017 2001-12-13 Akim Demaille <akim@epita.fr>
14019 The computation of nullable is broken: it doesn't handle empty
14022 * tests/torture.at (GNU AWK Grammar): New.
14023 * tests/sets.at (Nullable): New.
14024 * src/nullable.c (set_nullable): Instead of blindly looping over
14025 `ritems', loop over the rules, and then over their rhs's.
14027 Work around Autotest bugs.
14029 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
14030 frame, because Autotest understand lines starting with a `+' as
14031 traces from the shell. Then, they are not processed properly.
14032 Admittedly an Autotest bug, but we don't have time to wait for
14033 Autotest to catch up.
14034 * tests/regression.at (Broken Closure): Adjust to the new table
14037 * tests/sets.at: here.
14039 2001-12-13 Akim Demaille <akim@epita.fr>
14041 * src/closure.c (closure): Use nrules instead of playing tricks
14042 with BITS_PER_WORD.
14044 2001-12-13 Akim Demaille <akim@epita.fr>
14046 * src/print.c (print_actions): Output the handling of `$' as the
14047 traces do: shifting the token EOF. Before EOF was treated as a
14049 * tests/regression.at: Adjust some tests.
14050 * src/print_graph.c (print_core): Complete the set of items via
14051 closure. The next-to-final and final states are still unsatisfying,
14052 but that's to be addressed elsewhere.
14053 No longer output the rule numbers, but do output the state number.
14054 A single loop for the shifts + gotos is enough, but picked a
14055 distinct color for each.
14056 (print_graph): Initialize and finalize closure.
14058 2001-12-13 Akim Demaille <akim@epita.fr>
14060 * src/reader.c (readgram): Remove dead code, an strip useless
14062 (get_type): Remove, unused.
14064 2001-12-12 Akim Demaille <akim@epita.fr>
14066 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
14067 on that of lib/error.c.
14069 2001-12-12 Akim Demaille <akim@epita.fr>
14071 Some hosts don't like `/' in includes.
14073 * src/system.h: Include libgettext.h without qualifying the path.
14074 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
14077 2001-12-11 Marc Autret <autret_m@epita.fr>
14079 * src/output.c (output_parser): Remove useless muscle.
14081 2001-12-11 Marc Autret <autret_m@epita.fr>
14083 * src/bison.simple: Remove #line just before %%epilogue. It
14084 is now handled in ...
14085 * src/reader.c (read_additionnal_code): Add the output of a
14086 #line for the epilogue.
14088 2001-12-10 Marc Autret <autret_m@epita.fr>
14090 * src/reader.c (copy_definition): Re-use CPP-outed code which
14091 replace precedent remove.
14092 * src/bison.simple: Remove #line before %%prologue because
14093 %%input-line is wrong at this time.
14095 2001-12-10 Marc Autret <autret_m@epita.fr>
14097 * src/reader.c (symbols_output): Clean up.
14098 * src/output.c (output_gram, output): Clean up.
14100 2001-12-10 Akim Demaille <akim@epita.fr>
14102 * src/lalr.c (initialize_lookaheads): New. Extracted from...
14103 * src/LR0.c (set_state_table): here.
14104 * src/lalr.c (lalr): Call it.
14106 2001-12-10 Akim Demaille <akim@epita.fr>
14108 * src/state.h (shifts): Remove the `number' member: shifts are
14109 attached to state, hence no longer need to be labelled with a
14112 2001-12-10 Akim Demaille <akim@epita.fr>
14114 Now that states have a complete set of members, the linked list of
14115 shifts is useless: just fill directly the state's shifts member.
14117 * src/state.h (shifts): Remove the `next' member.
14118 * src/LR0.c (first_state, last_state): Remove.
14119 Adjust the callers.
14120 (augment_automaton): Don't look for the shifts that must be added
14121 a shift on EOF: it is those of the state we looked for! But now,
14122 since shifts are attached, it is no longer needed to looking
14123 merely by its id: its number.
14125 2001-12-10 Akim Demaille <akim@epita.fr>
14127 * src/LR0.c (augment_automaton): Better variable locality.
14128 Remove an impossible branch: if there is a state corresponding to
14129 the start symbol being shifted, then there is shift for the start
14130 symbol from the initial state.
14132 2001-12-10 Akim Demaille <akim@epita.fr>
14134 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
14135 only when appropriate: when insert_start_shifting_state' is not
14137 * tests/regression.at (Rule Line Numbers): Adjust.
14139 2001-12-10 Akim Demaille <akim@epita.fr>
14141 * src/LR0.c (augment_automaton): Now that all states have shifts,
14142 merge the two cases addition shifts to the initial state.
14144 2001-12-10 Akim Demaille <akim@epita.fr>
14146 * src/lalr.c (set_state_table): Move to...
14148 * src/lalr.c (lalr): Don't call it...
14149 * src/LR0.c (generate_states): do it.
14150 * src/LR0.h (first_state): Remove, only the table is used.
14152 2001-12-10 Akim Demaille <akim@epita.fr>
14154 * src/LR0.h (first_shift, first_reduction): Remove.
14155 * src/lalr.c: Don't use first_shift: find shifts through the
14158 2001-12-10 Akim Demaille <akim@epita.fr>
14160 * src/LR0.c: Attach shifts to states as soon as they are
14162 * src/lalr.c (set_state_table): Instead of assigning shifts to
14163 state, just assert that the mapping was properly done.
14165 2001-12-10 Akim Demaille <akim@epita.fr>
14167 * src/LR0.c (insert_start_shift): Rename as...
14168 (insert_start_shifting_state): this.
14169 (insert_eof_shifting_state, insert_accepting_state): New.
14170 (augment_automaton): Adjust.
14171 Better locality of the variables.
14172 When looking if the start_symbol is shifted from the initial
14173 state, using `while (... symbol != start_symbol ...)' sounds
14174 better than `while (... symbol < start_symbol ...)': If fail
14175 to see how the order between symbols could be relevant!
14177 2001-12-10 Akim Demaille <akim@epita.fr>
14179 * src/getargs.h: Don't declare `spec_name_prefix' and
14180 `spec_file_prefix', declared by src/files.h.
14181 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
14182 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
14183 * src/output.c (prepare): Adjust.
14184 * src/reader.c (symbols_output): Likewise.
14185 * src/vmsgetargs.c: Vaguely adjust, but who cares?
14187 2001-12-10 Akim Demaille <akim@epita.fr>
14189 * src/muscle_tab.c (muscle_init): NULL is a better default than
14192 2001-12-10 Akim Demaille <akim@epita.fr>
14194 * src/reader.c (reader): Calling symbols_output once is enough.
14196 2001-12-10 Akim Demaille <akim@epita.fr>
14198 Now that states have a complete set of members, the linked list of
14199 reductions is useless: just fill directly the state's reductions
14202 * src/state.h (struct reductions): Remove member `number' and
14204 * src/LR0.c (first_reduction, last_reduction): Remove.
14205 (save_reductions): Don't link the new reductions, store them in
14207 * src/lalr.c (set_state_table): No need to attach reductions to
14208 states, it's already done.
14209 * src/output.c (output_actions): No longer free the shifts, then
14210 the reductions, then the states: free all the states and their
14213 2001-12-10 Akim Demaille <akim@epita.fr>
14215 * src/options.c (OPTN, DRTV, BOTH): New.
14216 (option_table): Use them.
14218 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
14219 the job of system.h.
14220 * src/options.c: Don't include stdio.h and xalloc.h for the same
14223 2001-12-10 Akim Demaille <akim@epita.fr>
14225 * src/output.c (output, prepare): Make sure the values of the
14226 muscles `action' and `prologue' are 0-terminated.
14228 2001-12-10 Akim Demaille <akim@epita.fr>
14230 Clean up GCC warnings.
14232 * src/reader.c (copy_action): `buf' is not used.
14233 (parse_skel_decl): Be static.
14234 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
14235 * src/options.h (create_long_option_table): Have a real prototype.
14236 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
14237 (hash_delete_at): Return const void *.
14238 Adjust casts to preserve the const.
14240 2001-12-10 Akim Demaille <akim@epita.fr>
14242 * configure.in: Require 2.52g.
14243 M4 is not needed, but AUTOM4TE is.
14244 * m4/m4.m4: Remove.
14245 * tests/Makefile.am: Adjust.
14247 2001-12-10 Akim Demaille <akim@epita.fr>
14249 One structure for states is enough, even though theoretically
14250 there are LR(0) states and LALR(1) states.
14252 * src/lalr.h (state_t): Remove.
14253 (state_table): Be state_t **, not state_t *.
14254 * src/state.h (core, CORE_ALLOC): Rename as...
14255 (state_t, STATE_ALLOC): this.
14256 Add the LALR(1) members: shifts, reductions, errs.
14257 * src/LR0.c (state_table): Rename as...
14258 (state_hash): this, to avoid name clashes with the global
14260 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
14261 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
14263 2001-12-10 Akim Demaille <akim@epita.fr>
14265 Bison dumps core on bash.y.
14266 Reported by Pascal Bart.
14268 * src/warshall.c (bitmatrix_print): New.
14270 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
14271 j must be the outer loop.
14272 * tests/regression.at (Broken Closure): New.
14274 2001-12-05 Akim Demaille <akim@epita.fr>
14276 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
14278 Reported by Peter Hamorsky.
14280 2001-12-05 Akim Demaille <akim@epita.fr>
14282 * src/conflicts.c (err_table): Remove.
14283 (resolve_sr_conflict): Adjust.
14284 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
14286 (state_t.reductions, state_t.shifts): this.
14288 2001-12-05 Akim Demaille <akim@epita.fr>
14290 * src/reduce.c (reduce_grammar_tables): No longer disable the
14291 removal of useless rules via CPP but via `if (0)', so that the
14292 compiler still check the code is valid.
14293 For instance, it should have noticed `rline' no longer exists: use
14294 the `line' member of rule_t.
14295 * src/gram.c (dummy, rline): Remove, unused.
14297 2001-12-05 Akim Demaille <akim@epita.fr>
14299 * src/output.c (pack_vector): Use assert, not berror.
14300 * src/main.c (berror): Remove, unused.
14302 2001-12-05 Akim Demaille <akim@epita.fr>
14304 New experimental feature: if --verbose --trace output all the
14305 items of a state, not only its kernel.
14307 * src/print.c (print_core): If `trace_flag', then invoke closure
14308 before outputting the items of the state (print_core is no longer
14309 a correct name them).
14310 (print_results): Invoke new_closure/free_closure if needed.
14312 2001-12-05 Akim Demaille <akim@epita.fr>
14314 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
14315 * src/closure.c, src/closure.h (itemsetsize): Rename as...
14316 (nitemset): for consistency with the rest of the project.
14318 2001-12-05 Akim Demaille <akim@epita.fr>
14320 * src/closure.c (print_closure): Improve.
14321 (closure): Use it for printing input and output.
14323 2001-12-05 Akim Demaille <akim@epita.fr>
14325 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
14326 indexed by nonterminals.
14328 2001-12-05 Akim Demaille <akim@epita.fr>
14330 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
14332 * src/warshall.h: Remove accidental duplication of the content.
14334 2001-12-05 Akim Demaille <akim@epita.fr>
14336 * src/closure.c (set_fderives): De-obfuscate.
14338 2001-12-05 Akim Demaille <akim@epita.fr>
14340 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
14342 2001-12-05 Akim Demaille <akim@epita.fr>
14344 * src/closure.c (set_firsts): De-obfuscate.
14346 2001-12-05 Akim Demaille <akim@epita.fr>
14348 * src/output.c (action_row): De-obfuscate
14349 using the good o' techniques: arrays not pointers, variable
14350 locality, BITISSET, RESETBIT etc.
14352 2001-12-05 Akim Demaille <akim@epita.fr>
14354 Pessimize the code to simplify it: from now on, all the states
14355 have a valid SHIFTS, which NSHIFTS is possibly 0.
14357 * src/LR0.c (shifts_new): Be global and move to..
14358 * src/state.c, src/state.h: here.
14359 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
14360 * src/print_graph: Adjust.
14362 2001-12-05 Akim Demaille <akim@epita.fr>
14364 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
14365 * src/conflicts.c: Use it.
14366 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
14367 incorrectly ``simplified''.
14369 2001-12-05 Akim Demaille <akim@epita.fr>
14371 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
14372 using the good o' techniques: arrays not pointers, variable
14373 locality, BITISSET, RESETBIT etc.
14375 2001-12-05 Akim Demaille <akim@epita.fr>
14377 * src/state.h (SHIFT_SYMBOL): New.
14378 * src/conflicts.c: Use it to deobfuscate.
14380 2001-12-05 Akim Demaille <akim@epita.fr>
14382 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
14383 (print_reductions): De-obfuscate using the good o' techniques:
14384 arrays not pointers, variable locality, BITISSET.
14386 2001-12-05 Akim Demaille <akim@epita.fr>
14388 * src/conflicts.c (print_reductions): Arrays, not pointers.
14391 2001-12-05 Akim Demaille <akim@epita.fr>
14393 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14395 2001-12-05 Akim Demaille <akim@epita.fr>
14397 * src/conflicts.c (print_reductions): Improve variable locality.
14399 2001-12-05 Akim Demaille <akim@epita.fr>
14401 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14403 2001-12-05 Akim Demaille <akim@epita.fr>
14405 * src/conflicts.c (print_reductions): Improve variable locality.
14407 2001-12-05 Akim Demaille <akim@epita.fr>
14409 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
14410 * src/lalr.c: Use them.
14412 2001-12-05 Akim Demaille <akim@epita.fr>
14414 * src/LR0.c (augment_automaton): Formatting changes.
14415 Better variable locality.
14417 2001-12-05 Akim Demaille <akim@epita.fr>
14419 * src/lalr.c (matrix_print): New.
14420 (transpose): Use it.
14421 Use arrays instead of pointers.
14423 2001-12-05 Akim Demaille <akim@epita.fr>
14425 * src/lalr.c (maxrhs): Move to...
14426 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
14427 * src/lalr.c (build_relations): Adjust.
14429 2001-12-05 Akim Demaille <akim@epita.fr>
14431 * src/lalr.c (transpose): Free the memory allocated to the
14432 argument, as it is replaced by the results by the unique caller.
14433 (build_relations): Merely invoke transpose: it handles the memory
14435 Improve variable locality.
14436 Avoid variables used as mere abbreviations.
14437 (compute_lookaheads): Use arrays instead of pointers.
14439 2001-12-05 Akim Demaille <akim@epita.fr>
14441 * src/lalr.c (initialize_F): Improve variable locality.
14442 Avoid variables used as mere abbreviations.
14444 2001-12-05 Akim Demaille <akim@epita.fr>
14446 * src/derives.c (print_derives): Display the ruleno.
14447 * src/lalr.c (initialize_F, transpose): Better variable locality
14448 to improve readability.
14449 Avoid variables used as mere abbreviations.
14451 2001-12-05 Akim Demaille <akim@epita.fr>
14453 * src/lalr.c (traverse): Use arrays instead of pointers.
14455 2001-12-05 Akim Demaille <akim@epita.fr>
14457 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
14458 the handling of squeue.
14459 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14461 2001-12-05 Akim Demaille <akim@epita.fr>
14463 Because useless nonterminals are now kept alive (instead of being
14464 `destroyed'), we now sometimes examine them, and store information
14465 related to them. Hence we need to know their number, and adjust
14466 memory allocations.
14468 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
14470 * src/LR0.c (allocate_itemsets): The memory allocated to
14471 `symbol_count' was used for two different purpose: once to count
14472 the number of occurrences of each symbol, and later reassigned to
14473 `shift_symbol', containing the symbol that can be shifted from a
14475 Deobfuscate, i.e., allocate, use and free `symbol_count' here
14477 (new_itemsets): Allocate `shift_symbol' here.
14478 (allocate_itemsets): symbol_count includes useless nonterminals.
14479 Make room for them.
14480 (free_storage): Use `free', not `XFREE', for pointers that cannot
14483 2001-12-05 Akim Demaille <akim@epita.fr>
14485 * src/nullable.c (set_nullable): Deobfuscate the handling of
14487 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14489 2001-12-05 Akim Demaille <akim@epita.fr>
14491 * src/gram.c, src/gram.h (ritem_print): New.
14492 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
14493 (This useless function was defined only to work around VMS linkers
14494 that can't handle compilation units with variables only).
14495 * src/reduce.c (dump_grammar): Use it to trace the construction of
14498 2001-12-04 Paul Eggert <eggert@twinsun.com>
14500 * src/bison.simple (union yyalloc): Change member names
14501 to be the same as the stack names.
14502 (yyparse): yyptr is now union yyalloc *, not char *.
14503 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
14504 and may generate better code on some machines.
14505 (yystpcpy): Use prototype if __STDC__ is defined, not just
14506 if __cplusplus is defined.
14508 2001-11-30 Akim Demaille <akim@epita.fr>
14510 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
14511 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
14512 Gettext doesn't compile cleanly, and dies with -Werror.
14513 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
14514 Include WARNING_CFLAGS here.
14515 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
14516 before being defined.
14518 2001-11-27 Paul Eggert <eggert@twinsun.com>
14520 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14521 First arg is int, not unsigned.
14522 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14523 (SIZE_MAX, UINT_MAX): New macros.
14524 (quotearg_n_options): Abort if N is negative.
14525 Avoid overflow check on hosts where size_t is 64 bits and int
14526 is 32 bits, as overflow is impossible there.
14527 Fix off-by-one typo that caused unnecessary reallocation.
14529 2001-11-29 Paul Eggert <eggert@twinsun.com>
14531 Name space cleanup in generated parser.
14533 * doc/bison.texinfo (Bison Parser): Discuss system headers
14534 and their effect on the user name space.
14536 * src/bison.simple:
14537 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14538 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14539 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14541 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14542 on user names when possible.
14544 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14545 Simplify test for whather <alloca.h> exists.
14547 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14549 (<stdio.h>): Include if YYDEBUG.
14551 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14552 ! defined (yyoverflow) && ! defined (yymemcpy).
14554 (yymemcpy, yyparse): Rename local variables as needed so that
14555 they all begin with 'yy'.
14557 (yystrlen, yystpcpy): New functions.
14559 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14562 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14563 instead of relying on string.h functions. Use YYSTACK_ALLOC
14564 and YYSTACK_FREE instead of malloc and free.
14566 2001-11-30 Akim Demaille <akim@epita.fr>
14568 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14569 before their first uses.
14570 (YYBISON, YYPURE): Move to the top of the output.
14572 2001-11-30 Akim Demaille <akim@epita.fr>
14574 * tests/reduce.at (Useless Nonterminals): Fix.
14576 2001-11-30 Akim Demaille <akim@epita.fr>
14578 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14579 if body instead of `;' to pacify GCC's warnings.
14581 2001-11-30 Akim Demaille <akim@epita.fr>
14583 Instead of mapping the LHS of unused rules to -1, keep the LHS
14584 valid, but flag the rules as invalid.
14586 * src/gram.h (rule_t): `useful' is a new member.
14587 * src/print.c (print_grammar): Adjust.
14588 * src/derives.c (set_derives): Likewise.
14589 * src/reader.c (packgram, reduce_output): Likewise.
14590 * src/reduce.c (reduce_grammar_tables): Likewise.
14591 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14593 2001-11-30 Akim Demaille <akim@epita.fr>
14595 * src/reduce.c (reduce_output): Formatting changes.
14596 * src/print.c (print_results, print_grammar): Likewise.
14597 * tests/regression.at (Rule Line Numbers)
14598 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14600 2001-11-30 Akim Demaille <akim@epita.fr>
14602 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14603 useless nonterminals, move them at the end of the symbol arrays.
14604 (reduce_output): Adjust.
14605 * tests/reduce.at (Useless Nonterminals): Adjust.
14607 2001-11-30 Akim Demaille <akim@epita.fr>
14609 * src/reduce.c: Various comment/formatting changes.
14610 (nonterminals_reduce): New, extracted from...
14611 (reduce_grammar_tables): here.
14612 (reduce_grammar): Call nonterminals_reduce.
14614 2001-11-29 Paul Eggert <eggert@twinsun.com>
14616 * src/bison.simple (YYSTACK_REALLOC): Remove.
14617 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14618 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14620 (union yyalloc): New type.
14621 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14622 an arbitrary restriction on hosts where size_t is wider than int.
14624 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14625 a parser stack overflow. Allocate just one block of memory for all
14626 three stacks, instead of allocating three blocks; this typically is
14627 faster and reduces fragmentation.
14629 Do not limit the number of items in the stack to a value that fits
14630 in 'int', as this is an arbitrary limit on hosts with 64-bit
14631 size_t and 32-bit int.
14633 2001-11-29 Marc Autret <autret_m@epita.fr>
14635 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14636 of defining YYERROR_VERBOSE.
14637 [AT_DATA]: $4 is now out of C declarations in the prologue.
14639 2001-11-28 Marc Autret <autret_m@epita.fr>
14641 * src/reader.c (parse_dquoted_param): New.
14642 (parse_skel_decl): Use it.
14643 * src/lex.h: Add its prototype.
14644 * src/lex.c (literalchar): Become not static.
14646 2001-11-28 Marc Autret <autret_m@epita.fr>
14648 * src/output.h: And put its extern declaration here.
14649 * src/output.c (error_verbose): Define here.
14650 (prepare): Echo name modification.
14651 * src/getargs.h: Clean its extern declaration.
14652 * src/getargs.c (error_verbose_flag): Remove.
14653 (getargs): Remove case 'e'.
14654 * src/options.c (option_table): 'error-verbose' is now seen as simple
14658 * src/reader.c (read_declarations): Remove case tok_include.
14659 (parse_include_decl): Remove.
14660 * src/lex.h (token_t): Remove tok_include.
14661 * src/options.c (option_table): 'include' is now a simple command line
14664 2001-11-28 Marc Autret <autret_m@epita.fr>
14666 * src/bison.simple: Adjust muscle names.
14667 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14668 * src/output.c (prepare): s/_/-/ for the muscles names.
14669 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14671 2001-11-28 Marc Autret <autret_m@epita.fr>
14673 * src/bison.simple: Fix debug.
14674 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14676 2001-11-28 Akim Demaille <akim@epita.fr>
14678 * src/LR0.c (shifts_new): New.
14679 (save_shifts, insert_start_shift, augment_automaton): Use it.
14681 2001-11-28 Akim Demaille <akim@epita.fr>
14683 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14686 2001-11-28 Akim Demaille <akim@epita.fr>
14688 * src/closure.c (closure): Instead of looping over word in array
14689 then bits in words, loop over bits in array.
14691 2001-11-28 Akim Demaille <akim@epita.fr>
14693 * src/closure.c (closure): No longer optimize the special case
14694 where all the bits of `ruleset[r]' are set to 0, to make the code
14697 2001-11-28 Akim Demaille <akim@epita.fr>
14699 * src/closure.c (closure): `r' and `c' are new variables, used to
14700 de-obfuscate accesses to RULESET and CORE.
14702 2001-11-28 Akim Demaille <akim@epita.fr>
14704 * src/reduce.c (reduce_print): Use ngettext.
14705 (dump_grammar): Improve the trace accuracy.
14707 2001-11-28 Akim Demaille <akim@epita.fr>
14709 * src/reduce.c (dump_grammar): Don't translate trace messages.
14711 2001-11-28 Akim Demaille <akim@epita.fr>
14713 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14714 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14715 as all tags are free'ed afterwards.
14716 From Enrico Scholz.
14718 2001-11-27 Paul Eggert <eggert@twinsun.com>
14720 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14721 use alloca when we didn't want to, and vice versa.
14723 2001-11-27 Marc Autret <autret_m@epita.fr>
14725 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14727 * src/output.c (prepare): Remove its update.
14729 2001-11-27 Marc Autret <autret_m@epita.fr>
14731 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14732 Use %error-verbose.
14734 2001-11-27 Marc Autret <autret_m@epita.fr>
14736 * src/bison.simple: Remove YYERROR_VERBOSE using.
14737 Use %%error_verbose.
14738 (yyparse): Likewise.
14739 * src/output.c (prepare): Give its final value.
14740 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14741 * src/getargs.h: Add its extern declaration.
14742 * src/getargs.c (error_verbose_flag): New int.
14743 (getargs): Update to catch new case.
14744 * src/options.c (option_table): 'error-verbose' is a new option.
14745 (shortopts): Update.
14747 2001-11-27 Akim Demaille <akim@epita.fr>
14749 * src/system.h: Use intl/libgettext.h.
14750 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14752 2001-11-27 Akim Demaille <akim@epita.fr>
14754 * tests/torture.at (Exploding the Stack Size with Malloc):
14755 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14757 2001-11-27 Akim Demaille <akim@epita.fr>
14759 * src/files.c: Include error.h.
14760 Reported by Hans Aberg.
14762 2001-11-26 Marc Autret <autret_m@epita.fr>
14764 * src/reader.c (parse_include_decl): New, not yet implemented.
14765 (read_declarations): Add case tok_include.
14766 * src/getargs.h (include): Add its extern definition.
14767 * src/getargs.c (include): New const char *.
14768 (getargs): Add case '-I'.
14769 * src/options.c (option_table): Add include as command line and
14771 * src/lex.h (token_t): Add tok_include.
14773 2001-11-26 Akim Demaille <akim@epita.fr>
14775 * src/reader.c (readgram): Make sure rules for mid-rule actions
14776 have a lineno equal to that of their host rule.
14777 Reported by Hans Aberg.
14778 * tests/regression.at (Rule Line Numbers): New.
14780 2001-11-26 Akim Demaille <akim@epita.fr>
14782 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14785 2001-11-26 Akim Demaille <akim@epita.fr>
14787 * src/complain.c, src/complain.h (error): Remove, provided by
14790 2001-11-26 Akim Demaille <akim@epita.fr>
14792 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14793 issue an error message.
14794 * tests/regression.at (Invalid %directive): New.
14795 Reported by Hans Aberg.
14797 2001-11-26 Akim Demaille <akim@epita.fr>
14799 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14800 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14802 2001-11-26 Akim Demaille <akim@epita.fr>
14804 * src/conflicts.c (conflicts_print): Don't complain at all when
14805 there are no reduce/reduce conflicts, and as many shift/reduce
14806 conflicts as expected.
14807 * tests/regression.at (%expect right): Adjust.
14809 2001-11-23 Akim Demaille <akim@epita.fr>
14811 * lib/alloca.c: Update, from fileutils.
14813 2001-11-23 Akim Demaille <akim@epita.fr>
14815 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14817 2001-11-23 Akim Demaille <akim@epita.fr>
14819 * src/system.h: Include alloca.h.
14820 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14822 2001-11-23 Akim Demaille <akim@epita.fr>
14824 * src/print_graph.c (print_actions): Remove `rule', unused.
14825 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14826 pacify GCC's signed < unsigned warnings.
14827 * src/closure.c (itemsetsize): Likewise.
14828 * src/reader.c (symbol_list_new): Static.
14830 2001-11-23 Akim Demaille <akim@epita.fr>
14832 Attaching lineno to buckets is stupid, since only one copy of each
14833 symbol is kept, only the line of the first occurrence is kept too.
14835 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14836 * src/reader.c (rline_allocated): Remove, unused.
14837 (symbol_list): Have a `line' member.
14838 (symbol_list_new): New.
14839 (readgram): Use it.
14840 * src/print.c (print_grammar): Output the rule line numbers.
14841 * tests/regression.at (Solved SR Conflicts)
14842 (Unresolved SR Conflicts): Adjust.
14843 Reported by Hans Aberg.
14845 2001-11-22 Marc Autret <autret_m@epita.fr>
14847 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14849 2001-11-22 Marc Autret <autret_m@epita.fr>
14851 * src/muscle_tab.c (muscle_init): Remove initialization of
14853 * src/output.c (output_master_parser): Do it here.
14855 2001-11-20 Akim Demaille <akim@epita.fr>
14858 * configure.in (ALL_LINGUAS): Adjust.
14859 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14860 longer contains strings to translate.
14862 2001-11-19 Akim Demaille <akim@epita.fr>
14864 * src/conflicts.c (conflicts_print): Add a missing \n.
14866 2001-11-19 Akim Demaille <akim@epita.fr>
14868 * src/nullable.c (nullable_print): New.
14869 (set_nullable): Call it when tracing.
14870 Better locality of variables.
14872 2001-11-19 Akim Demaille <akim@epita.fr>
14874 * src/print.c (print_actions): Better locality of variables.
14876 2001-11-19 Akim Demaille <akim@epita.fr>
14878 * src/derives.c (print_derives): Fix and enrich.
14879 * src/closure.c (print_fderives): Likewise.
14881 2001-11-19 Akim Demaille <akim@epita.fr>
14883 * src/closure.c (itemsetend): Remove, replaced with...
14884 (itemsetsize): new.
14886 2001-11-19 Akim Demaille <akim@epita.fr>
14888 * src/LR0.c (kernel_end): Remove, replaced with...
14889 (kernel_size): new.
14891 2001-11-19 Akim Demaille <akim@epita.fr>
14893 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14896 2001-11-19 Akim Demaille <akim@epita.fr>
14898 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14900 2001-11-19 Akim Demaille <akim@epita.fr>
14902 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14904 * src/LR0.c: Likewise.
14905 (allocate_itemsets): Use arrays instead of pointers to clarify.
14907 2001-11-19 Akim Demaille <akim@epita.fr>
14909 * src/getargs.c (statistics_flag): Replace with...
14911 (longopts): Accept --trace instead of --statistics.
14912 * src/getargs.h, src/options.c: Adjust.
14913 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14914 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14916 2001-11-19 Akim Demaille <akim@epita.fr>
14918 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
14919 pointers to clarify the code.
14920 (save_reductions, save_shifts): Factor common parts of alternatives.
14922 2001-11-19 Akim Demaille <akim@epita.fr>
14924 * src/LR0.c (new_state, get_state): Complete TRACE code.
14925 * src/closure.c: Include `reader.h' to get `tags', needed by the
14927 Rename the conditional DEBUG as TRACE.
14928 Output consistently TRACEs to stderr, not stdout.
14929 * src/derives.c: Likewise.
14930 * src/reduce.c: (inaccessable_symbols): Using if is better style
14932 Use `#if TRACE' instead of `#if 0' for tracing code.
14934 2001-11-19 Akim Demaille <akim@epita.fr>
14936 * src/system.h (LIST_FREE, shortcpy): New.
14937 * src/LR0.c: Use them.
14938 * src/output.c (free_itemsets, free_reductions, free_shifts):
14939 Remove, replaced by LIST_FREE.
14941 2001-11-19 Akim Demaille <akim@epita.fr>
14943 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14944 (REDUCTIONS_ALLOC): New.
14945 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14948 2001-11-19 Akim Demaille <akim@epita.fr>
14950 * src/LR0.c (new_state): Complete trace code.
14951 * src/nullable.c (set_nullable): Don't translate traces.
14953 2001-11-19 Akim Demaille <akim@epita.fr>
14955 * src/print_graph.c (print_core): Better locality of variables.
14956 * src/print.c (print_core): Likewise.
14958 2001-11-19 Akim Demaille <akim@epita.fr>
14960 * src/vcg.c: You do the output, so you are responsible of the
14961 handling of VCG syntax, in particular: use quotearg.
14962 * src/print_graph.c: Don't.
14963 (print_actions): Don't output the actions as part of the nodes,
14964 since that's the job of the edges.
14965 (print_state): Don't output by hand: fill the node description,
14966 and ask for its output.
14968 2001-11-19 Akim Demaille <akim@epita.fr>
14970 * src/bison.simple (yyparse): When verbosely reporting an error,
14971 no longer put additional quotes around token names.
14972 * tests/calc.at: Adjust.
14974 2001-11-19 Akim Demaille <akim@epita.fr>
14976 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14977 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14978 * src/output.c: Adjust.
14980 2001-11-19 Akim Demaille <akim@epita.fr>
14982 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14984 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14986 2001-11-19 Akim Demaille <akim@epita.fr>
14988 * src/gram.h (rule_t): New.
14990 (rrhs, rlhs): Remove, part of state_t.
14991 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14992 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14993 * src/reader.c, src/reduce.c: Adjust.
14995 2001-11-19 Akim Demaille <akim@epita.fr>
14997 * src/reader.c (symbols_output): New, extracted from...
14998 (packsymbols): Here.
15001 2001-11-19 Akim Demaille <akim@epita.fr>
15003 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
15004 (maxrhs): this new function.
15006 2001-11-19 Akim Demaille <akim@epita.fr>
15008 * src/lalr.c (F): New macro to access the variable F.
15011 2001-11-19 Akim Demaille <akim@epita.fr>
15013 * src/lalr.h (LA): New macro to access the variable LA.
15014 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15015 * src/lalr.c: Adjust.
15017 2001-11-19 Akim Demaille <akim@epita.fr>
15019 * src/lalr.c (initialize_LA): Only initialize LA. Let...
15020 (set_state_table): handle the `lookaheads' members.
15022 2001-11-19 Akim Demaille <akim@epita.fr>
15024 * src/lalr.h (lookaheads): Removed array, whose contents is now
15026 (state_t): this structure.
15027 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15030 2001-11-19 Akim Demaille <akim@epita.fr>
15032 * src/lalr.h (consistent): Removed array, whose contents is now
15034 (state_t): this structure.
15035 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15038 2001-11-19 Akim Demaille <akim@epita.fr>
15040 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
15041 contents are now members of...
15042 (state_t): this structure.
15043 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15046 2001-11-19 Akim Demaille <akim@epita.fr>
15048 * src/lalr.h (state_t): New.
15049 (state_table): Be a state_t * instead of a core **.
15050 (accessing_symbol): Remove, part of state_t.
15051 * src/lalr.c: Adjust.
15052 (set_accessing_symbol): Merge into...
15053 (set_state_table): this.
15054 * src/print_graph.c, src/conflicts.c: Adjust.
15056 2001-11-14 Akim Demaille <akim@epita.fr>
15058 * tests/calc.at, tests/output.at, tests/regression.at,
15059 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
15060 now the tests are run in private dirs, therefore AC_CLEANUP and
15061 family can be simplified to 0-ary.
15062 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
15063 use abs. path to find config.h.
15064 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
15065 stderr, there can be way too much random noise.
15066 Instead pass -Werror to GCC and rely on the exit status.
15067 Reported by Wolfram Wagner.
15069 2001-11-14 Akim Demaille <akim@epita.fr>
15071 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
15072 defined only if yyoverflow is defined, to avoid `warning: unused
15074 Reported by The Test Suite.
15076 2001-11-14 Akim Demaille <akim@epita.fr>
15078 * src/print.c: Include reduce.h.
15079 Reported by Hans Aberg.
15081 2001-11-14 Akim Demaille <akim@epita.fr>
15083 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
15084 Revert a previous patch: these are really const.
15085 * src/conflicts.c (conflict_report): Additional useless pair of
15086 braces to pacify GCC's warnings for `if () if () {} else {}'.
15087 * src/lex.c (parse_percent_token): Replace equal_offset with
15090 Be sure to strdup `arg' when used, since there is no reason for
15091 token_buffer not to change.
15093 2001-11-14 Akim Demaille <akim@epita.fr>
15095 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
15097 * src/main.c (main): Use them.
15098 Suggested by Hans Aberg.
15100 2001-11-12 Akim Demaille <akim@epita.fr>
15102 * src/system.h (ngettext): Now that we use ngettext, be sure to
15103 provide a default definition when NLS are not used.
15105 2001-11-12 Akim Demaille <akim@epita.fr>
15107 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
15108 Use @kbd to denote user input.
15109 (Language and Grammar): ANSIfy the example.
15110 Adjust its layout for info/notinfo.
15111 (Location Tracking Calc): Output error messages to stderr.
15112 Output locations in a more GNUtically correct way.
15113 Fix a couple of Englishos.
15114 Adjust @group/@end group pairs.
15116 2001-11-12 Akim Demaille <akim@epita.fr>
15118 %expect was not functioning at all.
15120 * src/conflicts.c (expected_conflicts): Set to -1.
15121 (conflict_report): Use ngettext.
15122 (conflicts_print): Check %expect and make its violation an error.
15123 * doc/bison.texinfo (Expect Decl): Adjust.
15124 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
15125 * tests/regression.at (%expect not enough, %expect right)
15126 (%expect too much): New.
15128 2001-11-12 Akim Demaille <akim@epita.fr>
15130 * tests/regression.at (Conflicts): Rename as...
15131 (Unresolved SR Conflicts): this.
15132 (Solved SR Conflicts): New.
15134 2001-11-12 Akim Demaille <akim@epita.fr>
15136 * src/reduce.c (print_results): Rename as...
15137 (reduce_output): This.
15138 Output to OUT, passed as argument, instead of output_obstack.
15139 (dump_grammar): Likewise.
15140 (reduce_free): New.
15142 (reduce_grammar): No longer call reduce_output, since...
15143 * src/print.c (print_results): do it.
15144 * src/main.c (main): Call reduce_free;
15146 2001-11-12 Akim Demaille <akim@epita.fr>
15148 * src/conflicts.c (print_reductions): Accept OUT as argument.
15149 Output to it, not to output_obstack.
15150 * src/print.c (print_actions): Adjust.
15152 2001-11-12 Akim Demaille <akim@epita.fr>
15154 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
15155 the result instead of using...
15156 (src_total, rrc_total, src_count, rrc_count): Remove.
15157 (any_conflicts): Remove.
15158 (print_conflicts): Split into...
15159 (conflicts_print, conflicts_output): New.
15160 * src/conflicts.h: Adjust.
15161 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
15162 * src/print.c (print_grammar): Issue `\n' between two rules.
15163 * tests/regression.at (Conflicts): New.
15164 Reported by Tom Lane.
15166 2001-11-12 Akim Demaille <akim@epita.fr>
15168 * tests/regression.at (Invalid input): Remove, duplicate with
15169 ``Invalid input: 1''.
15171 2001-11-12 Akim Demaille <akim@epita.fr>
15173 * tests/torture.at (AT_DATA_STACK_TORTURE)
15174 (Exploding the Stack Size with Alloca)
15175 (Exploding the Stack Size with Malloc): New.
15177 2001-11-12 Akim Demaille <akim@epita.fr>
15179 * src/bison.simple (YYSTACK_REALLOC): New.
15180 (yyparse) [!yyoverflow]: Use it and free the old stack.
15181 Reported by Per Allansson.
15183 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
15185 * src/bison.simple: Define type yystype instead of YYSTYPE, and
15186 define CPP macro, which substitute YYSTYPE by yystype.
15187 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
15188 with yyltype/YYLTYPE. This allows inclusion of the generated
15189 header within the parser if the compiler, such as GGC, accepts
15190 multiple equivalent #defines.
15193 2001-11-05 Akim Demaille <akim@epita.fr>
15195 * src/reader.c (symbols_output): New, extracted from...
15196 (packsymbols): here.
15199 2001-11-05 Akim Demaille <akim@epita.fr>
15201 * src/lex.c (parse_percent_token): s/quotearg/quote/.
15203 2001-11-05 Akim Demaille <akim@epita.fr>
15205 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
15208 2001-11-05 Akim Demaille <akim@epita.fr>
15210 * src/options.h (struct option_table_struct): set_flags is void*.
15211 * src/options.c (longopts): Support `--output' and `%output'.
15213 * src/lex.h (tok_setopt): Remove, replaced with...
15214 (tok_intopt, tok_stropt): these new guys.
15215 * src/lex.c (getopt.h): Not needed.
15216 (token_buffer, unlexed_token_buffer): Not const.
15217 (percent_table): Promote `-' over `_' in directive names.
15218 Active `%name-prefix', `file-prefix', and `output'.
15219 (parse_percent_token): Accept possible arguments to directives.
15220 Promote `-' over `_' in directive names.
15222 2001-11-04 Akim Demaille <akim@epita.fr>
15224 * doc/bison.texinfo (Decl Summary): Split the list into
15225 `directives for grammars' and `directives for bison'.
15227 Add description of `%name-prefix', `file-prefix', and `output'.
15228 Promote `-' over `_' in directive names.
15229 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
15230 Simplify the description of `--name-prefix'.
15231 Promote `-' over `_' in directive names.
15232 Promote `--output' over `--output-file'.
15233 Fix the description of `--defines'.
15234 * tests/output.at: Exercise %file-prefix and %output.
15236 2001-11-02 Akim Demaille <akim@epita.fr>
15238 * doc/refcard.tex: Update.
15240 2001-11-02 Akim Demaille <akim@epita.fr>
15242 * src/symtab.h (SUNDEF): New.
15243 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
15244 stand for `uninitialized', instead of 0.
15245 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
15246 * src/lex.c (lex): Adjust.
15248 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
15250 Let yylex return it instead of a plain 0.
15251 Reported by Dick Streefland.
15253 2001-11-02 Akim Demaille <akim@epita.fr>
15255 * tests/regression.at (Mixing %token styles): New test.
15257 2001-11-02 Akim Demaille <akim@epita.fr>
15259 * src/reader.c (parse_thong_decl): Formatting changes.
15260 (token_translations_init): New, extracted from...
15261 (packsymbols): Here.
15264 2001-11-01 Akim Demaille <akim@epita.fr>
15266 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
15267 Check that `9foo.y' produces correct cpp guards.
15268 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
15272 2001-11-01 Akim Demaille <akim@epita.fr>
15274 * tests/regression.at (Invalid input: 2): New.
15275 * src/lex.c (unlexed_token_buffer): New.
15276 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
15280 2001-11-01 Akim Demaille <akim@epita.fr>
15282 * tests/calc.at: Catch up with 1.30.
15283 * configure.in: Bump to 1.49a.
15284 Adjust to newer Autotest.
15286 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
15288 * src/conflicts.c: Move global variables rrc_total and src_total ...
15289 (print_conflicts): here.
15290 * src/output.c (output): Free global variable user_toknums.
15291 * src/lex.c (token_obstack): Become static.
15293 2001-10-18 Akim Demaille <akim@epita.fr>
15295 * tests/atlocal.in (GCC): Add.
15296 * tests/calc.at: s/m4_match/m4_bmatch/.
15297 s/m4_patsubst/m4_bpatsubst/.
15298 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
15299 * configure.in: AC_SUBST(GCC).
15301 2001-10-14 Marc Autret <autret_m@epita.fr>
15303 * src/options.c (create_long_option_table): Fix.
15305 2001-10-10 Akim Demaille <akim@epita.fr>
15307 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
15309 2001-10-04 Akim Demaille <akim@epita.fr>
15311 * src/reader.c (parse_union_decl): Push the caracters in
15312 union_obstack, not attrs_obstack.
15314 2001-10-04 Akim Demaille <akim@epita.fr>
15316 Merge in the branch 1.29.
15318 * src/reader.c (packsymbols): Use a temporary obstack for
15319 `%%tokendef', since output_stack is already used elsewhere.
15321 2001-10-02 Akim Demaille <akim@epita.fr>
15325 2001-10-02 Akim Demaille <akim@epita.fr>
15329 2001-10-02 Akim Demaille <akim@epita.fr>
15331 * tests/regression.at (Invalid CPP headers): New.
15332 From Alexander Belopolsky.
15333 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
15335 2001-10-02 Akim Demaille <akim@epita.fr>
15337 * tests/regression.at (Invalid input): New.
15338 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
15341 2001-10-02 Akim Demaille <akim@epita.fr>
15343 * tests/calc.at: Now that --debug works, the tests must be adjusted.
15345 2001-10-02 Akim Demaille <akim@epita.fr>
15347 * src/output.c (output_parser): Assert `skeleton'.
15348 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
15352 2001-10-01 Marc Autret <autret_m@epita.fr>
15354 * src/lex.h: Echo modifications.
15355 * src/lex.c (unlex): Parameter is now token_t.
15358 2001-10-01 Marc Autret <autret_m@epita.fr>
15360 * src/main.c: Include lex.h.
15363 2001-09-29 Akim Demaille <akim@epita.fr>
15365 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
15367 2001-09-28 Akim Demaille <akim@epita.fr>
15369 * tests/testsuite.at: Update to newer Autotest.
15370 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
15372 2001-09-27 Akim Demaille <akim@epita.fr>
15374 Position independent wrapper.
15376 * tests/bison: Remove.
15377 * tests/bison.in: New.
15378 * configure.in: Adjust.
15380 2001-09-27 Paul Eggert <eggert@twinsun.com>
15382 Port quotearg fixes from tar 1.13.24.
15384 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
15386 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
15387 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
15389 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
15390 * m4/mbrtowc.m4: New file.
15391 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
15392 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
15394 2001-09-27 Akim Demaille <akim@epita.fr>
15398 2001-09-27 Akim Demaille <akim@epita.fr>
15402 2001-09-25 Akim Demaille <akim@epita.fr>
15404 * src/system.h: Include `xalloc.h'.
15405 Remove it from the C files.
15406 * src/files.c (output_files): Free the obstacks.
15407 * src/lex.c (init_lex): Rename as...
15410 * src/main.c (main): Use it.
15412 2001-09-24 Marc Autret <autret_m@epita.fr>
15414 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
15415 to output informations in fout (FILE*).
15416 (open_graph, close_graph): Likewise.
15417 (output_graph, output_edge, output_node): Likewise.
15418 * src/vcg.h: Update function prototypes.
15419 * src/print_graph.c (print_graph): Open output graph file.
15420 (print_actions): Adjust.
15421 * src/files.h: Remove extern declaration.
15422 * src/files.c: Remove graph_obstack declaration.
15423 (open_files): Remove graph_obstack initialization.
15424 (output_files): Remove graph_obstack saving.
15426 2001-09-24 Marc Autret <autret_m@epita.fr>
15428 * src/files.c (compute_output_file_names): Fix.
15430 2001-09-24 Marc Autret <autret_m@epita.fr>,
15431 Akim Demaille <akim@epita.fr>
15433 * src/reader.c (reader): Remove call to free_symtab ().
15434 * src/main.c (main): Call it here.
15436 * src/conflicts.c (initialize_conflicts): Rename as...
15437 (solve_conflicts): this.
15438 * src/print.c (print_core, print_actions, print_state)
15439 (print_grammar): Dump to a file instead a `output_obstack'.
15440 (print_results): Dump `output_obstack', and then proceed with the
15442 * src/files.c (compute_output_file_names, close_files): New.
15443 (output_files): Adjust.
15444 * src/main.c (main): Adjust.
15446 2001-09-23 Marc Autret <autret_m@epita.fr>
15448 * src/files.c (compute_header_macro): Computes header macro name
15449 from spec_defines_file when given.
15451 2001-09-23 Marc Autret <autret_m@epita.fr>
15453 * src/files.c (output_files): Add default extensions.
15455 2001-09-22 Akim Demaille <akim@epita.fr>
15457 * src/conflicts.c (finalize_conflicts): Rename as...
15458 (free_conflicts): this.
15460 2001-09-22 Akim Demaille <akim@epita.fr>
15462 * src/gram.c (gram_free): Rename back as...
15464 (output_token_translations): Free `token_translations'.
15465 * src/symtab.c (free_symtab): Free the tag field.
15467 2001-09-22 Akim Demaille <akim@epita.fr>
15469 Remove `translations' as it is always set to true.
15471 * src/gram.h: Adjust.
15472 * src/reader.c (packsymbols, parse_token_decl): Adjust
15473 * src/print.c (print_grammar): Adjust.
15474 * src/output.c (output_token_translations): Adjust.
15475 * src/lex.c (lex): Adjust.
15476 * src/gram.c: Be sure the set pointers to NULL.
15477 (dummy): Rename as...
15480 2001-09-22 Akim Demaille <akim@epita.fr>
15482 * configure.in: Invoke AM_LIB_DMALLOC.
15483 * src/system.h: Use dmalloc.
15484 * src/LR0.c: Be sure to have pointers initialized to NULL.
15485 (allocate_itemsets): Allocate kernel_items only if needed.
15487 2001-09-22 Akim Demaille <akim@epita.fr>
15489 * configure.in: Bump to 1.29b.
15490 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
15491 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
15492 need xmalloc.c in calc.y.
15495 2001-09-21 Akim Demaille <akim@epita.fr>
15498 * Makefile.maint, config/config.guess, config/config.sub,
15499 * config/missing: Update from masters.
15500 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
15502 * configure.in (ALL_LINGUAS): Add `tr'.
15504 2001-09-21 Akim Demaille <akim@epita.fr>
15506 * tests/Makefile.am (package.m4): Move to...
15507 ($(srcdir)/$(TESTSUITE)): here.
15509 2001-09-20 Akim Demaille <akim@epita.fr>
15511 * src/complain.c: No longer try to be standalone: use system.h.
15512 Don't assume __STDC__ is defined to 1. Just test if it is defined.
15513 * src/complain.h: Likewise.
15514 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
15515 Remove the unused variable `n'.
15516 From Albert Chin-A-Young.
15518 2001-09-18 Marc Autret <autret_m@epita.fr>
15520 * doc/bison.1: Update.
15521 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15523 (Option Cross Key): Update.
15526 2001-09-18 Marc Autret <autret_m@epita.fr>
15528 * tests/regression.at: New test (comment in %union).
15530 2001-09-18 Marc Autret <autret_m@epita.fr>
15532 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15534 Reported by Keith Browne.
15536 2001-09-18 Marc Autret <autret_m@epita.fr>
15538 * tests/output.at: Add tests for --defines and --graph.
15540 2001-09-18 Marc Autret <autret_m@epita.fr>
15542 * tests/output.at: Removes tests of %{header,src}_extension features.
15544 2001-09-18 Akim Demaille <akim@epita.fr>
15546 * tests/Makefile.am (package.m4): New.
15547 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15548 (_AT_CHECK_CALC_ERROR): Likewise.
15549 Factor the `, ' part of verbose error messages.
15551 2001-09-18 Marc Autret <autret_m@epita.fr>
15553 * src/getargs.c (longopts): Declare --defines and --graph as options
15554 with optional arguments.
15555 * src/files.h: Add extern declarations.
15556 * src/files.c (spec_graph_file, spec_defines_file): New.
15557 (output_files): Update.
15558 Remove CPP-outed code.
15560 2001-09-18 Marc Autret <autret_m@epita.fr>
15562 Turn off %{source,header}_extension feature.
15564 * src/files.c (compute_exts_from_gf): Update.
15565 (compute_exts_from_src): Update.
15566 (output_files): CPP-out useless code.
15567 * src/files.h: Remove {header,source}_extension extern declarations.
15568 * src/reader.c (parse_dquoted_param): CPP-out.
15569 (parse_header_extension_decl): Remove.
15570 (parse_source_extension_decl): Remove.
15571 (read_declarations): Remove cases tok_{hdrext,srcext}.
15572 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15573 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15575 2001-09-10 Akim Demaille <akim@epita.fr>
15577 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15578 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15579 (AT_CHECK_OUTPUT): this.
15580 Merely check ls' exit status, its output is useless.
15582 2001-09-10 Akim Demaille <akim@epita.fr>
15584 * tests/calc.at: Use m4_match.
15585 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15587 2001-09-10 Marc Autret <autret_m@epita.fr>,
15588 Akim Demaille <akim@epita.fr>
15590 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15592 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15594 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15595 * src/lex.h: Adjust prototype.
15596 (token_t): Add `tok_undef'.
15597 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15598 (parse_percent_token): Now returns token_t.
15599 Add default statement in switch.
15600 (lex): Separate `c' as an input variable, from the token_t result
15602 (unlexed): Is a token_t.
15604 2001-09-10 Akim Demaille <akim@epita.fr>
15606 * configure.in: Bump to 1.29a.
15608 2001-09-07 Akim Demaille <akim@epita.fr>
15612 2001-08-30 Akim Demaille <akim@epita.fr>
15614 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15615 * m4/atconfig.m4: Remove.
15616 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15617 * tests/bison: New.
15618 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15619 m4_if, m4_patsubst, and m4_regexp.
15620 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15621 `input' file instead of echo.
15623 2001-08-29 Akim Demaille <akim@epita.fr>
15627 2001-08-29 Akim Demaille <akim@epita.fr>
15631 2001-08-29 Paul Eggert <eggert@twinsun.com>
15633 * src/bison.simple (yyparse): Don't take the address of an
15634 item before the start of an array, as that doesn't conform to
15637 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15639 * doc/bison.texinfo (Location Tracking Calc): New node.
15641 2001-08-29 Paul Eggert <eggert@twinsun.com>
15643 * src/output.c (output): Do not define const, as this now
15644 causes more problems than it cures.
15646 2001-08-29 Akim Demaille <akim@epita.fr>
15648 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15650 Be sure to tag the `detailmenu'.
15652 2001-08-29 Akim Demaille <akim@epita.fr>
15654 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15655 download in a tmp dir.
15657 2001-08-28 Marc Autret <autret_m@epita.fr>
15659 * config/depcomp: New file.
15661 2001-08-28 Marc Autret <autret_m@epita.fr>
15663 * doc/bison.1 (mandoc): Adjust.
15664 From Juan Manuel Guerrero.
15666 2001-08-28 Marc Autret <autret_m@epita.fr>
15668 * src/print_graph.c (print_state): Fix.
15670 2001-08-27 Marc Autret <autret_m@epita.fr>
15672 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15674 Echo modifications to the functions prototypes.
15675 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15677 2001-08-27 Marc Autret <autret_m@epita.fr>
15679 * src/vcg.c: Include `xalloc.h'.
15680 (add_colorentry): New.
15681 (add_classname): New.
15682 (add_infoname): New.
15683 * src/vcg.h: Add new prototypes.
15685 2001-08-27 Akim Demaille <akim@epita.fr>
15687 * Makefile.maint: Sync. again with CVS Autoconf.
15689 2001-08-27 Akim Demaille <akim@epita.fr>
15691 * Makefile.maint: Formatting changes.
15692 (po-update, cvs-update, update): New targets.
15695 2001-08-27 Akim Demaille <akim@epita.fr>
15697 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15698 * Makefile.maint: Sync. with CVS Autoconf.
15700 2001-08-27 Marc Autret <autret_m@epita.fr>
15702 * src/vcg.h (struct infoname_s): New.
15703 (struct colorentry_s): New.
15704 (graph_s): New fields {vertical,horizontal}_order in structure.
15705 Add `infoname' field.
15706 Add `colorentry' field;
15707 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15708 (G_HORIZONTAL_ORDER): New.
15710 (G_COLORENTRY): New.
15711 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15712 Add output of `infoname'.
15713 Add output of `colorentry'.
15715 2001-08-27 Marc Autret <autret_m@epita.fr>
15717 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15718 This one shadowed a global parameter.
15720 2001-08-24 Marc Autret <autret_m@epita.fr>
15722 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15723 instead of `unsigned'.
15724 (print_state): Do not call obstack_object_size () in obstack_grow ()
15725 to avoid macro variables shadowing.
15727 2001-08-23 Marc Autret <autret_m@epita.fr>
15729 * src/lex.c (percent_table): Typo: s/naem/name/.
15731 Normalize new options declarations.
15733 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15735 * tests/suite.at: Exercise %header_extension and %source_extension.
15737 2001-08-16 Marc Autret <autret_m@epita.fr>
15739 * src/reader.c (parse_dquoted_param): New.
15740 (parse_header_extension_decl): Use it.
15741 (parse_source_extension_decl): Likewise.
15743 2001-08-16 Marc Autret <autret_m@epita.fr>
15745 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15746 (get_xxxx_str): Use assert () instead of complain ().
15747 Remove return invokations in default cases.
15748 (get_decision_str): Modify default behaviour. Remove second argument.
15749 Echo modifications on calls.
15750 (output_graph): Fix.
15752 2001-08-16 Marc Autret <autret_m@epita.fr>
15754 * src/getargs.c (usage): Update with ``-g, --graph''.
15756 2001-08-16 Marc Autret <autret_m@epita.fr>
15758 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15759 (Option Cross Key): Likewise.
15760 * doc/bison.1: Update.
15762 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
15764 * src/output.c (output_master_parser): Don't finish action_obstack.
15765 (output_parser): Don't care about the muscle action, here.
15766 (prepare): Copy the action_obstack in the action muscle.
15767 (output): Free action_obstack.
15769 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15771 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15772 will contain `%union' declaration.
15773 (parse_union_decl): Delete #line directive output.
15774 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15775 informations about %union.
15776 (parse_union_decl): Copy the union_obstack in the muscle stype.
15777 * src/bison.simple: Add new #line directive.
15778 Add typdef %%stype YYSTYPE.
15780 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15782 * src/bison.simple: Add new `#line' directive.
15784 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
15786 * src/bison.simple: New `#line' directive.
15787 * src/output.c (output_parser): Support new dynamic muscle input_line.
15789 2001-09-22 Marc Autret <autret_m@epita.fr>
15791 * src/output.c (output_master_parser): New.
15792 (output_parser): Be more re-entrant.
15794 2001-09-21 Marc Autret <autret_m@epita.fr>
15796 * src/reader.c (copy_definition, parse_union_decl): Update and use
15798 (copy_action): Likewise.
15799 Use obstack_1grow ().
15800 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15802 2001-09-21 Marc Autret <autret_m@epita.fr>
15804 * src/options.c (option_table): Adjust.
15805 * src/lex.c (parse_percent_token): Fix.
15807 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15809 * src/options.c (symtab.h): Include it, need by lex.h.
15811 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15813 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15814 is now an option_table_struct*.
15815 (option_strcmp): New function option_strcmp.
15816 (parse_percent_token): Call option_strcmp.
15817 * src/getargs.c (xalloc.h, options.h): Include it.
15818 (getargs): Call create_long_option_table.
15819 (getargs): Free longopts at the end of the function.
15820 (shortopts): Move in options.c.
15821 * src/options.c (create_long_option_table): New function. Convert
15822 information from option_table to option structure.
15823 * src/reader.c (options.h): Include it.
15825 * src/Makefile.am: Adjust.
15826 * src/options.c (option_table): Create from longopts and percent_table.
15827 * src/getargs.c (longopts): Delete.
15828 * src/lex.c (struct percent_table_struct): Delete.
15829 (percent_table): Delete.
15830 (options.h): Include it.
15831 * src/options.c: Create.
15832 * src/options.h: Create.
15833 Declare enum opt_access_e.
15834 Define struct option_table_struct.
15836 2001-09-20 Marc Autret <autret_m@epita.fr>
15838 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15841 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
15843 * src/bison.simple: s/%%filename/%%skeleton.
15844 * src/muscle_tab.c (getargs.h): Include it.
15845 (muscle_init): Insert new muscle skeleton.
15847 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
15849 * src/output.c (output_parser): Delete unused variable actions_dumped.
15851 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
15853 * src/output.c (output): Delete call to reader_output_yylsp.
15854 * src/reader.c (reader): Likewise.
15855 * src/reader.h: Delete declaration of reader_output_yylsp.
15857 2001-09-02 Marc Autret <autret_m@epita.fr>
15859 * src/reader.c: Include muscle_tab.h.
15860 (parse_union_decl): Update.
15861 (parse_macro_decl): Rename parse_muscle_decl.
15862 Update to use renamed functions and variable.
15863 (read_declarations, copy_action, read_additionnal_code, : Updated
15864 with correct variables and functions names.
15865 (packsymbols, reader): Likewise.
15867 * src/reader.h (muscle_obstack): Extern declaration update.
15869 * src/output.c: Include muscle_tab.h
15870 In all functions using macro_insert, change by using muscle_insert ().
15871 (macro_obstack): Rename muscle_obstack.
15872 Echo modifications in the whole file.
15873 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15874 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15875 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15877 * src/muscle_tab.h: Update double inclusion macros.
15878 (macro_entry_s): Rename muscle_entry_s.
15881 * src/muscle_tab.c: Include muscle_tab.h.
15882 Rename macro_tabble to muscle_table.
15883 (mhash1, mhash2, mcmp): Use muscle_entry.
15884 (macro_init): Rename muscle_init. Update.
15885 (macro_insert): Rename muscle_insert. Update.
15886 (macro_find): Rename muscle_find. Update.
15888 * src/main.c: Include muscle_tab.h.
15889 (main): Call muscle_init ().
15890 * src/Makefile.am (bison_SOURCES): Echo modifications.
15892 2001-09-02 Marc Autret <autret_m@epita.fr>
15894 Now the files macro_tab.[ch] are named muscle_tab.[ch].
15896 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15898 2001-09-02 Marc Autret <autret_m@epita.fr>
15900 * src/macrotab.c, src/macrotab.h: Remove.
15902 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
15904 * src/reader.c (copy_guard): Use muscle to specify the `#line'
15907 2001-09-01 Marc Autret <autret_m@epita.fr>
15909 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15910 to an explicit value to activate the feature. We do it here.
15912 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15914 * src/output.c (prepare): Delete the `filename' muscule insertion.
15915 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15916 (parse_union_decl): Likewise.
15917 * src/macrotab.c (macro_init): Initialize filename by infile.
15919 2001-08-31 Marc Autret <autret_m@epita.fr>
15921 * src/bison.simple (YYLSP_NEEDED): New definition.
15922 * src/output.c (prepare): Add macro insertion of `locations_flag'
15924 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15926 * src/output.c (prepare): Delete insertion of previous muscles,
15927 and insert the `prefix' muscles.
15928 * src/macrotab.c (macro_init): Likewise.
15929 (macro_init): Initialization prefix directive by `yy'.
15930 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
15931 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15932 yylval, yydebug, yyerror, yynerrs and yyparse.
15933 New directive `#define' to substitute yydebug, ... with option
15936 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15938 * src/main.c (main): Standardize.
15939 * src/output.c (output_table_data, output_parser): Likewise.
15940 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15942 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15944 * src/reader.c (read_additionnal_code): Rename %%user_code to
15946 * src/output.c (output): Rename %%declarations to %%prologue.
15947 * src/bison.simple: Echo modifications.
15949 2001-08-31 Marc Autret <autret_m@epita.fr>
15951 * src/reader.c (readgram): CleanUp.
15952 (output_token_defines): Likewise.
15953 (packsymbols): Likewise.
15954 (reader): Likewise.
15955 * src/output.c (output): CPP-out useless code.
15957 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15959 * src/reader.c (reader): Delete obsolete call to function
15960 output_trailers and output_headers.
15961 * src/output.h: Remove obsolete functions prototypes of output_headers
15962 and output_trailers.
15964 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
15966 * src/main.c: Include macrotab.h.
15967 * src/macrotab.h (macro_entry_s): Constify fields.
15968 Adjust functions prototypes.
15969 * src/macrotab.c (macro_insert): Constify key and value.
15970 (macro_find): Constify key.
15971 (macro_insert): Include 'xalloc.h'
15972 (macro_insert): Use XMALLOC.
15973 (macro_find): Constify return value.
15974 * src/output.c (output_table_data): Rename table to table_data.
15975 (output_parser): Constify macro_key, macro_value.
15977 2001-08-30 Marc Autret <autret_m@epita.fr>
15979 * src/reader.c (parse_skel_decl): New.
15980 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
15981 * src/lex.h (token_t): New token `tok_skel'.
15982 * src/lex.c (percent_table): Add skeleton option entry.
15985 2001-08-29 Marc Autret <autret_m@epita.fr>
15987 * src/bison.simple: Add %%user_code directive at the end.
15988 * src/reader.c (read_additionnal_code): New.
15990 * src/output.c (output_program): Remove.
15993 2001-08-28 Marc Autret <autret_m@epita.fr>
15995 * src/output.c (output_actions): Clean up.
15996 (output_gram): CPP-out useless code.
15997 * src/reader.c (reader): Clean up, CPP-out useless code.
15999 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
16001 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
16003 * src/bison.simple: Add `%%definitions'.
16005 2001-08-28 Marc Autret <autret_m@epita.fr>
16007 * config/depcomp: New file.
16009 2001-08-27 Paul Eggert <eggert@twinsun.com>
16011 * src/bison.simple (yyparse): Don't take the address of an
16012 item before the start of an array, as that doesn't conform to
16015 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
16017 * src/output.c (output): Remove the initialization of the macro
16018 obstack. It was done too late here.
16020 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
16022 (reader): Initialize the macro obstack here, since we need it to grow
16023 '%define' directives.
16025 * src/reader.h: Declare the macro obstack as extern.
16027 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
16029 * src/output.c (output_parser): Fix. Store single '%' characters in
16030 the output obstack instead of throwing them away.
16032 2001-08-27 Akim Demaille <akim@epita.fr>
16034 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16036 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16038 * lib/Makefile.am: Adjust.
16040 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16042 * src/bison.simple: Update and add '%%' directives.
16044 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16046 * src/reader.c (reader): Remove calls to 'output_headers' and
16047 'output_trailers'. Remove some C output.
16048 (readgram): Disable a piece of code that was writing a default
16049 definition for 'YYSTYPE'.
16050 (reader_output_yylsp): Remove.
16051 (packsymbols): Output token defintions to a macro.
16052 (copy_definition): Disable C output.
16054 * src/reader.c (parse_macro_decl): New function used to parse macro
16056 (copy_string2): Put the body of copy_string into this new function.
16057 Add a parameter to let the caller choose whether he wants to copy the
16058 string delimiters or not.
16059 (copy_string): Be a simple call to copy_string2 with the last argument
16061 (read_declarations): Add case for macro definition.
16062 (copy_identifier): New.
16063 (parse_macro_decl): Read macro identifiers using copy_identifier
16066 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16068 * src/output.c (prepare): Add prefixed names.
16069 (output_parser): Output semantic actions.
16070 (output_parser): Fix bug on '%%line' directives.
16072 * src/output.c (output_headers): Remove. The C code printed by this
16073 function should now be in the skeletons.
16074 (output_trailers): Remove.
16075 (output): Disable call to 'reader_output_yylsp'.
16076 (output_rule_data): Do not output tables to the table obstack.
16078 * src/output.c: Remove some C dedicated output.
16079 Improve the use of macro and output obstacks.
16080 (output_defines): Remove.
16082 * src/output.c (output_token_translations): Associate 'translate'
16083 table with a macro. No output to the table obstack.
16084 (output_gram): Same for 'rhs' and 'prhs'.
16085 (output_stos): Same for 'stos'.
16086 (output_rule_data): Same for 'r1' and 'r2'.
16087 (token_actions): Same for 'defact'.
16088 (goto_actions): Same for 'defgoto'.
16089 (output_base): Same for 'pact' and 'pgoto'.
16090 (output_table): Same for 'table'.
16091 (output_check): Same for 'check'.
16093 * src/output.c (output_table_data): New function.
16094 (output_short_table): Remove.
16095 (output_short_or_char_table): Remove.
16097 * src/output.c (output_parser): Replace most of the skeleton copy code
16098 with something new. Skeletons are now processed character by character
16099 rather than line by line, and Bison looks for '%%' macros. This is the
16100 first step in making Bison's output process (a lot) more flexible.
16101 (output_parser): Use the macro table.
16103 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16105 * src/main.c (main): Initialize the macro table.
16107 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16109 * src/lex.c (percent_table): Add tok_define.
16110 * src/lex.h: Add tok_define.
16112 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16114 * src/macrotab.c: New file.
16115 * src/macrotab.h: New file.
16116 * src/Makefile.am: Update.
16118 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16120 * lib/hash.c: New file.
16121 * lib/hash.h: New file.
16122 * lib/Makefile.am: Update.
16124 2001-08-15 Akim Demaille <akim@epita.fr>
16128 2001-08-15 Marc Autret <autret_m@epita.fr>
16130 * src/reader.c (readgram): Indent output macro YYSTYPE.
16131 (packsymbols): Likewise.
16132 (output_token_defines): Likewise.
16133 * src/files.c: Standardize.
16134 (compute_header_macro): New.
16135 (defines_obstack_save): New. Use compute_header_macro.
16136 (output_files): Update. Use defines_obstack_save.
16138 2001-08-15 Akim Demaille <akim@epita.fr>
16140 * doc/bison.texinfo (Table of Symbols): Document
16141 YYSTACK_USE_ALLOCA.
16143 2001-08-15 Akim Demaille <akim@epita.fr>
16145 * missing: Update from CVS Automake.
16146 * config/config.guess, config/config.sub, config/texinfo.tex:
16147 Update from gnu.org.
16149 2001-08-15 Akim Demaille <akim@epita.fr>
16151 * Makefile.maint: Sync with CVS Autoconf.
16153 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
16155 * doc/bison.texinfo: Include GNU Free Documentation License from
16157 * doc/fdl.texi: Add to package.
16159 2001-08-14 Marc Autret <autret_m@epita.fr>
16161 Turn on %{source,header}_extension features.
16163 * src/lex.c (percent_table): Un-CPP out header_extension and
16165 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
16166 (compute_exts_from_src): Remove conditions. It restores priorities
16169 2001-08-14 Marc Autret <autret_m@epita.fr>
16171 * src/files.c (compute_base_names): Add extensions computing when
16172 `--file-prefix' used.
16173 Standardize function calls.
16175 2001-08-13 Marc Autret <autret_m@epita.fr>
16177 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
16178 defining it (defined but null disables alloca).
16180 2001-08-13 Marc Autret <autret_m@epita.fr>
16182 * src/bison.simple (_yy_memcpy): CPP reformat.
16184 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
16186 * tests/atconfig.in (CPPFLAGS): Fix.
16188 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
16190 * doc/bison.texinfo: Include GNU General Public License from
16192 * doc/gpl.texi: Add to package.
16194 2001-08-10 Marc Autret <autret_m@epita.fr>
16196 * src/print_graph.h: Fix.
16197 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
16199 2001-08-10 Akim Demaille <akim@epita.fr>
16201 * src/system.h: Provide default declarations for stpcpy, strndup,
16204 2001-08-10 Robert Anisko <anisko_r@epita.fr>
16206 * doc/bison.texinfo (Locations): Update @$ stuff.
16208 2001-08-09 Robert Anisko <anisko_r@epita.fr>
16210 * src/bison.simple (YYLLOC_DEFAULT): Update.
16213 2001-08-08 Marc Autret <autret_m@epita.fr>
16215 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
16216 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
16217 Reported by Fabrice Bauzac.
16219 2001-08-08 Marc Autret <autret_m@epita.fr>
16221 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
16222 * src/vcg.c (output_node): Fix.
16223 * src/vcg.h: Cleanup.
16224 * src/print_graph.c: Add comments.
16225 (node_output_size): New global variable. Simplify the formatting of
16226 the VCG graph output.
16227 (print_actions): Unused code is now used. It notifies the final state
16228 and no action states in the VCG graph. It also give the reduce actions.
16229 The `shift and goto' edges are red and the `go to state' edges are
16231 Get the current node name and node_obstack by argument.
16232 (node_obstack): New variable.
16233 (print_state): Manage node_obstack.
16234 (print_core): Use node_obstack given by argument.
16235 A node is not only computed here but in print_actions also.
16236 (print_graph): CPP out useless code instead of commenting it.
16238 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
16240 * tests/atconfig.in (CPPFLAGS): Fix.
16242 2001-08-07 Akim Demaille <akim@epita.fr>
16244 * src/print_graph.c (quote): New.
16245 (print_core): Use it.
16247 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
16249 * src/vcg.c (complain.h): Include it.
16250 Unepitaize `return' invocations.
16251 [NDEBUG] (main): Remove.
16252 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
16253 * src/files.c (open_files): Initialize graph_obstack.
16254 * src/print_graph.c (print_actions): CPP out useless code.
16255 (print_core): Don't output the last `\n' in labels.
16257 * src/files.c (output_files): Output the VCG file.
16258 * src/main.c (main): Invoke print_graph ();
16260 2001-08-06 Marc Autret <autret_m@epita.fr>
16262 Automaton VCG graph output.
16263 Using option ``-g'' or long option ``--graph'', you can generate
16264 a gram_filename.vcg file containing a VCG description of the LALR (1)
16265 automaton of your grammar.
16267 * src/main.c: Call to print_graph() function.
16268 * src/getargs.h: Update.
16269 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
16270 (graph_flag): New flag.
16271 (longopts): Update.
16272 (getargs): Add case `g'.
16273 * src/files.c (graph_obstack): New obstack struct.
16274 (open_files): Initialize new obstack.
16275 (output_files): Saves graph_obstack if required.
16276 * src/files.h (graph_obstack): New extern declaration.
16277 * src/Makefile.am: Add new source files.
16279 2001-08-06 Marc Autret <autret_m@epita.fr>
16281 * src/print_graph.c, src/print_graph.h (graph): New.
16282 * src/vcg.h: New file.
16283 * src/vcg.c: New file, VCG graph handling.
16285 2001-08-06 Marc Autret <autret_m@epita.fr>
16287 Add of %source_extension and %header_extension which specify
16288 the source or/and the header output file extension.
16290 * src/files.c (compute_base_names): Remove initialisation of
16291 src_extension and header_extension.
16292 (compute_exts_from_gf): Update.
16293 (compute_exts_from_src): Update.
16294 (output_files): Update.
16295 * src/reader.c (parse_header_extension_decl): New.
16296 (parse_source_extension_decl): New.
16297 (read_declarations): New case statements for the new tokens.
16298 * src/lex.c (percent_table): Add entries for %source_extension
16299 and %header_extension.
16300 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
16302 2001-08-06 Marc Autret <autret_m@epita.fr>
16304 * configure.in: Bump to 1.28c.
16305 * doc/bison.texinfo: Texinfo thingies.
16307 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
16309 * tests/atconfig.in (CPPFLAGS): Add.
16310 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
16312 2001-08-03 Akim Demaille <akim@epita.fr>
16316 2001-08-03 Akim Demaille <akim@epita.fr>
16318 * tests/Makefile.am (check-local): Ship testsuite.
16319 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
16320 Include `string.h'.
16322 2001-08-03 Akim Demaille <akim@epita.fr>
16324 * configure.in: Try using -Wformat when compiling.
16326 2001-08-03 Akim Demaille <akim@epita.fr>
16328 * configure.in: Bump to 1.28b.
16330 2001-08-03 Akim Demaille <akim@epita.fr>
16332 * src/complain.c: Adjust strerror_r portability issues.
16334 2001-08-03 Akim Demaille <akim@epita.fr>
16338 2001-08-03 Akim Demaille <akim@epita.fr>
16340 * src/getargs.c, src/getarg.h (skeleton)): Constify.
16341 * src/lex.c (literalchar): Avoid name clashes on `buf'.
16342 * src/getargs.c: Include complain.h.
16343 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
16344 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
16346 2001-08-03 Akim Demaille <akim@epita.fr>
16348 * src/reader.c (readgram): Display hidden chars in error messages.
16350 2001-08-03 Akim Demaille <akim@epita.fr>
16352 Update to gettext 0.10.39.
16354 2001-08-03 Akim Demaille <akim@epita.fr>
16356 * lib/strspn.c: New.
16358 2001-08-01 Marc Autret <autret_m@epita.fr>
16360 * doc/bison.texinfo: Update.
16361 * doc/bison.1 (mandoc): Update.
16362 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
16363 * src/files.c: Support output files extensions computing.
16364 (src_extension): New static variable.
16365 (header_extension): New static variable.
16366 (tr): New function.
16367 (get_extension_index): New function, gets the index of an extension
16368 filename in a string.
16369 (compute_exts_from_gf): New function, computes extensions from the
16370 grammar file extension.
16371 (compute_exts_from_src): New functions, computes extensions from the
16372 C source file extension, file given by ``-o'' option.
16373 (compute_base_names): Update.
16374 (output_files): Update.
16376 2001-08-01 Robert Anisko <anisko_r@epita.fr>
16378 * doc/bison.texi: Document @$.
16379 (Locations): New section.
16381 2001-07-18 Akim Demaille <akim@epita.fr>
16383 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
16384 * config/prev-version.txt, config/move-if-change: New.
16385 * Makefile.am: Adjust.
16387 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
16389 * src/bison.simple (yyparse): Suppress warning `comparaison
16390 between signed and unsigned'.
16392 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
16394 * src/getargs.h (raw_flag): Remove.
16395 * src/getargs.c: Die on `-r'/`--raw'.
16396 * src/lex.c (parse_percent_token): Die on `%raw'.
16397 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
16398 * tests/calc.at: Suppress test with option `--raw'.
16400 2001-07-14 Akim Demaille <akim@epita.fr>
16403 * configure.in: Require Autoconf 2.50.
16404 Update to gettext 0.10.38.
16406 2001-03-16 Akim Demaille <akim@epita.fr>
16408 * doc/bison.texinfo: ANSIfy the examples.
16410 2001-03-16 Akim Demaille <akim@epita.fr>
16412 * getargs.c (skeleton): New variable.
16413 (longopts): --skeleton is a new option.
16414 (shortopts, getargs): -S is a new option.
16415 * getargs.h: Declare skeleton.
16416 * output.c (output_parser): Use it.
16418 2001-03-16 Akim Demaille <akim@epita.fr>
16420 * m4/strerror_r.m4: New.
16421 * m4/error.m4: Run AC_FUNC_STRERROR_R.
16422 * lib/error.h, lib/error.c: Update.
16424 2001-03-16 Akim Demaille <akim@epita.fr>
16426 * src/getargs.c (longopts): Clean up.
16428 2001-02-21 Akim Demaille <akim@epita.fr>
16430 * src/reader.c (gensym): `gensym_count' is your own.
16431 Use a static buf to create the symbol name, as token_buffer is no
16434 2001-02-08 Akim Demaille <akim@epita.fr>
16436 * src/conflicts.c (conflict_report): Be sure not to append to res
16437 between two calls, which could happen if both first sprintf were
16438 skipped, but not the first cp += strlen.
16440 2001-02-08 Akim Demaille <akim@epita.fr>
16442 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
16443 New, from fileutils 4.0.37.
16444 * configure.in: Require Autoconf 2.49c. I took some time before
16445 making this decision. This is the only way out for portability
16446 issues in Bison, it would mean way too much duplicate effort to
16447 import in Bison features implemented in 2.49c since 2.13.
16448 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
16450 2001-02-02 Akim Demaille <akim@epita.fr>
16452 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
16453 * lib/xalloc.h, lib/xmalloc.c: Update.
16455 2001-01-19 Akim Demaille <akim@epita.fr>
16457 Get rid of the ad hoc handling of token_buffer in the scanner: use
16460 * src/lex.c (token_obstack): New.
16461 (init_lex): Initialize it. No longer call...
16462 (grow_token_buffer): this. Remove it.
16463 Adjust all the places which used it to use the obstack.
16465 2001-01-19 Akim Demaille <akim@epita.fr>
16467 * src/lex.h: Rename all the tokens:
16468 s/\bENDFILE\b/tok_eof/g;
16469 s/\bIDENTIFIER\b/tok_identifier/g;
16471 Let them be enums, not #define, to ease debugging.
16472 Adjust all the code.
16474 2001-01-18 Akim Demaille <akim@epita.fr>
16476 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
16477 * src/lex.c (maxtoken, grow_token_buffer): Static.
16479 2001-01-18 Akim Demaille <akim@epita.fr>
16481 Since we now use obstacks, more % directives can be enabled.
16483 * src/lex.c (percent_table): Also accept `%yacc',
16484 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
16486 Handle the actions for `%semantic_parser' and `%pure_parser' here,
16487 instead of returning a token.
16488 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
16489 * src/reader.c (read_declarations): Adjust.
16490 * src/files.c (open_files): Don't call `compute_base_names', don't
16491 compute `attrsfile' since they depend upon data which might be
16492 *in* the input file now.
16493 (output_files): Do it here.
16494 * src/output.c (output_headers): Document the fact that this patch
16495 introduces a guaranteed SEGV for semantic parsers.
16496 * doc/bison.texinfo: Document them.
16497 * tests/suite.at: Exercise these %options.
16499 2000-12-20 Akim Demaille <akim@epita.fr>
16501 Also handle the output file (--verbose) with obstacks.
16503 * files.c (foutput): Remove.
16504 (output_obstack): New.
16505 Adjust all dependencies.
16506 * src/conflicts.c: Return a string.
16507 * src/system.h (obstack_grow_string): Rename as...
16508 (obstack_sgrow): this. Be ready to work with non literals.
16509 (obstack_fgrow4): New.
16511 2000-12-20 Akim Demaille <akim@epita.fr>
16513 * src/files.c (open_files): Fix the computation of short_base_name
16514 in the case of `-o foo.tab.c'.
16516 2000-12-20 Akim Demaille <akim@epita.fr>
16518 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16519 (copy_dollar): Now that everything uses obstacks, get rid of the
16522 2000-12-20 Akim Demaille <akim@epita.fr>
16524 * src/files.c (open_files): Actually the `.output' file is based
16525 on the short_base_name, not base_name.
16526 * tests/suite.at (Checking output file names): Adjust.
16528 2000-12-20 Akim Demaille <akim@epita.fr>
16530 * src/bison.s1: Remove, we now use directly...
16531 * src/bison.simple: this.
16532 * src/Makefile.am: Use pkgdata instead of data.
16534 2000-12-20 Akim Demaille <akim@epita.fr>
16536 * src/files.c (guard_obstack): New.
16537 (open_files): Initialize it.
16538 (output_files): Dump it...
16539 * src/files.h: Export it.
16540 * src/reader.c (copy_guard): Use it.
16542 2000-12-19 Akim Demaille <akim@epita.fr>
16544 * src/files.c (outfile, defsfile, actfile): Removed as global
16546 (open_files): Don't compute them.
16547 (output_files): Adjust.
16548 (base_name, short_base_name): Be global.
16549 Adjust dependencies.
16551 2000-12-19 Akim Demaille <akim@epita.fr>
16553 * src/files.c (strsuffix): New.
16554 (stringappend): Be just like strcat but allocate.
16555 (base_names): Eve out from open_files.
16556 Try to simplify the rather hairy computation of base_name and
16558 (open_files): Use it.
16559 * tests/suite.at (Checking output file names): New test.
16561 2000-12-19 Akim Demaille <akim@epita.fr>
16563 * src/system.h (obstack_grow_literal_string): Rename as...
16564 (obstack_grow_string): this.
16565 * src/output.c (output_parser): Recognize `%% actions' instead of
16567 * src/bison.s1: s/$/%% actions/.
16568 * src/bison.hairy: Likewise.
16570 2000-12-19 Akim Demaille <akim@epita.fr>
16572 * src/output.c (output_parser): Compute the `#line' lines when
16574 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16575 Suggested by Hans Aberg.
16577 2000-12-19 Akim Demaille <akim@epita.fr>
16579 Let the handling of the skeleton files be local to the procedures
16582 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16584 (fparser, open_extra_files): Remove.
16585 (open_files, output_files): Don't take care of fparser.
16586 * src/files.h: Adjust.
16587 * src/output.c (output_parser): Open and close the file to the
16589 * src/reader.c (read_declarations): When %semantic_parser, open
16592 2000-12-19 Akim Demaille <akim@epita.fr>
16594 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16595 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16597 2000-12-19 Akim Demaille <akim@epita.fr>
16599 * src/files.c (open_files): Yipee! We no longer need all the code
16600 looking for `/tmp' since we have no tmp file.
16602 2000-12-19 Akim Demaille <akim@epita.fr>
16604 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16606 * src/files.c (open_files): Less dependency on MSDOS etc.
16608 2000-12-14 Akim Demaille <akim@epita.fr>
16610 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16611 Provide a default definition.
16612 Use it when executing the default @ action.
16613 * src/reader.c (reader_output_yylsp): No longer include
16614 `timestamp' and `text' in the default YYLTYPE.
16616 2000-12-12 Akim Demaille <akim@epita.fr>
16618 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16619 (copy_guard): Quote the file names.
16620 Reported by Laurent Mascherpa.
16622 2000-12-12 Akim Demaille <akim@epita.fr>
16624 * src/output.c (output_headers, output_program, output): Be sure
16625 to escape special characters when outputting filenames.
16626 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16627 (output_headers): Don't depend on them, Use ACTSTR.
16629 2000-11-17 Akim Demaille <akim@epita.fr>
16631 * lib/obstack.h: Formatting changes.
16632 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16633 prevents type checking.
16634 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16635 cast the value to (void *): assigning a `foo *' to a `void *'
16637 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16638 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16641 2000-11-17 Akim Demaille <akim@epita.fr>
16643 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16645 (suite.m4, regression.m4, calc.m4): these.
16646 * tests/atgeneral.m4: Update from CVS Autoconf.
16648 2000-11-17 Akim Demaille <akim@epita.fr>
16650 * tests/regression.m4 (%union and --defines): New test,
16651 demonstrating a current bug in the obstack implementation.
16653 2000-11-17 Akim Demaille <akim@epita.fr>
16655 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16657 Use them to declare the variables which are global or local to
16660 2000-11-17 Akim Demaille <akim@epita.fr>
16662 * acconfig.h: Remove, no longer used.
16664 2000-11-07 Akim Demaille <akim@epita.fr>
16666 * src: s/Copyright (C)/Copyright/g.
16668 2000-11-07 Akim Demaille <akim@epita.fr>
16670 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16672 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16674 2000-11-07 Akim Demaille <akim@epita.fr>
16676 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16677 Merge in a single CPP if/else.
16679 2000-11-07 Akim Demaille <akim@epita.fr>
16681 * src/output.c (output): Remove useless variables.
16682 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16683 argument `data' for consistency with the prototypes.
16684 Qualify it `const'.
16685 (obstack_copy, obstack_copy0): Rename the second argument as
16686 `address' for consistency. Qualify it `const'.
16687 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16688 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16689 `const' their input argument (`data' or `address').
16690 Adjust the corresponding macros to include `const' in casts.
16692 2000-11-03 Akim Demaille <akim@epita.fr>
16694 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16695 s/PFILE1/BISON_HAIRY/.
16696 Adjust dependencies.
16698 2000-11-03 Akim Demaille <akim@epita.fr>
16700 For some reason, this was not applied.
16702 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16703 `unlink': it's no longer used.
16705 2000-11-03 Akim Demaille <akim@epita.fr>
16707 * src/files.c (skeleton_find): New function, eved out of...
16708 (open_files, open_extra_files): here.
16710 2000-11-03 Akim Demaille <akim@epita.fr>
16712 Don't use `atexit'.
16714 * src/files.c (obstack_save): New function.
16715 (done): Rename as...
16716 (output_files): this.
16717 Use `obstack_save'.
16718 * src/main.c (main): Don't use `atexit' to register `done', since
16719 it no longer has to remove tmp files, just call `output_files'
16720 when there are no errors.
16722 2000-11-02 Akim Demaille <akim@epita.fr>
16724 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16725 `unlink': it's no longer used.
16726 * src/files.h: Formatting changes.
16728 2000-11-02 Akim Demaille <akim@epita.fr>
16730 Remove the last uses of mktemp and unlink/delete.
16732 * src/files.c (fdefines, ftable): Removed.
16733 (defines_ostack, table_obstack): New.
16734 Adjust dependencies of the former into uses of the latter.
16735 * src/output.c (output_short_or_char_table, output_short_table):
16736 Convert to using obstacks.
16737 * src/reader.c (copy_comment2): Accept one FILE * and two
16739 (output_token_defines, reader_output_yylsp): Use obstacks.
16740 * src/system.h (obstack_fgrow3): New.
16741 * po/POTFILES.in: Adjust.
16743 2000-11-01 Akim Demaille <akim@epita.fr>
16745 Change each use of `fattrs' into a use of `attrs_obstack'.
16747 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16748 * src/files.c (fattrs): Remove.
16749 (attrs_obstack): New.
16750 Adjust all dependencies.
16751 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16753 2000-11-01 Akim Demaille <akim@epita.fr>
16755 Introduce obstacks.
16756 Change each use of `faction' into a use of `action_obstack'.
16758 * lib/obstack.h, lib/obstack.c: New files.
16759 * src/files.c (faction): Remove.
16760 (action_obstack): New.
16761 Adjust all dependencies.
16763 2000-10-20 Akim Demaille <akim@epita.fr>
16765 * lib/quote.h (PARAMS): New macro. Use it.
16767 2000-10-16 Akim Demaille <akim@epita.fr>
16769 * src/output.c (output_short_or_char_table): New function.
16770 (output_short_table, output_token_translations): Use it.
16771 (goto_actions): Use output_short_table.
16773 2000-10-16 Akim Demaille <akim@epita.fr>
16775 * src/symtab.c (bucket_new): New function.
16778 * src/output.c (output_short_table): New argument to display the
16779 comment associated with the table.
16780 Adjust dependencies.
16781 (output_gram): Use it.
16782 (output_rule_data): Nicer output layout for YYTNAME.
16784 2000-10-16 Akim Demaille <akim@epita.fr>
16786 * src/lex.c (read_typename): New function.
16788 * src/reader.c (copy_dollar): Likewise.
16790 2000-10-16 Akim Demaille <akim@epita.fr>
16792 * src/reader.c (copy_comment2): Expect the input stream to be on
16793 the `/' which is suspected to open a comment, instead of being
16794 called after `//' or `/*' was read.
16795 (copy_comment, copy_definition, parse_union_decl, copy_action)
16796 (copy_guard): Adjust.
16798 2000-10-16 Akim Demaille <akim@epita.fr>
16800 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16801 `read_signed_integer'.
16803 2000-10-16 Akim Demaille <akim@epita.fr>
16805 * src/reader.c (copy_dollar): New function.
16806 (copy_guard, copy_action): Use it.
16808 2000-10-16 Akim Demaille <akim@epita.fr>
16810 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16811 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16812 New files, from Fileutils 4.0.27.
16813 * src/main.c (printable_version): Remove.
16814 * src/lex.c, src/reader.c: Use `quote'.
16816 2000-10-04 Akim Demaille <akim@epita.fr>
16818 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16820 2000-10-04 Akim Demaille <akim@epita.fr>
16822 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16824 2000-10-04 Akim Demaille <akim@epita.fr>
16826 When a literal string is used to define two different tokens,
16827 `bison -v' segfaults.
16828 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16830 * tests/regression.m4: New file.
16831 Include the core of the sample provided by Piotr Gackiewicz.
16832 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16835 2000-10-04 Akim Demaille <akim@epita.fr>
16837 * src/reader.c (parse_expect_decl): Keep `count' within the size
16841 2000-10-02 Paul Eggert <eggert@twinsun.com>
16843 * bison.s1 (yyparse): Assign the default value
16844 unconditionally, to avoid a GCC warning and make the parser a
16847 2000-10-02 Akim Demaille <akim@epita.fr>
16849 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16852 2000-10-02 Akim Demaille <akim@epita.fr>
16854 * src/derives.c, src/print.c, src/reduce.c: To ease the
16855 translation, move some `\n' out of the translated strings.
16857 2000-10-02 Akim Demaille <akim@epita.fr>
16859 The location tracking mechanism is precious for parse error
16860 messages. Nevertheless, it is enabled only when `@n' is used in
16861 the grammar, which is a different issue (you can use it in error
16862 message, but not in the grammar per se). Therefore, there should
16863 be another means to enable it.
16865 * src/getargs.c (getargs): Support `--locations'.
16866 (usage): Report it.
16867 * src/getargs.h (locationsflag): Export it.
16868 * src/lex.c (percent_table): Support `%locations'.
16869 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16870 with `locationsflag'.
16871 * doc/bison.texinfo: Document `--locations' and `%locations'.
16873 * tests/calc.m4: Test it.
16875 For regularity of the names, replace each
16876 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16877 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16878 In addition replace each `flag' with `_flag'.
16880 2000-10-02 Akim Demaille <akim@epita.fr>
16882 Also test parse error messages, including with YYERROR_VERBOSE.
16884 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16886 Use it to check the computations.
16887 Use it to check `nonassoc' is honored.
16888 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16889 `--yyerror-verbose'.
16890 (_AT_CHECK_CALC): Adjust to this option.
16891 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16893 2000-10-02 Akim Demaille <akim@epita.fr>
16895 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16896 the latter demonstrates a flaw in the handling of non debugging
16897 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16898 was used in order to simplify:
16914 unfortunately this leads to a CPP conflict when
16915 `--name-prefix=foo' is used since it produces `#define yydebug
16918 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16919 (YYDPRINTF): New macro.
16921 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16923 Also test `--verbose', `--defines' and `--name-prefix'.
16925 2000-10-02 Akim Demaille <akim@epita.fr>
16927 Improve the readability of the produced parsers.
16929 * src/bison.s1: Formatting changes.
16930 Improve the comment related to the `$' mark.
16931 (yydefault): Don't fall through to `yyresume': `goto' there.
16932 * src/output.c (output_parser): When the `$' is met, skip the end
16934 New variable, `number_of_dollar_signs', to check there's exactly
16935 one `$' in the parser skeleton.
16937 2000-10-02 Akim Demaille <akim@epita.fr>
16939 * lib/xstrdup.c: New file, from the fileutils.
16940 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16941 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16942 instead of strlen + xmalloc + strcpy.
16943 * src/symtab.c (copys): Remove, use xstrdup instead.
16945 2000-10-02 Akim Demaille <akim@epita.fr>
16947 * src/gram.h (associativity): New enum type which replaces the
16948 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16949 `right_assoc', `left_assoc' and `non_assoc'.
16950 Adjust all dependencies.
16951 * src/reader.c: Formatting changes.
16952 (LTYPESTR): Don't define it, use it as a literal in
16953 `reader_output_yylsp'.
16954 * src/symtab.h (symbol_class): New enum type which replaces the
16955 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16956 `sunknown', `stoken and `snterm'.
16958 2000-10-02 Akim Demaille <akim@epita.fr>
16960 * src/getargs.c (fixed_outfiles): Rename as...
16961 (yaccflag): for consistency and accuracy.
16962 Adjust dependencies.
16964 2000-10-02 Akim Demaille <akim@epita.fr>
16966 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16967 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16968 difficult and introduced a lot of core dump. It turns out that
16969 Bison used an implementation of `xmalloc' based on `calloc', and
16970 at various places it does depend upon the initialization to 0. I
16971 have not tried to isolate the pertinent places, and all the former
16972 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16973 someone should address this issue.
16975 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16976 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16978 Adjust dependencies.
16979 * src/warshall.h: New file.
16982 2000-10-02 Akim Demaille <akim@epita.fr>
16984 Various anti-`extern in *.c' changes.
16986 * src/system.h: Include `assert.h'.
16988 2000-10-02 Akim Demaille <akim@epita.fr>
16990 * src/state.h (nstates, final_state, first_state, first_shift)
16991 (first_reduction): Move their exportation from here...
16992 * src/LR0.h: to here.
16993 Adjust dependencies.
16994 * src/getargs.c (statisticsflag): New variable.
16995 Add support for `--statistics'.
16996 Adjust dependencies.
16998 Remove a lot of now useless `extern' statements in most files.
17000 2000-10-02 Akim Demaille <akim@epita.fr>
17002 * src/LR0.h: New file.
17005 2000-10-02 Akim Demaille <akim@epita.fr>
17007 * src/print.h: New file.
17009 * src/print.c: Formatting and ordering changes.
17010 (verbose, terse): Replace with...
17011 (print_results): this new function.
17012 Adjust dependencies.
17014 2000-10-02 Akim Demaille <akim@epita.fr>
17016 * src/conflicts.c (conflict_report): New function.
17017 (conflict_log, verbose_conflict_log): Replace with...
17018 (print_conflicts): this function.
17019 Adjust dependencies.
17020 * src/conflicts.h: New file.
17021 Propagate its inclusion.
17023 2000-10-02 Akim Demaille <akim@epita.fr>
17025 * src/nullable.h: New file.
17026 Propagate its inclusion.
17027 * src/nullable.c: Formatting changes.
17029 2000-10-02 Akim Demaille <akim@epita.fr>
17031 * src/reduce.h: New file.
17032 Propagate its inclusion.
17033 * src/reduce.c: Topological sort and other formatting changes.
17034 (bool, TRUE, FALSE): Move their definition to...
17035 * src/system.h: here.
17037 2000-10-02 Akim Demaille <akim@epita.fr>
17039 * src/files.c: Formatting changes.
17040 (tryopen, tryclose, openfiles): Rename as...
17041 (xfopen, xfclose, open_files): this.
17042 (stringappend): static.
17043 * src/files.h: Complete the list of exported symbols.
17046 2000-10-02 Akim Demaille <akim@epita.fr>
17048 * src/reader.h: New file.
17049 Propagate its use instead of tedious list of `extern' and
17051 * src/reader.c: Formatting changes, topological sort,
17054 2000-10-02 Akim Demaille <akim@epita.fr>
17056 * src/lex.h: Prototype `lex.c' exported functions.
17057 * src/reader.c: Adjust.
17058 * src/lex.c: Formatting changes.
17059 (safegetc): Rename as...
17062 2000-10-02 Akim Demaille <akim@epita.fr>
17064 * src/lalr.h: New file.
17065 Propagate its inclusion instead of prototypes and `extern'.
17066 * src/lalr.c: Formatting changes, topological sorting etc.
17068 2000-10-02 Akim Demaille <akim@epita.fr>
17070 * src/output.c (token_actions): Introduce a temporary array,
17071 YYDEFACT, that makes it possible for this function to use
17072 output_short_table.
17074 2000-10-02 Akim Demaille <akim@epita.fr>
17076 `user_toknums' is output as a `short[]' in `output.c', while it is
17077 defined as a `int[]' in `reader.c'. For consistency with the
17078 other output tables, `user_toknums' is now defined as a table of
17081 * src/reader.c (user_toknums): Be a short table instead of an int
17083 Adjust dependencies.
17085 Factor the short table outputs.
17087 * src/output.c (output_short_table): New function.
17088 * src/output.c (output_gram, output_stos, output_rule_data)
17089 (output_base, output_table, output_check): Use it.
17091 2000-10-02 Akim Demaille <akim@epita.fr>
17093 * src/output.c (output): Topological sort of the functions, in
17094 order to get rid of the `static' prototypes.
17095 No longer use `register'.
17096 * src/output.h: New file.
17097 Propagate its inclusion in files explicitly prototyping functions
17100 2000-09-21 Akim Demaille <akim@epita.fr>
17102 * src/atgeneral.m4: Update from Autoconf.
17104 2000-09-21 Akim Demaille <akim@epita.fr>
17106 * src/closure.h: New file.
17107 * src/closure.c: Formatting changes, topological sort over the
17108 functions, use of closure.h.
17109 (initialize_closure, finalize_closure): Rename as...
17110 (new_closure, free_closure): these. Adjust dependencies.
17111 * src/LR0.c: Formatting changes, topological sort, use of
17113 (initialize_states): Rename as...
17114 (new_states): this.
17115 * src/Makefile.am (noinst_HEADERS): Adjust.
17117 2000-09-20 Akim Demaille <akim@epita.fr>
17119 * src/acconfig.h: Don't protect config.h against multiple
17121 Don't define PARAMS.
17122 * src/system.h: Define PARAMS.
17123 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
17124 purpose of config.h. system.h must not try to fix wrong
17125 definitions in config.h.
17127 2000-09-20 Akim Demaille <akim@epita.fr>
17129 * src/derives.h: New file.
17130 * src/main.c, src/derives.h: Use it.
17131 Formatting changes.
17132 * src/Makefile.am (noinst_HEADERS): Adjust.
17134 2000-09-20 Akim Demaille <akim@epita.fr>
17136 * tests/atgeneral.m4: Update from Autoconf.
17137 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
17138 (AT_CHECK_CALC): New macros.
17139 Use these macros to test bison with options `', `--raw',
17140 `--debug', `--yacc', `--yacc --debug'.
17142 2000-09-19 Akim Demaille <akim@epita.fr>
17144 * src/output.c: Formatting changes.
17145 * src/machine.h: Remove, leaving its contents in...
17146 * src/system.h: here.
17148 Adjust all dependencies on stdio.h and machine.h.
17149 * src/getargs.h: New file.
17150 Let all `extern' declarations about getargs.c be replaced with
17151 inclusion of `getargs.h'.
17152 * src/Makefile.am (noinst_HEADERS): Adjust.
17154 * tests/calc.m4 (yyin): Be initialized in main, not on the global
17156 (yyerror): Returns void, not int.
17157 * doc/bison.texinfo: Formatting changes.
17159 2000-09-19 Akim Demaille <akim@epita.fr>
17161 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
17164 2000-09-18 Akim Demaille <akim@epita.fr>
17166 * configure.in: Append WARNING_CFLAGS to CFLAGS.
17167 * src/Makefile.am (INCLUDES): Don't.
17168 Be ready to fetch headers in lib/.
17170 2000-09-18 Akim Demaille <akim@epita.fr>
17172 * doc/bison.texinfo: Update the copyright.
17173 ANSIfy and GNUify the examples.
17174 Remove the old menu.
17176 2000-09-18 Akim Demaille <akim@epita.fr>
17178 First set of tests: use the `calc' example from the documentation.
17180 * src/bison.s1 (yyparse): Condition the code using `yytname' which
17181 is defined only when YYDEBUG is.
17182 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
17183 * src/files.c (tryopen, tryclose): Formatting changes.
17184 Move to the top and be static.
17185 * src/reader.c (read_signed_integer): Likewise.
17186 * tests/calc.m4: New file.
17187 * Makefile.am, suite.m4: Adjust.
17188 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
17190 2000-09-18 Akim Demaille <akim@epita.fr>
17192 Add support for an Autotest test suite for Bison.
17194 * m4/m4.m4, m4/atconfig.m4: New files.
17195 * m4/Makefile.am (EXTRA_DIST): Adjust.
17196 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
17198 * src/getargs.c: Display a more standard --version message.
17199 * src/reader.c (reader): Formatting changes.
17200 No longer depend upon VERSION_STRING.
17201 * configure.in: No longer use `dnl'.
17202 Set up the test suite and the new directory `tests/.
17203 (VERSION_STRING): Remove.
17205 2000-04-14 Akim Demaille <akim@epita.fr>
17207 * src/reader.c (copy_comment2): New function, same as former
17208 `copy_comment', but outputs into two FILE *.
17209 (copy_comment): Use it.
17210 (parse_union_decl): Use it.
17211 (get_type, parse_start_decl): Use the same `invalid' message.
17212 (parse_start_decl, parse_union_decl): Use the same `multiple'
17214 (parse_union_decl, copy_guard, copy_action): Use the same
17215 `unmatched' message.
17216 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
17218 2000-03-31 Akim Demaille <akim@epita.fr>
17220 * src/files.c (tryopen, tryclose): Move to the top.
17223 2000-03-31 Akim Demaille <akim@epita.fr>
17225 * src/main.c (main): Don't call `done', exit does it.
17227 2000-03-31 Akim Demaille <akim@epita.fr>
17229 * allocate.c: s/return (foo)/return foo/.
17230 * lalr.c: Likewise.
17232 * output.c: Likewise.
17233 * reader.c: Likewise.
17234 * symtab.c: Likewise.
17235 * vmsgetargs.c: Likewise.
17237 2000-03-31 Akim Demaille <akim@epita.fr>
17239 Clean up the error reporting functions.
17241 * src/report.c: New file.
17242 * src/report.h: Likewise.
17243 * src/Makefile.am: Adjust.
17244 * m4/error.m4: New file.
17245 * m4/Makefile.am: Adjust.
17246 * configure.in (jm_PREREQ_ERROR): Call it.
17247 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
17249 (fatal, fatals): Remove. All callers use complain.c::fatal.
17250 (warn, warni, warns, warnss, warnss): Remove. All callers use
17251 complain.c::complain.
17252 (toomany): Remove, use fatal instead.
17253 * src/files.c (done): No argument, use complain_message_count.
17254 * src/main.c (main): Register `done' to `atexit'.
17256 * src/getargs.c (usage): More `fputs', less `fprintf'.
17258 2000-03-28 Akim Demaille <akim@epita.fr>
17260 * lib/: New directory.
17261 * Makefile.am (SUBDIRS): Adjust.
17262 * configure.in: Adjust.
17263 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
17265 * src/alloca.c: Moved to lib/.
17266 * src/getopt.c: Likewise.
17267 * src/getopt1.c: Likewise.
17268 * src/getopt.h: Likewise.
17269 * src/ansi2knr.c: Likewise.
17270 * src/ansi2knr.1: Likewise.
17271 * src/Makefile.am: Adjust.
17272 * lib/Makefile.am: New file.
17274 2000-03-28 Akim Demaille <akim@epita.fr>
17276 * src/getargs.c (usage): Refresh the help message.
17278 2000-03-17 Akim Demaille <akim@epita.fr>
17280 * src/getopt1.c: Updated from textutils 2.0e
17281 * src/getopt.c: Likewise.
17282 * src/getopt.h: Likewise.
17284 2000-03-17 Akim Demaille <akim@epita.fr>
17286 * src/Makefile.am (bison.simple): Fix the awk program: quote only
17287 the file name, not the whole `#line LINE FILE'.
17289 2000-03-17 Akim Demaille <akim@epita.fr>
17291 On syntax errors, report the token on which we choked.
17293 * src/bison.s1 (yyparse): In the label yyerrlab, when
17294 YYERROR_VERBOSE, add yychar in msg.
17296 2000-03-17 Akim Demaille <akim@epita.fr>
17298 * src/reader.c (copy_at): New function.
17299 (copy_guard): Use it.
17300 (copy_action): Use it.
17302 2000-03-17 Akim Demaille <akim@epita.fr>
17304 Be kind to translators, save some useless translations.
17306 * src/main.c (banner): New function.
17307 (fatal_banner): Use it.
17308 (warn_banner): Use it.
17310 2000-03-17 Akim Demaille <akim@epita.fr>
17312 * src/reader.c (copy_definition): Use copy_string and
17313 copy_comment. Removed now unused `match', `ended',
17315 (copy_comment, copy_string): Moved, to be visible from
17318 2000-03-17 Akim Demaille <akim@epita.fr>
17320 * src/reader.c (copy_string): Declare `static inline'. No
17321 problems with inline, since it is checked by configure.
17322 (copy_comment): Likewise.
17324 2000-03-17 Akim Demaille <akim@epita.fr>
17326 * src/reader.c (packsymbols): Formatting changes.
17328 2000-03-17 Akim Demaille <akim@epita.fr>
17330 * src/reader.c (copy_comment): New function, factored out from:
17331 (copy_action): Use it. Removed now unused `match', `ended',
17333 (copy_guard): Likewise.
17335 2000-03-17 Akim Demaille <akim@epita.fr>
17337 * src/reader.c (copy_string): New function, factored out from:
17338 (copy_action): Use it.
17339 (copy_guard): Likewise.
17341 2000-03-17 Akim Demaille <akim@epita.fr>
17343 Change the handling of @s so that they behave exactly like $s.
17344 There is now a pseudo variable @$ (readble and writable), location
17345 of the lhs of the rule (by default ranging from the location of
17346 the first symbol of the rhs, to the location of the last symbol,
17347 or, if the rhs is empty, YYLLOC).
17349 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
17351 (yyparse): When providing a default semantic action, provide a
17352 default location action.
17353 (after the $): No longer change `*YYLSP', just stack YYLOC the
17354 same way you stack YYVAL.
17355 * src/reader.c (read_declarations): Use warns.
17356 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
17357 (copy_action, case '@'): Likewise.
17358 Use a standard error message, to save useless work from
17361 2000-03-17 Akim Demaille <akim@epita.fr>
17363 * src/bison.s1: Formatting and cosmetics changes.
17364 * src/reader.c: Likewise.
17365 Update the Copyright notice.
17367 2000-03-17 Akim Demaille <akim@epita.fr>
17369 * src/bison.s1 (#line): All set to `#line' only, since the
17370 Makefile now handles them.
17372 2000-03-16 Akim Demaille <akim@epita.fr>
17374 * src/output.c (output_rule_data): Output the documentation of
17375 some of the tables.
17376 (Copyright notice): Update.
17377 Formatting changes.
17379 2000-03-16 Akim Demaille <akim@epita.fr>
17381 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
17382 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
17383 One `#if YYDEBUG' remains, since it uses variables which are
17384 defined only if `YYDEBUG != 0'.
17386 2000-03-16 Akim Demaille <akim@epita.fr>
17388 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
17389 and related variables so that the similarities are highlighted.
17391 2000-03-16 Akim Demaille <akim@epita.fr>
17393 * src/bison.s1: Properly indent CPP directives.
17395 2000-03-16 Akim Demaille <akim@epita.fr>
17397 * src/bison.s1: Properly indent the `alloca' CPP section.
17399 2000-03-16 Akim Demaille <akim@epita.fr>
17401 Do not hard code values of directories in `configure.in'.
17402 Update the `configure' tool chain.
17404 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
17406 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
17407 (AC_OUTPUT): Add m4/Makefile.
17408 Bump to bison 1.28a, 1.29 has never been released.
17409 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
17410 handled via src/Makefile.am.
17411 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
17412 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
17414 * Makefile.am (SUBDIRS): Add m4.
17415 (ACLOCAL_AM_FLAGS): New variable.
17416 (AUTOMAKE_OPTIONS): Add check-news.
17417 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
17418 the proper line number and file name.
17419 (DEFS): Propagate the location of bison library files and of the
17421 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
17423 * acinclude.m4: Remove, replaced by the directory m4.
17424 * m4/Makefile.am (EXTRA_DIST): New variable.
17425 * m4/gettext.m4: New file, from the fileutils.
17426 * m4/lcmessage.m4: Likewise
17427 * m4/progtest.m4: Likewise.
17428 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
17430 2000-03-10 Akim Demaille <akim@epita.fr>
17433 Formatting changes of various comments.
17434 Respect the GNU coding standards at various places.
17435 Don't use `_()' when no translation is needed.
17437 1999-12-13 Jesse Thilo <jthilo@gnu.org>
17440 OS/2 honors TMPDIR environment variable.
17442 1999-12-13 Jesse Thilo <jthilo@gnu.org>
17444 * doc/bison.texinfo: Tweaked spelling and grammar.
17446 Removed reference to price of printed copy.
17447 Mention BISON_SIMPLE and BISON_HAIRY.
17449 1999-12-13 Jesse Thilo <jthilo@gnu.org>
17451 * configure.in, NEWS:
17452 Bison 1.29 released.
17454 1999-10-27 Jesse Thilo <jthilo@gnu.org>
17456 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
17457 Added reference card.
17459 1999-07-26 Jesse Thilo <jthilo@gnu.org>
17461 * po/ru.po: Added Russian translation.
17463 1999-07-26 Jesse Thilo <jthilo@gnu.org>
17465 * configure.in: Added Russian translation.
17467 1999-07-06 Jesse Thilo <jthilo@gnu.org>
17469 * configure.in, NEWS, README:
17470 Released version 1.28.
17472 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17475 Squashed redefinition warning on some systems.
17477 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
17478 Have configure build version string instead of relying on ANSI string
17481 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17483 * po/POTFILES.in: Got rid of version.c.
17485 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17487 * acconfig.h, configure.in:
17488 Have configure build version string instead of relying on ANSI string
17491 1999-06-08 Jesse Thilo <jthilo@gnu.org>
17494 Dropped mention of `+' for long-named options.
17496 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17498 * src/files.c: Added <unistd.h> for unlink().
17500 * src/Makefile.am, src/system.h:
17503 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17505 * README: Added a FAQ list.
17507 * configure.in, acconfig.h:
17510 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17512 * doc/FAQ, doc/Makefile.am:
17515 1999-05-19 Jesse Thilo <jthilo@gnu.org>
17517 * src/alloc.h, src/symtab.h, src/version.c:
17518 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17520 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17522 * src/.cvsignore, src/Makefile.am:
17523 Reorganized: sources in `src', documentation in `doc'.
17525 * src/lex.c (literalchar):
17526 fixed the code for escaping double quotes (thanks
17529 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17531 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17532 Adjusted paths to reflect directory reorganization.
17534 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17536 * doc/.cvsignore, doc/Makefile.am:
17537 Reorganized: sources in `src', documentation in `doc'.
17539 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17542 Updated AC_INIT file to reflect directory reorganization.
17544 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17545 Reorganized: sources in `src', documentation in `doc'.
17547 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17550 Don't declare calloc() and realloc() if not necessary.
17552 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17554 * configure.in, acconfig.h, acinclude.m4:
17555 Don't declare calloc() and realloc() if not necessary.
17557 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17559 * po/.cvsignore: Added i18n support.
17561 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17563 * acconfig.h, configure.in, Makefile.am:
17564 Added i18n support.
17566 1999-03-22 Jesse Thilo <jthilo@gnu.org>
17568 * src/bison.s1: Fixed #line numbers.
17570 1999-03-15 Jesse Thilo <jthilo@gnu.org>
17572 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17573 Added PO files from Translation Project.
17575 1999-03-03 Jesse Thilo <jthilo@gnu.org>
17578 Added support for non-ANSI compilers (ansi2knr).
17580 1999-02-16 Jesse Thilo <jthilo@gnu.org>
17582 * configure.in: Bumped version number to 1.27.
17585 Added `bison.simple' to list of files removed by `make distclean'.
17587 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17589 * src/files.c, src/files.h:
17590 Defined locations of parser files in config.h instead of Makefile.
17592 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17594 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17595 Defined locations of parser files in config.h instead of Makefile.
17597 1999-02-09 Jesse Thilo <jthilo@gnu.org>
17600 Removed inappropriate use of $< macro.
17602 1999-02-05 Jesse Thilo <jthilo@gnu.org>
17604 * po/Makefile.in.in, po/POTFILES.in:
17605 Add `po' directory skeleton.
17607 1999-01-27 Jesse Thilo <jthilo@gnu.org>
17609 * README: Document help-bison list.
17611 * configure.in: Add check for mkstemp().
17613 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17615 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17616 Hush a few compiler warnings.
17619 Add tryclose(), which verifies that fclose was successful.
17620 Hush a couple of compiler warnings.
17622 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17624 * Makefile.am, OChangeLog:
17625 ChangeLog is now automatically generated. Include the old version as
17628 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17630 * 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:
17631 Update FSF address.
17633 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17635 * doc/bison.texinfo: Fix formatting glitch.
17637 * doc/bison.texinfo: Update FSF address.
17639 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17641 * acconfig.h: Update FSF address.
17643 1999-01-08 Jesse Thilo <jthilo@gnu.org>
17646 Don't define PACKAGE here, since config.h defines it.
17648 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17650 * src/reader.c: Update copyright date.
17653 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17654 favor of output directly to stderr (avoids buffer overruns).
17656 * src/reader.c: Some checks for premature EOF.
17658 * 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:
17659 Use prototypes if the compiler understands them.
17661 * src/files.c: Honor TMPDIR on Unix hosts.
17662 Use prototypes if the compiler understands them.
17665 Fix a couple of buffer overrun bugs.
17666 Use prototypes if the compiler understands them.
17668 * src/system.h: Include unistd.h and ctype.h.
17669 Use #ifdef instead of #if for NLS symbols.
17671 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17673 * doc/bison.texinfo:
17674 Delete comment "consider using @set for edition number, etc..." since
17675 we now are doing so.
17677 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17680 Use prototypes if the compiler understands them.
17682 * NEWS: Document 1.26 highlights.
17684 * Makefile.am: Require Automake 1.3 or later.
17687 Use prototypes if the compiler understands them.
17689 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17692 Use VERSION symbol from automake for version number.
17694 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17696 * acconfig.h, configure.in, version.cin:
17697 Use VERSION symbol from automake for version number.
17699 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17702 Distribute original version of simple parser (bison.s1), not built
17703 version (bison.simple).
17705 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17707 * doc/bison.texinfo: Add info dir entry.
17709 * doc/bison.texinfo:
17710 Let automake put version number into documentation.
17712 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17714 * src/bison.cld, src/build.com, src/vmshlp.mar:
17715 Add non-RCS files from /gd/gnu/bison.
17717 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17720 Document the BISON_HAIRY and BISON_SIMPLE variables.
17722 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17724 * src/version.c: Build version.c automatically.
17727 Fix token numbering (used to start at 258, not 257).
17729 * src/system.h: Include config.h.
17731 * src/getargs.c: Update bug report address.
17733 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17734 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17736 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17739 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17741 * configure.in, version.cin:
17742 Build version.c automatically.
17744 * AUTHORS: Add AUTHORS file.
17746 * README: Update bug report address.
17749 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17751 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17752 Add automake stuff.
17754 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17756 * doc/bison.texinfo: Clean up some formatting.
17758 1998-05-05 Richard Stallman <rms@gnu.org>
17760 * doc/bison.texinfo:
17761 Explain better why to make a pure parser.
17763 1998-01-05 Richard Stallman <rms@gnu.org>
17765 * src/files.c (openfiles):
17766 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17767 find a temporary directory, if possible. Do not unlink files while
17770 1997-08-25 Richard Stallman <rms@gnu.org>
17772 * src/reader.c (stack_offset;):
17773 Change some warni to warns.
17775 * src/lex.c (literalchar): Use warns, not warni.
17777 1997-06-28 Richard Stallman <rms@gnu.org>
17779 * src/bison.s1: Add a Bison version comment.
17781 * src/main.c (fatal, warn, berror):
17784 1997-06-28 Richard Stallman <rms@gnu.org>
17786 * Makefile.in (bison_version): New variable.
17787 (dist): Use that variable.
17788 (bison.s1): Substitute the Bison version into bison.simple.
17790 * bison.simple: Add a Bison version comment.
17792 1997-06-18 Richard Stallman <rms@gnu.org>
17794 * src/main.c (fatal, warn, berror):
17795 Make error messages standard.
17796 (toomany): Improve error message text.
17798 * 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:
17799 new.h renamed to alloc.h.
17801 1997-06-18 Richard Stallman <rms@gnu.org>
17803 * Makefile.in: new.h renamed to alloc.h.
17805 1997-05-24 Richard Stallman <rms@gnu.org>
17807 * src/lex.c (literalchar):
17808 Fix the code for escaping \, " and '.
17810 (lex): Avoid trouble when there are many chars
17811 to discard in a char literal with just several chars in it.
17813 1997-05-17 Richard Stallman <rms@gnu.org>
17816 Use malloc, if using alloca is troublesome.
17817 (YYSTACK_USE_ALLOCA): New flag macro.
17818 Define it for some systems and compilers.
17819 (YYSTACK_ALLOC): New macro.
17820 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17821 If it was malloc'd, free it.
17823 1997-05-17 Richard Stallman <rms@gnu.org>
17826 Use malloc, if using alloca is troublesome.
17827 (YYSTACK_USE_ALLOCA): New flag macro.
17828 Define it for some systems and compilers.
17829 (YYSTACK_ALLOC): New macro.
17830 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17831 If it was malloc'd, free it.
17833 1997-04-23 Richard Stallman <rms@gnu.org>
17836 (alloca) [__hpux]: Always define as __builtin_alloca.
17838 1997-04-23 Richard Stallman <rms@gnu.org>
17841 (alloca) [__hpux]: Always define as __builtin_alloca.
17843 1997-04-22 Richard Stallman <rms@gnu.org>
17846 [__hpux]: Include alloca.h (right for HPUX 10)
17847 instead of declaring alloca (right for HPUX 9).
17849 * src/bison.s1 (__yy_memcpy):
17850 Declare arg `count' as unsigned int.
17851 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17853 1997-04-22 Richard Stallman <rms@gnu.org>
17856 [__hpux]: Include alloca.h (right for HPUX 10)
17857 instead of declaring alloca (right for HPUX 9).
17859 * bison.simple (__yy_memcpy):
17860 Declare arg `count' as unsigned int.
17861 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17863 1997-01-03 Richard Stallman <rms@gnu.org>
17865 * src/allocate.c: [__STDC__ or _MSC_VER]:
17866 Declare calloc and realloc to return void *.
17868 1997-01-02 Richard Stallman <rms@gnu.org>
17871 [_MSC_VER]: Include stdlib.h and process.h.
17872 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17874 * src/main.c (main): Return FAILURE as a value.
17875 (printable_version): Declare arg as int, not char.
17877 1997-01-02 Richard Stallman <rms@gnu.org>
17879 * Makefile.in (dist):
17880 Explicitly check for symlinks, and copy them.
17882 1996-12-19 Richard Stallman <rms@gnu.org>
17885 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17887 1996-12-18 Paul Eggert <eggert@gnu.org>
17889 * src/bison.s1 (yyparse):
17890 If __GNUC__ and YYPARSE_PARAM are both defined,
17891 declare yyparse to have a void * argument.
17893 1996-12-18 Paul Eggert <eggert@gnu.org>
17895 * bison.simple (yyparse):
17896 If __GNUC__ and YYPARSE_PARAM are both defined,
17897 declare yyparse to have a void * argument.
17899 1996-12-17 Richard Stallman <rms@gnu.org>
17901 * src/reduce.c (nbits): Add some casts.
17903 1996-08-12 Richard Stallman <rms@gnu.org>
17905 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17907 1996-08-12 Richard Stallman <rms@gnu.org>
17909 * bison.simple: Test _MSDOS as well as _MSDOS_.
17911 1996-07-31 Richard Stallman <rms@gnu.org>
17914 [__sun && __i386]: Include alloca.h.
17916 1996-07-31 Richard Stallman <rms@gnu.org>
17919 [__sun && __i386]: Include alloca.h.
17921 1996-07-30 Richard Stallman <rms@gnu.org>
17923 * src/bison.s1: Comment change.
17925 * src/bison.s1: Test _MSDOS_, not MSDOS.
17927 1996-07-30 Richard Stallman <rms@gnu.org>
17929 * bison.simple: Comment change.
17931 * bison.simple: Test _MSDOS_, not MSDOS.
17933 1996-06-01 Richard Stallman <rms@gnu.org>
17935 * 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:
17936 Insert `_' macro around many string constants.
17939 Insert `_' macro around many string constants.
17941 (main): Call setlocale, bindtextdomain and textdomain.
17943 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17944 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17945 [ENABLE_NLS]: Include libintl.h.
17946 [ENABLE_NLS] (gettext): Define.
17947 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17948 (N_, PACKAGE, LOCALEDIR): New macros.
17950 1996-06-01 Richard Stallman <rms@gnu.org>
17952 * POTFILES.in: New file.
17954 * Makefile.in (allocate.o):
17955 Define target explicitly.
17957 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17958 (LDFLAGS): Set to @LDFLAGS@.
17959 (configure): Run autoconf only if preceding `cd' succeeds.
17960 (bison.s1): Redirect output to temporary file then move the
17961 temporary to the target, rather than redirecting directly to bison.s1.
17962 (clean): Remove config.status and config.log.
17963 (distclean): Don't remove config.status here.
17965 1996-05-12 Richard Stallman <rms@gnu.org>
17968 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17970 1996-05-12 Richard Stallman <rms@gnu.org>
17973 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17975 1996-05-11 Richard Stallman <rms@gnu.org>
17977 * src/bison.s1 (__yy_memcpy):
17978 Really reorder the args, as was supposedly done on Feb 14 1995.
17979 (yyparse): Calls changed accordingly.
17981 1996-05-11 Richard Stallman <rms@gnu.org>
17983 * Makefile.in (dist): Don't use $(srcdir).
17985 * bison.simple (__yy_memcpy):
17986 Really reorder the args, as was supposedly done on Feb 14 1995.
17987 (yyparse): Calls changed accordingly.
17989 1996-01-27 Richard Stallman <rms@gnu.org>
17991 * src/output.c (output_rule_data):
17992 Test YYERROR_VERBOSE in the conditional
17993 around the definition of ttyname.
17995 1995-12-29 Richard Stallman <rms@gnu.org>
17998 Fix line numbers in #line commands.
18000 1995-12-29 Richard Stallman <rms@gnu.org>
18003 Fix line numbers in #line commands.
18005 1995-12-27 Richard Stallman <rms@gnu.org>
18007 * src/bison.s1 (YYPARSE_PARAM_DECL):
18008 In C++, make it always null.
18009 (YYPARSE_PARAM_ARG): New macro.
18010 (yyparse): Use YYPARSE_PARAM_ARG.
18012 1995-12-27 Richard Stallman <rms@gnu.org>
18014 * bison.simple (YYPARSE_PARAM_DECL):
18015 In C++, make it always null.
18016 (YYPARSE_PARAM_ARG): New macro.
18017 (yyparse): Use YYPARSE_PARAM_ARG.
18019 1995-11-29 Richard Stallman <rms@gnu.org>
18021 * doc/bison.texinfo:
18022 Describe literal string tokens, %raw, %no_lines, %token_table.
18024 1995-11-29 Daniel Hagerty <hag@gnu.org>
18026 * doc/bison.texinfo: Fixed update date
18028 1995-10-16 Richard Stallman <rms@gnu.org>
18030 * src/version.c: Version 1.25.
18032 1995-10-16 Richard Stallman <rms@gnu.org>
18034 * NEWS: *** empty log message ***
18036 1995-10-16 Richard Stallman <rms@gnu.org>
18038 * doc/bison.1, doc/bison.rnh:
18041 1995-10-15 Richard Stallman <rms@gnu.org>
18043 * src/vmsgetargs.c, src/getargs.c:
18044 Added -n, -k, and -raw switches.
18045 (noparserflag, toknumflag, rawtoknumflag): New variables.
18047 * src/symtab.h (SALIAS):
18048 New #define for adding aliases to %token.
18049 (struct bucket): Added `alias' field.
18051 * src/reduce.c (reduce_grammar):
18052 Revise error message.
18053 (print_notices): Remove final `.' from error message.
18055 * src/reader.c (reader_output_yylsp):
18057 (readgram): Use `#if 0' around code that accepted %command
18058 inside grammar rules: The documentation doesn't allow it,
18059 and it will fail since the %command processors scan for the next %.
18060 (parse_token_decl): Extended the %token
18061 declaration to allow a multi-character symbol as an alias.
18062 (parse_thong_decl): New function.
18063 (read_declarations): Added %thong declarations.
18064 (read_declarations): Handle NOOP to deal with allowing
18065 % declarations as another means to specify the flags.
18066 (readgram): Allow %prec prior to semantics embedded in a rule.
18067 (skip_to_char, read_declarations, copy_definition)
18068 (parse_token_decl, parse_start_decl, parse_type_decl)
18069 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
18070 (get_type_name, copy_guard, copy_action, readgram)
18071 (get_type, packsymbols): Revised most error messages.
18072 Changed `fatal' to `warnxxx' to avoid aborting for error.
18073 Revised and use multiple warnxxx functions to avoid using VARARGS1.
18074 (read_declarations): Improve the error message for
18075 an invalid character. Do not abort.
18076 (read_declarations, copy_guard, copy_action): Use
18077 printable_version to avoid unprintable characters in printed output.
18078 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
18079 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
18080 Allow the type of a non-terminal can be given
18081 more than once, as long as all specifications give the same type.
18084 (output_headers, output_trailers, output, output_gram)
18085 (output_rule_data): Implement noparserflag variable.
18086 Implement toknumflag variable.
18087 (output): Call reader_output_yylsp to output LTYPESTR.
18089 * src/main.c (main):
18090 If reader sees an error, don't process the grammar.
18091 (fatals): Updated to not use VARARGS1.
18092 (printable_version, int_to_string, warn, warni, warns, warnss)
18093 (warnsss): New error reporting functions. Avoid abort for error.
18096 Added THONG and NOOP for alias processing.
18097 Added SETOPT for the new code that allows setting options with %flags.
18100 Include getopt.h. Add some extern decls.
18101 (safegetc): New function to deal with EOF gracefully.
18102 (literalchar); new function to deal with reading \ escapes.
18103 (lex): Use literalchar.
18104 (lex): Implemented "..." tokens.
18105 (literalchar, lex, parse_percent_token): Made tokenbuffer
18106 always contain the token. This includes growing the token
18107 buffer while reading an integer.
18108 (parse_percent_token): Replaced if-else statement with percent_table.
18109 (parse_percent_token): Added % declarations as another
18110 way to specify the flags -n, -l, and -r. Also added hooks for
18111 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
18112 major changes to files.c.
18113 (lex) Retain in the incoming stream a character following
18115 (skip_white_space, lex): Revised most error messages
18116 and changed fatal to warn to avoid aborting.
18117 (percent_table): Added %thong declarations.
18119 * src/gram.h: Comment changes.
18121 * src/files.c (openfiles, open_extra_files, done):
18123 and actfile file. Handle noparserflag. Both for -n switch.
18125 * src/conflicts.c (resolve_sr_conflict):
18126 Remove use of alloca.
18128 1995-06-01 Jim Meyering <meyering@gnu.org>
18130 * doc/bison.texinfo: *** empty log message ***
18132 1995-05-06 Richard Stallman <rms@gnu.org>
18134 * src/bison.s1: Comment change.
18136 1995-05-06 Richard Stallman <rms@gnu.org>
18138 * bison.simple: Comment change.
18140 1995-05-03 Richard Stallman <rms@gnu.org>
18142 * src/version.c: Version now 1.24.
18144 * src/bison.s1: Change distribution terms.
18146 * src/version.c: Version now 1.23.
18148 1995-05-03 Richard Stallman <rms@gnu.org>
18150 * doc/bison.texinfo:
18151 Rewrite "Conditions for Using Bison".
18152 Update version to 1.24.
18154 1995-05-03 Richard Stallman <rms@gnu.org>
18156 * bison.simple: Change distribution terms.
18158 1995-02-23 Richard Stallman <rms@gnu.org>
18160 * src/files.c: Test __VMS_POSIX as well as VMS.
18162 1995-02-14 Jim Meyering <meyering@gnu.org>
18164 * src/bison.s1 (__yy_memcpy):
18165 Renamed from __yy_bcopy to avoid
18166 confusion. Reverse FROM and TO arguments to be consistent with
18169 1995-02-14 Jim Meyering <meyering@gnu.org>
18171 * bison.simple (__yy_memcpy):
18172 Renamed from __yy_bcopy to avoid
18173 confusion. Reverse FROM and TO arguments to be consistent with
18176 1994-11-10 David J. MacKenzie <djm@gnu.org>
18182 * Makefile.in (DISTFILES): Include NEWS.
18184 * Makefile.in (DISTFILES):
18185 Include install-sh, not install.sh.
18187 * configure.in: Update to Autoconf v2 macro names.
18189 1994-10-05 David J. MacKenzie <djm@gnu.org>
18191 * Makefile.in: fix typo
18193 * Makefile.in (prefix, exec_prefix):
18194 Let configure set them.
18196 1994-09-28 David J. MacKenzie <djm@gnu.org>
18198 * Makefile.in: Set datadir to $(prefix)/share.
18200 1994-09-15 Richard Stallman <rms@gnu.org>
18203 Update copyright notice and GPL version.
18205 1994-09-15 Richard Stallman <rms@gnu.org>
18208 Update copyright notice and GPL version.
18210 1994-07-12 Richard Stallman <rms@gnu.org>
18212 * src/reduce.c, src/reader.c:
18215 1994-05-05 David J. MacKenzie <djm@gnu.org>
18217 * Makefile.in: entered into RCS
18219 1994-03-26 Richard Stallman <rms@gnu.org>
18221 * src/bison.s1: entered into RCS
18223 1994-03-26 Richard Stallman <rms@gnu.org>
18225 * bison.simple: entered into RCS
18227 1994-03-25 Richard Stallman <rms@gnu.org>
18229 * src/main.c: entered into RCS
18231 1994-03-24 Richard Stallman <rms@gnu.org>
18233 * src/conflicts.c: entered into RCS
18235 1994-01-02 Richard Stallman <rms@gnu.org>
18237 * Makefile.in: *** empty log message ***
18239 1993-11-21 Richard Stallman <rms@gnu.org>
18241 * src/bison.s1: *** empty log message ***
18243 1993-11-21 Richard Stallman <rms@gnu.org>
18245 * doc/bison.texinfo: entered into RCS
18247 * doc/bison.texinfo: *** empty log message ***
18249 1993-11-21 Richard Stallman <rms@gnu.org>
18251 * bison.simple: *** empty log message ***
18253 1993-10-25 David J. MacKenzie <djm@gnu.org>
18255 * doc/bison.texinfo: *** empty log message ***
18257 1993-10-19 Richard Stallman <rms@gnu.org>
18259 * src/bison.s1: *** empty log message ***
18261 1993-10-19 Richard Stallman <rms@gnu.org>
18263 * bison.simple: *** empty log message ***
18265 1993-10-14 Richard Stallman <rms@gnu.org>
18267 * src/bison.s1: *** empty log message ***
18269 1993-10-14 Richard Stallman <rms@gnu.org>
18271 * bison.simple: *** empty log message ***
18273 1993-09-14 David J. MacKenzie <djm@gnu.org>
18275 * doc/bison.texinfo: *** empty log message ***
18277 1993-09-13 Noah Friedman <friedman@gnu.org>
18279 * Makefile.in: *** empty log message ***
18281 1993-09-10 Richard Stallman <rms@gnu.org>
18283 * src/conflicts.c: *** empty log message ***
18285 * src/system.h: entered into RCS
18287 1993-09-10 Richard Stallman <rms@gnu.org>
18289 * doc/bison.1: entered into RCS
18291 1993-09-06 Noah Friedman <friedman@gnu.org>
18293 * src/version.c: entered into RCS
18295 1993-09-06 Noah Friedman <friedman@gnu.org>
18297 * Makefile.in: *** empty log message ***
18299 1993-07-30 David J. MacKenzie <djm@gnu.org>
18301 * Makefile.in: *** empty log message ***
18303 1993-07-24 Richard Stallman <rms@gnu.org>
18305 * src/bison.s1: *** empty log message ***
18307 1993-07-24 Richard Stallman <rms@gnu.org>
18309 * bison.simple: *** empty log message ***
18311 1993-07-08 David J. MacKenzie <djm@gnu.org>
18313 * Makefile.in: *** empty log message ***
18315 1993-07-04 Richard Stallman <rms@gnu.org>
18317 * src/bison.s1: *** empty log message ***
18319 1993-07-04 Richard Stallman <rms@gnu.org>
18321 * bison.simple: *** empty log message ***
18323 1993-06-26 David J. MacKenzie <djm@gnu.org>
18325 * src/getargs.c: entered into RCS
18327 1993-06-26 David J. MacKenzie <djm@gnu.org>
18329 * doc/bison.texinfo: *** empty log message ***
18331 * doc/bison.1: New file.
18333 1993-06-25 Richard Stallman <rms@gnu.org>
18335 * src/getargs.c: New file.
18337 1993-06-16 Richard Stallman <rms@gnu.org>
18339 * src/bison.s1: *** empty log message ***
18341 1993-06-16 Richard Stallman <rms@gnu.org>
18343 * bison.simple: *** empty log message ***
18345 1993-06-03 Richard Stallman <rms@gnu.org>
18347 * src/bison.s1: New file.
18349 1993-06-03 Richard Stallman <rms@gnu.org>
18351 * doc/bison.texinfo: *** empty log message ***
18353 1993-06-03 Richard Stallman <rms@gnu.org>
18355 * bison.simple: New file.
18357 1993-05-19 Richard Stallman <rms@gnu.org>
18359 * doc/bison.texinfo: New file.
18361 1993-05-07 Noah Friedman <friedman@gnu.org>
18363 * Makefile.in: *** empty log message ***
18365 1993-04-28 Noah Friedman <friedman@gnu.org>
18367 * src/reader.c: *** empty log message ***
18369 1993-04-23 Noah Friedman <friedman@gnu.org>
18371 * src/alloc.h: entered into RCS
18373 1993-04-20 David J. MacKenzie <djm@gnu.org>
18375 * src/version.c: *** empty log message ***
18377 * src/files.c, src/allocate.c:
18380 * src/reader.c: *** empty log message ***
18382 * src/lex.c: entered into RCS
18384 * src/conflicts.c: New file.
18386 * src/symtab.c: entered into RCS
18388 * src/alloc.h: New file.
18390 * src/LR0.c: entered into RCS
18392 1993-04-18 Noah Friedman <friedman@gnu.org>
18394 * src/reader.c: New file.
18396 * src/version.c: *** empty log message ***
18398 1993-04-18 Noah Friedman <friedman@gnu.org>
18400 * Makefile.in: *** empty log message ***
18402 1993-04-17 Noah Friedman <friedman@gnu.org>
18404 * Makefile.in: *** empty log message ***
18406 1993-04-15 Richard Stallman <rms@gnu.org>
18408 * src/main.c, src/files.c:
18411 1993-04-15 Noah Friedman <friedman@gnu.org>
18413 * configure.in: entered into RCS
18415 * configure.in: *** empty log message ***
18417 * configure.in: New file.
18419 1993-04-14 Richard Stallman <rms@gnu.org>
18421 * Makefile.in: New file.
18423 1993-04-13 Richard Stallman <rms@gnu.org>
18425 * src/version.c: New file.
18427 1993-03-25 Richard Stallman <rms@gnu.org>
18429 * src/output.c: entered into RCS
18431 1992-09-25 Richard Stallman <rms@gnu.org>
18433 * configure.bat: entered into RCS
18435 1992-06-22 Richard Stallman <rms@gnu.org>
18437 * src/vmsgetargs.c: entered into RCS
18439 1992-06-22 Richard Stallman <rms@gnu.org>
18441 * doc/bison.rnh: entered into RCS
18443 1992-04-20 David J. MacKenzie <djm@gnu.org>
18445 * README: entered into RCS
18447 1992-01-22 Richard Stallman <rms@gnu.org>
18449 * src/machine.h: entered into RCS
18451 1991-12-21 Richard Stallman <rms@gnu.org>
18453 * src/lalr.c, src/closure.c:
18456 1991-12-20 Richard Stallman <rms@gnu.org>
18458 * src/state.h: entered into RCS
18460 1991-12-18 Richard Stallman <rms@gnu.org>
18462 * src/print.c, src/nullable.c, src/derives.c:
18465 1991-11-03 David J. MacKenzie <djm@gnu.org>
18467 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
18470 1988-09-09 Richard Stallman <rms@gnu.org>
18472 * src/bison.hairy: entered into RCS
18474 1987-12-16 Richard Stallman <rms@gnu.org>
18476 * REFERENCES: entered into RCS
18481 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
18482 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
18483 Free Software Foundation, Inc.
18485 Copying and distribution of this file, with or without
18486 modification, are permitted provided the copyright notice and this
18487 notice are preserved.